summaryrefslogtreecommitdiff
path: root/chromium
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-08-01 11:44:21 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2017-08-01 09:49:25 +0000
commit9a05d0e4db172168e429f30bc8ed62b695006490 (patch)
tree6a7a6b2f7e3410bb9ddc3ef9a200156f2bf623e1 /chromium
parent6ec7b8da05d21a3878bd21c691b41e675d74bb1c (diff)
downloadqtwebengine-chromium-9a05d0e4db172168e429f30bc8ed62b695006490.tar.gz
BASELINE: Update Chromium to 60.0.3112.78
Change-Id: I58f9d14bddb9104a666b6ef869944111ee7eadb8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium')
-rw-r--r--chromium/DEPS6
-rw-r--r--chromium/build/util/LASTCHANGE2
-rw-r--r--chromium/build/util/LASTCHANGE.blink2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/.arcconfig2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/.clang-format13
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/CMakeLists.txt368
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/CREDITS.TXT8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/LICENSE.TXT2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/Makefile56
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/NOTES.TXT28
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/TODO.TXT80
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/appveyor-reqs-install.cmd53
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/appveyor.yml78
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/CMakeLists.txt156
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/ContainerBenchmarks.hpp113
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/GenerateInput.hpp142
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/algorithms.bench.cpp62
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/filesystem.bench.cpp138
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/string.bench.cpp49
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/unordered_set_operations.bench.cpp306
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/util_smartptr.bench.cpp42
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/benchmarks/vector_operations.bench.cpp32
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CheckLibcxxAtomic.cmake47
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CodeCoverage.cmake18
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleCompilerRT.cmake58
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibCXXABI.cmake53
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibcxxFlags.cmake37
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake114
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/cmake/config-ix.cmake70
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/BuildingLibcxx.rst213
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/CMakeLists.txt4
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/AvailabilityMarkup.rst114
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/DebugMode.rst100
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/ThreadingSupportAPI.rst79
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/VisibilityMacros.rst162
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/Makefile.sphinx2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/TestingLibcxx.rst97
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/UsingLibcxx.rst110
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/conf.py6
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/docs/index.rst15
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/CMakeLists.txt40
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__bit_reference42
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__bsd_locale_defaults.h33
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__bsd_locale_fallbacks.h135
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__config751
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__config_site.in4
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__debug108
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__functional_0332
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__functional_base136
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__hash_table1239
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__libcpp_version1
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__locale66
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__mutex_base91
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__nullptr6
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__refstring188
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__split_buffer28
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__sso_allocator4
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__std_stream2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__string873
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__threading_support634
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__tree1449
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__tuple495
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/__undef_min_max8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/algorithm512
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/any667
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/array86
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/atomic131
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/bitset92
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/cctype57
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/chrono63
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/cmath116
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/codecvt6
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/complex401
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/condition_variable2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/cstddef32
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/cstdio4
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/cstdlib10
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/cstring17
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/ctype.h9
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/cwchar25
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/deque242
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/exception163
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/__config25
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/__memory90
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/algorithm62
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/any23
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/coroutine260
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/deque47
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/dynarray63
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/filesystem2139
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/forward_list47
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/functional39
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/iterator114
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/list47
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/map57
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/memory_resource422
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/numeric113
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/optional66
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/propagate_const580
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/regex62
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/set57
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/string62
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/string_view51
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/tuple3
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/type_traits111
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/unordered_map65
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/unordered_set59
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/utility2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/experimental/vector47
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/ext/__hash24
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/ext/hash_map62
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/ext/hash_set12
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/forward_list478
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/fstream160
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/functional664
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/future115
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/initializer_list6
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/inttypes.h7
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/iomanip54
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/ios31
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/iosfwd43
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/istream277
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/iterator696
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/limits25
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/limits.h65
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/list629
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/locale478
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/locale.h45
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/map674
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/math.h516
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/memory2646
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/module.modulemap571
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/mutex179
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/new149
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/numeric73
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/optional1318
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/ostream123
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/queue165
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/random177
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/ratio46
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/regex214
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/scoped_allocator93
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/set97
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/shared_mutex26
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/sstream102
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/stack60
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/stdbool.h39
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/stddef.h3
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/stdexcept116
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/stdint.h121
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/stdio.h5
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/stdlib.h4
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/streambuf320
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/string1535
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/string.h110
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/string_view787
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/strstream20
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/android/locale_bionic.h8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/fuchsia/xlocale.h23
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/ibm/locale_mgmt_aix.h85
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/ibm/xlocale.h57
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/newlib/xlocale.h44
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/solaris/xlocale.h20
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/win32/limits_msvc_win32.h (renamed from chromium/buildtools/third_party/libc++/trunk/include/support/win32/limits_win32.h)27
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/win32/locale_win32.h37
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/win32/math_win32.h117
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/win32/support.h206
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__nop_locale_mgmt.h52
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__posix_l_fallback.h165
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__strtonum_fallback.h67
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/xlocale.h194
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/system_error44
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/thread180
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/tuple578
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/type_traits1379
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/typeindex6
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/typeinfo126
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/unordered_map752
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/unordered_set159
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/utility1135
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/valarray113
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/variant1567
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/vector305
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/include/wchar.h48
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/CMakeLists.txt316
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/3.9/x86_64-apple-darwin16.abilist2448
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/3.9/x86_64-linux-gnu.abilist2010
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/4.0/x86_64-apple-darwin16.abilist2376
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/4.0/x86_64-unknown-linux-gnu.abilist1905
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/CHANGELOG.TXT186
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/CMakeLists.txt36
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/README.TXT8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/x86_64-apple-darwin16.abilist2376
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/abi/x86_64-unknown-linux-gnu.abilist1883
-rwxr-xr-xchromium/buildtools/third_party/libc++/trunk/lib/buildit179
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/libc++abi-new-delete.exp8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/lib/libc++abi2.exp8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/algorithm.cpp6
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/any.cpp9
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/bind.cpp21
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/chrono.cpp120
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/condition_variable.cpp17
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/debug.cpp100
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/exception.cpp305
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/directory_iterator.cpp323
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/operations.cpp940
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/path.cpp447
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/experimental/memory_resource.cpp143
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/functional.cpp26
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/include/atomic_support.h13
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/include/config_elast.h10
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/ios.cpp18
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/iostream.cpp52
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/locale.cpp615
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/memory.cpp106
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/mutex.cpp86
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/new.cpp239
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/optional.cpp16
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/random.cpp2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/regex.cpp18
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/stdexcept.cpp6
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/string.cpp13
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/strstream.cpp12
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_fallback.ipp182
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_glibcxx.ipp38
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_libcxxabi.ipp28
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_libcxxrt.ipp (renamed from chromium/buildtools/third_party/libc++abi/trunk/src/exception.cpp)34
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_msvc.ipp89
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_cxxabi.ipp74
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_glibcxx.ipp78
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_msvc.ipp95
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_unimplemented.ipp80
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/runtime/new_handler_fallback.ipp (renamed from chromium/buildtools/third_party/libc++/trunk/include/__undef___deallocate)25
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/solaris/xlocale.cpp (renamed from chromium/buildtools/third_party/libc++/trunk/src/support/solaris/xlocale.c)5
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/support/win32/locale_win32.cpp30
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/system_error.cpp70
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/thread.cpp72
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/typeinfo.cpp60
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/src/variant.cpp18
-rwxr-xr-xchromium/buildtools/third_party/libc++/trunk/utils/cat_files.py46
-rwxr-xr-xchromium/buildtools/third_party/libc++/trunk/utils/gen_link_script.py (renamed from chromium/buildtools/third_party/libc++/trunk/utils/gen_link_script/gen_link_script.py)33
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/AUTHORS38
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CMakeLists.txt201
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CONTRIBUTING.md58
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CONTRIBUTORS56
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/LICENSE (renamed from chromium/third_party/afl/src/docs/COPYING)0
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/README.LLVM6
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/README.md659
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake64
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/CXXFeatureCheck.cmake44
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/Config.cmake.in1
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/GetGitVersion.cmake51
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/gnu_posix_regex.cpp12
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/posix_regex.cpp14
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/std_regex.cpp10
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/steady_clock.cpp7
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/thread_safety_attributes.cpp4
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/docs/tools.md59
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/benchmark.h21
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/benchmark_api.h915
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/macros.h66
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/reporter.h230
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/mingw.py320
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/CMakeLists.txt75
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/arraysize.h33
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark.cc690
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark_api_internal.h49
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark_register.cc452
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/check.h71
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/colorprint.cc188
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/colorprint.h33
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/commandlineflags.cc218
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/commandlineflags.h79
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/complexity.cc324
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/complexity.h61
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/console_reporter.cc155
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/counter.cc68
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/counter.h26
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/csv_reporter.cc146
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/cycleclock.h172
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/internal_macros.h55
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/json_reporter.cc168
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/log.h73
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/mutex.h155
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/re.h140
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/reporter.cc68
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sleep.cc51
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sleep.h15
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/stat.h306
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/string_util.cc172
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/string_util.h40
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sysinfo.cc355
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sysinfo.h10
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/timers.cc208
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/timers.h48
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/compare_bench.py68
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json60
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json60
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/__init__.py8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/report.py144
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/util.py159
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/libcxx/__init__.py17
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/libcxx/compiler.py291
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/__init__.py17
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/diff.py (renamed from chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/diff.py)16
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/extract.py (renamed from chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/extract.py)25
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/match.py (renamed from chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/match.py)8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/util.py268
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/libcxx/util.py286
-rwxr-xr-xchromium/buildtools/third_party/libc++/trunk/utils/merge_archives.py130
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/not.py (renamed from chromium/buildtools/third_party/libc++/trunk/utils/not/not.py)9
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/__init__.py8
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/util.py128
-rwxr-xr-xchromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_diff.py47
-rwxr-xr-xchromium/buildtools/third_party/libc++/trunk/utils/sym_diff.py73
-rwxr-xr-xchromium/buildtools/third_party/libc++/trunk/utils/sym_extract.py (renamed from chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_extract.py)15
-rwxr-xr-xchromium/buildtools/third_party/libc++/trunk/utils/sym_match.py (renamed from chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_match.py)11
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/symcheck-blacklists/linux_blacklist.txt (renamed from chromium/buildtools/third_party/libc++/trunk/utils/sym_check/linux_blacklist.txt)0
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/utils/symcheck-blacklists/osx_blacklist.txt (renamed from chromium/buildtools/third_party/libc++/trunk/utils/sym_check/osx_blacklist.txt)0
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/atomic_design.html2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/atomic_design_a.html2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/atomic_design_b.html2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/atomic_design_c.html2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/cxx1y_status.html2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/cxx1z_status.html527
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/debug_mode.html162
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/index.html300
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/kona.html154
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/lit_usage.html207
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/results.Linux.html513
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/results.Windows.html487
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/ts1z_status.html16
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/type_traits_design.html2
-rw-r--r--chromium/buildtools/third_party/libc++/trunk/www/upcoming_meeting.html129
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/.arcconfig2
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/.clang-format12
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/CMakeLists.txt303
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/LICENSE.TXT2
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/cmake/Modules/HandleCompilerRT.cmake58
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/cmake/config-ix.cmake56
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/fuzz/CMakeLists.txt11
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/fuzz/cxa_demangle_fuzzer.cpp15
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h39
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/include/cxxabi.h18
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt61
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.cpp7
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.h12
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/config.h31
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_aux_runtime.cpp18
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_default_handlers.cpp18
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_demangle.cpp179
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.cpp79
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.hpp57
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception_storage.cpp33
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_guard.cpp138
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.cpp17
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.hpp12
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_new_delete.cpp262
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_noexception.cpp55
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_personality.cpp36
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_thread_atexit.cpp126
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_unexpected.cpp6
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/cxa_virtual.cpp4
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.cpp252
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.h29
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.ipp188
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.cpp73
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.h24
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_exception.cpp103
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_new_delete.cpp264
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_stdexcept.cpp (renamed from chromium/buildtools/third_party/libc++abi/trunk/src/stdexcept.cpp)0
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_typeinfo.cpp (renamed from chromium/buildtools/third_party/libc++abi/trunk/src/typeinfo.cpp)0
-rw-r--r--chromium/buildtools/third_party/libc++abi/trunk/www/index.html4
-rw-r--r--chromium/cc/base/math_util.cc6
-rw-r--r--chromium/cc/base/math_util.h3
-rw-r--r--chromium/cc/ipc/cc_param_traits_macros.h1
-rw-r--r--chromium/cc/ipc/struct_traits_unittest.cc4
-rw-r--r--chromium/cc/ipc/transferable_resource.mojom3
-rw-r--r--chromium/cc/ipc/transferable_resource_struct_traits.cc1
-rw-r--r--chromium/cc/ipc/transferable_resource_struct_traits.h5
-rw-r--r--chromium/cc/resources/resource_pool.cc13
-rw-r--r--chromium/cc/resources/resource_pool.h2
-rw-r--r--chromium/cc/resources/resource_provider.cc6
-rw-r--r--chromium/cc/resources/shared_bitmap.cc5
-rw-r--r--chromium/cc/resources/shared_bitmap.h8
-rw-r--r--chromium/cc/resources/transferable_resource.cc1
-rw-r--r--chromium/cc/resources/transferable_resource.h1
-rw-r--r--chromium/cc/trees/layer_tree_host_common.cc13
-rw-r--r--chromium/cc/trees/layer_tree_host_common_unittest.cc72
-rw-r--r--chromium/cc/trees/property_tree.cc8
-rw-r--r--chromium/chrome/VERSION2
-rw-r--r--chromium/chrome/app/resources/chromium_strings_ko.xtb2
-rw-r--r--chromium/chrome/app/resources/chromium_strings_mr.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_ar.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_ca.xtb6
-rw-r--r--chromium/chrome/app/resources/generated_resources_de.xtb10
-rw-r--r--chromium/chrome/app/resources/generated_resources_es.xtb20
-rw-r--r--chromium/chrome/app/resources/generated_resources_fa.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_hi.xtb52
-rw-r--r--chromium/chrome/app/resources/generated_resources_kn.xtb12
-rw-r--r--chromium/chrome/app/resources/generated_resources_ko.xtb10
-rw-r--r--chromium/chrome/app/resources/generated_resources_ml.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_mr.xtb10
-rw-r--r--chromium/chrome/app/resources/generated_resources_pt-BR.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_ru.xtb4
-rw-r--r--chromium/chrome/app/resources/generated_resources_sw.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_te.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_uk.xtb30
-rw-r--r--chromium/chrome/app/resources/generated_resources_vi.xtb4
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_ko.xtb2
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_mr.xtb2
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_ru.xtb2
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_sk.xtb2
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_vi.xtb2
-rw-r--r--chromium/chrome/browser/extensions/api/automation/automation_apitest.cc19
-rw-r--r--chromium/chrome/browser/printing/print_job_worker.cc14
-rw-r--r--chromium/chrome/browser/printing/print_view_manager.cc5
-rw-r--r--chromium/chrome/browser/resources/print_preview/preview_generator.js2
-rw-r--r--chromium/codereview.settings8
-rw-r--r--chromium/components/printing/renderer/print_web_view_helper.cc19
-rw-r--r--chromium/components/safe_browsing/password_protection/password_protection_service.cc17
-rw-r--r--chromium/components/safe_browsing/password_protection/password_protection_service_unittest.cc38
-rw-r--r--chromium/components/strings/components_strings_de.xtb2
-rw-r--r--chromium/components/strings/components_strings_gu.xtb2
-rw-r--r--chromium/components/strings/components_strings_hi.xtb8
-rw-r--r--chromium/components/strings/components_strings_ko.xtb2
-rw-r--r--chromium/components/strings/components_strings_mr.xtb8
-rw-r--r--chromium/components/strings/components_strings_pt-BR.xtb8
-rw-r--r--chromium/components/strings/components_strings_sk.xtb2
-rw-r--r--chromium/components/strings/components_strings_te.xtb6
-rw-r--r--chromium/components/strings/components_strings_uk.xtb4
-rw-r--r--chromium/components/strings/components_strings_vi.xtb2
-rw-r--r--chromium/components/viz/display_compositor/host_shared_bitmap_manager.cc54
-rw-r--r--chromium/components/viz/display_compositor/host_shared_bitmap_manager.h26
-rw-r--r--chromium/content/browser/renderer_host/render_message_filter.cc6
-rw-r--r--chromium/content/browser/renderer_host/render_message_filter.h5
-rw-r--r--chromium/content/browser/renderer_host/render_process_host_impl.cc21
-rw-r--r--chromium/content/browser/renderer_host/render_process_host_impl.h10
-rw-r--r--chromium/content/browser/renderer_host/render_widget_host_impl.cc35
-rw-r--r--chromium/content/browser/renderer_host/render_widget_host_impl.h14
-rw-r--r--chromium/content/browser/renderer_host/text_input_manager.cc5
-rw-r--r--chromium/content/browser/web_contents/web_contents_impl.cc10
-rw-r--r--chromium/content/browser/web_contents/web_contents_impl.h6
-rw-r--r--chromium/content/browser/web_contents/web_contents_impl_browsertest.cc76
-rw-r--r--chromium/content/common/render_message_filter.mojom2
-rw-r--r--chromium/content/public/app/mojo/content_browser_manifest.json1
-rw-r--r--chromium/content/public/browser/render_process_host.h10
-rw-r--r--chromium/content/public/browser/web_contents.h3
-rw-r--r--chromium/content/renderer/render_thread_impl.cc16
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc4
-rw-r--r--chromium/gpu/config/gpu_driver_bug_list.json14
-rw-r--r--chromium/gpu/config/gpu_driver_bug_workaround_type.h2
-rw-r--r--chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.cc46
-rw-r--r--chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.h16
-rw-r--r--chromium/skia/ext/skia_commit_hash.h2
-rw-r--r--chromium/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h5
-rw-r--r--chromium/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp4
-rw-r--r--chromium/third_party/WebKit/Source/core/input/EventHandler.cpp71
-rw-r--r--chromium/third_party/WebKit/Source/core/input/EventHandler.h4
-rw-r--r--chromium/third_party/WebKit/Source/core/input/EventHandlerTest.cpp23
-rw-r--r--chromium/third_party/WebKit/Source/core/input/MouseEventManager.cpp10
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp5
-rw-r--r--chromium/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp23
-rw-r--r--chromium/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp2
-rw-r--r--chromium/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json54
-rw-r--r--chromium/third_party/WebKit/Source/platform/animation/TimingFunction.h5
-rw-r--r--chromium/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp5
-rw-r--r--chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp19
-rw-r--r--chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp34
-rw-r--r--chromium/third_party/afl/OWNERS4
-rw-r--r--chromium/third_party/afl/README.chromium22
-rw-r--r--chromium/third_party/afl/src/Makefile153
l---------chromium/third_party/afl/src/QuickStartGuide.txt1
l---------chromium/third_party/afl/src/README1
-rw-r--r--chromium/third_party/afl/src/afl-analyze.c1063
-rw-r--r--chromium/third_party/afl/src/afl-as.c544
-rw-r--r--chromium/third_party/afl/src/afl-as.h719
-rwxr-xr-xchromium/third_party/afl/src/afl-cmin447
-rw-r--r--chromium/third_party/afl/src/afl-fuzz.c8005
-rw-r--r--chromium/third_party/afl/src/afl-gcc.c336
-rw-r--r--chromium/third_party/afl/src/afl-gotcpu.c252
-rwxr-xr-xchromium/third_party/afl/src/afl-plot166
-rw-r--r--chromium/third_party/afl/src/afl-showmap.c763
-rw-r--r--chromium/third_party/afl/src/afl-tmin.c1141
-rwxr-xr-xchromium/third_party/afl/src/afl-whatsup163
-rw-r--r--chromium/third_party/afl/src/alloc-inl.h570
-rw-r--r--chromium/third_party/afl/src/config.h345
-rw-r--r--chromium/third_party/afl/src/debug.h251
-rw-r--r--chromium/third_party/afl/src/docs/ChangeLog2541
-rw-r--r--chromium/third_party/afl/src/docs/INSTALL183
-rw-r--r--chromium/third_party/afl/src/docs/QuickStartGuide.txt49
-rw-r--r--chromium/third_party/afl/src/docs/README507
-rw-r--r--chromium/third_party/afl/src/docs/env_variables.txt249
-rw-r--r--chromium/third_party/afl/src/docs/historical_notes.txt147
-rw-r--r--chromium/third_party/afl/src/docs/life_pro_tips.txt128
-rw-r--r--chromium/third_party/afl/src/docs/notes_for_asan.txt127
-rw-r--r--chromium/third_party/afl/src/docs/parallel_fuzzing.txt216
-rw-r--r--chromium/third_party/afl/src/docs/perf_tips.txt197
-rw-r--r--chromium/third_party/afl/src/docs/sister_projects.txt298
-rw-r--r--chromium/third_party/afl/src/docs/status_screen.txt400
-rw-r--r--chromium/third_party/afl/src/docs/technical_details.txt563
-rw-r--r--chromium/third_party/afl/src/docs/visualization/afl_gzip.pngbin594870 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/experimental/README.experiments38
-rwxr-xr-xchromium/third_party/afl/src/experimental/asan_cgroups/limit_memory.sh157
-rw-r--r--chromium/third_party/afl/src/experimental/bash_shellshock/shellshock-fuzz.diff59
-rw-r--r--chromium/third_party/afl/src/experimental/canvas_harness/canvas_harness.html170
-rwxr-xr-xchromium/third_party/afl/src/experimental/clang_asm_normalize/as75
-rwxr-xr-xchromium/third_party/afl/src/experimental/crash_triage/triage_crashes.sh89
-rwxr-xr-xchromium/third_party/afl/src/experimental/distributed_fuzzing/sync_script.sh89
-rw-r--r--chromium/third_party/afl/src/experimental/libpng_no_checksum/libpng-nocrc.patch15
-rw-r--r--chromium/third_party/afl/src/experimental/persistent_demo/persistent_demo.c89
-rw-r--r--chromium/third_party/afl/src/experimental/post_library/post_library.so.c119
-rw-r--r--chromium/third_party/afl/src/experimental/post_library/post_library_png.so.c113
-rw-r--r--chromium/third_party/afl/src/hash.h104
-rw-r--r--chromium/third_party/afl/src/libdislocator/Makefile38
-rw-r--r--chromium/third_party/afl/src/libdislocator/README.dislocator60
-rw-r--r--chromium/third_party/afl/src/libdislocator/libdislocator.so.c258
-rw-r--r--chromium/third_party/afl/src/libtokencap/Makefile38
-rw-r--r--chromium/third_party/afl/src/libtokencap/README.tokencap60
-rw-r--r--chromium/third_party/afl/src/libtokencap/libtokencap.so.c253
-rw-r--r--chromium/third_party/afl/src/llvm_mode/Makefile112
-rw-r--r--chromium/third_party/afl/src/llvm_mode/README.llvm188
-rw-r--r--chromium/third_party/afl/src/llvm_mode/afl-clang-fast.c354
-rw-r--r--chromium/third_party/afl/src/llvm_mode/afl-llvm-rt.o.c298
-rw-r--r--chromium/third_party/afl/src/qemu_mode/README.qemu125
-rwxr-xr-xchromium/third_party/afl/src/qemu_mode/build_qemu_support.sh196
-rw-r--r--chromium/third_party/afl/src/qemu_mode/patches/afl-qemu-cpu-inl.h294
-rw-r--r--chromium/third_party/afl/src/qemu_mode/patches/cpu-exec.diff33
-rw-r--r--chromium/third_party/afl/src/qemu_mode/patches/elfload.diff32
-rw-r--r--chromium/third_party/afl/src/qemu_mode/patches/syscall.diff25
-rw-r--r--chromium/third_party/afl/src/qemu_mode/patches/translate-all.diff18
-rw-r--r--chromium/third_party/afl/src/test-instr.c37
-rw-r--r--chromium/third_party/afl/src/testcases/README.testcases19
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/ar/small_archive.a8
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/bzip2/small_archive.bz2bin176 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/cab/small_archive.cabbin220 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/compress/small_archive.Zbin168 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/cpio/small_archive.cpiobin512 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/gzip/small_archive.gzbin159 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/lzo/small_archive.lzobin217 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/rar/small_archive.rarbin230 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/tar/small_archive.tarbin2048 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/xz/small_archive.xzbin228 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/common/zip/small_archive.zipbin289 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/exotic/arj/small_archive.arjbin269 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/exotic/lha/small_archive.lhabin182 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/exotic/lrzip/small_archive.lrzbin260 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/exotic/lzip/small_archive.lzbin195 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/exotic/lzma/small_archive.lzmabin182 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/exotic/rzip/small_archive.rzbin262 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/archives/exotic/zoo/small_archive.zoobin336 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/bmp/not_kitty.bmpbin630 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/gif/not_kitty.gifbin198 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/ico/not_kitty.icobin367 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/jp2/not_kitty.jp2bin293 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/jpeg/not_kitty.jpgbin413 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/jxr/not_kitty.jxrbin498 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/png/not_kitty.pngbin218 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/png/not_kitty_alpha.pngbin376 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/png/not_kitty_gamma.pngbin228 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/png/not_kitty_icc.pngbin427 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/tiff/not_kitty.tiffbin448 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/images/webp/not_kitty.webpbin226 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/multimedia/h264/small_movie.mp4bin1267 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/others/js/small_script.js1
-rw-r--r--chromium/third_party/afl/src/testcases/others/pcap/small_capture.pcapbin114 -> 0 bytes
-rw-r--r--chromium/third_party/afl/src/testcases/others/pdf/small.pdf2
-rw-r--r--chromium/third_party/afl/src/testcases/others/rtf/small_document.rtf1
-rw-r--r--chromium/third_party/afl/src/testcases/others/sql/simple_queries.sql3
-rw-r--r--chromium/third_party/afl/src/testcases/others/text/hello_world.txt1
-rw-r--r--chromium/third_party/afl/src/testcases/others/xml/small_document.xml1
-rw-r--r--chromium/third_party/afl/src/types.h82
-rwxr-xr-xchromium/third_party/afl/update.py181
-rw-r--r--chromium/third_party/cros_system_api/dbus/authpolicy/active_directory_account_data.proto30
-rw-r--r--chromium/third_party/cros_system_api/dbus/authpolicy/active_directory_info.proto68
-rw-r--r--chromium/third_party/cros_system_api/dbus/authpolicy/dbus-constants.h89
-rw-r--r--chromium/third_party/cros_system_api/dbus/biod/constants.proto21
-rw-r--r--chromium/third_party/cros_system_api/dbus/biod/dbus-constants.h52
-rw-r--r--chromium/third_party/cros_system_api/dbus/biod/messages.proto18
-rw-r--r--chromium/third_party/cros_system_api/dbus/chaps/OWNERS3
-rw-r--r--chromium/third_party/cros_system_api/dbus/chaps/ck_structs.proto75
-rw-r--r--chromium/third_party/cros_system_api/dbus/cros-disks/dbus-constants.h1
-rw-r--r--chromium/third_party/cros_system_api/dbus/cryptohome/dbus-constants.h19
-rw-r--r--chromium/third_party/cros_system_api/dbus/cryptohome/rpc.proto12
-rw-r--r--chromium/third_party/cros_system_api/dbus/debugd/dbus-constants.h15
-rw-r--r--chromium/third_party/cros_system_api/dbus/login_manager/arc.proto26
-rw-r--r--chromium/third_party/cros_system_api/dbus/login_manager/dbus-constants.h42
-rw-r--r--chromium/third_party/cros_system_api/dbus/power_manager/dbus-constants.h1
-rw-r--r--chromium/third_party/cros_system_api/dbus/power_manager/switch_states.proto28
-rw-r--r--chromium/third_party/cros_system_api/dbus/service_constants.h37
-rw-r--r--chromium/third_party/cros_system_api/dbus/shill/dbus-constants.h1
-rw-r--r--chromium/third_party/cros_system_api/dbus/update_engine/dbus-constants.h6
-rw-r--r--chromium/third_party/cros_system_api/system_api.gyp106
-rw-r--r--chromium/third_party/cros_system_api/system_api.pc2
-rw-r--r--[l---------]chromium/third_party/flatbuffers/src/docs/source/CONTRIBUTING.md43
-rw-r--r--chromium/third_party/fontconfig/src/INSTALL2
-rw-r--r--chromium/third_party/fontconfig/src/Makefile.am2
-rw-r--r--chromium/third_party/fontconfig/src/README275
-rwxr-xr-xchromium/third_party/fontconfig/src/autogen.sh40
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/10-hinting-full.conf13
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/10-hinting-medium.conf13
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/10-hinting-none.conf13
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/10-hinting-slight.conf13
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/10-no-sub-pixel.conf2
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/10-scale-bitmap-fonts.conf32
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/30-metric-aliases.conf189
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/30-urw-aliases.conf13
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/45-latin.conf150
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/60-latin.conf4
-rw-r--r--chromium/third_party/fontconfig/src/conf.d/Makefile.am5
-rw-r--r--chromium/third_party/fontconfig/src/config/Makedefs.in76
-rw-r--r--chromium/third_party/fontconfig/src/config/config-subst10
-rw-r--r--chromium/third_party/fontconfig/src/config/config.guess1497
-rw-r--r--chromium/third_party/fontconfig/src/config/config.sub1608
-rw-r--r--chromium/third_party/fontconfig/src/config/install.sh240
-rw-r--r--chromium/third_party/fontconfig/src/configure.ac144
-rw-r--r--chromium/third_party/fontconfig/src/doc/Makefile.am2
-rw-r--r--chromium/third_party/fontconfig/src/doc/fccache.fncs2
-rw-r--r--chromium/third_party/fontconfig/src/doc/fccharset.fncs1
-rw-r--r--chromium/third_party/fontconfig/src/doc/fcconfig.fncs15
-rw-r--r--chromium/third_party/fontconfig/src/doc/fcdircache.fncs11
-rw-r--r--chromium/third_party/fontconfig/src/doc/fcformat.fncs1
-rw-r--r--chromium/third_party/fontconfig/src/doc/fclangset.fncs6
-rw-r--r--chromium/third_party/fontconfig/src/doc/fcpattern.fncs27
-rw-r--r--chromium/third_party/fontconfig/src/doc/fcrange.fncs75
-rw-r--r--chromium/third_party/fontconfig/src/doc/fcstrset.fncs1
-rw-r--r--chromium/third_party/fontconfig/src/doc/fcweight.fncs47
-rw-r--r--chromium/third_party/fontconfig/src/doc/fontconfig-devel.sgml25
-rw-r--r--chromium/third_party/fontconfig/src/doc/fontconfig-user.sgml23
-rw-r--r--chromium/third_party/fontconfig/src/doc/func.sgml9
-rw-r--r--chromium/third_party/fontconfig/src/fc-blanks/Makefile.am46
-rwxr-xr-xchromium/third_party/fontconfig/src/fc-blanks/fc-blanks.py156
-rw-r--r--chromium/third_party/fontconfig/src/fc-blanks/fcblanks.tmpl.h25
-rw-r--r--chromium/third_party/fontconfig/src/fc-blanks/list-unicodeset.html119
-rw-r--r--chromium/third_party/fontconfig/src/fc-cache/fc-cache.c84
-rw-r--r--chromium/third_party/fontconfig/src/fc-cache/fc-cache.sgml33
-rw-r--r--chromium/third_party/fontconfig/src/fc-case/CaseFolding.txt285
-rw-r--r--chromium/third_party/fontconfig/src/fc-case/Makefile.am3
-rw-r--r--chromium/third_party/fontconfig/src/fc-cat/fc-cat.c18
-rw-r--r--chromium/third_party/fontconfig/src/fc-cat/fc-cat.sgml2
-rw-r--r--chromium/third_party/fontconfig/src/fc-glyphname/fc-glyphname.c2
-rw-r--r--chromium/third_party/fontconfig/src/fc-lang/README28
-rw-r--r--chromium/third_party/fontconfig/src/fc-lang/fc-lang.c2
-rw-r--r--chromium/third_party/fontconfig/src/fc-lang/ja.orth4234
-rw-r--r--chromium/third_party/fontconfig/src/fc-lang/ko.orth1
-rw-r--r--chromium/third_party/fontconfig/src/fc-lang/zh_hk.orth2249
-rw-r--r--chromium/third_party/fontconfig/src/fc-query/fc-query.c28
-rw-r--r--chromium/third_party/fontconfig/src/fc-query/fc-query.sgml12
-rw-r--r--chromium/third_party/fontconfig/src/fc-scan/fc-scan.c28
-rw-r--r--chromium/third_party/fontconfig/src/fc-scan/fc-scan.sgml14
-rw-r--r--chromium/third_party/fontconfig/src/fontconfig.pc.in2
-rw-r--r--chromium/third_party/fontconfig/src/fontconfig/fcprivate.h3
-rw-r--r--chromium/third_party/fontconfig/src/fontconfig/fontconfig.h60
-rw-r--r--chromium/third_party/fontconfig/src/fonts.conf.in66
-rw-r--r--chromium/third_party/fontconfig/src/fonts.dtd2
-rw-r--r--chromium/third_party/fontconfig/src/m4/ac_check_symbol.m448
-rw-r--r--chromium/third_party/fontconfig/src/m4/ax_pthread.m476
-rw-r--r--chromium/third_party/fontconfig/src/m4/pkg.m4214
-rw-r--r--chromium/third_party/fontconfig/src/new-version.sh21
-rw-r--r--chromium/third_party/fontconfig/src/src/Makefile.am3
-rw-r--r--chromium/third_party/fontconfig/src/src/fcarch.c5
-rw-r--r--chromium/third_party/fontconfig/src/src/fcatomic.c2
-rw-r--r--chromium/third_party/fontconfig/src/src/fcatomic.h18
-rw-r--r--chromium/third_party/fontconfig/src/src/fcblanks.c27
-rw-r--r--chromium/third_party/fontconfig/src/src/fccache.c282
-rw-r--r--chromium/third_party/fontconfig/src/src/fccfg.c128
-rw-r--r--chromium/third_party/fontconfig/src/src/fccharset.c262
-rw-r--r--chromium/third_party/fontconfig/src/src/fccompat.c39
-rw-r--r--chromium/third_party/fontconfig/src/src/fcdbg.c85
-rw-r--r--chromium/third_party/fontconfig/src/src/fcdefault.c55
-rw-r--r--chromium/third_party/fontconfig/src/src/fcdir.c167
-rw-r--r--chromium/third_party/fontconfig/src/src/fcfreetype.c877
-rw-r--r--chromium/third_party/fontconfig/src/src/fcfs.c22
-rw-r--r--chromium/third_party/fontconfig/src/src/fchash.c317
-rw-r--r--chromium/third_party/fontconfig/src/src/fcinit.c56
-rw-r--r--chromium/third_party/fontconfig/src/src/fcint.h122
-rw-r--r--chromium/third_party/fontconfig/src/src/fclang.c27
-rw-r--r--chromium/third_party/fontconfig/src/src/fclist.c4
-rw-r--r--chromium/third_party/fontconfig/src/src/fcmatch.c155
-rw-r--r--chromium/third_party/fontconfig/src/src/fcname.c45
-rw-r--r--chromium/third_party/fontconfig/src/src/fcobjs.c31
-rw-r--r--chromium/third_party/fontconfig/src/src/fcobjs.h31
-rw-r--r--chromium/third_party/fontconfig/src/src/fcobjshash.gperf.h23
-rw-r--r--chromium/third_party/fontconfig/src/src/fcpat.c81
-rw-r--r--chromium/third_party/fontconfig/src/src/fcrange.c161
-rw-r--r--chromium/third_party/fontconfig/src/src/fcstat.c101
-rw-r--r--chromium/third_party/fontconfig/src/src/fcstr.c105
-rw-r--r--chromium/third_party/fontconfig/src/src/fcweight.c109
-rw-r--r--chromium/third_party/fontconfig/src/src/fcwindows.h7
-rw-r--r--chromium/third_party/fontconfig/src/src/fcxml.c254
-rw-r--r--chromium/third_party/gestures/gestures/include/finger_metrics.h2
-rw-r--r--chromium/third_party/gestures/gestures/include/immediate_interpreter.h16
-rw-r--r--chromium/third_party/gestures/gestures/include/metrics_filter_interpreter.h4
-rw-r--r--chromium/third_party/gestures/gestures/src/immediate_interpreter.cc157
-rw-r--r--chromium/third_party/gestures/gestures/src/immediate_interpreter_unittest.cc43
-rw-r--r--chromium/third_party/libaddressinput/chromium/resources/address_input_strings_tr.xtb2
-rw-r--r--chromium/third_party/libdrm/src/Android.mk21
-rw-r--r--chromium/third_party/libdrm/src/CleanSpec.mk1
-rw-r--r--chromium/third_party/libdrm/src/Makefile.am18
-rw-r--r--chromium/third_party/libdrm/src/Makefile.sources6
-rw-r--r--chromium/third_party/libdrm/src/PRESUBMIT.cfg3
-rw-r--r--chromium/third_party/libdrm/src/amdgpu/Android.mk2
-rwxr-xr-xchromium/third_party/libdrm/src/amdgpu/amdgpu-symbol-check4
-rw-r--r--chromium/third_party/libdrm/src/amdgpu/amdgpu.h69
-rw-r--r--chromium/third_party/libdrm/src/amdgpu/amdgpu_bo.c14
-rw-r--r--chromium/third_party/libdrm/src/amdgpu/amdgpu_cs.c181
-rw-r--r--chromium/third_party/libdrm/src/amdgpu/amdgpu_internal.h16
-rw-r--r--chromium/third_party/libdrm/src/amdgpu/libdrm_amdgpu.pc.in1
-rw-r--r--chromium/third_party/libdrm/src/configure.ac91
-rwxr-xr-xchromium/third_party/libdrm/src/exynos/exynos-symbol-check3
-rw-r--r--chromium/third_party/libdrm/src/exynos/exynos_drm.c78
-rw-r--r--chromium/third_party/libdrm/src/exynos/exynos_drm.h12
-rw-r--r--chromium/third_party/libdrm/src/exynos/exynos_drmif.h26
-rw-r--r--chromium/third_party/libdrm/src/exynos/exynos_fimg2d.c174
-rw-r--r--chromium/third_party/libdrm/src/exynos/exynos_fimg2d.h4
-rw-r--r--chromium/third_party/libdrm/src/exynos/libdrm_exynos.pc.in2
-rw-r--r--chromium/third_party/libdrm/src/freedreno/Android.mk2
-rw-r--r--chromium/third_party/libdrm/src/freedreno/Makefile.am2
-rw-r--r--chromium/third_party/libdrm/src/freedreno/Makefile.sources1
-rw-r--r--chromium/third_party/libdrm/src/freedreno/README (renamed from chromium/third_party/libdrm/src/freedreno/kgsl/README)10
-rwxr-xr-xchromium/third_party/libdrm/src/freedreno/freedreno-symbol-check4
-rw-r--r--chromium/third_party/libdrm/src/freedreno/freedreno_bo.c148
-rw-r--r--chromium/third_party/libdrm/src/freedreno/freedreno_bo_cache.c222
-rw-r--r--chromium/third_party/libdrm/src/freedreno/freedreno_device.c62
-rw-r--r--chromium/third_party/libdrm/src/freedreno/freedreno_drmif.h16
-rw-r--r--chromium/third_party/libdrm/src/freedreno/freedreno_priv.h38
-rw-r--r--chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.c51
-rw-r--r--chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.h16
-rw-r--r--chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_bo.c6
-rw-r--r--chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_drm.h2
-rw-r--r--chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_pipe.c4
-rw-r--r--chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_ringbuffer.c13
-rw-r--r--chromium/third_party/libdrm/src/freedreno/kgsl/msm_kgsl.h4
-rw-r--r--chromium/third_party/libdrm/src/freedreno/msm/msm_bo.c20
-rw-r--r--chromium/third_party/libdrm/src/freedreno/msm/msm_device.c3
-rw-r--r--chromium/third_party/libdrm/src/freedreno/msm/msm_drm.h111
-rw-r--r--chromium/third_party/libdrm/src/freedreno/msm/msm_pipe.c47
-rw-r--r--chromium/third_party/libdrm/src/freedreno/msm/msm_priv.h17
-rw-r--r--chromium/third_party/libdrm/src/freedreno/msm/msm_ringbuffer.c411
-rw-r--r--chromium/third_party/libdrm/src/include/drm/drm.h69
-rw-r--r--chromium/third_party/libdrm/src/include/drm/drm_fourcc.h36
-rw-r--r--chromium/third_party/libdrm/src/include/drm/drm_mode.h197
-rw-r--r--chromium/third_party/libdrm/src/include/drm/drm_sarea.h2
-rw-r--r--chromium/third_party/libdrm/src/include/drm/evdi_drm.h85
-rw-r--r--chromium/third_party/libdrm/src/include/drm/i915_drm.h102
-rw-r--r--chromium/third_party/libdrm/src/include/drm/nouveau_drm.h1
-rw-r--r--chromium/third_party/libdrm/src/include/drm/tegra_drm.h3
-rw-r--r--chromium/third_party/libdrm/src/include/drm/vc4_drm.h300
-rw-r--r--chromium/third_party/libdrm/src/include/drm/vgem_drm.h33
-rw-r--r--chromium/third_party/libdrm/src/include/drm/virtgpu_drm.h109
-rw-r--r--chromium/third_party/libdrm/src/include/drm/vmwgfx_drm.h792
-rw-r--r--chromium/third_party/libdrm/src/intel/Android.mk2
-rw-r--r--chromium/third_party/libdrm/src/intel/Makefile.am1
-rwxr-xr-xchromium/third_party/libdrm/src/intel/intel-symbol-check2
-rw-r--r--chromium/third_party/libdrm/src/intel/intel_bufmgr.c20
-rw-r--r--chromium/third_party/libdrm/src/intel/intel_bufmgr.h2
-rw-r--r--chromium/third_party/libdrm/src/intel/intel_bufmgr_fake.c3
-rw-r--r--chromium/third_party/libdrm/src/intel/intel_bufmgr_gem.c252
-rw-r--r--chromium/third_party/libdrm/src/intel/intel_bufmgr_priv.h21
-rw-r--r--chromium/third_party/libdrm/src/intel/intel_chipset.h83
-rw-r--r--chromium/third_party/libdrm/src/intel/intel_decode.c4
-rw-r--r--chromium/third_party/libdrm/src/libkms/Android.mk8
-rw-r--r--chromium/third_party/libdrm/src/libkms/Makefile.am7
-rw-r--r--chromium/third_party/libdrm/src/libkms/Makefile.sources3
-rw-r--r--chromium/third_party/libdrm/src/libkms/internal.h2
-rw-r--r--chromium/third_party/libdrm/src/libkms/libkms.pc.in1
-rw-r--r--chromium/third_party/libdrm/src/libkms/linux.c10
-rw-r--r--chromium/third_party/libdrm/src/libkms/mediatek.c222
-rw-r--r--chromium/third_party/libdrm/src/man/drm-kms.xml2
-rw-r--r--chromium/third_party/libdrm/src/mediatek/Android.mk31
-rw-r--r--chromium/third_party/libdrm/src/mediatek/Makefile.am20
-rw-r--r--chromium/third_party/libdrm/src/mediatek/libdrm_mediatek.pc.in11
-rw-r--r--chromium/third_party/libdrm/src/mediatek/mediatek_drm.c299
-rw-r--r--chromium/third_party/libdrm/src/mediatek/mediatek_drm.h59
-rw-r--r--chromium/third_party/libdrm/src/mediatek/mediatek_drmif.h79
-rw-r--r--chromium/third_party/libdrm/src/nouveau/Android.mk2
-rw-r--r--chromium/third_party/libdrm/src/nouveau/Makefile.am13
-rw-r--r--chromium/third_party/libdrm/src/nouveau/abi16.c162
-rw-r--r--chromium/third_party/libdrm/src/nouveau/libdrm_nouveau.pc.in2
-rwxr-xr-xchromium/third_party/libdrm/src/nouveau/nouveau-symbol-check8
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nouveau.c574
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nouveau.h210
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nvif/cl0080.h45
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nvif/cl9097.h44
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nvif/class.h141
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nvif/if0002.h38
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nvif/if0003.h33
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nvif/ioctl.h132
-rw-r--r--chromium/third_party/libdrm/src/nouveau/nvif/unpack.h28
-rw-r--r--chromium/third_party/libdrm/src/nouveau/private.h8
-rw-r--r--chromium/third_party/libdrm/src/nouveau/pushbuf.c7
-rw-r--r--chromium/third_party/libdrm/src/radeon/Android.mk2
-rw-r--r--chromium/third_party/libdrm/src/radeon/Makefile.am3
-rw-r--r--chromium/third_party/libdrm/src/radeon/libdrm_radeon.pc.in1
-rw-r--r--chromium/third_party/libdrm/src/radeon/radeon_bo_gem.c2
-rw-r--r--chromium/third_party/libdrm/src/radeon/radeon_cs_gem.c2
-rw-r--r--chromium/third_party/libdrm/src/radeon/radeon_surface.c6
-rw-r--r--chromium/third_party/libdrm/src/rockchip/Android.mk27
-rw-r--r--chromium/third_party/libdrm/src/rockchip/Makefile.am20
-rw-r--r--chromium/third_party/libdrm/src/rockchip/libdrm_rockchip.pc.in11
-rw-r--r--chromium/third_party/libdrm/src/rockchip/rockchip_drm.c299
-rw-r--r--chromium/third_party/libdrm/src/rockchip/rockchip_drm.h73
-rw-r--r--chromium/third_party/libdrm/src/rockchip/rockchip_drmif.h77
-rw-r--r--chromium/third_party/libdrm/src/util_double_list.h8
-rw-r--r--chromium/third_party/libdrm/src/vc4/Makefile.am34
-rw-r--r--chromium/third_party/libdrm/src/vc4/Makefile.sources3
-rw-r--r--chromium/third_party/libdrm/src/vc4/libdrm_vc4.pc.in9
-rw-r--r--chromium/third_party/libdrm/src/vc4/vc4_packet.h397
-rw-r--r--chromium/third_party/libdrm/src/vc4/vc4_qpu_defines.h274
-rw-r--r--chromium/third_party/libdrm/src/xf86drm.c1486
-rw-r--r--chromium/third_party/libdrm/src/xf86drmMode.c83
-rw-r--r--chromium/third_party/libdrm/src/xf86drmMode.h11
-rw-r--r--[l---------]chromium/third_party/libxslt/linux/COPYING54
l---------chromium/third_party/mesa/src/src/gallium/state_trackers/d3d1x/w32api1
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_context.c267
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_drawable.c403
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_screen.c421
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_context.c267
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_drawable.c403
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_screen.c421
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_batchbuffer.c544
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_blit.c605
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffer_objects.c850
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffers.c133
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_context.c1031
-rwxr-xr-x[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_extensions.c198
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_fbo.c965
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_mipmap_tree.c1712
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel.c168
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c341
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_copy.c231
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_draw.c59
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_read.c206
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_regions.c474
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_resolve_map.c112
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_screen.c1205
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_span.c216
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_state.c196
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_syncobj.c133
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex.c223
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_copy.c172
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_format.c66
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_image.c361
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_layout.c207
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_subimage.c178
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_validate.c219
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_batchbuffer.c544
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_blit.c605
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffer_objects.c850
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffers.c133
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_context.c1031
-rwxr-xr-x[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_extensions.c198
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_fbo.c965
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_mipmap_tree.c1712
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel.c168
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c341
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_copy.c231
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_draw.c59
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_read.c206
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_regions.c474
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_resolve_map.c112
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_screen.c1205
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_span.c216
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_state.c196
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_syncobj.c133
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex.c223
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_copy.c172
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_format.c66
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_image.c361
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_layout.c207
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_subimage.c178
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_validate.c219
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.c234
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.h53
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_chipset.h42
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_cmdbuf.h114
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.c792
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.h89
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.c634
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.h531
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.c109
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.h175
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.c512
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.h61
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fbo.c981
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.c126
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.h45
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.c611
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.h107
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_pixel_read.c222
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.c218
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.h56
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.c797
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.h123
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.c162
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.h48
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tex_copy.c161
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.c834
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.h92
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.c513
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.h39
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_dri.h116
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_macros.h129
-rw-r--r--[l---------]chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_reg.h2164
-rw-r--r--chromium/third_party/minigbm/src/Makefile7
-rw-r--r--chromium/third_party/minigbm/src/amdgpu.c48
-rw-r--r--chromium/third_party/minigbm/src/cirrus.c19
-rw-r--r--chromium/third_party/minigbm/src/common.mk2
-rw-r--r--chromium/third_party/minigbm/src/cros_gralloc/cros_alloc_device.cc8
-rw-r--r--chromium/third_party/minigbm/src/drv.c87
-rw-r--r--chromium/third_party/minigbm/src/drv.h8
-rw-r--r--chromium/third_party/minigbm/src/drv_priv.h12
-rw-r--r--chromium/third_party/minigbm/src/evdi.c13
-rw-r--r--chromium/third_party/minigbm/src/exynos.c19
-rw-r--r--chromium/third_party/minigbm/src/gbm.c28
-rw-r--r--chromium/third_party/minigbm/src/gbm.h7
-rw-r--r--chromium/third_party/minigbm/src/gbm_helpers.c2
-rw-r--r--chromium/third_party/minigbm/src/gbm_helpers.h2
-rw-r--r--chromium/third_party/minigbm/src/gbm_priv.h2
-rw-r--r--chromium/third_party/minigbm/src/gma500.c10
-rw-r--r--chromium/third_party/minigbm/src/helpers.c42
-rw-r--r--chromium/third_party/minigbm/src/helpers.h3
-rw-r--r--chromium/third_party/minigbm/src/i915.c288
-rw-r--r--chromium/third_party/minigbm/src/marvell.c13
-rw-r--r--chromium/third_party/minigbm/src/mediatek.c20
-rw-r--r--chromium/third_party/minigbm/src/nouveau.c30
-rw-r--r--chromium/third_party/minigbm/src/rockchip.c98
-rw-r--r--chromium/third_party/minigbm/src/tegra.c118
-rw-r--r--chromium/third_party/minigbm/src/udl.c15
-rw-r--r--chromium/third_party/minigbm/src/util.h2
-rw-r--r--chromium/third_party/minigbm/src/vc4.c93
-rw-r--r--chromium/third_party/minigbm/src/vgem.c14
-rw-r--r--chromium/third_party/minigbm/src/virtio_gpu.c13
-rw-r--r--chromium/third_party/pyelftools/.hgignore12
-rw-r--r--chromium/third_party/pyelftools/.travis.yml8
-rw-r--r--chromium/third_party/pyelftools/CHANGES24
-rw-r--r--chromium/third_party/pyelftools/MANIFEST.in7
-rw-r--r--chromium/third_party/pyelftools/README43
-rw-r--r--chromium/third_party/pyelftools/README.rst57
-rw-r--r--chromium/third_party/pyelftools/TODO16
-rw-r--r--chromium/third_party/pyelftools/elftools/__init__.py10
-rw-r--r--chromium/third_party/pyelftools/elftools/common/ordereddict.py12
-rw-r--r--chromium/third_party/pyelftools/elftools/common/utils.py15
-rw-r--r--chromium/third_party/pyelftools/elftools/construct/README10
-rw-r--r--chromium/third_party/pyelftools/elftools/dwarf/callframe.py33
-rw-r--r--chromium/third_party/pyelftools/elftools/dwarf/compileunit.py69
-rw-r--r--chromium/third_party/pyelftools/elftools/dwarf/descriptions.py39
-rw-r--r--chromium/third_party/pyelftools/elftools/dwarf/die.py99
-rw-r--r--chromium/third_party/pyelftools/elftools/dwarf/dwarfinfo.py62
-rw-r--r--chromium/third_party/pyelftools/elftools/dwarf/enums.py60
-rw-r--r--chromium/third_party/pyelftools/elftools/dwarf/lineprogram.py4
-rw-r--r--chromium/third_party/pyelftools/elftools/dwarf/structs.py102
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/constants.py42
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/descriptions.py92
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/dynamic.py125
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/elffile.py135
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/enums.py391
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/gnuversions.py228
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/relocation.py25
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/sections.py54
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/segments.py12
-rw-r--r--chromium/third_party/pyelftools/elftools/elf/structs.py75
-rw-r--r--chromium/third_party/pyelftools/examples/dwarf_decode_address.py29
-rw-r--r--chromium/third_party/pyelftools/examples/dwarf_die_tree.py23
-rw-r--r--chromium/third_party/pyelftools/examples/dwarf_location_lists.py12
-rw-r--r--chromium/third_party/pyelftools/examples/dwarf_range_lists.py14
-rw-r--r--chromium/third_party/pyelftools/examples/elf_low_high_api.py9
-rw-r--r--chromium/third_party/pyelftools/examples/elf_relocations.py10
-rw-r--r--chromium/third_party/pyelftools/examples/elf_show_debug_sections.py9
-rw-r--r--chromium/third_party/pyelftools/examples/elfclass_address_size.py9
-rw-r--r--chromium/third_party/pyelftools/examples/examine_dwarf_info.py21
-rw-r--r--chromium/third_party/pyelftools/examples/reference_output/dwarf_decode_address.out2
-rw-r--r--chromium/third_party/pyelftools/examples/reference_output/dwarf_die_tree.out8
-rw-r--r--chromium/third_party/pyelftools/examples/reference_output/examine_dwarf_info.out8
-rw-r--r--chromium/third_party/pyelftools/pyelftools.sublime-project9
-rwxr-xr-xchromium/third_party/pyelftools/scripts/readelf.py463
-rw-r--r--chromium/third_party/pyelftools/setup.py8
-rw-r--r--chromium/third_party/pyelftools/tox.ini3
-rw-r--r--chromium/third_party/pyelftools/z.py7
-rw-r--r--chromium/third_party/skia/src/core/SkPathRef.cpp5
l---------chromium/third_party/skia/tools/gyp1
-rw-r--r--chromium/third_party/sqlite/amalgamation/sqlite3.c79
-rw-r--r--chromium/third_party/sqlite/amalgamation/sqlite3.h29
-rw-r--r--chromium/third_party/sqlite/patches/0013-Add-new-interfaces-sqlite3_bind_pointer-sqlite3_resu.patch420
-rw-r--r--chromium/third_party/sqlite/src/ext/fts3/fts3.c13
-rw-r--r--chromium/third_party/sqlite/src/ext/misc/carray.c46
-rw-r--r--chromium/third_party/sqlite/src/ext/misc/remember.c6
-rw-r--r--chromium/third_party/sqlite/src/src/sqlite.h.in29
-rw-r--r--chromium/third_party/sqlite/src/src/vdbeInt.h2
-rw-r--r--chromium/third_party/sqlite/src/src/vdbeapi.c24
-rw-r--r--chromium/third_party/sqlite/src/src/vdbemem.c11
-rw-r--r--[l---------]chromium/third_party/swiftshader/third_party/subzero/DESIGN.rst1594
-rw-r--r--[l---------]chromium/third_party/swiftshader/third_party/subzero/README.rst214
-rw-r--r--chromium/third_party/wayland-protocols/src/configure.ac1
-rw-r--r--chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml5
-rw-r--r--chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml3
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml49
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml10
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml5
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml2
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml1
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml1
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml80
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml2
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml14
-rw-r--r--chromium/third_party/wayland-protocols/src/wayland-protocols-uninstalled.pc.in5
-rw-r--r--chromium/third_party/wayland/src/Makefile.am38
-rw-r--r--chromium/third_party/wayland/src/cursor/os-compatibility.c2
-rw-r--r--chromium/third_party/wayland/src/doc/doxygen/Makefile.am1
-rw-r--r--chromium/third_party/wayland/src/doc/doxygen/wayland.doxygen.in3
-rw-r--r--chromium/third_party/wayland/src/doc/publican/sources/Client.xml2
-rw-r--r--chromium/third_party/wayland/src/protocol/wayland.xml108
-rw-r--r--chromium/third_party/wayland/src/src/wayland-client-uninstalled.pc.in3
-rw-r--r--chromium/third_party/wayland/src/src/wayland-client.c2
-rw-r--r--chromium/third_party/wayland/src/src/wayland-scanner-uninstalled.pc.in2
-rw-r--r--chromium/third_party/wayland/src/src/wayland-server-uninstalled.pc.in3
-rw-r--r--chromium/third_party/wayland/src/src/wayland-util.h143
-rw-r--r--chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp4
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec/aec_core.cc17
-rw-r--r--chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_context.cc3
-rw-r--r--chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h5
-rw-r--r--chromium/third_party/xdg-utils/codereview.settings9
-rw-r--r--chromium/ui/gl/gl_surface.cc10
-rw-r--r--chromium/ui/gl/gl_surface.h4
-rw-r--r--chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc20
-rw-r--r--chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.h3
-rw-r--r--chromium/ui/strings/translations/ui_strings_hi.xtb8
-rw-r--r--chromium/ui/strings/translations/ui_strings_ru.xtb2
-rw-r--r--chromium/ui/strings/translations/ui_strings_uk.xtb16
-rw-r--r--chromium/ui/views/controls/scrollbar/overlay_scroll_bar.cc6
-rw-r--r--chromium/v8/include/v8-version.h2
-rw-r--r--chromium/v8/src/ast/scopes.cc1
-rw-r--r--chromium/v8/src/bootstrapper.cc25
-rw-r--r--chromium/v8/src/compiler/access-builder.cc2
-rw-r--r--chromium/v8/src/compiler/wasm-compiler.cc2
-rw-r--r--chromium/v8/src/v8.gyp15
-rw-r--r--chromium/v8/src/wasm/wasm-module.cc2
1039 files changed, 101788 insertions, 62500 deletions
diff --git a/chromium/DEPS b/chromium/DEPS
index 06b17bd2498..5f3b9fa1e03 100644
--- a/chromium/DEPS
+++ b/chromium/DEPS
@@ -156,7 +156,7 @@ deps = {
'src/third_party/shaderc/src':
(Var("chromium_git")) + '/external/github.com/google/shaderc.git@cd8793c34907073025af2622c28bcee64e9879a4',
'src/third_party/skia':
- (Var("skia_git")) + '/skia.git@8386aa8a3bdc682ff9daa6c559d593b9d5c4a5d1',
+ (Var("skia_git")) + '/skia.git@a20ae70af542208b06c21413f13c4c86269c0b84',
'src/third_party/smhasher/src':
(Var("chromium_git")) + '/external/smhasher.git@e87738e57558e0ec472b2fc3a643b838e5b6e88f',
'src/third_party/snappy/src':
@@ -174,7 +174,7 @@ deps = {
'src/third_party/webpagereplay':
(Var("chromium_git")) + '/external/github.com/chromium/web-page-replay.git@3cd3a3f6f06a1b87b14b9162c7eb16d23d141241',
'src/third_party/webrtc':
- (Var("chromium_git")) + '/external/webrtc/trunk/webrtc.git@e49dbf0b8fbbf62862a5f9c395a83960fcb143d2',
+ (Var("chromium_git")) + '/external/webrtc/trunk/webrtc.git@2f82722d6914a47b20f4cac09d78dcefe48abead',
'src/third_party/yasm/source/patched-yasm':
(Var("chromium_git")) + '/chromium/deps/yasm/patched-yasm.git@7da28c6c7c6a1387217352ce02b31754deb54d2a',
'src/tools/gyp':
@@ -184,7 +184,7 @@ deps = {
'src/tools/swarming_client':
(Var("chromium_git")) + '/external/swarming.client.git@a941a089ff1000403078b74cb628eb430f07d271',
'src/v8':
- (Var("chromium_git")) + '/v8/v8.git@0a0271e43d7f6c83c6f3cae30845839cf30e80cc'
+ (Var("chromium_git")) + '/v8/v8.git@de3eac39923aeb8db4908751afa078c3b89c578a'
}
deps_os = {
diff --git a/chromium/build/util/LASTCHANGE b/chromium/build/util/LASTCHANGE
index c99e112a814..9152450bfc6 100644
--- a/chromium/build/util/LASTCHANGE
+++ b/chromium/build/util/LASTCHANGE
@@ -1 +1 @@
-LASTCHANGE=90251daa18c9278acb70506c5fef2a19c9a10b42-
+LASTCHANGE=9d5eb2a228983b0d1c699568e04fa37bfd99ec9b-
diff --git a/chromium/build/util/LASTCHANGE.blink b/chromium/build/util/LASTCHANGE.blink
index c99e112a814..9152450bfc6 100644
--- a/chromium/build/util/LASTCHANGE.blink
+++ b/chromium/build/util/LASTCHANGE.blink
@@ -1 +1 @@
-LASTCHANGE=90251daa18c9278acb70506c5fef2a19c9a10b42-
+LASTCHANGE=9d5eb2a228983b0d1c699568e04fa37bfd99ec9b-
diff --git a/chromium/buildtools/third_party/libc++/trunk/.arcconfig b/chromium/buildtools/third_party/libc++/trunk/.arcconfig
index 6d07e827fcb..c96fbc1b4e6 100644
--- a/chromium/buildtools/third_party/libc++/trunk/.arcconfig
+++ b/chromium/buildtools/third_party/libc++/trunk/.arcconfig
@@ -1,4 +1,4 @@
{
"project_id" : "libcxx",
- "conduit_uri" : "http://reviews.llvm.org/"
+ "conduit_uri" : "https://reviews.llvm.org/"
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/.clang-format b/chromium/buildtools/third_party/libc++/trunk/.clang-format
new file mode 100644
index 00000000000..dd596813fbb
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/.clang-format
@@ -0,0 +1,13 @@
+BasedOnStyle: LLVM
+
+---
+Language: Cpp
+Standard: Cpp03
+
+AlwaysBreakTemplateDeclarations: true
+PointerAlignment: Left
+
+# Disable formatting options which may break tests.
+SortIncludes: false
+ReflowComments: false
+---
diff --git a/chromium/buildtools/third_party/libc++/trunk/CMakeLists.txt b/chromium/buildtools/third_party/libc++/trunk/CMakeLists.txt
index e6c96f64711..33d888b807d 100644
--- a/chromium/buildtools/third_party/libc++/trunk/CMakeLists.txt
+++ b/chromium/buildtools/third_party/libc++/trunk/CMakeLists.txt
@@ -3,7 +3,7 @@
#===============================================================================
# Setup Project
#===============================================================================
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.4.3)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
@@ -12,13 +12,6 @@ if(POLICY CMP0022)
cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang
endif()
-project(libcxx CXX C)
-
-set(PACKAGE_NAME libcxx)
-set(PACKAGE_VERSION trunk-svn)
-set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")
-
# Add path for custom modules
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
@@ -26,6 +19,27 @@ set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
)
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ project(libcxx CXX C)
+
+ set(PACKAGE_NAME libcxx)
+ set(PACKAGE_VERSION 5.0.0svn)
+ set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+ set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")
+
+ # Find the LLVM sources and simulate LLVM CMake options.
+ include(HandleOutOfTreeLLVM)
+endif()
+
+if (LIBCXX_STANDALONE_BUILD)
+ include(FindPythonInterp)
+ if( NOT PYTHONINTERP_FOUND )
+ message(WARNING "Failed to find python interpreter. "
+ "The libc++ test suite will be disabled.")
+ set(LLVM_INCLUDE_TESTS OFF)
+ endif()
+endif()
+
# Require out of source build.
include(MacroEnsureOutOfSourceBuild)
MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
@@ -33,52 +47,96 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
)
-# Find the LLVM sources and simulate LLVM CMake options.
-include(HandleOutOfTreeLLVM)
-if (LIBCXX_BUILT_STANDALONE AND NOT LLVM_FOUND)
- message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "
- "llvm-config not found and LLVM_PATH not defined.\n"
- "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config "
- "or -DLLVM_PATH=path/to/llvm-source-root.")
+if (MSVC)
+ set(LIBCXX_TARGETING_MSVC ON)
+else()
+ set(LIBCXX_TARGETING_MSVC OFF)
endif()
#===============================================================================
# Setup CMake Options
#===============================================================================
+include(CMakeDependentOption)
+include(HandleCompilerRT)
# Basic options ---------------------------------------------------------------
-option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
+option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." OFF)
option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
-
+option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
+option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
+set(ENABLE_FILESYSTEM_DEFAULT ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY})
+if (WIN32)
+ set(ENABLE_FILESYSTEM_DEFAULT OFF)
+endif()
+option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++experimental.a"
+ ${ENABLE_FILESYSTEM_DEFAULT})
option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
+
+# Benchmark options -----------------------------------------------------------
+option(LIBCXX_INCLUDE_BENCHMARKS "Build the libc++ benchmarks and their dependancies" ON)
+set(LIBCXX_BENCHMARK_NATIVE_STDLIB "" CACHE STRING
+ "Build the benchmarks against the specified native STL.
+ The value must be one of libc++/libstdc++")
+set(LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN "" CACHE STRING
+ "Use alternate GCC toolchain when building the native benchmarks")
+
+if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
+ if (NOT (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++"
+ OR LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++"))
+ message(FATAL_ERROR "Invalid value for LIBCXX_BENCHMARK_NATIVE_STDLIB: "
+ "'${LIBCXX_BENCHMARK_NATIVE_STDLIB}'")
+ endif()
+endif()
+
option(LIBCXX_INCLUDE_DOCS "Build the libc++ documentation." ${LLVM_INCLUDE_DOCS})
set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
"Define suffix of library directory name (32/64)")
option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON)
option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON)
option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)
+cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY
+ "Install libc++experimental.a" ON
+ "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF)
set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.")
option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
+option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
+
+if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC)
+ message(FATAL_ERROR "libc++ must be built as either a shared or static library.")
+endif()
# ABI Library options ---------------------------------------------------------
-set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
- "Specify C++ ABI library to use." FORCE)
-set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)
+set(LIBCXX_CXX_ABI "default" CACHE STRING
+ "Specify C++ ABI library to use.")
+set(CXXABIS none default libcxxabi libcxxrt libstdc++ libsupc++ vcruntime)
set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
# Setup the default options if LIBCXX_CXX_ABI is not specified.
-if (NOT LIBCXX_CXX_ABI)
- if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND
- IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
+if (LIBCXX_CXX_ABI STREQUAL "default")
+ find_path(
+ LIBCXX_LIBCXXABI_INCLUDES_INTERNAL
+ cxxabi.h
+ PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi/include
+ ${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
+ NO_DEFAULT_PATH
+ )
+ if (LIBCXX_TARGETING_MSVC)
+ # FIXME: Figure out how to configure the ABI library on Windows.
+ set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
+ elseif ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
+ IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
- set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
+ set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
set(LIBCXX_CXX_ABI_INTREE 1)
- else ()
- set(LIBCXX_CXX_ABI_LIBNAME "none")
- endif ()
-else ()
+ elseif (APPLE)
+ set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
+ set(LIBCXX_CXX_ABI_SYSTEM 1)
+ else()
+ set(LIBCXX_CXX_ABI_LIBNAME "default")
+ endif()
+else()
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
-endif ()
+endif()
# Use a static copy of the ABI library when linking libc++. This option
# cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT.
@@ -86,13 +144,15 @@ option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
# Generate and install a linker script inplace of libc++.so. The linker script
# will link libc++ to the correct ABI library. This option is on by default
-# On UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'
+# on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'
# is on. This option is also disabled when the ABI library is not specified
# or is specified to be "none".
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY
AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"
- AND PYTHONINTERP_FOUND)
+ AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "default"
+ AND PYTHONINTERP_FOUND
+ AND LIBCXX_ENABLE_SHARED)
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON)
endif()
@@ -100,9 +160,25 @@ option(LIBCXX_ENABLE_ABI_LINKER_SCRIPT
"Use and install a linker script for the given ABI library"
${ENABLE_LINKER_SCRIPT_DEFAULT_VALUE})
+set(ENABLE_NEW_DELETE_DEFAULT ON)
+if (LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
+# FIXME: This option should default to off. Unfortunatly GCC 4.9 fails to link
+# programs due to undefined references to new/delete in libc++abi so to work
+# around this libc++abi currently defaults LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS
+# to ON. Once the GCC bug has been worked around this option should be changed
+# back to OFF.
+ set(ENABLE_NEW_DELETE_DEFAULT ON)
+endif()
+
+option(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS
+ "Build libc++ with definitions for operator new/delete. This option can
+ be used to disable the definitions when libc++abi is expected to provide
+ them" ${ENABLE_NEW_DELETE_DEFAULT})
+
# Build libc++abi with libunwind. We need this option to determine whether to
# link with libunwind or libgcc_s while running the test cases.
option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
+option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF)
# Target options --------------------------------------------------------------
option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++." ${LLVM_BUILD_32_BITS})
@@ -121,12 +197,20 @@ option(LIBCXX_ENABLE_MONOTONIC_CLOCK
"Build libc++ with support for a monotonic clock.
This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON)
option(LIBCXX_HAS_MUSL_LIBC "Build libc++ with support for the Musl C library" OFF)
+option(LIBCXX_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF)
+option(LIBCXX_HAS_EXTERNAL_THREAD_API
+ "Build libc++ with an externalized threading API.
+ This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON." OFF)
+option(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY
+ "Build libc++ with an externalized threading library.
+ This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON" OFF)
# Misc options ----------------------------------------------------------------
# FIXME: Turn -pedantic back ON. It is currently off because it warns
# about #include_next which is used everywhere.
option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF)
option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
+option(LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS "Disable #warnings about conflicting macros." OFF)
option(LIBCXX_GENERATE_COVERAGE "Enable generating code coverage." OFF)
set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING
@@ -160,6 +244,11 @@ option(LIBCXX_CONFIGURE_IDE "Configure libcxx for use within an IDE"
# Check option configurations
#===============================================================================
+if (LIBCXX_ENABLE_FILESYSTEM AND NOT LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+ message(FATAL_ERROR
+ "LIBCXX_ENABLE_FILESYSTEM cannot be turned on when LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF")
+endif()
+
# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON only when
# LIBCXX_ENABLE_THREADS is on.
if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)
@@ -167,6 +256,35 @@ if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)
" when LIBCXX_ENABLE_THREADS is also set to OFF.")
endif()
+if(NOT LIBCXX_ENABLE_THREADS)
+ if(LIBCXX_HAS_PTHREAD_API)
+ message(FATAL_ERROR "LIBCXX_HAS_PTHREAD_API can only be set to ON"
+ " when LIBCXX_ENABLE_THREADS is also set to ON.")
+ endif()
+ if(LIBCXX_HAS_EXTERNAL_THREAD_API)
+ message(FATAL_ERROR "LIBCXX_HAS_EXTERNAL_THREAD_API can only be set to ON"
+ " when LIBCXX_ENABLE_THREADS is also set to ON.")
+ endif()
+ if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
+ message(FATAL_ERROR "LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY can only be set "
+ "to ON when LIBCXX_ENABLE_THREADS is also set to ON.")
+ endif()
+
+endif()
+
+if (LIBCXX_HAS_EXTERNAL_THREAD_API)
+ if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
+ message(FATAL_ERROR "The options LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY and "
+ "LIBCXX_HAS_EXTERNAL_THREAD_API cannot both be ON at "
+ "the same time")
+ endif()
+ if (LIBCXX_HAS_PTHREAD_API)
+ message(FATAL_ERROR "The options LIBCXX_HAS_EXTERNAL_THREAD_API"
+ "and LIBCXX_HAS_PTHREAD_API cannot be both"
+ "set to ON at the same time.")
+ endif()
+endif()
+
# Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE
# is ON.
if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE)
@@ -190,6 +308,9 @@ if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
else()
message(WARNING "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option")
endif()
+ if (LIBCXX_ENABLE_STATIC AND NOT PYTHONINTERP_FOUND)
+ message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY requires python but it was not found.")
+ endif()
endif()
if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
@@ -199,6 +320,9 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
if (NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT requires python but it was not found.")
endif()
+ if (NOT LIBCXX_ENABLE_SHARED)
+ message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT is only available for shared library builds.")
+ endif()
endif()
if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
@@ -219,23 +343,53 @@ endif()
set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER})
set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
+if (LLVM_LIBRARY_OUTPUT_INTDIR)
+ set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+else()
+ set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
+endif()
+file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
# Declare libc++ configuration variables.
# They are intended for use as follows:
# LIBCXX_CXX_FLAGS: General flags for both the compiler and linker.
# LIBCXX_COMPILE_FLAGS: Compile only flags.
# LIBCXX_LINK_FLAGS: Linker only flags.
+# LIBCXX_LIBRARIES: libraries libc++ is linked to.
+# LIBCXX_INTERFACE_LIBRARIES: Libraries that must be linked when using libc++
+# These libraries are exposed in the linker script.
set(LIBCXX_COMPILE_FLAGS "")
set(LIBCXX_LINK_FLAGS "")
set(LIBCXX_LIBRARIES "")
+set(LIBCXX_INTERFACE_LIBRARIES "")
+
+# Include macros for adding and removing libc++ flags.
+include(HandleLibcxxFlags)
+
+# Target flags ================================================================
+# These flags get added to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS so that
+# 'config-ix' use them during feature checks. It also adds them to both
+# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'
+add_target_flags_if(LIBCXX_BUILD_32_BITS "-m32")
+add_target_flags_if(LIBCXX_TARGET_TRIPLE "--target=${LIBCXX_TARGET_TRIPLE}")
+add_target_flags_if(LIBCXX_SYSROOT "--sysroot=${LIBCXX_SYSROOT}")
+add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "--gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
+if (LIBCXX_TARGET_TRIPLE)
+ set(TARGET_TRIPLE "${LIBCXX_TARGET_TRIPLE}")
+endif()
# Configure compiler.
include(config-ix)
+if (LIBCXX_USE_COMPILER_RT)
+ list(APPEND LIBCXX_LINK_FLAGS "-rtlib=compiler-rt")
+endif()
+
# Configure coverage options.
if (LIBCXX_GENERATE_COVERAGE)
include(CodeCoverage)
@@ -243,29 +397,48 @@ if (LIBCXX_GENERATE_COVERAGE)
endif()
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ set(LIBCXX_DEBUG_BUILD ON)
+else()
+ set(LIBCXX_DEBUG_BUILD OFF)
+endif()
#===============================================================================
# Setup Compiler Flags
#===============================================================================
-include(HandleLibCXXABI) # Steup the ABI library flags
+include(HandleLibCXXABI) # Setup the ABI library flags
-# Include macros for adding and removing libc++ flags.
-include(HandleLibcxxFlags)
+if (NOT LIBCXX_STANDALONE_BUILD)
+ # Remove flags that may have snuck in.
+ remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
+ -lc++abi)
+endif()
+remove_flags(-stdlib=libc++ -stdlib=libstdc++)
-# Remove flags that may have snuck in.
-remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG
- -stdlib=libc++ -stdlib=libstdc++ -lc++abi -m32)
+# FIXME: Remove all debug flags and flags that change which Windows
+# default libraries are linked. Currently we only support linking the
+# non-debug DLLs
+remove_flags("/D_DEBUG" "/MTd" "/MDd" "/MT" "/Md")
# FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEDANTIC.
# Remove the -pedantic flag and -Wno-pedantic and -pedantic-errors
-# so they don't get transformed into -Wno and -errors respectivly.
+# so they don't get transformed into -Wno and -errors respectively.
remove_flags(-Wno-pedantic -pedantic-errors -pedantic)
# Required flags ==============================================================
-add_compile_flags_if_supported(-std=c++11)
-if (NOT MSVC AND NOT LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG)
- message(FATAL_ERROR "C++11 is required but the compiler does not support -std=c++11")
+set(LIBCXX_STANDARD_VER c++11 CACHE INTERNAL "internal option to change build dialect")
+if (LIBCXX_HAS_MUSL_LIBC)
+ # musl's pthread implementations uses volatile types in their structs which is
+ # not a constexpr in C++11 but is in C++14, so we use C++14 with musl.
+ set(LIBCXX_STANDARD_VER c++14 CACHE INTERNAL "internal option to change build dialect")
+endif()
+add_compile_flags_if_supported(-std=${LIBCXX_STANDARD_VER})
+mangle_name("LIBCXX_SUPPORTS_STD_EQ_${LIBCXX_STANDARD_VER}_FLAG" SUPPORTS_DIALECT_NAME)
+if(NOT ${SUPPORTS_DIALECT_NAME})
+ if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND NOT "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
+ message(FATAL_ERROR "C++11 or greater is required but the compiler does not support ${LIBCXX_STANDARD_VER}")
+ endif()
endif()
# On all systems the system c++ standard library headers need to be excluded.
@@ -274,18 +447,40 @@ endif()
# headers
add_compile_flags_if_supported(-nostdinc++)
-# Target flags ================================================================
-add_flags_if(LIBCXX_BUILD_32_BITS -m32)
-add_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}")
-add_flags_if(LIBCXX_SYSROOT "--sysroot ${LIBCXX_SYSROOT}")
-add_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")
+# Hide all inline function definitions which have not explicitly been marked
+# visible. This prevents new definitions for inline functions from appearing in
+# the dylib when get ODR used by another function.
+add_compile_flags_if_supported(-fvisibility-inlines-hidden)
+
+if (LIBCXX_CONFIGURE_IDE)
+ # This simply allows IDE to process <experimental/coroutine>
+ add_compile_flags_if_supported(-fcoroutines-ts)
+endif()
+
+# Let the library headers know they are currently being used to build the
+# library.
+add_definitions(-D_LIBCPP_BUILDING_LIBRARY)
+
+if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
+ add_definitions(-D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
+endif()
# Warning flags ===============================================================
add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
add_compile_flags_if_supported(
- -Wall -W -Wwrite-strings
+ -Wall -Wextra -W -Wwrite-strings
-Wno-unused-parameter -Wno-long-long
-Werror=return-type)
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ add_compile_flags_if_supported(
+ -Wno-user-defined-literals
+ -Wno-covered-switch-default)
+elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+ add_compile_flags_if_supported(
+ -Wno-literal-suffix
+ -Wno-c++14-compat
+ -Wno-noexcept-type)
+endif()
if (LIBCXX_ENABLE_WERROR)
add_compile_flags_if_supported(-Werror)
add_compile_flags_if_supported(-WX)
@@ -297,6 +492,9 @@ endif()
if (LIBCXX_ENABLE_PEDANTIC)
add_compile_flags_if_supported(-pedantic)
endif()
+if (LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS)
+ add_definitions(-D_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
+endif()
# Exception flags =============================================================
if (LIBCXX_ENABLE_EXCEPTIONS)
@@ -316,22 +514,42 @@ if (NOT LIBCXX_ENABLE_RTTI)
add_compile_flags_if_supported(-fno-rtti)
endif()
+# Threading flags =============================================================
+if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY AND LIBCXX_ENABLE_SHARED)
+ # Need to allow unresolved symbols if this is to work with shared library builds
+ if (APPLE)
+ add_link_flags("-undefined dynamic_lookup")
+ else()
+ # Relax this restriction from HandleLLVMOptions
+ string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+ endif()
+endif()
+
# Assertion flags =============================================================
define_if(LIBCXX_ENABLE_ASSERTIONS -UNDEBUG)
define_if_not(LIBCXX_ENABLE_ASSERTIONS -DNDEBUG)
-if (LIBCXX_ENABLE_ASSERTIONS)
+define_if(LIBCXX_ENABLE_ASSERTIONS -D_LIBCPP_DEBUG=0)
+define_if(LIBCXX_DEBUG_BUILD -D_DEBUG)
+if (LIBCXX_ENABLE_ASSERTIONS AND NOT LIBCXX_DEBUG_BUILD)
# MSVC doesn't like _DEBUG on release builds. See PR 4379.
- define_if_not(MSVC -D_DEBUG)
+ define_if_not(LIBCXX_TARGETING_MSVC -D_DEBUG)
endif()
-# Feature flags ===============================================================
-define_if(MSVC -D_CRT_SECURE_NO_WARNINGS)
+# Modules flags ===============================================================
+# FIXME The libc++ sources are fundamentally non-modular. They need special
+# versions of the headers in order to provide C++03 and legacy ABI definitions.
+# NOTE: The public headers can be used with modules in all other contexts.
+if (LLVM_ENABLE_MODULES)
+ # Ignore that the rest of the modules flags are now unused.
+ add_compile_flags_if_supported(-Wno-unused-command-line-argument)
+ add_compile_flags(-fno-modules)
+endif()
# Sanitizer flags =============================================================
-# Configure for sanitizers. If LIBCXX_BUILT_STANDALONE then we have to do
+# Configure for sanitizers. If LIBCXX_STANDALONE_BUILD then we have to do
# the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it.
-if (LIBCXX_BUILT_STANDALONE)
+if (LIBCXX_STANDALONE_BUILD)
set(LLVM_USE_SANITIZER "" CACHE STRING
"Define the sanitizer used to build the library and tests")
# NOTE: LLVM_USE_SANITIZER checks for a UNIX like system instead of MSVC.
@@ -376,16 +594,31 @@ config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS)
config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK)
config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)
+config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD)
+config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL)
+config_define_if(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL)
config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC)
+# By default libc++ on Windows expects to use a shared library, which requires
+# the headers to use DLL import/export semantics. However when building a
+# static library only we modify the headers to disable DLL import/export.
+if (DEFINED WIN32 AND LIBCXX_ENABLE_STATIC AND NOT LIBCXX_ENABLE_SHARED)
+ message(STATUS "Generating custom __config for non-DLL Windows build")
+ config_define(ON _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+endif()
+
if (LIBCXX_NEEDS_SITE_CONFIG)
- configure_file(
- include/__config_site.in
- ${LIBCXX_BINARY_DIR}/__config_site
- @ONLY)
+ configure_file("include/__config_site.in"
+ "${LIBCXX_BINARY_DIR}/__config_site"
+ @ONLY)
+
# Provide the config definitions by included the generated __config_site
# file at compile time.
- add_compile_flags("-include ${LIBCXX_BINARY_DIR}/__config_site")
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
+ add_compile_flags("/FI\"${LIBCXX_BINARY_DIR}/__config_site\"")
+ else()
+ add_compile_flags("-include ${LIBCXX_BINARY_DIR}/__config_site")
+ endif()
endif()
#===============================================================================
@@ -395,9 +628,24 @@ include_directories(include)
add_subdirectory(include)
add_subdirectory(lib)
-if (LIBCXX_INCLUDE_TESTS)
+
+if (LIBCXX_INCLUDE_BENCHMARKS)
+ add_subdirectory(benchmarks)
+endif()
+
+# Create the lit.site.cfg file even when LIBCXX_INCLUDE_TESTS is OFF or
+# LLVM_FOUND is OFF. This allows users to run the tests manually using
+# LIT without requiring a full LLVM checkout.
+#
+# However, since some submission systems strip test/ subdirectories, check for
+# it before adding it.
+if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
add_subdirectory(test)
endif()
+if (LIBCXX_INCLUDE_TESTS)
+ add_subdirectory(lib/abi)
+endif()
+
if (LIBCXX_INCLUDE_DOCS)
add_subdirectory(docs)
endif()
diff --git a/chromium/buildtools/third_party/libc++/trunk/CREDITS.TXT b/chromium/buildtools/third_party/libc++/trunk/CREDITS.TXT
index 1cf713a6884..92123d736bf 100644
--- a/chromium/buildtools/third_party/libc++/trunk/CREDITS.TXT
+++ b/chromium/buildtools/third_party/libc++/trunk/CREDITS.TXT
@@ -37,6 +37,10 @@ E: mclow.lists@gmail.com
E: marshall@idio.com
D: C++14 support, patches and bug fixes.
+N: Jonathan B Coe
+E: jbcoe@me.com
+D: Implementation of propagate_const.
+
N: Eric Fiselier
E: eric@efcs.ca
D: LFTS support, patches and bug fixes.
@@ -76,6 +80,10 @@ N: Andrew Morrow
E: andrew.c.morrow@gmail.com
D: Minor patches and Linux fixes.
+N: Michael Park
+E: mcypark@gmail.com
+D: Implementation of <variant>.
+
N: Arvid Picciani
E: aep at exys dot org
D: Minor patches and musl port.
diff --git a/chromium/buildtools/third_party/libc++/trunk/LICENSE.TXT b/chromium/buildtools/third_party/libc++/trunk/LICENSE.TXT
index 53352e42dd1..c278f2c9283 100644
--- a/chromium/buildtools/third_party/libc++/trunk/LICENSE.TXT
+++ b/chromium/buildtools/third_party/libc++/trunk/LICENSE.TXT
@@ -14,7 +14,7 @@ Full text of the relevant licenses is included below.
University of Illinois/NCSA
Open Source License
-Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
+Copyright (c) 2009-2017 by the contributors listed in CREDITS.TXT
All rights reserved.
diff --git a/chromium/buildtools/third_party/libc++/trunk/Makefile b/chromium/buildtools/third_party/libc++/trunk/Makefile
deleted file mode 100644
index ab7b5b603a0..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/Makefile
+++ /dev/null
@@ -1,56 +0,0 @@
-##
-# libc++ Makefile
-##
-
-SRCDIRS = .
-DESTDIR = $(DSTROOT)
-
-OBJROOT=.
-SYMROOT=.
-export TRIPLE=-apple-
-
-ifeq (,$(RC_INDIGO))
- INSTALL_PREFIX=""
-else
- INSTALL_PREFIX="$(SDKROOT)"
-endif
-INSTALL_DIR=$(DSTROOT)/$(INSTALL_PREFIX)
-
-.PHONY: help installsrc clean installheaders install
-
-help::
- @echo "Use make install DSTROOT=<destination>"
-
-installsrc:: $(SRCROOT)
-
- ditto $(SRCDIRS)/include $(SRCROOT)/include
- ditto $(SRCDIRS)/lib $(SRCROOT)/lib
- ditto $(SRCDIRS)/src $(SRCROOT)/src
- ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile
-
-clean::
-
-# The installheaders target is used by clang's runtime/libcxx makefile.
-installheaders::
- mkdir -p $(HEADER_DIR)/c++/v1/ext
- (cd $(SRCDIRS)/include && \
- tar cf - --exclude=".*" --exclude=support \
- --exclude=CMakeLists.txt *) | \
- (cd $(HEADER_DIR)/c++/v1 && tar xf -)
- chmod 755 $(HEADER_DIR)/c++/v1
- chmod 644 $(HEADER_DIR)/c++/v1/*
- chmod 755 $(HEADER_DIR)/c++/v1/ext
- chmod 644 $(HEADER_DIR)/c++/v1/ext/*
- chmod 755 $(HEADER_DIR)/c++/v1/experimental
- chmod 644 $(HEADER_DIR)/c++/v1/experimental/*
-
-install::
-
- cd lib && ./buildit
- ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
- cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM \
- $(SYMROOT)/usr/lib/libc++.1.dylib
- mkdir -p $(INSTALL_DIR)/usr/lib
- strip -S -o $(INSTALL_DIR)/usr/lib/libc++.1.dylib \
- $(SYMROOT)/usr/lib/libc++.1.dylib
- cd $(INSTALL_DIR)/usr/lib && ln -s libc++.1.dylib libc++.dylib
diff --git a/chromium/buildtools/third_party/libc++/trunk/NOTES.TXT b/chromium/buildtools/third_party/libc++/trunk/NOTES.TXT
new file mode 100644
index 00000000000..f0597de64ae
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/NOTES.TXT
@@ -0,0 +1,28 @@
+//===---------------------------------------------------------------------===//
+// Notes relating to various libc++ tasks
+//===---------------------------------------------------------------------===//
+
+This file contains notes about various libc++ tasks and processes.
+
+//===---------------------------------------------------------------------===//
+// Post-Release TODO
+//===---------------------------------------------------------------------===//
+
+These notes contain a list of things that must be done after branching for
+an LLVM release.
+
+1. Update _LIBCPP_VERSION in `__config`
+2. Update the __libcpp_version file.
+3. Update the version number in `docs/conf.py`
+4. Create ABI lists for the previous release under `lib/abi`
+
+//===---------------------------------------------------------------------===//
+// Adding a new header TODO
+//===---------------------------------------------------------------------===//
+
+These notes contain a list of things that must be done upon adding a new header
+to libc++.
+
+1. Add a test under `test/libcxx` that the header defines `_LIBCPP_VERSION`.
+2. Update `test/libcxx/double_include.sh.cpp` to include the new header.
+3. Create a submodule in `include/module.modulemap` for the new header.
diff --git a/chromium/buildtools/third_party/libc++/trunk/TODO.TXT b/chromium/buildtools/third_party/libc++/trunk/TODO.TXT
index bdb94de343d..652a38de75a 100644
--- a/chromium/buildtools/third_party/libc++/trunk/TODO.TXT
+++ b/chromium/buildtools/third_party/libc++/trunk/TODO.TXT
@@ -1,56 +1,76 @@
This is meant to be a general place to list things that should be done "someday"
-3.8 Release Goals
-=================
-* LFTS v1 (EricWF, MClow)
-* Filesystem TS (EricWF)
-* ASIO TS (MClow)
-* <regex> Improvements (MClow)
-* Setup ABI Versioning policy (EricWF)
-* Fix PR19302 - Fix UB in list and __tree.
-
-
-ABI Related Tasks
-=================
-* Explicitly manage and verify symbols exported from the dylib.
-* Explore using namespaces for managing symbol visibility.
-* Introduce and document ABI versioning/evolution policy.
-
CXX Runtime Library Tasks
=========================
-* Cleanup #ifdef hell in sources files that supports the different ABI libraries.
* Fix that CMake always link to /usr/lib/libc++abi.dylib on OS X.
-* Fix selection of ABI symbol list on OS X.
-* Have CMake generate linker scripts for libc++.so that it properly links the
- runtime library.
* Look into mirroring libsupc++'s typeinfo vtable layout when libsupc++/libstdc++
is used as the runtime library.
-* Audit libraries that CMake links into libc++. Are they all required?
* Investigate and document interoperability between libc++ and libstdc++ on
linux. Do this for every supported c++ runtime library.
Atomic Related Tasks
====================
-* Enable mixing of clang and GCC atomics internally. Currently some
- parts of libc++ use atomics only when clang provides them.
- (see memory@5380 for an example)
-* Audit use of libatomic builtins in <atomic> with GCC.
* future should use <atomic> for synchronization.
Test Suite Tasks
================
-* Move all libc++ specific tests from test/std into test/libcxx.
-* Improve how LIT handles compiler warnings.
* Improve the quality and portability of the locale test data.
* Convert failure tests to use Clang Verify.
+Filesystem Tasks
+================
+* P0492r2 - Implement National body comments for Filesystem
+ * INCOMPLETE - US 25: has_filename() is equivalent to just !empty()
+ * INCOMPLETE - US 31: Everything is defined in terms of one implicit host system
+ * INCOMPLETE - US 32: Meaning of 27.10.2.1 unclear
+ * INCOMPLETE - US 33: Definition of canonical path problematic
+ * INCOMPLETE - US 34: Are there attributes of a file that are not an aspect of the file system?
+ * INCOMPLETE - US 35: What synchronization is required to avoid a file system race?
+ * INCOMPLETE - US 36: Symbolic links themselves are attached to a directory via (hard) links
+ * INCOMPLETE - US 37: The term “redundant current directory (dot) elements” is not defined
+ * INCOMPLETE - US 38: Duplicates §17.3.16
+ * INCOMPLETE - US 39: Remove note: Dot and dot-dot are not directories
+ * INCOMPLETE - US 40: Not all directories have a parent.
+ * INCOMPLETE - US 41: The term “parent directory” for a (non-directory) file is unusual
+ * INCOMPLETE - US 42: Pathname resolution does not always resolve a symlink
+ * INCOMPLETE - US 43: Concerns about encoded character types
+ * INCOMPLETE - US 44: Definition of path in terms of a string requires leaky abstraction
+ * INCOMPLETE - US 45: Generic format portability compromised by unspecified root-name
+ * INCOMPLETE - US 46: filename can be empty so productions for relative-path are redundant
+ * INCOMPLETE - US 47: “.” and “..” already match the name production
+ * INCOMPLETE - US 48: Multiple separators are often meaningful in a root-name
+ * INCOMPLETE - US 49: What does “method of conversion method” mean?
+ * INCOMPLETE - US 50: 27.10.8.1 ¶ 1.4 largely redundant with ¶ 1.3
+ * INCOMPLETE - US 51: Failing to add / when appending empty string prevents useful apps
+ * INCOMPLETE - US 52: remove_filename() postcondition is not by itself a definition
+ * INCOMPLETE - US 53: remove_filename()'s name does not correspond to its behavior
+ * INCOMPLETE - US 54: remove_filename() is broken
+ * INCOMPLETE - US 55: replace_extension()'s use of path as parameter is inappropriate
+ * INCOMPLETE - US 56: Remove replace_extension()'s conditional addition of period
+ * INCOMPLETE - US 57: On Windows, absolute paths will sort in among relative paths
+ * INCOMPLETE - US 58: parent_path() behavior for root paths is useless
+ * INCOMPLETE - US 59: filename() returning path for single path components is bizarre
+ * INCOMPLETE - US 60: path("/foo/").filename()==path(".") is surprising
+ * INCOMPLETE - US 61: Leading dots in filename() should not begin an extension
+ * INCOMPLETE - US 62: It is important that stem()+extension()==filename()
+ * INCOMPLETE - US 63: lexically_normal() inconsistently treats trailing "/" but not "/.." as directory
+ * INCOMPLETE - US 73, CA 2: root-name is effectively implementation defined
+ * INCOMPLETE - US 74, CA 3: The term “pathname” is ambiguous in some contexts
+ * INCOMPLETE - US 75, CA 4: Extra flag in path constructors is needed
+ * INCOMPLETE - US 76, CA 5: root-name definition is over-specified.
+ * INCOMPLETE - US 77, CA 6: operator/ and other appends not useful if arg has root-name
+ * INCOMPLETE - US 78, CA 7: Member absolute() in 27.10.4.1 is overspecified for non-POSIX-like O/S
+ * INCOMPLETE - US 79, CA 8: Some operation functions are overspecified for implementation-defined file types
+ * INCOMPLETE - US 185: Fold error_code and non-error_code signatures into one signature
+ * INCOMPLETE - FI 14: directory_entry comparisons are members
+ * INCOMPLETE - Late 36: permissions() error_code overload should be noexcept
+ * INCOMPLETE - Late 37: permissions() actions should be separate parameter
+ * INCOMPLETE - Late 42: resize_file() Postcondition missing argument
+
Misc Tasks
==========
* Find all sequences of >2 underscores and eradicate them.
* run clang-tidy on libc++
* Document the "conditionally-supported" bits of libc++
* Look at basic_string's move assignment operator, re LWG 2063 and POCMA
-* libc++ is missing try_emplace
* Put a static_assert in std::allocator to deny const/volatile types (LWG 2447)
-* Document support (or lack of) for C++11 libraries in C++03.
-* Document supported compilers.
diff --git a/chromium/buildtools/third_party/libc++/trunk/appveyor-reqs-install.cmd b/chromium/buildtools/third_party/libc++/trunk/appveyor-reqs-install.cmd
new file mode 100644
index 00000000000..3a2087af51f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/appveyor-reqs-install.cmd
@@ -0,0 +1,53 @@
+@echo on
+
+if NOT EXIST C:\projects\deps (
+ mkdir C:\projects\deps
+)
+cd C:\projects\deps
+
+::###########################################################################
+:: Setup Compiler
+::###########################################################################
+if NOT EXIST llvm-installer.exe (
+ appveyor DownloadFile http://llvm.org/pre-releases/win-snapshots/LLVM-5.0.0-r301646-win32.exe -FileName llvm-installer.exe
+)
+if "%CLANG_VERSION%"=="ToT" (
+ START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM"
+)
+if DEFINED CLANG_VERSION @set PATH="C:\Program Files\LLVM\bin";%PATH%
+if DEFINED CLANG_VERSION clang-cl -v
+
+if DEFINED MINGW_PATH rename "C:\Program Files\Git\usr\bin\sh.exe" "sh-ignored.exe"
+if DEFINED MINGW_PATH @set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%"
+if DEFINED MINGW_PATH @set "PATH=%PATH%;%MINGW_PATH%"
+if DEFINED MINGW_PATH g++ -v
+
+::###########################################################################
+:: Install a recent CMake
+::###########################################################################
+if NOT EXIST cmake (
+ appveyor DownloadFile https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.zip -FileName cmake.zip
+ 7z x cmake.zip -oC:\projects\deps > nul
+ move C:\projects\deps\cmake-* C:\projects\deps\cmake
+ rm cmake.zip
+)
+@set PATH=C:\projects\deps\cmake\bin;%PATH%
+cmake --version
+
+::###########################################################################
+:: Install Ninja
+::###########################################################################
+if NOT EXIST ninja (
+ appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip -FileName ninja.zip
+ 7z x ninja.zip -oC:\projects\deps\ninja > nul
+ rm ninja.zip
+)
+@set PATH=C:\projects\deps\ninja;%PATH%
+ninja --version
+
+::###########################################################################
+:: Setup the cached copy of LLVM
+::###########################################################################
+git clone --depth=1 http://llvm.org/git/llvm.git
+
+@echo off
diff --git a/chromium/buildtools/third_party/libc++/trunk/appveyor.yml b/chromium/buildtools/third_party/libc++/trunk/appveyor.yml
new file mode 100644
index 00000000000..be69a555d77
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/appveyor.yml
@@ -0,0 +1,78 @@
+version: '{build}'
+
+shallow_clone: true
+
+build:
+ verbosity: detailed
+
+configuration:
+ - Debug
+
+environment:
+ matrix:
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+ CMAKE_OPTIONS: -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe
+ CLANG_VERSION: ToT
+ MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
+ MSVC_SETUP_ARG: x86
+ GENERATOR: Ninja
+ MAKE_PROGRAM: ninja
+ APPVEYOR_SAVE_CACHE_ON_ERROR: true
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+ CMAKE_OPTIONS: -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe
+ CLANG_VERSION: 4
+ MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
+ MSVC_SETUP_ARG: x86_amd64
+ GENERATOR: Ninja
+ MAKE_PROGRAM: ninja
+ APPVEYOR_SAVE_CACHE_ON_ERROR: true
+ - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+ MINGW_PATH: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
+ GENERATOR: MinGW Makefiles
+ MAKE_PROGRAM: mingw32-make
+ APPVEYOR_SAVE_CACHE_ON_ERROR: true
+
+install:
+ ############################################################################
+ # All external dependencies are installed in C:\projects\deps
+ ############################################################################
+ - call "%APPVEYOR_BUILD_FOLDER%\\appveyor-reqs-install.cmd"
+
+before_build:
+ - if DEFINED MSVC_SETUP_PATH call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG%
+ - cd %APPVEYOR_BUILD_FOLDER%
+
+build_script:
+ - md C:\projects\build-libcxx
+ - cd C:\projects\build-libcxx
+ - echo %configuration%
+
+ #############################################################################
+ # Configuration Step
+ #############################################################################
+ - cmake -G "%GENERATOR%" %CMAKE_OPTIONS%
+ "-DCMAKE_BUILD_TYPE=%configuration%"
+ "-DLLVM_PATH=C:\projects\deps\llvm" -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
+ -DLLVM_LIT_ARGS="-sv --show-xfail --show-unsupported"
+ %APPVEYOR_BUILD_FOLDER%
+
+ #############################################################################
+ # Build Step
+ #############################################################################
+ - "%MAKE_PROGRAM%"
+
+test_script:
+ - "%MAKE_PROGRAM% check-cxx"
+
+on_failure:
+ - appveyor PushArtifact CMakeFiles/CMakeOutput.log
+ - appveyor PushArtifact CMakeFiles/CMakeError.log
+
+artifacts:
+ - path: '_build/CMakeFiles/*.log'
+ name: logs
+
+cache:
+ - C:\projects\deps\ninja
+ - C:\projects\deps\cmake
+ - C:\projects\deps\llvm-installer.exe
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/CMakeLists.txt b/chromium/buildtools/third_party/libc++/trunk/benchmarks/CMakeLists.txt
new file mode 100644
index 00000000000..8211ebd009a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/CMakeLists.txt
@@ -0,0 +1,156 @@
+include(ExternalProject)
+include(CheckCXXCompilerFlag)
+
+#==============================================================================
+# Build Google Benchmark for libc++
+#==============================================================================
+
+set(BENCHMARK_LIBCXX_COMPILE_FLAGS
+ -Wno-unused-command-line-argument
+ -nostdinc++
+ -isystem ${LIBCXX_SOURCE_DIR}/include
+ -L${LIBCXX_LIBRARY_DIR}
+ -Wl,-rpath,${LIBCXX_LIBRARY_DIR}
+ )
+if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH)
+ list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS
+ -L${LIBCXX_CXX_ABI_LIBRARY_PATH}
+ -Wl,-rpath,${LIBCXX_CXX_ABI_LIBRARY_PATH})
+endif()
+split_list(BENCHMARK_LIBCXX_COMPILE_FLAGS)
+
+ExternalProject_Add(google-benchmark-libcxx
+ EXCLUDE_FROM_ALL ON
+ DEPENDS cxx
+ PREFIX benchmark-libcxx
+ SOURCE_DIR ${LIBCXX_SOURCE_DIR}/utils/google-benchmark
+ INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx
+ CMAKE_CACHE_ARGS
+ -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
+ -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
+ -DCMAKE_BUILD_TYPE:STRING=RELEASE
+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DCMAKE_CXX_FLAGS:STRING=${BENCHMARK_LIBCXX_COMPILE_FLAGS}
+ -DBENCHMARK_USE_LIBCXX:BOOL=ON
+ -DBENCHMARK_ENABLE_TESTING:BOOL=OFF)
+
+#==============================================================================
+# Build Google Benchmark for the native stdlib
+#==============================================================================
+set(BENCHMARK_NATIVE_TARGET_FLAGS)
+if (LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN)
+ set(BENCHMARK_NATIVE_TARGET_FLAGS
+ -gcc-toolchain ${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN})
+endif()
+split_list(BENCHMARK_NATIVE_TARGET_FLAGS)
+
+if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
+ ExternalProject_Add(google-benchmark-native
+ EXCLUDE_FROM_ALL ON
+ PREFIX benchmark-native
+ SOURCE_DIR ${LIBCXX_SOURCE_DIR}/utils/google-benchmark
+ INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native
+ CMAKE_CACHE_ARGS
+ -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
+ -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
+ -DCMAKE_CXX_FLAGS:STRING=${BENCHMARK_NATIVE_TARGET_FLAGS}
+ -DCMAKE_BUILD_TYPE:STRING=RELEASE
+ -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DBENCHMARK_ENABLE_TESTING:BOOL=OFF)
+endif()
+
+#==============================================================================
+# Benchmark tests configuration
+#==============================================================================
+add_custom_target(cxx-benchmarks)
+set(BENCHMARK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx)
+set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native)
+set(BENCHMARK_TEST_COMPILE_FLAGS
+ -std=c++14 -O2
+ -I${BENCHMARK_LIBCXX_INSTALL}/include
+ -I${LIBCXX_SOURCE_DIR}/test/support
+)
+set(BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS
+ -nostdinc++
+ -isystem ${LIBCXX_SOURCE_DIR}/include
+ ${BENCHMARK_TEST_COMPILE_FLAGS}
+ -Wno-user-defined-literals
+)
+set(BENCHMARK_TEST_LIBCXX_LINK_FLAGS
+ -nodefaultlibs
+ -L${BENCHMARK_LIBCXX_INSTALL}/lib/
+)
+set(BENCHMARK_TEST_NATIVE_COMPILE_FLAGS
+ ${BENCHMARK_NATIVE_TARGET_FLAGS}
+ ${BENCHMARK_TEST_COMPILE_FLAGS}
+)
+set(BENCHMARK_TEST_NATIVE_LINK_FLAGS
+ ${BENCHMARK_NATIVE_TARGET_FLAGS}
+ -L${BENCHMARK_NATIVE_INSTALL}/lib
+)
+split_list(BENCHMARK_TEST_COMPILE_FLAGS)
+split_list(BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS)
+split_list(BENCHMARK_TEST_LIBCXX_LINK_FLAGS)
+split_list(BENCHMARK_TEST_NATIVE_COMPILE_FLAGS)
+split_list(BENCHMARK_TEST_NATIVE_LINK_FLAGS)
+macro(add_benchmark_test name source_file)
+ set(libcxx_target ${name}_libcxx)
+ add_executable(${libcxx_target} EXCLUDE_FROM_ALL ${source_file})
+ add_dependencies(${libcxx_target} cxx google-benchmark-libcxx)
+ add_dependencies(cxx-benchmarks ${libcxx_target})
+ if (LIBCXX_ENABLE_SHARED)
+ target_link_libraries(${libcxx_target} cxx_shared)
+ else()
+ target_link_libraries(${libcxx_target} cxx_static)
+ endif()
+ if (TARGET cxx_experimental)
+ target_link_libraries(${libcxx_target} cxx_experimental)
+ endif()
+ target_link_libraries(${libcxx_target} -lbenchmark)
+ set_target_properties(${libcxx_target}
+ PROPERTIES
+ OUTPUT_NAME "${name}.libcxx.out"
+ RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}"
+ COMPILE_FLAGS "${BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS}"
+ LINK_FLAGS "${BENCHMARK_TEST_LIBCXX_LINK_FLAGS}")
+ if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
+ set(native_target ${name}_native)
+ add_executable(${native_target} EXCLUDE_FROM_ALL ${source_file})
+ add_dependencies(${native_target} google-benchmark-native
+ google-benchmark-libcxx)
+ target_link_libraries(${native_target} -lbenchmark)
+ if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++")
+ target_link_libraries(${native_target} -lstdc++fs)
+ elseif (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++")
+ target_link_libraries(${native_target} -lc++experimental)
+ endif()
+ if (LIBCXX_HAS_PTHREAD_LIB)
+ target_link_libraries(${native_target} -pthread)
+ endif()
+ add_dependencies(cxx-benchmarks ${native_target})
+ set_target_properties(${native_target}
+ PROPERTIES
+ OUTPUT_NAME "${name}.native.out"
+ RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}"
+ INCLUDE_DIRECTORIES ""
+ COMPILE_FLAGS "${BENCHMARK_TEST_NATIVE_COMPILE_FLAGS}"
+ LINK_FLAGS "${BENCHMARK_TEST_NATIVE_LINK_FLAGS}")
+ endif()
+endmacro()
+
+
+#==============================================================================
+# Register Benchmark tests
+#==============================================================================
+file(GLOB BENCHMARK_TESTS "*.bench.cpp")
+foreach(test_path ${BENCHMARK_TESTS})
+ get_filename_component(test_file "${test_path}" NAME)
+ string(REPLACE ".bench.cpp" "" test_name "${test_file}")
+ if (NOT DEFINED ${test_name}_REPORTED)
+ message(STATUS "Adding Benchmark: ${test_file}")
+ # Only report the adding of the benchmark once.
+ set(${test_name}_REPORTED ON CACHE INTERNAL "")
+ endif()
+ add_benchmark_test(${test_name} ${test_file})
+endforeach()
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/ContainerBenchmarks.hpp b/chromium/buildtools/third_party/libc++/trunk/benchmarks/ContainerBenchmarks.hpp
new file mode 100644
index 00000000000..dc268e7ebca
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/ContainerBenchmarks.hpp
@@ -0,0 +1,113 @@
+#ifndef BENCHMARK_CONTAINER_BENCHMARKS_HPP
+#define BENCHMARK_CONTAINER_BENCHMARKS_HPP
+
+#include <cassert>
+
+#include "benchmark/benchmark_api.h"
+
+namespace ContainerBenchmarks {
+
+
+template <class Container, class GenInputs>
+void BM_ConstructIterIter(benchmark::State& st, Container, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto begin = in.begin();
+ const auto end = in.end();
+ benchmark::DoNotOptimize(&in);
+ while (st.KeepRunning()) {
+ Container c(begin, end);
+ benchmark::DoNotOptimize(c.data());
+ }
+}
+
+template <class Container, class GenInputs>
+void BM_InsertValue(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.end();
+ while (st.KeepRunning()) {
+ c.clear();
+ for (auto it = in.begin(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.insert(*it).first));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+template <class Container, class GenInputs>
+void BM_InsertValueRehash(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.end();
+ while (st.KeepRunning()) {
+ c.clear();
+ c.rehash(16);
+ for (auto it = in.begin(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.insert(*it).first));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+
+template <class Container, class GenInputs>
+void BM_InsertDuplicate(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.end();
+ c.insert(in.begin(), in.end());
+ benchmark::DoNotOptimize(&c);
+ benchmark::DoNotOptimize(&in);
+ while (st.KeepRunning()) {
+ for (auto it = in.begin(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.insert(*it).first));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+
+template <class Container, class GenInputs>
+void BM_EmplaceDuplicate(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.end();
+ c.insert(in.begin(), in.end());
+ benchmark::DoNotOptimize(&c);
+ benchmark::DoNotOptimize(&in);
+ while (st.KeepRunning()) {
+ for (auto it = in.begin(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.emplace(*it).first));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+template <class Container, class GenInputs>
+static void BM_Find(benchmark::State& st, Container c, GenInputs gen) {
+ auto in = gen(st.range(0));
+ c.insert(in.begin(), in.end());
+ benchmark::DoNotOptimize(&(*c.begin()));
+ const auto end = in.data() + in.size();
+ while (st.KeepRunning()) {
+ for (auto it = in.data(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.find(*it)));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+template <class Container, class GenInputs>
+static void BM_FindRehash(benchmark::State& st, Container c, GenInputs gen) {
+ c.rehash(8);
+ auto in = gen(st.range(0));
+ c.insert(in.begin(), in.end());
+ benchmark::DoNotOptimize(&(*c.begin()));
+ const auto end = in.data() + in.size();
+ while (st.KeepRunning()) {
+ for (auto it = in.data(); it != end; ++it) {
+ benchmark::DoNotOptimize(&(*c.find(*it)));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+} // end namespace ContainerBenchmarks
+
+#endif // BENCHMARK_CONTAINER_BENCHMARKS_HPP
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/GenerateInput.hpp b/chromium/buildtools/third_party/libc++/trunk/benchmarks/GenerateInput.hpp
new file mode 100644
index 00000000000..9d5adac4af4
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/GenerateInput.hpp
@@ -0,0 +1,142 @@
+#ifndef BENCHMARK_GENERATE_INPUT_HPP
+#define BENCHMARK_GENERATE_INPUT_HPP
+
+#include <algorithm>
+#include <random>
+#include <vector>
+#include <string>
+#include <climits>
+#include <cstddef>
+
+static const char Letters[] = {
+ '0','1','2','3','4',
+ '5','6','7','8','9',
+ 'A','B','C','D','E','F',
+ 'G','H','I','J','K',
+ 'L','M','N','O','P',
+ 'Q','R','S','T','U',
+ 'V','W','X','Y','Z',
+ 'a','b','c','d','e','f',
+ 'g','h','i','j','k',
+ 'l','m','n','o','p',
+ 'q','r','s','t','u',
+ 'v','w','x','y','z'
+};
+static const std::size_t LettersSize = sizeof(Letters);
+
+inline std::default_random_engine& getRandomEngine() {
+ static std::default_random_engine RandEngine(std::random_device{}());
+ return RandEngine;
+}
+
+inline char getRandomChar() {
+ std::uniform_int_distribution<> LettersDist(0, LettersSize-1);
+ return Letters[LettersDist(getRandomEngine())];
+}
+
+template <class IntT>
+inline IntT getRandomInteger() {
+ std::uniform_int_distribution<IntT> dist;
+ return dist(getRandomEngine());
+}
+
+inline std::string getRandomString(std::size_t Len) {
+ std::string str(Len, 0);
+ std::generate_n(str.begin(), Len, &getRandomChar);
+ return str;
+}
+
+template <class IntT>
+inline std::vector<IntT> getDuplicateIntegerInputs(size_t N) {
+ std::vector<IntT> inputs(N, static_cast<IntT>(-1));
+ return inputs;
+}
+
+template <class IntT>
+inline std::vector<IntT> getSortedIntegerInputs(size_t N) {
+ std::vector<IntT> inputs;
+ for (size_t i=0; i < N; i += 1)
+ inputs.push_back(i);
+ return inputs;
+}
+
+template <class IntT>
+std::vector<IntT> getSortedLargeIntegerInputs(size_t N) {
+ std::vector<IntT> inputs;
+ for (size_t i=0; i < N; ++i) {
+ inputs.push_back(i + N);
+ }
+ return inputs;
+}
+
+template <class IntT>
+std::vector<IntT> getSortedTopBitsIntegerInputs(size_t N) {
+ std::vector<IntT> inputs = getSortedIntegerInputs<IntT>(N);
+ for (auto& E : inputs) E <<= ((sizeof(IntT) / 2) * CHAR_BIT);
+ return inputs;
+}
+
+template <class IntT>
+inline std::vector<IntT> getReverseSortedIntegerInputs(size_t N) {
+ std::vector<IntT> inputs;
+ std::size_t i = N;
+ while (i > 0) {
+ --i;
+ inputs.push_back(i);
+ }
+ return inputs;
+}
+
+template <class IntT>
+std::vector<IntT> getPipeOrganIntegerInputs(size_t N) {
+ std::vector<IntT> v; v.reserve(N);
+ for (size_t i = 0; i < N/2; ++i) v.push_back(i);
+ for (size_t i = N/2; i < N; ++i) v.push_back(N - i);
+ return v;
+}
+
+
+template <class IntT>
+std::vector<IntT> getRandomIntegerInputs(size_t N) {
+ std::vector<IntT> inputs;
+ for (size_t i=0; i < N; ++i) {
+ inputs.push_back(getRandomInteger<IntT>());
+ }
+ return inputs;
+}
+
+inline std::vector<std::string> getDuplicateStringInputs(size_t N) {
+ std::vector<std::string> inputs(N, getRandomString(1024));
+ return inputs;
+}
+
+inline std::vector<std::string> getRandomStringInputs(size_t N) {
+ std::vector<std::string> inputs;
+ for (size_t i=0; i < N; ++i) {
+ inputs.push_back(getRandomString(1024));
+ }
+ return inputs;
+}
+
+inline std::vector<std::string> getSortedStringInputs(size_t N) {
+ std::vector<std::string> inputs = getRandomStringInputs(N);
+ std::sort(inputs.begin(), inputs.end());
+ return inputs;
+}
+
+inline std::vector<std::string> getReverseSortedStringInputs(size_t N) {
+ std::vector<std::string> inputs = getSortedStringInputs(N);
+ std::reverse(inputs.begin(), inputs.end());
+ return inputs;
+}
+
+inline std::vector<const char*> getRandomCStringInputs(size_t N) {
+ static std::vector<std::string> inputs = getRandomStringInputs(N);
+ std::vector<const char*> cinputs;
+ for (auto const& str : inputs)
+ cinputs.push_back(str.c_str());
+ return cinputs;
+}
+
+
+#endif // BENCHMARK_GENERATE_INPUT_HPP
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/algorithms.bench.cpp b/chromium/buildtools/third_party/libc++/trunk/benchmarks/algorithms.bench.cpp
new file mode 100644
index 00000000000..745cc172718
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/algorithms.bench.cpp
@@ -0,0 +1,62 @@
+#include <unordered_set>
+#include <vector>
+#include <cstdint>
+
+#include "benchmark/benchmark_api.h"
+#include "GenerateInput.hpp"
+
+constexpr std::size_t TestNumInputs = 1024;
+
+template <class GenInputs>
+void BM_Sort(benchmark::State& st, GenInputs gen) {
+ using ValueType = typename decltype(gen(0))::value_type;
+ const auto in = gen(st.range(0));
+ std::vector<ValueType> inputs[5];
+ auto reset_inputs = [&]() {
+ for (auto& C : inputs) {
+ C = in;
+ benchmark::DoNotOptimize(C.data());
+ }
+ };
+ reset_inputs();
+ while (st.KeepRunning()) {
+ for (auto& I : inputs) {
+ std::sort(I.data(), I.data() + I.size());
+ benchmark::DoNotOptimize(I.data());
+ }
+ st.PauseTiming();
+ reset_inputs();
+ benchmark::ClobberMemory();
+ st.ResumeTiming();
+ }
+}
+
+BENCHMARK_CAPTURE(BM_Sort, random_uint32,
+ getRandomIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, sorted_ascending_uint32,
+ getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, sorted_descending_uint32,
+ getReverseSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, single_element_uint32,
+ getDuplicateIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, pipe_organ_uint32,
+ getPipeOrganIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, random_strings,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, sorted_ascending_strings,
+ getSortedStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, sorted_descending_strings,
+ getReverseSortedStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Sort, single_element_strings,
+ getDuplicateStringInputs)->Arg(TestNumInputs);
+
+
+BENCHMARK_MAIN()
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/filesystem.bench.cpp b/chromium/buildtools/third_party/libc++/trunk/benchmarks/filesystem.bench.cpp
new file mode 100644
index 00000000000..f7949a163a7
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/filesystem.bench.cpp
@@ -0,0 +1,138 @@
+#include <experimental/filesystem>
+
+#include "benchmark/benchmark_api.h"
+#include "GenerateInput.hpp"
+#include "test_iterators.h"
+
+namespace fs = std::experimental::filesystem;
+
+static const size_t TestNumInputs = 1024;
+
+
+template <class GenInputs>
+void BM_PathConstructString(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ const path P(PP.native());
+ benchmark::DoNotOptimize(P.native().data());
+ }
+}
+BENCHMARK_CAPTURE(BM_PathConstructString, large_string,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+template <class GenInputs>
+void BM_PathConstructCStr(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ const path P(PP.native().c_str());
+ benchmark::DoNotOptimize(P.native().data());
+ }
+}
+BENCHMARK_CAPTURE(BM_PathConstructCStr, large_string,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+template <template <class...> class ItType, class GenInputs>
+void BM_PathConstructIter(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ using Iter = ItType<std::string::const_iterator>;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ auto Start = Iter(PP.native().begin());
+ auto End = Iter(PP.native().end());
+ benchmark::DoNotOptimize(PP.native().data());
+ benchmark::DoNotOptimize(Start);
+ benchmark::DoNotOptimize(End);
+ while (st.KeepRunning()) {
+ const path P(Start, End);
+ benchmark::DoNotOptimize(P.native().data());
+ }
+}
+template <class GenInputs>
+void BM_PathConstructInputIter(benchmark::State &st, GenInputs gen) {
+ BM_PathConstructIter<input_iterator>(st, gen);
+}
+template <class GenInputs>
+void BM_PathConstructForwardIter(benchmark::State &st, GenInputs gen) {
+ BM_PathConstructIter<forward_iterator>(st, gen);
+}
+BENCHMARK_CAPTURE(BM_PathConstructInputIter, large_string,
+ getRandomStringInputs)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_PathConstructForwardIter, large_string,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+template <class GenInputs>
+void BM_PathIterateMultipleTimes(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ for (auto &E : PP) {
+ benchmark::DoNotOptimize(E.native().data());
+ }
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK_CAPTURE(BM_PathIterateMultipleTimes, iterate_elements,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+template <class GenInputs>
+void BM_PathIterateOnce(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ const path P = PP.native();
+ for (auto &E : P) {
+ benchmark::DoNotOptimize(E.native().data());
+ }
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK_CAPTURE(BM_PathIterateOnce, iterate_elements,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+template <class GenInputs>
+void BM_PathIterateOnceBackwards(benchmark::State &st, GenInputs gen) {
+ using namespace fs;
+ const auto in = gen(st.range(0));
+ path PP;
+ for (auto& Part : in)
+ PP /= Part;
+ benchmark::DoNotOptimize(PP.native().data());
+ while (st.KeepRunning()) {
+ const path P = PP.native();
+ const auto B = P.begin();
+ auto I = P.end();
+ while (I != B) {
+ --I;
+ benchmark::DoNotOptimize(*I);
+ }
+ benchmark::DoNotOptimize(*I);
+ }
+}
+BENCHMARK_CAPTURE(BM_PathIterateOnceBackwards, iterate_elements,
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_MAIN()
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/string.bench.cpp b/chromium/buildtools/third_party/libc++/trunk/benchmarks/string.bench.cpp
new file mode 100644
index 00000000000..ef892391688
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/string.bench.cpp
@@ -0,0 +1,49 @@
+#include <unordered_set>
+#include <vector>
+#include <cstdint>
+
+#include "benchmark/benchmark_api.h"
+#include "GenerateInput.hpp"
+
+constexpr std::size_t MAX_STRING_LEN = 8 << 14;
+
+// Benchmark when there is no match.
+static void BM_StringFindNoMatch(benchmark::State &state) {
+ std::string s1(state.range(0), '-');
+ std::string s2(8, '*');
+ while (state.KeepRunning())
+ benchmark::DoNotOptimize(s1.find(s2));
+}
+BENCHMARK(BM_StringFindNoMatch)->Range(10, MAX_STRING_LEN);
+
+// Benchmark when the string matches first time.
+static void BM_StringFindAllMatch(benchmark::State &state) {
+ std::string s1(MAX_STRING_LEN, '-');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning())
+ benchmark::DoNotOptimize(s1.find(s2));
+}
+BENCHMARK(BM_StringFindAllMatch)->Range(1, MAX_STRING_LEN);
+
+// Benchmark when the string matches somewhere in the end.
+static void BM_StringFindMatch1(benchmark::State &state) {
+ std::string s1(MAX_STRING_LEN / 2, '*');
+ s1 += std::string(state.range(0), '-');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning())
+ benchmark::DoNotOptimize(s1.find(s2));
+}
+BENCHMARK(BM_StringFindMatch1)->Range(1, MAX_STRING_LEN / 4);
+
+// Benchmark when the string matches somewhere from middle to the end.
+static void BM_StringFindMatch2(benchmark::State &state) {
+ std::string s1(MAX_STRING_LEN / 2, '*');
+ s1 += std::string(state.range(0), '-');
+ s1 += std::string(state.range(0), '*');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning())
+ benchmark::DoNotOptimize(s1.find(s2));
+}
+BENCHMARK(BM_StringFindMatch2)->Range(1, MAX_STRING_LEN / 4);
+
+BENCHMARK_MAIN()
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/unordered_set_operations.bench.cpp b/chromium/buildtools/third_party/libc++/trunk/benchmarks/unordered_set_operations.bench.cpp
new file mode 100644
index 00000000000..e2afdde56dc
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/unordered_set_operations.bench.cpp
@@ -0,0 +1,306 @@
+#include <unordered_set>
+#include <vector>
+#include <functional>
+#include <cstdint>
+#include <cstdlib>
+#include <cstring>
+
+#include "benchmark/benchmark_api.h"
+
+#include "ContainerBenchmarks.hpp"
+#include "GenerateInput.hpp"
+
+using namespace ContainerBenchmarks;
+
+constexpr std::size_t TestNumInputs = 1024;
+
+template <class _Size>
+inline __attribute__((__always_inline__))
+_Size loadword(const void* __p) {
+ _Size __r;
+ std::memcpy(&__r, __p, sizeof(__r));
+ return __r;
+}
+
+inline __attribute__((__always_inline__))
+std::size_t rotate_by_at_least_1(std::size_t __val, int __shift) {
+ return (__val >> __shift) | (__val << (64 - __shift));
+}
+
+inline __attribute__((__always_inline__))
+std::size_t hash_len_16(std::size_t __u, std::size_t __v) {
+ const std::size_t __mul = 0x9ddfea08eb382d69ULL;
+ std::size_t __a = (__u ^ __v) * __mul;
+ __a ^= (__a >> 47);
+ std::size_t __b = (__v ^ __a) * __mul;
+ __b ^= (__b >> 47);
+ __b *= __mul;
+ return __b;
+}
+
+
+template <std::size_t _Len>
+inline __attribute__((__always_inline__))
+std::size_t hash_len_0_to_8(const char* __s) {
+ static_assert(_Len == 4 || _Len == 8, "");
+ const uint64_t __a = loadword<uint32_t>(__s);
+ const uint64_t __b = loadword<uint32_t>(__s + _Len - 4);
+ return hash_len_16(_Len + (__a << 3), __b);
+}
+
+struct UInt32Hash {
+ UInt32Hash() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(uint32_t data) const {
+ return hash_len_0_to_8<4>(reinterpret_cast<const char*>(&data));
+ }
+};
+
+struct UInt64Hash {
+ UInt64Hash() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(uint64_t data) const {
+ return hash_len_0_to_8<8>(reinterpret_cast<const char*>(&data));
+ }
+};
+
+struct UInt128Hash {
+ UInt128Hash() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(__uint128_t data) const {
+ const __uint128_t __mask = static_cast<std::size_t>(-1);
+ const std::size_t __a = (std::size_t)(data & __mask);
+ const std::size_t __b = (std::size_t)((data & (__mask << 64)) >> 64);
+ return hash_len_16(__a, rotate_by_at_least_1(__b + 16, 16)) ^ __b;
+ }
+};
+
+struct UInt32Hash2 {
+ UInt32Hash2() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(uint32_t data) const {
+ const uint32_t __m = 0x5bd1e995;
+ const uint32_t __r = 24;
+ uint32_t __h = 4;
+ uint32_t __k = data;
+ __k *= __m;
+ __k ^= __k >> __r;
+ __k *= __m;
+ __h *= __m;
+ __h ^= __k;
+ __h ^= __h >> 13;
+ __h *= __m;
+ __h ^= __h >> 15;
+ return __h;
+ }
+};
+
+struct UInt64Hash2 {
+ UInt64Hash2() = default;
+ inline __attribute__((__always_inline__))
+ std::size_t operator()(uint64_t data) const {
+ return hash_len_0_to_8<8>(reinterpret_cast<const char*>(&data));
+ }
+};
+
+//----------------------------------------------------------------------------//
+// BM_Hash
+// ---------------------------------------------------------------------------//
+
+template <class HashFn, class GenInputs>
+void BM_Hash(benchmark::State& st, HashFn fn, GenInputs gen) {
+ auto in = gen(st.range(0));
+ const auto end = in.data() + in.size();
+ std::size_t last_hash = 0;
+ benchmark::DoNotOptimize(&last_hash);
+ while (st.KeepRunning()) {
+ for (auto it = in.data(); it != end; ++it) {
+ benchmark::DoNotOptimize(last_hash += fn(*it));
+ }
+ benchmark::ClobberMemory();
+ }
+}
+
+BENCHMARK_CAPTURE(BM_Hash,
+ uint32_random_std_hash,
+ std::hash<uint32_t>{},
+ getRandomIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Hash,
+ uint32_random_custom_hash,
+ UInt32Hash{},
+ getRandomIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Hash,
+ uint32_top_std_hash,
+ std::hash<uint32_t>{},
+ getSortedTopBitsIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_Hash,
+ uint32_top_custom_hash,
+ UInt32Hash{},
+ getSortedTopBitsIntegerInputs<uint32_t>) -> Arg(TestNumInputs);
+
+
+//----------------------------------------------------------------------------//
+// BM_InsertValue
+// ---------------------------------------------------------------------------//
+
+
+// Sorted Assending //
+BENCHMARK_CAPTURE(BM_InsertValue,
+ unordered_set_uint32,
+ std::unordered_set<uint32_t>{},
+ getRandomIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertValue,
+ unordered_set_uint32_sorted,
+ std::unordered_set<uint32_t>{},
+ getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+// Top Bytes //
+BENCHMARK_CAPTURE(BM_InsertValue,
+ unordered_set_top_bits_uint32,
+ std::unordered_set<uint32_t>{},
+ getSortedTopBitsIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertValueRehash,
+ unordered_set_top_bits_uint32,
+ std::unordered_set<uint32_t, UInt32Hash>{},
+ getSortedTopBitsIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+// String //
+BENCHMARK_CAPTURE(BM_InsertValue,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertValueRehash,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+//----------------------------------------------------------------------------//
+// BM_Find
+// ---------------------------------------------------------------------------//
+
+// Random //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_random_uint64,
+ std::unordered_set<uint64_t>{},
+ getRandomIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_random_uint64,
+ std::unordered_set<uint64_t, UInt64Hash>{},
+ getRandomIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+// Sorted //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_sorted_uint64,
+ std::unordered_set<uint64_t>{},
+ getSortedIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_sorted_uint64,
+ std::unordered_set<uint64_t, UInt64Hash>{},
+ getSortedIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+
+// Sorted //
+#if 1
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_sorted_uint128,
+ std::unordered_set<__uint128_t, UInt128Hash>{},
+ getSortedTopBitsIntegerInputs<__uint128_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_sorted_uint128,
+ std::unordered_set<__uint128_t, UInt128Hash>{},
+ getSortedTopBitsIntegerInputs<__uint128_t>)->Arg(TestNumInputs);
+#endif
+
+// Sorted //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_sorted_uint32,
+ std::unordered_set<uint32_t>{},
+ getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_sorted_uint32,
+ std::unordered_set<uint32_t, UInt32Hash2>{},
+ getSortedIntegerInputs<uint32_t>)->Arg(TestNumInputs);
+
+// Sorted Ascending //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_sorted_large_uint64,
+ std::unordered_set<uint64_t>{},
+ getSortedLargeIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_sorted_large_uint64,
+ std::unordered_set<uint64_t, UInt64Hash>{},
+ getSortedLargeIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+
+// Top Bits //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_top_bits_uint64,
+ std::unordered_set<uint64_t>{},
+ getSortedTopBitsIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_top_bits_uint64,
+ std::unordered_set<uint64_t, UInt64Hash>{},
+ getSortedTopBitsIntegerInputs<uint64_t>)->Arg(TestNumInputs);
+
+// String //
+BENCHMARK_CAPTURE(BM_Find,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_FindRehash,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+///////////////////////////////////////////////////////////////////////////////
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_int,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_int,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_string,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_int_insert_arg,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<int>)->Arg(TestNumInputs);
+BENCHMARK_CAPTURE(BM_InsertDuplicate,
+ unordered_set_string_insert_arg,
+ std::unordered_set<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_int_insert_arg,
+ std::unordered_set<int>{},
+ getRandomIntegerInputs<unsigned>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_EmplaceDuplicate,
+ unordered_set_string_arg,
+ std::unordered_set<std::string>{},
+ getRandomCStringInputs)->Arg(TestNumInputs);
+
+BENCHMARK_MAIN()
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/util_smartptr.bench.cpp b/chromium/buildtools/third_party/libc++/trunk/benchmarks/util_smartptr.bench.cpp
new file mode 100644
index 00000000000..ad3f03a0448
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/util_smartptr.bench.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <memory>
+
+#include "benchmark/benchmark_api.h"
+
+static void BM_SharedPtrCreateDestroy(benchmark::State& st) {
+ while (st.KeepRunning()) {
+ auto sp = std::make_shared<int>(42);
+ benchmark::DoNotOptimize(sp.get());
+ }
+}
+BENCHMARK(BM_SharedPtrCreateDestroy);
+
+static void BM_SharedPtrIncDecRef(benchmark::State& st) {
+ auto sp = std::make_shared<int>(42);
+ benchmark::DoNotOptimize(sp.get());
+ while (st.KeepRunning()) {
+ std::shared_ptr<int> sp2(sp);
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK(BM_SharedPtrIncDecRef);
+
+static void BM_WeakPtrIncDecRef(benchmark::State& st) {
+ auto sp = std::make_shared<int>(42);
+ benchmark::DoNotOptimize(sp.get());
+ while (st.KeepRunning()) {
+ std::weak_ptr<int> wp(sp);
+ benchmark::ClobberMemory();
+ }
+}
+BENCHMARK(BM_WeakPtrIncDecRef);
+
+BENCHMARK_MAIN()
diff --git a/chromium/buildtools/third_party/libc++/trunk/benchmarks/vector_operations.bench.cpp b/chromium/buildtools/third_party/libc++/trunk/benchmarks/vector_operations.bench.cpp
new file mode 100644
index 00000000000..004e801f0be
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/benchmarks/vector_operations.bench.cpp
@@ -0,0 +1,32 @@
+#include <vector>
+#include <functional>
+#include <cstdint>
+#include <cstdlib>
+#include <cstring>
+
+#include "benchmark/benchmark_api.h"
+
+#include "ContainerBenchmarks.hpp"
+#include "GenerateInput.hpp"
+
+using namespace ContainerBenchmarks;
+
+constexpr std::size_t TestNumInputs = 1024;
+
+BENCHMARK_CAPTURE(BM_ConstructIterIter,
+ vector_char,
+ std::vector<char>{},
+ getRandomIntegerInputs<char>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_ConstructIterIter,
+ vector_size_t,
+ std::vector<size_t>{},
+ getRandomIntegerInputs<size_t>)->Arg(TestNumInputs);
+
+BENCHMARK_CAPTURE(BM_ConstructIterIter,
+ vector_string,
+ std::vector<std::string>{},
+ getRandomStringInputs)->Arg(TestNumInputs);
+
+
+BENCHMARK_MAIN()
diff --git a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CheckLibcxxAtomic.cmake b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
new file mode 100644
index 00000000000..a7ae667a155
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CheckLibcxxAtomic.cmake
@@ -0,0 +1,47 @@
+INCLUDE(CheckCXXSourceCompiles)
+
+# Sometimes linking against libatomic is required for atomic ops, if
+# the platform doesn't support lock-free atomics.
+#
+# We could modify LLVM's CheckAtomic module and have it check for 64-bit
+# atomics instead. However, we would like to avoid careless uses of 64-bit
+# atomics inside LLVM over time on 32-bit platforms.
+
+function(check_cxx_atomics varname)
+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ set(CMAKE_REQUIRED_FLAGS "-nodefaultlibs -std=c++11 -nostdinc++ -isystem ${LIBCXX_SOURCE_DIR}/include")
+ if (${LIBCXX_GCC_TOOLCHAIN})
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
+ endif()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
+ endif()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize-coverage OR CMAKE_CXX_FLAGS MATCHES -fsanitize-coverage)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters")
+ endif()
+ check_cxx_source_compiles("
+#include <cstdint>
+#include <atomic>
+std::atomic<uintptr_t> x;
+std::atomic<uintmax_t> y;
+int main() {
+ return x + y;
+}
+" ${varname})
+ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_cxx_atomics)
+
+check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
+check_library_exists(atomic __atomic_fetch_add_8 "" LIBCXX_HAS_ATOMIC_LIB)
+# If not, check if the library exists, and atomics work with it.
+if(NOT LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
+ if(LIBCXX_HAS_ATOMIC_LIB)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+ check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB)
+ if (NOT LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB)
+ message(WARNING "Host compiler must support std::atomic!")
+ endif()
+ else()
+ message(WARNING "Host compiler appears to require libatomic, but cannot find it.")
+ endif()
+endif()
diff --git a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CodeCoverage.cmake b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CodeCoverage.cmake
index addd10abdfe..1bd3a786812 100644
--- a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CodeCoverage.cmake
+++ b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/CodeCoverage.cmake
@@ -3,6 +3,11 @@ if (NOT CODE_COVERAGE_LCOV)
message(FATAL_ERROR "Cannot find lcov...")
endif()
+find_program(CODE_COVERAGE_LLVM_COV llvm-cov)
+if (NOT CODE_COVERAGE_LLVM_COV)
+ message(FATAL_ERROR "Cannot find llvm-cov...")
+endif()
+
find_program(CODE_COVERAGE_GENHTML genhtml)
if (NOT CODE_COVERAGE_GENHTML)
message(FATAL_ERROR "Cannot find genhtml...")
@@ -11,6 +16,14 @@ endif()
set(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 --coverage")
function(setup_lcov_test_target_coverage target_name output_dir capture_dirs source_dirs)
+ if (NOT DEFINED LIBCXX_BINARY_DIR)
+ message(FATAL_ERROR "Variable must be set")
+ endif()
+
+ set(GCOV_TOOL "${LIBCXX_BINARY_DIR}/llvm-cov-wrapper")
+ file(GENERATE OUTPUT ${GCOV_TOOL}
+ CONTENT "#!/usr/bin/env bash\n${CODE_COVERAGE_LLVM_COV} gcov \"$@\"\n")
+
file(MAKE_DIRECTORY ${output_dir})
set(CAPTURE_DIRS "")
@@ -27,8 +40,9 @@ function(setup_lcov_test_target_coverage target_name output_dir capture_dirs sou
message(STATUS "Extract Directories: ${EXTRACT_DIRS}")
add_custom_target(generate-lib${target_name}-coverage
- COMMAND ${CODE_COVERAGE_LCOV} --capture ${CAPTURE_DIRS} -o test_coverage.info
- COMMAND ${CODE_COVERAGE_LCOV} --extract test_coverage.info ${EXTRACT_DIRS} -o test_coverage.info
+ COMMAND chmod +x ${GCOV_TOOL}
+ COMMAND ${CODE_COVERAGE_LCOV} --gcov-tool ${GCOV_TOOL} --capture ${CAPTURE_DIRS} -o test_coverage.info
+ COMMAND ${CODE_COVERAGE_LCOV} --gcov-tool ${GCOV_TOOL} --extract test_coverage.info ${EXTRACT_DIRS} -o test_coverage.info
COMMAND ${CODE_COVERAGE_GENHTML} --demangle-cpp test_coverage.info -o test_coverage
COMMAND ${CMAKE_COMMAND} -E remove test_coverage.info
WORKING_DIRECTORY ${output_dir}
diff --git a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleCompilerRT.cmake b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleCompilerRT.cmake
new file mode 100644
index 00000000000..e9da3c43a21
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleCompilerRT.cmake
@@ -0,0 +1,58 @@
+function(find_compiler_rt_library name dest)
+ if (NOT DEFINED LIBCXX_COMPILE_FLAGS)
+ message(FATAL_ERROR "LIBCXX_COMPILE_FLAGS must be defined when using this function")
+ endif()
+ set(dest "" PARENT_SCOPE)
+ set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXX_COMPILE_FLAGS}
+ "--rtlib=compiler-rt" "--print-libgcc-file-name")
+ if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET)
+ list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}")
+ endif()
+ execute_process(
+ COMMAND ${CLANG_COMMAND}
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE LIBRARY_FILE
+ )
+ string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE)
+ string(REPLACE "builtins" "${name}" LIBRARY_FILE "${LIBRARY_FILE}")
+ if (NOT HAD_ERROR AND EXISTS "${LIBRARY_FILE}")
+ message(STATUS "Found compiler-rt library: ${LIBRARY_FILE}")
+ set(${dest} "${LIBRARY_FILE}" PARENT_SCOPE)
+ else()
+ message(STATUS "Failed to find compiler-rt library")
+ endif()
+endfunction()
+
+function(find_compiler_rt_dir dest)
+ if (NOT DEFINED LIBCXX_COMPILE_FLAGS)
+ message(FATAL_ERROR "LIBCXX_COMPILE_FLAGS must be defined when using this function")
+ endif()
+ set(dest "" PARENT_SCOPE)
+ if (APPLE)
+ set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXX_COMPILE_FLAGS}
+ "-print-file-name=lib")
+ execute_process(
+ COMMAND ${CLANG_COMMAND}
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE LIBRARY_DIR
+ )
+ string(STRIP "${LIBRARY_DIR}" LIBRARY_DIR)
+ set(LIBRARY_DIR "${LIBRARY_DIR}/darwin")
+ else()
+ set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXX_COMPILE_FLAGS}
+ "--rtlib=compiler-rt" "--print-libgcc-file-name")
+ execute_process(
+ COMMAND ${CLANG_COMMAND}
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE LIBRARY_FILE
+ )
+ string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE)
+ get_filename_component(LIBRARY_DIR "${LIBRARY_FILE}" DIRECTORY)
+ endif()
+ if (NOT HAD_ERROR AND EXISTS "${LIBRARY_DIR}")
+ message(STATUS "Found compiler-rt directory: ${LIBRARY_DIR}")
+ set(${dest} "${LIBRARY_DIR}" PARENT_SCOPE)
+ else()
+ message(STATUS "Failed to find compiler-rt directory")
+ endif()
+endfunction()
diff --git a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibCXXABI.cmake b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibCXXABI.cmake
index d9c652d87ba..b404e36c148 100644
--- a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibCXXABI.cmake
+++ b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibCXXABI.cmake
@@ -10,25 +10,34 @@
# abidefines: A list of defines needed to compile libc++ with the ABI library
# abilib : The ABI library to link against.
# abifiles : A list of files (which may be relative paths) to copy into the
-# libc++ build tree for the build. These files will also be
+# libc++ build tree for the build. These files will be copied
+# twice: once into include/, so the libc++ build itself can find
+# them, and once into include/c++/v1, so that a clang built into
+# the same build area will find them. These files will also be
# installed alongside the libc++ headers.
# abidirs : A list of relative paths to create under an include directory
# in the libc++ build directory.
#
+
macro(setup_abi_lib abidefines abilib abifiles abidirs)
list(APPEND LIBCXX_COMPILE_FLAGS ${abidefines})
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_CXX_ABI_INCLUDE_PATHS}"
CACHE PATH
"Paths to C++ ABI header directories separated by ';'." FORCE
)
-
+ set(LIBCXX_CXX_ABI_LIBRARY_PATH "${LIBCXX_CXX_ABI_LIBRARY_PATH}"
+ CACHE PATH
+ "Paths to C++ ABI library directory"
+ )
set(LIBCXX_CXX_ABI_LIBRARY ${abilib})
-
set(LIBCXX_ABILIB_FILES ${abifiles})
- file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include")
+ # The place in the build tree where we store out-of-source headers.
+ file(MAKE_DIRECTORY "${LIBCXX_BUILD_HEADERS_ROOT}")
+ file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1")
foreach(_d ${abidirs})
- file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/${_d}")
+ file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}/${_d}")
+ file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/c++/v1/${_d}")
endforeach()
foreach(fpath ${LIBCXX_ABILIB_FILES})
@@ -39,16 +48,19 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
get_filename_component(dstdir ${fpath} PATH)
get_filename_component(ifile ${fpath} NAME)
file(COPY "${incpath}/${fpath}"
- DESTINATION "${CMAKE_BINARY_DIR}/include/${dstdir}"
+ DESTINATION "${LIBCXX_BINARY_INCLUDE_DIR}/${dstdir}"
+ )
+ file(COPY "${incpath}/${fpath}"
+ DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1/${dstdir}"
)
if (LIBCXX_INSTALL_HEADERS)
- install(FILES "${CMAKE_BINARY_DIR}/include/${fpath}"
+ install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
DESTINATION include/c++/v1/${dstdir}
COMPONENT libcxx
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endif()
- list(APPEND abilib_headers "${CMAKE_BINARY_DIR}/include/${fpath}")
+ list(APPEND abilib_headers "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}")
endif()
endforeach()
if (NOT found)
@@ -56,9 +68,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
endif()
endforeach()
- add_custom_target(LIBCXX_CXX_ABI_DEPS DEPENDS ${abilib_headers})
- include_directories("${CMAKE_BINARY_DIR}/include")
-
+ include_directories("${LIBCXX_BINARY_INCLUDE_DIR}")
endmacro()
@@ -93,16 +103,25 @@ elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
# Assume c++abi is installed in the system, rely on -lc++abi link flag.
set(CXXABI_LIBNAME "c++abi")
endif()
- setup_abi_lib("-DLIBCXX_BUILDING_LIBCXXABI"
- ${CXXABI_LIBNAME} "cxxabi.h;__cxxabi_config.h" ""
- )
+ set(HEADERS "cxxabi.h;__cxxabi_config.h")
+ if (LIBCXX_CXX_ABI_SYSTEM)
+ set(HEADERS "")
+ endif()
+ setup_abi_lib("-DLIBCXX_BUILDING_LIBCXXABI" ${CXXABI_LIBNAME} "${HEADERS}" "")
elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt")
setup_abi_lib("-DLIBCXXRT"
"cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
)
-elseif (NOT "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none")
+elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "vcruntime")
+ # Nothing TODO
+elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none")
+ list(APPEND LIBCXX_COMPILE_FLAGS "-D_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY")
+elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "default")
+ # Nothing TODO
+else()
message(FATAL_ERROR
- "Currently libstdc++, libsupc++, libcxxabi, libcxxrt and none are "
- "supported for c++ abi."
+ "Unsupported c++ abi: '${LIBCXX_CXX_ABI_LIBNAME}'. \
+ Currently libstdc++, libsupc++, libcxxabi, libcxxrt, default and none are
+ supported for c++ abi."
)
endif ()
diff --git a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibcxxFlags.cmake b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibcxxFlags.cmake
index bb886fa8a01..65f7d187f3b 100644
--- a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibcxxFlags.cmake
+++ b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleLibcxxFlags.cmake
@@ -26,6 +26,10 @@ endmacro()
# or added in other parts of LLVM's cmake configuration.
macro(remove_flags)
foreach(var ${ARGN})
+ string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+ string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
+ string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+ string(REPLACE "${var}" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
string(REPLACE "${var}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "${var}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
@@ -35,6 +39,11 @@ macro(remove_flags)
endforeach()
endmacro(remove_flags)
+macro(check_flag_supported flag)
+ mangle_name("${flag}" flagname)
+ check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")
+endmacro()
+
# Add a macro definition if condition is true.
macro(define_if condition def)
if (${condition})
@@ -71,6 +80,26 @@ macro(config_define value def)
set(LIBCXX_NEEDS_SITE_CONFIG ON)
endmacro()
+# Add a list of flags to all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS',
+# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'.
+macro(add_target_flags)
+ foreach(value ${ARGN})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${value}")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${value}")
+ list(APPEND LIBCXX_COMPILE_FLAGS ${value})
+ list(APPEND LIBCXX_LINK_FLAGS ${value})
+ endforeach()
+endmacro()
+
+# If the specified 'condition' is true then add a list of flags to
+# all of 'CMAKE_CXX_FLAGS', 'CMAKE_C_FLAGS', 'LIBCXX_COMPILE_FLAGS'
+# and 'LIBCXX_LINK_FLAGS'.
+macro(add_target_flags_if condition)
+ if (${condition})
+ add_target_flags(${ARGN})
+ endif()
+endmacro()
+
# Add a specified list of flags to both 'LIBCXX_COMPILE_FLAGS' and
# 'LIBCXX_LINK_FLAGS'.
macro(add_flags)
@@ -163,6 +192,14 @@ macro(add_library_flags_if condition)
endif()
endmacro()
+# Add a list of libraries or link flags to 'LIBCXX_LIBRARIES'.
+macro(add_interface_library)
+ foreach(lib ${ARGN})
+ list(APPEND LIBCXX_LIBRARIES ${lib})
+ list(APPEND LIBCXX_INTERFACE_LIBRARIES ${lib})
+ endforeach()
+endmacro()
+
# Turn a comma separated CMake list into a space separated string.
macro(split_list listname)
string(REPLACE ";" " " ${listname} "${${listname}}")
diff --git a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
index 6215be7f586..879882dcfea 100644
--- a/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/chromium/buildtools/third_party/libc++/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -1,15 +1,18 @@
macro(find_llvm_parts)
# Rely on llvm-config.
set(CONFIG_OUTPUT)
- find_program(LLVM_CONFIG "llvm-config")
+ if(NOT LLVM_CONFIG_PATH)
+ find_program(LLVM_CONFIG_PATH "llvm-config")
+ endif()
if(DEFINED LLVM_PATH)
set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
- elseif(LLVM_CONFIG)
- message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
- set(CONFIG_COMMAND ${LLVM_CONFIG}
+ elseif(LLVM_CONFIG_PATH)
+ message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}")
+ set(LIBCXX_USING_INSTALLED_LLVM 1)
+ set(CONFIG_COMMAND ${LLVM_CONFIG_PATH}
"--includedir"
"--prefix"
"--src-root")
@@ -35,45 +38,64 @@ macro(find_llvm_parts)
set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
- set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
- else()
- set(LLVM_FOUND OFF)
- return()
- endif()
- if (NOT EXISTS ${LLVM_MAIN_SRC_DIR})
+ # --cmakedir is supported since llvm r291218 (4.0 release)
+ execute_process(
+ COMMAND ${LLVM_CONFIG_PATH} --cmakedir
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE CONFIG_OUTPUT
+ ERROR_QUIET)
+ if(NOT HAD_ERROR)
+ string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH)
+ else()
+ set(LLVM_CMAKE_PATH
+ "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+ endif()
+ else()
set(LLVM_FOUND OFF)
- message(WARNING "Not found: ${LLVM_MAIN_SRC_DIR}")
+ message(WARNING "UNSUPPORTED LIBCXX CONFIGURATION DETECTED: "
+ "llvm-config not found and LLVM_PATH not defined.\n"
+ "Reconfigure with -DLLVM_CONFIG_PATH=path/to/llvm-config "
+ "or -DLLVM_PATH=path/to/llvm-source-root.")
return()
endif()
- if(NOT EXISTS ${LLVM_CMAKE_PATH})
+ if (EXISTS "${LLVM_CMAKE_PATH}")
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+ elseif (EXISTS "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+ else()
set(LLVM_FOUND OFF)
- message(WARNING "Not found: ${LLVM_CMAKE_PATH}")
+ message(WARNING "Neither ${LLVM_CMAKE_PATH} nor ${LLVM_MAIN_SRC_DIR}/cmake/modules found")
return()
endif()
- list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
- list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
-
set(LLVM_FOUND ON)
endmacro(find_llvm_parts)
-
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
- set(LIBCXX_BUILT_STANDALONE 1)
+macro(configure_out_of_tree_llvm)
message(STATUS "Configuring for standalone build.")
+ set(LIBCXX_STANDALONE_BUILD 1)
find_llvm_parts()
- # LLVM Options --------------------------------------------------------------
- include(FindPythonInterp)
- if( NOT PYTHONINTERP_FOUND )
- message(WARNING "Failed to find python interpreter. "
- "The libc++ test suite will be disabled.")
- set(LLVM_INCLUDE_TESTS OFF)
+ # Add LLVM Functions --------------------------------------------------------
+ if (LLVM_FOUND AND LIBCXX_USING_INSTALLED_LLVM)
+ include(LLVMConfig) # For TARGET_TRIPLE
+ else()
+ if (WIN32)
+ set(LLVM_ON_UNIX 0)
+ set(LLVM_ON_WIN32 1)
+ else()
+ set(LLVM_ON_UNIX 1)
+ set(LLVM_ON_WIN32 0)
+ endif()
+ endif()
+ if (LLVM_FOUND)
+ include(AddLLVM OPTIONAL)
endif()
+ # LLVM Options --------------------------------------------------------------
if (NOT DEFINED LLVM_INCLUDE_TESTS)
set(LLVM_INCLUDE_TESTS ${LLVM_FOUND})
endif()
@@ -93,46 +115,16 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()
set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
- # Make sure we can use the console pool for recent cmake and ninja > 1.5
- # Needed for add_lit_testsuite
- if(CMAKE_VERSION VERSION_LESS 3.1.20141117)
- set(cmake_3_2_USES_TERMINAL)
- else()
- set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
- endif()
-
# Required doc configuration
if (LLVM_ENABLE_SPHINX)
- message(STATUS "Sphinx enabled.")
find_package(Sphinx REQUIRED)
- else()
- message(STATUS "Sphinx disabled.")
endif()
- # FIXME - This is cribbed from HandleLLVMOptions.cmake.
- if(WIN32)
+ if (LLVM_ON_UNIX AND NOT APPLE)
+ set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
+ else()
set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
- if(CYGWIN)
- set(LLVM_ON_WIN32 0)
- set(LLVM_ON_UNIX 1)
- else(CYGWIN)
- set(LLVM_ON_WIN32 1)
- set(LLVM_ON_UNIX 0)
- endif(CYGWIN)
- else(WIN32)
- if(UNIX)
- set(LLVM_ON_WIN32 0)
- set(LLVM_ON_UNIX 1)
- if(APPLE)
- set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
- else(APPLE)
- set(LLVM_HAVE_LINK_VERSION_SCRIPT 1)
- endif(APPLE)
- else(UNIX)
- MESSAGE(SEND_ERROR "Unable to determine platform")
- endif(UNIX)
- endif(WIN32)
+ endif()
+endmacro(configure_out_of_tree_llvm)
- # Add LLVM Functions --------------------------------------------------------
- include(AddLLVM OPTIONAL)
-endif()
+configure_out_of_tree_llvm()
diff --git a/chromium/buildtools/third_party/libc++/trunk/cmake/config-ix.cmake b/chromium/buildtools/third_party/libc++/trunk/cmake/config-ix.cmake
index c05597ea73d..c425c31ea09 100644
--- a/chromium/buildtools/third_party/libc++/trunk/cmake/config-ix.cmake
+++ b/chromium/buildtools/third_party/libc++/trunk/cmake/config-ix.cmake
@@ -1,6 +1,60 @@
include(CheckLibraryExists)
+include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
+if(WIN32 AND NOT MINGW)
+ # NOTE(compnerd) this is technically a lie, there is msvcrt, but for now, lets
+ # let the default linking take care of that.
+ set(LIBCXX_HAS_C_LIB NO)
+else()
+ check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
+endif()
+
+if (NOT LIBCXX_USE_COMPILER_RT)
+ if(WIN32 AND NOT MINGW)
+ set(LIBCXX_HAS_GCC_S_LIB NO)
+ else()
+ check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
+ endif()
+endif()
+
+# libc++ is built with -nodefaultlibs, so we want all our checks to also
+# use this option, otherwise we may end up with an inconsistency between
+# the flags we think we require during configuration (if the checks are
+# performed without -nodefaultlibs) and the flags that are actually
+# required during compilation (which has the -nodefaultlibs). libc is
+# required for the link to go through. We remove sanitizers from the
+# configuration checks to avoid spurious link errors.
+check_c_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
+ if (LIBCXX_HAS_C_LIB)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES c)
+ endif ()
+ if (LIBCXX_USE_COMPILER_RT)
+ list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt)
+ find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBCXX_BUILTINS_LIBRARY}")
+ elseif (LIBCXX_HAS_GCC_S_LIB)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
+ endif ()
+ if (MINGW)
+ # Mingw64 requires quite a few "C" runtime libraries in order for basic
+ # programs to link successfully with -nodefaultlibs.
+ list(APPEND CMAKE_REQUIRED_LIBRARIES mingw32 gcc gcc_eh mingwex msvcrt gcc)
+ endif()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
+ endif ()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize-coverage OR CMAKE_CXX_FLAGS MATCHES -fsanitize-coverage)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters")
+ endif ()
+endif ()
+
+if(NOT WIN32 OR MINGW)
+ include(CheckLibcxxAtomic)
+endif()
+
# Check compiler flags
check_cxx_compiler_flag(/WX LIBCXX_HAS_WX_FLAG)
@@ -12,8 +66,14 @@ check_cxx_compiler_flag(/GR- LIBCXX_HAS_NO_GR_FLAG)
# Check libraries
-check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
-check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
-check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
-check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
-check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
+if(WIN32 AND NOT MINGW)
+ # TODO(compnerd) do we want to support an emulation layer that allows for the
+ # use of pthread-win32 or similar libraries to emulate pthreads on Windows?
+ set(LIBCXX_HAS_PTHREAD_LIB NO)
+ set(LIBCXX_HAS_M_LIB NO)
+ set(LIBCXX_HAS_RT_LIB NO)
+else()
+ check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
+ check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
+ check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
+endif()
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/BuildingLibcxx.rst b/chromium/buildtools/third_party/libc++/trunk/docs/BuildingLibcxx.rst
index f00ce4f9cff..c7b5e96422f 100644
--- a/chromium/buildtools/third_party/libc++/trunk/docs/BuildingLibcxx.rst
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/BuildingLibcxx.rst
@@ -1,3 +1,4 @@
+.. _BuildingLibcxx:
===============
Building libc++
@@ -6,6 +7,8 @@ Building libc++
.. contents::
:local:
+.. _build instructions:
+
Getting Started
===============
@@ -34,8 +37,7 @@ The basic steps needed to build libc++ are:
#. Configure and build libc++ with libc++abi:
- CMake is the only supported configuration system. Unlike other LLVM
- projects autotools is not supported for either libc++ or libc++abi.
+ CMake is the only supported configuration system.
Clang is the preferred compiler when building and using libc++.
@@ -47,7 +49,7 @@ The basic steps needed to build libc++ are:
For more information about configuring libc++ see :ref:`CMake Options`.
* ``make cxx`` --- will build libc++ and libc++abi.
- * ``make check-libcxx check-libcxxabi`` --- will run the test suites.
+ * ``make check-cxx check-cxxabi`` --- will run the test suites.
Shared libraries for libc++ and libc++ abi should now be present in llvm/build/lib.
See :ref:`using an alternate libc++ installation <alternate libcxx>`
@@ -58,7 +60,7 @@ The basic steps needed to build libc++ are:
careful not to replace it. Remember Use the CMake option ``CMAKE_INSTALL_PREFIX`` to
select a safe place to install libc++.
- * ``make install-libcxx install-libcxxabi`` --- Will install the libraries and the headers
+ * ``make install-cxx install-cxxabi`` --- Will install the libraries and the headers
.. warning::
* Replacing your systems libc++ installation could render the system non-functional.
@@ -90,6 +92,57 @@ build would look like this:
$ make check-libcxx # optional
+Experimental Support for Windows
+--------------------------------
+
+The Windows support requires building with clang-cl as cl does not support one
+required extension: `#include_next`. Furthermore, VS 2015 or newer (19.00) is
+required. In the case of clang-cl, we need to specify the "MS Compatibility
+Version" as it defaults to 2014 (18.00).
+
+CMake + Visual Studio
+~~~~~~~~~~~~~~~~~~~~~
+
+Building with Visual Studio currently does not permit running tests. However,
+it is the simplest way to build.
+
+.. code-block:: batch
+
+ > cmake -G "Visual Studio 14 2015" ^
+ -T "LLVM-vs2014" ^
+ -DLIBCXX_ENABLE_SHARED=YES ^
+ -DLIBCXX_ENABLE_STATIC=NO ^
+ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO ^
+ \path\to\libcxx
+ > cmake --build .
+
+CMake + ninja
+~~~~~~~~~~~~~
+
+Building with ninja is required for development to enable tests.
+Unfortunately, doing so requires additional configuration as we cannot
+just specify a toolset.
+
+.. code-block:: batch
+
+ > cmake -G Ninja ^
+ -DCMAKE_MAKE_PROGRAM=/path/to/ninja ^
+ -DCMAKE_SYSTEM_NAME=Windows ^
+ -DCMAKE_C_COMPILER=clang-cl ^
+ -DCMAKE_C_FLAGS="-fms-compatibility-version=19.00 --target=i686--windows" ^
+ -DCMAKE_CXX_COMPILER=clang-c ^
+ -DCMAKE_CXX_FLAGS="-fms-compatibility-version=19.00 --target=i686--windows" ^
+ -DLLVM_PATH=/path/to/llvm/tree ^
+ -DLIBCXX_ENABLE_SHARED=YES ^
+ -DLIBCXX_ENABLE_STATIC=NO ^
+ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO ^
+ \path\to\libcxx
+ > /path/to/ninja cxx
+ > /path/to/ninja check-cxx
+
+Note that the paths specified with backward slashes must use the `\\` as the
+directory separator as clang-cl may otherwise parse the path as an argument.
+
.. _`libc++abi`: http://libcxxabi.llvm.org/
@@ -120,6 +173,18 @@ CMake docs or execute ``cmake --help-variable VARIABLE_NAME``.
libc++ specific options
-----------------------
+.. option:: LIBCXX_INSTALL_LIBRARY:BOOL
+
+ **Default**: ``ON``
+
+ Toggle the installation of the library portion of libc++.
+
+.. option:: LIBCXX_INSTALL_HEADERS:BOOL
+
+ **Default**: ``ON``
+
+ Toggle the installation of the libc++ headers.
+
.. option:: LIBCXX_ENABLE_ASSERTIONS:BOOL
**Default**: ``ON``
@@ -130,19 +195,53 @@ libc++ specific options
**Default**: ``OFF``
- Build libc++ as a 32 bit library. Also see :option:`LLVM_BUILD_32_BITS`.
+ Build libc++ as a 32 bit library. Also see `LLVM_BUILD_32_BITS`.
.. option:: LIBCXX_ENABLE_SHARED:BOOL
**Default**: ``ON``
- Build libc++ as a shared library. If ``OFF`` is specified then libc++ is
- built as a static library.
+ Build libc++ as a shared library. Either `LIBCXX_ENABLE_SHARED` or
+ `LIBCXX_ENABLE_STATIC` has to be enabled.
+
+.. option:: LIBCXX_ENABLE_STATIC:BOOL
+
+ **Default**: ``ON``
+
+ Build libc++ as a static library. Either `LIBCXX_ENABLE_SHARED` or
+ `LIBCXX_ENABLE_STATIC` has to be enabled.
.. option:: LIBCXX_LIBDIR_SUFFIX:STRING
Extra suffix to append to the directory where libraries are to be installed.
- This option overrides :option:`LLVM_LIBDIR_SUFFIX`.
+ This option overrides `LLVM_LIBDIR_SUFFIX`.
+
+
+.. _libc++experimental options:
+
+libc++experimental Specific Options
+------------------------------------
+
+.. option:: LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL
+
+ **Default**: ``ON``
+
+ Build and test libc++experimental.a.
+
+.. option:: LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY:BOOL
+
+ **Default**: ``LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY AND LIBCXX_INSTALL_LIBRARY``
+
+ Install libc++experimental.a alongside libc++.
+
+
+.. option:: LIBCXX_ENABLE_FILESYSTEM:BOOL
+
+ **Default**: ``LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY``
+
+ Build filesystem as part of libc++experimental.a. This allows filesystem
+ to be disabled without turning off the entire experimental library.
+
.. _ABI Library Specific Options:
@@ -186,7 +285,7 @@ ABI Library Specific Options
libc++abi is the C++ ABI library used.
-libc++ Feature options
+libc++ Feature Options
----------------------
.. option:: LIBCXX_ENABLE_EXCEPTIONS:BOOL
@@ -201,9 +300,32 @@ libc++ Feature options
Build libc++ with run time type information.
+.. option:: LIBCXX_INCLUDE_BENCHMARKS:BOOL
-libc++ Feature options
-----------------------
+ **Default**: ``ON``
+
+ Build the libc++ benchmark tests and the Google Benchmark library needed
+ to support them.
+
+.. option:: LIBCXX_BENCHMARK_NATIVE_STDLIB:STRING
+
+ **Default**:: ``""``
+
+ **Values**:: ``libc++``, ``libstdc++``
+
+ Build the libc++ benchmark tests and Google Benchmark library against the
+ specified standard library on the platform. On linux this can be used to
+ compare libc++ to libstdc++ by building the benchmark tests against both
+ standard libraries.
+
+.. option:: LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN:STRING
+
+ Use the specified GCC toolchain and standard library when building the native
+ stdlib benchmark tests.
+
+
+libc++ ABI Feature Options
+--------------------------
The following options allow building libc++ for a different ABI version.
@@ -304,3 +426,72 @@ own copy of libsupc++ and this can lead to subtle problems.
$ make install
You can now run clang with -stdlib=libc++.
+
+
+.. _libcxxrt_ref:
+
+Using libcxxrt on Linux
+------------------------
+
+You will need to keep the source tree of `libcxxrt`_ available
+on your build machine and your copy of the libcxxrt shared library must
+be placed where your linker will find it.
+
+We can now run CMake like:
+
+.. code-block:: bash
+
+ $ CC=clang CXX=clang++ cmake -G "Unix Makefiles" \
+ -DLIBCXX_CXX_ABI=libcxxrt \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxrt-sources/src \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ <libc++-source-directory>
+ $ make cxx
+ $ make install
+
+Unfortunately you can't simply run clang with "-stdlib=libc++" at this point, as
+clang is set up to link for libc++ linked to libsupc++. To get around this
+you'll have to set up your linker yourself (or patch clang). For example,
+
+.. code-block:: bash
+
+ $ clang++ -stdlib=libc++ helloworld.cpp \
+ -nodefaultlibs -lc++ -lcxxrt -lm -lc -lgcc_s -lgcc
+
+Alternately, you could just add libcxxrt to your libraries list, which in most
+situations will give the same result:
+
+.. code-block:: bash
+
+ $ clang++ -stdlib=libc++ helloworld.cpp -lcxxrt
+
+.. _`libcxxrt`: https://github.com/pathscale/libcxxrt/
+
+
+Using a local ABI library installation
+---------------------------------------
+
+.. warning::
+ This is not recommended in almost all cases.
+
+These instructions should only be used when you can't install your ABI library.
+
+Normally you must link libc++ against a ABI shared library that the
+linker can find. If you want to build and test libc++ against an ABI
+library not in the linker's path you needq to set
+``-DLIBCXX_CXX_ABI_LIBRARY_PATH=/path/to/abi/lib`` when configuring CMake.
+
+An example build using libc++abi would look like:
+
+.. code-block:: bash
+
+ $ CC=clang CXX=clang++ cmake \
+ -DLIBCXX_CXX_ABI=libc++abi \
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/path/to/libcxxabi/include" \
+ -DLIBCXX_CXX_ABI_LIBRARY_PATH="/path/to/libcxxabi-build/lib" \
+ path/to/libcxx
+ $ make
+
+When testing libc++ LIT will automatically link against the proper ABI
+library.
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/CMakeLists.txt b/chromium/buildtools/third_party/libc++/trunk/docs/CMakeLists.txt
index f63ee00a5a0..d679761a5ad 100644
--- a/chromium/buildtools/third_party/libc++/trunk/docs/CMakeLists.txt
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/CMakeLists.txt
@@ -1,9 +1,9 @@
if (LLVM_ENABLE_SPHINX)
+ include(AddSphinxTarget)
if (SPHINX_FOUND)
- include(AddSphinxTarget)
if (${SPHINX_OUTPUT_HTML})
add_sphinx_target(html libcxx)
endif()
endif()
-endif() \ No newline at end of file
+endif()
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/AvailabilityMarkup.rst b/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/AvailabilityMarkup.rst
new file mode 100644
index 00000000000..4a85c698f23
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/AvailabilityMarkup.rst
@@ -0,0 +1,114 @@
+===================
+Availability Markup
+===================
+
+.. contents::
+ :local:
+
+Overview
+========
+
+Libc++ is used as a system library on macOS and iOS (amongst others). In order
+for users to be able to compile a binary that is intended to be deployed to an
+older version of the platform, clang provides the
+`availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>`_
+that can be placed on declarations to describe the lifecycle of a symbol in the
+library.
+
+Design
+======
+
+When a new feature is introduced that requires dylib support, a macro should be
+created in include/__config to mark this feature as unavailable for all the
+systems. For example::
+
+ // Define availability macros.
+ #if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
+ #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+ #else if defined(_LIBCPP_USE_AVAILABILITY_SOME_OTHER_VENDOR)
+ #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+ #else
+ #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+ #endif
+
+When the library is updated by the platform vendor, the markup can be updated.
+For example::
+
+ #define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+
+In the source code, the macro can be added on a class if the full class requires
+type info from the library for example::
+
+ _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
+ class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
+ : public std::logic_error {
+
+or on a particular symbol:
+
+ _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+
+
+Testing
+=======
+
+Some parameters can be passed to lit to run the test-suite and exercising the
+availability.
+
+* The `platform` parameter controls the deployement target. For example lit can
+ be invoked with `--param=platform=macosx10.8`. Default is the current host.
+* The `use_system_cxx_lib` parameter indicates to use another library than the
+ just built one. Invoking lit with `--param=use_system_cxx_lib=true` will run
+ the test-suite against the host system library. Alternatively a path to the
+ directory containing a specific prebuilt libc++ can be used, for example:
+ `--param=use_system_cxx_lib=/path/to/macOS/10.8/`.
+* The `with_availability` boolean parameter enables the availability markup.
+
+Tests can be marked as XFAIL based on multiple features made available by lit:
+
+
+* if either `use_system_cxx_lib` or `with_availability` is passed to lit,
+ assuming `--param=platform=macosx10.8` is passed as well the following
+ features will be available:
+
+ - availability
+ - availability=x86_64
+ - availability=macosx
+ - availability=x86_64-macosx
+ - availability=x86_64-apple-macosx10.8
+ - availability=macosx10.8
+
+ This feature is used to XFAIL a test that *is* using a class of a method marked
+ as unavailable *and* that is expected to *fail* if deployed on an older system.
+
+* if `use_system_cxx_lib` is passed to lit, the following features will also
+ be available:
+
+ - with_system_cxx_lib
+ - with_system_cxx_lib=x86_64
+ - with_system_cxx_lib=macosx
+ - with_system_cxx_lib=x86_64-macosx
+ - with_system_cxx_lib=x86_64-apple-macosx10.8
+ - with_system_cxx_lib=macosx10.8
+
+ This feature is used to XFAIL a test that is *not* using a class of a method
+ marked as unavailable *but* that is expected to fail if deployed on an older
+ system. For example if we know that it exhibits a but in the libc on a
+ particular system version.
+
+* if `with_availability` is passed to lit, the following features will also
+ be available:
+
+ - availability_markup
+ - availability_markup=x86_64
+ - availability_markup=macosx
+ - availability_markup=x86_64-macosx
+ - availability_markup=x86_64-apple-macosx10.8
+ - availability_markup=macosx10.8
+
+ This feature is used to XFAIL a test that *is* using a class of a method
+ marked as unavailable *but* that is expected to *pass* if deployed on an older
+ system. For example if it is using a symbol in a statically evaluated context.
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/DebugMode.rst b/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/DebugMode.rst
new file mode 100644
index 00000000000..3b997d44607
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/DebugMode.rst
@@ -0,0 +1,100 @@
+==========
+Debug Mode
+==========
+
+.. contents::
+ :local:
+
+.. _using-debug-mode:
+
+Using Debug Mode
+================
+
+Libc++ provides a debug mode that enables assertions meant to detect incorrect
+usage of the standard library. By default these assertions are disabled but
+they can be enabled using the ``_LIBCPP_DEBUG`` macro.
+
+**_LIBCPP_DEBUG** Macro
+-----------------------
+
+**_LIBCPP_DEBUG**:
+ This macro is used to enable assertions and iterator debugging checks within
+ libc++. By default it is undefined.
+
+ **Values**: ``0``, ``1``
+
+ Defining ``_LIBCPP_DEBUG`` to ``0`` or greater enables most of libc++'s
+ assertions. Defining ``_LIBCPP_DEBUG`` to ``1`` enables "iterator debugging"
+ which provides additional assertions about the validity of iterators used by
+ the program.
+
+ Note that this option has no effect on libc++'s ABI
+
+**_LIBCPP_DEBUG_USE_EXCEPTIONS**:
+ When this macro is defined ``_LIBCPP_ASSERT`` failures throw
+ ``__libcpp_debug_exception`` instead of aborting. Additionally this macro
+ disables exception specifications on functions containing ``_LIBCPP_ASSERT``
+ checks. This allows assertion failures to correctly throw through these
+ functions.
+
+Handling Assertion Failures
+---------------------------
+
+When a debug assertion fails the assertion handler is called via the
+``std::__libcpp_debug_function`` function pointer. It is possible to override
+this function pointer using a different handler function. Libc++ provides two
+different assertion handlers, the default handler
+``std::__libcpp_abort_debug_handler`` which aborts the program, and
+``std::__libcpp_throw_debug_handler`` which throws an instance of
+``std::__libcpp_debug_exception``. Libc++ can be changed to use the throwing
+assertion handler as follows:
+
+.. code-block:: cpp
+
+ #define _LIBCPP_DEBUG 1
+ #include <string>
+ int main() {
+ std::__libcpp_debug_function = std::__libcpp_throw_debug_function;
+ try {
+ std::string::iterator bad_it;
+ std::string str("hello world");
+ str.insert(bad_it, '!'); // causes debug assertion
+ } catch (std::__libcpp_debug_exception const&) {
+ return EXIT_SUCCESS;
+ }
+ return EXIT_FAILURE;
+ }
+
+Debug Mode Checks
+=================
+
+Libc++'s debug mode offers two levels of checking. The first enables various
+precondition checks throughout libc++. The second additionally enables
+"iterator debugging" which checks the validity of iterators used by the program.
+
+Basic Checks
+============
+
+These checks are enabled when ``_LIBCPP_DEBUG`` is defined to either 0 or 1.
+
+The following checks are enabled by ``_LIBCPP_DEBUG``:
+
+ * FIXME: Update this list
+
+Iterator Debugging Checks
+=========================
+
+These checks are enabled when ``_LIBCPP_DEBUG`` is defined to 1.
+
+The following containers and STL classes support iterator debugging:
+
+ * ``std::string``
+ * ``std::vector<T>`` (``T != bool``)
+ * ``std::list``
+ * ``std::unordered_map``
+ * ``std::unordered_multimap``
+ * ``std::unordered_set``
+ * ``std::unordered_multiset``
+
+The remaining containers do not currently support iterator debugging.
+Patches welcome.
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/ThreadingSupportAPI.rst b/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/ThreadingSupportAPI.rst
new file mode 100644
index 00000000000..556c45b7e1f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/ThreadingSupportAPI.rst
@@ -0,0 +1,79 @@
+=====================
+Threading Support API
+=====================
+
+.. contents::
+ :local:
+
+Overview
+========
+
+Libc++ supports using multiple different threading models and configurations
+to implement the threading parts of libc++, including ``<thread>`` and ``<mutex>``.
+These different models provide entirely different interfaces from each
+other. To address this libc++ wraps the underlying threading API in a new and
+consistent API, which it uses internally to implement threading primitives.
+
+The ``<__threading_support>`` header is where libc++ defines its internal
+threading interface. It contains forward declarations of the internal threading
+interface as well as definitions for the interface.
+
+External Threading API and the ``<__external_threading>`` header
+================================================================
+
+In order to support vendors with custom threading API's libc++ allows the
+entire internal threading interface to be provided by an external,
+vendor provided, header.
+
+When ``_LIBCPP_HAS_THREAD_API_EXTERNAL`` is defined the ``<__threading_support>``
+header simply forwards to the ``<__external_threading>`` header (which must exist).
+It is expected that the ``<__external_threading>`` header provide the exact
+interface normally provided by ``<__threading_support>``.
+
+External Threading Library
+==========================
+
+libc++ can be compiled with its internal threading API delegating to an external
+library. Such a configuration is useful for library vendors who wish to
+distribute a thread-agnostic libc++ library, where the users of the library are
+expected to provide the implementation of the libc++ internal threading API.
+
+On a production setting, this would be achieved through a custom
+``<__external_threading>`` header, which declares the libc++ internal threading
+API but leaves out the implementation.
+
+The ``-DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY`` option allows building libc++ in
+such a configuration while allowing it to be tested on a platform that supports
+any of the threading systems (e.g. pthread) supported in ``__threading_support``
+header. Therefore, the main purpose of this option is to allow testing of this
+particular configuration of the library without being tied to a vendor-specific
+threading system. This option is only meant to be used by libc++ library
+developers.
+
+Threading Configuration Macros
+==============================
+
+**_LIBCPP_HAS_NO_THREADS**
+ This macro is defined when libc++ is built without threading support. It
+ should not be manually defined by the user.
+
+**_LIBCPP_HAS_THREAD_API_EXTERNAL**
+ This macro is defined when libc++ should use the ``<__external_threading>``
+ header to provide the internal threading API. This macro overrides
+ ``_LIBCPP_HAS_THREAD_API_PTHREAD``.
+
+**_LIBCPP_HAS_THREAD_API_PTHREAD**
+ This macro is defined when libc++ should use POSIX threads to implement the
+ internal threading API.
+
+**_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL**
+ This macro is defined when libc++ expects the definitions of the internal
+ threading API to be provided by an external library. When defined
+ ``<__threading_support>`` will only provide the forward declarations and
+ typedefs for the internal threading API.
+
+**_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL**
+ This macro is used to build an external threading library using the
+ ``<__threading_support>``. Specifically it exposes the threading API
+ definitions in ``<__threading_support>`` as non-inline definitions meant to
+ be compiled into a library.
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/VisibilityMacros.rst b/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/VisibilityMacros.rst
new file mode 100644
index 00000000000..694882dd263
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/DesignDocs/VisibilityMacros.rst
@@ -0,0 +1,162 @@
+========================
+Symbol Visibility Macros
+========================
+
+.. contents::
+ :local:
+
+Overview
+========
+
+Libc++ uses various "visibility" macros in order to provide a stable ABI in
+both the library and the headers. These macros work by changing the
+visibility and inlining characteristics of the symbols they are applied to.
+
+Visibility Macros
+=================
+
+**_LIBCPP_HIDDEN**
+ Mark a symbol as hidden so it will not be exported from shared libraries.
+
+**_LIBCPP_FUNC_VIS**
+ Mark a symbol as being exported by the libc++ library. This attribute must
+ be applied to the declaration of all functions exported by the libc++ dylib.
+
+**_LIBCPP_EXTERN_VIS**
+ Mark a symbol as being exported by the libc++ library. This attribute may
+ only be applied to objects defined in the libc++ library. On Windows this
+ macro applies `dllimport`/`dllexport` to the symbol. On all other platforms
+ this macro has no effect.
+
+**_LIBCPP_OVERRIDABLE_FUNC_VIS**
+ Mark a symbol as being exported by the libc++ library, but allow it to be
+ overridden locally. On non-Windows, this is equivalent to `_LIBCPP_FUNC_VIS`.
+ This macro is applied to all `operator new` and `operator delete` overloads.
+
+ **Windows Behavior**: Any symbol marked `dllimport` cannot be overridden
+ locally, since `dllimport` indicates the symbol should be bound to a separate
+ DLL. All `operator new` and `operator delete` overloads are required to be
+ locally overridable, and therefore must not be marked `dllimport`. On Windows,
+ this macro therefore expands to `__declspec(dllexport)` when building the
+ library and has an empty definition otherwise.
+
+**_LIBCPP_INLINE_VISIBILITY**
+ Mark a function as hidden and force inlining whenever possible.
+
+**_LIBCPP_ALWAYS_INLINE**
+ A synonym for `_LIBCPP_INLINE_VISIBILITY`
+
+**_LIBCPP_TYPE_VIS**
+ Mark a type's typeinfo, vtable and members as having default visibility.
+ This attribute cannot be used on class templates.
+
+**_LIBCPP_TEMPLATE_VIS**
+ Mark a type's typeinfo and vtable as having default visibility.
+ This macro has no effect on the visibility of the type's member functions.
+
+ **GCC Behavior**: GCC does not support Clang's `type_visibility(...)`
+ attribute. With GCC the `visibility(...)` attribute is used and member
+ functions are affected.
+
+ **Windows Behavior**: DLLs do not support dllimport/export on class templates.
+ The macro has an empty definition on this platform.
+
+
+**_LIBCPP_ENUM_VIS**
+ Mark the typeinfo of an enum as having default visibility. This attribute
+ should be applied to all enum declarations.
+
+ **Windows Behavior**: DLLs do not support importing or exporting enumeration
+ typeinfo. The macro has an empty definition on this platform.
+
+ **GCC Behavior**: GCC un-hides the typeinfo for enumerations by default, even
+ if `-fvisibility=hidden` is specified. Additionally applying a visibility
+ attribute to an enum class results in a warning. The macro has an empty
+ definition with GCC.
+
+**_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS**
+ Mark the member functions, typeinfo, and vtable of the type named in
+ a `_LIBCPP_EXTERN_TEMPLATE` declaration as being exported by the libc++ library.
+ This attribute must be specified on all extern class template declarations.
+
+ This macro is used to override the `_LIBCPP_TEMPLATE_VIS` attribute
+ specified on the primary template and to export the member functions produced
+ by the explicit instantiation in the dylib.
+
+ **GCC Behavior**: GCC ignores visibility attributes applied the type in
+ extern template declarations and applying an attribute results in a warning.
+ However since `_LIBCPP_TEMPLATE_VIS` is the same as
+ `__attribute__((visibility("default"))` the visibility is already correct.
+ The macro has an empty definition with GCC.
+
+ **Windows Behavior**: `extern template` and `dllexport` are fundamentally
+ incompatible *on a template class* on Windows; the former suppresses
+ instantiation, while the latter forces it. Specifying both on the same
+ declaration makes the template class be instantiated, which is not desirable
+ inside headers. This macro therefore expands to `dllimport` outside of libc++
+ but nothing inside of it (rather than expanding to `dllexport`); instead, the
+ explicit instantiations themselves are marked as exported. Note that this
+ applies *only* to extern template *classes*. Extern template *functions* obey
+ regular import/export semantics, and applying `dllexport` directly to the
+ extern template declaration is the correct thing to do for them.
+
+**_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS**
+ Mark the member functions, typeinfo, and vtable of an explicit instantiation
+ of a class template as being exported by the libc++ library. This attribute
+ must be specified on all template class explicit instantiations.
+
+ It is only necessary to mark the explicit instantiation itself (as opposed to
+ the extern template declaration) as exported on Windows, as discussed above.
+ On all other platforms, this macro has an empty definition.
+
+**_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS**
+ Mark a symbol as hidden so it will not be exported from shared libraries. This
+ is intended specifically for method templates of either classes marked with
+ `_LIBCPP_TYPE_VIS` or classes with an extern template instantiation
+ declaration marked with `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS`.
+
+ When building libc++ with hidden visibility, we want explicit template
+ instantiations to export members, which is consistent with existing Windows
+ behavior. We also want classes annotated with `_LIBCPP_TYPE_VIS` to export
+ their members, which is again consistent with existing Windows behavior.
+ Both these changes are necessary for clients to be able to link against a
+ libc++ DSO built with hidden visibility without encountering missing symbols.
+
+ An unfortunate side effect, however, is that method templates of classes
+ either marked `_LIBCPP_TYPE_VIS` or with extern template instantiation
+ declarations marked with `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` also get default
+ visibility when instantiated. These methods are often implicitly instantiated
+ inside other libraries which use the libc++ headers, and will therefore end up
+ being exported from those libraries, since those implicit instantiations will
+ receive default visibility. This is not acceptable for libraries that wish to
+ control their visibility, and led to PR30642.
+
+ Consequently, all such problematic method templates are explicitly marked
+ either hidden (via this macro) or inline, so that they don't leak into client
+ libraries. The problematic methods were found by running
+ `bad-visibility-finder <https://github.com/smeenai/bad-visibility-finder>`_
+ against the libc++ headers after making `_LIBCPP_TYPE_VIS` and
+ `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` expand to default visibility.
+
+**_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY**
+ Mark a member function of a class template as visible and always inline. This
+ macro should only be applied to member functions of class templates that are
+ externally instantiated. It is important that these symbols are not marked
+ as hidden as that will prevent the dylib definition from being found.
+
+ This macro is used to maintain ABI compatibility for symbols that have been
+ historically exported by the libc++ library but are now marked inline.
+
+**_LIBCPP_EXCEPTION_ABI**
+ Mark the member functions, typeinfo, and vtable of the type as being exported
+ by the libc++ library. This macro must be applied to all *exception types*.
+ Exception types should be defined directly in namespace `std` and not the
+ versioning namespace. This allows throwing and catching some exception types
+ between libc++ and libstdc++.
+
+Links
+=====
+
+* `[cfe-dev] Visibility in libc++ - 1 <http://lists.llvm.org/pipermail/cfe-dev/2013-July/030610.html>`_
+* `[cfe-dev] Visibility in libc++ - 2 <http://lists.llvm.org/pipermail/cfe-dev/2013-August/031195.html>`_
+* `[libcxx] Visibility fixes for Windows <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130805/085461.html>`_
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/Makefile.sphinx b/chromium/buildtools/third_party/libc++/trunk/docs/Makefile.sphinx
index 2ca1e4d3faf..ae37a34b54e 100644
--- a/chromium/buildtools/third_party/libc++/trunk/docs/Makefile.sphinx
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/Makefile.sphinx
@@ -5,7 +5,7 @@
# out-of-tree builds.
# You can set these variables from the command line.
-SPHINXOPTS =
+SPHINXOPTS = -n -W
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/TestingLibcxx.rst b/chromium/buildtools/third_party/libc++/trunk/docs/TestingLibcxx.rst
index 98162d9c2e0..5c48ebe61dd 100644
--- a/chromium/buildtools/third_party/libc++/trunk/docs/TestingLibcxx.rst
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/TestingLibcxx.rst
@@ -102,6 +102,14 @@ configuration. Passing the option on the command line will override the default.
Specify the compiler used to build the tests.
+.. option:: cxx_stdlib_under_test=<stdlib name>
+
+ **Values**: libc++, libstdc++
+
+ Specify the C++ standard library being tested. Unless otherwise specified
+ libc++ is used. This option is intended to allow running the libc++ test
+ suite against other standard library implementations.
+
.. option:: std=<standard version>
**Values**: c++98, c++03, c++11, c++14, c++1z
@@ -111,20 +119,29 @@ configuration. Passing the option on the command line will override the default.
.. option:: libcxx_site_config=<path/to/lit.site.cfg>
Specify the site configuration to use when running the tests. This option
- overrides the enviroment variable LIBCXX_SITE_CONFIG.
+ overrides the environment variable LIBCXX_SITE_CONFIG.
+
+.. option:: cxx_headers=<path/to/headers>
-.. option:: libcxx_headers=<path/to/headers>
+ Specify the c++ standard library headers that are tested. By default the
+ headers in the source tree are used.
- Specify the libc++ headers that are tested. By default the headers in the
- source tree are used.
+.. option:: cxx_library_root=<path/to/lib/>
-.. option:: libcxx_library=<path/to/libc++.so>
+ Specify the directory of the libc++ library to be tested. By default the
+ library folder of the build directory is used. This option cannot be used
+ when use_system_cxx_lib is provided.
- Specify the libc++ library that is tested. By default the library in the
- build directory is used. This option cannot be used when use_system_lib is
- provided.
-.. option:: use_system_lib=<bool>
+.. option:: cxx_runtime_root=<path/to/lib/>
+
+ Specify the directory of the libc++ library to use at runtime. This directory
+ is not added to the linkers search path. This can be used to compile tests
+ against one version of libc++ and run them using another. The default value
+ for this option is `cxx_library_root`. This option cannot be used
+ when use_system_cxx_lib is provided.
+
+.. option:: use_system_cxx_lib=<bool>
**Default**: False
@@ -182,10 +199,68 @@ Environment Variables
.. envvar:: LIBCXX_SITE_CONFIG=<path/to/lit.site.cfg>
Specify the site configuration to use when running the tests.
- Also see :option:`libcxx_site_config`.
+ Also see `libcxx_site_config`.
.. envvar:: LIBCXX_COLOR_DIAGNOSTICS
If ``LIBCXX_COLOR_DIAGNOSTICS`` is defined then the test suite will attempt
to use color diagnostic outputs from the compiler.
- Also see :option:`color_diagnostics`.
+ Also see `color_diagnostics`.
+
+Benchmarks
+==========
+
+Libc++ contains benchmark tests separately from the test of the test suite.
+The benchmarks are written using the `Google Benchmark`_ library, a copy of which
+is stored in the libc++ repository.
+
+For more information about using the Google Benchmark library see the
+`official documentation <https://github.com/google/benchmark>`_.
+
+.. _`Google Benchmark`: https://github.com/google/benchmark
+
+Building Benchmarks
+-------------------
+
+The benchmark tests are not built by default. The benchmarks can be built using
+the ``cxx-benchmarks`` target.
+
+An example build would look like:
+
+.. code-block:: bash
+
+ $ cd build
+ $ cmake [options] <path to libcxx sources>
+ $ make cxx-benchmarks
+
+This will build all of the benchmarks under ``<libcxx-src>/benchmarks`` to be
+built against the just-built libc++. The compiled tests are output into
+``build/benchmarks``.
+
+The benchmarks can also be built against the platforms native standard library
+using the ``-DLIBCXX_BUILD_BENCHMARKS_NATIVE_STDLIB=ON`` CMake option. This
+is useful for comparing the performance of libc++ to other standard libraries.
+The compiled benchmarks are named ``<test>.libcxx.out`` if they test libc++ and
+``<test>.native.out`` otherwise.
+
+Also See:
+
+ * :ref:`Building Libc++ <build instructions>`
+ * :ref:`CMake Options`
+
+Running Benchmarks
+------------------
+
+The benchmarks must be run manually by the user. Currently there is no way
+to run them as part of the build.
+
+For example:
+
+.. code-block:: bash
+
+ $ cd build/benchmarks
+ $ make cxx-benchmarks
+ $ ./algorithms.libcxx.out # Runs all the benchmarks
+ $ ./algorithms.libcxx.out --benchmark_filter=BM_Sort.* # Only runs the sort benchmarks
+
+For more information about running benchmarks see `Google Benchmark`_.
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/UsingLibcxx.rst b/chromium/buildtools/third_party/libc++/trunk/docs/UsingLibcxx.rst
index 2a117917638..183664655aa 100644
--- a/chromium/buildtools/third_party/libc++/trunk/docs/UsingLibcxx.rst
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/UsingLibcxx.rst
@@ -49,7 +49,30 @@ An example of using ``LD_LIBRARY_PATH``:
$ export LD_LIBRARY_PATH=<libcxx-install-prefix>/lib
$ ./a.out # Searches for libc++ along LD_LIBRARY_PATH
+Using libc++experimental and ``<experimental/...>``
+=====================================================
+Libc++ provides implementations of experimental technical specifications
+in a separate library, ``libc++experimental.a``. Users of ``<experimental/...>``
+headers may be required to link ``-lc++experimental``.
+
+.. code-block:: bash
+
+ $ clang++ -std=c++14 -stdlib=libc++ test.cpp -lc++experimental
+
+Libc++experimental.a may not always be available, even when libc++ is already
+installed. For information on building libc++experimental from source see
+:ref:`Building Libc++ <build instructions>` and
+:ref:`libc++experimental CMake Options <libc++experimental options>`.
+
+Also see the `Experimental Library Implementation Status <http://libcxx.llvm.org/ts1z_status.html>`__
+page.
+
+.. warning::
+ Experimental libraries are Experimental.
+ * The contents of the ``<experimental/...>`` headers and ``libc++experimental.a``
+ library will not remain compatible between versions.
+ * No guarantees of API or ABI stability are provided.
Using libc++ on Linux
=====================
@@ -87,3 +110,90 @@ not just libstdc++ so they must be manually linked. For example:
$ g++ -nostdinc++ -I<libcxx-install-prefix>/include/c++/v1 \
test.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc
+
+
+GDB Pretty printers for libc++
+------------------------------
+
+GDB does not support pretty-printing of libc++ symbols by default. Unfortunately
+libc++ does not provide pretty-printers itself. However there are 3rd
+party implementations available and although they are not officially
+supported by libc++ they may be useful to users.
+
+Known 3rd Party Implementations Include:
+
+* `Koutheir's libc++ pretty-printers <https://github.com/koutheir/libcxx-pretty-printers>`_.
+
+
+Libc++ Configuration Macros
+===========================
+
+Libc++ provides a number of configuration macros which can be used to enable
+or disable extended libc++ behavior, including enabling "debug mode" or
+thread safety annotations.
+
+**_LIBCPP_DEBUG**:
+ See :ref:`using-debug-mode` for more information.
+
+**_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS**:
+ This macro is used to enable -Wthread-safety annotations on libc++'s
+ ``std::mutex`` and ``std::lock_guard``. By default these annotations are
+ disabled and must be manually enabled by the user.
+
+**_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS**:
+ This macro is used to disable all visibility annotations inside libc++.
+ Defining this macro and then building libc++ with hidden visibility gives a
+ build of libc++ which does not export any symbols, which can be useful when
+ building statically for inclusion into another library.
+
+**_LIBCPP_DISABLE_EXTERN_TEMPLATE**:
+ This macro is used to disable extern template declarations in the libc++
+ headers. The intended use case is for clients who wish to use the libc++
+ headers without taking a dependency on the libc++ library itself.
+
+**_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION**:
+ This macro is used to re-enable an extension in `std::tuple` which allowed
+ it to be implicitly constructed from fewer initializers than contained
+ elements. Elements without an initializer are default constructed. For example:
+
+ .. code-block:: cpp
+
+ std::tuple<std::string, int, std::error_code> foo() {
+ return {"hello world", 42}; // default constructs error_code
+ }
+
+
+ Since libc++ 4.0 this extension has been disabled by default. This macro
+ may be defined to re-enable it in order to support existing code that depends
+ on the extension. New use of this extension should be discouraged.
+ See `PR 27374 <http://llvm.org/PR27374>`_ for more information.
+
+ Note: The "reduced-arity-initialization" extension is still offered but only
+ for explicit conversions. Example:
+
+ .. code-block:: cpp
+
+ auto foo() {
+ using Tup = std::tuple<std::string, int, std::error_code>;
+ return Tup{"hello world", 42}; // explicit constructor called. OK.
+ }
+
+**_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS**:
+ This macro disables the additional diagnostics generated by libc++ using the
+ `diagnose_if` attribute. These additional diagnostics include checks for:
+
+ * Giving `set`, `map`, `multiset`, `multimap` a comparator which is not
+ const callable.
+
+C++17 Specific Configuration Macros
+-----------------------------------
+**_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES**:
+ This macro is used to re-enable all the features removed in C++17. The effect
+ is equivalent to manually defining each macro listed below.
+
+**_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS**:
+ This macro is used to re-enable the `set_unexpected`, `get_unexpected`, and
+ `unexpected` functions, which were removed in C++17.
+
+**_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR**:
+ This macro is used to re-enable `std::auto_ptr` in C++17.
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/conf.py b/chromium/buildtools/third_party/libc++/trunk/docs/conf.py
index 915daa47a51..17fb401a847 100644
--- a/chromium/buildtools/third_party/libc++/trunk/docs/conf.py
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/conf.py
@@ -40,16 +40,16 @@ master_doc = 'index'
# General information about the project.
project = u'libc++'
-copyright = u'2011-2015, LLVM Project'
+copyright = u'2011-2017, LLVM Project'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '3.8'
+version = '5.0'
# The full version, including alpha/beta/rc tags.
-release = '3.8'
+release = '5.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/chromium/buildtools/third_party/libc++/trunk/docs/index.rst b/chromium/buildtools/third_party/libc++/trunk/docs/index.rst
index b0c8b813f57..3526b47210f 100644
--- a/chromium/buildtools/third_party/libc++/trunk/docs/index.rst
+++ b/chromium/buildtools/third_party/libc++/trunk/docs/index.rst
@@ -7,7 +7,8 @@
Overview
========
-libc++ is a new implementation of the C++ standard library, targeting C++11.
+libc++ is a new implementation of the C++ standard library, targeting C++11 and
+above.
* Features and Goals
@@ -119,7 +120,7 @@ This list contains known issues with libc++
A full list of currently open libc++ bugs can be `found here`__.
-.. __: https://llvm.org/bugs/buglist.cgi?component=All%20Bugs&product=libc%2B%2B&query_format=advanced&resolution=---&order=changeddate%20DESC%2Cassigned_to%20DESC%2Cbug_status%2Cpriority%2Cbug_id&list_id=74184
+.. __: https://bugs.llvm.org/buglist.cgi?component=All%20Bugs&product=libc%2B%2B&query_format=advanced&resolution=---&order=changeddate%20DESC%2Cassigned_to%20DESC%2Cbug_status%2Cpriority%2Cbug_id&list_id=74184
Design Documents
----------------
@@ -127,13 +128,15 @@ Design Documents
.. toctree::
:maxdepth: 1
+ DesignDocs/AvailabilityMarkup
+ DesignDocs/DebugMode
DesignDocs/CapturingConfigInfo
DesignDocs/ABIVersioning
-
+ DesignDocs/VisibilityMacros
+ DesignDocs/ThreadingSupportAPI
* `<atomic> design <http://libcxx.llvm.org/atomic_design.html>`_
* `<type_traits> design <http://libcxx.llvm.org/type_traits_design.html>`_
-* `Status of debug mode <http://libcxx.llvm.org/debug_mode.html>`_
* `Notes by Marshall Clow`__
.. __: https://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/
@@ -143,7 +146,7 @@ Build Bots and Test Coverage
* `LLVM Buildbot Builders <http://lab.llvm.org:8011/console>`_
* `Apple Jenkins Builders <http://lab.llvm.org:8080/green/view/Libcxx/>`_
-* `EricWF's Nightly Builders <http://ds2.efcs.ca:8080/console>`_
+* `Windows Appveyor Builders <https://ci.appveyor.com/project/llvm-mirror/libcxx>`_
* `Code Coverage Results <http://efcs.ca/libcxx-coverage>`_
Getting Involved
@@ -178,7 +181,7 @@ Quick Links
===========
* `LLVM Homepage <http://llvm.org/>`_
* `libc++abi Homepage <http://libcxxabi.llvm.org/>`_
-* `LLVM Bugzilla <http://llvm.org/bugs/>`_
+* `LLVM Bugzilla <https://bugs.llvm.org/>`_
* `cfe-commits Mailing List`_
* `cfe-dev Mailing List`_
* `Browse libc++ -- SVN <http://llvm.org/svn/llvm-project/libcxx/trunk/>`_
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/CMakeLists.txt b/chromium/buildtools/third_party/libc++/trunk/include/CMakeLists.txt
index e16dc8b4de6..1c6790ab465 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/CMakeLists.txt
+++ b/chromium/buildtools/third_party/libc++/trunk/include/CMakeLists.txt
@@ -10,43 +10,57 @@ set(LIBCXX_HEADER_PATTERN
${LIBCXX_SUPPORT_HEADER_PATTERN}
)
-file(COPY .
- DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1"
- FILES_MATCHING
- ${LIBCXX_HEADER_PATTERN}
- )
+if(NOT LIBCXX_USING_INSTALLED_LLVM AND LLVM_BINARY_DIR)
+ file(COPY .
+ DESTINATION "${LLVM_BINARY_DIR}/include/c++/v1"
+ FILES_MATCHING
+ ${LIBCXX_HEADER_PATTERN}
+ )
+endif()
if (LIBCXX_INSTALL_HEADERS)
install(DIRECTORY .
DESTINATION include/c++/v1
- COMPONENT libcxx
+ COMPONENT cxx-headers
FILES_MATCHING
${LIBCXX_HEADER_PATTERN}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
if (LIBCXX_NEEDS_SITE_CONFIG)
- set(UNIX_CAT cat)
- if (WIN32)
- set(UNIX_CAT type)
- endif()
# Generate and install a custom __config header. The new header is created
# by prepending __config_site to the current __config header.
add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
- COMMAND ${CMAKE_COMMAND} -E copy ${LIBCXX_BINARY_DIR}/__config_site ${LIBCXX_BINARY_DIR}/__generated_config
- COMMAND ${UNIX_CAT} ${LIBCXX_SOURCE_DIR}/include/__config >> ${LIBCXX_BINARY_DIR}/__generated_config
+ COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
+ ${LIBCXX_BINARY_DIR}/__config_site
+ ${LIBCXX_SOURCE_DIR}/include/__config
+ -o ${LIBCXX_BINARY_DIR}/__generated_config
DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
${LIBCXX_BINARY_DIR}/__config_site
)
# Add a target that executes the generation commands.
add_custom_target(generate_config_header ALL
DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
+ set(generated_config_deps generate_config_header)
# Install the generated header as __config.
install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
DESTINATION include/c++/v1
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
RENAME __config
- COMPONENT libcxx)
+ COMPONENT cxx-headers)
+ endif()
+
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ # this target is just needed as a placeholder for the distribution target
+ add_custom_target(cxx-headers)
+ add_custom_target(install-cxx-headers
+ DEPENDS cxx-headers ${generated_config_deps}
+ COMMAND "${CMAKE_COMMAND}"
+ -DCMAKE_INSTALL_COMPONENT=cxx-headers
+ -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+
+ add_custom_target(libcxx-headers)
+ add_custom_target(install-libcxx-headers DEPENDS install-cxx-headers)
endif()
endif()
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__bit_reference b/chromium/buildtools/third_party/libc++/trunk/include/__bit_reference
index 5659ed06824..9aea9614528 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__bit_reference
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__bit_reference
@@ -40,11 +40,8 @@ class __bit_reference
__storage_pointer __seg_;
__storage_type __mask_;
-#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
friend typename _Cp::__self;
-#else
- friend class _Cp::__self;
-#endif
+
friend class __bit_const_reference<_Cp>;
friend class __bit_iterator<_Cp, false>;
public:
@@ -130,11 +127,7 @@ class __bit_const_reference
__storage_pointer __seg_;
__storage_type __mask_;
-#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
friend typename _Cp::__self;
-#else
- friend class _Cp::__self;
-#endif
friend class __bit_iterator<_Cp, true>;
public:
_LIBCPP_INLINE_VISIBILITY
@@ -163,7 +156,7 @@ __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
{
typedef __bit_iterator<_Cp, _IsConst> _It;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ static const int __bits_per_word = _It::__bits_per_word;
// do first partial word
if (__first.__ctz_ != 0)
{
@@ -199,7 +192,7 @@ __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
{
typedef __bit_iterator<_Cp, _IsConst> _It;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
// do first partial word
if (__first.__ctz_ != 0)
{
@@ -251,7 +244,7 @@ __count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type
typedef __bit_iterator<_Cp, _IsConst> _It;
typedef typename _It::__storage_type __storage_type;
typedef typename _It::difference_type difference_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
difference_type __r = 0;
// do first partial word
if (__first.__ctz_ != 0)
@@ -282,7 +275,7 @@ __count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_typ
typedef __bit_iterator<_Cp, _IsConst> _It;
typedef typename _It::__storage_type __storage_type;
typedef typename _It::difference_type difference_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
difference_type __r = 0;
// do first partial word
if (__first.__ctz_ != 0)
@@ -324,7 +317,7 @@ __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
{
typedef __bit_iterator<_Cp, false> _It;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
// do first partial word
if (__first.__ctz_ != 0)
{
@@ -354,7 +347,7 @@ __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
{
typedef __bit_iterator<_Cp, false> _It;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ const int __bits_per_word = _It::__bits_per_word;
// do first partial word
if (__first.__ctz_ != 0)
{
@@ -412,7 +405,7 @@ __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsCon
typedef __bit_iterator<_Cp, _IsConst> _In;
typedef typename _In::difference_type difference_type;
typedef typename _In::__storage_type __storage_type;
- static const unsigned __bits_per_word = _In::__bits_per_word;
+ const int __bits_per_word = _In::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -461,7 +454,7 @@ __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsC
typedef __bit_iterator<_Cp, _IsConst> _In;
typedef typename _In::difference_type difference_type;
typedef typename _In::__storage_type __storage_type;
- static const unsigned __bits_per_word = _In::__bits_per_word;
+ static const int __bits_per_word = _In::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -551,7 +544,7 @@ __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_C
typedef __bit_iterator<_Cp, _IsConst> _In;
typedef typename _In::difference_type difference_type;
typedef typename _In::__storage_type __storage_type;
- static const unsigned __bits_per_word = _In::__bits_per_word;
+ const int __bits_per_word = _In::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -600,7 +593,7 @@ __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<
typedef __bit_iterator<_Cp, _IsConst> _In;
typedef typename _In::difference_type difference_type;
typedef typename _In::__storage_type __storage_type;
- static const unsigned __bits_per_word = _In::__bits_per_word;
+ const int __bits_per_word = _In::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -718,7 +711,7 @@ __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1,
typedef __bit_iterator<__C1, false> _I1;
typedef typename _I1::difference_type difference_type;
typedef typename _I1::__storage_type __storage_type;
- static const unsigned __bits_per_word = _I1::__bits_per_word;
+ const int __bits_per_word = _I1::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -768,7 +761,7 @@ __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1
typedef __bit_iterator<__C1, false> _I1;
typedef typename _I1::difference_type difference_type;
typedef typename _I1::__storage_type __storage_type;
- static const unsigned __bits_per_word = _I1::__bits_per_word;
+ const int __bits_per_word = _I1::__bits_per_word;
difference_type __n = __last - __first;
if (__n > 0)
{
@@ -959,7 +952,7 @@ __equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1>
typedef __bit_iterator<_Cp, _IC1> _It;
typedef typename _It::difference_type difference_type;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ static const int __bits_per_word = _It::__bits_per_word;
difference_type __n = __last1 - __first1;
if (__n > 0)
{
@@ -1041,7 +1034,7 @@ __equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __
typedef __bit_iterator<_Cp, _IC1> _It;
typedef typename _It::difference_type difference_type;
typedef typename _It::__storage_type __storage_type;
- static const unsigned __bits_per_word = _It::__bits_per_word;
+ static const int __bits_per_word = _It::__bits_per_word;
difference_type __n = __last1 - __first1;
if (__n > 0)
{
@@ -1221,11 +1214,8 @@ private:
__bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
: __seg_(__s), __ctz_(__ctz) {}
-#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
friend typename _Cp::__self;
-#else
- friend class _Cp::__self;
-#endif
+
friend class __bit_reference<_Cp>;
friend class __bit_const_reference<_Cp>;
friend class __bit_iterator<_Cp, true>;
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__bsd_locale_defaults.h b/chromium/buildtools/third_party/libc++/trunk/include/__bsd_locale_defaults.h
new file mode 100644
index 00000000000..f315ca2949e
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__bsd_locale_defaults.h
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===---------------------- __bsd_locale_defaults.h -----------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// The BSDs have lots of *_l functions. We don't want to define those symbols
+// on other platforms though, for fear of conflicts with user code. So here,
+// we will define the mapping from an internal macro to the real BSD symbol.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_BSD_LOCALE_DEFAULTS_H
+#define _LIBCPP_BSD_LOCALE_DEFAULTS_H
+
+#define __libcpp_mb_cur_max_l(loc) MB_CUR_MAX_L(loc)
+#define __libcpp_btowc_l(ch, loc) btowc_l(ch, loc)
+#define __libcpp_wctob_l(wch, loc) wctob_l(wch, loc)
+#define __libcpp_wcsnrtombs_l(dst, src, nwc, len, ps, loc) wcsnrtombs_l(dst, src, nwc, len, ps, loc)
+#define __libcpp_wcrtomb_l(src, wc, ps, loc) wcrtomb_l(src, wc, ps, loc)
+#define __libcpp_mbsnrtowcs_l(dst, src, nms, len, ps, loc) mbsnrtowcs_l(dst, src, nms, len, ps, loc)
+#define __libcpp_mbrtowc_l(pwc, s, n, ps, l) mbrtowc_l(pwc, s, n, ps, l)
+#define __libcpp_mbtowc_l(pwc, pmb, max, l) mbtowc_l(pwc, pmb, max, l)
+#define __libcpp_mbrlen_l(s, n, ps, l) mbrlen_l(s, n, ps, l)
+#define __libcpp_localeconv_l(l) localeconv_l(l)
+#define __libcpp_mbsrtowcs_l(dest, src, len, ps, l) mbsrtowcs_l(dest, src, len, ps, l)
+#define __libcpp_snprintf_l(...) snprintf_l(__VA_ARGS__)
+#define __libcpp_asprintf_l(...) asprintf_l(__VA_ARGS__)
+#define __libcpp_sscanf_l(...) sscanf_l(__VA_ARGS__)
+
+#endif // _LIBCPP_BSD_LOCALE_DEFAULTS_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__bsd_locale_fallbacks.h b/chromium/buildtools/third_party/libc++/trunk/include/__bsd_locale_fallbacks.h
new file mode 100644
index 00000000000..3425ce659b7
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__bsd_locale_fallbacks.h
@@ -0,0 +1,135 @@
+// -*- C++ -*-
+//===---------------------- __bsd_locale_fallbacks.h ----------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// The BSDs have lots of *_l functions. This file provides reimplementations
+// of those functions for non-BSD platforms.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H
+#define _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H
+
+#include <stdlib.h>
+#include <memory>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+inline _LIBCPP_ALWAYS_INLINE
+decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return MB_CUR_MAX;
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+wint_t __libcpp_btowc_l(int __c, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return btowc(__c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+int __libcpp_wctob_l(wint_t __c, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return wctob(__c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
+ size_t __len, mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return wcrtomb(__s, __wc, __ps);
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
+ size_t __len, mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
+ mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbrtowc(__pwc, __s, __n, __ps);
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbtowc(__pwc, __pmb, __max);
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbrlen(__s, __n, __ps);
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+lconv *__libcpp_localeconv_l(locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return localeconv();
+}
+
+inline _LIBCPP_ALWAYS_INLINE
+size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
+ mbstate_t *__ps, locale_t __l)
+{
+ __libcpp_locale_guard __current(__l);
+ return mbsrtowcs(__dest, __src, __len, __ps);
+}
+
+inline
+int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
+ va_list __va;
+ va_start(__va, __format);
+ __libcpp_locale_guard __current(__l);
+ int __res = vsnprintf(__s, __n, __format, __va);
+ va_end(__va);
+ return __res;
+}
+
+inline
+int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
+ va_list __va;
+ va_start(__va, __format);
+ __libcpp_locale_guard __current(__l);
+ int __res = vasprintf(__s, __format, __va);
+ va_end(__va);
+ return __res;
+}
+
+inline
+int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
+ va_list __va;
+ va_start(__va, __format);
+ __libcpp_locale_guard __current(__l);
+ int __res = vsscanf(__s, __format, __va);
+ va_end(__va);
+ return __res;
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__config b/chromium/buildtools/third_party/libc++/trunk/include/__config
index f141f4f1b7f..4ad700e234c 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__config
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__config
@@ -12,8 +12,10 @@
#define _LIBCPP_CONFIG
#if defined(_MSC_VER) && !defined(__clang__)
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#endif
+#endif
#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
#pragma GCC system_header
@@ -23,22 +25,76 @@
#ifdef __GNUC__
#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
+// The _GNUC_VER_NEW macro better represents the new GCC versioning scheme
+// introduced in GCC 5.0.
+#define _GNUC_VER_NEW (_GNUC_VER * 10 + __GNUC_PATCHLEVEL__)
#else
#define _GNUC_VER 0
+#define _GNUC_VER_NEW 0
#endif
-#define _LIBCPP_VERSION 3800
+#define _LIBCPP_VERSION 5000
#ifndef _LIBCPP_ABI_VERSION
#define _LIBCPP_ABI_VERSION 1
#endif
+#if defined(__ELF__)
+#define _LIBCPP_OBJECT_FORMAT_ELF 1
+#elif defined(__MACH__)
+#define _LIBCPP_OBJECT_FORMAT_MACHO 1
+#elif defined(_WIN32)
+#define _LIBCPP_OBJECT_FORMAT_COFF 1
+#else
+#error Unknown object file format
+#endif
+
#if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
-// Change short string represention so that string data starts at offset 0,
+// Change short string representation so that string data starts at offset 0,
// improving its alignment in some cases.
#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
// Fix deque iterator type in order to support incomplete types.
#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
+// Fix undefined behavior in how std::list stores it's linked nodes.
+#define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
+// Fix undefined behavior in how __tree stores its end and parent nodes.
+#define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
+// Fix undefined behavior in how __hash_table stores it's pointer types
+#define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
+#define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
+#define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
+// Don't use a nullptr_t simulation type in C++03 instead using C++11 nullptr
+// provided under the alternate keyword __nullptr, which changes the mangling
+// of nullptr_t. This option is ABI incompatible with GCC in C++03 mode.
+#define _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR
+// Define the `pointer_safety` enum as a C++11 strongly typed enumeration
+// instead of as a class simulating an enum. If this option is enabled
+// `pointer_safety` and `get_pointer_safety()` will no longer be available
+// in C++03.
+#define _LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE
+// Define a key function for `bad_function_call` in the library, to centralize
+// its vtable and typeinfo to libc++ rather than having all other libraries
+// using that class define their own copies.
+#define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+#elif _LIBCPP_ABI_VERSION == 1
+#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
+// Enable compiling copies of now inline methods into the dylib to support
+// applications compiled against older libraries. This is unnecessary with
+// COFF dllexport semantics, since dllexport forces a non-inline definition
+// of inline functions to be emitted anyway. Our own non-inline copy would
+// conflict with the dllexport-emitted copy, so we disable it.
+#define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
+#endif
+// Feature macros for disabling pre ABI v1 features. All of these options
+// are deprecated.
+#if defined(__FreeBSD__)
+#define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
+#endif
+#endif
+
+#ifdef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
+#error "_LIBCPP_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \
+ use _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead
#endif
#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
@@ -46,6 +102,9 @@
#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
+#if __cplusplus < 201103L
+#define _LIBCPP_CXX03_LANG
+#endif
#ifndef __has_attribute
#define __has_attribute(__x) 0
@@ -64,7 +123,51 @@
#ifndef __is_identifier
#define __is_identifier(__x) 1
#endif
+#ifndef __has_declspec_attribute
+#define __has_declspec_attribute(__x) 0
+#endif
+
+#define __has_keyword(__x) !(__is_identifier(__x))
+#ifdef __has_include
+#define __libcpp_has_include(__x) __has_include(__x)
+#else
+#define __libcpp_has_include(__x) 0
+#endif
+
+#if defined(__clang__)
+#define _LIBCPP_COMPILER_CLANG
+# ifndef __apple_build_version__
+# define _LIBCPP_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
+# endif
+#elif defined(__GNUC__)
+#define _LIBCPP_COMPILER_GCC
+#elif defined(_MSC_VER)
+#define _LIBCPP_COMPILER_MSVC
+#elif defined(__IBMCPP__)
+#define _LIBCPP_COMPILER_IBM
+#endif
+
+#ifndef _LIBCPP_CLANG_VER
+#define _LIBCPP_CLANG_VER 0
+#endif
+
+// FIXME: ABI detection should be done via compiler builtin macros. This
+// is just a placeholder until Clang implements such macros. For now assume
+// that Windows compilers pretending to be MSVC++ target the microsoft ABI.
+#if defined(_WIN32) && defined(_MSC_VER)
+# define _LIBCPP_ABI_MICROSOFT
+#else
+# define _LIBCPP_ABI_ITANIUM
+#endif
+
+// Need to detect which libc we're using if we're on Linux.
+#if defined(__linux__)
+#include <features.h>
+#if !defined(__GLIBC_PREREQ)
+#define __GLIBC_PREREQ(a, b) 0
+#endif // !defined(__GLIBC_PREREQ)
+#endif // defined(__linux__)
#ifdef __LITTLE_ENDIAN__
#if __LITTLE_ENDIAN__
@@ -116,24 +219,32 @@
# define _LIBCPP_HAS_QUICK_EXIT
#endif // __NetBSD__
-#ifdef _WIN32
+#if defined(_WIN32)
+# define _LIBCPP_WIN32API 1
# define _LIBCPP_LITTLE_ENDIAN 1
# define _LIBCPP_BIG_ENDIAN 0
-// Compiler intrinsics (MSVC)
-#if defined(_MSC_VER) && _MSC_VER >= 1400
-# define _LIBCPP_HAS_IS_BASE_OF
-# endif
-# if defined(_MSC_VER) && !defined(__clang__)
-# define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler
-# define _LIBCPP_TOSTRING2(x) #x
-# define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
-# define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x))
-# endif
-# // If mingw not explicitly detected, assume using MS C runtime only.
+# define _LIBCPP_SHORT_WCHAR 1
+// If mingw not explicitly detected, assume using MS C runtime only.
# ifndef __MINGW32__
# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
# endif
-#endif // _WIN32
+# if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))
+# define _LIBCPP_HAS_BITSCAN64
+# endif
+# if defined(_LIBCPP_MSVCRT)
+# define _LIBCPP_HAS_QUICK_EXIT
+# endif
+
+// Some CRT APIs are unavailable to store apps
+#if defined(WINAPI_FAMILY)
+#include <winapifamily.h>
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && \
+ (!defined(WINAPI_PARTITION_SYSTEM) || \
+ !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM))
+#define _LIBCPP_WINDOWS_STORE_APP
+#endif
+#endif
+#endif // defined(_WIN32)
#ifdef __sun__
# include <sys/isa_defs.h>
@@ -157,7 +268,7 @@
// including accesses to the special files under /dev. C++11's
// std::random_device is instead exposed through a NaCl syscall.
# define _LIBCPP_USING_NACL_RANDOM
-#elif defined(_WIN32)
+#elif defined(_LIBCPP_WIN32API)
# define _LIBCPP_USING_WIN32_RANDOM
#else
# define _LIBCPP_USING_DEV_RANDOM
@@ -176,90 +287,18 @@
# endif
#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
-#ifdef _WIN32
-
-// only really useful for a DLL
-#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
-# ifdef cxx_EXPORTS
-# define _LIBCPP_HIDDEN
-# define _LIBCPP_FUNC_VIS __declspec(dllexport)
-# define _LIBCPP_TYPE_VIS __declspec(dllexport)
-# else
-# define _LIBCPP_HIDDEN
-# define _LIBCPP_FUNC_VIS __declspec(dllimport)
-# define _LIBCPP_TYPE_VIS __declspec(dllimport)
-# endif
+#if __has_attribute(__no_sanitize__)
+#define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
#else
-# define _LIBCPP_HIDDEN
-# define _LIBCPP_FUNC_VIS
-# define _LIBCPP_TYPE_VIS
+#define _LIBCPP_NO_CFI
#endif
-#define _LIBCPP_TYPE_VIS_ONLY
-#define _LIBCPP_FUNC_VIS_ONLY
-
-#ifndef _LIBCPP_INLINE_VISIBILITY
-# ifdef _LIBCPP_MSVC
-# define _LIBCPP_INLINE_VISIBILITY __forceinline
-# else // MinGW GCC and Clang
-# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
-# endif
-#endif
-
-#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
-#endif
-
-#ifndef _LIBCPP_ALWAYS_INLINE
-# ifdef _LIBCPP_MSVC
-# define _LIBCPP_ALWAYS_INLINE __forceinline
-# endif
-#endif
-
-#endif // _WIN32
-
-#ifndef _LIBCPP_HIDDEN
-#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
-#endif
-
-#ifndef _LIBCPP_FUNC_VIS
-#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
-#endif
-
-#ifndef _LIBCPP_TYPE_VIS
-# if __has_attribute(__type_visibility__)
-# define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
-# else
-# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
-# endif
-#endif
-
-#ifndef _LIBCPP_TYPE_VIS_ONLY
-# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS
-#endif
-
-#ifndef _LIBCPP_FUNC_VIS_ONLY
-# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS
-#endif
-
-#ifndef _LIBCPP_INLINE_VISIBILITY
-#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
-#endif
-
-#ifndef _LIBCPP_EXCEPTION_ABI
-#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
-#endif
-
-#ifndef _LIBCPP_ALWAYS_INLINE
-#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
-#endif
-
-#if defined(__clang__)
+#if defined(_LIBCPP_COMPILER_CLANG)
// _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
// _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility.
#if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
- !defined(__arm__)) || \
+ (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)) || \
defined(_LIBCPP_ALTERNATE_STRING_LAYOUT)
#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
#endif
@@ -272,20 +311,16 @@
# define _ALIGNAS(x) __attribute__((__aligned__(x)))
#endif
-#if !__has_feature(cxx_alias_templates)
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#endif
-
#if __cplusplus < 201103L
typedef __char16_t char16_t;
typedef __char32_t char32_t;
#endif
-#if !(__has_feature(cxx_exceptions))
+#if !(__has_feature(cxx_exceptions)) && !defined(_LIBCPP_NO_EXCEPTIONS)
#define _LIBCPP_NO_EXCEPTIONS
#endif
-#if !(__has_feature(cxx_rtti))
+#if !(__has_feature(cxx_rtti)) && !defined(_LIBCPP_NO_RTTI)
#define _LIBCPP_NO_RTTI
#endif
@@ -303,52 +338,30 @@ typedef __char32_t char32_t;
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
#endif
-#define _LIBCPP_UNUSED __attribute__((__unused__))
-
-#if !(__has_feature(cxx_default_function_template_args))
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
-#endif
-
-#if !(__has_feature(cxx_defaulted_functions))
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-#endif // !(__has_feature(cxx_defaulted_functions))
-
-#if !(__has_feature(cxx_deleted_functions))
-#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-#endif // !(__has_feature(cxx_deleted_functions))
-
#if !(__has_feature(cxx_lambdas))
#define _LIBCPP_HAS_NO_LAMBDAS
#endif
#if !(__has_feature(cxx_nullptr))
-#define _LIBCPP_HAS_NO_NULLPTR
+# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR)
+# define nullptr __nullptr
+# else
+# define _LIBCPP_HAS_NO_NULLPTR
+# endif
#endif
#if !(__has_feature(cxx_rvalue_references))
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
-#if !(__has_feature(cxx_static_assert))
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
-#endif
-
#if !(__has_feature(cxx_auto_type))
#define _LIBCPP_HAS_NO_AUTO_TYPE
#endif
-#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return)
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#endif
-
#if !(__has_feature(cxx_variadic_templates))
#define _LIBCPP_HAS_NO_VARIADICS
#endif
-#if !(__has_feature(cxx_trailing_return))
-#define _LIBCPP_HAS_NO_TRAILING_RETURN
-#endif
-
#if !(__has_feature(cxx_generalized_initializers))
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#endif
@@ -368,7 +381,6 @@ typedef __char32_t char32_t;
#if __has_feature(objc_arc_weak)
#define _LIBCPP_HAS_OBJC_ARC_WEAK
-#define _LIBCPP_HAS_NO_STRONG_ENUMS
#endif
#if !(__has_feature(cxx_constexpr))
@@ -387,12 +399,12 @@ typedef __char32_t char32_t;
#if defined(__FreeBSD__)
#define _LIBCPP_HAS_QUICK_EXIT
#define _LIBCPP_HAS_C11_FEATURES
-#elif defined(__ANDROID__)
+#elif defined(__Fuchsia__)
#define _LIBCPP_HAS_QUICK_EXIT
+#define _LIBCPP_HAS_C11_FEATURES
#elif defined(__linux__)
#if !defined(_LIBCPP_HAS_MUSL_LIBC)
-# include <features.h>
-#if __GLIBC_PREREQ(2, 15)
+#if __GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
#define _LIBCPP_HAS_QUICK_EXIT
#endif
#if __GLIBC_PREREQ(2, 17)
@@ -431,15 +443,18 @@ namespace std {
#define _LIBCPP_HAS_NO_ASAN
#endif
-#elif defined(__GNUC__)
+// Allow for build-time disabling of unsigned integer sanitization
+#if !defined(_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK) && __has_attribute(no_sanitize)
+#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow")))
+#endif
+
+#elif defined(_LIBCPP_COMPILER_GCC)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
#define _LIBCPP_NORETURN __attribute__((noreturn))
-#define _LIBCPP_UNUSED __attribute__((__unused__))
-
#if _GNUC_VER >= 407
#define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
#define _LIBCPP_IS_LITERAL(T) __is_literal_type(T)
@@ -454,8 +469,6 @@ namespace std {
#define _LIBCPP_NO_EXCEPTIONS
#endif
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-
// constexpr was added to GCC in 4.6.
#if _GNUC_VER < 406
#define _LIBCPP_HAS_NO_CONSTEXPR
@@ -475,14 +488,8 @@ namespace std {
#endif
#ifndef __GXX_EXPERIMENTAL_CXX0X__
-
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_DECLTYPE
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
#define _LIBCPP_HAS_NO_NULLPTR
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -492,16 +499,12 @@ namespace std {
#else // __GXX_EXPERIMENTAL_CXX0X__
#if _GNUC_VER < 403
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#define _LIBCPP_HAS_NO_STATIC_ASSERT
#endif
#if _GNUC_VER < 404
#define _LIBCPP_HAS_NO_DECLTYPE
-#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-#define _LIBCPP_HAS_NO_TRAILING_RETURN
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#define _LIBCPP_HAS_NO_VARIADICS
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
@@ -512,45 +515,44 @@ namespace std {
#define _LIBCPP_HAS_NO_NULLPTR
#endif
-#if _GNUC_VER < 407
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-#endif
-
#endif // __GXX_EXPERIMENTAL_CXX0X__
-#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
+#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { inline namespace _LIBCPP_NAMESPACE {
#define _LIBCPP_END_NAMESPACE_STD } }
#define _VSTD std::_LIBCPP_NAMESPACE
namespace std {
-namespace _LIBCPP_NAMESPACE {
-}
-using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
+ inline namespace _LIBCPP_NAMESPACE {
+ }
}
#if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__)
#define _LIBCPP_HAS_NO_ASAN
#endif
-#elif defined(_LIBCPP_MSVC)
+#elif defined(_LIBCPP_COMPILER_MSVC)
+
+#define _LIBCPP_TOSTRING2(x) #x
+#define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
+#define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x))
+
+#if _MSC_VER < 1900
+#error "MSVC versions prior to Visual Studio 2015 are not supported"
+#endif
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#define _LIBCPP_HAS_IS_BASE_OF
#define _LIBCPP_HAS_NO_CONSTEXPR
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
+#if _MSC_VER <= 1800
#define _LIBCPP_HAS_NO_UNICODE_CHARS
-#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif
#define _LIBCPP_HAS_NO_NOEXCEPT
#define __alignof__ __alignof
#define _LIBCPP_NORETURN __declspec(noreturn)
-#define _LIBCPP_UNUSED
#define _ALIGNAS(x) __declspec(align(x))
#define _LIBCPP_HAS_NO_VARIADICS
-
-
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
#define _LIBCPP_END_NAMESPACE_STD }
#define _VSTD std
@@ -561,17 +563,13 @@ namespace std {
#define _LIBCPP_HAS_NO_ASAN
-#elif defined(__IBMCPP__)
+#elif defined(_LIBCPP_COMPILER_IBM)
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
#define _ATTRIBUTE(x) __attribute__((x))
#define _LIBCPP_NORETURN __attribute__((noreturn))
-#define _LIBCPP_UNUSED
-#define _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
-#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#define _LIBCPP_HAS_NO_NOEXCEPT
#define _LIBCPP_HAS_NO_NULLPTR
@@ -595,7 +593,161 @@ namespace std {
#define _LIBCPP_HAS_NO_ASAN
-#endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
+#endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM]
+
+#if defined(_LIBCPP_OBJECT_FORMAT_COFF)
+#if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# define _LIBCPP_DLL_VIS
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+# define _LIBCPP_OVERRIDABLE_FUNC_VIS
+#elif defined(_LIBCPP_BUILDING_LIBRARY)
+# define _LIBCPP_DLL_VIS __declspec(dllexport)
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCPP_DLL_VIS
+# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_DLL_VIS
+#else
+# define _LIBCPP_DLL_VIS __declspec(dllimport)
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_DLL_VIS
+# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+# define _LIBCPP_OVERRIDABLE_FUNC_VIS
+#endif
+
+#define _LIBCPP_TYPE_VIS _LIBCPP_DLL_VIS
+#define _LIBCPP_FUNC_VIS _LIBCPP_DLL_VIS
+#define _LIBCPP_EXTERN_VIS _LIBCPP_DLL_VIS
+#define _LIBCPP_EXCEPTION_ABI _LIBCPP_DLL_VIS
+#define _LIBCPP_HIDDEN
+#define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+#define _LIBCPP_TEMPLATE_VIS
+#define _LIBCPP_FUNC_VIS_ONLY
+#define _LIBCPP_ENUM_VIS
+
+#if defined(_LIBCPP_COMPILER_MSVC)
+# define _LIBCPP_INLINE_VISIBILITY __forceinline
+# define _LIBCPP_ALWAYS_INLINE __forceinline
+# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __forceinline
+#else
+# define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
+# define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
+# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__ ((__always_inline__))
+#endif
+#endif // defined(_LIBCPP_OBJECT_FORMAT_COFF)
+
+#ifndef _LIBCPP_HIDDEN
+#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
+#else
+#define _LIBCPP_HIDDEN
+#endif
+#endif
+
+#ifndef _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+// The inline should be removed once PR32114 is resolved
+#define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCPP_HIDDEN
+#else
+#define _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+#endif
+#endif
+
+#ifndef _LIBCPP_FUNC_VIS
+#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
+#else
+#define _LIBCPP_FUNC_VIS
+#endif
+#endif
+
+#ifndef _LIBCPP_TYPE_VIS
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
+# else
+# define _LIBCPP_TYPE_VIS
+# endif
+#endif
+
+#ifndef _LIBCPP_TEMPLATE_VIS
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# if __has_attribute(__type_visibility__)
+# define _LIBCPP_TEMPLATE_VIS __attribute__ ((__type_visibility__("default")))
+# else
+# define _LIBCPP_TEMPLATE_VIS __attribute__ ((__visibility__("default")))
+# endif
+# else
+# define _LIBCPP_TEMPLATE_VIS
+# endif
+#endif
+
+#ifndef _LIBCPP_FUNC_VIS_ONLY
+# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS
+#endif
+
+#ifndef _LIBCPP_EXTERN_VIS
+# define _LIBCPP_EXTERN_VIS
+#endif
+
+#ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS
+# define _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_FUNC_VIS
+#endif
+
+#ifndef _LIBCPP_EXCEPTION_ABI
+#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
+#else
+#define _LIBCPP_EXCEPTION_ABI
+#endif
+#endif
+
+#ifndef _LIBCPP_ENUM_VIS
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
+# define _LIBCPP_ENUM_VIS __attribute__ ((__type_visibility__("default")))
+# else
+# define _LIBCPP_ENUM_VIS
+# endif
+#endif
+
+#ifndef _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__visibility__("default")))
+# else
+# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS
+# endif
+#endif
+
+#ifndef _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS
+#endif
+
+#ifndef _LIBCPP_INLINE_VISIBILITY
+#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
+#else
+#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
+#endif
+#endif
+
+#ifndef _LIBCPP_ALWAYS_INLINE
+#if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
+#else
+#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
+#endif
+#endif
+
+#ifndef _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
+# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__visibility__("default"), __always_inline__))
+# else
+# define _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY __attribute__((__always_inline__))
+# endif
+#endif
+
+#ifndef _LIBCPP_PREFERRED_OVERLOAD
+# if __has_attribute(__enable_if__)
+# define _LIBCPP_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))
+# endif
+#endif
#ifndef _LIBCPP_HAS_NO_NOEXCEPT
# define _NOEXCEPT noexcept
@@ -605,6 +757,17 @@ namespace std {
# define _NOEXCEPT_(x)
#endif
+#if defined(_LIBCPP_DEBUG_USE_EXCEPTIONS)
+# if !defined(_LIBCPP_DEBUG)
+# error cannot use _LIBCPP_DEBUG_USE_EXCEPTIONS unless _LIBCPP_DEBUG is defined
+# endif
+# define _NOEXCEPT_DEBUG noexcept(false)
+# define _NOEXCEPT_DEBUG_(x) noexcept(false)
+#else
+# define _NOEXCEPT_DEBUG _NOEXCEPT
+# define _NOEXCEPT_DEBUG_(x) _NOEXCEPT_(x)
+#endif
+
#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef unsigned short char16_t;
typedef unsigned int char32_t;
@@ -614,8 +777,10 @@ typedef unsigned int char32_t;
#define _LIBCPP_HAS_NO_INT128
#endif
-#ifdef _LIBCPP_HAS_NO_STATIC_ASSERT
-
+#ifdef _LIBCPP_CXX03_LANG
+# if __has_extension(c_static_assert)
+# define static_assert(__b, __m) _Static_assert(__b, __m)
+# else
extern "C++" {
template <bool> struct __static_assert_test;
template <> struct __static_assert_test<true> {};
@@ -624,12 +789,12 @@ template <unsigned> struct __static_assert_check {};
#define static_assert(__b, __m) \
typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
_LIBCPP_CONCAT(__t, __LINE__)
-
-#endif // _LIBCPP_HAS_NO_STATIC_ASSERT
+# endif // __has_extension(c_static_assert)
+#endif // _LIBCPP_CXX03_LANG
#ifdef _LIBCPP_HAS_NO_DECLTYPE
// GCC 4.6 provides __decltype in all standard modes.
-#if !__is_identifier(__decltype) || _GNUC_VER >= 406
+#if __has_keyword(__decltype) || _LIBCPP_CLANG_VER >= 304 || _GNUC_VER >= 406
# define decltype(__x) __decltype(__x)
#else
# define decltype(__x) __typeof__(__x)
@@ -642,19 +807,26 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_CONSTEXPR constexpr
#endif
-#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifdef _LIBCPP_CXX03_LANG
#define _LIBCPP_DEFAULT {}
#else
#define _LIBCPP_DEFAULT = default;
#endif
+#ifdef _LIBCPP_CXX03_LANG
+#define _LIBCPP_EQUAL_DELETE
+#else
+#define _LIBCPP_EQUAL_DELETE = delete
+#endif
+
#ifdef __GNUC__
#define _NOALIAS __attribute__((__malloc__))
#else
#define _NOALIAS
#endif
-#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)
+#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) || \
+ (!defined(_LIBCPP_CXX03_LANG) && defined(__GNUC__)) // All supported GCC versions
# define _LIBCPP_EXPLICIT explicit
#else
# define _LIBCPP_EXPLICIT
@@ -673,7 +845,7 @@ template <unsigned> struct __static_assert_check {};
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
};
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
-#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x
+#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
@@ -685,7 +857,14 @@ template <unsigned> struct __static_assert_check {};
# else
# error Supported values for _LIBCPP_DEBUG are 0 and 1
# endif
+# if !defined(_LIBCPP_BUILDING_LIBRARY)
# define _LIBCPP_EXTERN_TEMPLATE(...)
+# endif
+#endif
+
+#ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...)
+#define _LIBCPP_EXTERN_TEMPLATE2(...)
#endif
#ifndef _LIBCPP_EXTERN_TEMPLATE
@@ -700,20 +879,34 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63)
#endif
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || \
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT) || \
defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__)
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
#endif
-#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) && \
- !defined(__CloudABI__)
+#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+// Most unix variants have catopen. These are the specific ones that don't.
+#if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
#define _LIBCPP_HAS_CATOPEN 1
#endif
+#endif
#ifdef __FreeBSD__
#define _DECLARE_C99_LDBL_MATH 1
#endif
+#if defined(__APPLE__)
+# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
+ defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+# define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+# endif
+# if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+# if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+# endif
+# endif
+#endif // defined(__APPLE__)
+
#if defined(__APPLE__) || defined(__FreeBSD__)
#define _LIBCPP_HAS_DEFAULTRUNELOCALE
#endif
@@ -722,17 +915,13 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_WCTYPE_IS_MASK
#endif
-#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
-# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
-#endif
-
#ifndef _LIBCPP_STD_VER
# if __cplusplus <= 201103L
# define _LIBCPP_STD_VER 11
# elif __cplusplus <= 201402L
# define _LIBCPP_STD_VER 14
# else
-# define _LIBCPP_STD_VER 15 // current year, or date of c++17 ratification
+# define _LIBCPP_STD_VER 16 // current year, or date of c++17 ratification
# endif
#endif // _LIBCPP_STD_VER
@@ -756,6 +945,17 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_CONSTEXPR_AFTER_CXX11
#endif
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
+#define _LIBCPP_CONSTEXPR_AFTER_CXX14 constexpr
+#else
+#define _LIBCPP_CONSTEXPR_AFTER_CXX14
+#endif
+
+// FIXME: Remove all usages of this macro once compilers catch up.
+#if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606L)
+# define _LIBCPP_HAS_NO_INLINE_VARIABLES
+#endif
+
#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
# define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
#else
@@ -763,7 +963,7 @@ template <unsigned> struct __static_assert_check {};
#endif
#ifndef _LIBCPP_HAS_NO_ASAN
-extern "C" void __sanitizer_annotate_contiguous_container(
+_LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
const void *, const void *, const void *, const void *);
#endif
@@ -774,7 +974,7 @@ extern "C" void __sanitizer_annotate_contiguous_container(
# if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
(__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI)
# define _LIBCPP_NO_RTTI
-# elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI)
+# elif defined(_LIBCPP_COMPILER_MSVC) && !defined(_CPPRTTI)
# define _LIBCPP_NO_RTTI
# endif
#endif
@@ -783,6 +983,37 @@ extern "C" void __sanitizer_annotate_contiguous_container(
# define _LIBCPP_WEAK __attribute__((__weak__))
#endif
+// Thread API
+#if !defined(_LIBCPP_HAS_NO_THREADS) && \
+ !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \
+ !defined(_LIBCPP_HAS_THREAD_API_WIN32) && \
+ !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+# if defined(__FreeBSD__) || \
+ defined(__Fuchsia__) || \
+ defined(__NetBSD__) || \
+ defined(__linux__) || \
+ defined(__APPLE__) || \
+ defined(__CloudABI__) || \
+ defined(__sun__) || \
+ (defined(__MINGW32__) && __libcpp_has_include(<pthread.h>))
+# define _LIBCPP_HAS_THREAD_API_PTHREAD
+# elif defined(_LIBCPP_WIN32API)
+# define _LIBCPP_HAS_THREAD_API_WIN32
+# else
+# error "No thread API"
+# endif // _LIBCPP_HAS_THREAD_API
+#endif // _LIBCPP_HAS_NO_THREADS
+
+#if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+# error _LIBCPP_HAS_THREAD_API_PTHREAD may only be defined when \
+ _LIBCPP_HAS_NO_THREADS is not defined.
+#endif
+
+#if defined(_LIBCPP_HAS_NO_THREADS) && defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+# error _LIBCPP_HAS_THREAD_API_EXTERNAL may not be defined when \
+ _LIBCPP_HAS_NO_THREADS is defined.
+#endif
+
#if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS)
# error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
_LIBCPP_HAS_NO_THREADS is defined.
@@ -803,17 +1034,18 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_HAS_NO_STDOUT
#endif
-#if defined(__ANDROID__) || defined(__CloudABI__) || defined(_LIBCPP_HAS_MUSL_LIBC)
+#if defined(__BIONIC__) || defined(__CloudABI__) || \
+ defined(__Fuchsia__) || defined(_LIBCPP_HAS_MUSL_LIBC)
#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
#endif
-// Thread-unsafe functions such as strtok(), mbtowc() and localtime()
+// Thread-unsafe functions such as strtok() and localtime()
// are not available.
#ifdef __CloudABI__
#define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
#endif
-#if __has_feature(cxx_atomic) || __has_extension(c_atomic)
+#if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
#define _LIBCPP_HAS_C_ATOMIC_IMP
#elif _GNUC_VER > 407
#define _LIBCPP_HAS_GCC_ATOMIC_IMP
@@ -824,6 +1056,149 @@ extern "C" void __sanitizer_annotate_contiguous_container(
#define _LIBCPP_HAS_NO_ATOMIC_HEADER
#endif
+#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+#endif
+
+#if defined(_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS)
+#if defined(__clang__) && __has_attribute(acquire_capability)
+// Work around the attribute handling in clang. When both __declspec and
+// __attribute__ are present, the processing goes awry preventing the definition
+// of the types.
+#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
+#define _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
+#endif
+#endif
+#endif
+
+#if __has_attribute(require_constant_initialization)
+#define _LIBCPP_SAFE_STATIC __attribute__((__require_constant_initialization__))
+#else
+#define _LIBCPP_SAFE_STATIC
+#endif
+
+#if !__has_builtin(__builtin_addressof) && _GNUC_VER < 700
+# define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
+#if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION)
+#define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
+#endif
+#endif
+
+#if __has_attribute(diagnose_if) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS)
+# define _LIBCPP_DIAGNOSE_WARNING(...) \
+ __attribute__((diagnose_if(__VA_ARGS__, "warning")))
+# define _LIBCPP_DIAGNOSE_ERROR(...) \
+ __attribute__((diagnose_if(__VA_ARGS__, "error")))
+#else
+# define _LIBCPP_DIAGNOSE_WARNING(...)
+# define _LIBCPP_DIAGNOSE_ERROR(...)
+#endif
+
+#if __has_attribute(fallthough) || _GNUC_VER >= 700
+// Use a function like macro to imply that it must be followed by a semicolon
+#define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__))
+#else
+#define _LIBCPP_FALLTHROUGH() ((void)0)
+#endif
+
+#if defined(_LIBCPP_ABI_MICROSOFT) && \
+ (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
+# define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
+#else
+# define _LIBCPP_DECLSPEC_EMPTY_BASES
+#endif
+
+#if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES)
+# define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
+# define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
+# define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
+# define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS
+#endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
+
+#if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611
+# define _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+#endif
+
+#if !__has_keyword(__is_aggregate) && (_GNUC_VER_NEW < 7001)
+# define _LIBCPP_HAS_NO_IS_AGGREGATE
+#endif
+
#endif // __cplusplus
+// Decide whether to use availability macros.
+#if !defined(_LIBCPP_BUILDING_LIBRARY) && \
+ !defined(_LIBCPP_DISABLE_AVAILABILITY) && \
+ __has_feature(attribute_availability_with_strict) && \
+ __has_feature(attribute_availability_in_templates)
+#ifdef __APPLE__
+#define _LIBCPP_USE_AVAILABILITY_APPLE
+#endif
+#endif
+
+// Define availability macros.
+#if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
+#define _LIBCPP_AVAILABILITY_SHARED_MUTEX \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
+#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
+#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE \
+ __attribute__((availability(macosx,strict,introduced=10.12))) \
+ __attribute__((availability(ios,strict,introduced=10.0))) \
+ __attribute__((availability(tvos,strict,introduced=10.0))) \
+ __attribute__((availability(watchos,strict,introduced=3.0)))
+#define _LIBCPP_AVAILABILITY_FUTURE_ERROR \
+ __attribute__((availability(ios,strict,introduced=6.0)))
+#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
+#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
+#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR \
+ __attribute__((availability(macosx,strict,introduced=10.9))) \
+ __attribute__((availability(ios,strict,introduced=7.0)))
+#else
+#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
+#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
+#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
+#define _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
+#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
+#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+#endif
+
+// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#define _LIBCPP_AVAILABILITY_DYNARRAY
+#define _LIBCPP_AVAILABILITY_FUTURE
+#else
+#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
+#endif
+
+// Availability of stream API in the dylib got dropped and re-added. The
+// extern template should effectively be available at:
+// availability(macosx,introduced=10.9)
+// availability(ios,introduced=7.0)
+#if defined(_LIBCPP_USE_AVAILABILITY_APPLE) && \
+ ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1090) || \
+ (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ <= 70000))
+#define _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+#endif
+
#endif // _LIBCPP_CONFIG
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__config_site.in b/chromium/buildtools/third_party/libc++/trunk/include/__config_site.in
index ec64485289f..667b4e94ccc 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__config_site.in
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__config_site.in
@@ -19,5 +19,9 @@
#cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK
#cmakedefine _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
#cmakedefine _LIBCPP_HAS_MUSL_LIBC
+#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD
+#cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL
+#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL
+#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
#endif // _LIBCPP_CONFIG_SITE
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__debug b/chromium/buildtools/third_party/libc++/trunk/include/__debug
index a21f9a89884..d01bacdf7ed 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__debug
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__debug
@@ -17,23 +17,103 @@
#pragma GCC system_header
#endif
-#if _LIBCPP_DEBUG_LEVEL >= 1
+#if defined(_LIBCPP_HAS_NO_NULLPTR)
+# include <cstddef>
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 1 || defined(_LIBCPP_BUILDING_LIBRARY)
# include <cstdlib>
# include <cstdio>
# include <cstddef>
-# ifndef _LIBCPP_ASSERT
-# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::fprintf(stderr, "%s\n", m), _VSTD::abort()))
-# endif
+# include <exception>
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 1 && !defined(_LIBCPP_ASSERT)
+# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : \
+ _VSTD::__libcpp_debug_function(_VSTD::__libcpp_debug_info(__FILE__, __LINE__, #x, m)))
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 2
+#ifndef _LIBCPP_DEBUG_ASSERT
+#define _LIBCPP_DEBUG_ASSERT(x, m) _LIBCPP_ASSERT(x, m)
+#endif
+#define _LIBCPP_DEBUG_MODE(...) __VA_ARGS__
#endif
#ifndef _LIBCPP_ASSERT
# define _LIBCPP_ASSERT(x, m) ((void)0)
#endif
+#ifndef _LIBCPP_DEBUG_ASSERT
+# define _LIBCPP_DEBUG_ASSERT(x, m) ((void)0)
+#endif
+#ifndef _LIBCPP_DEBUG_MODE
+#define _LIBCPP_DEBUG_MODE(...) ((void)0)
+#endif
-#if _LIBCPP_DEBUG_LEVEL >= 2
+#if _LIBCPP_DEBUG_LEVEL < 1
+class _LIBCPP_EXCEPTION_ABI __libcpp_debug_exception;
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
+struct _LIBCPP_TEMPLATE_VIS __libcpp_debug_info {
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __libcpp_debug_info()
+ : __file_(nullptr), __line_(-1), __pred_(nullptr), __msg_(nullptr) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ __libcpp_debug_info(const char* __f, int __l, const char* __p, const char* __m)
+ : __file_(__f), __line_(__l), __pred_(__p), __msg_(__m) {}
+ const char* __file_;
+ int __line_;
+ const char* __pred_;
+ const char* __msg_;
+};
+
+/// __libcpp_debug_function_type - The type of the assertion failure handler.
+typedef void(*__libcpp_debug_function_type)(__libcpp_debug_info const&);
+
+/// __libcpp_debug_function - The handler function called when a _LIBCPP_ASSERT
+/// fails.
+extern _LIBCPP_EXTERN_VIS __libcpp_debug_function_type __libcpp_debug_function;
+
+/// __libcpp_abort_debug_function - A debug handler that aborts when called.
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS
+void __libcpp_abort_debug_function(__libcpp_debug_info const&);
+
+/// __libcpp_throw_debug_function - A debug handler that throws
+/// an instance of __libcpp_debug_exception when called.
+ _LIBCPP_NORETURN _LIBCPP_FUNC_VIS
+void __libcpp_throw_debug_function(__libcpp_debug_info const&);
+
+/// __libcpp_set_debug_function - Set the debug handler to the specified
+/// function.
+_LIBCPP_FUNC_VIS
+bool __libcpp_set_debug_function(__libcpp_debug_function_type __func);
+
+// Setup the throwing debug handler during dynamic initialization.
+#if _LIBCPP_DEBUG_LEVEL >= 1 && defined(_LIBCPP_DEBUG_USE_EXCEPTIONS)
+# if defined(_LIBCPP_NO_EXCEPTIONS)
+# error _LIBCPP_DEBUG_USE_EXCEPTIONS cannot be used when exceptions are disabled.
+# endif
+static bool __init_dummy = __libcpp_set_debug_function(__libcpp_throw_debug_function);
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 1 || defined(_LIBCPP_BUILDING_LIBRARY)
+class _LIBCPP_EXCEPTION_ABI __libcpp_debug_exception : public exception {
+public:
+ __libcpp_debug_exception() _NOEXCEPT;
+ explicit __libcpp_debug_exception(__libcpp_debug_info const& __i);
+ __libcpp_debug_exception(__libcpp_debug_exception const&);
+ ~__libcpp_debug_exception() _NOEXCEPT;
+ const char* what() const _NOEXCEPT;
+private:
+ struct __libcpp_debug_exception_imp;
+ __libcpp_debug_exception_imp *__imp_;
+};
+#endif
+
+#if _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY)
+
struct _LIBCPP_TYPE_VIS __c_node;
struct _LIBCPP_TYPE_VIS __i_node
@@ -42,7 +122,7 @@ struct _LIBCPP_TYPE_VIS __i_node
__i_node* __next_;
__c_node* __c_;
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__i_node(const __i_node&) = delete;
__i_node& operator=(const __i_node&) = delete;
#else
@@ -65,7 +145,7 @@ struct _LIBCPP_TYPE_VIS __c_node
__i_node** end_;
__i_node** cap_;
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__c_node(const __c_node&) = delete;
__c_node& operator=(const __c_node&) = delete;
#else
@@ -102,7 +182,7 @@ struct _C_node
};
template <class _Cont>
-bool
+inline bool
_C_node<_Cont>::__dereferenceable(const void* __i) const
{
typedef typename _Cont::const_iterator iterator;
@@ -112,7 +192,7 @@ _C_node<_Cont>::__dereferenceable(const void* __i) const
}
template <class _Cont>
-bool
+inline bool
_C_node<_Cont>::__decrementable(const void* __i) const
{
typedef typename _Cont::const_iterator iterator;
@@ -122,7 +202,7 @@ _C_node<_Cont>::__decrementable(const void* __i) const
}
template <class _Cont>
-bool
+inline bool
_C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
{
typedef typename _Cont::const_iterator iterator;
@@ -132,7 +212,7 @@ _C_node<_Cont>::__addable(const void* __i, ptrdiff_t __n) const
}
template <class _Cont>
-bool
+inline bool
_C_node<_Cont>::__subscriptable(const void* __i, ptrdiff_t __n) const
{
typedef typename _Cont::const_iterator iterator;
@@ -152,7 +232,7 @@ class _LIBCPP_TYPE_VIS __libcpp_db
__libcpp_db();
public:
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__libcpp_db(const __libcpp_db&) = delete;
__libcpp_db& operator=(const __libcpp_db&) = delete;
#else
@@ -214,9 +294,9 @@ _LIBCPP_FUNC_VIS __libcpp_db* __get_db();
_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db();
-_LIBCPP_END_NAMESPACE_STD
+#endif // _LIBCPP_DEBUG_LEVEL >= 2 || defined(_LIBCPP_BUILDING_LIBRARY)
-#endif
+_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_DEBUG_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__functional_03 b/chromium/buildtools/third_party/libc++/trunk/include/__functional_03
index 4edbb0996ca..1db7082eb3d 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__functional_03
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__functional_03
@@ -445,7 +445,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const
} // __function
template<class _Rp>
-class _LIBCPP_TYPE_VIS_ONLY function<_Rp()>
+class _LIBCPP_TEMPLATE_VIS function<_Rp()>
{
typedef __function::__base<_Rp()> __base;
aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -642,6 +642,8 @@ template<class _Rp>
void
function<_Rp()>::swap(function& __f)
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -679,10 +681,8 @@ template<class _Rp>
_Rp
function<_Rp()>::operator()() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)();
}
@@ -720,7 +720,7 @@ function<_Rp()>::target() const
#endif // _LIBCPP_NO_RTTI
template<class _Rp, class _A0>
-class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0)>
+class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)>
: public unary_function<_A0, _Rp>
{
typedef __function::__base<_Rp(_A0)> __base;
@@ -918,6 +918,8 @@ template<class _Rp, class _A0>
void
function<_Rp(_A0)>::swap(function& __f)
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -955,10 +957,8 @@ template<class _Rp, class _A0>
_Rp
function<_Rp(_A0)>::operator()(_A0 __a0) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)(__a0);
}
@@ -996,7 +996,7 @@ function<_Rp(_A0)>::target() const
#endif // _LIBCPP_NO_RTTI
template<class _Rp, class _A0, class _A1>
-class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0, _A1)>
+class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)>
: public binary_function<_A0, _A1, _Rp>
{
typedef __function::__base<_Rp(_A0, _A1)> __base;
@@ -1194,6 +1194,8 @@ template<class _Rp, class _A0, class _A1>
void
function<_Rp(_A0, _A1)>::swap(function& __f)
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -1231,10 +1233,8 @@ template<class _Rp, class _A0, class _A1>
_Rp
function<_Rp(_A0, _A1)>::operator()(_A0 __a0, _A1 __a1) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)(__a0, __a1);
}
@@ -1272,7 +1272,7 @@ function<_Rp(_A0, _A1)>::target() const
#endif // _LIBCPP_NO_RTTI
template<class _Rp, class _A0, class _A1, class _A2>
-class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_A0, _A1, _A2)>
+class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
{
typedef __function::__base<_Rp(_A0, _A1, _A2)> __base;
aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -1470,6 +1470,8 @@ template<class _Rp, class _A0, class _A1, class _A2>
void
function<_Rp(_A0, _A1, _A2)>::swap(function& __f)
{
+ if (_VSTD::addressof(__f) == this)
+ return;
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
@@ -1507,10 +1509,8 @@ template<class _Rp, class _A0, class _A1, class _A2>
_Rp
function<_Rp(_A0, _A1, _A2)>::operator()(_A0 __a0, _A1 __a1, _A2 __a2) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)(__a0, __a1, __a2);
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__functional_base b/chromium/buildtools/third_party/libc++/trunk/include/__functional_base
index 52c535aa3ea..0d2c2fc6501 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__functional_base
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__functional_base
@@ -16,6 +16,7 @@
#include <typeinfo>
#include <exception>
#include <new>
+#include <utility>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -23,23 +24,14 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Arg, class _Result>
-struct _LIBCPP_TYPE_VIS_ONLY unary_function
-{
- typedef _Arg argument_type;
- typedef _Result result_type;
-};
-
template <class _Arg1, class _Arg2, class _Result>
-struct _LIBCPP_TYPE_VIS_ONLY binary_function
+struct _LIBCPP_TEMPLATE_VIS binary_function
{
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash;
-
template <class _Tp>
struct __has_result_type
{
@@ -56,7 +48,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY less : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS less : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
@@ -65,7 +57,7 @@ struct _LIBCPP_TYPE_VIS_ONLY less : binary_function<_Tp, _Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY less<void>
+struct _LIBCPP_TEMPLATE_VIS less<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -259,7 +251,7 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile>
};
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
// 3 or more arguments
template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
@@ -304,83 +296,23 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
typedef _Rp result_type;
};
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-// __invoke
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-// bullets 1 and 2
-
-template <class _Fp, class _A0, class ..._Args,
- class>
-inline _LIBCPP_INLINE_VISIBILITY
-auto
-__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
- -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
-{
- return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
-}
-
-template <class _Fp, class _A0, class ..._Args,
- class>
-inline _LIBCPP_INLINE_VISIBILITY
-auto
-__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
- -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
-{
- return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...);
-}
-
-// bullets 3 and 4
-
-template <class _Fp, class _A0,
- class>
-inline _LIBCPP_INLINE_VISIBILITY
-auto
-__invoke(_Fp&& __f, _A0&& __a0)
- -> decltype(_VSTD::forward<_A0>(__a0).*__f)
-{
- return _VSTD::forward<_A0>(__a0).*__f;
-}
-
-template <class _Fp, class _A0,
- class>
-inline _LIBCPP_INLINE_VISIBILITY
-auto
-__invoke(_Fp&& __f, _A0&& __a0)
- -> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
-{
- return (*_VSTD::forward<_A0>(__a0)).*__f;
-}
-
-// bullet 5
-
-template <class _Fp, class ..._Args>
-inline _LIBCPP_INLINE_VISIBILITY
-auto
-__invoke(_Fp&& __f, _Args&& ...__args)
- -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
-{
- return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...);
-}
template <class _Tp, class ..._Args>
struct __invoke_return
{
typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
};
-#else // _LIBCPP_HAS_NO_VARIADICS
+#else // defined(_LIBCPP_CXX03_LANG)
#include <__functional_base_03>
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // !defined(_LIBCPP_CXX03_LANG)
template <class _Ret>
struct __invoke_void_return_wrapper
{
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class ..._Args>
static _Ret __call(_Args&&... __args) {
return __invoke(_VSTD::forward<_Args>(__args)...);
@@ -411,7 +343,7 @@ struct __invoke_void_return_wrapper
template <>
struct __invoke_void_return_wrapper<void>
{
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class ..._Args>
static void __call(_Args&&... __args) {
__invoke(_VSTD::forward<_Args>(__args)...);
@@ -440,7 +372,7 @@ struct __invoke_void_return_wrapper<void>
};
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY reference_wrapper
+class _LIBCPP_TEMPLATE_VIS reference_wrapper
: public __weak_result_type<_Tp>
{
public:
@@ -453,7 +385,7 @@ public:
// construct/copy/destroy
_LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT
: __f_(_VSTD::addressof(__f)) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
#endif
@@ -461,7 +393,7 @@ public:
_LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;}
_LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
// invoke
template <class... _ArgTypes>
_LIBCPP_INLINE_VISIBILITY
@@ -574,13 +506,9 @@ public:
operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
return __invoke(get(), __a0, __a1, __a2);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
};
-template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
-template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
-template <class _Tp> struct __is_reference_wrapper
- : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -614,23 +542,10 @@ cref(reference_wrapper<_Tp> __t) _NOEXCEPT
return cref(__t.get());
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp> void ref(const _Tp&&) = delete;
template <class _Tp> void cref(const _Tp&&) = delete;
-
-#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-
-template <class _Tp> void ref(const _Tp&&);// = delete;
-template <class _Tp> void cref(const _Tp&&);// = delete;
-
-#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif
#if _LIBCPP_STD_VER > 11
template <class _Tp1, class _Tp2 = void>
@@ -647,9 +562,9 @@ public:
// allocator_arg_t
-struct _LIBCPP_TYPE_VIS_ONLY allocator_arg_t { };
+struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { };
-#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MEMORY)
extern const allocator_arg_t allocator_arg;
#else
constexpr allocator_arg_t allocator_arg = allocator_arg_t();
@@ -682,19 +597,25 @@ struct __uses_allocator<_Tp, _Alloc, false>
};
template <class _Tp, class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY uses_allocator
+struct _LIBCPP_TEMPLATE_VIS uses_allocator
: public __uses_allocator<_Tp, _Alloc>
{
};
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#if _LIBCPP_STD_VER > 14
+template <class _Tp, class _Alloc>
+constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
+#endif
+
+#ifndef _LIBCPP_CXX03_LANG
// allocator construction
template <class _Tp, class _Alloc, class ..._Args>
struct __uses_alloc_ctor_imp
{
- static const bool __ua = uses_allocator<_Tp, _Alloc>::value;
+ typedef typename __uncvref<_Alloc>::type _RawAlloc;
+ static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value;
static const bool __ic =
is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
static const int value = __ua ? 2 - __ic : 0;
@@ -712,6 +633,7 @@ void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, con
new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
}
+// FIXME: This should have a version which takes a non-const alloc.
template <class _Tp, class _Allocator, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
@@ -719,6 +641,7 @@ void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, con
new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
}
+// FIXME: This should have a version which takes a non-const alloc.
template <class _Tp, class _Allocator, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
@@ -726,6 +649,7 @@ void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, con
new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
}
+// FIXME: Theis should have a version which takes a non-const alloc.
template <class _Tp, class _Allocator, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&... __args)
@@ -735,7 +659,7 @@ void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&...
__storage, __a, _VSTD::forward<_Args>(__args)...
);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__hash_table b/chromium/buildtools/third_party/libc++/trunk/include/__hash_table
index cfa763ab217..acdc443a640 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__hash_table
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__hash_table
@@ -17,9 +17,10 @@
#include <iterator>
#include <algorithm>
#include <cmath>
+#include <utility>
+#include <type_traits>
#include <__undef_min_max>
-#include <__undef___deallocate>
#include <__debug>
@@ -29,15 +30,76 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Key, class _Tp>
+union __hash_value_type;
+#else
+template <class _Key, class _Tp>
+struct __hash_value_type;
+#endif
+
+template <class _Key, class _Cp, class _Hash,
+ bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value>
+class __unordered_map_hasher;
+
+template <class _Key, class _Cp, class _Pred,
+ bool = is_empty<_Pred>::value && !__libcpp_is_final<_Pred>::value
+ >
+class __unordered_map_equal;
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp>
+struct __is_hash_value_type_imp : false_type {};
+
+template <class _Key, class _Value>
+struct __is_hash_value_type_imp<__hash_value_type<_Key, _Value>> : true_type {};
+
+template <class ..._Args>
+struct __is_hash_value_type : false_type {};
+
+template <class _One>
+struct __is_hash_value_type<_One> : __is_hash_value_type_imp<typename __uncvref<_One>::type> {};
+#endif
+
_LIBCPP_FUNC_VIS
size_t __next_prime(size_t __n);
template <class _NodePtr>
struct __hash_node_base
{
+ typedef typename pointer_traits<_NodePtr>::element_type __node_type;
typedef __hash_node_base __first_node;
+ typedef typename __rebind_pointer<_NodePtr, __first_node>::type __node_base_pointer;
+ typedef _NodePtr __node_pointer;
- _NodePtr __next_;
+#if defined(_LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB)
+ typedef __node_base_pointer __next_pointer;
+#else
+ typedef typename conditional<
+ is_pointer<__node_pointer>::value,
+ __node_base_pointer,
+ __node_pointer>::type __next_pointer;
+#endif
+
+ __next_pointer __next_;
+
+ _LIBCPP_INLINE_VISIBILITY
+ __next_pointer __ptr() _NOEXCEPT {
+ return static_cast<__next_pointer>(
+ pointer_traits<__node_base_pointer>::pointer_to(*this));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __node_pointer __upcast() _NOEXCEPT {
+ return static_cast<__node_pointer>(
+ pointer_traits<__node_base_pointer>::pointer_to(*this));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ size_t __hash() const _NOEXCEPT {
+ return static_cast<__node_type const&>(*this).__hash_;
+ }
_LIBCPP_INLINE_VISIBILITY __hash_node_base() _NOEXCEPT : __next_(nullptr) {}
};
@@ -46,18 +108,13 @@ template <class _Tp, class _VoidPtr>
struct __hash_node
: public __hash_node_base
<
- typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__hash_node<_Tp, _VoidPtr> >
-#else
- rebind<__hash_node<_Tp, _VoidPtr> >::other
-#endif
+ typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type
>
{
- typedef _Tp value_type;
+ typedef _Tp __node_value_type;
- size_t __hash_;
- value_type __value_;
+ size_t __hash_;
+ __node_value_type __value_;
};
inline _LIBCPP_INLINE_VISIBILITY
@@ -71,7 +128,8 @@ inline _LIBCPP_INLINE_VISIBILITY
size_t
__constrain_hash(size_t __h, size_t __bc)
{
- return !(__bc & (__bc - 1)) ? __h & (__bc - 1) : __h % __bc;
+ return !(__bc & (__bc - 1)) ? __h & (__bc - 1) :
+ (__h < __bc ? __h : __h % __bc);
}
inline _LIBCPP_INLINE_VISIBILITY
@@ -81,43 +139,181 @@ __next_hash_pow2(size_t __n)
return size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1));
}
+
template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
-template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
-template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
-template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
+template <class _NodePtr> class _LIBCPP_TEMPLATE_VIS __hash_iterator;
+template <class _ConstNodePtr> class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
+template <class _NodePtr> class _LIBCPP_TEMPLATE_VIS __hash_local_iterator;
+template <class _ConstNodePtr> class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
+template <class _HashIterator> class _LIBCPP_TEMPLATE_VIS __hash_map_iterator;
+template <class _HashIterator> class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
+
+template <class _Tp>
+struct __hash_key_value_types {
+ static_assert(!is_reference<_Tp>::value && !is_const<_Tp>::value, "");
+ typedef _Tp key_type;
+ typedef _Tp __node_value_type;
+ typedef _Tp __container_value_type;
+ static const bool __is_map = false;
+
+ _LIBCPP_INLINE_VISIBILITY
+ static key_type const& __get_key(_Tp const& __v) {
+ return __v;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type const& __get_value(__node_value_type const& __v) {
+ return __v;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type* __get_ptr(__node_value_type& __n) {
+ return _VSTD::addressof(__n);
+ }
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type&& __move(__node_value_type& __v) {
+ return _VSTD::move(__v);
+ }
+#endif
+};
+
+template <class _Key, class _Tp>
+struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef __hash_value_type<_Key, _Tp> __node_value_type;
+ typedef pair<const _Key, _Tp> __container_value_type;
+ typedef pair<_Key, _Tp> __nc_value_type;
+ typedef __container_value_type __map_value_type;
+ static const bool __is_map = true;
+
+ _LIBCPP_INLINE_VISIBILITY
+ static key_type const& __get_key(__container_value_type const& __v) {
+ return __v.first;
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static typename enable_if<__is_same_uncvref<_Up, __node_value_type>::value,
+ __container_value_type const&>::type
+ __get_value(_Up& __t) {
+ return __t.__cc;
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static typename enable_if<__is_same_uncvref<_Up, __container_value_type>::value,
+ __container_value_type const&>::type
+ __get_value(_Up& __t) {
+ return __t;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type* __get_ptr(__node_value_type& __n) {
+ return _VSTD::addressof(__n.__cc);
+ }
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ static __nc_value_type&& __move(__node_value_type& __v) {
+ return _VSTD::move(__v.__nc);
+ }
+#endif
+
+};
+
+template <class _Tp, class _AllocPtr, class _KVTypes = __hash_key_value_types<_Tp>,
+ bool = _KVTypes::__is_map>
+struct __hash_map_pointer_types {};
+
+template <class _Tp, class _AllocPtr, class _KVTypes>
+struct __hash_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
+ typedef typename _KVTypes::__map_value_type _Mv;
+ typedef typename __rebind_pointer<_AllocPtr, _Mv>::type
+ __map_value_type_pointer;
+ typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type
+ __const_map_value_type_pointer;
+};
+
+template <class _NodePtr, class _NodeT = typename pointer_traits<_NodePtr>::element_type>
+struct __hash_node_types;
+
+template <class _NodePtr, class _Tp, class _VoidPtr>
+struct __hash_node_types<_NodePtr, __hash_node<_Tp, _VoidPtr> >
+ : public __hash_key_value_types<_Tp>, __hash_map_pointer_types<_Tp, _VoidPtr>
+
+{
+ typedef __hash_key_value_types<_Tp> __base;
+
+public:
+ typedef ptrdiff_t difference_type;
+ typedef size_t size_type;
+
+ typedef typename __rebind_pointer<_NodePtr, void>::type __void_pointer;
+
+ typedef typename pointer_traits<_NodePtr>::element_type __node_type;
+ typedef _NodePtr __node_pointer;
+
+ typedef __hash_node_base<__node_pointer> __node_base_type;
+ typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type
+ __node_base_pointer;
+
+ typedef typename __node_base_type::__next_pointer __next_pointer;
+
+ typedef _Tp __node_value_type;
+ typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type
+ __node_value_type_pointer;
+ typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
+ __const_node_value_type_pointer;
+
+private:
+ static_assert(!is_const<__node_type>::value,
+ "_NodePtr should never be a pointer to const");
+ static_assert((is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value),
+ "_VoidPtr does not point to unqualified void type");
+ static_assert((is_same<typename __rebind_pointer<_VoidPtr, __node_type>::type,
+ _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");
+};
+
+template <class _HashIterator>
+struct __hash_node_types_from_iterator;
+template <class _NodePtr>
+struct __hash_node_types_from_iterator<__hash_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
template <class _NodePtr>
-class _LIBCPP_TYPE_VIS_ONLY __hash_iterator
+struct __hash_node_types_from_iterator<__hash_const_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
+template <class _NodePtr>
+struct __hash_node_types_from_iterator<__hash_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
+template <class _NodePtr>
+struct __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
+
+
+template <class _NodeValueTp, class _VoidPtr>
+struct __make_hash_node_types {
+ typedef __hash_node<_NodeValueTp, _VoidPtr> _NodeTp;
+ typedef typename __rebind_pointer<_VoidPtr, _NodeTp>::type _NodePtr;
+ typedef __hash_node_types<_NodePtr> type;
+};
+
+template <class _NodePtr>
+class _LIBCPP_TEMPLATE_VIS __hash_iterator
{
- typedef _NodePtr __node_pointer;
+ typedef __hash_node_types<_NodePtr> _NodeTypes;
+ typedef _NodePtr __node_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
- __node_pointer __node_;
+ __next_pointer __node_;
public:
- typedef forward_iterator_tag iterator_category;
- typedef typename pointer_traits<__node_pointer>::element_type::value_type value_type;
- typedef typename pointer_traits<__node_pointer>::difference_type difference_type;
- typedef value_type& reference;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef forward_iterator_tag iterator_category;
+ typedef typename _NodeTypes::__node_value_type value_type;
+ typedef typename _NodeTypes::difference_type difference_type;
+ typedef value_type& reference;
+ typedef typename _NodeTypes::__node_value_type_pointer pointer;
- _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
- : __node_(nullptr)
-#endif
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
+ _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT : __node_(nullptr) {
+ _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
}
#if _LIBCPP_DEBUG_LEVEL >= 2
-
_LIBCPP_INLINE_VISIBILITY
__hash_iterator(const __hash_iterator& __i)
: __node_(__i.__node_)
@@ -141,35 +337,26 @@ public:
}
return *this;
}
-
#endif // _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container iterator");
-#endif
- return __node_->__value_;
- }
+ reference operator*() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to dereference a non-dereferenceable unordered container iterator");
+ return __node_->__upcast()->__value_;
+ }
+
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ pointer operator->() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container iterator");
-#endif
- return pointer_traits<pointer>::pointer_to(__node_->__value_);
- }
+ return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
- __hash_iterator& operator++()
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ __hash_iterator& operator++() {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable unordered container iterator");
-#endif
__node_ = __node_->__next_;
return *this;
}
@@ -194,77 +381,56 @@ public:
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- __hash_iterator(__node_pointer __node, const void* __c) _NOEXCEPT
+ __hash_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
: __node_(__node)
{
__get_db()->__insert_ic(this, __c);
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_iterator(__node_pointer __node) _NOEXCEPT
+ __hash_iterator(__next_pointer __node) _NOEXCEPT
: __node_(__node)
{}
#endif
-
template <class, class, class, class> friend class __hash_table;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
};
-template <class _ConstNodePtr>
-class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator
+template <class _NodePtr>
+class _LIBCPP_TEMPLATE_VIS __hash_const_iterator
{
- typedef _ConstNodePtr __node_pointer;
-
- __node_pointer __node_;
+ static_assert(!is_const<typename pointer_traits<_NodePtr>::element_type>::value, "");
+ typedef __hash_node_types<_NodePtr> _NodeTypes;
+ typedef _NodePtr __node_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
- typedef typename remove_const<
- typename pointer_traits<__node_pointer>::element_type
- >::type __node;
+ __next_pointer __node_;
public:
- typedef forward_iterator_tag iterator_category;
- typedef typename __node::value_type value_type;
- typedef typename pointer_traits<__node_pointer>::difference_type difference_type;
- typedef const value_type& reference;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
- pointer;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__node>
-#else
- rebind<__node>::other
-#endif
- __non_const_node_pointer;
- typedef __hash_iterator<__non_const_node_pointer> __non_const_iterator;
+ typedef __hash_iterator<_NodePtr> __non_const_iterator;
- _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT
-#if _LIBCPP_STD_VER > 11
- : __node_(nullptr)
-#endif
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
+ typedef forward_iterator_tag iterator_category;
+ typedef typename _NodeTypes::__node_value_type value_type;
+ typedef typename _NodeTypes::difference_type difference_type;
+ typedef const value_type& reference;
+ typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
+
+
+ _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT : __node_(nullptr) {
+ _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
}
+
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
: __node_(__x.__node_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__iterator_copy(this, &__x);
-#endif
+ _LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));
}
#if _LIBCPP_DEBUG_LEVEL >= 2
-
_LIBCPP_INLINE_VISIBILITY
__hash_const_iterator(const __hash_const_iterator& __i)
: __node_(__i.__node_)
@@ -288,35 +454,25 @@ public:
}
return *this;
}
-
#endif // _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ reference operator*() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container const_iterator");
-#endif
- return __node_->__value_;
- }
+ return __node_->__upcast()->__value_;
+ }
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ pointer operator->() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container const_iterator");
-#endif
- return pointer_traits<pointer>::pointer_to(__node_->__value_);
- }
+ return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
- __hash_const_iterator& operator++()
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to increment non-incrementable unordered container const_iterator");
-#endif
+ __hash_const_iterator& operator++() {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to increment non-incrementable unordered container const_iterator");
__node_ = __node_->__next_;
return *this;
}
@@ -341,58 +497,46 @@ public:
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- __hash_const_iterator(__node_pointer __node, const void* __c) _NOEXCEPT
+ __hash_const_iterator(__next_pointer __node, const void* __c) _NOEXCEPT
: __node_(__node)
{
__get_db()->__insert_ic(this, __c);
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_const_iterator(__node_pointer __node) _NOEXCEPT
+ __hash_const_iterator(__next_pointer __node) _NOEXCEPT
: __node_(__node)
{}
#endif
-
template <class, class, class, class> friend class __hash_table;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
};
-template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
-
template <class _NodePtr>
-class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator
+class _LIBCPP_TEMPLATE_VIS __hash_local_iterator
{
- typedef _NodePtr __node_pointer;
+ typedef __hash_node_types<_NodePtr> _NodeTypes;
+ typedef _NodePtr __node_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
- __node_pointer __node_;
+ __next_pointer __node_;
size_t __bucket_;
size_t __bucket_count_;
- typedef pointer_traits<__node_pointer> __pointer_traits;
public:
typedef forward_iterator_tag iterator_category;
- typedef typename __pointer_traits::element_type::value_type value_type;
- typedef typename __pointer_traits::difference_type difference_type;
+ typedef typename _NodeTypes::__node_value_type value_type;
+ typedef typename _NodeTypes::difference_type difference_type;
typedef value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef typename _NodeTypes::__node_value_type_pointer pointer;
- _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
+ _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT : __node_(nullptr) {
+ _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
}
#if _LIBCPP_DEBUG_LEVEL >= 2
-
_LIBCPP_INLINE_VISIBILITY
__hash_local_iterator(const __hash_local_iterator& __i)
: __node_(__i.__node_),
@@ -420,37 +564,28 @@ public:
}
return *this;
}
-
#endif // _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ reference operator*() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container local_iterator");
-#endif
- return __node_->__value_;
- }
+ return __node_->__upcast()->__value_;
+ }
+
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
- "Attempted to dereference a non-dereferenceable unordered container local_iterator");
-#endif
- return pointer_traits<pointer>::pointer_to(__node_->__value_);
- }
+ pointer operator->() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to dereference a non-dereferenceable unordered container local_iterator");
+ return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
- __hash_local_iterator& operator++()
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ __hash_local_iterator& operator++() {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable unordered container local_iterator");
-#endif
__node_ = __node_->__next_;
- if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_)
+ if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
return *this;
}
@@ -475,7 +610,7 @@ public:
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- __hash_local_iterator(__node_pointer __node, size_t __bucket,
+ __hash_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count, const void* __c) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
@@ -487,7 +622,7 @@ private:
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_local_iterator(__node_pointer __node, size_t __bucket,
+ __hash_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
@@ -498,51 +633,39 @@ private:
}
#endif
template <class, class, class, class> friend class __hash_table;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_iterator;
};
template <class _ConstNodePtr>
-class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator
+class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator
{
- typedef _ConstNodePtr __node_pointer;
+ typedef __hash_node_types<_ConstNodePtr> _NodeTypes;
+ typedef _ConstNodePtr __node_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
- __node_pointer __node_;
+ __next_pointer __node_;
size_t __bucket_;
size_t __bucket_count_;
typedef pointer_traits<__node_pointer> __pointer_traits;
typedef typename __pointer_traits::element_type __node;
typedef typename remove_const<__node>::type __non_const_node;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__non_const_node>
-#else
- rebind<__non_const_node>::other
-#endif
- __non_const_node_pointer;
+ typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type
+ __non_const_node_pointer;
+public:
typedef __hash_local_iterator<__non_const_node_pointer>
__non_const_iterator;
-public:
- typedef forward_iterator_tag iterator_category;
- typedef typename remove_const<
- typename __pointer_traits::element_type::value_type
- >::type value_type;
- typedef typename __pointer_traits::difference_type difference_type;
- typedef const value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
- pointer;
- _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__insert_i(this);
-#endif
+ typedef forward_iterator_tag iterator_category;
+ typedef typename _NodeTypes::__node_value_type value_type;
+ typedef typename _NodeTypes::difference_type difference_type;
+ typedef const value_type& reference;
+ typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
+
+
+ _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT : __node_(nullptr) {
+ _LIBCPP_DEBUG_MODE(__get_db()->__insert_i(this));
}
_LIBCPP_INLINE_VISIBILITY
@@ -551,13 +674,10 @@ public:
__bucket_(__x.__bucket_),
__bucket_count_(__x.__bucket_count_)
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __get_db()->__iterator_copy(this, &__x);
-#endif
+ _LIBCPP_DEBUG_MODE(__get_db()->__iterator_copy(this, &__x));
}
#if _LIBCPP_DEBUG_LEVEL >= 2
-
_LIBCPP_INLINE_VISIBILITY
__hash_const_local_iterator(const __hash_const_local_iterator& __i)
: __node_(__i.__node_),
@@ -585,37 +705,28 @@ public:
}
return *this;
}
-
#endif // _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ reference operator*() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
-#endif
- return __node_->__value_;
- }
+ return __node_->__upcast()->__value_;
+ }
+
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ pointer operator->() const {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
-#endif
- return pointer_traits<pointer>::pointer_to(__node_->__value_);
- }
+ return pointer_traits<pointer>::pointer_to(__node_->__upcast()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator& operator++()
- {
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ __hash_const_local_iterator& operator++() {
+ _LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable unordered container const_local_iterator");
-#endif
__node_ = __node_->__next_;
- if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_)
+ if (__node_ != nullptr && __constrain_hash(__node_->__hash(), __bucket_count_) != __bucket_)
__node_ = nullptr;
return *this;
}
@@ -640,7 +751,7 @@ public:
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator(__node_pointer __node, size_t __bucket,
+ __hash_const_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count, const void* __c) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
@@ -652,7 +763,7 @@ private:
}
#else
_LIBCPP_INLINE_VISIBILITY
- __hash_const_local_iterator(__node_pointer __node, size_t __bucket,
+ __hash_const_local_iterator(__next_pointer __node, size_t __bucket,
size_t __bucket_count) _NOEXCEPT
: __node_(__node),
__bucket_(__bucket),
@@ -663,7 +774,7 @@ private:
}
#endif
template <class, class, class, class> friend class __hash_table;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
};
template <class _Alloc>
@@ -687,8 +798,7 @@ public:
_NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
: __data_(__size, __a) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__bucket_list_deallocator(__bucket_list_deallocator&& __x)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
@@ -696,8 +806,7 @@ public:
{
__x.size() = 0;
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
_LIBCPP_INLINE_VISIBILITY
size_type& size() _NOEXCEPT {return __data_.first();}
@@ -723,10 +832,11 @@ class __hash_node_destructor
{
typedef _Alloc allocator_type;
typedef allocator_traits<allocator_type> __alloc_traits;
- typedef typename __alloc_traits::value_type::value_type value_type;
+
public:
typedef typename __alloc_traits::pointer pointer;
private:
+ typedef __hash_node_types<pointer> _NodeTypes;
allocator_type& __na_;
@@ -746,7 +856,7 @@ public:
void operator()(pointer __p) _NOEXCEPT
{
if (__value_constructed)
- __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
+ __alloc_traits::destroy(__na_, _NodeTypes::__get_ptr(__p->__value_));
if (__p)
__alloc_traits::deallocate(__na_, __p, 1);
}
@@ -754,6 +864,37 @@ public:
template <class> friend class __hash_map_node_destructor;
};
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Key, class _Hash, class _Equal, class _Alloc>
+struct __diagnose_hash_table_helper {
+ static constexpr bool __trigger_diagnostics()
+ _LIBCPP_DIAGNOSE_WARNING(__check_hash_requirements<_Key, _Hash>::value
+ && !__invokable<_Hash const&, _Key const&>::value,
+ "the specified hash functor does not provide a const call operator")
+ _LIBCPP_DIAGNOSE_WARNING(is_copy_constructible<_Equal>::value
+ && !__invokable<_Equal const&, _Key const&, _Key const&>::value,
+ "the specified comparator type does not provide a const call operator")
+ {
+ static_assert(__check_hash_requirements<_Key, _Hash>::value,
+ "the specified hash does not meet the Hash requirements");
+ static_assert(is_copy_constructible<_Equal>::value,
+ "the specified comparator is required to be copy constructible");
+ return true;
+ }
+};
+
+template <class _Key, class _Value, class _Hash, class _Equal, class _Alloc>
+struct __diagnose_hash_table_helper<
+ __hash_value_type<_Key, _Value>,
+ __unordered_map_hasher<_Key, __hash_value_type<_Key, _Value>, _Hash>,
+ __unordered_map_equal<_Key, __hash_value_type<_Key, _Value>, _Equal>,
+ _Alloc>
+: __diagnose_hash_table_helper<_Key, _Hash, _Equal, _Alloc>
+{
+};
+#endif // _LIBCPP_CXX03_LANG
+
template <class _Tp, class _Hash, class _Equal, class _Alloc>
class __hash_table
{
@@ -765,42 +906,66 @@ public:
private:
typedef allocator_traits<allocator_type> __alloc_traits;
+ typedef typename
+ __make_hash_node_types<value_type, typename __alloc_traits::void_pointer>::type
+ _NodeTypes;
public:
+
+ typedef typename _NodeTypes::__node_value_type __node_value_type;
+ typedef typename _NodeTypes::__container_value_type __container_value_type;
+ typedef typename _NodeTypes::key_type key_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
+#ifndef _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
typedef typename __alloc_traits::size_type size_type;
- typedef typename __alloc_traits::difference_type difference_type;
+#else
+ typedef typename _NodeTypes::size_type size_type;
+#endif
+ typedef typename _NodeTypes::difference_type difference_type;
public:
// Create __node
- typedef __hash_node<value_type, typename __alloc_traits::void_pointer> __node;
+
+ typedef typename _NodeTypes::__node_type __node;
typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator;
typedef allocator_traits<__node_allocator> __node_traits;
- typedef typename __node_traits::pointer __node_pointer;
- typedef typename __node_traits::pointer __node_const_pointer;
- typedef __hash_node_base<__node_pointer> __first_node;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__first_node>
-#else
- rebind<__first_node>::other
-#endif
- __node_base_pointer;
+ typedef typename _NodeTypes::__void_pointer __void_pointer;
+ typedef typename _NodeTypes::__node_pointer __node_pointer;
+ typedef typename _NodeTypes::__node_pointer __node_const_pointer;
+ typedef typename _NodeTypes::__node_base_type __first_node;
+ typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;
+ typedef typename _NodeTypes::__next_pointer __next_pointer;
private:
+ // check for sane allocator pointer rebinding semantics. Rebinding the
+ // allocator for a new pointer type should be exactly the same as rebinding
+ // the pointer using 'pointer_traits'.
+ static_assert((is_same<__node_pointer, typename __node_traits::pointer>::value),
+ "Allocator does not rebind pointers in a sane manner.");
+ typedef typename __rebind_alloc_helper<__node_traits, __first_node>::type
+ __node_base_allocator;
+ typedef allocator_traits<__node_base_allocator> __node_base_traits;
+ static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value),
+ "Allocator does not rebind pointers in a sane manner.");
- typedef typename __rebind_alloc_helper<__node_traits, __node_pointer>::type __pointer_allocator;
+private:
+
+ typedef typename __rebind_alloc_helper<__node_traits, __next_pointer>::type __pointer_allocator;
typedef __bucket_list_deallocator<__pointer_allocator> __bucket_list_deleter;
- typedef unique_ptr<__node_pointer[], __bucket_list_deleter> __bucket_list;
+ typedef unique_ptr<__next_pointer[], __bucket_list_deleter> __bucket_list;
typedef allocator_traits<__pointer_allocator> __pointer_alloc_traits;
- typedef typename __bucket_list_deleter::pointer __node_pointer_pointer;
+ typedef typename __bucket_list_deleter::pointer __node_pointer_pointer;
+
+#ifndef _LIBCPP_CXX03_LANG
+ static_assert(__diagnose_hash_table_helper<_Tp, _Hash, _Equal, _Alloc>::__trigger_diagnostics(), "");
+#endif
// --- Member data begin ---
- __bucket_list __bucket_list_;
- __compressed_pair<__first_node, __node_allocator> __p1_;
- __compressed_pair<size_type, hasher> __p2_;
- __compressed_pair<float, key_equal> __p3_;
+ __bucket_list __bucket_list_;
+ __compressed_pair<__first_node, __node_allocator> __p1_;
+ __compressed_pair<size_type, hasher> __p2_;
+ __compressed_pair<float, key_equal> __p3_;
// --- Member data end ---
_LIBCPP_INLINE_VISIBILITY
@@ -851,7 +1016,7 @@ public:
explicit __hash_table(const allocator_type& __a);
__hash_table(const __hash_table& __u);
__hash_table(const __hash_table& __u, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
__hash_table(__hash_table&& __u)
_NOEXCEPT_(
is_nothrow_move_constructible<__bucket_list>::value &&
@@ -860,11 +1025,11 @@ public:
is_nothrow_move_constructible<hasher>::value &&
is_nothrow_move_constructible<key_equal>::value);
__hash_table(__hash_table&& __u, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
~__hash_table();
__hash_table& operator=(const __hash_table& __u);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__hash_table& operator=(__hash_table&& __u)
_NOEXCEPT_(
@@ -881,8 +1046,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
{
- return allocator_traits<__pointer_allocator>::max_size(
- __bucket_list_.get_deleter().__alloc());
+ return std::min<size_type>(
+ __node_traits::max_size(__node_alloc()),
+ numeric_limits<difference_type >::max()
+ );
}
pair<iterator, bool> __node_insert_unique(__node_pointer __nd);
@@ -890,41 +1057,104 @@ public:
iterator __node_insert_multi(const_iterator __p,
__node_pointer __nd);
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- template <class... _Args>
- pair<iterator, bool> __emplace_unique(_Args&&... __args);
- template <class... _Args>
- iterator __emplace_multi(_Args&&... __args);
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _Key, class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __emplace_unique_key_args(_Key const& __k, _Args&&... __args);
+
template <class... _Args>
- iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __emplace_unique_impl(_Args&&... __args);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _ValueTp>
+ template <class _Pp>
_LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __insert_unique_value(_ValueTp&& __x);
-#else
+ pair<iterator, bool> __emplace_unique(_Pp&& __x) {
+ return __emplace_unique_extract_key(_VSTD::forward<_Pp>(__x),
+ __can_extract_key<_Pp, key_type>());
+ }
+
+ template <class _First, class _Second>
_LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __insert_unique_value(const value_type& __x);
-#endif
+ typename enable_if<
+ __can_extract_map_key<_First, key_type, __container_value_type>::value,
+ pair<iterator, bool>
+ >::type __emplace_unique(_First&& __f, _Second&& __s) {
+ return __emplace_unique_key_args(__f, _VSTD::forward<_First>(__f),
+ _VSTD::forward<_Second>(__s));
+ }
- pair<iterator, bool> __insert_unique(const value_type& __x);
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __emplace_unique(_Args&&... __args) {
+ return __emplace_unique_impl(_VSTD::forward<_Args>(__args)...);
+ }
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- pair<iterator, bool> __insert_unique(value_type&& __x);
template <class _Pp>
- pair<iterator, bool> __insert_unique(_Pp&& __x);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) {
+ return __emplace_unique_impl(_VSTD::forward<_Pp>(__x));
+ }
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) {
+ return __emplace_unique_key_args(__x, _VSTD::forward<_Pp>(__x));
+ }
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) {
+ return __emplace_unique_key_args(__x.first, _VSTD::forward<_Pp>(__x));
+ }
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __emplace_multi(_Args&&... __args);
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
+
+
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ __insert_unique(__container_value_type&& __x) {
+ return __emplace_unique_key_args(_NodeTypes::__get_key(__x), _VSTD::move(__x));
+ }
+
+ template <class _Pp, class = typename enable_if<
+ !__is_same_uncvref<_Pp, __container_value_type>::value
+ >::type>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __insert_unique(_Pp&& __x) {
+ return __emplace_unique(_VSTD::forward<_Pp>(__x));
+ }
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Pp>
- iterator __insert_multi(_Pp&& __x);
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_multi(_Pp&& __x) {
+ return __emplace_multi(_VSTD::forward<_Pp>(__x));
+ }
+
template <class _Pp>
- iterator __insert_multi(const_iterator __p, _Pp&& __x);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- iterator __insert_multi(const value_type& __x);
- iterator __insert_multi(const_iterator __p, const value_type& __x);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_multi(const_iterator __p, _Pp&& __x) {
+ return __emplace_hint_multi(__p, _VSTD::forward<_Pp>(__x));
+ }
+
+#else // !defined(_LIBCPP_CXX03_LANG)
+ template <class _Key, class _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args& __args);
+
+ iterator __insert_multi(const __container_value_type& __x);
+ iterator __insert_multi(const_iterator __p, const __container_value_type& __x);
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __insert_unique(const __container_value_type& __x) {
+ return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
+ }
void clear() _NOEXCEPT;
void rehash(size_type __n);
@@ -993,7 +1223,7 @@ public:
void swap(__hash_table& __u)
#if _LIBCPP_STD_VER <= 11
- _NOEXCEPT_(
+ _NOEXCEPT_DEBUG_(
__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
&& (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value
|| __is_nothrow_swappable<__pointer_allocator>::value)
@@ -1001,12 +1231,12 @@ public:
|| __is_nothrow_swappable<__node_allocator>::value)
);
#else
- _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value);
+ _NOEXCEPT_DEBUG_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value);
#endif
_LIBCPP_INLINE_VISIBILITY
size_type max_bucket_count() const _NOEXCEPT
- {return __pointer_alloc_traits::max_size(__bucket_list_.get_deleter().__alloc());}
+ {return max_size(); }
size_type bucket_size(size_type __n) const;
_LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
{
@@ -1084,16 +1314,17 @@ public:
private:
void __rehash(size_type __n);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class ..._Args>
- __node_holder __construct_node(_Args&& ...__args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
- __node_holder __construct_node(value_type&& __v, size_t __hash);
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- __node_holder __construct_node(const value_type& __v);
+ __node_holder __construct_node(_Args&& ...__args);
+
+ template <class _First, class ..._Rest>
+ __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);
+#else // _LIBCPP_CXX03_LANG
+ __node_holder __construct_node(const __container_value_type& __v);
+ __node_holder __construct_node_hash(size_t __hash, const __container_value_type& __v);
#endif
- __node_holder __construct_node(const value_type& __v, size_t __hash);
+
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __hash_table& __u)
@@ -1103,6 +1334,7 @@ private:
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __hash_table&, false_type) {}
+#ifndef _LIBCPP_CXX03_LANG
void __move_assign(__hash_table& __u, false_type);
void __move_assign(__hash_table& __u, true_type)
_NOEXCEPT_(
@@ -1129,12 +1361,13 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
+#endif // _LIBCPP_CXX03_LANG
- void __deallocate(__node_pointer __np) _NOEXCEPT;
- __node_pointer __detach() _NOEXCEPT;
+ void __deallocate_node(__next_pointer __np) _NOEXCEPT;
+ __next_pointer __detach() _NOEXCEPT;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
};
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1167,7 +1400,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const hasher& __hf,
const key_equal& __eql,
const allocator_type& __a)
: __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
- __p1_(__node_allocator(__a)),
+ __p1_(__second_tag(), __node_allocator(__a)),
__p2_(0, __hf),
__p3_(1.0f, __eql)
{
@@ -1176,7 +1409,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const hasher& __hf,
template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const allocator_type& __a)
: __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
- __p1_(__node_allocator(__a)),
+ __p1_(__second_tag(), __node_allocator(__a)),
__p2_(0),
__p3_(1.0f)
{
@@ -1188,7 +1421,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u)
__bucket_list_deleter(allocator_traits<__pointer_allocator>::
select_on_container_copy_construction(
__u.__bucket_list_.get_deleter().__alloc()), 0)),
- __p1_(allocator_traits<__node_allocator>::
+ __p1_(__second_tag(), allocator_traits<__node_allocator>::
select_on_container_copy_construction(__u.__node_alloc())),
__p2_(0, __u.hash_function()),
__p3_(__u.__p3_)
@@ -1199,13 +1432,13 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u,
const allocator_type& __a)
: __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
- __p1_(__node_allocator(__a)),
+ __p1_(__second_tag(), __node_allocator(__a)),
__p2_(0, __u.hash_function()),
__p3_(__u.__p3_)
{
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
@@ -1222,8 +1455,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
{
if (size() > 0)
{
- __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
+ __p1_.first().__ptr();
__u.__p1_.first().__next_ = nullptr;
__u.size() = 0;
}
@@ -1233,7 +1466,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
const allocator_type& __a)
: __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
- __p1_(__node_allocator(__a)),
+ __p1_(__second_tag(), __node_allocator(__a)),
__p2_(0, _VSTD::move(__u.hash_function())),
__p3_(_VSTD::move(__u.__p3_))
{
@@ -1246,20 +1479,27 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
{
__p1_.first().__next_ = __u.__p1_.first().__next_;
__u.__p1_.first().__next_ = nullptr;
- __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
+ __p1_.first().__ptr();
size() = __u.size();
__u.size() = 0;
}
}
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
{
- __deallocate(__p1_.first().__next_);
+#if defined(_LIBCPP_CXX03_LANG)
+ static_assert((is_copy_constructible<key_equal>::value),
+ "Predicate must be copy-constructible.");
+ static_assert((is_copy_constructible<hasher>::value),
+ "Hasher must be copy-constructible.");
+#endif
+
+ __deallocate_node(__p1_.first().__next_);
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__erase_c(this);
#endif
@@ -1297,13 +1537,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(const __hash_table& __u)
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate_node(__next_pointer __np)
_NOEXCEPT
{
__node_allocator& __na = __node_alloc();
while (__np != nullptr)
{
- __node_pointer __next = __np->__next_;
+ __next_pointer __next = __np->__next_;
#if _LIBCPP_DEBUG_LEVEL >= 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
for (__i_node** __p = __c->end_; __p != __c->beg_; )
@@ -1319,26 +1559,27 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np)
}
__get_db()->unlock();
#endif
- __node_traits::destroy(__na, _VSTD::addressof(__np->__value_));
- __node_traits::deallocate(__na, __np, 1);
+ __node_pointer __real_np = __np->__upcast();
+ __node_traits::destroy(__na, _NodeTypes::__get_ptr(__real_np->__value_));
+ __node_traits::deallocate(__na, __real_np, 1);
__np = __next;
}
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_pointer
+typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__next_pointer
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT
{
size_type __bc = bucket_count();
for (size_type __i = 0; __i < __bc; ++__i)
__bucket_list_[__i] = nullptr;
size() = 0;
- __node_pointer __cache = __p1_.first().__next_;
+ __next_pointer __cache = __p1_.first().__next_;
__p1_.first().__next_ = nullptr;
return __cache;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
@@ -1361,8 +1602,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
__p1_.first().__next_ = __u.__p1_.first().__next_;
if (size() > 0)
{
- __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
+ __p1_.first().__ptr();
__u.__p1_.first().__next_ = nullptr;
__u.size() = 0;
}
@@ -1385,7 +1626,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
max_load_factor() = __u.max_load_factor();
if (bucket_count() != 0)
{
- __node_pointer __cache = __detach();
+ __next_pointer __cache = __detach();
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
@@ -1393,26 +1634,26 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
const_iterator __i = __u.begin();
while (__cache != nullptr && __u.size() != 0)
{
- __cache->__value_ = _VSTD::move(__u.remove(__i++)->__value_);
- __node_pointer __next = __cache->__next_;
- __node_insert_multi(__cache);
+ __cache->__upcast()->__value_ =
+ _VSTD::move(__u.remove(__i++)->__value_);
+ __next_pointer __next = __cache->__next_;
+ __node_insert_multi(__cache->__upcast());
__cache = __next;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
- __deallocate(__cache);
+ __deallocate_node(__cache);
throw;
}
#endif // _LIBCPP_NO_EXCEPTIONS
- __deallocate(__cache);
+ __deallocate_node(__cache);
}
const_iterator __i = __u.begin();
while (__u.size() != 0)
{
- __node_holder __h =
- __construct_node(_VSTD::move(__u.remove(__i++)->__value_));
+ __node_holder __h = __construct_node(_NodeTypes::__move(__u.remove(__i++)->__value_));
__node_insert_multi(__h.get());
__h.release();
}
@@ -1434,7 +1675,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _InputIterator>
@@ -1442,29 +1683,34 @@ void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first,
_InputIterator __last)
{
+ typedef iterator_traits<_InputIterator> _ITraits;
+ typedef typename _ITraits::value_type _ItValueType;
+ static_assert((is_same<_ItValueType, __container_value_type>::value),
+ "__assign_unique may only be called with the containers value type");
+
if (bucket_count() != 0)
{
- __node_pointer __cache = __detach();
+ __next_pointer __cache = __detach();
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
- __cache->__value_ = *__first;
- __node_pointer __next = __cache->__next_;
- __node_insert_unique(__cache);
+ __cache->__upcast()->__value_ = *__first;
+ __next_pointer __next = __cache->__next_;
+ __node_insert_unique(__cache->__upcast());
__cache = __next;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
- __deallocate(__cache);
+ __deallocate_node(__cache);
throw;
}
#endif // _LIBCPP_NO_EXCEPTIONS
- __deallocate(__cache);
+ __deallocate_node(__cache);
}
for (; __first != __last; ++__first)
__insert_unique(*__first);
@@ -1476,32 +1722,38 @@ void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
_InputIterator __last)
{
+ typedef iterator_traits<_InputIterator> _ITraits;
+ typedef typename _ITraits::value_type _ItValueType;
+ static_assert((is_same<_ItValueType, __container_value_type>::value ||
+ is_same<_ItValueType, __node_value_type>::value),
+ "__assign_multi may only be called with the containers value type"
+ " or the nodes value type");
if (bucket_count() != 0)
{
- __node_pointer __cache = __detach();
+ __next_pointer __cache = __detach();
#ifndef _LIBCPP_NO_EXCEPTIONS
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
for (; __cache != nullptr && __first != __last; ++__first)
{
- __cache->__value_ = *__first;
- __node_pointer __next = __cache->__next_;
- __node_insert_multi(__cache);
+ __cache->__upcast()->__value_ = *__first;
+ __next_pointer __next = __cache->__next_;
+ __node_insert_multi(__cache->__upcast());
__cache = __next;
}
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
- __deallocate(__cache);
+ __deallocate_node(__cache);
throw;
}
#endif // _LIBCPP_NO_EXCEPTIONS
- __deallocate(__cache);
+ __deallocate_node(__cache);
}
for (; __first != __last; ++__first)
- __insert_multi(*__first);
+ __insert_multi(_NodeTypes::__get_value(*__first));
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -1558,7 +1810,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::clear() _NOEXCEPT
{
if (size() > 0)
{
- __deallocate(__p1_.first().__next_);
+ __deallocate_node(__p1_.first().__next_);
__p1_.first().__next_ = nullptr;
size_type __bc = bucket_count();
for (size_type __i = 0; __i < __bc; ++__i)
@@ -1574,7 +1826,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
__nd->__hash_ = hash_function()(__nd->__value_);
size_type __bc = bucket_count();
bool __inserted = false;
- __node_pointer __ndptr;
+ __next_pointer __ndptr;
size_t __chash;
if (__bc != 0)
{
@@ -1583,10 +1835,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
if (__ndptr != nullptr)
{
for (__ndptr = __ndptr->__next_; __ndptr != nullptr &&
- __constrain_hash(__ndptr->__hash_, __bc) == __chash;
+ __constrain_hash(__ndptr->__hash(), __bc) == __chash;
__ndptr = __ndptr->__next_)
{
- if (key_eq()(__ndptr->__value_, __nd->__value_))
+ if (key_eq()(__ndptr->__upcast()->__value_, __nd->__value_))
goto __done;
}
}
@@ -1600,23 +1852,23 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
__chash = __constrain_hash(__nd->__hash_, __bc);
}
// insert_after __bucket_list_[__chash], or __first_node if bucket is null
- __node_pointer __pn = __bucket_list_[__chash];
+ __next_pointer __pn = __bucket_list_[__chash];
if (__pn == nullptr)
{
- __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __pn =__p1_.first().__ptr();
__nd->__next_ = __pn->__next_;
- __pn->__next_ = __nd;
+ __pn->__next_ = __nd->__ptr();
// fix up __bucket_list_
__bucket_list_[__chash] = __pn;
if (__nd->__next_ != nullptr)
- __bucket_list_[__constrain_hash(__nd->__next_->__hash_, __bc)] = __nd;
+ __bucket_list_[__constrain_hash(__nd->__next_->__hash(), __bc)] = __nd->__ptr();
}
else
{
__nd->__next_ = __pn->__next_;
- __pn->__next_ = __nd;
+ __pn->__next_ = __nd->__ptr();
}
- __ndptr = __nd;
+ __ndptr = __nd->__ptr();
// increment size
++size();
__inserted = true;
@@ -1642,21 +1894,22 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
__bc = bucket_count();
}
size_t __chash = __constrain_hash(__cp->__hash_, __bc);
- __node_pointer __pn = __bucket_list_[__chash];
+ __next_pointer __pn = __bucket_list_[__chash];
if (__pn == nullptr)
{
- __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __pn =__p1_.first().__ptr();
__cp->__next_ = __pn->__next_;
- __pn->__next_ = __cp;
+ __pn->__next_ = __cp->__ptr();
// fix up __bucket_list_
__bucket_list_[__chash] = __pn;
if (__cp->__next_ != nullptr)
- __bucket_list_[__constrain_hash(__cp->__next_->__hash_, __bc)] = __cp;
+ __bucket_list_[__constrain_hash(__cp->__next_->__hash(), __bc)]
+ = __cp->__ptr();
}
else
{
for (bool __found = false; __pn->__next_ != nullptr &&
- __constrain_hash(__pn->__next_->__hash_, __bc) == __chash;
+ __constrain_hash(__pn->__next_->__hash(), __bc) == __chash;
__pn = __pn->__next_)
{
// __found key_eq() action
@@ -1664,8 +1917,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
// true true loop
// false true set __found to true
// true false break
- if (__found != (__pn->__next_->__hash_ == __cp->__hash_ &&
- key_eq()(__pn->__next_->__value_, __cp->__value_)))
+ if (__found != (__pn->__next_->__hash() == __cp->__hash_ &&
+ key_eq()(__pn->__next_->__upcast()->__value_, __cp->__value_)))
{
if (!__found)
__found = true;
@@ -1674,19 +1927,19 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
}
}
__cp->__next_ = __pn->__next_;
- __pn->__next_ = __cp;
+ __pn->__next_ = __cp->__ptr();
if (__cp->__next_ != nullptr)
{
- size_t __nhash = __constrain_hash(__cp->__next_->__hash_, __bc);
+ size_t __nhash = __constrain_hash(__cp->__next_->__hash(), __bc);
if (__nhash != __chash)
- __bucket_list_[__nhash] = __cp;
+ __bucket_list_[__nhash] = __cp->__ptr();
}
}
++size();
#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(__cp, this);
+ return iterator(__cp->__ptr(), this);
#else
- return iterator(__cp);
+ return iterator(__cp->__ptr());
#endif
}
@@ -1702,8 +1955,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
#endif
if (__p != end() && key_eq()(*__p, __cp->__value_))
{
- __node_pointer __np = __p.__node_;
- __cp->__hash_ = __np->__hash_;
+ __next_pointer __np = __p.__node_;
+ __cp->__hash_ = __np->__hash();
size_type __bc = bucket_count();
if (size()+1 > __bc * max_load_factor() || __bc == 0)
{
@@ -1712,49 +1965,40 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
__bc = bucket_count();
}
size_t __chash = __constrain_hash(__cp->__hash_, __bc);
- __node_pointer __pp = __bucket_list_[__chash];
+ __next_pointer __pp = __bucket_list_[__chash];
while (__pp->__next_ != __np)
__pp = __pp->__next_;
__cp->__next_ = __np;
- __pp->__next_ = __cp;
+ __pp->__next_ = static_cast<__next_pointer>(__cp);
++size();
#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(__cp, this);
+ return iterator(static_cast<__next_pointer>(__cp), this);
#else
- return iterator(__cp);
+ return iterator(static_cast<__next_pointer>(__cp));
#endif
}
return __node_insert_multi(__cp);
}
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x)
-{
- return __insert_unique_value(__x);
-}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _ValueTp>
-_LIBCPP_INLINE_VISIBILITY
+template <class _Key, class ..._Args>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(_ValueTp&& __x)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)
#else
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-_LIBCPP_INLINE_VISIBILITY
+template <class _Key, class _Args>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(const value_type& __x)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args& __args)
#endif
{
-#if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
- typedef const value_type& _ValueTp;
-#endif
- size_t __hash = hash_function()(__x);
+
+ size_t __hash = hash_function()(__k);
size_type __bc = bucket_count();
bool __inserted = false;
- __node_pointer __nd;
+ __next_pointer __nd;
size_t __chash;
if (__bc != 0)
{
@@ -1763,16 +2007,20 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(const value_type
if (__nd != nullptr)
{
for (__nd = __nd->__next_; __nd != nullptr &&
- __constrain_hash(__nd->__hash_, __bc) == __chash;
+ (__nd->__hash() == __hash || __constrain_hash(__nd->__hash(), __bc) == __chash);
__nd = __nd->__next_)
{
- if (key_eq()(__nd->__value_, __x))
+ if (key_eq()(__nd->__upcast()->__value_, __k))
goto __done;
}
}
}
{
- __node_holder __h = __construct_node(_VSTD::forward<_ValueTp>(__x), __hash);
+#ifndef _LIBCPP_CXX03_LANG
+ __node_holder __h = __construct_node_hash(__hash, _VSTD::forward<_Args>(__args)...);
+#else
+ __node_holder __h = __construct_node_hash(__hash, __args);
+#endif
if (size()+1 > __bc * max_load_factor() || __bc == 0)
{
rehash(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
@@ -1781,23 +2029,24 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(const value_type
__chash = __constrain_hash(__hash, __bc);
}
// insert_after __bucket_list_[__chash], or __first_node if bucket is null
- __node_pointer __pn = __bucket_list_[__chash];
+ __next_pointer __pn = __bucket_list_[__chash];
if (__pn == nullptr)
{
- __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __pn = __p1_.first().__ptr();
__h->__next_ = __pn->__next_;
- __pn->__next_ = __h.get();
+ __pn->__next_ = __h.get()->__ptr();
// fix up __bucket_list_
__bucket_list_[__chash] = __pn;
if (__h->__next_ != nullptr)
- __bucket_list_[__constrain_hash(__h->__next_->__hash_, __bc)] = __h.get();
+ __bucket_list_[__constrain_hash(__h->__next_->__hash(), __bc)]
+ = __h.get()->__ptr();
}
else
{
__h->__next_ = __pn->__next_;
- __pn->__next_ = __h.get();
+ __pn->__next_ = static_cast<__next_pointer>(__h.get());
}
- __nd = __h.release();
+ __nd = static_cast<__next_pointer>(__h.release());
// increment size
++size();
__inserted = true;
@@ -1810,13 +2059,12 @@ __done:
#endif
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class... _Args>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique(_Args&&... __args)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_impl(_Args&&... __args)
{
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
pair<iterator, bool> __r = __node_insert_unique(__h.get());
@@ -1853,64 +2101,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
return __r;
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#else // _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(value_type&& __x)
-{
- return __insert_unique_value(_VSTD::move(__x));
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _Pp>
-pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_Pp&& __x)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x));
- pair<iterator, bool> __r = __node_insert_unique(__h.get());
- if (__r.second)
- __h.release();
- return __r;
-}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _Pp>
-typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(_Pp&& __x)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x));
- iterator __r = __node_insert_multi(__h.get());
- __h.release();
- return __r;
-}
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _Pp>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
- _Pp&& __x)
-{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "unordered container::insert(const_iterator, rvalue) called with an iterator not"
- " referring to this unordered container");
-#endif
- __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x));
- iterator __r = __node_insert_multi(__p, __h.get());
- __h.release();
- return __r;
-}
-
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Tp, class _Hash, class _Equal, class _Alloc>
-typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const value_type& __x)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const __container_value_type& __x)
{
__node_holder __h = __construct_node(__x);
iterator __r = __node_insert_multi(__h.get());
@@ -1921,7 +2116,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const value_type& __x)
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
- const value_type& __x)
+ const __container_value_type& __x)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
@@ -1934,7 +2129,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
return __r;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
@@ -1975,17 +2170,17 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
{
for (size_type __i = 0; __i < __nbc; ++__i)
__bucket_list_[__i] = nullptr;
- __node_pointer __pp(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
- __node_pointer __cp = __pp->__next_;
+ __next_pointer __pp = __p1_.first().__ptr();
+ __next_pointer __cp = __pp->__next_;
if (__cp != nullptr)
{
- size_type __chash = __constrain_hash(__cp->__hash_, __nbc);
+ size_type __chash = __constrain_hash(__cp->__hash(), __nbc);
__bucket_list_[__chash] = __pp;
size_type __phash = __chash;
for (__pp = __cp, __cp = __cp->__next_; __cp != nullptr;
__cp = __pp->__next_)
{
- __chash = __constrain_hash(__cp->__hash_, __nbc);
+ __chash = __constrain_hash(__cp->__hash(), __nbc);
if (__chash == __phash)
__pp = __cp;
else
@@ -1998,9 +2193,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
}
else
{
- __node_pointer __np = __cp;
+ __next_pointer __np = __cp;
for (; __np->__next_ != nullptr &&
- key_eq()(__cp->__value_, __np->__next_->__value_);
+ key_eq()(__cp->__upcast()->__value_,
+ __np->__next_->__upcast()->__value_);
__np = __np->__next_)
;
__pp->__next_ = __np->__next_;
@@ -2024,14 +2220,16 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k)
if (__bc != 0)
{
size_t __chash = __constrain_hash(__hash, __bc);
- __node_pointer __nd = __bucket_list_[__chash];
+ __next_pointer __nd = __bucket_list_[__chash];
if (__nd != nullptr)
{
for (__nd = __nd->__next_; __nd != nullptr &&
- __constrain_hash(__nd->__hash_, __bc) == __chash;
+ (__nd->__hash() == __hash
+ || __constrain_hash(__nd->__hash(), __bc) == __chash);
__nd = __nd->__next_)
{
- if (key_eq()(__nd->__value_, __k))
+ if ((__nd->__hash() == __hash)
+ && key_eq()(__nd->__upcast()->__value_, __k))
#if _LIBCPP_DEBUG_LEVEL >= 2
return iterator(__nd, this);
#else
@@ -2053,14 +2251,16 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
if (__bc != 0)
{
size_t __chash = __constrain_hash(__hash, __bc);
- __node_const_pointer __nd = __bucket_list_[__chash];
+ __next_pointer __nd = __bucket_list_[__chash];
if (__nd != nullptr)
{
for (__nd = __nd->__next_; __nd != nullptr &&
- __constrain_hash(__nd->__hash_, __bc) == __chash;
+ (__hash == __nd->__hash()
+ || __constrain_hash(__nd->__hash(), __bc) == __chash);
__nd = __nd->__next_)
{
- if (key_eq()(__nd->__value_, __k))
+ if ((__nd->__hash() == __hash)
+ && key_eq()(__nd->__upcast()->__value_, __k))
#if _LIBCPP_DEBUG_LEVEL >= 2
return const_iterator(__nd, this);
#else
@@ -2073,75 +2273,79 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
return end();
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class ..._Args>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args)
{
+ static_assert(!__is_hash_value_type<_Args...>::value,
+ "Construct cannot be called with a hash value type");
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
+ __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _VSTD::forward<_Args>(__args)...);
__h.get_deleter().__value_constructed = true;
__h->__hash_ = hash_function()(__h->__value_);
__h->__next_ = nullptr;
return __h;
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
+template <class _First, class ..._Rest>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v,
- size_t __hash)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(
+ size_t __hash, _First&& __f, _Rest&& ...__rest)
{
+ static_assert(!__is_hash_value_type<_First, _Rest...>::value,
+ "Construct cannot be called with a hash value type");
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
+ __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_),
+ _VSTD::forward<_First>(__f),
+ _VSTD::forward<_Rest>(__rest)...);
__h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash;
__h->__next_ = nullptr;
return __h;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const __container_value_type& __v)
{
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
+ __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
__h.get_deleter().__value_constructed = true;
__h->__hash_ = hash_function()(__h->__value_);
__h->__next_ = nullptr;
return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v,
- size_t __hash)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash,
+ const __container_value_type& __v)
{
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
+ __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
__h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash;
__h->__next_ = nullptr;
return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
+#endif // _LIBCPP_CXX03_LANG
+
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
{
- __node_pointer __np = __p.__node_;
+ __next_pointer __np = __p.__node_;
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered container erase(iterator) called with an iterator not"
@@ -2175,7 +2379,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __first,
++__first;
erase(__p);
}
- __node_pointer __np = __last.__node_;
+ __next_pointer __np = __last.__node_;
#if _LIBCPP_DEBUG_LEVEL >= 2
return iterator (__np, this);
#else
@@ -2219,26 +2423,27 @@ typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
{
// current node
- __node_pointer __cn = __p.__node_;
+ __next_pointer __cn = __p.__node_;
size_type __bc = bucket_count();
- size_t __chash = __constrain_hash(__cn->__hash_, __bc);
+ size_t __chash = __constrain_hash(__cn->__hash(), __bc);
// find previous node
- __node_pointer __pn = __bucket_list_[__chash];
+ __next_pointer __pn = __bucket_list_[__chash];
for (; __pn->__next_ != __cn; __pn = __pn->__next_)
;
// Fix up __bucket_list_
// if __pn is not in same bucket (before begin is not in same bucket) &&
// if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
- if (__pn == static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()))
- || __constrain_hash(__pn->__hash_, __bc) != __chash)
+ if (__pn == __p1_.first().__ptr()
+ || __constrain_hash(__pn->__hash(), __bc) != __chash)
{
- if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash)
+ if (__cn->__next_ == nullptr
+ || __constrain_hash(__cn->__next_->__hash(), __bc) != __chash)
__bucket_list_[__chash] = nullptr;
}
// if __cn->__next_ is not in same bucket (nullptr is in same bucket)
if (__cn->__next_ != nullptr)
{
- size_t __nhash = __constrain_hash(__cn->__next_->__hash_, __bc);
+ size_t __nhash = __constrain_hash(__cn->__next_->__hash(), __bc);
if (__nhash != __chash)
__bucket_list_[__nhash] = __pn;
}
@@ -2248,20 +2453,20 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
--size();
#if _LIBCPP_DEBUG_LEVEL >= 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
+ for (__i_node** __dp = __c->end_; __dp != __c->beg_; )
{
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
+ --__dp;
+ iterator* __i = static_cast<iterator*>((*__dp)->__i_);
if (__i->__node_ == __cn)
{
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ (*__dp)->__c_ = nullptr;
+ if (--__c->end_ != __dp)
+ memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*));
}
}
__get_db()->unlock();
#endif
- return __node_holder(__cn, _Dp(__node_alloc(), true));
+ return __node_holder(__cn->__upcast(), _Dp(__node_alloc(), true));
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
@@ -2364,7 +2569,7 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
#if _LIBCPP_STD_VER <= 11
- _NOEXCEPT_(
+ _NOEXCEPT_DEBUG_(
__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value
&& (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value
|| __is_nothrow_swappable<__pointer_allocator>::value)
@@ -2372,9 +2577,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
|| __is_nothrow_swappable<__node_allocator>::value)
)
#else
- _NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value)
+ _NOEXCEPT_DEBUG_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value)
#endif
{
+ _LIBCPP_ASSERT(__node_traits::propagate_on_container_swap::value ||
+ this->__node_alloc() == __u.__node_alloc(),
+ "list::swap: Either propagate_on_container_swap must be true"
+ " or the allocators must compare equal");
{
__node_pointer_pointer __npp = __bucket_list_.release();
__bucket_list_.reset(__u.__bucket_list_.release());
@@ -2388,11 +2597,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
__p2_.swap(__u.__p2_);
__p3_.swap(__u.__p3_);
if (size() > 0)
- __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash(), bucket_count())] =
+ __p1_.first().__ptr();
if (__u.size() > 0)
- __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash_, __u.bucket_count())] =
- static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__u.__p1_.first()));
+ __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash(), __u.bucket_count())] =
+ __u.__p1_.first().__ptr();
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->swap(this, &__u);
#endif
@@ -2404,13 +2613,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::bucket_size(size_type __n) const
{
_LIBCPP_ASSERT(__n < bucket_count(),
"unordered container::bucket_size(n) called with n >= bucket_count()");
- __node_const_pointer __np = __bucket_list_[__n];
+ __next_pointer __np = __bucket_list_[__n];
size_type __bc = bucket_count();
size_type __r = 0;
if (__np != nullptr)
{
for (__np = __np->__next_; __np != nullptr &&
- __constrain_hash(__np->__hash_, __bc) == __n;
+ __constrain_hash(__np->__hash(), __bc) == __n;
__np = __np->__next_, ++__r)
;
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__libcpp_version b/chromium/buildtools/third_party/libc++/trunk/include/__libcpp_version
new file mode 100644
index 00000000000..e9c02dad182
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__libcpp_version
@@ -0,0 +1 @@
+5000
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__locale b/chromium/buildtools/third_party/libc++/trunk/include/__locale
index 7bc701dda6e..cf3ba23b909 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__locale
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__locale
@@ -37,9 +37,11 @@
#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
# include <xlocale.h>
+#elif defined(__Fuchsia__)
+# include <support/fuchsia/xlocale.h>
#elif defined(_LIBCPP_HAS_MUSL_LIBC)
# include <support/musl/xlocale.h>
-#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -47,6 +49,25 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+#if !defined(_LIBCPP_LOCALE__L_EXTENSIONS) || defined(_LIBCPP_MSVCRT)
+struct __libcpp_locale_guard {
+ _LIBCPP_INLINE_VISIBILITY
+ __libcpp_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~__libcpp_locale_guard() {
+ if (__old_loc_)
+ uselocale(__old_loc_);
+ }
+
+ locale_t __old_loc_;
+private:
+ __libcpp_locale_guard(__libcpp_locale_guard const&);
+ __libcpp_locale_guard& operator=(__libcpp_locale_guard const&);
+};
+#endif
+
+
class _LIBCPP_TYPE_VIS locale;
template <class _Facet>
@@ -67,6 +88,7 @@ public:
class _LIBCPP_TYPE_VIS id;
typedef int category;
+ _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
static const category // values assigned here are for exposition only
none = 0,
collate = LC_COLLATE_MASK,
@@ -92,13 +114,16 @@ public:
const locale& operator=(const locale&) _NOEXCEPT;
- template <class _Facet> locale combine(const locale&) const;
+ template <class _Facet>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ locale combine(const locale&) const;
// locale operations:
string name() const;
bool operator==(const locale&) const;
bool operator!=(const locale& __y) const {return !(*this == __y);}
template <class _CharT, class _Traits, class _Allocator>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
bool operator()(const basic_string<_CharT, _Traits, _Allocator>&,
const basic_string<_CharT, _Traits, _Allocator>&) const;
@@ -165,10 +190,9 @@ template <class _Facet>
locale
locale::combine(const locale& __other) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!_VSTD::has_facet<_Facet>(__other))
- throw runtime_error("locale::combine: locale missing facet");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_runtime_error("locale::combine: locale missing facet");
+
return locale(*this, &const_cast<_Facet&>(_VSTD::use_facet<_Facet>(__other)));
}
@@ -191,7 +215,7 @@ use_facet(const locale& __l)
// template <class _CharT> class collate;
template <class _CharT>
-class _LIBCPP_TYPE_VIS_ONLY collate
+class _LIBCPP_TEMPLATE_VIS collate
: public locale::facet
{
public:
@@ -270,12 +294,12 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
return static_cast<long>(__h);
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS collate<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS collate<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate<wchar_t>)
// template <class CharT> class collate_byname;
-template <class _CharT> class _LIBCPP_TYPE_VIS_ONLY collate_byname;
+template <class _CharT> class _LIBCPP_TEMPLATE_VIS collate_byname;
template <>
class _LIBCPP_TYPE_VIS collate_byname<char>
@@ -343,7 +367,7 @@ public:
static const mask punct = _ISpunct;
static const mask xdigit = _ISxdigit;
static const mask blank = _ISblank;
-#elif defined(_WIN32)
+#elif defined(_LIBCPP_MSVCRT)
typedef unsigned short mask;
static const mask space = _SPACE;
static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT;
@@ -426,7 +450,7 @@ public:
_LIBCPP_ALWAYS_INLINE ctype_base() {}
};
-template <class _CharT> class _LIBCPP_TYPE_VIS_ONLY ctype;
+template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype;
template <>
class _LIBCPP_TYPE_VIS ctype<wchar_t>
@@ -653,7 +677,7 @@ protected:
// template <class CharT> class ctype_byname;
-template <class _CharT> class _LIBCPP_TYPE_VIS_ONLY ctype_byname;
+template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype_byname;
template <>
class _LIBCPP_TYPE_VIS ctype_byname<char>
@@ -814,7 +838,7 @@ public:
// template <class internT, class externT, class stateT> class codecvt;
-template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_TYPE_VIS_ONLY codecvt;
+template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_TEMPLATE_VIS codecvt;
// template <> class codecvt<char, char, mbstate_t>
@@ -1160,7 +1184,7 @@ protected:
// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname
template <class _InternT, class _ExternT, class _StateT>
-class _LIBCPP_TYPE_VIS_ONLY codecvt_byname
+class _LIBCPP_TEMPLATE_VIS codecvt_byname
: public codecvt<_InternT, _ExternT, _StateT>
{
public:
@@ -1179,12 +1203,12 @@ codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname()
{
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>)
-_LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
template <size_t _Np>
struct __narrow_to_utf8
@@ -1368,7 +1392,7 @@ struct __widen_from_utf8<32>
// template <class charT> class numpunct
-template <class _CharT> class _LIBCPP_TYPE_VIS_ONLY numpunct;
+template <class _CharT> class _LIBCPP_TEMPLATE_VIS numpunct;
template <>
class _LIBCPP_TYPE_VIS numpunct<char>
@@ -1434,7 +1458,7 @@ protected:
// template <class charT> class numpunct_byname
-template <class _CharT> class _LIBCPP_TYPE_VIS_ONLY numpunct_byname;
+template <class _CharT> class _LIBCPP_TEMPLATE_VIS numpunct_byname;
template <>
class _LIBCPP_TYPE_VIS numpunct_byname<char>
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__mutex_base b/chromium/buildtools/third_party/libc++/trunk/include/__mutex_base
index b019b4760d1..7f5e2ea2810 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__mutex_base
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__mutex_base
@@ -14,9 +14,8 @@
#include <__config>
#include <chrono>
#include <system_error>
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include <pthread.h>
-#endif
+#include <__threading_support>
+#include <__undef_min_max>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -26,29 +25,41 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_THREADS
-class _LIBCPP_TYPE_VIS mutex
+#ifndef _LIBCPP_THREAD_SAFETY_ANNOTATION
+# ifdef _LIBCPP_HAS_THREAD_SAFETY_ANNOTATIONS
+# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x) __attribute__((x))
+# else
+# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
+# endif
+#endif // _LIBCPP_THREAD_SAFETY_ANNOTATION
+
+class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
{
- pthread_mutex_t __m_;
+#ifndef _LIBCPP_CXX03_LANG
+ __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
+#else
+ __libcpp_mutex_t __m_;
+#endif
public:
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_CONSTEXPR
- constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
+#ifndef _LIBCPP_CXX03_LANG
+ constexpr mutex() _NOEXCEPT = default;
#else
- mutex() _NOEXCEPT {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;}
+ mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;}
#endif
- ~mutex();
+ ~mutex();
private:
mutex(const mutex&);// = delete;
mutex& operator=(const mutex&);// = delete;
public:
- void lock();
- bool try_lock() _NOEXCEPT;
- void unlock() _NOEXCEPT;
+ void lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability());
+ bool try_lock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(try_acquire_capability(true));
+ void unlock() _NOEXCEPT _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability());
- typedef pthread_mutex_t* native_handle_type;
+ typedef __libcpp_mutex_t* native_handle_type;
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
};
@@ -56,7 +67,7 @@ struct _LIBCPP_TYPE_VIS defer_lock_t {};
struct _LIBCPP_TYPE_VIS try_to_lock_t {};
struct _LIBCPP_TYPE_VIS adopt_lock_t {};
-#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX)
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MUTEX)
extern const defer_lock_t defer_lock;
extern const try_to_lock_t try_to_lock;
@@ -71,7 +82,8 @@ constexpr adopt_lock_t adopt_lock = adopt_lock_t();
#endif
template <class _Mutex>
-class _LIBCPP_TYPE_VIS_ONLY lock_guard
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable)
+lock_guard
{
public:
typedef _Mutex mutex_type;
@@ -81,21 +93,21 @@ private:
public:
_LIBCPP_INLINE_VISIBILITY
- explicit lock_guard(mutex_type& __m)
+ explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
: __m_(__m) {__m_.lock();}
_LIBCPP_INLINE_VISIBILITY
- lock_guard(mutex_type& __m, adopt_lock_t)
+ lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
: __m_(__m) {}
_LIBCPP_INLINE_VISIBILITY
- ~lock_guard() {__m_.unlock();}
+ ~lock_guard() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
private:
- lock_guard(lock_guard const&);// = delete;
- lock_guard& operator=(lock_guard const&);// = delete;
+ lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE;
+ lock_guard& operator=(lock_guard const&) _LIBCPP_EQUAL_DELETE;
};
template <class _Mutex>
-class _LIBCPP_TYPE_VIS_ONLY unique_lock
+class _LIBCPP_TEMPLATE_VIS unique_lock
{
public:
typedef _Mutex mutex_type;
@@ -109,24 +121,24 @@ public:
unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
_LIBCPP_INLINE_VISIBILITY
explicit unique_lock(mutex_type& __m)
- : __m_(&__m), __owns_(true) {__m_->lock();}
+ : __m_(_VSTD::addressof(__m)), __owns_(true) {__m_->lock();}
_LIBCPP_INLINE_VISIBILITY
unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
- : __m_(&__m), __owns_(false) {}
+ : __m_(_VSTD::addressof(__m)), __owns_(false) {}
_LIBCPP_INLINE_VISIBILITY
unique_lock(mutex_type& __m, try_to_lock_t)
- : __m_(&__m), __owns_(__m.try_lock()) {}
+ : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock()) {}
_LIBCPP_INLINE_VISIBILITY
unique_lock(mutex_type& __m, adopt_lock_t)
- : __m_(&__m), __owns_(true) {}
+ : __m_(_VSTD::addressof(__m)), __owns_(true) {}
template <class _Clock, class _Duration>
_LIBCPP_INLINE_VISIBILITY
unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
- : __m_(&__m), __owns_(__m.try_lock_until(__t)) {}
+ : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_until(__t)) {}
template <class _Rep, class _Period>
_LIBCPP_INLINE_VISIBILITY
unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
- : __m_(&__m), __owns_(__m.try_lock_for(__d)) {}
+ : __m_(_VSTD::addressof(__m)), __owns_(__m.try_lock_for(__d)) {}
_LIBCPP_INLINE_VISIBILITY
~unique_lock()
{
@@ -139,7 +151,7 @@ private:
unique_lock& operator=(unique_lock const&); // = delete;
public:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
unique_lock(unique_lock&& __u) _NOEXCEPT
: __m_(__u.__m_), __owns_(__u.__owns_)
@@ -156,7 +168,7 @@ public:
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
void lock();
bool try_lock();
@@ -268,13 +280,18 @@ _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)
class _LIBCPP_TYPE_VIS condition_variable
{
- pthread_cond_t __cv_;
+#ifndef _LIBCPP_CXX03_LANG
+ __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
+#else
+ __libcpp_condvar_t __cv_;
+#endif
+
public:
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_CONSTEXPR
- constexpr condition_variable() : __cv_(PTHREAD_COND_INITIALIZER) {}
+#ifndef _LIBCPP_CXX03_LANG
+ constexpr condition_variable() _NOEXCEPT = default;
#else
- condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
+ condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;}
#endif
~condition_variable();
@@ -288,20 +305,24 @@ public:
void wait(unique_lock<mutex>& __lk) _NOEXCEPT;
template <class _Predicate>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
void wait(unique_lock<mutex>& __lk, _Predicate __pred);
template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
cv_status
wait_until(unique_lock<mutex>& __lk,
const chrono::time_point<_Clock, _Duration>& __t);
template <class _Clock, class _Duration, class _Predicate>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
bool
wait_until(unique_lock<mutex>& __lk,
const chrono::time_point<_Clock, _Duration>& __t,
_Predicate __pred);
template <class _Rep, class _Period>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
cv_status
wait_for(unique_lock<mutex>& __lk,
const chrono::duration<_Rep, _Period>& __d);
@@ -313,7 +334,7 @@ public:
const chrono::duration<_Rep, _Period>& __d,
_Predicate __pred);
- typedef pthread_cond_t* native_handle_type;
+ typedef __libcpp_condvar_t* native_handle_type;
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}
private:
@@ -382,8 +403,8 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
typedef time_point<system_clock, duration<long double, nano> > __sys_tpf;
typedef time_point<system_clock, nanoseconds> __sys_tpi;
__sys_tpf _Max = __sys_tpi::max();
- system_clock::time_point __s_now = system_clock::now();
steady_clock::time_point __c_now = steady_clock::now();
+ system_clock::time_point __s_now = system_clock::now();
if (_Max - __d > __s_now)
__do_timed_wait(__lk, __s_now + __ceil<nanoseconds>(__d));
else
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__nullptr b/chromium/buildtools/third_party/libc++/trunk/include/__nullptr
index 95415a6325a..a341234f5d1 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__nullptr
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__nullptr
@@ -21,7 +21,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-struct _LIBCPP_TYPE_VIS_ONLY nullptr_t
+struct _LIBCPP_TEMPLATE_VIS nullptr_t
{
void* __lx;
@@ -42,10 +42,6 @@ struct _LIBCPP_TYPE_VIS_ONLY nullptr_t
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;}
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;}
- friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<(nullptr_t, nullptr_t) {return false;}
- friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<=(nullptr_t, nullptr_t) {return true;}
- friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>(nullptr_t, nullptr_t) {return false;}
- friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>=(nullptr_t, nullptr_t) {return true;}
};
inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__refstring b/chromium/buildtools/third_party/libc++/trunk/include/__refstring
index 61ccc75122a..7f417a03c49 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__refstring
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__refstring
@@ -11,6 +11,7 @@
#define _LIBCPP___REFSTRING
#include <__config>
+#include <stdexcept>
#include <cstddef>
#include <cstring>
#ifdef __APPLE__
@@ -20,119 +21,106 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_HIDDEN __libcpp_refstring
-{
-private:
- const char* str_;
+namespace __refstring_imp { namespace {
+typedef int count_t;
- typedef int count_t;
+struct _Rep_base {
+ std::size_t len;
+ std::size_t cap;
+ count_t count;
+};
- struct _Rep_base
- {
- std::size_t len;
- std::size_t cap;
- count_t count;
- };
-
- static
- _Rep_base*
- rep_from_data(const char *data_) _NOEXCEPT
- {
- char *data = const_cast<char *>(data_);
- return reinterpret_cast<_Rep_base *>(data - sizeof(_Rep_base));
- }
- static
- char *
- data_from_rep(_Rep_base *rep) _NOEXCEPT
- {
- char *data = reinterpret_cast<char *>(rep);
- return data + sizeof(*rep);
- }
+inline _Rep_base* rep_from_data(const char *data_) noexcept {
+ char *data = const_cast<char *>(data_);
+ return reinterpret_cast<_Rep_base *>(data - sizeof(_Rep_base));
+}
-#ifdef __APPLE__
- static
- const char*
- compute_gcc_empty_string_storage() _NOEXCEPT
- {
- void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD);
- if (handle == nullptr)
- return nullptr;
- void* sym = dlsym(handle, "_ZNSs4_Rep20_S_empty_rep_storageE");
- if (sym == nullptr)
- return nullptr;
- return data_from_rep(reinterpret_cast<_Rep_base *>(sym));
- }
-
- static
- const char*
- get_gcc_empty_string_storage() _NOEXCEPT
- {
- static const char* p = compute_gcc_empty_string_storage();
- return p;
- }
+inline char * data_from_rep(_Rep_base *rep) noexcept {
+ char *data = reinterpret_cast<char *>(rep);
+ return data + sizeof(*rep);
+}
- bool
- uses_refcount() const
- {
- return str_ != get_gcc_empty_string_storage();
- }
-#else
- bool
- uses_refcount() const
- {
- return true;
- }
+#if defined(__APPLE__)
+inline
+const char* compute_gcc_empty_string_storage() _NOEXCEPT
+{
+ void* handle = dlopen("/usr/lib/libstdc++.6.dylib", RTLD_NOLOAD);
+ if (handle == nullptr)
+ return nullptr;
+ void* sym = dlsym(handle, "_ZNSs4_Rep20_S_empty_rep_storageE");
+ if (sym == nullptr)
+ return nullptr;
+ return data_from_rep(reinterpret_cast<_Rep_base *>(sym));
+}
+
+inline
+const char*
+get_gcc_empty_string_storage() _NOEXCEPT
+{
+ static const char* p = compute_gcc_empty_string_storage();
+ return p;
+}
#endif
-public:
- explicit __libcpp_refstring(const char* msg) {
- std::size_t len = strlen(msg);
- _Rep_base* rep = static_cast<_Rep_base *>(::operator new(sizeof(*rep) + len + 1));
- rep->len = len;
- rep->cap = len;
- rep->count = 0;
- char *data = data_from_rep(rep);
- std::memcpy(data, msg, len + 1);
- str_ = data;
- }
-
- __libcpp_refstring(const __libcpp_refstring& s) _NOEXCEPT : str_(s.str_)
- {
- if (uses_refcount())
- __sync_add_and_fetch(&rep_from_data(str_)->count, 1);
- }
-
- __libcpp_refstring& operator=(const __libcpp_refstring& s) _NOEXCEPT
+}} // namespace __refstring_imp
+
+using namespace __refstring_imp;
+
+inline
+__libcpp_refstring::__libcpp_refstring(const char* msg) {
+ std::size_t len = strlen(msg);
+ _Rep_base* rep = static_cast<_Rep_base *>(::operator new(sizeof(*rep) + len + 1));
+ rep->len = len;
+ rep->cap = len;
+ rep->count = 0;
+ char *data = data_from_rep(rep);
+ std::memcpy(data, msg, len + 1);
+ __imp_ = data;
+}
+
+inline
+__libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT
+ : __imp_(s.__imp_)
+{
+ if (__uses_refcount())
+ __sync_add_and_fetch(&rep_from_data(__imp_)->count, 1);
+}
+
+inline
+__libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _NOEXCEPT {
+ bool adjust_old_count = __uses_refcount();
+ struct _Rep_base *old_rep = rep_from_data(__imp_);
+ __imp_ = s.__imp_;
+ if (__uses_refcount())
+ __sync_add_and_fetch(&rep_from_data(__imp_)->count, 1);
+ if (adjust_old_count)
{
- bool adjust_old_count = uses_refcount();
- struct _Rep_base *old_rep = rep_from_data(str_);
- str_ = s.str_;
- if (uses_refcount())
- __sync_add_and_fetch(&rep_from_data(str_)->count, 1);
- if (adjust_old_count)
+ if (__sync_add_and_fetch(&old_rep->count, count_t(-1)) < 0)
{
- if (__sync_add_and_fetch(&old_rep->count, count_t(-1)) < 0)
- {
- ::operator delete(old_rep);
- }
+ ::operator delete(old_rep);
}
- return *this;
}
-
- ~__libcpp_refstring()
- {
- if (uses_refcount())
- {
- _Rep_base* rep = rep_from_data(str_);
- if (__sync_add_and_fetch(&rep->count, count_t(-1)) < 0)
- {
- ::operator delete(rep);
- }
+ return *this;
+}
+
+inline
+__libcpp_refstring::~__libcpp_refstring() {
+ if (__uses_refcount()) {
+ _Rep_base* rep = rep_from_data(__imp_);
+ if (__sync_add_and_fetch(&rep->count, count_t(-1)) < 0) {
+ ::operator delete(rep);
}
}
+}
- const char* c_str() const _NOEXCEPT {return str_;}
-};
+inline
+bool __libcpp_refstring::__uses_refcount() const {
+#ifdef __APPLE__
+ return __imp_ != get_gcc_empty_string_storage();
+#else
+ return true;
+#endif
+}
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__split_buffer b/chromium/buildtools/third_party/libc++/trunk/include/__split_buffer
index 79d1aa1d7c4..72073f024cd 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__split_buffer
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__split_buffer
@@ -66,7 +66,7 @@ public:
__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
~__split_buffer();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
__split_buffer(__split_buffer&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
__split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
@@ -74,7 +74,7 @@ public:
_NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::value) ||
!__alloc_traits::propagate_on_container_move_assignment::value);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;}
_LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
@@ -99,14 +99,12 @@ public:
void shrink_to_fit() _NOEXCEPT;
void push_front(const_reference __x);
_LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+#ifndef _LIBCPP_CXX03_LANG
void push_front(value_type&& __x);
void push_back(value_type&& __x);
-#if !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class... _Args>
void emplace_back(_Args&&... __args);
-#endif // !defined(_LIBCPP_HAS_NO_VARIADICS)
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
_LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
@@ -343,7 +341,7 @@ __split_buffer<_Tp, _Allocator>::~__split_buffer()
__alloc_traits::deallocate(__alloc(), __first_, capacity());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
@@ -361,7 +359,7 @@ __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
template <class _Tp, class _Allocator>
__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __alloc_rr& __a)
- : __end_cap_(__a)
+ : __end_cap_(__second_tag(), __a)
{
if (__a == __c.__alloc())
{
@@ -405,7 +403,7 @@ __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
void
@@ -492,7 +490,7 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
--__begin_;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
void
@@ -524,7 +522,7 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x)
--__begin_;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -556,7 +554,7 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x)
++__end_;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
void
@@ -588,8 +586,6 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
++__end_;
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Allocator>
template <class... _Args>
void
@@ -621,9 +617,7 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
++__end_;
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__sso_allocator b/chromium/buildtools/third_party/libc++/trunk/include/__sso_allocator
index ca3b937c013..8147e75ec2c 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__sso_allocator
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__sso_allocator
@@ -15,8 +15,6 @@
#include <type_traits>
#include <new>
-#include <__undef___deallocate>
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -64,7 +62,7 @@ public:
if (__p == (pointer)&buf_)
__allocated_ = false;
else
- _VSTD::__deallocate(__p);
+ _VSTD::__libcpp_deallocate(__p);
}
_LIBCPP_INLINE_VISIBILITY size_type max_size() const throw() {return size_type(~0) / sizeof(_Tp);}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__std_stream b/chromium/buildtools/third_party/libc++/trunk/include/__std_stream
index f867cd23bdd..fb5a346f10d 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__std_stream
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__std_stream
@@ -297,7 +297,7 @@ __stdoutbuf<_CharT>::overflow(int_type __c)
return traits_type::eof();
if (__r == codecvt_base::partial)
{
- pbase = (char_type*)__e;
+ pbase = const_cast<char_type*>(__e);
}
}
else
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__string b/chromium/buildtools/third_party/libc++/trunk/include/__string
new file mode 100644
index 00000000000..75608cea71d
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__string
@@ -0,0 +1,873 @@
+// -*- C++ -*-
+//===-------------------------- __string ----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___STRING
+#define _LIBCPP___STRING
+
+/*
+ string synopsis
+
+namespace std
+{
+
+template <class charT>
+struct char_traits
+{
+ typedef charT char_type;
+ typedef ... int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static constexpr void assign(char_type& c1, const char_type& c2) noexcept;
+ static constexpr bool eq(char_type c1, char_type c2) noexcept;
+ static constexpr bool lt(char_type c1, char_type c2) noexcept;
+
+ static constexpr int compare(const char_type* s1, const char_type* s2, size_t n);
+ static constexpr size_t length(const char_type* s);
+ static constexpr const char_type*
+ find(const char_type* s, size_t n, const char_type& a);
+ static char_type* move(char_type* s1, const char_type* s2, size_t n);
+ static char_type* copy(char_type* s1, const char_type* s2, size_t n);
+ static char_type* assign(char_type* s, size_t n, char_type a);
+
+ static constexpr int_type not_eof(int_type c) noexcept;
+ static constexpr char_type to_char_type(int_type c) noexcept;
+ static constexpr int_type to_int_type(char_type c) noexcept;
+ static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept;
+ static constexpr int_type eof() noexcept;
+};
+
+template <> struct char_traits<char>;
+template <> struct char_traits<wchar_t>;
+
+} // std
+
+*/
+
+#include <__config>
+#include <algorithm> // for search and min
+#include <cstdio> // For EOF.
+#include <memory> // for __murmur2_or_cityhash
+
+#include <__undef_min_max>
+
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// char_traits
+
+template <class _CharT>
+struct _LIBCPP_TEMPLATE_VIS char_traits
+{
+ typedef _CharT char_type;
+ typedef int int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline void _LIBCPP_CONSTEXPR_AFTER_CXX14
+ assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 < __c2;}
+
+ static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ int compare(const char_type* __s1, const char_type* __s2, size_t __n);
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ size_t length(const char_type* __s);
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
+ static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* assign(char_type* __s, size_t __n, char_type __a);
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type(__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(EOF);}
+};
+
+template <class _CharT>
+_LIBCPP_CONSTEXPR_AFTER_CXX14 int
+char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
+{
+ for (; __n; --__n, ++__s1, ++__s2)
+ {
+ if (lt(*__s1, *__s2))
+ return -1;
+ if (lt(*__s2, *__s1))
+ return 1;
+ }
+ return 0;
+}
+
+template <class _CharT>
+inline
+_LIBCPP_CONSTEXPR_AFTER_CXX14 size_t
+char_traits<_CharT>::length(const char_type* __s)
+{
+ size_t __len = 0;
+ for (; !eq(*__s, char_type(0)); ++__s)
+ ++__len;
+ return __len;
+}
+
+template <class _CharT>
+inline
+_LIBCPP_CONSTEXPR_AFTER_CXX14 const _CharT*
+char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a)
+{
+ for (; __n; --__n)
+ {
+ if (eq(*__s, __a))
+ return __s;
+ ++__s;
+ }
+ return 0;
+}
+
+template <class _CharT>
+_CharT*
+char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n)
+{
+ char_type* __r = __s1;
+ if (__s1 < __s2)
+ {
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ }
+ else if (__s2 < __s1)
+ {
+ __s1 += __n;
+ __s2 += __n;
+ for (; __n; --__n)
+ assign(*--__s1, *--__s2);
+ }
+ return __r;
+}
+
+template <class _CharT>
+inline
+_CharT*
+char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n)
+{
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ char_type* __r = __s1;
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ return __r;
+}
+
+template <class _CharT>
+inline
+_CharT*
+char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
+{
+ char_type* __r = __s;
+ for (; __n; --__n, ++__s)
+ assign(*__s, __a);
+ return __r;
+}
+
+// char_traits<char>
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS char_traits<char>
+{
+ typedef char char_type;
+ typedef int int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+ void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return (unsigned char)__c1 < (unsigned char)__c2;}
+
+ static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ static inline size_t _LIBCPP_CONSTEXPR_AFTER_CXX14
+ length(const char_type* __s) _NOEXCEPT {return __builtin_strlen(__s);}
+ static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
+ static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {return __n == 0 ? __s1 : (char_type*) memmove(__s1, __s2, __n);}
+ static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ return __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
+ }
+ static inline char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
+ {return __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);}
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type((unsigned char)__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(EOF);}
+};
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+int
+char_traits<char>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ if (__n == 0)
+ return 0;
+#if __has_feature(cxx_constexpr_string_builtins)
+ return __builtin_memcmp(__s1, __s2, __n);
+#elif _LIBCPP_STD_VER <= 14
+ return memcmp(__s1, __s2, __n);
+#else
+ for (; __n; --__n, ++__s1, ++__s2)
+ {
+ if (lt(*__s1, *__s2))
+ return -1;
+ if (lt(*__s2, *__s1))
+ return 1;
+ }
+ return 0;
+#endif
+}
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+const char*
+char_traits<char>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
+{
+ if (__n == 0)
+ return NULL;
+#if __has_feature(cxx_constexpr_string_builtins)
+ return __builtin_char_memchr(__s, to_int_type(__a), __n);
+#elif _LIBCPP_STD_VER <= 14
+ return (const char_type*) memchr(__s, to_int_type(__a), __n);
+#else
+ for (; __n; --__n)
+ {
+ if (eq(*__s, __a))
+ return __s;
+ ++__s;
+ }
+ return NULL;
+#endif
+}
+
+
+// char_traits<wchar_t>
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS char_traits<wchar_t>
+{
+ typedef wchar_t char_type;
+ typedef wint_t int_type;
+ typedef streamoff off_type;
+ typedef streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+ void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 < __c2;}
+
+ static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ size_t length(const char_type* __s) _NOEXCEPT;
+ static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
+ static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {return __n == 0 ? __s1 : (char_type*)wmemmove(__s1, __s2, __n);}
+ static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ return __n == 0 ? __s1 : (char_type*)wmemcpy(__s1, __s2, __n);
+ }
+ static inline char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
+ {return __n == 0 ? __s : (char_type*)wmemset(__s, __a, __n);}
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type(__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(WEOF);}
+};
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+int
+char_traits<wchar_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ if (__n == 0)
+ return 0;
+#if __has_feature(cxx_constexpr_string_builtins)
+ return __builtin_wmemcmp(__s1, __s2, __n);
+#elif _LIBCPP_STD_VER <= 14
+ return wmemcmp(__s1, __s2, __n);
+#else
+ for (; __n; --__n, ++__s1, ++__s2)
+ {
+ if (lt(*__s1, *__s2))
+ return -1;
+ if (lt(*__s2, *__s1))
+ return 1;
+ }
+ return 0;
+#endif
+}
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+size_t
+char_traits<wchar_t>::length(const char_type* __s) _NOEXCEPT
+{
+#if __has_feature(cxx_constexpr_string_builtins)
+ return __builtin_wcslen(__s);
+#elif _LIBCPP_STD_VER <= 14
+ return wcslen(__s);
+#else
+ size_t __len = 0;
+ for (; !eq(*__s, char_type(0)); ++__s)
+ ++__len;
+ return __len;
+#endif
+}
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+const wchar_t*
+char_traits<wchar_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
+{
+ if (__n == 0)
+ return NULL;
+#if __has_feature(cxx_constexpr_string_builtins)
+ return __builtin_wmemchr(__s, __a, __n);
+#elif _LIBCPP_STD_VER <= 14
+ return wmemchr(__s, __a, __n);
+#else
+ for (; __n; --__n)
+ {
+ if (eq(*__s, __a))
+ return __s;
+ ++__s;
+ }
+ return NULL;
+#endif
+}
+
+
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS char_traits<char16_t>
+{
+ typedef char16_t char_type;
+ typedef uint_least16_t int_type;
+ typedef streamoff off_type;
+ typedef u16streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+ void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 < __c2;}
+
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ size_t length(const char_type* __s) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT;
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type(__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(0xFFFF);}
+};
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+int
+char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ for (; __n; --__n, ++__s1, ++__s2)
+ {
+ if (lt(*__s1, *__s2))
+ return -1;
+ if (lt(*__s2, *__s1))
+ return 1;
+ }
+ return 0;
+}
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+size_t
+char_traits<char16_t>::length(const char_type* __s) _NOEXCEPT
+{
+ size_t __len = 0;
+ for (; !eq(*__s, char_type(0)); ++__s)
+ ++__len;
+ return __len;
+}
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+const char16_t*
+char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
+{
+ for (; __n; --__n)
+ {
+ if (eq(*__s, __a))
+ return __s;
+ ++__s;
+ }
+ return 0;
+}
+
+inline
+char16_t*
+char_traits<char16_t>::move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ char_type* __r = __s1;
+ if (__s1 < __s2)
+ {
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ }
+ else if (__s2 < __s1)
+ {
+ __s1 += __n;
+ __s2 += __n;
+ for (; __n; --__n)
+ assign(*--__s1, *--__s2);
+ }
+ return __r;
+}
+
+inline
+char16_t*
+char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ char_type* __r = __s1;
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ return __r;
+}
+
+inline
+char16_t*
+char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
+{
+ char_type* __r = __s;
+ for (; __n; --__n, ++__s)
+ assign(*__s, __a);
+ return __r;
+}
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS char_traits<char32_t>
+{
+ typedef char32_t char_type;
+ typedef uint_least32_t int_type;
+ typedef streamoff off_type;
+ typedef u32streampos pos_type;
+ typedef mbstate_t state_type;
+
+ static inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+ void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT {__c1 = __c2;}
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ {return __c1 < __c2;}
+
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ int compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ size_t length(const char_type* __s) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR_AFTER_CXX14
+ const char_type* find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ static char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT;
+
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ {return eq_int_type(__c, eof()) ? ~eof() : __c;}
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ {return char_type(__c);}
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ {return int_type(__c);}
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ {return __c1 == __c2;}
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ {return int_type(0xFFFFFFFF);}
+};
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+int
+char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ for (; __n; --__n, ++__s1, ++__s2)
+ {
+ if (lt(*__s1, *__s2))
+ return -1;
+ if (lt(*__s2, *__s1))
+ return 1;
+ }
+ return 0;
+}
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+size_t
+char_traits<char32_t>::length(const char_type* __s) _NOEXCEPT
+{
+ size_t __len = 0;
+ for (; !eq(*__s, char_type(0)); ++__s)
+ ++__len;
+ return __len;
+}
+
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+const char32_t*
+char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a) _NOEXCEPT
+{
+ for (; __n; --__n)
+ {
+ if (eq(*__s, __a))
+ return __s;
+ ++__s;
+ }
+ return 0;
+}
+
+inline
+char32_t*
+char_traits<char32_t>::move(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ char_type* __r = __s1;
+ if (__s1 < __s2)
+ {
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ }
+ else if (__s2 < __s1)
+ {
+ __s1 += __n;
+ __s2 += __n;
+ for (; __n; --__n)
+ assign(*--__s1, *--__s2);
+ }
+ return __r;
+}
+
+inline
+char32_t*
+char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT
+{
+ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ char_type* __r = __s1;
+ for (; __n; --__n, ++__s1, ++__s2)
+ assign(*__s1, *__s2);
+ return __r;
+}
+
+inline
+char32_t*
+char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT
+{
+ char_type* __r = __s;
+ for (; __n; --__n, ++__s)
+ assign(*__s, __a);
+ return __r;
+}
+
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+
+// helper fns for basic_string and string_view
+
+// __str_find
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find(const _CharT *__p, _SizeT __sz,
+ _CharT __c, _SizeT __pos) _NOEXCEPT
+{
+ if (__pos >= __sz)
+ return __npos;
+ const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
+ if (__r == 0)
+ return __npos;
+ return static_cast<_SizeT>(__r - __p);
+}
+
+template <class _CharT, class _Traits>
+inline _LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT *
+__search_substring(const _CharT *__first1, const _CharT *__last1,
+ const _CharT *__first2, const _CharT *__last2) {
+ // Take advantage of knowing source and pattern lengths.
+ // Stop short when source is smaller than pattern.
+ const ptrdiff_t __len2 = __last2 - __first2;
+ if (__len2 == 0)
+ return __first1;
+
+ ptrdiff_t __len1 = __last1 - __first1;
+ if (__len1 < __len2)
+ return __last1;
+
+ // First element of __first2 is loop invariant.
+ _CharT __f2 = *__first2;
+ while (true) {
+ __len1 = __last1 - __first1;
+ // Check whether __first1 still has at least __len2 bytes.
+ if (__len1 < __len2)
+ return __last1;
+
+ // Find __f2 the first byte matching in __first1.
+ __first1 = _Traits::find(__first1, __len1 - __len2 + 1, __f2);
+ if (__first1 == 0)
+ return __last1;
+
+ // It is faster to compare from the first byte of __first1 even if we
+ // already know that it matches the first byte of __first2: this is because
+ // __first2 is most likely aligned, as it is user's "pattern" string, and
+ // __first1 + 1 is most likely not aligned, as the match is in the middle of
+ // the string.
+ if (_Traits::compare(__first1, __first2, __len2) == 0)
+ return __first1;
+
+ ++__first1;
+ }
+}
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ if (__pos > __sz)
+ return __npos;
+
+ if (__n == 0) // There is nothing to search, just return __pos.
+ return __pos;
+
+ const _CharT *__r = __search_substring<_CharT, _Traits>(
+ __p + __pos, __p + __sz, __s, __s + __n);
+
+ if (__r == __p + __sz)
+ return __npos;
+ return static_cast<_SizeT>(__r - __p);
+}
+
+
+// __str_rfind
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_rfind(const _CharT *__p, _SizeT __sz,
+ _CharT __c, _SizeT __pos) _NOEXCEPT
+{
+ if (__sz < 1)
+ return __npos;
+ if (__pos < __sz)
+ ++__pos;
+ else
+ __pos = __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __p;)
+ {
+ if (_Traits::eq(*--__ps, __c))
+ return static_cast<_SizeT>(__ps - __p);
+ }
+ return __npos;
+}
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_rfind(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ __pos = _VSTD::min(__pos, __sz);
+ if (__n < __sz - __pos)
+ __pos += __n;
+ else
+ __pos = __sz;
+ const _CharT* __r = _VSTD::__find_end(
+ __p, __p + __pos, __s, __s + __n, _Traits::eq,
+ random_access_iterator_tag(), random_access_iterator_tag());
+ if (__n > 0 && __r == __p + __pos)
+ return __npos;
+ return static_cast<_SizeT>(__r - __p);
+}
+
+// __str_find_first_of
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_first_of(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ if (__pos >= __sz || __n == 0)
+ return __npos;
+ const _CharT* __r = _VSTD::__find_first_of_ce
+ (__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
+ if (__r == __p + __sz)
+ return __npos;
+ return static_cast<_SizeT>(__r - __p);
+}
+
+
+// __str_find_last_of
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_last_of(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+ {
+ if (__n != 0)
+ {
+ if (__pos < __sz)
+ ++__pos;
+ else
+ __pos = __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __p;)
+ {
+ const _CharT* __r = _Traits::find(__s, __n, *--__ps);
+ if (__r)
+ return static_cast<_SizeT>(__ps - __p);
+ }
+ }
+ return __npos;
+}
+
+
+// __str_find_first_not_of
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ if (__pos < __sz)
+ {
+ const _CharT* __pe = __p + __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
+ if (_Traits::find(__s, __n, *__ps) == 0)
+ return static_cast<_SizeT>(__ps - __p);
+ }
+ return __npos;
+}
+
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
+ _CharT __c, _SizeT __pos) _NOEXCEPT
+{
+ if (__pos < __sz)
+ {
+ const _CharT* __pe = __p + __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
+ if (!_Traits::eq(*__ps, __c))
+ return static_cast<_SizeT>(__ps - __p);
+ }
+ return __npos;
+}
+
+
+// __str_find_last_not_of
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
+ const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
+{
+ if (__pos < __sz)
+ ++__pos;
+ else
+ __pos = __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __p;)
+ if (_Traits::find(__s, __n, *--__ps) == 0)
+ return static_cast<_SizeT>(__ps - __p);
+ return __npos;
+}
+
+
+template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
+inline _SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
+ _CharT __c, _SizeT __pos) _NOEXCEPT
+{
+ if (__pos < __sz)
+ ++__pos;
+ else
+ __pos = __sz;
+ for (const _CharT* __ps = __p + __pos; __ps != __p;)
+ if (!_Traits::eq(*--__ps, __c))
+ return static_cast<_SizeT>(__ps - __p);
+ return __npos;
+}
+
+template<class _Ptr>
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __do_string_hash(_Ptr __p, _Ptr __e)
+{
+ typedef typename iterator_traits<_Ptr>::value_type value_type;
+ return __murmur2_or_cityhash<size_t>()(__p, (__e-__p)*sizeof(value_type));
+}
+
+template <class _CharT, class _Iter, class _Traits=char_traits<_CharT> >
+struct __quoted_output_proxy
+{
+ _Iter __first;
+ _Iter __last;
+ _CharT __delim;
+ _CharT __escape;
+
+ __quoted_output_proxy(_Iter __f, _Iter __l, _CharT __d, _CharT __e)
+ : __first(__f), __last(__l), __delim(__d), __escape(__e) {}
+ // This would be a nice place for a string_ref
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___STRING
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__threading_support b/chromium/buildtools/third_party/libc++/trunk/include/__threading_support
new file mode 100644
index 00000000000..385fff32b35
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__threading_support
@@ -0,0 +1,634 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_THREADING_SUPPORT
+#define _LIBCPP_THREADING_SUPPORT
+
+#include <__config>
+#include <chrono>
+#include <errno.h>
+
+#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
+#pragma GCC system_header
+#endif
+
+#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
+# include <__external_threading>
+#elif !defined(_LIBCPP_HAS_NO_THREADS)
+
+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+# include <pthread.h>
+# include <sched.h>
+#elif defined(_LIBCPP_HAS_THREAD_API_WIN32)
+#include <Windows.h>
+#include <process.h>
+#include <fibersapi.h>
+#include <__undef_min_max>
+#endif
+
+#if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
+ defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)
+#define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS
+#else
+#define _LIBCPP_THREAD_ABI_VISIBILITY inline _LIBCPP_INLINE_VISIBILITY
+#endif
+
+#if defined(__FreeBSD__) && defined(__clang__) && __has_attribute(no_thread_safety_analysis)
+#define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis))
+#else
+#define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+// Mutex
+typedef pthread_mutex_t __libcpp_mutex_t;
+#define _LIBCPP_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+
+typedef pthread_mutex_t __libcpp_recursive_mutex_t;
+
+// Condition Variable
+typedef pthread_cond_t __libcpp_condvar_t;
+#define _LIBCPP_CONDVAR_INITIALIZER PTHREAD_COND_INITIALIZER
+
+// Execute once
+typedef pthread_once_t __libcpp_exec_once_flag;
+#define _LIBCPP_EXEC_ONCE_INITIALIZER PTHREAD_ONCE_INIT
+
+// Thread id
+typedef pthread_t __libcpp_thread_id;
+
+// Thread
+#define _LIBCPP_NULL_THREAD 0U
+
+typedef pthread_t __libcpp_thread_t;
+
+// Thrad Local Storage
+typedef pthread_key_t __libcpp_tls_key;
+
+#define _LIBCPP_TLS_DESTRUCTOR_CC
+#else
+// Mutex
+typedef SRWLOCK __libcpp_mutex_t;
+#define _LIBCPP_MUTEX_INITIALIZER SRWLOCK_INIT
+
+typedef CRITICAL_SECTION __libcpp_recursive_mutex_t;
+
+// Condition Variable
+typedef CONDITION_VARIABLE __libcpp_condvar_t;
+#define _LIBCPP_CONDVAR_INITIALIZER CONDITION_VARIABLE_INIT
+
+// Execute Once
+typedef INIT_ONCE __libcpp_exec_once_flag;
+#define _LIBCPP_EXEC_ONCE_INITIALIZER INIT_ONCE_STATIC_INIT
+
+// Thread ID
+typedef DWORD __libcpp_thread_id;
+
+// Thread
+#define _LIBCPP_NULL_THREAD 0U
+
+typedef HANDLE __libcpp_thread_t;
+
+// Thread Local Storage
+typedef DWORD __libcpp_tls_key;
+
+#define _LIBCPP_TLS_DESTRUCTOR_CC WINAPI
+#endif
+
+// Mutex
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+int __libcpp_mutex_lock(__libcpp_mutex_t *__m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+int __libcpp_mutex_unlock(__libcpp_mutex_t *__m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_mutex_destroy(__libcpp_mutex_t *__m);
+
+// Condition variable
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_condvar_signal(__libcpp_condvar_t* __cv);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_condvar_broadcast(__libcpp_condvar_t* __cv);
+
+_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+int __libcpp_condvar_wait(__libcpp_condvar_t* __cv, __libcpp_mutex_t* __m);
+
+_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
+int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
+ timespec *__ts);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv);
+
+// Execute once
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
+ void (*init_routine)(void));
+
+// Thread id
+_LIBCPP_THREAD_ABI_VISIBILITY
+bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2);
+
+// Thread
+_LIBCPP_THREAD_ABI_VISIBILITY
+bool __libcpp_thread_isnull(const __libcpp_thread_t *__t);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
+ void *__arg);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+__libcpp_thread_id __libcpp_thread_get_current_id();
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_thread_join(__libcpp_thread_t *__t);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_thread_detach(__libcpp_thread_t *__t);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+void __libcpp_thread_yield();
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns);
+
+// Thread local storage
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_tls_create(__libcpp_tls_key* __key,
+ void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*));
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+void *__libcpp_tls_get(__libcpp_tls_key __key);
+
+_LIBCPP_THREAD_ABI_VISIBILITY
+int __libcpp_tls_set(__libcpp_tls_key __key, void *__p);
+
+#if !defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
+ defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)
+
+#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+
+int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
+{
+ pthread_mutexattr_t attr;
+ int __ec = pthread_mutexattr_init(&attr);
+ if (__ec)
+ return __ec;
+ __ec = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ if (__ec) {
+ pthread_mutexattr_destroy(&attr);
+ return __ec;
+ }
+ __ec = pthread_mutex_init(__m, &attr);
+ if (__ec) {
+ pthread_mutexattr_destroy(&attr);
+ return __ec;
+ }
+ __ec = pthread_mutexattr_destroy(&attr);
+ if (__ec) {
+ pthread_mutex_destroy(__m);
+ return __ec;
+ }
+ return 0;
+}
+
+int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m)
+{
+ return pthread_mutex_lock(__m);
+}
+
+bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m)
+{
+ return pthread_mutex_trylock(__m) == 0;
+}
+
+int __libcpp_recursive_mutex_unlock(__libcpp_mutex_t *__m)
+{
+ return pthread_mutex_unlock(__m);
+}
+
+int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m)
+{
+ return pthread_mutex_destroy(__m);
+}
+
+int __libcpp_mutex_lock(__libcpp_mutex_t *__m)
+{
+ return pthread_mutex_lock(__m);
+}
+
+bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m)
+{
+ return pthread_mutex_trylock(__m) == 0;
+}
+
+int __libcpp_mutex_unlock(__libcpp_mutex_t *__m)
+{
+ return pthread_mutex_unlock(__m);
+}
+
+int __libcpp_mutex_destroy(__libcpp_mutex_t *__m)
+{
+ return pthread_mutex_destroy(__m);
+}
+
+// Condition Variable
+int __libcpp_condvar_signal(__libcpp_condvar_t *__cv)
+{
+ return pthread_cond_signal(__cv);
+}
+
+int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv)
+{
+ return pthread_cond_broadcast(__cv);
+}
+
+int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m)
+{
+ return pthread_cond_wait(__cv, __m);
+}
+
+int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
+ timespec *__ts)
+{
+ return pthread_cond_timedwait(__cv, __m, __ts);
+}
+
+int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv)
+{
+ return pthread_cond_destroy(__cv);
+}
+
+// Execute once
+int __libcpp_execute_once(__libcpp_exec_once_flag *flag,
+ void (*init_routine)(void)) {
+ return pthread_once(flag, init_routine);
+}
+
+// Thread id
+// Returns non-zero if the thread ids are equal, otherwise 0
+bool __libcpp_thread_id_equal(__libcpp_thread_id t1, __libcpp_thread_id t2)
+{
+ return pthread_equal(t1, t2) != 0;
+}
+
+// Returns non-zero if t1 < t2, otherwise 0
+bool __libcpp_thread_id_less(__libcpp_thread_id t1, __libcpp_thread_id t2)
+{
+ return t1 < t2;
+}
+
+// Thread
+bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
+ return *__t == 0;
+}
+
+int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
+ void *__arg)
+{
+ return pthread_create(__t, 0, __func, __arg);
+}
+
+__libcpp_thread_id __libcpp_thread_get_current_id()
+{
+ return pthread_self();
+}
+
+__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
+{
+ return *__t;
+}
+
+int __libcpp_thread_join(__libcpp_thread_t *__t)
+{
+ return pthread_join(*__t, 0);
+}
+
+int __libcpp_thread_detach(__libcpp_thread_t *__t)
+{
+ return pthread_detach(*__t);
+}
+
+void __libcpp_thread_yield()
+{
+ sched_yield();
+}
+
+void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns)
+{
+ using namespace chrono;
+ seconds __s = duration_cast<seconds>(__ns);
+ timespec __ts;
+ typedef decltype(__ts.tv_sec) ts_sec;
+ _LIBCPP_CONSTEXPR ts_sec __ts_sec_max = numeric_limits<ts_sec>::max();
+
+ if (__s.count() < __ts_sec_max)
+ {
+ __ts.tv_sec = static_cast<ts_sec>(__s.count());
+ __ts.tv_nsec = static_cast<decltype(__ts.tv_nsec)>((__ns - __s).count());
+ }
+ else
+ {
+ __ts.tv_sec = __ts_sec_max;
+ __ts.tv_nsec = 999999999; // (10^9 - 1)
+ }
+
+ while (nanosleep(&__ts, &__ts) == -1 && errno == EINTR);
+}
+
+// Thread local storage
+int __libcpp_tls_create(__libcpp_tls_key *__key, void (*__at_exit)(void *))
+{
+ return pthread_key_create(__key, __at_exit);
+}
+
+void *__libcpp_tls_get(__libcpp_tls_key __key)
+{
+ return pthread_getspecific(__key);
+}
+
+int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
+{
+ return pthread_setspecific(__key, __p);
+}
+
+#elif defined(_LIBCPP_HAS_THREAD_API_WIN32)
+
+// Mutex
+int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t *__m)
+{
+ InitializeCriticalSection(__m);
+ return 0;
+}
+
+int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t *__m)
+{
+ EnterCriticalSection(__m);
+ return 0;
+}
+
+bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t *__m)
+{
+ return TryEnterCriticalSection(__m) != 0;
+}
+
+int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t *__m)
+{
+ LeaveCriticalSection(__m);
+ return 0;
+}
+
+int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t *__m)
+{
+ DeleteCriticalSection(__m);
+ return 0;
+}
+
+int __libcpp_mutex_lock(__libcpp_mutex_t *__m)
+{
+ AcquireSRWLockExclusive(__m);
+ return 0;
+}
+
+bool __libcpp_mutex_trylock(__libcpp_mutex_t *__m)
+{
+ return TryAcquireSRWLockExclusive(__m) != 0;
+}
+
+int __libcpp_mutex_unlock(__libcpp_mutex_t *__m)
+{
+ ReleaseSRWLockExclusive(__m);
+ return 0;
+}
+
+int __libcpp_mutex_destroy(__libcpp_mutex_t *__m)
+{
+ static_cast<void>(__m);
+ return 0;
+}
+
+// Condition Variable
+int __libcpp_condvar_signal(__libcpp_condvar_t *__cv)
+{
+ WakeConditionVariable(__cv);
+ return 0;
+}
+
+int __libcpp_condvar_broadcast(__libcpp_condvar_t *__cv)
+{
+ WakeAllConditionVariable(__cv);
+ return 0;
+}
+
+int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m)
+{
+ SleepConditionVariableSRW(__cv, __m, INFINITE, 0);
+ return 0;
+}
+
+int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,
+ timespec *__ts)
+{
+ using namespace _VSTD::chrono;
+
+ auto duration = seconds(__ts->tv_sec) + nanoseconds(__ts->tv_nsec);
+ auto abstime =
+ system_clock::time_point(duration_cast<system_clock::duration>(duration));
+ auto timeout_ms = duration_cast<milliseconds>(abstime - system_clock::now());
+
+ if (!SleepConditionVariableSRW(__cv, __m,
+ timeout_ms.count() > 0 ? timeout_ms.count()
+ : 0,
+ 0))
+ {
+ auto __ec = GetLastError();
+ return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec;
+ }
+ return 0;
+}
+
+int __libcpp_condvar_destroy(__libcpp_condvar_t *__cv)
+{
+ static_cast<void>(__cv);
+ return 0;
+}
+
+// Execute Once
+static inline _LIBCPP_ALWAYS_INLINE BOOL CALLBACK
+__libcpp_init_once_execute_once_thunk(PINIT_ONCE __init_once, PVOID __parameter,
+ PVOID *__context)
+{
+ static_cast<void>(__init_once);
+ static_cast<void>(__context);
+
+ void (*init_routine)(void) = reinterpret_cast<void (*)(void)>(__parameter);
+ init_routine();
+ return TRUE;
+}
+
+int __libcpp_execute_once(__libcpp_exec_once_flag *__flag,
+ void (*__init_routine)(void))
+{
+ if (!InitOnceExecuteOnce(__flag, __libcpp_init_once_execute_once_thunk,
+ reinterpret_cast<void *>(__init_routine), NULL))
+ return GetLastError();
+ return 0;
+}
+
+// Thread ID
+bool __libcpp_thread_id_equal(__libcpp_thread_id __lhs,
+ __libcpp_thread_id __rhs)
+{
+ return __lhs == __rhs;
+}
+
+bool __libcpp_thread_id_less(__libcpp_thread_id __lhs, __libcpp_thread_id __rhs)
+{
+ return __lhs < __rhs;
+}
+
+// Thread
+struct __libcpp_beginthreadex_thunk_data
+{
+ void *(*__func)(void *);
+ void *__arg;
+};
+
+static inline _LIBCPP_ALWAYS_INLINE unsigned WINAPI
+__libcpp_beginthreadex_thunk(void *__raw_data)
+{
+ auto *__data =
+ static_cast<__libcpp_beginthreadex_thunk_data *>(__raw_data);
+ auto *__func = __data->__func;
+ void *__arg = __data->__arg;
+ delete __data;
+ return static_cast<unsigned>(reinterpret_cast<uintptr_t>(__func(__arg)));
+}
+
+bool __libcpp_thread_isnull(const __libcpp_thread_t *__t) {
+ return *__t == 0;
+}
+
+int __libcpp_thread_create(__libcpp_thread_t *__t, void *(*__func)(void *),
+ void *__arg)
+{
+ auto *__data = new __libcpp_beginthreadex_thunk_data;
+ __data->__func = __func;
+ __data->__arg = __arg;
+
+ *__t = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0,
+ __libcpp_beginthreadex_thunk,
+ __data, 0, nullptr));
+
+ if (*__t)
+ return 0;
+ return GetLastError();
+}
+
+__libcpp_thread_id __libcpp_thread_get_current_id()
+{
+ return GetCurrentThreadId();
+}
+
+__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t *__t)
+{
+ return GetThreadId(*__t);
+}
+
+int __libcpp_thread_join(__libcpp_thread_t *__t)
+{
+ if (WaitForSingleObjectEx(*__t, INFINITE, FALSE) == WAIT_FAILED)
+ return GetLastError();
+ if (!CloseHandle(*__t))
+ return GetLastError();
+ return 0;
+}
+
+int __libcpp_thread_detach(__libcpp_thread_t *__t)
+{
+ if (!CloseHandle(*__t))
+ return GetLastError();
+ return 0;
+}
+
+void __libcpp_thread_yield()
+{
+ SwitchToThread();
+}
+
+void __libcpp_thread_sleep_for(const chrono::nanoseconds& __ns)
+{
+ using namespace chrono;
+ // round-up to the nearest milisecond
+ milliseconds __ms =
+ duration_cast<milliseconds>(__ns + chrono::nanoseconds(999999));
+ // FIXME(compnerd) this should be an alertable sleep (WFSO or SleepEx)
+ Sleep(__ms.count());
+}
+
+// Thread Local Storage
+int __libcpp_tls_create(__libcpp_tls_key* __key,
+ void(_LIBCPP_TLS_DESTRUCTOR_CC* __at_exit)(void*))
+{
+ *__key = FlsAlloc(__at_exit);
+ if (*__key == FLS_OUT_OF_INDEXES)
+ return GetLastError();
+ return 0;
+}
+
+void *__libcpp_tls_get(__libcpp_tls_key __key)
+{
+ return FlsGetValue(__key);
+}
+
+int __libcpp_tls_set(__libcpp_tls_key __key, void *__p)
+{
+ if (!FlsSetValue(__key, __p))
+ return GetLastError();
+ return 0;
+}
+
+#endif // _LIBCPP_HAS_THREAD_API_PTHREAD
+
+#endif // !_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL || _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // !_LIBCPP_HAS_NO_THREADS
+
+#endif // _LIBCPP_THREADING_SUPPORT
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__tree b/chromium/buildtools/third_party/libc++/trunk/include/__tree
index 6391609b398..6771589bbc6 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__tree
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__tree
@@ -17,6 +17,8 @@
#include <stdexcept>
#include <algorithm>
+#include <__undef_min_max>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -25,9 +27,29 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Compare, class _Allocator> class __tree;
template <class _Tp, class _NodePtr, class _DiffType>
- class _LIBCPP_TYPE_VIS_ONLY __tree_iterator;
+ class _LIBCPP_TEMPLATE_VIS __tree_iterator;
template <class _Tp, class _ConstNodePtr, class _DiffType>
- class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator;
+ class _LIBCPP_TEMPLATE_VIS __tree_const_iterator;
+
+template <class _Pointer> class __tree_end_node;
+template <class _VoidPtr> class __tree_node_base;
+template <class _Tp, class _VoidPtr> class __tree_node;
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Key, class _Value>
+union __value_type;
+#else
+template <class _Key, class _Value>
+struct __value_type;
+#endif
+
+template <class _Key, class _CP, class _Compare,
+ bool = is_empty<_Compare>::value && !__libcpp_is_final<_Compare>::value>
+class __map_value_compare;
+
+template <class _Allocator> class __map_node_destructor;
+template <class _TreeIterator> class _LIBCPP_TEMPLATE_VIS __map_iterator;
+template <class _TreeIterator> class _LIBCPP_TEMPLATE_VIS __map_const_iterator;
/*
@@ -149,21 +171,36 @@ __tree_next(_NodePtr __x) _NOEXCEPT
if (__x->__right_ != nullptr)
return __tree_min(__x->__right_);
while (!__tree_is_left_child(__x))
- __x = __x->__parent_;
- return __x->__parent_;
+ __x = __x->__parent_unsafe();
+ return __x->__parent_unsafe();
+}
+
+template <class _EndNodePtr, class _NodePtr>
+inline _LIBCPP_INLINE_VISIBILITY
+_EndNodePtr
+__tree_next_iter(_NodePtr __x) _NOEXCEPT
+{
+ if (__x->__right_ != nullptr)
+ return static_cast<_EndNodePtr>(__tree_min(__x->__right_));
+ while (!__tree_is_left_child(__x))
+ __x = __x->__parent_unsafe();
+ return static_cast<_EndNodePtr>(__x->__parent_);
}
// Returns: pointer to the previous in-order node before __x.
// Precondition: __x != nullptr.
-template <class _NodePtr>
+// Note: __x may be the end node.
+template <class _NodePtr, class _EndNodePtr>
+inline _LIBCPP_INLINE_VISIBILITY
_NodePtr
-__tree_prev(_NodePtr __x) _NOEXCEPT
+__tree_prev_iter(_EndNodePtr __x) _NOEXCEPT
{
if (__x->__left_ != nullptr)
return __tree_max(__x->__left_);
- while (__tree_is_left_child(__x))
- __x = __x->__parent_;
- return __x->__parent_;
+ _NodePtr __xx = static_cast<_NodePtr>(__x);
+ while (__tree_is_left_child(__xx))
+ __xx = __xx->__parent_unsafe();
+ return __xx->__parent_unsafe();
}
// Returns: pointer to a node which has no children
@@ -199,14 +236,14 @@ __tree_left_rotate(_NodePtr __x) _NOEXCEPT
_NodePtr __y = __x->__right_;
__x->__right_ = __y->__left_;
if (__x->__right_ != nullptr)
- __x->__right_->__parent_ = __x;
+ __x->__right_->__set_parent(__x);
__y->__parent_ = __x->__parent_;
if (__tree_is_left_child(__x))
__x->__parent_->__left_ = __y;
else
- __x->__parent_->__right_ = __y;
+ __x->__parent_unsafe()->__right_ = __y;
__y->__left_ = __x;
- __x->__parent_ = __y;
+ __x->__set_parent(__y);
}
// Effects: Makes __x->__left_ the subtree root with __x as its right child
@@ -219,14 +256,14 @@ __tree_right_rotate(_NodePtr __x) _NOEXCEPT
_NodePtr __y = __x->__left_;
__x->__left_ = __y->__right_;
if (__x->__left_ != nullptr)
- __x->__left_->__parent_ = __x;
+ __x->__left_->__set_parent(__x);
__y->__parent_ = __x->__parent_;
if (__tree_is_left_child(__x))
__x->__parent_->__left_ = __y;
else
- __x->__parent_->__right_ = __y;
+ __x->__parent_unsafe()->__right_ = __y;
__y->__right_ = __x;
- __x->__parent_ = __y;
+ __x->__set_parent(__y);
}
// Effects: Rebalances __root after attaching __x to a leaf.
@@ -242,17 +279,17 @@ void
__tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
{
__x->__is_black_ = __x == __root;
- while (__x != __root && !__x->__parent_->__is_black_)
+ while (__x != __root && !__x->__parent_unsafe()->__is_black_)
{
// __x->__parent_ != __root because __x->__parent_->__is_black == false
- if (__tree_is_left_child(__x->__parent_))
+ if (__tree_is_left_child(__x->__parent_unsafe()))
{
- _NodePtr __y = __x->__parent_->__parent_->__right_;
+ _NodePtr __y = __x->__parent_unsafe()->__parent_unsafe()->__right_;
if (__y != nullptr && !__y->__is_black_)
{
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__x->__is_black_ = true;
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__x->__is_black_ = __x == __root;
__y->__is_black_ = true;
}
@@ -260,12 +297,12 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
{
if (!__tree_is_left_child(__x))
{
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__tree_left_rotate(__x);
}
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__x->__is_black_ = true;
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__x->__is_black_ = false;
__tree_right_rotate(__x);
break;
@@ -273,12 +310,12 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
}
else
{
- _NodePtr __y = __x->__parent_->__parent_->__left_;
+ _NodePtr __y = __x->__parent_unsafe()->__parent_->__left_;
if (__y != nullptr && !__y->__is_black_)
{
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__x->__is_black_ = true;
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__x->__is_black_ = __x == __root;
__y->__is_black_ = true;
}
@@ -286,12 +323,12 @@ __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
{
if (__tree_is_left_child(__x))
{
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__tree_right_rotate(__x);
}
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__x->__is_black_ = true;
- __x = __x->__parent_;
+ __x = __x->__parent_unsafe();
__x->__is_black_ = false;
__tree_left_rotate(__x);
break;
@@ -328,13 +365,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
{
__y->__parent_->__left_ = __x;
if (__y != __root)
- __w = __y->__parent_->__right_;
+ __w = __y->__parent_unsafe()->__right_;
else
__root = __x; // __w == nullptr
}
else
{
- __y->__parent_->__right_ = __x;
+ __y->__parent_unsafe()->__right_ = __x;
// __y can't be root if it is a right child
__w = __y->__parent_->__left_;
}
@@ -348,12 +385,12 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
if (__tree_is_left_child(__z))
__y->__parent_->__left_ = __y;
else
- __y->__parent_->__right_ = __y;
+ __y->__parent_unsafe()->__right_ = __y;
__y->__left_ = __z->__left_;
- __y->__left_->__parent_ = __y;
+ __y->__left_->__set_parent(__y);
__y->__right_ = __z->__right_;
if (__y->__right_ != nullptr)
- __y->__right_->__parent_ = __y;
+ __y->__right_->__set_parent(__y);
__y->__is_black_ = __z->__is_black_;
if (__root == __z)
__root = __y;
@@ -390,8 +427,8 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
if (!__w->__is_black_)
{
__w->__is_black_ = true;
- __w->__parent_->__is_black_ = false;
- __tree_left_rotate(__w->__parent_);
+ __w->__parent_unsafe()->__is_black_ = false;
+ __tree_left_rotate(__w->__parent_unsafe());
// __x is still valid
// reset __root only if necessary
if (__root == __w->__left_)
@@ -404,7 +441,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
(__w->__right_ == nullptr || __w->__right_->__is_black_))
{
__w->__is_black_ = false;
- __x = __w->__parent_;
+ __x = __w->__parent_unsafe();
// __x can no longer be null
if (__x == __root || !__x->__is_black_)
{
@@ -413,7 +450,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
}
// reset sibling, and it still can't be null
__w = __tree_is_left_child(__x) ?
- __x->__parent_->__right_ :
+ __x->__parent_unsafe()->__right_ :
__x->__parent_->__left_;
// continue;
}
@@ -427,13 +464,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
__tree_right_rotate(__w);
// __w is known not to be root, so root hasn't changed
// reset sibling, and it still can't be null
- __w = __w->__parent_;
+ __w = __w->__parent_unsafe();
}
// __w has a right red child, left child may be null
- __w->__is_black_ = __w->__parent_->__is_black_;
- __w->__parent_->__is_black_ = true;
+ __w->__is_black_ = __w->__parent_unsafe()->__is_black_;
+ __w->__parent_unsafe()->__is_black_ = true;
__w->__right_->__is_black_ = true;
- __tree_left_rotate(__w->__parent_);
+ __tree_left_rotate(__w->__parent_unsafe());
break;
}
}
@@ -442,8 +479,8 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
if (!__w->__is_black_)
{
__w->__is_black_ = true;
- __w->__parent_->__is_black_ = false;
- __tree_right_rotate(__w->__parent_);
+ __w->__parent_unsafe()->__is_black_ = false;
+ __tree_right_rotate(__w->__parent_unsafe());
// __x is still valid
// reset __root only if necessary
if (__root == __w->__right_)
@@ -456,7 +493,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
(__w->__right_ == nullptr || __w->__right_->__is_black_))
{
__w->__is_black_ = false;
- __x = __w->__parent_;
+ __x = __w->__parent_unsafe();
// __x can no longer be null
if (!__x->__is_black_ || __x == __root)
{
@@ -465,7 +502,7 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
}
// reset sibling, and it still can't be null
__w = __tree_is_left_child(__x) ?
- __x->__parent_->__right_ :
+ __x->__parent_unsafe()->__right_ :
__x->__parent_->__left_;
// continue;
}
@@ -479,13 +516,13 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
__tree_left_rotate(__w);
// __w is known not to be root, so root hasn't changed
// reset sibling, and it still can't be null
- __w = __w->__parent_;
+ __w = __w->__parent_unsafe();
}
// __w has a left red child, right child may be null
- __w->__is_black_ = __w->__parent_->__is_black_;
- __w->__parent_->__is_black_ = true;
+ __w->__is_black_ = __w->__parent_unsafe()->__is_black_;
+ __w->__parent_unsafe()->__is_black_ = true;
__w->__left_->__is_black_ = true;
- __tree_right_rotate(__w->__parent_);
+ __tree_right_rotate(__w->__parent_unsafe());
break;
}
}
@@ -494,41 +531,182 @@ __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
}
}
-template <class _Allocator> class __map_node_destructor;
+// node traits
+
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp>
+struct __is_tree_value_type_imp : false_type {};
+
+template <class _Key, class _Value>
+struct __is_tree_value_type_imp<__value_type<_Key, _Value>> : true_type {};
+
+template <class ..._Args>
+struct __is_tree_value_type : false_type {};
+
+template <class _One>
+struct __is_tree_value_type<_One> : __is_tree_value_type_imp<typename __uncvref<_One>::type> {};
+#endif
+
+template <class _Tp>
+struct __tree_key_value_types {
+ typedef _Tp key_type;
+ typedef _Tp __node_value_type;
+ typedef _Tp __container_value_type;
+ static const bool __is_map = false;
+
+ _LIBCPP_INLINE_VISIBILITY
+ static key_type const& __get_key(_Tp const& __v) {
+ return __v;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type const& __get_value(__node_value_type const& __v) {
+ return __v;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type* __get_ptr(__node_value_type& __n) {
+ return _VSTD::addressof(__n);
+ }
+
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type&& __move(__node_value_type& __v) {
+ return _VSTD::move(__v);
+ }
+#endif
+};
+
+template <class _Key, class _Tp>
+struct __tree_key_value_types<__value_type<_Key, _Tp> > {
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef __value_type<_Key, _Tp> __node_value_type;
+ typedef pair<const _Key, _Tp> __container_value_type;
+ typedef pair<_Key, _Tp> __nc_value_type;
+ typedef __container_value_type __map_value_type;
+ static const bool __is_map = true;
+
+ _LIBCPP_INLINE_VISIBILITY
+ static key_type const&
+ __get_key(__node_value_type const& __t) {
+ return __t.__cc.first;
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static typename enable_if<__is_same_uncvref<_Up, __container_value_type>::value,
+ key_type const&>::type
+ __get_key(_Up& __t) {
+ return __t.first;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type const&
+ __get_value(__node_value_type const& __t) {
+ return __t.__cc;
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static typename enable_if<__is_same_uncvref<_Up, __container_value_type>::value,
+ __container_value_type const&>::type
+ __get_value(_Up& __t) {
+ return __t;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static __container_value_type* __get_ptr(__node_value_type& __n) {
+ return _VSTD::addressof(__n.__cc);
+ }
+
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ static __nc_value_type&& __move(__node_value_type& __v) {
+ return _VSTD::move(__v.__nc);
+ }
+#endif
+};
+
+template <class _VoidPtr>
+struct __tree_node_base_types {
+ typedef _VoidPtr __void_pointer;
+
+ typedef __tree_node_base<__void_pointer> __node_base_type;
+ typedef typename __rebind_pointer<_VoidPtr, __node_base_type>::type
+ __node_base_pointer;
+
+ typedef __tree_end_node<__node_base_pointer> __end_node_type;
+ typedef typename __rebind_pointer<_VoidPtr, __end_node_type>::type
+ __end_node_pointer;
+#if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB)
+ typedef __end_node_pointer __parent_pointer;
+#else
+ typedef typename conditional<
+ is_pointer<__end_node_pointer>::value,
+ __end_node_pointer,
+ __node_base_pointer>::type __parent_pointer;
+#endif
-template <class _Allocator>
-class __tree_node_destructor
-{
- typedef _Allocator allocator_type;
- typedef allocator_traits<allocator_type> __alloc_traits;
- typedef typename __alloc_traits::value_type::value_type value_type;
-public:
- typedef typename __alloc_traits::pointer pointer;
private:
+ static_assert((is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value),
+ "_VoidPtr does not point to unqualified void type");
+};
- allocator_type& __na_;
+template <class _Tp, class _AllocPtr, class _KVTypes = __tree_key_value_types<_Tp>,
+ bool = _KVTypes::__is_map>
+struct __tree_map_pointer_types {};
+
+template <class _Tp, class _AllocPtr, class _KVTypes>
+struct __tree_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
+ typedef typename _KVTypes::__map_value_type _Mv;
+ typedef typename __rebind_pointer<_AllocPtr, _Mv>::type
+ __map_value_type_pointer;
+ typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type
+ __const_map_value_type_pointer;
+};
- __tree_node_destructor& operator=(const __tree_node_destructor&);
+template <class _NodePtr, class _NodeT = typename pointer_traits<_NodePtr>::element_type>
+struct __tree_node_types;
+template <class _NodePtr, class _Tp, class _VoidPtr>
+struct __tree_node_types<_NodePtr, __tree_node<_Tp, _VoidPtr> >
+ : public __tree_node_base_types<_VoidPtr>,
+ __tree_key_value_types<_Tp>,
+ __tree_map_pointer_types<_Tp, _VoidPtr>
+{
+ typedef __tree_node_base_types<_VoidPtr> __base;
+ typedef __tree_key_value_types<_Tp> __key_base;
+ typedef __tree_map_pointer_types<_Tp, _VoidPtr> __map_pointer_base;
public:
- bool __value_constructed;
- _LIBCPP_INLINE_VISIBILITY
- explicit __tree_node_destructor(allocator_type& __na, bool __val = false) _NOEXCEPT
- : __na_(__na),
- __value_constructed(__val)
- {}
+ typedef typename pointer_traits<_NodePtr>::element_type __node_type;
+ typedef _NodePtr __node_pointer;
- _LIBCPP_INLINE_VISIBILITY
- void operator()(pointer __p) _NOEXCEPT
- {
- if (__value_constructed)
- __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
- if (__p)
- __alloc_traits::deallocate(__na_, __p, 1);
- }
+ typedef _Tp __node_value_type;
+ typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type
+ __node_value_type_pointer;
+ typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
+ __const_node_value_type_pointer;
+#if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB)
+ typedef typename __base::__end_node_pointer __iter_pointer;
+#else
+ typedef typename conditional<
+ is_pointer<__node_pointer>::value,
+ typename __base::__end_node_pointer,
+ __node_pointer>::type __iter_pointer;
+#endif
+private:
+ static_assert(!is_const<__node_type>::value,
+ "_NodePtr should never be a pointer to const");
+ static_assert((is_same<typename __rebind_pointer<_VoidPtr, __node_type>::type,
+ _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");
+};
- template <class> friend class __map_node_destructor;
+template <class _ValueTp, class _VoidPtr>
+struct __make_tree_node_types {
+ typedef typename __rebind_pointer<_VoidPtr, __tree_node<_ValueTp, _VoidPtr> >::type
+ _NodePtr;
+ typedef __tree_node_types<_NodePtr> type;
};
// node
@@ -546,42 +724,30 @@ public:
template <class _VoidPtr>
class __tree_node_base
- : public __tree_end_node
- <
- typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__tree_node_base<_VoidPtr> >
-#else
- rebind<__tree_node_base<_VoidPtr> >::other
-#endif
- >
+ : public __tree_node_base_types<_VoidPtr>::__end_node_type
{
- __tree_node_base(const __tree_node_base&);
- __tree_node_base& operator=(const __tree_node_base&);
+ typedef __tree_node_base_types<_VoidPtr> _NodeBaseTypes;
+
public:
- typedef typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__tree_node_base>
-#else
- rebind<__tree_node_base>::other
-#endif
- pointer;
- typedef typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const __tree_node_base>
-#else
- rebind<const __tree_node_base>::other
-#endif
- const_pointer;
- typedef __tree_end_node<pointer> base;
+ typedef typename _NodeBaseTypes::__node_base_pointer pointer;
+ typedef typename _NodeBaseTypes::__parent_pointer __parent_pointer;
- pointer __right_;
- pointer __parent_;
+ pointer __right_;
+ __parent_pointer __parent_;
bool __is_black_;
_LIBCPP_INLINE_VISIBILITY
- __tree_node_base() _NOEXCEPT
- : __right_(), __parent_(), __is_black_(false) {}
+ pointer __parent_unsafe() const { return static_cast<pointer>(__parent_);}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void __set_parent(pointer __p) {
+ __parent_ = static_cast<__parent_pointer>(__p);
+ }
+
+private:
+ ~__tree_node_base() _LIBCPP_EQUAL_DELETE;
+ __tree_node_base(__tree_node_base const&) _LIBCPP_EQUAL_DELETE;
+ __tree_node_base& operator=(__tree_node_base const&) _LIBCPP_EQUAL_DELETE;
};
template <class _Tp, class _VoidPtr>
@@ -589,47 +755,71 @@ class __tree_node
: public __tree_node_base<_VoidPtr>
{
public:
- typedef __tree_node_base<_VoidPtr> base;
- typedef _Tp value_type;
+ typedef _Tp __node_value_type;
- value_type __value_;
+ __node_value_type __value_;
+
+private:
+ ~__tree_node() _LIBCPP_EQUAL_DELETE;
+ __tree_node(__tree_node const&) _LIBCPP_EQUAL_DELETE;
+ __tree_node& operator=(__tree_node const&) _LIBCPP_EQUAL_DELETE;
+};
+
+
+template <class _Allocator>
+class __tree_node_destructor
+{
+ typedef _Allocator allocator_type;
+ typedef allocator_traits<allocator_type> __alloc_traits;
+
+public:
+ typedef typename __alloc_traits::pointer pointer;
+private:
+ typedef __tree_node_types<pointer> _NodeTypes;
+ allocator_type& __na_;
+
+ __tree_node_destructor& operator=(const __tree_node_destructor&);
+
+public:
+ bool __value_constructed;
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __tree_node_destructor(allocator_type& __na, bool __val = false) _NOEXCEPT
+ : __na_(__na),
+ __value_constructed(__val)
+ {}
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- explicit __tree_node(_Args&& ...__args)
- : __value_(_VSTD::forward<_Args>(__args)...) {}
-#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
_LIBCPP_INLINE_VISIBILITY
- explicit __tree_node(const value_type& __v)
- : __value_(__v) {}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+ void operator()(pointer __p) _NOEXCEPT
+ {
+ if (__value_constructed)
+ __alloc_traits::destroy(__na_, _NodeTypes::__get_ptr(__p->__value_));
+ if (__p)
+ __alloc_traits::deallocate(__na_, __p, 1);
+ }
+
+ template <class> friend class __map_node_destructor;
};
-template <class _TreeIterator> class _LIBCPP_TYPE_VIS_ONLY __map_iterator;
-template <class _TreeIterator> class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator;
template <class _Tp, class _NodePtr, class _DiffType>
-class _LIBCPP_TYPE_VIS_ONLY __tree_iterator
+class _LIBCPP_TEMPLATE_VIS __tree_iterator
{
- typedef _NodePtr __node_pointer;
- typedef typename pointer_traits<__node_pointer>::element_type __node;
+ typedef __tree_node_types<_NodePtr> _NodeTypes;
+ typedef _NodePtr __node_pointer;
+ typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;
+ typedef typename _NodeTypes::__end_node_pointer __end_node_pointer;
+ typedef typename _NodeTypes::__iter_pointer __iter_pointer;
+ typedef pointer_traits<__node_pointer> __pointer_traits;
- __node_pointer __ptr_;
+ __iter_pointer __ptr_;
- typedef pointer_traits<__node_pointer> __pointer_traits;
public:
- typedef bidirectional_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _DiffType difference_type;
- typedef value_type& reference;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _DiffType difference_type;
+ typedef value_type& reference;
+ typedef typename _NodeTypes::__node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
@@ -637,14 +827,15 @@ public:
#endif
{}
- _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
+ _LIBCPP_INLINE_VISIBILITY reference operator*() const
+ {return __get_np()->__value_;}
_LIBCPP_INLINE_VISIBILITY pointer operator->() const
- {return pointer_traits<pointer>::pointer_to(__ptr_->__value_);}
+ {return pointer_traits<pointer>::pointer_to(__get_np()->__value_);}
_LIBCPP_INLINE_VISIBILITY
__tree_iterator& operator++() {
- __ptr_ = static_cast<__node_pointer>(
- __tree_next(static_cast<typename __node::base::pointer>(__ptr_)));
+ __ptr_ = static_cast<__iter_pointer>(
+ __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
return *this;
}
_LIBCPP_INLINE_VISIBILITY
@@ -653,8 +844,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
__tree_iterator& operator--() {
- __ptr_ = static_cast<__node_pointer>(
- __tree_prev(static_cast<typename __node::base::pointer>(__ptr_)));
+ __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>(
+ static_cast<__end_node_pointer>(__ptr_)));
return *this;
}
_LIBCPP_INLINE_VISIBILITY
@@ -671,36 +862,37 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY
explicit __tree_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __tree_iterator(__end_node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY
+ __node_pointer __get_np() const { return static_cast<__node_pointer>(__ptr_); }
template <class, class, class> friend class __tree;
- template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __map_iterator;
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY map;
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multimap;
- template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY set;
- template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multiset;
+ template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS __tree_const_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __map_iterator;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
+ template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS set;
+ template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS multiset;
};
-template <class _Tp, class _ConstNodePtr, class _DiffType>
-class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator
+template <class _Tp, class _NodePtr, class _DiffType>
+class _LIBCPP_TEMPLATE_VIS __tree_const_iterator
{
- typedef _ConstNodePtr __node_pointer;
- typedef typename pointer_traits<__node_pointer>::element_type __node;
+ typedef __tree_node_types<_NodePtr> _NodeTypes;
+ typedef typename _NodeTypes::__node_pointer __node_pointer;
+ typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;
+ typedef typename _NodeTypes::__end_node_pointer __end_node_pointer;
+ typedef typename _NodeTypes::__iter_pointer __iter_pointer;
+ typedef pointer_traits<__node_pointer> __pointer_traits;
- __node_pointer __ptr_;
+ __iter_pointer __ptr_;
- typedef pointer_traits<__node_pointer> __pointer_traits;
public:
- typedef bidirectional_iterator_tag iterator_category;
- typedef _Tp value_type;
- typedef _DiffType difference_type;
- typedef const value_type& reference;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
- pointer;
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef _Tp value_type;
+ typedef _DiffType difference_type;
+ typedef const value_type& reference;
+ typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY __tree_const_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
@@ -709,37 +901,22 @@ public:
{}
private:
- typedef typename remove_const<__node>::type __non_const_node;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__non_const_node>
-#else
- rebind<__non_const_node>::other
-#endif
- __non_const_node_pointer;
- typedef __tree_iterator<value_type, __non_const_node_pointer, difference_type>
- __non_const_iterator;
+ typedef __tree_iterator<value_type, __node_pointer, difference_type>
+ __non_const_iterator;
public:
_LIBCPP_INLINE_VISIBILITY
__tree_const_iterator(__non_const_iterator __p) _NOEXCEPT
: __ptr_(__p.__ptr_) {}
- _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
+ _LIBCPP_INLINE_VISIBILITY reference operator*() const
+ {return __get_np()->__value_;}
_LIBCPP_INLINE_VISIBILITY pointer operator->() const
- {return pointer_traits<pointer>::pointer_to(__ptr_->__value_);}
+ {return pointer_traits<pointer>::pointer_to(__get_np()->__value_);}
_LIBCPP_INLINE_VISIBILITY
__tree_const_iterator& operator++() {
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<typename __node::base>
-#else
- rebind<typename __node::base>::other
-#endif
- __node_base_pointer;
-
- __ptr_ = static_cast<__node_pointer>(
- __tree_next(static_cast<__node_base_pointer>(__ptr_)));
+ __ptr_ = static_cast<__iter_pointer>(
+ __tree_next_iter<__end_node_pointer>(static_cast<__node_base_pointer>(__ptr_)));
return *this;
}
@@ -749,16 +926,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
__tree_const_iterator& operator--() {
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<typename __node::base>
-#else
- rebind<typename __node::base>::other
-#endif
- __node_base_pointer;
-
- __ptr_ = static_cast<__node_pointer>(
- __tree_prev(static_cast<__node_base_pointer>(__ptr_)));
+ __ptr_ = static_cast<__iter_pointer>(__tree_prev_iter<__node_base_pointer>(
+ static_cast<__end_node_pointer>(__ptr_)));
return *this;
}
@@ -777,13 +946,39 @@ private:
_LIBCPP_INLINE_VISIBILITY
explicit __tree_const_iterator(__node_pointer __p) _NOEXCEPT
: __ptr_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __tree_const_iterator(__end_node_pointer __p) _NOEXCEPT
+ : __ptr_(__p) {}
+ _LIBCPP_INLINE_VISIBILITY
+ __node_pointer __get_np() const { return static_cast<__node_pointer>(__ptr_); }
+
template <class, class, class> friend class __tree;
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY map;
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multimap;
- template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY set;
- template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multiset;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
+ template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS set;
+ template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS multiset;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __map_const_iterator;
+
+};
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp, class _Compare, class _Allocator>
+struct __diagnose_tree_helper {
+ static constexpr bool __trigger_diagnostics()
+ _LIBCPP_DIAGNOSE_WARNING(!__invokable<_Compare const&, _Tp const&, _Tp const&>::value,
+ "the specified comparator type does not provide a const call operator")
+ { return true; }
+};
+
+template <class _Key, class _Value, class _KeyComp, class _Alloc>
+struct __diagnose_tree_helper<
+ __value_type<_Key, _Value>,
+ __map_value_compare<_Key, __value_type<_Key, _Value>, _KeyComp>,
+ _Alloc
+> : __diagnose_tree_helper<_Key, _KeyComp, _Alloc>
+{
};
+#endif // !_LIBCPP_CXX03_LANG
template <class _Tp, class _Compare, class _Allocator>
class __tree
@@ -792,59 +987,73 @@ public:
typedef _Tp value_type;
typedef _Compare value_compare;
typedef _Allocator allocator_type;
+
+private:
typedef allocator_traits<allocator_type> __alloc_traits;
+ typedef typename __make_tree_node_types<value_type,
+ typename __alloc_traits::void_pointer>::type
+ _NodeTypes;
+ typedef typename _NodeTypes::key_type key_type;
+public:
+ typedef typename _NodeTypes::__node_value_type __node_value_type;
+ typedef typename _NodeTypes::__container_value_type __container_value_type;
+
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
typedef typename __alloc_traits::size_type size_type;
typedef typename __alloc_traits::difference_type difference_type;
- typedef typename __alloc_traits::void_pointer __void_pointer;
+public:
+ typedef typename _NodeTypes::__void_pointer __void_pointer;
+
+ typedef typename _NodeTypes::__node_type __node;
+ typedef typename _NodeTypes::__node_pointer __node_pointer;
+
+ typedef typename _NodeTypes::__node_base_type __node_base;
+ typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;
+
+ typedef typename _NodeTypes::__end_node_type __end_node_t;
+ typedef typename _NodeTypes::__end_node_pointer __end_node_ptr;
+
+ typedef typename _NodeTypes::__parent_pointer __parent_pointer;
+ typedef typename _NodeTypes::__iter_pointer __iter_pointer;
- typedef __tree_node<value_type, __void_pointer> __node;
- typedef __tree_node_base<__void_pointer> __node_base;
typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator;
- typedef allocator_traits<__node_allocator> __node_traits;
- typedef typename __node_traits::pointer __node_pointer;
- typedef typename __node_traits::pointer __node_const_pointer;
- typedef typename __node_base::pointer __node_base_pointer;
- typedef typename __node_base::pointer __node_base_const_pointer;
+ typedef allocator_traits<__node_allocator> __node_traits;
+
private:
- typedef typename __node_base::base __end_node_t;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__end_node_t>
-#else
- rebind<__end_node_t>::other
-#endif
- __end_node_ptr;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__end_node_t>
-#else
- rebind<__end_node_t>::other
-#endif
- __end_node_const_ptr;
+ // check for sane allocator pointer rebinding semantics. Rebinding the
+ // allocator for a new pointer type should be exactly the same as rebinding
+ // the pointer using 'pointer_traits'.
+ static_assert((is_same<__node_pointer, typename __node_traits::pointer>::value),
+ "Allocator does not rebind pointers in a sane manner.");
+ typedef typename __rebind_alloc_helper<__node_traits, __node_base>::type
+ __node_base_allocator;
+ typedef allocator_traits<__node_base_allocator> __node_base_traits;
+ static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value),
+ "Allocator does not rebind pointers in a sane manner.");
- __node_pointer __begin_node_;
+private:
+ __iter_pointer __begin_node_;
__compressed_pair<__end_node_t, __node_allocator> __pair1_;
__compressed_pair<size_type, value_compare> __pair3_;
public:
_LIBCPP_INLINE_VISIBILITY
- __node_pointer __end_node() _NOEXCEPT
+ __iter_pointer __end_node() _NOEXCEPT
{
- return static_cast<__node_pointer>
- (
- pointer_traits<__end_node_ptr>::pointer_to(__pair1_.first())
- );
+ return static_cast<__iter_pointer>(
+ pointer_traits<__end_node_ptr>::pointer_to(__pair1_.first())
+ );
}
_LIBCPP_INLINE_VISIBILITY
- __node_const_pointer __end_node() const _NOEXCEPT
+ __iter_pointer __end_node() const _NOEXCEPT
{
- return static_cast<__node_const_pointer>
- (
- pointer_traits<__end_node_const_ptr>::pointer_to(const_cast<__end_node_t&>(__pair1_.first()))
- );
+ return static_cast<__iter_pointer>(
+ pointer_traits<__end_node_ptr>::pointer_to(
+ const_cast<__end_node_t&>(__pair1_.first())
+ )
+ );
}
_LIBCPP_INLINE_VISIBILITY
__node_allocator& __node_alloc() _NOEXCEPT {return __pair1_.second();}
@@ -853,9 +1062,9 @@ private:
const __node_allocator& __node_alloc() const _NOEXCEPT
{return __pair1_.second();}
_LIBCPP_INLINE_VISIBILITY
- __node_pointer& __begin_node() _NOEXCEPT {return __begin_node_;}
+ __iter_pointer& __begin_node() _NOEXCEPT {return __begin_node_;}
_LIBCPP_INLINE_VISIBILITY
- const __node_pointer& __begin_node() const _NOEXCEPT {return __begin_node_;}
+ const __iter_pointer& __begin_node() const _NOEXCEPT {return __begin_node_;}
public:
_LIBCPP_INLINE_VISIBILITY
allocator_type __alloc() const _NOEXCEPT
@@ -872,12 +1081,14 @@ public:
const value_compare& value_comp() const _NOEXCEPT
{return __pair3_.second();}
public:
+
_LIBCPP_INLINE_VISIBILITY
- __node_pointer __root() _NOEXCEPT
- {return static_cast<__node_pointer> (__end_node()->__left_);}
- _LIBCPP_INLINE_VISIBILITY
- __node_const_pointer __root() const _NOEXCEPT
- {return static_cast<__node_const_pointer>(__end_node()->__left_);}
+ __node_pointer __root() const _NOEXCEPT
+ {return static_cast<__node_pointer>(__end_node()->__left_);}
+
+ __node_base_pointer* __root_ptr() const _NOEXCEPT {
+ return _VSTD::addressof(__end_node()->__left_);
+ }
typedef __tree_iterator<value_type, __node_pointer, difference_type> iterator;
typedef __tree_const_iterator<value_type, __node_pointer, difference_type> const_iterator;
@@ -894,7 +1105,7 @@ public:
void __assign_unique(_InputIterator __first, _InputIterator __last);
template <class _InputIterator>
void __assign_multi(_InputIterator __first, _InputIterator __last);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
__tree(__tree&& __t)
_NOEXCEPT_(
is_nothrow_move_constructible<__node_allocator>::value &&
@@ -905,7 +1116,7 @@ public:
__node_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<value_compare>::value &&
is_nothrow_move_assignable<__node_allocator>::value);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
~__tree();
@@ -920,50 +1131,210 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
- {return __node_traits::max_size(__node_alloc());}
+ {return std::min<size_type>(
+ __node_traits::max_size(__node_alloc()),
+ numeric_limits<difference_type >::max());}
void clear() _NOEXCEPT;
void swap(__tree& __t)
+#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<value_compare>::value
-#if _LIBCPP_STD_VER <= 11
&& (!__node_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
-#endif
);
+#else
+ _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value);
+#endif
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _Key, class ..._Args>
+ pair<iterator, bool>
+ __emplace_unique_key_args(_Key const&, _Args&&... __args);
+ template <class _Key, class ..._Args>
+ iterator
+ __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&&...);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
- pair<iterator, bool>
- __emplace_unique(_Args&&... __args);
+ pair<iterator, bool> __emplace_unique_impl(_Args&&... __args);
+
template <class... _Args>
- iterator
- __emplace_multi(_Args&&... __args);
+ iterator __emplace_hint_unique_impl(const_iterator __p, _Args&&... __args);
template <class... _Args>
- iterator
- __emplace_hint_unique(const_iterator __p, _Args&&... __args);
+ iterator __emplace_multi(_Args&&... __args);
+
+ template <class... _Args>
+ iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __emplace_unique(_Pp&& __x) {
+ return __emplace_unique_extract_key(_VSTD::forward<_Pp>(__x),
+ __can_extract_key<_Pp, key_type>());
+ }
+
+ template <class _First, class _Second>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<
+ __can_extract_map_key<_First, key_type, __container_value_type>::value,
+ pair<iterator, bool>
+ >::type __emplace_unique(_First&& __f, _Second&& __s) {
+ return __emplace_unique_key_args(__f, _VSTD::forward<_First>(__f),
+ _VSTD::forward<_Second>(__s));
+ }
+
template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __emplace_unique(_Args&&... __args) {
+ return __emplace_unique_impl(_VSTD::forward<_Args>(__args)...);
+ }
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) {
+ return __emplace_unique_impl(_VSTD::forward<_Pp>(__x));
+ }
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) {
+ return __emplace_unique_key_args(__x, _VSTD::forward<_Pp>(__x));
+ }
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) {
+ return __emplace_unique_key_args(__x.first, _VSTD::forward<_Pp>(__x));
+ }
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __emplace_hint_unique(const_iterator __p, _Pp&& __x) {
+ return __emplace_hint_unique_extract_key(__p, _VSTD::forward<_Pp>(__x),
+ __can_extract_key<_Pp, key_type>());
+ }
+
+ template <class _First, class _Second>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<
+ __can_extract_map_key<_First, key_type, __container_value_type>::value,
iterator
- __emplace_hint_multi(const_iterator __p, _Args&&... __args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
+ >::type __emplace_hint_unique(const_iterator __p, _First&& __f, _Second&& __s) {
+ return __emplace_hint_unique_key_args(__p, __f,
+ _VSTD::forward<_First>(__f),
+ _VSTD::forward<_Second>(__s));
+ }
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __emplace_hint_unique(const_iterator __p, _Args&&... __args) {
+ return __emplace_hint_unique_impl(__p, _VSTD::forward<_Args>(__args)...);
+ }
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator
+ __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_fail_tag) {
+ return __emplace_hint_unique_impl(__p, _VSTD::forward<_Pp>(__x));
+ }
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator
+ __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_self_tag) {
+ return __emplace_hint_unique_key_args(__p, __x, _VSTD::forward<_Pp>(__x));
+ }
+
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator
+ __emplace_hint_unique_extract_key(const_iterator __p, _Pp&& __x, __extract_key_first_tag) {
+ return __emplace_hint_unique_key_args(__p, __x.first, _VSTD::forward<_Pp>(__x));
+ }
+
+#else
+ template <class _Key, class _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args& __args);
+ template <class _Key, class _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __emplace_hint_unique_key_args(const_iterator, _Key const&, _Args&);
+#endif
+
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __insert_unique(const __container_value_type& __v) {
+ return __emplace_unique_key_args(_NodeTypes::__get_key(__v), __v);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_unique(const_iterator __p, const __container_value_type& __v) {
+ return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), __v);
+ }
+
+#ifdef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_multi(const __container_value_type& __v);
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_multi(const_iterator __p, const __container_value_type& __v);
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __insert_unique(__container_value_type&& __v) {
+ return __emplace_unique_key_args(_NodeTypes::__get_key(__v), _VSTD::move(__v));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_unique(const_iterator __p, __container_value_type&& __v) {
+ return __emplace_hint_unique_key_args(__p, _NodeTypes::__get_key(__v), _VSTD::move(__v));
+ }
+
+ template <class _Vp, class = typename enable_if<
+ !is_same<typename __unconstref<_Vp>::type,
+ __container_value_type
+ >::value
+ >::type>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> __insert_unique(_Vp&& __v) {
+ return __emplace_unique(_VSTD::forward<_Vp>(__v));
+ }
+
+ template <class _Vp, class = typename enable_if<
+ !is_same<typename __unconstref<_Vp>::type,
+ __container_value_type
+ >::value
+ >::type>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_unique(const_iterator __p, _Vp&& __v) {
+ return __emplace_hint_unique(__p, _VSTD::forward<_Vp>(__v));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_multi(__container_value_type&& __v) {
+ return __emplace_multi(_VSTD::move(__v));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_multi(const_iterator __p, __container_value_type&& __v) {
+ return __emplace_hint_multi(__p, _VSTD::move(__v));
+ }
template <class _Vp>
- pair<iterator, bool> __insert_unique(_Vp&& __v);
- template <class _Vp>
- iterator __insert_unique(const_iterator __p, _Vp&& __v);
- template <class _Vp>
- iterator __insert_multi(_Vp&& __v);
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_multi(_Vp&& __v) {
+ return __emplace_multi(_VSTD::forward<_Vp>(__v));
+ }
+
template <class _Vp>
- iterator __insert_multi(const_iterator __p, _Vp&& __v);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ iterator __insert_multi(const_iterator __p, _Vp&& __v) {
+ return __emplace_hint_multi(__p, _VSTD::forward<_Vp>(__v));
+ }
- pair<iterator, bool> __insert_unique(const value_type& __v);
- iterator __insert_unique(const_iterator __p, const value_type& __v);
- iterator __insert_multi(const value_type& __v);
- iterator __insert_multi(const_iterator __p, const value_type& __v);
+#endif // !_LIBCPP_CXX03_LANG
pair<iterator, bool> __node_insert_unique(__node_pointer __nd);
iterator __node_insert_unique(const_iterator __p,
@@ -979,7 +1350,7 @@ public:
template <class _Key>
size_type __erase_multi(const _Key& __k);
- void __insert_node_at(__node_base_pointer __parent,
+ void __insert_node_at(__parent_pointer __parent,
__node_base_pointer& __child,
__node_base_pointer __new_node);
@@ -1000,15 +1371,15 @@ public:
template <class _Key>
iterator __lower_bound(const _Key& __v,
__node_pointer __root,
- __node_pointer __result);
+ __iter_pointer __result);
template <class _Key>
_LIBCPP_INLINE_VISIBILITY
const_iterator lower_bound(const _Key& __v) const
{return __lower_bound(__v, __root(), __end_node());}
template <class _Key>
const_iterator __lower_bound(const _Key& __v,
- __node_const_pointer __root,
- __node_const_pointer __result) const;
+ __node_pointer __root,
+ __iter_pointer __result) const;
template <class _Key>
_LIBCPP_INLINE_VISIBILITY
iterator upper_bound(const _Key& __v)
@@ -1016,15 +1387,15 @@ public:
template <class _Key>
iterator __upper_bound(const _Key& __v,
__node_pointer __root,
- __node_pointer __result);
+ __iter_pointer __result);
template <class _Key>
_LIBCPP_INLINE_VISIBILITY
const_iterator upper_bound(const _Key& __v) const
{return __upper_bound(__v, __root(), __end_node());}
template <class _Key>
const_iterator __upper_bound(const _Key& __v,
- __node_const_pointer __root,
- __node_const_pointer __result) const;
+ __node_pointer __root,
+ __iter_pointer __result) const;
template <class _Key>
pair<iterator, iterator>
__equal_range_unique(const _Key& __k);
@@ -1044,26 +1415,34 @@ public:
__node_holder remove(const_iterator __p) _NOEXCEPT;
private:
- typename __node_base::pointer&
- __find_leaf_low(typename __node_base::pointer& __parent, const value_type& __v);
- typename __node_base::pointer&
- __find_leaf_high(typename __node_base::pointer& __parent, const value_type& __v);
- typename __node_base::pointer&
+ __node_base_pointer&
+ __find_leaf_low(__parent_pointer& __parent, const key_type& __v);
+ __node_base_pointer&
+ __find_leaf_high(__parent_pointer& __parent, const key_type& __v);
+ __node_base_pointer&
__find_leaf(const_iterator __hint,
- typename __node_base::pointer& __parent, const value_type& __v);
+ __parent_pointer& __parent, const key_type& __v);
+ // FIXME: Make this function const qualified. Unfortunetly doing so
+ // breaks existing code which uses non-const callable comparators.
template <class _Key>
- typename __node_base::pointer&
- __find_equal(typename __node_base::pointer& __parent, const _Key& __v);
+ __node_base_pointer&
+ __find_equal(__parent_pointer& __parent, const _Key& __v);
template <class _Key>
- typename __node_base::pointer&
- __find_equal(const_iterator __hint, typename __node_base::pointer& __parent,
+ _LIBCPP_INLINE_VISIBILITY __node_base_pointer&
+ __find_equal(__parent_pointer& __parent, const _Key& __v) const {
+ return const_cast<__tree*>(this)->__find_equal(__parent, __v);
+ }
+ template <class _Key>
+ __node_base_pointer&
+ __find_equal(const_iterator __hint, __parent_pointer& __parent,
+ __node_base_pointer& __dummy,
const _Key& __v);
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
template <class ..._Args>
- __node_holder __construct_node(_Args&& ...__args);
-#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- __node_holder __construct_node(const value_type& __v);
+ __node_holder __construct_node(_Args&& ...__args);
+#else
+ __node_holder __construct_node(const __container_value_type& __v);
#endif
void destroy(__node_pointer __nd) _NOEXCEPT;
@@ -1075,9 +1454,13 @@ private:
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __tree& __t, true_type)
- {__node_alloc() = __t.__node_alloc();}
+ {
+ if (__node_alloc() != __t.__node_alloc())
+ clear();
+ __node_alloc() = __t.__node_alloc();
+ }
_LIBCPP_INLINE_VISIBILITY
- void __copy_assign_alloc(const __tree& __t, false_type) {}
+ void __copy_assign_alloc(const __tree&, false_type) {}
void __move_assign(__tree& __t, false_type);
void __move_assign(__tree& __t, true_type)
@@ -1097,13 +1480,13 @@ private:
_NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
{__node_alloc() = _VSTD::move(__t.__node_alloc());}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__tree& __t, false_type) _NOEXCEPT {}
+ void __move_assign_alloc(__tree&, false_type) _NOEXCEPT {}
__node_pointer __detach();
static __node_pointer __detach(__node_pointer);
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY map;
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multimap;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
};
template <class _Tp, class _Compare, class _Allocator>
@@ -1118,8 +1501,8 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp)
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
- : __begin_node_(__node_pointer()),
- __pair1_(__node_allocator(__a)),
+ : __begin_node_(__iter_pointer()),
+ __pair1_(__second_tag(), __node_allocator(__a)),
__pair3_(0)
{
__begin_node() = __end_node();
@@ -1128,8 +1511,8 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp,
const allocator_type& __a)
- : __begin_node_(__node_pointer()),
- __pair1_(__node_allocator(__a)),
+ : __begin_node_(__iter_pointer()),
+ __pair1_(__second_tag(), __node_allocator(__a)),
__pair3_(0, __comp)
{
__begin_node() = __end_node();
@@ -1140,7 +1523,7 @@ template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_pointer
__tree<_Tp, _Compare, _Allocator>::__detach()
{
- __node_pointer __cache = __begin_node();
+ __node_pointer __cache = static_cast<__node_pointer>(__begin_node());
__begin_node() = __end_node();
__end_node()->__left_->__parent_ = nullptr;
__end_node()->__left_ = nullptr;
@@ -1172,7 +1555,7 @@ __tree<_Tp, _Compare, _Allocator>::__detach(__node_pointer __cache)
return static_cast<__node_pointer>(__tree_leaf(__cache->__right_));
}
// __cache is right child
- __cache->__parent_->__right_ = nullptr;
+ __cache->__parent_unsafe()->__right_ = nullptr;
__cache = static_cast<__node_pointer>(__cache->__parent_);
if (__cache->__left_ == nullptr)
return __cache;
@@ -1197,6 +1580,11 @@ template <class _InputIterator>
void
__tree<_Tp, _Compare, _Allocator>::__assign_unique(_InputIterator __first, _InputIterator __last)
{
+ typedef iterator_traits<_InputIterator> _ITraits;
+ typedef typename _ITraits::value_type _ItValueType;
+ static_assert((is_same<_ItValueType, __container_value_type>::value),
+ "__assign_unique may only be called with the containers value type");
+
if (size() != 0)
{
__node_pointer __cache = __detach();
@@ -1237,6 +1625,12 @@ template <class _InputIterator>
void
__tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _InputIterator __last)
{
+ typedef iterator_traits<_InputIterator> _ITraits;
+ typedef typename _ITraits::value_type _ItValueType;
+ static_assert((is_same<_ItValueType, __container_value_type>::value ||
+ is_same<_ItValueType, __node_value_type>::value),
+ "__assign_multi may only be called with the containers value type"
+ " or the nodes value type");
if (size() != 0)
{
__node_pointer __cache = __detach();
@@ -1269,19 +1663,19 @@ __tree<_Tp, _Compare, _Allocator>::__assign_multi(_InputIterator __first, _Input
}
}
for (; __first != __last; ++__first)
- __insert_multi(*__first);
+ __insert_multi(_NodeTypes::__get_value(*__first));
}
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
- : __begin_node_(__node_pointer()),
- __pair1_(__node_traits::select_on_container_copy_construction(__t.__node_alloc())),
+ : __begin_node_(__iter_pointer()),
+ __pair1_(__second_tag(), __node_traits::select_on_container_copy_construction(__t.__node_alloc())),
__pair3_(0, __t.value_comp())
{
__begin_node() = __end_node();
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
@@ -1296,7 +1690,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
__begin_node() = __end_node();
else
{
- __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
+ __end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__end_node());
__t.__begin_node() = __t.__end_node();
__t.__end_node()->__left_ = nullptr;
__t.size() = 0;
@@ -1305,7 +1699,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
- : __pair1_(__node_allocator(__a)),
+ : __pair1_(__second_tag(), __node_allocator(__a)),
__pair3_(0, _VSTD::move(__t.value_comp()))
{
if (__a == __t.__alloc())
@@ -1316,7 +1710,7 @@ __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __
{
__begin_node() = __t.__begin_node();
__end_node()->__left_ = __t.__end_node()->__left_;
- __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
+ __end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__end_node());
size() = __t.size();
__t.__begin_node() = __t.__end_node();
__t.__end_node()->__left_ = nullptr;
@@ -1344,7 +1738,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, true_type)
__begin_node() = __end_node();
else
{
- __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
+ __end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__end_node());
__t.__begin_node() = __t.__end_node();
__t.__end_node()->__left_ = nullptr;
__t.size() = 0;
@@ -1393,7 +1787,7 @@ __tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type)
}
}
while (__t.size() != 0)
- __insert_multi(__e, _VSTD::move(__t.remove(__t.begin())->__value_));
+ __insert_multi(__e, _NodeTypes::__move(__t.remove(__t.begin())->__value_));
}
}
@@ -1411,12 +1805,18 @@ __tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::~__tree()
{
- destroy(__root());
+ static_assert((is_copy_constructible<value_compare>::value),
+ "Comparator must be copy-constructible.");
+#ifndef _LIBCPP_CXX03_LANG
+ static_assert((__diagnose_tree_helper<_Tp, _Compare, _Allocator>::
+ __trigger_diagnostics()), "");
+#endif
+ destroy(__root());
}
template <class _Tp, class _Compare, class _Allocator>
@@ -1428,7 +1828,7 @@ __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT
destroy(static_cast<__node_pointer>(__nd->__left_));
destroy(static_cast<__node_pointer>(__nd->__right_));
__node_allocator& __na = __node_alloc();
- __node_traits::destroy(__na, _VSTD::addressof(__nd->__value_));
+ __node_traits::destroy(__na, _NodeTypes::__get_ptr(__nd->__value_));
__node_traits::deallocate(__na, __nd, 1);
}
}
@@ -1436,13 +1836,15 @@ __tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT
template <class _Tp, class _Compare, class _Allocator>
void
__tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
+#if _LIBCPP_STD_VER <= 11
_NOEXCEPT_(
__is_nothrow_swappable<value_compare>::value
-#if _LIBCPP_STD_VER <= 11
&& (!__node_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
-#endif
)
+#else
+ _NOEXCEPT_(__is_nothrow_swappable<value_compare>::value)
+#endif
{
using _VSTD::swap;
swap(__begin_node_, __t.__begin_node_);
@@ -1452,11 +1854,11 @@ __tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
if (size() == 0)
__begin_node() = __end_node();
else
- __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
+ __end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__end_node());
if (__t.size() == 0)
__t.__begin_node() = __t.__end_node();
else
- __t.__end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__t.__end_node());
+ __t.__end_node()->__left_->__parent_ = static_cast<__parent_pointer>(__t.__end_node());
}
template <class _Tp, class _Compare, class _Allocator>
@@ -1473,9 +1875,9 @@ __tree<_Tp, _Compare, _Allocator>::clear() _NOEXCEPT
// Set __parent to parent of null leaf
// Return reference to null leaf
template <class _Tp, class _Compare, class _Allocator>
-typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
-__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer& __parent,
- const value_type& __v)
+typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
+__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(__parent_pointer& __parent,
+ const key_type& __v)
{
__node_pointer __nd = __root();
if (__nd != nullptr)
@@ -1488,8 +1890,8 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer
__nd = static_cast<__node_pointer>(__nd->__right_);
else
{
- __parent = static_cast<__node_base_pointer>(__nd);
- return __parent->__right_;
+ __parent = static_cast<__parent_pointer>(__nd);
+ return __nd->__right_;
}
}
else
@@ -1498,13 +1900,13 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer
__nd = static_cast<__node_pointer>(__nd->__left_);
else
{
- __parent = static_cast<__node_base_pointer>(__nd);
+ __parent = static_cast<__parent_pointer>(__nd);
return __parent->__left_;
}
}
}
}
- __parent = static_cast<__node_base_pointer>(__end_node());
+ __parent = static_cast<__parent_pointer>(__end_node());
return __parent->__left_;
}
@@ -1512,9 +1914,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer
// Set __parent to parent of null leaf
// Return reference to null leaf
template <class _Tp, class _Compare, class _Allocator>
-typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
-__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointer& __parent,
- const value_type& __v)
+typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
+__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(__parent_pointer& __parent,
+ const key_type& __v)
{
__node_pointer __nd = __root();
if (__nd != nullptr)
@@ -1527,7 +1929,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointe
__nd = static_cast<__node_pointer>(__nd->__left_);
else
{
- __parent = static_cast<__node_base_pointer>(__nd);
+ __parent = static_cast<__parent_pointer>(__nd);
return __parent->__left_;
}
}
@@ -1537,13 +1939,13 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointe
__nd = static_cast<__node_pointer>(__nd->__right_);
else
{
- __parent = static_cast<__node_base_pointer>(__nd);
- return __parent->__right_;
+ __parent = static_cast<__parent_pointer>(__nd);
+ return __nd->__right_;
}
}
}
}
- __parent = static_cast<__node_base_pointer>(__end_node());
+ __parent = static_cast<__parent_pointer>(__end_node());
return __parent->__left_;
}
@@ -1554,10 +1956,10 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointe
// Set __parent to parent of null leaf
// Return reference to null leaf
template <class _Tp, class _Compare, class _Allocator>
-typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
+typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
__tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint,
- typename __node_base::pointer& __parent,
- const value_type& __v)
+ __parent_pointer& __parent,
+ const key_type& __v)
{
if (__hint == end() || !value_comp()(*__hint, __v)) // check before
{
@@ -1568,13 +1970,13 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint,
// *prev(__hint) <= __v <= *__hint
if (__hint.__ptr_->__left_ == nullptr)
{
- __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
+ __parent = static_cast<__parent_pointer>(__hint.__ptr_);
return __parent->__left_;
}
else
{
- __parent = static_cast<__node_base_pointer>(__prior.__ptr_);
- return __parent->__right_;
+ __parent = static_cast<__parent_pointer>(__prior.__ptr_);
+ return static_cast<__node_base_pointer>(__prior.__ptr_)->__right_;
}
}
// __v < *prev(__hint)
@@ -1590,43 +1992,44 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint,
// If __v exists, set parent to node of __v and return reference to node of __v
template <class _Tp, class _Compare, class _Allocator>
template <class _Key>
-typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
-__tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node_base::pointer& __parent,
+typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
+__tree<_Tp, _Compare, _Allocator>::__find_equal(__parent_pointer& __parent,
const _Key& __v)
{
__node_pointer __nd = __root();
+ __node_base_pointer* __nd_ptr = __root_ptr();
if (__nd != nullptr)
{
while (true)
{
if (value_comp()(__v, __nd->__value_))
{
- if (__nd->__left_ != nullptr)
+ if (__nd->__left_ != nullptr) {
+ __nd_ptr = _VSTD::addressof(__nd->__left_);
__nd = static_cast<__node_pointer>(__nd->__left_);
- else
- {
- __parent = static_cast<__node_base_pointer>(__nd);
+ } else {
+ __parent = static_cast<__parent_pointer>(__nd);
return __parent->__left_;
}
}
else if (value_comp()(__nd->__value_, __v))
{
- if (__nd->__right_ != nullptr)
+ if (__nd->__right_ != nullptr) {
+ __nd_ptr = _VSTD::addressof(__nd->__right_);
__nd = static_cast<__node_pointer>(__nd->__right_);
- else
- {
- __parent = static_cast<__node_base_pointer>(__nd);
- return __parent->__right_;
+ } else {
+ __parent = static_cast<__parent_pointer>(__nd);
+ return __nd->__right_;
}
}
else
{
- __parent = static_cast<__node_base_pointer>(__nd);
- return __parent;
+ __parent = static_cast<__parent_pointer>(__nd);
+ return *__nd_ptr;
}
}
}
- __parent = static_cast<__node_base_pointer>(__end_node());
+ __parent = static_cast<__parent_pointer>(__end_node());
return __parent->__left_;
}
@@ -1639,9 +2042,10 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node_base::pointer& _
// If __v exists, set parent to node of __v and return reference to node of __v
template <class _Tp, class _Compare, class _Allocator>
template <class _Key>
-typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
+typename __tree<_Tp, _Compare, _Allocator>::__node_base_pointer&
__tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
- typename __node_base::pointer& __parent,
+ __parent_pointer& __parent,
+ __node_base_pointer& __dummy,
const _Key& __v)
{
if (__hint == end() || value_comp()(__v, *__hint)) // check before
@@ -1653,13 +2057,13 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
// *prev(__hint) < __v < *__hint
if (__hint.__ptr_->__left_ == nullptr)
{
- __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
+ __parent = static_cast<__parent_pointer>(__hint.__ptr_);
return __parent->__left_;
}
else
{
- __parent = static_cast<__node_base_pointer>(__prior.__ptr_);
- return __parent->__right_;
+ __parent = static_cast<__parent_pointer>(__prior.__ptr_);
+ return static_cast<__node_base_pointer>(__prior.__ptr_)->__right_;
}
}
// __v <= *prev(__hint)
@@ -1672,14 +2076,14 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
if (__next == end() || value_comp()(__v, *__next))
{
// *__hint < __v < *_VSTD::next(__hint)
- if (__hint.__ptr_->__right_ == nullptr)
+ if (__hint.__get_np()->__right_ == nullptr)
{
- __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
- return __parent->__right_;
+ __parent = static_cast<__parent_pointer>(__hint.__ptr_);
+ return static_cast<__node_base_pointer>(__hint.__ptr_)->__right_;
}
else
{
- __parent = static_cast<__node_base_pointer>(__next.__ptr_);
+ __parent = static_cast<__parent_pointer>(__next.__ptr_);
return __parent->__left_;
}
}
@@ -1687,48 +2091,115 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
return __find_equal(__parent, __v);
}
// else __v == *__hint
- __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
- return __parent;
+ __parent = static_cast<__parent_pointer>(__hint.__ptr_);
+ __dummy = static_cast<__node_base_pointer>(__hint.__ptr_);
+ return __dummy;
}
template <class _Tp, class _Compare, class _Allocator>
void
-__tree<_Tp, _Compare, _Allocator>::__insert_node_at(__node_base_pointer __parent,
+__tree<_Tp, _Compare, _Allocator>::__insert_node_at(__parent_pointer __parent,
__node_base_pointer& __child,
- __node_base_pointer __new_node)
+ __node_base_pointer __new_node)
{
__new_node->__left_ = nullptr;
__new_node->__right_ = nullptr;
__new_node->__parent_ = __parent;
+ // __new_node->__is_black_ is initialized in __tree_balance_after_insert
__child = __new_node;
if (__begin_node()->__left_ != nullptr)
- __begin_node() = static_cast<__node_pointer>(__begin_node()->__left_);
+ __begin_node() = static_cast<__iter_pointer>(__begin_node()->__left_);
__tree_balance_after_insert(__end_node()->__left_, __child);
++size();
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp, class _Compare, class _Allocator>
+template <class _Key, class... _Args>
+pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
+__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)
+#else
+template <class _Tp, class _Compare, class _Allocator>
+template <class _Key, class _Args>
+pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
+__tree<_Tp, _Compare, _Allocator>::__emplace_unique_key_args(_Key const& __k, _Args& __args)
+#endif
+{
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __find_equal(__parent, __k);
+ __node_pointer __r = static_cast<__node_pointer>(__child);
+ bool __inserted = false;
+ if (__child == nullptr)
+ {
+#ifndef _LIBCPP_CXX03_LANG
+ __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+#else
+ __node_holder __h = __construct_node(__args);
+#endif
+ __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
+ __r = __h.release();
+ __inserted = true;
+ }
+ return pair<iterator, bool>(iterator(__r), __inserted);
+}
+
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp, class _Compare, class _Allocator>
+template <class _Key, class... _Args>
+typename __tree<_Tp, _Compare, _Allocator>::iterator
+__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
+ const_iterator __p, _Key const& __k, _Args&&... __args)
+#else
+template <class _Tp, class _Compare, class _Allocator>
+template <class _Key, class _Args>
+typename __tree<_Tp, _Compare, _Allocator>::iterator
+__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_key_args(
+ const_iterator __p, _Key const& __k, _Args& __args)
+#endif
+{
+ __parent_pointer __parent;
+ __node_base_pointer __dummy;
+ __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __k);
+ __node_pointer __r = static_cast<__node_pointer>(__child);
+ if (__child == nullptr)
+ {
+#ifndef _LIBCPP_CXX03_LANG
+ __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
+#else
+ __node_holder __h = __construct_node(__args);
+#endif
+ __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
+ __r = __h.release();
+ }
+ return iterator(__r);
+}
+
+
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Compare, class _Allocator>
template <class ..._Args>
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args)
{
+ static_assert(!__is_tree_value_type<_Args...>::value,
+ "Cannot construct from __value_type");
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
+ __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _VSTD::forward<_Args>(__args)...);
__h.get_deleter().__value_constructed = true;
return __h;
}
+
template <class _Tp, class _Compare, class _Allocator>
template <class... _Args>
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
-__tree<_Tp, _Compare, _Allocator>::__emplace_unique(_Args&&... __args)
+__tree<_Tp, _Compare, _Allocator>::__emplace_unique_impl(_Args&&... __args)
{
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- __node_base_pointer __parent;
+ __parent_pointer __parent;
__node_base_pointer& __child = __find_equal(__parent, __h->__value_);
__node_pointer __r = static_cast<__node_pointer>(__child);
bool __inserted = false;
@@ -1744,11 +2215,12 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_unique(_Args&&... __args)
template <class _Tp, class _Compare, class _Allocator>
template <class... _Args>
typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique(const_iterator __p, _Args&&... __args)
+__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique_impl(const_iterator __p, _Args&&... __args)
{
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_equal(__p, __parent, __h->__value_);
+ __parent_pointer __parent;
+ __node_base_pointer __dummy;
+ __node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __h->__value_);
__node_pointer __r = static_cast<__node_pointer>(__child);
if (__child == nullptr)
{
@@ -1764,8 +2236,8 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args)
{
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__h->__value_));
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
return iterator(static_cast<__node_pointer>(__h.release()));
}
@@ -1777,117 +2249,35 @@ __tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
_Args&&... __args)
{
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__h->__value_));
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
return iterator(static_cast<__node_pointer>(__h.release()));
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _Vp>
-pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
-__tree<_Tp, _Compare, _Allocator>::__insert_unique(_Vp&& __v)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v));
- pair<iterator, bool> __r = __node_insert_unique(__h.get());
- if (__r.second)
- __h.release();
- return __r;
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _Vp>
-typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _Vp&& __v)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v));
- iterator __r = __node_insert_unique(__p, __h.get());
- if (__r.__ptr_ == __h.get())
- __h.release();
- return __r;
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _Vp>
-typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__insert_multi(_Vp&& __v)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v));
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
- return iterator(__h.release());
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-template <class _Vp>
-typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, _Vp&& __v)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v));
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
- return iterator(__h.release());
-}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
-__tree<_Tp, _Compare, _Allocator>::__construct_node(const value_type& __v)
+__tree<_Tp, _Compare, _Allocator>::__construct_node(const __container_value_type& __v)
{
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
+ __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
__h.get_deleter().__value_constructed = true;
return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Tp, class _Compare, class _Allocator>
-pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
-__tree<_Tp, _Compare, _Allocator>::__insert_unique(const value_type& __v)
-{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_equal(__parent, __v);
- __node_pointer __r = static_cast<__node_pointer>(__child);
- bool __inserted = false;
- if (__child == nullptr)
- {
- __node_holder __h = __construct_node(__v);
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
- __r = __h.release();
- __inserted = true;
- }
- return pair<iterator, bool>(iterator(__r), __inserted);
-}
-
-template <class _Tp, class _Compare, class _Allocator>
-typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, const value_type& __v)
-{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_equal(__p, __parent, __v);
- __node_pointer __r = static_cast<__node_pointer>(__child);
- if (__child == nullptr)
- {
- __node_holder __h = __construct_node(__v);
- __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
- __r = __h.release();
- }
- return iterator(__r);
-}
+#endif // _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_CXX03_LANG
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__insert_multi(const value_type& __v)
+__tree<_Tp, _Compare, _Allocator>::__insert_multi(const __container_value_type& __v)
{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_leaf_high(__parent, __v);
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__v));
__node_holder __h = __construct_node(__v);
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
return iterator(__h.release());
@@ -1895,20 +2285,21 @@ __tree<_Tp, _Compare, _Allocator>::__insert_multi(const value_type& __v)
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::iterator
-__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const value_type& __v)
+__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const __container_value_type& __v)
{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_leaf(__p, __parent, __v);
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__v));
__node_holder __h = __construct_node(__v);
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
return iterator(__h.release());
}
+#endif
template <class _Tp, class _Compare, class _Allocator>
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
__tree<_Tp, _Compare, _Allocator>::__node_insert_unique(__node_pointer __nd)
{
- __node_base_pointer __parent;
+ __parent_pointer __parent;
__node_base_pointer& __child = __find_equal(__parent, __nd->__value_);
__node_pointer __r = static_cast<__node_pointer>(__child);
bool __inserted = false;
@@ -1926,7 +2317,8 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__node_insert_unique(const_iterator __p,
__node_pointer __nd)
{
- __node_base_pointer __parent;
+ __parent_pointer __parent;
+ __node_base_pointer __dummy;
__node_base_pointer& __child = __find_equal(__p, __parent, __nd->__value_);
__node_pointer __r = static_cast<__node_pointer>(__child);
if (__child == nullptr)
@@ -1941,8 +2333,8 @@ template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__node_insert_multi(__node_pointer __nd)
{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_leaf_high(__parent, __nd->__value_);
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __find_leaf_high(__parent, _NodeTypes::__get_key(__nd->__value_));
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd));
return iterator(__nd);
}
@@ -1952,8 +2344,8 @@ typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__node_insert_multi(const_iterator __p,
__node_pointer __nd)
{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_leaf(__p, __parent, __nd->__value_);
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __find_leaf(__p, __parent, _NodeTypes::__get_key(__nd->__value_));
__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__nd));
return iterator(__nd);
}
@@ -1962,16 +2354,17 @@ template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::erase(const_iterator __p)
{
- __node_pointer __np = __p.__ptr_;
- iterator __r(__np);
+ __node_pointer __np = __p.__get_np();
+ iterator __r(__p.__ptr_);
++__r;
- if (__begin_node() == __np)
+ if (__begin_node() == __p.__ptr_)
__begin_node() = __r.__ptr_;
--size();
__node_allocator& __na = __node_alloc();
__tree_remove(__end_node()->__left_,
static_cast<__node_base_pointer>(__np));
- __node_traits::destroy(__na, const_cast<value_type*>(_VSTD::addressof(*__p)));
+ __node_traits::destroy(__na, _NodeTypes::__get_ptr(
+ const_cast<__node_value_type&>(*__p)));
__node_traits::deallocate(__na, __np, 1);
return __r;
}
@@ -2036,17 +2429,15 @@ template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::size_type
__tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const
{
- __node_const_pointer __result = __end_node();
- __node_const_pointer __rt = __root();
+ __node_pointer __rt = __root();
while (__rt != nullptr)
{
if (value_comp()(__k, __rt->__value_))
{
- __result = __rt;
- __rt = static_cast<__node_const_pointer>(__rt->__left_);
+ __rt = static_cast<__node_pointer>(__rt->__left_);
}
else if (value_comp()(__rt->__value_, __k))
- __rt = static_cast<__node_const_pointer>(__rt->__right_);
+ __rt = static_cast<__node_pointer>(__rt->__right_);
else
return 1;
}
@@ -2058,21 +2449,21 @@ template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::size_type
__tree<_Tp, _Compare, _Allocator>::__count_multi(const _Key& __k) const
{
- __node_const_pointer __result = __end_node();
- __node_const_pointer __rt = __root();
+ __iter_pointer __result = __end_node();
+ __node_pointer __rt = __root();
while (__rt != nullptr)
{
if (value_comp()(__k, __rt->__value_))
{
- __result = __rt;
- __rt = static_cast<__node_const_pointer>(__rt->__left_);
+ __result = static_cast<__iter_pointer>(__rt);
+ __rt = static_cast<__node_pointer>(__rt->__left_);
}
else if (value_comp()(__rt->__value_, __k))
- __rt = static_cast<__node_const_pointer>(__rt->__right_);
+ __rt = static_cast<__node_pointer>(__rt->__right_);
else
return _VSTD::distance(
- __lower_bound(__k, static_cast<__node_const_pointer>(__rt->__left_), __rt),
- __upper_bound(__k, static_cast<__node_const_pointer>(__rt->__right_), __result)
+ __lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__iter_pointer>(__rt)),
+ __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result)
);
}
return 0;
@@ -2083,13 +2474,13 @@ template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__lower_bound(const _Key& __v,
__node_pointer __root,
- __node_pointer __result)
+ __iter_pointer __result)
{
while (__root != nullptr)
{
if (!value_comp()(__root->__value_, __v))
{
- __result = __root;
+ __result = static_cast<__iter_pointer>(__root);
__root = static_cast<__node_pointer>(__root->__left_);
}
else
@@ -2102,18 +2493,18 @@ template <class _Tp, class _Compare, class _Allocator>
template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::const_iterator
__tree<_Tp, _Compare, _Allocator>::__lower_bound(const _Key& __v,
- __node_const_pointer __root,
- __node_const_pointer __result) const
+ __node_pointer __root,
+ __iter_pointer __result) const
{
while (__root != nullptr)
{
if (!value_comp()(__root->__value_, __v))
{
- __result = __root;
- __root = static_cast<__node_const_pointer>(__root->__left_);
+ __result = static_cast<__iter_pointer>(__root);
+ __root = static_cast<__node_pointer>(__root->__left_);
}
else
- __root = static_cast<__node_const_pointer>(__root->__right_);
+ __root = static_cast<__node_pointer>(__root->__right_);
}
return const_iterator(__result);
}
@@ -2123,13 +2514,13 @@ template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__upper_bound(const _Key& __v,
__node_pointer __root,
- __node_pointer __result)
+ __iter_pointer __result)
{
while (__root != nullptr)
{
if (value_comp()(__v, __root->__value_))
{
- __result = __root;
+ __result = static_cast<__iter_pointer>(__root);
__root = static_cast<__node_pointer>(__root->__left_);
}
else
@@ -2142,18 +2533,18 @@ template <class _Tp, class _Compare, class _Allocator>
template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::const_iterator
__tree<_Tp, _Compare, _Allocator>::__upper_bound(const _Key& __v,
- __node_const_pointer __root,
- __node_const_pointer __result) const
+ __node_pointer __root,
+ __iter_pointer __result) const
{
while (__root != nullptr)
{
if (value_comp()(__v, __root->__value_))
{
- __result = __root;
- __root = static_cast<__node_const_pointer>(__root->__left_);
+ __result = static_cast<__iter_pointer>(__root);
+ __root = static_cast<__node_pointer>(__root->__left_);
}
else
- __root = static_cast<__node_const_pointer>(__root->__right_);
+ __root = static_cast<__node_pointer>(__root->__right_);
}
return const_iterator(__result);
}
@@ -2165,13 +2556,13 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator,
__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k)
{
typedef pair<iterator, iterator> _Pp;
- __node_pointer __result = __end_node();
+ __iter_pointer __result = __end_node();
__node_pointer __rt = __root();
while (__rt != nullptr)
{
if (value_comp()(__k, __rt->__value_))
{
- __result = __rt;
+ __result = static_cast<__iter_pointer>(__rt);
__rt = static_cast<__node_pointer>(__rt->__left_);
}
else if (value_comp()(__rt->__value_, __k))
@@ -2180,7 +2571,7 @@ __tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k)
return _Pp(iterator(__rt),
iterator(
__rt->__right_ != nullptr ?
- static_cast<__node_pointer>(__tree_min(__rt->__right_))
+ static_cast<__iter_pointer>(__tree_min(__rt->__right_))
: __result));
}
return _Pp(iterator(__result), iterator(__result));
@@ -2193,22 +2584,22 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,
__tree<_Tp, _Compare, _Allocator>::__equal_range_unique(const _Key& __k) const
{
typedef pair<const_iterator, const_iterator> _Pp;
- __node_const_pointer __result = __end_node();
- __node_const_pointer __rt = __root();
+ __iter_pointer __result = __end_node();
+ __node_pointer __rt = __root();
while (__rt != nullptr)
{
if (value_comp()(__k, __rt->__value_))
{
- __result = __rt;
- __rt = static_cast<__node_const_pointer>(__rt->__left_);
+ __result = static_cast<__iter_pointer>(__rt);
+ __rt = static_cast<__node_pointer>(__rt->__left_);
}
else if (value_comp()(__rt->__value_, __k))
- __rt = static_cast<__node_const_pointer>(__rt->__right_);
+ __rt = static_cast<__node_pointer>(__rt->__right_);
else
return _Pp(const_iterator(__rt),
const_iterator(
__rt->__right_ != nullptr ?
- static_cast<__node_const_pointer>(__tree_min(__rt->__right_))
+ static_cast<__iter_pointer>(__tree_min(__rt->__right_))
: __result));
}
return _Pp(const_iterator(__result), const_iterator(__result));
@@ -2221,19 +2612,19 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::iterator,
__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k)
{
typedef pair<iterator, iterator> _Pp;
- __node_pointer __result = __end_node();
+ __iter_pointer __result = __end_node();
__node_pointer __rt = __root();
while (__rt != nullptr)
{
if (value_comp()(__k, __rt->__value_))
{
- __result = __rt;
+ __result = static_cast<__iter_pointer>(__rt);
__rt = static_cast<__node_pointer>(__rt->__left_);
}
else if (value_comp()(__rt->__value_, __k))
__rt = static_cast<__node_pointer>(__rt->__right_);
else
- return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), __rt),
+ return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__iter_pointer>(__rt)),
__upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result));
}
return _Pp(iterator(__result), iterator(__result));
@@ -2246,20 +2637,20 @@ pair<typename __tree<_Tp, _Compare, _Allocator>::const_iterator,
__tree<_Tp, _Compare, _Allocator>::__equal_range_multi(const _Key& __k) const
{
typedef pair<const_iterator, const_iterator> _Pp;
- __node_const_pointer __result = __end_node();
- __node_const_pointer __rt = __root();
+ __iter_pointer __result = __end_node();
+ __node_pointer __rt = __root();
while (__rt != nullptr)
{
if (value_comp()(__k, __rt->__value_))
{
- __result = __rt;
- __rt = static_cast<__node_const_pointer>(__rt->__left_);
+ __result = static_cast<__iter_pointer>(__rt);
+ __rt = static_cast<__node_pointer>(__rt->__left_);
}
else if (value_comp()(__rt->__value_, __k))
- __rt = static_cast<__node_const_pointer>(__rt->__right_);
+ __rt = static_cast<__node_pointer>(__rt->__right_);
else
- return _Pp(__lower_bound(__k, static_cast<__node_const_pointer>(__rt->__left_), __rt),
- __upper_bound(__k, static_cast<__node_const_pointer>(__rt->__right_), __result));
+ return _Pp(__lower_bound(__k, static_cast<__node_pointer>(__rt->__left_), static_cast<__iter_pointer>(__rt)),
+ __upper_bound(__k, static_cast<__node_pointer>(__rt->__right_), __result));
}
return _Pp(const_iterator(__result), const_iterator(__result));
}
@@ -2268,13 +2659,13 @@ template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
__tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT
{
- __node_pointer __np = __p.__ptr_;
- if (__begin_node() == __np)
+ __node_pointer __np = __p.__get_np();
+ if (__begin_node() == __p.__ptr_)
{
if (__np->__right_ != nullptr)
- __begin_node() = static_cast<__node_pointer>(__np->__right_);
+ __begin_node() = static_cast<__iter_pointer>(__np->__right_);
else
- __begin_node() = static_cast<__node_pointer>(__np->__parent_);
+ __begin_node() = static_cast<__iter_pointer>(__np->__parent_);
}
--size();
__tree_remove(__end_node()->__left_,
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__tuple b/chromium/buildtools/third_party/libc++/trunk/include/__tuple
index 8c31759774d..69d6ee96111 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__tuple
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__tuple
@@ -22,38 +22,56 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY tuple_size;
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_size;
+
+#if !defined(_LIBCPP_CXX03_LANG)
+template <class _Tp, class...>
+using __enable_if_tuple_size_imp = _Tp;
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<const _Tp>
- : public tuple_size<_Tp> {};
+class _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+ const _Tp,
+ typename enable_if<!is_volatile<_Tp>::value>::type,
+ integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
+ : public integral_constant<size_t, tuple_size<_Tp>::value> {};
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<volatile _Tp>
- : public tuple_size<_Tp> {};
+class _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+ volatile _Tp,
+ typename enable_if<!is_const<_Tp>::value>::type,
+ integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
+ : public integral_constant<size_t, tuple_size<_Tp>::value> {};
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<const volatile _Tp>
- : public tuple_size<_Tp> {};
+class _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
+ const volatile _Tp,
+ integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
+ : public integral_constant<size_t, tuple_size<_Tp>::value> {};
+
+#else
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {};
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {};
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
+#endif
-template <size_t _Ip, class _Tp> class _LIBCPP_TYPE_VIS_ONLY tuple_element;
+template <size_t _Ip, class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_element;
template <size_t _Ip, class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, const _Tp>
+class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp>
{
public:
typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
};
template <size_t _Ip, class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, volatile _Tp>
+class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp>
{
public:
typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
};
template <size_t _Ip, class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, const volatile _Tp>
+class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp>
{
public:
typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
@@ -67,11 +85,91 @@ template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_li
// tuple specializations
-#if !defined(_LIBCPP_HAS_NO_VARIADICS)
-template <class ..._Tp> class _LIBCPP_TYPE_VIS_ONLY tuple;
+#ifndef _LIBCPP_CXX03_LANG
+
+template <size_t...> struct __tuple_indices {};
+
+template <class _IdxType, _IdxType... _Values>
+struct __integer_sequence {
+ template <template <class _OIdxType, _OIdxType...> class _ToIndexSeq, class _ToIndexType>
+ using __convert = _ToIndexSeq<_ToIndexType, _Values...>;
+
+ template <size_t _Sp>
+ using __to_tuple_indices = __tuple_indices<(_Values + _Sp)...>;
+};
+
+#if !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+namespace __detail {
+
+template<typename _Tp, size_t ..._Extra> struct __repeat;
+template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<__integer_sequence<_Tp, _Np...>, _Extra...> {
+ typedef __integer_sequence<_Tp,
+ _Np...,
+ sizeof...(_Np) + _Np...,
+ 2 * sizeof...(_Np) + _Np...,
+ 3 * sizeof...(_Np) + _Np...,
+ 4 * sizeof...(_Np) + _Np...,
+ 5 * sizeof...(_Np) + _Np...,
+ 6 * sizeof...(_Np) + _Np...,
+ 7 * sizeof...(_Np) + _Np...,
+ _Extra...> type;
+};
+
+template<size_t _Np> struct __parity;
+template<size_t _Np> struct __make : __parity<_Np % 8>::template __pmake<_Np> {};
+
+template<> struct __make<0> { typedef __integer_sequence<size_t> type; };
+template<> struct __make<1> { typedef __integer_sequence<size_t, 0> type; };
+template<> struct __make<2> { typedef __integer_sequence<size_t, 0, 1> type; };
+template<> struct __make<3> { typedef __integer_sequence<size_t, 0, 1, 2> type; };
+template<> struct __make<4> { typedef __integer_sequence<size_t, 0, 1, 2, 3> type; };
+template<> struct __make<5> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4> type; };
+template<> struct __make<6> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5> type; };
+template<> struct __make<7> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5, 6> type; };
+
+template<> struct __parity<0> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type> {}; };
+template<> struct __parity<1> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 1> {}; };
+template<> struct __parity<2> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 2, _Np - 1> {}; };
+template<> struct __parity<3> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 3, _Np - 2, _Np - 1> {}; };
+template<> struct __parity<4> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
+template<> struct __parity<5> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
+template<> struct __parity<6> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
+template<> struct __parity<7> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 7, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
+
+} // namespace detail
+
+#endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
+
+#if __has_builtin(__make_integer_seq)
+template <size_t _Ep, size_t _Sp>
+using __make_indices_imp =
+ typename __make_integer_seq<__integer_sequence, size_t, _Ep - _Sp>::template
+ __to_tuple_indices<_Sp>;
+#else
+template <size_t _Ep, size_t _Sp>
+using __make_indices_imp =
+ typename __detail::__make<_Ep - _Sp>::type::template __to_tuple_indices<_Sp>;
+
+#endif
+
+template <size_t _Ep, size_t _Sp = 0>
+struct __make_tuple_indices
+{
+ static_assert(_Sp <= _Ep, "__make_tuple_indices input error");
+ typedef __make_indices_imp<_Ep, _Sp> type;
+};
+
+
+template <class ..._Tp> class _LIBCPP_TEMPLATE_VIS tuple;
template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {};
+template <class ..._Tp>
+class _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> >
+ : public integral_constant<size_t, sizeof...(_Tp)>
+{
+};
+
template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&
@@ -91,11 +189,10 @@ template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
get(const tuple<_Tp...>&&) _NOEXCEPT;
-#endif
-// pair specializations
+#endif // !defined(_LIBCPP_CXX03_LANG)
-template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY pair;
+// pair specializations
template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
@@ -109,7 +206,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(const pair<_T1, _T2>&) _NOEXCEPT;
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+#ifndef _LIBCPP_CXX03_LANG
template <size_t _Ip, class _T1, class _T2>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
@@ -123,7 +220,7 @@ get(const pair<_T1, _T2>&&) _NOEXCEPT;
// array specializations
-template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
+template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};
@@ -137,7 +234,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _Tp&
get(const array<_Tp, _Size>&) _NOEXCEPT;
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+#ifndef _LIBCPP_CXX03_LANG
template <size_t _Ip, class _Tp, size_t _Size>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&&
@@ -149,68 +246,98 @@ const _Tp&&
get(const array<_Tp, _Size>&&) _NOEXCEPT;
#endif
-#if !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
-// __make_tuple_indices
+// __tuple_types
-template <size_t...> struct __tuple_indices {};
+template <class ..._Tp> struct __tuple_types {};
-template <size_t _Sp, class _IntTuple, size_t _Ep>
-struct __make_indices_imp;
+#if !__has_builtin(__type_pack_element)
-template <size_t _Sp, size_t ..._Indices, size_t _Ep>
-struct __make_indices_imp<_Sp, __tuple_indices<_Indices...>, _Ep>
-{
- typedef typename __make_indices_imp<_Sp+1, __tuple_indices<_Indices..., _Sp>, _Ep>::type type;
-};
+namespace __indexer_detail {
-template <size_t _Ep, size_t ..._Indices>
-struct __make_indices_imp<_Ep, __tuple_indices<_Indices...>, _Ep>
-{
- typedef __tuple_indices<_Indices...> type;
-};
+template <size_t _Idx, class _Tp>
+struct __indexed { using type = _Tp; };
-template <size_t _Ep, size_t _Sp = 0>
-struct __make_tuple_indices
-{
- static_assert(_Sp <= _Ep, "__make_tuple_indices input error");
- typedef typename __make_indices_imp<_Sp, __tuple_indices<>, _Ep>::type type;
-};
+template <class _Types, class _Indexes> struct __indexer;
-// __tuple_types
+template <class ..._Types, size_t ..._Idx>
+struct __indexer<__tuple_types<_Types...>, __tuple_indices<_Idx...>>
+ : __indexed<_Idx, _Types>...
+{};
-template <class ..._Tp> struct __tuple_types {};
+template <size_t _Idx, class _Tp>
+__indexed<_Idx, _Tp> __at_index(__indexed<_Idx, _Tp> const&);
-template <size_t _Ip>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, __tuple_types<> >
-{
-public:
- static_assert(_Ip == 0, "tuple_element index out of range");
- static_assert(_Ip != 0, "tuple_element index out of range");
-};
+} // namespace __indexer_detail
-template <class _Hp, class ..._Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<0, __tuple_types<_Hp, _Tp...> >
-{
-public:
- typedef _Hp type;
-};
+template <size_t _Idx, class ..._Types>
+using __type_pack_element = typename decltype(
+ __indexer_detail::__at_index<_Idx>(
+ __indexer_detail::__indexer<
+ __tuple_types<_Types...>,
+ typename __make_tuple_indices<sizeof...(_Types)>::type
+ >{})
+ )::type;
+#endif
-template <size_t _Ip, class _Hp, class ..._Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, __tuple_types<_Hp, _Tp...> >
+template <size_t _Ip, class ..._Types>
+class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>>
{
public:
- typedef typename tuple_element<_Ip-1, __tuple_types<_Tp...> >::type type;
+ static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range");
+ typedef __type_pack_element<_Ip, _Types...> type;
};
+
template <class ..._Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<__tuple_types<_Tp...> >
+class _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> >
: public integral_constant<size_t, sizeof...(_Tp)>
{
};
template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...> > : true_type {};
+template <bool _ApplyLV, bool _ApplyConst, bool _ApplyVolatile>
+struct __apply_cv_mf;
+template <>
+struct __apply_cv_mf<false, false, false> {
+ template <class _Tp> using __apply = _Tp;
+};
+template <>
+struct __apply_cv_mf<false, true, false> {
+ template <class _Tp> using __apply = const _Tp;
+};
+template <>
+struct __apply_cv_mf<false, false, true> {
+ template <class _Tp> using __apply = volatile _Tp;
+};
+template <>
+struct __apply_cv_mf<false, true, true> {
+ template <class _Tp> using __apply = const volatile _Tp;
+};
+template <>
+struct __apply_cv_mf<true, false, false> {
+ template <class _Tp> using __apply = _Tp&;
+};
+template <>
+struct __apply_cv_mf<true, true, false> {
+ template <class _Tp> using __apply = const _Tp&;
+};
+template <>
+struct __apply_cv_mf<true, false, true> {
+ template <class _Tp> using __apply = volatile _Tp&;
+};
+template <>
+struct __apply_cv_mf<true, true, true> {
+ template <class _Tp> using __apply = const volatile _Tp&;
+};
+template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type>
+using __apply_cv_t = __apply_cv_mf<
+ is_lvalue_reference<_Tp>::value,
+ is_const<_RawTp>::value,
+ is_volatile<_RawTp>::value>;
+
// __make_tuple_types
// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
@@ -218,58 +345,72 @@ template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...> > : true_type
// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a
// lvalue_reference type, then __tuple_types<_Types&...> is the result.
-template <class _TupleTypes, class _Tp, size_t _Sp, size_t _Ep>
-struct __make_tuple_types_imp;
+template <class _TupleTypes, class _TupleIndices>
+struct __make_tuple_types_flat;
-template <class ..._Types, class _Tp, size_t _Sp, size_t _Ep>
-struct __make_tuple_types_imp<__tuple_types<_Types...>, _Tp, _Sp, _Ep>
-{
- typedef typename remove_reference<_Tp>::type _Tpr;
- typedef typename __make_tuple_types_imp<__tuple_types<_Types...,
- typename conditional<is_lvalue_reference<_Tp>::value,
- typename tuple_element<_Sp, _Tpr>::type&,
- typename tuple_element<_Sp, _Tpr>::type>::type>,
- _Tp, _Sp+1, _Ep>::type type;
+template <template <class...> class _Tuple, class ..._Types, size_t ..._Idx>
+struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> {
+ // Specialization for pair, tuple, and __tuple_types
+ template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>>
+ using __apply_quals = __tuple_types<
+ typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>...
+ >;
};
-template <class ..._Types, class _Tp, size_t _Ep>
-struct __make_tuple_types_imp<__tuple_types<_Types...>, _Tp, _Ep, _Ep>
-{
- typedef __tuple_types<_Types...> type;
+template <class _Vt, size_t _Np, size_t ..._Idx>
+struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> {
+ template <size_t>
+ using __value_type = _Vt;
+ template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>>
+ using __apply_quals = __tuple_types<
+ typename _ApplyFn::template __apply<__value_type<_Idx>>...
+ >;
};
-template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value, size_t _Sp = 0>
+template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value,
+ size_t _Sp = 0,
+ bool _SameSize = (_Ep == tuple_size<typename remove_reference<_Tp>::type>::value)>
struct __make_tuple_types
{
static_assert(_Sp <= _Ep, "__make_tuple_types input error");
- typedef typename __make_tuple_types_imp<__tuple_types<>, _Tp, _Sp, _Ep>::type type;
+ using _RawTp = typename remove_cv<typename remove_reference<_Tp>::type>::type;
+ using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
+ using type = typename _Maker::template __apply_quals<_Tp>;
};
-// __tuple_convertible
-
-template <class, class>
-struct __tuple_convertible_imp : public false_type {};
-
-template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
-struct __tuple_convertible_imp<__tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
- : public integral_constant<bool,
- is_convertible<_Tp0, _Up0>::value &&
- __tuple_convertible_imp<__tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
+template <class ..._Types, size_t _Ep>
+struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> {
+ typedef __tuple_types<_Types...> type;
+};
-template <>
-struct __tuple_convertible_imp<__tuple_types<>, __tuple_types<> >
- : public true_type {};
+template <class ..._Types, size_t _Ep>
+struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> {
+ typedef __tuple_types<_Types...> type;
+};
-template <bool, class, class>
-struct __tuple_convertible_apply : public false_type {};
+template <bool ..._Preds>
+struct __all_dummy;
+
+template <bool ..._Pred>
+using __all = is_same<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>>;
+
+struct __tuple_sfinae_base {
+ template <template <class, class...> class _Trait,
+ class ..._LArgs, class ..._RArgs>
+ static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>)
+ -> __all<typename enable_if<_Trait<_LArgs, _RArgs>::value, bool>::type{true}...>;
+ template <template <class...> class>
+ static auto __do_test(...) -> false_type;
+
+ template <class _FromArgs, class _ToArgs>
+ using __constructible = decltype(__do_test<is_constructible>(_ToArgs{}, _FromArgs{}));
+ template <class _FromArgs, class _ToArgs>
+ using __convertible = decltype(__do_test<is_convertible>(_FromArgs{}, _ToArgs{}));
+ template <class _FromArgs, class _ToArgs>
+ using __assignable = decltype(__do_test<is_assignable>(_ToArgs{}, _FromArgs{}));
+};
-template <class _Tp, class _Up>
-struct __tuple_convertible_apply<true, _Tp, _Up>
- : public __tuple_convertible_imp<
- typename __make_tuple_types<_Tp>::type
- , typename __make_tuple_types<_Up>::type
- >
-{};
+// __tuple_convertible
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
bool = __tuple_like<_Up>::value>
@@ -278,36 +419,14 @@ struct __tuple_convertible
template <class _Tp, class _Up>
struct __tuple_convertible<_Tp, _Up, true, true>
- : public __tuple_convertible_apply<tuple_size<typename remove_reference<_Tp>::type>::value ==
- tuple_size<_Up>::value, _Tp, _Up>
-{};
-
-// __tuple_constructible
-
-template <class, class>
-struct __tuple_constructible_imp : public false_type {};
-
-template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
-struct __tuple_constructible_imp<__tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
- : public integral_constant<bool,
- is_constructible<_Up0, _Tp0>::value &&
- __tuple_constructible_imp<__tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
-
-template <>
-struct __tuple_constructible_imp<__tuple_types<>, __tuple_types<> >
- : public true_type {};
-
-template <bool _SameSize, class, class>
-struct __tuple_constructible_apply : public false_type {};
-
-template <class _Tp, class _Up>
-struct __tuple_constructible_apply<true, _Tp, _Up>
- : public __tuple_constructible_imp<
+ : public __tuple_sfinae_base::__convertible<
typename __make_tuple_types<_Tp>::type
, typename __make_tuple_types<_Up>::type
>
{};
+// __tuple_constructible
+
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
bool = __tuple_like<_Up>::value>
struct __tuple_constructible
@@ -315,36 +434,14 @@ struct __tuple_constructible
template <class _Tp, class _Up>
struct __tuple_constructible<_Tp, _Up, true, true>
- : public __tuple_constructible_apply<tuple_size<typename remove_reference<_Tp>::type>::value ==
- tuple_size<_Up>::value, _Tp, _Up>
-{};
-
-// __tuple_assignable
-
-template <class, class>
-struct __tuple_assignable_imp : public false_type {};
-
-template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
-struct __tuple_assignable_imp<__tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
- : public integral_constant<bool,
- is_assignable<_Up0&, _Tp0>::value &&
- __tuple_assignable_imp<__tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
-
-template <>
-struct __tuple_assignable_imp<__tuple_types<>, __tuple_types<> >
- : public true_type {};
-
-template <bool, class, class>
-struct __tuple_assignable_apply : public false_type {};
-
-template <class _Tp, class _Up>
-struct __tuple_assignable_apply<true, _Tp, _Up>
- : __tuple_assignable_imp<
+ : public __tuple_sfinae_base::__constructible<
typename __make_tuple_types<_Tp>::type
, typename __make_tuple_types<_Up>::type
>
{};
+// __tuple_assignable
+
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
bool = __tuple_like<_Up>::value>
struct __tuple_assignable
@@ -352,11 +449,107 @@ struct __tuple_assignable
template <class _Tp, class _Up>
struct __tuple_assignable<_Tp, _Up, true, true>
- : public __tuple_assignable_apply<tuple_size<typename remove_reference<_Tp>::type>::value ==
- tuple_size<_Up>::value, _Tp, _Up>
+ : public __tuple_sfinae_base::__assignable<
+ typename __make_tuple_types<_Tp>::type
+ , typename __make_tuple_types<_Up&>::type
+ >
{};
-#endif // _LIBCPP_HAS_NO_VARIADICS
+
+template <size_t _Ip, class ..._Tp>
+class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> >
+{
+public:
+ typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
+};
+
+#if _LIBCPP_STD_VER > 11
+template <size_t _Ip, class ..._Tp>
+using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type;
+#endif
+
+template <bool _IsTuple, class _SizeTrait, size_t _Expected>
+struct __tuple_like_with_size_imp : false_type {};
+
+template <class _SizeTrait, size_t _Expected>
+struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected>
+ : integral_constant<bool, _SizeTrait::value == _Expected> {};
+
+template <class _Tuple, size_t _ExpectedSize,
+ class _RawTuple = typename __uncvref<_Tuple>::type>
+using __tuple_like_with_size = __tuple_like_with_size_imp<
+ __tuple_like<_RawTuple>::value,
+ tuple_size<_RawTuple>, _ExpectedSize
+ >;
+
+struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
+ template <class ...>
+ static constexpr bool __enable_default() { return false; }
+ template <class ...>
+ static constexpr bool __enable_explicit() { return false; }
+ template <class ...>
+ static constexpr bool __enable_implicit() { return false; }
+ template <class ...>
+ static constexpr bool __enable_assign() { return false; }
+};
+#endif // !defined(_LIBCPP_CXX03_LANG)
+
+#if _LIBCPP_STD_VER > 14
+
+template <bool _CanCopy, bool _CanMove>
+struct __sfinae_ctor_base {};
+template <>
+struct __sfinae_ctor_base<false, false> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+template <>
+struct __sfinae_ctor_base<true, false> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+template <>
+struct __sfinae_ctor_base<false, true> {
+ __sfinae_ctor_base() = default;
+ __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
+ __sfinae_ctor_base(__sfinae_ctor_base &&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
+ __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
+};
+
+template <bool _CanCopy, bool _CanMove>
+struct __sfinae_assign_base {};
+template <>
+struct __sfinae_assign_base<false, false> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
+};
+template <>
+struct __sfinae_assign_base<true, false> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
+};
+template <>
+struct __sfinae_assign_base<false, true> {
+ __sfinae_assign_base() = default;
+ __sfinae_assign_base(__sfinae_assign_base const&) = default;
+ __sfinae_assign_base(__sfinae_assign_base &&) = default;
+ __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
+ __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
+};
+#endif // _LIBCPP_STD_VER > 14
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__undef_min_max b/chromium/buildtools/third_party/libc++/trunk/include/__undef_min_max
index 5df9412c64f..71db3965e3c 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__undef_min_max
+++ b/chromium/buildtools/third_party/libc++/trunk/include/__undef_min_max
@@ -9,21 +9,25 @@
//===----------------------------------------------------------------------===//
#ifdef min
-#if defined(_MSC_VER) && ! defined(__clang__)
+#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
+#if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("macro min is incompatible with C++. Try #define NOMINMAX "
"before any Windows header. #undefing min")
#else
#warning: macro min is incompatible with C++. #undefing min
#endif
+#endif
#undef min
#endif
#ifdef max
-#if defined(_MSC_VER) && ! defined(__clang__)
+#if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
+#if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("macro max is incompatible with C++. Try #define NOMINMAX "
"before any Windows header. #undefing max")
#else
#warning: macro max is incompatible with C++. #undefing max
#endif
+#endif
#undef max
#endif
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/algorithm b/chromium/buildtools/third_party/libc++/trunk/include/algorithm
index 9c051198930..7ea4474a1bb 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/algorithm
+++ b/chromium/buildtools/third_party/libc++/trunk/include/algorithm
@@ -35,6 +35,9 @@ template <class InputIterator, class Function>
Function
for_each(InputIterator first, InputIterator last, Function f);
+template<class InputIterator, class Size, class Function>
+ InputIterator for_each_n(InputIterator first, Size n, Function f); // C++17
+
template <class InputIterator, class T>
InputIterator
find(InputIterator first, InputIterator last, const T& value);
@@ -89,7 +92,7 @@ template <class InputIterator1, class InputIterator2>
template <class InputIterator1, class InputIterator2>
pair<InputIterator1, InputIterator2>
- mismatch(InputIterator1 first1, InputIterator1 last1,
+ mismatch(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2); // **C++14**
template <class InputIterator1, class InputIterator2, class BinaryPredicate>
@@ -109,7 +112,7 @@ template <class InputIterator1, class InputIterator2>
template <class InputIterator1, class InputIterator2>
bool
- equal(InputIterator1 first1, InputIterator1 last1,
+ equal(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2); // **C++14**
template <class InputIterator1, class InputIterator2, class BinaryPredicate>
@@ -281,12 +284,18 @@ template <class ForwardIterator, class OutputIterator>
template <class RandomAccessIterator>
void
- random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14
+ random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14, removed in C++17
template <class RandomAccessIterator, class RandomNumberGenerator>
void
random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
- RandomNumberGenerator& rand); // deprecated in C++14
+ RandomNumberGenerator& rand); // deprecated in C++14, removed in C++17
+
+template<class PopulationIterator, class SampleIterator,
+ class Distance, class UniformRandomBitGenerator>
+ SampleIterator sample(PopulationIterator first, PopulationIterator last,
+ SampleIterator out, Distance n,
+ UniformRandomBitGenerator&& g); // C++17
template<class RandomAccessIterator, class UniformRandomNumberGenerator>
void shuffle(RandomAccessIterator first, RandomAccessIterator last,
@@ -543,6 +552,12 @@ template<class T, class Compare>
T
min(initializer_list<T> t, Compare comp); // constexpr in C++14
+template<class T>
+ constexpr const T& clamp( const T& v, const T& lo, const T& hi ); // C++17
+
+template<class T, class Compare>
+ constexpr const T& clamp( const T& v, const T& lo, const T& hi, Compare comp ); // C++17
+
template <class ForwardIterator>
ForwardIterator
max_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14
@@ -624,7 +639,7 @@ template <class BidirectionalIterator, class Compare>
#include <initializer_list>
#include <type_traits>
#include <cstring>
-#include <utility>
+#include <utility> // needed to provide swap_ranges.
#include <memory>
#include <iterator>
#include <cstddef>
@@ -632,8 +647,8 @@ template <class BidirectionalIterator, class Compare>
#if defined(__IBMCPP__)
#include "support/ibm/support.h"
#endif
-#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
-#include "support/win32/support.h"
+#if defined(_LIBCPP_COMPILER_MSVC)
+#include <intrin.h>
#endif
#include <__undef_min_max>
@@ -682,7 +697,7 @@ struct __equal_to<_T1, const _T1>
template <class _T1, class _T2 = _T1>
struct __less
{
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -743,65 +758,160 @@ struct __debug_less
{
_Compare __comp_;
__debug_less(_Compare& __c) : __comp_(__c) {}
+
template <class _Tp, class _Up>
bool operator()(const _Tp& __x, const _Up& __y)
{
bool __r = __comp_(__x, __y);
if (__r)
- _LIBCPP_ASSERT(!__comp_(__y, __x), "Comparator does not induce a strict weak ordering");
+ __do_compare_assert(0, __y, __x);
return __r;
}
+
+ template <class _LHS, class _RHS>
+ inline _LIBCPP_INLINE_VISIBILITY
+ decltype((void)_VSTD::declval<_Compare&>()(
+ _VSTD::declval<_LHS const&>(), _VSTD::declval<_RHS const&>()))
+ __do_compare_assert(int, _LHS const& __l, _RHS const& __r) {
+ _LIBCPP_ASSERT(!__comp_(__l, __r),
+ "Comparator does not induce a strict weak ordering");
+ }
+
+ template <class _LHS, class _RHS>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __do_compare_assert(long, _LHS const&, _RHS const&) {}
};
#endif // _LIBCPP_DEBUG
// Precondition: __x != 0
inline _LIBCPP_INLINE_VISIBILITY
-unsigned
-__ctz(unsigned __x)
-{
+unsigned __ctz(unsigned __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
return static_cast<unsigned>(__builtin_ctz(__x));
+#else
+ static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
+ static_assert(sizeof(unsigned long) == 4, "");
+ unsigned long where;
+ // Search from LSB to MSB for first set bit.
+ // Returns zero if no set bit is found.
+ if (_BitScanForward(&where, mask))
+ return where;
+ return 32;
+#endif
}
inline _LIBCPP_INLINE_VISIBILITY
-unsigned long
-__ctz(unsigned long __x)
-{
+unsigned long __ctz(unsigned long __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
return static_cast<unsigned long>(__builtin_ctzl(__x));
+#else
+ static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
+ return __ctz(static_cast<unsigned>(__x));
+#endif
}
inline _LIBCPP_INLINE_VISIBILITY
-unsigned long long
-__ctz(unsigned long long __x)
-{
+unsigned long long __ctz(unsigned long long __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
return static_cast<unsigned long long>(__builtin_ctzll(__x));
+#else
+ unsigned long where;
+// Search from LSB to MSB for first set bit.
+// Returns zero if no set bit is found.
+#if defined(_LIBCPP_HAS_BITSCAN64)
+ (defined(_M_AMD64) || defined(__x86_64__))
+ if (_BitScanForward64(&where, mask))
+ return static_cast<int>(where);
+#else
+ // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
+ // Scan the Low Word.
+ if (_BitScanForward(&where, static_cast<unsigned long>(mask)))
+ return where;
+ // Scan the High Word.
+ if (_BitScanForward(&where, static_cast<unsigned long>(mask >> 32)))
+ return where + 32; // Create a bit offset from the LSB.
+#endif
+ return 64;
+#endif // _LIBCPP_COMPILER_MSVC
}
// Precondition: __x != 0
inline _LIBCPP_INLINE_VISIBILITY
-unsigned
-__clz(unsigned __x)
-{
+unsigned __clz(unsigned __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
return static_cast<unsigned>(__builtin_clz(__x));
+#else
+ static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
+ static_assert(sizeof(unsigned long) == 4, "");
+ unsigned long where;
+ // Search from LSB to MSB for first set bit.
+ // Returns zero if no set bit is found.
+ if (_BitScanReverse(&where, mask))
+ return 31 - where;
+ return 32; // Undefined Behavior.
+#endif
}
inline _LIBCPP_INLINE_VISIBILITY
-unsigned long
-__clz(unsigned long __x)
-{
+unsigned long __clz(unsigned long __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
return static_cast<unsigned long>(__builtin_clzl (__x));
+#else
+ static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
+ return __clz(static_cast<unsigned>(__x));
+#endif
}
inline _LIBCPP_INLINE_VISIBILITY
-unsigned long long
-__clz(unsigned long long __x)
-{
+unsigned long long __clz(unsigned long long __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
return static_cast<unsigned long long>(__builtin_clzll(__x));
+#else
+ unsigned long where;
+// BitScanReverse scans from MSB to LSB for first set bit.
+// Returns 0 if no set bit is found.
+#if defined(_LIBCPP_HAS_BITSCAN64)
+ if (_BitScanReverse64(&where, mask))
+ return static_cast<int>(63 - where);
+#else
+ // Scan the high 32 bits.
+ if (_BitScanReverse(&where, static_cast<unsigned long>(mask >> 32)))
+ return 63 - (where + 32); // Create a bit offset from the MSB.
+ // Scan the low 32 bits.
+ if (_BitScanReverse(&where, static_cast<unsigned long>(mask)))
+ return 63 - where;
+#endif
+ return 64; // Undefined Behavior.
+#endif // _LIBCPP_COMPILER_MSVC
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
+ return __builtin_popcount (__x);
+#else
+ static_assert(sizeof(unsigned) == 4, "");
+ return __popcnt(__x);
+#endif
+}
+
+inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
+ return __builtin_popcountl (__x);
+#else
+ static_assert(sizeof(unsigned long) == 4, "");
+ return __popcnt(__x);
+#endif
}
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned __x) {return __builtin_popcount (__x);}
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long __x) {return __builtin_popcountl (__x);}
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) {return __builtin_popcountll(__x);}
+inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) {
+#ifndef _LIBCPP_COMPILER_MSVC
+ return __builtin_popcountll(__x);
+#else
+ static_assert(sizeof(unsigned long long) == 8, "");
+ return __popcnt64(__x);
+#endif
+}
// all_of
@@ -851,9 +961,29 @@ for_each(_InputIterator __first, _InputIterator __last, _Function __f)
{
for (; __first != __last; ++__first)
__f(*__first);
- return _LIBCPP_EXPLICIT_MOVE(__f); // explicitly moved for (emulated) C++03
+ return __f;
}
+#if _LIBCPP_STD_VER > 14
+// for_each_n
+
+template <class _InputIterator, class _Size, class _Function>
+inline _LIBCPP_INLINE_VISIBILITY
+_InputIterator
+for_each_n(_InputIterator __first, _Size __orig_n, _Function __f)
+{
+ typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
+ _IntegralSize __n = __orig_n;
+ while (__n > 0)
+ {
+ __f(*__first);
+ ++__first;
+ --__n;
+ }
+ return __first;
+}
+#endif
+
// find
template <class _InputIterator, class _Tp>
@@ -1209,7 +1339,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-__equal(_InputIterator1 __first1, _InputIterator1 __last1,
+__equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred,
input_iterator_tag, input_iterator_tag )
{
@@ -1222,8 +1352,8 @@ __equal(_InputIterator1 __first1, _InputIterator1 __last1,
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
+__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
+ _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
random_access_iterator_tag, random_access_iterator_tag )
{
if ( _VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))
@@ -1236,11 +1366,11 @@ __equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
inline _LIBCPP_INLINE_VISIBILITY
bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1,
+equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred )
{
return _VSTD::__equal<typename add_lvalue_reference<_BinaryPredicate>::type>
- (__first1, __last1, __first2, __last2, __pred,
+ (__first1, __last1, __first2, __last2, __pred,
typename iterator_traits<_InputIterator1>::iterator_category(),
typename iterator_traits<_InputIterator2>::iterator_category());
}
@@ -1248,7 +1378,7 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1,
template <class _InputIterator1, class _InputIterator2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-equal(_InputIterator1 __first1, _InputIterator1 __last1,
+equal(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2)
{
typedef typename iterator_traits<_InputIterator1>::value_type __v1;
@@ -1322,7 +1452,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
bool
__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
- _ForwardIterator2 __first2, _ForwardIterator2 __last2,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2,
_BinaryPredicate __pred,
forward_iterator_tag, forward_iterator_tag )
{
@@ -1373,7 +1503,7 @@ __next_iter:;
template<class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
bool
__is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1,
- _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2,
+ _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2,
_BinaryPredicate __pred,
random_access_iterator_tag, random_access_iterator_tag )
{
@@ -1415,20 +1545,20 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
// search
template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
-_ForwardIterator1
+pair<_ForwardIterator1, _ForwardIterator1>
__search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
forward_iterator_tag, forward_iterator_tag)
{
if (__first2 == __last2)
- return __first1; // Everything matches an empty sequence
+ return make_pair(__first1, __first1); // Everything matches an empty sequence
while (true)
{
// Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks
while (true)
{
if (__first1 == __last1) // return __last1 if no element matches *__first2
- return __last1;
+ return make_pair(__last1, __last1);
if (__pred(*__first1, *__first2))
break;
++__first1;
@@ -1439,9 +1569,9 @@ __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
while (true)
{
if (++__m2 == __last2) // If pattern exhausted, __first1 is the answer (works for 1 element pattern)
- return __first1;
+ return make_pair(__first1, __m1);
if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found
- return __last1;
+ return make_pair(__last1, __last1);
if (!__pred(*__m1, *__m2)) // if there is a mismatch, restart with a new __first1
{
++__first1;
@@ -1452,70 +1582,40 @@ __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
}
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1
+_LIBCPP_CONSTEXPR_AFTER_CXX11
+pair<_RandomAccessIterator1, _RandomAccessIterator1>
__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
- _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
+ _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
random_access_iterator_tag, random_access_iterator_tag)
{
- typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type _D1;
- typedef typename std::iterator_traits<_RandomAccessIterator2>::difference_type _D2;
+ typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1;
+ typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2;
// Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern
- _D2 __len2 = __last2 - __first2;
+ const _D2 __len2 = __last2 - __first2;
if (__len2 == 0)
- return __first1;
- _D1 __len1 = __last1 - __first1;
+ return make_pair(__first1, __first1);
+ const _D1 __len1 = __last1 - __first1;
if (__len1 < __len2)
- return __last1;
+ return make_pair(__last1, __last1);
const _RandomAccessIterator1 __s = __last1 - (__len2 - 1); // Start of pattern match can't go beyond here
+
while (true)
{
-#if !_LIBCPP_UNROLL_LOOPS
while (true)
{
if (__first1 == __s)
- return __last1;
+ return make_pair(__last1, __last1);
if (__pred(*__first1, *__first2))
break;
++__first1;
}
-#else // !_LIBCPP_UNROLL_LOOPS
- for (_D1 __loop_unroll = (__s - __first1) / 4; __loop_unroll > 0; --__loop_unroll)
- {
- if (__pred(*__first1, *__first2))
- goto __phase2;
- if (__pred(*++__first1, *__first2))
- goto __phase2;
- if (__pred(*++__first1, *__first2))
- goto __phase2;
- if (__pred(*++__first1, *__first2))
- goto __phase2;
- ++__first1;
- }
- switch (__s - __first1)
- {
- case 3:
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- case 2:
- if (__pred(*__first1, *__first2))
- break;
- ++__first1;
- case 1:
- if (__pred(*__first1, *__first2))
- break;
- case 0:
- return __last1;
- }
- __phase2:
-#endif // !_LIBCPP_UNROLL_LOOPS
+
_RandomAccessIterator1 __m1 = __first1;
_RandomAccessIterator2 __m2 = __first2;
-#if !_LIBCPP_UNROLL_LOOPS
while (true)
{
if (++__m2 == __last2)
- return __first1;
+ return make_pair(__first1, __first1 + __len2);
++__m1; // no need to check range on __m1 because __s guarantees we have enough source
if (!__pred(*__m1, *__m2))
{
@@ -1523,43 +1623,6 @@ __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
break;
}
}
-#else // !_LIBCPP_UNROLL_LOOPS
- ++__m2;
- ++__m1;
- for (_D2 __loop_unroll = (__last2 - __m2) / 4; __loop_unroll > 0; --__loop_unroll)
- {
- if (!__pred(*__m1, *__m2))
- goto __continue;
- if (!__pred(*++__m1, *++__m2))
- goto __continue;
- if (!__pred(*++__m1, *++__m2))
- goto __continue;
- if (!__pred(*++__m1, *++__m2))
- goto __continue;
- ++__m1;
- ++__m2;
- }
- switch (__last2 - __m2)
- {
- case 3:
- if (!__pred(*__m1, *__m2))
- break;
- ++__m1;
- ++__m2;
- case 2:
- if (!__pred(*__m1, *__m2))
- break;
- ++__m1;
- ++__m2;
- case 1:
- if (!__pred(*__m1, *__m2))
- break;
- case 0:
- return __first1;
- }
- __continue:
- ++__first1;
-#endif // !_LIBCPP_UNROLL_LOOPS
}
}
@@ -1571,8 +1634,9 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
{
return _VSTD::__search<typename add_lvalue_reference<_BinaryPredicate>::type>
(__first1, __last1, __first2, __last2, __pred,
- typename std::iterator_traits<_ForwardIterator1>::iterator_category(),
- typename std::iterator_traits<_ForwardIterator2>::iterator_category());
+ typename iterator_traits<_ForwardIterator1>::iterator_category(),
+ typename iterator_traits<_ForwardIterator2>::iterator_category())
+ .first;
}
template <class _ForwardIterator1, class _ForwardIterator2>
@@ -1581,8 +1645,8 @@ _ForwardIterator1
search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2)
{
- typedef typename std::iterator_traits<_ForwardIterator1>::value_type __v1;
- typedef typename std::iterator_traits<_ForwardIterator2>::value_type __v2;
+ typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
+ typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
}
@@ -1687,25 +1751,6 @@ search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const
}
// copy
-
-template <class _Iter>
-struct __libcpp_is_trivial_iterator
-{
- static const bool value = is_pointer<_Iter>::value;
-};
-
-template <class _Iter>
-struct __libcpp_is_trivial_iterator<move_iterator<_Iter> >
-{
- static const bool value = is_pointer<_Iter>::value;
-};
-
-template <class _Iter>
-struct __libcpp_is_trivial_iterator<__wrap_iter<_Iter> >
-{
- static const bool value = is_pointer<_Iter>::value;
-};
-
template <class _Iter>
inline _LIBCPP_INLINE_VISIBILITY
_Iter
@@ -1740,6 +1785,20 @@ __unwrap_iter(__wrap_iter<_Tp*> __i)
return __i.base();
}
+#else
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
+ is_trivially_copy_assignable<_Tp>::value,
+ __wrap_iter<_Tp*>
+>::type
+__unwrap_iter(__wrap_iter<_Tp*> __i)
+{
+ return __i;
+}
+
#endif // _LIBCPP_DEBUG_LEVEL < 2
template <class _InputIterator, class _OutputIterator>
@@ -1813,7 +1872,9 @@ _BidirectionalIterator2
copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
_BidirectionalIterator2 __result)
{
- return _VSTD::__copy_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
+ return _VSTD::__copy_backward(__unwrap_iter(__first),
+ __unwrap_iter(__last),
+ __unwrap_iter(__result));
}
// copy_if
@@ -2428,7 +2489,7 @@ __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIt
template<typename _Integral>
inline _LIBCPP_INLINE_VISIBILITY
_Integral
-__gcd(_Integral __x, _Integral __y)
+__algo_gcd(_Integral __x, _Integral __y)
{
do
{
@@ -2453,7 +2514,7 @@ __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Ran
_VSTD::swap_ranges(__first, __middle, __middle);
return __middle;
}
- const difference_type __g = _VSTD::__gcd(__m1, __m2);
+ const difference_type __g = _VSTD::__algo_gcd(__m1, __m2);
for (_RandomAccessIterator __p = __first + __g; __p != __first;)
{
value_type __t(_VSTD::move(*--__p));
@@ -2591,7 +2652,7 @@ min(const _Tp& __a, const _Tp& __b)
return _VSTD::min(__a, __b, __less<_Tp>());
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2609,7 +2670,7 @@ min(initializer_list<_Tp> __t)
return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// max_element
@@ -2656,7 +2717,7 @@ max(const _Tp& __a, const _Tp& __b)
return _VSTD::max(__a, __b, __less<_Tp>());
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2674,7 +2735,28 @@ max(initializer_list<_Tp> __t)
return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
+
+#if _LIBCPP_STD_VER > 14
+// clamp
+template<class _Tp, class _Compare>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+const _Tp&
+clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
+{
+ _LIBCPP_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
+ return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
+
+}
+
+template<class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+const _Tp&
+clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
+{
+ return _VSTD::clamp(__v, __lo, __hi, __less<_Tp>());
+}
+#endif
// minmax_element
@@ -2754,7 +2836,7 @@ minmax(const _Tp& __a, const _Tp& __b)
return _VSTD::minmax(__a, __b, __less<_Tp>());
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2775,7 +2857,7 @@ minmax(initializer_list<_Tp> __t, _Compare __comp)
__result.second = *__first;
++__first;
}
-
+
while (__first != __last)
{
_Tp __prev = *__first++;
@@ -2787,7 +2869,7 @@ minmax(initializer_list<_Tp> __t, _Compare __comp)
if ( __comp(__prev, __result.first)) __result.first = __prev;
if (!__comp(*__first, __result.second)) __result.second = *__first;
}
-
+
__first++;
}
return __result;
@@ -2801,7 +2883,7 @@ minmax(initializer_list<_Tp> __t)
return _VSTD::minmax(__t, __less<_Tp>());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// random_shuffle
@@ -2859,7 +2941,7 @@ private:
_Engine_result_type __mask0_;
_Engine_result_type __mask1_;
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
+ _Working_result_type(1);
#else
@@ -3048,6 +3130,8 @@ uniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p
return static_cast<result_type>(__u + __p.a());
}
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
+ || defined(_LIBCPP_BUILDING_LIBRARY)
class _LIBCPP_TYPE_VIS __rs_default;
_LIBCPP_FUNC_VIS __rs_default __rs_get();
@@ -3100,7 +3184,7 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
template <class _RandomAccessIterator, class _RandomNumberGenerator>
void
random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_RandomNumberGenerator&& __rand)
#else
_RandomNumberGenerator& __rand)
@@ -3117,10 +3201,83 @@ random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
}
}
}
+#endif
+
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __output,
+ _Distance __n,
+ _UniformRandomNumberGenerator & __g,
+ input_iterator_tag) {
+
+ _Distance __k = 0;
+ for (; __first != __last && __k < __n; ++__first, (void)++__k)
+ __output[__k] = *__first;
+ _Distance __sz = __k;
+ for (; __first != __last; ++__first, (void)++__k) {
+ _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g);
+ if (__r < __sz)
+ __output[__r] = *__first;
+ }
+ return __output + _VSTD::min(__n, __k);
+}
+
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __output,
+ _Distance __n,
+ _UniformRandomNumberGenerator& __g,
+ forward_iterator_tag) {
+ _Distance __unsampled_sz = _VSTD::distance(__first, __last);
+ for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {
+ _Distance __r =
+ _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);
+ if (__r < __n) {
+ *__output++ = *__first;
+ --__n;
+ }
+ }
+ return __output;
+}
+
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+_LIBCPP_INLINE_VISIBILITY
+_SampleIterator __sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __output,
+ _Distance __n, _UniformRandomNumberGenerator& __g) {
+ typedef typename iterator_traits<_PopulationIterator>::iterator_category
+ _PopCategory;
+ typedef typename iterator_traits<_PopulationIterator>::difference_type
+ _Difference;
+ static_assert(__is_forward_iterator<_PopulationIterator>::value ||
+ __is_random_access_iterator<_SampleIterator>::value,
+ "SampleIterator must meet the requirements of RandomAccessIterator");
+ typedef typename common_type<_Distance, _Difference>::type _CommonType;
+ _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
+ return _VSTD::__sample(
+ __first, __last, __output, _CommonType(__n),
+ __g, _PopCategory());
+}
+
+#if _LIBCPP_STD_VER > 14
+template <class _PopulationIterator, class _SampleIterator, class _Distance,
+ class _UniformRandomNumberGenerator>
+inline _LIBCPP_INLINE_VISIBILITY
+_SampleIterator sample(_PopulationIterator __first,
+ _PopulationIterator __last, _SampleIterator __output,
+ _Distance __n, _UniformRandomNumberGenerator&& __g) {
+ return _VSTD::__sample(__first, __last, __output, __n, __g);
+}
+#endif // _LIBCPP_STD_VER > 14
template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_UniformRandomNumberGenerator&& __g)
#else
_UniformRandomNumberGenerator& __g)
@@ -4413,7 +4570,7 @@ __buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator
::new(__p) value_type(_VSTD::move(*__i));
typedef reverse_iterator<_BidirectionalIterator> _RBi;
typedef reverse_iterator<value_type*> _Rv;
- __half_inplace_merge(_Rv(__p), _Rv(__buff),
+ __half_inplace_merge(_Rv(__p), _Rv(__buff),
_RBi(__middle), _RBi(__first),
_RBi(__last), __negate<_Compare>(__comp));
}
@@ -4861,7 +5018,8 @@ push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
template <class _Compare, class _RandomAccessIterator>
void
-__sift_down(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
+__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
+ _Compare __comp,
typename iterator_traits<_RandomAccessIterator>::difference_type __len,
_RandomAccessIterator __start)
{
@@ -5744,34 +5902,6 @@ prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
__less<typename iterator_traits<_BidirectionalIterator>::value_type>());
}
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value,
- _Tp
->::type
-__rotate_left(_Tp __t, _Tp __n = 1)
-{
- const unsigned __bits = static_cast<unsigned>(sizeof(_Tp) * __CHAR_BIT__ - 1);
- __n &= __bits;
- return static_cast<_Tp>((__t << __n) | (static_cast<typename make_unsigned<_Tp>::type>(__t) >> (__bits - __n)));
-}
-
-template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value,
- _Tp
->::type
-__rotate_right(_Tp __t, _Tp __n = 1)
-{
- const unsigned __bits = static_cast<unsigned>(sizeof(_Tp) * __CHAR_BIT__ - 1);
- __n &= __bits;
- return static_cast<_Tp>((__t << (__bits - __n)) | (static_cast<typename make_unsigned<_Tp>::type>(__t) >> __n));
-}
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_ALGORITHM
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/any b/chromium/buildtools/third_party/libc++/trunk/include/any
new file mode 100644
index 00000000000..d7161b0d6f4
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/any
@@ -0,0 +1,667 @@
+// -*- C++ -*-
+//===------------------------------ any -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_ANY
+#define _LIBCPP_ANY
+
+/*
+ any synopsis
+
+namespace std {
+
+ class bad_any_cast : public bad_cast
+ {
+ public:
+ virtual const char* what() const noexcept;
+ };
+
+ class any
+ {
+ public:
+
+ // 6.3.1 any construct/destruct
+ any() noexcept;
+
+ any(const any& other);
+ any(any&& other) noexcept;
+
+ template <class ValueType>
+ any(ValueType&& value);
+
+ ~any();
+
+ // 6.3.2 any assignments
+ any& operator=(const any& rhs);
+ any& operator=(any&& rhs) noexcept;
+
+ template <class ValueType>
+ any& operator=(ValueType&& rhs);
+
+ // 6.3.3 any modifiers
+ template <class ValueType, class... Args>
+ decay_t<ValueType>& emplace(Args&&... args);
+ template <class ValueType, class U, class... Args>
+ decay_t<ValueType>& emplace(initializer_list<U>, Args&&...);
+ void reset() noexcept;
+ void swap(any& rhs) noexcept;
+
+ // 6.3.4 any observers
+ bool has_value() const noexcept;
+ const type_info& type() const noexcept;
+ };
+
+ // 6.4 Non-member functions
+ void swap(any& x, any& y) noexcept;
+
+ template <class T, class ...Args>
+ any make_any(Args&& ...args);
+ template <class T, class U, class ...Args>
+ any make_any(initializer_list<U>, Args&& ...args);
+
+ template<class ValueType>
+ ValueType any_cast(const any& operand);
+ template<class ValueType>
+ ValueType any_cast(any& operand);
+ template<class ValueType>
+ ValueType any_cast(any&& operand);
+
+ template<class ValueType>
+ const ValueType* any_cast(const any* operand) noexcept;
+ template<class ValueType>
+ ValueType* any_cast(any* operand) noexcept;
+
+} // namespace std
+
+*/
+
+#include <experimental/__config>
+#include <memory>
+#include <new>
+#include <typeinfo>
+#include <type_traits>
+#include <cstdlib>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+namespace std {
+class _LIBCPP_EXCEPTION_ABI bad_any_cast : public bad_cast
+{
+public:
+ virtual const char* what() const _NOEXCEPT;
+};
+} // namespace std
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_any_cast()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_any_cast();
+#else
+ _VSTD::abort();
+#endif
+}
+
+// Forward declarations
+class _LIBCPP_TEMPLATE_VIS any;
+
+template <class _ValueType>
+_LIBCPP_INLINE_VISIBILITY
+add_pointer_t<add_const_t<_ValueType>>
+any_cast(any const *) _NOEXCEPT;
+
+template <class _ValueType>
+_LIBCPP_INLINE_VISIBILITY
+add_pointer_t<_ValueType> any_cast(any *) _NOEXCEPT;
+
+namespace __any_imp
+{
+ using _Buffer = aligned_storage_t<3*sizeof(void*), alignment_of<void*>::value>;
+
+ template <class _Tp>
+ using _IsSmallObject = integral_constant<bool
+ , sizeof(_Tp) <= sizeof(_Buffer)
+ && alignment_of<_Buffer>::value
+ % alignment_of<_Tp>::value == 0
+ && is_nothrow_move_constructible<_Tp>::value
+ >;
+
+ enum class _Action {
+ _Destroy,
+ _Copy,
+ _Move,
+ _Get,
+ _TypeInfo
+ };
+
+ template <class _Tp> struct _SmallHandler;
+ template <class _Tp> struct _LargeHandler;
+
+ template <class _Tp>
+ struct _LIBCPP_TEMPLATE_VIS __unique_typeinfo { static constexpr int __id = 0; };
+ template <class _Tp> constexpr int __unique_typeinfo<_Tp>::__id;
+
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr const void* __get_fallback_typeid() {
+ return &__unique_typeinfo<decay_t<_Tp>>::__id;
+ }
+
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ bool __compare_typeid(type_info const* __id, const void* __fallback_id)
+ {
+#if !defined(_LIBCPP_NO_RTTI)
+ if (__id && *__id == typeid(_Tp))
+ return true;
+#endif
+ if (!__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>())
+ return true;
+ return false;
+ }
+
+ template <class _Tp>
+ using _Handler = conditional_t<
+ _IsSmallObject<_Tp>::value, _SmallHandler<_Tp>, _LargeHandler<_Tp>>;
+
+} // namespace __any_imp
+
+class _LIBCPP_TEMPLATE_VIS any
+{
+public:
+ // construct/destruct
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr any() _NOEXCEPT : __h(nullptr) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ any(any const & __other) : __h(nullptr)
+ {
+ if (__other.__h) __other.__call(_Action::_Copy, this);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ any(any && __other) _NOEXCEPT : __h(nullptr)
+ {
+ if (__other.__h) __other.__call(_Action::_Move, this);
+ }
+
+ template <
+ class _ValueType
+ , class _Tp = decay_t<_ValueType>
+ , class = enable_if_t<
+ !is_same<_Tp, any>::value &&
+ !__is_inplace_type<_ValueType>::value &&
+ is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ any(_ValueType && __value);
+
+ template <class _ValueType, class ..._Args,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<
+ is_constructible<_Tp, _Args...>::value &&
+ is_copy_constructible<_Tp>::value
+ >
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit any(in_place_type_t<_ValueType>, _Args&&... __args);
+
+ template <class _ValueType, class _Up, class ..._Args,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<
+ is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
+ is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args);
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~any() { this->reset(); }
+
+ // assignments
+ _LIBCPP_INLINE_VISIBILITY
+ any & operator=(any const & __rhs) {
+ any(__rhs).swap(*this);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ any & operator=(any && __rhs) _NOEXCEPT {
+ any(_VSTD::move(__rhs)).swap(*this);
+ return *this;
+ }
+
+ template <
+ class _ValueType
+ , class _Tp = decay_t<_ValueType>
+ , class = enable_if_t<
+ !is_same<_Tp, any>::value
+ && is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ any & operator=(_ValueType && __rhs);
+
+ template <class _ValueType, class ..._Args,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<
+ is_constructible<_Tp, _Args...>::value &&
+ is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ _Tp& emplace(_Args&&... args);
+
+ template <class _ValueType, class _Up, class ..._Args,
+ class _Tp = decay_t<_ValueType>,
+ class = enable_if_t<
+ is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
+ is_copy_constructible<_Tp>::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ _Tp& emplace(initializer_list<_Up>, _Args&&...);
+
+ // 6.3.3 any modifiers
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() _NOEXCEPT { if (__h) this->__call(_Action::_Destroy); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(any & __rhs) _NOEXCEPT;
+
+ // 6.3.4 any observers
+ _LIBCPP_INLINE_VISIBILITY
+ bool has_value() const _NOEXCEPT { return __h != nullptr; }
+
+#if !defined(_LIBCPP_NO_RTTI)
+ _LIBCPP_INLINE_VISIBILITY
+ const type_info & type() const _NOEXCEPT {
+ if (__h) {
+ return *static_cast<type_info const *>(this->__call(_Action::_TypeInfo));
+ } else {
+ return typeid(void);
+ }
+ }
+#endif
+
+private:
+ typedef __any_imp::_Action _Action;
+ using _HandleFuncPtr = void* (*)(_Action, any const *, any *, const type_info *,
+ const void* __fallback_info);
+
+ union _Storage {
+ constexpr _Storage() : __ptr(nullptr) {}
+ void * __ptr;
+ __any_imp::_Buffer __buf;
+ };
+
+ _LIBCPP_ALWAYS_INLINE
+ void * __call(_Action __a, any * __other = nullptr,
+ type_info const * __info = nullptr,
+ const void* __fallback_info = nullptr) const
+ {
+ return __h(__a, this, __other, __info, __fallback_info);
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ void * __call(_Action __a, any * __other = nullptr,
+ type_info const * __info = nullptr,
+ const void* __fallback_info = nullptr)
+ {
+ return __h(__a, this, __other, __info, __fallback_info);
+ }
+
+ template <class>
+ friend struct __any_imp::_SmallHandler;
+ template <class>
+ friend struct __any_imp::_LargeHandler;
+
+ template <class _ValueType>
+ friend add_pointer_t<add_const_t<_ValueType>>
+ any_cast(any const *) _NOEXCEPT;
+
+ template <class _ValueType>
+ friend add_pointer_t<_ValueType>
+ any_cast(any *) _NOEXCEPT;
+
+ _HandleFuncPtr __h = nullptr;
+ _Storage __s;
+};
+
+namespace __any_imp
+{
+ template <class _Tp>
+ struct _LIBCPP_TEMPLATE_VIS _SmallHandler
+ {
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __handle(_Action __act, any const * __this, any * __other,
+ type_info const * __info, const void* __fallback_info)
+ {
+ switch (__act)
+ {
+ case _Action::_Destroy:
+ __destroy(const_cast<any &>(*__this));
+ return nullptr;
+ case _Action::_Copy:
+ __copy(*__this, *__other);
+ return nullptr;
+ case _Action::_Move:
+ __move(const_cast<any &>(*__this), *__other);
+ return nullptr;
+ case _Action::_Get:
+ return __get(const_cast<any &>(*__this), __info, __fallback_info);
+ case _Action::_TypeInfo:
+ return __type_info();
+ }
+ }
+
+ template <class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY
+ static _Tp& __create(any & __dest, _Args&&... __args) {
+ _Tp* __ret = ::new (static_cast<void*>(&__dest.__s.__buf)) _Tp(_VSTD::forward<_Args>(__args)...);
+ __dest.__h = &_SmallHandler::__handle;
+ return *__ret;
+ }
+
+ private:
+ _LIBCPP_INLINE_VISIBILITY
+ static void __destroy(any & __this) {
+ _Tp & __value = *static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));
+ __value.~_Tp();
+ __this.__h = nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __copy(any const & __this, any & __dest) {
+ _SmallHandler::__create(__dest, *static_cast<_Tp const *>(
+ static_cast<void const *>(&__this.__s.__buf)));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __move(any & __this, any & __dest) {
+ _SmallHandler::__create(__dest, _VSTD::move(
+ *static_cast<_Tp*>(static_cast<void*>(&__this.__s.__buf))));
+ __destroy(__this);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __get(any & __this,
+ type_info const * __info,
+ const void* __fallback_id)
+ {
+ if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_id))
+ return static_cast<void*>(&__this.__s.__buf);
+ return nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __type_info()
+ {
+#if !defined(_LIBCPP_NO_RTTI)
+ return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
+#else
+ return nullptr;
+#endif
+ }
+ };
+
+ template <class _Tp>
+ struct _LIBCPP_TEMPLATE_VIS _LargeHandler
+ {
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __handle(_Action __act, any const * __this,
+ any * __other, type_info const * __info,
+ void const* __fallback_info)
+ {
+ switch (__act)
+ {
+ case _Action::_Destroy:
+ __destroy(const_cast<any &>(*__this));
+ return nullptr;
+ case _Action::_Copy:
+ __copy(*__this, *__other);
+ return nullptr;
+ case _Action::_Move:
+ __move(const_cast<any &>(*__this), *__other);
+ return nullptr;
+ case _Action::_Get:
+ return __get(const_cast<any &>(*__this), __info, __fallback_info);
+ case _Action::_TypeInfo:
+ return __type_info();
+ }
+ }
+
+ template <class ..._Args>
+ _LIBCPP_INLINE_VISIBILITY
+ static _Tp& __create(any & __dest, _Args&&... __args) {
+ typedef allocator<_Tp> _Alloc;
+ typedef __allocator_destructor<_Alloc> _Dp;
+ _Alloc __a;
+ unique_ptr<_Tp, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
+ _Tp* __ret = ::new ((void*)__hold.get()) _Tp(_VSTD::forward<_Args>(__args)...);
+ __dest.__s.__ptr = __hold.release();
+ __dest.__h = &_LargeHandler::__handle;
+ return *__ret;
+ }
+
+ private:
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __destroy(any & __this){
+ delete static_cast<_Tp*>(__this.__s.__ptr);
+ __this.__h = nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __copy(any const & __this, any & __dest) {
+ _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void __move(any & __this, any & __dest) {
+ __dest.__s.__ptr = __this.__s.__ptr;
+ __dest.__h = &_LargeHandler::__handle;
+ __this.__h = nullptr;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __get(any & __this, type_info const * __info,
+ void const* __fallback_info)
+ {
+ if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_info))
+ return static_cast<void*>(__this.__s.__ptr);
+ return nullptr;
+
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ static void* __type_info()
+ {
+#if !defined(_LIBCPP_NO_RTTI)
+ return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
+#else
+ return nullptr;
+#endif
+ }
+ };
+
+} // namespace __any_imp
+
+
+template <class _ValueType, class _Tp, class>
+any::any(_ValueType && __v) : __h(nullptr)
+{
+ __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_ValueType>(__v));
+}
+
+template <class _ValueType, class ..._Args, class _Tp, class>
+any::any(in_place_type_t<_ValueType>, _Args&&... __args) {
+ __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
+};
+
+template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
+any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) {
+ __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _ValueType, class, class>
+inline _LIBCPP_INLINE_VISIBILITY
+any & any::operator=(_ValueType && __v)
+{
+ any(_VSTD::forward<_ValueType>(__v)).swap(*this);
+ return *this;
+}
+
+template <class _ValueType, class ..._Args, class _Tp, class>
+inline _LIBCPP_INLINE_VISIBILITY
+_Tp& any::emplace(_Args&&... __args) {
+ reset();
+ return __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
+inline _LIBCPP_INLINE_VISIBILITY
+_Tp& any::emplace(initializer_list<_Up> __il, _Args&&... __args) {
+ reset();
+ return __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void any::swap(any & __rhs) _NOEXCEPT
+{
+ if (this == &__rhs)
+ return;
+ if (__h && __rhs.__h) {
+ any __tmp;
+ __rhs.__call(_Action::_Move, &__tmp);
+ this->__call(_Action::_Move, &__rhs);
+ __tmp.__call(_Action::_Move, this);
+ }
+ else if (__h) {
+ this->__call(_Action::_Move, &__rhs);
+ }
+ else if (__rhs.__h) {
+ __rhs.__call(_Action::_Move, this);
+ }
+}
+
+// 6.4 Non-member functions
+
+inline _LIBCPP_INLINE_VISIBILITY
+void swap(any & __lhs, any & __rhs) _NOEXCEPT
+{
+ __lhs.swap(__rhs);
+}
+
+template <class _Tp, class ..._Args>
+inline _LIBCPP_INLINE_VISIBILITY
+any make_any(_Args&&... __args) {
+ return any(in_place_type<_Tp>, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _Tp, class _Up, class ..._Args>
+inline _LIBCPP_INLINE_VISIBILITY
+any make_any(initializer_list<_Up> __il, _Args&&... __args) {
+ return any(in_place_type<_Tp>, __il, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any const & __v)
+{
+ using _RawValueType = __uncvref_t<_ValueType>;
+ static_assert(is_constructible<_ValueType, _RawValueType const &>::value,
+ "ValueType is required to be a const lvalue reference "
+ "or a CopyConstructible type");
+ auto __tmp = _VSTD::any_cast<add_const_t<_RawValueType>>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return static_cast<_ValueType>(*__tmp);
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any & __v)
+{
+ using _RawValueType = __uncvref_t<_ValueType>;
+ static_assert(is_constructible<_ValueType, _RawValueType &>::value,
+ "ValueType is required to be an lvalue reference "
+ "or a CopyConstructible type");
+ auto __tmp = _VSTD::any_cast<_RawValueType>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return static_cast<_ValueType>(*__tmp);
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+_ValueType any_cast(any && __v)
+{
+ using _RawValueType = __uncvref_t<_ValueType>;
+ static_assert(is_constructible<_ValueType, _RawValueType>::value,
+ "ValueType is required to be an rvalue reference "
+ "or a CopyConstructible type");
+ auto __tmp = _VSTD::any_cast<_RawValueType>(&__v);
+ if (__tmp == nullptr)
+ __throw_bad_any_cast();
+ return static_cast<_ValueType>(_VSTD::move(*__tmp));
+}
+
+template <class _ValueType>
+inline _LIBCPP_INLINE_VISIBILITY
+add_pointer_t<add_const_t<_ValueType>>
+any_cast(any const * __any) _NOEXCEPT
+{
+ static_assert(!is_reference<_ValueType>::value,
+ "_ValueType may not be a reference.");
+ return _VSTD::any_cast<_ValueType>(const_cast<any *>(__any));
+}
+
+template <class _RetType>
+inline _LIBCPP_INLINE_VISIBILITY
+_RetType __pointer_or_func_cast(void* __p, /*IsFunction*/false_type) noexcept {
+ return static_cast<_RetType>(__p);
+}
+
+template <class _RetType>
+inline _LIBCPP_INLINE_VISIBILITY
+_RetType __pointer_or_func_cast(void*, /*IsFunction*/true_type) noexcept {
+ return nullptr;
+}
+
+template <class _ValueType>
+add_pointer_t<_ValueType>
+any_cast(any * __any) _NOEXCEPT
+{
+ using __any_imp::_Action;
+ static_assert(!is_reference<_ValueType>::value,
+ "_ValueType may not be a reference.");
+ typedef typename add_pointer<_ValueType>::type _ReturnType;
+ if (__any && __any->__h) {
+ void *__p = __any->__call(_Action::_Get, nullptr,
+#if !defined(_LIBCPP_NO_RTTI)
+ &typeid(_ValueType),
+#else
+ nullptr,
+#endif
+ __any_imp::__get_fallback_typeid<_ValueType>());
+ return _VSTD::__pointer_or_func_cast<_ReturnType>(
+ __p, is_function<_ValueType>{});
+ }
+ return nullptr;
+}
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_ANY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/array b/chromium/buildtools/third_party/libc++/trunk/include/array
index 8866eaf6b46..31f5501b9bc 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/array
+++ b/chromium/buildtools/third_party/libc++/trunk/include/array
@@ -34,7 +34,7 @@ struct array
// No explicit construct/copy/destroy for aggregate type
void fill(const T& u);
- void swap(array& a) noexcept(noexcept(swap(declval<T&>(), declval<T&>())));
+ void swap(array& a) noexcept(is_nothrow_swappable_v<T>);
// iterators:
iterator begin() noexcept;
@@ -108,9 +108,6 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
#include <iterator>
#include <algorithm>
#include <stdexcept>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -119,7 +116,7 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, size_t _Size>
-struct _LIBCPP_TYPE_VIS_ONLY array
+struct _LIBCPP_TEMPLATE_VIS array
{
// types:
typedef array __self;
@@ -141,35 +138,42 @@ struct _LIBCPP_TYPE_VIS_ONLY array
_LIBCPP_INLINE_VISIBILITY void fill(const value_type& __u)
{_VSTD::fill_n(__elems_, _Size, __u);}
_LIBCPP_INLINE_VISIBILITY
- void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
- {_VSTD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
+ void swap(array& __a) _NOEXCEPT_(_Size == 0 || __is_nothrow_swappable<_Tp>::value)
+ { __swap_dispatch((std::integral_constant<bool, _Size == 0>()), __a); }
- // iterators:
_LIBCPP_INLINE_VISIBILITY
- iterator begin() _NOEXCEPT {return iterator(__elems_);}
+ void __swap_dispatch(std::true_type, array&) {}
+
_LIBCPP_INLINE_VISIBILITY
+ void __swap_dispatch(std::false_type, array& __a)
+ { _VSTD::swap_ranges(__elems_, __elems_ + _Size, __a.__elems_);}
+
+ // iterators:
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ iterator begin() _NOEXCEPT {return iterator(__elems_);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const_iterator begin() const _NOEXCEPT {return const_iterator(__elems_);}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
iterator end() _NOEXCEPT {return iterator(__elems_ + _Size);}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const_iterator end() const _NOEXCEPT {return const_iterator(__elems_ + _Size);}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const_iterator cbegin() const _NOEXCEPT {return begin();}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const_iterator cend() const _NOEXCEPT {return end();}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
// capacity:
@@ -181,32 +185,33 @@ struct _LIBCPP_TYPE_VIS_ONLY array
_LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;}
// element access:
- _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __elems_[__n];}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference operator[](size_type __n) const {return __elems_[__n];}
- reference at(size_type __n);
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator[](size_type __n) {return __elems_[__n];}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const_reference operator[](size_type __n) const {return __elems_[__n];}
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n);
_LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const;
- _LIBCPP_INLINE_VISIBILITY reference front() {return __elems_[0];}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() {return __elems_[0];}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const {return __elems_[0];}
- _LIBCPP_INLINE_VISIBILITY reference back() {return __elems_[_Size > 0 ? _Size-1 : 0];}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() {return __elems_[_Size > 0 ? _Size-1 : 0];}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const {return __elems_[_Size > 0 ? _Size-1 : 0];}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
value_type* data() _NOEXCEPT {return __elems_;}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
const value_type* data() const _NOEXCEPT {return __elems_;}
};
template <class _Tp, size_t _Size>
+_LIBCPP_CONSTEXPR_AFTER_CXX14
typename array<_Tp, _Size>::reference
array<_Tp, _Size>::at(size_type __n)
{
if (__n >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("array::at");
-#else
- assert(!"array::at out_of_range");
-#endif
+ __throw_out_of_range("array::at");
+
return __elems_[__n];
}
@@ -216,11 +221,7 @@ typename array<_Tp, _Size>::const_reference
array<_Tp, _Size>::at(size_type __n) const
{
if (__n >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("array::at");
-#else
- assert(!"array::at out_of_range");
-#endif
+ __throw_out_of_range("array::at");
return __elems_[__n];
}
@@ -276,21 +277,22 @@ template <class _Tp, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
+ _Size == 0 ||
__is_swappable<_Tp>::value,
void
>::type
-swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
- _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
+swap(array<_Tp, _Size>& __x, array<_Tp, _Size>& __y)
+ _NOEXCEPT_(noexcept(__x.swap(__y)))
{
__x.swap(__y);
}
template <class _Tp, size_t _Size>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<array<_Tp, _Size> >
+class _LIBCPP_TEMPLATE_VIS tuple_size<array<_Tp, _Size> >
: public integral_constant<size_t, _Size> {};
template <size_t _Ip, class _Tp, size_t _Size>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, array<_Tp, _Size> >
+class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, array<_Tp, _Size> >
{
public:
typedef _Tp type;
@@ -314,7 +316,7 @@ get(const array<_Tp, _Size>& __a) _NOEXCEPT
return __a.__elems_[_Ip];
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <size_t _Ip, class _Tp, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -334,7 +336,7 @@ get(const array<_Tp, _Size>&& __a) _NOEXCEPT
return _VSTD::move(__a.__elems_[_Ip]);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // !_LIBCPP_CXX03_LANG
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/atomic b/chromium/buildtools/third_party/libc++/trunk/include/atomic
index abec2a0b565..f55e28ff5e9 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/atomic
+++ b/chromium/buildtools/third_party/libc++/trunk/include/atomic
@@ -17,6 +17,10 @@
namespace std
{
+// feature test macro
+
+#define __cpp_lib_atomic_is_always_lock_free // as specified by SG10
+
// order and consistency
typedef enum memory_order
@@ -89,6 +93,7 @@ void
template <class T>
struct atomic
{
+ static constexpr bool is_always_lock_free;
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
void store(T desr, memory_order m = memory_order_seq_cst) volatile noexcept;
@@ -127,6 +132,7 @@ struct atomic
template <>
struct atomic<integral>
{
+ static constexpr bool is_always_lock_free;
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
void store(integral desr, memory_order m = memory_order_seq_cst) volatile noexcept;
@@ -202,6 +208,7 @@ struct atomic<integral>
template <class T>
struct atomic<T*>
{
+ static constexpr bool is_always_lock_free;
bool is_lock_free() const volatile noexcept;
bool is_lock_free() const noexcept;
void store(T* desr, memory_order m = memory_order_seq_cst) volatile noexcept;
@@ -508,6 +515,15 @@ typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
typedef atomic<int_fast64_t> atomic_int_fast64_t;
typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
+typedef atomic<int8_t> atomic_int8_t;
+typedef atomic<uint8_t> atomic_uint8_t;
+typedef atomic<int16_t> atomic_int16_t;
+typedef atomic<uint16_t> atomic_uint16_t;
+typedef atomic<int32_t> atomic_int32_t;
+typedef atomic<uint32_t> atomic_uint32_t;
+typedef atomic<int64_t> atomic_int64_t;
+typedef atomic<uint64_t> atomic_uint64_t;
+
typedef atomic<intptr_t> atomic_intptr_t;
typedef atomic<uintptr_t> atomic_uintptr_t;
typedef atomic<size_t> atomic_size_t;
@@ -540,6 +556,26 @@ void atomic_signal_fence(memory_order m) noexcept;
#error <atomic> is not implemented
#endif
+#if _LIBCPP_STD_VER > 14
+# define __cpp_lib_atomic_is_always_lock_free 201603L
+#endif
+
+#define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \
+ _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_consume || \
+ __m == memory_order_acquire || \
+ __m == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
+#define _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m) \
+ _LIBCPP_DIAGNOSE_WARNING(__m == memory_order_release || \
+ __m == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
+#define _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__m, __f) \
+ _LIBCPP_DIAGNOSE_WARNING(__f == memory_order_release || \
+ __f == memory_order_acq_rel, \
+ "memory order argument to atomic operation is invalid")
+
_LIBCPP_BEGIN_NAMESPACE_STD
typedef enum memory_order
@@ -559,11 +595,11 @@ struct __gcc_atomic_t {
#endif
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__gcc_atomic_t() _NOEXCEPT = default;
#else
__gcc_atomic_t() _NOEXCEPT : __a_value() {}
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_CONSTEXPR explicit __gcc_atomic_t(_Tp value) _NOEXCEPT
: __a_value(value) {}
_Tp __a_value;
@@ -825,6 +861,30 @@ kill_dependency(_Tp __y) _NOEXCEPT
return __y;
}
+#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
+# define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
+# define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
+# define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
+# define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
+# define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
+# define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
+# define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
+# define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
+# define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
+# define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
+#else
+# define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
+# define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
+# define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
+# define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
+# define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
+# define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
+# define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
+# define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
+# define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
+# define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
+#endif
+
// general atomic<T>
template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
@@ -832,6 +892,10 @@ struct __atomic_base // false
{
mutable _Atomic(_Tp) __a_;
+#if defined(__cpp_lib_atomic_is_always_lock_free)
+ static _LIBCPP_CONSTEXPR bool is_always_lock_free = __atomic_always_lock_free(sizeof(__a_), 0);
+#endif
+
_LIBCPP_INLINE_VISIBILITY
bool is_lock_free() const volatile _NOEXCEPT
{
@@ -846,15 +910,19 @@ struct __atomic_base // false
{return static_cast<__atomic_base const volatile*>(this)->is_lock_free();}
_LIBCPP_INLINE_VISIBILITY
void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
{__c11_atomic_store(&__a_, __d, __m);}
_LIBCPP_INLINE_VISIBILITY
void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
{__c11_atomic_store(&__a_, __d, __m);}
_LIBCPP_INLINE_VISIBILITY
_Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
{return __c11_atomic_load(&__a_, __m);}
_LIBCPP_INLINE_VISIBILITY
_Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
{return __c11_atomic_load(&__a_, __m);}
_LIBCPP_INLINE_VISIBILITY
operator _Tp() const volatile _NOEXCEPT {return load();}
@@ -869,18 +937,22 @@ struct __atomic_base // false
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_weak(_Tp& __e, _Tp __d,
memory_order __s, memory_order __f) volatile _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_weak(_Tp& __e, _Tp __d,
memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_strong(_Tp& __e, _Tp __d,
memory_order __s, memory_order __f) volatile _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_strong(_Tp& __e, _Tp __d,
memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
_LIBCPP_INLINE_VISIBILITY
bool compare_exchange_weak(_Tp& __e, _Tp __d,
@@ -900,26 +972,31 @@ struct __atomic_base // false
{return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__atomic_base() _NOEXCEPT = default;
#else
__atomic_base() _NOEXCEPT : __a_() {}
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__atomic_base(const __atomic_base&) = delete;
__atomic_base& operator=(const __atomic_base&) = delete;
__atomic_base& operator=(const __atomic_base&) volatile = delete;
-#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#else
private:
__atomic_base(const __atomic_base&);
__atomic_base& operator=(const __atomic_base&);
__atomic_base& operator=(const __atomic_base&) volatile;
-#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#endif
};
+#if defined(__cpp_lib_atomic_is_always_lock_free)
+template <class _Tp, bool __b>
+_LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
+#endif
+
// atomic<Integral>
template <class _Tp>
@@ -1141,6 +1218,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
{
__o->store(__d, __m);
}
@@ -1149,6 +1227,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m)
{
__o->store(__d, __m);
}
@@ -1177,6 +1256,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
{
return __o->load(__m);
}
@@ -1185,6 +1265,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
+ _LIBCPP_CHECK_LOAD_MEMORY_ORDER(__m)
{
return __o->load(__m);
}
@@ -1269,6 +1350,7 @@ bool
atomic_compare_exchange_weak_explicit(volatile atomic<_Tp>* __o, _Tp* __e,
_Tp __d,
memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{
return __o->compare_exchange_weak(*__e, __d, __s, __f);
}
@@ -1278,6 +1360,7 @@ inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_weak_explicit(atomic<_Tp>* __o, _Tp* __e, _Tp __d,
memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{
return __o->compare_exchange_weak(*__e, __d, __s, __f);
}
@@ -1290,6 +1373,7 @@ bool
atomic_compare_exchange_strong_explicit(volatile atomic<_Tp>* __o,
_Tp* __e, _Tp __d,
memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{
return __o->compare_exchange_strong(*__e, __d, __s, __f);
}
@@ -1300,6 +1384,7 @@ bool
atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, _Tp* __e,
_Tp __d,
memory_order __s, memory_order __f) _NOEXCEPT
+ _LIBCPP_CHECK_EXCHANGE_MEMORY_ORDER(__s, __f)
{
return __o->compare_exchange_strong(*__e, __d, __s, __f);
}
@@ -1650,25 +1735,25 @@ typedef struct atomic_flag
{__c11_atomic_store(&__a_, false, __m);}
_LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
atomic_flag() _NOEXCEPT = default;
#else
atomic_flag() _NOEXCEPT : __a_() {}
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {}
+ atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
atomic_flag(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) volatile = delete;
-#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#else
private:
atomic_flag(const atomic_flag&);
atomic_flag& operator=(const atomic_flag&);
atomic_flag& operator=(const atomic_flag&) volatile;
-#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#endif
} atomic_flag;
inline _LIBCPP_INLINE_VISIBILITY
@@ -1779,6 +1864,15 @@ typedef atomic<uint_fast32_t> atomic_uint_fast32_t;
typedef atomic<int_fast64_t> atomic_int_fast64_t;
typedef atomic<uint_fast64_t> atomic_uint_fast64_t;
+typedef atomic< int8_t> atomic_int8_t;
+typedef atomic<uint8_t> atomic_uint8_t;
+typedef atomic< int16_t> atomic_int16_t;
+typedef atomic<uint16_t> atomic_uint16_t;
+typedef atomic< int32_t> atomic_int32_t;
+typedef atomic<uint32_t> atomic_uint32_t;
+typedef atomic< int64_t> atomic_int64_t;
+typedef atomic<uint64_t> atomic_uint64_t;
+
typedef atomic<intptr_t> atomic_intptr_t;
typedef atomic<uintptr_t> atomic_uintptr_t;
typedef atomic<size_t> atomic_size_t;
@@ -1789,17 +1883,6 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
#define ATOMIC_FLAG_INIT {false}
#define ATOMIC_VAR_INIT(__v) {__v}
-#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
-#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
-#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
-#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
-#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
-#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
-#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
-#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
-#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
-#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
-
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_ATOMIC
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/bitset b/chromium/buildtools/third_party/libc++/trunk/include/bitset
index 87d7afca5a7..b49c93ce222 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/bitset
+++ b/chromium/buildtools/third_party/libc++/trunk/include/bitset
@@ -125,9 +125,6 @@ template <size_t N> struct hash<std::bitset<N>>;
#include <stdexcept>
#include <iosfwd>
#include <__functional_base>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
#include <__undef_min_max>
@@ -200,11 +197,11 @@ protected:
_LIBCPP_INLINE_VISIBILITY
size_t __hash_code() const _NOEXCEPT;
private:
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
void __init(unsigned long long __v, false_type) _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
void __init(unsigned long long __v, true_type) _NOEXCEPT;
-#endif // _LIBCPP_HAS_NO_CONSTEXPR
+#endif // _LIBCPP_CXX03_LANG
unsigned long to_ulong(false_type) const;
_LIBCPP_INLINE_VISIBILITY
unsigned long to_ulong(true_type) const;
@@ -220,16 +217,16 @@ template <size_t _N_words, size_t _Size>
inline
_LIBCPP_CONSTEXPR
__bitset<_N_words, _Size>::__bitset() _NOEXCEPT
-#ifndef _LIBCPP_HAS_NO_CONSTEXPR
+#ifndef _LIBCPP_CXX03_LANG
: __first_{0}
#endif
{
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
_VSTD::fill_n(__first_, _N_words, __storage_type(0));
#endif
}
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
template <size_t _N_words, size_t _Size>
void
@@ -252,23 +249,23 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
}
-#endif // _LIBCPP_HAS_NO_CONSTEXPR
+#endif // _LIBCPP_CXX03_LANG
template <size_t _N_words, size_t _Size>
inline
_LIBCPP_CONSTEXPR
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
-#ifndef _LIBCPP_HAS_NO_CONSTEXPR
+#ifndef _LIBCPP_CXX03_LANG
#if __SIZEOF_SIZE_T__ == 8
: __first_{__v}
#elif __SIZEOF_SIZE_T__ == 4
- : __first_{__v, __v >> __bits_per_word}
+ : __first_{static_cast<__storage_type>(__v), static_cast<__storage_type>(__v >> __bits_per_word)}
#else
#error This constructor has not been ported to this platform
#endif
#endif
{
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
__init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
#endif
}
@@ -326,11 +323,8 @@ __bitset<_N_words, _Size>::to_ulong(false_type) const
const_iterator __e = __make_iter(_Size);
const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long) * CHAR_BIT), __e, true);
if (__i != __e)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw overflow_error("bitset to_ulong overflow error");
-#else
- assert(!"bitset to_ulong overflow error");
-#endif
+ __throw_overflow_error("bitset to_ulong overflow error");
+
return __first_[0];
}
@@ -349,11 +343,8 @@ __bitset<_N_words, _Size>::to_ullong(false_type) const
const_iterator __e = __make_iter(_Size);
const_iterator __i = _VSTD::find(__make_iter(sizeof(unsigned long long) * CHAR_BIT), __e, true);
if (__i != __e)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw overflow_error("bitset to_ullong overflow error");
-#else
- assert(!"bitset to_ullong overflow error");
-#endif
+ __throw_overflow_error("bitset to_ullong overflow error");
+
return to_ullong(true_type());
}
@@ -655,11 +646,11 @@ __bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
{
}
-template <size_t _Size> class _LIBCPP_TYPE_VIS_ONLY bitset;
-template <size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY hash<bitset<_Size> >;
+template <size_t _Size> class _LIBCPP_TEMPLATE_VIS bitset;
+template <size_t _Size> struct hash<bitset<_Size> >;
template <size_t _Size>
-class _LIBCPP_TYPE_VIS_ONLY bitset
+class _LIBCPP_TEMPLATE_VIS bitset
: private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
{
public:
@@ -763,11 +754,8 @@ bitset<_Size>::bitset(const _CharT* __str,
size_t __rlen = _VSTD::min(__n, char_traits<_CharT>::length(__str));
for (size_t __i = 0; __i < __rlen; ++__i)
if (__str[__i] != __zero && __str[__i] != __one)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw invalid_argument("bitset string ctor has invalid argument");
-#else
- assert(!"bitset string ctor has invalid argument");
-#endif
+ __throw_invalid_argument("bitset string ctor has invalid argument");
+
size_t _Mp = _VSTD::min(__rlen, _Size);
size_t __i = 0;
for (; __i < _Mp; ++__i)
@@ -789,19 +777,13 @@ bitset<_Size>::bitset(const basic_string<_CharT,_Traits,_Allocator>& __str,
_CharT __zero, _CharT __one)
{
if (__pos > __str.size())
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset string pos out of range");
-#else
- assert(!"bitset string pos out of range");
-#endif
+ __throw_out_of_range("bitset string pos out of range");
+
size_t __rlen = _VSTD::min(__n, __str.size() - __pos);
for (size_t __i = __pos; __i < __pos + __rlen; ++__i)
if (!_Traits::eq(__str[__i], __zero) && !_Traits::eq(__str[__i], __one))
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw invalid_argument("bitset string ctor has invalid argument");
-#else
- assert(!"bitset string ctor has invalid argument");
-#endif
+ __throw_invalid_argument("bitset string ctor has invalid argument");
+
size_t _Mp = _VSTD::min(__rlen, _Size);
size_t __i = 0;
for (; __i < _Mp; ++__i)
@@ -876,11 +858,8 @@ bitset<_Size>&
bitset<_Size>::set(size_t __pos, bool __val)
{
if (__pos >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset set argument out of range");
-#else
- assert(!"bitset set argument out of range");
-#endif
+ __throw_out_of_range("bitset set argument out of range");
+
(*this)[__pos] = __val;
return *this;
}
@@ -899,11 +878,8 @@ bitset<_Size>&
bitset<_Size>::reset(size_t __pos)
{
if (__pos >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset reset argument out of range");
-#else
- assert(!"bitset reset argument out of range");
-#endif
+ __throw_out_of_range("bitset reset argument out of range");
+
(*this)[__pos] = false;
return *this;
}
@@ -932,11 +908,8 @@ bitset<_Size>&
bitset<_Size>::flip(size_t __pos)
{
if (__pos >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset flip argument out of range");
-#else
- assert(!"bitset flip argument out of range");
-#endif
+ __throw_out_of_range("bitset flip argument out of range");
+
reference r = base::__make_ref(__pos);
r = ~r;
return *this;
@@ -1027,11 +1000,8 @@ bool
bitset<_Size>::test(size_t __pos) const
{
if (__pos >= _Size)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("bitset test argument out of range");
-#else
- assert(!"bitset test argument out of range");
-#endif
+ __throw_out_of_range("bitset test argument out of range");
+
return (*this)[__pos];
}
@@ -1102,7 +1072,7 @@ operator^(const bitset<_Size>& __x, const bitset<_Size>& __y) _NOEXCEPT
}
template <size_t _Size>
-struct _LIBCPP_TYPE_VIS_ONLY hash<bitset<_Size> >
+struct _LIBCPP_TEMPLATE_VIS hash<bitset<_Size> >
: public unary_function<bitset<_Size>, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/cctype b/chromium/buildtools/third_party/libc++/trunk/include/cctype
index a68c2a06604..7fc81344696 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/cctype
+++ b/chromium/buildtools/third_party/libc++/trunk/include/cctype
@@ -44,6 +44,63 @@ int toupper(int c);
_LIBCPP_BEGIN_NAMESPACE_STD
+#ifdef isalnum
+#undef isalnum
+#endif
+
+#ifdef isalpha
+#undef isalpha
+#endif
+
+#ifdef isblank
+#undef isblank
+#endif
+
+#ifdef iscntrl
+#undef iscntrl
+#endif
+
+#ifdef isdigit
+#undef isdigit
+#endif
+
+#ifdef isgraph
+#undef isgraph
+#endif
+
+#ifdef islower
+#undef islower
+#endif
+
+#ifdef isprint
+#undef isprint
+#endif
+
+#ifdef ispunct
+#undef ispunct
+#endif
+
+#ifdef isspace
+#undef isspace
+#endif
+
+#ifdef isupper
+#undef isupper
+#endif
+
+#ifdef isxdigit
+#undef isxdigit
+#endif
+
+#ifdef tolower
+#undef tolower
+#endif
+
+#ifdef toupper
+#undef toupper
+#endif
+
+
using ::isalnum;
using ::isalpha;
using ::isblank;
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/chrono b/chromium/buildtools/third_party/libc++/trunk/include/chrono
index 68484e98243..657808736d0 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/chrono
+++ b/chromium/buildtools/third_party/libc++/trunk/include/chrono
@@ -48,7 +48,7 @@ class duration
static_assert(Period::num > 0, "duration period must be positive");
public:
typedef Rep rep;
- typedef Period period;
+ typedef typename _Period::type period;
constexpr duration() = default;
template <class Rep2>
@@ -75,15 +75,15 @@ public:
// arithmetic
- constexpr duration operator+() const;
- constexpr duration operator-() const;
- duration& operator++();
- duration operator++(int);
- duration& operator--();
- duration operator--(int);
+ constexpr common_type<duration>::type operator+() const;
+ constexpr common_type<duration>::type operator-() const;
+ constexpr duration& operator++();
+ constexpr duration operator++(int);
+ constexpr duration& operator--();
+ constexpr duration operator--(int);
- duration& operator+=(const duration& d);
- duration& operator-=(const duration& d);
+ constexpr duration& operator+=(const duration& d);
+ constexpr duration& operator-=(const duration& d);
duration& operator*=(const rep& rhs);
duration& operator/=(const rep& rhs);
@@ -316,7 +316,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace chrono
{
-template <class _Rep, class _Period = ratio<1> > class _LIBCPP_TYPE_VIS_ONLY duration;
+template <class _Rep, class _Period = ratio<1> > class _LIBCPP_TEMPLATE_VIS duration;
template <class _Tp>
struct __is_duration : false_type {};
@@ -336,7 +336,7 @@ struct __is_duration<const volatile duration<_Rep, _Period> > : true_type {};
} // chrono
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<chrono::duration<_Rep1, _Period1>,
+struct _LIBCPP_TEMPLATE_VIS common_type<chrono::duration<_Rep1, _Period1>,
chrono::duration<_Rep2, _Period2> >
{
typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
@@ -414,7 +414,7 @@ duration_cast(const duration<_Rep, _Period>& __fd)
}
template <class _Rep>
-struct _LIBCPP_TYPE_VIS_ONLY treat_as_floating_point : is_floating_point<_Rep> {};
+struct _LIBCPP_TEMPLATE_VIS treat_as_floating_point : is_floating_point<_Rep> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Rep> _LIBCPP_CONSTEXPR bool treat_as_floating_point_v
@@ -422,7 +422,7 @@ template <class _Rep> _LIBCPP_CONSTEXPR bool treat_as_floating_point_v
#endif
template <class _Rep>
-struct _LIBCPP_TYPE_VIS_ONLY duration_values
+struct _LIBCPP_TEMPLATE_VIS duration_values
{
public:
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep zero() {return _Rep(0);}
@@ -485,7 +485,7 @@ round(const duration<_Rep, _Period>& __d)
// duration
template <class _Rep, class _Period>
-class _LIBCPP_TYPE_VIS_ONLY duration
+class _LIBCPP_TEMPLATE_VIS duration
{
static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration");
static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ratio");
@@ -523,13 +523,13 @@ class _LIBCPP_TYPE_VIS_ONLY duration
public:
typedef _Rep rep;
- typedef _Period period;
+ typedef typename _Period::type period;
private:
rep __rep_;
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
duration() = default;
#else
duration() {}
@@ -565,20 +565,20 @@ public:
// arithmetic
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration operator+() const {return *this;}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration operator-() const {return duration(-__rep_);}
- _LIBCPP_INLINE_VISIBILITY duration& operator++() {++__rep_; return *this;}
- _LIBCPP_INLINE_VISIBILITY duration operator++(int) {return duration(__rep_++);}
- _LIBCPP_INLINE_VISIBILITY duration& operator--() {--__rep_; return *this;}
- _LIBCPP_INLINE_VISIBILITY duration operator--(int) {return duration(__rep_--);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename common_type<duration>::type operator+() const {return typename common_type<duration>::type(*this);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename common_type<duration>::type operator-() const {return typename common_type<duration>::type(-__rep_);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator++() {++__rep_; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration operator++(int) {return duration(__rep_++);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator--() {--__rep_; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration operator--(int) {return duration(__rep_--);}
- _LIBCPP_INLINE_VISIBILITY duration& operator+=(const duration& __d) {__rep_ += __d.count(); return *this;}
- _LIBCPP_INLINE_VISIBILITY duration& operator-=(const duration& __d) {__rep_ -= __d.count(); return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator+=(const duration& __d) {__rep_ += __d.count(); return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator-=(const duration& __d) {__rep_ -= __d.count(); return *this;}
- _LIBCPP_INLINE_VISIBILITY duration& operator*=(const rep& rhs) {__rep_ *= rhs; return *this;}
- _LIBCPP_INLINE_VISIBILITY duration& operator/=(const rep& rhs) {__rep_ /= rhs; return *this;}
- _LIBCPP_INLINE_VISIBILITY duration& operator%=(const rep& rhs) {__rep_ %= rhs; return *this;}
- _LIBCPP_INLINE_VISIBILITY duration& operator%=(const duration& rhs) {__rep_ %= rhs.count(); return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator*=(const rep& rhs) {__rep_ *= rhs; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator/=(const rep& rhs) {__rep_ /= rhs; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator%=(const rep& rhs) {__rep_ %= rhs; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator%=(const duration& rhs) {__rep_ %= rhs.count(); return *this;}
// special values
@@ -828,7 +828,7 @@ operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
//////////////////////////////////////////////////////////
template <class _Clock, class _Duration = typename _Clock::duration>
-class _LIBCPP_TYPE_VIS_ONLY time_point
+class _LIBCPP_TEMPLATE_VIS time_point
{
static_assert(__is_duration<_Duration>::value,
"Second template parameter of time_point must be a std::chrono::duration");
@@ -872,7 +872,7 @@ public:
} // chrono
template <class _Clock, class _Duration1, class _Duration2>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<chrono::time_point<_Clock, _Duration1>,
+struct _LIBCPP_TEMPLATE_VIS common_type<chrono::time_point<_Clock, _Duration1>,
chrono::time_point<_Clock, _Duration2> >
{
typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
@@ -1026,7 +1026,8 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
{
- return __lhs + (-__rhs);
+ typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Ret;
+ return _Ret(__lhs.time_since_epoch() -__rhs);
}
// duration operator-(time_point x, time_point y);
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/cmath b/chromium/buildtools/third_party/libc++/trunk/include/cmath
index ebbde18168f..b41f247af59 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/cmath
+++ b/chromium/buildtools/third_party/libc++/trunk/include/cmath
@@ -209,6 +209,10 @@ floating_point hypot (arithmetic x, arithmetic y);
float hypotf(float x, float y);
long double hypotl(long double x, long double y);
+double hypot(double x, double y, double z); // C++17
+float hypot(float x, float y, float z); // C++17
+long double hypot(long double x, long double y, long double z); // C++17
+
int ilogb (arithmetic x);
int ilogbf(float x);
int ilogbl(long double x);
@@ -327,7 +331,6 @@ using ::double_t;
using ::abs;
#endif
-#ifndef __sun__
using ::acos;
using ::acosf;
using ::asin;
@@ -342,58 +345,47 @@ using ::cos;
using ::cosf;
using ::cosh;
using ::coshf;
-#endif // __sun__
using ::exp;
using ::expf;
-#ifndef __sun__
using ::fabs;
using ::fabsf;
using ::floor;
using ::floorf;
-#endif //__sun__
using ::fmod;
using ::fmodf;
-#ifndef __sun__
using ::frexp;
using ::frexpf;
using ::ldexp;
using ::ldexpf;
-#endif // __sun__
using ::log;
using ::logf;
-#ifndef __sun__
using ::log10;
using ::log10f;
using ::modf;
using ::modff;
-#endif // __sun__
using ::pow;
using ::powf;
-#ifndef __sun__
using ::sin;
using ::sinf;
using ::sinh;
using ::sinhf;
-#endif // __sun__
using ::sqrt;
using ::sqrtf;
using ::tan;
using ::tanf;
-#ifndef __sun__
using ::tanh;
using ::tanhf;
-#ifndef _LIBCPP_MSVCRT
using ::acosh;
using ::acoshf;
using ::asinh;
@@ -402,12 +394,10 @@ using ::atanh;
using ::atanhf;
using ::cbrt;
using ::cbrtf;
-#endif
using ::copysign;
using ::copysignf;
-#ifndef _LIBCPP_MSVCRT
using ::erf;
using ::erff;
using ::erfc;
@@ -444,16 +434,10 @@ using ::lrint;
using ::lrintf;
using ::lround;
using ::lroundf;
-#endif // _LIBCPP_MSVCRT
-#endif // __sun__
-#ifndef _LIBCPP_MSVCRT
using ::nan;
using ::nanf;
-#endif // _LIBCPP_MSVCRT
-#ifndef __sun__
-#ifndef _LIBCPP_MSVCRT
using ::nearbyint;
using ::nearbyintf;
using ::nextafter;
@@ -476,7 +460,6 @@ using ::tgamma;
using ::tgammaf;
using ::trunc;
using ::truncf;
-#endif // !_LIBCPP_MSVCRT
using ::acosl;
using ::asinl;
@@ -500,17 +483,14 @@ using ::sinhl;
using ::sqrtl;
using ::tanl;
-#ifndef _LIBCPP_MSVCRT
using ::tanhl;
using ::acoshl;
using ::asinhl;
using ::atanhl;
using ::cbrtl;
-#endif // !_LIBCPP_MSVCRT
using ::copysignl;
-#ifndef _LIBCPP_MSVCRT
using ::erfl;
using ::erfcl;
using ::exp2l;
@@ -541,12 +521,90 @@ using ::scalblnl;
using ::scalbnl;
using ::tgammal;
using ::truncl;
-#endif // !_LIBCPP_MSVCRT
-#else
-using ::lgamma;
-using ::lgammaf;
-#endif // __sun__
+#if _LIBCPP_STD_VER > 14
+inline _LIBCPP_INLINE_VISIBILITY float hypot( float x, float y, float z ) { return sqrt(x*x + y*y + z*z); }
+inline _LIBCPP_INLINE_VISIBILITY double hypot( double x, double y, double z ) { return sqrt(x*x + y*y + z*z); }
+inline _LIBCPP_INLINE_VISIBILITY long double hypot( long double x, long double y, long double z ) { return sqrt(x*x + y*y + z*z); }
+
+template <class _A1, class _A2, class _A3>
+inline _LIBCPP_INLINE_VISIBILITY
+typename __lazy_enable_if
+<
+ is_arithmetic<_A1>::value &&
+ is_arithmetic<_A2>::value &&
+ is_arithmetic<_A3>::value,
+ __promote<_A1, _A2, _A3>
+>::type
+hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
+{
+ typedef typename __promote<_A1, _A2, _A3>::type __result_type;
+ static_assert((!(is_same<_A1, __result_type>::value &&
+ is_same<_A2, __result_type>::value &&
+ is_same<_A3, __result_type>::value)), "");
+ return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
+}
+#endif
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
+{
+#if __has_builtin(__builtin_isnan)
+ return __builtin_isnan(__lcpp_x);
+#else
+ return isnan(__lcpp_x);
+#endif
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isnan(__lcpp_x);
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
+{
+#if __has_builtin(__builtin_isinf)
+ return __builtin_isinf(__lcpp_x);
+#else
+ return isinf(__lcpp_x);
+#endif
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isinf(__lcpp_x);
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
+__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
+{
+#if __has_builtin(__builtin_isfinite)
+ return __builtin_isfinite(__lcpp_x);
+#else
+ return isfinite(__lcpp_x);
+#endif
+}
+
+template <class _A1>
+_LIBCPP_ALWAYS_INLINE
+_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
+__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
+{
+ return isfinite(__lcpp_x);
+}
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/codecvt b/chromium/buildtools/third_party/libc++/trunk/include/codecvt
index 6eff107cd1c..46f56acff71 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/codecvt
+++ b/chromium/buildtools/third_party/libc++/trunk/include/codecvt
@@ -182,7 +182,7 @@ protected:
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_TYPE_VIS_ONLY codecvt_utf8
+class _LIBCPP_TEMPLATE_VIS codecvt_utf8
: public __codecvt_utf8<_Elem>
{
public:
@@ -410,7 +410,7 @@ protected:
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_TYPE_VIS_ONLY codecvt_utf16
+class _LIBCPP_TEMPLATE_VIS codecvt_utf16
: public __codecvt_utf16<_Elem, _Mode & little_endian>
{
public:
@@ -533,7 +533,7 @@ protected:
template <class _Elem, unsigned long _Maxcode = 0x10ffff,
codecvt_mode _Mode = (codecvt_mode)0>
-class _LIBCPP_TYPE_VIS_ONLY codecvt_utf8_utf16
+class _LIBCPP_TEMPLATE_VIS codecvt_utf8_utf16
: public __codecvt_utf8_utf16<_Elem>
{
public:
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/complex b/chromium/buildtools/third_party/libc++/trunk/include/complex
index 2943da1d775..d41971b3b4d 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/complex
+++ b/chromium/buildtools/third_party/libc++/trunk/include/complex
@@ -245,9 +245,6 @@ template<class T, class charT, class traits>
#include <stdexcept>
#include <cmath>
#include <sstream>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -255,13 +252,13 @@ template<class T, class charT, class traits>
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY complex;
+template<class _Tp> class _LIBCPP_TEMPLATE_VIS complex;
template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
template<class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY complex
+class _LIBCPP_TEMPLATE_VIS complex
{
public:
typedef _Tp value_type;
@@ -319,11 +316,11 @@ public:
}
};
-template<> class _LIBCPP_TYPE_VIS_ONLY complex<double>;
-template<> class _LIBCPP_TYPE_VIS_ONLY complex<long double>;
+template<> class _LIBCPP_TEMPLATE_VIS complex<double>;
+template<> class _LIBCPP_TEMPLATE_VIS complex<long double>;
template<>
-class _LIBCPP_TYPE_VIS_ONLY complex<float>
+class _LIBCPP_TEMPLATE_VIS complex<float>
{
float __re_;
float __im_;
@@ -332,7 +329,9 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(float __re = 0.0f, float __im = 0.0f)
: __re_(__re), __im_(__im) {}
+ _LIBCPP_INLINE_VISIBILITY
explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
+ _LIBCPP_INLINE_VISIBILITY
explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float real() const {return __re_;}
@@ -379,7 +378,7 @@ public:
};
template<>
-class _LIBCPP_TYPE_VIS_ONLY complex<double>
+class _LIBCPP_TEMPLATE_VIS complex<double>
{
double __re_;
double __im_;
@@ -388,7 +387,9 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(double __re = 0.0, double __im = 0.0)
: __re_(__re), __im_(__im) {}
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR complex(const complex<float>& __c);
+ _LIBCPP_INLINE_VISIBILITY
explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double real() const {return __re_;}
@@ -435,7 +436,7 @@ public:
};
template<>
-class _LIBCPP_TYPE_VIS_ONLY complex<long double>
+class _LIBCPP_TEMPLATE_VIS complex<long double>
{
long double __re_;
long double __im_;
@@ -444,7 +445,9 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(long double __re = 0.0L, long double __im = 0.0L)
: __re_(__re), __im_(__im) {}
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR complex(const complex<float>& __c);
+ _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR complex(const complex<double>& __c);
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double real() const {return __re_;}
@@ -490,32 +493,32 @@ public:
}
};
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
complex<float>::complex(const complex<double>& __c)
: __re_(__c.real()), __im_(__c.imag()) {}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
complex<float>::complex(const complex<long double>& __c)
: __re_(__c.real()), __im_(__c.imag()) {}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
complex<double>::complex(const complex<float>& __c)
: __re_(__c.real()), __im_(__c.imag()) {}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
complex<double>::complex(const complex<long double>& __c)
: __re_(__c.real()), __im_(__c.imag()) {}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
complex<long double>::complex(const complex<float>& __c)
: __re_(__c.real()), __im_(__c.imag()) {}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_LIBCPP_CONSTEXPR
complex<long double>::complex(const complex<double>& __c)
: __re_(__c.real()), __im_(__c.imag()) {}
@@ -596,39 +599,39 @@ operator*(const complex<_Tp>& __z, const complex<_Tp>& __w)
_Tp __bc = __b * __c;
_Tp __x = __ac - __bd;
_Tp __y = __ad + __bc;
- if (isnan(__x) && isnan(__y))
+ if (__libcpp_isnan(__x) && __libcpp_isnan(__y))
{
bool __recalc = false;
- if (isinf(__a) || isinf(__b))
+ if (__libcpp_isinf(__a) || __libcpp_isinf(__b))
{
- __a = copysign(isinf(__a) ? _Tp(1) : _Tp(0), __a);
- __b = copysign(isinf(__b) ? _Tp(1) : _Tp(0), __b);
- if (isnan(__c))
+ __a = copysign(__libcpp_isinf(__a) ? _Tp(1) : _Tp(0), __a);
+ __b = copysign(__libcpp_isinf(__b) ? _Tp(1) : _Tp(0), __b);
+ if (__libcpp_isnan(__c))
__c = copysign(_Tp(0), __c);
- if (isnan(__d))
+ if (__libcpp_isnan(__d))
__d = copysign(_Tp(0), __d);
__recalc = true;
}
- if (isinf(__c) || isinf(__d))
+ if (__libcpp_isinf(__c) || __libcpp_isinf(__d))
{
- __c = copysign(isinf(__c) ? _Tp(1) : _Tp(0), __c);
- __d = copysign(isinf(__d) ? _Tp(1) : _Tp(0), __d);
- if (isnan(__a))
+ __c = copysign(__libcpp_isinf(__c) ? _Tp(1) : _Tp(0), __c);
+ __d = copysign(__libcpp_isinf(__d) ? _Tp(1) : _Tp(0), __d);
+ if (__libcpp_isnan(__a))
__a = copysign(_Tp(0), __a);
- if (isnan(__b))
+ if (__libcpp_isnan(__b))
__b = copysign(_Tp(0), __b);
__recalc = true;
}
- if (!__recalc && (isinf(__ac) || isinf(__bd) ||
- isinf(__ad) || isinf(__bc)))
+ if (!__recalc && (__libcpp_isinf(__ac) || __libcpp_isinf(__bd) ||
+ __libcpp_isinf(__ad) || __libcpp_isinf(__bc)))
{
- if (isnan(__a))
+ if (__libcpp_isnan(__a))
__a = copysign(_Tp(0), __a);
- if (isnan(__b))
+ if (__libcpp_isnan(__b))
__b = copysign(_Tp(0), __b);
- if (isnan(__c))
+ if (__libcpp_isnan(__c))
__c = copysign(_Tp(0), __c);
- if (isnan(__d))
+ if (__libcpp_isnan(__d))
__d = copysign(_Tp(0), __d);
__recalc = true;
}
@@ -671,7 +674,7 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
_Tp __c = __w.real();
_Tp __d = __w.imag();
_Tp __logbw = logb(fmax(fabs(__c), fabs(__d)));
- if (isfinite(__logbw))
+ if (__libcpp_isfinite(__logbw))
{
__ilogbw = static_cast<int>(__logbw);
__c = scalbn(__c, -__ilogbw);
@@ -680,24 +683,24 @@ operator/(const complex<_Tp>& __z, const complex<_Tp>& __w)
_Tp __denom = __c * __c + __d * __d;
_Tp __x = scalbn((__a * __c + __b * __d) / __denom, -__ilogbw);
_Tp __y = scalbn((__b * __c - __a * __d) / __denom, -__ilogbw);
- if (isnan(__x) && isnan(__y))
+ if (__libcpp_isnan(__x) && __libcpp_isnan(__y))
{
- if ((__denom == _Tp(0)) && (!isnan(__a) || !isnan(__b)))
+ if ((__denom == _Tp(0)) && (!__libcpp_isnan(__a) || !__libcpp_isnan(__b)))
{
__x = copysign(_Tp(INFINITY), __c) * __a;
__y = copysign(_Tp(INFINITY), __c) * __b;
}
- else if ((isinf(__a) || isinf(__b)) && isfinite(__c) && isfinite(__d))
+ else if ((__libcpp_isinf(__a) || __libcpp_isinf(__b)) && __libcpp_isfinite(__c) && __libcpp_isfinite(__d))
{
- __a = copysign(isinf(__a) ? _Tp(1) : _Tp(0), __a);
- __b = copysign(isinf(__b) ? _Tp(1) : _Tp(0), __b);
+ __a = copysign(__libcpp_isinf(__a) ? _Tp(1) : _Tp(0), __a);
+ __b = copysign(__libcpp_isinf(__b) ? _Tp(1) : _Tp(0), __b);
__x = _Tp(INFINITY) * (__a * __c + __b * __d);
__y = _Tp(INFINITY) * (__b * __c - __a * __d);
}
- else if (isinf(__logbw) && __logbw > _Tp(0) && isfinite(__a) && isfinite(__b))
+ else if (__libcpp_isinf(__logbw) && __logbw > _Tp(0) && __libcpp_isfinite(__a) && __libcpp_isfinite(__b))
{
- __c = copysign(isinf(__c) ? _Tp(1) : _Tp(0), __c);
- __d = copysign(isinf(__d) ? _Tp(1) : _Tp(0), __d);
+ __c = copysign(__libcpp_isinf(__c) ? _Tp(1) : _Tp(0), __c);
+ __d = copysign(__libcpp_isinf(__d) ? _Tp(1) : _Tp(0), __d);
__x = _Tp(0) * (__a * __c + __b * __d);
__y = _Tp(0) * (__b * __c - __a * __d);
}
@@ -789,45 +792,41 @@ operator!=(const _Tp& __x, const complex<_Tp>& __y)
// 26.3.7 values:
-// real
+template <class _Tp, bool = is_integral<_Tp>::value,
+ bool = is_floating_point<_Tp>::value
+ >
+struct __libcpp_complex_overload_traits {};
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-_Tp
-real(const complex<_Tp>& __c)
+// Integral Types
+template <class _Tp>
+struct __libcpp_complex_overload_traits<_Tp, true, false>
{
- return __c.real();
-}
+ typedef double _ValueType;
+ typedef complex<double> _ComplexType;
+};
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-long double
-real(long double __re)
+// Floating point types
+template <class _Tp>
+struct __libcpp_complex_overload_traits<_Tp, false, true>
{
- return __re;
-}
+ typedef _Tp _ValueType;
+ typedef complex<_Tp> _ComplexType;
+};
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-double
-real(double __re)
-{
- return __re;
-}
+// real
template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-typename enable_if
-<
- is_integral<_Tp>::value,
- double
->::type
-real(_Tp __re)
+_Tp
+real(const complex<_Tp>& __c)
{
- return __re;
+ return __c.real();
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-float
-real(float __re)
+typename __libcpp_complex_overload_traits<_Tp>::_ValueType
+real(_Tp __re)
{
return __re;
}
@@ -842,35 +841,10 @@ imag(const complex<_Tp>& __c)
return __c.imag();
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-long double
-imag(long double __re)
-{
- return 0;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-double
-imag(double __re)
-{
- return 0;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-typename enable_if
-<
- is_integral<_Tp>::value,
- double
->::type
-imag(_Tp __re)
-{
- return 0;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-float
-imag(float __re)
+typename __libcpp_complex_overload_traits<_Tp>::_ValueType
+imag(_Tp)
{
return 0;
}
@@ -895,25 +869,22 @@ arg(const complex<_Tp>& __c)
return atan2(__c.imag(), __c.real());
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-long double
-arg(long double __re)
+typename enable_if<
+ is_same<_Tp, long double>::value,
+ long double
+>::type
+arg(_Tp __re)
{
return atan2l(0.L, __re);
}
-inline _LIBCPP_INLINE_VISIBILITY
-double
-arg(double __re)
-{
- return atan2(0., __re);
-}
-
template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
- is_integral<_Tp>::value,
+ is_integral<_Tp>::value || is_same<_Tp, double>::value,
double
>::type
arg(_Tp __re)
@@ -921,9 +892,13 @@ arg(_Tp __re)
return atan2(0., __re);
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-float
-arg(float __re)
+typename enable_if<
+ is_same<_Tp, float>::value,
+ float
+>::type
+arg(_Tp __re)
{
return atan2f(0.F, __re);
}
@@ -935,44 +910,20 @@ inline _LIBCPP_INLINE_VISIBILITY
_Tp
norm(const complex<_Tp>& __c)
{
- if (isinf(__c.real()))
+ if (__libcpp_isinf(__c.real()))
return abs(__c.real());
- if (isinf(__c.imag()))
+ if (__libcpp_isinf(__c.imag()))
return abs(__c.imag());
return __c.real() * __c.real() + __c.imag() * __c.imag();
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-long double
-norm(long double __re)
-{
- return __re * __re;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-double
-norm(double __re)
-{
- return __re * __re;
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value,
- double
->::type
+typename __libcpp_complex_overload_traits<_Tp>::_ValueType
norm(_Tp __re)
{
- return (double)__re * __re;
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-float
-norm(float __re)
-{
- return __re * __re;
+ typedef typename __libcpp_complex_overload_traits<_Tp>::_ValueType _ValueType;
+ return static_cast<_ValueType>(__re) * __re;
}
// conj
@@ -985,38 +936,16 @@ conj(const complex<_Tp>& __c)
return complex<_Tp>(__c.real(), -__c.imag());
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-complex<long double>
-conj(long double __re)
-{
- return complex<long double>(__re);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-complex<double>
-conj(double __re)
-{
- return complex<double>(__re);
-}
-
-template<class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
-<
- is_integral<_Tp>::value,
- complex<double>
->::type
+typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
conj(_Tp __re)
{
- return complex<double>(__re);
+ typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
+ return _ComplexType(__re);
}
-inline _LIBCPP_INLINE_VISIBILITY
-complex<float>
-conj(float __re)
-{
- return complex<float>(__re);
-}
+
// proj
@@ -1026,48 +955,36 @@ complex<_Tp>
proj(const complex<_Tp>& __c)
{
std::complex<_Tp> __r = __c;
- if (isinf(__c.real()) || isinf(__c.imag()))
+ if (__libcpp_isinf(__c.real()) || __libcpp_isinf(__c.imag()))
__r = complex<_Tp>(INFINITY, copysign(_Tp(0), __c.imag()));
return __r;
}
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-complex<long double>
-proj(long double __re)
-{
- if (isinf(__re))
- __re = abs(__re);
- return complex<long double>(__re);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-complex<double>
-proj(double __re)
+typename enable_if
+<
+ is_floating_point<_Tp>::value,
+ typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
+>::type
+proj(_Tp __re)
{
- if (isinf(__re))
+ if (__libcpp_isinf(__re))
__re = abs(__re);
- return complex<double>(__re);
+ return complex<_Tp>(__re);
}
-template<class _Tp>
+template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
is_integral<_Tp>::value,
- complex<double>
+ typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
>::type
proj(_Tp __re)
{
- return complex<double>(__re);
-}
-
-inline _LIBCPP_INLINE_VISIBILITY
-complex<float>
-proj(float __re)
-{
- if (isinf(__re))
- __re = abs(__re);
- return complex<float>(__re);
+ typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
+ return _ComplexType(__re);
}
// polar
@@ -1076,25 +993,25 @@ template<class _Tp>
complex<_Tp>
polar(const _Tp& __rho, const _Tp& __theta = _Tp(0))
{
- if (isnan(__rho) || signbit(__rho))
+ if (__libcpp_isnan(__rho) || signbit(__rho))
return complex<_Tp>(_Tp(NAN), _Tp(NAN));
- if (isnan(__theta))
+ if (__libcpp_isnan(__theta))
{
- if (isinf(__rho))
+ if (__libcpp_isinf(__rho))
return complex<_Tp>(__rho, __theta);
return complex<_Tp>(__theta, __theta);
}
- if (isinf(__theta))
+ if (__libcpp_isinf(__theta))
{
- if (isinf(__rho))
+ if (__libcpp_isinf(__rho))
return complex<_Tp>(__rho, _Tp(NAN));
return complex<_Tp>(_Tp(NAN), _Tp(NAN));
}
_Tp __x = __rho * cos(__theta);
- if (isnan(__x))
+ if (__libcpp_isnan(__x))
__x = 0;
_Tp __y = __rho * sin(__theta);
- if (isnan(__y))
+ if (__libcpp_isnan(__y))
__y = 0;
return complex<_Tp>(__x, __y);
}
@@ -1125,13 +1042,13 @@ template<class _Tp>
complex<_Tp>
sqrt(const complex<_Tp>& __x)
{
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(_Tp(INFINITY), __x.imag());
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
if (__x.real() > _Tp(0))
- return complex<_Tp>(__x.real(), isnan(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag()));
- return complex<_Tp>(isnan(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag()));
+ return complex<_Tp>(__x.real(), __libcpp_isnan(__x.imag()) ? __x.imag() : copysign(_Tp(0), __x.imag()));
+ return complex<_Tp>(__libcpp_isnan(__x.imag()) ? __x.imag() : _Tp(0), copysign(__x.real(), __x.imag()));
}
return polar(sqrt(abs(__x)), arg(__x) / _Tp(2));
}
@@ -1143,21 +1060,21 @@ complex<_Tp>
exp(const complex<_Tp>& __x)
{
_Tp __i = __x.imag();
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
if (__x.real() < _Tp(0))
{
- if (!isfinite(__i))
+ if (!__libcpp_isfinite(__i))
__i = _Tp(1);
}
- else if (__i == 0 || !isfinite(__i))
+ else if (__i == 0 || !__libcpp_isfinite(__i))
{
- if (isinf(__i))
+ if (__libcpp_isinf(__i))
__i = _Tp(NAN);
return complex<_Tp>(__x.real(), __i);
}
}
- else if (isnan(__x.real()) && __x.imag() == 0)
+ else if (__libcpp_isnan(__x.real()) && __x.imag() == 0)
return __x;
_Tp __e = exp(__x.real());
return complex<_Tp>(__e * cos(__i), __e * sin(__i));
@@ -1215,23 +1132,23 @@ complex<_Tp>
asinh(const complex<_Tp>& __x)
{
const _Tp __pi(atan2(+0., -0.));
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
- if (isnan(__x.imag()))
+ if (__libcpp_isnan(__x.imag()))
return __x;
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
}
- if (isnan(__x.real()))
+ if (__libcpp_isnan(__x.real()))
{
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(__x.imag(), __x.real());
if (__x.imag() == 0)
return __x;
return complex<_Tp>(__x.real(), __x.real());
}
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(copysign(__x.imag(), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) + _Tp(1)));
return complex<_Tp>(copysign(__z.real(), __x.real()), copysign(__z.imag(), __x.imag()));
@@ -1244,11 +1161,11 @@ complex<_Tp>
acosh(const complex<_Tp>& __x)
{
const _Tp __pi(atan2(+0., -0.));
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
- if (isnan(__x.imag()))
+ if (__libcpp_isnan(__x.imag()))
return complex<_Tp>(abs(__x.real()), __x.imag());
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
{
if (__x.real() > 0)
return complex<_Tp>(__x.real(), copysign(__pi * _Tp(0.25), __x.imag()));
@@ -1259,13 +1176,13 @@ acosh(const complex<_Tp>& __x)
return complex<_Tp>(-__x.real(), copysign(__pi, __x.imag()));
return complex<_Tp>(__x.real(), copysign(_Tp(0), __x.imag()));
}
- if (isnan(__x.real()))
+ if (__libcpp_isnan(__x.real()))
{
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(abs(__x.imag()), __x.real());
return complex<_Tp>(__x.real(), __x.real());
}
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(abs(__x.imag()), copysign(__pi/_Tp(2), __x.imag()));
complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) - _Tp(1)));
return complex<_Tp>(copysign(__z.real(), _Tp(0)), copysign(__z.imag(), __x.imag()));
@@ -1278,21 +1195,21 @@ complex<_Tp>
atanh(const complex<_Tp>& __x)
{
const _Tp __pi(atan2(+0., -0.));
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
{
return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
}
- if (isnan(__x.imag()))
+ if (__libcpp_isnan(__x.imag()))
{
- if (isinf(__x.real()) || __x.real() == 0)
+ if (__libcpp_isinf(__x.real()) || __x.real() == 0)
return complex<_Tp>(copysign(_Tp(0), __x.real()), __x.imag());
return complex<_Tp>(__x.imag(), __x.imag());
}
- if (isnan(__x.real()))
+ if (__libcpp_isnan(__x.real()))
{
return complex<_Tp>(__x.real(), __x.real());
}
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
return complex<_Tp>(copysign(_Tp(0), __x.real()), copysign(__pi/_Tp(2), __x.imag()));
}
@@ -1310,11 +1227,11 @@ template<class _Tp>
complex<_Tp>
sinh(const complex<_Tp>& __x)
{
- if (isinf(__x.real()) && !isfinite(__x.imag()))
+ if (__libcpp_isinf(__x.real()) && !__libcpp_isfinite(__x.imag()))
return complex<_Tp>(__x.real(), _Tp(NAN));
- if (__x.real() == 0 && !isfinite(__x.imag()))
+ if (__x.real() == 0 && !__libcpp_isfinite(__x.imag()))
return complex<_Tp>(__x.real(), _Tp(NAN));
- if (__x.imag() == 0 && !isfinite(__x.real()))
+ if (__x.imag() == 0 && !__libcpp_isfinite(__x.real()))
return __x;
return complex<_Tp>(sinh(__x.real()) * cos(__x.imag()), cosh(__x.real()) * sin(__x.imag()));
}
@@ -1325,13 +1242,13 @@ template<class _Tp>
complex<_Tp>
cosh(const complex<_Tp>& __x)
{
- if (isinf(__x.real()) && !isfinite(__x.imag()))
+ if (__libcpp_isinf(__x.real()) && !__libcpp_isfinite(__x.imag()))
return complex<_Tp>(abs(__x.real()), _Tp(NAN));
- if (__x.real() == 0 && !isfinite(__x.imag()))
+ if (__x.real() == 0 && !__libcpp_isfinite(__x.imag()))
return complex<_Tp>(_Tp(NAN), __x.real());
if (__x.real() == 0 && __x.imag() == 0)
return complex<_Tp>(_Tp(1), __x.imag());
- if (__x.imag() == 0 && !isfinite(__x.real()))
+ if (__x.imag() == 0 && !__libcpp_isfinite(__x.real()))
return complex<_Tp>(abs(__x.real()), __x.imag());
return complex<_Tp>(cosh(__x.real()) * cos(__x.imag()), sinh(__x.real()) * sin(__x.imag()));
}
@@ -1342,19 +1259,19 @@ template<class _Tp>
complex<_Tp>
tanh(const complex<_Tp>& __x)
{
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
- if (!isfinite(__x.imag()))
+ if (!__libcpp_isfinite(__x.imag()))
return complex<_Tp>(_Tp(1), _Tp(0));
return complex<_Tp>(_Tp(1), copysign(_Tp(0), sin(_Tp(2) * __x.imag())));
}
- if (isnan(__x.real()) && __x.imag() == 0)
+ if (__libcpp_isnan(__x.real()) && __x.imag() == 0)
return __x;
_Tp __2r(_Tp(2) * __x.real());
_Tp __2i(_Tp(2) * __x.imag());
_Tp __d(cosh(__2r) + cos(__2i));
_Tp __2rsh(sinh(__2r));
- if (isinf(__2rsh) && isinf(__d))
+ if (__libcpp_isinf(__2rsh) && __libcpp_isinf(__d))
return complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1),
__2i > _Tp(0) ? _Tp(0) : _Tp(-0.));
return complex<_Tp>(__2rsh/__d, sin(__2i)/__d);
@@ -1377,11 +1294,11 @@ complex<_Tp>
acos(const complex<_Tp>& __x)
{
const _Tp __pi(atan2(+0., -0.));
- if (isinf(__x.real()))
+ if (__libcpp_isinf(__x.real()))
{
- if (isnan(__x.imag()))
+ if (__libcpp_isnan(__x.imag()))
return complex<_Tp>(__x.imag(), __x.real());
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
{
if (__x.real() < _Tp(0))
return complex<_Tp>(_Tp(0.75) * __pi, -__x.imag());
@@ -1391,15 +1308,15 @@ acos(const complex<_Tp>& __x)
return complex<_Tp>(__pi, signbit(__x.imag()) ? -__x.real() : __x.real());
return complex<_Tp>(_Tp(0), signbit(__x.imag()) ? __x.real() : -__x.real());
}
- if (isnan(__x.real()))
+ if (__libcpp_isnan(__x.real()))
{
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(__x.real(), -__x.imag());
return complex<_Tp>(__x.real(), __x.real());
}
- if (isinf(__x.imag()))
+ if (__libcpp_isinf(__x.imag()))
return complex<_Tp>(__pi/_Tp(2), -__x.imag());
- if (__x.real() == 0)
+ if (__x.real() == 0 && (__x.imag() == 0 || isnan(__x.imag())))
return complex<_Tp>(__pi/_Tp(2), -__x.imag());
complex<_Tp> __z = log(__x + sqrt(pow(__x, _Tp(2)) - _Tp(1)));
if (signbit(__x.imag()))
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/condition_variable b/chromium/buildtools/third_party/libc++/trunk/include/condition_variable
index 10e00770167..c45a326d898 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/condition_variable
+++ b/chromium/buildtools/third_party/libc++/trunk/include/condition_variable
@@ -133,12 +133,14 @@ public:
void notify_all() _NOEXCEPT;
template <class _Lock>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
void wait(_Lock& __lock);
template <class _Lock, class _Predicate>
_LIBCPP_INLINE_VISIBILITY
void wait(_Lock& __lock, _Predicate __pred);
template <class _Lock, class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
cv_status
wait_until(_Lock& __lock,
const chrono::time_point<_Clock, _Duration>& __t);
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/cstddef b/chromium/buildtools/third_party/libc++/trunk/include/cstddef
index edd106c001b..62584494d97 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/cstddef
+++ b/chromium/buildtools/third_party/libc++/trunk/include/cstddef
@@ -28,6 +28,7 @@ Types:
size_t
max_align_t
nullptr_t
+ byte // C++17
} // std
@@ -48,7 +49,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
using ::ptrdiff_t;
using ::size_t;
-#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T)
+#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) || \
+ defined(__DEFINED_max_align_t)
// Re-use the compiler's <stddef.h> max_align_t where possible.
using ::max_align_t;
#else
@@ -57,4 +59,32 @@ typedef long double max_align_t;
_LIBCPP_END_NAMESPACE_STD
+#if _LIBCPP_STD_VER > 14
+namespace std // purposefully not versioned
+{
+enum class byte : unsigned char {};
+
+constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept
+{ return __lhs = byte(static_cast<unsigned char>(__lhs) | static_cast<unsigned char>(__rhs)); }
+constexpr byte operator| (byte __lhs, byte __rhs) noexcept
+{ return byte(static_cast<unsigned char>(__lhs) | static_cast<unsigned char>(__rhs)); }
+
+constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept
+{ return __lhs = byte(static_cast<unsigned char>(__lhs) & static_cast<unsigned char>(__rhs)); }
+constexpr byte operator& (byte __lhs, byte __rhs) noexcept
+{ return byte(static_cast<unsigned char>(__lhs) & static_cast<unsigned char>(__rhs)); }
+
+constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept
+{ return __lhs = byte(static_cast<unsigned char>(__lhs) ^ static_cast<unsigned char>(__rhs)); }
+constexpr byte operator^ (byte __lhs, byte __rhs) noexcept
+{ return byte(static_cast<unsigned char>(__lhs) ^ static_cast<unsigned char>(__rhs)); }
+
+constexpr byte operator~ (byte __b) noexcept
+{ return byte(~static_cast<unsigned char>(__b)); }
+
+}
+
+#include <type_traits> // rest of byte
+#endif
+
#endif // _LIBCPP_CSTDDEF
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/cstdio b/chromium/buildtools/third_party/libc++/trunk/include/cstdio
index 50fdd345742..00b989fad7c 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/cstdio
+++ b/chromium/buildtools/third_party/libc++/trunk/include/cstdio
@@ -118,11 +118,9 @@ using ::fscanf;
using ::snprintf;
using ::sprintf;
using ::sscanf;
-#ifndef _LIBCPP_MSVCRT
using ::vfprintf;
using ::vfscanf;
using ::vsscanf;
-#endif // _LIBCPP_MSVCRT
using ::vsnprintf;
using ::vsprintf;
using ::fgetc;
@@ -155,7 +153,7 @@ using ::tmpnam;
#ifndef _LIBCPP_HAS_NO_STDIN
using ::getchar;
-#if _LIBCPP_STD_VER <= 11
+#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_MSVCRT)
using ::gets;
#endif
using ::scanf;
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/cstdlib b/chromium/buildtools/third_party/libc++/trunk/include/cstdlib
index 10ed231078d..78c428403c3 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/cstdlib
+++ b/chromium/buildtools/third_party/libc++/trunk/include/cstdlib
@@ -89,6 +89,12 @@ void *aligned_alloc(size_t alignment, size_t size); // C11
#pragma GCC system_header
#endif
+#ifdef __GNUC__
+#define _LIBCPP_UNREACHABLE() __builtin_unreachable()
+#else
+#define _LIBCPP_UNREACHABLE() _VSTD::abort()
+#endif
+
_LIBCPP_BEGIN_NAMESPACE_STD
using ::size_t;
@@ -124,8 +130,10 @@ using ::abort;
using ::atexit;
using ::exit;
using ::_Exit;
+#ifndef _LIBCPP_WINDOWS_STORE_APP
using ::getenv;
using ::system;
+#endif
using ::bsearch;
using ::qsort;
using ::abs;
@@ -138,11 +146,9 @@ using ::ldiv;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
using ::lldiv;
#endif // _LIBCPP_HAS_NO_LONG_LONG
-#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
using ::mblen;
using ::mbtowc;
using ::wctomb;
-#endif
using ::mbstowcs;
using ::wcstombs;
#ifdef _LIBCPP_HAS_QUICK_EXIT
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/cstring b/chromium/buildtools/third_party/libc++/trunk/include/cstring
index d60b9923c6c..d550695caa4 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/cstring
+++ b/chromium/buildtools/third_party/libc++/trunk/include/cstring
@@ -78,30 +78,13 @@ using ::strcmp;
using ::strncmp;
using ::strcoll;
using ::strxfrm;
-
using ::memchr;
-
using ::strchr;
-
using ::strcspn;
-
using ::strpbrk;
-
using ::strrchr;
-
using ::strspn;
-
using ::strstr;
-
-// MSVCRT, GNU libc and its derivates already have the correct prototype in <string.h> #ifdef __cplusplus
-#if !defined(__GLIBC__) && !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
-inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);}
-inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
-inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);}
-inline _LIBCPP_INLINE_VISIBILITY void* memchr( void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
-inline _LIBCPP_INLINE_VISIBILITY char* strstr( char* __s1, const char* __s2) {return ::strstr(__s1, __s2);}
-#endif
-
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
using ::strtok;
#endif
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/ctype.h b/chromium/buildtools/third_party/libc++/trunk/include/ctype.h
index 22d6c49be9e..e97ff3c4887 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/ctype.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/ctype.h
@@ -40,15 +40,6 @@ int toupper(int c);
#ifdef __cplusplus
-#if defined(_LIBCPP_MSVCRT)
-// We support including .h headers inside 'extern "C"' contexts, so switch
-// back to C++ linkage before including these C++ headers.
-extern "C++" {
- #include "support/win32/support.h"
- #include "support/win32/locale_win32.h"
-}
-#endif // _LIBCPP_MSVCRT
-
#undef isalnum
#undef isalpha
#undef isblank
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/cwchar b/chromium/buildtools/third_party/libc++/trunk/include/cwchar
index ef4806db2bd..d268e8bbd39 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/cwchar
+++ b/chromium/buildtools/third_party/libc++/trunk/include/cwchar
@@ -123,11 +123,9 @@ using ::fwscanf;
using ::swprintf;
using ::vfwprintf;
using ::vswprintf;
-#ifndef _LIBCPP_MSVCRT
using ::swscanf;
using ::vfwscanf;
using ::vswscanf;
-#endif // _LIBCPP_MSVCRT
using ::fgetwc;
using ::fgetws;
using ::fputwc;
@@ -137,10 +135,8 @@ using ::getwc;
using ::putwc;
using ::ungetwc;
using ::wcstod;
-#ifndef _LIBCPP_MSVCRT
using ::wcstof;
using ::wcstold;
-#endif // _LIBCPP_MSVCRT
using ::wcstol;
#ifndef _LIBCPP_HAS_NO_LONG_LONG
using ::wcstoll;
@@ -157,30 +153,11 @@ using ::wcscmp;
using ::wcscoll;
using ::wcsncmp;
using ::wcsxfrm;
-
-#ifdef _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS
using ::wcschr;
using ::wcspbrk;
using ::wcsrchr;
using ::wcsstr;
using ::wmemchr;
-#else
-inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
-inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);}
-
-inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);}
-inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);}
-
-inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);}
-inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);}
-
-inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
-inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);}
-
-inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
-inline _LIBCPP_INLINE_VISIBILITY wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);}
-#endif
-
using ::wcscspn;
using ::wcslen;
using ::wcsspn;
@@ -201,9 +178,7 @@ using ::wcsrtombs;
#ifndef _LIBCPP_HAS_NO_STDIN
using ::getwchar;
-#ifndef _LIBCPP_MSVCRT
using ::vwscanf;
-#endif // _LIBCPP_MSVCRT
using ::wscanf;
#endif
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/deque b/chromium/buildtools/third_party/libc++/trunk/include/deque
index c6fbd512a1c..bd4316412f6 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/deque
+++ b/chromium/buildtools/third_party/libc++/trunk/include/deque
@@ -110,8 +110,8 @@ public:
void push_front(value_type&& v);
void push_back(const value_type& v);
void push_back(value_type&& v);
- template <class... Args> void emplace_front(Args&&... args);
- template <class... Args> void emplace_back(Args&&... args);
+ template <class... Args> reference emplace_front(Args&&... args); // reference in C++17
+ template <class... Args> reference emplace_back(Args&&... args); // reference in C++17
template <class... Args> iterator emplace(const_iterator p, Args&&... args);
iterator insert(const_iterator p, const value_type& v);
iterator insert(const_iterator p, value_type&& v);
@@ -167,11 +167,11 @@ template <class T, class Allocator>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Allocator> class __deque_base;
-template <class _Tp, class _Allocator = allocator<_Tp> > class _LIBCPP_TYPE_VIS_ONLY deque;
+template <class _Tp, class _Allocator = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS deque;
template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
class _DiffType, _DiffType _BlockSize>
-class _LIBCPP_TYPE_VIS_ONLY __deque_iterator;
+class _LIBCPP_TEMPLATE_VIS __deque_iterator;
template <class _RAIter,
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
@@ -276,7 +276,7 @@ template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
__deque_block_size<_ValueType, _DiffType>::value
#endif
>
-class _LIBCPP_TYPE_VIS_ONLY __deque_iterator
+class _LIBCPP_TEMPLATE_VIS __deque_iterator
{
typedef _MapPointer __map_iterator;
public:
@@ -428,9 +428,9 @@ private:
: __m_iter_(__m), __ptr_(__p) {}
template <class _Tp, class _Ap> friend class __deque_base;
- template <class _Tp, class _Ap> friend class _LIBCPP_TYPE_VIS_ONLY deque;
+ template <class _Tp, class _Ap> friend class _LIBCPP_TEMPLATE_VIS deque;
template <class _Vp, class _Pp, class _Rp, class _MP, class _Dp, _Dp>
- friend class _LIBCPP_TYPE_VIS_ONLY __deque_iterator;
+ friend class _LIBCPP_TEMPLATE_VIS __deque_iterator;
template <class _RAIter,
class _V2, class _P2, class _R2, class _M2, class _D2, _D2 _B2>
@@ -895,26 +895,22 @@ template <bool>
class __deque_base_common
{
protected:
- void __throw_length_error() const;
- void __throw_out_of_range() const;
+ _LIBCPP_NORETURN void __throw_length_error() const;
+ _LIBCPP_NORETURN void __throw_out_of_range() const;
};
template <bool __b>
void
__deque_base_common<__b>::__throw_length_error() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw length_error("deque");
-#endif
+ _VSTD::__throw_length_error("deque");
}
template <bool __b>
void
__deque_base_common<__b>::__throw_out_of_range() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("deque");
-#endif
+ _VSTD::__throw_out_of_range("deque");
}
template <class _Tp, class _Allocator>
@@ -972,13 +968,12 @@ protected:
public:
~__deque_base();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
__deque_base(__deque_base&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
__deque_base(__deque_base&& __c, const allocator_type& __a);
+#endif // _LIBCPP_CXX03_LANG
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void swap(__deque_base& __c)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
@@ -1112,7 +1107,7 @@ __deque_base<_Tp, _Allocator>::~__deque_base()
__alloc_traits::deallocate(__alloc(), *__i, __block_size);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
__deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
@@ -1144,7 +1139,7 @@ __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c, const allocator_
}
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
void
@@ -1187,7 +1182,7 @@ __deque_base<_Tp, _Allocator>::clear() _NOEXCEPT
}
template <class _Tp, class _Allocator /*= allocator<_Tp>*/>
-class _LIBCPP_TYPE_VIS_ONLY deque
+class _LIBCPP_TEMPLATE_VIS deque
: private __deque_base<_Tp, _Allocator>
{
public:
@@ -1234,18 +1229,16 @@ public:
typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0);
deque(const deque& __c);
deque(const deque& __c, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+ deque& operator=(const deque& __c);
+
+#ifndef _LIBCPP_CXX03_LANG
deque(initializer_list<value_type> __il);
deque(initializer_list<value_type> __il, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- deque& operator=(const deque& __c);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
deque& operator=(initializer_list<value_type> __il) {assign(__il); return *this;}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
_LIBCPP_INLINE_VISIBILITY
@@ -1254,7 +1247,10 @@ public:
deque& operator=(deque&& __c)
_NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::value);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
+#endif // _LIBCPP_CXX03_LANG
template <class _InputIter>
void assign(_InputIter __f, _InputIter __l,
@@ -1264,10 +1260,6 @@ public:
void assign(_RAIter __f, _RAIter __l,
typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0);
void assign(size_type __n, const value_type& __v);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
- void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT;
@@ -1314,7 +1306,9 @@ public:
size_type size() const _NOEXCEPT {return __base::size();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
- {return __alloc_traits::max_size(__base::__alloc());}
+ {return std::min<size_type>(
+ __alloc_traits::max_size(__base::__alloc()),
+ numeric_limits<difference_type>::max());}
void resize(size_type __n);
void resize(size_type __n, const value_type& __v);
void shrink_to_fit() _NOEXCEPT;
@@ -1342,16 +1336,25 @@ public:
// 23.2.2.3 modifiers:
void push_front(const value_type& __v);
void push_back(const value_type& __v);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class... _Args> void emplace_front(_Args&&... __args);
- template <class... _Args> void emplace_back(_Args&&... __args);
+#ifndef _LIBCPP_CXX03_LANG
+#if _LIBCPP_STD_VER > 14
+ template <class... _Args> reference emplace_front(_Args&&... __args);
+ template <class... _Args> reference emplace_back (_Args&&... __args);
+#else
+ template <class... _Args> void emplace_front(_Args&&... __args);
+ template <class... _Args> void emplace_back (_Args&&... __args);
+#endif
template <class... _Args> iterator emplace(const_iterator __p, _Args&&... __args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
+
void push_front(value_type&& __v);
void push_back(value_type&& __v);
iterator insert(const_iterator __p, value_type&& __v);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, initializer_list<value_type> __il)
+ {return insert(__p, __il.begin(), __il.end());}
+#endif // _LIBCPP_CXX03_LANG
+
iterator insert(const_iterator __p, const value_type& __v);
iterator insert(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIter>
@@ -1365,11 +1368,7 @@ public:
template <class _BiIter>
iterator insert(const_iterator __p, _BiIter __f, _BiIter __l,
typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type* = 0);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, initializer_list<value_type> __il)
- {return insert(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
void pop_front();
void pop_back();
iterator erase(const_iterator __p);
@@ -1524,7 +1523,19 @@ deque<_Tp, _Allocator>::deque(const deque& __c, const allocator_type& __a)
__append(__c.begin(), __c.end());
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+template <class _Tp, class _Allocator>
+deque<_Tp, _Allocator>&
+deque<_Tp, _Allocator>::operator=(const deque& __c)
+{
+ if (this != &__c)
+ {
+ __copy_assign_alloc(__c);
+ assign(__c.begin(), __c.end());
+ }
+ return *this;
+}
+
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il)
@@ -1539,22 +1550,6 @@ deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator
__append(__il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>&
-deque<_Tp, _Allocator>::operator=(const deque& __c)
-{
- if (this != &__c)
- {
- __copy_assign_alloc(__c);
- assign(__c.begin(), __c.end());
- }
- return *this;
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, class _Allocator>
inline
deque<_Tp, _Allocator>::deque(deque&& __c)
@@ -1610,7 +1605,7 @@ deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type)
__base::__move_assign(__c);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
template <class _InputIter>
@@ -1806,8 +1801,20 @@ deque<_Tp, _Allocator>::push_back(const value_type& __v)
++__base::size();
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+template <class _Tp, class _Allocator>
+void
+deque<_Tp, _Allocator>::push_front(const value_type& __v)
+{
+ allocator_type& __a = __base::__alloc();
+ if (__front_spare() == 0)
+ __add_front_capacity();
+ // __front_spare() >= 1
+ __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
+ --__base::__start_;
+ ++__base::size();
+}
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::push_back(value_type&& __v)
@@ -1820,39 +1827,27 @@ deque<_Tp, _Allocator>::push_back(value_type&& __v)
++__base::size();
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Allocator>
template <class... _Args>
+#if _LIBCPP_STD_VER > 14
+typename deque<_Tp, _Allocator>::reference
+#else
void
+#endif
deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
allocator_type& __a = __base::__alloc();
if (__back_spare() == 0)
__add_back_capacity();
// __back_spare() >= 1
- __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
- ++__base::size();
-}
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Tp, class _Allocator>
-void
-deque<_Tp, _Allocator>::push_front(const value_type& __v)
-{
- allocator_type& __a = __base::__alloc();
- if (__front_spare() == 0)
- __add_front_capacity();
- // __front_spare() >= 1
- __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
- --__base::__start_;
+ __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()),
+ _VSTD::forward<_Args>(__args)...);
++__base::size();
+#if _LIBCPP_STD_VER > 14
+ return *--__base::end();
+#endif
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::push_front(value_type&& __v)
@@ -1866,11 +1861,14 @@ deque<_Tp, _Allocator>::push_front(value_type&& __v)
++__base::size();
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Allocator>
template <class... _Args>
+#if _LIBCPP_STD_VER > 14
+typename deque<_Tp, _Allocator>::reference
+#else
void
+#endif
deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
{
allocator_type& __a = __base::__alloc();
@@ -1880,14 +1878,14 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
__alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
--__base::__start_;
++__base::size();
+#if _LIBCPP_STD_VER > 14
+ return *__base::begin();
+#endif
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
+deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
{
size_type __pos = __p - __base::begin();
size_type __to_end = __base::size() - __pos;
@@ -1899,23 +1897,20 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
// __front_spare() >= 1
if (__pos == 0)
{
- __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
+ __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
--__base::__start_;
++__base::size();
}
else
{
- const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
iterator __b = __base::begin();
iterator __bm1 = _VSTD::prev(__b);
- if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
- __vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
__alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
--__base::__start_;
++__base::size();
if (__pos > 1)
- __b = __move_and_check(_VSTD::next(__b), __b + __pos, __b, __vt);
- *__b = *__vt;
+ __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
+ *__b = _VSTD::move(__v);
}
}
else
@@ -1926,31 +1921,27 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
size_type __de = __base::size() - __pos;
if (__de == 0)
{
- __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
+ __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
++__base::size();
}
else
{
- const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
iterator __e = __base::end();
iterator __em1 = _VSTD::prev(__e);
- if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
- __vt = pointer_traits<const_pointer>::pointer_to(*__e);
__alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
++__base::size();
if (__de > 1)
- __e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
- *--__e = *__vt;
+ __e = _VSTD::move_backward(__e - __de, __em1, __e);
+ *--__e = _VSTD::move(__v);
}
}
return __base::begin() + __pos;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, class _Allocator>
+template <class... _Args>
typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
+deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
{
size_type __pos = __p - __base::begin();
size_type __to_end = __base::size() - __pos;
@@ -1962,12 +1953,13 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
// __front_spare() >= 1
if (__pos == 0)
{
- __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
+ __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
--__base::__start_;
++__base::size();
}
else
{
+ __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
iterator __b = __base::begin();
iterator __bm1 = _VSTD::prev(__b);
__alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
@@ -1975,7 +1967,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
++__base::size();
if (__pos > 1)
__b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
- *__b = _VSTD::move(__v);
+ *__b = _VSTD::move(__tmp.get());
}
}
else
@@ -1986,29 +1978,30 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
size_type __de = __base::size() - __pos;
if (__de == 0)
{
- __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
+ __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
++__base::size();
}
else
{
+ __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
iterator __e = __base::end();
iterator __em1 = _VSTD::prev(__e);
__alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
++__base::size();
if (__de > 1)
__e = _VSTD::move_backward(__e - __de, __em1, __e);
- *--__e = _VSTD::move(__v);
+ *--__e = _VSTD::move(__tmp.get());
}
}
return __base::begin() + __pos;
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
+
template <class _Tp, class _Allocator>
-template <class... _Args>
typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
+deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
{
size_type __pos = __p - __base::begin();
size_type __to_end = __base::size() - __pos;
@@ -2020,21 +2013,23 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
// __front_spare() >= 1
if (__pos == 0)
{
- __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
+ __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
--__base::__start_;
++__base::size();
}
else
{
- value_type __tmp(_VSTD::forward<_Args>(__args)...);
+ const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
iterator __b = __base::begin();
iterator __bm1 = _VSTD::prev(__b);
+ if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
+ __vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
__alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
--__base::__start_;
++__base::size();
if (__pos > 1)
- __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
- *__b = _VSTD::move(__tmp);
+ __b = __move_and_check(_VSTD::next(__b), __b + __pos, __b, __vt);
+ *__b = *__vt;
}
}
else
@@ -2045,27 +2040,26 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
size_type __de = __base::size() - __pos;
if (__de == 0)
{
- __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
+ __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
++__base::size();
}
else
{
- value_type __tmp(_VSTD::forward<_Args>(__args)...);
+ const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
iterator __e = __base::end();
iterator __em1 = _VSTD::prev(__e);
+ if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
+ __vt = pointer_traits<const_pointer>::pointer_to(*__e);
__alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
++__base::size();
if (__de > 1)
- __e = _VSTD::move_backward(__e - __de, __em1, __e);
- *--__e = _VSTD::move(__tmp);
+ __e = __move_backward_and_check(__e - __de, __em1, __e, __vt);
+ *--__e = *__vt;
}
}
return __base::begin() + __pos;
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v)
@@ -2734,7 +2728,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
difference_type __pos = __f - __b;
iterator __p = __b + __pos;
allocator_type& __a = __base::__alloc();
- if (__pos <= (__base::size() - 1) / 2)
+ if (static_cast<size_t>(__pos) <= (__base::size() - 1) / 2)
{ // erase from front
_VSTD::move_backward(__b, __p, _VSTD::next(__p));
__alloc_traits::destroy(__a, _VSTD::addressof(*__b));
@@ -2772,7 +2766,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
if (__n > 0)
{
allocator_type& __a = __base::__alloc();
- if (__pos <= (__base::size() - __n) / 2)
+ if (static_cast<size_t>(__pos) <= (__base::size() - __n) / 2)
{ // erase from front
iterator __i = _VSTD::move_backward(__b, __p, __p + __n);
for (; __b != __i; ++__b)
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/exception b/chromium/buildtools/third_party/libc++/trunk/include/exception
index 686e4ecd057..ca2eaf5c6a0 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/exception
+++ b/chromium/buildtools/third_party/libc++/trunk/include/exception
@@ -79,8 +79,13 @@ template <class E> void rethrow_if_nested(const E& e);
#include <__config>
#include <cstddef>
+#include <cstdlib>
#include <type_traits>
+#if defined(_LIBCPP_ABI_MICROSOFT)
+#include <vcruntime_exception.h>
+#endif
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -88,6 +93,7 @@ template <class E> void rethrow_if_nested(const E& e);
namespace std // purposefully not using versioning namespace
{
+#if !defined(_LIBCPP_ABI_MICROSOFT)
class _LIBCPP_EXCEPTION_ABI exception
{
public:
@@ -104,11 +110,16 @@ public:
virtual ~bad_exception() _NOEXCEPT;
virtual const char* what() const _NOEXCEPT;
};
+#endif // !_LIBCPP_ABI_MICROSOFT
+#if _LIBCPP_STD_VER <= 14 \
+ || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) \
+ || defined(_LIBCPP_BUILDING_LIBRARY)
typedef void (*unexpected_handler)();
_LIBCPP_FUNC_VIS unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
_LIBCPP_FUNC_VIS unexpected_handler get_unexpected() _NOEXCEPT;
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void unexpected();
+#endif
typedef void (*terminate_handler)();
_LIBCPP_FUNC_VIS terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
@@ -116,30 +127,33 @@ _LIBCPP_FUNC_VIS terminate_handler get_terminate() _NOEXCEPT;
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
_LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
-_LIBCPP_FUNC_VIS int uncaught_exceptions() _NOEXCEPT;
+_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
class _LIBCPP_TYPE_VIS exception_ptr;
_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
+#ifndef _LIBCPP_ABI_MICROSOFT
+
class _LIBCPP_TYPE_VIS exception_ptr
{
void* __ptr_;
public:
_LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
+
exception_ptr(const exception_ptr&) _NOEXCEPT;
exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
~exception_ptr() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT
- operator bool() const _NOEXCEPT {return __ptr_ != nullptr;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
+ {return __ptr_ != nullptr;}
friend _LIBCPP_INLINE_VISIBILITY
bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
{return __x.__ptr_ == __y.__ptr_;}
+
friend _LIBCPP_INLINE_VISIBILITY
bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
{return !(__x == __y);}
@@ -161,9 +175,60 @@ make_exception_ptr(_Ep __e) _NOEXCEPT
{
return current_exception();
}
-#endif // _LIBCPP_NO_EXCEPTIONS
+#else
+ ((void)__e);
+ _VSTD::abort();
+#endif
+}
+
+#else // _LIBCPP_ABI_MICROSOFT
+
+class _LIBCPP_TYPE_VIS exception_ptr
+{
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-private-field"
+#endif
+ void* __ptr1_;
+ void* __ptr2_;
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+public:
+ exception_ptr() _NOEXCEPT;
+ exception_ptr(nullptr_t) _NOEXCEPT;
+ exception_ptr(const exception_ptr& __other) _NOEXCEPT;
+ exception_ptr& operator=(const exception_ptr& __other) _NOEXCEPT;
+ exception_ptr& operator=(nullptr_t) _NOEXCEPT;
+ ~exception_ptr() _NOEXCEPT;
+ _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT;
+};
+
+_LIBCPP_FUNC_VIS
+bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT;
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
+ {return !(__x == __y);}
+
+_LIBCPP_FUNC_VIS void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
+
+_LIBCPP_FUNC_VIS exception_ptr __copy_exception_ptr(void *__except, const void* __ptr);
+_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr p);
+
+// This is a built-in template function which automagically extracts the required
+// information.
+template <class _E> void *__GetExceptionInfo(_E);
+
+template<class _Ep>
+exception_ptr
+make_exception_ptr(_Ep __e) _NOEXCEPT
+{
+ return __copy_exception_ptr(_VSTD::addressof(__e), __GetExceptionInfo(__e));
}
+#endif // _LIBCPP_ABI_MICROSOFT
// nested_exception
class _LIBCPP_EXCEPTION_ABI nested_exception
@@ -188,52 +253,71 @@ struct __nested
_LIBCPP_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
};
-template <class _Tp>
-_LIBCPP_NORETURN
-void
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-throw_with_nested(_Tp&& __t, typename enable_if<
- is_class<typename remove_reference<_Tp>::type>::value &&
- !is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
- && !__libcpp_is_final<typename remove_reference<_Tp>::type>::value
- >::type* = 0)
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-throw_with_nested (_Tp& __t, typename enable_if<
- is_class<_Tp>::value && !is_base_of<nested_exception, _Tp>::value
- >::type* = 0)
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-{
#ifndef _LIBCPP_NO_EXCEPTIONS
- throw __nested<typename remove_reference<_Tp>::type>(_VSTD::forward<_Tp>(__t));
+template <class _Tp, class _Up, bool>
+struct __throw_with_nested;
+
+template <class _Tp, class _Up>
+struct __throw_with_nested<_Tp, _Up, true> {
+ _LIBCPP_NORETURN static inline _LIBCPP_ALWAYS_INLINE void
+#ifndef _LIBCPP_CXX03_LANG
+ __do_throw(_Tp&& __t)
+#else
+ __do_throw (_Tp& __t)
+#endif // _LIBCPP_CXX03_LANG
+ {
+ throw __nested<_Up>(_VSTD::forward<_Tp>(__t));
+ }
+};
+
+template <class _Tp, class _Up>
+struct __throw_with_nested<_Tp, _Up, false> {
+ _LIBCPP_NORETURN static inline _LIBCPP_ALWAYS_INLINE void
+#ifndef _LIBCPP_CXX03_LANG
+ __do_throw(_Tp&& __t)
+#else
+ __do_throw (_Tp& __t)
+#endif // _LIBCPP_CXX03_LANG
+ {
+ throw _VSTD::forward<_Tp>(__t);
+ }
+};
#endif
-}
template <class _Tp>
_LIBCPP_NORETURN
void
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-throw_with_nested(_Tp&& __t, typename enable_if<
- !is_class<typename remove_reference<_Tp>::type>::value ||
- is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
- || __libcpp_is_final<typename remove_reference<_Tp>::type>::value
- >::type* = 0)
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-throw_with_nested (_Tp& __t, typename enable_if<
- !is_class<_Tp>::value || is_base_of<nested_exception, _Tp>::value
- >::type* = 0)
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+throw_with_nested(_Tp&& __t)
+#else
+throw_with_nested (_Tp& __t)
+#endif // _LIBCPP_CXX03_LANG
{
#ifndef _LIBCPP_NO_EXCEPTIONS
- throw _VSTD::forward<_Tp>(__t);
+ typedef typename decay<_Tp>::type _Up;
+ static_assert( is_copy_constructible<_Up>::value, "type thrown must be CopyConstructible");
+ __throw_with_nested<_Tp, _Up,
+ is_class<_Up>::value &&
+ !is_base_of<nested_exception, _Up>::value &&
+ !__libcpp_is_final<_Up>::value>::
+ __do_throw(_VSTD::forward<_Tp>(__t));
+#else
+ ((void)__t);
+ // FIXME: Make this abort
#endif
}
+template <class _From, class _To>
+struct __can_dynamic_cast : public _LIBCPP_BOOL_CONSTANT(
+ is_polymorphic<_From>::value &&
+ (!is_base_of<_To, _From>::value ||
+ is_convertible<const _From*, const _To*>::value)) {};
+
template <class _Ep>
inline _LIBCPP_INLINE_VISIBILITY
void
-rethrow_if_nested(const _Ep& __e, typename enable_if<
- is_polymorphic<_Ep>::value
- >::type* = 0)
+rethrow_if_nested(const _Ep& __e,
+ typename enable_if< __can_dynamic_cast<_Ep, nested_exception>::value>::type* = 0)
{
const nested_exception* __nep = dynamic_cast<const nested_exception*>(_VSTD::addressof(__e));
if (__nep)
@@ -243,9 +327,8 @@ rethrow_if_nested(const _Ep& __e, typename enable_if<
template <class _Ep>
inline _LIBCPP_INLINE_VISIBILITY
void
-rethrow_if_nested(const _Ep&, typename enable_if<
- !is_polymorphic<_Ep>::value
- >::type* = 0)
+rethrow_if_nested(const _Ep&,
+ typename enable_if<!__can_dynamic_cast<_Ep, nested_exception>::value>::type* = 0)
{
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/__config b/chromium/buildtools/third_party/libc++/trunk/include/experimental/__config
index f64a3a90cd1..37f88c166dd 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/__config
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/__config
@@ -25,8 +25,33 @@
#define _LIBCPP_END_NAMESPACE_LFTS } } }
#define _VSTD_LFTS _VSTD_EXPERIMENTAL::fundamentals_v1
+#define _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v2 {
+#define _LIBCPP_END_NAMESPACE_LFTS_V2 } } }
+#define _VSTD_LFTS_V2 _VSTD_EXPERIMENTAL::fundamentals_v2
+
+#define _LIBCPP_BEGIN_NAMESPACE_LFTS_PMR _LIBCPP_BEGIN_NAMESPACE_LFTS namespace pmr {
+#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
+#define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
+
#define _LIBCPP_BEGIN_NAMESPACE_CHRONO_LFTS _LIBCPP_BEGIN_NAMESPACE_STD \
namespace chrono { namespace experimental { inline namespace fundamentals_v1 {
#define _LIBCPP_END_NAMESPACE_CHRONO_LFTS _LIBCPP_END_NAMESPACE_STD } } }
+#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM \
+ _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace filesystem { \
+ inline namespace v1 {
+
+#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM \
+ } } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
+
+#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES \
+ _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace coroutines_v1 {
+
+#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES \
+ } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
+
+#define _VSTD_CORO _VSTD_EXPERIMENTAL::coroutines_v1
+
+#define _VSTD_FS ::std::experimental::filesystem::v1
+
#endif
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/__memory b/chromium/buildtools/third_party/libc++/trunk/include/experimental/__memory
new file mode 100644
index 00000000000..229fea605bf
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/__memory
@@ -0,0 +1,90 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL___MEMORY
+#define _LIBCPP_EXPERIMENTAL___MEMORY
+
+#include <experimental/__config>
+#include <experimental/utility> // for erased_type
+#include <__functional_base>
+#include <type_traits>
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+
+template <
+ class _Tp, class _Alloc
+ , bool = uses_allocator<_Tp, _Alloc>::value
+ , bool = __has_allocator_type<_Tp>::value
+ >
+struct __lfts_uses_allocator : public false_type {};
+
+template <class _Tp, class _Alloc>
+struct __lfts_uses_allocator<_Tp, _Alloc, false, false> : public false_type {};
+
+template <class _Tp, class _Alloc, bool HasAlloc>
+struct __lfts_uses_allocator<_Tp, _Alloc, true, HasAlloc> : public true_type {};
+
+template <class _Tp, class _Alloc>
+struct __lfts_uses_allocator<_Tp, _Alloc, false, true>
+ : public integral_constant<bool
+ , is_convertible<_Alloc, typename _Tp::allocator_type>::value
+ || is_same<erased_type, typename _Tp::allocator_type>::value
+ >
+{};
+
+template <bool _UsesAlloc, class _Tp, class _Alloc, class ..._Args>
+struct __lfts_uses_alloc_ctor_imp
+{
+ static const int value = 0;
+};
+
+template <class _Tp, class _Alloc, class ..._Args>
+struct __lfts_uses_alloc_ctor_imp<true, _Tp, _Alloc, _Args...>
+{
+ static const bool __ic_first
+ = is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
+
+ static const bool __ic_second =
+ conditional<
+ __ic_first,
+ false_type,
+ is_constructible<_Tp, _Args..., _Alloc>
+ >::type::value;
+
+ static_assert(__ic_first || __ic_second,
+ "Request for uses allocator construction is ill-formed");
+
+ static const int value = __ic_first ? 1 : 2;
+};
+
+template <class _Tp, class _Alloc, class ..._Args>
+struct __lfts_uses_alloc_ctor
+ : integral_constant<int,
+ __lfts_uses_alloc_ctor_imp<
+ __lfts_uses_allocator<_Tp, _Alloc>::value
+ , _Tp, _Alloc, _Args...
+ >::value
+ >
+{};
+
+template <class _Tp, class _Alloc, class ..._Args>
+inline _LIBCPP_INLINE_VISIBILITY
+void __lfts_user_alloc_construct(
+ _Tp * __store, const _Alloc & __a, _Args &&... __args)
+{
+ _VSTD::__user_alloc_construct_impl(
+ typename __lfts_uses_alloc_ctor<_Tp, _Alloc, _Args...>::type()
+ , __store, __a, _VSTD::forward<_Args>(__args)...
+ );
+}
+
+_LIBCPP_END_NAMESPACE_LFTS
+
+#endif /* _LIBCPP_EXPERIMENTAL___MEMORY */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/algorithm b/chromium/buildtools/third_party/libc++/trunk/include/experimental/algorithm
index ffaa793b6d4..b32d7ca66bd 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/algorithm
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/algorithm
@@ -53,66 +53,16 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
template <class _ForwardIterator, class _Searcher>
_LIBCPP_INLINE_VISIBILITY
_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s)
-{ return __s(__f, __l); }
+{ return __s(__f, __l).first; }
template <class _PopulationIterator, class _SampleIterator, class _Distance,
class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator __sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __out,
- _Distance __n,
- _UniformRandomNumberGenerator &&__g,
- input_iterator_tag) {
-
- _Distance __k = 0;
- for (; __first != __last && __k < __n; ++__first, (void)++__k)
- __out[__k] = *__first;
- _Distance __sz = __k;
- for (; __first != __last; ++__first, (void)++__k) {
- _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g);
- if (__r < __sz)
- __out[__r] = *__first;
- }
- return __out + _VSTD::min(__n, __k);
-}
-
-template <class _PopulationIterator, class _SampleIterator, class _Distance,
- class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator __sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __out,
- _Distance __n,
- _UniformRandomNumberGenerator &&__g,
- forward_iterator_tag) {
- _Distance __unsampled_sz = _VSTD::distance(__first, __last);
- for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {
- _Distance __r =
- _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);
- if (__r < __n) {
- *__out++ = *__first;
- --__n;
- }
- }
- return __out;
-}
-
-template <class _PopulationIterator, class _SampleIterator, class _Distance,
- class _UniformRandomNumberGenerator>
-_LIBCPP_INLINE_VISIBILITY
-_SampleIterator sample(_PopulationIterator __first,
- _PopulationIterator __last, _SampleIterator __out,
- _Distance __n, _UniformRandomNumberGenerator &&__g) {
- typedef typename iterator_traits<_PopulationIterator>::iterator_category
- _PopCategory;
- typedef typename iterator_traits<_PopulationIterator>::difference_type
- _Difference;
- typedef typename common_type<_Distance, _Difference>::type _CommonType;
- _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
- return _VSTD_LFTS::__sample(
- __first, __last, __out, _CommonType(__n),
- _VSTD::forward<_UniformRandomNumberGenerator>(__g),
- _PopCategory());
+inline _LIBCPP_INLINE_VISIBILITY
+_SampleIterator sample(_PopulationIterator __first, _PopulationIterator __last,
+ _SampleIterator __output, _Distance __n,
+ _UniformRandomNumberGenerator &&__g) {
+ return _VSTD::__sample(__first, __last, __output, __n, __g);
}
_LIBCPP_END_NAMESPACE_LFTS
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/any b/chromium/buildtools/third_party/libc++/trunk/include/experimental/any
index 603788484dd..022b379e858 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/any
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/any
@@ -82,7 +82,6 @@ inline namespace fundamentals_v1 {
#include <typeinfo>
#include <type_traits>
#include <cstdlib>
-#include <cassert>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -98,13 +97,13 @@ public:
#if _LIBCPP_STD_VER > 11 // C++ > 11
-_LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY
-inline void __throw_bad_any_cast()
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_any_cast()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw bad_any_cast();
#else
- assert(!"bad_any_cast");
+ _VSTD::abort();
#endif
}
@@ -113,10 +112,12 @@ class any;
template <class _ValueType>
typename add_pointer<typename add_const<_ValueType>::type>::type
+_LIBCPP_INLINE_VISIBILITY
any_cast(any const *) _NOEXCEPT;
template <class _ValueType>
typename add_pointer<_ValueType>::type
+_LIBCPP_INLINE_VISIBILITY
any_cast(any *) _NOEXCEPT;
namespace __any_imp
@@ -185,6 +186,7 @@ public:
class _ValueType
, class = __any_imp::_EnableIfNotAny<_ValueType>
>
+ _LIBCPP_INLINE_VISIBILITY
any(_ValueType && __value);
_LIBCPP_INLINE_VISIBILITY
@@ -212,6 +214,7 @@ public:
class _ValueType
, class = __any_imp::_EnableIfNotAny<_ValueType>
>
+ _LIBCPP_INLINE_VISIBILITY
any & operator=(_ValueType && __rhs);
// 6.3.3 any modifiers
@@ -221,6 +224,7 @@ public:
if (__h) this->__call(_Action::_Destroy);
}
+ _LIBCPP_INLINE_VISIBILITY
void swap(any & __rhs) _NOEXCEPT;
// 6.3.4 any observers
@@ -288,7 +292,7 @@ namespace __any_imp
{
template <class _Tp>
- struct _LIBCPP_TYPE_VIS_ONLY _SmallHandler
+ struct _LIBCPP_TEMPLATE_VIS _SmallHandler
{
_LIBCPP_INLINE_VISIBILITY
static void* __handle(_Action __act, any const * __this, any * __other,
@@ -369,7 +373,7 @@ namespace __any_imp
};
template <class _Tp>
- struct _LIBCPP_TYPE_VIS_ONLY _LargeHandler
+ struct _LIBCPP_TEMPLATE_VIS _LargeHandler
{
_LIBCPP_INLINE_VISIBILITY
static void* __handle(_Action __act, any const * __this, any * __other,
@@ -457,7 +461,6 @@ namespace __any_imp
template <class _ValueType, class>
-_LIBCPP_INLINE_VISIBILITY
any::any(_ValueType && __v) : __h(nullptr)
{
typedef typename decay<_ValueType>::type _Tp;
@@ -468,7 +471,6 @@ any::any(_ValueType && __v) : __h(nullptr)
}
template <class _ValueType, class>
-_LIBCPP_INLINE_VISIBILITY
any & any::operator=(_ValueType && __v)
{
typedef typename decay<_ValueType>::type _Tp;
@@ -478,7 +480,7 @@ any & any::operator=(_ValueType && __v)
return *this;
}
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void any::swap(any & __rhs) _NOEXCEPT
{
if (__h && __rhs.__h) {
@@ -550,7 +552,7 @@ _ValueType any_cast(any && __v)
}
template <class _ValueType>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename add_pointer<typename add_const<_ValueType>::type>::type
any_cast(any const * __any) _NOEXCEPT
{
@@ -560,7 +562,6 @@ any_cast(any const * __any) _NOEXCEPT
}
template <class _ValueType>
-_LIBCPP_INLINE_VISIBILITY
typename add_pointer<_ValueType>::type
any_cast(any * __any) _NOEXCEPT
{
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/coroutine b/chromium/buildtools/third_party/libc++/trunk/include/experimental/coroutine
new file mode 100644
index 00000000000..208a4d21761
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/coroutine
@@ -0,0 +1,260 @@
+// -*- C++ -*-
+//===----------------------------- coroutine -----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_COROUTINE
+#define _LIBCPP_EXPERIMENTAL_COROUTINE
+
+/**
+ experimental/coroutine synopsis
+
+// C++next
+
+namespace std {
+namespace experimental {
+inline namespace coroutines_v1 {
+
+ // 18.11.1 coroutine traits
+template <typename R, typename... ArgTypes>
+class coroutine_traits;
+// 18.11.2 coroutine handle
+template <typename Promise = void>
+class coroutine_handle;
+// 18.11.2.7 comparison operators:
+bool operator==(coroutine_handle<> x, coroutine_handle<> y) noexcept;
+bool operator!=(coroutine_handle<> x, coroutine_handle<> y) noexcept;
+bool operator<(coroutine_handle<> x, coroutine_handle<> y) noexcept;
+bool operator<=(coroutine_handle<> x, coroutine_handle<> y) noexcept;
+bool operator>=(coroutine_handle<> x, coroutine_handle<> y) noexcept;
+bool operator>(coroutine_handle<> x, coroutine_handle<> y) noexcept;
+// 18.11.3 trivial awaitables
+struct suspend_never;
+struct suspend_always;
+// 18.11.2.8 hash support:
+template <class T> struct hash;
+template <class P> struct hash<coroutine_handle<P>>;
+
+} // namespace coroutines_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <new>
+#include <type_traits>
+#include <functional>
+#include <memory> // for hash<T*>
+#include <cstddef>
+#include <cassert>
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#ifndef __cpp_coroutines
+# if defined(_LIBCPP_WARNING)
+ _LIBCPP_WARNING("<experimental/coroutine> cannot be used with this compiler")
+# else
+# warning <experimental/coroutine> cannot be used with this compiler
+# endif
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES
+
+template <class _Tp, class = void>
+struct __coroutine_traits_sfinae {};
+
+template <class _Tp>
+struct __coroutine_traits_sfinae<
+ _Tp, typename __void_t<typename _Tp::promise_type>::type>
+{
+ using promise_type = typename _Tp::promise_type;
+};
+
+template <typename _Ret, typename... _Args>
+struct _LIBCPP_TEMPLATE_VIS coroutine_traits
+ : public __coroutine_traits_sfinae<_Ret>
+{
+};
+
+template <typename Promise = void>
+class _LIBCPP_TEMPLATE_VIS coroutine_handle;
+
+#if defined(__cpp_coroutines)
+
+template <>
+class _LIBCPP_TEMPLATE_VIS coroutine_handle<void> {
+public:
+ _LIBCPP_ALWAYS_INLINE
+ constexpr coroutine_handle() noexcept : __handle_(nullptr) {}
+
+ _LIBCPP_ALWAYS_INLINE
+ constexpr coroutine_handle(nullptr_t) noexcept : __handle_(nullptr) {}
+
+ _LIBCPP_ALWAYS_INLINE
+ coroutine_handle& operator=(nullptr_t) noexcept {
+ __handle_ = nullptr;
+ return *this;
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ constexpr void* address() const noexcept { return __handle_; }
+
+ _LIBCPP_ALWAYS_INLINE
+ constexpr explicit operator bool() const noexcept { return __handle_; }
+
+ _LIBCPP_ALWAYS_INLINE
+ void operator()() const { resume(); }
+
+ _LIBCPP_ALWAYS_INLINE
+ void resume() const {
+ _LIBCPP_ASSERT(__is_suspended(),
+ "resume() can only be called on suspended coroutines");
+ _LIBCPP_ASSERT(!done(),
+ "resume() has undefined behavior when the coroutine is done");
+ __builtin_coro_resume(__handle_);
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ void destroy() const {
+ _LIBCPP_ASSERT(__is_suspended(),
+ "destroy() can only be called on suspended coroutines");
+ __builtin_coro_destroy(__handle_);
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ bool done() const {
+ _LIBCPP_ASSERT(__is_suspended(),
+ "done() can only be called on suspended coroutines");
+ return __builtin_coro_done(__handle_);
+ }
+
+public:
+ _LIBCPP_ALWAYS_INLINE
+ static coroutine_handle from_address(void* __addr) noexcept {
+ coroutine_handle __tmp;
+ __tmp.__handle_ = __addr;
+ return __tmp;
+ }
+
+private:
+ bool __is_suspended() const noexcept {
+ // FIXME actually implement a check for if the coro is suspended.
+ return __handle_;
+ }
+
+ template <class _PromiseT> friend class coroutine_handle;
+ void* __handle_;
+};
+
+// 18.11.2.7 comparison operators:
+inline _LIBCPP_ALWAYS_INLINE
+bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
+ return __x.address() == __y.address();
+}
+inline _LIBCPP_ALWAYS_INLINE
+bool operator!=(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
+ return !(__x == __y);
+}
+inline _LIBCPP_ALWAYS_INLINE
+bool operator<(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
+ return less<void*>()(__x.address(), __y.address());
+}
+inline _LIBCPP_ALWAYS_INLINE
+bool operator>(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
+ return __y < __x;
+}
+inline _LIBCPP_ALWAYS_INLINE
+bool operator<=(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
+ return !(__x > __y);
+}
+inline _LIBCPP_ALWAYS_INLINE
+bool operator>=(coroutine_handle<> __x, coroutine_handle<> __y) noexcept {
+ return !(__x < __y);
+}
+
+template <typename _Promise>
+class _LIBCPP_TEMPLATE_VIS coroutine_handle : public coroutine_handle<> {
+ using _Base = coroutine_handle<>;
+public:
+ // 18.11.2.1 construct/reset
+ using coroutine_handle<>::coroutine_handle;
+
+ _LIBCPP_INLINE_VISIBILITY
+ coroutine_handle& operator=(nullptr_t) noexcept {
+ _Base::operator=(nullptr);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ _Promise& promise() {
+ return *reinterpret_cast<_Promise*>(
+ __builtin_coro_promise(this->__handle_, alignof(_Promise), false));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ _Promise const& promise() const {
+ return *reinterpret_cast<_Promise const*>(
+ __builtin_coro_promise(this->__handle_, alignof(_Promise), false));
+ }
+
+public:
+ _LIBCPP_ALWAYS_INLINE
+ static coroutine_handle from_address(void* __addr) noexcept {
+ coroutine_handle __tmp;
+ __tmp.__handle_ = __addr;
+ return __tmp;
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ static coroutine_handle from_promise(_Promise& __promise) noexcept {
+ coroutine_handle __tmp;
+ __tmp.__handle_ = __builtin_coro_promise(_VSTD::addressof(__promise),
+ alignof(_Promise), true);
+ return __tmp;
+ }
+};
+
+#endif // defined(__cpp_coroutines)
+
+struct _LIBCPP_TYPE_VIS suspend_never {
+ _LIBCPP_ALWAYS_INLINE
+ bool await_ready() const noexcept { return true; }
+ _LIBCPP_ALWAYS_INLINE
+ void await_suspend(coroutine_handle<>) const noexcept {}
+ _LIBCPP_ALWAYS_INLINE
+ void await_resume() const noexcept {}
+};
+
+struct _LIBCPP_TYPE_VIS suspend_always {
+ _LIBCPP_ALWAYS_INLINE
+ bool await_ready() const noexcept { return false; }
+ _LIBCPP_ALWAYS_INLINE
+ void await_suspend(coroutine_handle<>) const noexcept {}
+ _LIBCPP_ALWAYS_INLINE
+ void await_resume() const noexcept {}
+};
+
+_LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct hash<_VSTD_CORO::coroutine_handle<_Tp> > {
+ using __arg_type = _VSTD_CORO::coroutine_handle<_Tp>;
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(__arg_type const& __v) const noexcept
+ {return hash<void*>{}(__v.address());}
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif /* _LIBCPP_EXPERIMENTAL_COROUTINE */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/deque b/chromium/buildtools/third_party/libc++/trunk/include/experimental/deque
new file mode 100644
index 00000000000..f8495743c1f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/deque
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+//===--------------------------- deque ------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_DEQUE
+#define _LIBCPP_EXPERIMENTAL_DEQUE
+/*
+ experimental/deque synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class T>
+ using deque = std::deque<T,polymorphic_allocator<T>>;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <deque>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _ValueT>
+using deque = _VSTD::deque<_ValueT, polymorphic_allocator<_ValueT>>;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_DEQUE */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/dynarray b/chromium/buildtools/third_party/libc++/trunk/include/experimental/dynarray
index f40a6ca188b..f96a0e5fed3 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/dynarray
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/dynarray
@@ -11,9 +11,6 @@
#ifndef _LIBCPP_DYNARRAY
#define _LIBCPP_DYNARRAY
-#include <__config>
-#if _LIBCPP_STD_VER > 11
-
/*
dynarray synopsis
@@ -96,6 +93,8 @@ public:
}} // std::experimental
*/
+#include <__config>
+#if _LIBCPP_STD_VER > 11
#include <__functional_base>
#include <iterator>
@@ -104,12 +103,6 @@ public:
#include <new>
#include <algorithm>
-#include <__undef___deallocate>
-
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -117,7 +110,7 @@ public:
namespace std { namespace experimental { inline namespace __array_extensions_v1 {
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY dynarray
+struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_DYNARRAY dynarray
{
public:
// types:
@@ -142,26 +135,25 @@ private:
static inline _LIBCPP_INLINE_VISIBILITY value_type* __allocate ( size_t count )
{
if ( numeric_limits<size_t>::max() / sizeof (value_type) <= count )
- {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_array_length();
-#else
- assert(!"dynarray::allocation");
-#endif
- }
+ __throw_bad_array_length();
+
return static_cast<value_type *> (_VSTD::__allocate (sizeof(value_type) * count));
}
- static inline _LIBCPP_INLINE_VISIBILITY void __deallocate ( value_type* __ptr ) noexcept
+ static inline _LIBCPP_INLINE_VISIBILITY void __deallocate_value( value_type* __ptr ) noexcept
{
- _VSTD::__deallocate (static_cast<void *> (__ptr));
+ _VSTD::__libcpp_deallocate (static_cast<void *> (__ptr));
}
public:
+ _LIBCPP_INLINE_VISIBILITY
explicit dynarray(size_type __c);
+ _LIBCPP_INLINE_VISIBILITY
dynarray(size_type __c, const value_type& __v);
+ _LIBCPP_INLINE_VISIBILITY
dynarray(const dynarray& __d);
+ _LIBCPP_INLINE_VISIBILITY
dynarray(initializer_list<value_type>);
// We're not implementing these right now.
@@ -176,6 +168,7 @@ public:
// dynarray(allocator_arg_t, const _Alloc& __alloc, initializer_list<value_type>);
dynarray& operator=(const dynarray&) = delete;
+ _LIBCPP_INLINE_VISIBILITY
~dynarray();
// iterators:
@@ -219,7 +212,7 @@ public:
};
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
dynarray<_Tp>::dynarray(size_type __c) : dynarray ()
{
__base_ = __allocate (__c);
@@ -229,7 +222,7 @@ dynarray<_Tp>::dynarray(size_type __c) : dynarray ()
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
dynarray<_Tp>::dynarray(size_type __c, const value_type& __v) : dynarray ()
{
__base_ = __allocate (__c);
@@ -239,7 +232,7 @@ dynarray<_Tp>::dynarray(size_type __c, const value_type& __v) : dynarray ()
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
dynarray<_Tp>::dynarray(initializer_list<value_type> __il) : dynarray ()
{
size_t sz = __il.size();
@@ -251,7 +244,7 @@ dynarray<_Tp>::dynarray(initializer_list<value_type> __il) : dynarray ()
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
dynarray<_Tp>::dynarray(const dynarray& __d) : dynarray ()
{
size_t sz = __d.size();
@@ -263,13 +256,13 @@ dynarray<_Tp>::dynarray(const dynarray& __d) : dynarray ()
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
dynarray<_Tp>::~dynarray()
{
value_type *__data = data () + __size_;
for ( size_t i = 0; i < __size_; ++i )
(--__data)->value_type::~value_type();
- __deallocate ( __base_ );
+ __deallocate_value( __base_ );
}
template <class _Tp>
@@ -278,13 +271,8 @@ typename dynarray<_Tp>::reference
dynarray<_Tp>::at(size_type __n)
{
if (__n >= __size_)
- {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("dynarray::at");
-#else
- assert(!"dynarray::at out_of_range");
-#endif
- }
+ __throw_out_of_range("dynarray::at");
+
return data()[__n];
}
@@ -294,13 +282,8 @@ typename dynarray<_Tp>::const_reference
dynarray<_Tp>::at(size_type __n) const
{
if (__n >= __size_)
- {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("dynarray::at");
-#else
- assert(!"dynarray::at out_of_range");
-#endif
- }
+ __throw_out_of_range("dynarray::at");
+
return data()[__n];
}
@@ -309,7 +292,7 @@ dynarray<_Tp>::at(size_type __n) const
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<std::experimental::dynarray<_Tp>, _Alloc> : true_type {};
+struct _LIBCPP_TEMPLATE_VIS uses_allocator<std::experimental::dynarray<_Tp>, _Alloc> : true_type {};
_LIBCPP_END_NAMESPACE_STD
#endif // if _LIBCPP_STD_VER > 11
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/filesystem b/chromium/buildtools/third_party/libc++/trunk/include/experimental/filesystem
new file mode 100644
index 00000000000..42157ba309b
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/filesystem
@@ -0,0 +1,2139 @@
+// -*- C++ -*-
+//===--------------------------- filesystem -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP_EXPERIMENTAL_FILESYSTEM
+#define _LIBCPP_EXPERIMENTAL_FILESYSTEM
+/*
+ filesystem synopsis
+
+ namespace std { namespace experimental { namespace filesystem { inline namespace v1 {
+
+ class path;
+
+ void swap(path& lhs, path& rhs) _NOEXCEPT;
+ size_t hash_value(const path& p) _NOEXCEPT;
+
+ bool operator==(const path& lhs, const path& rhs) _NOEXCEPT;
+ bool operator!=(const path& lhs, const path& rhs) _NOEXCEPT;
+ bool operator< (const path& lhs, const path& rhs) _NOEXCEPT;
+ bool operator<=(const path& lhs, const path& rhs) _NOEXCEPT;
+ bool operator> (const path& lhs, const path& rhs) _NOEXCEPT;
+ bool operator>=(const path& lhs, const path& rhs) _NOEXCEPT;
+
+ path operator/ (const path& lhs, const path& rhs);
+
+ template <class charT, class traits>
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os, const path& p);
+
+ template <class charT, class traits>
+ basic_istream<charT, traits>&
+ operator>>(basic_istream<charT, traits>& is, path& p);
+
+ template <class Source>
+ path u8path(const Source& source);
+ template <class InputIterator>
+ path u8path(InputIterator first, InputIterator last);
+
+ class filesystem_error;
+ class directory_entry;
+
+ class directory_iterator;
+
+ // enable directory_iterator range-based for statements
+ directory_iterator begin(directory_iterator iter) noexcept;
+ directory_iterator end(const directory_iterator&) noexcept;
+
+ class recursive_directory_iterator;
+
+ // enable recursive_directory_iterator range-based for statements
+ recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
+ recursive_directory_iterator end(const recursive_directory_iterator&) noexcept;
+
+ class file_status;
+
+ struct space_info
+ {
+ uintmax_t capacity;
+ uintmax_t free;
+ uintmax_t available;
+ };
+
+ enum class file_type;
+ enum class perms;
+ enum class copy_options;
+ enum class directory_options;
+
+ typedef chrono::time_point<trivial-clock> file_time_type;
+
+ // operational functions
+
+ path absolute(const path& p, const path& base=current_path());
+
+ path canonical(const path& p, const path& base = current_path());
+ path canonical(const path& p, error_code& ec);
+ path canonical(const path& p, const path& base, error_code& ec);
+
+ void copy(const path& from, const path& to);
+ void copy(const path& from, const path& to, error_code& ec) _NOEXCEPT;
+ void copy(const path& from, const path& to, copy_options options);
+ void copy(const path& from, const path& to, copy_options options,
+ error_code& ec) _NOEXCEPT;
+
+ bool copy_file(const path& from, const path& to);
+ bool copy_file(const path& from, const path& to, error_code& ec) _NOEXCEPT;
+ bool copy_file(const path& from, const path& to, copy_options option);
+ bool copy_file(const path& from, const path& to, copy_options option,
+ error_code& ec) _NOEXCEPT;
+
+ void copy_symlink(const path& existing_symlink, const path& new_symlink);
+ void copy_symlink(const path& existing_symlink, const path& new_symlink,
+ error_code& ec) _NOEXCEPT;
+
+ bool create_directories(const path& p);
+ bool create_directories(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool create_directory(const path& p);
+ bool create_directory(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool create_directory(const path& p, const path& attributes);
+ bool create_directory(const path& p, const path& attributes,
+ error_code& ec) _NOEXCEPT;
+
+ void create_directory_symlink(const path& to, const path& new_symlink);
+ void create_directory_symlink(const path& to, const path& new_symlink,
+ error_code& ec) _NOEXCEPT;
+
+ void create_hard_link(const path& to, const path& new_hard_link);
+ void create_hard_link(const path& to, const path& new_hard_link,
+ error_code& ec) _NOEXCEPT;
+
+ void create_symlink(const path& to, const path& new_symlink);
+ void create_symlink(const path& to, const path& new_symlink,
+ error_code& ec) _NOEXCEPT;
+
+ path current_path();
+ path current_path(error_code& ec);
+ void current_path(const path& p);
+ void current_path(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool exists(file_status s) _NOEXCEPT;
+ bool exists(const path& p);
+ bool exists(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool equivalent(const path& p1, const path& p2);
+ bool equivalent(const path& p1, const path& p2, error_code& ec) _NOEXCEPT;
+
+ uintmax_t file_size(const path& p);
+ uintmax_t file_size(const path& p, error_code& ec) _NOEXCEPT;
+
+ uintmax_t hard_link_count(const path& p);
+ uintmax_t hard_link_count(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_block_file(file_status s) _NOEXCEPT;
+ bool is_block_file(const path& p);
+ bool is_block_file(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_character_file(file_status s) _NOEXCEPT;
+ bool is_character_file(const path& p);
+ bool is_character_file(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_directory(file_status s) _NOEXCEPT;
+ bool is_directory(const path& p);
+ bool is_directory(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_empty(const path& p);
+ bool is_empty(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_fifo(file_status s) _NOEXCEPT;
+ bool is_fifo(const path& p);
+ bool is_fifo(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_other(file_status s) _NOEXCEPT;
+ bool is_other(const path& p);
+ bool is_other(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_regular_file(file_status s) _NOEXCEPT;
+ bool is_regular_file(const path& p);
+ bool is_regular_file(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_socket(file_status s) _NOEXCEPT;
+ bool is_socket(const path& p);
+ bool is_socket(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool is_symlink(file_status s) _NOEXCEPT;
+ bool is_symlink(const path& p);
+ bool is_symlink(const path& p, error_code& ec) _NOEXCEPT;
+
+ file_time_type last_write_time(const path& p);
+ file_time_type last_write_time(const path& p, error_code& ec) _NOEXCEPT;
+ void last_write_time(const path& p, file_time_type new_time);
+ void last_write_time(const path& p, file_time_type new_time,
+ error_code& ec) _NOEXCEPT;
+
+ void permissions(const path& p, perms prms);
+ void permissions(const path& p, perms prms, error_code& ec) _NOEXCEPT;
+
+ path read_symlink(const path& p);
+ path read_symlink(const path& p, error_code& ec);
+
+ bool remove(const path& p);
+ bool remove(const path& p, error_code& ec) _NOEXCEPT;
+
+ uintmax_t remove_all(const path& p);
+ uintmax_t remove_all(const path& p, error_code& ec) _NOEXCEPT;
+
+ void rename(const path& from, const path& to);
+ void rename(const path& from, const path& to, error_code& ec) _NOEXCEPT;
+
+ void resize_file(const path& p, uintmax_t size);
+ void resize_file(const path& p, uintmax_t size, error_code& ec) _NOEXCEPT;
+
+ space_info space(const path& p);
+ space_info space(const path& p, error_code& ec) _NOEXCEPT;
+
+ file_status status(const path& p);
+ file_status status(const path& p, error_code& ec) _NOEXCEPT;
+
+ bool status_known(file_status s) _NOEXCEPT;
+
+ file_status symlink_status(const path& p);
+ file_status symlink_status(const path& p, error_code& ec) _NOEXCEPT;
+
+ path system_complete(const path& p);
+ path system_complete(const path& p, error_code& ec);
+
+ path temp_directory_path();
+ path temp_directory_path(error_code& ec);
+
+} } } } // namespaces std::experimental::filesystem::v1
+
+*/
+
+#include <experimental/__config>
+#include <cstddef>
+#include <chrono>
+#include <iterator>
+#include <iosfwd>
+#include <locale>
+#include <memory>
+#include <stack>
+#include <string>
+#include <system_error>
+#include <utility>
+#include <iomanip> // for quoted
+#include <string_view>
+
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#define __cpp_lib_experimental_filesystem 201406
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
+
+typedef chrono::time_point<std::chrono::system_clock> file_time_type;
+
+struct _LIBCPP_TYPE_VIS space_info
+{
+ uintmax_t capacity;
+ uintmax_t free;
+ uintmax_t available;
+};
+
+enum class _LIBCPP_ENUM_VIS file_type : signed char
+{
+ none = 0,
+ not_found = -1,
+ regular = 1,
+ directory = 2,
+ symlink = 3,
+ block = 4,
+ character = 5,
+ fifo = 6,
+ socket = 7,
+ unknown = 8
+};
+
+enum class _LIBCPP_ENUM_VIS perms : unsigned
+{
+ none = 0,
+
+ owner_read = 0400,
+ owner_write = 0200,
+ owner_exec = 0100,
+ owner_all = 0700,
+
+ group_read = 040,
+ group_write = 020,
+ group_exec = 010,
+ group_all = 070,
+
+ others_read = 04,
+ others_write = 02,
+ others_exec = 01,
+ others_all = 07,
+
+ all = 0777,
+
+ set_uid = 04000,
+ set_gid = 02000,
+ sticky_bit = 01000,
+ mask = 07777,
+ unknown = 0xFFFF,
+
+ add_perms = 0x10000,
+ remove_perms = 0x20000,
+ symlink_nofollow = 0x40000
+};
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR perms operator&(perms _LHS, perms _RHS)
+{ return static_cast<perms>(static_cast<unsigned>(_LHS) & static_cast<unsigned>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR perms operator|(perms _LHS, perms _RHS)
+{ return static_cast<perms>(static_cast<unsigned>(_LHS) | static_cast<unsigned>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR perms operator^(perms _LHS, perms _RHS)
+{ return static_cast<perms>(static_cast<unsigned>(_LHS) ^ static_cast<unsigned>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR perms operator~(perms _LHS)
+{ return static_cast<perms>(~static_cast<unsigned>(_LHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline perms& operator&=(perms& _LHS, perms _RHS)
+{ return _LHS = _LHS & _RHS; }
+
+_LIBCPP_INLINE_VISIBILITY
+inline perms& operator|=(perms& _LHS, perms _RHS)
+{ return _LHS = _LHS | _RHS; }
+
+_LIBCPP_INLINE_VISIBILITY
+inline perms& operator^=(perms& _LHS, perms _RHS)
+{ return _LHS = _LHS ^ _RHS; }
+
+enum class _LIBCPP_ENUM_VIS copy_options : unsigned short
+{
+ none = 0,
+ skip_existing = 1,
+ overwrite_existing = 2,
+ update_existing = 4,
+ recursive = 8,
+ copy_symlinks = 16,
+ skip_symlinks = 32,
+ directories_only = 64,
+ create_symlinks = 128,
+ create_hard_links = 256,
+ __in_recursive_copy = 512,
+};
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR copy_options operator&(copy_options _LHS, copy_options _RHS)
+{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) & static_cast<unsigned short>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR copy_options operator|(copy_options _LHS, copy_options _RHS)
+{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) | static_cast<unsigned short>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR copy_options operator^(copy_options _LHS, copy_options _RHS)
+{ return static_cast<copy_options>(static_cast<unsigned short>(_LHS) ^ static_cast<unsigned short>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR copy_options operator~(copy_options _LHS)
+{ return static_cast<copy_options>(~static_cast<unsigned short>(_LHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline copy_options& operator&=(copy_options& _LHS, copy_options _RHS)
+{ return _LHS = _LHS & _RHS; }
+
+_LIBCPP_INLINE_VISIBILITY
+inline copy_options& operator|=(copy_options& _LHS, copy_options _RHS)
+{ return _LHS = _LHS | _RHS; }
+
+_LIBCPP_INLINE_VISIBILITY
+inline copy_options& operator^=(copy_options& _LHS, copy_options _RHS)
+{ return _LHS = _LHS ^ _RHS; }
+
+
+enum class _LIBCPP_ENUM_VIS directory_options : unsigned char
+{
+ none = 0,
+ follow_directory_symlink = 1,
+ skip_permission_denied = 2
+};
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR directory_options operator&(directory_options _LHS, directory_options _RHS)
+{ return static_cast<directory_options>(static_cast<unsigned char>(_LHS) & static_cast<unsigned char>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR directory_options operator|(directory_options _LHS, directory_options _RHS)
+{ return static_cast<directory_options>(static_cast<unsigned char>(_LHS) | static_cast<unsigned char>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR directory_options operator^(directory_options _LHS, directory_options _RHS)
+{ return static_cast<directory_options>(static_cast<unsigned char>(_LHS) ^ static_cast<unsigned char>(_RHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR directory_options operator~(directory_options _LHS)
+{ return static_cast<directory_options>(~static_cast<unsigned char>(_LHS)); }
+
+_LIBCPP_INLINE_VISIBILITY
+inline directory_options& operator&=(directory_options& _LHS, directory_options _RHS)
+{ return _LHS = _LHS & _RHS; }
+
+_LIBCPP_INLINE_VISIBILITY
+inline directory_options& operator|=(directory_options& _LHS, directory_options _RHS)
+{ return _LHS = _LHS | _RHS; }
+
+_LIBCPP_INLINE_VISIBILITY
+inline directory_options& operator^=(directory_options& _LHS, directory_options _RHS)
+{ return _LHS = _LHS ^ _RHS; }
+
+
+class _LIBCPP_TYPE_VIS file_status
+{
+public:
+ // constructors
+ _LIBCPP_INLINE_VISIBILITY
+ file_status() _NOEXCEPT : file_status(file_type::none) {}
+ _LIBCPP_INLINE_VISIBILITY
+ explicit file_status(file_type __ft,
+ perms __prms = perms::unknown) _NOEXCEPT
+ : __ft_(__ft), __prms_(__prms)
+ {}
+
+ file_status(const file_status&) _NOEXCEPT = default;
+ file_status(file_status&&) _NOEXCEPT = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~file_status() {}
+
+ file_status& operator=(const file_status&) _NOEXCEPT = default;
+ file_status& operator=(file_status&&) _NOEXCEPT = default;
+
+ // observers
+ _LIBCPP_ALWAYS_INLINE
+ file_type type() const _NOEXCEPT {
+ return __ft_;
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ perms permissions() const _NOEXCEPT {
+ return __prms_;
+ }
+
+ // modifiers
+ _LIBCPP_ALWAYS_INLINE
+ void type(file_type __ft) _NOEXCEPT {
+ __ft_ = __ft;
+ }
+
+ _LIBCPP_ALWAYS_INLINE
+ void permissions(perms __p) _NOEXCEPT {
+ __prms_ = __p;
+ }
+private:
+ file_type __ft_;
+ perms __prms_;
+};
+
+class _LIBCPP_TYPE_VIS directory_entry;
+
+template <class _Tp> struct __can_convert_char {
+ static const bool value = false;
+};
+template <class _Tp> struct __can_convert_char<const _Tp>
+ : public __can_convert_char<_Tp> {
+};
+template <> struct __can_convert_char<char> {
+ static const bool value = true;
+ using __char_type = char;
+};
+template <> struct __can_convert_char<wchar_t> {
+ static const bool value = true;
+ using __char_type = wchar_t;
+};
+template <> struct __can_convert_char<char16_t> {
+ static const bool value = true;
+ using __char_type = char16_t;
+};
+template <> struct __can_convert_char<char32_t> {
+ static const bool value = true;
+ using __char_type = char32_t;
+};
+
+template <class _ECharT>
+typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
+__is_separator(_ECharT __e) {
+ return __e == _ECharT('/');
+};
+
+struct _NullSentinal {};
+
+template <class _Tp>
+using _Void = void;
+
+template <class _Tp, class = void>
+struct __is_pathable_string : public false_type {};
+
+template <class _ECharT, class _Traits, class _Alloc>
+struct __is_pathable_string<basic_string<_ECharT, _Traits, _Alloc>,
+ _Void<typename __can_convert_char<_ECharT>::__char_type>>
+: public __can_convert_char<_ECharT>
+{
+ using _Str = basic_string<_ECharT, _Traits, _Alloc>;
+ using _Base = __can_convert_char<_ECharT>;
+ static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); }
+ static _ECharT const* __range_end(_Str const& __s) { return __s.data() + __s.length(); }
+ static _ECharT __first_or_null(_Str const& __s) {
+ return __s.empty() ? _ECharT{} : __s[0];
+ }
+};
+
+
+template <class _ECharT, class _Traits>
+struct __is_pathable_string<basic_string_view<_ECharT, _Traits>,
+ _Void<typename __can_convert_char<_ECharT>::__char_type>>
+: public __can_convert_char<_ECharT>
+{
+ using _Str = basic_string_view<_ECharT, _Traits>;
+ using _Base = __can_convert_char<_ECharT>;
+ static _ECharT const* __range_begin(_Str const& __s) { return __s.data(); }
+ static _ECharT const* __range_end(_Str const& __s) { return __s.data() + __s.length(); }
+ static _ECharT __first_or_null(_Str const& __s) {
+ return __s.empty() ? _ECharT{} : __s[0];
+ }
+};
+
+template <class _Source,
+ class _DS = typename decay<_Source>::type,
+ class _UnqualPtrType = typename remove_const<
+ typename remove_pointer<_DS>::type>::type,
+ bool _IsCharPtr = is_pointer<_DS>::value &&
+ __can_convert_char<_UnqualPtrType>::value
+ >
+struct __is_pathable_char_array : false_type {};
+
+template <class _Source, class _ECharT, class _UPtr>
+struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
+ : __can_convert_char<typename remove_const<_ECharT>::type>
+{
+ using _Base = __can_convert_char<typename remove_const<_ECharT>::type>;
+
+ static _ECharT const* __range_begin(const _ECharT* __b) { return __b; }
+ static _ECharT const* __range_end(const _ECharT* __b)
+ {
+ using _Iter = const _ECharT*;
+ const _ECharT __sentinal = _ECharT{};
+ _Iter __e = __b;
+ for (; *__e != __sentinal; ++__e)
+ ;
+ return __e;
+ }
+
+ static _ECharT __first_or_null(const _ECharT* __b) { return *__b; }
+};
+
+template <class _Iter, bool _IsIt = __is_input_iterator<_Iter>::value, class = void>
+struct __is_pathable_iter : false_type {};
+
+template <class _Iter>
+struct __is_pathable_iter<_Iter, true,
+ _Void<typename __can_convert_char<typename iterator_traits<_Iter>::value_type>::__char_type>>
+ : __can_convert_char<typename iterator_traits<_Iter>::value_type>
+{
+ using _ECharT = typename iterator_traits<_Iter>::value_type;
+ using _Base = __can_convert_char<_ECharT>;
+
+ static _Iter __range_begin(_Iter __b) { return __b; }
+ static _NullSentinal __range_end(_Iter) { return _NullSentinal{}; }
+
+ static _ECharT __first_or_null(_Iter __b) { return *__b; }
+};
+
+template <class _Tp, bool _IsStringT = __is_pathable_string<_Tp>::value,
+ bool _IsCharIterT = __is_pathable_char_array<_Tp>::value,
+ bool _IsIterT = !_IsCharIterT && __is_pathable_iter<_Tp>::value
+ >
+struct __is_pathable : false_type {
+ static_assert(!_IsStringT && !_IsCharIterT && !_IsIterT, "Must all be false");
+};
+
+template <class _Tp>
+struct __is_pathable<_Tp, true, false, false> : __is_pathable_string<_Tp> {};
+
+
+template <class _Tp>
+struct __is_pathable<_Tp, false, true, false> : __is_pathable_char_array<_Tp> {};
+
+
+template <class _Tp>
+struct __is_pathable<_Tp, false, false, true> : __is_pathable_iter<_Tp> {};
+
+
+template <class _ECharT>
+struct _PathCVT {
+ static_assert(__can_convert_char<_ECharT>::value, "Char type not convertible");
+
+ typedef __narrow_to_utf8<sizeof(_ECharT)*__CHAR_BIT__> _Narrower;
+
+ static void __append_range(string& __dest, _ECharT const* __b, _ECharT const* __e) {
+ _Narrower()(back_inserter(__dest), __b, __e);
+ }
+
+ template <class _Iter>
+ static void __append_range(string& __dest, _Iter __b, _Iter __e) {
+ static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
+ if (__b == __e) return;
+ basic_string<_ECharT> __tmp(__b, __e);
+ _Narrower()(back_inserter(__dest), __tmp.data(),
+ __tmp.data() + __tmp.length());
+ }
+
+ template <class _Iter>
+ static void __append_range(string& __dest, _Iter __b, _NullSentinal) {
+ static_assert(!is_same<_Iter, _ECharT*>::value, "Call const overload");
+ const _ECharT __sentinal = _ECharT{};
+ if (*__b == __sentinal) return;
+ basic_string<_ECharT> __tmp;
+ for (; *__b != __sentinal; ++__b)
+ __tmp.push_back(*__b);
+ _Narrower()(back_inserter(__dest), __tmp.data(),
+ __tmp.data() + __tmp.length());
+ }
+
+ template <class _Source>
+ static void __append_source(string& __dest, _Source const& __s)
+ {
+ using _Traits = __is_pathable<_Source>;
+ __append_range(__dest, _Traits::__range_begin(__s), _Traits::__range_end(__s));
+ }
+};
+
+template <>
+struct _PathCVT<char> {
+
+ template <class _Iter>
+ static typename enable_if<
+ __is_exactly_input_iterator<_Iter>::value
+ >::type __append_range(string& __dest, _Iter __b, _Iter __e) {
+ for (; __b != __e; ++__b)
+ __dest.push_back(*__b);
+ }
+
+ template <class _Iter>
+ static typename enable_if<
+ __is_forward_iterator<_Iter>::value
+ >::type __append_range(string& __dest, _Iter __b, _Iter __e) {
+ __dest.__append_forward_unsafe(__b, __e);
+ }
+
+ template <class _Iter>
+ static void __append_range(string& __dest, _Iter __b, _NullSentinal) {
+ const char __sentinal = char{};
+ for (; *__b != __sentinal; ++__b)
+ __dest.push_back(*__b);
+ }
+
+ template <class _Source>
+ static void __append_source(string& __dest, _Source const& __s)
+ {
+ using _Traits = __is_pathable<_Source>;
+ __append_range(__dest, _Traits::__range_begin(__s),
+ _Traits::__range_end(__s));
+ }
+};
+
+
+class _LIBCPP_TYPE_VIS path
+{
+ template <class _SourceOrIter, class _Tp = path&>
+ using _EnableIfPathable = typename
+ enable_if<__is_pathable<_SourceOrIter>::value, _Tp>::type;
+
+ template <class _Tp>
+ using _SourceChar = typename __is_pathable<_Tp>::__char_type;
+
+ template <class _Tp>
+ using _SourceCVT = _PathCVT<_SourceChar<_Tp>>;
+
+public:
+ typedef char value_type;
+ typedef basic_string<value_type> string_type;
+ typedef _VSTD::string_view __string_view;
+ static _LIBCPP_CONSTEXPR value_type preferred_separator = '/';
+
+ // constructors and destructor
+ _LIBCPP_INLINE_VISIBILITY path() _NOEXCEPT {}
+ _LIBCPP_INLINE_VISIBILITY path(const path& __p) : __pn_(__p.__pn_) {}
+ _LIBCPP_INLINE_VISIBILITY path(path&& __p) _NOEXCEPT : __pn_(_VSTD::move(__p.__pn_)) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ path(string_type&& __s) _NOEXCEPT : __pn_(_VSTD::move(__s)) {}
+
+ template <
+ class _Source,
+ class = _EnableIfPathable<_Source, void>
+ >
+ path(const _Source& __src) {
+ _SourceCVT<_Source>::__append_source(__pn_, __src);
+ }
+
+ template <class _InputIt>
+ path(_InputIt __first, _InputIt __last) {
+ typedef typename iterator_traits<_InputIt>::value_type _ItVal;
+ _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
+ }
+
+ // TODO Implement locale conversions.
+ template <class _Source,
+ class = _EnableIfPathable<_Source, void>
+ >
+ path(const _Source& __src, const locale& __loc);
+ template <class _InputIt>
+ path(_InputIt __first, _InputIt _last, const locale& __loc);
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~path() = default;
+
+ // assignments
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator=(const path& __p) {
+ __pn_ = __p.__pn_;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator=(path&& __p) _NOEXCEPT {
+ __pn_ = _VSTD::move(__p.__pn_);
+ return *this;
+ }
+
+ template <class = void>
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator=(string_type&& __s) _NOEXCEPT {
+ __pn_ = _VSTD::move(__s);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ path& assign(string_type&& __s) _NOEXCEPT {
+ __pn_ = _VSTD::move(__s);
+ return *this;
+ }
+
+ template <class _Source>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIfPathable<_Source>
+ operator=(const _Source& __src)
+ { return this->assign(__src); }
+
+
+ template <class _Source>
+ _EnableIfPathable<_Source>
+ assign(const _Source& __src) {
+ __pn_.clear();
+ _SourceCVT<_Source>::__append_source(__pn_, __src);
+ return *this;
+ }
+
+ template <class _InputIt>
+ path& assign(_InputIt __first, _InputIt __last) {
+ typedef typename iterator_traits<_InputIt>::value_type _ItVal;
+ __pn_.clear();
+ _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
+ return *this;
+ }
+
+private:
+ template <class _ECharT>
+ void __append_sep_if_needed(_ECharT __first_or_null) {
+ const _ECharT __null_val = {};
+ bool __append_sep = !empty() &&
+ !__is_separator(__pn_.back()) &&
+ __first_or_null != __null_val && // non-empty
+ !__is_separator(__first_or_null);
+ if (__append_sep)
+ __pn_ += preferred_separator;
+ }
+
+public:
+ // appends
+ path& operator/=(const path& __p) {
+ _LIBCPP_ASSERT(!__p.has_root_name(),
+ "cannot append to a path with a root name");
+ __append_sep_if_needed(__p.empty() ? char{} : __p.__pn_[0]);
+ __pn_ += __p.native();
+ return *this;
+ }
+
+ template <class _Source>
+ _LIBCPP_INLINE_VISIBILITY
+ _EnableIfPathable<_Source>
+ operator/=(const _Source& __src) {
+ return this->append(__src);
+ }
+
+ template <class _Source>
+ _EnableIfPathable<_Source>
+ append(const _Source& __src) {
+ using _Traits = __is_pathable<_Source>;
+ using _CVT = _PathCVT<_SourceChar<_Source>>;
+ __append_sep_if_needed(_Traits::__first_or_null(__src));
+ _CVT::__append_source(__pn_, __src);
+ return *this;
+ }
+
+ template <class _InputIt>
+ path& append(_InputIt __first, _InputIt __last) {
+ typedef typename iterator_traits<_InputIt>::value_type _ItVal;
+ static_assert(__can_convert_char<_ItVal>::value, "Must convertible");
+ using _CVT = _PathCVT<_ItVal>;
+ if (__first != __last) {
+ __append_sep_if_needed(*__first);
+ _CVT::__append_range(__pn_, __first, __last);
+ }
+ return *this;
+ }
+
+ // concatenation
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator+=(const path& __x) {
+ __pn_ += __x.__pn_;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator+=(const string_type& __x) {
+ __pn_ += __x;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator+=(__string_view __x) {
+ __pn_ += __x;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator+=(const value_type* __x) {
+ __pn_ += __x;
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ path& operator+=(value_type __x) {
+ __pn_ += __x;
+ return *this;
+ }
+
+ template <class _ECharT>
+ typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
+ operator+=(_ECharT __x)
+ {
+ basic_string<_ECharT> __tmp;
+ __tmp += __x;
+ _PathCVT<_ECharT>::__append_source(__pn_, __tmp);
+ return *this;
+ }
+
+ template <class _Source>
+ _EnableIfPathable<_Source>
+ operator+=(const _Source& __x) {
+ return this->concat(__x);
+ }
+
+ template <class _Source>
+ _EnableIfPathable<_Source>
+ concat(const _Source& __x) {
+ _SourceCVT<_Source>::__append_source(__pn_, __x);
+ return *this;
+ }
+
+ template <class _InputIt>
+ path& concat(_InputIt __first, _InputIt __last) {
+ typedef typename iterator_traits<_InputIt>::value_type _ItVal;
+ _PathCVT<_ItVal>::__append_range(__pn_, __first, __last);
+ return *this;
+ }
+
+ // modifiers
+ _LIBCPP_INLINE_VISIBILITY
+ void clear() _NOEXCEPT {
+ __pn_.clear();
+ }
+
+ path& make_preferred() { return *this; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ path& remove_filename() {
+ if (__pn_.size() == __root_path_raw().size())
+ clear();
+ else
+ __pn_ = __parent_path();
+ return *this;
+ }
+
+ path& replace_filename(const path& __replacement) {
+ remove_filename();
+ return (*this /= __replacement);
+ }
+
+ path& replace_extension(const path& __replacement = path());
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(path& __rhs) _NOEXCEPT {
+ __pn_.swap(__rhs.__pn_);
+ }
+
+ // native format observers
+ _LIBCPP_INLINE_VISIBILITY
+ const string_type& native() const _NOEXCEPT {
+ return __pn_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const value_type* c_str() const _NOEXCEPT { return __pn_.c_str(); }
+
+ _LIBCPP_INLINE_VISIBILITY operator string_type() const { return __pn_; }
+
+ template <class _ECharT, class _Traits = char_traits<_ECharT>,
+ class _Allocator = allocator<_ECharT> >
+ basic_string<_ECharT, _Traits, _Allocator>
+ string(const _Allocator& __a = _Allocator()) const {
+ using _CVT = __widen_from_utf8<sizeof(_ECharT)*__CHAR_BIT__>;
+ using _Str = basic_string<_ECharT, _Traits, _Allocator>;
+ _Str __s(__a);
+ __s.reserve(__pn_.size());
+ _CVT()(back_inserter(__s), __pn_.data(), __pn_.data() + __pn_.size());
+ return __s;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY std::string string() const { return __pn_; }
+ _LIBCPP_INLINE_VISIBILITY std::wstring wstring() const { return string<wchar_t>(); }
+ _LIBCPP_INLINE_VISIBILITY std::string u8string() const { return __pn_; }
+ _LIBCPP_INLINE_VISIBILITY std::u16string u16string() const { return string<char16_t>(); }
+ _LIBCPP_INLINE_VISIBILITY std::u32string u32string() const { return string<char32_t>(); }
+
+ // generic format observers
+ template <class _ECharT, class _Traits = char_traits<_ECharT>,
+ class _Allocator = allocator<_ECharT>
+ >
+ basic_string<_ECharT, _Traits, _Allocator>
+ generic_string(const _Allocator& __a = _Allocator()) const {
+ return string<_ECharT, _Traits, _Allocator>(__a);
+ }
+
+ std::string generic_string() const { return __pn_; }
+ std::wstring generic_wstring() const { return string<wchar_t>(); }
+ std::string generic_u8string() const { return __pn_; }
+ std::u16string generic_u16string() const { return string<char16_t>(); }
+ std::u32string generic_u32string() const { return string<char32_t>(); }
+
+private:
+ int __compare(__string_view) const;
+ __string_view __root_name() const;
+ __string_view __root_directory() const;
+ __string_view __root_path_raw() const;
+ __string_view __relative_path() const;
+ __string_view __parent_path() const;
+ __string_view __filename() const;
+ __string_view __stem() const;
+ __string_view __extension() const;
+
+public:
+ // compare
+ _LIBCPP_INLINE_VISIBILITY int compare(const path& __p) const _NOEXCEPT { return __compare(__p.__pn_);}
+ _LIBCPP_INLINE_VISIBILITY int compare(const string_type& __s) const { return __compare(__s); }
+ _LIBCPP_INLINE_VISIBILITY int compare(__string_view __s) const { return __compare(__s); }
+ _LIBCPP_INLINE_VISIBILITY int compare(const value_type* __s) const { return __compare(__s); }
+
+ // decomposition
+ _LIBCPP_INLINE_VISIBILITY path root_name() const { return string_type(__root_name()); }
+ _LIBCPP_INLINE_VISIBILITY path root_directory() const { return string_type(__root_directory()); }
+ _LIBCPP_INLINE_VISIBILITY path root_path() const { return root_name().append(string_type(__root_directory())); }
+ _LIBCPP_INLINE_VISIBILITY path relative_path() const { return string_type(__relative_path()); }
+ _LIBCPP_INLINE_VISIBILITY path parent_path() const { return string_type(__parent_path()); }
+ _LIBCPP_INLINE_VISIBILITY path filename() const { return string_type(__filename()); }
+ _LIBCPP_INLINE_VISIBILITY path stem() const { return string_type(__stem());}
+ _LIBCPP_INLINE_VISIBILITY path extension() const { return string_type(__extension()); }
+
+ // query
+ _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT { return __pn_.empty(); }
+
+ _LIBCPP_INLINE_VISIBILITY bool has_root_name() const { return !__root_name().empty(); }
+ _LIBCPP_INLINE_VISIBILITY bool has_root_directory() const { return !__root_directory().empty(); }
+ _LIBCPP_INLINE_VISIBILITY bool has_root_path() const { return !__root_path_raw().empty(); }
+ _LIBCPP_INLINE_VISIBILITY bool has_relative_path() const { return !__relative_path().empty(); }
+ _LIBCPP_INLINE_VISIBILITY bool has_parent_path() const { return !__parent_path().empty(); }
+ _LIBCPP_INLINE_VISIBILITY bool has_filename() const { return !__filename().empty(); }
+ _LIBCPP_INLINE_VISIBILITY bool has_stem() const { return !__stem().empty(); }
+ _LIBCPP_INLINE_VISIBILITY bool has_extension() const { return !__extension().empty(); }
+
+ _LIBCPP_INLINE_VISIBILITY bool is_absolute() const { return has_root_directory(); }
+ _LIBCPP_INLINE_VISIBILITY bool is_relative() const { return !is_absolute(); }
+
+ // iterators
+ class _LIBCPP_TYPE_VIS iterator;
+ typedef iterator const_iterator;
+
+ iterator begin() const;
+ iterator end() const;
+
+private:
+ inline _LIBCPP_INLINE_VISIBILITY
+ path& __assign_view(__string_view const& __s) noexcept { __pn_ = string_type(__s); return *this; }
+ string_type __pn_;
+};
+
+inline _LIBCPP_ALWAYS_INLINE
+void swap(path& __lhs, path& __rhs) _NOEXCEPT {
+ __lhs.swap(__rhs);
+}
+
+_LIBCPP_FUNC_VIS
+size_t hash_value(const path& __p) _NOEXCEPT;
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator==(const path& __lhs, const path& __rhs) _NOEXCEPT
+{ return __lhs.compare(__rhs) == 0; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator!=(const path& __lhs, const path& __rhs) _NOEXCEPT
+{ return __lhs.compare(__rhs) != 0; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator<(const path& __lhs, const path& __rhs) _NOEXCEPT
+{ return __lhs.compare(__rhs) < 0; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator<=(const path& __lhs, const path& __rhs) _NOEXCEPT
+{ return __lhs.compare(__rhs) <= 0; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator>(const path& __lhs, const path& __rhs) _NOEXCEPT
+{ return __lhs.compare(__rhs) > 0; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator>=(const path& __lhs, const path& __rhs) _NOEXCEPT
+{ return __lhs.compare(__rhs) >= 0; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+path operator/(const path& __lhs, const path& __rhs) {
+ return path(__lhs) /= __rhs;
+}
+
+template <class _CharT, class _Traits>
+_LIBCPP_INLINE_VISIBILITY
+typename enable_if<is_same<_CharT, char>::value &&
+ is_same<_Traits, char_traits<char>>::value,
+ basic_ostream<_CharT, _Traits>&
+>::type
+operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
+ __os << std::__quoted(__p.native());
+ return __os;
+}
+
+template <class _CharT, class _Traits>
+_LIBCPP_INLINE_VISIBILITY
+typename enable_if<!is_same<_CharT, char>::value ||
+ !is_same<_Traits, char_traits<char>>::value,
+ basic_ostream<_CharT, _Traits>&
+>::type
+operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
+ __os << std::__quoted(__p.string<_CharT, _Traits>());
+ return __os;
+}
+
+template <class _CharT, class _Traits>
+_LIBCPP_INLINE_VISIBILITY
+basic_istream<_CharT, _Traits>&
+operator>>(basic_istream<_CharT, _Traits>& __is, path& __p)
+{
+ basic_string<_CharT, _Traits> __tmp;
+ __is >> __quoted(__tmp);
+ __p = __tmp;
+ return __is;
+}
+
+template <class _Source>
+_LIBCPP_INLINE_VISIBILITY
+typename enable_if<__is_pathable<_Source>::value, path>::type
+u8path(const _Source& __s){
+ static_assert(is_same<typename __is_pathable<_Source>::__char_type, char>::value,
+ "u8path(Source const&) requires Source have a character type of type 'char'");
+ return path(__s);
+}
+
+template <class _InputIt>
+_LIBCPP_INLINE_VISIBILITY
+typename enable_if<__is_pathable<_InputIt>::value, path>::type
+u8path(_InputIt __f, _InputIt __l) {
+ static_assert(is_same<typename __is_pathable<_InputIt>::__char_type, char>::value,
+ "u8path(Iter, Iter) requires Iter have a value_type of type 'char'");
+ return path(__f, __l);
+}
+
+class _LIBCPP_TYPE_VIS path::iterator
+{
+public:
+ typedef bidirectional_iterator_tag iterator_category;
+
+ typedef path value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const path* pointer;
+ typedef const path& reference;
+
+ typedef void __stashing_iterator_tag; // See reverse_iterator and __is_stashing_iterator
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ iterator() : __stashed_elem_(), __path_ptr_(nullptr),
+ __entry_(), __state_(__singular) {}
+
+ iterator(const iterator&) = default;
+ ~iterator() = default;
+
+ iterator& operator=(const iterator&) = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ reference operator*() const {
+ return __stashed_elem_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ pointer operator->() const {
+ return &__stashed_elem_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator& operator++() {
+ _LIBCPP_ASSERT(__state_ != __singular,
+ "attempting to increment a singular iterator");
+ _LIBCPP_ASSERT(__state_ != __at_end,
+ "attempting to increment the end iterator");
+ return __increment();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator operator++(int) {
+ iterator __it(*this);
+ this->operator++();
+ return __it;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator& operator--() {
+ _LIBCPP_ASSERT(__state_ != __singular,
+ "attempting to decrement a singular iterator");
+ _LIBCPP_ASSERT(__entry_.data() != __path_ptr_->native().data(),
+ "attempting to decrement the begin iterator");
+ return __decrement();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator operator--(int) {
+ iterator __it(*this);
+ this->operator--();
+ return __it;
+ }
+
+private:
+ friend class path;
+
+ static constexpr unsigned char __singular = 0;
+ static constexpr unsigned char __at_end = 6;
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ friend bool operator==(const iterator&, const iterator&);
+
+ iterator& __increment();
+ iterator& __decrement();
+
+ path __stashed_elem_;
+ const path* __path_ptr_;
+ path::__string_view __entry_;
+ unsigned char __state_;
+};
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator==(const path::iterator& __lhs, const path::iterator& __rhs) {
+ return __lhs.__path_ptr_ == __rhs.__path_ptr_ &&
+ __lhs.__entry_.data() == __rhs.__entry_.data();
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator!=(const path::iterator& __lhs, const path::iterator& __rhs) {
+ return !(__lhs == __rhs);
+}
+
+class _LIBCPP_EXCEPTION_ABI filesystem_error : public system_error
+{
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ filesystem_error(const string& __what, error_code __ec)
+ : system_error(__ec, __what),
+ __paths_(make_shared<_Storage>(path(), path()))
+ {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ filesystem_error(const string& __what, const path& __p1, error_code __ec)
+ : system_error(__ec, __what),
+ __paths_(make_shared<_Storage>(__p1, path()))
+ {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ filesystem_error(const string& __what, const path& __p1, const path& __p2,
+ error_code __ec)
+ : system_error(__ec, __what),
+ __paths_(make_shared<_Storage>(__p1, __p2))
+ {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ const path& path1() const _NOEXCEPT {
+ return __paths_->first;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const path& path2() const _NOEXCEPT {
+ return __paths_->second;
+ }
+
+ ~filesystem_error() override; // key function
+
+ // TODO(ericwf): Create a custom error message.
+ //const char* what() const _NOEXCEPT;
+
+private:
+ typedef pair<path, path> _Storage;
+ shared_ptr<_Storage> __paths_;
+};
+
+template <class... _Args>
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+#ifndef _LIBCPP_NO_EXCEPTIONS
+void __throw_filesystem_error(_Args && ...__args)
+{
+ throw filesystem_error(std::forward<_Args>(__args)...);
+}
+#else
+void __throw_filesystem_error(_Args&&...)
+{
+ _VSTD::abort();
+}
+#endif
+
+
+// operational functions
+
+_LIBCPP_FUNC_VIS
+path __canonical(const path&, const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __copy(const path& __from, const path& __to, copy_options __opt,
+ error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+bool __copy_file(const path& __from, const path& __to, copy_options __opt,
+ error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __copy_symlink(const path& __existing_symlink, const path& __new_symlink,
+ error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+bool __create_directories(const path& p, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+bool __create_directory(const path& p, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+bool __create_directory(const path& p, const path & attributes,
+ error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __create_directory_symlink(const path& __to, const path& __new_symlink,
+ error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __create_hard_link(const path& __to, const path& __new_hard_link,
+ error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __create_symlink(const path& __to, const path& __new_symlink,
+ error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+path __current_path(error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __current_path(const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+bool __equivalent(const path&, const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+uintmax_t __file_size(const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+uintmax_t __hard_link_count(const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+bool __fs_is_empty(const path& p, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+file_time_type __last_write_time(const path& p, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __last_write_time(const path& p, file_time_type new_time,
+ error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __permissions(const path& p, perms prms, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+path __read_symlink(const path& p, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+bool __remove(const path& p, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+uintmax_t __remove_all(const path& p, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __rename(const path& from, const path& to, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+void __resize_file(const path& p, uintmax_t size, error_code *ec=nullptr);
+_LIBCPP_FUNC_VIS
+space_info __space(const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+file_status __status(const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+file_status __symlink_status(const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+path __system_complete(const path&, error_code *__ec=nullptr);
+_LIBCPP_FUNC_VIS
+path __temp_directory_path(error_code *__ec=nullptr);
+
+inline _LIBCPP_INLINE_VISIBILITY
+path current_path() {
+ return __current_path();
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path current_path(error_code& __ec) {
+ return __current_path(&__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void current_path(const path& __p) {
+ __current_path(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void current_path(const path& __p, error_code& __ec) _NOEXCEPT {
+ __current_path(__p, &__ec);
+}
+
+_LIBCPP_FUNC_VIS
+path absolute(const path&, const path& __p2 = current_path());
+
+inline _LIBCPP_INLINE_VISIBILITY
+path canonical(const path& __p, const path& __base = current_path()) {
+ return __canonical(__p, __base);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path canonical(const path& __p, error_code& __ec) {
+ path __base = __current_path(&__ec);
+ if (__ec) return {};
+ return __canonical(__p, __base, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path canonical(const path& __p, const path& __base, error_code& __ec) {
+ return __canonical(__p, __base, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void copy(const path& __from, const path& __to) {
+ __copy(__from, __to, copy_options::none);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void copy(const path& __from, const path& __to, error_code& __ec) _NOEXCEPT {
+ __copy(__from, __to, copy_options::none, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void copy(const path& __from, const path& __to, copy_options __opt) {
+ __copy(__from, __to, __opt);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void copy(const path& __from, const path& __to,
+ copy_options __opt, error_code& __ec) _NOEXCEPT {
+ __copy(__from, __to, __opt, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool copy_file(const path& __from, const path& __to) {
+ return __copy_file(__from, __to, copy_options::none);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool copy_file(const path& __from, const path& __to, error_code& __ec) _NOEXCEPT {
+ return __copy_file(__from, __to, copy_options::none, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool copy_file(const path& __from, const path& __to, copy_options __opt) {
+ return __copy_file(__from, __to, __opt);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool copy_file(const path& __from, const path& __to,
+ copy_options __opt, error_code& __ec) _NOEXCEPT {
+ return __copy_file(__from, __to, __opt, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void copy_symlink(const path& __existing, const path& __new) {
+ __copy_symlink(__existing, __new);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void copy_symlink(const path& __ext, const path& __new, error_code& __ec) _NOEXCEPT {
+ __copy_symlink(__ext, __new, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool create_directories(const path& __p) {
+ return __create_directories(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool create_directories(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __create_directories(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool create_directory(const path& __p) {
+ return __create_directory(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool create_directory(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __create_directory(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool create_directory(const path& __p, const path& __attrs) {
+ return __create_directory(__p, __attrs);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool create_directory(const path& __p, const path& __attrs, error_code& __ec) _NOEXCEPT {
+ return __create_directory(__p, __attrs, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void create_directory_symlink(const path& __to, const path& __new) {
+ __create_directory_symlink(__to, __new);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void create_directory_symlink(const path& __to, const path& __new,
+ error_code& __ec) _NOEXCEPT {
+ __create_directory_symlink(__to, __new, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void create_hard_link(const path& __to, const path& __new) {
+ __create_hard_link(__to, __new);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void create_hard_link(const path& __to, const path& __new, error_code& __ec) _NOEXCEPT {
+ __create_hard_link(__to, __new, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void create_symlink(const path& __to, const path& __new) {
+ __create_symlink(__to, __new);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void create_symlink(const path& __to, const path& __new, error_code& __ec) _NOEXCEPT {
+ return __create_symlink(__to, __new, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool status_known(file_status __s) _NOEXCEPT {
+ return __s.type() != file_type::none;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool exists(file_status __s) _NOEXCEPT {
+ return status_known(__s) && __s.type() != file_type::not_found;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool exists(const path& __p) {
+ return exists(__status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool exists(const path& __p, error_code& __ec) _NOEXCEPT {
+ auto __s = __status(__p, &__ec);
+ if (status_known(__s)) __ec.clear();
+ return exists(__s);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool equivalent(const path& __p1, const path& __p2) {
+ return __equivalent(__p1, __p2);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool equivalent(const path& __p1, const path& __p2, error_code& __ec) _NOEXCEPT {
+ return __equivalent(__p1, __p2, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+uintmax_t file_size(const path& __p) {
+ return __file_size(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+uintmax_t file_size(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __file_size(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+uintmax_t hard_link_count(const path& __p) {
+ return __hard_link_count(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+uintmax_t hard_link_count(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __hard_link_count(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_block_file(file_status __s) _NOEXCEPT {
+ return __s.type() == file_type::block;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_block_file(const path& __p) {
+ return is_block_file(__status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_block_file(const path& __p, error_code& __ec) _NOEXCEPT {
+ return is_block_file(__status(__p, &__ec));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_character_file(file_status __s) _NOEXCEPT {
+ return __s.type() == file_type::character;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_character_file(const path& __p) {
+ return is_character_file(__status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_character_file(const path& __p, error_code& __ec) _NOEXCEPT {
+ return is_character_file(__status(__p, &__ec));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_directory(file_status __s) _NOEXCEPT {
+ return __s.type() == file_type::directory;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_directory(const path& __p) {
+ return is_directory(__status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_directory(const path& __p, error_code& __ec) _NOEXCEPT {
+ return is_directory(__status(__p, &__ec));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_empty(const path& __p) {
+ return __fs_is_empty(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_empty(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __fs_is_empty(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_fifo(file_status __s) _NOEXCEPT {
+ return __s.type() == file_type::fifo;
+}
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_fifo(const path& __p) {
+ return is_fifo(__status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_fifo(const path& __p, error_code& __ec) _NOEXCEPT {
+ return is_fifo(__status(__p, &__ec));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_regular_file(file_status __s) _NOEXCEPT {
+ return __s.type() == file_type::regular;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_regular_file(const path& __p) {
+ return is_regular_file(__status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_regular_file(const path& __p, error_code& __ec) _NOEXCEPT {
+ return is_regular_file(__status(__p, &__ec));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_socket(file_status __s) _NOEXCEPT {
+ return __s.type() == file_type::socket;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_socket(const path& __p) {
+ return is_socket(__status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_socket(const path& __p, error_code& __ec) _NOEXCEPT {
+ return is_socket(__status(__p, &__ec));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_symlink(file_status __s) _NOEXCEPT {
+ return __s.type() == file_type::symlink;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_symlink(const path& __p) {
+ return is_symlink(__symlink_status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_symlink(const path& __p, error_code& __ec) _NOEXCEPT {
+ return is_symlink(__symlink_status(__p, &__ec));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_other(file_status __s) _NOEXCEPT {
+ return exists(__s)
+ && !is_regular_file(__s) && !is_directory(__s) && !is_symlink(__s);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_other(const path& __p) {
+ return is_other(__status(__p));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool is_other(const path& __p, error_code& __ec) _NOEXCEPT {
+ return is_other(__status(__p, &__ec));
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+file_time_type last_write_time(const path& __p) {
+ return __last_write_time(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+file_time_type last_write_time(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __last_write_time(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void last_write_time(const path& __p, file_time_type __t) {
+ __last_write_time(__p, __t);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void last_write_time(const path& __p, file_time_type __t, error_code& __ec) _NOEXCEPT {
+ __last_write_time(__p, __t, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void permissions(const path& __p, perms __prms) {
+ __permissions(__p, __prms);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void permissions(const path& __p, perms __prms, error_code& __ec) {
+ __permissions(__p, __prms, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path read_symlink(const path& __p) {
+ return __read_symlink(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path read_symlink(const path& __p, error_code& __ec) {
+ return __read_symlink(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool remove(const path& __p) {
+ return __remove(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool remove(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __remove(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+uintmax_t remove_all(const path& __p) {
+ return __remove_all(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+uintmax_t remove_all(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __remove_all(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void rename(const path& __from, const path& __to) {
+ return __rename(__from, __to);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void rename(const path& __from, const path& __to, error_code& __ec) _NOEXCEPT {
+ return __rename(__from, __to, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void resize_file(const path& __p, uintmax_t __ns) {
+ return __resize_file(__p, __ns);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void resize_file(const path& __p, uintmax_t __ns, error_code& __ec) _NOEXCEPT {
+ return __resize_file(__p, __ns, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+space_info space(const path& __p) {
+ return __space(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+space_info space(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __space(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+file_status status(const path& __p) {
+ return __status(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+file_status status(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __status(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+file_status symlink_status(const path& __p) {
+ return __symlink_status(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+file_status symlink_status(const path& __p, error_code& __ec) _NOEXCEPT {
+ return __symlink_status(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path system_complete(const path& __p) {
+ return __system_complete(__p);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path system_complete(const path& __p, error_code& __ec) {
+ return __system_complete(__p, &__ec);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path temp_directory_path() {
+ return __temp_directory_path();
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+path temp_directory_path(error_code& __ec) {
+ return __temp_directory_path(&__ec);
+}
+
+
+class directory_entry
+{
+ typedef _VSTD_FS::path _Path;
+
+public:
+ // constructors and destructors
+ directory_entry() _NOEXCEPT = default;
+ directory_entry(directory_entry const&) = default;
+ directory_entry(directory_entry&&) _NOEXCEPT = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit directory_entry(_Path const& __p) : __p_(__p) {}
+
+ ~directory_entry() {}
+
+ directory_entry& operator=(directory_entry const&) = default;
+ directory_entry& operator=(directory_entry&&) _NOEXCEPT = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(_Path const& __p) {
+ __p_ = __p;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void replace_filename(_Path const& __p) {
+ __p_ = __p_.parent_path() / __p;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ _Path const& path() const _NOEXCEPT {
+ return __p_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ operator const _Path&() const _NOEXCEPT {
+ return __p_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ file_status status() const {
+ return _VSTD_FS::status(__p_);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ file_status status(error_code& __ec) const _NOEXCEPT {
+ return _VSTD_FS::status(__p_, __ec);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ file_status symlink_status() const {
+ return _VSTD_FS::symlink_status(__p_);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ file_status symlink_status(error_code& __ec) const _NOEXCEPT {
+ return _VSTD_FS::symlink_status(__p_, __ec);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator< (directory_entry const& __rhs) const _NOEXCEPT {
+ return __p_ < __rhs.__p_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator==(directory_entry const& __rhs) const _NOEXCEPT {
+ return __p_ == __rhs.__p_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator!=(directory_entry const& __rhs) const _NOEXCEPT {
+ return __p_ != __rhs.__p_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator<=(directory_entry const& __rhs) const _NOEXCEPT {
+ return __p_ <= __rhs.__p_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator> (directory_entry const& __rhs) const _NOEXCEPT {
+ return __p_ > __rhs.__p_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator>=(directory_entry const& __rhs) const _NOEXCEPT {
+ return __p_ >= __rhs.__p_;
+ }
+private:
+ _Path __p_;
+};
+
+
+class directory_iterator;
+class recursive_directory_iterator;
+class __dir_stream;
+
+class __dir_element_proxy {
+public:
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ directory_entry operator*() { return _VSTD::move(__elem_); }
+
+private:
+ friend class directory_iterator;
+ friend class recursive_directory_iterator;
+ explicit __dir_element_proxy(directory_entry const& __e) : __elem_(__e) {}
+ __dir_element_proxy(__dir_element_proxy&& __o) : __elem_(_VSTD::move(__o.__elem_)) {}
+ directory_entry __elem_;
+};
+
+class directory_iterator
+{
+public:
+ typedef directory_entry value_type;
+ typedef ptrdiff_t difference_type;
+ typedef value_type const* pointer;
+ typedef value_type const& reference;
+ typedef input_iterator_tag iterator_category;
+
+public:
+ //ctor & dtor
+ directory_iterator() _NOEXCEPT
+ { }
+
+ explicit directory_iterator(const path& __p)
+ : directory_iterator(__p, nullptr)
+ { }
+
+ directory_iterator(const path& __p, directory_options __opts)
+ : directory_iterator(__p, nullptr, __opts)
+ { }
+
+ directory_iterator(const path& __p, error_code& __ec) _NOEXCEPT
+ : directory_iterator(__p, &__ec)
+ { }
+
+ directory_iterator(const path& __p, directory_options __opts,
+ error_code& __ec) _NOEXCEPT
+ : directory_iterator(__p, &__ec, __opts)
+ { }
+
+ directory_iterator(const directory_iterator&) = default;
+ directory_iterator(directory_iterator&&) = default;
+ directory_iterator& operator=(const directory_iterator&) = default;
+
+ directory_iterator& operator=(directory_iterator&& __o) _NOEXCEPT {
+ // non-default implementation provided to support self-move assign.
+ if (this != &__o) {
+ __imp_ = _VSTD::move(__o.__imp_);
+ }
+ return *this;
+ }
+
+ ~directory_iterator() = default;
+
+ const directory_entry& operator*() const {
+ _LIBCPP_ASSERT(__imp_, "The end iterator cannot be dereferenced");
+ return __dereference();
+ }
+
+ const directory_entry* operator->() const
+ { return &**this; }
+
+ directory_iterator& operator++()
+ { return __increment(); }
+
+ __dir_element_proxy operator++(int) {
+ __dir_element_proxy __p(**this);
+ __increment();
+ return __p;
+ }
+
+ directory_iterator& increment(error_code& __ec) _NOEXCEPT
+ { return __increment(&__ec); }
+
+private:
+ inline _LIBCPP_INLINE_VISIBILITY
+ friend bool operator==(const directory_iterator& __lhs,
+ const directory_iterator& __rhs) _NOEXCEPT;
+
+ // construct the dir_stream
+ _LIBCPP_FUNC_VIS
+ directory_iterator(const path&, error_code *,
+ directory_options = directory_options::none);
+
+ _LIBCPP_FUNC_VIS
+ directory_iterator& __increment(error_code * __ec = nullptr);
+
+ _LIBCPP_FUNC_VIS
+ const directory_entry& __dereference() const;
+
+private:
+ shared_ptr<__dir_stream> __imp_;
+};
+
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator==(const directory_iterator& __lhs,
+ const directory_iterator& __rhs) _NOEXCEPT {
+ return __lhs.__imp_ == __rhs.__imp_;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator!=(const directory_iterator& __lhs,
+ const directory_iterator& __rhs) _NOEXCEPT {
+ return !(__lhs == __rhs);
+}
+
+// enable directory_iterator range-based for statements
+inline _LIBCPP_INLINE_VISIBILITY
+directory_iterator begin(directory_iterator __iter) _NOEXCEPT {
+ return __iter;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+directory_iterator end(const directory_iterator&) _NOEXCEPT {
+ return directory_iterator();
+}
+
+class recursive_directory_iterator {
+public:
+ using value_type = directory_entry;
+ using difference_type = std::ptrdiff_t;
+ using pointer = directory_entry const *;
+ using reference = directory_entry const &;
+ using iterator_category = std::input_iterator_tag;
+
+public:
+ // constructors and destructor
+ _LIBCPP_INLINE_VISIBILITY
+ recursive_directory_iterator() _NOEXCEPT
+ : __rec_(false)
+ {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit recursive_directory_iterator(const path& __p,
+ directory_options __xoptions = directory_options::none)
+ : recursive_directory_iterator(__p, __xoptions, nullptr)
+ { }
+
+ _LIBCPP_INLINE_VISIBILITY
+ recursive_directory_iterator(const path& __p,
+ directory_options __xoptions, error_code& __ec) _NOEXCEPT
+ : recursive_directory_iterator(__p, __xoptions, &__ec)
+ { }
+
+ _LIBCPP_INLINE_VISIBILITY
+ recursive_directory_iterator(const path& __p, error_code& __ec) _NOEXCEPT
+ : recursive_directory_iterator(__p, directory_options::none, &__ec)
+ { }
+
+ recursive_directory_iterator(const recursive_directory_iterator&) = default;
+ recursive_directory_iterator(recursive_directory_iterator&&) = default;
+
+ recursive_directory_iterator &
+ operator=(const recursive_directory_iterator&) = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ recursive_directory_iterator &
+ operator=(recursive_directory_iterator&& __o) noexcept {
+ // non-default implementation provided to support self-move assign.
+ if (this != &__o) {
+ __imp_ = _VSTD::move(__o.__imp_);
+ __rec_ = __o.__rec_;
+ }
+ return *this;
+ }
+
+ ~recursive_directory_iterator() = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ const directory_entry& operator*() const
+ { return __dereference(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const directory_entry* operator->() const
+ { return &__dereference(); }
+
+ recursive_directory_iterator& operator++()
+ { return __increment(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __dir_element_proxy operator++(int) {
+ __dir_element_proxy __p(**this);
+ __increment();
+ return __p;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ recursive_directory_iterator& increment(error_code& __ec) _NOEXCEPT
+ { return __increment(&__ec); }
+
+ _LIBCPP_FUNC_VIS directory_options options() const;
+ _LIBCPP_FUNC_VIS int depth() const;
+
+ _LIBCPP_INLINE_VISIBILITY
+ void pop() { __pop(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void pop(error_code& __ec)
+ { __pop(&__ec); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool recursion_pending() const
+ { return __rec_; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void disable_recursion_pending()
+ { __rec_ = false; }
+
+private:
+ recursive_directory_iterator(const path& __p, directory_options __opt,
+ error_code *__ec);
+
+ _LIBCPP_FUNC_VIS
+ const directory_entry& __dereference() const;
+
+ _LIBCPP_FUNC_VIS
+ bool __try_recursion(error_code* __ec);
+
+ _LIBCPP_FUNC_VIS
+ void __advance(error_code* __ec=nullptr);
+
+ _LIBCPP_FUNC_VIS
+ recursive_directory_iterator& __increment(error_code *__ec=nullptr);
+
+ _LIBCPP_FUNC_VIS
+ void __pop(error_code* __ec=nullptr);
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ friend bool operator==(const recursive_directory_iterator&,
+ const recursive_directory_iterator&) _NOEXCEPT;
+
+ struct __shared_imp;
+ shared_ptr<__shared_imp> __imp_;
+ bool __rec_;
+}; // class recursive_directory_iterator
+
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator==(const recursive_directory_iterator& __lhs,
+ const recursive_directory_iterator& __rhs) _NOEXCEPT
+{
+ return __lhs.__imp_ == __rhs.__imp_;
+}
+
+_LIBCPP_INLINE_VISIBILITY
+inline bool operator!=(const recursive_directory_iterator& __lhs,
+ const recursive_directory_iterator& __rhs) _NOEXCEPT
+{
+ return !(__lhs == __rhs);
+}
+// enable recursive_directory_iterator range-based for statements
+inline _LIBCPP_INLINE_VISIBILITY
+recursive_directory_iterator begin(recursive_directory_iterator __iter) _NOEXCEPT {
+ return __iter;
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+recursive_directory_iterator end(const recursive_directory_iterator&) _NOEXCEPT {
+ return recursive_directory_iterator();
+}
+
+_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM
+
+#endif // _LIBCPP_EXPERIMENTAL_FILESYSTEM
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/forward_list b/chromium/buildtools/third_party/libc++/trunk/include/experimental/forward_list
new file mode 100644
index 00000000000..55e195f446f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/forward_list
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+//===--------------------------- forward_list -----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_FORWARD_LIST
+#define _LIBCPP_EXPERIMENTAL_FORWARD_LIST
+/*
+ experimental/forward_list synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class T>
+ using forward_list = std::forward_list<T,polymorphic_allocator<T>>;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <forward_list>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _ValueT>
+using forward_list = _VSTD::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_FORWARD_LIST */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/functional b/chromium/buildtools/third_party/libc++/trunk/include/experimental/functional
index c7a78695b80..75fc8e99f35 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/functional
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/functional
@@ -119,9 +119,12 @@ public:
template <typename _ForwardIterator2>
_LIBCPP_INLINE_VISIBILITY
- _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
+ pair<_ForwardIterator2, _ForwardIterator2>
+ operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const
{
- return _VSTD::search(__f, __l, __first_, __last_, __pred_);
+ return _VSTD::__search(__f, __l, __first_, __last_, __pred_,
+ typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category(),
+ typename _VSTD::iterator_traits<_ForwardIterator2>::iterator_category());
}
private:
@@ -233,7 +236,7 @@ public:
}
template <typename _RandomAccessIterator2>
- _RandomAccessIterator2
+ pair<_RandomAccessIterator2, _RandomAccessIterator2>
operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
{
static_assert ( std::is_same<
@@ -242,12 +245,12 @@ public:
>::value,
"Corpus and Pattern iterators must point to the same type" );
- if (__f == __l ) return __l; // empty corpus
- if (__first_ == __last_) return __f; // empty pattern
+ if (__f == __l ) return make_pair(__l, __l); // empty corpus
+ if (__first_ == __last_) return make_pair(__f, __f); // empty pattern
// If the pattern is larger than the corpus, we can't find it!
if ( __pattern_length_ > _VSTD::distance (__f, __l))
- return __l;
+ return make_pair(__l, __l);
// Do the search
return this->__search(__f, __l);
@@ -262,7 +265,8 @@ public: // TODO private:
shared_ptr<vector<difference_type>> __suffix_;
template <typename _RandomAccessIterator2>
- _RandomAccessIterator2 __search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
+ pair<_RandomAccessIterator2, _RandomAccessIterator2>
+ __search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
{
_RandomAccessIterator2 __cur = __f;
const _RandomAccessIterator2 __last = __l - __pattern_length_;
@@ -278,7 +282,7 @@ public: // TODO private:
__j--;
// We matched - we're done!
if ( __j == 0 )
- return __cur;
+ return make_pair(__cur, __cur + __pattern_length_);
}
// Since we didn't match, figure out how far to skip forward
@@ -290,7 +294,7 @@ public: // TODO private:
__cur += __suffix[ __j ];
}
- return __l; // We didn't find anything
+ return make_pair(__l, __l); // We didn't find anything
}
@@ -384,8 +388,8 @@ public:
}
}
- template <typename _RandomAccessIterator2>
- _RandomAccessIterator2
+ template <typename _RandomAccessIterator2>
+ pair<_RandomAccessIterator2, _RandomAccessIterator2>
operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const
{
static_assert ( std::is_same<
@@ -394,12 +398,12 @@ public:
>::value,
"Corpus and Pattern iterators must point to the same type" );
- if (__f == __l ) return __l; // empty corpus
- if (__first_ == __last_) return __f; // empty pattern
+ if (__f == __l ) return make_pair(__l, __l); // empty corpus
+ if (__first_ == __last_) return make_pair(__f, __f); // empty pattern
// If the pattern is larger than the corpus, we can't find it!
if ( __pattern_length_ > _VSTD::distance (__f, __l))
- return __l;
+ return make_pair(__l, __l);
// Do the search
return this->__search(__f, __l);
@@ -413,7 +417,8 @@ private:
shared_ptr<skip_table_type> __skip_;
template <typename _RandomAccessIterator2>
- _RandomAccessIterator2 __search ( _RandomAccessIterator2 __f, _RandomAccessIterator2 __l ) const {
+ pair<_RandomAccessIterator2, _RandomAccessIterator2>
+ __search ( _RandomAccessIterator2 __f, _RandomAccessIterator2 __l ) const {
_RandomAccessIterator2 __cur = __f;
const _RandomAccessIterator2 __last = __l - __pattern_length_;
const skip_table_type & __skip = *__skip_.get();
@@ -427,12 +432,12 @@ private:
__j--;
// We matched - we're done!
if ( __j == 0 )
- return __cur;
+ return make_pair(__cur, __cur + __pattern_length_);
}
__cur += __skip[__cur[__pattern_length_-1]];
}
- return __l;
+ return make_pair(__l, __l);
}
};
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/iterator b/chromium/buildtools/third_party/libc++/trunk/include/experimental/iterator
new file mode 100644
index 00000000000..37186b3d0b3
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/iterator
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+//===----------------------------- iterator -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_ITERATOR
+#define _LIBCPP_EXPERIMENTAL_ITERATOR
+
+/*
+namespace std {
+ namespace experimental {
+ inline namespace fundamentals_v2 {
+
+ template <class DelimT, class charT = char, class traits = char_traits<charT>>
+ class ostream_joiner {
+ public:
+ typedef charT char_type;
+ typedef traits traits_type;
+ typedef basic_ostream<charT, traits> ostream_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ ostream_joiner(ostream_type& s, const DelimT& delimiter);
+ ostream_joiner(ostream_type& s, DelimT&& delimiter);
+
+ template<typename T>
+ ostream_joiner& operator=(const T& value);
+
+ ostream_joiner& operator*() noexcept;
+ ostream_joiner& operator++() noexcept;
+ ostream_joiner& operator++(int) noexcept;
+ private:
+ ostream_type* out_stream; // exposition only
+ DelimT delim; // exposition only
+ bool first_element; // exposition only
+ };
+
+ template <class charT, class traits, class DelimT>
+ ostream_joiner<decay_t<DelimT>, charT, traits>
+ make_ostream_joiner(basic_ostream<charT, traits>& os, DelimT&& delimiter);
+
+ } // inline namespace fundamentals_v2
+ } // namespace experimental
+} // namespace std
+
+*/
+
+#include <experimental/__config>
+
+#if _LIBCPP_STD_VER > 11
+
+#include <iterator>
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+
+template <class _Delim, class _CharT = char, class _Traits = char_traits<_CharT>>
+class ostream_joiner {
+public:
+
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef basic_ostream<char_type,traits_type> ostream_type;
+ typedef output_iterator_tag iterator_category;
+ typedef void value_type;
+ typedef void difference_type;
+ typedef void pointer;
+ typedef void reference;
+
+ ostream_joiner(ostream_type& __os, _Delim&& __d)
+ : __output(_VSTD::addressof(__os)), __delim(_VSTD::move(__d)), __first(true) {}
+
+ ostream_joiner(ostream_type& __os, const _Delim& __d)
+ : __output(_VSTD::addressof(__os)), __delim(__d), __first(true) {}
+
+
+ template<typename _Tp>
+ ostream_joiner& operator=(const _Tp& __v)
+ {
+ if (!__first)
+ *__output << __delim;
+ __first = false;
+ *__output << __v;
+ return *this;
+ }
+
+ ostream_joiner& operator*() _NOEXCEPT { return *this; }
+ ostream_joiner& operator++() _NOEXCEPT { return *this; }
+ ostream_joiner& operator++(int) _NOEXCEPT { return *this; }
+
+private:
+ ostream_type* __output;
+ _Delim __delim;
+ bool __first;
+};
+
+
+template <class _CharT, class _Traits, class _Delim>
+ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits>
+make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os, _Delim && __d)
+{ return ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits>(__os, _VSTD::forward<_Delim>(__d)); }
+
+_LIBCPP_END_NAMESPACE_LFTS
+
+#endif /* _LIBCPP_STD_VER > 11 */
+
+#endif // _LIBCPP_EXPERIMENTAL_ITERATOR
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/list b/chromium/buildtools/third_party/libc++/trunk/include/experimental/list
new file mode 100644
index 00000000000..1678ee3e93c
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/list
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+//===--------------------------- list ------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_LIST
+#define _LIBCPP_EXPERIMENTAL_LIST
+/*
+ experimental/list synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class T>
+ using list = std::list<T,polymorphic_allocator<T>>;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <list>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _ValueT>
+using list = _VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_LIST */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/map b/chromium/buildtools/third_party/libc++/trunk/include/experimental/map
new file mode 100644
index 00000000000..cff2c5e52c0
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/map
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+//===----------------------------- map ------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_MAP
+#define _LIBCPP_EXPERIMENTAL_MAP
+/*
+ experimental/map synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class Key, class T, class Compare = less<Key>>
+ using map = std::map<Key, T, Compare,
+ polymorphic_allocator<pair<const Key,T>>>;
+
+ template <class Key, class T, class Compare = less<Key>>
+ using multimap = std::multimap<Key, T, Compare,
+ polymorphic_allocator<pair<const Key,T>>>;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <map>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _Key, class _Value, class _Compare = less<_Key>>
+using map = _VSTD::map<_Key, _Value, _Compare,
+ polymorphic_allocator<pair<const _Key, _Value>>>;
+
+template <class _Key, class _Value, class _Compare = less<_Key>>
+using multimap = _VSTD::multimap<_Key, _Value, _Compare,
+ polymorphic_allocator<pair<const _Key, _Value>>>;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_MAP */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/memory_resource b/chromium/buildtools/third_party/libc++/trunk/include/experimental/memory_resource
new file mode 100644
index 00000000000..743f9cbe639
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/memory_resource
@@ -0,0 +1,422 @@
+// -*- C++ -*-
+//===------------------------ memory_resource -----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE
+#define _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE
+
+/**
+ experimental/memory_resource synopsis
+
+// C++1y
+
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ class memory_resource;
+
+ bool operator==(const memory_resource& a,
+ const memory_resource& b) noexcept;
+ bool operator!=(const memory_resource& a,
+ const memory_resource& b) noexcept;
+
+ template <class Tp> class polymorphic_allocator;
+
+ template <class T1, class T2>
+ bool operator==(const polymorphic_allocator<T1>& a,
+ const polymorphic_allocator<T2>& b) noexcept;
+ template <class T1, class T2>
+ bool operator!=(const polymorphic_allocator<T1>& a,
+ const polymorphic_allocator<T2>& b) noexcept;
+
+ // The name resource_adaptor_imp is for exposition only.
+ template <class Allocator> class resource_adaptor_imp;
+
+ template <class Allocator>
+ using resource_adaptor = resource_adaptor_imp<
+ allocator_traits<Allocator>::rebind_alloc<char>>;
+
+ // Global memory resources
+ memory_resource* new_delete_resource() noexcept;
+ memory_resource* null_memory_resource() noexcept;
+
+ // The default memory resource
+ memory_resource* set_default_resource(memory_resource* r) noexcept;
+ memory_resource* get_default_resource() noexcept;
+
+ // Standard memory resources
+ struct pool_options;
+ class synchronized_pool_resource;
+ class unsynchronized_pool_resource;
+ class monotonic_buffer_resource;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <experimental/__memory>
+#include <limits>
+#include <memory>
+#include <new>
+#include <stdexcept>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+#include <cstddef>
+#include <cstdlib>
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+// Round __s up to next multiple of __a.
+inline _LIBCPP_INLINE_VISIBILITY
+size_t __aligned_allocation_size(size_t __s, size_t __a) _NOEXCEPT
+{
+ _LIBCPP_ASSERT(__s + __a > __s, "aligned allocation size overflows");
+ return (__s + __a - 1) & ~(__a - 1);
+}
+
+// 8.5, memory.resource
+class _LIBCPP_TEMPLATE_VIS memory_resource
+{
+ static const size_t __max_align = alignof(max_align_t);
+
+// 8.5.2, memory.resource.public
+public:
+ virtual ~memory_resource() = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ void* allocate(size_t __bytes, size_t __align = __max_align)
+ { return do_allocate(__bytes, __align); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void deallocate(void * __p, size_t __bytes, size_t __align = __max_align)
+ { do_deallocate(__p, __bytes, __align); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool is_equal(memory_resource const & __other) const _NOEXCEPT
+ { return do_is_equal(__other); }
+
+// 8.5.3, memory.resource.priv
+protected:
+ virtual void* do_allocate(size_t, size_t) = 0;
+ virtual void do_deallocate(void*, size_t, size_t) = 0;
+ virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0;
+};
+
+// 8.5.4, memory.resource.eq
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator==(memory_resource const & __lhs,
+ memory_resource const & __rhs) _NOEXCEPT
+{
+ return &__lhs == &__rhs || __lhs.is_equal(__rhs);
+}
+
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator!=(memory_resource const & __lhs,
+ memory_resource const & __rhs) _NOEXCEPT
+{
+ return !(__lhs == __rhs);
+}
+
+_LIBCPP_FUNC_VIS
+memory_resource * new_delete_resource() _NOEXCEPT;
+
+_LIBCPP_FUNC_VIS
+memory_resource * null_memory_resource() _NOEXCEPT;
+
+_LIBCPP_FUNC_VIS
+memory_resource * get_default_resource() _NOEXCEPT;
+
+_LIBCPP_FUNC_VIS
+memory_resource * set_default_resource(memory_resource * __new_res) _NOEXCEPT;
+
+// 8.6, memory.polymorphic.allocator.class
+
+// 8.6.1, memory.polymorphic.allocator.overview
+template <class _ValueType>
+class _LIBCPP_TEMPLATE_VIS polymorphic_allocator
+{
+public:
+ typedef _ValueType value_type;
+
+ // 8.6.2, memory.polymorphic.allocator.ctor
+ _LIBCPP_INLINE_VISIBILITY
+ polymorphic_allocator() _NOEXCEPT
+ : __res_(_VSTD_LFTS_PMR::get_default_resource())
+ {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ polymorphic_allocator(memory_resource * __r) _NOEXCEPT
+ : __res_(__r)
+ {}
+
+ polymorphic_allocator(polymorphic_allocator const &) = default;
+
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY
+ polymorphic_allocator(polymorphic_allocator<_Tp> const & __other) _NOEXCEPT
+ : __res_(__other.resource())
+ {}
+
+ polymorphic_allocator &
+ operator=(polymorphic_allocator const &) = delete;
+
+ // 8.6.3, memory.polymorphic.allocator.mem
+ _LIBCPP_INLINE_VISIBILITY
+ _ValueType* allocate(size_t __n) {
+ if (__n > __max_size()) {
+ __throw_length_error(
+ "std::experimental::pmr::polymorphic_allocator<T>::allocate(size_t n)"
+ " 'n' exceeds maximum supported size");
+ }
+ return static_cast<_ValueType*>(
+ __res_->allocate(__n * sizeof(_ValueType), alignof(_ValueType))
+ );
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void deallocate(_ValueType * __p, size_t __n) _NOEXCEPT {
+ _LIBCPP_ASSERT(__n <= __max_size(),
+ "deallocate called for size which exceeds max_size()");
+ __res_->deallocate(__p, __n * sizeof(_ValueType), alignof(_ValueType));
+ }
+
+ template <class _Tp, class ..._Ts>
+ _LIBCPP_INLINE_VISIBILITY
+ void construct(_Tp* __p, _Ts &&... __args)
+ {
+ _VSTD_LFTS::__lfts_user_alloc_construct(
+ __p, resource(), _VSTD::forward<_Ts>(__args)...
+ );
+ }
+
+ template <class _T1, class _T2, class ..._Args1, class ..._Args2>
+ _LIBCPP_INLINE_VISIBILITY
+ void construct(pair<_T1, _T2>* __p, piecewise_construct_t,
+ tuple<_Args1...> __x, tuple<_Args2...> __y)
+ {
+ ::new ((void*)__p) pair<_T1, _T2>(piecewise_construct
+ , __transform_tuple(
+ typename __lfts_uses_alloc_ctor<
+ _T1, memory_resource*, _Args1...
+ >::type()
+ , _VSTD::move(__x)
+ , typename __make_tuple_indices<sizeof...(_Args1)>::type{}
+ )
+ , __transform_tuple(
+ typename __lfts_uses_alloc_ctor<
+ _T2, memory_resource*, _Args2...
+ >::type()
+ , _VSTD::move(__y)
+ , typename __make_tuple_indices<sizeof...(_Args2)>::type{}
+ )
+ );
+ }
+
+ template <class _T1, class _T2>
+ _LIBCPP_INLINE_VISIBILITY
+ void construct(pair<_T1, _T2>* __p) {
+ construct(__p, piecewise_construct, tuple<>(), tuple<>());
+ }
+
+ template <class _T1, class _T2, class _Up, class _Vp>
+ _LIBCPP_INLINE_VISIBILITY
+ void construct(pair<_T1, _T2> * __p, _Up && __u, _Vp && __v) {
+ construct(__p, piecewise_construct
+ , _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__u))
+ , _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__v)));
+ }
+
+ template <class _T1, class _T2, class _U1, class _U2>
+ _LIBCPP_INLINE_VISIBILITY
+ void construct(pair<_T1, _T2> * __p, pair<_U1, _U2> const & __pr) {
+ construct(__p, piecewise_construct
+ , _VSTD::forward_as_tuple(__pr.first)
+ , _VSTD::forward_as_tuple(__pr.second));
+ }
+
+ template <class _T1, class _T2, class _U1, class _U2>
+ _LIBCPP_INLINE_VISIBILITY
+ void construct(pair<_T1, _T2> * __p, pair<_U1, _U2> && __pr){
+ construct(__p, piecewise_construct
+ , _VSTD::forward_as_tuple(_VSTD::forward<_U1>(__pr.first))
+ , _VSTD::forward_as_tuple(_VSTD::forward<_U2>(__pr.second)));
+ }
+
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY
+ void destroy(_Tp * __p) _NOEXCEPT
+ { __p->~_Tp(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ polymorphic_allocator
+ select_on_container_copy_construction() const _NOEXCEPT
+ { return polymorphic_allocator(); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ memory_resource * resource() const _NOEXCEPT
+ { return __res_; }
+
+private:
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<_Args&&...>
+ __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t,
+ __tuple_indices<_Idx...>) const
+ {
+ return _VSTD::forward_as_tuple(_VSTD::get<_Idx>(_VSTD::move(__t))...);
+ }
+
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<allocator_arg_t const&, memory_resource*, _Args&&...>
+ __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t,
+ __tuple_indices<_Idx...>) const
+ {
+ using _Tup = tuple<allocator_arg_t const&, memory_resource*, _Args&&...>;
+ return _Tup(allocator_arg, resource(),
+ _VSTD::get<_Idx>(_VSTD::move(__t))...);
+ }
+
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<_Args&&..., memory_resource*>
+ __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t,
+ __tuple_indices<_Idx...>) const
+ {
+ using _Tup = tuple<_Args&&..., memory_resource*>;
+ return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., resource());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ size_t __max_size() const _NOEXCEPT
+ { return numeric_limits<size_t>::max() / sizeof(value_type); }
+
+ memory_resource * __res_;
+};
+
+// 8.6.4, memory.polymorphic.allocator.eq
+
+template <class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator==(polymorphic_allocator<_Tp> const & __lhs,
+ polymorphic_allocator<_Up> const & __rhs) _NOEXCEPT
+{
+ return *__lhs.resource() == *__rhs.resource();
+}
+
+template <class _Tp, class _Up>
+inline _LIBCPP_INLINE_VISIBILITY
+bool operator!=(polymorphic_allocator<_Tp> const & __lhs,
+ polymorphic_allocator<_Up> const & __rhs) _NOEXCEPT
+{
+ return !(__lhs == __rhs);
+}
+
+// 8.7, memory.resource.adaptor
+
+// 8.7.1, memory.resource.adaptor.overview
+template <class _CharAlloc>
+class _LIBCPP_TEMPLATE_VIS __resource_adaptor_imp
+ : public memory_resource
+{
+ using _CTraits = allocator_traits<_CharAlloc>;
+ static_assert(is_same<typename _CTraits::value_type, char>::value
+ && is_same<typename _CTraits::pointer, char*>::value
+ && is_same<typename _CTraits::void_pointer, void*>::value, "");
+
+ static const size_t _MaxAlign = alignof(max_align_t);
+
+ using _Alloc = typename _CTraits::template rebind_alloc<
+ typename aligned_storage<_MaxAlign, _MaxAlign>::type
+ >;
+
+ using _ValueType = typename _Alloc::value_type;
+
+ _Alloc __alloc_;
+
+public:
+ typedef _CharAlloc allocator_type;
+
+ __resource_adaptor_imp() = default;
+ __resource_adaptor_imp(__resource_adaptor_imp const &) = default;
+ __resource_adaptor_imp(__resource_adaptor_imp &&) = default;
+
+ // 8.7.2, memory.resource.adaptor.ctor
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __resource_adaptor_imp(allocator_type const & __a)
+ : __alloc_(__a)
+ {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __resource_adaptor_imp(allocator_type && __a)
+ : __alloc_(_VSTD::move(__a))
+ {}
+
+ __resource_adaptor_imp &
+ operator=(__resource_adaptor_imp const &) = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ allocator_type get_allocator() const
+ { return __alloc_; }
+
+// 8.7.3, memory.resource.adaptor.mem
+protected:
+ virtual void * do_allocate(size_t __bytes, size_t)
+ {
+ if (__bytes > __max_size()) {
+ __throw_length_error(
+ "std::experimental::pmr::resource_adaptor<T>::do_allocate(size_t bytes, size_t align)"
+ " 'bytes' exceeds maximum supported size");
+ }
+ size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
+ return __alloc_.allocate(__s);
+ }
+
+ virtual void do_deallocate(void * __p, size_t __bytes, size_t)
+ {
+ _LIBCPP_ASSERT(__bytes <= __max_size(),
+ "do_deallocate called for size which exceeds the maximum allocation size");
+ size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
+ __alloc_.deallocate((_ValueType*)__p, __s);
+ }
+
+ virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT {
+ __resource_adaptor_imp const * __p
+ = dynamic_cast<__resource_adaptor_imp const *>(&__other);
+ return __p ? __alloc_ == __p->__alloc_ : false;
+ }
+
+private:
+ _LIBCPP_INLINE_VISIBILITY
+ size_t __max_size() const _NOEXCEPT {
+ return numeric_limits<size_t>::max() - _MaxAlign;
+ }
+};
+
+template <class _Alloc>
+using resource_adaptor = __resource_adaptor_imp<
+ typename allocator_traits<_Alloc>::template rebind_alloc<char>
+ >;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/numeric b/chromium/buildtools/third_party/libc++/trunk/include/experimental/numeric
new file mode 100644
index 00000000000..6488a68eca6
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/numeric
@@ -0,0 +1,113 @@
+// -*- C++ -*-
+//===--------------------------- numeric ----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_NUMERIC
+#define _LIBCPP_EXPERIMENTAL_NUMERIC
+/*
+ experimental/numeric synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v2 {
+
+ // 13.1.2, Greatest common divisor
+ template<class M, class N>
+ constexpr common_type_t<M,N> gcd(M m, N n);
+
+ // 13.1.3, Least common multiple
+ template<class M, class N>
+ constexpr common_type_t<M,N> lcm(M m, N n);
+
+} // namespace fundamentals_v2
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <numeric>
+#include <type_traits> // is_integral
+#include <limits> // numeric_limits
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 11
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
+
+template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __abs;
+
+template <typename _Result, typename _Source>
+struct __abs<_Result, _Source, true> {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _Result operator()(_Source __t) const noexcept
+ {
+ if (__t >= 0) return __t;
+ if (__t == numeric_limits<_Source>::min()) return -static_cast<_Result>(__t);
+ return -__t;
+ }
+};
+
+template <typename _Result, typename _Source>
+struct __abs<_Result, _Source, false> {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _Result operator()(_Source __t) const noexcept { return __t; }
+};
+
+
+template<class _Tp>
+_LIBCPP_CONSTEXPR _LIBCPP_HIDDEN
+inline _Tp __gcd(_Tp __m, _Tp __n)
+{
+ static_assert((!is_signed<_Tp>::value), "" );
+ return __n == 0 ? __m : _VSTD_LFTS_V2::__gcd<_Tp>(__n, __m % __n);
+}
+
+
+template<class _Tp, class _Up>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+common_type_t<_Tp,_Up>
+gcd(_Tp __m, _Up __n)
+{
+ static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types");
+ static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to gcd cannot be bool" );
+ static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" );
+ using _Rp = common_type_t<_Tp,_Up>;
+ using _Wp = make_unsigned_t<_Rp>;
+ return static_cast<_Rp>(_VSTD_LFTS_V2::__gcd(
+ static_cast<_Wp>(__abs<_Rp, _Tp>()(__m)),
+ static_cast<_Wp>(__abs<_Rp, _Up>()(__n))));
+}
+
+template<class _Tp, class _Up>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+common_type_t<_Tp,_Up>
+lcm(_Tp __m, _Up __n)
+{
+ static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types");
+ static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to lcm cannot be bool" );
+ static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to lcm cannot be bool" );
+ if (__m == 0 || __n == 0)
+ return 0;
+
+ using _Rp = common_type_t<_Tp,_Up>;
+ _Rp __val1 = __abs<_Rp, _Tp>()(__m) / _VSTD_LFTS_V2::gcd(__m, __n);
+ _Rp __val2 = __abs<_Rp, _Up>()(__n);
+ _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
+ return __val1 * __val2;
+}
+
+_LIBCPP_END_NAMESPACE_LFTS_V2
+
+#endif /* _LIBCPP_STD_VER > 11 */
+#endif /* _LIBCPP_EXPERIMENTAL_NUMERIC */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/optional b/chromium/buildtools/third_party/libc++/trunk/include/experimental/optional
index a384882a1e1..48adfbae516 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/optional
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/optional
@@ -8,8 +8,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP_OPTIONAL
-#define _LIBCPP_OPTIONAL
+#ifndef _LIBCPP_EXPERIMENTAL_OPTIONAL
+#define _LIBCPP_EXPERIMENTAL_OPTIONAL
/*
optional synopsis
@@ -145,7 +145,7 @@ namespace std { namespace experimental { inline namespace fundamentals_v1 {
#include <stdexcept>
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
-class _LIBCPP_EXCEPTION_ABI bad_optional_access
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
: public std::logic_error
{
public:
@@ -211,7 +211,7 @@ protected:
: __engaged_(__x.__engaged_)
{
if (__engaged_)
- ::new(_VSTD::addressof(__val_)) value_type(__x.__val_);
+ ::new((void*)_VSTD::addressof(__val_)) value_type(__x.__val_);
}
_LIBCPP_INLINE_VISIBILITY
@@ -220,7 +220,7 @@ protected:
: __engaged_(__x.__engaged_)
{
if (__engaged_)
- ::new(_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_));
+ ::new((void*)_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_));
}
_LIBCPP_INLINE_VISIBILITY
@@ -262,7 +262,7 @@ protected:
: __engaged_(__x.__engaged_)
{
if (__engaged_)
- ::new(_VSTD::addressof(__val_)) value_type(__x.__val_);
+ ::new((void*)_VSTD::addressof(__val_)) value_type(__x.__val_);
}
_LIBCPP_INLINE_VISIBILITY
@@ -271,7 +271,7 @@ protected:
: __engaged_(__x.__engaged_)
{
if (__engaged_)
- ::new(_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_));
+ ::new((void*)_VSTD::addressof(__val_)) value_type(_VSTD::move(__x.__val_));
}
_LIBCPP_INLINE_VISIBILITY
@@ -368,7 +368,7 @@ public:
if (this->__engaged_)
this->__val_.~value_type();
else
- ::new(_VSTD::addressof(this->__val_)) value_type(__opt.__val_);
+ ::new((void*)_VSTD::addressof(this->__val_)) value_type(__opt.__val_);
this->__engaged_ = __opt.__engaged_;
}
return *this;
@@ -390,7 +390,8 @@ public:
if (this->__engaged_)
this->__val_.~value_type();
else
- ::new(_VSTD::addressof(this->__val_)) value_type(_VSTD::move(__opt.__val_));
+ ::new((void*)_VSTD::addressof(this->__val_))
+ value_type(_VSTD::move(__opt.__val_));
this->__engaged_ = __opt.__engaged_;
}
return *this;
@@ -412,7 +413,7 @@ public:
this->__val_ = _VSTD::forward<_Up>(__v);
else
{
- ::new(_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Up>(__v));
+ ::new((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Up>(__v));
this->__engaged_ = true;
}
return *this;
@@ -429,7 +430,8 @@ public:
emplace(_Args&&... __args)
{
*this = nullopt;
- ::new(_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
+ ::new((void*)_VSTD::addressof(this->__val_))
+ value_type(_VSTD::forward<_Args>(__args)...);
this->__engaged_ = true;
}
@@ -444,7 +446,8 @@ public:
emplace(initializer_list<_Up> __il, _Args&&... __args)
{
*this = nullopt;
- ::new(_VSTD::addressof(this->__val_)) value_type(__il, _VSTD::forward<_Args>(__args)...);
+ ::new((void*)_VSTD::addressof(this->__val_))
+ value_type(__il, _VSTD::forward<_Args>(__args)...);
this->__engaged_ = true;
}
@@ -464,12 +467,14 @@ public:
{
if (this->__engaged_)
{
- ::new(_VSTD::addressof(__opt.__val_)) value_type(_VSTD::move(this->__val_));
+ ::new((void*)_VSTD::addressof(__opt.__val_))
+ value_type(_VSTD::move(this->__val_));
this->__val_.~value_type();
}
else
{
- ::new(_VSTD::addressof(this->__val_)) value_type(_VSTD::move(__opt.__val_));
+ ::new((void*)_VSTD::addressof(this->__val_))
+ value_type(_VSTD::move(__opt.__val_));
__opt.__val_.~value_type();
}
swap(this->__engaged_, __opt.__engaged_);
@@ -482,7 +487,11 @@ public:
operator->() const
{
_LIBCPP_ASSERT(this->__engaged_, "optional operator-> called for disengaged value");
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+ return __builtin_addressof(this->__val_);
+#else
return __operator_arrow(__has_operator_addressof<value_type>{});
+#endif
}
_LIBCPP_INLINE_VISIBILITY
@@ -513,19 +522,32 @@ public:
_LIBCPP_INLINE_VISIBILITY
constexpr explicit operator bool() const noexcept {return this->__engaged_;}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+#endif
+ constexpr void __throw_bad_optional_access() const
+ {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_optional_access();
+#else
+ _VSTD::abort();
+#endif
+ }
+
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
constexpr value_type const& value() const
{
if (!this->__engaged_)
- throw bad_optional_access();
+ __throw_bad_optional_access();
return this->__val_;
}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
value_type& value()
{
if (!this->__engaged_)
- throw bad_optional_access();
+ __throw_bad_optional_access();
return this->__val_;
}
@@ -702,7 +724,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
constexpr
bool
-operator<=(nullopt_t, const optional<_Tp>& __x) noexcept
+operator<=(nullopt_t, const optional<_Tp>&) noexcept
{
return true;
}
@@ -720,7 +742,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
constexpr
bool
-operator>(nullopt_t, const optional<_Tp>& __x) noexcept
+operator>(nullopt_t, const optional<_Tp>&) noexcept
{
return false;
}
@@ -875,7 +897,7 @@ _LIBCPP_END_NAMESPACE_LFTS
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY hash<std::experimental::optional<_Tp> >
+struct _LIBCPP_TEMPLATE_VIS hash<std::experimental::optional<_Tp> >
{
typedef std::experimental::optional<_Tp> argument_type;
typedef size_t result_type;
@@ -891,4 +913,4 @@ _LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_STD_VER > 11
-#endif // _LIBCPP_OPTIONAL
+#endif // _LIBCPP_EXPERIMENTAL_OPTIONAL
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/propagate_const b/chromium/buildtools/third_party/libc++/trunk/include/experimental/propagate_const
new file mode 100644
index 00000000000..e7f7e9fc683
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/propagate_const
@@ -0,0 +1,580 @@
+// -*- C++ -*-
+//===------------------------ propagate_const -----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
+#define _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
+/*
+ propagate_const synopsis
+
+ namespace std { namespace experimental { inline namespace fundamentals_v2 {
+
+ // [propagate_const]
+ template <class T> class propagate_const;
+
+ // [propagate_const.underlying], underlying pointer access
+ constexpr const _Tp& _VSTD_LFTS_V2::get_underlying(const propagate_const<T>& pt) noexcept;
+ constexpr T& _VSTD_LFTS_V2::get_underlying(propagate_const<T>& pt) noexcept;
+
+ // [propagate_const.relational], relational operators
+ template <class T> constexpr bool operator==(const propagate_const<T>& pt, nullptr_t);
+ template <class T> constexpr bool operator==(nullptr_t, const propagate_const<T>& pu);
+ template <class T> constexpr bool operator!=(const propagate_const<T>& pt, nullptr_t);
+ template <class T> constexpr bool operator!=(nullptr_t, const propagate_const<T>& pu);
+ template <class T, class U> constexpr bool operator==(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator!=(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator<(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator>(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator<=(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator>=(const propagate_const<T>& pt, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator==(const propagate_const<T>& pt, const _Up& u);
+ template <class T, class U> constexpr bool operator!=(const propagate_const<T>& pt, const _Up& u);
+ template <class T, class U> constexpr bool operator<(const propagate_const<T>& pt, const _Up& u);
+ template <class T, class U> constexpr bool operator>(const propagate_const<T>& pt, const _Up& u);
+ template <class T, class U> constexpr bool operator<=(const propagate_const<T>& pt, const _Up& u);
+ template <class T, class U> constexpr bool operator>=(const propagate_const<T>& pt, const _Up& u);
+ template <class T, class U> constexpr bool operator==(const _Tp& t, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator!=(const _Tp& t, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator<(const _Tp& t, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator>(const _Tp& t, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator<=(const _Tp& t, const propagate_const<_Up>& pu);
+ template <class T, class U> constexpr bool operator>=(const _Tp& t, const propagate_const<_Up>& pu);
+
+ // [propagate_const.algorithms], specialized algorithms
+ template <class T> constexpr void swap(propagate_const<T>& pt, propagate_const<T>& pu) noexcept(see below);
+
+ template <class T>
+ class propagate_const
+ {
+
+ public:
+ typedef remove_reference_t<decltype(*declval<T&>())> element_type;
+
+ // [propagate_const.ctor], constructors
+ constexpr propagate_const() = default;
+ propagate_const(const propagate_const& p) = delete;
+ constexpr propagate_const(propagate_const&& p) = default;
+ template <class U> EXPLICIT constexpr propagate_const(propagate_const<_Up>&& pu); // see below
+ template <class U> EXPLICIT constexpr propagate_const(U&& u); // see below
+
+ // [propagate_const.assignment], assignment
+ propagate_const& operator=(const propagate_const& p) = delete;
+ constexpr propagate_const& operator=(propagate_const&& p) = default;
+ template <class U> constexpr propagate_const& operator=(propagate_const<_Up>&& pu);
+ template <class U> constexpr propagate_const& operator=(U&& u); // see below
+
+ // [propagate_const.const_observers], const observers
+ explicit constexpr operator bool() const;
+ constexpr const element_type* operator->() const;
+ constexpr operator const element_type*() const; // Not always defined
+ constexpr const element_type& operator*() const;
+ constexpr const element_type* get() const;
+
+ // [propagate_const.non_const_observers], non-const observers
+ constexpr element_type* operator->();
+ constexpr operator element_type*(); // Not always defined
+ constexpr element_type& operator*();
+ constexpr element_type* get();
+
+ // [propagate_const.modifiers], modifiers
+ constexpr void swap(propagate_const& pt) noexcept(see below)
+
+ private:
+ T t_; // exposition only
+ };
+
+ } // namespace fundamentals_v2
+ } // namespace experimental
+
+ // [propagate_const.hash], hash support
+ template <class T> struct hash<experimental::fundamentals_v2::propagate_const<T>>;
+
+ // [propagate_const.comparison_function_objects], comparison function objects
+ template <class T> struct equal_to<experimental::fundamentals_v2::propagate_const<T>>;
+ template <class T> struct not_equal_to<experimental::fundamentals_v2::propagate_const<T>>;
+ template <class T> struct less<experimental::fundamentals_v2::propagate_const<T>>;
+ template <class T> struct greater<experimental::fundamentals_v2::propagate_const<T>>;
+ template <class T> struct less_equal<experimental::fundamentals_v2::propagate_const<T>>;
+ template <class T> struct greater_equal<experimental::fundamentals_v2::propagate_const<T>>;
+
+} // namespace std
+
+*/
+
+#include <experimental/__config>
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#if _LIBCPP_STD_VER > 11
+
+#include <type_traits>
+#include <utility>
+#include <functional>
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
+
+
+template <class _Tp>
+class propagate_const;
+
+template <class _Up>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
+
+template <class _Up>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+_Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
+
+template <class _Tp>
+class propagate_const
+{
+public:
+ typedef remove_reference_t<decltype(*_VSTD::declval<_Tp&>())> element_type;
+
+ static_assert(!is_array<_Tp>::value,
+ "Instantiation of propagate_const with an array type is ill-formed.");
+ static_assert(!is_reference<_Tp>::value,
+ "Instantiation of propagate_const with a reference type is ill-formed.");
+ static_assert(!(is_pointer<_Tp>::value && is_function<typename remove_pointer<_Tp>::type>::value),
+ "Instantiation of propagate_const with a function-pointer type is ill-formed.");
+ static_assert(!(is_pointer<_Tp>::value && is_same<typename remove_cv<typename remove_pointer<_Tp>::type>::type, void>::value),
+ "Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed.");
+
+private:
+ template <class _Up>
+ static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u)
+ {
+ return __u;
+ }
+
+ template <class _Up>
+ static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u)
+ {
+ return __get_pointer(__u.get());
+ }
+
+ template <class _Up>
+ static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u)
+ {
+ return __u;
+ }
+
+ template <class _Up>
+ static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u)
+ {
+ return __get_pointer(__u.get());
+ }
+
+ template <class _Up>
+ struct __is_propagate_const : false_type
+ {
+ };
+
+ template <class _Up>
+ struct __is_propagate_const<propagate_const<_Up>> : true_type
+ {
+ };
+
+ _Tp __t_;
+
+public:
+
+ template <class _Up> friend _LIBCPP_CONSTEXPR const _Up& ::_VSTD_LFTS_V2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
+ template <class _Up> friend _LIBCPP_CONSTEXPR _Up& ::_VSTD_LFTS_V2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
+
+ _LIBCPP_CONSTEXPR propagate_const() = default;
+
+ propagate_const(const propagate_const&) = delete;
+
+ _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default;
+
+ template <class _Up, enable_if_t<!is_convertible<_Up, _Tp>::value &&
+ is_constructible<_Tp, _Up&&>::value,bool> = true>
+ explicit _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
+ : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu)))
+ {
+ }
+
+ template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value &&
+ is_constructible<_Tp, _Up&&>::value,bool> = false>
+ _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu)
+ : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu)))
+ {
+ }
+
+ template <class _Up, enable_if_t<!is_convertible<_Up&&, _Tp>::value &&
+ is_constructible<_Tp, _Up&&>::value &&
+ !__is_propagate_const<decay_t<_Up>>::value,bool> = true>
+ explicit _LIBCPP_CONSTEXPR propagate_const(_Up&& __u)
+ : __t_(std::forward<_Up>(__u))
+ {
+ }
+
+ template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value &&
+ is_constructible<_Tp, _Up&&>::value &&
+ !__is_propagate_const<decay_t<_Up>>::value,bool> = false>
+ _LIBCPP_CONSTEXPR propagate_const(_Up&& __u)
+ : __t_(std::forward<_Up>(__u))
+ {
+ }
+
+ propagate_const& operator=(const propagate_const&) = delete;
+
+ _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default;
+
+ template <class _Up>
+ _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu)
+ {
+ __t_ = std::move(_VSTD_LFTS_V2::get_underlying(__pu));
+ return *this;
+ }
+
+ template <class _Up, class _Vp = enable_if_t<!__is_propagate_const<decay_t<_Up>>::value>>
+ _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u)
+ {
+ __t_ = std::forward<_Up>(__u);
+ return *this;
+ }
+
+ _LIBCPP_CONSTEXPR const element_type* get() const
+ {
+ return __get_pointer(__t_);
+ }
+
+ _LIBCPP_CONSTEXPR element_type* get()
+ {
+ return __get_pointer(__t_);
+ }
+
+ explicit _LIBCPP_CONSTEXPR operator bool() const
+ {
+ return get() != nullptr;
+ }
+
+ _LIBCPP_CONSTEXPR const element_type* operator->() const
+ {
+ return get();
+ }
+
+ template <class _Tp_ = _Tp, class _Up = enable_if_t<is_convertible<
+ const _Tp_, const element_type *>::value>>
+ _LIBCPP_CONSTEXPR operator const element_type *() const {
+ return get();
+ }
+
+ _LIBCPP_CONSTEXPR const element_type& operator*() const
+ {
+ return *get();
+ }
+
+ _LIBCPP_CONSTEXPR element_type* operator->()
+ {
+ return get();
+ }
+
+ template <class _Tp_ = _Tp, class _Up = enable_if_t<
+ is_convertible<_Tp_, element_type *>::value>>
+ _LIBCPP_CONSTEXPR operator element_type *() {
+ return get();
+ }
+
+ _LIBCPP_CONSTEXPR element_type& operator*()
+ {
+ return *get();
+ }
+
+ _LIBCPP_CONSTEXPR void swap(propagate_const& __pt) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
+ {
+ using _VSTD::swap;
+ swap(__t_, __pt.__t_);
+ }
+};
+
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, nullptr_t)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) == nullptr;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator==(nullptr_t, const propagate_const<_Tp>& __pt)
+{
+ return nullptr == _VSTD_LFTS_V2::get_underlying(__pt);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) != nullptr;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt)
+{
+ return nullptr != _VSTD_LFTS_V2::get_underlying(__pt);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt,
+ const propagate_const<_Up>& __pu)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) == _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt,
+ const propagate_const<_Up>& __pu)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) != _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt,
+ const propagate_const<_Up>& __pu)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) < _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt,
+ const propagate_const<_Up>& __pu)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) > _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt,
+ const propagate_const<_Up>& __pu)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) <= _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt,
+ const propagate_const<_Up>& __pu)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) >= _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) == __u;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) != __u;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) < __u;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) > __u;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) <= __u;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u)
+{
+ return _VSTD_LFTS_V2::get_underlying(__pt) >= __u;
+}
+
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu)
+{
+ return __t == _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu)
+{
+ return __t != _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu)
+{
+ return __t < _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu)
+{
+ return __t > _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu)
+{
+ return __t <= _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu)
+{
+ return __t >= _VSTD_LFTS_V2::get_underlying(__pu);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
+{
+ using _VSTD::swap;
+ swap(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
+}
+
+template <class _Tp>
+_LIBCPP_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT
+{
+ return __pt.__t_;
+}
+
+template <class _Tp>
+_LIBCPP_CONSTEXPR _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT
+{
+ return __pt.__t_;
+}
+
+_LIBCPP_END_NAMESPACE_LFTS_V2
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template <class _Tp>
+struct hash<experimental::fundamentals_v2::propagate_const<_Tp>>
+{
+ typedef size_t result_type;
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> argument_type;
+
+ size_t operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1) const
+ {
+ return std::hash<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1));
+ }
+};
+
+template <class _Tp>
+struct equal_to<experimental::fundamentals_v2::propagate_const<_Tp>>
+{
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
+
+ bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
+ const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
+ {
+ return std::equal_to<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
+ }
+};
+
+template <class _Tp>
+struct not_equal_to<experimental::fundamentals_v2::propagate_const<_Tp>>
+{
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
+
+ bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
+ const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
+ {
+ return std::not_equal_to<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
+ }
+};
+
+template <class _Tp>
+struct less<experimental::fundamentals_v2::propagate_const<_Tp>>
+{
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
+
+ bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
+ const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
+ {
+ return std::less<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
+ }
+};
+
+template <class _Tp>
+struct greater<experimental::fundamentals_v2::propagate_const<_Tp>>
+{
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
+
+ bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
+ const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
+ {
+ return std::greater<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
+ }
+};
+
+template <class _Tp>
+struct less_equal<experimental::fundamentals_v2::propagate_const<_Tp>>
+{
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
+
+ bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
+ const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
+ {
+ return std::less_equal<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
+ }
+};
+
+template <class _Tp>
+struct greater_equal<experimental::fundamentals_v2::propagate_const<_Tp>>
+{
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type;
+ typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type;
+
+ bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1,
+ const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const
+ {
+ return std::greater_equal<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2));
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 11
+#endif // _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST
+
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/regex b/chromium/buildtools/third_party/libc++/trunk/include/experimental/regex
new file mode 100644
index 00000000000..d38891c374b
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/regex
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+//===----------------------------- regex ----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_REGEX
+#define _LIBCPP_EXPERIMENTAL_REGEX
+/*
+ experimental/regex synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class BidirectionalIterator>
+ using match_results =
+ std::match_results<BidirectionalIterator,
+ polymorphic_allocator<sub_match<BidirectionalIterator>>>;
+
+ typedef match_results<const char*> cmatch;
+ typedef match_results<const wchar_t*> wcmatch;
+ typedef match_results<string::const_iterator> smatch;
+ typedef match_results<wstring::const_iterator> wsmatch;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <regex>
+#include <experimental/string>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _BiDirIter>
+using match_results =
+ _VSTD::match_results<_BiDirIter,
+ polymorphic_allocator<_VSTD::sub_match<_BiDirIter>>>;
+
+typedef match_results<const char*> cmatch;
+typedef match_results<const wchar_t*> wcmatch;
+typedef match_results<_VSTD_LFTS_PMR::string::const_iterator> smatch;
+typedef match_results<_VSTD_LFTS_PMR::wstring::const_iterator> wsmatch;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_REGEX */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/set b/chromium/buildtools/third_party/libc++/trunk/include/experimental/set
new file mode 100644
index 00000000000..20cf6d4a389
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/set
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+//===--------------------------- list ------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_SET
+#define _LIBCPP_EXPERIMENTAL_SET
+/*
+ experimental/set synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class Key, class T, class Compare = less<Key>>
+ using set = std::set<Key, T, Compare,
+ polymorphic_allocator<pair<const Key,T>>>;
+
+ template <class Key, class T, class Compare = less<Key>>
+ using multiset = std::multiset<Key, T, Compare,
+ polymorphic_allocator<pair<const Key,T>>>;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <set>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _Value, class _Compare = less<_Value>>
+using set = _VSTD::set<_Value, _Compare,
+ polymorphic_allocator<_Value>>;
+
+template <class _Value, class _Compare = less<_Value>>
+using multiset = _VSTD::multiset<_Value, _Compare,
+ polymorphic_allocator<_Value>>;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_SET */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/string b/chromium/buildtools/third_party/libc++/trunk/include/experimental/string
new file mode 100644
index 00000000000..8b8545128f2
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/string
@@ -0,0 +1,62 @@
+// -*- C++ -*-
+//===--------------------------- string ----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_STRING
+#define _LIBCPP_EXPERIMENTAL_STRING
+/*
+ experimental/string synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ // basic_string using polymorphic allocator in namespace pmr
+ template <class charT, class traits = char_traits<charT>>
+ using basic_string =
+ std::basic_string<charT, traits, polymorphic_allocator<charT>>;
+
+ // basic_string typedef names using polymorphic allocator in namespace
+ // std::experimental::pmr
+ typedef basic_string<char> string;
+ typedef basic_string<char16_t> u16string;
+ typedef basic_string<char32_t> u32string;
+ typedef basic_string<wchar_t> wstring;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <string>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _CharT, class _Traits = char_traits<_CharT>>
+using basic_string =
+ _VSTD::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
+
+typedef basic_string<char> string;
+typedef basic_string<char16_t> u16string;
+typedef basic_string<char32_t> u32string;
+typedef basic_string<wchar_t> wstring;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_STRING */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/string_view b/chromium/buildtools/third_party/libc++/trunk/include/experimental/string_view
index 2a20d7caa68..41c0d34d3c8 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/string_view
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/string_view
@@ -180,6 +180,7 @@ namespace std {
#include <algorithm>
#include <iterator>
#include <ostream>
+#include <stdexcept>
#include <iomanip>
#include <__debug>
@@ -191,7 +192,7 @@ namespace std {
_LIBCPP_BEGIN_NAMESPACE_LFTS
template<class _CharT, class _Traits = _VSTD::char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_string_view {
+ class _LIBCPP_TEMPLATE_VIS basic_string_view {
public:
// types
typedef _Traits traits_type;
@@ -227,7 +228,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
basic_string_view(const _CharT* __s, size_type __len)
: __data(__s), __size(__len)
{
-// _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): recieved nullptr");
+// _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr");
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
@@ -280,7 +281,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
const_reference at(size_type __pos) const
{
return __pos >= size()
- ? (throw out_of_range("string_view::at"), __data[0])
+ ? (__throw_out_of_range("string_view::at"), __data[0])
: __data[__pos];
}
@@ -351,7 +352,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const
{
if ( __pos > size())
- throw out_of_range("string_view::copy");
+ __throw_out_of_range("string_view::copy");
size_type __rlen = _VSTD::min( __n, size() - __pos );
_VSTD::copy_n(begin() + __pos, __rlen, __s );
return __rlen;
@@ -361,11 +362,11 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
basic_string_view substr(size_type __pos = 0, size_type __n = npos) const
{
// if (__pos > size())
-// throw out_of_range("string_view::substr");
+// __throw_out_of_range("string_view::substr");
// size_type __rlen = _VSTD::min( __n, size() - __pos );
// return basic_string_view(data() + __pos, __rlen);
return __pos > size()
- ? throw out_of_range("string_view::substr")
+ ? (__throw_out_of_range("string_view::substr"), basic_string_view())
: basic_string_view(data() + __pos, _VSTD::min(__n, size() - __pos));
}
@@ -413,7 +414,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): recieved nullptr");
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
return _VSTD::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -428,7 +429,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find(const _CharT* __s, size_type __pos, size_type __n) const
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): recieved nullptr");
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
return _VSTD::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -436,7 +437,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find(const _CharT* __s, size_type __pos = 0) const
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): recieved nullptr");
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): received nullptr");
return _VSTD::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -445,7 +446,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): recieved nullptr");
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -460,7 +461,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): recieved nullptr");
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -468,7 +469,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type rfind(const _CharT* __s, size_type __pos=npos) const
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): recieved nullptr");
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): received nullptr");
return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -477,7 +478,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): received nullptr");
return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -489,7 +490,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -497,7 +498,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const _CharT* __s, size_type __pos=0) const
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): received nullptr");
return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -506,7 +507,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): received nullptr");
return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -518,7 +519,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -526,7 +527,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const _CharT* __s, size_type __pos=npos) const
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): received nullptr");
return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -535,7 +536,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(basic_string_view __s, size_type __pos=0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): received nullptr");
return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -550,7 +551,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -558,7 +559,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -567,7 +568,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): received nullptr");
return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
@@ -582,7 +583,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -590,7 +591,7 @@ _LIBCPP_BEGIN_NAMESPACE_LFTS
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): recieved nullptr");
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -782,7 +783,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// [string.view.hash]
// Shamelessly stolen from <string>
template<class _CharT, class _Traits>
-struct _LIBCPP_TYPE_VIS_ONLY hash<std::experimental::basic_string_view<_CharT, _Traits> >
+struct _LIBCPP_TEMPLATE_VIS hash<std::experimental::basic_string_view<_CharT, _Traits> >
: public unary_function<std::experimental::basic_string_view<_CharT, _Traits>, size_t>
{
size_t operator()(const std::experimental::basic_string_view<_CharT, _Traits>& __val) const _NOEXCEPT;
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/tuple b/chromium/buildtools/third_party/libc++/trunk/include/experimental/tuple
index 50d1e0555bc..e00d2ec1a92 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/tuple
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/tuple
@@ -57,9 +57,10 @@ _LIBCPP_CONSTEXPR size_t tuple_size_v = tuple_size<_Tp>::value;
template <class _Fn, class _Tuple, size_t ..._Id>
inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR_AFTER_CXX11
decltype(auto) __apply_tuple_impl(_Fn && __f, _Tuple && __t,
integer_sequence<size_t, _Id...>) {
- return _VSTD::__invoke(
+ return _VSTD::__invoke_constexpr(
_VSTD::forward<_Fn>(__f),
_VSTD::get<_Id>(_VSTD::forward<_Tuple>(__t))...
);
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/type_traits b/chromium/buildtools/third_party/libc++/trunk/include/experimental/type_traits
index ae49fc176c0..3a7593620a7 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/type_traits
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/type_traits
@@ -172,6 +172,45 @@ inline namespace fundamentals_v1 {
template <class T>
using raw_invocation_type_t = typename raw_invocation_type<T>::type;
+ // 3.3.3, Logical operator traits
+ template<class... B> struct conjunction;
+ template<class... B> constexpr bool conjunction_v = conjunction<B...>::value;
+ template<class... B> struct disjunction;
+ template<class... B> constexpr bool disjunction_v = disjunction<B...>::value;
+ template<class B> struct negation;
+ template<class B> constexpr bool negation_v = negation<B>::value;
+
+ // 3.3.4, Detection idiom
+ template <class...> using void_t = void;
+
+ struct nonesuch {
+ nonesuch() = delete;
+ ~nonesuch() = delete;
+ nonesuch(nonesuch const&) = delete;
+ void operator=(nonesuch const&) = delete;
+ };
+
+ template <template<class...> class Op, class... Args>
+ using is_detected = see below;
+ template <template<class...> class Op, class... Args>
+ constexpr bool is_detected_v = is_detected<Op, Args...>::value;
+ template <template<class...> class Op, class... Args>
+ using detected_t = see below;
+ template <class Default, template<class...> class Op, class... Args>
+ using detected_or = see below;
+ template <class Default, template<class...> class Op, class... Args>
+ using detected_or_t = typename detected_or<Default, Op, Args...>::type;
+ template <class Expected, template<class...> class Op, class... Args>
+ using is_detected_exact = is_same<Expected, detected_t<Op, Args...>>;
+ template <class Expected, template<class...> class Op, class... Args>
+ constexpr bool is_detected_exact_v
+ = is_detected_exact<Expected, Op, Args...>::value;
+ template <class To, template<class...> class Op, class... Args>
+ using is_detected_convertible = is_convertible<detected_t<Op, Args...>, To>;
+ template <class To, template<class...> class Op, class... Args>
+ constexpr bool is_detected_convertible_v
+ = is_detected_convertible<To, Op, Args...>::value;
+
} // namespace fundamentals_v1
} // namespace experimental
} // namespace std
@@ -402,16 +441,16 @@ template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_convertible_v
// 3.3.2, Other type transformations
/*
template <class>
-class _LIBCPP_TYPE_VIS_ONLY raw_invocation_type;
+class _LIBCPP_TEMPLATE_VIS raw_invocation_type;
template <class _Fn, class ..._Args>
-class _LIBCPP_TYPE_VIS_ONLY raw_invocation_type<_Fn(_Args...)>;
+class _LIBCPP_TEMPLATE_VIS raw_invocation_type<_Fn(_Args...)>;
template <class>
-class _LIBCPP_TYPE_VIS_ONLY invokation_type;
+class _LIBCPP_TEMPLATE_VIS invokation_type;
template <class _Fn, class ..._Args>
-class _LIBCPP_TYPE_VIS_ONLY invokation_type<_Fn(_Args...)>;
+class _LIBCPP_TEMPLATE_VIS invokation_type<_Fn(_Args...)>;
template <class _Tp>
using invokation_type_t = typename invokation_type<_Tp>::type;
@@ -420,6 +459,70 @@ template <class _Tp>
using raw_invocation_type_t = typename raw_invocation_type<_Tp>::type;
*/
+// 3.3.3, Logical operator traits
+template <class...> using void_t = void;
+
+template <class... _Args>
+struct conjunction : _VSTD::__and_<_Args...> {};
+template <class... _Args>
+_LIBCPP_CONSTEXPR bool conjunction_v = conjunction<_Args...>::value;
+
+template <class... _Args>
+struct disjunction : _VSTD::__or_<_Args...> {};
+template <class... _Args>
+_LIBCPP_CONSTEXPR bool disjunction_v = disjunction<_Args...>::value;
+
+template <class _Tp>
+struct negation : _VSTD::__not_<_Tp> {};
+template<class _Tp>
+_LIBCPP_CONSTEXPR bool negation_v = negation<_Tp>::value;
+
+// 3.3.4, Detection idiom
+template <class...> using void_t = void;
+
+struct nonesuch {
+ nonesuch() = delete;
+ ~nonesuch() = delete;
+ nonesuch (nonesuch const&) = delete;
+ void operator=(nonesuch const&) = delete;
+ };
+
+template <class _Default, class _AlwaysVoid, template <class...> class _Op, class... _Args>
+struct _DETECTOR {
+ using value_t = false_type;
+ using type = _Default;
+ };
+
+template <class _Default, template <class...> class _Op, class... _Args>
+struct _DETECTOR<_Default, void_t<_Op<_Args...>>, _Op, _Args...> {
+ using value_t = true_type;
+ using type = _Op<_Args...>;
+ };
+
+
+template <template<class...> class _Op, class... _Args>
+ using is_detected = typename _DETECTOR<nonesuch, void, _Op, _Args...>::value_t;
+template <template<class...> class _Op, class... _Args>
+ using detected_t = typename _DETECTOR<nonesuch, void, _Op, _Args...>::type;
+template <template<class...> class _Op, class... _Args>
+ _LIBCPP_CONSTEXPR bool is_detected_v = is_detected<_Op, _Args...>::value;
+
+template <class Default, template<class...> class _Op, class... _Args>
+ using detected_or = _DETECTOR<Default, void, _Op, _Args...>;
+template <class Default, template<class...> class _Op, class... _Args>
+ using detected_or_t = typename detected_or<Default, _Op, _Args...>::type;
+
+template <class Expected, template<class...> class _Op, class... _Args>
+ using is_detected_exact = is_same<Expected, detected_t<_Op, _Args...>>;
+template <class Expected, template<class...> class _Op, class... _Args>
+ _LIBCPP_CONSTEXPR bool is_detected_exact_v = is_detected_exact<Expected, _Op, _Args...>::value;
+
+template <class To, template<class...> class _Op, class... _Args>
+ using is_detected_convertible = is_convertible<detected_t<_Op, _Args...>, To>;
+template <class To, template<class...> class _Op, class... _Args>
+ _LIBCPP_CONSTEXPR bool is_detected_convertible_v = is_detected_convertible<To, _Op, _Args...>::value;
+
+
_LIBCPP_END_NAMESPACE_LFTS
#endif /* _LIBCPP_STD_VER > 11 */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/unordered_map b/chromium/buildtools/third_party/libc++/trunk/include/experimental/unordered_map
new file mode 100644
index 00000000000..1f998c2d4c7
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/unordered_map
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+//===------------------------- unordered_map ------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_UNORDERED_MAP
+#define _LIBCPP_EXPERIMENTAL_UNORDERED_MAP
+/*
+ experimental/unordered_map synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class Key, class T,
+ class Hash = hash<Key>,
+ class Pred = equal_to<Key>>
+ using unordered_map =
+ std::unordered_map<Key, T, Hash, Pred,
+ polymorphic_allocator<pair<const Key,T>>>;
+
+ template <class Key, class T,
+ class Hash = hash<Key>,
+ class Pred = equal_to<Key>>
+ using unordered_multimap =
+ std::unordered_multimap<Key, T, Hash, Pred,
+ polymorphic_allocator<pair<const Key,T>>>;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <unordered_map>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _Key, class _Value,
+ class _Hash = hash<_Key>, class _Pred = equal_to<_Key>>
+using unordered_map = _VSTD::unordered_map<_Key, _Value, _Hash, _Pred,
+ polymorphic_allocator<pair<const _Key, _Value>>>;
+
+template <class _Key, class _Value,
+ class _Hash = hash<_Key>, class _Pred = equal_to<_Key>>
+using unordered_multimap = _VSTD::unordered_multimap<_Key, _Value, _Hash, _Pred,
+ polymorphic_allocator<pair<const _Key, _Value>>>;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_MAP */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/unordered_set b/chromium/buildtools/third_party/libc++/trunk/include/experimental/unordered_set
new file mode 100644
index 00000000000..d00a8375340
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/unordered_set
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+//===------------------------- unordered_set ------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_UNORDERED_SET
+#define _LIBCPP_EXPERIMENTAL_UNORDERED_SET
+/*
+ experimental/unordered_set synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class T, class Hash = hash<T>, class Pred = equal_to<T>>
+ using unordered_set = std::unordered_set<T, Hash, Pred,
+ polymorphic_allocator<T>>;
+
+ template <class T, class Hash = hash<T>, class Pred = equal_to<T>>
+ using unordered_multiset = std::unordered_multiset<T, Hash, Pred,
+ polymorphic_allocator<T>>;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <unordered_set>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _Value,
+ class _Hash = hash<_Value>, class _Pred = equal_to<_Value>>
+using unordered_set = _VSTD::unordered_set<_Value, _Hash, _Pred,
+ polymorphic_allocator<_Value>>;
+
+template <class _Value,
+ class _Hash = hash<_Value>, class _Pred = equal_to<_Value>>
+using unordered_multiset = _VSTD::unordered_multiset<_Value, _Hash, _Pred,
+ polymorphic_allocator<_Value>>;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_SET */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/utility b/chromium/buildtools/third_party/libc++/trunk/include/experimental/utility
index b5fca6c775b..8effa71c131 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/experimental/utility
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/utility
@@ -40,7 +40,7 @@ inline namespace fundamentals_v1 {
_LIBCPP_BEGIN_NAMESPACE_LFTS
- struct _LIBCPP_TYPE_VIS_ONLY erased_type { };
+ struct _LIBCPP_TEMPLATE_VIS erased_type { };
_LIBCPP_END_NAMESPACE_LFTS
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/experimental/vector b/chromium/buildtools/third_party/libc++/trunk/include/experimental/vector
new file mode 100644
index 00000000000..bd10492bfef
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/experimental/vector
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+//===--------------------------- vector ------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_VECTOR
+#define _LIBCPP_EXPERIMENTAL_VECTOR
+/*
+ experimental/vector synopsis
+
+// C++1z
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+namespace pmr {
+
+ template <class T>
+ using vector = std::vector<T, polymorphic_allocator<T>>;
+
+} // namespace pmr
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+#include <experimental/__config>
+#include <vector>
+#include <experimental/memory_resource>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+template <class _ValueT>
+using vector = _VSTD::vector<_ValueT, polymorphic_allocator<_ValueT>>;
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
+
+#endif /* _LIBCPP_EXPERIMENTAL_VECTOR */
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/ext/__hash b/chromium/buildtools/third_party/libc++/trunk/include/ext/__hash
index 5675d54055e..318cb1f97b0 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/ext/__hash
+++ b/chromium/buildtools/third_party/libc++/trunk/include/ext/__hash
@@ -19,9 +19,9 @@
namespace __gnu_cxx {
using namespace std;
-template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash { };
+template <typename _Tp> struct _LIBCPP_TEMPLATE_VIS hash { };
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<const char*>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<const char*>
: public unary_function<const char*, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -31,7 +31,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<const char*>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<char *>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<char *>
: public unary_function<char*, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -41,7 +41,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<char *>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<char>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<char>
: public unary_function<char, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -51,7 +51,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<char>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<signed char>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<signed char>
: public unary_function<signed char, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -61,7 +61,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<signed char>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned char>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
: public unary_function<unsigned char, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -71,7 +71,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned char>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<short>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<short>
: public unary_function<short, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -81,7 +81,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<short>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned short>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned short>
: public unary_function<unsigned short, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -91,7 +91,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned short>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<int>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<int>
: public unary_function<int, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -101,7 +101,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<int>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned int>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned int>
: public unary_function<unsigned int, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -111,7 +111,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned int>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<long>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<long>
: public unary_function<long, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -121,7 +121,7 @@ template <> struct _LIBCPP_TYPE_VIS_ONLY hash<long>
}
};
-template <> struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned long>
+template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
: public unary_function<unsigned long, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/ext/hash_map b/chromium/buildtools/third_party/libc++/trunk/include/ext/hash_map
index 0e4ab6910eb..998e8f65994 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/ext/hash_map
+++ b/chromium/buildtools/third_party/libc++/trunk/include/ext/hash_map
@@ -207,7 +207,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <ext/__hash>
#if __DEPRECATED
-#if defined(_MSC_VER) && ! defined(__clang__)
+#if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>")
#else
# warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>
@@ -309,7 +309,7 @@ class __hash_map_node_destructor
{
typedef _Alloc allocator_type;
typedef allocator_traits<allocator_type> __alloc_traits;
- typedef typename __alloc_traits::value_type::value_type value_type;
+ typedef typename __alloc_traits::value_type::__node_value_type value_type;
public:
typedef typename __alloc_traits::pointer pointer;
private:
@@ -331,7 +331,7 @@ public:
__second_constructed(false)
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
: __na_(__x.__na_),
@@ -340,7 +340,7 @@ public:
{
__x.__value_constructed = false;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
: __na_(__x.__na_),
@@ -349,7 +349,7 @@ public:
{
const_cast<bool&>(__x.__value_constructed) = false;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void operator()(pointer __p)
@@ -364,11 +364,10 @@ public:
};
template <class _HashIterator>
-class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator
+class _LIBCPP_TEMPLATE_VIS __hash_map_iterator
{
_HashIterator __i_;
- typedef pointer_traits<typename _HashIterator::pointer> __pointer_traits;
typedef const typename _HashIterator::value_type::first_type key_type;
typedef typename _HashIterator::value_type::second_type mapped_type;
public:
@@ -376,13 +375,8 @@ public:
typedef pair<key_type, mapped_type> value_type;
typedef typename _HashIterator::difference_type difference_type;
typedef value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef typename __rebind_pointer<typename _HashIterator::pointer, value_type>::type
+ pointer;
_LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {}
@@ -407,19 +401,18 @@ public:
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_multimap;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_multimap;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
};
template <class _HashIterator>
-class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator
+class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator
{
_HashIterator __i_;
- typedef pointer_traits<typename _HashIterator::pointer> __pointer_traits;
typedef const typename _HashIterator::value_type::first_type key_type;
typedef typename _HashIterator::value_type::second_type mapped_type;
public:
@@ -427,13 +420,8 @@ public:
typedef pair<key_type, mapped_type> value_type;
typedef typename _HashIterator::difference_type difference_type;
typedef const value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
- pointer;
+ typedef typename __rebind_pointer<typename _HashIterator::pointer, const value_type>::type
+ pointer;
_LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {}
@@ -466,15 +454,15 @@ public:
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_multimap;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_multimap;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
};
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TYPE_VIS_ONLY hash_map
+class _LIBCPP_TEMPLATE_VIS hash_map
{
public:
// types
@@ -561,6 +549,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
@@ -686,7 +675,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
@@ -747,7 +736,7 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TYPE_VIS_ONLY hash_multimap
+class _LIBCPP_TEMPLATE_VIS hash_multimap
{
public:
// types
@@ -832,6 +821,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
@@ -939,7 +929,7 @@ hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap(
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/ext/hash_set b/chromium/buildtools/third_party/libc++/trunk/include/ext/hash_set
index c4bb89843d5..38f81ed3b5c 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/ext/hash_set
+++ b/chromium/buildtools/third_party/libc++/trunk/include/ext/hash_set
@@ -199,7 +199,7 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <ext/__hash>
#if __DEPRECATED
-#if defined(_MSC_VER) && ! defined(__clang__)
+#if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>")
#else
# warning Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>
@@ -212,7 +212,7 @@ using namespace std;
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_TYPE_VIS_ONLY hash_set
+class _LIBCPP_TEMPLATE_VIS hash_set
{
public:
// types
@@ -282,6 +282,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
@@ -385,7 +386,7 @@ hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
@@ -433,7 +434,7 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_TYPE_VIS_ONLY hash_multiset
+class _LIBCPP_TEMPLATE_VIS hash_multiset
{
public:
// types
@@ -502,6 +503,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
@@ -606,7 +608,7 @@ hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset(
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/forward_list b/chromium/buildtools/third_party/libc++/trunk/include/forward_list
index adbc32cf861..e4ab41e38b1 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/forward_list
+++ b/chromium/buildtools/third_party/libc++/trunk/include/forward_list
@@ -87,7 +87,7 @@ public:
reference front();
const_reference front() const;
- template <class... Args> void emplace_front(Args&&... args);
+ template <class... Args> reference emplace_front(Args&&... args); // reference in C++17
void push_front(const value_type& v);
void push_front(value_type&& v);
@@ -183,29 +183,77 @@ template <class T, class Allocator>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _VoidPtr> struct __forward_list_node;
+template <class _NodePtr> struct __forward_begin_node;
+
+
+template <class>
+struct __forward_list_node_value_type;
+
+template <class _Tp, class _VoidPtr>
+struct __forward_list_node_value_type<__forward_list_node<_Tp, _VoidPtr> > {
+ typedef _Tp type;
+};
+
+template <class _NodePtr>
+struct __forward_node_traits {
+
+ typedef typename remove_cv<
+ typename pointer_traits<_NodePtr>::element_type>::type __node;
+ typedef typename __forward_list_node_value_type<__node>::type __node_value_type;
+ typedef _NodePtr __node_pointer;
+ typedef __forward_begin_node<_NodePtr> __begin_node;
+ typedef typename __rebind_pointer<_NodePtr, __begin_node>::type
+ __begin_node_pointer;
+ typedef typename __rebind_pointer<_NodePtr, void>::type __void_pointer;
+
+#if defined(_LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB)
+ typedef __begin_node_pointer __iter_node_pointer;
+#else
+ typedef typename conditional<
+ is_pointer<__void_pointer>::value,
+ __begin_node_pointer,
+ __node_pointer
+ >::type __iter_node_pointer;
+#endif
+
+ typedef typename conditional<
+ is_same<__iter_node_pointer, __node_pointer>::value,
+ __begin_node_pointer,
+ __node_pointer
+ >::type __non_iter_node_pointer;
+
+ _LIBCPP_INLINE_VISIBILITY
+ static __iter_node_pointer __as_iter_node(__iter_node_pointer __p) {
+ return __p;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ static __iter_node_pointer __as_iter_node(__non_iter_node_pointer __p) {
+ return static_cast<__iter_node_pointer>(static_cast<__void_pointer>(__p));
+ }
+};
template <class _NodePtr>
struct __forward_begin_node
{
typedef _NodePtr pointer;
+ typedef typename __rebind_pointer<_NodePtr, __forward_begin_node>::type __begin_node_pointer;
pointer __next_;
- _LIBCPP_INLINE_VISIBILITY __forward_begin_node() : __next_(nullptr) {}
+ _LIBCPP_INLINE_VISIBILITY __forward_begin_node() : __next_(nullptr) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ __begin_node_pointer __next_as_begin() const {
+ return static_cast<__begin_node_pointer>(__next_);
+ }
};
template <class _Tp, class _VoidPtr>
struct _LIBCPP_HIDDEN __begin_node_of
{
- typedef __forward_begin_node
- <
- typename pointer_traits<_VoidPtr>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__forward_list_node<_Tp, _VoidPtr> >
-#else
- rebind<__forward_list_node<_Tp, _VoidPtr> >::other
-#endif
- > type;
+ typedef __forward_begin_node<
+ typename __rebind_pointer<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >::type
+ > type;
};
template <class _Tp, class _VoidPtr>
@@ -217,49 +265,68 @@ struct __forward_list_node
value_type __value_;
};
-template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCPP_TYPE_VIS_ONLY forward_list;
-template<class _NodeConstPtr> class _LIBCPP_TYPE_VIS_ONLY __forward_list_const_iterator;
+
+template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS forward_list;
+template<class _NodeConstPtr> class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator;
template <class _NodePtr>
-class _LIBCPP_TYPE_VIS_ONLY __forward_list_iterator
+class _LIBCPP_TEMPLATE_VIS __forward_list_iterator
{
- typedef _NodePtr __node_pointer;
+ typedef __forward_node_traits<_NodePtr> __traits;
+ typedef typename __traits::__node_pointer __node_pointer;
+ typedef typename __traits::__begin_node_pointer __begin_node_pointer;
+ typedef typename __traits::__iter_node_pointer __iter_node_pointer;
+ typedef typename __traits::__void_pointer __void_pointer;
- __node_pointer __ptr_;
+ __iter_node_pointer __ptr_;
_LIBCPP_INLINE_VISIBILITY
- explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
+ __begin_node_pointer __get_begin() const {
+ return static_cast<__begin_node_pointer>(
+ static_cast<__void_pointer>(__ptr_));
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ __node_pointer __get_unsafe_node_pointer() const {
+ return static_cast<__node_pointer>(
+ static_cast<__void_pointer>(__ptr_));
+ }
- template<class, class> friend class _LIBCPP_TYPE_VIS_ONLY forward_list;
- template<class> friend class _LIBCPP_TYPE_VIS_ONLY __forward_list_const_iterator;
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __forward_list_iterator(nullptr_t) _NOEXCEPT : __ptr_(nullptr) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __forward_list_iterator(__begin_node_pointer __p) _NOEXCEPT
+ : __ptr_(__traits::__as_iter_node(__p)) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT
+ : __ptr_(__traits::__as_iter_node(__p)) {}
+
+ template<class, class> friend class _LIBCPP_TEMPLATE_VIS forward_list;
+ template<class> friend class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator;
public:
typedef forward_iterator_tag iterator_category;
- typedef typename pointer_traits<__node_pointer>::element_type::value_type
- value_type;
+ typedef typename __traits::__node_value_type value_type;
typedef value_type& reference;
typedef typename pointer_traits<__node_pointer>::difference_type
difference_type;
- typedef typename pointer_traits<__node_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer;
_LIBCPP_INLINE_VISIBILITY
__forward_list_iterator() _NOEXCEPT : __ptr_(nullptr) {}
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const {return __ptr_->__value_;}
+ reference operator*() const {return __get_unsafe_node_pointer()->__value_;}
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const {return pointer_traits<pointer>::pointer_to(__ptr_->__value_);}
+ pointer operator->() const {
+ return pointer_traits<pointer>::pointer_to(__get_unsafe_node_pointer()->__value_);
+ }
_LIBCPP_INLINE_VISIBILITY
__forward_list_iterator& operator++()
{
- __ptr_ = __ptr_->__next_;
+ __ptr_ = __traits::__as_iter_node(__ptr_->__next_);
return *this;
}
_LIBCPP_INLINE_VISIBILITY
@@ -281,42 +348,51 @@ public:
};
template <class _NodeConstPtr>
-class _LIBCPP_TYPE_VIS_ONLY __forward_list_const_iterator
+class _LIBCPP_TEMPLATE_VIS __forward_list_const_iterator
{
- typedef _NodeConstPtr __node_const_pointer;
+ static_assert((!is_const<typename pointer_traits<_NodeConstPtr>::element_type>::value), "");
+ typedef _NodeConstPtr _NodePtr;
+
+ typedef __forward_node_traits<_NodePtr> __traits;
+ typedef typename __traits::__node __node;
+ typedef typename __traits::__node_pointer __node_pointer;
+ typedef typename __traits::__begin_node_pointer __begin_node_pointer;
+ typedef typename __traits::__iter_node_pointer __iter_node_pointer;
+ typedef typename __traits::__void_pointer __void_pointer;
- __node_const_pointer __ptr_;
+ __iter_node_pointer __ptr_;
+
+ __begin_node_pointer __get_begin() const {
+ return static_cast<__begin_node_pointer>(
+ static_cast<__void_pointer>(__ptr_));
+ }
+ __node_pointer __get_unsafe_node_pointer() const {
+ return static_cast<__node_pointer>(
+ static_cast<__void_pointer>(__ptr_));
+ }
_LIBCPP_INLINE_VISIBILITY
- explicit __forward_list_const_iterator(__node_const_pointer __p) _NOEXCEPT
- : __ptr_(__p) {}
+ explicit __forward_list_const_iterator(nullptr_t) _NOEXCEPT
+ : __ptr_(nullptr) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __forward_list_const_iterator(__begin_node_pointer __p) _NOEXCEPT
+ : __ptr_(__traits::__as_iter_node(__p)) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit __forward_list_const_iterator(__node_pointer __p) _NOEXCEPT
+ : __ptr_(__traits::__as_iter_node(__p)) {}
- typedef typename remove_const
- <
- typename pointer_traits<__node_const_pointer>::element_type
- >::type __node;
- typedef typename pointer_traits<__node_const_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<__node>
-#else
- rebind<__node>::other
-#endif
- __node_pointer;
template<class, class> friend class forward_list;
public:
typedef forward_iterator_tag iterator_category;
- typedef typename __node::value_type value_type;
+ typedef typename __traits::__node_value_type value_type;
typedef const value_type& reference;
- typedef typename pointer_traits<__node_const_pointer>::difference_type
+ typedef typename pointer_traits<__node_pointer>::difference_type
difference_type;
- typedef typename pointer_traits<__node_const_pointer>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
+ typedef typename __rebind_pointer<__node_pointer, const value_type>::type
pointer;
_LIBCPP_INLINE_VISIBILITY
@@ -326,14 +402,15 @@ public:
: __ptr_(__p.__ptr_) {}
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const {return __ptr_->__value_;}
+ reference operator*() const {return __get_unsafe_node_pointer()->__value_;}
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const {return pointer_traits<pointer>::pointer_to(__ptr_->__value_);}
+ pointer operator->() const {return pointer_traits<pointer>::pointer_to(
+ __get_unsafe_node_pointer()->__value_);}
_LIBCPP_INLINE_VISIBILITY
__forward_list_const_iterator& operator++()
{
- __ptr_ = __ptr_->__next_;
+ __ptr_ = __traits::__as_iter_node(__ptr_->__next_);
return *this;
}
_LIBCPP_INLINE_VISIBILITY
@@ -367,21 +444,21 @@ protected:
typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>, __node>::type __node_allocator;
typedef allocator_traits<__node_allocator> __node_traits;
typedef typename __node_traits::pointer __node_pointer;
- typedef typename __node_traits::pointer __node_const_pointer;
- typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>, __begin_node>::type __begin_node_allocator;
- typedef typename allocator_traits<__begin_node_allocator>::pointer __begin_node_pointer;
+ typedef typename __rebind_alloc_helper<
+ allocator_traits<allocator_type>, __begin_node
+ >::type __begin_node_allocator;
+ typedef typename allocator_traits<__begin_node_allocator>::pointer
+ __begin_node_pointer;
__compressed_pair<__begin_node, __node_allocator> __before_begin_;
_LIBCPP_INLINE_VISIBILITY
- __node_pointer __before_begin() _NOEXCEPT
- {return static_cast<__node_pointer>(pointer_traits<__begin_node_pointer>::
- pointer_to(__before_begin_.first()));}
+ __begin_node_pointer __before_begin() _NOEXCEPT
+ {return pointer_traits<__begin_node_pointer>::pointer_to(__before_begin_.first());}
_LIBCPP_INLINE_VISIBILITY
- __node_const_pointer __before_begin() const _NOEXCEPT
- {return static_cast<__node_const_pointer>(pointer_traits<__begin_node_pointer>::
- pointer_to(const_cast<__begin_node&>(__before_begin_.first())));}
+ __begin_node_pointer __before_begin() const _NOEXCEPT
+ {return pointer_traits<__begin_node_pointer>::pointer_to(const_cast<__begin_node&>(__before_begin_.first()));}
_LIBCPP_INLINE_VISIBILITY
__node_allocator& __alloc() _NOEXCEPT
@@ -401,12 +478,14 @@ protected:
__forward_list_base(const allocator_type& __a)
: __before_begin_(__begin_node(), __node_allocator(__a)) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
public:
+ _LIBCPP_INLINE_VISIBILITY
__forward_list_base(__forward_list_base&& __x)
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
+ _LIBCPP_INLINE_VISIBILITY
__forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
private:
__forward_list_base(const __forward_list_base&);
@@ -429,6 +508,7 @@ protected:
__node_traits::propagate_on_container_move_assignment::value>());}
public:
+ _LIBCPP_INLINE_VISIBILITY
void swap(__forward_list_base& __x)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
@@ -451,7 +531,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__forward_list_base& __x, false_type) _NOEXCEPT
+ void __move_assign_alloc(__forward_list_base&, false_type) _NOEXCEPT
{}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__forward_list_base& __x, true_type)
@@ -459,10 +539,10 @@ private:
{__alloc() = _VSTD::move(__x.__alloc());}
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x)
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
: __before_begin_(_VSTD::move(__x.__before_begin_))
@@ -471,7 +551,7 @@ __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x)
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x,
const allocator_type& __a)
: __before_begin_(__begin_node(), __node_allocator(__a))
@@ -483,7 +563,7 @@ __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x,
}
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
__forward_list_base<_Tp, _Alloc>::~__forward_list_base()
@@ -492,7 +572,7 @@ __forward_list_base<_Tp, _Alloc>::~__forward_list_base()
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
__forward_list_base<_Tp, _Alloc>::swap(__forward_list_base& __x)
#if _LIBCPP_STD_VER >= 14
@@ -524,14 +604,15 @@ __forward_list_base<_Tp, _Alloc>::clear() _NOEXCEPT
}
template <class _Tp, class _Alloc /*= allocator<_Tp>*/>
-class _LIBCPP_TYPE_VIS_ONLY forward_list
+class _LIBCPP_TEMPLATE_VIS forward_list
: private __forward_list_base<_Tp, _Alloc>
{
typedef __forward_list_base<_Tp, _Alloc> base;
typedef typename base::__node_allocator __node_allocator;
- typedef typename base::__node __node;
- typedef typename base::__node_traits __node_traits;
- typedef typename base::__node_pointer __node_pointer;
+ typedef typename base::__node __node;
+ typedef typename base::__node_traits __node_traits;
+ typedef typename base::__node_pointer __node_pointer;
+ typedef typename base::__begin_node_pointer __begin_node_pointer;
public:
typedef _Tp value_type;
@@ -554,6 +635,7 @@ public:
forward_list()
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
{} // = default;
+ _LIBCPP_INLINE_VISIBILITY
explicit forward_list(const allocator_type& __a);
explicit forward_list(size_type __n);
#if _LIBCPP_STD_VER > 11
@@ -574,30 +656,33 @@ public:
>::type* = nullptr);
forward_list(const forward_list& __x);
forward_list(const forward_list& __x, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+ forward_list& operator=(const forward_list& __x);
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
forward_list(forward_list&& __x)
_NOEXCEPT_(is_nothrow_move_constructible<base>::value)
: base(_VSTD::move(__x)) {}
forward_list(forward_list&& __x, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
forward_list(initializer_list<value_type> __il);
forward_list(initializer_list<value_type> __il, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- // ~forward_list() = default;
-
- forward_list& operator=(const forward_list& __x);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
forward_list& operator=(forward_list&& __x)
_NOEXCEPT_(
__node_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<allocator_type>::value);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+ _LIBCPP_INLINE_VISIBILITY
forward_list& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(initializer_list<value_type> __il);
+#endif // _LIBCPP_CXX03_LANG
+
+ // ~forward_list() = default;
template <class _InputIterator>
typename enable_if
@@ -607,9 +692,6 @@ public:
>::type
assign(_InputIterator __f, _InputIterator __l);
void assign(size_type __n, const value_type& __v);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- void assign(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
@@ -649,31 +731,37 @@ public:
bool empty() const _NOEXCEPT
{return base::__before_begin()->__next_ == nullptr;}
_LIBCPP_INLINE_VISIBILITY
- size_type max_size() const _NOEXCEPT
- {return numeric_limits<size_type>::max();}
+ size_type max_size() const _NOEXCEPT {
+ return std::min<size_type>(
+ __node_traits::max_size(base::__alloc()),
+ numeric_limits<difference_type>::max());
+ }
_LIBCPP_INLINE_VISIBILITY
reference front() {return base::__before_begin()->__next_->__value_;}
_LIBCPP_INLINE_VISIBILITY
const_reference front() const {return base::__before_begin()->__next_->__value_;}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class... _Args> void emplace_front(_Args&&... __args);
+#ifndef _LIBCPP_CXX03_LANG
+#if _LIBCPP_STD_VER > 14
+ template <class... _Args> reference emplace_front(_Args&&... __args);
+#else
+ template <class... _Args> void emplace_front(_Args&&... __args);
#endif
void push_front(value_type&& __v);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
void push_front(const value_type& __v);
void pop_front();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
iterator emplace_after(const_iterator __p, _Args&&... __args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
+
iterator insert_after(const_iterator __p, value_type&& __v);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
+ {return insert_after(__p, __il.begin(), __il.end());}
+#endif // _LIBCPP_CXX03_LANG
iterator insert_after(const_iterator __p, const value_type& __v);
iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIterator>
@@ -684,10 +772,6 @@ public:
iterator
>::type
insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
- {return insert_after(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
iterator erase_after(const_iterator __p);
iterator erase_after(const_iterator __f, const_iterator __l);
@@ -707,7 +791,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void clear() _NOEXCEPT {base::clear();}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void splice_after(const_iterator __p, forward_list&& __x);
_LIBCPP_INLINE_VISIBILITY
@@ -715,7 +799,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void splice_after(const_iterator __p, forward_list&& __x,
const_iterator __f, const_iterator __l);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
void splice_after(const_iterator __p, forward_list& __x);
void splice_after(const_iterator __p, forward_list& __x, const_iterator __i);
void splice_after(const_iterator __p, forward_list& __x,
@@ -725,29 +809,29 @@ public:
_LIBCPP_INLINE_VISIBILITY
void unique() {unique(__equal_to<value_type>());}
template <class _BinaryPredicate> void unique(_BinaryPredicate __binary_pred);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void merge(forward_list&& __x) {merge(__x, __less<value_type>());}
template <class _Compare>
_LIBCPP_INLINE_VISIBILITY
void merge(forward_list&& __x, _Compare __comp)
{merge(__x, _VSTD::move(__comp));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void merge(forward_list& __x) {merge(__x, __less<value_type>());}
template <class _Compare> void merge(forward_list& __x, _Compare __comp);
_LIBCPP_INLINE_VISIBILITY
void sort() {sort(__less<value_type>());}
- template <class _Compare> void sort(_Compare __comp);
+ template <class _Compare> _LIBCPP_INLINE_VISIBILITY void sort(_Compare __comp);
void reverse() _NOEXCEPT;
private:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
void __move_assign(forward_list& __x, true_type)
_NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
void __move_assign(forward_list& __x, false_type);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Compare>
static
@@ -761,7 +845,7 @@ private:
};
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
forward_list<_Tp, _Alloc>::forward_list(const allocator_type& __a)
: base(__a)
{
@@ -775,8 +859,8 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n)
__node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1));
- for (__node_pointer __p = base::__before_begin(); __n > 0; --__n,
- __p = __p->__next_)
+ for (__begin_node_pointer __p = base::__before_begin(); __n > 0; --__n,
+ __p = __p->__next_as_begin())
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_));
@@ -788,16 +872,17 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n)
#if _LIBCPP_STD_VER > 11
template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>::forward_list(size_type __n, const allocator_type& __a)
- : base ( __a )
+forward_list<_Tp, _Alloc>::forward_list(size_type __n,
+ const allocator_type& __base_alloc)
+ : base ( __base_alloc )
{
if (__n > 0)
{
__node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1));
- for (__node_pointer __p = base::__before_begin(); __n > 0; --__n,
- __p = __p->__next_)
+ for (__begin_node_pointer __p = base::__before_begin(); __n > 0; --__n,
+ __p = __p->__next_as_begin())
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_));
@@ -862,8 +947,19 @@ forward_list<_Tp, _Alloc>::forward_list(const forward_list& __x,
insert_after(cbefore_begin(), __x.begin(), __x.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+template <class _Tp, class _Alloc>
+forward_list<_Tp, _Alloc>&
+forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
+{
+ if (this != &__x)
+ {
+ base::__copy_assign_alloc(__x);
+ assign(__x.begin(), __x.end());
+ }
+ return *this;
+}
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
const allocator_type& __a)
@@ -876,10 +972,6 @@ forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
}
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il)
{
@@ -894,22 +986,6 @@ forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il,
insert_after(cbefore_begin(), __il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>&
-forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
-{
- if (this != &__x)
- {
- base::__copy_assign_alloc(__x);
- assign(__x.begin(), __x.end());
- }
- return *this;
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, true_type)
@@ -935,7 +1011,7 @@ forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, false_type)
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
forward_list<_Tp, _Alloc>&
forward_list<_Tp, _Alloc>::operator=(forward_list&& __x)
_NOEXCEPT_(
@@ -947,12 +1023,8 @@ forward_list<_Tp, _Alloc>::operator=(forward_list&& __x)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
forward_list<_Tp, _Alloc>&
forward_list<_Tp, _Alloc>::operator=(initializer_list<value_type> __il)
{
@@ -960,7 +1032,7 @@ forward_list<_Tp, _Alloc>::operator=(initializer_list<value_type> __il)
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
template <class _InputIterator>
@@ -997,24 +1069,23 @@ forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
erase_after(__i, __e);
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
{
assign(__il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Alloc>
template <class... _Args>
+#if _LIBCPP_STD_VER > 14
+typename forward_list<_Tp, _Alloc>::reference
+#else
void
+#endif
forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
{
__node_allocator& __a = base::__alloc();
@@ -1024,10 +1095,11 @@ forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
_VSTD::forward<_Args>(__args)...);
__h->__next_ = base::__before_begin()->__next_;
base::__before_begin()->__next_ = __h.release();
+#if _LIBCPP_STD_VER > 14
+ return base::__before_begin()->__next_->__value_;
+#endif
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
@@ -1040,7 +1112,7 @@ forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
base::__before_begin()->__next_ = __h.release();
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
void
@@ -1065,15 +1137,14 @@ forward_list<_Tp, _Alloc>::pop_front()
__node_traits::deallocate(__a, __p, 1);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
template <class... _Args>
typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args)
{
- __node_pointer const __r = __p.__ptr_;
+ __begin_node_pointer const __r = __p.__get_begin();
__node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
@@ -1084,13 +1155,11 @@ forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args)
return iterator(__r->__next_);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Alloc>
typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
{
- __node_pointer const __r = __p.__ptr_;
+ __begin_node_pointer const __r = __p.__get_begin();
__node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
@@ -1100,13 +1169,13 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
return iterator(__r->__next_);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, const value_type& __v)
{
- __node_pointer const __r = __p.__ptr_;
+ __begin_node_pointer const __r = __p.__get_begin();
__node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1));
@@ -1121,7 +1190,7 @@ typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
const value_type& __v)
{
- __node_pointer __r = __p.__ptr_;
+ __begin_node_pointer __r = __p.__get_begin();
if (__n > 0)
{
__node_allocator& __a = base::__alloc();
@@ -1156,7 +1225,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n,
#endif // _LIBCPP_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
- __r = __last;
+ __r = static_cast<__begin_node_pointer>(__last);
}
return iterator(__r);
}
@@ -1171,7 +1240,7 @@ typename enable_if
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
_InputIterator __f, _InputIterator __l)
{
- __node_pointer __r = __p.__ptr_;
+ __begin_node_pointer __r = __p.__get_begin();
if (__f != __l)
{
__node_allocator& __a = base::__alloc();
@@ -1206,7 +1275,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p,
#endif // _LIBCPP_NO_EXCEPTIONS
__last->__next_ = __r->__next_;
__r->__next_ = __first;
- __r = __last;
+ __r = static_cast<__begin_node_pointer>(__last);
}
return iterator(__r);
}
@@ -1215,7 +1284,7 @@ template <class _Tp, class _Alloc>
typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::erase_after(const_iterator __f)
{
- __node_pointer __p = __f.__ptr_;
+ __begin_node_pointer __p = __f.__get_begin();
__node_pointer __n = __p->__next_;
__p->__next_ = __n->__next_;
__node_allocator& __a = base::__alloc();
@@ -1228,21 +1297,22 @@ template <class _Tp, class _Alloc>
typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::erase_after(const_iterator __f, const_iterator __l)
{
- __node_pointer __e = __l.__ptr_;
+ __node_pointer __e = __l.__get_unsafe_node_pointer();
if (__f != __l)
{
- __node_pointer __p = __f.__ptr_;
- __node_pointer __n = __p->__next_;
+ __begin_node_pointer __bp = __f.__get_begin();
+
+ __node_pointer __n = __bp->__next_;
if (__n != __e)
{
- __p->__next_ = __e;
+ __bp->__next_ = __e;
__node_allocator& __a = base::__alloc();
do
{
- __p = __n->__next_;
+ __node_pointer __tmp = __n->__next_;
__node_traits::destroy(__a, _VSTD::addressof(__n->__value_));
__node_traits::deallocate(__a, __n, 1);
- __n = __p;
+ __n = __tmp;
} while (__n != __e);
}
}
@@ -1269,8 +1339,8 @@ forward_list<_Tp, _Alloc>::resize(size_type __n)
__node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1));
- for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n,
- __ptr = __ptr->__next_)
+ for (__begin_node_pointer __ptr = __p.__get_begin(); __n > 0; --__n,
+ __ptr = __ptr->__next_as_begin())
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_));
@@ -1301,8 +1371,8 @@ forward_list<_Tp, _Alloc>::resize(size_type __n, const value_type& __v)
__node_allocator& __a = base::__alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1));
- for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n,
- __ptr = __ptr->__next_)
+ for (__begin_node_pointer __ptr = __p.__get_begin(); __n > 0; --__n,
+ __ptr = __ptr->__next_as_begin())
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v);
@@ -1320,14 +1390,14 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
{
if (!__x.empty())
{
- if (__p.__ptr_->__next_ != nullptr)
+ if (__p.__get_begin()->__next_ != nullptr)
{
const_iterator __lm1 = __x.before_begin();
- while (__lm1.__ptr_->__next_ != nullptr)
+ while (__lm1.__get_begin()->__next_ != nullptr)
++__lm1;
- __lm1.__ptr_->__next_ = __p.__ptr_->__next_;
+ __lm1.__get_begin()->__next_ = __p.__get_begin()->__next_;
}
- __p.__ptr_->__next_ = __x.__before_begin()->__next_;
+ __p.__get_begin()->__next_ = __x.__before_begin()->__next_;
__x.__before_begin()->__next_ = nullptr;
}
}
@@ -1335,39 +1405,39 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
- forward_list& __x,
+ forward_list& /*__other*/,
const_iterator __i)
{
const_iterator __lm1 = _VSTD::next(__i);
if (__p != __i && __p != __lm1)
{
- __i.__ptr_->__next_ = __lm1.__ptr_->__next_;
- __lm1.__ptr_->__next_ = __p.__ptr_->__next_;
- __p.__ptr_->__next_ = __lm1.__ptr_;
+ __i.__get_begin()->__next_ = __lm1.__get_begin()->__next_;
+ __lm1.__get_begin()->__next_ = __p.__get_begin()->__next_;
+ __p.__get_begin()->__next_ = __lm1.__get_unsafe_node_pointer();
}
}
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
- forward_list& __x,
+ forward_list& /*__other*/,
const_iterator __f, const_iterator __l)
{
if (__f != __l && __p != __f)
{
const_iterator __lm1 = __f;
- while (__lm1.__ptr_->__next_ != __l.__ptr_)
+ while (__lm1.__get_begin()->__next_ != __l.__get_begin())
++__lm1;
if (__f != __lm1)
{
- __lm1.__ptr_->__next_ = __p.__ptr_->__next_;
- __p.__ptr_->__next_ = __f.__ptr_->__next_;
- __f.__ptr_->__next_ = __l.__ptr_;
+ __lm1.__get_begin()->__next_ = __p.__get_begin()->__next_;
+ __p.__get_begin()->__next_ = __f.__get_begin()->__next_;
+ __f.__get_begin()->__next_ = __l.__get_unsafe_node_pointer();
}
}
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1398,7 +1468,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
splice_after(__p, __x, __f, __l);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
void
@@ -1406,9 +1476,9 @@ forward_list<_Tp, _Alloc>::remove(const value_type& __v)
{
forward_list<_Tp, _Alloc> __deleted_nodes; // collect the nodes we're removing
iterator __e = end();
- for (iterator __i = before_begin(); __i.__ptr_->__next_ != nullptr;)
+ for (iterator __i = before_begin(); __i.__get_begin()->__next_ != nullptr;)
{
- if (__i.__ptr_->__next_->__value_ == __v)
+ if (__i.__get_begin()->__next_->__value_ == __v)
{
iterator __j = _VSTD::next(__i, 2);
for (; __j != __e && *__j == __v; ++__j)
@@ -1429,9 +1499,9 @@ void
forward_list<_Tp, _Alloc>::remove_if(_Predicate __pred)
{
iterator __e = end();
- for (iterator __i = before_begin(); __i.__ptr_->__next_ != nullptr;)
+ for (iterator __i = before_begin(); __i.__get_begin()->__next_ != nullptr;)
{
- if (__pred(__i.__ptr_->__next_->__value_))
+ if (__pred(__i.__get_begin()->__next_->__value_))
{
iterator __j = _VSTD::next(__i, 2);
for (; __j != __e && __pred(*__j); ++__j)
@@ -1456,7 +1526,7 @@ forward_list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred)
iterator __j = _VSTD::next(__i);
for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
;
- if (__i.__ptr_->__next_ != __j.__ptr_)
+ if (__i.__get_begin()->__next_ != __j.__get_unsafe_node_pointer())
erase_after(__i, __j);
__i = __j;
}
@@ -1523,7 +1593,7 @@ forward_list<_Tp, _Alloc>::__merge(__node_pointer __f1, __node_pointer __f2,
template <class _Tp, class _Alloc>
template <class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
forward_list<_Tp, _Alloc>::sort(_Compare __comp)
{
@@ -1554,7 +1624,7 @@ forward_list<_Tp, _Alloc>::__sort(__node_pointer __f1, difference_type __sz,
}
difference_type __sz1 = __sz / 2;
difference_type __sz2 = __sz - __sz1;
- __node_pointer __t = _VSTD::next(iterator(__f1), __sz1 - 1).__ptr_;
+ __node_pointer __t = _VSTD::next(iterator(__f1), __sz1 - 1).__get_unsafe_node_pointer();
__node_pointer __f2 = __t->__next_;
__t->__next_ = nullptr;
return __merge(__sort(__f1, __sz1, __comp),
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/fstream b/chromium/buildtools/third_party/libc++/trunk/include/fstream
index 1f289eddc56..5ec42bd1340 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/fstream
+++ b/chromium/buildtools/third_party/libc++/trunk/include/fstream
@@ -180,7 +180,7 @@ typedef basic_fstream<wchar_t> wfstream;
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_filebuf
+class _LIBCPP_TEMPLATE_VIS basic_filebuf
: public basic_streambuf<_CharT, _Traits>
{
public:
@@ -193,21 +193,24 @@ public:
// 27.9.1.2 Constructors/destructor:
basic_filebuf();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
basic_filebuf(basic_filebuf&& __rhs);
#endif
virtual ~basic_filebuf();
// 27.9.1.3 Assign/swap:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
basic_filebuf& operator=(basic_filebuf&& __rhs);
#endif
void swap(basic_filebuf& __rhs);
// 27.9.1.4 Members:
+ _LIBCPP_INLINE_VISIBILITY
bool is_open() const;
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
basic_filebuf* open(const char* __s, ios_base::openmode __mode);
+ _LIBCPP_INLINE_VISIBILITY
basic_filebuf* open(const string& __s, ios_base::openmode __mode);
#endif
basic_filebuf* close();
@@ -273,7 +276,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf()
setbuf(0, 4096);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
@@ -340,7 +343,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_filebuf<_CharT, _Traits>&
basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
{
@@ -349,7 +352,7 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
basic_filebuf<_CharT, _Traits>::~basic_filebuf()
@@ -458,7 +461,7 @@ swap(basic_filebuf<_CharT, _Traits>& __x, basic_filebuf<_CharT, _Traits>& __y)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
basic_filebuf<_CharT, _Traits>::is_open() const
{
@@ -547,7 +550,7 @@ basic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_filebuf<_CharT, _Traits>*
basic_filebuf<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mode)
{
@@ -603,7 +606,9 @@ basic_filebuf<_CharT, _Traits>::underflow()
}
else
{
- memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
+ _LIBCPP_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
+ if (__extbufend_ != __extbufnext_)
+ memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
size_t __nmemb = _VSTD::min(static_cast<size_t>(__ibs_ - __unget_sz),
@@ -613,10 +618,9 @@ basic_filebuf<_CharT, _Traits>::underflow()
size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_);
if (__nr != 0)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__cv_)
- throw bad_cast();
-#endif
+ __throw_bad_cast();
+
__extbufend_ = __extbufnext_ + __nr;
char_type* __inext;
__r = __cv_->in(__st_, __extbuf_, __extbufend_, __extbufnext_,
@@ -695,10 +699,9 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
codecvt_base::result __r;
do
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__cv_)
- throw bad_cast();
-#endif
+ __throw_bad_cast();
+
const char_type* __e;
__r = __cv_->out(__st_, this->pbase(), this->pptr(), __e,
__extbuf_, __extbuf_ + __ebs_, __extbe);
@@ -788,10 +791,9 @@ typename basic_filebuf<_CharT, _Traits>::pos_type
basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode)
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__cv_)
- throw bad_cast();
-#endif
+ __throw_bad_cast();
+
int __width = __cv_->encoding();
if (__file_ == 0 || (__width <= 0 && __off != 0) || sync())
return pos_type(off_type(-1));
@@ -811,7 +813,7 @@ basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
default:
return pos_type(off_type(-1));
}
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))
return pos_type(off_type(-1));
pos_type __r = ftell(__file_);
@@ -830,7 +832,7 @@ basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
{
if (__file_ == 0 || sync())
return pos_type(off_type(-1));
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, __sp, SEEK_SET))
return pos_type(off_type(-1));
#else
@@ -847,10 +849,9 @@ basic_filebuf<_CharT, _Traits>::sync()
{
if (__file_ == 0)
return 0;
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (!__cv_)
- throw bad_cast();
-#endif
+ __throw_bad_cast();
+
if (__cm_ & ios_base::out)
{
if (this->pptr() != this->pbase())
@@ -895,7 +896,7 @@ basic_filebuf<_CharT, _Traits>::sync()
}
}
}
-#if defined(_WIN32) || defined(_NEWLIB_VERSION)
+#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
if (fseek(__file_, -__c, SEEK_CUR))
return -1;
#else
@@ -998,7 +999,7 @@ basic_filebuf<_CharT, _Traits>::__write_mode()
// basic_ifstream
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_ifstream
+class _LIBCPP_TEMPLATE_VIS basic_ifstream
: public basic_istream<_CharT, _Traits>
{
public:
@@ -1008,26 +1009,33 @@ public:
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
+ _LIBCPP_INLINE_VISIBILITY
basic_ifstream();
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in);
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
basic_ifstream(basic_ifstream&& __rhs);
-#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
basic_ifstream& operator=(basic_ifstream&& __rhs);
#endif
+ _LIBCPP_INLINE_VISIBILITY
void swap(basic_ifstream& __rhs);
+ _LIBCPP_INLINE_VISIBILITY
basic_filebuf<char_type, traits_type>* rdbuf() const;
+ _LIBCPP_INLINE_VISIBILITY
bool is_open() const;
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
void open(const char* __s, ios_base::openmode __mode = ios_base::in);
void open(const string& __s, ios_base::openmode __mode = ios_base::in);
#endif
+ _LIBCPP_INLINE_VISIBILITY
void close();
private:
@@ -1035,7 +1043,7 @@ private:
};
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ifstream<_CharT, _Traits>::basic_ifstream()
: basic_istream<char_type, traits_type>(&__sb_)
{
@@ -1043,7 +1051,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream()
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openmode __mode)
: basic_istream<char_type, traits_type>(&__sb_)
{
@@ -1052,7 +1060,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openm
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::openmode __mode)
: basic_istream<char_type, traits_type>(&__sb_)
{
@@ -1061,10 +1069,10 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::ope
}
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ifstream<_CharT, _Traits>::basic_ifstream(basic_ifstream&& __rhs)
: basic_istream<char_type, traits_type>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -1073,7 +1081,7 @@ basic_ifstream<_CharT, _Traits>::basic_ifstream(basic_ifstream&& __rhs)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ifstream<_CharT, _Traits>&
basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs)
{
@@ -1082,10 +1090,10 @@ basic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_ifstream<_CharT, _Traits>::swap(basic_ifstream& __rhs)
{
@@ -1102,7 +1110,7 @@ swap(basic_ifstream<_CharT, _Traits>& __x, basic_ifstream<_CharT, _Traits>& __y)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_filebuf<_CharT, _Traits>*
basic_ifstream<_CharT, _Traits>::rdbuf() const
{
@@ -1110,7 +1118,7 @@ basic_ifstream<_CharT, _Traits>::rdbuf() const
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
basic_ifstream<_CharT, _Traits>::is_open() const
{
@@ -1140,7 +1148,7 @@ basic_ifstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mo
#endif
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_ifstream<_CharT, _Traits>::close()
{
@@ -1151,7 +1159,7 @@ basic_ifstream<_CharT, _Traits>::close()
// basic_ofstream
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_ofstream
+class _LIBCPP_TEMPLATE_VIS basic_ofstream
: public basic_ostream<_CharT, _Traits>
{
public:
@@ -1161,24 +1169,31 @@ public:
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
+ _LIBCPP_INLINE_VISIBILITY
basic_ofstream();
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
basic_ofstream(basic_ofstream&& __rhs);
-#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
basic_ofstream& operator=(basic_ofstream&& __rhs);
#endif
+ _LIBCPP_INLINE_VISIBILITY
void swap(basic_ofstream& __rhs);
+ _LIBCPP_INLINE_VISIBILITY
basic_filebuf<char_type, traits_type>* rdbuf() const;
+ _LIBCPP_INLINE_VISIBILITY
bool is_open() const;
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
void open(const char* __s, ios_base::openmode __mode = ios_base::out);
void open(const string& __s, ios_base::openmode __mode = ios_base::out);
#endif
+ _LIBCPP_INLINE_VISIBILITY
void close();
private:
@@ -1186,7 +1201,7 @@ private:
};
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ofstream<_CharT, _Traits>::basic_ofstream()
: basic_ostream<char_type, traits_type>(&__sb_)
{
@@ -1194,7 +1209,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream()
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openmode __mode)
: basic_ostream<char_type, traits_type>(&__sb_)
{
@@ -1203,7 +1218,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openm
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::openmode __mode)
: basic_ostream<char_type, traits_type>(&__sb_)
{
@@ -1212,10 +1227,10 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::ope
}
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ofstream<_CharT, _Traits>::basic_ofstream(basic_ofstream&& __rhs)
: basic_ostream<char_type, traits_type>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -1224,7 +1239,7 @@ basic_ofstream<_CharT, _Traits>::basic_ofstream(basic_ofstream&& __rhs)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_ofstream<_CharT, _Traits>&
basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs)
{
@@ -1233,10 +1248,10 @@ basic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_ofstream<_CharT, _Traits>::swap(basic_ofstream& __rhs)
{
@@ -1253,7 +1268,7 @@ swap(basic_ofstream<_CharT, _Traits>& __x, basic_ofstream<_CharT, _Traits>& __y)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_filebuf<_CharT, _Traits>*
basic_ofstream<_CharT, _Traits>::rdbuf() const
{
@@ -1261,7 +1276,7 @@ basic_ofstream<_CharT, _Traits>::rdbuf() const
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
basic_ofstream<_CharT, _Traits>::is_open() const
{
@@ -1291,7 +1306,7 @@ basic_ofstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mo
#endif
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_ofstream<_CharT, _Traits>::close()
{
@@ -1302,7 +1317,7 @@ basic_ofstream<_CharT, _Traits>::close()
// basic_fstream
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_fstream
+class _LIBCPP_TEMPLATE_VIS basic_fstream
: public basic_iostream<_CharT, _Traits>
{
public:
@@ -1312,26 +1327,33 @@ public:
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
+ _LIBCPP_INLINE_VISIBILITY
basic_fstream();
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
+ _LIBCPP_INLINE_VISIBILITY
explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
basic_fstream(basic_fstream&& __rhs);
-#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
basic_fstream& operator=(basic_fstream&& __rhs);
#endif
+ _LIBCPP_INLINE_VISIBILITY
void swap(basic_fstream& __rhs);
+ _LIBCPP_INLINE_VISIBILITY
basic_filebuf<char_type, traits_type>* rdbuf() const;
+ _LIBCPP_INLINE_VISIBILITY
bool is_open() const;
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
#endif
+ _LIBCPP_INLINE_VISIBILITY
void close();
private:
@@ -1339,7 +1361,7 @@ private:
};
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_fstream<_CharT, _Traits>::basic_fstream()
: basic_iostream<char_type, traits_type>(&__sb_)
{
@@ -1347,7 +1369,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream()
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmode __mode)
: basic_iostream<char_type, traits_type>(&__sb_)
{
@@ -1356,7 +1378,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmod
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openmode __mode)
: basic_iostream<char_type, traits_type>(&__sb_)
{
@@ -1365,10 +1387,10 @@ basic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openm
}
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_fstream<_CharT, _Traits>::basic_fstream(basic_fstream&& __rhs)
: basic_iostream<char_type, traits_type>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -1377,7 +1399,7 @@ basic_fstream<_CharT, _Traits>::basic_fstream(basic_fstream&& __rhs)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_fstream<_CharT, _Traits>&
basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs)
{
@@ -1386,10 +1408,10 @@ basic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_fstream<_CharT, _Traits>::swap(basic_fstream& __rhs)
{
@@ -1406,7 +1428,7 @@ swap(basic_fstream<_CharT, _Traits>& __x, basic_fstream<_CharT, _Traits>& __y)
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
basic_filebuf<_CharT, _Traits>*
basic_fstream<_CharT, _Traits>::rdbuf() const
{
@@ -1414,7 +1436,7 @@ basic_fstream<_CharT, _Traits>::rdbuf() const
}
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
bool
basic_fstream<_CharT, _Traits>::is_open() const
{
@@ -1444,7 +1466,7 @@ basic_fstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mod
#endif
template <class _CharT, class _Traits>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
basic_fstream<_CharT, _Traits>::close()
{
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/functional b/chromium/buildtools/third_party/libc++/trunk/include/functional
index dbe9b01bbd8..ea35697d3bb 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/functional
+++ b/chromium/buildtools/third_party/libc++/trunk/include/functional
@@ -207,9 +207,18 @@ public:
template <class Predicate> binary_negate<Predicate> not2(const Predicate& pred);
+template <class F> unspecified not_fn(F&& f); // C++17
+
template<class T> struct is_bind_expression;
template<class T> struct is_placeholder;
+ // See C++14 20.9.9, Function object binders
+template <class T> constexpr bool is_bind_expression_v
+ = is_bind_expression<T>::value; // C++17
+template <class T> constexpr int is_placeholder_v
+ = is_placeholder<T>::value; // C++17
+
+
template<class Fn, class... BoundArgs>
unspecified bind(Fn&&, BoundArgs&&...);
template<class R, class Fn, class... BoundArgs>
@@ -226,7 +235,7 @@ namespace placeholders {
}
template <class Operation>
-class binder1st
+class binder1st // deprecated in C++11, removed in C++17
: public unary_function<typename Operation::second_argument_type,
typename Operation::result_type>
{
@@ -240,10 +249,10 @@ public:
};
template <class Operation, class T>
-binder1st<Operation> bind1st(const Operation& op, const T& x);
+binder1st<Operation> bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
template <class Operation>
-class binder2nd
+class binder2nd // deprecated in C++11, removed in C++17
: public unary_function<typename Operation::first_argument_type,
typename Operation::result_type>
{
@@ -257,9 +266,9 @@ public:
};
template <class Operation, class T>
-binder2nd<Operation> bind2nd(const Operation& op, const T& x);
+binder2nd<Operation> bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17
-template <class Arg, class Result>
+template <class Arg, class Result> // deprecated in C++11, removed in C++17
class pointer_to_unary_function : public unary_function<Arg, Result>
{
public:
@@ -268,9 +277,9 @@ public:
};
template <class Arg, class Result>
-pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg));
+pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17
-template <class Arg1, class Arg2, class Result>
+template <class Arg1, class Arg2, class Result> // deprecated in C++11, removed in C++17
class pointer_to_binary_function : public binary_function<Arg1, Arg2, Result>
{
public:
@@ -279,9 +288,9 @@ public:
};
template <class Arg1, class Arg2, class Result>
-pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2));
+pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17
-template<class S, class T>
+template<class S, class T> // deprecated in C++11, removed in C++17
class mem_fun_t : public unary_function<T*, S>
{
public:
@@ -290,18 +299,18 @@ public:
};
template<class S, class T, class A>
-class mem_fun1_t : public binary_function<T*, A, S>
+class mem_fun1_t : public binary_function<T*, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun1_t(S (T::*p)(A));
S operator()(T* p, A x) const;
};
-template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)());
-template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A));
+template<class S, class T> mem_fun_t<S,T> mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17
+template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17
template<class S, class T>
-class mem_fun_ref_t : public unary_function<T, S>
+class mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun_ref_t(S (T::*p)());
@@ -309,18 +318,18 @@ public:
};
template<class S, class T, class A>
-class mem_fun1_ref_t : public binary_function<T, A, S>
+class mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit mem_fun1_ref_t(S (T::*p)(A));
S operator()(T& p, A x) const;
};
-template<class S, class T> mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)());
-template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A));
+template<class S, class T> mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17
+template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17
template <class S, class T>
-class const_mem_fun_t : public unary_function<const T*, S>
+class const_mem_fun_t : public unary_function<const T*, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun_t(S (T::*p)() const);
@@ -328,18 +337,18 @@ public:
};
template <class S, class T, class A>
-class const_mem_fun1_t : public binary_function<const T*, A, S>
+class const_mem_fun1_t : public binary_function<const T*, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun1_t(S (T::*p)(A) const);
S operator()(const T* p, A x) const;
};
-template <class S, class T> const_mem_fun_t<S,T> mem_fun(S (T::*f)() const);
-template <class S, class T, class A> const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const);
+template <class S, class T> const_mem_fun_t<S,T> mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17
+template <class S, class T, class A> const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
template <class S, class T>
-class const_mem_fun_ref_t : public unary_function<T, S>
+class const_mem_fun_ref_t : public unary_function<T, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun_ref_t(S (T::*p)() const);
@@ -347,15 +356,15 @@ public:
};
template <class S, class T, class A>
-class const_mem_fun1_ref_t : public binary_function<T, A, S>
+class const_mem_fun1_ref_t : public binary_function<T, A, S> // deprecated in C++11, removed in C++17
{
public:
explicit const_mem_fun1_ref_t(S (T::*p)(A) const);
S operator()(const T& p, A x) const;
};
-template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const);
-template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const);
+template <class S, class T> const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17
+template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17
template<class R, class T> unspecified mem_fn(R T::*);
@@ -384,15 +393,15 @@ public:
template<class F>
function(F);
template<Allocator Alloc>
- function(allocator_arg_t, const Alloc&) noexcept;
+ function(allocator_arg_t, const Alloc&) noexcept; // removed in C++17
template<Allocator Alloc>
- function(allocator_arg_t, const Alloc&, nullptr_t) noexcept;
+ function(allocator_arg_t, const Alloc&, nullptr_t) noexcept; // removed in C++17
template<Allocator Alloc>
- function(allocator_arg_t, const Alloc&, const function&);
+ function(allocator_arg_t, const Alloc&, const function&); // removed in C++17
template<Allocator Alloc>
- function(allocator_arg_t, const Alloc&, function&&);
+ function(allocator_arg_t, const Alloc&, function&&); // removed in C++17
template<class F, Allocator Alloc>
- function(allocator_arg_t, const Alloc&, F);
+ function(allocator_arg_t, const Alloc&, F); // removed in C++17
function& operator=(const function&);
function& operator=(function&&) noexcept;
@@ -407,7 +416,7 @@ public:
// function modifiers:
void swap(function&) noexcept;
template<class F, class Alloc>
- void assign(F&&, const Alloc&);
+ void assign(F&&, const Alloc&); // Removed in C++17
// function capacity:
explicit operator bool() const noexcept;
@@ -461,6 +470,7 @@ template <> struct hash<double>;
template <> struct hash<long double>;
template<class T> struct hash<T*>;
+template <> struct hash<nullptr_t>; // C++17
} // std
@@ -476,6 +486,7 @@ POLICY: For non-variadic implementations, the number of arguments is limited
#include <exception>
#include <memory>
#include <tuple>
+#include <utility>
#include <__functional_base>
@@ -490,7 +501,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY plus : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS plus : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
@@ -499,7 +510,7 @@ struct _LIBCPP_TYPE_VIS_ONLY plus : binary_function<_Tp, _Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY plus<void>
+struct _LIBCPP_TEMPLATE_VIS plus<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -517,7 +528,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY minus : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS minus : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
@@ -526,7 +537,7 @@ struct _LIBCPP_TYPE_VIS_ONLY minus : binary_function<_Tp, _Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY minus<void>
+struct _LIBCPP_TEMPLATE_VIS minus<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -544,7 +555,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY multiplies : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS multiplies : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
@@ -553,7 +564,7 @@ struct _LIBCPP_TYPE_VIS_ONLY multiplies : binary_function<_Tp, _Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY multiplies<void>
+struct _LIBCPP_TEMPLATE_VIS multiplies<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -571,7 +582,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY divides : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS divides : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
@@ -580,7 +591,7 @@ struct _LIBCPP_TYPE_VIS_ONLY divides : binary_function<_Tp, _Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY divides<void>
+struct _LIBCPP_TEMPLATE_VIS divides<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -598,7 +609,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY modulus : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS modulus : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
@@ -607,7 +618,7 @@ struct _LIBCPP_TYPE_VIS_ONLY modulus : binary_function<_Tp, _Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY modulus<void>
+struct _LIBCPP_TEMPLATE_VIS modulus<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -625,7 +636,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY negate : unary_function<_Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS negate : unary_function<_Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
@@ -634,7 +645,7 @@ struct _LIBCPP_TYPE_VIS_ONLY negate : unary_function<_Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY negate<void>
+struct _LIBCPP_TEMPLATE_VIS negate<void>
{
template <class _Tp>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -652,7 +663,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY equal_to : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS equal_to : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
@@ -661,7 +672,7 @@ struct _LIBCPP_TYPE_VIS_ONLY equal_to : binary_function<_Tp, _Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY equal_to<void>
+struct _LIBCPP_TEMPLATE_VIS equal_to<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -679,7 +690,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY not_equal_to : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS not_equal_to : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
@@ -688,7 +699,7 @@ struct _LIBCPP_TYPE_VIS_ONLY not_equal_to : binary_function<_Tp, _Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY not_equal_to<void>
+struct _LIBCPP_TEMPLATE_VIS not_equal_to<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -706,7 +717,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY greater : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
@@ -715,7 +726,7 @@ struct _LIBCPP_TYPE_VIS_ONLY greater : binary_function<_Tp, _Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY greater<void>
+struct _LIBCPP_TEMPLATE_VIS greater<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -735,7 +746,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY greater_equal : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
@@ -744,7 +755,7 @@ struct _LIBCPP_TYPE_VIS_ONLY greater_equal : binary_function<_Tp, _Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY greater_equal<void>
+struct _LIBCPP_TEMPLATE_VIS greater_equal<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -762,7 +773,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY less_equal : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS less_equal : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
@@ -771,7 +782,7 @@ struct _LIBCPP_TYPE_VIS_ONLY less_equal : binary_function<_Tp, _Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY less_equal<void>
+struct _LIBCPP_TEMPLATE_VIS less_equal<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -789,7 +800,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY logical_and : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS logical_and : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
@@ -798,7 +809,7 @@ struct _LIBCPP_TYPE_VIS_ONLY logical_and : binary_function<_Tp, _Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY logical_and<void>
+struct _LIBCPP_TEMPLATE_VIS logical_and<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -816,7 +827,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY logical_or : binary_function<_Tp, _Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS logical_or : binary_function<_Tp, _Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
@@ -825,7 +836,7 @@ struct _LIBCPP_TYPE_VIS_ONLY logical_or : binary_function<_Tp, _Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY logical_or<void>
+struct _LIBCPP_TEMPLATE_VIS logical_or<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -843,7 +854,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY logical_not : unary_function<_Tp, bool>
+struct _LIBCPP_TEMPLATE_VIS logical_not : unary_function<_Tp, bool>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x) const
@@ -852,7 +863,7 @@ struct _LIBCPP_TYPE_VIS_ONLY logical_not : unary_function<_Tp, bool>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY logical_not<void>
+struct _LIBCPP_TEMPLATE_VIS logical_not<void>
{
template <class _Tp>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -870,7 +881,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY bit_and : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS bit_and : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
@@ -879,7 +890,7 @@ struct _LIBCPP_TYPE_VIS_ONLY bit_and : binary_function<_Tp, _Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY bit_and<void>
+struct _LIBCPP_TEMPLATE_VIS bit_and<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -897,7 +908,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY bit_or : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS bit_or : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
@@ -906,7 +917,7 @@ struct _LIBCPP_TYPE_VIS_ONLY bit_or : binary_function<_Tp, _Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY bit_or<void>
+struct _LIBCPP_TEMPLATE_VIS bit_or<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -924,7 +935,7 @@ template <class _Tp = void>
#else
template <class _Tp>
#endif
-struct _LIBCPP_TYPE_VIS_ONLY bit_xor : binary_function<_Tp, _Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS bit_xor : binary_function<_Tp, _Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x, const _Tp& __y) const
@@ -933,7 +944,7 @@ struct _LIBCPP_TYPE_VIS_ONLY bit_xor : binary_function<_Tp, _Tp, _Tp>
#if _LIBCPP_STD_VER > 11
template <>
-struct _LIBCPP_TYPE_VIS_ONLY bit_xor<void>
+struct _LIBCPP_TEMPLATE_VIS bit_xor<void>
{
template <class _T1, class _T2>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -948,7 +959,7 @@ struct _LIBCPP_TYPE_VIS_ONLY bit_xor<void>
#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
-struct _LIBCPP_TYPE_VIS_ONLY bit_not : unary_function<_Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS bit_not : unary_function<_Tp, _Tp>
{
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
_Tp operator()(const _Tp& __x) const
@@ -956,7 +967,7 @@ struct _LIBCPP_TYPE_VIS_ONLY bit_not : unary_function<_Tp, _Tp>
};
template <>
-struct _LIBCPP_TYPE_VIS_ONLY bit_not<void>
+struct _LIBCPP_TEMPLATE_VIS bit_not<void>
{
template <class _Tp>
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -969,7 +980,7 @@ struct _LIBCPP_TYPE_VIS_ONLY bit_not<void>
#endif
template <class _Predicate>
-class _LIBCPP_TYPE_VIS_ONLY unary_negate
+class _LIBCPP_TEMPLATE_VIS unary_negate
: public unary_function<typename _Predicate::argument_type, bool>
{
_Predicate __pred_;
@@ -988,7 +999,7 @@ unary_negate<_Predicate>
not1(const _Predicate& __pred) {return unary_negate<_Predicate>(__pred);}
template <class _Predicate>
-class _LIBCPP_TYPE_VIS_ONLY binary_negate
+class _LIBCPP_TEMPLATE_VIS binary_negate
: public binary_function<typename _Predicate::first_argument_type,
typename _Predicate::second_argument_type,
bool>
@@ -1009,8 +1020,9 @@ inline _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
binary_negate<_Predicate>
not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
template <class __Operation>
-class _LIBCPP_TYPE_VIS_ONLY binder1st
+class _LIBCPP_TEMPLATE_VIS binder1st
: public unary_function<typename __Operation::second_argument_type,
typename __Operation::result_type>
{
@@ -1036,7 +1048,7 @@ bind1st(const __Operation& __op, const _Tp& __x)
{return binder1st<__Operation>(__op, __x);}
template <class __Operation>
-class _LIBCPP_TYPE_VIS_ONLY binder2nd
+class _LIBCPP_TEMPLATE_VIS binder2nd
: public unary_function<typename __Operation::first_argument_type,
typename __Operation::result_type>
{
@@ -1062,7 +1074,7 @@ bind2nd(const __Operation& __op, const _Tp& __x)
{return binder2nd<__Operation>(__op, __x);}
template <class _Arg, class _Result>
-class _LIBCPP_TYPE_VIS_ONLY pointer_to_unary_function
+class _LIBCPP_TEMPLATE_VIS pointer_to_unary_function
: public unary_function<_Arg, _Result>
{
_Result (*__f_)(_Arg);
@@ -1080,7 +1092,7 @@ ptr_fun(_Result (*__f)(_Arg))
{return pointer_to_unary_function<_Arg,_Result>(__f);}
template <class _Arg1, class _Arg2, class _Result>
-class _LIBCPP_TYPE_VIS_ONLY pointer_to_binary_function
+class _LIBCPP_TEMPLATE_VIS pointer_to_binary_function
: public binary_function<_Arg1, _Arg2, _Result>
{
_Result (*__f_)(_Arg1, _Arg2);
@@ -1098,7 +1110,7 @@ ptr_fun(_Result (*__f)(_Arg1,_Arg2))
{return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
template<class _Sp, class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY mem_fun_t : public unary_function<_Tp*, _Sp>
+class _LIBCPP_TEMPLATE_VIS mem_fun_t : public unary_function<_Tp*, _Sp>
{
_Sp (_Tp::*__p_)();
public:
@@ -1109,7 +1121,7 @@ public:
};
template<class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TYPE_VIS_ONLY mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
+class _LIBCPP_TEMPLATE_VIS mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
{
_Sp (_Tp::*__p_)(_Ap);
public:
@@ -1132,7 +1144,7 @@ mem_fun(_Sp (_Tp::*__f)(_Ap))
{return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
template<class _Sp, class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY mem_fun_ref_t : public unary_function<_Tp, _Sp>
+class _LIBCPP_TEMPLATE_VIS mem_fun_ref_t : public unary_function<_Tp, _Sp>
{
_Sp (_Tp::*__p_)();
public:
@@ -1143,7 +1155,7 @@ public:
};
template<class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TYPE_VIS_ONLY mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
+class _LIBCPP_TEMPLATE_VIS mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
{
_Sp (_Tp::*__p_)(_Ap);
public:
@@ -1166,7 +1178,7 @@ mem_fun_ref(_Sp (_Tp::*__f)(_Ap))
{return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
template <class _Sp, class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY const_mem_fun_t : public unary_function<const _Tp*, _Sp>
+class _LIBCPP_TEMPLATE_VIS const_mem_fun_t : public unary_function<const _Tp*, _Sp>
{
_Sp (_Tp::*__p_)() const;
public:
@@ -1177,7 +1189,7 @@ public:
};
template <class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TYPE_VIS_ONLY const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
+class _LIBCPP_TEMPLATE_VIS const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
{
_Sp (_Tp::*__p_)(_Ap) const;
public:
@@ -1200,7 +1212,7 @@ mem_fun(_Sp (_Tp::*__f)(_Ap) const)
{return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
template <class _Sp, class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY const_mem_fun_ref_t : public unary_function<_Tp, _Sp>
+class _LIBCPP_TEMPLATE_VIS const_mem_fun_ref_t : public unary_function<_Tp, _Sp>
{
_Sp (_Tp::*__p_)() const;
public:
@@ -1211,7 +1223,7 @@ public:
};
template <class _Sp, class _Tp, class _Ap>
-class _LIBCPP_TYPE_VIS_ONLY const_mem_fun1_ref_t
+class _LIBCPP_TEMPLATE_VIS const_mem_fun1_ref_t
: public binary_function<_Tp, _Ap, _Sp>
{
_Sp (_Tp::*__p_)(_Ap) const;
@@ -1233,6 +1245,7 @@ inline _LIBCPP_INLINE_VISIBILITY
const_mem_fun1_ref_t<_Sp,_Tp,_Ap>
mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const)
{return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
+#endif
////////////////////////////////////////////////////////////////////////////////
// MEMFUN
@@ -1251,7 +1264,7 @@ private:
public:
_LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
// invoke
template <class... _ArgTypes>
_LIBCPP_INLINE_VISIBILITY
@@ -1378,9 +1391,25 @@ mem_fn(_Rp _Tp::* __pm) _NOEXCEPT
class _LIBCPP_EXCEPTION_ABI bad_function_call
: public exception
{
+#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+public:
+ virtual ~bad_function_call() _NOEXCEPT;
+
+ virtual const char* what() const _NOEXCEPT;
+#endif
};
-template<class _Fp> class _LIBCPP_TYPE_VIS_ONLY function; // undefined
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_function_call()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_function_call();
+#else
+ _VSTD::abort();
+#endif
+}
+
+template<class _Fp> class _LIBCPP_TEMPLATE_VIS function; // undefined
namespace __function
{
@@ -1425,7 +1454,7 @@ bool __not_null(function<_Fp> const& __f) { return !!__f; }
} // namespace __function
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
namespace __function {
@@ -1556,7 +1585,7 @@ __func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
} // __function
template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_ArgTypes...)>
+class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
: public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
{
@@ -1564,6 +1593,10 @@ class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_ArgTypes...)>
typename aligned_storage<3*sizeof(void*)>::type __buf_;
__base* __f_;
+ _LIBCPP_NO_CFI static __base *__as_base(void *p) {
+ return reinterpret_cast<__base*>(p);
+ }
+
template <class _Fp, bool = !is_same<_Fp, function>::value &&
__invokable<_Fp&, _ArgTypes...>::value>
struct __callable;
@@ -1589,13 +1622,12 @@ public:
function(nullptr_t) _NOEXCEPT : __f_(0) {}
function(const function&);
function(function&&) _NOEXCEPT;
- template<class _Fp>
- function(_Fp, typename enable_if
- <
- __callable<_Fp>::value &&
- !is_same<_Fp, function>::value
- >::type* = 0);
+ template<class _Fp, class = typename enable_if<
+ __callable<_Fp>::value && !is_same<_Fp, function>::value
+ >::type>
+ function(_Fp);
+#if _LIBCPP_STD_VER <= 14
template<class _Alloc>
_LIBCPP_INLINE_VISIBILITY
function(allocator_arg_t, const _Alloc&) _NOEXCEPT : __f_(0) {}
@@ -1606,9 +1638,9 @@ public:
function(allocator_arg_t, const _Alloc&, const function&);
template<class _Alloc>
function(allocator_arg_t, const _Alloc&, function&&);
- template<class _Fp, class _Alloc>
- function(allocator_arg_t, const _Alloc& __a, _Fp __f,
- typename enable_if<__callable<_Fp>::value>::type* = 0);
+ template<class _Fp, class _Alloc, class = typename enable_if<__callable<_Fp>::value>::type>
+ function(allocator_arg_t, const _Alloc& __a, _Fp __f);
+#endif
function& operator=(const function&);
function& operator=(function&&) _NOEXCEPT;
@@ -1626,10 +1658,13 @@ public:
// function modifiers:
void swap(function&) _NOEXCEPT;
+
+#if _LIBCPP_STD_VER <= 14
template<class _Fp, class _Alloc>
_LIBCPP_INLINE_VISIBILITY
void assign(_Fp&& __f, const _Alloc& __a)
{function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);}
+#endif
// function capacity:
_LIBCPP_INLINE_VISIBILITY
@@ -1657,15 +1692,16 @@ function<_Rp(_ArgTypes...)>::function(const function& __f)
{
if (__f.__f_ == 0)
__f_ = 0;
- else if (__f.__f_ == (const __base*)&__f.__buf_)
+ else if ((void *)__f.__f_ == &__f.__buf_)
{
- __f_ = (__base*)&__buf_;
+ __f_ = __as_base(&__buf_);
__f.__f_->__clone(__f_);
}
else
__f_ = __f.__f_->__clone();
}
+#if _LIBCPP_STD_VER <= 14
template<class _Rp, class ..._ArgTypes>
template <class _Alloc>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
@@ -1673,23 +1709,24 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
{
if (__f.__f_ == 0)
__f_ = 0;
- else if (__f.__f_ == (const __base*)&__f.__buf_)
+ else if ((void *)__f.__f_ == &__f.__buf_)
{
- __f_ = (__base*)&__buf_;
+ __f_ = __as_base(&__buf_);
__f.__f_->__clone(__f_);
}
else
__f_ = __f.__f_->__clone();
}
+#endif
template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
{
if (__f.__f_ == 0)
__f_ = 0;
- else if (__f.__f_ == (__base*)&__f.__buf_)
+ else if ((void *)__f.__f_ == &__f.__buf_)
{
- __f_ = (__base*)&__buf_;
+ __f_ = __as_base(&__buf_);
__f.__f_->__clone(__f_);
}
else
@@ -1699,6 +1736,7 @@ function<_Rp(_ArgTypes...)>::function(function&& __f) _NOEXCEPT
}
}
+#if _LIBCPP_STD_VER <= 14
template<class _Rp, class ..._ArgTypes>
template <class _Alloc>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
@@ -1706,9 +1744,9 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
{
if (__f.__f_ == 0)
__f_ = 0;
- else if (__f.__f_ == (__base*)&__f.__buf_)
+ else if ((void *)__f.__f_ == &__f.__buf_)
{
- __f_ = (__base*)&__buf_;
+ __f_ = __as_base(&__buf_);
__f.__f_->__clone(__f_);
}
else
@@ -1717,15 +1755,11 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
__f.__f_ = 0;
}
}
+#endif
template<class _Rp, class ..._ArgTypes>
-template <class _Fp>
-function<_Rp(_ArgTypes...)>::function(_Fp __f,
- typename enable_if
- <
- __callable<_Fp>::value &&
- !is_same<_Fp, function>::value
- >::type*)
+template <class _Fp, class>
+function<_Rp(_ArgTypes...)>::function(_Fp __f)
: __f_(0)
{
if (__function::__not_null(__f))
@@ -1733,8 +1767,7 @@ function<_Rp(_ArgTypes...)>::function(_Fp __f,
typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value)
{
- __f_ = (__base*)&__buf_;
- ::new (__f_) _FF(_VSTD::move(__f));
+ __f_ = ::new((void*)&__buf_) _FF(_VSTD::move(__f));
}
else
{
@@ -1748,10 +1781,10 @@ function<_Rp(_ArgTypes...)>::function(_Fp __f,
}
}
+#if _LIBCPP_STD_VER <= 14
template<class _Rp, class ..._ArgTypes>
-template <class _Fp, class _Alloc>
-function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
- typename enable_if<__callable<_Fp>::value>::type*)
+template <class _Fp, class _Alloc, class>
+function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f)
: __f_(0)
{
typedef allocator_traits<_Alloc> __alloc_traits;
@@ -1763,8 +1796,7 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp _
if (sizeof(_FF) <= sizeof(__buf_) &&
is_nothrow_copy_constructible<_Fp>::value && is_nothrow_copy_constructible<_Ap>::value)
{
- __f_ = (__base*)&__buf_;
- ::new (__f_) _FF(_VSTD::move(__f), _Alloc(__a));
+ __f_ = ::new((void*)&__buf_) _FF(_VSTD::move(__f), _Alloc(__a));
}
else
{
@@ -1775,6 +1807,7 @@ function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp _
}
}
}
+#endif
template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>&
@@ -1788,16 +1821,16 @@ template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>&
function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
{
- if (__f_ == (__base*)&__buf_)
+ if ((void *)__f_ == &__buf_)
__f_->destroy();
else if (__f_)
__f_->destroy_deallocate();
__f_ = 0;
if (__f.__f_ == 0)
__f_ = 0;
- else if (__f.__f_ == (__base*)&__f.__buf_)
+ else if ((void *)__f.__f_ == &__f.__buf_)
{
- __f_ = (__base*)&__buf_;
+ __f_ = __as_base(&__buf_);
__f.__f_->__clone(__f_);
}
else
@@ -1812,7 +1845,7 @@ template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>&
function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
{
- if (__f_ == (__base*)&__buf_)
+ if ((void *)__f_ == &__buf_)
__f_->destroy();
else if (__f_)
__f_->destroy_deallocate();
@@ -1837,7 +1870,7 @@ function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f)
template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>::~function()
{
- if (__f_ == (__base*)&__buf_)
+ if ((void *)__f_ == &__buf_)
__f_->destroy();
else if (__f_)
__f_->destroy_deallocate();
@@ -1847,34 +1880,36 @@ template<class _Rp, class ..._ArgTypes>
void
function<_Rp(_ArgTypes...)>::swap(function& __f) _NOEXCEPT
{
- if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
+ if (_VSTD::addressof(__f) == this)
+ return;
+ if ((void *)__f_ == &__buf_ && (void *)__f.__f_ == &__f.__buf_)
{
typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
- __base* __t = (__base*)&__tempbuf;
+ __base* __t = __as_base(&__tempbuf);
__f_->__clone(__t);
__f_->destroy();
__f_ = 0;
- __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->__clone(__as_base(&__buf_));
__f.__f_->destroy();
__f.__f_ = 0;
- __f_ = (__base*)&__buf_;
- __t->__clone((__base*)&__f.__buf_);
+ __f_ = __as_base(&__buf_);
+ __t->__clone(__as_base(&__f.__buf_));
__t->destroy();
- __f.__f_ = (__base*)&__f.__buf_;
+ __f.__f_ = __as_base(&__f.__buf_);
}
- else if (__f_ == (__base*)&__buf_)
+ else if ((void *)__f_ == &__buf_)
{
- __f_->__clone((__base*)&__f.__buf_);
+ __f_->__clone(__as_base(&__f.__buf_));
__f_->destroy();
__f_ = __f.__f_;
- __f.__f_ = (__base*)&__f.__buf_;
+ __f.__f_ = __as_base(&__f.__buf_);
}
- else if (__f.__f_ == (__base*)&__f.__buf_)
+ else if ((void *)__f.__f_ == &__f.__buf_)
{
- __f.__f_->__clone((__base*)&__buf_);
+ __f.__f_->__clone(__as_base(&__buf_));
__f.__f_->destroy();
__f.__f_ = __f_;
- __f_ = (__base*)&__buf_;
+ __f_ = __as_base(&__buf_);
}
else
_VSTD::swap(__f_, __f.__f_);
@@ -1884,10 +1919,8 @@ template<class _Rp, class ..._ArgTypes>
_Rp
function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__f_ == 0)
- throw bad_function_call();
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_bad_function_call();
return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...);
}
@@ -1950,7 +1983,7 @@ void
swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
{return __x.swap(__y);}
-#else // _LIBCPP_HAS_NO_VARIADICS
+#else // _LIBCPP_CXX03_LANG
#include <__functional_03>
@@ -1961,28 +1994,51 @@ swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCE
//==============================================================================
template<class _Tp> struct __is_bind_expression : public false_type {};
-template<class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_bind_expression
+template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_bind_expression
: public __is_bind_expression<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
+#endif
+
template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
-template<class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_placeholder
+template<class _Tp> struct _LIBCPP_TEMPLATE_VIS is_placeholder
: public __is_placeholder<typename remove_cv<_Tp>::type> {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_placeholder_v = is_placeholder<_Tp>::value;
+#endif
+
namespace placeholders
{
template <int _Np> struct __ph {};
-_LIBCPP_FUNC_VIS extern __ph<1> _1;
-_LIBCPP_FUNC_VIS extern __ph<2> _2;
-_LIBCPP_FUNC_VIS extern __ph<3> _3;
-_LIBCPP_FUNC_VIS extern __ph<4> _4;
-_LIBCPP_FUNC_VIS extern __ph<5> _5;
-_LIBCPP_FUNC_VIS extern __ph<6> _6;
-_LIBCPP_FUNC_VIS extern __ph<7> _7;
-_LIBCPP_FUNC_VIS extern __ph<8> _8;
-_LIBCPP_FUNC_VIS extern __ph<9> _9;
-_LIBCPP_FUNC_VIS extern __ph<10> _10;
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
+_LIBCPP_FUNC_VIS extern const __ph<1> _1;
+_LIBCPP_FUNC_VIS extern const __ph<2> _2;
+_LIBCPP_FUNC_VIS extern const __ph<3> _3;
+_LIBCPP_FUNC_VIS extern const __ph<4> _4;
+_LIBCPP_FUNC_VIS extern const __ph<5> _5;
+_LIBCPP_FUNC_VIS extern const __ph<6> _6;
+_LIBCPP_FUNC_VIS extern const __ph<7> _7;
+_LIBCPP_FUNC_VIS extern const __ph<8> _8;
+_LIBCPP_FUNC_VIS extern const __ph<9> _9;
+_LIBCPP_FUNC_VIS extern const __ph<10> _10;
+#else
+constexpr __ph<1> _1{};
+constexpr __ph<2> _2{};
+constexpr __ph<3> _3{};
+constexpr __ph<4> _4{};
+constexpr __ph<5> _5{};
+constexpr __ph<6> _6{};
+constexpr __ph<7> _7{};
+constexpr __ph<8> _8{};
+constexpr __ph<9> _9{};
+constexpr __ph<10> _10{};
+#endif // defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_BIND)
} // placeholders
@@ -1991,7 +2047,7 @@ struct __is_placeholder<placeholders::__ph<_Np> >
: public integral_constant<int, _Np> {};
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Uj>
inline _LIBCPP_INLINE_VISIBILITY
@@ -2168,7 +2224,7 @@ typename __bind_return<_Fp, _BoundArgs, _Args>::type
__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
_Args&& __args)
{
- return __invoke(__f, __mu(_VSTD::get<_Indx>(__bound_args), __args)...);
+ return _VSTD::__invoke(__f, _VSTD::__mu(_VSTD::get<_Indx>(__bound_args), __args)...);
}
template<class _Fp, class ..._BoundArgs>
@@ -2184,36 +2240,6 @@ private:
typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
public:
-#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-
- _LIBCPP_INLINE_VISIBILITY
- __bind(const __bind& __b)
- : __f_(__b.__f_),
- __bound_args_(__b.__bound_args_) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __bind& operator=(const __bind& __b)
- {
- __f_ = __b.__f_;
- __bound_args_ = __b.__bound_args_;
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __bind(__bind&& __b)
- : __f_(_VSTD::move(__b.__f_)),
- __bound_args_(_VSTD::move(__b.__bound_args_)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __bind& operator=(__bind&& __b)
- {
- __f_ = _VSTD::move(__b.__f_);
- __bound_args_ = _VSTD::move(__b.__bound_args_);
- return *this;
- }
-
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-
template <class _Gp, class ..._BA,
class = typename enable_if
<
@@ -2231,7 +2257,7 @@ public:
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
operator()(_Args&& ...__args)
{
- return __apply_functor(__f_, __bound_args_, __indices(),
+ return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
}
@@ -2240,7 +2266,7 @@ public:
typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
operator()(_Args&& ...__args) const
{
- return __apply_functor(__f_, __bound_args_, __indices(),
+ return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
}
};
@@ -2258,31 +2284,6 @@ class __bind_r
public:
typedef _Rp result_type;
-#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
-
- _LIBCPP_INLINE_VISIBILITY
- __bind_r(const __bind_r& __b)
- : base(_VSTD::forward<const base&>(__b)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __bind_r& operator=(const __bind_r& __b)
- {
- base::operator=(_VSTD::forward<const base&>(__b));
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __bind_r(__bind_r&& __b)
- : base(_VSTD::forward<base>(__b)) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __bind_r& operator=(__bind_r&& __b)
- {
- base::operator=(_VSTD::forward<base>(__b));
- return *this;
- }
-
-#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
template <class _Gp, class ..._BA,
class = typename enable_if
@@ -2346,229 +2347,74 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<bool>
- : public unary_function<bool, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<char>
- : public unary_function<char, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<signed char>
- : public unary_function<signed char, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned char>
- : public unary_function<unsigned char, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<char16_t>
- : public unary_function<char16_t, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<char32_t>
- : public unary_function<char32_t, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
+#if _LIBCPP_STD_VER > 14
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+#define __cpp_lib_invoke 201411
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<wchar_t>
- : public unary_function<wchar_t, size_t>
+template <class _Fn, class ..._Args>
+result_of_t<_Fn&&(_Args&&...)>
+invoke(_Fn&& __f, _Args&&... __args)
+ noexcept(noexcept(_VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...)))
{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
+ return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
+}
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<short>
- : public unary_function<short, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
+template <class _DecayFunc>
+class _LIBCPP_TEMPLATE_VIS __not_fn_imp {
+ _DecayFunc __fd;
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned short>
- : public unary_function<unsigned short, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
+public:
+ __not_fn_imp() = delete;
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<int>
- : public unary_function<int, size_t>
-{
+ template <class ..._Args>
_LIBCPP_INLINE_VISIBILITY
- size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
+ auto operator()(_Args&& ...__args) &
+ noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
+ -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned int>
- : public unary_function<unsigned int, size_t>
-{
+ template <class ..._Args>
_LIBCPP_INLINE_VISIBILITY
- size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
+ auto operator()(_Args&& ...__args) &&
+ noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
+ -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<long>
- : public unary_function<long, size_t>
-{
+ template <class ..._Args>
_LIBCPP_INLINE_VISIBILITY
- size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
+ auto operator()(_Args&& ...__args) const&
+ noexcept(noexcept(!_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...)))
+ -> decltype( !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(__fd, _VSTD::forward<_Args>(__args)...); }
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned long>
- : public unary_function<unsigned long, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
-};
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<long long>
- : public __scalar_hash<long long>
-{
-};
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned long long>
- : public __scalar_hash<unsigned long long>
-{
-};
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<float>
- : public __scalar_hash<float>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(float __v) const _NOEXCEPT
- {
- // -0.0 and 0.0 should return same hash
- if (__v == 0)
- return 0;
- return __scalar_hash<float>::operator()(__v);
- }
-};
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<double>
- : public __scalar_hash<double>
-{
+ template <class ..._Args>
_LIBCPP_INLINE_VISIBILITY
- size_t operator()(double __v) const _NOEXCEPT
- {
- // -0.0 and 0.0 should return same hash
- if (__v == 0)
- return 0;
- return __scalar_hash<double>::operator()(__v);
- }
-};
+ auto operator()(_Args&& ...__args) const&&
+ noexcept(noexcept(!_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...)))
+ -> decltype( !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...))
+ { return !_VSTD::invoke(_VSTD::move(__fd), _VSTD::forward<_Args>(__args)...); }
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<long double>
- : public __scalar_hash<long double>
-{
+private:
+ template <class _RawFunc,
+ class = enable_if_t<!is_same<decay_t<_RawFunc>, __not_fn_imp>::value>>
_LIBCPP_INLINE_VISIBILITY
- size_t operator()(long double __v) const _NOEXCEPT
- {
- // -0.0 and 0.0 should return same hash
- if (__v == 0)
- return 0;
-#if defined(__i386__)
- // Zero out padding bits
- union
- {
- long double __t;
- struct
- {
- size_t __a;
- size_t __b;
- size_t __c;
- size_t __d;
- } __s;
- } __u;
- __u.__s.__a = 0;
- __u.__s.__b = 0;
- __u.__s.__c = 0;
- __u.__s.__d = 0;
- __u.__t = __v;
- return __u.__s.__a ^ __u.__s.__b ^ __u.__s.__c ^ __u.__s.__d;
-#elif defined(__x86_64__)
- // Zero out padding bits
- union
- {
- long double __t;
- struct
- {
- size_t __a;
- size_t __b;
- } __s;
- } __u;
- __u.__s.__a = 0;
- __u.__s.__b = 0;
- __u.__t = __v;
- return __u.__s.__a ^ __u.__s.__b;
-#else
- return __scalar_hash<long double>::operator()(__v);
-#endif
- }
-};
-
-#if _LIBCPP_STD_VER > 11
-template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY hash
- : public unary_function<_Tp, size_t>
-{
- static_assert(is_enum<_Tp>::value, "This hash only works for enumeration types");
+ explicit __not_fn_imp(_RawFunc&& __rf)
+ : __fd(_VSTD::forward<_RawFunc>(__rf)) {}
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- typedef typename underlying_type<_Tp>::type type;
- return hash<type>{}(static_cast<type>(__v));
- }
+ template <class _RawFunc>
+ friend inline _LIBCPP_INLINE_VISIBILITY
+ __not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&&);
};
-#endif
-
-#if _LIBCPP_STD_VER > 14
-template <class _Fn, class ..._Args>
-result_of_t<_Fn&&(_Args&&...)>
-invoke(_Fn&& __f, _Args&&... __args) {
- return __invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
+template <class _RawFunc>
+inline _LIBCPP_INLINE_VISIBILITY
+__not_fn_imp<decay_t<_RawFunc>> not_fn(_RawFunc&& __fn) {
+ return __not_fn_imp<decay_t<_RawFunc>>(_VSTD::forward<_RawFunc>(__fn));
}
+
#endif
// struct hash<T*> in <memory>
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/future b/chromium/buildtools/third_party/libc++/trunk/include/future
index ce15eafbf7e..e38876758e1 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/future
+++ b/chromium/buildtools/third_party/libc++/trunk/include/future
@@ -50,7 +50,7 @@ class future_error
{
public:
future_error(error_code ec); // exposition only
-
+ explicit future_error(future_errc); // C++17
const error_code& code() const noexcept;
const char* what() const noexcept;
};
@@ -156,7 +156,7 @@ public:
~future();
future& operator=(const future& rhs) = delete;
future& operator=(future&&) noexcept;
- shared_future<R> share();
+ shared_future<R> share() noexcept;
// retrieving the value
R get();
@@ -183,7 +183,7 @@ public:
~future();
future& operator=(const future& rhs) = delete;
future& operator=(future&&) noexcept;
- shared_future<R&> share();
+ shared_future<R&> share() noexcept;
// retrieving the value
R& get();
@@ -210,7 +210,7 @@ public:
~future();
future& operator=(const future& rhs) = delete;
future& operator=(future&&) noexcept;
- shared_future<void> share();
+ shared_future<void> share() noexcept;
// retrieving the value
void get();
@@ -322,7 +322,7 @@ template <class R, class... ArgTypes>
class packaged_task<R(ArgTypes...)>
{
public:
- typedef R result_type;
+ typedef R result_type; // extension
// construction and destruction
packaged_task() noexcept;
@@ -391,11 +391,11 @@ _LIBCPP_DECLARE_STRONG_ENUM(future_errc)
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_errc)
template <>
-struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum<future_errc> : public true_type {};
+struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<future_errc> : public true_type {};
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
-struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum<future_errc::__lx> : public true_type { };
+struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<future_errc::__lx> : public true_type { };
#endif
//enum class launch
@@ -499,30 +499,36 @@ make_error_condition(future_errc __e) _NOEXCEPT
return error_condition(static_cast<int>(__e), future_category());
}
-class _LIBCPP_EXCEPTION_ABI future_error
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_FUTURE_ERROR future_error
: public logic_error
{
error_code __ec_;
public:
future_error(error_code __ec);
-
+#if _LIBCPP_STD_VERS > 14
+ explicit future_error(future_errc _Ev) : logic_error(), __ec_(make_error_code(_Ev)) {}
+#endif
_LIBCPP_INLINE_VISIBILITY
const error_code& code() const _NOEXCEPT {return __ec_;}
virtual ~future_error() _NOEXCEPT;
};
-inline _LIBCPP_ALWAYS_INLINE
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCPP_AVAILABILITY_FUTURE_ERROR
+#endif
void __throw_future_error(future_errc _Ev)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw future_error(make_error_code(_Ev));
#else
- assert(!"future_error");
+ ((void)_Ev);
+ _VSTD::abort();
#endif
}
-class _LIBCPP_TYPE_VIS __assoc_sub_state
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state
: public __shared_count
{
protected:
@@ -579,6 +585,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
wait_for(const chrono::duration<_Rep, _Period>& __rel_time) const;
template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
future_status
wait_until(const chrono::time_point<_Clock, _Duration>& __abs_time) const;
@@ -608,7 +615,7 @@ __assoc_sub_state::wait_for(const chrono::duration<_Rep, _Period>& __rel_time) c
}
template <class _Rp>
-class __assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state
: public __assoc_sub_state
{
typedef __assoc_sub_state base;
@@ -648,6 +655,7 @@ __assoc_state<_Rp>::__on_zero_shared() _NOEXCEPT
template <class _Rp>
template <class _Arg>
+_LIBCPP_AVAILABILITY_FUTURE
void
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__assoc_state<_Rp>::set_value(_Arg&& __arg)
@@ -703,7 +711,7 @@ __assoc_state<_Rp>::copy()
}
template <class _Rp>
-class __assoc_state<_Rp&>
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state<_Rp&>
: public __assoc_sub_state
{
typedef __assoc_sub_state base;
@@ -763,7 +771,7 @@ __assoc_state<_Rp&>::copy()
}
template <class _Rp, class _Alloc>
-class __assoc_state_alloc
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc
: public __assoc_state<_Rp>
{
typedef __assoc_state<_Rp> base;
@@ -791,7 +799,7 @@ __assoc_state_alloc<_Rp, _Alloc>::__on_zero_shared() _NOEXCEPT
}
template <class _Rp, class _Alloc>
-class __assoc_state_alloc<_Rp&, _Alloc>
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc<_Rp&, _Alloc>
: public __assoc_state<_Rp&>
{
typedef __assoc_state<_Rp&> base;
@@ -817,7 +825,7 @@ __assoc_state_alloc<_Rp&, _Alloc>::__on_zero_shared() _NOEXCEPT
}
template <class _Alloc>
-class __assoc_sub_state_alloc
+class _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state_alloc
: public __assoc_sub_state
{
typedef __assoc_sub_state base;
@@ -843,7 +851,7 @@ __assoc_sub_state_alloc<_Alloc>::__on_zero_shared() _NOEXCEPT
}
template <class _Rp, class _Fp>
-class __deferred_assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
: public __assoc_state<_Rp>
{
typedef __assoc_state<_Rp> base;
@@ -890,7 +898,7 @@ __deferred_assoc_state<_Rp, _Fp>::__execute()
}
template <class _Fp>
-class __deferred_assoc_state<void, _Fp>
+class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
: public __assoc_sub_state
{
typedef __assoc_sub_state base;
@@ -938,7 +946,7 @@ __deferred_assoc_state<void, _Fp>::__execute()
}
template <class _Rp, class _Fp>
-class __async_assoc_state
+class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
: public __assoc_state<_Rp>
{
typedef __assoc_state<_Rp> base;
@@ -993,7 +1001,7 @@ __async_assoc_state<_Rp, _Fp>::__on_zero_shared() _NOEXCEPT
}
template <class _Fp>
-class __async_assoc_state<void, _Fp>
+class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
: public __assoc_sub_state
{
typedef __assoc_sub_state base;
@@ -1048,12 +1056,12 @@ __async_assoc_state<void, _Fp>::__on_zero_shared() _NOEXCEPT
base::__on_zero_shared();
}
-template <class _Rp> class _LIBCPP_TYPE_VIS_ONLY promise;
-template <class _Rp> class _LIBCPP_TYPE_VIS_ONLY shared_future;
+template <class _Rp> class _LIBCPP_TEMPLATE_VIS promise;
+template <class _Rp> class _LIBCPP_TEMPLATE_VIS shared_future;
// future
-template <class _Rp> class _LIBCPP_TYPE_VIS_ONLY future;
+template <class _Rp> class _LIBCPP_TEMPLATE_VIS future;
template <class _Rp, class _Fp>
future<_Rp>
@@ -1072,7 +1080,7 @@ __make_async_assoc_state(_Fp __f);
#endif
template <class _Rp>
-class _LIBCPP_TYPE_VIS_ONLY future
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
{
__assoc_state<_Rp>* __state_;
@@ -1116,7 +1124,7 @@ public:
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~future();
_LIBCPP_INLINE_VISIBILITY
- shared_future<_Rp> share();
+ shared_future<_Rp> share() _NOEXCEPT;
// retrieving the value
_Rp get();
@@ -1175,7 +1183,7 @@ future<_Rp>::get()
}
template <class _Rp>
-class _LIBCPP_TYPE_VIS_ONLY future<_Rp&>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
{
__assoc_state<_Rp&>* __state_;
@@ -1219,7 +1227,7 @@ public:
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~future();
_LIBCPP_INLINE_VISIBILITY
- shared_future<_Rp&> share();
+ shared_future<_Rp&> share() _NOEXCEPT;
// retrieving the value
_Rp& get();
@@ -1273,7 +1281,7 @@ future<_Rp&>::get()
}
template <>
-class _LIBCPP_TYPE_VIS future<void>
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
{
__assoc_sub_state* __state_;
@@ -1317,7 +1325,7 @@ public:
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~future();
_LIBCPP_INLINE_VISIBILITY
- shared_future<void> share();
+ shared_future<void> share() _NOEXCEPT;
// retrieving the value
void get();
@@ -1356,7 +1364,7 @@ swap(future<_Rp>& __x, future<_Rp>& __y) _NOEXCEPT
template <class _Callable> class packaged_task;
template <class _Rp>
-class _LIBCPP_TYPE_VIS_ONLY promise
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise
{
__assoc_state<_Rp>* __state_;
@@ -1482,6 +1490,7 @@ template <class _Rp>
void
promise<_Rp>::set_exception(exception_ptr __p)
{
+ _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
@@ -1513,6 +1522,7 @@ template <class _Rp>
void
promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
{
+ _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception_at_thread_exit(__p);
@@ -1521,7 +1531,7 @@ promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
// promise<R&>
template <class _Rp>
-class _LIBCPP_TYPE_VIS_ONLY promise<_Rp&>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<_Rp&>
{
__assoc_state<_Rp&>* __state_;
@@ -1629,6 +1639,7 @@ template <class _Rp>
void
promise<_Rp&>::set_exception(exception_ptr __p)
{
+ _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
@@ -1647,6 +1658,7 @@ template <class _Rp>
void
promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
{
+ _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception_at_thread_exit(__p);
@@ -1655,7 +1667,7 @@ promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
// promise<void>
template <>
-class _LIBCPP_TYPE_VIS promise<void>
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<void>
{
__assoc_sub_state* __state_;
@@ -1667,6 +1679,7 @@ class _LIBCPP_TYPE_VIS promise<void>
public:
promise();
template <class _Allocator>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
promise(allocator_arg_t, const _Allocator& __a);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
@@ -1730,7 +1743,7 @@ swap(promise<_Rp>& __x, promise<_Rp>& __y) _NOEXCEPT
}
template <class _Rp, class _Alloc>
- struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<promise<_Rp>, _Alloc>
+ struct _LIBCPP_TEMPLATE_VIS uses_allocator<promise<_Rp>, _Alloc>
: public true_type {};
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -1740,7 +1753,7 @@ template <class _Rp, class _Alloc>
template<class _Fp> class __packaged_task_base;
template<class _Rp, class ..._ArgTypes>
-class __packaged_task_base<_Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_base<_Rp(_ArgTypes...)>
{
__packaged_task_base(const __packaged_task_base&);
__packaged_task_base& operator=(const __packaged_task_base&);
@@ -1758,7 +1771,7 @@ public:
template<class _FD, class _Alloc, class _FB> class __packaged_task_func;
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-class __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
: public __packaged_task_base<_Rp(_ArgTypes...)>
{
__compressed_pair<_Fp, _Alloc> __f_;
@@ -1816,7 +1829,7 @@ __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ...
template <class _Callable> class __packaged_task_function;
template<class _Rp, class ..._ArgTypes>
-class __packaged_task_function<_Rp(_ArgTypes...)>
+class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
{
typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
typename aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -1991,10 +2004,10 @@ __packaged_task_function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) cons
}
template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_TYPE_VIS_ONLY packaged_task<_Rp(_ArgTypes...)>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<_Rp(_ArgTypes...)>
{
public:
- typedef _Rp result_type;
+ typedef _Rp result_type; // extension
private:
__packaged_task_function<result_type(_ArgTypes...)> __f_;
@@ -2120,10 +2133,10 @@ packaged_task<_Rp(_ArgTypes...)>::reset()
}
template<class ..._ArgTypes>
-class _LIBCPP_TYPE_VIS_ONLY packaged_task<void(_ArgTypes...)>
+class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<void(_ArgTypes...)>
{
public:
- typedef void result_type;
+ typedef void result_type; // extension
private:
__packaged_task_function<result_type(_ArgTypes...)> __f_;
@@ -2259,7 +2272,7 @@ swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y) _NOEXCEPT
}
template <class _Callable, class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<packaged_task<_Callable>, _Alloc>
+struct _LIBCPP_TEMPLATE_VIS uses_allocator<packaged_task<_Callable>, _Alloc>
: public true_type {};
template <class _Rp, class _Fp>
@@ -2360,7 +2373,7 @@ async(_Fp&& __f, _Args&&... __args)
// shared_future
template <class _Rp>
-class _LIBCPP_TYPE_VIS_ONLY shared_future
+class _LIBCPP_TEMPLATE_VIS shared_future
{
__assoc_state<_Rp>* __state_;
@@ -2368,7 +2381,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
shared_future() _NOEXCEPT : __state_(nullptr) {}
_LIBCPP_INLINE_VISIBILITY
- shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
+ shared_future(const shared_future& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
{if (__state_) __state_->__add_shared();}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
@@ -2379,7 +2392,7 @@ public:
{__rhs.__state_ = nullptr;}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~shared_future();
- shared_future& operator=(const shared_future& __rhs);
+ shared_future& operator=(const shared_future& __rhs) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
@@ -2423,7 +2436,7 @@ shared_future<_Rp>::~shared_future()
template <class _Rp>
shared_future<_Rp>&
-shared_future<_Rp>::operator=(const shared_future& __rhs)
+shared_future<_Rp>::operator=(const shared_future& __rhs) _NOEXCEPT
{
if (__rhs.__state_)
__rhs.__state_->__add_shared();
@@ -2434,7 +2447,7 @@ shared_future<_Rp>::operator=(const shared_future& __rhs)
}
template <class _Rp>
-class _LIBCPP_TYPE_VIS_ONLY shared_future<_Rp&>
+class _LIBCPP_TEMPLATE_VIS shared_future<_Rp&>
{
__assoc_state<_Rp&>* __state_;
@@ -2508,7 +2521,7 @@ shared_future<_Rp&>::operator=(const shared_future& __rhs)
}
template <>
-class _LIBCPP_TYPE_VIS shared_future<void>
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE shared_future<void>
{
__assoc_sub_state* __state_;
@@ -2573,7 +2586,7 @@ swap(shared_future<_Rp>& __x, shared_future<_Rp>& __y) _NOEXCEPT
template <class _Rp>
inline
shared_future<_Rp>
-future<_Rp>::share()
+future<_Rp>::share() _NOEXCEPT
{
return shared_future<_Rp>(_VSTD::move(*this));
}
@@ -2581,7 +2594,7 @@ future<_Rp>::share()
template <class _Rp>
inline
shared_future<_Rp&>
-future<_Rp&>::share()
+future<_Rp&>::share() _NOEXCEPT
{
return shared_future<_Rp&>(_VSTD::move(*this));
}
@@ -2590,7 +2603,7 @@ future<_Rp&>::share()
inline
shared_future<void>
-future<void>::share()
+future<void>::share() _NOEXCEPT
{
return shared_future<void>(_VSTD::move(*this));
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/initializer_list b/chromium/buildtools/third_party/libc++/trunk/include/initializer_list
index 663e49b6ee4..8c234aaaab2 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/initializer_list
+++ b/chromium/buildtools/third_party/libc++/trunk/include/initializer_list
@@ -53,10 +53,10 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in
namespace std // purposefully not versioned
{
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Ep>
-class _LIBCPP_TYPE_VIS_ONLY initializer_list
+class _LIBCPP_TEMPLATE_VIS initializer_list
{
const _Ep* __begin_;
size_t __size_;
@@ -111,7 +111,7 @@ end(initializer_list<_Ep> __il) _NOEXCEPT
return __il.end();
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // !defined(_LIBCPP_CXX03_LANG)
} // std
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/inttypes.h b/chromium/buildtools/third_party/libc++/trunk/include/inttypes.h
index 5c5618bef88..058f54b5161 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/inttypes.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/inttypes.h
@@ -237,6 +237,13 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
#pragma GCC system_header
#endif
+/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
+ for C++11 unless __STDC_FORMAT_MACROS is defined
+*/
+#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
+# define __STDC_FORMAT_MACROS
+#endif
+
#include_next <inttypes.h>
#ifdef __cplusplus
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/iomanip b/chromium/buildtools/third_party/libc++/trunk/include/iomanip
index a5042c7df81..a6bee736f45 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/iomanip
+++ b/chromium/buildtools/third_party/libc++/trunk/include/iomanip
@@ -44,6 +44,7 @@ template <class charT, class traits, class Allocator>
*/
#include <__config>
+#include <__string>
#include <istream>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -512,8 +513,6 @@ put_time(const tm* __tm, const _CharT* __fmt)
return __iom_t10<_CharT>(__tm, __fmt);
}
-#if _LIBCPP_STD_VER > 11
-
template <class _CharT, class _Traits, class _ForwardIterator>
std::basic_ostream<_CharT, _Traits> &
__quoted_output ( basic_ostream<_CharT, _Traits> &__os,
@@ -569,19 +568,6 @@ __quoted_input ( basic_istream<_CharT, _Traits> &__is, _String & __string, _Char
}
-template <class _CharT, class _Iter, class _Traits=char_traits<_CharT>>
-struct __quoted_output_proxy
-{
- _Iter __first;
- _Iter __last;
- _CharT __delim;
- _CharT __escape;
-
- __quoted_output_proxy(_Iter __f, _Iter __l, _CharT __d, _CharT __e)
- : __first(__f), __last(__l), __delim(__d), __escape(__e) {}
- // This would be a nice place for a string_ref
-};
-
template <class _CharT, class _Traits, class _Iter>
basic_ostream<_CharT, _Traits>& operator<<(
basic_ostream<_CharT, _Traits>& __os,
@@ -631,22 +617,52 @@ quoted ( const _CharT *__s, _CharT __delim = _CharT('"'), _CharT __escape =_Char
return __quoted_output_proxy<_CharT, const _CharT *> ( __s, __end, __delim, __escape );
}
+
template <class _CharT, class _Traits, class _Allocator>
_LIBCPP_INLINE_VISIBILITY
__quoted_output_proxy<_CharT, typename basic_string <_CharT, _Traits, _Allocator>::const_iterator>
-quoted ( const basic_string <_CharT, _Traits, _Allocator> &__s, _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
+__quoted ( const basic_string <_CharT, _Traits, _Allocator> &__s, _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
{
- return __quoted_output_proxy<_CharT,
- typename basic_string <_CharT, _Traits, _Allocator>::const_iterator>
+ return __quoted_output_proxy<_CharT,
+ typename basic_string <_CharT, _Traits, _Allocator>::const_iterator>
( __s.cbegin(), __s.cend (), __delim, __escape );
}
template <class _CharT, class _Traits, class _Allocator>
+_LIBCPP_INLINE_VISIBILITY
__quoted_proxy<_CharT, _Traits, _Allocator>
-quoted ( basic_string <_CharT, _Traits, _Allocator> &__s, _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
+__quoted ( basic_string <_CharT, _Traits, _Allocator> &__s, _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
{
return __quoted_proxy<_CharT, _Traits, _Allocator>( __s, __delim, __escape );
}
+
+
+#if _LIBCPP_STD_VER > 11
+
+template <class _CharT, class _Traits, class _Allocator>
+_LIBCPP_INLINE_VISIBILITY
+__quoted_output_proxy<_CharT, typename basic_string <_CharT, _Traits, _Allocator>::const_iterator>
+quoted ( const basic_string <_CharT, _Traits, _Allocator> &__s, _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
+{
+ return __quoted(__s, __delim, __escape);
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+_LIBCPP_INLINE_VISIBILITY
+__quoted_proxy<_CharT, _Traits, _Allocator>
+quoted ( basic_string <_CharT, _Traits, _Allocator> &__s, _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
+{
+ return __quoted(__s, __delim, __escape);
+}
+
+template <class _CharT, class _Traits>
+__quoted_output_proxy<_CharT, const _CharT *, _Traits>
+quoted (basic_string_view <_CharT, _Traits> __sv,
+ _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
+{
+ return __quoted_output_proxy<_CharT, const _CharT *, _Traits>
+ ( __sv.data(), __sv.data() + __sv.size(), __delim, __escape );
+}
#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/ios b/chromium/buildtools/third_party/libc++/trunk/include/ios
index 1deb5f613c8..61d00b90ee0 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/ios
+++ b/chromium/buildtools/third_party/libc++/trunk/include/ios
@@ -231,7 +231,7 @@ typedef ptrdiff_t streamsize;
class _LIBCPP_TYPE_VIS ios_base
{
public:
- class _LIBCPP_TYPE_VIS failure;
+ class _LIBCPP_EXCEPTION_ABI failure;
typedef unsigned int fmtflags;
static const fmtflags boolalpha = 0x0001;
@@ -393,11 +393,11 @@ _LIBCPP_DECLARE_STRONG_ENUM(io_errc)
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)
template <>
-struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum<io_errc> : public true_type { };
+struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc> : public true_type { };
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
-struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum<io_errc::__lx> : public true_type { };
+struct _LIBCPP_TEMPLATE_VIS is_error_code_enum<io_errc::__lx> : public true_type { };
#endif
_LIBCPP_FUNC_VIS
@@ -572,8 +572,15 @@ ios_base::exceptions(iostate __iostate)
clear(__rdstate_);
}
+#if defined(_LIBCPP_CXX03_LANG)
+struct _LIBCPP_TYPE_VIS __cxx03_bool {
+ typedef void (__cxx03_bool::*__bool_type)();
+ void __true_value() {}
+};
+#endif
+
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_ios
+class _LIBCPP_TEMPLATE_VIS basic_ios
: public ios_base
{
public:
@@ -585,9 +592,19 @@ public:
typedef typename traits_type::pos_type pos_type;
typedef typename traits_type::off_type off_type;
+ // __true_value will generate undefined references when linking unless
+ // we give it internal linkage.
+
+#if defined(_LIBCPP_CXX03_LANG)
_LIBCPP_ALWAYS_INLINE
- _LIBCPP_EXPLICIT
- operator bool() const {return !fail();}
+ operator __cxx03_bool::__bool_type() const {
+ return !fail() ? &__cxx03_bool::__true_value : nullptr;
+ }
+#else
+ _LIBCPP_ALWAYS_INLINE
+ _LIBCPP_EXPLICIT operator bool() const {return !fail();}
+#endif
+
_LIBCPP_ALWAYS_INLINE bool operator!() const {return fail();}
_LIBCPP_ALWAYS_INLINE iostate rdstate() const {return ios_base::rdstate();}
_LIBCPP_ALWAYS_INLINE void clear(iostate __state = goodbit) {ios_base::clear(__state);}
@@ -640,7 +657,7 @@ protected:
_LIBCPP_INLINE_VISIBILITY
void move(basic_ios& __rhs);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_ALWAYS_INLINE
void move(basic_ios&& __rhs) {move(__rhs);}
#endif
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/iosfwd b/chromium/buildtools/third_party/libc++/trunk/include/iosfwd
index eccfd349a4a..d4384859e41 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/iosfwd
+++ b/chromium/buildtools/third_party/libc++/trunk/include/iosfwd
@@ -97,47 +97,47 @@ _LIBCPP_BEGIN_NAMESPACE_STD
class _LIBCPP_TYPE_VIS ios_base;
-template<class _CharT> struct _LIBCPP_TYPE_VIS_ONLY char_traits;
-template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY allocator;
+template<class _CharT> struct _LIBCPP_TEMPLATE_VIS char_traits;
+template<class _Tp> class _LIBCPP_TEMPLATE_VIS allocator;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_ios;
+ class _LIBCPP_TEMPLATE_VIS basic_ios;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_streambuf;
+ class _LIBCPP_TEMPLATE_VIS basic_streambuf;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_istream;
+ class _LIBCPP_TEMPLATE_VIS basic_istream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_ostream;
+ class _LIBCPP_TEMPLATE_VIS basic_ostream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_iostream;
+ class _LIBCPP_TEMPLATE_VIS basic_iostream;
template <class _CharT, class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_stringbuf;
+ class _LIBCPP_TEMPLATE_VIS basic_stringbuf;
template <class _CharT, class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_istringstream;
+ class _LIBCPP_TEMPLATE_VIS basic_istringstream;
template <class _CharT, class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_ostringstream;
+ class _LIBCPP_TEMPLATE_VIS basic_ostringstream;
template <class _CharT, class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_stringstream;
+ class _LIBCPP_TEMPLATE_VIS basic_stringstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_filebuf;
+ class _LIBCPP_TEMPLATE_VIS basic_filebuf;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_ifstream;
+ class _LIBCPP_TEMPLATE_VIS basic_ifstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_ofstream;
+ class _LIBCPP_TEMPLATE_VIS basic_ofstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_fstream;
+ class _LIBCPP_TEMPLATE_VIS basic_fstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY istreambuf_iterator;
+ class _LIBCPP_TEMPLATE_VIS istreambuf_iterator;
template <class _CharT, class _Traits = char_traits<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY ostreambuf_iterator;
+ class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;
typedef basic_ios<char> ios;
typedef basic_ios<wchar_t> wios;
@@ -172,7 +172,7 @@ typedef basic_ifstream<wchar_t> wifstream;
typedef basic_ofstream<wchar_t> wofstream;
typedef basic_fstream<wchar_t> wfstream;
-template <class _State> class _LIBCPP_TYPE_VIS_ONLY fpos;
+template <class _State> class _LIBCPP_TEMPLATE_VIS fpos;
typedef fpos<mbstate_t> streampos;
typedef fpos<mbstate_t> wstreampos;
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
@@ -190,10 +190,15 @@ typedef long long streamoff; // for char_traits in <string>
template <class _CharT, // for <stdexcept>
class _Traits = char_traits<_CharT>,
class _Allocator = allocator<_CharT> >
- class _LIBCPP_TYPE_VIS_ONLY basic_string;
+ class _LIBCPP_TEMPLATE_VIS basic_string;
typedef basic_string<char, char_traits<char>, allocator<char> > string;
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
+
+// Include other forward declarations here
+template <class _Tp, class _Alloc = allocator<_Tp> >
+class _LIBCPP_TEMPLATE_VIS vector;
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_IOSFWD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/istream b/chromium/buildtools/third_party/libc++/trunk/include/istream
index c6a272e75ef..530f204cfad 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/istream
+++ b/chromium/buildtools/third_party/libc++/trunk/include/istream
@@ -171,7 +171,7 @@ template <class charT, class traits, class T>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_istream
+class _LIBCPP_TEMPLATE_VIS basic_istream
: virtual public basic_ios<_CharT, _Traits>
{
streamsize __gc_;
@@ -184,39 +184,49 @@ public:
typedef typename traits_type::off_type off_type;
// 27.7.1.1.1 Constructor/destructor:
- explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb) : __gc_(0)
+ { this->init(__sb); }
virtual ~basic_istream();
protected:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
basic_istream(basic_istream&& __rhs);
-#endif
+
// 27.7.1.1.2 Assign/swap:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_istream& operator=(basic_istream&& __rhs);
#endif
- void swap(basic_istream& __rhs);
-#if _LIBCPP_STD_VER > 11
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void swap(basic_istream& __rhs) {
+ _VSTD::swap(__gc_, __rhs.__gc_);
+ basic_ios<char_type, traits_type>::swap(__rhs);
+ }
+
+#ifndef _LIBCPP_CXX03_LANG
basic_istream (const basic_istream& __rhs) = delete;
basic_istream& operator=(const basic_istream& __rhs) = delete;
-#else
- basic_istream (const basic_istream& __rhs); // not defined
- basic_istream& operator=(const basic_istream& __rhs); // not defined
-#endif
#endif
public:
// 27.7.1.1.3 Prefix/suffix:
- class _LIBCPP_TYPE_VIS_ONLY sentry;
+ class _LIBCPP_TEMPLATE_VIS sentry;
// 27.7.1.2 Formatted input:
- basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&))
+ { return __pf(*this); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
basic_istream& operator>>(basic_ios<char_type, traits_type>&
- (*__pf)(basic_ios<char_type, traits_type>&));
- basic_istream& operator>>(ios_base& (*__pf)(ios_base&));
+ (*__pf)(basic_ios<char_type, traits_type>&))
+ { __pf(*this); return *this; }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& operator>>(ios_base& (*__pf)(ios_base&))
+ { __pf(*this); return *this; }
+
basic_istream& operator>>(basic_streambuf<char_type, traits_type>* __sb);
basic_istream& operator>>(bool& __n);
basic_istream& operator>>(short& __n);
@@ -236,13 +246,31 @@ public:
_LIBCPP_INLINE_VISIBILITY
streamsize gcount() const {return __gc_;}
int_type get();
- basic_istream& get(char_type& __c);
- basic_istream& get(char_type* __s, streamsize __n);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& get(char_type& __c) {
+ int_type __ch = get();
+ if (__ch != traits_type::eof())
+ __c = traits_type::to_char_type(__ch);
+ return *this;
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& get(char_type* __s, streamsize __n)
+ { return get(__s, __n, this->widen('\n')); }
+
basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);
- basic_istream& get(basic_streambuf<char_type, traits_type>& __sb);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& get(basic_streambuf<char_type, traits_type>& __sb)
+ { return get(__sb, this->widen('\n')); }
+
basic_istream& get(basic_streambuf<char_type, traits_type>& __sb, char_type __dlm);
- basic_istream& getline(char_type* __s, streamsize __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_istream& getline(char_type* __s, streamsize __n)
+ { return getline(__s, __n, this->widen('\n')); }
+
basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);
basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());
@@ -260,7 +288,7 @@ public:
};
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_istream<_CharT, _Traits>::sentry
+class _LIBCPP_TEMPLATE_VIS basic_istream<_CharT, _Traits>::sentry
{
bool __ok_;
@@ -303,18 +331,9 @@ basic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& _
__is.setstate(ios_base::failbit);
}
-template <class _CharT, class _Traits>
-inline
-basic_istream<_CharT, _Traits>::basic_istream(basic_streambuf<char_type, traits_type>* __sb)
- : __gc_(0)
-{
- this->init(__sb);
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline
basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
: __gc_(__rhs.__gc_)
{
@@ -323,7 +342,6 @@ basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
}
template <class _CharT, class _Traits>
-inline
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
{
@@ -331,7 +349,7 @@ basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
basic_istream<_CharT, _Traits>::~basic_istream()
@@ -339,15 +357,6 @@ basic_istream<_CharT, _Traits>::~basic_istream()
}
template <class _CharT, class _Traits>
-inline
-void
-basic_istream<_CharT, _Traits>::swap(basic_istream& __rhs)
-{
- _VSTD::swap(__gc_, __rhs.__gc_);
- basic_ios<char_type, traits_type>::swap(__rhs);
-}
-
-template <class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)
{
@@ -724,33 +733,6 @@ basic_istream<_CharT, _Traits>::operator>>(int& __n)
return *this;
}
-template <class _CharT, class _Traits>
-inline
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::operator>>(basic_istream& (*__pf)(basic_istream&))
-{
- return __pf(*this);
-}
-
-template <class _CharT, class _Traits>
-inline
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::operator>>(basic_ios<char_type, traits_type>&
- (*__pf)(basic_ios<char_type, traits_type>&))
-{
- __pf(*this);
- return *this;
-}
-
-template <class _CharT, class _Traits>
-inline
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::operator>>(ios_base& (*__pf)(ios_base&))
-{
- __pf(*this);
- return *this;
-}
-
template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
@@ -800,7 +782,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)
}
template<class _Traits>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
{
@@ -808,7 +790,7 @@ operator>>(basic_istream<char, _Traits>& __is, unsigned char* __s)
}
template<class _Traits>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __is, signed char* __s)
{
@@ -843,7 +825,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
}
template<class _Traits>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
{
@@ -851,7 +833,7 @@ operator>>(basic_istream<char, _Traits>& __is, unsigned char& __c)
}
template<class _Traits>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_istream<char, _Traits>&
operator>>(basic_istream<char, _Traits>& __is, signed char& __c)
{
@@ -947,17 +929,6 @@ basic_istream<_CharT, _Traits>::get()
}
template<class _CharT, class _Traits>
-inline
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::get(char_type& __c)
-{
- int_type __ch = get();
- if (__ch != traits_type::eof())
- __c = traits_type::to_char_type(__ch);
- return *this;
-}
-
-template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __dlm)
{
@@ -1006,14 +977,6 @@ basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __
}
template<class _CharT, class _Traits>
-inline
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n)
-{
- return get(__s, __n, this->widen('\n'));
-}
-
-template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __sb,
char_type __dlm)
@@ -1068,14 +1031,6 @@ basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __s
}
template<class _CharT, class _Traits>
-inline
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::get(basic_streambuf<char_type, traits_type>& __sb)
-{
- return get(__sb, this->widen('\n'));
-}
-
-template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_type __dlm)
{
@@ -1129,14 +1084,6 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
}
template<class _CharT, class _Traits>
-inline
-basic_istream<_CharT, _Traits>&
-basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n)
-{
- return getline(__s, __n, this->widen('\n'));
-}
-
-template<class _CharT, class _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)
{
@@ -1251,18 +1198,35 @@ streamsize
basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
{
__gc_ = 0;
- streamsize __c = this->rdbuf()->in_avail();
- switch (__c)
- {
- case -1:
- this->setstate(ios_base::eofbit);
- break;
- case 0:
- break;
- default:
- read(__s, _VSTD::min(__c, __n));
- break;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ sentry __sen(*this, true);
+ if (__sen)
+ {
+ streamsize __c = this->rdbuf()->in_avail();
+ switch (__c)
+ {
+ case -1:
+ this->setstate(ios_base::eofbit);
+ break;
+ case 0:
+ break;
+ default:
+ read(__s, _VSTD::min(__c, __n));
+ break;
+ }
+ }
+ else
+ this->setstate(ios_base::failbit);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ this->__set_badbit_and_consider_rethrow();
}
+#endif // _LIBCPP_NO_EXCEPTIONS
return __gc_;
}
@@ -1459,21 +1423,21 @@ ws(basic_istream<_CharT, _Traits>& __is)
return __is;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Tp>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
-operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
+operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp&& __x)
{
- __is >> __x;
+ __is >> _VSTD::forward<_Tp>(__x);
return __is;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_iostream
+class _LIBCPP_TEMPLATE_VIS basic_iostream
: public basic_istream<_CharT, _Traits>,
public basic_ostream<_CharT, _Traits>
{
@@ -1486,41 +1450,36 @@ public:
typedef typename traits_type::off_type off_type;
// constructor/destructor
- explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
+ : basic_istream<_CharT, _Traits>(__sb)
+ {}
+
virtual ~basic_iostream();
protected:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
basic_iostream(basic_iostream&& __rhs);
-#endif
// assign/swap
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_iostream& operator=(basic_iostream&& __rhs);
#endif
- void swap(basic_iostream& __rhs);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void swap(basic_iostream& __rhs)
+ { basic_istream<char_type, traits_type>::swap(__rhs); }
public:
};
-template <class _CharT, class _Traits>
-inline
-basic_iostream<_CharT, _Traits>::basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
- : basic_istream<_CharT, _Traits>(__sb)
-{
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline
basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
{
}
template <class _CharT, class _Traits>
-inline
basic_iostream<_CharT, _Traits>&
basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
{
@@ -1528,21 +1487,13 @@ basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
basic_iostream<_CharT, _Traits>::~basic_iostream()
{
}
-template <class _CharT, class _Traits>
-inline
-void
-basic_iostream<_CharT, _Traits>::swap(basic_iostream& __rhs)
-{
- basic_istream<char_type, traits_type>::swap(__rhs);
-}
-
template<class _CharT, class _Traits, class _Allocator>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is,
@@ -1645,7 +1596,7 @@ getline(basic_istream<_CharT, _Traits>& __is,
}
template<class _CharT, class _Traits, class _Allocator>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Allocator>& __str)
@@ -1653,10 +1604,10 @@ getline(basic_istream<_CharT, _Traits>& __is,
return getline(__is, __str, __is.widen('\n'));
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template<class _CharT, class _Traits, class _Allocator>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
@@ -1665,7 +1616,7 @@ getline(basic_istream<_CharT, _Traits>&& __is,
}
template<class _CharT, class _Traits, class _Allocator>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Allocator>& __str)
@@ -1673,7 +1624,7 @@ getline(basic_istream<_CharT, _Traits>&& __is,
return getline(__is, __str, __is.widen('\n'));
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, size_t _Size>
basic_istream<_CharT, _Traits>&
@@ -1688,7 +1639,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
{
basic_string<_CharT, _Traits> __str;
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__is.getloc());
- streamsize __c = 0;
+ size_t __c = 0;
ios_base::iostate __err = ios_base::goodbit;
_CharT __zero = __ct.widen('0');
_CharT __one = __ct.widen('1');
@@ -1724,9 +1675,11 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
return __is;
}
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_istream<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_istream<wchar_t>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_iostream<char>)
+#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
+#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/iterator b/chromium/buildtools/third_party/libc++/trunk/include/iterator
index 8dd6bd59c1a..d163ab1b091 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/iterator
+++ b/chromium/buildtools/third_party/libc++/trunk/include/iterator
@@ -64,14 +64,23 @@ struct forward_iterator_tag : public input_iterator_tag {};
struct bidirectional_iterator_tag : public forward_iterator_tag {};
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
+// 27.4.3, iterator operations
// extension: second argument not conforming to C++03
-template <class InputIterator>
-void advance(InputIterator& i,
+template <class InputIterator> // constexpr in C++17
+ constexpr void advance(InputIterator& i,
typename iterator_traits<InputIterator>::difference_type n);
-template <class InputIterator>
-typename iterator_traits<InputIterator>::difference_type
-distance(InputIterator first, InputIterator last);
+template <class InputIterator> // constexpr in C++17
+ constexpr typename iterator_traits<InputIterator>::difference_type
+ distance(InputIterator first, InputIterator last);
+
+template <class InputIterator> // constexpr in C++17
+ constexpr InputIterator next(InputIterator x,
+typename iterator_traits<InputIterator>::difference_type n = 1);
+
+template <class BidirectionalIterator> // constexpr in C++17
+ constexpr BidirectionalIterator prev(BidirectionalIterator x,
+ typename iterator_traits<BidirectionalIterator>::difference_type n = 1);
template <class Iterator>
class reverse_iterator
@@ -89,56 +98,60 @@ public:
typedef typename iterator_traits<Iterator>::reference reference;
typedef typename iterator_traits<Iterator>::pointer pointer;
- reverse_iterator();
- explicit reverse_iterator(Iterator x);
- template <class U> reverse_iterator(const reverse_iterator<U>& u);
- Iterator base() const;
- reference operator*() const;
- pointer operator->() const;
- reverse_iterator& operator++();
- reverse_iterator operator++(int);
- reverse_iterator& operator--();
- reverse_iterator operator--(int);
- reverse_iterator operator+ (difference_type n) const;
- reverse_iterator& operator+=(difference_type n);
- reverse_iterator operator- (difference_type n) const;
- reverse_iterator& operator-=(difference_type n);
- reference operator[](difference_type n) const;
+ constexpr reverse_iterator();
+ constexpr explicit reverse_iterator(Iterator x);
+ template <class U> constexpr reverse_iterator(const reverse_iterator<U>& u);
+ template <class U> constexpr reverse_iterator& operator=(const reverse_iterator<U>& u);
+ constexpr Iterator base() const;
+ constexpr reference operator*() const;
+ constexpr pointer operator->() const;
+ constexpr reverse_iterator& operator++();
+ constexpr reverse_iterator operator++(int);
+ constexpr reverse_iterator& operator--();
+ constexpr reverse_iterator operator--(int);
+ constexpr reverse_iterator operator+ (difference_type n) const;
+ constexpr reverse_iterator& operator+=(difference_type n);
+ constexpr reverse_iterator operator- (difference_type n) const;
+ constexpr reverse_iterator& operator-=(difference_type n);
+ constexpr reference operator[](difference_type n) const;
};
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator==(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator<(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator!=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator>(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator>=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-bool
+constexpr bool // constexpr in C++17
operator<=(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
template <class Iterator1, class Iterator2>
-typename reverse_iterator<Iterator1>::difference_type
-operator-(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y);
+constexpr auto
+operator-(const reverse_iterator<Iterator1>& x, const reverse_iterator<Iterator2>& y)
+-> decltype(__y.base() - __x.base()); // constexpr in C++17
template <class Iterator>
-reverse_iterator<Iterator>
-operator+(typename reverse_iterator<Iterator>::difference_type n, const reverse_iterator<Iterator>& x);
+constexpr reverse_iterator<Iterator>
+operator+(typename reverse_iterator<Iterator>::difference_type n,
+ const reverse_iterator<Iterator>& x); // constexpr in C++17
-template <class Iterator> reverse_iterator<Iterator> make_reverse_iterator(Iterator i); // C++14
+template <class Iterator>
+constexpr reverse_iterator<Iterator> make_reverse_iterator(Iterator i); // C++14, constexpr in C++17
template <class Container>
class back_insert_iterator
@@ -149,7 +162,7 @@ public:
typedef Container container_type;
typedef void value_type;
typedef void difference_type;
- typedef back_insert_iterator<Cont>& reference;
+ typedef void reference;
typedef void pointer;
explicit back_insert_iterator(Container& x);
@@ -170,7 +183,7 @@ public:
typedef Container container_type;
typedef void value_type;
typedef void difference_type;
- typedef front_insert_iterator<Cont>& reference;
+ typedef void reference;
typedef void pointer;
explicit front_insert_iterator(Container& x);
@@ -192,7 +205,7 @@ public:
typedef Container container_type;
typedef void value_type;
typedef void difference_type;
- typedef insert_iterator<Cont>& reference;
+ typedef void reference;
typedef void pointer;
insert_iterator(Container& x, typename Container::iterator i);
@@ -205,6 +218,76 @@ public:
template <class Container, class Iterator>
insert_iterator<Container> inserter(Container& x, Iterator i);
+template <class Iterator>
+class move_iterator {
+public:
+ typedef Iterator iterator_type;
+ typedef typename iterator_traits<Iterator>::difference_type difference_type;
+ typedef Iterator pointer;
+ typedef typename iterator_traits<Iterator>::value_type value_type;
+ typedef typename iterator_traits<Iterator>::iterator_category iterator_category;
+ typedef value_type&& reference;
+
+ constexpr move_iterator(); // all the constexprs are in C++17
+ constexpr explicit move_iterator(Iterator i);
+ template <class U>
+ constexpr move_iterator(const move_iterator<U>& u);
+ template <class U>
+ constexpr move_iterator& operator=(const move_iterator<U>& u);
+ constexpr iterator_type base() const;
+ constexpr reference operator*() const;
+ constexpr pointer operator->() const;
+ constexpr move_iterator& operator++();
+ constexpr move_iterator operator++(int);
+ constexpr move_iterator& operator--();
+ constexpr move_iterator operator--(int);
+ constexpr move_iterator operator+(difference_type n) const;
+ constexpr move_iterator& operator+=(difference_type n);
+ constexpr move_iterator operator-(difference_type n) const;
+ constexpr move_iterator& operator-=(difference_type n);
+ constexpr unspecified operator[](difference_type n) const;
+private:
+ Iterator current; // exposition only
+};
+
+template <class Iterator1, class Iterator2>
+constexpr bool // constexpr in C++17
+operator==(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
+
+template <class Iterator1, class Iterator2>
+constexpr bool // constexpr in C++17
+operator!=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
+
+template <class Iterator1, class Iterator2>
+constexpr bool // constexpr in C++17
+operator<(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
+
+template <class Iterator1, class Iterator2>
+constexpr bool // constexpr in C++17
+operator<=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
+
+template <class Iterator1, class Iterator2>
+constexpr bool // constexpr in C++17
+operator>(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
+
+template <class Iterator1, class Iterator2>
+constexpr bool // constexpr in C++17
+operator>=(const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
+
+template <class Iterator1, class Iterator2>
+constexpr auto // constexpr in C++17
+operator-(const move_iterator<Iterator1>& x,
+ const move_iterator<Iterator2>& y) -> decltype(x.base() - y.base());
+
+template <class Iterator>
+constexpr move_iterator<Iterator> operator+( // constexpr in C++17
+ typename move_iterator<Iterator>::difference_type n,
+ const move_iterator<Iterator>& x);
+
+template <class Iterator> // constexpr in C++17
+constexpr move_iterator<Iterator> make_move_iterator(const Iterator& i);
+
+
template <class T, class charT = char, class traits = char_traits<charT>, class Distance = ptrdiff_t>
class istream_iterator
: public iterator<input_iterator_tag, T, Distance, const T*, const T&>
@@ -304,25 +387,25 @@ public:
bool failed() const noexcept;
};
-template <class C> auto begin(C& c) -> decltype(c.begin());
-template <class C> auto begin(const C& c) -> decltype(c.begin());
-template <class C> auto end(C& c) -> decltype(c.end());
-template <class C> auto end(const C& c) -> decltype(c.end());
-template <class T, size_t N> T* begin(T (&array)[N]);
-template <class T, size_t N> T* end(T (&array)[N]);
-
-template <class C> auto cbegin(const C& c) -> decltype(std::begin(c)); // C++14
-template <class C> auto cend(const C& c) -> decltype(std::end(c)); // C++14
-template <class C> auto rbegin(C& c) -> decltype(c.rbegin()); // C++14
-template <class C> auto rbegin(const C& c) -> decltype(c.rbegin()); // C++14
-template <class C> auto rend(C& c) -> decltype(c.rend()); // C++14
-template <class C> auto rend(const C& c) -> decltype(c.rend()); // C++14
-template <class E> reverse_iterator<const E*> rbegin(initializer_list<E> il); // C++14
-template <class E> reverse_iterator<const E*> rend(initializer_list<E> il); // C++14
-template <class T, size_t N> reverse_iterator<T*> rbegin(T (&array)[N]); // C++14
-template <class T, size_t N> reverse_iterator<T*> rend(T (&array)[N]); // C++14
-template <class C> auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14
-template <class C> auto crend(const C& c) -> decltype(std::rend(c)); // C++14
+template <class C> constexpr auto begin(C& c) -> decltype(c.begin());
+template <class C> constexpr auto begin(const C& c) -> decltype(c.begin());
+template <class C> constexpr auto end(C& c) -> decltype(c.end());
+template <class C> constexpr auto end(const C& c) -> decltype(c.end());
+template <class T, size_t N> constexpr T* begin(T (&array)[N]);
+template <class T, size_t N> constexpr T* end(T (&array)[N]);
+
+template <class C> auto constexpr cbegin(const C& c) -> decltype(std::begin(c)); // C++14
+template <class C> auto constexpr cend(const C& c) -> decltype(std::end(c)); // C++14
+template <class C> auto constexpr rbegin(C& c) -> decltype(c.rbegin()); // C++14
+template <class C> auto constexpr rbegin(const C& c) -> decltype(c.rbegin()); // C++14
+template <class C> auto constexpr rend(C& c) -> decltype(c.rend()); // C++14
+template <class C> constexpr auto rend(const C& c) -> decltype(c.rend()); // C++14
+template <class E> reverse_iterator<const E*> constexpr rbegin(initializer_list<E> il); // C++14
+template <class E> reverse_iterator<const E*> constexpr rend(initializer_list<E> il); // C++14
+template <class T, size_t N> reverse_iterator<T*> constexpr rbegin(T (&array)[N]); // C++14
+template <class T, size_t N> reverse_iterator<T*> constexpr rend(T (&array)[N]); // C++14
+template <class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14
+template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c)); // C++14
// 24.8, container access:
template <class C> constexpr auto size(const C& c) -> decltype(c.size()); // C++17
@@ -340,10 +423,10 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
*/
#include <__config>
+#include <iosfwd> // for forward declarations of vector and string.
#include <__functional_base>
#include <type_traits>
#include <cstddef>
-#include <iosfwd>
#include <initializer_list>
#ifdef __APPLE__
#include <Availability.h>
@@ -357,11 +440,11 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
_LIBCPP_BEGIN_NAMESPACE_STD
-struct _LIBCPP_TYPE_VIS_ONLY input_iterator_tag {};
-struct _LIBCPP_TYPE_VIS_ONLY output_iterator_tag {};
-struct _LIBCPP_TYPE_VIS_ONLY forward_iterator_tag : public input_iterator_tag {};
-struct _LIBCPP_TYPE_VIS_ONLY bidirectional_iterator_tag : public forward_iterator_tag {};
-struct _LIBCPP_TYPE_VIS_ONLY random_access_iterator_tag : public bidirectional_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS input_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS output_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS forward_iterator_tag : public input_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};
+struct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};
template <class _Tp>
struct __has_iterator_category
@@ -404,11 +487,11 @@ struct __iterator_traits<_Iter, true>
// the client expects instead of failing at compile time.
template <class _Iter>
-struct _LIBCPP_TYPE_VIS_ONLY iterator_traits
+struct _LIBCPP_TEMPLATE_VIS iterator_traits
: __iterator_traits<_Iter, __has_iterator_category<_Iter>::value> {};
template<class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY iterator_traits<_Tp*>
+struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
{
typedef ptrdiff_t difference_type;
typedef typename remove_const<_Tp>::type value_type;
@@ -437,9 +520,15 @@ struct __is_bidirectional_iterator : public __has_iterator_category_convertible_
template <class _Tp>
struct __is_random_access_iterator : public __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag> {};
+template <class _Tp>
+struct __is_exactly_input_iterator
+ : public integral_constant<bool,
+ __has_iterator_category_convertible_to<_Tp, input_iterator_tag>::value &&
+ !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};
+
template<class _Category, class _Tp, class _Distance = ptrdiff_t,
class _Pointer = _Tp*, class _Reference = _Tp&>
-struct _LIBCPP_TYPE_VIS_ONLY iterator
+struct _LIBCPP_TEMPLATE_VIS iterator
{
typedef _Tp value_type;
typedef _Distance difference_type;
@@ -449,7 +538,7 @@ struct _LIBCPP_TYPE_VIS_ONLY iterator
};
template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
void __advance(_InputIter& __i,
typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag)
{
@@ -458,7 +547,7 @@ void __advance(_InputIter& __i,
}
template <class _BiDirIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
void __advance(_BiDirIter& __i,
typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag)
{
@@ -471,7 +560,7 @@ void __advance(_BiDirIter& __i,
}
template <class _RandIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
void __advance(_RandIter& __i,
typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag)
{
@@ -479,7 +568,7 @@ void __advance(_RandIter& __i,
}
template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
void advance(_InputIter& __i,
typename iterator_traits<_InputIter>::difference_type __n)
{
@@ -487,7 +576,7 @@ void advance(_InputIter& __i,
}
template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
typename iterator_traits<_InputIter>::difference_type
__distance(_InputIter __first, _InputIter __last, input_iterator_tag)
{
@@ -498,7 +587,7 @@ __distance(_InputIter __first, _InputIter __last, input_iterator_tag)
}
template <class _RandIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
typename iterator_traits<_RandIter>::difference_type
__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
{
@@ -506,7 +595,7 @@ __distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
}
template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
typename iterator_traits<_InputIter>::difference_type
distance(_InputIter __first, _InputIter __last)
{
@@ -514,7 +603,7 @@ distance(_InputIter __first, _InputIter __last)
}
template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
_InputIter
next(_InputIter __x,
typename iterator_traits<_InputIter>::difference_type __n = 1,
@@ -525,7 +614,7 @@ next(_InputIter __x,
}
template <class _BidiretionalIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
_BidiretionalIter
prev(_BidiretionalIter __x,
typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
@@ -535,8 +624,16 @@ prev(_BidiretionalIter __x,
return __x;
}
+
+template <class _Tp, class = void>
+struct __is_stashing_iterator : false_type {};
+
+template <class _Tp>
+struct __is_stashing_iterator<_Tp, typename __void_t<typename _Tp::__stashing_iterator_tag>::type>
+ : true_type {};
+
template <class _Iter>
-class _LIBCPP_TYPE_VIS_ONLY reverse_iterator
+class _LIBCPP_TEMPLATE_VIS reverse_iterator
: public iterator<typename iterator_traits<_Iter>::iterator_category,
typename iterator_traits<_Iter>::value_type,
typename iterator_traits<_Iter>::difference_type,
@@ -544,7 +641,12 @@ class _LIBCPP_TYPE_VIS_ONLY reverse_iterator
typename iterator_traits<_Iter>::reference>
{
private:
- mutable _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break
+ /*mutable*/ _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break
+
+ static_assert(!__is_stashing_iterator<_Iter>::value,
+ "The specified iterator type cannot be used with reverse_iterator; "
+ "Using stashing iterators with reverse_iterator causes undefined behavior");
+
protected:
_Iter current;
public:
@@ -553,33 +655,45 @@ public:
typedef typename iterator_traits<_Iter>::reference reference;
typedef typename iterator_traits<_Iter>::pointer pointer;
- _LIBCPP_INLINE_VISIBILITY reverse_iterator() : current() {}
- _LIBCPP_INLINE_VISIBILITY explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
- template <class _Up> _LIBCPP_INLINE_VISIBILITY reverse_iterator(const reverse_iterator<_Up>& __u)
- : __t(__u.base()), current(__u.base()) {}
- _LIBCPP_INLINE_VISIBILITY _Iter base() const {return current;}
- _LIBCPP_INLINE_VISIBILITY reference operator*() const {_Iter __tmp = current; return *--__tmp;}
- _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return _VSTD::addressof(operator*());}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator++() {--current; return *this;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator operator++(int)
- {reverse_iterator __tmp(*this); --current; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator--() {++current; return *this;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator operator--(int)
- {reverse_iterator __tmp(*this); ++current; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator operator+ (difference_type __n) const
- {return reverse_iterator(current - __n);}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator+=(difference_type __n)
- {current -= __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator operator- (difference_type __n) const
- {return reverse_iterator(current + __n);}
- _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator-=(difference_type __n)
- {current += __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
- {return *(*this + __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator() : __t(), current() {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator(const reverse_iterator<_Up>& __u) : __t(__u.base()), current(__u.base()) {}
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator=(const reverse_iterator<_Up>& __u)
+ { __t = current = __u.base(); return *this; }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ _Iter base() const {return current;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator*() const {_Iter __tmp = current; return *--__tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ pointer operator->() const {return _VSTD::addressof(operator*());}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator++() {--current; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator++(int) {reverse_iterator __tmp(*this); --current; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator--() {++current; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator--(int) {reverse_iterator __tmp(*this); ++current; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator+ (difference_type __n) const {return reverse_iterator(current - __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator+=(difference_type __n) {current -= __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator operator- (difference_type __n) const {return reverse_iterator(current + __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator[](difference_type __n) const {return *(*this + __n);}
};
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -587,7 +701,7 @@ operator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -595,7 +709,7 @@ operator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -603,7 +717,7 @@ operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -611,7 +725,7 @@ operator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
@@ -619,13 +733,23 @@ operator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>&
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
{
return __x.base() >= __y.base();
}
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto
+operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
+-> decltype(__y.base() - __x.base())
+{
+ return __y.base() - __x.base();
+}
+#else
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
typename reverse_iterator<_Iter1>::difference_type
@@ -633,9 +757,10 @@ operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& _
{
return __y.base() - __x.base();
}
+#endif
template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator<_Iter>
operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x)
{
@@ -644,7 +769,7 @@ operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_i
#if _LIBCPP_STD_VER > 11
template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator<_Iter> make_reverse_iterator(_Iter __i)
{
return reverse_iterator<_Iter>(__i);
@@ -652,12 +777,12 @@ reverse_iterator<_Iter> make_reverse_iterator(_Iter __i)
#endif
template <class _Container>
-class _LIBCPP_TYPE_VIS_ONLY back_insert_iterator
+class _LIBCPP_TEMPLATE_VIS back_insert_iterator
: public iterator<output_iterator_tag,
void,
void,
void,
- back_insert_iterator<_Container>&>
+ void>
{
protected:
_Container* container;
@@ -667,10 +792,10 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value_)
{container->push_back(__value_); return *this;}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value_)
{container->push_back(_VSTD::move(__value_)); return *this;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*() {return *this;}
_LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++() {return *this;}
_LIBCPP_INLINE_VISIBILITY back_insert_iterator operator++(int) {return *this;}
@@ -685,12 +810,12 @@ back_inserter(_Container& __x)
}
template <class _Container>
-class _LIBCPP_TYPE_VIS_ONLY front_insert_iterator
+class _LIBCPP_TEMPLATE_VIS front_insert_iterator
: public iterator<output_iterator_tag,
void,
void,
void,
- front_insert_iterator<_Container>&>
+ void>
{
protected:
_Container* container;
@@ -700,10 +825,10 @@ public:
_LIBCPP_INLINE_VISIBILITY explicit front_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(const typename _Container::value_type& __value_)
{container->push_front(__value_); return *this;}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value_)
{container->push_front(_VSTD::move(__value_)); return *this;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*() {return *this;}
_LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++() {return *this;}
_LIBCPP_INLINE_VISIBILITY front_insert_iterator operator++(int) {return *this;}
@@ -718,12 +843,12 @@ front_inserter(_Container& __x)
}
template <class _Container>
-class _LIBCPP_TYPE_VIS_ONLY insert_iterator
+class _LIBCPP_TEMPLATE_VIS insert_iterator
: public iterator<output_iterator_tag,
void,
void,
void,
- insert_iterator<_Container>&>
+ void>
{
protected:
_Container* container;
@@ -735,10 +860,10 @@ public:
: container(_VSTD::addressof(__x)), iter(__i) {}
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(const typename _Container::value_type& __value_)
{iter = container->insert(iter, __value_); ++iter; return *this;}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value_)
{iter = container->insert(iter, _VSTD::move(__value_)); ++iter; return *this;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator*() {return *this;}
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator++() {return *this;}
_LIBCPP_INLINE_VISIBILITY insert_iterator& operator++(int) {return *this;}
@@ -754,7 +879,7 @@ inserter(_Container& __x, typename _Container::iterator __i)
template <class _Tp, class _CharT = char,
class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
-class _LIBCPP_TYPE_VIS_ONLY istream_iterator
+class _LIBCPP_TEMPLATE_VIS istream_iterator
: public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
{
public:
@@ -766,14 +891,14 @@ private:
_Tp __value_;
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {}
- _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(&__s)
+ _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))
{
if (!(*__in_stream_ >> __value_))
__in_stream_ = 0;
}
_LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}
- _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return &(operator*());}
+ _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return _VSTD::addressof((operator*()));}
_LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()
{
if (!(*__in_stream_ >> __value_))
@@ -793,7 +918,7 @@ public:
};
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY ostream_iterator
+class _LIBCPP_TEMPLATE_VIS ostream_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
public:
@@ -804,10 +929,10 @@ private:
ostream_type* __out_stream_;
const char_type* __delim_;
public:
- _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s)
- : __out_stream_(&__s), __delim_(0) {}
- _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter)
- : __out_stream_(&__s), __delim_(__delimiter) {}
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT
+ : __out_stream_(_VSTD::addressof(__s)), __delim_(0) {}
+ _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT
+ : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}
_LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)
{
*__out_stream_ << __value_;
@@ -822,7 +947,7 @@ public:
};
template<class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY istreambuf_iterator
+class _LIBCPP_TEMPLATE_VIS istreambuf_iterator
: public iterator<input_iterator_tag, _CharT,
typename _Traits::off_type, _CharT*,
_CharT>
@@ -865,7 +990,6 @@ public:
_LIBCPP_INLINE_VISIBILITY char_type operator*() const
{return static_cast<char_type>(__sbuf_->sgetc());}
- _LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;}
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
{
__sbuf_->sbumpc();
@@ -893,7 +1017,7 @@ bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
{return !__a.equal(__b);}
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY ostreambuf_iterator
+class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator
: public iterator<output_iterator_tag, void, void, void, void>
{
public:
@@ -934,7 +1058,7 @@ public:
};
template <class _Iter>
-class _LIBCPP_TYPE_VIS_ONLY move_iterator
+class _LIBCPP_TEMPLATE_VIS move_iterator
{
private:
_Iter __i;
@@ -943,47 +1067,52 @@ public:
typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
typedef typename iterator_traits<iterator_type>::value_type value_type;
typedef typename iterator_traits<iterator_type>::difference_type difference_type;
- typedef typename iterator_traits<iterator_type>::pointer pointer;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- typedef value_type&& reference;
+ typedef iterator_type pointer;
+#ifndef _LIBCPP_CXX03_LANG
+ typedef typename iterator_traits<iterator_type>::reference __reference;
+ typedef typename conditional<
+ is_reference<__reference>::value,
+ typename remove_reference<__reference>::type&&,
+ __reference
+ >::type reference;
#else
typedef typename iterator_traits<iterator_type>::reference reference;
#endif
- _LIBCPP_INLINE_VISIBILITY move_iterator() : __i() {}
- _LIBCPP_INLINE_VISIBILITY explicit move_iterator(_Iter __x) : __i(__x) {}
- template <class _Up> _LIBCPP_INLINE_VISIBILITY move_iterator(const move_iterator<_Up>& __u)
- : __i(__u.base()) {}
- _LIBCPP_INLINE_VISIBILITY _Iter base() const {return __i;}
- _LIBCPP_INLINE_VISIBILITY reference operator*() const {
- return static_cast<reference>(*__i);
- }
- _LIBCPP_INLINE_VISIBILITY pointer operator->() const {
- typename iterator_traits<iterator_type>::reference __ref = *__i;
- return &__ref;
- }
- _LIBCPP_INLINE_VISIBILITY move_iterator& operator++() {++__i; return *this;}
- _LIBCPP_INLINE_VISIBILITY move_iterator operator++(int)
- {move_iterator __tmp(*this); ++__i; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY move_iterator& operator--() {--__i; return *this;}
- _LIBCPP_INLINE_VISIBILITY move_iterator operator--(int)
- {move_iterator __tmp(*this); --__i; return __tmp;}
- _LIBCPP_INLINE_VISIBILITY move_iterator operator+ (difference_type __n) const
- {return move_iterator(__i + __n);}
- _LIBCPP_INLINE_VISIBILITY move_iterator& operator+=(difference_type __n)
- {__i += __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY move_iterator operator- (difference_type __n) const
- {return move_iterator(__i - __n);}
- _LIBCPP_INLINE_VISIBILITY move_iterator& operator-=(difference_type __n)
- {__i -= __n; return *this;}
- _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const
- {
- return static_cast<reference>(__i[__n]);
- }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator() : __i() {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ explicit move_iterator(_Iter __x) : __i(__x) {}
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _Iter base() const {return __i;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator*() const { return static_cast<reference>(*__i); }
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ pointer operator->() const { return __i;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator++() {++__i; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator++(int) {move_iterator __tmp(*this); ++__i; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator--() {--__i; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator--(int) {move_iterator __tmp(*this); --__i; return __tmp;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator+ (difference_type __n) const {return move_iterator(__i + __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator+=(difference_type __n) {__i += __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator operator- (difference_type __n) const {return move_iterator(__i - __n);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ move_iterator& operator-=(difference_type __n) {__i -= __n; return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ reference operator[](difference_type __n) const { return static_cast<reference>(__i[__n]); }
};
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -991,7 +1120,7 @@ operator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -999,7 +1128,7 @@ operator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1007,7 +1136,7 @@ operator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1015,7 +1144,7 @@ operator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
@@ -1023,13 +1152,23 @@ operator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
}
template <class _Iter1, class _Iter2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
bool
operator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
return __x.base() <= __y.base();
}
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto
+operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
+-> decltype(__x.base() - __y.base())
+{
+ return __x.base() - __y.base();
+}
+#else
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
typename move_iterator<_Iter1>::difference_type
@@ -1037,9 +1176,10 @@ operator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)
{
return __x.base() - __y.base();
}
+#endif
template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
move_iterator<_Iter>
operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x)
{
@@ -1047,7 +1187,7 @@ operator+(typename move_iterator<_Iter>::difference_type __n, const move_iterato
}
template <class _Iter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
move_iterator<_Iter>
make_move_iterator(_Iter __i)
{
@@ -1061,48 +1201,58 @@ template <class _Iter> class __wrap_iter;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
-operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
+auto
+operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
+-> decltype(__x.base() - __y.base());
+#else
template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
typename __wrap_iter<_Iter1>::difference_type
-operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
+#endif
template <class _Iter>
_LIBCPP_INLINE_VISIBILITY
__wrap_iter<_Iter>
-operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
+operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT_DEBUG;
template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY copy(_Ip, _Ip, _Op);
template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY copy_backward(_B1, _B1, _B2);
template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op);
template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);
+#if _LIBCPP_DEBUG_LEVEL < 2
+
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
typename enable_if
@@ -1112,6 +1262,19 @@ typename enable_if
>::type
__unwrap_iter(__wrap_iter<_Tp*>);
+#else
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if
+<
+ is_trivially_copy_assignable<_Tp>::value,
+ __wrap_iter<_Tp*>
+>::type
+__unwrap_iter(__wrap_iter<_Tp*> __i);
+
+#endif
+
template <class _Iter>
class __wrap_iter
{
@@ -1125,7 +1288,7 @@ public:
private:
iterator_type __i;
public:
- _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT_DEBUG
#if _LIBCPP_STD_VER > 11
: __i{}
#endif
@@ -1135,7 +1298,7 @@ public:
#endif
}
template <class _Up> _LIBCPP_INLINE_VISIBILITY __wrap_iter(const __wrap_iter<_Up>& __u,
- typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
+ typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT_DEBUG
: __i(__u.base())
{
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1165,7 +1328,7 @@ public:
__get_db()->__erase_i(this);
}
#endif
- _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
@@ -1173,15 +1336,15 @@ public:
#endif
return *__i;
}
- _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable iterator");
#endif
- return (pointer)&reinterpret_cast<const volatile char&>(*__i);
+ return (pointer)_VSTD::addressof(*__i);
}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
@@ -1190,9 +1353,9 @@ public:
++__i;
return *this;
}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT_DEBUG
{__wrap_iter __tmp(*this); ++(*this); return __tmp;}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
@@ -1201,11 +1364,11 @@ public:
--__i;
return *this;
}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT_DEBUG
{__wrap_iter __tmp(*this); --(*this); return __tmp;}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT_DEBUG
{__wrap_iter __w(*this); __w += __n; return __w;}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
@@ -1214,11 +1377,11 @@ public:
__i += __n;
return *this;
}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT_DEBUG
{return *this + (-__n);}
- _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT_DEBUG
{*this += -__n; return *this;}
- _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT
+ _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
@@ -1227,7 +1390,7 @@ public:
return __i[__n];
}
- _LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT {return __i;}
+ _LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT_DEBUG {return __i;}
private:
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1236,58 +1399,67 @@ private:
__get_db()->__insert_ic(this, __p);
}
#else
- _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
+ _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT_DEBUG : __i(__x) {}
#endif
template <class _Up> friend class __wrap_iter;
template <class _CharT, class _Traits, class _Alloc> friend class basic_string;
- template <class _Tp, class _Alloc> friend class _LIBCPP_TYPE_VIS_ONLY vector;
+ template <class _Tp, class _Alloc> friend class _LIBCPP_TEMPLATE_VIS vector;
template <class _Iter1, class _Iter2>
friend
bool
- operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
template <class _Iter1, class _Iter2>
friend
bool
- operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _Iter1, class _Iter2>
+ friend
+ auto
+ operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
+ -> decltype(__x.base() - __y.base());
+#else
template <class _Iter1, class _Iter2>
friend
typename __wrap_iter<_Iter1>::difference_type
- operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
+ operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;
+#endif
template <class _Iter1>
friend
__wrap_iter<_Iter1>
- operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT;
+ operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT_DEBUG;
template <class _Ip, class _Op> friend _Op copy(_Ip, _Ip, _Op);
template <class _B1, class _B2> friend _B2 copy_backward(_B1, _B1, _B2);
template <class _Ip, class _Op> friend _Op move(_Ip, _Ip, _Op);
template <class _B1, class _B2> friend _B2 move_backward(_B1, _B1, _B2);
+#if _LIBCPP_DEBUG_LEVEL < 2
template <class _Tp>
friend
typename enable_if
@@ -1296,12 +1468,22 @@ private:
_Tp*
>::type
__unwrap_iter(__wrap_iter<_Tp*>);
+#else
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ typename enable_if
+ <
+ is_trivially_copy_assignable<_Tp>::value,
+ __wrap_iter<_Tp*>
+ >::type
+ __unwrap_iter(__wrap_iter<_Tp*> __i);
+#endif
};
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return __x.base() == __y.base();
}
@@ -1309,7 +1491,7 @@ operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
@@ -1321,7 +1503,7 @@ operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return !(__x == __y);
}
@@ -1329,7 +1511,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return __y < __x;
}
@@ -1337,7 +1519,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return !(__x < __y);
}
@@ -1345,7 +1527,7 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
return !(__y < __x);
}
@@ -1353,7 +1535,7 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
template <class _Iter1>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
{
return !(__x == __y);
}
@@ -1361,7 +1543,7 @@ operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX
template <class _Iter1>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
{
return __y < __x;
}
@@ -1369,7 +1551,7 @@ operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXC
template <class _Iter1>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
{
return !(__x < __y);
}
@@ -1377,15 +1559,29 @@ operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEX
template <class _Iter1>
inline _LIBCPP_INLINE_VISIBILITY
bool
-operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG
{
return !(__y < __x);
}
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Iter1, class _Iter2>
+inline _LIBCPP_INLINE_VISIBILITY
+auto
+operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
+-> decltype(__x.base() - __y.base())
+{
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
+ "Attempted to subtract incompatible iterators");
+#endif
+ return __x.base() - __y.base();
+}
+#else
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
typename __wrap_iter<_Iter1>::difference_type
-operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
+operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
@@ -1393,17 +1589,35 @@ operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXC
#endif
return __x.base() - __y.base();
}
+#endif
template <class _Iter>
inline _LIBCPP_INLINE_VISIBILITY
__wrap_iter<_Iter>
operator+(typename __wrap_iter<_Iter>::difference_type __n,
- __wrap_iter<_Iter> __x) _NOEXCEPT
+ __wrap_iter<_Iter> __x) _NOEXCEPT_DEBUG
{
__x += __n;
return __x;
}
+template <class _Iter>
+struct __libcpp_is_trivial_iterator
+ : public _LIBCPP_BOOL_CONSTANT(is_pointer<_Iter>::value) {};
+
+template <class _Iter>
+struct __libcpp_is_trivial_iterator<move_iterator<_Iter> >
+ : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
+
+template <class _Iter>
+struct __libcpp_is_trivial_iterator<reverse_iterator<_Iter> >
+ : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
+
+template <class _Iter>
+struct __libcpp_is_trivial_iterator<__wrap_iter<_Iter> >
+ : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};
+
+
template <class _Tp, size_t _Np>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp*
@@ -1420,10 +1634,10 @@ end(_Tp (&__array)[_Np])
return __array + _Np;
}
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#if !defined(_LIBCPP_CXX03_LANG)
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto
begin(_Cp& __c) -> decltype(__c.begin())
{
@@ -1431,7 +1645,7 @@ begin(_Cp& __c) -> decltype(__c.begin())
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto
begin(const _Cp& __c) -> decltype(__c.begin())
{
@@ -1439,7 +1653,7 @@ begin(const _Cp& __c) -> decltype(__c.begin())
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto
end(_Cp& __c) -> decltype(__c.end())
{
@@ -1447,7 +1661,7 @@ end(_Cp& __c) -> decltype(__c.end())
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto
end(const _Cp& __c) -> decltype(__c.end())
{
@@ -1457,28 +1671,28 @@ end(const _Cp& __c) -> decltype(__c.end())
#if _LIBCPP_STD_VER > 11
template <class _Tp, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np])
{
return reverse_iterator<_Tp*>(__array + _Np);
}
template <class _Tp, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np])
{
return reverse_iterator<_Tp*>(__array);
}
template <class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il)
{
return reverse_iterator<const _Ep*>(__il.end());
}
template <class _Ep>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il)
{
return reverse_iterator<const _Ep*>(__il.begin());
@@ -1486,64 +1700,64 @@ reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il)
template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-auto cbegin(const _Cp& __c) -> decltype(begin(__c))
+auto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c))
{
- return begin(__c);
+ return _VSTD::begin(__c);
}
template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-auto cend(const _Cp& __c) -> decltype(end(__c))
+auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c))
{
- return end(__c);
+ return _VSTD::end(__c);
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto rbegin(_Cp& __c) -> decltype(__c.rbegin())
{
return __c.rbegin();
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto rbegin(const _Cp& __c) -> decltype(__c.rbegin())
{
return __c.rbegin();
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto rend(_Cp& __c) -> decltype(__c.rend())
{
return __c.rend();
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
auto rend(const _Cp& __c) -> decltype(__c.rend())
{
return __c.rend();
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
-auto crbegin(const _Cp& __c) -> decltype(rbegin(__c))
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c))
{
- return rbegin(__c);
+ return _VSTD::rbegin(__c);
}
template <class _Cp>
-inline _LIBCPP_INLINE_VISIBILITY
-auto crend(const _Cp& __c) -> decltype(rend(__c))
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
{
- return rend(__c);
+ return _VSTD::rend(__c);
}
#endif
-#else // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#else // defined(_LIBCPP_CXX03_LANG)
template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1577,20 +1791,20 @@ end(const _Cp& __c)
return __c.end();
}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#endif // !defined(_LIBCPP_CXX03_LANG)
#if _LIBCPP_STD_VER > 14
template <class _Cont>
constexpr auto size(const _Cont& __c) -> decltype(__c.size()) { return __c.size(); }
template <class _Tp, size_t _Sz>
-constexpr size_t size(const _Tp (&__array)[_Sz]) noexcept { return _Sz; }
+constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
template <class _Cont>
constexpr auto empty(const _Cont& __c) -> decltype(__c.empty()) { return __c.empty(); }
template <class _Tp, size_t _Sz>
-constexpr bool empty(const _Tp (&__array)[_Sz]) noexcept { return false; }
+constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }
template <class _Ep>
constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/limits b/chromium/buildtools/third_party/libc++/trunk/include/limits
index ce967ea1b23..4755c57cf90 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/limits
+++ b/chromium/buildtools/third_party/libc++/trunk/include/limits
@@ -101,18 +101,18 @@ template<> class numeric_limits<cv long double>;
} // std
*/
+#include <__config>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
-#include <__config>
#include <type_traits>
#include <__undef_min_max>
-#if defined(_LIBCPP_MSVCRT)
-#include "support/win32/limits_win32.h"
+#if defined(_LIBCPP_COMPILER_MSVC)
+#include "support/win32/limits_msvc_win32.h"
#endif // _LIBCPP_MSVCRT
#if defined(__IBMCPP__)
@@ -182,7 +182,7 @@ protected:
static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
};
-template <class _Tp, int digits, bool is_signed>
+template <class _Tp, int digits, bool _IsSigned>
struct __libcpp_compute_min
{
static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << digits);
@@ -237,7 +237,8 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_bounded = true;
static _LIBCPP_CONSTEXPR const bool is_modulo = !_VSTD::is_signed<_Tp>::value;
-#if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || \
+ defined(__wasm__)
static _LIBCPP_CONSTEXPR const bool traps = true;
#else
static _LIBCPP_CONSTEXPR const bool traps = false;
@@ -305,7 +306,7 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_signed = true;
static _LIBCPP_CONSTEXPR const int digits = __FLT_MANT_DIG__;
static _LIBCPP_CONSTEXPR const int digits10 = __FLT_DIG__;
- static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l;
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __FLT_MIN__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __FLT_MAX__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
@@ -351,7 +352,7 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_signed = true;
static _LIBCPP_CONSTEXPR const int digits = __DBL_MANT_DIG__;
static _LIBCPP_CONSTEXPR const int digits10 = __DBL_DIG__;
- static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l;
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __DBL_MIN__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __DBL_MAX__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
@@ -397,7 +398,7 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_signed = true;
static _LIBCPP_CONSTEXPR const int digits = __LDBL_MANT_DIG__;
static _LIBCPP_CONSTEXPR const int digits10 = __LDBL_DIG__;
- static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103)/100000;
+ static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l;
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __LDBL_MIN__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __LDBL_MAX__;}
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();}
@@ -437,7 +438,7 @@ protected:
};
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY numeric_limits
+class _LIBCPP_TEMPLATE_VIS numeric_limits
: private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
{
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
@@ -530,7 +531,7 @@ template <class _Tp>
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style;
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY numeric_limits<const _Tp>
+class _LIBCPP_TEMPLATE_VIS numeric_limits<const _Tp>
: private numeric_limits<_Tp>
{
typedef numeric_limits<_Tp> __base;
@@ -623,7 +624,7 @@ template <class _Tp>
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<const _Tp>::round_style;
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY numeric_limits<volatile _Tp>
+class _LIBCPP_TEMPLATE_VIS numeric_limits<volatile _Tp>
: private numeric_limits<_Tp>
{
typedef numeric_limits<_Tp> __base;
@@ -716,7 +717,7 @@ template <class _Tp>
_LIBCPP_CONSTEXPR const float_round_style numeric_limits<volatile _Tp>::round_style;
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY numeric_limits<const volatile _Tp>
+class _LIBCPP_TEMPLATE_VIS numeric_limits<const volatile _Tp>
: private numeric_limits<_Tp>
{
typedef numeric_limits<_Tp> __base;
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/limits.h b/chromium/buildtools/third_party/libc++/trunk/include/limits.h
new file mode 100644
index 00000000000..1867b104857
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/limits.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+//===--------------------------- limits.h ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_LIMITS_H
+#define _LIBCPP_LIMITS_H
+
+/*
+ limits.h synopsis
+
+Macros:
+
+ CHAR_BIT
+ SCHAR_MIN
+ SCHAR_MAX
+ UCHAR_MAX
+ CHAR_MIN
+ CHAR_MAX
+ MB_LEN_MAX
+ SHRT_MIN
+ SHRT_MAX
+ USHRT_MAX
+ INT_MIN
+ INT_MAX
+ UINT_MAX
+ LONG_MIN
+ LONG_MAX
+ ULONG_MAX
+ LLONG_MIN // C99
+ LLONG_MAX // C99
+ ULLONG_MAX // C99
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#ifndef __GNUC__
+#include_next <limits.h>
+#else
+// GCC header limits.h recursively includes itself through another header called
+// syslimits.h for some reason. This setup breaks down if we directly
+// #include_next GCC's limits.h (reasons not entirely clear to me). Therefore,
+// we manually re-create the necessary include sequence below:
+
+// Get the system limits.h defines (force recurse into the next level)
+#define _GCC_LIMITS_H_
+#define _GCC_NEXT_LIMITS_H
+#include_next <limits.h>
+
+// Get the ISO C defines
+#undef _GCC_LIMITS_H_
+#include_next <limits.h>
+#endif // __GNUC__
+
+#endif // _LIBCPP_LIMITS_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/list b/chromium/buildtools/third_party/libc++/trunk/include/list
index 28d505582c0..5e76d110337 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/list
+++ b/chromium/buildtools/third_party/libc++/trunk/include/list
@@ -93,10 +93,10 @@ public:
size_type max_size() const noexcept;
template <class... Args>
- void emplace_front(Args&&... args);
+ reference emplace_front(Args&&... args); // reference in C++17
void pop_front();
template <class... Args>
- void emplace_back(Args&&... args);
+ reference emplace_back(Args&&... args); // reference in C++17
void pop_back();
void push_front(const value_type& x);
void push_front(value_type&& x);
@@ -175,6 +175,7 @@ template <class T, class Alloc>
#include <initializer_list>
#include <iterator>
#include <algorithm>
+#include <type_traits>
#include <__undef_min_max>
@@ -187,25 +188,66 @@ template <class T, class Alloc>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp, class _VoidPtr> struct __list_node;
+template <class _Tp, class _VoidPtr> struct __list_node_base;
+
+template <class _Tp, class _VoidPtr>
+struct __list_node_pointer_traits {
+ typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
+ __node_pointer;
+ typedef typename __rebind_pointer<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >::type
+ __base_pointer;
+
+#if defined(_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB)
+ typedef __base_pointer __link_pointer;
+#else
+ typedef typename conditional<
+ is_pointer<_VoidPtr>::value,
+ __base_pointer,
+ __node_pointer
+ >::type __link_pointer;
+#endif
+
+ typedef typename conditional<
+ is_same<__link_pointer, __node_pointer>::value,
+ __base_pointer,
+ __node_pointer
+ >::type __non_link_pointer;
+
+ static _LIBCPP_INLINE_VISIBILITY
+ __link_pointer __unsafe_link_pointer_cast(__link_pointer __p) {
+ return __p;
+ }
+
+ static _LIBCPP_INLINE_VISIBILITY
+ __link_pointer __unsafe_link_pointer_cast(__non_link_pointer __p) {
+ return static_cast<__link_pointer>(static_cast<_VoidPtr>(__p));
+ }
+
+};
template <class _Tp, class _VoidPtr>
struct __list_node_base
{
- typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
- pointer;
- typedef typename __rebind_pointer<_VoidPtr, __list_node_base>::type
- __base_pointer;
+ typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits;
+ typedef typename _NodeTraits::__node_pointer __node_pointer;
+ typedef typename _NodeTraits::__base_pointer __base_pointer;
+ typedef typename _NodeTraits::__link_pointer __link_pointer;
- pointer __prev_;
- pointer __next_;
+ __link_pointer __prev_;
+ __link_pointer __next_;
_LIBCPP_INLINE_VISIBILITY
- __list_node_base() : __prev_(__self()), __next_(__self()) {}
+ __list_node_base() : __prev_(_NodeTraits::__unsafe_link_pointer_cast(__self())),
+ __next_(_NodeTraits::__unsafe_link_pointer_cast(__self())) {}
_LIBCPP_INLINE_VISIBILITY
- pointer __self()
- {
- return static_cast<pointer>(pointer_traits<__base_pointer>::pointer_to(*this));
+ __base_pointer __self() {
+ return pointer_traits<__base_pointer>::pointer_to(*this);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __node_pointer __as_node() {
+ return static_cast<__node_pointer>(__self());
}
};
@@ -214,30 +256,38 @@ struct __list_node
: public __list_node_base<_Tp, _VoidPtr>
{
_Tp __value_;
+
+ typedef __list_node_base<_Tp, _VoidPtr> __base;
+ typedef typename __base::__link_pointer __link_pointer;
+
+ _LIBCPP_INLINE_VISIBILITY
+ __link_pointer __as_link() {
+ return static_cast<__link_pointer>(__base::__self());
+ }
};
-template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCPP_TYPE_VIS_ONLY list;
+template <class _Tp, class _Alloc = allocator<_Tp> > class _LIBCPP_TEMPLATE_VIS list;
template <class _Tp, class _Alloc> class __list_imp;
-template <class _Tp, class _VoidPtr> class _LIBCPP_TYPE_VIS_ONLY __list_const_iterator;
+template <class _Tp, class _VoidPtr> class _LIBCPP_TEMPLATE_VIS __list_const_iterator;
template <class _Tp, class _VoidPtr>
-class _LIBCPP_TYPE_VIS_ONLY __list_iterator
+class _LIBCPP_TEMPLATE_VIS __list_iterator
{
- typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
- __node_pointer;
+ typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits;
+ typedef typename _NodeTraits::__link_pointer __link_pointer;
- __node_pointer __ptr_;
+ __link_pointer __ptr_;
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- explicit __list_iterator(__node_pointer __p, const void* __c) _NOEXCEPT
+ explicit __list_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
: __ptr_(__p)
{
__get_db()->__insert_ic(this, __c);
}
#else
_LIBCPP_INLINE_VISIBILITY
- explicit __list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
+ explicit __list_iterator(__link_pointer __p) _NOEXCEPT : __ptr_(__p) {}
#endif
@@ -295,7 +345,7 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable list::iterator");
#endif
- return __ptr_->__value_;
+ return __ptr_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const
@@ -304,7 +354,7 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable list::iterator");
#endif
- return pointer_traits<pointer>::pointer_to(__ptr_->__value_);
+ return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_);
}
_LIBCPP_INLINE_VISIBILITY
@@ -344,23 +394,23 @@ public:
};
template <class _Tp, class _VoidPtr>
-class _LIBCPP_TYPE_VIS_ONLY __list_const_iterator
+class _LIBCPP_TEMPLATE_VIS __list_const_iterator
{
- typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
- __node_pointer;
+ typedef __list_node_pointer_traits<_Tp, _VoidPtr> _NodeTraits;
+ typedef typename _NodeTraits::__link_pointer __link_pointer;
- __node_pointer __ptr_;
+ __link_pointer __ptr_;
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
- explicit __list_const_iterator(__node_pointer __p, const void* __c) _NOEXCEPT
+ explicit __list_const_iterator(__link_pointer __p, const void* __c) _NOEXCEPT
: __ptr_(__p)
{
__get_db()->__insert_ic(this, __c);
}
#else
_LIBCPP_INLINE_VISIBILITY
- explicit __list_const_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
+ explicit __list_const_iterator(__link_pointer __p) _NOEXCEPT : __ptr_(__p) {}
#endif
template<class, class> friend class list;
@@ -422,7 +472,7 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable list::const_iterator");
#endif
- return __ptr_->__value_;
+ return __ptr_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const
@@ -431,7 +481,7 @@ public:
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable list::iterator");
#endif
- return pointer_traits<pointer>::pointer_to(__ptr_->__value_);
+ return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_);
}
_LIBCPP_INLINE_VISIBILITY
@@ -489,6 +539,9 @@ protected:
typedef allocator_traits<__node_allocator> __node_alloc_traits;
typedef typename __node_alloc_traits::pointer __node_pointer;
typedef typename __node_alloc_traits::pointer __node_const_pointer;
+ typedef __list_node_pointer_traits<value_type, __void_pointer> __node_pointer_traits;
+ typedef typename __node_pointer_traits::__link_pointer __link_pointer;
+ typedef __link_pointer __link_const_pointer;
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
typedef typename __alloc_traits::difference_type difference_type;
@@ -500,6 +553,12 @@ protected:
__compressed_pair<size_type, __node_allocator> __size_alloc_;
_LIBCPP_INLINE_VISIBILITY
+ __link_pointer __end_as_link() const _NOEXCEPT {
+ return __node_pointer_traits::__unsafe_link_pointer_cast(
+ const_cast<__node_base&>(__end_).__self());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
size_type& __sz() _NOEXCEPT {return __size_alloc_.first();}
_LIBCPP_INLINE_VISIBILITY
const size_type& __sz() const _NOEXCEPT
@@ -511,10 +570,17 @@ protected:
const __node_allocator& __node_alloc() const _NOEXCEPT
{return __size_alloc_.second();}
- static void __unlink_nodes(__node_pointer __f, __node_pointer __l) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type __node_alloc_max_size() const _NOEXCEPT {
+ return __node_alloc_traits::max_size(__node_alloc());
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ static void __unlink_nodes(__link_pointer __f, __link_pointer __l) _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
__list_imp()
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value);
+ _LIBCPP_INLINE_VISIBILITY
__list_imp(const allocator_type& __a);
~__list_imp();
void clear() _NOEXCEPT;
@@ -543,30 +609,26 @@ protected:
iterator end() _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(static_cast<__node_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(__end_)), this);
+ return iterator(__end_as_link(), this);
#else
- return iterator(static_cast<__node_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(__end_)));
+ return iterator(__end_as_link());
#endif
}
_LIBCPP_INLINE_VISIBILITY
const_iterator end() const _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
- return const_iterator(static_cast<__node_const_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(const_cast<__node_base&>(__end_))), this);
+ return const_iterator(__end_as_link(), this);
#else
- return const_iterator(static_cast<__node_const_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(const_cast<__node_base&>(__end_))));
+ return const_iterator(__end_as_link());
#endif
}
void swap(__list_imp& __c)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
+ _NOEXCEPT_DEBUG;
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
@@ -593,7 +655,7 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __copy_assign_alloc(const __list_imp& __c, false_type)
+ void __copy_assign_alloc(const __list_imp&, false_type)
{}
_LIBCPP_INLINE_VISIBILITY
@@ -604,16 +666,23 @@ private:
}
_LIBCPP_INLINE_VISIBILITY
- void __move_assign_alloc(__list_imp& __c, false_type)
+ void __move_assign_alloc(__list_imp&, false_type)
_NOEXCEPT
{}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void __invalidate_all_iterators() {
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__invalidate_all(this);
+#endif
+ }
};
// Unlink nodes [__f, __l]
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
-__list_imp<_Tp, _Alloc>::__unlink_nodes(__node_pointer __f, __node_pointer __l)
+__list_imp<_Tp, _Alloc>::__unlink_nodes(__link_pointer __f, __link_pointer __l)
_NOEXCEPT
{
__f->__prev_->__next_ = __l->__next_;
@@ -621,7 +690,7 @@ __list_imp<_Tp, _Alloc>::__unlink_nodes(__node_pointer __f, __node_pointer __l)
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__list_imp<_Tp, _Alloc>::__list_imp()
_NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
: __size_alloc_(0)
@@ -629,7 +698,7 @@ __list_imp<_Tp, _Alloc>::__list_imp()
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
__list_imp<_Tp, _Alloc>::__list_imp(const allocator_type& __a)
: __size_alloc_(0, __node_allocator(__a))
{
@@ -651,33 +720,18 @@ __list_imp<_Tp, _Alloc>::clear() _NOEXCEPT
if (!empty())
{
__node_allocator& __na = __node_alloc();
- __node_pointer __f = __end_.__next_;
- __node_pointer __l = static_cast<__node_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(__end_));
+ __link_pointer __f = __end_.__next_;
+ __link_pointer __l = __end_as_link();
__unlink_nodes(__f, __l->__prev_);
__sz() = 0;
while (__f != __l)
{
- __node_pointer __n = __f;
+ __node_pointer __np = __f->__as_node();
__f = __f->__next_;
- __node_alloc_traits::destroy(__na, _VSTD::addressof(__n->__value_));
- __node_alloc_traits::deallocate(__na, __n, 1);
- }
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->__ptr_ != __l)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
+ __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+ __node_alloc_traits::deallocate(__na, __np, 1);
}
- __get_db()->unlock();
-#endif
+ __invalidate_all_iterators();
}
}
@@ -685,9 +739,9 @@ template <class _Tp, class _Alloc>
void
__list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
+ _NOEXCEPT_DEBUG
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value)
#endif
{
@@ -700,13 +754,13 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
swap(__sz(), __c.__sz());
swap(__end_, __c.__end_);
if (__sz() == 0)
- __end_.__next_ = __end_.__prev_ = __end_.__self();
+ __end_.__next_ = __end_.__prev_ = __end_as_link();
else
- __end_.__prev_->__next_ = __end_.__next_->__prev_ = __end_.__self();
+ __end_.__prev_->__next_ = __end_.__next_->__prev_ = __end_as_link();
if (__c.__sz() == 0)
- __c.__end_.__next_ = __c.__end_.__prev_ = __c.__end_.__self();
+ __c.__end_.__next_ = __c.__end_.__prev_ = __c.__end_as_link();
else
- __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_.__self();
+ __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_ = __c.__end_as_link();
#if _LIBCPP_DEBUG_LEVEL >= 2
__libcpp_db* __db = __get_db();
@@ -719,8 +773,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
{
--__p;
const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->__ptr_ == static_cast<__node_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(__c.__end_)))
+ if (__i->__ptr_ == __c.__end_as_link())
{
__cn2->__add(*__p);
if (--__cn1->end_ != __p)
@@ -733,8 +786,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
{
--__p;
const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->__ptr_ == static_cast<__node_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(__end_)))
+ if (__i->__ptr_ == __end_as_link())
{
__cn1->__add(*__p);
if (--__cn2->end_ != __p)
@@ -748,7 +800,7 @@ __list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
}
template <class _Tp, class _Alloc /*= allocator<_Tp>*/>
-class _LIBCPP_TYPE_VIS_ONLY list
+class _LIBCPP_TEMPLATE_VIS list
: private __list_imp<_Tp, _Alloc>
{
typedef __list_imp<_Tp, _Alloc> base;
@@ -758,6 +810,7 @@ class _LIBCPP_TYPE_VIS_ONLY list
typedef typename base::__node_alloc_traits __node_alloc_traits;
typedef typename base::__node_base __node_base;
typedef typename base::__node_base_pointer __node_base_pointer;
+ typedef typename base::__link_pointer __link_pointer;
public:
typedef _Tp value_type;
@@ -805,36 +858,38 @@ public:
list(const list& __c);
list(const list& __c, const allocator_type& __a);
+ _LIBCPP_INLINE_VISIBILITY
list& operator=(const list& __c);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
list(initializer_list<value_type> __il);
list(initializer_list<value_type> __il, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+ _LIBCPP_INLINE_VISIBILITY
list(list&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
+ _LIBCPP_INLINE_VISIBILITY
list(list&& __c, const allocator_type& __a);
+ _LIBCPP_INLINE_VISIBILITY
list& operator=(list&& __c)
_NOEXCEPT_(
__node_alloc_traits::propagate_on_container_move_assignment::value &&
is_nothrow_move_assignable<__node_allocator>::value);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
_LIBCPP_INLINE_VISIBILITY
list& operator=(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end()); return *this;}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+ _LIBCPP_INLINE_VISIBILITY
+ void assign(initializer_list<value_type> __il)
+ {assign(__il.begin(), __il.end());}
+#endif // _LIBCPP_CXX03_LANG
template <class _InpIter>
void assign(_InpIter __f, _InpIter __l,
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
void assign(size_type __n, const value_type& __x);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
- void assign(initializer_list<value_type> __il)
- {assign(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
@@ -843,7 +898,11 @@ public:
bool empty() const _NOEXCEPT {return base::empty();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const _NOEXCEPT
- {return numeric_limits<difference_type>::max();}
+ {
+ return std::min<size_type>(
+ base::__node_alloc_max_size(),
+ numeric_limits<difference_type >::max());
+ }
_LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT {return base::begin();}
@@ -881,40 +940,52 @@ public:
reference front()
{
_LIBCPP_ASSERT(!empty(), "list::front called on empty list");
- return base::__end_.__next_->__value_;
+ return base::__end_.__next_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference front() const
{
_LIBCPP_ASSERT(!empty(), "list::front called on empty list");
- return base::__end_.__next_->__value_;
+ return base::__end_.__next_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
reference back()
{
_LIBCPP_ASSERT(!empty(), "list::back called on empty list");
- return base::__end_.__prev_->__value_;
+ return base::__end_.__prev_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference back() const
{
_LIBCPP_ASSERT(!empty(), "list::back called on empty list");
- return base::__end_.__prev_->__value_;
+ return base::__end_.__prev_->__as_node()->__value_;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
void push_front(value_type&& __x);
void push_back(value_type&& __x);
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+
template <class... _Args>
- void emplace_front(_Args&&... __args);
+#if _LIBCPP_STD_VER > 14
+ reference emplace_front(_Args&&... __args);
+#else
+ void emplace_front(_Args&&... __args);
+#endif
template <class... _Args>
- void emplace_back(_Args&&... __args);
+#if _LIBCPP_STD_VER > 14
+ reference emplace_back(_Args&&... __args);
+#else
+ void emplace_back(_Args&&... __args);
+#endif
template <class... _Args>
iterator emplace(const_iterator __p, _Args&&... __args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
+
iterator insert(const_iterator __p, value_type&& __x);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, initializer_list<value_type> __il)
+ {return insert(__p, __il.begin(), __il.end());}
+#endif // _LIBCPP_CXX03_LANG
void push_front(const value_type& __x);
void push_back(const value_type& __x);
@@ -924,18 +995,13 @@ public:
template <class _InpIter>
iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, initializer_list<value_type> __il)
- {return insert(__p, __il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
void swap(list& __c)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
+ _NOEXCEPT_DEBUG
#else
- _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__node_alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<__node_allocator>::value)
#endif
{base::swap(__c);}
@@ -952,42 +1018,42 @@ public:
void resize(size_type __n, const value_type& __x);
void splice(const_iterator __p, list& __c);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void splice(const_iterator __p, list&& __c) {splice(__p, __c);}
-#endif
- void splice(const_iterator __p, list& __c, const_iterator __i);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
void splice(const_iterator __p, list&& __c, const_iterator __i)
{splice(__p, __c, __i);}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
{splice(__p, __c, __f, __l);}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
+ void splice(const_iterator __p, list& __c, const_iterator __i);
+ void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
void remove(const value_type& __x);
template <class _Pred> void remove_if(_Pred __pred);
+ _LIBCPP_INLINE_VISIBILITY
void unique();
template <class _BinaryPred>
void unique(_BinaryPred __binary_pred);
+ _LIBCPP_INLINE_VISIBILITY
void merge(list& __c);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void merge(list&& __c) {merge(__c);}
+
+ template <class _Comp>
+ _LIBCPP_INLINE_VISIBILITY
+ void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
#endif
template <class _Comp>
void merge(list& __c, _Comp __comp);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _Comp>
+
_LIBCPP_INLINE_VISIBILITY
- void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void sort();
template <class _Comp>
+ _LIBCPP_INLINE_VISIBILITY
void sort(_Comp __comp);
void reverse() _NOEXCEPT;
@@ -1004,9 +1070,12 @@ public:
#endif // _LIBCPP_DEBUG_LEVEL >= 2
private:
- static void __link_nodes (__node_pointer __p, __node_pointer __f, __node_pointer __l);
- void __link_nodes_at_front(__node_pointer __f, __node_pointer __l);
- void __link_nodes_at_back (__node_pointer __f, __node_pointer __l);
+ _LIBCPP_INLINE_VISIBILITY
+ static void __link_nodes (__link_pointer __p, __link_pointer __f, __link_pointer __l);
+ _LIBCPP_INLINE_VISIBILITY
+ void __link_nodes_at_front(__link_pointer __f, __link_pointer __l);
+ _LIBCPP_INLINE_VISIBILITY
+ void __link_nodes_at_back (__link_pointer __f, __link_pointer __l);
iterator __iterator(size_type __n);
template <class _Comp>
static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp);
@@ -1018,9 +1087,9 @@ private:
// Link in nodes [__f, __l] just prior to __p
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
-list<_Tp, _Alloc>::__link_nodes(__node_pointer __p, __node_pointer __f, __node_pointer __l)
+list<_Tp, _Alloc>::__link_nodes(__link_pointer __p, __link_pointer __f, __link_pointer __l)
{
__p->__prev_->__next_ = __f;
__f->__prev_ = __p->__prev_;
@@ -1030,11 +1099,11 @@ list<_Tp, _Alloc>::__link_nodes(__node_pointer __p, __node_pointer __f, __node_p
// Link in nodes [__f, __l] at the front of the list
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
-list<_Tp, _Alloc>::__link_nodes_at_front(__node_pointer __f, __node_pointer __l)
+list<_Tp, _Alloc>::__link_nodes_at_front(__link_pointer __f, __link_pointer __l)
{
- __f->__prev_ = base::__end_.__self();
+ __f->__prev_ = base::__end_as_link();
__l->__next_ = base::__end_.__next_;
__l->__next_->__prev_ = __l;
base::__end_.__next_ = __f;
@@ -1042,11 +1111,11 @@ list<_Tp, _Alloc>::__link_nodes_at_front(__node_pointer __f, __node_pointer __l)
// Link in nodes [__f, __l] at the front of the list
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
-list<_Tp, _Alloc>::__link_nodes_at_back(__node_pointer __f, __node_pointer __l)
+list<_Tp, _Alloc>::__link_nodes_at_back(__link_pointer __f, __link_pointer __l)
{
- __l->__next_ = base::__end_.__self();
+ __l->__next_ = base::__end_as_link();
__f->__prev_ = base::__end_.__prev_;
__f->__prev_->__next_ = __f;
base::__end_.__prev_ = __l;
@@ -1054,7 +1123,7 @@ list<_Tp, _Alloc>::__link_nodes_at_back(__node_pointer __f, __node_pointer __l)
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::__iterator(size_type __n)
{
@@ -1069,7 +1138,7 @@ list<_Tp, _Alloc>::list(size_type __n)
__get_db()->__insert_c(this);
#endif
for (; __n > 0; --__n)
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
emplace_back();
#else
push_back(value_type());
@@ -1084,11 +1153,7 @@ list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
__get_db()->__insert_c(this);
#endif
for (; __n > 0; --__n)
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
emplace_back();
-#else
- push_back(value_type());
-#endif
}
#endif
@@ -1162,7 +1227,7 @@ list<_Tp, _Alloc>::list(const list& __c, const allocator_type& __a)
push_back(*__i);
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
@@ -1187,25 +1252,8 @@ list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
push_back(*__i);
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
-list<_Tp, _Alloc>&
-list<_Tp, _Alloc>::operator=(const list& __c)
-{
- if (this != &__c)
- {
- base::__copy_assign_alloc(__c);
- assign(__c.begin(), __c.end());
- }
- return *this;
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
list<_Tp, _Alloc>::list(list&& __c)
_NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
: base(allocator_type(_VSTD::move(__c.__node_alloc())))
@@ -1217,7 +1265,7 @@ list<_Tp, _Alloc>::list(list&& __c)
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
: base(__a)
{
@@ -1234,7 +1282,7 @@ list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
list<_Tp, _Alloc>&
list<_Tp, _Alloc>::operator=(list&& __c)
_NOEXCEPT_(
@@ -1269,7 +1317,20 @@ list<_Tp, _Alloc>::__move_assign(list& __c, true_type)
splice(end(), __c);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
+
+template <class _Tp, class _Alloc>
+inline
+list<_Tp, _Alloc>&
+list<_Tp, _Alloc>::operator=(const list& __c)
+{
+ if (this != &__c)
+ {
+ base::__copy_assign_alloc(__c);
+ assign(__c.begin(), __c.end());
+ }
+ return *this;
+}
template <class _Tp, class _Alloc>
template <class _InpIter>
@@ -1285,6 +1346,9 @@ list<_Tp, _Alloc>::assign(_InpIter __f, _InpIter __l,
insert(__e, __f, __l);
else
erase(__i, __e);
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__invalidate_all(this);
+#endif
}
template <class _Tp, class _Alloc>
@@ -1299,10 +1363,13 @@ list<_Tp, _Alloc>::assign(size_type __n, const value_type& __x)
insert(__e, __n, __x);
else
erase(__i, __e);
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__invalidate_all(this);
+#endif
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
_Alloc
list<_Tp, _Alloc>::get_allocator() const _NOEXCEPT
{
@@ -1323,12 +1390,12 @@ list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
- __link_nodes(__p.__ptr_, __hold.get(), __hold.get());
+ __link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link());
++base::__sz();
#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(__hold.release(), this);
+ return iterator(__hold.release()->__as_link(), this);
#else
- return iterator(__hold.release());
+ return iterator(__hold.release()->__as_link());
#endif
}
@@ -1354,9 +1421,9 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
++__ds;
#if _LIBCPP_DEBUG_LEVEL >= 2
- __r = iterator(__hold.get(), this);
+ __r = iterator(__hold->__as_link(), this);
#else
- __r = iterator(__hold.get());
+ __r = iterator(__hold->__as_link());
#endif
__hold.release();
iterator __e = __r;
@@ -1368,7 +1435,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
- __e.__ptr_->__next_ = __hold.get();
+ __e.__ptr_->__next_ = __hold->__as_link();
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
@@ -1379,8 +1446,8 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
while (true)
{
__node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
- __node_pointer __prev = __e.__ptr_->__prev_;
- __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
+ __link_pointer __prev = __e.__ptr_->__prev_;
+ __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1422,9 +1489,9 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
++__ds;
#if _LIBCPP_DEBUG_LEVEL >= 2
- __r = iterator(__hold.get(), this);
+ __r = iterator(__hold.get()->__as_link(), this);
#else
- __r = iterator(__hold.get());
+ __r = iterator(__hold.get()->__as_link());
#endif
__hold.release();
iterator __e = __r;
@@ -1436,7 +1503,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
- __e.__ptr_->__next_ = __hold.get();
+ __e.__ptr_->__next_ = __hold.get()->__as_link();
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
@@ -1447,8 +1514,8 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
while (true)
{
__node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
- __node_pointer __prev = __e.__ptr_->__prev_;
- __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
+ __link_pointer __prev = __e.__ptr_->__prev_;
+ __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1474,7 +1541,8 @@ list<_Tp, _Alloc>::push_front(const value_type& __x)
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
- __link_nodes_at_front(__hold.get(), __hold.get());
+ __link_pointer __nl = __hold->__as_link();
+ __link_nodes_at_front(__nl, __nl);
++base::__sz();
__hold.release();
}
@@ -1487,12 +1555,12 @@ list<_Tp, _Alloc>::push_back(const value_type& __x)
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
- __link_nodes_at_back(__hold.get(), __hold.get());
+ __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link());
++base::__sz();
__hold.release();
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
void
@@ -1502,7 +1570,7 @@ list<_Tp, _Alloc>::push_front(value_type&& __x)
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
- __link_nodes_at_front(__hold.get(), __hold.get());
+ __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
++base::__sz();
__hold.release();
}
@@ -1515,39 +1583,54 @@ list<_Tp, _Alloc>::push_back(value_type&& __x)
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
- __link_nodes_at_back(__hold.get(), __hold.get());
+ __link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link());
++base::__sz();
__hold.release();
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Alloc>
template <class... _Args>
+#if _LIBCPP_STD_VER > 14
+typename list<_Tp, _Alloc>::reference
+#else
void
+#endif
list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
{
__node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
- __link_nodes_at_front(__hold.get(), __hold.get());
+ __link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
++base::__sz();
+#if _LIBCPP_STD_VER > 14
+ return __hold.release()->__value_;
+#else
__hold.release();
+#endif
}
template <class _Tp, class _Alloc>
template <class... _Args>
+#if _LIBCPP_STD_VER > 14
+typename list<_Tp, _Alloc>::reference
+#else
void
+#endif
list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
{
__node_allocator& __na = base::__node_alloc();
typedef __allocator_destructor<__node_allocator> _Dp;
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
- __link_nodes_at_back(__hold.get(), __hold.get());
+ __link_pointer __nl = __hold->__as_link();
+ __link_nodes_at_back(__nl, __nl);
++base::__sz();
+#if _LIBCPP_STD_VER > 14
+ return __hold.release()->__value_;
+#else
__hold.release();
+#endif
}
template <class _Tp, class _Alloc>
@@ -1565,17 +1648,17 @@ list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
- __link_nodes(__p.__ptr_, __hold.get(), __hold.get());
+ __link_pointer __nl = __hold.get()->__as_link();
+ __link_nodes(__p.__ptr_, __nl, __nl);
++base::__sz();
+ __hold.release();
#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(__hold.release(), this);
+ return iterator(__nl, this);
#else
- return iterator(__hold.release());
+ return iterator(__nl);
#endif
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
@@ -1590,16 +1673,18 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
__hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
- __link_nodes(__p.__ptr_, __hold.get(), __hold.get());
+ __link_pointer __nl = __hold->__as_link();
+ __link_nodes(__p.__ptr_, __nl, __nl);
++base::__sz();
+ __hold.release();
#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(__hold.release(), this);
+ return iterator(__nl, this);
#else
- return iterator(__hold.release());
+ return iterator(__nl);
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Alloc>
void
@@ -1607,7 +1692,7 @@ list<_Tp, _Alloc>::pop_front()
{
_LIBCPP_ASSERT(!empty(), "list::pop_front() called with empty list");
__node_allocator& __na = base::__node_alloc();
- __node_pointer __n = base::__end_.__next_;
+ __link_pointer __n = base::__end_.__next_;
base::__unlink_nodes(__n, __n);
--base::__sz();
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1625,8 +1710,9 @@ list<_Tp, _Alloc>::pop_front()
}
__get_db()->unlock();
#endif
- __node_alloc_traits::destroy(__na, _VSTD::addressof(__n->__value_));
- __node_alloc_traits::deallocate(__na, __n, 1);
+ __node_pointer __np = __n->__as_node();
+ __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+ __node_alloc_traits::deallocate(__na, __np, 1);
}
template <class _Tp, class _Alloc>
@@ -1635,7 +1721,7 @@ list<_Tp, _Alloc>::pop_back()
{
_LIBCPP_ASSERT(!empty(), "list::pop_back() called with empty list");
__node_allocator& __na = base::__node_alloc();
- __node_pointer __n = base::__end_.__prev_;
+ __link_pointer __n = base::__end_.__prev_;
base::__unlink_nodes(__n, __n);
--base::__sz();
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1653,8 +1739,9 @@ list<_Tp, _Alloc>::pop_back()
}
__get_db()->unlock();
#endif
- __node_alloc_traits::destroy(__na, _VSTD::addressof(__n->__value_));
- __node_alloc_traits::deallocate(__na, __n, 1);
+ __node_pointer __np = __n->__as_node();
+ __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+ __node_alloc_traits::deallocate(__na, __np, 1);
}
template <class _Tp, class _Alloc>
@@ -1669,27 +1756,28 @@ list<_Tp, _Alloc>::erase(const_iterator __p)
_LIBCPP_ASSERT(__p != end(),
"list::erase(iterator) called with a non-dereferenceable iterator");
__node_allocator& __na = base::__node_alloc();
- __node_pointer __n = __p.__ptr_;
- __node_pointer __r = __n->__next_;
+ __link_pointer __n = __p.__ptr_;
+ __link_pointer __r = __n->__next_;
base::__unlink_nodes(__n, __n);
--base::__sz();
#if _LIBCPP_DEBUG_LEVEL >= 2
__c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
+ for (__i_node** __ip = __c->end_; __ip != __c->beg_; )
{
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
+ --__ip;
+ iterator* __i = static_cast<iterator*>((*__ip)->__i_);
if (__i->__ptr_ == __n)
{
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ (*__ip)->__c_ = nullptr;
+ if (--__c->end_ != __ip)
+ memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*));
}
}
__get_db()->unlock();
#endif
- __node_alloc_traits::destroy(__na, _VSTD::addressof(__n->__value_));
- __node_alloc_traits::deallocate(__na, __n, 1);
+ __node_pointer __np = __n->__as_node();
+ __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+ __node_alloc_traits::deallocate(__na, __np, 1);
#if _LIBCPP_DEBUG_LEVEL >= 2
return iterator(__r, this);
#else
@@ -1705,6 +1793,9 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == this,
"list::erase(iterator, iterator) called with an iterator not"
" referring to this list");
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == this,
+ "list::erase(iterator, iterator) called with an iterator not"
+ " referring to this list");
#endif
if (__f != __l)
{
@@ -1712,7 +1803,7 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
base::__unlink_nodes(__f.__ptr_, __l.__ptr_->__prev_);
while (__f != __l)
{
- __node_pointer __n = __f.__ptr_;
+ __link_pointer __n = __f.__ptr_;
++__f;
--base::__sz();
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1730,8 +1821,9 @@ list<_Tp, _Alloc>::erase(const_iterator __f, const_iterator __l)
}
__get_db()->unlock();
#endif
- __node_alloc_traits::destroy(__na, _VSTD::addressof(__n->__value_));
- __node_alloc_traits::deallocate(__na, __n, 1);
+ __node_pointer __np = __n->__as_node();
+ __node_alloc_traits::destroy(__na, _VSTD::addressof(__np->__value_));
+ __node_alloc_traits::deallocate(__na, __np, 1);
}
}
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1758,9 +1850,9 @@ list<_Tp, _Alloc>::resize(size_type __n)
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
++__ds;
#if _LIBCPP_DEBUG_LEVEL >= 2
- iterator __r = iterator(__hold.release(), this);
+ iterator __r = iterator(__hold.release()->__as_link(), this);
#else
- iterator __r = iterator(__hold.release());
+ iterator __r = iterator(__hold.release()->__as_link());
#endif
iterator __e = __r;
#ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1771,7 +1863,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
- __e.__ptr_->__next_ = __hold.get();
+ __e.__ptr_->__next_ = __hold.get()->__as_link();
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
@@ -1782,8 +1874,8 @@ list<_Tp, _Alloc>::resize(size_type __n)
while (true)
{
__node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
- __node_pointer __prev = __e.__ptr_->__prev_;
- __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
+ __link_pointer __prev = __e.__ptr_->__prev_;
+ __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1816,10 +1908,11 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
__hold->__prev_ = 0;
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
++__ds;
+ __link_pointer __nl = __hold.release()->__as_link();
#if _LIBCPP_DEBUG_LEVEL >= 2
- iterator __r = iterator(__hold.release(), this);
+ iterator __r = iterator(__nl, this);
#else
- iterator __r = iterator(__hold.release());
+ iterator __r = iterator(__nl);
#endif
iterator __e = __r;
#ifndef _LIBCPP_NO_EXCEPTIONS
@@ -1830,7 +1923,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
{
__hold.reset(__node_alloc_traits::allocate(__na, 1));
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
- __e.__ptr_->__next_ = __hold.get();
+ __e.__ptr_->__next_ = __hold.get()->__as_link();
__hold->__prev_ = __e.__ptr_;
__hold.release();
}
@@ -1841,8 +1934,8 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
while (true)
{
__node_alloc_traits::destroy(__na, _VSTD::addressof(*__e));
- __node_pointer __prev = __e.__ptr_->__prev_;
- __node_alloc_traits::deallocate(__na, __e.__ptr_, 1);
+ __link_pointer __prev = __e.__ptr_->__prev_;
+ __node_alloc_traits::deallocate(__na, __e.__ptr_->__as_node(), 1);
if (__prev == 0)
break;
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1854,8 +1947,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
throw;
}
#endif // _LIBCPP_NO_EXCEPTIONS
- __link_nodes(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::
- pointer_to(base::__end_)), __r.__ptr_, __e.__ptr_);
+ __link_nodes(base::__end_as_link(), __r.__ptr_, __e.__ptr_);
base::__sz() += __ds;
}
}
@@ -1873,8 +1965,8 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
#endif
if (!__c.empty())
{
- __node_pointer __f = __c.__end_.__next_;
- __node_pointer __l = __c.__end_.__prev_;
+ __link_pointer __f = __c.__end_.__next_;
+ __link_pointer __l = __c.__end_.__prev_;
base::__unlink_nodes(__f, __l);
__link_nodes(__p.__ptr_, __f, __l);
base::__sz() += __c.__sz();
@@ -1883,17 +1975,16 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__c_node* __cn2 = __db->__find_c(&__c);
- for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
+ for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
{
- --__p;
- iterator* __i = static_cast<iterator*>((*__p)->__i_);
- if (__i->__ptr_ != static_cast<__node_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(__c.__end_)))
+ --__ip;
+ iterator* __i = static_cast<iterator*>((*__ip)->__i_);
+ if (__i->__ptr_ != __c.__end_as_link())
{
- __cn1->__add(*__p);
- (*__p)->__c_ = __cn1;
- if (--__cn2->end_ != __p)
- memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+ __cn1->__add(*__ip);
+ (*__ip)->__c_ = __cn1;
+ if (--__cn2->end_ != __ip)
+ memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
__db->unlock();
@@ -1918,7 +2009,7 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
#endif
if (__p.__ptr_ != __i.__ptr_ && __p.__ptr_ != __i.__ptr_->__next_)
{
- __node_pointer __f = __i.__ptr_;
+ __link_pointer __f = __i.__ptr_;
base::__unlink_nodes(__f, __f);
__link_nodes(__p.__ptr_, __f, __f);
--__c.__sz();
@@ -1927,16 +2018,16 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__c_node* __cn2 = __db->__find_c(&__c);
- for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
+ for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
{
- --__p;
- iterator* __j = static_cast<iterator*>((*__p)->__i_);
+ --__ip;
+ iterator* __j = static_cast<iterator*>((*__ip)->__i_);
if (__j->__ptr_ == __f)
{
- __cn1->__add(*__p);
- (*__p)->__c_ = __cn1;
- if (--__cn2->end_ != __p)
- memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+ __cn1->__add(*__ip);
+ (*__ip)->__c_ = __cn1;
+ if (--__cn2->end_ != __ip)
+ memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
__db->unlock();
@@ -1972,28 +2063,28 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
__c.__sz() -= __s;
base::__sz() += __s;
}
- __node_pointer __first = __f.__ptr_;
+ __link_pointer __first = __f.__ptr_;
--__l;
- __node_pointer __last = __l.__ptr_;
+ __link_pointer __last = __l.__ptr_;
base::__unlink_nodes(__first, __last);
__link_nodes(__p.__ptr_, __first, __last);
#if _LIBCPP_DEBUG_LEVEL >= 2
__libcpp_db* __db = __get_db();
__c_node* __cn1 = __db->__find_c_and_lock(this);
__c_node* __cn2 = __db->__find_c(&__c);
- for (__i_node** __p = __cn2->end_; __p != __cn2->beg_;)
+ for (__i_node** __ip = __cn2->end_; __ip != __cn2->beg_;)
{
- --__p;
- iterator* __j = static_cast<iterator*>((*__p)->__i_);
- for (__node_pointer __k = __f.__ptr_;
+ --__ip;
+ iterator* __j = static_cast<iterator*>((*__ip)->__i_);
+ for (__link_pointer __k = __f.__ptr_;
__k != __l.__ptr_; __k = __k->__next_)
{
if (__j->__ptr_ == __k)
{
- __cn1->__add(*__p);
- (*__p)->__c_ = __cn1;
- if (--__cn2->end_ != __p)
- memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*));
+ __cn1->__add(*__ip);
+ (*__ip)->__c_ = __cn1;
+ if (--__cn2->end_ != __ip)
+ memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*));
}
}
}
@@ -2006,7 +2097,7 @@ template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::remove(const value_type& __x)
{
- list<_Tp, _Alloc> __deleted_nodes; // collect the nodes we're removing
+ list<_Tp, _Alloc> __deleted_nodes(get_allocator()); // collect the nodes we're removing
for (const_iterator __i = begin(), __e = end(); __i != __e;)
{
if (*__i == __x)
@@ -2046,7 +2137,7 @@ list<_Tp, _Alloc>::remove_if(_Pred __pred)
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
list<_Tp, _Alloc>::unique()
{
@@ -2069,7 +2160,7 @@ list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred)
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
list<_Tp, _Alloc>::merge(list& __c)
{
@@ -2097,8 +2188,8 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
;
base::__sz() += __ds;
__c.__sz() -= __ds;
- __node_pointer __f = __f2.__ptr_;
- __node_pointer __l = __m2.__ptr_->__prev_;
+ __link_pointer __f = __f2.__ptr_;
+ __link_pointer __l = __m2.__ptr_->__prev_;
__f2 = __m2;
base::__unlink_nodes(__f, __l);
__m2 = _VSTD::next(__f1);
@@ -2117,8 +2208,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
{
--__p;
iterator* __i = static_cast<iterator*>((*__p)->__i_);
- if (__i->__ptr_ != static_cast<__node_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(__c.__end_)))
+ if (__i->__ptr_ != __c.__end_as_link())
{
__cn1->__add(*__p);
(*__p)->__c_ = __cn1;
@@ -2132,7 +2222,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
}
template <class _Tp, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
list<_Tp, _Alloc>::sort()
{
@@ -2141,7 +2231,7 @@ list<_Tp, _Alloc>::sort()
template <class _Tp, class _Alloc>
template <class _Comp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
list<_Tp, _Alloc>::sort(_Comp __comp)
{
@@ -2161,7 +2251,7 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
case 2:
if (__comp(*--__e2, *__f1))
{
- __node_pointer __f = __e2.__ptr_;
+ __link_pointer __f = __e2.__ptr_;
base::__unlink_nodes(__f, __f);
__link_nodes(__f1.__ptr_, __f, __f);
return __e2;
@@ -2177,8 +2267,8 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
iterator __m2 = _VSTD::next(__f2);
for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
;
- __node_pointer __f = __f2.__ptr_;
- __node_pointer __l = __m2.__ptr_->__prev_;
+ __link_pointer __f = __f2.__ptr_;
+ __link_pointer __l = __m2.__ptr_->__prev_;
__r = __f2;
__e1 = __f2 = __m2;
base::__unlink_nodes(__f, __l);
@@ -2195,8 +2285,8 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
iterator __m2 = _VSTD::next(__f2);
for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
;
- __node_pointer __f = __f2.__ptr_;
- __node_pointer __l = __m2.__ptr_->__prev_;
+ __link_pointer __f = __f2.__ptr_;
+ __link_pointer __l = __m2.__ptr_->__prev_;
if (__e1 == __f2)
__e1 = __m2;
__f2 = __m2;
@@ -2240,8 +2330,7 @@ template <class _Tp, class _Alloc>
bool
list<_Tp, _Alloc>::__dereferenceable(const const_iterator* __i) const
{
- return __i->__ptr_ != static_cast<__node_pointer>(
- pointer_traits<__node_base_pointer>::pointer_to(const_cast<__node_base&>(this->__end_)));
+ return __i->__ptr_ != this->__end_as_link();
}
template <class _Tp, class _Alloc>
@@ -2253,14 +2342,14 @@ list<_Tp, _Alloc>::__decrementable(const const_iterator* __i) const
template <class _Tp, class _Alloc>
bool
-list<_Tp, _Alloc>::__addable(const const_iterator* __i, ptrdiff_t __n) const
+list<_Tp, _Alloc>::__addable(const const_iterator*, ptrdiff_t) const
{
return false;
}
template <class _Tp, class _Alloc>
bool
-list<_Tp, _Alloc>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
+list<_Tp, _Alloc>::__subscriptable(const const_iterator*, ptrdiff_t) const
{
return false;
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/locale b/chromium/buildtools/third_party/libc++/trunk/include/locale
index 84cb5a5ef6c..d29a2dc70a5 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/locale
+++ b/chromium/buildtools/third_party/libc++/trunk/include/locale
@@ -180,6 +180,7 @@ template <class charT> class messages_byname;
#include <__config>
#include <__locale>
+#include <__debug>
#include <algorithm>
#include <memory>
#include <ios>
@@ -213,6 +214,12 @@ template <class charT> class messages_byname;
#pragma GCC system_header
#endif
+#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
+#include <__bsd_locale_defaults.h>
+#else
+#include <__bsd_locale_fallbacks.h>
+#endif
+
_LIBCPP_BEGIN_NAMESPACE_STD
#if defined(__APPLE__) || defined(__FreeBSD__)
@@ -226,192 +233,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#define __cloc_defined
#endif
-typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
-typedef _VSTD::unique_ptr<__locale_struct, decltype(&freelocale)> __locale_unique_ptr;
-#ifndef _LIBCPP_LOCALE__L_EXTENSIONS
-typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
-#endif
-
-// OSX has nice foo_l() functions that let you turn off use of the global
-// locale. Linux, not so much. The following functions avoid the locale when
-// that's possible and otherwise do the wrong thing. FIXME.
-#if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(_AIX) || \
- defined(_NEWLIB_VERSION) || defined(__GLIBC__)
-
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
-decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
-inline _LIBCPP_INLINE_VISIBILITY
-__mb_cur_max_l(locale_t __l)
-{
- return MB_CUR_MAX_L(__l);
-}
-#else // _LIBCPP_LOCALE__L_EXTENSIONS
-inline _LIBCPP_ALWAYS_INLINE
-decltype(MB_CUR_MAX) __mb_cur_max_l(locale_t __l)
-{
- __locale_raii __current(uselocale(__l), uselocale);
- return MB_CUR_MAX;
-}
-#endif // _LIBCPP_LOCALE__L_EXTENSIONS
-
-inline _LIBCPP_ALWAYS_INLINE
-wint_t __btowc_l(int __c, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return btowc_l(__c, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return btowc(__c);
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-int __wctob_l(wint_t __c, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return wctob_l(__c, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return wctob(__c);
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-size_t __wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
- size_t __len, mbstate_t *__ps, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return wcsnrtombs_l(__dest, __src, __nwc, __len, __ps, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-size_t __wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return wcrtomb_l(__s, __wc, __ps, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return wcrtomb(__s, __wc, __ps);
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-size_t __mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
- size_t __len, mbstate_t *__ps, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return mbsnrtowcs_l(__dest, __src, __nms, __len, __ps, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-size_t __mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
- mbstate_t *__ps, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return mbrtowc_l(__pwc, __s, __n, __ps, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return mbrtowc(__pwc, __s, __n, __ps);
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-int __mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return mbtowc_l(__pwc, __pmb, __max, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return mbtowc(__pwc, __pmb, __max);
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-size_t __mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return mbrlen_l(__s, __n, __ps, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return mbrlen(__s, __n, __ps);
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-lconv *__localeconv_l(locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return localeconv_l(__l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return localeconv();
-#endif
-}
-
-inline _LIBCPP_ALWAYS_INLINE
-size_t __mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
- mbstate_t *__ps, locale_t __l)
-{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return mbsrtowcs_l(__dest, __src, __len, __ps, __l);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- return mbsrtowcs(__dest, __src, __len, __ps);
-#endif
-}
-
-inline
-int __snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
- va_list __va;
- va_start(__va, __format);
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int __res = vsnprintf_l(__s, __n, __l, __format, __va);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- int __res = vsnprintf(__s, __n, __format, __va);
-#endif
- va_end(__va);
- return __res;
-}
-
-inline
-int __asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
- va_list __va;
- va_start(__va, __format);
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int __res = vasprintf_l(__s, __l, __format, __va);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- int __res = vasprintf(__s, __format, __va);
-#endif
- va_end(__va);
- return __res;
-}
-
-inline
-int __sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
- va_list __va;
- va_start(__va, __format);
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int __res = vsscanf_l(__s, __l, __format, __va);
-#else
- __locale_raii __current(uselocale(__l), uselocale);
- int __res = vsscanf(__s, __format, __va);
-#endif
- va_end(__va);
- return __res;
-}
-
-#endif // __linux__
-
// __scan_keyword
// Scans [__b, __e) until a match is found in the basic_strings range
// [__kb, __ke) or until it can be shown that there is no match in [__kb, __ke).
@@ -699,11 +520,11 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
return 0;
}
-_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get<wchar_t>)
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY num_get
+class _LIBCPP_TEMPLATE_VIS num_get
: public locale::facet,
private __num_get<_CharT>
{
@@ -799,16 +620,19 @@ protected:
~num_get() {}
template <class _Fp>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
iter_type __do_get_floating_point
(iter_type __b, iter_type __e, ios_base& __iob,
ios_base::iostate& __err, _Fp& __v) const;
template <class _Signed>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
iter_type __do_get_signed
(iter_type __b, iter_type __e, ios_base& __iob,
ios_base::iostate& __err, _Signed& __v) const;
template <class _Unsigned>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
iter_type __do_get_unsigned
(iter_type __b, iter_type __e, ios_base& __iob,
ios_base::iostate& __err, _Unsigned& __v) const;
@@ -933,6 +757,29 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
}
template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY
+_Tp __do_strtod(const char* __a, char** __p2);
+
+template <>
+inline _LIBCPP_INLINE_VISIBILITY
+float __do_strtod<float>(const char* __a, char** __p2) {
+ return strtof_l(__a, __p2, _LIBCPP_GET_C_LOCALE);
+}
+
+template <>
+inline _LIBCPP_INLINE_VISIBILITY
+double __do_strtod<double>(const char* __a, char** __p2) {
+ return strtod_l(__a, __p2, _LIBCPP_GET_C_LOCALE);
+}
+
+template <>
+inline _LIBCPP_INLINE_VISIBILITY
+long double __do_strtod<long double>(const char* __a, char** __p2) {
+ return strtold_l(__a, __p2, _LIBCPP_GET_C_LOCALE);
+}
+
+template <class _Tp>
+_LIBCPP_HIDDEN
_Tp
__num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
{
@@ -941,7 +788,7 @@ __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
typename remove_reference<decltype(errno)>::type __save_errno = errno;
errno = 0;
char *__p2;
- long double __ld = strtold_l(__a, &__p2, _LIBCPP_GET_C_LOCALE);
+ _Tp __ld = __do_strtod<_Tp>(__a, &__p2);
typename remove_reference<decltype(errno)>::type __current_errno = errno;
if (__current_errno == 0)
errno = __save_errno;
@@ -952,7 +799,7 @@ __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
}
else if (__current_errno == ERANGE)
__err = ios_base::failbit;
- return static_cast<_Tp>(__ld);
+ return __ld;
}
__err = ios_base::failbit;
return 0;
@@ -1188,11 +1035,7 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
}
// Stage 3
__buf.resize(__a_end - __a);
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- if (sscanf_l(__buf.c_str(), _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1)
-#else
- if (__sscanf_l(__buf.c_str(), _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1)
-#endif
+ if (__libcpp_sscanf_l(__buf.c_str(), _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1)
__err = ios_base::failbit;
// EOF checked
if (__b == __e)
@@ -1200,8 +1043,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get<wchar_t>)
struct _LIBCPP_TYPE_VIS __num_put_base
{
@@ -1350,11 +1193,11 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
__op = __ob + (__np - __nb);
}
-_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY num_put
+class _LIBCPP_TEMPLATE_VIS num_put
: public locale::facet,
private __num_put<_CharT>
{
@@ -1556,13 +1399,10 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
this->__format_int(__fmt+1, __len, true, __iob.flags());
const unsigned __nbuf = (numeric_limits<long>::digits / 3)
+ ((numeric_limits<long>::digits % 3) != 0)
- + 1;
+ + ((__iob.flags() & ios_base::showbase) != 0)
+ + 2;
char __nar[__nbuf];
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#endif
+ int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
char* __ne = __nar + __nc;
char* __np = this->__identify_padding(__nar, __ne, __iob);
// Stage 2 - Widen __nar while adding thousands separators
@@ -1586,13 +1426,10 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
this->__format_int(__fmt+1, __len, true, __iob.flags());
const unsigned __nbuf = (numeric_limits<long long>::digits / 3)
+ ((numeric_limits<long long>::digits % 3) != 0)
+ + ((__iob.flags() & ios_base::showbase) != 0)
+ 2;
char __nar[__nbuf];
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#endif
+ int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
char* __ne = __nar + __nc;
char* __np = this->__identify_padding(__nar, __ne, __iob);
// Stage 2 - Widen __nar while adding thousands separators
@@ -1616,13 +1453,10 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
this->__format_int(__fmt+1, __len, false, __iob.flags());
const unsigned __nbuf = (numeric_limits<unsigned long>::digits / 3)
+ ((numeric_limits<unsigned long>::digits % 3) != 0)
+ + ((__iob.flags() & ios_base::showbase) != 0)
+ 1;
char __nar[__nbuf];
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#endif
+ int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
char* __ne = __nar + __nc;
char* __np = this->__identify_padding(__nar, __ne, __iob);
// Stage 2 - Widen __nar while adding thousands separators
@@ -1646,13 +1480,10 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
this->__format_int(__fmt+1, __len, false, __iob.flags());
const unsigned __nbuf = (numeric_limits<unsigned long long>::digits / 3)
+ ((numeric_limits<unsigned long long>::digits % 3) != 0)
+ + ((__iob.flags() & ios_base::showbase) != 0)
+ 1;
char __nar[__nbuf];
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#endif
+ int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
char* __ne = __nar + __nc;
char* __np = this->__identify_padding(__nar, __ne, __iob);
// Stage 2 - Widen __nar while adding thousands separators
@@ -1679,34 +1510,17 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
char* __nb = __nar;
int __nc;
if (__specify_precision)
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
- (int)__iob.precision(), __v);
-#else
- __nc = __snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
+ __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
(int)__iob.precision(), __v);
-#endif
else
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- __nc = __snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#endif
+ __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
unique_ptr<char, void(*)(void*)> __nbh(0, free);
if (__nc > static_cast<int>(__nbuf-1))
{
if (__specify_precision)
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
-#else
- __nc = __asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
-#endif
+ __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
else
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- __nc = __asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
-#endif
+ __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
if (__nb == 0)
__throw_bad_alloc();
__nbh.reset(__nb);
@@ -1747,34 +1561,17 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
char* __nb = __nar;
int __nc;
if (__specify_precision)
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
- (int)__iob.precision(), __v);
-#else
- __nc = __snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
+ __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt,
(int)__iob.precision(), __v);
-#endif
else
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- __nc = __snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#endif
+ __nc = __libcpp_snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v);
unique_ptr<char, void(*)(void*)> __nbh(0, free);
if (__nc > static_cast<int>(__nbuf-1))
{
if (__specify_precision)
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
-#else
- __nc = __asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
-#endif
+ __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v);
else
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- __nc = __asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#endif
+ __nc = __libcpp_asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v);
if (__nb == 0)
__throw_bad_alloc();
__nbh.reset(__nb);
@@ -1810,11 +1607,7 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
char __fmt[6] = "%p";
const unsigned __nbuf = 20;
char __nar[__nbuf];
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#else
- int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
-#endif
+ int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
char* __ne = __nar + __nc;
char* __np = this->__identify_padding(__nar, __ne, __iob);
// Stage 2 - Widen __nar
@@ -1833,8 +1626,8 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
return __pad_and_output(__s, __o, __op, __oe, __iob, __fl);
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put<wchar_t>)
template <class _CharT, class _InputIterator>
_LIBCPP_HIDDEN
@@ -1876,7 +1669,7 @@ public:
};
template <class _CharT>
-class _LIBCPP_TYPE_VIS_ONLY __time_get_c_storage
+class _LIBCPP_TEMPLATE_VIS __time_get_c_storage
{
protected:
typedef basic_string<_CharT> string_type;
@@ -1893,8 +1686,24 @@ protected:
~__time_get_c_storage() {}
};
+template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__weeks() const;
+template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__months() const;
+template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__am_pm() const;
+template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__c() const;
+template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__r() const;
+template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__x() const;
+template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__X() const;
+
+template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__weeks() const;
+template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__months() const;
+template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__am_pm() const;
+template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__c() const;
+template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__r() const;
+template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__x() const;
+template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__X() const;
+
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY time_get
+class _LIBCPP_TEMPLATE_VIS time_get
: public locale::facet,
public time_base,
private __time_get_c_storage<_CharT>
@@ -2503,8 +2312,8 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get<wchar_t>)
class _LIBCPP_TYPE_VIS __time_get
{
@@ -2517,7 +2326,7 @@ protected:
};
template <class _CharT>
-class _LIBCPP_TYPE_VIS_ONLY __time_get_storage
+class _LIBCPP_TEMPLATE_VIS __time_get_storage
: public __time_get
{
protected:
@@ -2544,7 +2353,7 @@ private:
};
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY time_get_byname
+class _LIBCPP_TEMPLATE_VIS time_get_byname
: public time_get<_CharT, _InputIterator>,
private __time_get_storage<_CharT>
{
@@ -2586,8 +2395,8 @@ private:
virtual const string_type& __X() const {return this->__X_;}
};
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get_byname<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get_byname<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname<wchar_t>)
class _LIBCPP_TYPE_VIS __time_put
{
@@ -2604,7 +2413,7 @@ protected:
};
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY time_put
+class _LIBCPP_TEMPLATE_VIS time_put
: public locale::facet,
private __time_put
{
@@ -2699,11 +2508,11 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base&,
return _VSTD::copy(__nb, __ne, __s);
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY time_put_byname
+class _LIBCPP_TEMPLATE_VIS time_put_byname
: public time_put<_CharT, _OutputIterator>
{
public:
@@ -2720,8 +2529,8 @@ protected:
~time_put_byname() {}
};
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put_byname<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put_byname<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<wchar_t>)
// money_base
@@ -2737,7 +2546,7 @@ public:
// moneypunct
template <class _CharT, bool _International = false>
-class _LIBCPP_TYPE_VIS_ONLY moneypunct
+class _LIBCPP_TEMPLATE_VIS moneypunct
: public locale::facet,
public money_base
{
@@ -2787,15 +2596,15 @@ template <class _CharT, bool _International>
const bool
moneypunct<_CharT, _International>::intl;
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<char, false>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<char, true>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<wchar_t, false>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<wchar_t, true>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, false>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<char, true>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, false>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct<wchar_t, true>)
// moneypunct_byname
template <class _CharT, bool _International = false>
-class _LIBCPP_TYPE_VIS_ONLY moneypunct_byname
+class _LIBCPP_TEMPLATE_VIS moneypunct_byname
: public moneypunct<_CharT, _International>
{
public:
@@ -2839,15 +2648,15 @@ private:
void init(const char*);
};
-template<> void moneypunct_byname<char, false>::init(const char*);
-template<> void moneypunct_byname<char, true>::init(const char*);
-template<> void moneypunct_byname<wchar_t, false>::init(const char*);
-template<> void moneypunct_byname<wchar_t, true>::init(const char*);
+template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, false>::init(const char*);
+template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, true>::init(const char*);
+template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
+template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<char, false>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<char, true>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<wchar_t, false>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<wchar_t, true>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, false>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<wchar_t, true>)
// money_get
@@ -2903,11 +2712,11 @@ __money_get<_CharT>::__gather_info(bool __intl, const locale& __loc,
}
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get<wchar_t>)
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY money_get
+class _LIBCPP_TEMPLATE_VIS money_get
: public locale::facet,
private __money_get<_CharT>
{
@@ -3033,7 +2842,7 @@ money_get<_CharT, _InputIterator>::__do_get(iter_type& __b, iter_type __e,
return false;
}
}
- // drop through
+ _LIBCPP_FALLTHROUGH();
case money_base::none:
if (__p != 3)
{
@@ -3286,8 +3095,8 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_get<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_get<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get<wchar_t>)
// money_put
@@ -3461,11 +3270,11 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
__mi = __mb;
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY money_put
+class _LIBCPP_TEMPLATE_VIS money_put
: public locale::facet,
private __money_put<_CharT>
{
@@ -3526,11 +3335,7 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
// secure memory for digit storage
if (__n > __bs-1)
{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- __n = static_cast<size_t>(asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units));
-#else
- __n = __asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units);
-#endif
+ __n = static_cast<size_t>(__libcpp_asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units));
if (__bb == 0)
__throw_bad_alloc();
__hn.reset(__bb);
@@ -3618,8 +3423,8 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl);
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_put<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_put<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put<wchar_t>)
// messages
@@ -3632,7 +3437,7 @@ public:
};
template <class _CharT>
-class _LIBCPP_TYPE_VIS_ONLY messages
+class _LIBCPP_TEMPLATE_VIS messages
: public locale::facet,
public messages_base
{
@@ -3728,11 +3533,11 @@ messages<_CharT>::do_close(catalog __c) const
#endif // _LIBCPP_HAS_CATOPEN
}
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages<wchar_t>)
template <class _CharT>
-class _LIBCPP_TYPE_VIS_ONLY messages_byname
+class _LIBCPP_TEMPLATE_VIS messages_byname
: public messages<_CharT>
{
public:
@@ -3752,13 +3557,13 @@ protected:
~messages_byname() {}
};
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages_byname<char>)
-_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages_byname<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname<wchar_t>)
template<class _Codecvt, class _Elem = wchar_t,
class _Wide_alloc = allocator<_Elem>,
class _Byte_alloc = allocator<char> >
-class _LIBCPP_TYPE_VIS_ONLY wstring_convert
+class _LIBCPP_TEMPLATE_VIS wstring_convert
{
public:
typedef basic_string<char, char_traits<char>, _Byte_alloc> byte_string;
@@ -3782,7 +3587,7 @@ public:
wstring_convert(_Codecvt* __pcvt, state_type __state);
_LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
const wide_string& __wide_err = wide_string());
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_ALWAYS_INLINE
wstring_convert(wstring_convert&& __wc);
#endif
@@ -3841,7 +3646,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
__cvtptr_ = new _Codecvt;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
inline
@@ -3850,12 +3655,12 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
: __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)),
__wide_err_string_(_VSTD::move(__wc.__wide_err_string_)),
__cvtptr_(__wc.__cvtptr_),
- __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtstate_)
+ __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtcount_)
{
__wc.__cvtptr_ = nullptr;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::~wstring_convert()
@@ -3917,10 +3722,10 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
if (__r == codecvt_base::ok)
return __ws;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (__wide_err_string_.empty())
- throw range_error("wstring_convert: from_bytes error");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_range_error("wstring_convert: from_bytes error");
+
return __wide_err_string_;
}
@@ -4006,15 +3811,15 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
return __bs;
}
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (__byte_err_string_.empty())
- throw range_error("wstring_convert: to_bytes error");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_range_error("wstring_convert: to_bytes error");
+
return __byte_err_string_;
}
template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
-class _LIBCPP_TYPE_VIS_ONLY wbuffer_convert
+class _LIBCPP_TEMPLATE_VIS wbuffer_convert
: public basic_streambuf<_Elem, _Tr>
{
public:
@@ -4140,13 +3945,16 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
}
else
{
- memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
+ _LIBCPP_ASSERT(!(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" );
+ if (__extbufend_ != __extbufnext_)
+ memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
streamsize __nmemb = _VSTD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
static_cast<streamsize>(__extbufend_ - __extbufnext_));
codecvt_base::result __r;
- state_type __svs = __st_;
+ // FIXME: Do we ever need to restore the state here?
+ //state_type __svs = __st_;
streamsize __nr = __bufptr_->sgetn(const_cast<char*>(__extbufnext_), __nmemb);
if (__nr != 0)
{
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/locale.h b/chromium/buildtools/third_party/libc++/trunk/include/locale.h
new file mode 100644
index 00000000000..cad7b8b53eb
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/locale.h
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+//===---------------------------- locale.h --------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_LOCALE_H
+#define _LIBCPP_LOCALE_H
+
+/*
+ locale.h synopsis
+
+Macros:
+
+ LC_ALL
+ LC_COLLATE
+ LC_CTYPE
+ LC_MONETARY
+ LC_NUMERIC
+ LC_TIME
+
+Types:
+
+ lconv
+
+Functions:
+
+ setlocale
+ localeconv
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <locale.h>
+
+#endif // _LIBCPP_LOCALE_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/map b/chromium/buildtools/third_party/libc++/trunk/include/map
index adfb4cdb5e9..71f18693f6d 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/map
+++ b/chromium/buildtools/third_party/libc++/trunk/include/map
@@ -126,9 +126,11 @@ public:
template <class... Args>
iterator emplace_hint(const_iterator position, Args&&... args);
pair<iterator, bool> insert(const value_type& v);
+ pair<iterator, bool> insert( value_type&& v); // C++17
template <class P>
pair<iterator, bool> insert(P&& p);
iterator insert(const_iterator position, const value_type& v);
+ iterator insert(const_iterator position, value_type&& v); // C++17
template <class P>
iterator insert(const_iterator position, P&& p);
template <class InputIterator>
@@ -160,7 +162,7 @@ public:
void swap(map& m)
noexcept(allocator_traits<allocator_type>::is_always_equal::value &&
- __is_nothrow_swappable<key_compare>::value); // C++17
+ is_nothrow_swappable<key_compare>::value); // C++17
// observers:
allocator_type get_allocator() const noexcept;
@@ -336,9 +338,11 @@ public:
template <class... Args>
iterator emplace_hint(const_iterator position, Args&&... args);
iterator insert(const value_type& v);
+ iterator insert( value_type&& v); // C++17
template <class P>
iterator insert(P&& p);
iterator insert(const_iterator position, const value_type& v);
+ iterator insert(const_iterator position, value_type&& v); // C++17
template <class P>
iterator insert(const_iterator position, P&& p);
template <class InputIterator>
@@ -353,7 +357,7 @@ public:
void swap(multimap& m)
noexcept(allocator_traits<allocator_type>::is_always_equal::value &&
- __is_nothrow_swappable<key_compare>::value); // C++17
+ is_nothrow_swappable<key_compare>::value); // C++17
// observers:
allocator_type get_allocator() const noexcept;
@@ -449,9 +453,7 @@ swap(multimap<Key, T, Compare, Allocator>& x,
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Key, class _CP, class _Compare,
- bool = is_empty<_Compare>::value && !__libcpp_is_final<_Compare>::value
- >
+template <class _Key, class _CP, class _Compare, bool _IsSmall>
class __map_value_compare
: private _Compare
{
@@ -478,8 +480,8 @@ public:
void swap(__map_value_compare&__y)
_NOEXCEPT_(__is_nothrow_swappable<_Compare>::value)
{
- using _VSTD::swap;
- swap(static_cast<const _Compare&>(*this), static_cast<const _Compare&>(__y));
+ using _VSTD::swap;
+ swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y));
}
#if _LIBCPP_STD_VER > 11
@@ -529,7 +531,7 @@ public:
using _VSTD::swap;
swap(comp, __y.comp);
}
-
+
#if _LIBCPP_STD_VER > 11
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
@@ -560,13 +562,11 @@ class __map_node_destructor
{
typedef _Allocator allocator_type;
typedef allocator_traits<allocator_type> __alloc_traits;
- typedef typename __alloc_traits::value_type::value_type value_type;
+
public:
typedef typename __alloc_traits::pointer pointer;
-private:
- typedef typename value_type::value_type::first_type first_type;
- typedef typename value_type::value_type::second_type second_type;
+private:
allocator_type& __na_;
__map_node_destructor& operator=(const __map_node_destructor&);
@@ -582,7 +582,7 @@ public:
__second_constructed(false)
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT
: __na_(__x.__na_),
@@ -591,7 +591,7 @@ public:
{
__x.__value_constructed = false;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void operator()(pointer __p) _NOEXCEPT
@@ -611,7 +611,7 @@ template <class _Key, class _Tp, class _Compare, class _Allocator>
class multimap;
template <class _TreeIterator> class __map_const_iterator;
-#if __cplusplus >= 201103L
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp>
union __value_type
@@ -624,33 +624,29 @@ union __value_type
value_type __cc;
__nc_value_type __nc;
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- __value_type(_Args&& ...__args)
- : __cc(std::forward<_Args>(__args)...) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __value_type(const __value_type& __v)
- : __cc(__v.__cc) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __value_type(__value_type& __v)
- : __cc(__v.__cc) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __value_type(__value_type&& __v)
- : __nc(std::move(__v.__nc)) {}
-
_LIBCPP_INLINE_VISIBILITY
__value_type& operator=(const __value_type& __v)
{__nc = __v.__cc; return *this;}
_LIBCPP_INLINE_VISIBILITY
__value_type& operator=(__value_type&& __v)
- {__nc = std::move(__v.__nc); return *this;}
+ {__nc = _VSTD::move(__v.__nc); return *this;}
+ template <class _ValueTp,
+ class = typename enable_if<
+ __is_same_uncvref<_ValueTp, value_type>::value
+ >::type
+ >
_LIBCPP_INLINE_VISIBILITY
- ~__value_type() {__cc.~value_type();}
+ __value_type& operator=(_ValueTp&& __v) {
+ __nc = _VSTD::forward<_ValueTp>(__v); return *this;
+ }
+
+private:
+ __value_type() _LIBCPP_EQUAL_DELETE;
+ ~__value_type() _LIBCPP_EQUAL_DELETE;
+ __value_type(const __value_type& __v) _LIBCPP_EQUAL_DELETE;
+ __value_type(__value_type&& __v) _LIBCPP_EQUAL_DELETE;
};
#else
@@ -664,21 +660,14 @@ struct __value_type
value_type __cc;
- _LIBCPP_INLINE_VISIBILITY
- __value_type() {}
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- __value_type(const _A0& __a0)
- : __cc(__a0) {}
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- __value_type(const _A0& __a0, const _A1& __a1)
- : __cc(__a0, __a1) {}
+private:
+ __value_type();
+ __value_type(__value_type const&);
+ __value_type& operator=(__value_type const&);
+ ~__value_type();
};
-#endif
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
struct __extract_key_value_types;
@@ -691,26 +680,19 @@ struct __extract_key_value_types<__value_type<_Key, _Tp> >
};
template <class _TreeIterator>
-class _LIBCPP_TYPE_VIS_ONLY __map_iterator
+class _LIBCPP_TEMPLATE_VIS __map_iterator
{
+ typedef typename _TreeIterator::_NodeTypes _NodeTypes;
+ typedef typename _TreeIterator::__pointer_traits __pointer_traits;
+
_TreeIterator __i_;
- typedef typename _TreeIterator::__pointer_traits __pointer_traits;
- typedef typename _TreeIterator::value_type __value_type;
- typedef typename __extract_key_value_types<__value_type>::__key_type __key_type;
- typedef typename __extract_key_value_types<__value_type>::__mapped_type __mapped_type;
public:
typedef bidirectional_iterator_tag iterator_category;
- typedef pair<__key_type, __mapped_type> value_type;
+ typedef typename _NodeTypes::__map_value_type value_type;
typedef typename _TreeIterator::difference_type difference_type;
typedef value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef typename _NodeTypes::__map_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY
__map_iterator() _NOEXCEPT {}
@@ -746,37 +728,30 @@ public:
friend _LIBCPP_INLINE_VISIBILITY
bool operator==(const __map_iterator& __x, const __map_iterator& __y)
{return __x.__i_ == __y.__i_;}
- friend
+ friend
_LIBCPP_INLINE_VISIBILITY
bool operator!=(const __map_iterator& __x, const __map_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY map;
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multimap;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __map_const_iterator;
};
template <class _TreeIterator>
-class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator
+class _LIBCPP_TEMPLATE_VIS __map_const_iterator
{
+ typedef typename _TreeIterator::_NodeTypes _NodeTypes;
+ typedef typename _TreeIterator::__pointer_traits __pointer_traits;
+
_TreeIterator __i_;
- typedef typename _TreeIterator::__pointer_traits __pointer_traits;
- typedef typename _TreeIterator::value_type __value_type;
- typedef typename __extract_key_value_types<__value_type>::__key_type __key_type;
- typedef typename __extract_key_value_types<__value_type>::__mapped_type __mapped_type;
public:
typedef bidirectional_iterator_tag iterator_category;
- typedef pair<__key_type, __mapped_type> value_type;
+ typedef typename _NodeTypes::__map_value_type value_type;
typedef typename _TreeIterator::difference_type difference_type;
typedef const value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
- pointer;
+ typedef typename _NodeTypes::__const_map_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY
__map_const_iterator() _NOEXCEPT {}
@@ -820,14 +795,14 @@ public:
bool operator!=(const __map_const_iterator& __x, const __map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY map;
- template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multimap;
- template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS map;
+ template <class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS multimap;
+ template <class, class, class> friend class _LIBCPP_TEMPLATE_VIS __tree_const_iterator;
};
template <class _Key, class _Tp, class _Compare = less<_Key>,
class _Allocator = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TYPE_VIS_ONLY map
+class _LIBCPP_TEMPLATE_VIS map
{
public:
// types:
@@ -843,7 +818,7 @@ public:
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
"Allocator::value_type must be same type as value_type");
- class _LIBCPP_TYPE_VIS_ONLY value_compare
+ class _LIBCPP_TEMPLATE_VIS value_compare
: public binary_function<value_type, value_type, bool>
{
friend class map;
@@ -896,7 +871,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit map(const key_compare& __comp, const allocator_type& __a)
- : __tree_(__vc(__comp), __a) {}
+ : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {}
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
@@ -911,14 +886,14 @@ public:
_LIBCPP_INLINE_VISIBILITY
map(_InputIterator __f, _InputIterator __l,
const key_compare& __comp, const allocator_type& __a)
- : __tree_(__vc(__comp), __a)
+ : __tree_(__vc(__comp), typename __base::allocator_type(__a))
{
insert(__f, __l);
}
#if _LIBCPP_STD_VER > 11
template <class _InputIterator>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY
map(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
: map(__f, __l, key_compare(), __a) {}
#endif
@@ -933,7 +908,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
map& operator=(const map& __m)
{
-#if __cplusplus >= 201103L
+#ifndef _LIBCPP_CXX03_LANG
__tree_ = __m.__tree_;
#else
if (this != &__m) {
@@ -946,7 +921,7 @@ public:
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
map(map&& __m)
@@ -965,10 +940,6 @@ public:
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
_LIBCPP_INLINE_VISIBILITY
map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
: __tree_(__vc(__comp))
@@ -978,13 +949,13 @@ public:
_LIBCPP_INLINE_VISIBILITY
map(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
- : __tree_(__vc(__comp), __a)
+ : __tree_(__vc(__comp), typename __base::allocator_type(__a))
{
insert(__il.begin(), __il.end());
}
#if _LIBCPP_STD_VER > 11
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY
map(initializer_list<value_type> __il, const allocator_type& __a)
: map(__il, key_compare(), __a) {}
#endif
@@ -996,17 +967,17 @@ public:
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit map(const allocator_type& __a)
- : __tree_(__a)
+ : __tree_(typename __base::allocator_type(__a))
{
}
_LIBCPP_INLINE_VISIBILITY
map(const map& __m, const allocator_type& __a)
- : __tree_(__m.__tree_.value_comp(), __a)
+ : __tree_(__m.__tree_.value_comp(), typename __base::allocator_type(__a))
{
insert(__m.begin(), __m.end());
}
@@ -1049,7 +1020,7 @@ public:
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
mapped_type& operator[](const key_type& __k);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
mapped_type& operator[](key_type&& __k);
#endif
@@ -1057,24 +1028,24 @@ public:
const mapped_type& at(const key_type& __k) const;
_LIBCPP_INLINE_VISIBILITY
- allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
+ allocator_type get_allocator() const _NOEXCEPT {return allocator_type(__tree_.__alloc());}
_LIBCPP_INLINE_VISIBILITY
key_compare key_comp() const {return __tree_.value_comp().key_comp();}
_LIBCPP_INLINE_VISIBILITY
value_compare value_comp() const {return value_compare(__tree_.value_comp().key_comp());}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
+#ifndef _LIBCPP_CXX03_LANG
template <class ..._Args>
- pair<iterator, bool>
- emplace(_Args&& ...__args);
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> emplace(_Args&& ...__args) {
+ return __tree_.__emplace_unique(_VSTD::forward<_Args>(__args)...);
+ }
template <class ..._Args>
- iterator
- emplace_hint(const_iterator __p, _Args&& ...__args);
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
+ _LIBCPP_INLINE_VISIBILITY
+ iterator emplace_hint(const_iterator __p, _Args&& ...__args) {
+ return __tree_.__emplace_hint_unique(__p.__i_, _VSTD::forward<_Args>(__args)...);
+ }
template <class _Pp,
class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
@@ -1088,7 +1059,7 @@ public:
iterator insert(const_iterator __pos, _Pp&& __p)
{return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_Pp>(__p));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool>
@@ -1099,6 +1070,20 @@ public:
insert(const_iterator __p, const value_type& __v)
{return __tree_.__insert_unique(__p.__i_, __v);}
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool>
+ insert(value_type&& __v) {return __tree_.__insert_unique(_VSTD::move(__v));}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, value_type&& __v)
+ {return __tree_.__insert_unique(__p.__i_, _VSTD::move(__v));}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(initializer_list<value_type> __il)
+ {insert(__il.begin(), __il.end());}
+#endif
+
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __f, _InputIterator __l)
@@ -1107,71 +1092,46 @@ public:
insert(__e.__i_, *__f);
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
- _LIBCPP_INLINE_VISIBILITY
- void insert(initializer_list<value_type> __il)
- {insert(__il.begin(), __il.end());}
-
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
#if _LIBCPP_STD_VER > 14
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)
{
- iterator __p = lower_bound(__k);
- if ( __p != end() && !key_comp()(__k, __p->first))
- return _VSTD::make_pair(__p, false);
- else
- return _VSTD::make_pair(
- emplace_hint(__p,
- _VSTD::piecewise_construct, _VSTD::forward_as_tuple(__k),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)),
- true);
+ return __tree_.__emplace_unique_key_args(__k,
+ _VSTD::piecewise_construct,
+ _VSTD::forward_as_tuple(__k),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args)
{
- iterator __p = lower_bound(__k);
- if ( __p != end() && !key_comp()(__k, __p->first))
- return _VSTD::make_pair(__p, false);
- else
- return _VSTD::make_pair(
- emplace_hint(__p,
- _VSTD::piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__k)),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)),
- true);
+ return __tree_.__emplace_unique_key_args(__k,
+ _VSTD::piecewise_construct,
+ _VSTD::forward_as_tuple(_VSTD::move(__k)),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)
{
- iterator __p = lower_bound(__k);
- if ( __p != end() && !key_comp()(__k, __p->first))
- return __p;
- else
- return emplace_hint(__p,
- _VSTD::piecewise_construct, _VSTD::forward_as_tuple(__k),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
+ return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
+ _VSTD::piecewise_construct,
+ _VSTD::forward_as_tuple(__k),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)
{
- iterator __p = lower_bound(__k);
- if ( __p != end() && !key_comp()(__k, __p->first))
- return __p;
- else
- return emplace_hint(__p,
- _VSTD::piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__k)),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
+ return __tree_.__emplace_hint_unique_key_args(__h.__i_, __k,
+ _VSTD::piecewise_construct,
+ _VSTD::forward_as_tuple(_VSTD::move(__k)),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
}
template <class _Vp>
@@ -1186,7 +1146,7 @@ public:
}
return _VSTD::make_pair(emplace_hint(__p, __k, _VSTD::forward<_Vp>(__v)), true);
}
-
+
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v)
@@ -1225,9 +1185,8 @@ public:
}
return emplace_hint(__h, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
}
-#endif
-#endif
-#endif
+
+#endif // _LIBCPP_STD_VER > 14
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
@@ -1327,194 +1286,53 @@ private:
typedef typename __base::__node __node;
typedef typename __base::__node_allocator __node_allocator;
typedef typename __base::__node_pointer __node_pointer;
- typedef typename __base::__node_const_pointer __node_const_pointer;
typedef typename __base::__node_base_pointer __node_base_pointer;
- typedef typename __base::__node_base_const_pointer __node_base_const_pointer;
+ typedef typename __base::__parent_pointer __parent_pointer;
+
typedef __map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- __node_holder __construct_node();
- template <class _A0>
- __node_holder __construct_node(_A0&& __a0);
- __node_holder __construct_node_with_key(key_type&& __k);
-#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class _A0, class _A1, class ..._Args>
- __node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif
+#ifdef _LIBCPP_CXX03_LANG
__node_holder __construct_node_with_key(const key_type& __k);
-
- __node_base_pointer&
- __find_equal_key(__node_base_pointer& __parent, const key_type& __k);
- __node_base_const_pointer
- __find_equal_key(__node_base_const_pointer& __parent, const key_type& __k) const;
+#endif
};
-// Find place to insert if __k doesn't exist
-// Set __parent to parent of null leaf
-// Return reference to null leaf
-// If __k exists, set parent to node of __k and return reference to node of __k
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-typename map<_Key, _Tp, _Compare, _Allocator>::__node_base_pointer&
-map<_Key, _Tp, _Compare, _Allocator>::__find_equal_key(__node_base_pointer& __parent,
- const key_type& __k)
-{
- __node_pointer __nd = __tree_.__root();
- if (__nd != nullptr)
- {
- while (true)
- {
- if (__tree_.value_comp().key_comp()(__k, __nd->__value_.__cc.first))
- {
- if (__nd->__left_ != nullptr)
- __nd = static_cast<__node_pointer>(__nd->__left_);
- else
- {
- __parent = static_cast<__node_base_pointer>(__nd);
- return __parent->__left_;
- }
- }
- else if (__tree_.value_comp().key_comp()(__nd->__value_.__cc.first, __k))
- {
- if (__nd->__right_ != nullptr)
- __nd = static_cast<__node_pointer>(__nd->__right_);
- else
- {
- __parent = static_cast<__node_base_pointer>(__nd);
- return __parent->__right_;
- }
- }
- else
- {
- __parent = static_cast<__node_base_pointer>(__nd);
- return __parent;
- }
- }
- }
- __parent = static_cast<__node_base_pointer>(__tree_.__end_node());
- return __parent->__left_;
-}
-
-// Find __k
-// Set __parent to parent of null leaf and
-// return reference to null leaf iv __k does not exist.
-// If __k exists, set parent to node of __k and return reference to node of __k
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-typename map<_Key, _Tp, _Compare, _Allocator>::__node_base_const_pointer
-map<_Key, _Tp, _Compare, _Allocator>::__find_equal_key(__node_base_const_pointer& __parent,
- const key_type& __k) const
-{
- __node_const_pointer __nd = __tree_.__root();
- if (__nd != nullptr)
- {
- while (true)
- {
- if (__tree_.value_comp().key_comp()(__k, __nd->__value_.__cc.first))
- {
- if (__nd->__left_ != nullptr)
- __nd = static_cast<__node_pointer>(__nd->__left_);
- else
- {
- __parent = static_cast<__node_base_pointer>(__nd);
- return const_cast<const __node_base_const_pointer&>(__parent->__left_);
- }
- }
- else if (__tree_.value_comp().key_comp()(__nd->__value_.__cc.first, __k))
- {
- if (__nd->__right_ != nullptr)
- __nd = static_cast<__node_pointer>(__nd->__right_);
- else
- {
- __parent = static_cast<__node_base_pointer>(__nd);
- return const_cast<const __node_base_const_pointer&>(__parent->__right_);
- }
- }
- else
- {
- __parent = static_cast<__node_base_pointer>(__nd);
- return __parent;
- }
- }
- }
- __parent = static_cast<__node_base_pointer>(__tree_.__end_node());
- return const_cast<const __node_base_const_pointer&>(__parent->__left_);
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator>
map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
- : __tree_(_VSTD::move(__m.__tree_), __a)
+ : __tree_(_VSTD::move(__m.__tree_), typename __base::allocator_type(__a))
{
if (__a != __m.get_allocator())
{
const_iterator __e = cend();
while (!__m.empty())
__tree_.__insert_unique(__e.__i_,
- _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
+ _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_.__nc));
}
}
template <class _Key, class _Tp, class _Compare, class _Allocator>
-typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
-map<_Key, _Tp, _Compare, _Allocator>::__construct_node()
-{
- __node_allocator& __na = __tree_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first));
- __h.get_deleter().__first_constructed = true;
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-template <class _A0>
-typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
-map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
+_Tp&
+map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
{
- __node_allocator& __na = __tree_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
+ return __tree_.__emplace_unique_key_args(__k,
+ _VSTD::piecewise_construct,
+ _VSTD::forward_as_tuple(__k),
+ _VSTD::forward_as_tuple()).first->__cc.second;
}
template <class _Key, class _Tp, class _Compare, class _Allocator>
-typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
-map<_Key, _Tp, _Compare, _Allocator>::__construct_node_with_key(key_type&& __k)
-{
- __node_allocator& __na = __tree_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), _VSTD::move(__k));
- __h.get_deleter().__first_constructed = true;
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-template <class _A0, class _A1, class ..._Args>
-typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
-map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args)
+_Tp&
+map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
{
- __node_allocator& __na = __tree_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
- _VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
- _VSTD::forward<_Args>(__args)...);
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
+ return __tree_.__emplace_unique_key_args(__k,
+ _VSTD::piecewise_construct,
+ _VSTD::forward_as_tuple(_VSTD::move(__k)),
+ _VSTD::forward_as_tuple()).first->__cc.second;
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator>
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
@@ -1533,8 +1351,8 @@ template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp&
map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_equal_key(__parent, __k);
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __tree_.__find_equal(__parent, __k);
__node_pointer __r = static_cast<__node_pointer>(__child);
if (__child == nullptr)
{
@@ -1545,32 +1363,14 @@ map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
return __r->__value_.__cc.second;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-_Tp&
-map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
-{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_equal_key(__parent, __k);
- __node_pointer __r = static_cast<__node_pointer>(__child);
- if (__child == nullptr)
- {
- __node_holder __h = __construct_node_with_key(_VSTD::move(__k));
- __tree_.__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
- __r = __h.release();
- }
- return __r->__value_.__cc.second;
-}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp&
map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k)
{
- __node_base_pointer __parent;
- __node_base_pointer& __child = __find_equal_key(__parent, __k);
+ __parent_pointer __parent;
+ __node_base_pointer& __child = __tree_.__find_equal(__parent, __k);
#ifndef _LIBCPP_NO_EXCEPTIONS
if (__child == nullptr)
throw out_of_range("map::at: key not found");
@@ -1582,43 +1382,15 @@ template <class _Key, class _Tp, class _Compare, class _Allocator>
const _Tp&
map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const
{
- __node_base_const_pointer __parent;
- __node_base_const_pointer __child = __find_equal_key(__parent, __k);
+ __parent_pointer __parent;
+ __node_base_pointer __child = __tree_.__find_equal(__parent, __k);
#ifndef _LIBCPP_NO_EXCEPTIONS
if (__child == nullptr)
throw out_of_range("map::at: key not found");
#endif // _LIBCPP_NO_EXCEPTIONS
- return static_cast<__node_const_pointer>(__child)->__value_.__cc.second;
-}
-
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-template <class ..._Args>
-pair<typename map<_Key, _Tp, _Compare, _Allocator>::iterator, bool>
-map<_Key, _Tp, _Compare, _Allocator>::emplace(_Args&& ...__args)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- pair<iterator, bool> __r = __tree_.__node_insert_unique(__h.get());
- if (__r.second)
- __h.release();
- return __r;
-}
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-template <class ..._Args>
-typename map<_Key, _Tp, _Compare, _Allocator>::iterator
-map<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
- _Args&& ...__args)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- iterator __r = __tree_.__node_insert_unique(__p.__i_, __h.get());
- if (__r.__i_.__ptr_ == __h.get())
- __h.release();
- return __r;
+ return static_cast<__node_pointer>(__child)->__value_.__cc.second;
}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1686,7 +1458,7 @@ swap(map<_Key, _Tp, _Compare, _Allocator>& __x,
template <class _Key, class _Tp, class _Compare = less<_Key>,
class _Allocator = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TYPE_VIS_ONLY multimap
+class _LIBCPP_TEMPLATE_VIS multimap
{
public:
// types:
@@ -1702,7 +1474,7 @@ public:
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
"Allocator::value_type must be same type as value_type");
- class _LIBCPP_TYPE_VIS_ONLY value_compare
+ class _LIBCPP_TEMPLATE_VIS value_compare
: public binary_function<value_type, value_type, bool>
{
friend class multimap;
@@ -1756,7 +1528,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit multimap(const key_compare& __comp, const allocator_type& __a)
- : __tree_(__vc(__comp), __a) {}
+ : __tree_(__vc(__comp), typename __base::allocator_type(__a)) {}
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
@@ -1771,14 +1543,14 @@ public:
_LIBCPP_INLINE_VISIBILITY
multimap(_InputIterator __f, _InputIterator __l,
const key_compare& __comp, const allocator_type& __a)
- : __tree_(__vc(__comp), __a)
+ : __tree_(__vc(__comp), typename __base::allocator_type(__a))
{
insert(__f, __l);
}
#if _LIBCPP_STD_VER > 11
template <class _InputIterator>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY
multimap(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
: multimap(__f, __l, key_compare(), __a) {}
#endif
@@ -1794,7 +1566,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
multimap& operator=(const multimap& __m)
{
-#if __cplusplus >= 201103L
+#ifndef _LIBCPP_CXX03_LANG
__tree_ = __m.__tree_;
#else
if (this != &__m) {
@@ -1807,7 +1579,7 @@ public:
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
multimap(multimap&& __m)
@@ -1826,10 +1598,6 @@ public:
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
_LIBCPP_INLINE_VISIBILITY
multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
: __tree_(__vc(__comp))
@@ -1839,13 +1607,13 @@ public:
_LIBCPP_INLINE_VISIBILITY
multimap(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
- : __tree_(__vc(__comp), __a)
+ : __tree_(__vc(__comp), typename __base::allocator_type(__a))
{
insert(__il.begin(), __il.end());
}
#if _LIBCPP_STD_VER > 11
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY
multimap(initializer_list<value_type> __il, const allocator_type& __a)
: multimap(__il, key_compare(), __a) {}
#endif
@@ -1857,17 +1625,17 @@ public:
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit multimap(const allocator_type& __a)
- : __tree_(__a)
+ : __tree_(typename __base::allocator_type(__a))
{
}
_LIBCPP_INLINE_VISIBILITY
multimap(const multimap& __m, const allocator_type& __a)
- : __tree_(__m.__tree_.value_comp(), __a)
+ : __tree_(__m.__tree_.value_comp(), typename __base::allocator_type(__a))
{
insert(__m.begin(), __m.end());
}
@@ -1909,25 +1677,26 @@ public:
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
_LIBCPP_INLINE_VISIBILITY
- allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
+ allocator_type get_allocator() const _NOEXCEPT {return allocator_type(__tree_.__alloc());}
_LIBCPP_INLINE_VISIBILITY
key_compare key_comp() const {return __tree_.value_comp().key_comp();}
_LIBCPP_INLINE_VISIBILITY
value_compare value_comp() const
{return value_compare(__tree_.value_comp().key_comp());}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class ..._Args>
- iterator
- emplace(_Args&& ...__args);
+ _LIBCPP_INLINE_VISIBILITY
+ iterator emplace(_Args&& ...__args) {
+ return __tree_.__emplace_multi(_VSTD::forward<_Args>(__args)...);
+ }
template <class ..._Args>
- iterator
- emplace_hint(const_iterator __p, _Args&& ...__args);
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
+ _LIBCPP_INLINE_VISIBILITY
+ iterator emplace_hint(const_iterator __p, _Args&& ...__args) {
+ return __tree_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_Args>(__args)...);
+ }
template <class _Pp,
class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
@@ -1941,7 +1710,20 @@ public:
iterator insert(const_iterator __pos, _Pp&& __p)
{return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_Pp>(__p));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(value_type&& __v)
+ {return __tree_.__insert_multi(_VSTD::move(__v));}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, value_type&& __v)
+ {return __tree_.__insert_multi(__p.__i_, _VSTD::move(__v));}
+
+
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(initializer_list<value_type> __il)
+ {insert(__il.begin(), __il.end());}
+
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __v) {return __tree_.__insert_multi(__v);}
@@ -1958,14 +1740,6 @@ public:
__tree_.__insert_multi(__e.__i_, *__f);
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
- _LIBCPP_INLINE_VISIBILITY
- void insert(initializer_list<value_type> __il)
- {insert(__il.begin(), __il.end());}
-
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
_LIBCPP_INLINE_VISIBILITY
@@ -2063,109 +1837,25 @@ private:
typedef typename __base::__node __node;
typedef typename __base::__node_allocator __node_allocator;
typedef typename __base::__node_pointer __node_pointer;
- typedef typename __base::__node_const_pointer __node_const_pointer;
+
typedef __map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- __node_holder __construct_node();
- template <class _A0>
- __node_holder
- __construct_node(_A0&& __a0);
-#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class _A0, class _A1, class ..._Args>
- __node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Compare, class _Allocator>
multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const allocator_type& __a)
- : __tree_(_VSTD::move(__m.__tree_), __a)
+ : __tree_(_VSTD::move(__m.__tree_), typename __base::allocator_type(__a))
{
if (__a != __m.get_allocator())
{
const_iterator __e = cend();
while (!__m.empty())
__tree_.__insert_multi(__e.__i_,
- _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
+ _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_.__nc));
}
}
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
-multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node()
-{
- __node_allocator& __na = __tree_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first));
- __h.get_deleter().__first_constructed = true;
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-template <class _A0>
-typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
-multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
-{
- __node_allocator& __na = __tree_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-template <class _A0, class _A1, class ..._Args>
-typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
-multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args)
-{
- __node_allocator& __na = __tree_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
- _VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
- _VSTD::forward<_Args>(__args)...);
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-template <class ..._Args>
-typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
-multimap<_Key, _Tp, _Compare, _Allocator>::emplace(_Args&& ...__args)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- iterator __r = __tree_.__node_insert_multi(__h.get());
- __h.release();
- return __r;
-}
-
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-template <class ..._Args>
-typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
-multimap<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
- _Args&& ...__args)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- iterator __r = __tree_.__node_insert_multi(__p.__i_, __h.get());
- __h.release();
- return __r;
-}
-
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#endif
template <class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/math.h b/chromium/buildtools/third_party/libc++/trunk/include/math.h
index 20205544d51..8c30ba85d22 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/math.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/math.h
@@ -307,10 +307,7 @@ long double truncl(long double x);
extern "C++" {
#include <type_traits>
-
-#ifdef _LIBCPP_MSVCRT
-#include "support/win32/math_win32.h"
-#endif
+#include <limits>
// signbit
@@ -328,12 +325,50 @@ __libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
signbit(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
+signbit(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x < 0; }
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
+signbit(_A1) _NOEXCEPT
+{ return false; }
+
+#elif defined(_LIBCPP_MSVCRT)
+
+template <typename _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
+signbit(_A1 __lcpp_x) _NOEXCEPT
+{
+ return ::signbit(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
+}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
+signbit(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x < 0; }
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
+signbit(_A1) _NOEXCEPT
+{ return false; }
+
#endif // signbit
// fpclassify
@@ -352,12 +387,34 @@ __libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
fpclassify(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, int>::type
+fpclassify(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
+
+#elif defined(_LIBCPP_MSVCRT)
+
+template <typename _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
+fpclassify(_A1 __lcpp_x) _NOEXCEPT
+{
+ return ::fpclassify(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
+}
+
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, int>::type
+fpclassify(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
+
#endif // fpclassify
// isfinite
@@ -376,12 +433,22 @@ __libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<
+ std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
+ bool>::type
isfinite(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
+ bool>::type
+isfinite(_A1) _NOEXCEPT
+{ return true; }
+
#endif // isfinite
// isinf
@@ -400,12 +467,22 @@ __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<
+ std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
+ bool>::type
isinf(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<
+ std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
+ bool>::type
+isinf(_A1) _NOEXCEPT
+{ return false; }
+
#endif // isinf
// isnan
@@ -424,12 +501,18 @@ __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
isnan(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, bool>::type
+isnan(_A1) _NOEXCEPT
+{ return false; }
+
#endif // isnan
// isnormal
@@ -448,12 +531,18 @@ __libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
+typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
isnormal(_A1 __lcpp_x) _NOEXCEPT
{
return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
}
+template <class _A1>
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, bool>::type
+isnormal(_A1 __lcpp_x) _NOEXCEPT
+{ return __lcpp_x != 0; }
+
#endif // isnormal
// isgreater
@@ -636,65 +725,63 @@ isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
#endif // isunordered
-#ifndef __sun__
-
// abs
-#if !defined(_AIX)
+#if !(defined(_AIX) || defined(__sun__))
inline _LIBCPP_INLINE_VISIBILITY
float
-abs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
+abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY
double
-abs(double __lcpp_x) _NOEXCEPT {return fabs(__lcpp_x);}
+abs(double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY
long double
-abs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
-#endif // !defined(_AIX)
+abs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
+#endif // !(defined(_AIX) || defined(__sun__))
// acos
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return acosf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return ::acosf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-acos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);}
+acos(_A1 __lcpp_x) _NOEXCEPT {return ::acos((double)__lcpp_x);}
// asin
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return asinf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return asinl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return ::asinf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-asin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);}
+asin(_A1 __lcpp_x) _NOEXCEPT {return ::asin((double)__lcpp_x);}
// atan
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return atanf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return atanl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return ::atanf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-atan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);}
+atan(_A1 __lcpp_x) _NOEXCEPT {return ::atan((double)__lcpp_x);}
// atan2
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return atan2f(__lcpp_y, __lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return atan2l(__lcpp_y, __lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return ::atan2f(__lcpp_y, __lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);}
#endif
template <class _A1, class _A2>
@@ -710,86 +797,86 @@ atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
+ return ::atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
}
// ceil
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ceilf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ceill(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ::ceilf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-ceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);}
+ceil(_A1 __lcpp_x) _NOEXCEPT {return ::ceil((double)__lcpp_x);}
// cos
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return cosf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return cosl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return ::cosf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-cos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);}
+cos(_A1 __lcpp_x) _NOEXCEPT {return ::cos((double)__lcpp_x);}
// cosh
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return coshf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return coshl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return ::coshf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-cosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);}
+cosh(_A1 __lcpp_x) _NOEXCEPT {return ::cosh((double)__lcpp_x);}
// exp
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return expf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return expl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return ::expf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-exp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);}
+exp(_A1 __lcpp_x) _NOEXCEPT {return ::exp((double)__lcpp_x);}
// fabs
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-fabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);}
+fabs(_A1 __lcpp_x) _NOEXCEPT {return ::fabs((double)__lcpp_x);}
// floor
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return floorf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return floorl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return ::floorf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-floor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);}
+floor(_A1 __lcpp_x) _NOEXCEPT {return ::floor((double)__lcpp_x);}
// fmod
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmodf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmodl(__lcpp_x, __lcpp_y);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fmodf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);}
#endif
template <class _A1, class _A2>
@@ -805,69 +892,69 @@ fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// frexp
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpf(__lcpp_x, __lcpp_e);}
-inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpl(__lcpp_x, __lcpp_e);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpf(__lcpp_x, __lcpp_e);}
+inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __lcpp_e);}
+frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexp((double)__lcpp_x, __lcpp_e);}
// ldexp
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpf(__lcpp_x, __lcpp_e);}
-inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpl(__lcpp_x, __lcpp_e);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpf(__lcpp_x, __lcpp_e);}
+inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lcpp_e);}
+ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexp((double)__lcpp_x, __lcpp_e);}
// log
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return logf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return logl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return ::logf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
+log(_A1 __lcpp_x) _NOEXCEPT {return ::log((double)__lcpp_x);}
// log10
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return log10f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return log10l(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return ::log10f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-log10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);}
+log10(_A1 __lcpp_x) _NOEXCEPT {return ::log10((double)__lcpp_x);}
// modf
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return modff(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return modfl(__lcpp_x, __lcpp_y);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return ::modff(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);}
#endif
// pow
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return powf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return powl(__lcpp_x, __lcpp_y);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::powf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);}
#endif
template <class _A1, class _A2>
@@ -883,131 +970,119 @@ pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// sin
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return sinf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return sinl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return ::sinf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-sin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);}
+sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);}
// sinh
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return sinhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return sinhl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return ::sinhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-sinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);}
+sinh(_A1 __lcpp_x) _NOEXCEPT {return ::sinh((double)__lcpp_x);}
// sqrt
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return sqrtf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return sqrtl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return ::sqrtf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
#endif
-#endif // __sun__
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-sqrt(_A1 __lcpp_x) _NOEXCEPT {return sqrt((double)__lcpp_x);}
-#ifndef __sun__
+sqrt(_A1 __lcpp_x) _NOEXCEPT {return ::sqrt((double)__lcpp_x);}
// tan
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return tanf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return tanl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return ::tanf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-tan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);}
+tan(_A1 __lcpp_x) _NOEXCEPT {return ::tan((double)__lcpp_x);}
// tanh
-#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return tanhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return tanhl(__lcpp_x);}
+#if !(defined(_AIX) || defined(__sun__))
+inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return ::tanhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-tanh(_A1 __lcpp_x) _NOEXCEPT {return tanh((double)__lcpp_x);}
+tanh(_A1 __lcpp_x) _NOEXCEPT {return ::tanh((double)__lcpp_x);}
// acosh
-#ifndef _LIBCPP_MSVCRT
-inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return acoshf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return acoshl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return ::acoshf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-acosh(_A1 __lcpp_x) _NOEXCEPT {return acosh((double)__lcpp_x);}
-#endif
+acosh(_A1 __lcpp_x) _NOEXCEPT {return ::acosh((double)__lcpp_x);}
// asinh
-#ifndef _LIBCPP_MSVCRT
-inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return asinhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return asinhl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return ::asinhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-asinh(_A1 __lcpp_x) _NOEXCEPT {return asinh((double)__lcpp_x);}
-#endif
+asinh(_A1 __lcpp_x) _NOEXCEPT {return ::asinh((double)__lcpp_x);}
// atanh
-#ifndef _LIBCPP_MSVCRT
-inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return atanhf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return atanhl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return ::atanhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-atanh(_A1 __lcpp_x) _NOEXCEPT {return atanh((double)__lcpp_x);}
-#endif
+atanh(_A1 __lcpp_x) _NOEXCEPT {return ::atanh((double)__lcpp_x);}
// cbrt
-#ifndef _LIBCPP_MSVCRT
-inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return cbrtf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return cbrtl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return ::cbrtf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-cbrt(_A1 __lcpp_x) _NOEXCEPT {return cbrt((double)__lcpp_x);}
-#endif
+cbrt(_A1 __lcpp_x) _NOEXCEPT {return ::cbrt((double)__lcpp_x);}
// copysign
-#if !defined(_VC_CRT_MAJOR_VERSION) || (_VC_CRT_MAJOR_VERSION < 12)
inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x,
float __lcpp_y) _NOEXCEPT {
- return copysignf(__lcpp_x, __lcpp_y);
+ return ::copysignf(__lcpp_x, __lcpp_y);
}
inline _LIBCPP_INLINE_VISIBILITY long double
copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
- return copysignl(__lcpp_x, __lcpp_y);
+ return ::copysignl(__lcpp_x, __lcpp_y);
}
-#endif
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1022,55 +1097,53 @@ copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
-#ifndef _LIBCPP_MSVCRT
-
// erf
-inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return erff(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return erfl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return ::erff(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return ::erfl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-erf(_A1 __lcpp_x) _NOEXCEPT {return erf((double)__lcpp_x);}
+erf(_A1 __lcpp_x) _NOEXCEPT {return ::erf((double)__lcpp_x);}
// erfc
-inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return erfcf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return erfcl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return ::erfcf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return ::erfcl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-erfc(_A1 __lcpp_x) _NOEXCEPT {return erfc((double)__lcpp_x);}
+erfc(_A1 __lcpp_x) _NOEXCEPT {return ::erfc((double)__lcpp_x);}
// exp2
-inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return exp2f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return exp2l(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return ::exp2f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return ::exp2l(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-exp2(_A1 __lcpp_x) _NOEXCEPT {return exp2((double)__lcpp_x);}
+exp2(_A1 __lcpp_x) _NOEXCEPT {return ::exp2((double)__lcpp_x);}
// expm1
-inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return expm1f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return expm1l(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return ::expm1f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return ::expm1l(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-expm1(_A1 __lcpp_x) _NOEXCEPT {return expm1((double)__lcpp_x);}
+expm1(_A1 __lcpp_x) _NOEXCEPT {return ::expm1((double)__lcpp_x);}
// fdim
-inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fdimf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fdiml(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fdimf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fdiml(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1085,13 +1158,13 @@ fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// fma
-inline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
-inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return fmal(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return ::fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return ::fmal(__lcpp_x, __lcpp_y, __lcpp_z);}
template <class _A1, class _A2, class _A3>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1108,13 +1181,13 @@ fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value &&
std::is_same<_A3, __result_type>::value)), "");
- return fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
+ return ::fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
}
// fmax
-inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmaxf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmaxl(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fmaxf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmaxl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1129,13 +1202,13 @@ fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// fmin
-inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fminf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fminl(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fminf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fminl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1150,13 +1223,13 @@ fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// hypot
-inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return hypotf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return hypotl(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::hypotf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::hypotl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1171,115 +1244,115 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// ilogb
-inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ilogbf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ilogbl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ::ilogbf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ::ilogbl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, int>::type
-ilogb(_A1 __lcpp_x) _NOEXCEPT {return ilogb((double)__lcpp_x);}
+ilogb(_A1 __lcpp_x) _NOEXCEPT {return ::ilogb((double)__lcpp_x);}
// lgamma
-inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return lgammaf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return lgammal(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return ::lgammaf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return ::lgammal(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-lgamma(_A1 __lcpp_x) _NOEXCEPT {return lgamma((double)__lcpp_x);}
+lgamma(_A1 __lcpp_x) _NOEXCEPT {return ::lgamma((double)__lcpp_x);}
// llrint
-inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return llrintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return llrintl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return ::llrintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return ::llrintl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, long long>::type
-llrint(_A1 __lcpp_x) _NOEXCEPT {return llrint((double)__lcpp_x);}
+llrint(_A1 __lcpp_x) _NOEXCEPT {return ::llrint((double)__lcpp_x);}
// llround
-inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return llroundf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return llroundl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return ::llroundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return ::llroundl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, long long>::type
-llround(_A1 __lcpp_x) _NOEXCEPT {return llround((double)__lcpp_x);}
+llround(_A1 __lcpp_x) _NOEXCEPT {return ::llround((double)__lcpp_x);}
// log1p
-inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return log1pf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return log1pl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return ::log1pf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return ::log1pl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-log1p(_A1 __lcpp_x) _NOEXCEPT {return log1p((double)__lcpp_x);}
+log1p(_A1 __lcpp_x) _NOEXCEPT {return ::log1p((double)__lcpp_x);}
// log2
-inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return log2f(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return log2l(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return ::log2f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return ::log2l(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-log2(_A1 __lcpp_x) _NOEXCEPT {return log2((double)__lcpp_x);}
+log2(_A1 __lcpp_x) _NOEXCEPT {return ::log2((double)__lcpp_x);}
// logb
-inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return logbf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return logbl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return ::logbf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return ::logbl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-logb(_A1 __lcpp_x) _NOEXCEPT {return logb((double)__lcpp_x);}
+logb(_A1 __lcpp_x) _NOEXCEPT {return ::logb((double)__lcpp_x);}
// lrint
-inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return lrintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return lrintl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return ::lrintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return ::lrintl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, long>::type
-lrint(_A1 __lcpp_x) _NOEXCEPT {return lrint((double)__lcpp_x);}
+lrint(_A1 __lcpp_x) _NOEXCEPT {return ::lrint((double)__lcpp_x);}
// lround
-inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return lroundf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return lroundl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return ::lroundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return ::lroundl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, long>::type
-lround(_A1 __lcpp_x) _NOEXCEPT {return lround((double)__lcpp_x);}
+lround(_A1 __lcpp_x) _NOEXCEPT {return ::lround((double)__lcpp_x);}
// nan
// nearbyint
-inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return nearbyintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return nearbyintl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return ::nearbyintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return ::nearbyintl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-nearbyint(_A1 __lcpp_x) _NOEXCEPT {return nearbyint((double)__lcpp_x);}
+nearbyint(_A1 __lcpp_x) _NOEXCEPT {return ::nearbyint((double)__lcpp_x);}
// nextafter
-inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return nextafterf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nextafterl(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::nextafterf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nextafterl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1294,23 +1367,23 @@ nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// nexttoward
-inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardl(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardl(__lcpp_x, __lcpp_y);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttoward((double)__lcpp_x, __lcpp_y);}
+nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttoward((double)__lcpp_x, __lcpp_y);}
// remainder
-inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return remainderf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return remainderl(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::remainderf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::remainderl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1325,13 +1398,13 @@ remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
+ return ::remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// remquo
-inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
-inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return ::remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return ::remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1346,71 +1419,68 @@ remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
typedef typename std::__promote<_A1, _A2>::type __result_type;
static_assert((!(std::is_same<_A1, __result_type>::value &&
std::is_same<_A2, __result_type>::value)), "");
- return remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
+ return ::remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
}
// rint
-inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return rintf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return rintl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return ::rintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return ::rintl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-rint(_A1 __lcpp_x) _NOEXCEPT {return rint((double)__lcpp_x);}
+rint(_A1 __lcpp_x) _NOEXCEPT {return ::rint((double)__lcpp_x);}
// round
-inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return roundf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return roundl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return ::roundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return ::roundl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-round(_A1 __lcpp_x) _NOEXCEPT {return round((double)__lcpp_x);}
+round(_A1 __lcpp_x) _NOEXCEPT {return ::round((double)__lcpp_x);}
// scalbln
-inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnl(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnl(__lcpp_x, __lcpp_y);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalbln((double)__lcpp_x, __lcpp_y);}
+scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalbln((double)__lcpp_x, __lcpp_y);}
// scalbn
-inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnf(__lcpp_x, __lcpp_y);}
-inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnl(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnl(__lcpp_x, __lcpp_y);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbn((double)__lcpp_x, __lcpp_y);}
+scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbn((double)__lcpp_x, __lcpp_y);}
// tgamma
-inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return tgammaf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return tgammal(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return ::tgammaf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return ::tgammal(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-tgamma(_A1 __lcpp_x) _NOEXCEPT {return tgamma((double)__lcpp_x);}
+tgamma(_A1 __lcpp_x) _NOEXCEPT {return ::tgamma((double)__lcpp_x);}
// trunc
-inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return truncf(__lcpp_x);}
-inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return truncl(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return ::truncf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return ::truncl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_integral<_A1>::value, double>::type
-trunc(_A1 __lcpp_x) _NOEXCEPT {return trunc((double)__lcpp_x);}
-
-#endif // !_LIBCPP_MSVCRT
-#endif // __sun__
+trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((double)__lcpp_x);}
} // extern "C++"
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/memory b/chromium/buildtools/third_party/libc++/trunk/include/memory
index 65369d2632c..31dc73d8b14 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/memory
+++ b/chromium/buildtools/third_party/libc++/trunk/include/memory
@@ -164,6 +164,7 @@ template <class T> pair<T*,ptrdiff_t> get_temporary_buffer(ptrdiff_t n) noexcept
template <class T> void return_temporary_buffer(T* p) noexcept;
template <class T> T* addressof(T& r) noexcept;
+template <class T> T* addressof(const T&& r) noexcept = delete;
template <class InputIterator, class ForwardIterator>
ForwardIterator
@@ -180,10 +181,37 @@ template <class ForwardIterator, class Size, class T>
ForwardIterator
uninitialized_fill_n(ForwardIterator first, Size n, const T& x);
-template <class Y> struct auto_ptr_ref {};
+template <class T>
+void destroy_at(T* location);
+
+template <class ForwardIterator>
+ void destroy(ForwardIterator first, ForwardIterator last);
+
+template <class ForwardIterator, class Size>
+ ForwardIterator destroy_n(ForwardIterator first, Size n);
+
+template <class InputIterator, class ForwardIterator>
+ ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result);
+
+template <class InputIterator, class Size, class ForwardIterator>
+ pair<InputIterator,ForwardIterator> uninitialized_move_n(InputIterator first, Size n, ForwardIterator result);
+
+template <class ForwardIterator>
+ void uninitialized_value_construct(ForwardIterator first, ForwardIterator last);
+
+template <class ForwardIterator, class Size>
+ ForwardIterator uninitialized_value_construct_n(ForwardIterator first, Size n);
+
+template <class ForwardIterator>
+ void uninitialized_default_construct(ForwardIterator first, ForwardIterator last);
+
+template <class ForwardIterator, class Size>
+ ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n);
+
+template <class Y> struct auto_ptr_ref {}; // removed in C++17
template<class X>
-class auto_ptr
+class auto_ptr // removed in C++17
{
public:
typedef X element_type;
@@ -242,7 +270,7 @@ public:
template <class U, class E>
unique_ptr(unique_ptr<U, E>&& u) noexcept;
template <class U>
- unique_ptr(auto_ptr<U>&& u) noexcept;
+ unique_ptr(auto_ptr<U>&& u) noexcept; // removed in C++17
// destructor
~unique_ptr();
@@ -361,6 +389,7 @@ class shared_ptr
{
public:
typedef T element_type;
+ typedef weak_ptr<T> weak_type; // C++17
// constructors:
constexpr shared_ptr() noexcept;
@@ -375,7 +404,7 @@ public:
shared_ptr(shared_ptr&& r) noexcept;
template<class Y> shared_ptr(shared_ptr<Y>&& r) noexcept;
template<class Y> explicit shared_ptr(const weak_ptr<Y>& r);
- template<class Y> shared_ptr(auto_ptr<Y>&& r);
+ template<class Y> shared_ptr(auto_ptr<Y>&& r); // removed in C++17
template <class Y, class D> shared_ptr(unique_ptr<Y, D>&& r);
shared_ptr(nullptr_t) : shared_ptr() { }
@@ -387,7 +416,7 @@ public:
template<class Y> shared_ptr& operator=(const shared_ptr<Y>& r) noexcept;
shared_ptr& operator=(shared_ptr&& r) noexcept;
template<class Y> shared_ptr& operator=(shared_ptr<Y>&& r);
- template<class Y> shared_ptr& operator=(auto_ptr<Y>&& r);
+ template<class Y> shared_ptr& operator=(auto_ptr<Y>&& r); // removed in C++17
template <class Y, class D> shared_ptr& operator=(unique_ptr<Y, D>&& r);
// modifiers:
@@ -404,8 +433,8 @@ public:
long use_count() const noexcept;
bool unique() const noexcept;
explicit operator bool() const noexcept;
- template<class U> bool owner_before(shared_ptr<U> const& b) const;
- template<class U> bool owner_before(weak_ptr<U> const& b) const;
+ template<class U> bool owner_before(shared_ptr<U> const& b) const noexcept;
+ template<class U> bool owner_before(weak_ptr<U> const& b) const noexcept;
};
// shared_ptr comparisons:
@@ -502,8 +531,8 @@ public:
long use_count() const noexcept;
bool expired() const noexcept;
shared_ptr<T> lock() const noexcept;
- template<class U> bool owner_before(shared_ptr<U> const& b) const;
- template<class U> bool owner_before(weak_ptr<U> const& b) const;
+ template<class U> bool owner_before(shared_ptr<U> const& b) const noexcept;
+ template<class U> bool owner_before(weak_ptr<U> const& b) const noexcept;
};
// weak_ptr specialized algorithms:
@@ -517,9 +546,9 @@ struct owner_less<shared_ptr<T>>
: binary_function<shared_ptr<T>, shared_ptr<T>, bool>
{
typedef bool result_type;
- bool operator()(shared_ptr<T> const&, shared_ptr<T> const&) const;
- bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
- bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
+ bool operator()(shared_ptr<T> const&, shared_ptr<T> const&) const noexcept;
+ bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const noexcept;
+ bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const noexcept;
};
template<class T>
@@ -527,9 +556,24 @@ struct owner_less<weak_ptr<T>>
: binary_function<weak_ptr<T>, weak_ptr<T>, bool>
{
typedef bool result_type;
- bool operator()(weak_ptr<T> const&, weak_ptr<T> const&) const;
- bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
- bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
+ bool operator()(weak_ptr<T> const&, weak_ptr<T> const&) const noexcept;
+ bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const noexcept;
+ bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const noexcept;
+};
+
+template <> // Added in C++14
+struct owner_less<void>
+{
+ template <class _Tp, class _Up>
+ bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept;
+ template <class _Tp, class _Up>
+ bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const noexcept;
+ template <class _Tp, class _Up>
+ bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept;
+ template <class _Tp, class _Up>
+ bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const noexcept;
+
+ typedef void is_transparent;
};
template<class T>
@@ -607,17 +651,14 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
#include <__functional_base>
#include <iosfwd>
#include <tuple>
+#include <stdexcept>
#include <cstring>
-#if defined(_LIBCPP_NO_EXCEPTIONS)
- #include <cassert>
-#endif
-
+#include <cassert>
#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
# include <atomic>
#endif
#include <__undef_min_max>
-#include <__undef___deallocate>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -637,12 +678,24 @@ _ValueType __libcpp_relaxed_load(_ValueType const* __value) {
#endif
}
-// addressof moved to <__functional_base>
+template <class _ValueType>
+inline _LIBCPP_ALWAYS_INLINE
+_ValueType __libcpp_acquire_load(_ValueType const* __value) {
+#if !defined(_LIBCPP_HAS_NO_THREADS) && \
+ defined(__ATOMIC_ACQUIRE) && \
+ (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407)
+ return __atomic_load_n(__value, __ATOMIC_ACQUIRE);
+#else
+ return *__value;
+#endif
+}
+
+// addressof moved to <type_traits>
template <class _Tp> class allocator;
template <>
-class _LIBCPP_TYPE_VIS_ONLY allocator<void>
+class _LIBCPP_TEMPLATE_VIS allocator<void>
{
public:
typedef void* pointer;
@@ -653,7 +706,7 @@ public:
};
template <>
-class _LIBCPP_TYPE_VIS_ONLY allocator<const void>
+class _LIBCPP_TEMPLATE_VIS allocator<const void>
{
public:
typedef const void* pointer;
@@ -790,7 +843,7 @@ public:
template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
struct __pointer_traits_rebind
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Tp::template rebind<_Up> type;
#else
typedef typename _Tp::template rebind<_Up>::other type;
@@ -802,7 +855,7 @@ struct __pointer_traits_rebind
template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
@@ -820,7 +873,7 @@ struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
template <template <class> class _Sp, class _Tp, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp>::template rebind<_Up>::other type;
@@ -836,7 +889,7 @@ struct __pointer_traits_rebind<_Sp<_Tp>, _Up, false>
template <template <class, class> class _Sp, class _Tp, class _A0, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0>::template rebind<_Up>::other type;
@@ -853,7 +906,7 @@ template <template <class, class, class> class _Sp, class _Tp, class _A0,
class _A1, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0, _A1>::template rebind<_Up>::other type;
@@ -871,7 +924,7 @@ template <template <class, class, class, class> class _Sp, class _Tp, class _A0,
class _A1, class _A2, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, true>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up> type;
#else
typedef typename _Sp<_Tp, _A0, _A1, _A2>::template rebind<_Up>::other type;
@@ -888,18 +941,18 @@ struct __pointer_traits_rebind<_Sp<_Tp, _A0, _A1, _A2>, _Up, false>
#endif // _LIBCPP_HAS_NO_VARIADICS
template <class _Ptr>
-struct _LIBCPP_TYPE_VIS_ONLY pointer_traits
+struct _LIBCPP_TEMPLATE_VIS pointer_traits
{
typedef _Ptr pointer;
typedef typename __pointer_traits_element_type<pointer>::type element_type;
typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
#else
template <class _Up> struct rebind
{typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
private:
struct __nat {};
@@ -911,13 +964,13 @@ public:
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY pointer_traits<_Tp*>
+struct _LIBCPP_TEMPLATE_VIS pointer_traits<_Tp*>
{
typedef _Tp* pointer;
typedef _Tp element_type;
typedef ptrdiff_t difference_type;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Up> using rebind = _Up*;
#else
template <class _Up> struct rebind {typedef _Up* other;};
@@ -934,7 +987,7 @@ public:
template <class _From, class _To>
struct __rebind_pointer {
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_From>::template rebind<_To> type;
#else
typedef typename pointer_traits<_From>::template rebind<_To>::other type;
@@ -943,11 +996,11 @@ struct __rebind_pointer {
// allocator_traits
-namespace __has_pointer_type_imp
+struct __has_pointer_type_imp
{
template <class _Up> static __two __test(...);
template <class _Up> static char __test(typename _Up::pointer* = 0);
-}
+};
template <class _Tp>
struct __has_pointer_type
@@ -998,7 +1051,7 @@ struct __const_pointer
template <class _Tp, class _Ptr, class _Alloc>
struct __const_pointer<_Tp, _Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<const _Tp> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<const _Tp>::other type;
@@ -1025,7 +1078,7 @@ struct __void_pointer
template <class _Ptr, class _Alloc>
struct __void_pointer<_Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<void> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<void>::other type;
@@ -1052,7 +1105,7 @@ struct __const_void_pointer
template <class _Ptr, class _Alloc>
struct __const_void_pointer<_Ptr, _Alloc, false>
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename pointer_traits<_Ptr>::template rebind<const void> type;
#else
typedef typename pointer_traits<_Ptr>::template rebind<const void>::other type;
@@ -1283,7 +1336,7 @@ struct __allocator_traits_rebind<_Alloc<_Tp, _A0, _A1, _A2>, _Up, false>
#endif // _LIBCPP_HAS_NO_VARIADICS
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc, class _SizeType, class _ConstVoidPtr>
auto
@@ -1306,7 +1359,7 @@ struct __has_allocate_hint
{
};
-#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#else // _LIBCPP_CXX03_LANG
template <class _Alloc, class _SizeType, class _ConstVoidPtr>
struct __has_allocate_hint
@@ -1314,9 +1367,9 @@ struct __has_allocate_hint
{
};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
-#if !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#if !defined(_LIBCPP_CXX03_LANG)
template <class _Alloc, class _Tp, class ..._Args>
decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Tp*>(),
@@ -1397,7 +1450,7 @@ struct __has_select_on_container_copy_construction
{
};
-#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#else // _LIBCPP_CXX03_LANG
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -1435,7 +1488,7 @@ struct __has_select_on_container_copy_construction
{
};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
template <class _Alloc, class _Ptr, bool = __has_difference_type<_Alloc>::value>
struct __alloc_traits_difference_type
@@ -1450,7 +1503,7 @@ struct __alloc_traits_difference_type<_Alloc, _Ptr, true>
};
template <class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
+struct _LIBCPP_TEMPLATE_VIS allocator_traits
{
typedef _Alloc allocator_type;
typedef typename allocator_type::value_type value_type;
@@ -1472,16 +1525,16 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
typedef typename __is_always_equal<allocator_type>::type
is_always_equal;
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp> using rebind_alloc =
typename __allocator_traits_rebind<allocator_type, _Tp>::type;
template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _Tp> struct rebind_alloc
{typedef typename __allocator_traits_rebind<allocator_type, _Tp>::type other;};
template <class _Tp> struct rebind_traits
{typedef allocator_traits<typename rebind_alloc<_Tp>::other> other;};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
static pointer allocate(allocator_type& __a, size_type __n)
@@ -1504,26 +1557,26 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
#else // _LIBCPP_HAS_NO_VARIADICS
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
- static void construct(allocator_type& __a, _Tp* __p)
+ static void construct(allocator_type&, _Tp* __p)
{
::new ((void*)__p) _Tp();
}
template <class _Tp, class _A0>
_LIBCPP_INLINE_VISIBILITY
- static void construct(allocator_type& __a, _Tp* __p, const _A0& __a0)
+ static void construct(allocator_type&, _Tp* __p, const _A0& __a0)
{
::new ((void*)__p) _Tp(__a0);
}
template <class _Tp, class _A0, class _A1>
_LIBCPP_INLINE_VISIBILITY
- static void construct(allocator_type& __a, _Tp* __p, const _A0& __a0,
+ static void construct(allocator_type&, _Tp* __p, const _A0& __a0,
const _A1& __a1)
{
::new ((void*)__p) _Tp(__a0, __a1);
}
template <class _Tp, class _A0, class _A1, class _A2>
_LIBCPP_INLINE_VISIBILITY
- static void construct(allocator_type& __a, _Tp* __p, const _A0& __a0,
+ static void construct(allocator_type&, _Tp* __p, const _A0& __a0,
const _A1& __a1, const _A2& __a2)
{
::new ((void*)__p) _Tp(__a0, __a1, __a2);
@@ -1566,7 +1619,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_forward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
+ __construct_forward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
{
ptrdiff_t _Np = __end1 - __begin1;
if (_Np > 0)
@@ -1596,7 +1649,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_range_forward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
+ __construct_range_forward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
{
typedef typename remove_const<_Tp>::type _Vp;
ptrdiff_t _Np = __end1 - __begin1;
@@ -1630,7 +1683,7 @@ struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
is_trivially_move_constructible<_Tp>::value,
void
>::type
- __construct_backward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __end2)
+ __construct_backward(allocator_type&, _Tp* __begin1, _Tp* __end1, _Tp*& __end2)
{
ptrdiff_t _Np = __end1 - __begin1;
__end2 -= _Np;
@@ -1693,7 +1746,7 @@ private:
template <class _Traits, class _Tp>
struct __rebind_alloc_helper
{
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
typedef typename _Traits::template rebind_alloc<_Tp> type;
#else
typedef typename _Traits::template rebind_alloc<_Tp>::other type;
@@ -1703,7 +1756,7 @@ struct __rebind_alloc_helper
// allocator
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY allocator
+class _LIBCPP_TEMPLATE_VIS allocator
{
public:
typedef size_t size_type;
@@ -1726,9 +1779,14 @@ public:
_LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT
{return _VSTD::addressof(__x);}
_LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
- {return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp)));}
+ {
+ if (__n > max_size())
+ __throw_length_error("allocator<T>::allocate(size_t n)"
+ " 'n' exceeds maximum supported size");
+ return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp)));
+ }
_LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT
- {_VSTD::__deallocate((void*)__p);}
+ {_VSTD::__libcpp_deallocate((void*)__p);}
_LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT
{return size_type(~0) / sizeof(_Tp);}
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
@@ -1796,7 +1854,7 @@ public:
};
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY allocator<const _Tp>
+class _LIBCPP_TEMPLATE_VIS allocator<const _Tp>
{
public:
typedef size_t size_type;
@@ -1817,9 +1875,14 @@ public:
_LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT
{return _VSTD::addressof(__x);}
_LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
- {return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp)));}
+ {
+ if (__n > max_size())
+ __throw_length_error("allocator<const T>::allocate(size_t n)"
+ " 'n' exceeds maximum supported size");
+ return static_cast<pointer>(_VSTD::__allocate(__n * sizeof(_Tp)));
+ }
_LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT
- {_VSTD::__deallocate((void*)__p);}
+ {_VSTD::__libcpp_deallocate((void*)__p);}
_LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT
{return size_type(~0) / sizeof(_Tp);}
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
@@ -1895,7 +1958,7 @@ inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
template <class _OutputIterator, class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY raw_storage_iterator
+class _LIBCPP_TEMPLATE_VIS raw_storage_iterator
: public iterator<output_iterator_tag,
_Tp, // purposefully not C++03
ptrdiff_t, // purposefully not C++03
@@ -1948,6 +2011,7 @@ template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void return_temporary_buffer(_Tp* __p) _NOEXCEPT {::operator delete(__p);}
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template <class _Tp>
struct auto_ptr_ref
{
@@ -1955,7 +2019,7 @@ struct auto_ptr_ref
};
template<class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY auto_ptr
+class _LIBCPP_TEMPLATE_VIS auto_ptr
{
private:
_Tp* __ptr_;
@@ -1999,983 +2063,832 @@ public:
};
template <>
-class _LIBCPP_TYPE_VIS_ONLY auto_ptr<void>
+class _LIBCPP_TEMPLATE_VIS auto_ptr<void>
{
public:
typedef void element_type;
};
+#endif
-template <class _T1, class _T2, bool = is_same<typename remove_cv<_T1>::type,
- typename remove_cv<_T2>::type>::value,
- bool = is_empty<_T1>::value
- && !__libcpp_is_final<_T1>::value,
- bool = is_empty<_T2>::value
- && !__libcpp_is_final<_T2>::value
- >
-struct __libcpp_compressed_pair_switch;
+template <class _Tp, int _Idx,
+ bool _CanBeEmptyBase =
+ is_empty<_Tp>::value && !__libcpp_is_final<_Tp>::value>
+struct __compressed_pair_elem {
+ typedef _Tp _ParamT;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+
+#ifndef _LIBCPP_CXX03_LANG
+ constexpr __compressed_pair_elem() : __value_() {}
+
+ template <class _Up, class = typename enable_if<
+ !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
+ >::type>
+ constexpr explicit
+ __compressed_pair_elem(_Up&& __u)
+ : __value_(_VSTD::forward<_Up>(__u)){};
+
+ template <class... _Args, size_t... _Indexes>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
+ __tuple_indices<_Indexes...>)
+ : __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
+#else
+ __compressed_pair_elem() : __value_() {}
+ __compressed_pair_elem(_ParamT __p) : __value_(std::forward<_ParamT>(__p)) {}
+#endif
-template <class _T1, class _T2, bool IsSame>
-struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, false, false> {enum {value = 0};};
+ reference __get() _NOEXCEPT { return __value_; }
+ const_reference __get() const _NOEXCEPT { return __value_; }
-template <class _T1, class _T2, bool IsSame>
-struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, true, false> {enum {value = 1};};
+private:
+ _Tp __value_;
+};
+
+template <class _Tp, int _Idx>
+struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
+ typedef _Tp _ParamT;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp __value_type;
+
+#ifndef _LIBCPP_CXX03_LANG
+ constexpr __compressed_pair_elem() = default;
+
+ template <class _Up, class = typename enable_if<
+ !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
+ >::type>
+ constexpr explicit
+ __compressed_pair_elem(_Up&& __u)
+ : __value_type(_VSTD::forward<_Up>(__u)){};
+
+ template <class... _Args, size_t... _Indexes>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
+ __tuple_indices<_Indexes...>)
+ : __value_type(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
+#else
+ __compressed_pair_elem() : __value_type() {}
+ __compressed_pair_elem(_ParamT __p)
+ : __value_type(std::forward<_ParamT>(__p)) {}
+#endif
-template <class _T1, class _T2, bool IsSame>
-struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, false, true> {enum {value = 2};};
+ reference __get() _NOEXCEPT { return *this; }
+ const_reference __get() const _NOEXCEPT { return *this; }
+};
-template <class _T1, class _T2>
-struct __libcpp_compressed_pair_switch<_T1, _T2, false, true, true> {enum {value = 3};};
+// Tag used to construct the second element of the compressed pair.
+struct __second_tag {};
template <class _T1, class _T2>
-struct __libcpp_compressed_pair_switch<_T1, _T2, true, true, true> {enum {value = 1};};
-
-template <class _T1, class _T2, unsigned = __libcpp_compressed_pair_switch<_T1, _T2>::value>
-class __libcpp_compressed_pair_imp;
+class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
+ private __compressed_pair_elem<_T2, 1> {
+ typedef __compressed_pair_elem<_T1, 0> _Base1;
+ typedef __compressed_pair_elem<_T2, 1> _Base2;
+
+ // NOTE: This static assert should never fire because __compressed_pair
+ // is *almost never* used in a scenario where it's possible for T1 == T2.
+ // (The exception is std::function where it is possible that the function
+ // object and the allocator have the same type).
+ static_assert((!is_same<_T1, _T2>::value),
+ "__compressed_pair cannot be instantated when T1 and T2 are the same type; "
+ "The current implementation is NOT ABI-compatible with the previous "
+ "implementation for this configuration");
-template <class _T1, class _T2>
-class __libcpp_compressed_pair_imp<_T1, _T2, 0>
-{
-private:
- _T1 __first_;
- _T2 __second_;
public:
- typedef _T1 _T1_param;
- typedef _T2 _T2_param;
-
- typedef typename remove_reference<_T1>::type& _T1_reference;
- typedef typename remove_reference<_T2>::type& _T2_reference;
-
- typedef const typename remove_reference<_T1>::type& _T1_const_reference;
- typedef const typename remove_reference<_T2>::type& _T2_const_reference;
-
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __first_(), __second_() {}
- _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
- : __first_(_VSTD::forward<_T1_param>(__t1)), __second_() {}
- _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
- : __first_(), __second_(_VSTD::forward<_T2_param>(__t2)) {}
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
- : __first_(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
+#ifndef _LIBCPP_CXX03_LANG
+ template <bool _Dummy = true,
+ class = typename enable_if<
+ __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
+ __dependent_type<is_default_constructible<_T2>, _Dummy>::value
+ >::type
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr __compressed_pair() {}
+
+ template <class _Tp, typename enable_if<!is_same<typename decay<_Tp>::type,
+ __compressed_pair>::value,
+ bool>::type = true>
+ _LIBCPP_INLINE_VISIBILITY constexpr explicit
+ __compressed_pair(_Tp&& __t)
+ : _Base1(std::forward<_Tp>(__t)), _Base2() {}
+
+ template <class _Tp>
+ _LIBCPP_INLINE_VISIBILITY constexpr
+ __compressed_pair(__second_tag, _Tp&& __t)
+ : _Base1(), _Base2(std::forward<_Tp>(__t)) {}
+
+ template <class _U1, class _U2>
+ _LIBCPP_INLINE_VISIBILITY constexpr
+ __compressed_pair(_U1&& __t1, _U2&& __t2)
+ : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
+
+ template <class... _Args1, class... _Args2>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+ __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
+ tuple<_Args2...> __second_args)
+ : _Base1(__pc, _VSTD::move(__first_args),
+ typename __make_tuple_indices<sizeof...(_Args1)>::type()),
+ _Base2(__pc, _VSTD::move(__second_args),
+ typename __make_tuple_indices<sizeof...(_Args2)>::type()) {}
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : __first_(__p.first()),
- __second_(__p.second()) {}
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ __compressed_pair() {}
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- __first_ = __p.first();
- __second_ = __p.second();
- return *this;
- }
+ _LIBCPP_INLINE_VISIBILITY explicit
+ __compressed_pair(_T1 __t1) : _Base1(_VSTD::forward<_T1>(__t1)) {}
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : __first_(_VSTD::forward<_T1>(__p.first())),
- __second_(_VSTD::forward<_T2>(__p.second())) {}
+ _LIBCPP_INLINE_VISIBILITY
+ __compressed_pair(__second_tag, _T2 __t2)
+ : _Base1(), _Base2(_VSTD::forward<_T2>(__t2)) {}
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- __first_ = _VSTD::forward<_T1>(__p.first());
- __second_ = _VSTD::forward<_T2>(__p.second());
- return *this;
- }
-
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+ _LIBCPP_INLINE_VISIBILITY
+ __compressed_pair(_T1 __t1, _T2 __t2)
+ : _Base1(_VSTD::forward<_T1>(__t1)), _Base2(_VSTD::forward<_T2>(__t2)) {}
+#endif
- template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
- tuple<_Args1...> __first_args,
- tuple<_Args2...> __second_args,
- __tuple_indices<_I1...>,
- __tuple_indices<_I2...>)
- : __first_(_VSTD::forward<_Args1>(_VSTD::get<_I1>(__first_args))...),
- __second_(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
- {}
+ _LIBCPP_INLINE_VISIBILITY
+ typename _Base1::reference first() _NOEXCEPT {
+ return static_cast<_Base1&>(*this).__get();
+ }
-#endif // _LIBCPP_HAS_NO_VARIADICS
+ _LIBCPP_INLINE_VISIBILITY
+ typename _Base1::const_reference first() const _NOEXCEPT {
+ return static_cast<_Base1 const&>(*this).__get();
+ }
- _LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return __first_;}
- _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
+ _LIBCPP_INLINE_VISIBILITY
+ typename _Base2::reference second() _NOEXCEPT {
+ return static_cast<_Base2&>(*this).__get();
+ }
- _LIBCPP_INLINE_VISIBILITY _T2_reference second() _NOEXCEPT {return __second_;}
- _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return __second_;}
+ _LIBCPP_INLINE_VISIBILITY
+ typename _Base2::const_reference second() const _NOEXCEPT {
+ return static_cast<_Base2 const&>(*this).__get();
+ }
- _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
- _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value)
- {
- using _VSTD::swap;
- swap(__first_, __x.__first_);
- swap(__second_, __x.__second_);
- }
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(__compressed_pair& __x)
+ _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+ __is_nothrow_swappable<_T2>::value)
+ {
+ using std::swap;
+ swap(first(), __x.first());
+ swap(second(), __x.second());
+ }
};
template <class _T1, class _T2>
-class __libcpp_compressed_pair_imp<_T1, _T2, 1>
- : private _T1
-{
-private:
- _T2 __second_;
-public:
- typedef _T1 _T1_param;
- typedef _T2 _T2_param;
-
- typedef _T1& _T1_reference;
- typedef typename remove_reference<_T2>::type& _T2_reference;
-
- typedef const _T1& _T1_const_reference;
- typedef const typename remove_reference<_T2>::type& _T2_const_reference;
-
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __second_() {}
- _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
- : _T1(_VSTD::forward<_T1_param>(__t1)), __second_() {}
- _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
- : __second_(_VSTD::forward<_T2_param>(__t2)) {}
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
- : _T1(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
-
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : _T1(__p.first()), __second_(__p.second()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- _T1::operator=(__p.first());
- __second_ = __p.second();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : _T1(_VSTD::move(__p.first())), __second_(_VSTD::forward<_T2>(__p.second())) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- _T1::operator=(_VSTD::move(__p.first()));
- __second_ = _VSTD::forward<_T2>(__p.second());
- return *this;
- }
-
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
- template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
- tuple<_Args1...> __first_args,
- tuple<_Args2...> __second_args,
- __tuple_indices<_I1...>,
- __tuple_indices<_I2...>)
- : _T1(_VSTD::forward<_Args1>(_VSTD::get<_I1>(__first_args))...),
- __second_(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
- {}
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
- _LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return *this;}
- _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
+inline _LIBCPP_INLINE_VISIBILITY
+void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
+ _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+ __is_nothrow_swappable<_T2>::value) {
+ __x.swap(__y);
+}
- _LIBCPP_INLINE_VISIBILITY _T2_reference second() _NOEXCEPT {return __second_;}
- _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return __second_;}
+// default_delete
- _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
- _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value)
- {
- using _VSTD::swap;
- swap(__second_, __x.__second_);
- }
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS default_delete {
+ static_assert(!is_function<_Tp>::value,
+ "default_delete cannot be instantiated for function types");
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY constexpr default_delete() noexcept = default;
+#else
+ _LIBCPP_INLINE_VISIBILITY default_delete() {}
+#endif
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ default_delete(const default_delete<_Up>&,
+ typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* =
+ 0) _NOEXCEPT {}
+
+ _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __ptr) const _NOEXCEPT {
+ static_assert(sizeof(_Tp) > 0,
+ "default_delete can not delete incomplete type");
+ static_assert(!is_void<_Tp>::value,
+ "default_delete can not delete incomplete type");
+ delete __ptr;
+ }
};
-template <class _T1, class _T2>
-class __libcpp_compressed_pair_imp<_T1, _T2, 2>
- : private _T2
-{
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS default_delete<_Tp[]> {
private:
- _T1 __first_;
-public:
- typedef _T1 _T1_param;
- typedef _T2 _T2_param;
-
- typedef typename remove_reference<_T1>::type& _T1_reference;
- typedef _T2& _T2_reference;
-
- typedef const typename remove_reference<_T1>::type& _T1_const_reference;
- typedef const _T2& _T2_const_reference;
-
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __first_() {}
- _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
- : __first_(_VSTD::forward<_T1_param>(__t1)) {}
- _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
- : _T2(_VSTD::forward<_T2_param>(__t2)), __first_() {}
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : _T2(_VSTD::forward<_T2_param>(__t2)), __first_(_VSTD::forward<_T1_param>(__t1)) {}
-
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+ template <class _Up>
+ struct _EnableIfConvertible
+ : enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value> {};
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : _T2(__p.second()), __first_(__p.first()) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- _T2::operator=(__p.second());
- __first_ = __p.first();
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : _T2(_VSTD::forward<_T2>(__p.second())), __first_(_VSTD::move(__p.first())) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- _T2::operator=(_VSTD::forward<_T2>(__p.second()));
- __first_ = _VSTD::move(__p.first());
- return *this;
- }
-
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+public:
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY constexpr default_delete() noexcept = default;
+#else
+ _LIBCPP_INLINE_VISIBILITY default_delete() {}
+#endif
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ default_delete(const default_delete<_Up[]>&,
+ typename _EnableIfConvertible<_Up>::type* = 0) _NOEXCEPT {}
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ typename _EnableIfConvertible<_Up>::type
+ operator()(_Up* __ptr) const _NOEXCEPT {
+ static_assert(sizeof(_Tp) > 0,
+ "default_delete can not delete incomplete type");
+ static_assert(!is_void<_Tp>::value,
+ "default_delete can not delete void type");
+ delete[] __ptr;
+ }
+};
- template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
- tuple<_Args1...> __first_args,
- tuple<_Args2...> __second_args,
- __tuple_indices<_I1...>,
- __tuple_indices<_I2...>)
- : _T2(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...),
- __first_(_VSTD::forward<_Args1>(_VSTD::get<_I1>(__first_args))...)
-
- {}
-#endif // _LIBCPP_HAS_NO_VARIADICS
- _LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return __first_;}
- _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Deleter>
+struct __unique_ptr_deleter_sfinae {
+ static_assert(!is_reference<_Deleter>::value, "incorrect specialization");
+ typedef const _Deleter& __lval_ref_type;
+ typedef _Deleter&& __good_rval_ref_type;
+ typedef true_type __enable_rval_overload;
+};
- _LIBCPP_INLINE_VISIBILITY _T2_reference second() _NOEXCEPT {return *this;}
- _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return *this;}
+template <class _Deleter>
+struct __unique_ptr_deleter_sfinae<_Deleter const&> {
+ typedef const _Deleter& __lval_ref_type;
+ typedef const _Deleter&& __bad_rval_ref_type;
+ typedef false_type __enable_rval_overload;
+};
- _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
- _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value)
- {
- using _VSTD::swap;
- swap(__first_, __x.__first_);
- }
+template <class _Deleter>
+struct __unique_ptr_deleter_sfinae<_Deleter&> {
+ typedef _Deleter& __lval_ref_type;
+ typedef _Deleter&& __bad_rval_ref_type;
+ typedef false_type __enable_rval_overload;
};
+#endif // !defined(_LIBCPP_CXX03_LANG)
-template <class _T1, class _T2>
-class __libcpp_compressed_pair_imp<_T1, _T2, 3>
- : private _T1,
- private _T2
-{
+template <class _Tp, class _Dp = default_delete<_Tp> >
+class _LIBCPP_TEMPLATE_VIS unique_ptr {
public:
- typedef _T1 _T1_param;
- typedef _T2 _T2_param;
-
- typedef _T1& _T1_reference;
- typedef _T2& _T2_reference;
-
- typedef const _T1& _T1_const_reference;
- typedef const _T2& _T2_const_reference;
+ typedef _Tp element_type;
+ typedef _Dp deleter_type;
+ typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
- _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
- : _T1(_VSTD::forward<_T1_param>(__t1)) {}
- _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
- : _T2(_VSTD::forward<_T2_param>(__t2)) {}
- _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
- : _T1(_VSTD::forward<_T1_param>(__t1)), _T2(_VSTD::forward<_T2_param>(__t2)) {}
+ static_assert(!is_rvalue_reference<deleter_type>::value,
+ "the specified deleter type cannot be an rvalue reference");
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
-
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : _T1(__p.first()), _T2(__p.second()) {}
+private:
+ __compressed_pair<pointer, deleter_type> __ptr_;
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(const __libcpp_compressed_pair_imp& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- _T1::operator=(__p.first());
- _T2::operator=(__p.second());
- return *this;
- }
+ struct __nat { int __for_bool_; };
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : _T1(_VSTD::move(__p.first())), _T2(_VSTD::move(__p.second())) {}
+#ifndef _LIBCPP_CXX03_LANG
+ typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp& operator=(__libcpp_compressed_pair_imp&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- _T1::operator=(_VSTD::move(__p.first()));
- _T2::operator=(_VSTD::move(__p.second()));
- return *this;
- }
+ template <bool _Dummy>
+ using _LValRefType =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+ template <bool _Dummy>
+ using _GoodRValRefType =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+ template <bool _Dummy>
+ using _BadRValRefType =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
- template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
- _LIBCPP_INLINE_VISIBILITY
- __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
- tuple<_Args1...> __first_args,
- tuple<_Args2...> __second_args,
- __tuple_indices<_I1...>,
- __tuple_indices<_I2...>)
- : _T1(_VSTD::forward<_Args1>(_VSTD::get<_I1>(__first_args))...),
- _T2(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
- {}
+ template <bool _Dummy, class _Deleter = typename __dependent_type<
+ __identity<deleter_type>, _Dummy>::type>
+ using _EnableIfDeleterDefaultConstructible =
+ typename enable_if<is_default_constructible<_Deleter>::value &&
+ !is_pointer<_Deleter>::value>::type;
-#endif // _LIBCPP_HAS_NO_VARIADICS
+ template <class _ArgType>
+ using _EnableIfDeleterConstructible =
+ typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
- _LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return *this;}
- _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
+ template <class _UPtr, class _Up>
+ using _EnableIfMoveConvertible = typename enable_if<
+ is_convertible<typename _UPtr::pointer, pointer>::value &&
+ !is_array<_Up>::value
+ >::type;
- _LIBCPP_INLINE_VISIBILITY _T2_reference second() _NOEXCEPT {return *this;}
- _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return *this;}
+ template <class _UDel>
+ using _EnableIfDeleterConvertible = typename enable_if<
+ (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
+ (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
+ >::type;
- _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp&)
- _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value)
- {
- }
-};
+ template <class _UDel>
+ using _EnableIfDeleterAssignable = typename enable_if<
+ is_assignable<_Dp&, _UDel&&>::value
+ >::type;
-template <class _T1, class _T2>
-class __compressed_pair
- : private __libcpp_compressed_pair_imp<_T1, _T2>
-{
- typedef __libcpp_compressed_pair_imp<_T1, _T2> base;
public:
- typedef typename base::_T1_param _T1_param;
- typedef typename base::_T2_param _T2_param;
-
- typedef typename base::_T1_reference _T1_reference;
- typedef typename base::_T2_reference _T2_reference;
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy>>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr unique_ptr() noexcept : __ptr_(pointer()) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy>>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr unique_ptr(nullptr_t) noexcept : __ptr_(pointer()) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy>>
+ _LIBCPP_INLINE_VISIBILITY
+ explicit unique_ptr(pointer __p) noexcept : __ptr_(__p) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(pointer __p, _LValRefType<_Dummy> __d) noexcept
+ : __ptr_(__p, __d) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) noexcept
+ : __ptr_(__p, _VSTD::move(__d)) {
+ static_assert(!is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference");
+ }
- typedef typename base::_T1_const_reference _T1_const_reference;
- typedef typename base::_T2_const_reference _T2_const_reference;
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy>>>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete;
- _LIBCPP_INLINE_VISIBILITY __compressed_pair() {}
- _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T1_param __t1)
- : base(_VSTD::forward<_T1_param>(__t1)) {}
- _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T2_param __t2)
- : base(_VSTD::forward<_T2_param>(__t2)) {}
- _LIBCPP_INLINE_VISIBILITY __compressed_pair(_T1_param __t1, _T2_param __t2)
- : base(_VSTD::forward<_T1_param>(__t1), _VSTD::forward<_T2_param>(__t2)) {}
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(unique_ptr&& __u) noexcept
+ : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
+ }
-#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+ template <class _Up, class _Ep,
+ class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
+ class = _EnableIfDeleterConvertible<_Ep>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
+ : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(auto_ptr<_Up>&& __p,
+ typename enable_if<is_convertible<_Up*, _Tp*>::value &&
+ is_same<_Dp, default_delete<_Tp>>::value,
+ __nat>::type = __nat()) _NOEXCEPT
+ : __ptr_(__p.release()) {}
+#endif
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair(const __compressed_pair& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
- is_nothrow_copy_constructible<_T2>::value)
- : base(__p) {}
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+ return *this;
+ }
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair& operator=(const __compressed_pair& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<_T1>::value &&
- is_nothrow_copy_assignable<_T2>::value)
- {
- base::operator=(__p);
- return *this;
- }
+ template <class _Up, class _Ep,
+ class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
+ class = _EnableIfDeleterAssignable<_Ep>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+ return *this;
+ }
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair(__compressed_pair&& __p)
- _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
- is_nothrow_move_constructible<_T2>::value)
- : base(_VSTD::move(__p)) {}
+#else // _LIBCPP_CXX03_LANG
+private:
+ unique_ptr(unique_ptr&);
+ template <class _Up, class _Ep> unique_ptr(unique_ptr<_Up, _Ep>&);
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair& operator=(__compressed_pair&& __p)
- _NOEXCEPT_(is_nothrow_move_assignable<_T1>::value &&
- is_nothrow_move_assignable<_T2>::value)
- {
- base::operator=(_VSTD::move(__p));
- return *this;
- }
+ unique_ptr& operator=(unique_ptr&);
+ template <class _Up, class _Ep> unique_ptr& operator=(unique_ptr<_Up, _Ep>&);
-#endif // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr() : __ptr_(pointer())
+ {
+ static_assert(!is_pointer<deleter_type>::value,
+ "unique_ptr constructed with null function pointer deleter");
+ static_assert(is_default_constructible<deleter_type>::value,
+ "unique_ptr::deleter_type is not default constructible");
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(nullptr_t) : __ptr_(pointer())
+ {
+ static_assert(!is_pointer<deleter_type>::value,
+ "unique_ptr constructed with null function pointer deleter");
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ explicit unique_ptr(pointer __p)
+ : __ptr_(_VSTD::move(__p)) {
+ static_assert(!is_pointer<deleter_type>::value,
+ "unique_ptr constructed with null function pointer deleter");
+ }
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+ _LIBCPP_INLINE_VISIBILITY
+ operator __rv<unique_ptr>() {
+ return __rv<unique_ptr>(*this);
+ }
- template <class... _Args1, class... _Args2>
- _LIBCPP_INLINE_VISIBILITY
- __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
- tuple<_Args2...> __second_args)
- : base(__pc, _VSTD::move(__first_args), _VSTD::move(__second_args),
- typename __make_tuple_indices<sizeof...(_Args1)>::type(),
- typename __make_tuple_indices<sizeof...(_Args2) >::type())
- {}
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(__rv<unique_ptr> __u)
+ : __ptr_(__u->release(),
+ _VSTD::forward<deleter_type>(__u->get_deleter())) {}
+
+ template <class _Up, class _Ep>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<
+ !is_array<_Up>::value &&
+ is_convertible<typename unique_ptr<_Up, _Ep>::pointer,
+ pointer>::value &&
+ is_assignable<deleter_type&, _Ep&>::value,
+ unique_ptr&>::type
+ operator=(unique_ptr<_Up, _Ep> __u) {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+ return *this;
+ }
-#endif // _LIBCPP_HAS_NO_VARIADICS
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(pointer __p, deleter_type __d)
+ : __ptr_(_VSTD::move(__p), _VSTD::move(__d)) {}
+#endif // _LIBCPP_CXX03_LANG
+
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<is_convertible<_Up*, _Tp*>::value &&
+ is_same<_Dp, default_delete<_Tp> >::value,
+ unique_ptr&>::type
+ operator=(auto_ptr<_Up> __p) {
+ reset(__p.release());
+ return *this;
+ }
+#endif
- _LIBCPP_INLINE_VISIBILITY _T1_reference first() _NOEXCEPT {return base::first();}
- _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return base::first();}
+ _LIBCPP_INLINE_VISIBILITY
+ ~unique_ptr() { reset(); }
- _LIBCPP_INLINE_VISIBILITY _T2_reference second() _NOEXCEPT {return base::second();}
- _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return base::second();}
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(nullptr_t) _NOEXCEPT {
+ reset();
+ return *this;
+ }
- _LIBCPP_INLINE_VISIBILITY void swap(__compressed_pair& __x)
- _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value)
- {base::swap(__x);}
-};
+ _LIBCPP_INLINE_VISIBILITY
+ typename add_lvalue_reference<_Tp>::type
+ operator*() const {
+ return *__ptr_.first();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ pointer operator->() const _NOEXCEPT {
+ return __ptr_.first();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ pointer get() const _NOEXCEPT {
+ return __ptr_.first();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ deleter_type& get_deleter() _NOEXCEPT {
+ return __ptr_.second();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ const deleter_type& get_deleter() const _NOEXCEPT {
+ return __ptr_.second();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {
+ return __ptr_.first() != nullptr;
+ }
-template <class _T1, class _T2>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
- _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
- __is_nothrow_swappable<_T2>::value)
- {__x.swap(__y);}
-
-// __same_or_less_cv_qualified
-
-template <class _Ptr1, class _Ptr2,
- bool = is_same<typename remove_cv<typename pointer_traits<_Ptr1>::element_type>::type,
- typename remove_cv<typename pointer_traits<_Ptr2>::element_type>::type
- >::value
- >
-struct __same_or_less_cv_qualified_imp
- : is_convertible<_Ptr1, _Ptr2> {};
-
-template <class _Ptr1, class _Ptr2>
-struct __same_or_less_cv_qualified_imp<_Ptr1, _Ptr2, false>
- : false_type {};
-
-template <class _Ptr1, class _Ptr2, bool = is_pointer<_Ptr1>::value ||
- is_same<_Ptr1, _Ptr2>::value ||
- __has_element_type<_Ptr1>::value>
-struct __same_or_less_cv_qualified
- : __same_or_less_cv_qualified_imp<_Ptr1, _Ptr2> {};
-
-template <class _Ptr1, class _Ptr2>
-struct __same_or_less_cv_qualified<_Ptr1, _Ptr2, false>
- : false_type {};
+ _LIBCPP_INLINE_VISIBILITY
+ pointer release() _NOEXCEPT {
+ pointer __t = __ptr_.first();
+ __ptr_.first() = pointer();
+ return __t;
+ }
-// default_delete
+ _LIBCPP_INLINE_VISIBILITY
+ void reset(pointer __p = pointer()) _NOEXCEPT {
+ pointer __tmp = __ptr_.first();
+ __ptr_.first() = __p;
+ if (__tmp)
+ __ptr_.second()(__tmp);
+ }
-template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY default_delete
-{
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
-#else
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
-#endif
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up>&,
- typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
- _LIBCPP_INLINE_VISIBILITY void operator() (_Tp* __ptr) const _NOEXCEPT
- {
- static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
- static_assert(!is_void<_Tp>::value, "default_delete can not delete incomplete type");
- delete __ptr;
- }
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(unique_ptr& __u) _NOEXCEPT {
+ __ptr_.swap(__u.__ptr_);
+ }
};
-template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY default_delete<_Tp[]>
-{
-public:
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
-#else
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
-#endif
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up[]>&,
- typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- void operator() (_Up* __ptr,
- typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) const _NOEXCEPT
- {
- static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
- static_assert(!is_void<_Tp>::value, "default_delete can not delete incomplete type");
- delete [] __ptr;
- }
-};
-template <class _Tp, class _Dp = default_delete<_Tp> >
-class _LIBCPP_TYPE_VIS_ONLY unique_ptr
-{
+template <class _Tp, class _Dp>
+class _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {
public:
- typedef _Tp element_type;
- typedef _Dp deleter_type;
- typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
-private:
- __compressed_pair<pointer, deleter_type> __ptr_;
-
-#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- unique_ptr(unique_ptr&);
- template <class _Up, class _Ep>
- unique_ptr(unique_ptr<_Up, _Ep>&);
- unique_ptr& operator=(unique_ptr&);
- template <class _Up, class _Ep>
- unique_ptr& operator=(unique_ptr<_Up, _Ep>&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ typedef _Tp element_type;
+ typedef _Dp deleter_type;
+ typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
- struct __nat {int __for_bool_;};
+private:
+ __compressed_pair<pointer, deleter_type> __ptr_;
+
+ template <class _From>
+ struct _CheckArrayPointerConversion : is_same<_From, pointer> {};
+
+ template <class _FromElem>
+ struct _CheckArrayPointerConversion<_FromElem*>
+ : integral_constant<bool,
+ is_same<_FromElem*, pointer>::value ||
+ (is_same<pointer, element_type*>::value &&
+ is_convertible<_FromElem(*)[], element_type(*)[]>::value)
+ >
+ {};
+
+#ifndef _LIBCPP_CXX03_LANG
+ typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
+
+ template <bool _Dummy>
+ using _LValRefType =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
+
+ template <bool _Dummy>
+ using _GoodRValRefType =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
+
+ template <bool _Dummy>
+ using _BadRValRefType =
+ typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
+
+ template <bool _Dummy, class _Deleter = typename __dependent_type<
+ __identity<deleter_type>, _Dummy>::type>
+ using _EnableIfDeleterDefaultConstructible =
+ typename enable_if<is_default_constructible<_Deleter>::value &&
+ !is_pointer<_Deleter>::value>::type;
+
+ template <class _ArgType>
+ using _EnableIfDeleterConstructible =
+ typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
+
+ template <class _Pp>
+ using _EnableIfPointerConvertible = typename enable_if<
+ _CheckArrayPointerConversion<_Pp>::value
+ >::type;
+
+ template <class _UPtr, class _Up,
+ class _ElemT = typename _UPtr::element_type>
+ using _EnableIfMoveConvertible = typename enable_if<
+ is_array<_Up>::value &&
+ is_same<pointer, element_type*>::value &&
+ is_same<typename _UPtr::pointer, _ElemT*>::value &&
+ is_convertible<_ElemT(*)[], element_type(*)[]>::value
+ >::type;
+
+ template <class _UDel>
+ using _EnableIfDeleterConvertible = typename enable_if<
+ (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
+ (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
+ >::type;
+
+ template <class _UDel>
+ using _EnableIfDeleterAssignable = typename enable_if<
+ is_assignable<_Dp&, _UDel&&>::value
+ >::type;
- typedef typename remove_reference<deleter_type>::type& _Dp_reference;
- typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT
- : __ptr_(pointer())
- {
- static_assert(!is_pointer<deleter_type>::value,
- "unique_ptr constructed with null function pointer deleter");
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
- : __ptr_(pointer())
- {
- static_assert(!is_pointer<deleter_type>::value,
- "unique_ptr constructed with null function pointer deleter");
- }
- _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(pointer __p) _NOEXCEPT
- : __ptr_(_VSTD::move(__p))
- {
- static_assert(!is_pointer<deleter_type>::value,
- "unique_ptr constructed with null function pointer deleter");
- }
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename conditional<
- is_reference<deleter_type>::value,
- deleter_type,
- typename add_lvalue_reference<const deleter_type>::type>::type __d)
- _NOEXCEPT
- : __ptr_(__p, __d) {}
-
- _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename remove_reference<deleter_type>::type&& __d)
- _NOEXCEPT
- : __ptr_(__p, _VSTD::move(__d))
- {
- static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
- }
- _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
- : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
- template <class _Up, class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(unique_ptr<_Up, _Ep>&& __u,
- typename enable_if
- <
- !is_array<_Up>::value &&
- is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
- is_convertible<_Ep, deleter_type>::value &&
- (
- !is_reference<deleter_type>::value ||
- is_same<deleter_type, _Ep>::value
- ),
- __nat
- >::type = __nat()) _NOEXCEPT
- : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
-
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY unique_ptr(auto_ptr<_Up>&& __p,
- typename enable_if<
- is_convertible<_Up*, _Tp*>::value &&
- is_same<_Dp, default_delete<_Tp> >::value,
- __nat
- >::type = __nat()) _NOEXCEPT
- : __ptr_(__p.release())
- {
- }
-
- _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
- {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
- return *this;
- }
-
- template <class _Up, class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- !is_array<_Up>::value &&
- is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
- is_assignable<deleter_type&, _Ep&&>::value,
- unique_ptr&
- >::type
- operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
- {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
- return *this;
- }
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- _LIBCPP_INLINE_VISIBILITY operator __rv<unique_ptr>()
- {
- return __rv<unique_ptr>(*this);
- }
-
- _LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
- : __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
-
- template <class _Up, class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if<
- !is_array<_Up>::value &&
- is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
- is_assignable<deleter_type&, _Ep&>::value,
- unique_ptr&
- >::type
- operator=(unique_ptr<_Up, _Ep> __u)
- {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
- return *this;
- }
-
- _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d)
- : __ptr_(_VSTD::move(__p), _VSTD::move(__d)) {}
-
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if<
- is_convertible<_Up*, _Tp*>::value &&
- is_same<_Dp, default_delete<_Tp> >::value,
- unique_ptr&
- >::type
- operator=(auto_ptr<_Up> __p)
- {reset(__p.release()); return *this;}
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy>>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr unique_ptr() noexcept : __ptr_(pointer()) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy>>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr unique_ptr(nullptr_t) noexcept : __ptr_(pointer()) {}
+
+ template <class _Pp, bool _Dummy = true,
+ class = _EnableIfDeleterDefaultConstructible<_Dummy>,
+ class = _EnableIfPointerConvertible<_Pp>>
+ _LIBCPP_INLINE_VISIBILITY
+ explicit unique_ptr(_Pp __p) noexcept
+ : __ptr_(__p) {}
+
+ template <class _Pp, bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>,
+ class = _EnableIfPointerConvertible<_Pp>>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) noexcept
+ : __ptr_(__p, __d) {}
+
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) noexcept
+ : __ptr_(nullptr, __d) {}
+
+ template <class _Pp, bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>,
+ class = _EnableIfPointerConvertible<_Pp>>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) noexcept
+ : __ptr_(__p, _VSTD::move(__d)) {
+ static_assert(!is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference");
+ }
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}
+ template <bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) noexcept
+ : __ptr_(nullptr, _VSTD::move(__d)) {
+ static_assert(!is_reference<deleter_type>::value,
+ "rvalue deleter bound to reference");
+ }
- _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(nullptr_t) _NOEXCEPT
- {
- reset();
- return *this;
- }
+ template <class _Pp, bool _Dummy = true,
+ class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy>>,
+ class = _EnableIfPointerConvertible<_Pp>>
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete;
- _LIBCPP_INLINE_VISIBILITY typename add_lvalue_reference<_Tp>::type operator*() const
- {return *__ptr_.first();}
- _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT {return __ptr_.first();}
- _LIBCPP_INLINE_VISIBILITY pointer get() const _NOEXCEPT {return __ptr_.first();}
- _LIBCPP_INLINE_VISIBILITY _Dp_reference get_deleter() _NOEXCEPT
- {return __ptr_.second();}
- _LIBCPP_INLINE_VISIBILITY _Dp_const_reference get_deleter() const _NOEXCEPT
- {return __ptr_.second();}
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
- {return __ptr_.first() != nullptr;}
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(unique_ptr&& __u) noexcept
+ : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
+ }
- _LIBCPP_INLINE_VISIBILITY pointer release() _NOEXCEPT
- {
- pointer __t = __ptr_.first();
- __ptr_.first() = pointer();
- return __t;
- }
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(unique_ptr&& __u) noexcept {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+ return *this;
+ }
- _LIBCPP_INLINE_VISIBILITY void reset(pointer __p = pointer()) _NOEXCEPT
- {
- pointer __tmp = __ptr_.first();
- __ptr_.first() = __p;
- if (__tmp)
- __ptr_.second()(__tmp);
- }
+ template <class _Up, class _Ep,
+ class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
+ class = _EnableIfDeleterConvertible<_Ep>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
+ : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {
+ }
- _LIBCPP_INLINE_VISIBILITY void swap(unique_ptr& __u) _NOEXCEPT
- {__ptr_.swap(__u.__ptr_);}
-};
+ template <class _Up, class _Ep,
+ class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
+ class = _EnableIfDeleterAssignable<_Ep>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr&
+ operator=(unique_ptr<_Up, _Ep>&& __u) noexcept {
+ reset(__u.release());
+ __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+ return *this;
+ }
-template <class _Tp, class _Dp>
-class _LIBCPP_TYPE_VIS_ONLY unique_ptr<_Tp[], _Dp>
-{
-public:
- typedef _Tp element_type;
- typedef _Dp deleter_type;
- typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
+#else // _LIBCPP_CXX03_LANG
private:
- __compressed_pair<pointer, deleter_type> __ptr_;
+ template <class _Up> explicit unique_ptr(_Up);
-#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- unique_ptr(unique_ptr&);
- template <class _Up>
- unique_ptr(unique_ptr<_Up>&);
- unique_ptr& operator=(unique_ptr&);
- template <class _Up>
- unique_ptr& operator=(unique_ptr<_Up>&);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ unique_ptr(unique_ptr&);
+ template <class _Up> unique_ptr(unique_ptr<_Up>&);
- struct __nat {int __for_bool_;};
+ unique_ptr& operator=(unique_ptr&);
+ template <class _Up> unique_ptr& operator=(unique_ptr<_Up>&);
- typedef typename remove_reference<deleter_type>::type& _Dp_reference;
- typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
+ template <class _Up>
+ unique_ptr(_Up __u,
+ typename conditional<
+ is_reference<deleter_type>::value, deleter_type,
+ typename add_lvalue_reference<const deleter_type>::type>::type,
+ typename enable_if<is_convertible<_Up, pointer>::value,
+ __nat>::type = __nat());
public:
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT
- : __ptr_(pointer())
- {
- static_assert(!is_pointer<deleter_type>::value,
- "unique_ptr constructed with null function pointer deleter");
- }
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
- : __ptr_(pointer())
- {
- static_assert(!is_pointer<deleter_type>::value,
- "unique_ptr constructed with null function pointer deleter");
- }
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_Pp __p,
- typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value, __nat>::type = __nat()) _NOEXCEPT
- : __ptr_(__p)
- {
- static_assert(!is_pointer<deleter_type>::value,
- "unique_ptr constructed with null function pointer deleter");
- }
-
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY unique_ptr(_Pp __p, typename conditional<
- is_reference<deleter_type>::value,
- deleter_type,
- typename add_lvalue_reference<const deleter_type>::type>::type __d,
- typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value, __nat>::type = __nat())
- _NOEXCEPT
- : __ptr_(__p, __d) {}
-
- _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, typename conditional<
- is_reference<deleter_type>::value,
- deleter_type,
- typename add_lvalue_reference<const deleter_type>::type>::type __d)
- _NOEXCEPT
- : __ptr_(pointer(), __d) {}
-
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY unique_ptr(_Pp __p,
- typename remove_reference<deleter_type>::type&& __d,
- typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value, __nat>::type = __nat())
- _NOEXCEPT
- : __ptr_(__p, _VSTD::move(__d))
- {
- static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
- }
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr() : __ptr_(pointer()) {
+ static_assert(!is_pointer<deleter_type>::value,
+ "unique_ptr constructed with null function pointer deleter");
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(nullptr_t) : __ptr_(pointer()) {
+ static_assert(!is_pointer<deleter_type>::value,
+ "unique_ptr constructed with null function pointer deleter");
+ }
- _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, typename remove_reference<deleter_type>::type&& __d)
- _NOEXCEPT
- : __ptr_(pointer(), _VSTD::move(__d))
- {
- static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
- }
+ _LIBCPP_INLINE_VISIBILITY
+ explicit unique_ptr(pointer __p) : __ptr_(__p) {
+ static_assert(!is_pointer<deleter_type>::value,
+ "unique_ptr constructed with null function pointer deleter");
+ }
- _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
- : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(pointer __p, deleter_type __d)
+ : __ptr_(__p, _VSTD::forward<deleter_type>(__d)) {}
- _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
- {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
- return *this;
- }
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(nullptr_t, deleter_type __d)
+ : __ptr_(pointer(), _VSTD::forward<deleter_type>(__d)) {}
- template <class _Up, class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- unique_ptr(unique_ptr<_Up, _Ep>&& __u,
- typename enable_if
- <
- is_array<_Up>::value &&
- __same_or_less_cv_qualified<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value
- && is_convertible<_Ep, deleter_type>::value &&
- (
- !is_reference<deleter_type>::value ||
- is_same<deleter_type, _Ep>::value
- ),
- __nat
- >::type = __nat()
- ) _NOEXCEPT
- : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
-
-
- template <class _Up, class _Ep>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if
- <
- is_array<_Up>::value &&
- __same_or_less_cv_qualified<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
- is_assignable<deleter_type&, _Ep&&>::value,
- unique_ptr&
- >::type
- operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
- {
- reset(__u.release());
- __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
- return *this;
- }
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ operator __rv<unique_ptr>() {
+ return __rv<unique_ptr>(*this);
+ }
- _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(pointer __p)
- : __ptr_(__p)
- {
- static_assert(!is_pointer<deleter_type>::value,
- "unique_ptr constructed with null function pointer deleter");
- }
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr(__rv<unique_ptr> __u)
+ : __ptr_(__u->release(),
+ _VSTD::forward<deleter_type>(__u->get_deleter())) {}
- _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d)
- : __ptr_(__p, _VSTD::forward<deleter_type>(__d)) {}
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(__rv<unique_ptr> __u) {
+ reset(__u->release());
+ __ptr_.second() = _VSTD::forward<deleter_type>(__u->get_deleter());
+ return *this;
+ }
- _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, deleter_type __d)
- : __ptr_(pointer(), _VSTD::forward<deleter_type>(__d)) {}
+#endif // _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY operator __rv<unique_ptr>()
- {
- return __rv<unique_ptr>(*this);
- }
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ ~unique_ptr() { reset(); }
- _LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
- : __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
+ _LIBCPP_INLINE_VISIBILITY
+ unique_ptr& operator=(nullptr_t) _NOEXCEPT {
+ reset();
+ return *this;
+ }
- _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(__rv<unique_ptr> __u)
- {
- reset(__u->release());
- __ptr_.second() = _VSTD::forward<deleter_type>(__u->get_deleter());
- return *this;
- }
+ _LIBCPP_INLINE_VISIBILITY
+ typename add_lvalue_reference<_Tp>::type
+ operator[](size_t __i) const {
+ return __ptr_.first()[__i];
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ pointer get() const _NOEXCEPT {
+ return __ptr_.first();
+ }
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}
+ _LIBCPP_INLINE_VISIBILITY
+ deleter_type& get_deleter() _NOEXCEPT {
+ return __ptr_.second();
+ }
- _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(nullptr_t) _NOEXCEPT
- {
- reset();
- return *this;
- }
+ _LIBCPP_INLINE_VISIBILITY
+ const deleter_type& get_deleter() const _NOEXCEPT {
+ return __ptr_.second();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {
+ return __ptr_.first() != nullptr;
+ }
- _LIBCPP_INLINE_VISIBILITY typename add_lvalue_reference<_Tp>::type operator[](size_t __i) const
- {return __ptr_.first()[__i];}
- _LIBCPP_INLINE_VISIBILITY pointer get() const _NOEXCEPT {return __ptr_.first();}
- _LIBCPP_INLINE_VISIBILITY _Dp_reference get_deleter() _NOEXCEPT
- {return __ptr_.second();}
- _LIBCPP_INLINE_VISIBILITY _Dp_const_reference get_deleter() const _NOEXCEPT
- {return __ptr_.second();}
- _LIBCPP_INLINE_VISIBILITY
- _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
- {return __ptr_.first() != nullptr;}
+ _LIBCPP_INLINE_VISIBILITY
+ pointer release() _NOEXCEPT {
+ pointer __t = __ptr_.first();
+ __ptr_.first() = pointer();
+ return __t;
+ }
- _LIBCPP_INLINE_VISIBILITY pointer release() _NOEXCEPT
- {
- pointer __t = __ptr_.first();
- __ptr_.first() = pointer();
- return __t;
- }
+ template <class _Pp>
+ _LIBCPP_INLINE_VISIBILITY
+ typename enable_if<
+ _CheckArrayPointerConversion<_Pp>::value
+ >::type
+ reset(_Pp __p) _NOEXCEPT {
+ pointer __tmp = __ptr_.first();
+ __ptr_.first() = __p;
+ if (__tmp)
+ __ptr_.second()(__tmp);
+ }
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value, void>::type
- reset(_Pp __p) _NOEXCEPT
- {
- pointer __tmp = __ptr_.first();
- __ptr_.first() = __p;
- if (__tmp)
- __ptr_.second()(__tmp);
- }
- _LIBCPP_INLINE_VISIBILITY void reset(nullptr_t) _NOEXCEPT
- {
- pointer __tmp = __ptr_.first();
- __ptr_.first() = nullptr;
- if (__tmp)
- __ptr_.second()(__tmp);
- }
- _LIBCPP_INLINE_VISIBILITY void reset() _NOEXCEPT
- {
- pointer __tmp = __ptr_.first();
- __ptr_.first() = nullptr;
- if (__tmp)
- __ptr_.second()(__tmp);
- }
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY void reset(pointer __p = pointer())
- {
- pointer __tmp = __ptr_.first();
- __ptr_.first() = __p;
- if (__tmp)
- __ptr_.second()(__tmp);
- }
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ void reset(nullptr_t = nullptr) _NOEXCEPT {
+ pointer __tmp = __ptr_.first();
+ __ptr_.first() = nullptr;
+ if (__tmp)
+ __ptr_.second()(__tmp);
+ }
- _LIBCPP_INLINE_VISIBILITY void swap(unique_ptr& __u) {__ptr_.swap(__u.__ptr_);}
-private:
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(unique_ptr& __u) _NOEXCEPT {
+ __ptr_.swap(__u.__ptr_);
+ }
-#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _Up>
- explicit unique_ptr(_Up);
- template <class _Up>
- unique_ptr(_Up __u,
- typename conditional<
- is_reference<deleter_type>::value,
- deleter_type,
- typename add_lvalue_reference<const deleter_type>::type>::type,
- typename enable_if
- <
- is_convertible<_Up, pointer>::value,
- __nat
- >::type = __nat());
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
};
template <class _Tp, class _Dp>
inline _LIBCPP_INLINE_VISIBILITY
-void
+typename enable_if<
+ __is_swappable<_Dp>::value,
+ void
+>::type
swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) _NOEXCEPT {__x.swap(__y);}
template <class _T1, class _D1, class _T2, class _D2>
@@ -3167,355 +3080,18 @@ template<class _Tp, class... _Args>
#endif // _LIBCPP_STD_VER > 11
-template <class _Tp> struct hash;
-
-template <class _Size>
-inline _LIBCPP_INLINE_VISIBILITY
-_Size
-__loadword(const void* __p)
-{
- _Size __r;
- std::memcpy(&__r, __p, sizeof(__r));
- return __r;
-}
-
-// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
-// is 64 bits. This is because cityhash64 uses 64bit x 64bit
-// multiplication, which can be very slow on 32-bit systems.
-template <class _Size, size_t = sizeof(_Size)*__CHAR_BIT__>
-struct __murmur2_or_cityhash;
-
-template <class _Size>
-struct __murmur2_or_cityhash<_Size, 32>
-{
- _Size operator()(const void* __key, _Size __len);
-};
-
-// murmur2
-template <class _Size>
-_Size
-__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
-{
- const _Size __m = 0x5bd1e995;
- const _Size __r = 24;
- _Size __h = __len;
- const unsigned char* __data = static_cast<const unsigned char*>(__key);
- for (; __len >= 4; __data += 4, __len -= 4)
- {
- _Size __k = __loadword<_Size>(__data);
- __k *= __m;
- __k ^= __k >> __r;
- __k *= __m;
- __h *= __m;
- __h ^= __k;
- }
- switch (__len)
- {
- case 3:
- __h ^= __data[2] << 16;
- case 2:
- __h ^= __data[1] << 8;
- case 1:
- __h ^= __data[0];
- __h *= __m;
- }
- __h ^= __h >> 13;
- __h *= __m;
- __h ^= __h >> 15;
- return __h;
-}
-
-template <class _Size>
-struct __murmur2_or_cityhash<_Size, 64>
-{
- _Size operator()(const void* __key, _Size __len);
-
- private:
- // Some primes between 2^63 and 2^64.
- static const _Size __k0 = 0xc3a5c85c97cb3127ULL;
- static const _Size __k1 = 0xb492b66fbe98f273ULL;
- static const _Size __k2 = 0x9ae16a3b2f90404fULL;
- static const _Size __k3 = 0xc949d7c7509e6557ULL;
-
- static _Size __rotate(_Size __val, int __shift) {
- return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift)));
- }
-
- static _Size __rotate_by_at_least_1(_Size __val, int __shift) {
- return (__val >> __shift) | (__val << (64 - __shift));
- }
-
- static _Size __shift_mix(_Size __val) {
- return __val ^ (__val >> 47);
- }
-
- static _Size __hash_len_16(_Size __u, _Size __v) {
- const _Size __mul = 0x9ddfea08eb382d69ULL;
- _Size __a = (__u ^ __v) * __mul;
- __a ^= (__a >> 47);
- _Size __b = (__v ^ __a) * __mul;
- __b ^= (__b >> 47);
- __b *= __mul;
- return __b;
- }
-
- static _Size __hash_len_0_to_16(const char* __s, _Size __len) {
- if (__len > 8) {
- const _Size __a = __loadword<_Size>(__s);
- const _Size __b = __loadword<_Size>(__s + __len - 8);
- return __hash_len_16(__a, __rotate_by_at_least_1(__b + __len, __len)) ^ __b;
- }
- if (__len >= 4) {
- const uint32_t __a = __loadword<uint32_t>(__s);
- const uint32_t __b = __loadword<uint32_t>(__s + __len - 4);
- return __hash_len_16(__len + (__a << 3), __b);
- }
- if (__len > 0) {
- const unsigned char __a = __s[0];
- const unsigned char __b = __s[__len >> 1];
- const unsigned char __c = __s[__len - 1];
- const uint32_t __y = static_cast<uint32_t>(__a) +
- (static_cast<uint32_t>(__b) << 8);
- const uint32_t __z = __len + (static_cast<uint32_t>(__c) << 2);
- return __shift_mix(__y * __k2 ^ __z * __k3) * __k2;
- }
- return __k2;
- }
-
- static _Size __hash_len_17_to_32(const char *__s, _Size __len) {
- const _Size __a = __loadword<_Size>(__s) * __k1;
- const _Size __b = __loadword<_Size>(__s + 8);
- const _Size __c = __loadword<_Size>(__s + __len - 8) * __k2;
- const _Size __d = __loadword<_Size>(__s + __len - 16) * __k0;
- return __hash_len_16(__rotate(__a - __b, 43) + __rotate(__c, 30) + __d,
- __a + __rotate(__b ^ __k3, 20) - __c + __len);
- }
-
- // Return a 16-byte hash for 48 bytes. Quick and dirty.
- // Callers do best to use "random-looking" values for a and b.
- static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
- _Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b) {
- __a += __w;
- __b = __rotate(__b + __a + __z, 21);
- const _Size __c = __a;
- __a += __x;
- __a += __y;
- __b += __rotate(__a, 44);
- return pair<_Size, _Size>(__a + __z, __b + __c);
- }
-
- // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.
- static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
- const char* __s, _Size __a, _Size __b) {
- return __weak_hash_len_32_with_seeds(__loadword<_Size>(__s),
- __loadword<_Size>(__s + 8),
- __loadword<_Size>(__s + 16),
- __loadword<_Size>(__s + 24),
- __a,
- __b);
- }
-
- // Return an 8-byte hash for 33 to 64 bytes.
- static _Size __hash_len_33_to_64(const char *__s, size_t __len) {
- _Size __z = __loadword<_Size>(__s + 24);
- _Size __a = __loadword<_Size>(__s) +
- (__len + __loadword<_Size>(__s + __len - 16)) * __k0;
- _Size __b = __rotate(__a + __z, 52);
- _Size __c = __rotate(__a, 37);
- __a += __loadword<_Size>(__s + 8);
- __c += __rotate(__a, 7);
- __a += __loadword<_Size>(__s + 16);
- _Size __vf = __a + __z;
- _Size __vs = __b + __rotate(__a, 31) + __c;
- __a = __loadword<_Size>(__s + 16) + __loadword<_Size>(__s + __len - 32);
- __z += __loadword<_Size>(__s + __len - 8);
- __b = __rotate(__a + __z, 52);
- __c = __rotate(__a, 37);
- __a += __loadword<_Size>(__s + __len - 24);
- __c += __rotate(__a, 7);
- __a += __loadword<_Size>(__s + __len - 16);
- _Size __wf = __a + __z;
- _Size __ws = __b + __rotate(__a, 31) + __c;
- _Size __r = __shift_mix((__vf + __ws) * __k2 + (__wf + __vs) * __k0);
- return __shift_mix(__r * __k0 + __vs) * __k2;
- }
-};
-
-// cityhash64
-template <class _Size>
-_Size
-__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
-{
- const char* __s = static_cast<const char*>(__key);
- if (__len <= 32) {
- if (__len <= 16) {
- return __hash_len_0_to_16(__s, __len);
- } else {
- return __hash_len_17_to_32(__s, __len);
- }
- } else if (__len <= 64) {
- return __hash_len_33_to_64(__s, __len);
- }
-
- // For strings over 64 bytes we hash the end first, and then as we
- // loop we keep 56 bytes of state: v, w, x, y, and z.
- _Size __x = __loadword<_Size>(__s + __len - 40);
- _Size __y = __loadword<_Size>(__s + __len - 16) +
- __loadword<_Size>(__s + __len - 56);
- _Size __z = __hash_len_16(__loadword<_Size>(__s + __len - 48) + __len,
- __loadword<_Size>(__s + __len - 24));
- pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
- pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
- __x = __x * __k1 + __loadword<_Size>(__s);
-
- // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
- __len = (__len - 1) & ~static_cast<_Size>(63);
- do {
- __x = __rotate(__x + __y + __v.first + __loadword<_Size>(__s + 8), 37) * __k1;
- __y = __rotate(__y + __v.second + __loadword<_Size>(__s + 48), 42) * __k1;
- __x ^= __w.second;
- __y += __v.first + __loadword<_Size>(__s + 40);
- __z = __rotate(__z + __w.first, 33) * __k1;
- __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
- __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
- __y + __loadword<_Size>(__s + 16));
- std::swap(__z, __x);
- __s += 64;
- __len -= 64;
- } while (__len != 0);
- return __hash_len_16(
- __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
- __hash_len_16(__v.second, __w.second) + __x);
-}
-
-template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)>
-struct __scalar_hash;
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 0>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- size_t __a;
- } __u;
- __u.__a = 0;
- __u.__t = __v;
- return __u.__a;
- }
-};
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 1>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- size_t __a;
- } __u;
- __u.__t = __v;
- return __u.__a;
- }
-};
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 2>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- struct
- {
- size_t __a;
- size_t __b;
- } __s;
- } __u;
- __u.__t = __v;
- return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
- }
-};
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 3>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- struct
- {
- size_t __a;
- size_t __b;
- size_t __c;
- } __s;
- } __u;
- __u.__t = __v;
- return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
- }
-};
-
-template <class _Tp>
-struct __scalar_hash<_Tp, 4>
- : public unary_function<_Tp, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp __v) const _NOEXCEPT
- {
- union
- {
- _Tp __t;
- struct
- {
- size_t __a;
- size_t __b;
- size_t __c;
- size_t __d;
- } __s;
- } __u;
- __u.__t = __v;
- return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
- }
-};
-
-template<class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY hash<_Tp*>
- : public unary_function<_Tp*, size_t>
-{
- _LIBCPP_INLINE_VISIBILITY
- size_t operator()(_Tp* __v) const _NOEXCEPT
- {
- union
- {
- _Tp* __t;
- size_t __a;
- } __u;
- __u.__t = __v;
- return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
- }
-};
-
template <class _Tp, class _Dp>
-struct _LIBCPP_TYPE_VIS_ONLY hash<unique_ptr<_Tp, _Dp> >
+#ifdef _LIBCPP_CXX03_LANG
+struct _LIBCPP_TEMPLATE_VIS hash<unique_ptr<_Tp, _Dp> >
+#else
+struct _LIBCPP_TEMPLATE_VIS hash<__enable_hash_helper<
+ unique_ptr<_Tp, _Dp>, typename unique_ptr<_Tp, _Dp>::pointer>>
+#endif
{
typedef unique_ptr<_Tp, _Dp> argument_type;
typedef size_t result_type;
_LIBCPP_INLINE_VISIBILITY
- result_type operator()(const argument_type& __ptr) const _NOEXCEPT
+ result_type operator()(const argument_type& __ptr) const
{
typedef typename argument_type::pointer pointer;
return hash<pointer>()(__ptr.get());
@@ -3675,6 +3251,181 @@ uninitialized_fill_n(_ForwardIterator __f, _Size __n, const _Tp& __x)
return __f;
}
+#if _LIBCPP_STD_VER > 14
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+void destroy_at(_Tp* __loc) {
+ _LIBCPP_ASSERT(__loc, "null pointer given to destroy_at");
+ __loc->~_Tp();
+}
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void destroy(_ForwardIterator __first, _ForwardIterator __last) {
+ for (; __first != __last; ++__first)
+ _VSTD::destroy_at(_VSTD::addressof(*__first));
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator destroy_n(_ForwardIterator __first, _Size __n) {
+ for (; __n > 0; (void)++__first, --__n)
+ _VSTD::destroy_at(_VSTD::addressof(*__first));
+ return __first;
+}
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void uninitialized_default_construct(_ForwardIterator __first, _ForwardIterator __last) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __idx != __last; ++__idx)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator uninitialized_default_construct_n(_ForwardIterator __first, _Size __n) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; (void)++__idx, --__n)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt;
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+
+template <class _ForwardIterator>
+inline _LIBCPP_INLINE_VISIBILITY
+void uninitialized_value_construct(_ForwardIterator __first, _ForwardIterator __last) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __idx != __last; ++__idx)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt();
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _ForwardIterator, class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator uninitialized_value_construct_n(_ForwardIterator __first, _Size __n) {
+ using _Vt = typename iterator_traits<_ForwardIterator>::value_type;
+ auto __idx = __first;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; (void)++__idx, --__n)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt();
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first, __idx);
+ throw;
+ }
+#endif
+}
+
+
+template <class _InputIt, class _ForwardIt>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIt uninitialized_move(_InputIt __first, _InputIt __last, _ForwardIt __first_res) {
+ using _Vt = typename iterator_traits<_ForwardIt>::value_type;
+ auto __idx = __first_res;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __first != __last; (void)++__idx, ++__first)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt(std::move(*__first));
+ return __idx;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first_res, __idx);
+ throw;
+ }
+#endif
+}
+
+template <class _InputIt, class _Size, class _ForwardIt>
+inline _LIBCPP_INLINE_VISIBILITY
+pair<_InputIt, _ForwardIt>
+uninitialized_move_n(_InputIt __first, _Size __n, _ForwardIt __first_res) {
+ using _Vt = typename iterator_traits<_ForwardIt>::value_type;
+ auto __idx = __first_res;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try {
+#endif
+ for (; __n > 0; ++__idx, (void)++__first, --__n)
+ ::new((void*)_VSTD::addressof(*__idx)) _Vt(std::move(*__first));
+ return {__first, __idx};
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ } catch (...) {
+ _VSTD::destroy(__first_res, __idx);
+ throw;
+ }
+#endif
+}
+
+
+#endif // _LIBCPP_STD_VER > 14
+
+// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)
+// should be sufficient for thread safety.
+// See https://bugs.llvm.org/show_bug.cgi?id=22803
+#if defined(__clang__) && __has_builtin(__atomic_add_fetch) \
+ && defined(__ATOMIC_RELAXED) \
+ && defined(__ATOMIC_ACQ_REL)
+# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT
+#elif !defined(__clang__) && defined(_GNUC_VER) && _GNUC_VER >= 407
+# define _LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT
+#endif
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _Tp
+__libcpp_atomic_refcount_increment(_Tp& __t) _NOEXCEPT
+{
+#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
+ return __atomic_add_fetch(&__t, 1, __ATOMIC_RELAXED);
+#else
+ return __t += 1;
+#endif
+}
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY _Tp
+__libcpp_atomic_refcount_decrement(_Tp& __t) _NOEXCEPT
+{
+#if defined(_LIBCPP_HAS_BUILTIN_ATOMIC_SUPPORT) && !defined(_LIBCPP_HAS_NO_THREADS)
+ return __atomic_add_fetch(&__t, -1, __ATOMIC_ACQ_REL);
+#else
+ return __t -= 1;
+#endif
+}
+
class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
: public std::exception
{
@@ -3683,7 +3434,17 @@ public:
virtual const char* what() const _NOEXCEPT;
};
-template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY weak_ptr;
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_weak_ptr()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_weak_ptr();
+#else
+ _VSTD::abort();
+#endif
+}
+
+template<class _Tp> class _LIBCPP_TEMPLATE_VIS weak_ptr;
class _LIBCPP_TYPE_VIS __shared_count
{
@@ -3701,8 +3462,24 @@ public:
explicit __shared_count(long __refs = 0) _NOEXCEPT
: __shared_owners_(__refs) {}
+#if defined(_LIBCPP_BUILDING_MEMORY) && \
+ defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
void __add_shared() _NOEXCEPT;
bool __release_shared() _NOEXCEPT;
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ void __add_shared() _NOEXCEPT {
+ __libcpp_atomic_refcount_increment(__shared_owners_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ bool __release_shared() _NOEXCEPT {
+ if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1) {
+ __on_zero_shared();
+ return true;
+ }
+ return false;
+ }
+#endif
_LIBCPP_INLINE_VISIBILITY
long use_count() const _NOEXCEPT {
return __libcpp_relaxed_load(&__shared_owners_) + 1;
@@ -3723,9 +3500,26 @@ protected:
virtual ~__shared_weak_count();
public:
+#if defined(_LIBCPP_BUILDING_MEMORY) && \
+ defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
void __add_shared() _NOEXCEPT;
void __add_weak() _NOEXCEPT;
void __release_shared() _NOEXCEPT;
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ void __add_shared() _NOEXCEPT {
+ __shared_count::__add_shared();
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void __add_weak() _NOEXCEPT {
+ __libcpp_atomic_refcount_increment(__shared_weak_owners_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ void __release_shared() _NOEXCEPT {
+ if (__shared_count::__release_shared())
+ __release_weak();
+ }
+#endif
void __release_weak() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
long use_count() const _NOEXCEPT {return __shared_count::use_count();}
@@ -3767,7 +3561,7 @@ template <class _Tp, class _Dp, class _Alloc>
const void*
__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT
{
- return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : 0;
+ return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr;
}
#endif // _LIBCPP_NO_RTTI
@@ -3861,13 +3655,29 @@ __shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
__a.deallocate(_PTraits::pointer_to(*this), 1);
}
-template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY enable_shared_from_this;
+struct __shared_ptr_dummy_rebind_allocator_type;
+template <>
+class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
+{
+public:
+ template <class _Other>
+ struct rebind
+ {
+ typedef allocator<_Other> other;
+ };
+};
+
+template<class _Tp> class _LIBCPP_TEMPLATE_VIS enable_shared_from_this;
template<class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY shared_ptr
+class _LIBCPP_TEMPLATE_VIS shared_ptr
{
public:
typedef _Tp element_type;
+
+#if _LIBCPP_STD_VER > 14
+ typedef weak_ptr<_Tp> weak_type;
+#endif
private:
element_type* __ptr_;
__shared_weak_count* __cntrl_;
@@ -3895,17 +3705,18 @@ public:
template<class _Yp>
_LIBCPP_INLINE_VISIBILITY
shared_ptr(const shared_ptr<_Yp>& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat())
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat())
_NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
shared_ptr(shared_ptr&& __r) _NOEXCEPT;
template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(shared_ptr<_Yp>&& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat())
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat())
_NOEXCEPT;
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type= __nat());
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type= __nat());
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template<class _Yp>
shared_ptr(auto_ptr<_Yp>&& __r,
@@ -3915,6 +3726,7 @@ public:
shared_ptr(auto_ptr<_Yp> __r,
typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type = __nat());
#endif
+#endif
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Yp, class _Dp>
shared_ptr(unique_ptr<_Yp, _Dp>&&,
@@ -3978,26 +3790,30 @@ public:
>::type
_LIBCPP_INLINE_VISIBILITY
operator=(shared_ptr<_Yp>&& __r);
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template<class _Yp>
+ _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
!is_array<_Yp>::value &&
is_convertible<_Yp*, element_type*>::value,
shared_ptr
>::type&
- _LIBCPP_INLINE_VISIBILITY
operator=(auto_ptr<_Yp>&& __r);
+#endif
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template<class _Yp>
+ _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
!is_array<_Yp>::value &&
is_convertible<_Yp*, element_type*>::value,
shared_ptr&
>::type
- _LIBCPP_INLINE_VISIBILITY
operator=(auto_ptr<_Yp> __r);
#endif
+#endif
template <class _Yp, class _Dp>
typename enable_if
<
@@ -4057,11 +3873,11 @@ public:
_LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return get() != 0;}
template <class _Up>
_LIBCPP_INLINE_VISIBILITY
- bool owner_before(shared_ptr<_Up> const& __p) const
+ bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT
{return __cntrl_ < __p.__cntrl_;}
template <class _Up>
_LIBCPP_INLINE_VISIBILITY
- bool owner_before(weak_ptr<_Up> const& __p) const
+ bool owner_before(weak_ptr<_Up> const& __p) const _NOEXCEPT
{return __cntrl_ < __p.__cntrl_;}
_LIBCPP_INLINE_VISIBILITY
bool
@@ -4119,27 +3935,42 @@ public:
#endif // _LIBCPP_HAS_NO_VARIADICS
private:
+ template <class _Yp, bool = is_function<_Yp>::value>
+ struct __shared_ptr_default_allocator
+ {
+ typedef allocator<_Yp> type;
+ };
template <class _Yp>
+ struct __shared_ptr_default_allocator<_Yp, true>
+ {
+ typedef allocator<__shared_ptr_dummy_rebind_allocator_type> type;
+ };
+
+ template <class _Yp, class _OrigPtr>
_LIBCPP_INLINE_VISIBILITY
- void
- __enable_weak_this(const enable_shared_from_this<_Yp>* __e) _NOEXCEPT
+ typename enable_if<is_convertible<_OrigPtr*,
+ const enable_shared_from_this<_Yp>*
+ >::value,
+ void>::type
+ __enable_weak_this(const enable_shared_from_this<_Yp>* __e,
+ _OrigPtr* __ptr) _NOEXCEPT
{
- if (__e)
+ typedef typename remove_cv<_Yp>::type _RawYp;
+ if (__e && __e->__weak_this_.expired())
{
- __e->__weak_this_.__ptr_ = const_cast<_Yp*>(static_cast<const _Yp*>(__e));
- __e->__weak_this_.__cntrl_ = __cntrl_;
- __cntrl_->__add_weak();
+ __e->__weak_this_ = shared_ptr<_RawYp>(*this,
+ const_cast<_RawYp*>(static_cast<const _Yp*>(__ptr)));
}
}
- _LIBCPP_INLINE_VISIBILITY
- void __enable_weak_this(const volatile void*) _NOEXCEPT {}
+ _LIBCPP_INLINE_VISIBILITY void __enable_weak_this(...) _NOEXCEPT {}
- template <class _Up> friend class _LIBCPP_TYPE_VIS_ONLY shared_ptr;
- template <class _Up> friend class _LIBCPP_TYPE_VIS_ONLY weak_ptr;
+ template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
+ template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
};
+
template<class _Tp>
inline
_LIBCPP_CONSTEXPR
@@ -4165,10 +3996,11 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p,
: __ptr_(__p)
{
unique_ptr<_Yp> __hold(__p);
- typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__p, default_delete<_Yp>(), allocator<_Yp>());
+ typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
+ typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, _AllocT > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__p, default_delete<_Yp>(), _AllocT());
__hold.release();
- __enable_weak_this(__p);
+ __enable_weak_this(__p, __p);
}
template<class _Tp>
@@ -4181,9 +4013,10 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d,
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
- typedef __shared_ptr_pointer<_Yp*, _Dp, allocator<_Yp> > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__p, __d, allocator<_Yp>());
- __enable_weak_this(__p);
+ typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
+ typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
+ __enable_weak_this(__p, __p);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
@@ -4203,8 +4036,9 @@ shared_ptr<_Tp>::shared_ptr(nullptr_t __p, _Dp __d)
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
- typedef __shared_ptr_pointer<nullptr_t, _Dp, allocator<_Tp> > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__p, __d, allocator<_Tp>());
+ typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
+ typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
@@ -4233,7 +4067,7 @@ shared_ptr<_Tp>::shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
_CntrlBlk(__p, __d, __a);
__cntrl_ = _VSTD::addressof(*__hold2.release());
- __enable_weak_this(__p);
+ __enable_weak_this(__p, __p);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
@@ -4296,7 +4130,7 @@ template<class _Tp>
template<class _Yp>
inline
shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type)
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
_NOEXCEPT
: __ptr_(__r.__ptr_),
__cntrl_(__r.__cntrl_)
@@ -4321,7 +4155,7 @@ template<class _Tp>
template<class _Yp>
inline
shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type)
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
_NOEXCEPT
: __ptr_(__r.__ptr_),
__cntrl_(__r.__cntrl_)
@@ -4332,6 +4166,7 @@ shared_ptr<_Tp>::shared_ptr(shared_ptr<_Yp>&& __r,
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template<class _Tp>
template<class _Yp>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -4344,9 +4179,10 @@ shared_ptr<_Tp>::shared_ptr(auto_ptr<_Yp> __r,
{
typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk;
__cntrl_ = new _CntrlBlk(__r.get(), default_delete<_Yp>(), allocator<_Yp>());
- __enable_weak_this(__r.get());
+ __enable_weak_this(__r.get(), __r.get());
__r.release();
}
+#endif
template<class _Tp>
template <class _Yp, class _Dp>
@@ -4370,9 +4206,10 @@ shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
else
#endif
{
- typedef __shared_ptr_pointer<_Yp*, _Dp, allocator<_Yp> > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), allocator<_Yp>());
- __enable_weak_this(__r.get());
+ typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
+ typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), _AllocT());
+ __enable_weak_this(__r.get(), __r.get());
}
__r.release();
}
@@ -4399,11 +4236,12 @@ shared_ptr<_Tp>::shared_ptr(unique_ptr<_Yp, _Dp> __r,
else
#endif
{
+ typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
typedef __shared_ptr_pointer<_Yp*,
reference_wrapper<typename remove_reference<_Dp>::type>,
- allocator<_Yp> > _CntrlBlk;
- __cntrl_ = new _CntrlBlk(__r.get(), ref(__r.get_deleter()), allocator<_Yp>());
- __enable_weak_this(__r.get());
+ _AllocT > _CntrlBlk;
+ __cntrl_ = new _CntrlBlk(__r.get(), ref(__r.get_deleter()), _AllocT());
+ __enable_weak_this(__r.get(), __r.get());
}
__r.release();
}
@@ -4424,7 +4262,7 @@ shared_ptr<_Tp>::make_shared(_Args&& ...__args)
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = __hold2.release();
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4443,7 +4281,7 @@ shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _Args&& ...__args)
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = _VSTD::addressof(*__hold2.release());
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4462,7 +4300,7 @@ shared_ptr<_Tp>::make_shared()
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = __hold2.release();
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4480,7 +4318,7 @@ shared_ptr<_Tp>::make_shared(_A0& __a0)
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = __hold2.release();
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4498,7 +4336,7 @@ shared_ptr<_Tp>::make_shared(_A0& __a0, _A1& __a1)
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = __hold2.release();
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4516,7 +4354,7 @@ shared_ptr<_Tp>::make_shared(_A0& __a0, _A1& __a1, _A2& __a2)
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = __hold2.release();
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4535,7 +4373,7 @@ shared_ptr<_Tp>::allocate_shared(const _Alloc& __a)
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = _VSTD::addressof(*__hold2.release());
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4554,7 +4392,7 @@ shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0)
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = _VSTD::addressof(*__hold2.release());
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4573,7 +4411,7 @@ shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0, _A1& __a1)
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = _VSTD::addressof(*__hold2.release());
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4592,7 +4430,7 @@ shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0, _A1& __a1, _A2& _
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
__r.__cntrl_ = _VSTD::addressof(*__hold2.release());
- __r.__enable_weak_this(__r.__ptr_);
+ __r.__enable_weak_this(__r.__ptr_, __r.__ptr_);
return __r;
}
@@ -4619,7 +4457,7 @@ template<class _Yp>
inline
typename enable_if
<
- is_convertible<_Yp*, _Tp*>::value,
+ is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
shared_ptr<_Tp>&
>::type
shared_ptr<_Tp>::operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
@@ -4644,7 +4482,7 @@ template<class _Yp>
inline
typename enable_if
<
- is_convertible<_Yp*, _Tp*>::value,
+ is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
shared_ptr<_Tp>&
>::type
shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
@@ -4653,13 +4491,14 @@ shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
return *this;
}
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template<class _Tp>
template<class _Yp>
inline
typename enable_if
<
!is_array<_Yp>::value &&
- is_convertible<_Yp*, _Tp*>::value,
+ is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
shared_ptr<_Tp>
>::type&
shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
@@ -4667,6 +4506,7 @@ shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
shared_ptr(_VSTD::move(__r)).swap(*this);
return *this;
}
+#endif
template<class _Tp>
template <class _Yp, class _Dp>
@@ -4674,7 +4514,8 @@ inline
typename enable_if
<
!is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, _Tp*>::value,
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer,
+ typename shared_ptr<_Tp>::element_type*>::value,
shared_ptr<_Tp>&
>::type
shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
@@ -4685,13 +4526,14 @@ shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp>&& __r)
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
template<class _Tp>
template<class _Yp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
!is_array<_Yp>::value &&
- is_convertible<_Yp*, _Tp*>::value,
+ is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
shared_ptr<_Tp>&
>::type
shared_ptr<_Tp>::operator=(auto_ptr<_Yp> __r)
@@ -4699,6 +4541,7 @@ shared_ptr<_Tp>::operator=(auto_ptr<_Yp> __r)
shared_ptr(__r).swap(*this);
return *this;
}
+#endif
template<class _Tp>
template <class _Yp, class _Dp>
@@ -4706,7 +4549,8 @@ inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
!is_array<_Yp>::value &&
- is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, _Tp*>::value,
+ is_convertible<typename unique_ptr<_Yp, _Dp>::pointer,
+ typename shared_ptr<_Tp>::element_type*>::value,
shared_ptr<_Tp>&
>::type
shared_ptr<_Tp>::operator=(unique_ptr<_Yp, _Dp> __r)
@@ -4739,7 +4583,7 @@ template<class _Yp>
inline
typename enable_if
<
- is_convertible<_Yp*, _Tp*>::value,
+ is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
void
>::type
shared_ptr<_Tp>::reset(_Yp* __p)
@@ -4752,7 +4596,7 @@ template<class _Yp, class _Dp>
inline
typename enable_if
<
- is_convertible<_Yp*, _Tp*>::value,
+ is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
void
>::type
shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d)
@@ -4765,7 +4609,7 @@ template<class _Yp, class _Dp, class _Alloc>
inline
typename enable_if
<
- is_convertible<_Yp*, _Tp*>::value,
+ is_convertible<_Yp*, typename shared_ptr<_Tp>::element_type*>::value,
void
>::type
shared_ptr<_Tp>::reset(_Yp* __p, _Dp __d, _Alloc __a)
@@ -5070,7 +4914,7 @@ get_deleter(const shared_ptr<_Tp>& __p) _NOEXCEPT
#endif // _LIBCPP_NO_RTTI
template<class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY weak_ptr
+class _LIBCPP_TEMPLATE_VIS weak_ptr
{
public:
typedef _Tp element_type;
@@ -5148,15 +4992,15 @@ public:
shared_ptr<_Tp> lock() const _NOEXCEPT;
template<class _Up>
_LIBCPP_INLINE_VISIBILITY
- bool owner_before(const shared_ptr<_Up>& __r) const
+ bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT
{return __cntrl_ < __r.__cntrl_;}
template<class _Up>
_LIBCPP_INLINE_VISIBILITY
- bool owner_before(const weak_ptr<_Up>& __r) const
+ bool owner_before(const weak_ptr<_Up>& __r) const _NOEXCEPT
{return __cntrl_ < __r.__cntrl_;}
- template <class _Up> friend class _LIBCPP_TYPE_VIS_ONLY weak_ptr;
- template <class _Up> friend class _LIBCPP_TYPE_VIS_ONLY shared_ptr;
+ template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
+ template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
};
template<class _Tp>
@@ -5330,16 +5174,12 @@ weak_ptr<_Tp>::reset() _NOEXCEPT
template<class _Tp>
template<class _Yp>
shared_ptr<_Tp>::shared_ptr(const weak_ptr<_Yp>& __r,
- typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type)
+ typename enable_if<is_convertible<_Yp*, element_type*>::value, __nat>::type)
: __ptr_(__r.__ptr_),
__cntrl_(__r.__cntrl_ ? __r.__cntrl_->lock() : __r.__cntrl_)
{
if (__cntrl_ == 0)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_weak_ptr();
-#else
- assert(!"bad_weak_ptr");
-#endif
+ __throw_bad_weak_ptr();
}
template<class _Tp>
@@ -5360,63 +5200,63 @@ template <class _Tp> struct owner_less;
#endif
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY owner_less<shared_ptr<_Tp> >
+struct _LIBCPP_TEMPLATE_VIS owner_less<shared_ptr<_Tp> >
: binary_function<shared_ptr<_Tp>, shared_ptr<_Tp>, bool>
{
typedef bool result_type;
_LIBCPP_INLINE_VISIBILITY
- bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
+ bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
_LIBCPP_INLINE_VISIBILITY
- bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const
+ bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
_LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
+ bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY owner_less<weak_ptr<_Tp> >
+struct _LIBCPP_TEMPLATE_VIS owner_less<weak_ptr<_Tp> >
: binary_function<weak_ptr<_Tp>, weak_ptr<_Tp>, bool>
{
typedef bool result_type;
_LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const
+ bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
_LIBCPP_INLINE_VISIBILITY
- bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const
+ bool operator()(shared_ptr<_Tp> const& __x, weak_ptr<_Tp> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
_LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
+ bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
};
#if _LIBCPP_STD_VER > 14
template <>
-struct _LIBCPP_TYPE_VIS_ONLY owner_less<void>
+struct _LIBCPP_TEMPLATE_VIS owner_less<void>
{
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY
- bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const
+ bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY
- bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const
+ bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const
+ bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY
- bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const
+ bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const _NOEXCEPT
{return __x.owner_before(__y);}
typedef void is_transparent;
};
#endif
template<class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY enable_shared_from_this
+class _LIBCPP_TEMPLATE_VIS enable_shared_from_this
{
mutable weak_ptr<_Tp> __weak_this_;
protected:
@@ -5437,14 +5277,25 @@ public:
shared_ptr<_Tp const> shared_from_this() const
{return shared_ptr<const _Tp>(__weak_this_);}
+#if _LIBCPP_STD_VER > 14
+ _LIBCPP_INLINE_VISIBILITY
+ weak_ptr<_Tp> weak_from_this() _NOEXCEPT
+ { return __weak_this_; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ weak_ptr<const _Tp> weak_from_this() const _NOEXCEPT
+ { return __weak_this_; }
+#endif // _LIBCPP_STD_VER > 14
+
template <class _Up> friend class shared_ptr;
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY hash<shared_ptr<_Tp> >
+struct _LIBCPP_TEMPLATE_VIS hash<shared_ptr<_Tp> >
{
typedef shared_ptr<_Tp> argument_type;
typedef size_t result_type;
+
_LIBCPP_INLINE_VISIBILITY
result_type operator()(const argument_type& __ptr) const _NOEXCEPT
{
@@ -5457,9 +5308,8 @@ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
-// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
-// enabled with clang.
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
class _LIBCPP_TYPE_VIS __sp_mut
{
@@ -5476,7 +5326,8 @@ private:
friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
};
-_LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
+_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
+__sp_mut& __get_sp_mut(const void*);
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
@@ -5487,6 +5338,7 @@ atomic_is_lock_free(const shared_ptr<_Tp>*)
}
template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
shared_ptr<_Tp>
atomic_load(const shared_ptr<_Tp>* __p)
{
@@ -5499,6 +5351,7 @@ atomic_load(const shared_ptr<_Tp>* __p)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
shared_ptr<_Tp>
atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
{
@@ -5506,6 +5359,7 @@ atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
}
template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
void
atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
{
@@ -5517,6 +5371,7 @@ atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
void
atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
{
@@ -5524,6 +5379,7 @@ atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
}
template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
shared_ptr<_Tp>
atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
{
@@ -5536,6 +5392,7 @@ atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
shared_ptr<_Tp>
atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
{
@@ -5543,17 +5400,21 @@ atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order
}
template <class _Tp>
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
bool
atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
{
+ shared_ptr<_Tp> __temp;
__sp_mut& __m = __get_sp_mut(__p);
__m.lock();
if (__p->__owner_equivalent(*__v))
{
+ _VSTD::swap(__temp, *__p);
*__p = __w;
__m.unlock();
return true;
}
+ _VSTD::swap(__temp, *__v);
*__v = *__p;
__m.unlock();
return false;
@@ -5561,6 +5422,7 @@ atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, share
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
bool
atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
{
@@ -5569,6 +5431,7 @@ atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
bool
atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -5578,6 +5441,7 @@ atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* _
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
bool
atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -5585,9 +5449,18 @@ atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v
return atomic_compare_exchange_weak(__p, __v, __w);
}
-#endif // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
//enum class
+#if defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE)
+# ifndef _LIBCPP_CXX03_LANG
+enum class pointer_safety : unsigned char {
+ relaxed,
+ preferred,
+ strict
+};
+# endif
+#else
struct _LIBCPP_TYPE_VIS pointer_safety
{
enum __lx
@@ -5600,15 +5473,32 @@ struct _LIBCPP_TYPE_VIS pointer_safety
__lx __v_;
_LIBCPP_INLINE_VISIBILITY
+ pointer_safety() : __v_() {}
+
+ _LIBCPP_INLINE_VISIBILITY
pointer_safety(__lx __v) : __v_(__v) {}
_LIBCPP_INLINE_VISIBILITY
operator int() const {return __v_;}
};
+#endif
+
+#if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE) && \
+ defined(_LIBCPP_BUILDING_MEMORY)
+_LIBCPP_FUNC_VIS pointer_safety get_pointer_safety() _NOEXCEPT;
+#else
+// This function is only offered in C++03 under ABI v1.
+# if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE) || !defined(_LIBCPP_CXX03_LANG)
+inline _LIBCPP_INLINE_VISIBILITY
+pointer_safety get_pointer_safety() _NOEXCEPT {
+ return pointer_safety::relaxed;
+}
+# endif
+#endif
+
_LIBCPP_FUNC_VIS void declare_reachable(void* __p);
_LIBCPP_FUNC_VIS void declare_no_pointers(char* __p, size_t __n);
_LIBCPP_FUNC_VIS void undeclare_no_pointers(char* __p, size_t __n);
-_LIBCPP_FUNC_VIS pointer_safety get_pointer_safety() _NOEXCEPT;
_LIBCPP_FUNC_VIS void* __undeclare_reachable(void* __p);
template <class _Tp>
@@ -5623,7 +5513,7 @@ _LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t&
// --- Helper for container swap --
template <typename _Alloc>
-_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY
void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
@@ -5649,7 +5539,7 @@ void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
}
template <typename _Alloc>
-_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY
void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
template <typename _Alloc, typename _Traits=allocator_traits<_Alloc> >
@@ -5662,6 +5552,26 @@ struct __noexcept_move_assign_container : public integral_constant<bool,
#endif
> {};
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+template <class _Tp, class _Alloc>
+struct __temp_value {
+ typedef allocator_traits<_Alloc> _Traits;
+
+ typename aligned_storage<sizeof(_Tp), alignof(_Tp)>::type __v;
+ _Alloc &__a;
+
+ _Tp *__addr() { return reinterpret_cast<_Tp *>(addressof(__v)); }
+ _Tp & get() { return *__addr(); }
+
+ template<class... _Args>
+ __temp_value(_Alloc &__alloc, _Args&& ... __args) : __a(__alloc)
+ { _Traits::construct(__a, __addr(), _VSTD::forward<_Args>(__args)...); }
+
+ ~__temp_value() { _Traits::destroy(__a, __addr()); }
+ };
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_MEMORY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/module.modulemap b/chromium/buildtools/third_party/libc++/trunk/include/module.modulemap
index 3fb7428411d..ad765c07d48 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/module.modulemap
+++ b/chromium/buildtools/third_party/libc++/trunk/include/module.modulemap
@@ -1,13 +1,224 @@
+// define the module for __config outside of the top level 'std' module
+// since __config may be included from C headers which may create an
+// include cycle.
+module std_config [system] [extern_c] {
+ header "__config"
+}
+
module std [system] {
+ export std_config
// FIXME: The standard does not require that each of these submodules
// re-exports its imported modules. We should provide an alternative form of
// export that issues a warning if a name from the submodule is used, and
// use that to provide a 'strict mode' for libc++.
+
+ // Deprecated C-compatibility headers. These can all be included from within
+ // an 'extern "C"' context.
+ module depr [extern_c] {
+ // <assert.h> provided by C library.
+ module ctype_h {
+ header "ctype.h"
+ export *
+ }
+ module errno_h {
+ header "errno.h"
+ export *
+ }
+ // <fenv.h> provided by C library.
+ // <float.h> provided by compiler or C library.
+ module inttypes_h {
+ header "inttypes.h"
+ export stdint_h
+ export *
+ }
+ // <iso646.h> provided by compiler.
+ // <limits.h> provided by compiler or C library.
+ module locale_h {
+ header "locale.h"
+ export *
+ }
+ module math_h {
+ header "math.h"
+ export *
+ }
+ module setjmp_h {
+ header "setjmp.h"
+ export *
+ }
+ // FIXME: <stdalign.h> is missing.
+ // <signal.h> provided by C library.
+ // <stdarg.h> provided by compiler.
+ // <stdbool.h> provided by compiler.
+ module stddef_h {
+ // <stddef.h>'s __need_* macros require textual inclusion.
+ textual header "stddef.h"
+ }
+ module stdint_h {
+ header "stdint.h"
+ export *
+ // FIXME: This module only exists on OS X and for some reason the
+ // wildcard above doesn't export it.
+ export Darwin.C.stdint
+ }
+ module stdio_h {
+ // <stdio.h>'s __need_* macros require textual inclusion.
+ textual header "stdio.h"
+ export *
+ export Darwin.C.stdio
+ }
+ module stdlib_h {
+ // <stdlib.h>'s __need_* macros require textual inclusion.
+ textual header "stdlib.h"
+ export *
+ }
+ module string_h {
+ header "string.h"
+ export *
+ }
+ // FIXME: <uchar.h> is missing.
+ // <time.h> provided by C library.
+ module wchar_h {
+ // <wchar.h>'s __need_* macros require textual inclusion.
+ textual header "wchar.h"
+ export *
+ }
+ module wctype_h {
+ header "wctype.h"
+ export *
+ }
+ }
+
+ // <complex.h> and <tgmath.h> are not C headers in any real sense, do not
+ // allow their use in extern "C" contexts.
+ module complex_h {
+ header "complex.h"
+ export ccomplex
+ export *
+ }
+ module tgmath_h {
+ header "tgmath.h"
+ export ccomplex
+ export cmath
+ export *
+ }
+
+ // C compatibility headers.
+ module compat {
+ module cassert {
+ // <cassert>'s use of NDEBUG requires textual inclusion.
+ textual header "cassert"
+ }
+ module ccomplex {
+ header "ccomplex"
+ export complex
+ export *
+ }
+ module cctype {
+ header "cctype"
+ export *
+ }
+ module cerrno {
+ header "cerrno"
+ export *
+ }
+ module cfenv {
+ header "cfenv"
+ export *
+ }
+ module cfloat {
+ header "cfloat"
+ export *
+ }
+ module cinttypes {
+ header "cinttypes"
+ export cstdint
+ export *
+ }
+ module ciso646 {
+ header "ciso646"
+ export *
+ }
+ module climits {
+ header "climits"
+ export *
+ }
+ module clocale {
+ header "clocale"
+ export *
+ }
+ module cmath {
+ header "cmath"
+ export *
+ }
+ module csetjmp {
+ header "csetjmp"
+ export *
+ }
+ module csignal {
+ header "csignal"
+ export *
+ }
+ // FIXME: <cstdalign> is missing.
+ module cstdarg {
+ header "cstdarg"
+ export *
+ }
+ module cstdbool {
+ header "cstdbool"
+ export *
+ }
+ module cstddef {
+ header "cstddef"
+ export *
+ }
+ module cstdint {
+ header "cstdint"
+ export depr.stdint_h
+ export *
+ }
+ module cstdio {
+ header "cstdio"
+ export *
+ }
+ module cstdlib {
+ header "cstdlib"
+ export *
+ }
+ module cstring {
+ header "cstring"
+ export *
+ }
+ module ctgmath {
+ header "ctgmath"
+ export ccomplex
+ export cmath
+ export *
+ }
+ module ctime {
+ header "ctime"
+ export *
+ }
+ // FIXME: <cuchar> is missing.
+ module cwchar {
+ header "cwchar"
+ export depr.stdio_h
+ export *
+ }
+ module cwctype {
+ header "cwctype"
+ export *
+ }
+ }
+
module algorithm {
header "algorithm"
export initializer_list
export *
}
+ module any {
+ header "any"
+ export *
+ }
module array {
header "array"
export initializer_list
@@ -16,7 +227,6 @@ module std [system] {
module atomic {
header "atomic"
export *
- requires cplusplus11
}
module bitset {
header "bitset"
@@ -25,118 +235,10 @@ module std [system] {
export *
}
// No submodule for cassert. It fundamentally needs repeated, textual inclusion.
- module ccomplex {
- header "ccomplex"
- export complex
- export *
- }
- module cctype {
- header "cctype"
- export *
- }
- module cerrno {
- header "cerrno"
-/*
- export_macros ECONNREFUSED, EIO, ENODEV, ENOTEMPTY, ERANGE,
- E2BIG, ECONNRESET, EISCONN, ENOENT, ENOTRECOVERABLE, EROFS,
- EACCES, EDEADLK, EISDIR, ENOEXEC, ENOTSOCK, ESPIPE,
- EADDRINUSE, EDESTADDRREQ, ELOOP, ENOLCK, ENOTSUP, ESRCH,
- EADDRNOTAVAIL, EDOM, EMFILE, ENOLINK, ENOTTY, ETIME,
- EAFNOSUPPORT, EEXIST, EMLINK, ENOMEM, ENXIO, ETIMEDOUT,
- EAGAIN, EFAULT, EMSGSIZE, ENOMSG, EOPNOTSUPP, ETXTBSY,
- EALREADY, EFBIG, ENAMETOOLONG, ENOPROTOOPT, EOVERFLOW, EWOULDBLOCK,
- EBADF, EHOSTUNREACH, ENETDOWN, ENOSPC, EOWNERDEAD, EXDEV,
- EBADMSG, EIDRM, ENETRESET, ENOSR, EPERM, errno,
- EBUSY, EILSEQ, ENETUNREACH, ENOSTR, EPIPE,
- ECANCELED, EINPROGRESS, ENFILE, ENOSYS, EPROTO,
- ECHILD, EINTR, ENOBUFS, ENOTCONN, EPROTONOSUPPORT,
- ECONNABORTED, EINVAL, ENODATA, ENOTDIR, EPROTOTYPE
-*/
- export *
- }
- module cfenv {
- header "cfenv"
-/*
- export_macros FE_ALL_EXCEPT, FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW,
- FE_UNDERFLOW, FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD,
- FE_DFL_ENV
-*/
- export *
- }
- module cfloat {
- header "cfloat"
-/*
- export_macros FLT_EVAL_METHOD, FLT_RADIX, FLT_ROUNDS,
- FLT_DIG, FLT_EPSILON, FLT_MANT_DIG,
- FLT_MAX, FLT_MAX_10_EXP, FLT_MAX_EXP,
- FLT_MIN, FLT_MIN_10_EXP, FLT_MIN_EXP,
- DBL_DIG, DBL_EPSILON, DBL_MANT_DIG,
- DBL_MAX, DBL_MAX_10_EXP, DBL_MAX_EXP,
- DBL_MIN, DBL_MIN_10_EXP, DBL_MIN_EXP,
- LDBL_DIG, LDBL_EPSILON, LDBL_MANT_DIG,
- LDBL_MAX, LDBL_MAX_10_EXP, LDBL_MAX_EXP,
- LDBL_MIN, LDBL_MIN_10_EXP, LDBL_MIN_EXP
-*/
- export *
- }
module chrono {
header "chrono"
export *
}
- module cinttypes {
- header "cinttypes"
- export cstdint
-/*
- export_macros
- PRId8, PRId16, PRId32, PRId64, PRIdFAST8, PRIdFAST16, PRIdFAST32, PRIdFAST64, PRIdLEAST8, PRIdLEAST16, PRIdLEAST32, PRIdLEAST64, PRIdMAX, PRIdPTR,
- PRIi8, PRIi16, PRIi32, PRIi64, PRIiFAST8, PRIiFAST16, PRIiFAST32, PRIiFAST64, PRIiLEAST8, PRIiLEAST16, PRIiLEAST32, PRIiLEAST64, PRIiMAX, PRIiPTR,
- PRIo8, PRIo16, PRIo32, PRIo64, PRIoFAST8, PRIoFAST16, PRIoFAST32, PRIoFAST64, PRIoLEAST8, PRIoLEAST16, PRIoLEAST32, PRIoLEAST64, PRIoMAX, PRIoPTR,
- PRIu8, PRIu16, PRIu32, PRIu64, PRIuFAST8, PRIuFAST16, PRIuFAST32, PRIuFAST64, PRIuLEAST8, PRIuLEAST16, PRIuLEAST32, PRIuLEAST64, PRIuMAX, PRIuPTR,
- PRIx8, PRIx16, PRIx32, PRIx64, PRIxFAST8, PRIxFAST16, PRIxFAST32, PRIxFAST64, PRIxLEAST8, PRIxLEAST16, PRIxLEAST32, PRIxLEAST64, PRIxMAX, PRIxPTR,
- PRIX8, PRIX16, PRIX32, PRIX64, PRIXFAST8, PRIXFAST16, PRIXFAST32, PRIXFAST64, PRIXLEAST8, PRIXLEAST16, PRIXLEAST32, PRIXLEAST64, PRIXMAX, PRIXPTR,
- SCNd8, SCNd16, SCNd32, SCNd64, SCNdFAST8, SCNdFAST16, SCNdFAST32, SCNdFAST64, SCNdLEAST8, SCNdLEAST16, SCNdLEAST32, SCNdLEAST64, SCNdMAX, SCNdPTR,
- SCNi8, SCNi16, SCNi32, SCNi64, SCNiFAST8, SCNiFAST16, SCNiFAST32, SCNiFAST64, SCNiLEAST8, SCNiLEAST16, SCNiLEAST32, SCNiLEAST64, SCNiMAX, SCNiPTR,
- SCNo8, SCNo16, SCNo32, SCNo64, SCNoFAST8, SCNoFAST16, SCNoFAST32, SCNoFAST64, SCNoLEAST8, SCNoLEAST16, SCNoLEAST32, SCNoLEAST64, SCNoMAX, SCNoPTR,
- SCNu8, SCNu16, SCNu32, SCNu64, SCNuFAST8, SCNuFAST16, SCNuFAST32, SCNuFAST64, SCNuLEAST8, SCNuLEAST16, SCNuLEAST32, SCNuLEAST64, SCNuMAX, SCNuPTR,
- SCNx8, SCNx16, SCNx32, SCNx64, SCNxFAST8, SCNxFAST16, SCNxFAST32, SCNxFAST64, SCNxLEAST8, SCNxLEAST16, SCNxLEAST32, SCNxLEAST64, SCNxMAX, SCNxPTR,
- SCNX8, SCNX16, SCNX32, SCNX64, SCNXFAST8, SCNXFAST16, SCNXFAST32, SCNXFAST64, SCNXLEAST8, SCNXLEAST16, SCNXLEAST32, SCNXLEAST64, SCNXMAX, SCNXPTR
-*/
- export *
- }
- module ciso646 {
- header "ciso646"
- export *
- }
- module climits {
- header "climits"
-/*
- export_macros CHAR_BIT, CHAR_MIN, CHAR_MAX,
- SCHAR_MIN, SCHAR_MAX, UCHAR_MAX,
- SHRT_MIN, SHRT_MAX, USHRT_MAX,
- INT_MIN, INT_MAX, UINT_MAX,
- LONG_MIN, LONG_MAX, ULONG_MAX,
- LLONG_MIN, LLONG_MAX, ULLONG_MAX,
- MB_LEN_MAX
-*/
- export *
- }
- module clocale {
- header "clocale"
-/*
- export_macros LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, NULL
-*/
- export *
- }
- module cmath {
- header "cmath"
-/*
- export_macros FP_FAST_FMA, FP_FAST_FMAF, FP_FAST_FMAL, FP_ILOGBO, FP_ILOGBNAN,
- FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO,
- HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY, NAN,
- MATH_ERRNO, MATH_ERREXCEPT, math_errhandling
-*/
- export *
- }
module codecvt {
header "codecvt"
export *
@@ -149,108 +251,6 @@ module std [system] {
header "condition_variable"
export *
}
- module csetjmp {
- header "csetjmp"
-/*
- export_macros setjmp
-*/
- export *
- }
- module csignal {
- header "csignal"
-/*
- export_macros SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM,
- SIG_DFL, SIG_IGN, SIG_ERR
-*/
- export *
- }
- module cstdarg {
- header "cstdarg"
-/*
- export_macros va_arg, va_start, va_end, va_copy
-*/
- export *
- }
- module cstdbool {
- header "cstdbool"
-/*
- export_macros __bool_true_false_are_defined
-*/
- export *
- }
- module cstddef {
- header "cstddef"
-/*
- export_macros NULL, offsetof
-*/
- export *
- }
- module cstdint {
- header "cstdint"
-/*
- export_macros
- INT_8_MIN, INT_8_MAX, UINT_8_MAX, INT_16_MIN, INT_16_MAX, UINT_16_MAX,
- INT_32_MIN, INT_32_MAX, UINT_32_MAX, INT_64_MIN, INT_64_MAX, UINT_64_MAX,
- INT_FAST8_MIN, INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX, UINT_FAST16_MAX,
- INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX, INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX,
- INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX, INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX,
- INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX,
- INT_MAX_MIN, INT_MAX_MAX, UINT_MAX_MAX, INT_PTR_MIN, INT_PTR_MAX, UINT_PTR_MAX,
- PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX,
- SIZE_MAX
-*/
- export *
- }
- module cstdio {
- header "cstdio"
-/*
- export_macros BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_tmpnam, NULL,
- SEEK_CUR, SEEK_END, SEEK_SET, TMP_MAX, _IOFBF, _IOLBF,
- stdin, stdout, stderr
-*/
- export *
- }
- module cstdlib {
- header "cstdlib"
-/*
- export_macros RAND_MAX
-*/
- export *
- }
- module cstring {
- header "cstring"
-/*
- export_macros NULL
-*/
- export *
- }
- module ctgmath {
- header "ctgmath"
- export ccomplex
- export cmath
- export *
- }
- module ctime {
- header "ctime"
-/*
- export_macros NULL, CLOCKS_PER_SEC
-*/
- export *
- }
- module cwchar {
- header "cwchar"
-/*
- export_macros NULL, WCHAR_MAX, WCHAR_MIN, WEOF
-*/
- export *
- }
- module cwctype {
- header "cwctype"
-/*
- export_macros WEOF
-*/
- export *
- }
module deque {
header "deque"
export initializer_list
@@ -345,6 +345,10 @@ module std [system] {
header "numeric"
export *
}
+ module optional {
+ header "optional"
+ export *
+ }
module ostream {
header "ostream"
// FIXME: should re-export ios, streambuf?
@@ -399,11 +403,19 @@ module std [system] {
module string {
header "string"
export initializer_list
+ export string_view
+ export __string
+ export *
+ }
+ module string_view {
+ header "string_view"
+ export initializer_list
+ export __string
export *
}
module strstream {
header "strstream"
- requires !cplusplus11
+ export *
}
module system_error {
header "system_error"
@@ -449,17 +461,16 @@ module std [system] {
export initializer_list
export *
}
+ module variant {
+ header "variant"
+ export *
+ }
module vector {
header "vector"
export initializer_list
export *
}
- // FIXME: We don't have modules for the <foo.h> headers, because they might
- // be included from the C library's headers, and that would create a #include
- // cycle. For the same reason, we don't have a module for __config.
- //module __config { header "__config" export * }
-
// FIXME: These should be private.
module __bit_reference { header "__bit_reference" export * }
module __debug { header "__debug" export * }
@@ -470,8 +481,132 @@ module std [system] {
module __split_buffer { header "__split_buffer" export * }
module __sso_allocator { header "__sso_allocator" export * }
module __std_stream { header "__std_stream" export * }
+ module __string { header "__string" export * }
module __tree { header "__tree" export * }
module __tuple { header "__tuple" export * }
module __undef_min_max { header "__undef_min_max" export * }
- module __undef___deallocate { header "__undef___deallocate" export * }
+
+ module experimental {
+ requires cplusplus11
+
+ module algorithm {
+ header "experimental/algorithm"
+ export *
+ }
+ module any {
+ header "experimental/any"
+ export *
+ }
+ module chrono {
+ header "experimental/chrono"
+ export *
+ }
+ // FIXME: This module only works when -fcoroutines-ts is enabled and it
+ // breaks the modules build otherwise.
+ // module coroutine {
+ // header "experimental/coroutine"
+ // export *
+ // }
+ module deque {
+ header "experimental/deque"
+ export *
+ }
+ module dynarray {
+ header "experimental/dynarray"
+ export *
+ }
+ module filesystem {
+ header "experimental/filesystem"
+ export *
+ }
+ module forward_list {
+ header "experimental/forward_list"
+ export *
+ }
+ module functional {
+ header "experimental/functional"
+ export *
+ }
+ module iterator {
+ header "experimental/iterator"
+ export *
+ }
+ module list {
+ header "experimental/list"
+ export *
+ }
+ module map {
+ header "experimental/map"
+ export *
+ }
+ module memory_resource {
+ header "experimental/memory_resource"
+ export *
+ }
+ module numeric {
+ header "experimental/numeric"
+ export *
+ }
+ module optional {
+ header "experimental/optional"
+ export *
+ }
+ module propagate_const {
+ header "experimental/propagate_const"
+ export *
+ }
+ module ratio {
+ header "experimental/ratio"
+ export *
+ }
+ module regex {
+ header "experimental/regex"
+ export *
+ }
+ module set {
+ header "experimental/set"
+ export *
+ }
+ module string {
+ header "experimental/string"
+ export *
+ }
+ module string_view {
+ header "experimental/string_view"
+ export *
+ }
+ module system_error {
+ header "experimental/system_error"
+ export *
+ }
+ module tuple {
+ header "experimental/tuple"
+ export *
+ }
+ module type_traits {
+ header "experimental/type_traits"
+ export *
+ }
+ module unordered_map {
+ header "experimental/unordered_map"
+ export *
+ }
+ module unordered_set {
+ header "experimental/unordered_set"
+ export *
+ }
+ module utility {
+ header "experimental/utility"
+ export *
+ }
+ module vector {
+ header "experimental/vector"
+ export *
+ }
+ // FIXME these should be private
+ module __memory {
+ header "experimental/__memory"
+ export *
+ }
+ } // end experimental
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/mutex b/chromium/buildtools/third_party/libc++/trunk/include/mutex
index a0875a568ec..0b25614e8ea 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/mutex
+++ b/chromium/buildtools/third_party/libc++/trunk/include/mutex
@@ -109,6 +109,21 @@ public:
lock_guard& operator=(lock_guard const&) = delete;
};
+template <class... MutexTypes>
+class scoped_lock // C++17
+{
+public:
+ using mutex_type = Mutex; // If MutexTypes... consists of the single type Mutex
+
+ explicit scoped_lock(MutexTypes&... m);
+ scoped_lock(MutexTypes&... m, adopt_lock_t);
+ ~scoped_lock();
+ scoped_lock(scoped_lock const&) = delete;
+ scoped_lock& operator=(scoped_lock const&) = delete;
+private:
+ tuple<MutexTypes&...> pm; // exposition only
+};
+
template <class Mutex>
class unique_lock
{
@@ -176,12 +191,10 @@ template<class Callable, class ...Args>
#include <__mutex_base>
#include <functional>
#include <memory>
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
#include <tuple>
#endif
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include <sched.h>
-#endif
+#include <__threading_support>
#include <__undef_min_max>
@@ -195,7 +208,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
class _LIBCPP_TYPE_VIS recursive_mutex
{
- pthread_mutex_t __m_;
+ __libcpp_recursive_mutex_t __m_;
public:
recursive_mutex();
@@ -210,7 +223,8 @@ public:
bool try_lock() _NOEXCEPT;
void unlock() _NOEXCEPT;
- typedef pthread_mutex_t* native_handle_type;
+ typedef __libcpp_recursive_mutex_t* native_handle_type;
+
_LIBCPP_INLINE_VISIBILITY
native_handle_type native_handle() {return &__m_;}
};
@@ -236,6 +250,7 @@ public:
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
{return try_lock_until(chrono::steady_clock::now() + __d);}
template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
void unlock() _NOEXCEPT;
};
@@ -262,7 +277,7 @@ class _LIBCPP_TYPE_VIS recursive_timed_mutex
mutex __m_;
condition_variable __cv_;
size_t __count_;
- pthread_t __id_;
+ __libcpp_thread_id __id_;
public:
recursive_timed_mutex();
~recursive_timed_mutex();
@@ -279,6 +294,7 @@ public:
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
{return try_lock_until(chrono::steady_clock::now() + __d);}
template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
void unlock() _NOEXCEPT;
};
@@ -288,9 +304,9 @@ bool
recursive_timed_mutex::try_lock_until(const chrono::time_point<_Clock, _Duration>& __t)
{
using namespace chrono;
- pthread_t __id = pthread_self();
+ __libcpp_thread_id __id = __libcpp_thread_get_current_id();
unique_lock<mutex> lk(__m_);
- if (pthread_equal(__id, __id_))
+ if (__libcpp_thread_id_equal(__id, __id_))
{
if (__count_ == numeric_limits<size_t>::max())
return false;
@@ -327,7 +343,7 @@ try_lock(_L0& __l0, _L1& __l1)
return 0;
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class _L0, class _L1, class _L2, class... _L3>
int
@@ -346,7 +362,7 @@ try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3)
return __r;
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
template <class _L0, class _L1>
void
@@ -362,7 +378,7 @@ lock(_L0& __l0, _L1& __l1)
break;
}
}
- sched_yield();
+ __libcpp_thread_yield();
{
unique_lock<_L1> __u1(__l1);
if (__l0.try_lock())
@@ -371,11 +387,11 @@ lock(_L0& __l0, _L1& __l1)
break;
}
}
- sched_yield();
+ __libcpp_thread_yield();
}
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class _L0, class _L1, class _L2, class ..._L3>
void
@@ -396,7 +412,7 @@ __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
}
}
++__i;
- sched_yield();
+ __libcpp_thread_yield();
break;
case 1:
{
@@ -412,7 +428,7 @@ __lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
__i = 0;
else
__i += 2;
- sched_yield();
+ __libcpp_thread_yield();
break;
default:
__lock_first(__i - 2, __l2, __l3..., __l0, __l1);
@@ -429,19 +445,118 @@ lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
__lock_first(0, __l0, __l1, __l2, __l3...);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+template <class _L0>
+inline _LIBCPP_INLINE_VISIBILITY
+void __unlock(_L0& __l0) {
+ __l0.unlock();
+}
+
+template <class _L0, class _L1>
+inline _LIBCPP_INLINE_VISIBILITY
+void __unlock(_L0& __l0, _L1& __l1) {
+ __l0.unlock();
+ __l1.unlock();
+}
+
+template <class _L0, class _L1, class _L2, class ..._L3>
+inline _LIBCPP_INLINE_VISIBILITY
+void __unlock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) {
+ __l0.unlock();
+ __l1.unlock();
+ _VSTD::__unlock(__l2, __l3...);
+}
+
+#endif // _LIBCPP_CXX03_LANG
+
+#if _LIBCPP_STD_VER > 14
+template <class ..._Mutexes>
+class _LIBCPP_TEMPLATE_VIS scoped_lock;
+
+template <>
+class _LIBCPP_TEMPLATE_VIS scoped_lock<> {
+public:
+ explicit scoped_lock() {}
+ ~scoped_lock() = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit scoped_lock(adopt_lock_t) {}
+
+ scoped_lock(scoped_lock const&) = delete;
+ scoped_lock& operator=(scoped_lock const&) = delete;
+};
+
+template <class _Mutex>
+class _LIBCPP_TEMPLATE_VIS scoped_lock<_Mutex> {
+public:
+ typedef _Mutex mutex_type;
+private:
+ mutex_type& __m_;
+public:
+ explicit scoped_lock(mutex_type & __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
+ : __m_(__m) {__m_.lock();}
+
+ ~scoped_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();}
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit scoped_lock(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
+ : __m_(__m) {}
+
+
+ scoped_lock(scoped_lock const&) = delete;
+ scoped_lock& operator=(scoped_lock const&) = delete;
+};
+
+template <class ..._MArgs>
+class _LIBCPP_TEMPLATE_VIS scoped_lock
+{
+ static_assert(sizeof...(_MArgs) > 1, "At least 2 lock types required");
+ typedef tuple<_MArgs&...> _MutexTuple;
+
+public:
+ _LIBCPP_INLINE_VISIBILITY
+ explicit scoped_lock(_MArgs&... __margs)
+ : __t_(__margs...)
+ {
+ _VSTD::lock(__margs...);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ scoped_lock(_MArgs&... __margs, adopt_lock_t)
+ : __t_(__margs...)
+ {
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~scoped_lock() {
+ typedef typename __make_tuple_indices<sizeof...(_MArgs)>::type _Indices;
+ __unlock_unpack(_Indices{}, __t_);
+ }
+
+ scoped_lock(scoped_lock const&) = delete;
+ scoped_lock& operator=(scoped_lock const&) = delete;
+
+private:
+ template <size_t ..._Indx>
+ _LIBCPP_INLINE_VISIBILITY
+ static void __unlock_unpack(__tuple_indices<_Indx...>, _MutexTuple& __mt) {
+ _VSTD::__unlock(_VSTD::get<_Indx>(__mt)...);
+ }
+
+ _MutexTuple __t_;
+};
+#endif // _LIBCPP_STD_VER > 14
#endif // !_LIBCPP_HAS_NO_THREADS
-struct _LIBCPP_TYPE_VIS_ONLY once_flag;
+struct _LIBCPP_TEMPLATE_VIS once_flag;
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Callable, class... _Args>
_LIBCPP_INLINE_VISIBILITY
void call_once(once_flag&, _Callable&&, _Args&&...);
-#else // _LIBCPP_HAS_NO_VARIADICS
+#else // _LIBCPP_CXX03_LANG
template<class _Callable>
_LIBCPP_INLINE_VISIBILITY
@@ -451,9 +566,9 @@ template<class _Callable>
_LIBCPP_INLINE_VISIBILITY
void call_once(once_flag&, const _Callable&);
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
-struct _LIBCPP_TYPE_VIS_ONLY once_flag
+struct _LIBCPP_TEMPLATE_VIS once_flag
{
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
@@ -465,11 +580,11 @@ private:
unsigned long __state_;
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Callable, class... _Args>
friend
void call_once(once_flag&, _Callable&&, _Args&&...);
-#else // _LIBCPP_HAS_NO_VARIADICS
+#else // _LIBCPP_CXX03_LANG
template<class _Callable>
friend
void call_once(once_flag&, _Callable&);
@@ -477,10 +592,10 @@ private:
template<class _Callable>
friend
void call_once(once_flag&, const _Callable&);
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
};
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Fp>
class __call_once_param
@@ -535,14 +650,14 @@ __call_once_proxy(void* __vp)
_LIBCPP_FUNC_VIS void __call_once(volatile unsigned long&, void*, void(*)(void*));
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Callable, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
{
- if (__libcpp_relaxed_load(&__flag.__state_) != ~0ul)
+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul)
{
typedef tuple<_Callable&&, _Args&&...> _Gp;
_Gp __f(_VSTD::forward<_Callable>(__func), _VSTD::forward<_Args>(__args)...);
@@ -551,14 +666,14 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
}
}
-#else // _LIBCPP_HAS_NO_VARIADICS
+#else // _LIBCPP_CXX03_LANG
template<class _Callable>
inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, _Callable& __func)
{
- if (__libcpp_relaxed_load(&__flag.__state_) != ~0ul)
+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul)
{
__call_once_param<_Callable> __p(__func);
__call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>);
@@ -570,14 +685,14 @@ inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, const _Callable& __func)
{
- if (__flag.__state_ != ~0ul)
+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul)
{
__call_once_param<const _Callable> __p(__func);
__call_once(__flag.__state_, &__p, &__call_once_proxy<const _Callable>);
}
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/new b/chromium/buildtools/third_party/libc++/trunk/include/new
index d2b2ae648b4..34df2efee09 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/new
+++ b/chromium/buildtools/third_party/libc++/trunk/include/new
@@ -27,18 +27,19 @@ public:
virtual const char* what() const noexcept;
};
-class bad_array_length : public bad_alloc // C++14
+class bad_array_length : public bad_alloc // FIXME: Not part of C++
{
public:
bad_array_length() noexcept;
};
-class bad_array_new_length : public bad_alloc
+class bad_array_new_length : public bad_alloc // C++14
{
public:
bad_array_new_length() noexcept;
};
+enum class align_val_t : size_t {}; // C++17
struct nothrow_t {};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
@@ -48,16 +49,34 @@ new_handler get_new_handler() noexcept;
} // std
void* operator new(std::size_t size); // replaceable
+void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17
void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable
+void* operator new(std::size_t size, std::align_val_t alignment,
+ const std::nothrow_t&) noexcept; // replaceable, C++17
void operator delete(void* ptr) noexcept; // replaceable
void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14
+void operator delete(void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++17
+void operator delete(void* ptr, std::size_t size,
+ std::align_val_t alignment) noexcept; // replaceable, C++17
void operator delete(void* ptr, const std::nothrow_t&) noexcept; // replaceable
+void operator delete(void* ptr, std:align_val_t alignment,
+ const std::nothrow_t&) noexcept; // replaceable, C++17
void* operator new[](std::size_t size); // replaceable
+void* operator new[](std::size_t size,
+ std::align_val_t alignment) noexcept; // replaceable, C++17
void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable
+void* operator new[](std::size_t size, std::align_val_t alignment,
+ const std::nothrow_t&) noexcept; // replaceable, C++17
void operator delete[](void* ptr) noexcept; // replaceable
void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14
+void operator delete[](void* ptr,
+ std::align_val_t alignment) noexcept; // replaceable, C++17
+void operator delete[](void* ptr, std::size_t size,
+ std::align_val_t alignment) noexcept; // replaceable, C++17
void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // replaceable
+void operator delete[](void* ptr, std::align_val_t alignment,
+ const std::nothrow_t&) noexcept; // replaceable, C++17
void* operator new (std::size_t size, void* ptr) noexcept;
void* operator new[](std::size_t size, void* ptr) noexcept;
@@ -69,16 +88,36 @@ void operator delete[](void* ptr, void*) noexcept;
#include <__config>
#include <exception>
#include <cstddef>
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
-#include <__undef___deallocate>
+#if defined(_LIBCPP_ABI_MICROSOFT)
+#include <new.h>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
+#if !(defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER >= 14 || \
+ (defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309))
+# define _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) && \
+ (!(defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER > 14 || \
+ (defined(__cpp_aligned_new) && __cpp_aligned_new >= 201606)))
+# define _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#endif
+
namespace std // purposefully not using versioning namespace
{
+#if !defined(_LIBCPP_ABI_MICROSOFT)
+struct _LIBCPP_TYPE_VIS nothrow_t {};
+extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
+
class _LIBCPP_EXCEPTION_ABI bad_alloc
: public exception
{
@@ -97,11 +136,18 @@ public:
virtual const char* what() const _NOEXCEPT;
};
-#if defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11)
+typedef void (*new_handler)();
+_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
+_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
-class _LIBCPP_EXCEPTION_ABI bad_array_length
- : public bad_alloc
-{
+#endif // !_LIBCPP_ABI_MICROSOFT
+
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
+
+#if defined(_LIBCPP_BUILDING_LIBRARY) || (_LIBCPP_STD_VER > 11)
+
+class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+ bad_array_length : public bad_alloc {
public:
bad_array_length() _NOEXCEPT;
virtual ~bad_array_length() _NOEXCEPT;
@@ -112,46 +158,56 @@ public:
#endif // defined(_LIBCPP_BUILDING_NEW) || (_LIBCPP_STD_VER > 11)
-_LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
-
-struct _LIBCPP_TYPE_VIS nothrow_t {};
-extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
-typedef void (*new_handler)();
-_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
-_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
+#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION) || _LIBCPP_STD_VER > 14
+#ifndef _LIBCPP_CXX03_LANG
+enum class _LIBCPP_ENUM_VIS align_val_t : size_t { };
+#else
+enum align_val_t { __zero = 0, __max = (size_t)-1 };
+#endif
+#endif
} // std
-#if defined(_WIN32) && !defined(cxx_EXPORTS)
-# define _LIBCPP_NEW_DELETE_VIS _LIBCPP_FUNC_VIS_ONLY
+#if defined(_LIBCPP_CXX03_LANG)
+#define _THROW_BAD_ALLOC throw(std::bad_alloc)
#else
-# define _LIBCPP_NEW_DELETE_VIS _LIBCPP_FUNC_VIS
+#define _THROW_BAD_ALLOC
#endif
-_LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
+#if !defined(_LIBCPP_ABI_MICROSOFT)
+
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
#endif
-;
-_LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p) _NOEXCEPT;
-_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
-#if defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER >= 14 || \
- (defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309)
-_LIBCPP_NEW_DELETE_VIS void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
#endif
-_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
+#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+#endif
+
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
+#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
+_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
#endif
-;
-_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
-_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p) _NOEXCEPT;
-_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
-#if defined(_LIBCPP_BUILDING_NEW) || _LIBCPP_STD_VER >= 14 || \
- (defined(__cpp_sized_deallocation) && __cpp_sized_deallocation >= 201309)
-_LIBCPP_NEW_DELETE_VIS void operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
#endif
inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
@@ -159,6 +215,8 @@ inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _N
inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {}
inline _LIBCPP_INLINE_VISIBILITY void operator delete[](void*, void*) _NOEXCEPT {}
+#endif // !_LIBCPP_ABI_MICROSOFT
+
_LIBCPP_BEGIN_NAMESPACE_STD
inline _LIBCPP_INLINE_VISIBILITY void *__allocate(size_t __size) {
@@ -169,7 +227,7 @@ inline _LIBCPP_INLINE_VISIBILITY void *__allocate(size_t __size) {
#endif
}
-inline _LIBCPP_INLINE_VISIBILITY void __deallocate(void *__ptr) {
+inline _LIBCPP_INLINE_VISIBILITY void __libcpp_deallocate(void *__ptr) {
#ifdef _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
::operator delete(__ptr);
#else
@@ -177,6 +235,21 @@ inline _LIBCPP_INLINE_VISIBILITY void __deallocate(void *__ptr) {
#endif
}
+#ifdef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+#ifndef _LIBCPP_NO_EXCEPTIONS
+_LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
+#endif
+void __throw_bad_array_length()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_array_length();
+#else
+ _VSTD::abort();
+#endif
+}
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_NEW
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/numeric b/chromium/buildtools/third_party/libc++/trunk/include/numeric
index 21c3781ab6a..9c98cdbe262 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/numeric
+++ b/chromium/buildtools/third_party/libc++/trunk/include/numeric
@@ -53,12 +53,19 @@ template <class InputIterator, class OutputIterator, class BinaryOperation>
template <class ForwardIterator, class T>
void iota(ForwardIterator first, ForwardIterator last, T value);
+template <class M, class N>
+ constexpr common_type_t<M,N> gcd(M m, N n); // C++17
+
+template <class M, class N>
+ constexpr common_type_t<M,N> lcm(M m, N n); // C++17
+
} // std
*/
#include <__config>
#include <iterator>
+#include <limits> // for numeric_limits
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -192,6 +199,72 @@ iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_)
*__first = __value_;
}
+
+#if _LIBCPP_STD_VER > 14
+template <typename _Result, typename _Source, bool _IsSigned = is_signed<_Source>::value> struct __abs;
+
+template <typename _Result, typename _Source>
+struct __abs<_Result, _Source, true> {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _Result operator()(_Source __t) const noexcept
+ {
+ if (__t >= 0) return __t;
+ if (__t == numeric_limits<_Source>::min()) return -static_cast<_Result>(__t);
+ return -__t;
+ }
+};
+
+template <typename _Result, typename _Source>
+struct __abs<_Result, _Source, false> {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ _Result operator()(_Source __t) const noexcept { return __t; }
+};
+
+
+template<class _Tp>
+_LIBCPP_CONSTEXPR _LIBCPP_HIDDEN
+_Tp __gcd(_Tp __m, _Tp __n)
+{
+ static_assert((!is_signed<_Tp>::value), "");
+ return __n == 0 ? __m : _VSTD::__gcd<_Tp>(__n, __m % __n);
+}
+
+
+template<class _Tp, class _Up>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+common_type_t<_Tp,_Up>
+gcd(_Tp __m, _Up __n)
+{
+ static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types");
+ static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to gcd cannot be bool" );
+ static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" );
+ using _Rp = common_type_t<_Tp,_Up>;
+ using _Wp = make_unsigned_t<_Rp>;
+ return static_cast<_Rp>(_VSTD::__gcd(
+ static_cast<_Wp>(__abs<_Rp, _Tp>()(__m)),
+ static_cast<_Wp>(__abs<_Rp, _Up>()(__n))));
+}
+
+template<class _Tp, class _Up>
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+common_type_t<_Tp,_Up>
+lcm(_Tp __m, _Up __n)
+{
+ static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types");
+ static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to lcm cannot be bool" );
+ static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to lcm cannot be bool" );
+ if (__m == 0 || __n == 0)
+ return 0;
+
+ using _Rp = common_type_t<_Tp,_Up>;
+ _Rp __val1 = __abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n);
+ _Rp __val2 = __abs<_Rp, _Up>()(__n);
+ _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
+ return __val1 * __val2;
+}
+
+#endif /* _LIBCPP_STD_VER > 14 */
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_NUMERIC
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/optional b/chromium/buildtools/third_party/libc++/trunk/include/optional
new file mode 100644
index 00000000000..70b6eb44dcd
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/optional
@@ -0,0 +1,1318 @@
+// -*- C++ -*-
+//===-------------------------- optional ----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_OPTIONAL
+#define _LIBCPP_OPTIONAL
+
+/*
+ optional synopsis
+
+// C++1z
+
+namespace std {
+ // 23.6.3, optional for object types
+ template <class T> class optional;
+
+ // 23.6.4, no-value state indicator
+ struct nullopt_t{see below };
+ constexpr nullopt_t nullopt(unspecified );
+
+ // 23.6.5, class bad_optional_access
+ class bad_optional_access;
+
+ // 23.6.6, relational operators
+ template <class T, class U>
+ constexpr bool operator==(const optional<T>&, const optional<U>&);
+ template <class T, class U>
+ constexpr bool operator!=(const optional<T>&, const optional<U>&);
+ template <class T, class U>
+ constexpr bool operator<(const optional<T>&, const optional<U>&);
+ template <class T, class U>
+ constexpr bool operator>(const optional<T>&, const optional<U>&);
+ template <class T, class U>
+ constexpr bool operator<=(const optional<T>&, const optional<U>&);
+ template <class T, class U>
+ constexpr bool operator>=(const optional<T>&, const optional<U>&);
+
+ // 23.6.7 comparison with nullopt
+ template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator!=(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator<=(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator>(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept;
+ template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept;
+ template <class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept;
+
+ // 23.6.8, comparison with T
+ template <class T, class U> constexpr bool operator==(const optional<T>&, const U&);
+ template <class T, class U> constexpr bool operator==(const U&, const optional<T>&);
+ template <class T, class U> constexpr bool operator!=(const optional<T>&, const U&);
+ template <class T, class U> constexpr bool operator!=(const U&, const optional<T>&);
+ template <class T, class U> constexpr bool operator<(const optional<T>&, const U&);
+ template <class T, class U> constexpr bool operator<(const U&, const optional<T>&);
+ template <class T, class U> constexpr bool operator<=(const optional<T>&, const U&);
+ template <class T, class U> constexpr bool operator<=(const U&, const optional<T>&);
+ template <class T, class U> constexpr bool operator>(const optional<T>&, const U&);
+ template <class T, class U> constexpr bool operator>(const U&, const optional<T>&);
+ template <class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
+ template <class T, class U> constexpr bool operator>=(const U&, const optional<T>&);
+
+ // 23.6.9, specialized algorithms
+ template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below );
+ template <class T> constexpr optional<see below > make_optional(T&&);
+ template <class T, class... Args>
+ constexpr optional<T> make_optional(Args&&... args);
+ template <class T, class U, class... Args>
+ constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
+
+ // 23.6.10, hash support
+ template <class T> struct hash;
+ template <class T> struct hash<optional<T>>;
+
+ template <class T> class optional {
+ public:
+ using value_type = T;
+
+ // 23.6.3.1, constructors
+ constexpr optional() noexcept;
+ constexpr optional(nullopt_t) noexcept;
+ optional(const optional &);
+ optional(optional &&) noexcept(see below);
+ template <class... Args> constexpr explicit optional(in_place_t, Args &&...);
+ template <class U, class... Args>
+ constexpr explicit optional(in_place_t, initializer_list<U>, Args &&...);
+ template <class U = T>
+ constexpr EXPLICIT optional(U &&);
+ template <class U>
+ constexpr EXPLICIT optional(const optional<U> &);
+ template <class U>
+ constexpr EXPLICIT optional(optional<U> &&);
+
+ // 23.6.3.2, destructor
+ ~optional();
+
+ // 23.6.3.3, assignment
+ optional &operator=(nullopt_t) noexcept;
+ optional &operator=(const optional &);
+ optional &operator=(optional &&) noexcept(see below );
+ template <class U = T> optional &operator=(U &&);
+ template <class U> optional &operator=(const optional<U> &);
+ template <class U> optional &operator=(optional<U> &&);
+ template <class... Args> T& emplace(Args &&...);
+ template <class U, class... Args>
+ T& emplace(initializer_list<U>, Args &&...);
+
+ // 23.6.3.4, swap
+ void swap(optional &) noexcept(see below );
+
+ // 23.6.3.5, observers
+ constexpr T const *operator->() const;
+ constexpr T *operator->();
+ constexpr T const &operator*() const &;
+ constexpr T &operator*() &;
+ constexpr T &&operator*() &&;
+ constexpr const T &&operator*() const &&;
+ constexpr explicit operator bool() const noexcept;
+ constexpr bool has_value() const noexcept;
+ constexpr T const &value() const &;
+ constexpr T &value() &;
+ constexpr T &&value() &&;
+ constexpr const T &&value() const &&;
+ template <class U> constexpr T value_or(U &&) const &;
+ template <class U> constexpr T value_or(U &&) &&;
+
+ // 23.6.3.6, modifiers
+ void reset() noexcept;
+
+ private:
+ T *val; // exposition only
+ };
+} // namespace std
+
+*/
+
+#include <__config>
+#include <__debug>
+#include <__functional_base>
+#include <__undef_min_max>
+#include <functional>
+#include <initializer_list>
+#include <new>
+#include <stdexcept>
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+namespace std // purposefully not using versioning namespace
+{
+
+class _LIBCPP_EXCEPTION_ABI bad_optional_access
+ : public exception
+{
+public:
+ // Get the key function ~bad_optional_access() into the dylib
+ virtual ~bad_optional_access() _NOEXCEPT;
+ virtual const char* what() const _NOEXCEPT;
+};
+
+} // std
+
+#if _LIBCPP_STD_VER > 14
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+_LIBCPP_NORETURN
+inline _LIBCPP_INLINE_VISIBILITY
+void __throw_bad_optional_access() {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_optional_access();
+#else
+ _VSTD::abort();
+#endif
+}
+
+struct nullopt_t
+{
+ struct __secret_tag { _LIBCPP_INLINE_VISIBILITY explicit __secret_tag() = default; };
+ _LIBCPP_INLINE_VISIBILITY constexpr explicit nullopt_t(__secret_tag, __secret_tag) noexcept {}
+};
+
+/* inline */ constexpr nullopt_t nullopt{nullopt_t::__secret_tag{}, nullopt_t::__secret_tag{}};
+
+template <class _Tp, bool = is_trivially_destructible<_Tp>::value>
+struct __optional_destruct_base;
+
+template <class _Tp>
+struct __optional_destruct_base<_Tp, false>
+{
+ typedef _Tp value_type;
+ static_assert(is_object_v<value_type>,
+ "instantiation of optional with a non-object type is undefined behavior");
+ union
+ {
+ char __null_state_;
+ value_type __val_;
+ };
+ bool __engaged_;
+
+ _LIBCPP_INLINE_VISIBILITY
+ ~__optional_destruct_base()
+ {
+ if (__engaged_)
+ __val_.~value_type();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr __optional_destruct_base() noexcept
+ : __null_state_(),
+ __engaged_(false) {}
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit __optional_destruct_base(in_place_t, _Args&&... __args)
+ : __val_(_VSTD::forward<_Args>(__args)...),
+ __engaged_(true) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() noexcept
+ {
+ if (__engaged_)
+ {
+ __val_.~value_type();
+ __engaged_ = false;
+ }
+ }
+};
+
+template <class _Tp>
+struct __optional_destruct_base<_Tp, true>
+{
+ typedef _Tp value_type;
+ static_assert(is_object_v<value_type>,
+ "instantiation of optional with a non-object type is undefined behavior");
+ union
+ {
+ char __null_state_;
+ value_type __val_;
+ };
+ bool __engaged_;
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr __optional_destruct_base() noexcept
+ : __null_state_(),
+ __engaged_(false) {}
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit __optional_destruct_base(in_place_t, _Args&&... __args)
+ : __val_(_VSTD::forward<_Args>(__args)...),
+ __engaged_(true) {}
+
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() noexcept
+ {
+ if (__engaged_)
+ {
+ __engaged_ = false;
+ }
+ }
+};
+
+template <class _Tp, bool = is_reference<_Tp>::value>
+struct __optional_storage_base : __optional_destruct_base<_Tp>
+{
+ using __base = __optional_destruct_base<_Tp>;
+ using value_type = _Tp;
+ using __base::__base;
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr bool has_value() const noexcept
+ {
+ return this->__engaged_;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type& __get() & noexcept
+ {
+ return this->__val_;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr const value_type& __get() const& noexcept
+ {
+ return this->__val_;
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type&& __get() && noexcept
+ {
+ return _VSTD::move(this->__val_);
+ }
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr const value_type&& __get() const&& noexcept
+ {
+ return _VSTD::move(this->__val_);
+ }
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ void __construct(_Args&&... __args)
+ {
+ _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+ ::new((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
+ this->__engaged_ = true;
+ }
+
+ template <class _That>
+ _LIBCPP_INLINE_VISIBILITY
+ void __construct_from(_That&& __opt)
+ {
+ if (__opt.has_value())
+ __construct(_VSTD::forward<_That>(__opt).__get());
+ }
+
+ template <class _That>
+ _LIBCPP_INLINE_VISIBILITY
+ void __assign_from(_That&& __opt)
+ {
+ if (this->__engaged_ == __opt.has_value())
+ {
+ if (this->__engaged_)
+ this->__val_ = _VSTD::forward<_That>(__opt).__get();
+ }
+ else
+ {
+ if (this->__engaged_)
+ this->reset();
+ else
+ __construct(_VSTD::forward<_That>(__opt).__get());
+ }
+ }
+};
+
+// optional<T&> is currently required ill-formed, however it may to be in the
+// future. For this reason it has already been implemented to ensure we can
+// make the change in an ABI compatible manner.
+template <class _Tp>
+struct __optional_storage_base<_Tp, true>
+{
+ using value_type = _Tp;
+ using __raw_type = remove_reference_t<_Tp>;
+ __raw_type* __value_;
+
+ template <class _Up>
+ static constexpr bool __can_bind_reference() {
+ using _RawUp = typename remove_reference<_Up>::type;
+ using _UpPtr = _RawUp*;
+ using _RawTp = typename remove_reference<_Tp>::type;
+ using _TpPtr = _RawTp*;
+ using _CheckLValueArg = integral_constant<bool,
+ (is_lvalue_reference<_Up>::value && is_convertible<_UpPtr, _TpPtr>::value)
+ || is_same<_RawUp, reference_wrapper<_RawTp>>::value
+ || is_same<_RawUp, reference_wrapper<typename remove_const<_RawTp>::type>>::value
+ >;
+ return (is_lvalue_reference<_Tp>::value && _CheckLValueArg::value)
+ || (is_rvalue_reference<_Tp>::value && !is_lvalue_reference<_Up>::value &&
+ is_convertible<_UpPtr, _TpPtr>::value);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr __optional_storage_base() noexcept
+ : __value_(nullptr) {}
+
+ template <class _UArg>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit __optional_storage_base(in_place_t, _UArg&& __uarg)
+ : __value_(_VSTD::addressof(__uarg))
+ {
+ static_assert(__can_bind_reference<_UArg>(),
+ "Attempted to construct a reference element in tuple from a "
+ "possible temporary");
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void reset() noexcept { __value_ = nullptr; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr bool has_value() const noexcept
+ { return __value_ != nullptr; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type& __get() const& noexcept
+ { return *__value_; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type&& __get() const&& noexcept
+ { return _VSTD::forward<value_type>(*__value_); }
+
+ template <class _UArg>
+ _LIBCPP_INLINE_VISIBILITY
+ void __construct(_UArg&& __val)
+ {
+ _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+ static_assert(__can_bind_reference<_UArg>(),
+ "Attempted to construct a reference element in tuple from a "
+ "possible temporary");
+ __value_ = _VSTD::addressof(__val);
+ }
+
+ template <class _That>
+ _LIBCPP_INLINE_VISIBILITY
+ void __construct_from(_That&& __opt)
+ {
+ if (__opt.has_value())
+ __construct(_VSTD::forward<_That>(__opt).__get());
+ }
+
+ template <class _That>
+ _LIBCPP_INLINE_VISIBILITY
+ void __assign_from(_That&& __opt)
+ {
+ if (has_value() == __opt.has_value())
+ {
+ if (has_value())
+ *__value_ = _VSTD::forward<_That>(__opt).__get();
+ }
+ else
+ {
+ if (has_value())
+ reset();
+ else
+ __construct(_VSTD::forward<_That>(__opt).__get());
+ }
+ }
+};
+
+template <class _Tp, bool = is_trivially_copyable<_Tp>::value>
+struct __optional_storage;
+
+template <class _Tp>
+struct __optional_storage<_Tp, true> : __optional_storage_base<_Tp>
+{
+ using __optional_storage_base<_Tp>::__optional_storage_base;
+};
+
+template <class _Tp>
+struct __optional_storage<_Tp, false> : __optional_storage_base<_Tp>
+{
+ using value_type = _Tp;
+ using __optional_storage_base<_Tp>::__optional_storage_base;
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage() = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage(const __optional_storage& __opt)
+ {
+ this->__construct_from(__opt);
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage(__optional_storage&& __opt)
+ noexcept(is_nothrow_move_constructible_v<value_type>)
+ {
+ this->__construct_from(_VSTD::move(__opt));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage& operator=(const __optional_storage& __opt)
+ {
+ this->__assign_from(__opt);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __optional_storage& operator=(__optional_storage&& __opt)
+ noexcept(is_nothrow_move_assignable_v<value_type> &&
+ is_nothrow_move_constructible_v<value_type>)
+ {
+ this->__assign_from(_VSTD::move(__opt));
+ return *this;
+ }
+};
+
+template <class _Tp>
+using __optional_sfinae_ctor_base_t = __sfinae_ctor_base<
+ is_copy_constructible<_Tp>::value,
+ is_move_constructible<_Tp>::value
+>;
+
+template <class _Tp>
+using __optional_sfinae_assign_base_t = __sfinae_assign_base<
+ (is_copy_constructible<_Tp>::value && is_copy_assignable<_Tp>::value),
+ (is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value)
+>;
+
+template <class _Tp>
+class optional
+ : private __optional_storage<_Tp>
+ , private __optional_sfinae_ctor_base_t<_Tp>
+ , private __optional_sfinae_assign_base_t<_Tp>
+{
+ using __base = __optional_storage<_Tp>;
+public:
+ using value_type = _Tp;
+
+private:
+ // Disable the reference extension using this static assert.
+ static_assert(!is_same_v<value_type, in_place_t>,
+ "instantiation of optional with in_place_t is ill-formed");
+ static_assert(!is_same_v<__uncvref_t<value_type>, nullopt_t>,
+ "instantiation of optional with nullopt_t is ill-formed");
+ static_assert(!is_reference_v<value_type>,
+ "instantiation of optional with a reference type is ill-formed");
+ static_assert(is_destructible_v<value_type>,
+ "instantiation of optional with a non-destructible type is ill-formed");
+
+ // LWG2756: conditionally explicit conversion from _Up
+ struct _CheckOptionalArgsConstructor {
+ template <class _Up>
+ static constexpr bool __enable_implicit() {
+ return is_constructible_v<_Tp, _Up&&> &&
+ is_convertible_v<_Up&&, _Tp>;
+ }
+
+ template <class _Up>
+ static constexpr bool __enable_explicit() {
+ return is_constructible_v<_Tp, _Up&&> &&
+ !is_convertible_v<_Up&&, _Tp>;
+ }
+ };
+ template <class _Up>
+ using _CheckOptionalArgsCtor = conditional_t<
+ !is_same_v<decay_t<_Up>, in_place_t> &&
+ !is_same_v<decay_t<_Up>, optional>,
+ _CheckOptionalArgsConstructor,
+ __check_tuple_constructor_fail
+ >;
+ template <class _QualUp>
+ struct _CheckOptionalLikeConstructor {
+ template <class _Up, class _Opt = optional<_Up>>
+ using __check_constructible_from_opt = __lazy_or<
+ is_constructible<_Tp, _Opt&>,
+ is_constructible<_Tp, _Opt const&>,
+ is_constructible<_Tp, _Opt&&>,
+ is_constructible<_Tp, _Opt const&&>,
+ is_convertible<_Opt&, _Tp>,
+ is_convertible<_Opt const&, _Tp>,
+ is_convertible<_Opt&&, _Tp>,
+ is_convertible<_Opt const&&, _Tp>
+ >;
+ template <class _Up, class _Opt = optional<_Up>>
+ using __check_assignable_from_opt = __lazy_or<
+ is_assignable<_Tp&, _Opt&>,
+ is_assignable<_Tp&, _Opt const&>,
+ is_assignable<_Tp&, _Opt&&>,
+ is_assignable<_Tp&, _Opt const&&>
+ >;
+ template <class _Up, class _QUp = _QualUp>
+ static constexpr bool __enable_implicit() {
+ return is_convertible<_QUp, _Tp>::value &&
+ !__check_constructible_from_opt<_Up>::value;
+ }
+ template <class _Up, class _QUp = _QualUp>
+ static constexpr bool __enable_explicit() {
+ return !is_convertible<_QUp, _Tp>::value &&
+ !__check_constructible_from_opt<_Up>::value;
+ }
+ template <class _Up, class _QUp = _QualUp>
+ static constexpr bool __enable_assign() {
+ // Construction and assignability of _Qup to _Tp has already been
+ // checked.
+ return !__check_constructible_from_opt<_Up>::value &&
+ !__check_assignable_from_opt<_Up>::value;
+ }
+ };
+
+ template <class _Up, class _QualUp>
+ using _CheckOptionalLikeCtor = conditional_t<
+ __lazy_and<
+ __lazy_not<is_same<_Up, _Tp>>,
+ is_constructible<_Tp, _QualUp>
+ >::value,
+ _CheckOptionalLikeConstructor<_QualUp>,
+ __check_tuple_constructor_fail
+ >;
+ template <class _Up, class _QualUp>
+ using _CheckOptionalLikeAssign = conditional_t<
+ __lazy_and<
+ __lazy_not<is_same<_Up, _Tp>>,
+ is_constructible<_Tp, _QualUp>,
+ is_assignable<_Tp&, _QualUp>
+ >::value,
+ _CheckOptionalLikeConstructor<_QualUp>,
+ __check_tuple_constructor_fail
+ >;
+public:
+
+ _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {}
+ _LIBCPP_INLINE_VISIBILITY constexpr optional(const optional&) = default;
+ _LIBCPP_INLINE_VISIBILITY constexpr optional(optional&&) = default;
+ _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
+
+ template <class... _Args, class = enable_if_t<
+ is_constructible_v<value_type, _Args...>>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit optional(in_place_t, _Args&&... __args)
+ : __base(in_place, _VSTD::forward<_Args>(__args)...) {}
+
+ template <class _Up, class... _Args, class = enable_if_t<
+ is_constructible_v<value_type, initializer_list<_Up>&, _Args...>>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)
+ : __base(in_place, __il, _VSTD::forward<_Args>(__args)...) {}
+
+ template <class _Up = value_type, enable_if_t<
+ _CheckOptionalArgsCtor<_Up>::template __enable_implicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr optional(_Up&& __v)
+ : __base(in_place, _VSTD::forward<_Up>(__v)) {}
+
+ template <class _Up, enable_if_t<
+ _CheckOptionalArgsCtor<_Up>::template __enable_explicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit optional(_Up&& __v)
+ : __base(in_place, _VSTD::forward<_Up>(__v)) {}
+
+ // LWG2756: conditionally explicit conversion from const optional<_Up>&
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_implicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ optional(const optional<_Up>& __v)
+ {
+ this->__construct_from(__v);
+ }
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up const&>::template __enable_explicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ explicit optional(const optional<_Up>& __v)
+ {
+ this->__construct_from(__v);
+ }
+
+ // LWG2756: conditionally explicit conversion from optional<_Up>&&
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_implicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ optional(optional<_Up>&& __v)
+ {
+ this->__construct_from(_VSTD::move(__v));
+ }
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_explicit<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ explicit optional(optional<_Up>&& __v)
+ {
+ this->__construct_from(_VSTD::move(__v));
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ optional& operator=(nullopt_t) noexcept
+ {
+ reset();
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY optional& operator=(const optional&) = default;
+ _LIBCPP_INLINE_VISIBILITY optional& operator=(optional&&) = default;
+
+ // LWG2756
+ template <class _Up = value_type,
+ class = enable_if_t
+ <__lazy_and<
+ integral_constant<bool,
+ !is_same_v<decay_t<_Up>, optional> &&
+ !(is_same_v<_Up, value_type> && is_scalar_v<value_type>)
+ >,
+ is_constructible<value_type, _Up>,
+ is_assignable<value_type&, _Up>
+ >::value>
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ optional&
+ operator=(_Up&& __v)
+ {
+ if (this->has_value())
+ this->__get() = _VSTD::forward<_Up>(__v);
+ else
+ this->__construct(_VSTD::forward<_Up>(__v));
+ return *this;
+ }
+
+ // LWG2756
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeAssign<_Up, _Up const&>::template __enable_assign<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ optional&
+ operator=(const optional<_Up>& __v)
+ {
+ this->__assign_from(__v);
+ return *this;
+ }
+
+ // LWG2756
+ template <class _Up, enable_if_t<
+ _CheckOptionalLikeCtor<_Up, _Up &&>::template __enable_assign<_Up>()
+ , int> = 0>
+ _LIBCPP_INLINE_VISIBILITY
+ optional&
+ operator=(optional<_Up>&& __v)
+ {
+ this->__assign_from(_VSTD::move(__v));
+ return *this;
+ }
+
+ template <class... _Args,
+ class = enable_if_t
+ <
+ is_constructible_v<value_type, _Args...>
+ >
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ _Tp &
+ emplace(_Args&&... __args)
+ {
+ reset();
+ this->__construct(_VSTD::forward<_Args>(__args)...);
+ return this->__get();
+ }
+
+ template <class _Up, class... _Args,
+ class = enable_if_t
+ <
+ is_constructible_v<value_type, initializer_list<_Up>&, _Args...>
+ >
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ _Tp &
+ emplace(initializer_list<_Up> __il, _Args&&... __args)
+ {
+ reset();
+ this->__construct(__il, _VSTD::forward<_Args>(__args)...);
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ void swap(optional& __opt)
+ noexcept(is_nothrow_move_constructible_v<value_type> &&
+ is_nothrow_swappable_v<value_type>)
+ {
+ if (this->has_value() == __opt.has_value())
+ {
+ using _VSTD::swap;
+ if (this->has_value())
+ swap(this->__get(), __opt.__get());
+ }
+ else
+ {
+ if (this->has_value())
+ {
+ __opt.__construct(_VSTD::move(this->__get()));
+ reset();
+ }
+ else
+ {
+ this->__construct(_VSTD::move(__opt.__get()));
+ __opt.reset();
+ }
+ }
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ add_pointer_t<value_type const>
+ operator->() const
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+ return _VSTD::addressof(this->__get());
+#else
+ return __operator_arrow(__has_operator_addressof<value_type>{}, this->__get());
+#endif
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ add_pointer_t<value_type>
+ operator->()
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator-> called for disengaged value");
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+ return _VSTD::addressof(this->__get());
+#else
+ return __operator_arrow(__has_operator_addressof<value_type>{}, this->__get());
+#endif
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ const value_type&
+ operator*() const&
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ value_type&
+ operator*() &
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ value_type&&
+ operator*() &&
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ return _VSTD::move(this->__get());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr
+ const value_type&&
+ operator*() const&&
+ {
+ _LIBCPP_ASSERT(this->has_value(), "optional operator* called for disengaged value");
+ return _VSTD::move(this->__get());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr explicit operator bool() const noexcept { return has_value(); }
+
+ using __base::has_value;
+ using __base::__get;
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type const& value() const&
+ {
+ if (!this->has_value())
+ __throw_bad_optional_access();
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type& value() &
+ {
+ if (!this->has_value())
+ __throw_bad_optional_access();
+ return this->__get();
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type&& value() &&
+ {
+ if (!this->has_value())
+ __throw_bad_optional_access();
+ return _VSTD::move(this->__get());
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type const&& value() const&&
+ {
+ if (!this->has_value())
+ __throw_bad_optional_access();
+ return _VSTD::move(this->__get());
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type value_or(_Up&& __v) const&
+ {
+ static_assert(is_copy_constructible_v<value_type>,
+ "optional<T>::value_or: T must be copy constructible");
+ static_assert(is_convertible_v<_Up, value_type>,
+ "optional<T>::value_or: U must be convertible to T");
+ return this->has_value() ? this->__get() :
+ static_cast<value_type>(_VSTD::forward<_Up>(__v));
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ value_type value_or(_Up&& __v) &&
+ {
+ static_assert(is_move_constructible_v<value_type>,
+ "optional<T>::value_or: T must be move constructible");
+ static_assert(is_convertible_v<_Up, value_type>,
+ "optional<T>::value_or: U must be convertible to T");
+ return this->has_value() ? _VSTD::move(this->__get()) :
+ static_cast<value_type>(_VSTD::forward<_Up>(__v));
+ }
+
+ using __base::reset;
+
+private:
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static _Up*
+ __operator_arrow(true_type, _Up& __x)
+ {
+ return _VSTD::addressof(__x);
+ }
+
+ template <class _Up>
+ _LIBCPP_INLINE_VISIBILITY
+ static constexpr _Up*
+ __operator_arrow(false_type, _Up& __x)
+ {
+ return &__x;
+ }
+};
+
+// Comparisons between optionals
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator==(const optional<_Tp>& __x, const optional<_Up>& __y)
+{
+ if (static_cast<bool>(__x) != static_cast<bool>(__y))
+ return false;
+ if (!static_cast<bool>(__x))
+ return true;
+ return *__x == *__y;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator!=(const optional<_Tp>& __x, const optional<_Up>& __y)
+{
+ if (static_cast<bool>(__x) != static_cast<bool>(__y))
+ return true;
+ if (!static_cast<bool>(__x))
+ return false;
+ return *__x != *__y;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator<(const optional<_Tp>& __x, const optional<_Up>& __y)
+{
+ if (!static_cast<bool>(__y))
+ return false;
+ if (!static_cast<bool>(__x))
+ return true;
+ return *__x < *__y;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator>(const optional<_Tp>& __x, const optional<_Up>& __y)
+{
+ if (!static_cast<bool>(__x))
+ return false;
+ if (!static_cast<bool>(__y))
+ return true;
+ return *__x > *__y;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator<=(const optional<_Tp>& __x, const optional<_Up>& __y)
+{
+ if (!static_cast<bool>(__x))
+ return true;
+ if (!static_cast<bool>(__y))
+ return false;
+ return *__x <= *__y;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator>=(const optional<_Tp>& __x, const optional<_Up>& __y)
+{
+ if (!static_cast<bool>(__y))
+ return true;
+ if (!static_cast<bool>(__x))
+ return false;
+ return *__x >= *__y;
+}
+
+// Comparisons with nullopt
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator==(const optional<_Tp>& __x, nullopt_t) noexcept
+{
+ return !static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator==(nullopt_t, const optional<_Tp>& __x) noexcept
+{
+ return !static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator!=(const optional<_Tp>& __x, nullopt_t) noexcept
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator!=(nullopt_t, const optional<_Tp>& __x) noexcept
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator<(const optional<_Tp>&, nullopt_t) noexcept
+{
+ return false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator<(nullopt_t, const optional<_Tp>& __x) noexcept
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator<=(const optional<_Tp>& __x, nullopt_t) noexcept
+{
+ return !static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator<=(nullopt_t, const optional<_Tp>&) noexcept
+{
+ return true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator>(const optional<_Tp>& __x, nullopt_t) noexcept
+{
+ return static_cast<bool>(__x);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator>(nullopt_t, const optional<_Tp>&) noexcept
+{
+ return false;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator>=(const optional<_Tp>&, nullopt_t) noexcept
+{
+ return true;
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+bool
+operator>=(nullopt_t, const optional<_Tp>& __x) noexcept
+{
+ return !static_cast<bool>(__x);
+}
+
+// Comparisons with T
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator==(const optional<_Tp>& __x, const _Up& __v)
+{
+ return static_cast<bool>(__x) ? *__x == __v : false;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator==(const _Tp& __v, const optional<_Up>& __x)
+{
+ return static_cast<bool>(__x) ? __v == *__x : false;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator!=(const optional<_Tp>& __x, const _Up& __v)
+{
+ return static_cast<bool>(__x) ? *__x != __v : true;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator!=(const _Tp& __v, const optional<_Up>& __x)
+{
+ return static_cast<bool>(__x) ? __v != *__x : true;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator<(const optional<_Tp>& __x, const _Up& __v)
+{
+ return static_cast<bool>(__x) ? *__x < __v : true;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator<(const _Tp& __v, const optional<_Up>& __x)
+{
+ return static_cast<bool>(__x) ? __v < *__x : false;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator<=(const optional<_Tp>& __x, const _Up& __v)
+{
+ return static_cast<bool>(__x) ? *__x <= __v : true;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator<=(const _Tp& __v, const optional<_Up>& __x)
+{
+ return static_cast<bool>(__x) ? __v <= *__x : false;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator>(const optional<_Tp>& __x, const _Up& __v)
+{
+ return static_cast<bool>(__x) ? *__x > __v : false;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator>(const _Tp& __v, const optional<_Up>& __x)
+{
+ return static_cast<bool>(__x) ? __v > *__x : true;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator>=(const optional<_Tp>& __x, const _Up& __v)
+{
+ return static_cast<bool>(__x) ? *__x >= __v : false;
+}
+
+template <class _Tp, class _Up>
+_LIBCPP_INLINE_VISIBILITY constexpr
+enable_if_t<
+ is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
+ _VSTD::declval<const _Up&>()), bool>,
+ bool
+>
+operator>=(const _Tp& __v, const optional<_Up>& __x)
+{
+ return static_cast<bool>(__x) ? __v >= *__x : true;
+}
+
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY
+enable_if_t<
+ is_move_constructible_v<_Tp> && is_swappable_v<_Tp>,
+ void
+>
+swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y)))
+{
+ __x.swap(__y);
+}
+
+template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY constexpr
+optional<decay_t<_Tp>> make_optional(_Tp&& __v)
+{
+ return optional<decay_t<_Tp>>(_VSTD::forward<_Tp>(__v));
+}
+
+template <class _Tp, class... _Args>
+_LIBCPP_INLINE_VISIBILITY constexpr
+optional<_Tp> make_optional(_Args&&... __args)
+{
+ return optional<_Tp>(in_place, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _Tp, class _Up, class... _Args>
+_LIBCPP_INLINE_VISIBILITY constexpr
+optional<_Tp> make_optional(initializer_list<_Up> __il, _Args&&... __args)
+{
+ return optional<_Tp>(in_place, __il, _VSTD::forward<_Args>(__args)...);
+}
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS hash<
+ __enable_hash_helper<optional<_Tp>, remove_const_t<_Tp>>
+>
+{
+ typedef optional<_Tp> argument_type;
+ typedef size_t result_type;
+
+ _LIBCPP_INLINE_VISIBILITY
+ result_type operator()(const argument_type& __opt) const
+ {
+ return static_cast<bool>(__opt) ? hash<remove_const_t<_Tp>>()(*__opt) : 0;
+ }
+};
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STD_VER > 14
+
+#endif // _LIBCPP_OPTIONAL
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/ostream b/chromium/buildtools/third_party/libc++/trunk/include/ostream
index 01157b2377d..9bf8d3cdcfb 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/ostream
+++ b/chromium/buildtools/third_party/libc++/trunk/include/ostream
@@ -148,7 +148,7 @@ template <class charT, class traits, class T>
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_ostream
+class _LIBCPP_TEMPLATE_VIS basic_ostream
: virtual public basic_ios<_CharT, _Traits>
{
public:
@@ -160,22 +160,24 @@ public:
typedef typename traits_type::off_type off_type;
// 27.7.2.2 Constructor/destructor:
- explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ explicit basic_ostream(basic_streambuf<char_type, traits_type>* __sb)
+ { this->init(__sb); }
virtual ~basic_ostream();
protected:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream(basic_ostream&& __rhs);
-#endif
// 27.7.2.3 Assign/swap
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream& operator=(basic_ostream&& __rhs);
#endif
- void swap(basic_ostream& __rhs);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void swap(basic_ostream& __rhs)
+ { basic_ios<char_type, traits_type>::swap(__rhs); }
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
basic_ostream (const basic_ostream& __rhs) = delete;
basic_ostream& operator=(const basic_ostream& __rhs) = delete;
#else
@@ -185,13 +187,22 @@ protected:
public:
// 27.7.2.4 Prefix/suffix:
- class _LIBCPP_TYPE_VIS_ONLY sentry;
+ class _LIBCPP_TEMPLATE_VIS sentry;
// 27.7.2.6 Formatted output:
- basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&))
+ { return __pf(*this); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
basic_ostream& operator<<(basic_ios<char_type, traits_type>&
- (*__pf)(basic_ios<char_type,traits_type>&));
- basic_ostream& operator<<(ios_base& (*__pf)(ios_base&));
+ (*__pf)(basic_ios<char_type,traits_type>&))
+ { __pf(*this); return *this; }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_ostream& operator<<(ios_base& (*__pf)(ios_base&))
+ { __pf(*this); return *this; }
+
basic_ostream& operator<<(bool __n);
basic_ostream& operator<<(short __n);
basic_ostream& operator<<(unsigned short __n);
@@ -213,8 +224,11 @@ public:
basic_ostream& flush();
// 27.7.2.5 seeks:
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
pos_type tellp();
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
basic_ostream& seekp(pos_type __pos);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
basic_ostream& seekp(off_type __off, ios_base::seekdir __dir);
protected:
@@ -223,7 +237,7 @@ protected:
};
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_ostream<_CharT, _Traits>::sentry
+class _LIBCPP_TEMPLATE_VIS basic_ostream<_CharT, _Traits>::sentry
{
bool __ok_;
basic_ostream<_CharT, _Traits>& __os_;
@@ -274,24 +288,15 @@ basic_ostream<_CharT, _Traits>::sentry::~sentry()
}
}
-template <class _CharT, class _Traits>
-inline
-basic_ostream<_CharT, _Traits>::basic_ostream(basic_streambuf<char_type, traits_type>* __sb)
-{
- this->init(__sb);
-}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
-inline
basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs)
{
this->move(__rhs);
}
template <class _CharT, class _Traits>
-inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs)
{
@@ -299,7 +304,7 @@ basic_ostream<_CharT, _Traits>::operator=(basic_ostream&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>::~basic_ostream()
@@ -307,41 +312,6 @@ basic_ostream<_CharT, _Traits>::~basic_ostream()
}
template <class _CharT, class _Traits>
-inline
-void
-basic_ostream<_CharT, _Traits>::swap(basic_ostream& __rhs)
-{
- basic_ios<char_type, traits_type>::swap(__rhs);
-}
-
-template <class _CharT, class _Traits>
-inline
-basic_ostream<_CharT, _Traits>&
-basic_ostream<_CharT, _Traits>::operator<<(basic_ostream& (*__pf)(basic_ostream&))
-{
- return __pf(*this);
-}
-
-template <class _CharT, class _Traits>
-inline
-basic_ostream<_CharT, _Traits>&
-basic_ostream<_CharT, _Traits>::operator<<(basic_ios<char_type, traits_type>&
- (*__pf)(basic_ios<char_type,traits_type>&))
-{
- __pf(*this);
- return *this;
-}
-
-template <class _CharT, class _Traits>
-inline
-basic_ostream<_CharT, _Traits>&
-basic_ostream<_CharT, _Traits>::operator<<(ios_base& (*__pf)(ios_base&))
-{
- __pf(*this);
- return *this;
-}
-
-template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(basic_streambuf<char_type, traits_type>* __sb)
{
@@ -989,7 +959,6 @@ basic_ostream<_CharT, _Traits>::flush()
}
template <class _CharT, class _Traits>
-inline
typename basic_ostream<_CharT, _Traits>::pos_type
basic_ostream<_CharT, _Traits>::tellp()
{
@@ -999,7 +968,6 @@ basic_ostream<_CharT, _Traits>::tellp()
}
template <class _CharT, class _Traits>
-inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
{
@@ -1013,7 +981,6 @@ basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
}
template <class _CharT, class _Traits>
-inline
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
{
@@ -1027,7 +994,7 @@ basic_ostream<_CharT, _Traits>::seekp(off_type __off, ios_base::seekdir __dir)
}
template <class _CharT, class _Traits>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
endl(basic_ostream<_CharT, _Traits>& __os)
{
@@ -1037,7 +1004,7 @@ endl(basic_ostream<_CharT, _Traits>& __os)
}
template <class _CharT, class _Traits>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
ends(basic_ostream<_CharT, _Traits>& __os)
{
@@ -1046,7 +1013,7 @@ ends(basic_ostream<_CharT, _Traits>& __os)
}
template <class _CharT, class _Traits>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
flush(basic_ostream<_CharT, _Traits>& __os)
{
@@ -1054,10 +1021,10 @@ flush(basic_ostream<_CharT, _Traits>& __os)
return __os;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Stream, class _Tp>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
!is_lvalue_reference<_Stream>::value &&
@@ -1070,7 +1037,7 @@ operator<<(_Stream&& __os, const _Tp& __x)
return _VSTD::move(__os);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template<class _CharT, class _Traits, class _Allocator>
basic_ostream<_CharT, _Traits>&
@@ -1080,8 +1047,16 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
return _VSTD::__put_character_sequence(__os, __str.data(), __str.size());
}
+template<class _CharT, class _Traits>
+basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os,
+ const basic_string_view<_CharT, _Traits> __sv)
+{
+ return _VSTD::__put_character_sequence(__os, __sv.data(), __sv.size());
+}
+
template <class _CharT, class _Traits>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
{
@@ -1089,7 +1064,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __ec)
}
template<class _CharT, class _Traits, class _Yp>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
{
@@ -1105,8 +1080,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
}
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ostream<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ostream<wchar_t>)
+#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
+#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/queue b/chromium/buildtools/third_party/libc++/trunk/include/queue
index 6f49c87acdc..feaae892046 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/queue
+++ b/chromium/buildtools/third_party/libc++/trunk/include/queue
@@ -63,10 +63,10 @@ public:
void push(const value_type& v);
void push(value_type&& v);
- template <class... Args> void emplace(Args&&... args);
+ template <class... Args> reference emplace(Args&&... args); // reference in C++17
void pop();
- void swap(queue& q) noexcept(noexcept(swap(c, q.c)));
+ void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>)
};
template <class T, class Container>
@@ -153,7 +153,8 @@ public:
void pop();
void swap(priority_queue& q)
- noexcept(noexcept(swap(c, q.c)) && noexcept(swap(comp.q.comp)));
+ noexcept(is_nothrow_swappable_v<Container> &&
+ is_nothrow_swappable_v<Comp>)
};
template <class T, class Container, class Compare>
@@ -177,7 +178,7 @@ template <class T, class Container, class Compare>
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TYPE_VIS_ONLY queue;
+template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TEMPLATE_VIS queue;
template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
@@ -190,7 +191,7 @@ bool
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
template <class _Tp, class _Container /*= deque<_Tp>*/>
-class _LIBCPP_TYPE_VIS_ONLY queue
+class _LIBCPP_TEMPLATE_VIS queue
{
public:
typedef _Container container_type;
@@ -198,6 +199,7 @@ public:
typedef typename container_type::reference reference;
typedef typename container_type::const_reference const_reference;
typedef typename container_type::size_type size_type;
+ static_assert((is_same<_Tp, value_type>::value), "" );
protected:
container_type c;
@@ -211,29 +213,27 @@ public:
_LIBCPP_INLINE_VISIBILITY
queue(const queue& __q) : c(__q.c) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ queue& operator=(const queue& __q) {c = __q.c; return *this;}
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
queue(queue&& __q)
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
: c(_VSTD::move(__q.c)) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
- _LIBCPP_INLINE_VISIBILITY
- queue& operator=(const queue& __q) {c = __q.c; return *this;}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
queue& operator=(queue&& __q)
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
{c = _VSTD::move(__q.c); return *this;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit queue(const container_type& __c) : c(__c) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit queue(const _Alloc& __a,
@@ -252,7 +252,7 @@ public:
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0)
: c(__c, __a) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
queue(container_type&& __c, const _Alloc& __a,
@@ -266,7 +266,7 @@ public:
_Alloc>::value>::type* = 0)
: c(_VSTD::move(__q.c), __a) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
bool empty() const {return c.empty();}
@@ -284,16 +284,19 @@ public:
_LIBCPP_INLINE_VISIBILITY
void push(const value_type& __v) {c.push_back(__v);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- void emplace(_Args&&... __args)
- {c.emplace_back(_VSTD::forward<_Args>(__args)...);}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_STD_VER > 14
+ reference emplace(_Args&&... __args)
+ { return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#else
+ void emplace(_Args&&... __args)
+ { c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#endif
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void pop() {c.pop_front();}
@@ -368,7 +371,10 @@ operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
-void
+typename enable_if<
+ __is_swappable<_Container>::value,
+ void
+>::type
swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
{
@@ -376,14 +382,14 @@ swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
}
template <class _Tp, class _Container, class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<queue<_Tp, _Container>, _Alloc>
+struct _LIBCPP_TEMPLATE_VIS uses_allocator<queue<_Tp, _Container>, _Alloc>
: public uses_allocator<_Container, _Alloc>
{
};
template <class _Tp, class _Container = vector<_Tp>,
class _Compare = less<typename _Container::value_type> >
-class _LIBCPP_TYPE_VIS_ONLY priority_queue
+class _LIBCPP_TEMPLATE_VIS priority_queue
{
public:
typedef _Container container_type;
@@ -392,6 +398,7 @@ public:
typedef typename container_type::reference reference;
typedef typename container_type::const_reference const_reference;
typedef typename container_type::size_type size_type;
+ static_assert((is_same<_Tp, value_type>::value), "" );
protected:
container_type c;
@@ -407,72 +414,81 @@ public:
_LIBCPP_INLINE_VISIBILITY
priority_queue(const priority_queue& __q) : c(__q.c), comp(__q.comp) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ priority_queue& operator=(const priority_queue& __q)
+ {c = __q.c; comp = __q.comp; return *this;}
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
priority_queue(priority_queue&& __q)
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
is_nothrow_move_constructible<value_compare>::value)
: c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
- priority_queue& operator=(const priority_queue& __q)
- {c = __q.c; comp = __q.comp; return *this;}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
priority_queue& operator=(priority_queue&& __q)
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
is_nothrow_move_assignable<value_compare>::value)
{c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit priority_queue(const value_compare& __comp)
: c(), comp(__comp) {}
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(const value_compare& __comp, const container_type& __c);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
explicit priority_queue(const value_compare& __comp, container_type&& __c);
#endif
template <class _InputIter>
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp = value_compare());
template <class _InputIter>
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp, const container_type& __c);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _InputIter>
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp, container_type&& __c);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
explicit priority_queue(const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0);
template <class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(const value_compare& __comp, const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0);
template <class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(const value_compare& __comp, const container_type& __c,
const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0);
template <class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(const priority_queue& __q, const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(const value_compare& __comp, container_type&& __c,
const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0);
template <class _Alloc>
+ _LIBCPP_INLINE_VISIBILITY
priority_queue(priority_queue&& __q, const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
bool empty() const {return c.empty();}
@@ -481,22 +497,26 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_reference top() const {return c.front();}
+ _LIBCPP_INLINE_VISIBILITY
void push(const value_type& __v);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
void push(value_type&& __v);
-#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class... _Args> void emplace(_Args&&... __args);
-#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ void emplace(_Args&&... __args);
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
void pop();
+ _LIBCPP_INLINE_VISIBILITY
void swap(priority_queue& __q)
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
__is_nothrow_swappable<value_compare>::value);
};
template <class _Tp, class _Container, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp,
const container_type& __c)
: c(__c),
@@ -505,10 +525,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
container_type&& __c)
: c(_VSTD::move(__c)),
@@ -517,11 +537,11 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp)
: c(__f, __l),
@@ -532,7 +552,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
template <class _Tp, class _Container, class _Compare>
template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp,
const container_type& __c)
@@ -543,11 +563,11 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
const value_compare& __comp,
container_type&& __c)
@@ -558,11 +578,11 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type*)
@@ -572,7 +592,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
@@ -584,7 +604,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
const container_type& __c,
const _Alloc& __a,
@@ -598,7 +618,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q,
const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
@@ -609,11 +629,11 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue&
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
container_type&& __c,
const _Alloc& __a,
@@ -627,7 +647,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _
template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
const _Alloc& __a,
typename enable_if<uses_allocator<container_type,
@@ -638,10 +658,10 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
_VSTD::make_heap(c.begin(), c.end(), comp);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
{
@@ -649,10 +669,10 @@ priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
_VSTD::push_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
{
@@ -660,11 +680,9 @@ priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
_VSTD::push_heap(c.begin(), c.end(), comp);
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Container, class _Compare>
template <class... _Args>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
{
@@ -672,11 +690,10 @@ priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
_VSTD::push_heap(c.begin(), c.end(), comp);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp, class _Container, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
priority_queue<_Tp, _Container, _Compare>::pop()
{
@@ -685,7 +702,7 @@ priority_queue<_Tp, _Container, _Compare>::pop()
}
template <class _Tp, class _Container, class _Compare>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
_NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
@@ -698,7 +715,11 @@ priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
template <class _Tp, class _Container, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
-void
+typename enable_if<
+ __is_swappable<_Container>::value
+ && __is_swappable<_Compare>::value,
+ void
+>::type
swap(priority_queue<_Tp, _Container, _Compare>& __x,
priority_queue<_Tp, _Container, _Compare>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
@@ -707,7 +728,7 @@ swap(priority_queue<_Tp, _Container, _Compare>& __x,
}
template <class _Tp, class _Container, class _Compare, class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
+struct _LIBCPP_TEMPLATE_VIS uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
: public uses_allocator<_Container, _Alloc>
{
};
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/random b/chromium/buildtools/third_party/libc++/trunk/include/random
index 794bf7b3fd1..6c36e8c01ae 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/random
+++ b/chromium/buildtools/third_party/libc++/trunk/include/random
@@ -1813,7 +1813,7 @@ struct __lce_ta<__a, __c, __m, (unsigned short)(~0), __b>
};
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-class _LIBCPP_TYPE_VIS_ONLY linear_congruential_engine;
+class _LIBCPP_TEMPLATE_VIS linear_congruential_engine;
template <class _CharT, class _Traits,
class _Up, _Up _Ap, _Up _Cp, _Up _Np>
@@ -1829,7 +1829,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x);
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-class _LIBCPP_TYPE_VIS_ONLY linear_congruential_engine
+class _LIBCPP_TEMPLATE_VIS linear_congruential_engine
{
public:
// types
@@ -2011,7 +2011,7 @@ typedef minstd_rand default_random_engine;
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-class _LIBCPP_TYPE_VIS_ONLY mersenne_twister_engine;
+class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine;
template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
_UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
@@ -2053,7 +2053,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
-class _LIBCPP_TYPE_VIS_ONLY mersenne_twister_engine
+class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine
{
public:
// types
@@ -2499,7 +2499,7 @@ typedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,
// subtract_with_carry_engine
template<class _UIntType, size_t __w, size_t __s, size_t __r>
-class _LIBCPP_TYPE_VIS_ONLY subtract_with_carry_engine;
+class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine;
template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
bool
@@ -2527,7 +2527,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x);
template<class _UIntType, size_t __w, size_t __s, size_t __r>
-class _LIBCPP_TYPE_VIS_ONLY subtract_with_carry_engine
+class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine
{
public:
// types
@@ -2810,13 +2810,14 @@ typedef subtract_with_carry_engine<uint_fast64_t, 48, 5, 12> ranlux48_base;
// discard_block_engine
template<class _Engine, size_t __p, size_t __r>
-class _LIBCPP_TYPE_VIS_ONLY discard_block_engine
+class _LIBCPP_TEMPLATE_VIS discard_block_engine
{
_Engine __e_;
int __n_;
static_assert( 0 < __r, "discard_block_engine invalid parameters");
static_assert(__r <= __p, "discard_block_engine invalid parameters");
+ static_assert(__r <= INT_MAX, "discard_block_engine invalid parameters");
public:
// types
typedef typename _Engine::result_type result_type;
@@ -2825,7 +2826,7 @@ public:
static _LIBCPP_CONSTEXPR const size_t block_size = __p;
static _LIBCPP_CONSTEXPR const size_t used_block = __r;
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
static const result_type _Min = _Engine::_Min;
static const result_type _Max = _Engine::_Max;
#else
@@ -2844,11 +2845,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit discard_block_engine(const _Engine& __e)
: __e_(__e), __n_(0) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit discard_block_engine(_Engine&& __e)
: __e_(_VSTD::move(__e)), __n_(0) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
template<class _Sseq>
@@ -2918,7 +2919,7 @@ template<class _Engine, size_t __p, size_t __r>
typename discard_block_engine<_Engine, __p, __r>::result_type
discard_block_engine<_Engine, __p, __r>::operator()()
{
- if (__n_ >= __r)
+ if (__n_ >= static_cast<int>(__r))
{
__e_.discard(__p - __r);
__n_ = 0;
@@ -2983,7 +2984,7 @@ typedef discard_block_engine<ranlux48_base, 389, 11> ranlux48;
// independent_bits_engine
template<class _Engine, size_t __w, class _UIntType>
-class _LIBCPP_TYPE_VIS_ONLY independent_bits_engine
+class _LIBCPP_TEMPLATE_VIS independent_bits_engine
{
template <class _UI, _UI _R0, size_t _Wp, size_t _Mp>
class __get_n
@@ -3013,7 +3014,7 @@ private:
result_type,
_Engine_result_type
>::type _Working_result_type;
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
+ _Working_result_type(1);
#else
@@ -3054,11 +3055,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit independent_bits_engine(const _Engine& __e)
: __e_(__e) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit independent_bits_engine(_Engine&& __e)
: __e_(_VSTD::move(__e)) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
template<class _Sseq>
@@ -3247,7 +3248,7 @@ public:
};
template<class _Engine, size_t __k>
-class _LIBCPP_TYPE_VIS_ONLY shuffle_order_engine
+class _LIBCPP_TEMPLATE_VIS shuffle_order_engine
{
static_assert(0 < __k, "shuffle_order_engine invalid parameters");
public:
@@ -3263,7 +3264,7 @@ public:
// engine characteristics
static _LIBCPP_CONSTEXPR const size_t table_size = __k;
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
static const result_type _Min = _Engine::_Min;
static const result_type _Max = _Engine::_Max;
#else
@@ -3284,11 +3285,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit shuffle_order_engine(const _Engine& __e)
: __e_(__e) {__init();}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit shuffle_order_engine(_Engine&& __e)
: __e_(_VSTD::move(__e)) {__init();}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
template<class _Sseq>
@@ -3510,7 +3511,7 @@ private:
// seed_seq
-class _LIBCPP_TYPE_VIS_ONLY seed_seq
+class _LIBCPP_TEMPLATE_VIS seed_seq
{
public:
// types
@@ -3525,11 +3526,11 @@ public:
// constructors
_LIBCPP_INLINE_VISIBILITY
seed_seq() _NOEXCEPT {}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _Tp>
_LIBCPP_INLINE_VISIBILITY
seed_seq(initializer_list<_Tp> __il) {init(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
@@ -3636,7 +3637,7 @@ generate_canonical(_URNG& __g)
{
const size_t _Dt = numeric_limits<_RealType>::digits;
const size_t __b = _Dt < __bits ? _Dt : __bits;
-#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+#ifdef _LIBCPP_CXX03_LANG
const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
#else
const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
@@ -3687,13 +3688,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// uniform_real_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY uniform_real_distribution
+class _LIBCPP_TEMPLATE_VIS uniform_real_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __a_;
result_type __b_;
@@ -3808,13 +3809,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// bernoulli_distribution
-class _LIBCPP_TYPE_VIS_ONLY bernoulli_distribution
+class _LIBCPP_TEMPLATE_VIS bernoulli_distribution
{
public:
// types
typedef bool result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
double __p_;
public:
@@ -3917,13 +3918,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x)
// binomial_distribution
template<class _IntType = int>
-class _LIBCPP_TYPE_VIS_ONLY binomial_distribution
+class _LIBCPP_TEMPLATE_VIS binomial_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __t_;
double __p_;
@@ -3996,16 +3997,30 @@ public:
{return !(__x == __y);}
};
+#ifndef _LIBCPP_MSVCRT
+extern "C" double lgamma_r(double, int *);
+#endif
+
+inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) {
+#if defined(_LIBCPP_MSVCRT)
+ return lgamma(__d);
+#else
+ int __sign;
+ return lgamma_r(__d, &__sign);
+#endif
+}
+
template<class _IntType>
-binomial_distribution<_IntType>::param_type::param_type(result_type __t, double __p)
+binomial_distribution<_IntType>::param_type::param_type(const result_type __t, const double __p)
: __t_(__t), __p_(__p)
{
if (0 < __p_ && __p_ < 1)
{
__r0_ = static_cast<result_type>((__t_ + 1) * __p_);
- __pr_ = _VSTD::exp(_VSTD::lgamma(__t_ + 1.) - _VSTD::lgamma(__r0_ + 1.) -
- _VSTD::lgamma(__t_ - __r0_ + 1.) + __r0_ * _VSTD::log(__p_) +
- (__t_ - __r0_) * _VSTD::log(1 - __p_));
+ __pr_ = _VSTD::exp(__libcpp_lgamma(__t_ + 1.) -
+ __libcpp_lgamma(__r0_ + 1.) -
+ __libcpp_lgamma(__t_ - __r0_ + 1.) + __r0_ * _VSTD::log(__p_) +
+ (__t_ - __r0_) * _VSTD::log(1 - __p_));
__odds_ratio_ = __p_ / (1 - __p_);
}
}
@@ -4085,13 +4100,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// exponential_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY exponential_distribution
+class _LIBCPP_TEMPLATE_VIS exponential_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __lambda_;
public:
@@ -4200,13 +4215,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// normal_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY normal_distribution
+class _LIBCPP_TEMPLATE_VIS normal_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __mean_;
result_type __stddev_;
@@ -4368,13 +4383,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// lognormal_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY lognormal_distribution
+class _LIBCPP_TEMPLATE_VIS lognormal_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
normal_distribution<result_type> __nd_;
public:
@@ -4493,13 +4508,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// poisson_distribution
template<class _IntType = int>
-class _LIBCPP_TYPE_VIS_ONLY poisson_distribution
+class _LIBCPP_TEMPLATE_VIS poisson_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
double __mean_;
double __s_;
@@ -4724,13 +4739,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// weibull_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY weibull_distribution
+class _LIBCPP_TEMPLATE_VIS weibull_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __a_;
result_type __b_;
@@ -4838,13 +4853,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
}
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY extreme_value_distribution
+class _LIBCPP_TEMPLATE_VIS extreme_value_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __a_;
result_type __b_;
@@ -4959,13 +4974,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// gamma_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY gamma_distribution
+class _LIBCPP_TEMPLATE_VIS gamma_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __alpha_;
result_type __beta_;
@@ -5131,13 +5146,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// negative_binomial_distribution
template<class _IntType = int>
-class _LIBCPP_TYPE_VIS_ONLY negative_binomial_distribution
+class _LIBCPP_TEMPLATE_VIS negative_binomial_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __k_;
double __p_;
@@ -5266,13 +5281,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// geometric_distribution
template<class _IntType = int>
-class _LIBCPP_TYPE_VIS_ONLY geometric_distribution
+class _LIBCPP_TEMPLATE_VIS geometric_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
double __p_;
public:
@@ -5368,13 +5383,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// chi_squared_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY chi_squared_distribution
+class _LIBCPP_TEMPLATE_VIS chi_squared_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __n_;
public:
@@ -5474,13 +5489,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// cauchy_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY cauchy_distribution
+class _LIBCPP_TEMPLATE_VIS cauchy_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __a_;
result_type __b_;
@@ -5597,13 +5612,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// fisher_f_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY fisher_f_distribution
+class _LIBCPP_TEMPLATE_VIS fisher_f_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __m_;
result_type __n_;
@@ -5719,13 +5734,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// student_t_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY student_t_distribution
+class _LIBCPP_TEMPLATE_VIS student_t_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
result_type __n_;
public:
@@ -5832,13 +5847,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// discrete_distribution
template<class _IntType = int>
-class _LIBCPP_TYPE_VIS_ONLY discrete_distribution
+class _LIBCPP_TEMPLATE_VIS discrete_distribution
{
public:
// types
typedef _IntType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
vector<double> __p_;
public:
@@ -5850,11 +5865,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
param_type(_InputIterator __f, _InputIterator __l)
: __p_(__f, __l) {__init();}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
param_type(initializer_list<double> __wl)
: __p_(__wl.begin(), __wl.end()) {__init();}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(size_t __nw, double __xmin, double __xmax,
_UnaryOperation __fw);
@@ -5897,11 +5912,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
discrete_distribution(_InputIterator __f, _InputIterator __l)
: __p_(__f, __l) {}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
discrete_distribution(initializer_list<double> __wl)
: __p_(__wl) {}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
_LIBCPP_INLINE_VISIBILITY
discrete_distribution(size_t __nw, double __xmin, double __xmax,
@@ -6060,13 +6075,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// piecewise_constant_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY piecewise_constant_distribution
+class _LIBCPP_TEMPLATE_VIS piecewise_constant_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
vector<result_type> __b_;
vector<result_type> __densities_;
@@ -6078,10 +6093,10 @@ public:
template<class _InputIteratorB, class _InputIteratorW>
param_type(_InputIteratorB __fB, _InputIteratorB __lB,
_InputIteratorW __fW);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(size_t __nw, result_type __xmin, result_type __xmax,
_UnaryOperation __fw);
@@ -6131,13 +6146,13 @@ public:
_InputIteratorW __fW)
: __p_(__fB, __lB, __fW) {}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
_LIBCPP_INLINE_VISIBILITY
piecewise_constant_distribution(initializer_list<result_type> __bl,
_UnaryOperation __fw)
: __p_(__bl, __fw) {}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
_LIBCPP_INLINE_VISIBILITY
@@ -6267,7 +6282,7 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(
}
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _RealType>
template<class _UnaryOperation>
@@ -6292,7 +6307,7 @@ piecewise_constant_distribution<_RealType>::param_type::param_type(
}
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _RealType>
template<class _UnaryOperation>
@@ -6383,13 +6398,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
// piecewise_linear_distribution
template<class _RealType = double>
-class _LIBCPP_TYPE_VIS_ONLY piecewise_linear_distribution
+class _LIBCPP_TEMPLATE_VIS piecewise_linear_distribution
{
public:
// types
typedef _RealType result_type;
- class _LIBCPP_TYPE_VIS_ONLY param_type
+ class _LIBCPP_TEMPLATE_VIS param_type
{
vector<result_type> __b_;
vector<result_type> __densities_;
@@ -6401,10 +6416,10 @@ public:
template<class _InputIteratorB, class _InputIteratorW>
param_type(_InputIteratorB __fB, _InputIteratorB __lB,
_InputIteratorW __fW);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
param_type(size_t __nw, result_type __xmin, result_type __xmax,
_UnaryOperation __fw);
@@ -6454,13 +6469,13 @@ public:
_InputIteratorW __fW)
: __p_(__fB, __lB, __fW) {}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
_LIBCPP_INLINE_VISIBILITY
piecewise_linear_distribution(initializer_list<result_type> __bl,
_UnaryOperation __fw)
: __p_(__bl, __fw) {}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _UnaryOperation>
_LIBCPP_INLINE_VISIBILITY
@@ -6594,7 +6609,7 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(
}
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template<class _RealType>
template<class _UnaryOperation>
@@ -6619,7 +6634,7 @@ piecewise_linear_distribution<_RealType>::param_type::param_type(
}
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template<class _RealType>
template<class _UnaryOperation>
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/ratio b/chromium/buildtools/third_party/libc++/trunk/include/ratio
index 8f708ce478d..fa893637d51 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/ratio
+++ b/chromium/buildtools/third_party/libc++/trunk/include/ratio
@@ -244,7 +244,7 @@ public:
};
template <intmax_t _Num, intmax_t _Den = 1>
-class _LIBCPP_TYPE_VIS_ONLY ratio
+class _LIBCPP_TEMPLATE_VIS ratio
{
static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
static_assert(_Den != 0, "ratio divide by 0");
@@ -300,18 +300,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_multiply
= typename __ratio_multiply<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_multiply
+struct _LIBCPP_TEMPLATE_VIS ratio_multiply
: public __ratio_multiply<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_divide
@@ -327,18 +327,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_divide
= typename __ratio_divide<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_divide
+struct _LIBCPP_TEMPLATE_VIS ratio_divide
: public __ratio_divide<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_add
@@ -362,18 +362,18 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_add
= typename __ratio_add<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_add
+struct _LIBCPP_TEMPLATE_VIS ratio_add
: public __ratio_add<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
struct __ratio_subtract
@@ -397,27 +397,27 @@ public:
>::type type;
};
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#ifndef _LIBCPP_CXX03_LANG
template <class _R1, class _R2> using ratio_subtract
= typename __ratio_subtract<_R1, _R2>::type;
-#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#else // _LIBCPP_CXX03_LANG
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_subtract
+struct _LIBCPP_TEMPLATE_VIS ratio_subtract
: public __ratio_subtract<_R1, _R2>::type {};
-#endif // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+#endif // _LIBCPP_CXX03_LANG
// ratio_equal
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_equal
+struct _LIBCPP_TEMPLATE_VIS ratio_equal
: public _LIBCPP_BOOL_CONSTANT((_R1::num == _R2::num && _R1::den == _R2::den)) {};
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_not_equal
+struct _LIBCPP_TEMPLATE_VIS ratio_not_equal
: public _LIBCPP_BOOL_CONSTANT((!ratio_equal<_R1, _R2>::value)) {};
// ratio_less
@@ -476,19 +476,19 @@ struct __ratio_less<_R1, _R2, -1LL, -1LL>
};
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_less
+struct _LIBCPP_TEMPLATE_VIS ratio_less
: public _LIBCPP_BOOL_CONSTANT((__ratio_less<_R1, _R2>::value)) {};
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_less_equal
+struct _LIBCPP_TEMPLATE_VIS ratio_less_equal
: public _LIBCPP_BOOL_CONSTANT((!ratio_less<_R2, _R1>::value)) {};
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_greater
+struct _LIBCPP_TEMPLATE_VIS ratio_greater
: public _LIBCPP_BOOL_CONSTANT((ratio_less<_R2, _R1>::value)) {};
template <class _R1, class _R2>
-struct _LIBCPP_TYPE_VIS_ONLY ratio_greater_equal
+struct _LIBCPP_TEMPLATE_VIS ratio_greater_equal
: public _LIBCPP_BOOL_CONSTANT((!ratio_less<_R1, _R2>::value)) {};
template <class _R1, class _R2>
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/regex b/chromium/buildtools/third_party/libc++/trunk/include/regex
index b9dac4765cd..0f49b95a656 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/regex
+++ b/chromium/buildtools/third_party/libc++/trunk/include/regex
@@ -127,6 +127,8 @@ class basic_regex
public:
// types:
typedef charT value_type;
+ typedef traits traits_type;
+ typedef typename traits::string_type string_type;
typedef regex_constants::syntax_option_type flag_type;
typedef typename traits::locale_type locale_type;
@@ -145,7 +147,7 @@ public:
// construct/copy/destroy:
basic_regex();
explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
- basic_regex(const charT* p, size_t len, flag_type f);
+ basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
basic_regex(const basic_regex&);
basic_regex(basic_regex&&) noexcept;
template <class ST, class SA>
@@ -762,7 +764,6 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
#include <memory>
#include <vector>
#include <deque>
-#include <cassert>
#include <__undef_min_max>
@@ -864,7 +865,8 @@ enum match_flag_type
format_sed = 1 << 8,
format_no_copy = 1 << 9,
format_first_only = 1 << 10,
- __no_update_pos = 1 << 11
+ __no_update_pos = 1 << 11,
+ __full_match = 1 << 12
};
inline _LIBCPP_INLINE_VISIBILITY
@@ -957,18 +959,18 @@ public:
};
template <regex_constants::error_type _Ev>
-_LIBCPP_ALWAYS_INLINE
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
void __throw_regex_error()
{
#ifndef _LIBCPP_NO_EXCEPTIONS
throw regex_error(_Ev);
#else
- assert(!"regex_error");
+ _VSTD::abort();
#endif
}
template <class _CharT>
-struct _LIBCPP_TYPE_VIS_ONLY regex_traits
+struct _LIBCPP_TEMPLATE_VIS regex_traits
{
public:
typedef _CharT char_type;
@@ -976,7 +978,12 @@ public:
typedef locale locale_type;
typedef ctype_base::mask char_class_type;
+#if defined(__mips__) && defined(__GLIBC__)
+ static const char_class_type __regex_word = static_cast<char_class_type>(_ISbit(15));
+#else
static const char_class_type __regex_word = 0x80;
+#endif
+
private:
locale __loc_;
const ctype<char_type>* __ct_;
@@ -1280,11 +1287,11 @@ regex_traits<_CharT>::__regex_traits_value(wchar_t __ch, int __radix) const
template <class _CharT> class __node;
-template <class _BidirectionalIterator> class _LIBCPP_TYPE_VIS_ONLY sub_match;
+template <class _BidirectionalIterator> class _LIBCPP_TEMPLATE_VIS sub_match;
template <class _BidirectionalIterator,
class _Allocator = allocator<sub_match<_BidirectionalIterator> > >
-class _LIBCPP_TYPE_VIS_ONLY match_results;
+class _LIBCPP_TEMPLATE_VIS match_results;
template <class _CharT>
struct __state
@@ -2465,11 +2472,13 @@ __exit:
template <class _CharT, class _Traits> class __lookahead;
template <class _CharT, class _Traits = regex_traits<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY basic_regex
+class _LIBCPP_TEMPLATE_VIS basic_regex
{
public:
// types:
typedef _CharT value_type;
+ typedef _Traits traits_type;
+ typedef typename _Traits::string_type string_type;
typedef regex_constants::syntax_option_type flag_type;
typedef typename _Traits::locale_type locale_type;
@@ -2510,7 +2519,7 @@ public:
__end_(0)
{__parse(__p, __p + __traits_.length(__p));}
_LIBCPP_INLINE_VISIBILITY
- basic_regex(const value_type* __p, size_t __len, flag_type __f)
+ basic_regex(const value_type* __p, size_t __len, flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
{__parse(__p, __p + __len);}
@@ -2530,14 +2539,14 @@ public:
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
{__parse(__first, __last);}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_regex(initializer_list<value_type> __il,
flag_type __f = regex_constants::ECMAScript)
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
__end_(0)
{__parse(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// ~basic_regex() = default;
@@ -2546,11 +2555,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_regex& operator=(const value_type* __p)
{return assign(__p);}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_regex& operator=(initializer_list<value_type> __il)
{return assign(__il);}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _ST, class _SA>
_LIBCPP_INLINE_VISIBILITY
basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
@@ -2560,7 +2569,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_regex& assign(const basic_regex& __that)
{return *this = __that;}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_regex& assign(basic_regex&& __that) _NOEXCEPT
{return *this = _VSTD::move(__that);}
@@ -2617,14 +2626,14 @@ public:
return assign(basic_regex(__first, __last, __f));
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_regex& assign(initializer_list<value_type> __il,
flag_type __f = regex_constants::ECMAScript)
{return assign(__il.begin(), __il.end(), __f);}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// const operations:
_LIBCPP_INLINE_VISIBILITY
@@ -2976,10 +2985,12 @@ __lookahead<_CharT, _Traits>::__exec(__state& __s) const
{
match_results<const _CharT*> __m;
__m.__init(1 + __exp_.mark_count(), __s.__current_, __s.__last_);
- bool __matched = __exp_.__match_at_start_ecma(__s.__current_, __s.__last_,
- __m,
- __s.__flags_ | regex_constants::match_continuous,
- __s.__at_first_ && __s.__current_ == __s.__first_);
+ bool __matched = __exp_.__match_at_start_ecma(
+ __s.__current_, __s.__last_,
+ __m,
+ (__s.__flags_ | regex_constants::match_continuous) &
+ ~regex_constants::__full_match,
+ __s.__at_first_ && __s.__current_ == __s.__first_);
if (__matched != __invert_)
{
__s.__do_ = __state::__accept_but_not_consume;
@@ -3946,7 +3957,6 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
if (__temp == __last)
__throw_regex_error<regex_constants::error_brack>();
// [__first, __temp) contains all text in [= ... =]
- typedef typename _Traits::string_type string_type;
string_type __collate_name =
__traits_.lookup_collatename(__first, __temp);
if (__collate_name.empty())
@@ -4265,6 +4275,9 @@ basic_regex<_CharT, _Traits>::__parse_atom_escape(_ForwardIterator __first,
if (__first != __last && *__first == '\\')
{
_ForwardIterator __t1 = _VSTD::next(__first);
+ if (__t1 == __last)
+ __throw_regex_error<regex_constants::error_escape>();
+
_ForwardIterator __t2 = __parse_decimal_escape(__t1, __last);
if (__t2 != __t1)
__first = __t2;
@@ -4300,7 +4313,8 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first,
else if ('1' <= *__first && *__first <= '9')
{
unsigned __v = *__first - '0';
- for (++__first; '0' <= *__first && *__first <= '9'; ++__first)
+ for (++__first;
+ __first != __last && '0' <= *__first && *__first <= '9'; ++__first)
__v = 10 * __v + *__first - '0';
if (__v > mark_count())
__throw_regex_error<regex_constants::error_backref>();
@@ -4750,7 +4764,7 @@ typedef basic_regex<wchar_t> wregex;
// sub_match
template <class _BidirectionalIterator>
-class _LIBCPP_TYPE_VIS_ONLY sub_match
+class _LIBCPP_TEMPLATE_VIS sub_match
: public pair<_BidirectionalIterator, _BidirectionalIterator>
{
public:
@@ -5173,7 +5187,7 @@ operator<<(basic_ostream<_CharT, _ST>& __os, const sub_match<_BiIter>& __m)
}
template <class _BidirectionalIterator, class _Allocator>
-class _LIBCPP_TYPE_VIS_ONLY match_results
+class _LIBCPP_TEMPLATE_VIS match_results
{
public:
typedef _Allocator allocator_type;
@@ -5247,15 +5261,15 @@ public:
// format:
template <class _OutputIter>
_OutputIter
- format(_OutputIter __out, const char_type* __fmt_first,
+ format(_OutputIter __output, const char_type* __fmt_first,
const char_type* __fmt_last,
regex_constants::match_flag_type __flags = regex_constants::format_default) const;
template <class _OutputIter, class _ST, class _SA>
_LIBCPP_INLINE_VISIBILITY
_OutputIter
- format(_OutputIter __out, const basic_string<char_type, _ST, _SA>& __fmt,
+ format(_OutputIter __output, const basic_string<char_type, _ST, _SA>& __fmt,
regex_constants::match_flag_type __flags = regex_constants::format_default) const
- {return format(__out, __fmt.data(), __fmt.data() + __fmt.size(), __flags);}
+ {return format(__output, __fmt.data(), __fmt.data() + __fmt.size(), __flags);}
template <class _ST, class _SA>
_LIBCPP_INLINE_VISIBILITY
basic_string<char_type, _ST, _SA>
@@ -5367,7 +5381,7 @@ match_results<_BidirectionalIterator, _Allocator>::__init(unsigned __s,
template <class _BidirectionalIterator, class _Allocator>
template <class _OutputIter>
_OutputIter
-match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
+match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output,
const char_type* __fmt_first, const char_type* __fmt_last,
regex_constants::match_flag_type __flags) const
{
@@ -5376,27 +5390,27 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
for (; __fmt_first != __fmt_last; ++__fmt_first)
{
if (*__fmt_first == '&')
- __out = _VSTD::copy(__matches_[0].first, __matches_[0].second,
- __out);
+ __output = _VSTD::copy(__matches_[0].first, __matches_[0].second,
+ __output);
else if (*__fmt_first == '\\' && __fmt_first + 1 != __fmt_last)
{
++__fmt_first;
if ('0' <= *__fmt_first && *__fmt_first <= '9')
{
size_t __i = *__fmt_first - '0';
- __out = _VSTD::copy(__matches_[__i].first,
- __matches_[__i].second, __out);
+ __output = _VSTD::copy((*this)[__i].first,
+ (*this)[__i].second, __output);
}
else
{
- *__out = *__fmt_first;
- ++__out;
+ *__output = *__fmt_first;
+ ++__output;
}
}
else
{
- *__out = *__fmt_first;
- ++__out;
+ *__output = *__fmt_first;
+ ++__output;
}
}
}
@@ -5409,21 +5423,21 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
switch (__fmt_first[1])
{
case '$':
- *__out = *++__fmt_first;
- ++__out;
+ *__output = *++__fmt_first;
+ ++__output;
break;
case '&':
++__fmt_first;
- __out = _VSTD::copy(__matches_[0].first, __matches_[0].second,
- __out);
+ __output = _VSTD::copy(__matches_[0].first, __matches_[0].second,
+ __output);
break;
case '`':
++__fmt_first;
- __out = _VSTD::copy(__prefix_.first, __prefix_.second, __out);
+ __output = _VSTD::copy(__prefix_.first, __prefix_.second, __output);
break;
case '\'':
++__fmt_first;
- __out = _VSTD::copy(__suffix_.first, __suffix_.second, __out);
+ __output = _VSTD::copy(__suffix_.first, __suffix_.second, __output);
break;
default:
if ('0' <= __fmt_first[1] && __fmt_first[1] <= '9')
@@ -5436,25 +5450,25 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __out,
++__fmt_first;
__i = 10 * __i + *__fmt_first - '0';
}
- __out = _VSTD::copy(__matches_[__i].first,
- __matches_[__i].second, __out);
+ __output = _VSTD::copy((*this)[__i].first,
+ (*this)[__i].second, __output);
}
else
{
- *__out = *__fmt_first;
- ++__out;
+ *__output = *__fmt_first;
+ ++__output;
}
break;
}
}
else
{
- *__out = *__fmt_first;
- ++__out;
+ *__output = *__fmt_first;
+ ++__output;
}
}
}
- return __out;
+ return __output;
}
template <class _BidirectionalIterator, class _Allocator>
@@ -5544,6 +5558,18 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
switch (__s.__do_)
{
case __state::__end_state:
+ if ((__flags & regex_constants::match_not_null) &&
+ __s.__current_ == __first)
+ {
+ __states.pop_back();
+ break;
+ }
+ if ((__flags & regex_constants::__full_match) &&
+ __s.__current_ != __last)
+ {
+ __states.pop_back();
+ break;
+ }
__m.__matches_[0].first = __first;
__m.__matches_[0].second = _VSTD::next(__first, __s.__current_ - __first);
__m.__matches_[0].matched = true;
@@ -5607,6 +5633,18 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
switch (__s.__do_)
{
case __state::__end_state:
+ if ((__flags & regex_constants::match_not_null) &&
+ __s.__current_ == __first)
+ {
+ __states.pop_back();
+ break;
+ }
+ if ((__flags & regex_constants::__full_match) &&
+ __s.__current_ != __last)
+ {
+ __states.pop_back();
+ break;
+ }
if (!__matched || __highest_j < __s.__current_ - __s.__first_)
__highest_j = __s.__current_ - __s.__first_;
__matched = true;
@@ -5692,6 +5730,18 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
switch (__s.__do_)
{
case __state::__end_state:
+ if ((__flags & regex_constants::match_not_null) &&
+ __s.__current_ == __first)
+ {
+ __states.pop_back();
+ break;
+ }
+ if ((__flags & regex_constants::__full_match) &&
+ __s.__current_ != __last)
+ {
+ __states.pop_back();
+ break;
+ }
if (!__matched || __highest_j < __s.__current_ - __s.__first_)
{
__highest_j = __s.__current_ - __s.__first_;
@@ -5922,8 +5972,10 @@ regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last,
const basic_regex<_CharT, _Traits>& __e,
regex_constants::match_flag_type __flags = regex_constants::match_default)
{
- bool __r = _VSTD::regex_search(__first, __last, __m, __e,
- __flags | regex_constants::match_continuous);
+ bool __r = _VSTD::regex_search(
+ __first, __last, __m, __e,
+ __flags | regex_constants::match_continuous |
+ regex_constants::__full_match);
if (__r)
{
__r = !__m.suffix().matched;
@@ -5999,7 +6051,7 @@ regex_match(const basic_string<_CharT, _ST, _SA>& __s,
template <class _BidirectionalIterator,
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
class _Traits = regex_traits<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY regex_iterator
+class _LIBCPP_TEMPLATE_VIS regex_iterator
{
public:
typedef basic_regex<_CharT, _Traits> regex_type;
@@ -6118,7 +6170,7 @@ typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
template <class _BidirectionalIterator,
class _CharT = typename iterator_traits<_BidirectionalIterator>::value_type,
class _Traits = regex_traits<_CharT> >
-class _LIBCPP_TYPE_VIS_ONLY regex_token_iterator
+class _LIBCPP_TEMPLATE_VIS regex_token_iterator
{
public:
typedef basic_regex<_CharT, _Traits> regex_type;
@@ -6134,7 +6186,7 @@ private:
_Position __position_;
const value_type* __result_;
value_type __suffix_;
- ptrdiff_t _N_;
+ ptrdiff_t __n_;
vector<int> __subs_;
public:
@@ -6161,7 +6213,7 @@ public:
regex_constants::match_default) = delete;
#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
const regex_type& __re,
initializer_list<int> __submatches,
@@ -6175,7 +6227,7 @@ public:
regex_constants::match_flag_type __m =
regex_constants::match_default) = delete;
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <size_t _Np>
regex_token_iterator(_BidirectionalIterator __a,
_BidirectionalIterator __b,
@@ -6217,10 +6269,10 @@ public:
private:
void __init(_BidirectionalIterator __a, _BidirectionalIterator __b);
void __establish_result () {
- if (__subs_[_N_] == -1)
+ if (__subs_[__n_] == -1)
__result_ = &__position_->prefix();
else
- __result_ = &(*__position_)[__subs_[_N_]];
+ __result_ = &(*__position_)[__subs_[__n_]];
}
};
@@ -6229,7 +6281,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
regex_token_iterator()
: __result_(nullptr),
__suffix_(),
- _N_(0)
+ __n_(0)
{
}
@@ -6240,7 +6292,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
{
if (__position_ != _Position())
__establish_result ();
- else if (__subs_[_N_] == -1)
+ else if (__subs_[__n_] == -1)
{
__suffix_.matched = true;
__suffix_.first = __a;
@@ -6257,7 +6309,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
const regex_type& __re, int __submatch,
regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m),
- _N_(0),
+ __n_(0),
__subs_(1, __submatch)
{
__init(__a, __b);
@@ -6269,13 +6321,13 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
const regex_type& __re, const vector<int>& __submatches,
regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m),
- _N_(0),
+ __n_(0),
__subs_(__submatches)
{
__init(__a, __b);
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template <class _BidirectionalIterator, class _CharT, class _Traits>
regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
@@ -6284,13 +6336,13 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
initializer_list<int> __submatches,
regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m),
- _N_(0),
+ __n_(0),
__subs_(__submatches)
{
__init(__a, __b);
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _BidirectionalIterator, class _CharT, class _Traits>
template <size_t _Np>
@@ -6300,7 +6352,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
const int (&__submatches)[_Np],
regex_constants::match_flag_type __m)
: __position_(__a, __b, __re, __m),
- _N_(0),
+ __n_(0),
__subs_(__submatches, __submatches + _Np)
{
__init(__a, __b);
@@ -6312,7 +6364,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
: __position_(__x.__position_),
__result_(__x.__result_),
__suffix_(__x.__suffix_),
- _N_(__x._N_),
+ __n_(__x.__n_),
__subs_(__x.__subs_)
{
if (__x.__result_ == &__x.__suffix_)
@@ -6334,7 +6386,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
else
__result_ = __x.__result_;
__suffix_ = __x.__suffix_;
- _N_ = __x._N_;
+ __n_ = __x.__n_;
__subs_ = __x.__subs_;
if ( __result_ != nullptr && __result_ != &__suffix_ )
@@ -6357,7 +6409,7 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
return false;
if (__result_ == &__suffix_ || __x.__result_ == &__x.__suffix_)
return false;
- return __position_ == __x.__position_ && _N_ == __x._N_ &&
+ return __position_ == __x.__position_ && __n_ == __x.__n_ &&
__subs_ == __x.__subs_;
}
@@ -6368,14 +6420,14 @@ regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::operator++()
_Position __prev = __position_;
if (__result_ == &__suffix_)
__result_ = nullptr;
- else if (_N_ + 1 < __subs_.size())
+ else if (static_cast<size_t>(__n_ + 1) < __subs_.size())
{
- ++_N_;
+ ++__n_;
__establish_result();
}
else
{
- _N_ = 0;
+ __n_ = 0;
++__position_;
if (__position_ != _Position())
__establish_result();
@@ -6406,7 +6458,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
template <class _OutputIterator, class _BidirectionalIterator,
class _Traits, class _CharT>
_OutputIterator
-regex_replace(_OutputIterator __out,
+regex_replace(_OutputIterator __output,
_BidirectionalIterator __first, _BidirectionalIterator __last,
const basic_regex<_CharT, _Traits>& __e, const _CharT* __fmt,
regex_constants::match_flag_type __flags = regex_constants::match_default)
@@ -6417,7 +6469,7 @@ regex_replace(_OutputIterator __out,
if (__i == __eof)
{
if (!(__flags & regex_constants::format_no_copy))
- __out = _VSTD::copy(__first, __last, __out);
+ __output = _VSTD::copy(__first, __last, __output);
}
else
{
@@ -6425,29 +6477,29 @@ regex_replace(_OutputIterator __out,
for (size_t __len = char_traits<_CharT>::length(__fmt); __i != __eof; ++__i)
{
if (!(__flags & regex_constants::format_no_copy))
- __out = _VSTD::copy(__i->prefix().first, __i->prefix().second, __out);
- __out = __i->format(__out, __fmt, __fmt + __len, __flags);
+ __output = _VSTD::copy(__i->prefix().first, __i->prefix().second, __output);
+ __output = __i->format(__output, __fmt, __fmt + __len, __flags);
__lm = __i->suffix();
if (__flags & regex_constants::format_first_only)
break;
}
if (!(__flags & regex_constants::format_no_copy))
- __out = _VSTD::copy(__lm.first, __lm.second, __out);
+ __output = _VSTD::copy(__lm.first, __lm.second, __output);
}
- return __out;
+ return __output;
}
template <class _OutputIterator, class _BidirectionalIterator,
class _Traits, class _CharT, class _ST, class _SA>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
-regex_replace(_OutputIterator __out,
+regex_replace(_OutputIterator __output,
_BidirectionalIterator __first, _BidirectionalIterator __last,
const basic_regex<_CharT, _Traits>& __e,
const basic_string<_CharT, _ST, _SA>& __fmt,
regex_constants::match_flag_type __flags = regex_constants::match_default)
{
- return _VSTD::regex_replace(__out, __first, __last, __e, __fmt.c_str(), __flags);
+ return _VSTD::regex_replace(__output, __first, __last, __e, __fmt.c_str(), __flags);
}
template <class _Traits, class _CharT, class _ST, class _SA, class _FST,
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/scoped_allocator b/chromium/buildtools/third_party/libc++/trunk/include/scoped_allocator
index 9436dac9c19..d60ae94f14e 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/scoped_allocator
+++ b/chromium/buildtools/third_party/libc++/trunk/include/scoped_allocator
@@ -115,7 +115,7 @@ template <class OuterA1, class OuterA2, class... InnerAllocs>
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
+#if !defined(_LIBCPP_CXX03_LANG)
// scoped_allocator_adaptor
@@ -384,7 +384,7 @@ struct __outermost<_Alloc, true>
};
template <class _OuterAlloc, class... _InnerAllocs>
-class _LIBCPP_TYPE_VIS_ONLY scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
+class _LIBCPP_TEMPLATE_VIS scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>
: public __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...>
{
typedef __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> base;
@@ -498,8 +498,58 @@ public:
template <class _Tp, class... _Args>
_LIBCPP_INLINE_VISIBILITY
void construct(_Tp* __p, _Args&& ...__args)
- {__construct(__uses_alloc_ctor<_Tp, inner_allocator_type, _Args...>(),
+ {__construct(__uses_alloc_ctor<_Tp, inner_allocator_type&, _Args...>(),
__p, _VSTD::forward<_Args>(__args)...);}
+
+ template <class _T1, class _T2, class... _Args1, class... _Args2>
+ void construct(pair<_T1, _T2>* __p, piecewise_construct_t,
+ tuple<_Args1...> __x, tuple<_Args2...> __y)
+ {
+ typedef __outermost<outer_allocator_type> _OM;
+ allocator_traits<typename _OM::type>::construct(
+ _OM()(outer_allocator()), __p, piecewise_construct
+ , __transform_tuple(
+ typename __uses_alloc_ctor<
+ _T1, inner_allocator_type&, _Args1...
+ >::type()
+ , _VSTD::move(__x)
+ , typename __make_tuple_indices<sizeof...(_Args1)>::type{}
+ )
+ , __transform_tuple(
+ typename __uses_alloc_ctor<
+ _T2, inner_allocator_type&, _Args2...
+ >::type()
+ , _VSTD::move(__y)
+ , typename __make_tuple_indices<sizeof...(_Args2)>::type{}
+ )
+ );
+ }
+
+ template <class _T1, class _T2>
+ void construct(pair<_T1, _T2>* __p)
+ { construct(__p, piecewise_construct, tuple<>{}, tuple<>{}); }
+
+ template <class _T1, class _T2, class _Up, class _Vp>
+ void construct(pair<_T1, _T2>* __p, _Up&& __x, _Vp&& __y) {
+ construct(__p, piecewise_construct,
+ _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x)),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__y)));
+ }
+
+ template <class _T1, class _T2, class _Up, class _Vp>
+ void construct(pair<_T1, _T2>* __p, const pair<_Up, _Vp>& __x) {
+ construct(__p, piecewise_construct,
+ _VSTD::forward_as_tuple(__x.first),
+ _VSTD::forward_as_tuple(__x.second));
+ }
+
+ template <class _T1, class _T2, class _Up, class _Vp>
+ void construct(pair<_T1, _T2>* __p, pair<_Up, _Vp>&& __x) {
+ construct(__p, piecewise_construct,
+ _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x.first)),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__x.second)));
+ }
+
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
void destroy(_Tp* __p)
@@ -515,6 +565,7 @@ public:
private:
+
template <class _OuterA2,
class = typename enable_if<
is_constructible<outer_allocator_type, _OuterA2>::value
@@ -545,9 +596,7 @@ private:
allocator_traits<typename _OM::type>::construct
(
_OM()(outer_allocator()),
- __p,
- allocator_arg,
- inner_allocator(),
+ __p, allocator_arg, inner_allocator(),
_VSTD::forward<_Args>(__args)...
);
}
@@ -566,6 +615,36 @@ private:
);
}
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<_Args&&...>
+ __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t,
+ __tuple_indices<_Idx...>)
+ {
+ return _VSTD::forward_as_tuple(_VSTD::get<_Idx>(_VSTD::move(__t))...);
+ }
+
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>
+ __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t,
+ __tuple_indices<_Idx...>)
+ {
+ using _Tup = tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>;
+ return _Tup(allocator_arg, inner_allocator(),
+ _VSTD::get<_Idx>(_VSTD::move(__t))...);
+ }
+
+ template <class ..._Args, size_t ..._Idx>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple<_Args&&..., inner_allocator_type&>
+ __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t,
+ __tuple_indices<_Idx...>)
+ {
+ using _Tup = tuple<_Args&&..., inner_allocator_type&>;
+ return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., inner_allocator());
+ }
+
template <class...> friend class __scoped_allocator_storage;
};
@@ -597,7 +676,7 @@ operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
return !(__a == __b);
}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE)
+#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/set b/chromium/buildtools/third_party/libc++/trunk/include/set
index ac69e085241..30f2fa88f25 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/set
+++ b/chromium/buildtools/third_party/libc++/trunk/include/set
@@ -397,7 +397,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key> >
-class _LIBCPP_TYPE_VIS_ONLY set
+class _LIBCPP_TEMPLATE_VIS set
{
public:
// types:
@@ -486,12 +486,12 @@ public:
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
set(set&& __s)
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
: __tree_(_VSTD::move(__s.__tree_)) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit set(const allocator_type& __a)
@@ -504,11 +504,9 @@ public:
insert(__s.begin(), __s.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
set(set&& __s, const allocator_type& __a);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
: __tree_(__comp)
@@ -536,9 +534,7 @@ public:
__tree_.__assign_unique(__il.begin(), __il.end());
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
set& operator=(set&& __s)
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
@@ -546,7 +542,7 @@ public:
__tree_ = _VSTD::move(__s.__tree_);
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT {return __tree_.begin();}
@@ -587,7 +583,7 @@ public:
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
// modifiers:
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> emplace(_Args&&... __args)
@@ -596,23 +592,15 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _Args&&... __args)
{return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#endif // _LIBCPP_CXX03_LANG
+
_LIBCPP_INLINE_VISIBILITY
pair<iterator,bool> insert(const value_type& __v)
{return __tree_.__insert_unique(__v);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator,bool> insert(value_type&& __v)
- {return __tree_.__insert_unique(_VSTD::move(__v));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, const value_type& __v)
{return __tree_.__insert_unique(__p, __v);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, value_type&& __v)
- {return __tree_.__insert_unique(__p, _VSTD::move(__v));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __f, _InputIterator __l)
@@ -621,11 +609,19 @@ public:
__tree_.__insert_unique(__e, *__f);
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator,bool> insert(value_type&& __v)
+ {return __tree_.__insert_unique(_VSTD::move(__v));}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, value_type&& __v)
+ {return __tree_.__insert_unique(__p, _VSTD::move(__v));}
+
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
@@ -672,7 +668,7 @@ public:
template <typename _K2>
_LIBCPP_INLINE_VISIBILITY
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
- count(const _K2& __k) {return __tree_.__count_unique(__k);}
+ count(const _K2& __k) const {return __tree_.__count_unique(__k);}
#endif
_LIBCPP_INLINE_VISIBILITY
iterator lower_bound(const key_type& __k)
@@ -727,7 +723,7 @@ public:
#endif
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Compare, class _Allocator>
set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
@@ -741,7 +737,7 @@ set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
}
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -810,7 +806,7 @@ swap(set<_Key, _Compare, _Allocator>& __x,
template <class _Key, class _Compare = less<_Key>,
class _Allocator = allocator<_Key> >
-class _LIBCPP_TYPE_VIS_ONLY multiset
+class _LIBCPP_TEMPLATE_VIS multiset
{
public:
// types:
@@ -901,12 +897,14 @@ public:
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
multiset(multiset&& __s)
_NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
: __tree_(_VSTD::move(__s.__tree_)) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+ multiset(multiset&& __s, const allocator_type& __a);
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
explicit multiset(const allocator_type& __a)
: __tree_(__a) {}
@@ -916,11 +914,8 @@ public:
{
insert(__s.begin(), __s.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- multiset(multiset&& __s, const allocator_type& __a);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
: __tree_(__comp)
@@ -948,9 +943,7 @@ public:
__tree_.__assign_multi(__il.begin(), __il.end());
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
multiset& operator=(multiset&& __s)
_NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
@@ -958,7 +951,7 @@ public:
__tree_ = _VSTD::move(__s.__tree_);
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT {return __tree_.begin();}
@@ -999,7 +992,7 @@ public:
size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
// modifiers:
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator emplace(_Args&&... __args)
@@ -1008,23 +1001,15 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _Args&&... __args)
{return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#endif // _LIBCPP_CXX03_LANG
+
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __v)
{return __tree_.__insert_multi(__v);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(value_type&& __v)
- {return __tree_.__insert_multi(_VSTD::move(__v));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, const value_type& __v)
{return __tree_.__insert_multi(__p, __v);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, value_type&& __v)
- {return __tree_.__insert_multi(_VSTD::move(__v));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __f, _InputIterator __l)
@@ -1033,11 +1018,19 @@ public:
__tree_.__insert_multi(__e, *__f);
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(value_type&& __v)
+ {return __tree_.__insert_multi(_VSTD::move(__v));}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, value_type&& __v)
+ {return __tree_.__insert_multi(__p, _VSTD::move(__v));}
+
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __tree_.erase(__p);}
@@ -1140,7 +1133,7 @@ public:
#endif
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Compare, class _Allocator>
multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)
@@ -1154,7 +1147,7 @@ multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_t
}
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Compare, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/shared_mutex b/chromium/buildtools/third_party/libc++/trunk/include/shared_mutex
index dcb93949e30..ff36ee6ac67 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/shared_mutex
+++ b/chromium/buildtools/third_party/libc++/trunk/include/shared_mutex
@@ -141,7 +141,7 @@ template <class Mutex>
_LIBCPP_BEGIN_NAMESPACE_STD
-struct _LIBCPP_TYPE_VIS __shared_mutex_base
+struct _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX __shared_mutex_base
{
mutex __mut_;
condition_variable __gate1_;
@@ -173,11 +173,11 @@ struct _LIBCPP_TYPE_VIS __shared_mutex_base
#if _LIBCPP_STD_VER > 14
-class _LIBCPP_TYPE_VIS shared_mutex
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex
{
- __shared_mutex_base __base;
+ __shared_mutex_base __base;
public:
- shared_mutex() : __base() {}
+ _LIBCPP_INLINE_VISIBILITY shared_mutex() : __base() {}
_LIBCPP_INLINE_VISIBILITY ~shared_mutex() = default;
shared_mutex(const shared_mutex&) = delete;
@@ -199,9 +199,9 @@ public:
#endif
-class _LIBCPP_TYPE_VIS shared_timed_mutex
+class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_timed_mutex
{
- __shared_mutex_base __base;
+ __shared_mutex_base __base;
public:
shared_timed_mutex();
_LIBCPP_INLINE_VISIBILITY ~shared_timed_mutex() = default;
@@ -220,6 +220,7 @@ public:
return try_lock_until(chrono::steady_clock::now() + __rel_time);
}
template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
bool
try_lock_until(const chrono::time_point<_Clock, _Duration>& __abs_time);
void unlock();
@@ -235,6 +236,7 @@ public:
return try_lock_shared_until(chrono::steady_clock::now() + __rel_time);
}
template <class _Clock, class _Duration>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
bool
try_lock_shared_until(const chrono::time_point<_Clock, _Duration>& __abs_time);
void unlock_shared();
@@ -319,25 +321,25 @@ public:
_LIBCPP_INLINE_VISIBILITY
explicit shared_lock(mutex_type& __m)
- : __m_(&__m),
+ : __m_(_VSTD::addressof(__m)),
__owns_(true)
{__m_->lock_shared();}
_LIBCPP_INLINE_VISIBILITY
shared_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
- : __m_(&__m),
+ : __m_(_VSTD::addressof(__m)),
__owns_(false)
{}
_LIBCPP_INLINE_VISIBILITY
shared_lock(mutex_type& __m, try_to_lock_t)
- : __m_(&__m),
+ : __m_(_VSTD::addressof(__m)),
__owns_(__m.try_lock_shared())
{}
_LIBCPP_INLINE_VISIBILITY
shared_lock(mutex_type& __m, adopt_lock_t)
- : __m_(&__m),
+ : __m_(_VSTD::addressof(__m)),
__owns_(true)
{}
@@ -345,7 +347,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
shared_lock(mutex_type& __m,
const chrono::time_point<_Clock, _Duration>& __abs_time)
- : __m_(&__m),
+ : __m_(_VSTD::addressof(__m)),
__owns_(__m.try_lock_shared_until(__abs_time))
{}
@@ -353,7 +355,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
shared_lock(mutex_type& __m,
const chrono::duration<_Rep, _Period>& __rel_time)
- : __m_(&__m),
+ : __m_(_VSTD::addressof(__m)),
__owns_(__m.try_lock_shared_for(__rel_time))
{}
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/sstream b/chromium/buildtools/third_party/libc++/trunk/include/sstream
index 308c3b62f2b..411374207b4 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/sstream
+++ b/chromium/buildtools/third_party/libc++/trunk/include/sstream
@@ -186,7 +186,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// basic_stringbuf
template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TYPE_VIS_ONLY basic_stringbuf
+class _LIBCPP_TEMPLATE_VIS basic_stringbuf
: public basic_streambuf<_CharT, _Traits>
{
public:
@@ -207,15 +207,15 @@ private:
public:
// 27.8.1.1 Constructors:
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in | ios_base::out);
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_stringbuf(const string_type& __s,
ios_base::openmode __wch = ios_base::in | ios_base::out);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
basic_stringbuf(basic_stringbuf&& __rhs);
-#endif
// 27.8.1.2 Assign and swap:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
basic_stringbuf& operator=(basic_stringbuf&& __rhs);
#endif
void swap(basic_stringbuf& __rhs);
@@ -231,12 +231,12 @@ protected:
virtual int_type overflow (int_type __c = traits_type::eof());
virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
ios_base::openmode __wch = ios_base::in | ios_base::out);
+ inline _LIBCPP_INLINE_VISIBILITY
virtual pos_type seekpos(pos_type __sp,
ios_base::openmode __wch = ios_base::in | ios_base::out);
};
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode __wch)
: __hm_(0),
__mode_(__wch)
@@ -245,7 +245,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& __s,
ios_base::openmode __wch)
: __hm_(0),
@@ -254,7 +253,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type&
str(__s);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
@@ -345,7 +344,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
void
@@ -425,7 +424,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
}
template <class _CharT, class _Traits, class _Allocator>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
void
swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x,
basic_stringbuf<_CharT, _Traits, _Allocator>& __y)
@@ -607,7 +606,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
}
template <class _CharT, class _Traits, class _Allocator>
-inline
typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type
basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
ios_base::openmode __wch)
@@ -618,7 +616,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
// basic_istringstream
template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TYPE_VIS_ONLY basic_istringstream
+class _LIBCPP_TEMPLATE_VIS basic_istringstream
: public basic_istream<_CharT, _Traits>
{
public:
@@ -636,25 +634,31 @@ private:
public:
// 27.8.2.1 Constructors:
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_istringstream(ios_base::openmode __wch = ios_base::in);
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_istringstream(const string_type& __s,
ios_base::openmode __wch = ios_base::in);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
basic_istringstream(basic_istringstream&& __rhs);
// 27.8.2.2 Assign and swap:
basic_istringstream& operator=(basic_istringstream&& __rhs);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
void swap(basic_istringstream& __rhs);
// 27.8.2.3 Members:
+ inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
+ inline _LIBCPP_INLINE_VISIBILITY
string_type str() const;
+ inline _LIBCPP_INLINE_VISIBILITY
void str(const string_type& __s);
};
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::openmode __wch)
: basic_istream<_CharT, _Traits>(&__sb_),
__sb_(__wch | ios_base::in)
@@ -662,7 +666,6 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(ios_base::
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_istream<_CharT, _Traits>(&__sb_),
@@ -670,10 +673,9 @@ basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(const stri
{
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
: basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -690,19 +692,17 @@ basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
-inline
-void
-basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs)
+void basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs)
{
basic_istream<char_type, traits_type>::swap(__rhs);
__sb_.swap(__rhs.__sb_);
}
template <class _CharT, class _Traits, class _Allocator>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
void
swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
basic_istringstream<_CharT, _Traits, _Allocator>& __y)
@@ -711,7 +711,6 @@ swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -719,7 +718,6 @@ basic_istringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_string<_CharT, _Traits, _Allocator>
basic_istringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -727,9 +725,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline
-void
-basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
+void basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
__sb_.str(__s);
}
@@ -737,7 +733,7 @@ basic_istringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
// basic_ostringstream
template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TYPE_VIS_ONLY basic_ostringstream
+class _LIBCPP_TEMPLATE_VIS basic_ostringstream
: public basic_ostream<_CharT, _Traits>
{
public:
@@ -755,25 +751,31 @@ private:
public:
// 27.8.2.1 Constructors:
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out);
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_ostringstream(const string_type& __s,
ios_base::openmode __wch = ios_base::out);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
basic_ostringstream(basic_ostringstream&& __rhs);
// 27.8.2.2 Assign and swap:
basic_ostringstream& operator=(basic_ostringstream&& __rhs);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
void swap(basic_ostringstream& __rhs);
// 27.8.2.3 Members:
+ inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
+ inline _LIBCPP_INLINE_VISIBILITY
string_type str() const;
+ inline _LIBCPP_INLINE_VISIBILITY
void str(const string_type& __s);
};
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::openmode __wch)
: basic_ostream<_CharT, _Traits>(&__sb_),
__sb_(__wch | ios_base::out)
@@ -781,7 +783,6 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_ostream<_CharT, _Traits>(&__sb_),
@@ -789,10 +790,9 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(const stri
{
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
: basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -809,10 +809,9 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
-inline
void
basic_ostringstream<_CharT, _Traits, _Allocator>::swap(basic_ostringstream& __rhs)
{
@@ -821,7 +820,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::swap(basic_ostringstream& __rh
}
template <class _CharT, class _Traits, class _Allocator>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
void
swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
basic_ostringstream<_CharT, _Traits, _Allocator>& __y)
@@ -830,7 +829,6 @@ swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -838,7 +836,6 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_string<_CharT, _Traits, _Allocator>
basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -846,7 +843,6 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline
void
basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
@@ -856,7 +852,7 @@ basic_ostringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
// basic_stringstream
template <class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TYPE_VIS_ONLY basic_stringstream
+class _LIBCPP_TEMPLATE_VIS basic_stringstream
: public basic_iostream<_CharT, _Traits>
{
public:
@@ -874,25 +870,31 @@ private:
public:
// 27.8.2.1 Constructors:
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
+ inline _LIBCPP_INLINE_VISIBILITY
explicit basic_stringstream(const string_type& __s,
ios_base::openmode __wch = ios_base::in | ios_base::out);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
basic_stringstream(basic_stringstream&& __rhs);
// 27.8.2.2 Assign and swap:
basic_stringstream& operator=(basic_stringstream&& __rhs);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
+ inline _LIBCPP_INLINE_VISIBILITY
void swap(basic_stringstream& __rhs);
// 27.8.2.3 Members:
+ inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<char_type, traits_type, allocator_type>* rdbuf() const;
+ inline _LIBCPP_INLINE_VISIBILITY
string_type str() const;
+ inline _LIBCPP_INLINE_VISIBILITY
void str(const string_type& __s);
};
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::openmode __wch)
: basic_iostream<_CharT, _Traits>(&__sb_),
__sb_(__wch)
@@ -900,7 +902,6 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::op
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string_type& __s,
ios_base::openmode __wch)
: basic_iostream<_CharT, _Traits>(&__sb_),
@@ -908,10 +909,9 @@ basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(const string
{
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
: basic_iostream<_CharT, _Traits>(_VSTD::move(__rhs)),
__sb_(_VSTD::move(__rhs.__sb_))
@@ -928,10 +928,9 @@ basic_stringstream<_CharT, _Traits, _Allocator>::operator=(basic_stringstream&&
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
-inline
void
basic_stringstream<_CharT, _Traits, _Allocator>::swap(basic_stringstream& __rhs)
{
@@ -940,7 +939,7 @@ basic_stringstream<_CharT, _Traits, _Allocator>::swap(basic_stringstream& __rhs)
}
template <class _CharT, class _Traits, class _Allocator>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
void
swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
basic_stringstream<_CharT, _Traits, _Allocator>& __y)
@@ -949,7 +948,6 @@ swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_stringbuf<_CharT, _Traits, _Allocator>*
basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const
{
@@ -957,7 +955,6 @@ basic_stringstream<_CharT, _Traits, _Allocator>::rdbuf() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline
basic_string<_CharT, _Traits, _Allocator>
basic_stringstream<_CharT, _Traits, _Allocator>::str() const
{
@@ -965,7 +962,6 @@ basic_stringstream<_CharT, _Traits, _Allocator>::str() const
}
template <class _CharT, class _Traits, class _Allocator>
-inline
void
basic_stringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/stack b/chromium/buildtools/third_party/libc++/trunk/include/stack
index 2992b091ee5..b2d4e239501 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/stack
+++ b/chromium/buildtools/third_party/libc++/trunk/include/stack
@@ -55,10 +55,10 @@ public:
void push(const value_type& x);
void push(value_type&& x);
- template <class... Args> void emplace(Args&&... args);
+ template <class... Args> reference emplace(Args&&... args); // reference in C++17
void pop();
- void swap(stack& c) noexcept(noexcept(swap(c, q.c)));
+ void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>)
};
template <class T, class Container>
@@ -91,7 +91,7 @@ template <class T, class Container>
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TYPE_VIS_ONLY stack;
+template <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TEMPLATE_VIS stack;
template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
@@ -104,7 +104,7 @@ bool
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
template <class _Tp, class _Container /*= deque<_Tp>*/>
-class _LIBCPP_TYPE_VIS_ONLY stack
+class _LIBCPP_TEMPLATE_VIS stack
{
public:
typedef _Container container_type;
@@ -112,7 +112,8 @@ public:
typedef typename container_type::reference reference;
typedef typename container_type::const_reference const_reference;
typedef typename container_type::size_type size_type;
-
+ static_assert((is_same<_Tp, value_type>::value), "" );
+
protected:
container_type c;
@@ -125,29 +126,28 @@ public:
_LIBCPP_INLINE_VISIBILITY
stack(const stack& __q) : c(__q.c) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ stack& operator=(const stack& __q) {c = __q.c; return *this;}
+
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
stack(stack&& __q)
_NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
: c(_VSTD::move(__q.c)) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
- stack& operator=(const stack& __q) {c = __q.c; return *this;}
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
stack& operator=(stack&& __q)
_NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
{c = _VSTD::move(__q.c); return *this;}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
- explicit stack(const container_type& __c) : c(__c) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit stack(const container_type& __c) : c(__c) {}
+
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit stack(const _Alloc& __a,
@@ -166,7 +166,7 @@ public:
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0)
: c(__s.c, __a) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
stack(container_type&& __c, const _Alloc& __a,
@@ -179,7 +179,7 @@ public:
typename enable_if<uses_allocator<container_type,
_Alloc>::value>::type* = 0)
: c(_VSTD::move(__s.c), __a) {}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
bool empty() const {return c.empty();}
@@ -192,16 +192,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
void push(const value_type& __v) {c.push_back(__v);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- void emplace(_Args&&... __args)
- {c.emplace_back(_VSTD::forward<_Args>(__args)...);}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_STD_VER > 14
+ reference emplace(_Args&&... __args)
+ { return c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#else
+ void emplace(_Args&&... __args)
+ { c.emplace_back(_VSTD::forward<_Args>(__args)...);}
+#endif
+#endif // _LIBCPP_CXX03_LANG
+
_LIBCPP_INLINE_VISIBILITY
void pop() {c.pop_back();}
@@ -274,7 +279,10 @@ operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
-void
+typename enable_if<
+ __is_swappable<_Container>::value,
+ void
+>::type
swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
{
@@ -282,7 +290,7 @@ swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y)
}
template <class _Tp, class _Container, class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<stack<_Tp, _Container>, _Alloc>
+struct _LIBCPP_TEMPLATE_VIS uses_allocator<stack<_Tp, _Container>, _Alloc>
: public uses_allocator<_Container, _Alloc>
{
};
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/stdbool.h b/chromium/buildtools/third_party/libc++/trunk/include/stdbool.h
new file mode 100644
index 00000000000..86a127f0fd6
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/stdbool.h
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+//===--------------------------- stdbool.h --------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP_STDBOOL_H
+#define _LIBCPP_STDBOOL_H
+
+
+/*
+ stdbool.h synopsis
+
+Macros:
+
+ __bool_true_false_are_defined
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <stdbool.h>
+
+#ifdef __cplusplus
+#undef bool
+#undef true
+#undef false
+#undef __bool_true_false_are_defined
+#define __bool_true_false_are_defined 1
+#endif
+
+#endif // _LIBCPP_STDBOOL_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/stddef.h b/chromium/buildtools/third_party/libc++/trunk/include/stddef.h
index 8841bbea297..faf8552d8ce 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/stddef.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/stddef.h
@@ -53,7 +53,8 @@ using std::nullptr_t;
}
// Re-use the compiler's <stddef.h> max_align_t where possible.
-#if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T)
+#if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T) && \
+ !defined(__DEFINED_max_align_t)
typedef long double max_align_t;
#endif
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/stdexcept b/chromium/buildtools/third_party/libc++/trunk/include/stdexcept
index f251806fba6..d501d091608 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/stdexcept
+++ b/chromium/buildtools/third_party/libc++/trunk/include/stdexcept
@@ -45,18 +45,31 @@ public:
#include <__config>
#include <exception>
#include <iosfwd> // for string forward decl
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
-#ifndef _LIBCPP___REFSTRING
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_HIDDEN __libcpp_refstring {
- const char *__imp_ _LIBCPP_UNUSED;
+
+class _LIBCPP_HIDDEN __libcpp_refstring
+{
+ const char* __imp_;
+
+ bool __uses_refcount() const;
+public:
+ explicit __libcpp_refstring(const char* msg);
+ __libcpp_refstring(const __libcpp_refstring& s) _NOEXCEPT;
+ __libcpp_refstring& operator=(const __libcpp_refstring& s) _NOEXCEPT;
+ ~__libcpp_refstring();
+
+ const char* c_str() const _NOEXCEPT {return __imp_;}
};
+
_LIBCPP_END_NAMESPACE_STD
-#endif
namespace std // purposefully not using versioning namespace
{
@@ -167,4 +180,99 @@ public:
} // std
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// in the dylib
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_logic_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw logic_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_domain_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw domain_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_invalid_argument(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw invalid_argument(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_length_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw length_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_out_of_range(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw out_of_range(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_range_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw range_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_overflow_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw overflow_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_underflow_error(const char*__msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw underflow_error(__msg);
+#else
+ ((void)__msg);
+ _VSTD::abort();
+#endif
+}
+
+_LIBCPP_END_NAMESPACE_STD
+
#endif // _LIBCPP_STDEXCEPT
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/stdint.h b/chromium/buildtools/third_party/libc++/trunk/include/stdint.h
new file mode 100644
index 00000000000..468f6cd97c2
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/stdint.h
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+//===---------------------------- stdint.h --------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_STDINT_H
+#define _LIBCPP_STDINT_H
+
+/*
+ stdint.h synopsis
+
+Macros:
+
+ INT8_MIN
+ INT16_MIN
+ INT32_MIN
+ INT64_MIN
+
+ INT8_MAX
+ INT16_MAX
+ INT32_MAX
+ INT64_MAX
+
+ UINT8_MAX
+ UINT16_MAX
+ UINT32_MAX
+ UINT64_MAX
+
+ INT_LEAST8_MIN
+ INT_LEAST16_MIN
+ INT_LEAST32_MIN
+ INT_LEAST64_MIN
+
+ INT_LEAST8_MAX
+ INT_LEAST16_MAX
+ INT_LEAST32_MAX
+ INT_LEAST64_MAX
+
+ UINT_LEAST8_MAX
+ UINT_LEAST16_MAX
+ UINT_LEAST32_MAX
+ UINT_LEAST64_MAX
+
+ INT_FAST8_MIN
+ INT_FAST16_MIN
+ INT_FAST32_MIN
+ INT_FAST64_MIN
+
+ INT_FAST8_MAX
+ INT_FAST16_MAX
+ INT_FAST32_MAX
+ INT_FAST64_MAX
+
+ UINT_FAST8_MAX
+ UINT_FAST16_MAX
+ UINT_FAST32_MAX
+ UINT_FAST64_MAX
+
+ INTPTR_MIN
+ INTPTR_MAX
+ UINTPTR_MAX
+
+ INTMAX_MIN
+ INTMAX_MAX
+
+ UINTMAX_MAX
+
+ PTRDIFF_MIN
+ PTRDIFF_MAX
+
+ SIG_ATOMIC_MIN
+ SIG_ATOMIC_MAX
+
+ SIZE_MAX
+
+ WCHAR_MIN
+ WCHAR_MAX
+
+ WINT_MIN
+ WINT_MAX
+
+ INT8_C(value)
+ INT16_C(value)
+ INT32_C(value)
+ INT64_C(value)
+
+ UINT8_C(value)
+ UINT16_C(value)
+ UINT32_C(value)
+ UINT64_C(value)
+
+ INTMAX_C(value)
+ UINTMAX_C(value)
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+/* C99 stdlib (e.g. glibc < 2.18) does not provide macros needed
+ for C++11 unless __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS
+ are defined
+*/
+#if defined(__cplusplus) && !defined(__STDC_LIMIT_MACROS)
+# define __STDC_LIMIT_MACROS
+#endif
+#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
+# define __STDC_CONSTANT_MACROS
+#endif
+
+#include_next <stdint.h>
+
+#endif // _LIBCPP_STDINT_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/stdio.h b/chromium/buildtools/third_party/libc++/trunk/include/stdio.h
index 56fb2d83bb2..dc534970f9d 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/stdio.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/stdio.h
@@ -111,8 +111,9 @@ void perror(const char* s);
// snprintf
#if defined(_LIBCPP_MSVCRT)
-extern "C++" {
-#include "support/win32/support.h"
+extern "C" {
+int vasprintf(char **sptr, const char *__restrict fmt, va_list ap);
+int asprintf(char **sptr, const char *__restrict fmt, ...);
}
#endif
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/stdlib.h b/chromium/buildtools/third_party/libc++/trunk/include/stdlib.h
index 12fd676a15f..f11c5e76226 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/stdlib.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/stdlib.h
@@ -97,10 +97,6 @@ void *aligned_alloc(size_t alignment, size_t size); // C11
extern "C++" {
-#ifdef _LIBCPP_MSVCRT
-#include "support/win32/locale_win32.h"
-#endif // _LIBCPP_MSVCRT
-
#undef abs
#undef div
#undef labs
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/streambuf b/chromium/buildtools/third_party/libc++/trunk/include/streambuf
index e75e8be2271..12eded5c4d3 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/streambuf
+++ b/chromium/buildtools/third_party/libc++/trunk/include/streambuf
@@ -119,7 +119,7 @@ protected:
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _CharT, class _Traits>
-class _LIBCPP_TYPE_VIS_ONLY basic_streambuf
+class _LIBCPP_TEMPLATE_VIS basic_streambuf
{
public:
// types:
@@ -132,32 +132,96 @@ public:
virtual ~basic_streambuf();
// 27.6.2.2.1 locales:
- locale pubimbue(const locale& __loc);
- locale getloc() const;
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ locale pubimbue(const locale& __loc) {
+ imbue(__loc);
+ locale __r = __loc_;
+ __loc_ = __loc;
+ return __r;
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ locale getloc() const { return __loc_; }
// 27.6.2.2.2 buffer and positioning:
- basic_streambuf* pubsetbuf(char_type* __s, streamsize __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ basic_streambuf* pubsetbuf(char_type* __s, streamsize __n)
+ { return setbuf(__s, __n); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
pos_type pubseekoff(off_type __off, ios_base::seekdir __way,
- ios_base::openmode __which = ios_base::in | ios_base::out);
+ ios_base::openmode __which = ios_base::in | ios_base::out)
+ { return seekoff(__off, __way, __which); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
pos_type pubseekpos(pos_type __sp,
- ios_base::openmode __which = ios_base::in | ios_base::out);
- int pubsync();
+ ios_base::openmode __which = ios_base::in | ios_base::out)
+ { return seekpos(__sp, __which); }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int pubsync() { return sync(); }
// Get and put areas:
// 27.6.2.2.3 Get area:
- streamsize in_avail();
- int_type snextc();
- int_type sbumpc();
- int_type sgetc();
- streamsize sgetn(char_type* __s, streamsize __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ streamsize in_avail() {
+ if (__ninp_ < __einp_)
+ return static_cast<streamsize>(__einp_ - __ninp_);
+ return showmanyc();
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type snextc() {
+ if (sbumpc() == traits_type::eof())
+ return traits_type::eof();
+ return sgetc();
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sbumpc() {
+ if (__ninp_ == __einp_)
+ return uflow();
+ return traits_type::to_int_type(*__ninp_++);
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sgetc() {
+ if (__ninp_ == __einp_)
+ return underflow();
+ return traits_type::to_int_type(*__ninp_);
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ streamsize sgetn(char_type* __s, streamsize __n)
+ { return xsgetn(__s, __n); }
// 27.6.2.2.4 Putback:
- int_type sputbackc(char_type __c);
- int_type sungetc();
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sputbackc(char_type __c) {
+ if (__binp_ == __ninp_ || !traits_type::eq(__c, __ninp_[-1]))
+ return pbackfail(traits_type::to_int_type(__c));
+ return traits_type::to_int_type(*--__ninp_);
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sungetc() {
+ if (__binp_ == __ninp_)
+ return pbackfail();
+ return traits_type::to_int_type(*--__ninp_);
+ }
// 27.6.2.2.5 Put area:
- int_type sputc(char_type __c);
- streamsize sputn(const char_type* __s, streamsize __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ int_type sputc(char_type __c) {
+ if (__nout_ == __eout_)
+ return overflow(traits_type::to_int_type(__c));
+ *__nout_++ = __c;
+ return traits_type::to_int_type(__c);
+ }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ streamsize sputn(const char_type* __s, streamsize __n)
+ { return xsputn(__s, __n); }
protected:
basic_streambuf();
@@ -169,15 +233,30 @@ protected:
_LIBCPP_ALWAYS_INLINE char_type* eback() const {return __binp_;}
_LIBCPP_ALWAYS_INLINE char_type* gptr() const {return __ninp_;}
_LIBCPP_ALWAYS_INLINE char_type* egptr() const {return __einp_;}
- void gbump(int __n);
- void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void gbump(int __n) { __ninp_ += __n; }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend) {
+ __binp_ = __gbeg;
+ __ninp_ = __gnext;
+ __einp_ = __gend;
+ }
// 27.6.2.3.3 Put area:
_LIBCPP_ALWAYS_INLINE char_type* pbase() const {return __bout_;}
_LIBCPP_ALWAYS_INLINE char_type* pptr() const {return __nout_;}
_LIBCPP_ALWAYS_INLINE char_type* epptr() const {return __eout_;}
- void pbump(int __n);
- void setp(char_type* __pbeg, char_type* __pend);
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void pbump(int __n) { __nout_ += __n; }
+
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ void setp(char_type* __pbeg, char_type* __pend) {
+ __bout_ = __nout_ = __pbeg;
+ __eout_ = __pend;
+ }
// 27.6.2.4 virtual functions:
// 27.6.2.4.1 Locales:
@@ -220,147 +299,6 @@ basic_streambuf<_CharT, _Traits>::~basic_streambuf()
}
template <class _CharT, class _Traits>
-inline
-locale
-basic_streambuf<_CharT, _Traits>::pubimbue(const locale& __loc)
-{
- imbue(__loc);
- locale __r = __loc_;
- __loc_ = __loc;
- return __r;
-}
-
-template <class _CharT, class _Traits>
-inline
-locale
-basic_streambuf<_CharT, _Traits>::getloc() const
-{
- return __loc_;
-}
-
-template <class _CharT, class _Traits>
-inline
-basic_streambuf<_CharT, _Traits>*
-basic_streambuf<_CharT, _Traits>::pubsetbuf(char_type* __s, streamsize __n)
-{
- return setbuf(__s, __n);
-}
-
-template <class _CharT, class _Traits>
-inline
-typename basic_streambuf<_CharT, _Traits>::pos_type
-basic_streambuf<_CharT, _Traits>::pubseekoff(off_type __off,
- ios_base::seekdir __way,
- ios_base::openmode __which)
-{
- return seekoff(__off, __way, __which);
-}
-
-template <class _CharT, class _Traits>
-inline
-typename basic_streambuf<_CharT, _Traits>::pos_type
-basic_streambuf<_CharT, _Traits>::pubseekpos(pos_type __sp,
- ios_base::openmode __which)
-{
- return seekpos(__sp, __which);
-}
-
-template <class _CharT, class _Traits>
-inline
-int
-basic_streambuf<_CharT, _Traits>::pubsync()
-{
- return sync();
-}
-
-template <class _CharT, class _Traits>
-inline
-streamsize
-basic_streambuf<_CharT, _Traits>::in_avail()
-{
- if (__ninp_ < __einp_)
- return static_cast<streamsize>(__einp_ - __ninp_);
- return showmanyc();
-}
-
-template <class _CharT, class _Traits>
-inline
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::snextc()
-{
- if (sbumpc() == traits_type::eof())
- return traits_type::eof();
- return sgetc();
-}
-
-template <class _CharT, class _Traits>
-inline
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sbumpc()
-{
- if (__ninp_ == __einp_)
- return uflow();
- return traits_type::to_int_type(*__ninp_++);
-}
-
-template <class _CharT, class _Traits>
-inline
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sgetc()
-{
- if (__ninp_ == __einp_)
- return underflow();
- return traits_type::to_int_type(*__ninp_);
-}
-
-template <class _CharT, class _Traits>
-inline
-streamsize
-basic_streambuf<_CharT, _Traits>::sgetn(char_type* __s, streamsize __n)
-{
- return xsgetn(__s, __n);
-}
-
-template <class _CharT, class _Traits>
-inline
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sputbackc(char_type __c)
-{
- if (__binp_ == __ninp_ || !traits_type::eq(__c, __ninp_[-1]))
- return pbackfail(traits_type::to_int_type(__c));
- return traits_type::to_int_type(*--__ninp_);
-}
-
-template <class _CharT, class _Traits>
-inline
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sungetc()
-{
- if (__binp_ == __ninp_)
- return pbackfail();
- return traits_type::to_int_type(*--__ninp_);
-}
-
-template <class _CharT, class _Traits>
-inline
-typename basic_streambuf<_CharT, _Traits>::int_type
-basic_streambuf<_CharT, _Traits>::sputc(char_type __c)
-{
- if (__nout_ == __eout_)
- return overflow(traits_type::to_int_type(__c));
- *__nout_++ = __c;
- return traits_type::to_int_type(__c);
-}
-
-template <class _CharT, class _Traits>
-inline
-streamsize
-basic_streambuf<_CharT, _Traits>::sputn(const char_type* __s, streamsize __n)
-{
- return xsputn(__s, __n);
-}
-
-template <class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits>::basic_streambuf()
: __binp_(0),
__ninp_(0),
@@ -411,42 +349,6 @@ basic_streambuf<_CharT, _Traits>::swap(basic_streambuf& __sb)
}
template <class _CharT, class _Traits>
-inline
-void
-basic_streambuf<_CharT, _Traits>::gbump(int __n)
-{
- __ninp_ += __n;
-}
-
-template <class _CharT, class _Traits>
-inline
-void
-basic_streambuf<_CharT, _Traits>::setg(char_type* __gbeg, char_type* __gnext,
- char_type* __gend)
-{
- __binp_ = __gbeg;
- __ninp_ = __gnext;
- __einp_ = __gend;
-}
-
-template <class _CharT, class _Traits>
-inline
-void
-basic_streambuf<_CharT, _Traits>::pbump(int __n)
-{
- __nout_ += __n;
-}
-
-template <class _CharT, class _Traits>
-inline
-void
-basic_streambuf<_CharT, _Traits>::setp(char_type* __pbeg, char_type* __pend)
-{
- __bout_ = __nout_ = __pbeg;
- __eout_ = __pend;
-}
-
-template <class _CharT, class _Traits>
void
basic_streambuf<_CharT, _Traits>::imbue(const locale&)
{
@@ -495,12 +397,22 @@ basic_streambuf<_CharT, _Traits>::xsgetn(char_type* __s, streamsize __n)
const int_type __eof = traits_type::eof();
int_type __c;
streamsize __i = 0;
- for (;__i < __n; ++__i, ++__s)
+ while(__i < __n)
{
if (__ninp_ < __einp_)
- *__s = *__ninp_++;
+ {
+ const streamsize __len = _VSTD::min(__einp_ - __ninp_, __n - __i);
+ traits_type::copy(__s, __ninp_, __len);
+ __s += __len;
+ __i += __len;
+ this->gbump(__len);
+ }
else if ((__c = uflow()) != __eof)
+ {
*__s = traits_type::to_char_type(__c);
+ ++__s;
+ ++__i;
+ }
else
break;
}
@@ -564,11 +476,13 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)
return traits_type::eof();
}
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_streambuf<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_streambuf<wchar_t>)
+#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ios<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ios<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)
+#endif
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/string b/chromium/buildtools/third_party/libc++/trunk/include/string
index ee5db1aab63..af028a023c2 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/string
+++ b/chromium/buildtools/third_party/libc++/trunk/include/string
@@ -98,8 +98,13 @@ public:
basic_string(const basic_string& str);
basic_string(basic_string&& str)
noexcept(is_nothrow_move_constructible<allocator_type>::value);
- basic_string(const basic_string& str, size_type pos, size_type n = npos,
+ basic_string(const basic_string& str, size_type pos,
const allocator_type& a = allocator_type());
+ basic_string(const basic_string& str, size_type pos, size_type n,
+ const Allocator& a = Allocator());
+ template<class T>
+ basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // C++17
+ explicit basic_string(const basic_string_view<charT, traits> sv, const Allocator& a = Allocator());
basic_string(const value_type* s, const allocator_type& a = allocator_type());
basic_string(const value_type* s, size_type n, const allocator_type& a = allocator_type());
basic_string(size_type n, value_type c, const allocator_type& a = allocator_type());
@@ -112,7 +117,10 @@ public:
~basic_string();
+ operator basic_string_view<charT, traits>() const noexcept;
+
basic_string& operator=(const basic_string& str);
+ basic_string& operator=(basic_string_view<charT, traits> sv);
basic_string& operator=(basic_string&& str)
noexcept(
allocator_type::propagate_on_container_move_assignment::value ||
@@ -156,12 +164,16 @@ public:
reference at(size_type n);
basic_string& operator+=(const basic_string& str);
+ basic_string& operator+=(basic_string_view<charT, traits> sv);
basic_string& operator+=(const value_type* s);
basic_string& operator+=(value_type c);
basic_string& operator+=(initializer_list<value_type>);
basic_string& append(const basic_string& str);
+ basic_string& append(basic_string_view<charT, traits> sv);
basic_string& append(const basic_string& str, size_type pos, size_type n=npos); //C++14
+ template <class T>
+ basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17
basic_string& append(const value_type* s, size_type n);
basic_string& append(const value_type* s);
basic_string& append(size_type n, value_type c);
@@ -177,8 +189,11 @@ public:
const_reference back() const;
basic_string& assign(const basic_string& str);
+ basic_string& assign(basic_string_view<charT, traits> sv);
basic_string& assign(basic_string&& str);
basic_string& assign(const basic_string& str, size_type pos, size_type n=npos); // C++14
+ template <class T>
+ basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17
basic_string& assign(const value_type* s, size_type n);
basic_string& assign(const value_type* s);
basic_string& assign(size_type n, value_type c);
@@ -187,8 +202,11 @@ public:
basic_string& assign(initializer_list<value_type>);
basic_string& insert(size_type pos1, const basic_string& str);
+ basic_string& insert(size_type pos1, basic_string_view<charT, traits> sv);
basic_string& insert(size_type pos1, const basic_string& str,
size_type pos2, size_type n);
+ template <class T>
+ basic_string& insert(size_type pos1, const T& t, size_type pos2, size_type n); // C++17
basic_string& insert(size_type pos, const value_type* s, size_type n=npos); //C++14
basic_string& insert(size_type pos, const value_type* s);
basic_string& insert(size_type pos, size_type n, value_type c);
@@ -203,12 +221,17 @@ public:
iterator erase(const_iterator first, const_iterator last);
basic_string& replace(size_type pos1, size_type n1, const basic_string& str);
+ basic_string& replace(size_type pos1, size_type n1, basic_string_view<charT, traits> sv);
basic_string& replace(size_type pos1, size_type n1, const basic_string& str,
size_type pos2, size_type n2=npos); // C++14
+ template <class T>
+ basic_string& replace(size_type pos1, size_type n1, const T& t,
+ size_type pos2, size_type n); // C++17
basic_string& replace(size_type pos, size_type n1, const value_type* s, size_type n2);
basic_string& replace(size_type pos, size_type n1, const value_type* s);
basic_string& replace(size_type pos, size_type n1, size_type n2, value_type c);
basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str);
+ basic_string& replace(const_iterator i1, const_iterator i2, basic_string_view<charT, traits> sv);
basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s, size_type n);
basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s);
basic_string& replace(const_iterator i1, const_iterator i2, size_type n, value_type c);
@@ -225,43 +248,55 @@ public:
const value_type* c_str() const noexcept;
const value_type* data() const noexcept;
+ value_type* data() noexcept; // C++17
allocator_type get_allocator() const noexcept;
size_type find(const basic_string& str, size_type pos = 0) const noexcept;
+ size_type find(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find(const value_type* s, size_type pos = 0) const noexcept;
size_type find(value_type c, size_type pos = 0) const noexcept;
size_type rfind(const basic_string& str, size_type pos = npos) const noexcept;
+ size_type ffind(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept;
size_type rfind(const value_type* s, size_type pos = npos) const noexcept;
size_type rfind(value_type c, size_type pos = npos) const noexcept;
size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept;
+ size_type find_first_of(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find_first_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_first_of(const value_type* s, size_type pos = 0) const noexcept;
size_type find_first_of(value_type c, size_type pos = 0) const noexcept;
size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept;
+ size_type find_last_of(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept;
size_type find_last_of(value_type c, size_type pos = npos) const noexcept;
size_type find_first_not_of(const basic_string& str, size_type pos = 0) const noexcept;
+ size_type find_first_not_of(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find_first_not_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_first_not_of(const value_type* s, size_type pos = 0) const noexcept;
size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept;
size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept;
+ size_type find_last_not_of(basic_string_view<charT, traits> sv, size_type pos = 0) const noexcept;
size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept;
size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept;
size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept;
int compare(const basic_string& str) const noexcept;
+ int compare(basic_string_view<charT, traits> sv) const noexcept;
int compare(size_type pos1, size_type n1, const basic_string& str) const;
+ int compare(size_type pos1, size_type n1, basic_string_view<charT, traits> sv) const;
int compare(size_type pos1, size_type n1, const basic_string& str,
size_type pos2, size_type n2=npos) const; // C++14
+ template <class T>
+ int compare(size_type pos1, size_type n1, const T& t,
+ size_type pos2, size_type n2=npos) const; // C++17
int compare(const value_type* s) const noexcept;
int compare(size_type pos1, size_type n1, const value_type* s) const;
int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const;
@@ -432,6 +467,7 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
*/
#include <__config>
+#include <string_view>
#include <iosfwd>
#include <cstring>
#include <cstdio> // For EOF.
@@ -447,9 +483,6 @@ basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++1
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
#include <cstdint>
#endif
-#if defined(_LIBCPP_NO_EXCEPTIONS)
-#include <cassert>
-#endif
#include <__undef_min_max>
@@ -464,7 +497,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// fpos
template <class _StateT>
-class _LIBCPP_TYPE_VIS_ONLY fpos
+class _LIBCPP_TEMPLATE_VIS fpos
{
private:
_StateT __st_;
@@ -498,647 +531,6 @@ inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y)
{return streamoff(__x) != streamoff(__y);}
-// char_traits
-
-template <class _CharT>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits
-{
- typedef _CharT char_type;
- typedef int int_type;
- typedef streamoff off_type;
- typedef streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 < __c2;}
-
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static size_t length(const char_type* __s);
- _LIBCPP_INLINE_VISIBILITY
- static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* assign(char_type* __s, size_t __n, char_type __a);
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(EOF);}
-};
-
-template <class _CharT>
-int
-char_traits<_CharT>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
-{
- for (; __n; --__n, ++__s1, ++__s2)
- {
- if (lt(*__s1, *__s2))
- return -1;
- if (lt(*__s2, *__s1))
- return 1;
- }
- return 0;
-}
-
-template <class _CharT>
-inline
-size_t
-char_traits<_CharT>::length(const char_type* __s)
-{
- size_t __len = 0;
- for (; !eq(*__s, char_type(0)); ++__s)
- ++__len;
- return __len;
-}
-
-template <class _CharT>
-inline
-const _CharT*
-char_traits<_CharT>::find(const char_type* __s, size_t __n, const char_type& __a)
-{
- for (; __n; --__n)
- {
- if (eq(*__s, __a))
- return __s;
- ++__s;
- }
- return 0;
-}
-
-template <class _CharT>
-_CharT*
-char_traits<_CharT>::move(char_type* __s1, const char_type* __s2, size_t __n)
-{
- char_type* __r = __s1;
- if (__s1 < __s2)
- {
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- }
- else if (__s2 < __s1)
- {
- __s1 += __n;
- __s2 += __n;
- for (; __n; --__n)
- assign(*--__s1, *--__s2);
- }
- return __r;
-}
-
-template <class _CharT>
-inline
-_CharT*
-char_traits<_CharT>::copy(char_type* __s1, const char_type* __s2, size_t __n)
-{
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- char_type* __r = __s1;
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- return __r;
-}
-
-template <class _CharT>
-inline
-_CharT*
-char_traits<_CharT>::assign(char_type* __s, size_t __n, char_type __a)
-{
- char_type* __r = __s;
- for (; __n; --__n, ++__s)
- assign(*__s, __a);
- return __r;
-}
-
-// char_traits<char>
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits<char>
-{
- typedef char char_type;
- typedef int int_type;
- typedef streamoff off_type;
- typedef streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return (unsigned char)__c1 < (unsigned char)__c2;}
-
- static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n)
- {return __n == 0 ? 0 : memcmp(__s1, __s2, __n);}
- static inline size_t length(const char_type* __s) {return strlen(__s);}
- static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
- {return __n == 0 ? NULL : (const char_type*) memchr(__s, to_int_type(__a), __n);}
- static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
- {return __n == 0 ? __s1 : (char_type*) memmove(__s1, __s2, __n);}
- static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
- {
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- return __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n);
- }
- static inline char_type* assign(char_type* __s, size_t __n, char_type __a)
- {return __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n);}
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type((unsigned char)__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(EOF);}
-};
-
-// char_traits<wchar_t>
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits<wchar_t>
-{
- typedef wchar_t char_type;
- typedef wint_t int_type;
- typedef streamoff off_type;
- typedef streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 < __c2;}
-
- static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n)
- {return __n == 0 ? 0 : wmemcmp(__s1, __s2, __n);}
- static inline size_t length(const char_type* __s)
- {return wcslen(__s);}
- static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
- {return __n == 0 ? NULL : (const char_type*)wmemchr(__s, __a, __n);}
- static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
- {return __n == 0 ? __s1 : (char_type*)wmemmove(__s1, __s2, __n);}
- static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
- {
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- return __n == 0 ? __s1 : (char_type*)wmemcpy(__s1, __s2, __n);
- }
- static inline char_type* assign(char_type* __s, size_t __n, char_type __a)
- {return __n == 0 ? __s : (char_type*)wmemset(__s, __a, __n);}
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(WEOF);}
-};
-
-#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits<char16_t>
-{
- typedef char16_t char_type;
- typedef uint_least16_t int_type;
- typedef streamoff off_type;
- typedef u16streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 < __c2;}
-
- _LIBCPP_INLINE_VISIBILITY
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static size_t length(const char_type* __s);
- _LIBCPP_INLINE_VISIBILITY
- static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* assign(char_type* __s, size_t __n, char_type __a);
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(0xFFFF);}
-};
-
-inline
-int
-char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
-{
- for (; __n; --__n, ++__s1, ++__s2)
- {
- if (lt(*__s1, *__s2))
- return -1;
- if (lt(*__s2, *__s1))
- return 1;
- }
- return 0;
-}
-
-inline
-size_t
-char_traits<char16_t>::length(const char_type* __s)
-{
- size_t __len = 0;
- for (; !eq(*__s, char_type(0)); ++__s)
- ++__len;
- return __len;
-}
-
-inline
-const char16_t*
-char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a)
-{
- for (; __n; --__n)
- {
- if (eq(*__s, __a))
- return __s;
- ++__s;
- }
- return 0;
-}
-
-inline
-char16_t*
-char_traits<char16_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
-{
- char_type* __r = __s1;
- if (__s1 < __s2)
- {
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- }
- else if (__s2 < __s1)
- {
- __s1 += __n;
- __s2 += __n;
- for (; __n; --__n)
- assign(*--__s1, *--__s2);
- }
- return __r;
-}
-
-inline
-char16_t*
-char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
-{
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- char_type* __r = __s1;
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- return __r;
-}
-
-inline
-char16_t*
-char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a)
-{
- char_type* __r = __s;
- for (; __n; --__n, ++__s)
- assign(*__s, __a);
- return __r;
-}
-
-template <>
-struct _LIBCPP_TYPE_VIS_ONLY char_traits<char32_t>
-{
- typedef char32_t char_type;
- typedef uint_least32_t int_type;
- typedef streamoff off_type;
- typedef u32streampos pos_type;
- typedef mbstate_t state_type;
-
- static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
- {__c1 = __c2;}
- static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
- {return __c1 < __c2;}
-
- _LIBCPP_INLINE_VISIBILITY
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static size_t length(const char_type* __s);
- _LIBCPP_INLINE_VISIBILITY
- static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
- _LIBCPP_INLINE_VISIBILITY
- static char_type* assign(char_type* __s, size_t __n, char_type __a);
-
- static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
- {return eq_int_type(__c, eof()) ? ~eof() : __c;}
- static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
- {return char_type(__c);}
- static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
- {return int_type(__c);}
- static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
- {return __c1 == __c2;}
- static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
- {return int_type(0xFFFFFFFF);}
-};
-
-inline
-int
-char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
-{
- for (; __n; --__n, ++__s1, ++__s2)
- {
- if (lt(*__s1, *__s2))
- return -1;
- if (lt(*__s2, *__s1))
- return 1;
- }
- return 0;
-}
-
-inline
-size_t
-char_traits<char32_t>::length(const char_type* __s)
-{
- size_t __len = 0;
- for (; !eq(*__s, char_type(0)); ++__s)
- ++__len;
- return __len;
-}
-
-inline
-const char32_t*
-char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a)
-{
- for (; __n; --__n)
- {
- if (eq(*__s, __a))
- return __s;
- ++__s;
- }
- return 0;
-}
-
-inline
-char32_t*
-char_traits<char32_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
-{
- char_type* __r = __s1;
- if (__s1 < __s2)
- {
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- }
- else if (__s2 < __s1)
- {
- __s1 += __n;
- __s2 += __n;
- for (; __n; --__n)
- assign(*--__s1, *--__s2);
- }
- return __r;
-}
-
-inline
-char32_t*
-char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
-{
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
- char_type* __r = __s1;
- for (; __n; --__n, ++__s1, ++__s2)
- assign(*__s1, *__s2);
- return __r;
-}
-
-inline
-char32_t*
-char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a)
-{
- char_type* __r = __s;
- for (; __n; --__n, ++__s)
- assign(*__s, __a);
- return __r;
-}
-
-#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
-
-// helper fns for basic_string
-
-// __str_find
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find(const _CharT *__p, _SizeT __sz,
- _CharT __c, _SizeT __pos) _NOEXCEPT
-{
- if (__pos >= __sz)
- return __npos;
- const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
- if (__r == 0)
- return __npos;
- return static_cast<_SizeT>(__r - __p);
-}
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- if (__pos > __sz || __sz - __pos < __n)
- return __npos;
- if (__n == 0)
- return __pos;
- const _CharT* __r =
- _VSTD::__search(__p + __pos, __p + __sz,
- __s, __s + __n, _Traits::eq,
- random_access_iterator_tag(), random_access_iterator_tag());
- if (__r == __p + __sz)
- return __npos;
- return static_cast<_SizeT>(__r - __p);
-}
-
-
-// __str_rfind
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_rfind(const _CharT *__p, _SizeT __sz,
- _CharT __c, _SizeT __pos) _NOEXCEPT
-{
- if (__sz < 1)
- return __npos;
- if (__pos < __sz)
- ++__pos;
- else
- __pos = __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __p;)
- {
- if (_Traits::eq(*--__ps, __c))
- return static_cast<_SizeT>(__ps - __p);
- }
- return __npos;
-}
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_rfind(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- __pos = _VSTD::min(__pos, __sz);
- if (__n < __sz - __pos)
- __pos += __n;
- else
- __pos = __sz;
- const _CharT* __r = _VSTD::__find_end(
- __p, __p + __pos, __s, __s + __n, _Traits::eq,
- random_access_iterator_tag(), random_access_iterator_tag());
- if (__n > 0 && __r == __p + __pos)
- return __npos;
- return static_cast<_SizeT>(__r - __p);
-}
-
-// __str_find_first_of
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_first_of(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- if (__pos >= __sz || __n == 0)
- return __npos;
- const _CharT* __r = _VSTD::__find_first_of_ce
- (__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
- if (__r == __p + __sz)
- return __npos;
- return static_cast<_SizeT>(__r - __p);
-}
-
-
-// __str_find_last_of
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_last_of(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
- {
- if (__n != 0)
- {
- if (__pos < __sz)
- ++__pos;
- else
- __pos = __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __p;)
- {
- const _CharT* __r = _Traits::find(__s, __n, *--__ps);
- if (__r)
- return static_cast<_SizeT>(__ps - __p);
- }
- }
- return __npos;
-}
-
-
-// __str_find_first_not_of
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- if (__pos < __sz)
- {
- const _CharT* __pe = __p + __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
- if (_Traits::find(__s, __n, *__ps) == 0)
- return static_cast<_SizeT>(__ps - __p);
- }
- return __npos;
-}
-
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
- _CharT __c, _SizeT __pos) _NOEXCEPT
-{
- if (__pos < __sz)
- {
- const _CharT* __pe = __p + __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
- if (!_Traits::eq(*__ps, __c))
- return static_cast<_SizeT>(__ps - __p);
- }
- return __npos;
-}
-
-
-// __str_find_last_not_of
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
- const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
-{
- if (__pos < __sz)
- ++__pos;
- else
- __pos = __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __p;)
- if (_Traits::find(__s, __n, *--__ps) == 0)
- return static_cast<_SizeT>(__ps - __p);
- return __npos;
-}
-
-
-template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
-_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
- _CharT __c, _SizeT __pos) _NOEXCEPT
-{
- if (__pos < __sz)
- ++__pos;
- else
- __pos = __sz;
- for (const _CharT* __ps = __p + __pos; __ps != __p;)
- if (!_Traits::eq(*--__ps, __c))
- return static_cast<_SizeT>(__ps - __p);
- return __npos;
-}
-
-template<class _Ptr>
-size_t _LIBCPP_INLINE_VISIBILITY __do_string_hash(_Ptr __p, _Ptr __e)
-{
- typedef typename iterator_traits<_Ptr>::value_type value_type;
- return __murmur2_or_cityhash<size_t>()(__p, (__e-__p)*sizeof(value_type));
-}
-
// basic_string
template<class _CharT, class _Traits, class _Allocator>
@@ -1163,44 +555,65 @@ basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);
template <bool>
-class _LIBCPP_TYPE_VIS_ONLY __basic_string_common
+class _LIBCPP_TEMPLATE_VIS __basic_string_common
{
protected:
- void __throw_length_error() const;
- void __throw_out_of_range() const;
+ _LIBCPP_NORETURN void __throw_length_error() const;
+ _LIBCPP_NORETURN void __throw_out_of_range() const;
};
template <bool __b>
void
__basic_string_common<__b>::__throw_length_error() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw length_error("basic_string");
-#else
- assert(!"basic_string length_error");
-#endif
+ _VSTD::__throw_length_error("basic_string");
}
template <bool __b>
void
__basic_string_common<__b>::__throw_out_of_range() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("basic_string");
-#else
- assert(!"basic_string out_of_range");
-#endif
+ _VSTD::__throw_out_of_range("basic_string");
}
#ifdef _LIBCPP_MSVC
#pragma warning( push )
#pragma warning( disable: 4231 )
#endif // _LIBCPP_MSVC
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS __basic_string_common<true>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __basic_string_common<true>)
#ifdef _LIBCPP_MSVC
#pragma warning( pop )
#endif // _LIBCPP_MSVC
+#ifdef _LIBCPP_NO_EXCEPTIONS
+template <class _Iter>
+struct __libcpp_string_gets_noexcept_iterator_impl : public true_type {};
+#elif defined(_LIBCPP_HAS_NO_NOEXCEPT)
+template <class _Iter>
+struct __libcpp_string_gets_noexcept_iterator_impl : public false_type {};
+#else
+template <class _Iter, bool = __is_forward_iterator<_Iter>::value>
+struct __libcpp_string_gets_noexcept_iterator_impl : public _LIBCPP_BOOL_CONSTANT((
+ noexcept(++(declval<_Iter&>())) &&
+ is_nothrow_assignable<_Iter&, _Iter>::value &&
+ noexcept(declval<_Iter>() == declval<_Iter>()) &&
+ noexcept(*declval<_Iter>())
+)) {};
+
+template <class _Iter>
+struct __libcpp_string_gets_noexcept_iterator_impl<_Iter, false> : public false_type {};
+#endif
+
+
+template <class _Iter>
+struct __libcpp_string_gets_noexcept_iterator
+ : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value || __libcpp_string_gets_noexcept_iterator_impl<_Iter>::value) {};
+
+template <class _CharT, class _Traits, class _Tp>
+struct __can_be_converted_to_string_view : public _LIBCPP_BOOL_CONSTANT(
+ ( is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&
+ !is_convertible<const _Tp&, const _CharT*>::value)) {};
+
#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
template <class _CharT, size_t = sizeof(_CharT)>
@@ -1217,13 +630,14 @@ struct __padding<_CharT, 1>
#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
template<class _CharT, class _Traits, class _Allocator>
-class _LIBCPP_TYPE_VIS_ONLY basic_string
+class _LIBCPP_TEMPLATE_VIS basic_string
: private __basic_string_common<true>
{
public:
typedef basic_string __self;
+ typedef basic_string_view<_CharT, _Traits> __self_view;
typedef _Traits traits_type;
- typedef typename traits_type::char_type value_type;
+ typedef _CharT value_type;
typedef _Allocator allocator_type;
typedef allocator_traits<allocator_type> __alloc_traits;
typedef typename __alloc_traits::size_type size_type;
@@ -1234,7 +648,7 @@ public:
typedef typename __alloc_traits::const_pointer const_pointer;
static_assert(is_pod<value_type>::value, "Character type of basic_string must be a POD");
- static_assert((is_same<_CharT, value_type>::value),
+ static_assert((is_same<_CharT, typename traits_type::char_type>::value),
"traits_type::char_type must be the same type as CharT");
static_assert((is_same<typename allocator_type::value_type, value_type>::value),
"Allocator::value_type must be same type as value_type");
@@ -1349,7 +763,7 @@ public:
basic_string(const basic_string& __str);
basic_string(const basic_string& __str, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string(basic_string&& __str)
#if _LIBCPP_STD_VER <= 14
@@ -1360,47 +774,66 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_string(basic_string&& __str, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY basic_string(const value_type* __s);
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string(const _CharT* __s, const _Allocator& __a);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string(const _CharT* __s, size_type __n);
_LIBCPP_INLINE_VISIBILITY
- basic_string(const value_type* __s, const allocator_type& __a);
+ basic_string(const _CharT* __s, size_type __n, const _Allocator& __a);
_LIBCPP_INLINE_VISIBILITY
- basic_string(const value_type* __s, size_type __n);
+ basic_string(size_type __n, _CharT __c);
_LIBCPP_INLINE_VISIBILITY
- basic_string(const value_type* __s, size_type __n, const allocator_type& __a);
+ basic_string(size_type __n, _CharT __c, const _Allocator& __a);
+ basic_string(const basic_string& __str, size_type __pos, size_type __n,
+ const _Allocator& __a = _Allocator());
_LIBCPP_INLINE_VISIBILITY
- basic_string(size_type __n, value_type __c);
+ basic_string(const basic_string& __str, size_type __pos,
+ const _Allocator& __a = _Allocator());
+ template<class _Tp>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ basic_string(const _Tp& __t, size_type __pos, size_type __n,
+ const allocator_type& __a = allocator_type(),
+ typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type* = 0);
+ _LIBCPP_INLINE_VISIBILITY explicit
+ basic_string(__self_view __sv);
_LIBCPP_INLINE_VISIBILITY
- basic_string(size_type __n, value_type __c, const allocator_type& __a);
- basic_string(const basic_string& __str, size_type __pos, size_type __n = npos,
- const allocator_type& __a = allocator_type());
+ basic_string(__self_view __sv, const _Allocator& __a);
template<class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
basic_string(_InputIterator __first, _InputIterator __last);
template<class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- basic_string(initializer_list<value_type> __il);
+ basic_string(initializer_list<_CharT> __il);
_LIBCPP_INLINE_VISIBILITY
- basic_string(initializer_list<value_type> __il, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ basic_string(initializer_list<_CharT> __il, const _Allocator& __a);
+#endif // _LIBCPP_CXX03_LANG
- ~basic_string();
+ inline ~basic_string();
+
+ _LIBCPP_INLINE_VISIBILITY
+ operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); }
basic_string& operator=(const basic_string& __str);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class = void>
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& operator=(__self_view __sv) {return assign(__sv);}
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& operator=(basic_string&& __str)
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
#endif
_LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
basic_string& operator=(value_type __c);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
- basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
@@ -1473,44 +906,70 @@ public:
void clear() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return size() == 0;}
- _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __pos) const;
- _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __pos);
+ _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __pos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __pos) _NOEXCEPT;
const_reference at(size_type __n) const;
reference at(size_type __n);
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const basic_string& __str) {return append(__str);}
- _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s) {return append(__s);}
+ _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(__self_view __sv) {return append(__sv);}
+ _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s) {return append(__s);}
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c) {push_back(__c); return *this;}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& append(const basic_string& __str);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& append(__self_view __sv) { return append(__sv.data(), __sv.size()); }
basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos);
+ template <class _Tp>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string&
+ >::type
+ append(const _Tp& __t, size_type __pos, size_type __n=npos);
basic_string& append(const value_type* __s, size_type __n);
basic_string& append(const value_type* __s);
basic_string& append(size_type __n, value_type __c);
+ template <class _ForwardIterator>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ basic_string& __append_forward_unsafe(_ForwardIterator, _ForwardIterator);
template<class _InputIterator>
- typename enable_if
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ __is_exactly_input_iterator<_InputIterator>::value
+ || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
basic_string&
>::type
- append(_InputIterator __first, _InputIterator __last);
+ _LIBCPP_INLINE_VISIBILITY
+ append(_InputIterator __first, _InputIterator __last) {
+ const basic_string __temp (__first, __last, __alloc());
+ append(__temp.data(), __temp.size());
+ return *this;
+ }
template<class _ForwardIterator>
- typename enable_if
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value
+ && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
basic_string&
>::type
- append(_ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
+ append(_ForwardIterator __first, _ForwardIterator __last) {
+ return __append_forward_unsafe(__first, __last);
+ }
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
void push_back(value_type __c);
_LIBCPP_INLINE_VISIBILITY
@@ -1521,39 +980,62 @@ public:
_LIBCPP_INLINE_VISIBILITY const_reference back() const;
_LIBCPP_INLINE_VISIBILITY
- basic_string& assign(const basic_string& __str);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ basic_string& assign(__self_view __sv) { return assign(__sv.data(), __sv.size()); }
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& assign(const basic_string& __str) { return *this = __str; }
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& assign(basic_string&& str)
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
{*this = _VSTD::move(str); return *this;}
#endif
basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
+ template <class _Tp>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string&
+ >::type
+ assign(const _Tp & __t, size_type pos, size_type n=npos);
basic_string& assign(const value_type* __s, size_type __n);
basic_string& assign(const value_type* __s);
basic_string& assign(size_type __n, value_type __c);
template<class _InputIterator>
- typename enable_if
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ __is_exactly_input_iterator<_InputIterator>::value
+ || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
basic_string&
>::type
assign(_InputIterator __first, _InputIterator __last);
template<class _ForwardIterator>
- typename enable_if
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value
+ && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
basic_string&
>::type
assign(_ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& insert(size_type __pos1, const basic_string& __str);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& insert(size_type __pos1, __self_view __sv) { return insert(__pos1, __sv.data(), __sv.size()); }
+ template <class _Tp>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string&
+ >::type
+ insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n=npos);
basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n=npos);
basic_string& insert(size_type __pos, const value_type* __s, size_type __n);
basic_string& insert(size_type __pos, const value_type* __s);
@@ -1562,25 +1044,28 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __pos, size_type __n, value_type __c);
template<class _InputIterator>
- typename enable_if
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ __is_exactly_input_iterator<_InputIterator>::value
+ || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
iterator
>::type
insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);
template<class _ForwardIterator>
- typename enable_if
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value
+ && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
iterator
>::type
insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __pos, initializer_list<value_type> __il)
{return insert(__pos, __il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
basic_string& erase(size_type __pos = 0, size_type __n = npos);
_LIBCPP_INLINE_VISIBILITY
@@ -1590,30 +1075,43 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str);
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string& replace(size_type __pos1, size_type __n1, __self_view __sv) { return replace(__pos1, __n1, __sv.data(), __sv.size()); }
basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos);
+ template <class _Tp>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string&
+ >::type
+ replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos);
basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);
basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);
basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str);
_LIBCPP_INLINE_VISIBILITY
+ basic_string& replace(const_iterator __i1, const_iterator __i2, __self_view __sv) { return replace(__i1 - begin(), __i2 - __i1, __sv); }
+ _LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n);
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s);
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, size_type __n, value_type __c);
template<class _InputIterator>
- typename enable_if
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ typename enable_if
<
__is_input_iterator<_InputIterator>::value,
basic_string&
>::type
replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il)
{return replace(__i1, __i2, __il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;
_LIBCPP_INLINE_VISIBILITY
@@ -1622,9 +1120,9 @@ public:
_LIBCPP_INLINE_VISIBILITY
void swap(basic_string& __str)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
+ _NOEXCEPT_DEBUG;
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
@@ -1632,12 +1130,18 @@ public:
const value_type* c_str() const _NOEXCEPT {return data();}
_LIBCPP_INLINE_VISIBILITY
const value_type* data() const _NOEXCEPT {return _VSTD::__to_raw_pointer(__get_pointer());}
+#if _LIBCPP_STD_VER > 14
+ _LIBCPP_INLINE_VISIBILITY
+ value_type* data() _NOEXCEPT {return _VSTD::__to_raw_pointer(__get_pointer());}
+#endif
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT {return __alloc();}
_LIBCPP_INLINE_VISIBILITY
size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1645,6 +1149,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1652,6 +1158,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1660,6 +1168,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1668,6 +1178,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
@@ -1676,6 +1188,8 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;
size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;
@@ -1685,8 +1199,20 @@ public:
_LIBCPP_INLINE_VISIBILITY
int compare(const basic_string& __str) const _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY
+ int compare(__self_view __sv) const _NOEXCEPT;
+ _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, __self_view __sv) const;
+ _LIBCPP_INLINE_VISIBILITY
int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;
int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos) const;
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ int
+ >::type
+ compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos) const;
int compare(const value_type* __s) const _NOEXCEPT;
int compare(size_type __pos1, size_type __n1, const value_type* __s) const;
int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
@@ -1810,20 +1336,24 @@ private:
__align_it<sizeof(value_type) < __alignment ?
__alignment/sizeof(value_type) : 1 > (__s+1)) - 1;}
+ inline
void __init(const value_type* __s, size_type __sz, size_type __reserve);
+ inline
void __init(const value_type* __s, size_type __sz);
+ inline
void __init(size_type __n, value_type __c);
template <class _InputIterator>
+ inline
typename enable_if
<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ __is_exactly_input_iterator<_InputIterator>::value,
void
>::type
__init(_InputIterator __first, _InputIterator __last);
template <class _ForwardIterator>
+ inline
typename enable_if
<
__is_forward_iterator<_ForwardIterator>::value,
@@ -1848,19 +1378,35 @@ private:
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const basic_string& __str, true_type)
{
- if (__alloc() != __str.__alloc())
+ if (__alloc() == __str.__alloc())
+ __alloc() = __str.__alloc();
+ else
{
- clear();
- shrink_to_fit();
+ if (!__str.__is_long())
+ {
+ clear();
+ shrink_to_fit();
+ __alloc() = __str.__alloc();
+ }
+ else
+ {
+ allocator_type __a = __str.__alloc();
+ pointer __p = __alloc_traits::allocate(__a, __str.__get_long_cap());
+ clear();
+ shrink_to_fit();
+ __alloc() = _VSTD::move(__a);
+ __set_long_pointer(__p);
+ __set_long_cap(__str.__get_long_cap());
+ __set_long_size(__str.size());
+ }
}
- __alloc() = __str.__alloc();
}
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const basic_string&, false_type) _NOEXCEPT
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void __move_assign(basic_string& __str, false_type)
_NOEXCEPT_(__alloc_traits::is_always_equal::value);
@@ -1963,7 +1509,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __
#else
_NOEXCEPT
#endif
-: __r_(__a)
+: __r_(__second_tag(), __a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1972,8 +1518,9 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __
}
template <class _CharT, class _Traits, class _Allocator>
-void
-basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz, size_type __reserve)
+void basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s,
+ size_type __sz,
+ size_type __reserve)
{
if (__reserve > max_size())
this->__throw_length_error();
@@ -2021,7 +1568,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_ty
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s)
{
_LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
__init(__s, traits_type::length(__s));
@@ -2032,8 +1579,8 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s)
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, const allocator_type& __a)
- : __r_(__a)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a)
+ : __r_(__second_tag(), __a)
{
_LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
__init(__s, traits_type::length(__s));
@@ -2044,7 +1591,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, c
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, size_type __n)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_type __n)
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
__init(__s, __n);
@@ -2055,8 +1602,8 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, s
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, size_type __n, const allocator_type& __a)
- : __r_(__a)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)
+ : __r_(__second_tag(), __a)
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
__init(__s, __n);
@@ -2067,7 +1614,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, s
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)
- : __r_(__alloc_traits::select_on_container_copy_construction(__str.__alloc()))
+ : __r_(__second_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc()))
{
if (!__str.__is_long())
__r_.first().__r = __str.__r_.first().__r;
@@ -2079,8 +1626,9 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
}
template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, const allocator_type& __a)
- : __r_(__a)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(
+ const basic_string& __str, const allocator_type& __a)
+ : __r_(__second_tag(), __a)
{
if (!__str.__is_long())
__r_.first().__r = __str.__r_.first().__r;
@@ -2091,7 +1639,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
#endif
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -2114,7 +1662,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, const allocator_type& __a)
- : __r_(__a)
+ : __r_(__second_tag(), __a)
{
if (__str.__is_long() && __a != __str.__alloc()) // copy, not move
__init(_VSTD::__to_raw_pointer(__str.__get_long_pointer()), __str.__get_long_size());
@@ -2130,7 +1678,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, co
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
void
@@ -2158,7 +1706,7 @@ basic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c)
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_type __c)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c)
{
__init(__n, __c);
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -2168,8 +1716,8 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_typ
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_type __c, const allocator_type& __a)
- : __r_(__a)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a)
+ : __r_(__second_tag(), __a)
{
__init(__n, __c);
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -2178,9 +1726,10 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_typ
}
template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos, size_type __n,
- const allocator_type& __a)
- : __r_(__a)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str,
+ size_type __pos, size_type __n,
+ const _Allocator& __a)
+ : __r_(__second_tag(), __a)
{
size_type __str_sz = __str.size();
if (__pos > __str_sz)
@@ -2192,11 +1741,60 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __st
}
template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos,
+ const _Allocator& __a)
+ : __r_(__second_tag(), __a)
+{
+ size_type __str_sz = __str.size();
+ if (__pos > __str_sz)
+ this->__throw_out_of_range();
+ __init(__str.data() + __pos, __str_sz - __pos);
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__insert_c(this);
+#endif
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+basic_string<_CharT, _Traits, _Allocator>::basic_string(
+ const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a,
+ typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type *)
+ : __r_(__second_tag(), __a)
+{
+ __self_view __sv = __self_view(__t).substr(__pos, __n);
+ __init(__sv.data(), __sv.size());
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__insert_c(this);
+#endif
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv)
+{
+ __init(__sv.data(), __sv.size());
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__insert_c(this);
+#endif
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv, const _Allocator& __a)
+ : __r_(__second_tag(), __a)
+{
+ __init(__sv.data(), __sv.size());
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __get_db()->__insert_c(this);
+#endif
+}
+
+template <class _CharT, class _Traits, class _Allocator>
template <class _InputIterator>
typename enable_if
<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ __is_exactly_input_iterator<_InputIterator>::value,
void
>::type
basic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last)
@@ -2266,7 +1864,7 @@ template<class _InputIterator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last,
const allocator_type& __a)
- : __r_(__a)
+ : __r_(__second_tag(), __a)
{
__init(__first, __last);
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -2274,11 +1872,12 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first,
#endif
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_type> __il)
+basic_string<_CharT, _Traits, _Allocator>::basic_string(
+ initializer_list<_CharT> __il)
{
__init(__il.begin(), __il.end());
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -2288,8 +1887,10 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_t
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
-basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_type> __il, const allocator_type& __a)
- : __r_(__a)
+
+basic_string<_CharT, _Traits, _Allocator>::basic_string(
+ initializer_list<_CharT> __il, const _Allocator& __a)
+ : __r_(__second_tag(), __a)
{
__init(__il.begin(), __il.end());
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -2297,7 +1898,7 @@ basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_t
#endif
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>::~basic_string()
@@ -2441,12 +2042,12 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)
if (this != &__str)
{
__copy_assign_alloc(__str);
- assign(__str);
+ assign(__str.data(), __str.size());
}
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -2494,15 +2095,14 @@ template <class _CharT, class _Traits, class _Allocator>
template<class _InputIterator>
typename enable_if
<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
+ __is_exactly_input_iterator <_InputIterator>::value
+ || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
basic_string<_CharT, _Traits, _Allocator>&
>::type
basic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
{
- clear();
- for (; __first != __last; ++__first)
- push_back(*__first);
+ const basic_string __temp(__first, __last, __alloc());
+ assign(__temp.data(), __temp.size());
return *this;
}
@@ -2510,7 +2110,8 @@ template <class _CharT, class _Traits, class _Allocator>
template<class _ForwardIterator>
typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value
+ && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
basic_string<_CharT, _Traits, _Allocator>&
>::type
basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
@@ -2533,23 +2134,32 @@ basic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _For
}
template <class _CharT, class _Traits, class _Allocator>
-inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>&
-basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str)
+basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str, size_type __pos, size_type __n)
{
- return assign(__str.data(), __str.size());
+ size_type __sz = __str.size();
+ if (__pos > __sz)
+ this->__throw_out_of_range();
+ return assign(__str.data() + __pos, _VSTD::min(__n, __sz - __pos));
}
template <class _CharT, class _Traits, class _Allocator>
-basic_string<_CharT, _Traits, _Allocator>&
-basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str, size_type __pos, size_type __n)
+template <class _Tp>
+typename enable_if
+<
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+>::type
+basic_string<_CharT, _Traits, _Allocator>::assign(const _Tp & __t, size_type __pos, size_type __n)
{
- size_type __sz = __str.size();
+ __self_view __sv = __t;
+ size_type __sz = __sv.size();
if (__pos > __sz)
this->__throw_out_of_range();
- return assign(__str.data() + __pos, _VSTD::min(__n, __sz - __pos));
+ return assign(__sv.data() + __pos, _VSTD::min(__n, __sz - __pos));
}
+
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)
@@ -2639,42 +2249,48 @@ basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
traits_type::assign(*++__p, value_type());
}
-template <class _CharT, class _Traits, class _Allocator>
-template<class _InputIterator>
-typename enable_if
-<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->::type
-basic_string<_CharT, _Traits, _Allocator>::append(_InputIterator __first, _InputIterator __last)
+template <class _Tp>
+bool __ptr_in_range (const _Tp* __p, const _Tp* __first, const _Tp* __last)
{
- for (; __first != __last; ++__first)
- push_back(*__first);
- return *this;
+ return __first <= __p && __p < __last;
+}
+
+template <class _Tp1, class _Tp2>
+bool __ptr_in_range (const _Tp1*, const _Tp2*, const _Tp2*)
+{
+ return false;
}
template <class _CharT, class _Traits, class _Allocator>
template<class _ForwardIterator>
-typename enable_if
-<
- __is_forward_iterator<_ForwardIterator>::value,
- basic_string<_CharT, _Traits, _Allocator>&
->::type
-basic_string<_CharT, _Traits, _Allocator>::append(_ForwardIterator __first, _ForwardIterator __last)
+basic_string<_CharT, _Traits, _Allocator>&
+basic_string<_CharT, _Traits, _Allocator>::__append_forward_unsafe(
+ _ForwardIterator __first, _ForwardIterator __last)
{
+ static_assert(__is_forward_iterator<_ForwardIterator>::value,
+ "function requires a ForwardIterator");
size_type __sz = size();
size_type __cap = capacity();
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n)
{
- if (__cap - __sz < __n)
- __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
- pointer __p = __get_pointer() + __sz;
- for (; __first != __last; ++__p, ++__first)
- traits_type::assign(*__p, *__first);
- traits_type::assign(*__p, value_type());
- __set_size(__sz + __n);
+ typedef typename iterator_traits<_ForwardIterator>::reference _CharRef;
+ _CharRef __tmp_ref = *__first;
+ if (__ptr_in_range(_VSTD::addressof(__tmp_ref), data(), data() + size()))
+ {
+ const basic_string __temp (__first, __last, __alloc());
+ append(__temp.data(), __temp.size());
+ }
+ else
+ {
+ if (__cap - __sz < __n)
+ __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);
+ pointer __p = __get_pointer() + __sz;
+ for (; __first != __last; ++__p, ++__first)
+ traits_type::assign(*__p, *__first);
+ traits_type::assign(*__p, value_type());
+ __set_size(__sz + __n);
+ }
}
return *this;
}
@@ -2698,6 +2314,22 @@ basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str, siz
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+ typename enable_if
+ <
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+ >::type
+basic_string<_CharT, _Traits, _Allocator>::append(const _Tp & __t, size_type __pos, size_type __n)
+{
+ __self_view __sv = __t;
+ size_type __sz = __sv.size();
+ if (__pos > __sz)
+ this->__throw_out_of_range();
+ return append(__sv.data() + __pos, _VSTD::min(__n, __sz - __pos));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s)
{
@@ -2774,9 +2406,9 @@ template <class _CharT, class _Traits, class _Allocator>
template<class _InputIterator>
typename enable_if
<
- __is_input_iterator <_InputIterator>::value &&
- !__is_forward_iterator<_InputIterator>::value,
- typename basic_string<_CharT, _Traits, _Allocator>::iterator
+ __is_exactly_input_iterator<_InputIterator>::value
+ || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
+ typename basic_string<_CharT, _Traits, _Allocator>::iterator
>::type
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)
{
@@ -2785,24 +2417,16 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIt
"string::insert(iterator, range) called with an iterator not"
" referring to this string");
#endif
- size_type __old_sz = size();
- difference_type __ip = __pos - begin();
- for (; __first != __last; ++__first)
- push_back(*__first);
- pointer __p = __get_pointer();
- _VSTD::rotate(__p + __ip, __p + __old_sz, __p + size());
-#if _LIBCPP_DEBUG_LEVEL >= 2
- return iterator(this, __p + __ip);
-#else
- return iterator(__p + __ip);
-#endif
+ const basic_string __temp(__first, __last, __alloc());
+ return insert(__pos, __temp.data(), __temp.data() + __temp.size());
}
template <class _CharT, class _Traits, class _Allocator>
template<class _ForwardIterator>
typename enable_if
<
- __is_forward_iterator<_ForwardIterator>::value,
+ __is_forward_iterator<_ForwardIterator>::value
+ && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
typename basic_string<_CharT, _Traits, _Allocator>::iterator
>::type
basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)
@@ -2813,11 +2437,19 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _Forward
" referring to this string");
#endif
size_type __ip = static_cast<size_type>(__pos - begin());
- size_type __sz = size();
- size_type __cap = capacity();
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
if (__n)
{
+ typedef typename iterator_traits<_ForwardIterator>::reference _CharRef;
+ _CharRef __tmp_char = *__first;
+ if (__ptr_in_range(_VSTD::addressof(__tmp_char), data(), data() + size()))
+ {
+ const basic_string __temp(__first, __last, __alloc());
+ return insert(__pos, __temp.data(), __temp.data() + __temp.size());
+ }
+
+ size_type __sz = size();
+ size_type __cap = capacity();
value_type* __p;
if (__cap - __sz >= __n)
{
@@ -2860,6 +2492,23 @@ basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+typename enable_if
+<
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+>::type
+basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t,
+ size_type __pos2, size_type __n)
+{
+ __self_view __sv = __t;
+ size_type __str_sz = __sv.size();
+ if (__pos2 > __str_sz)
+ this->__throw_out_of_range();
+ return insert(__pos1, __sv.data() + __pos2, _VSTD::min(__n, __str_sz - __pos2));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s)
{
@@ -2913,6 +2562,7 @@ basic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, size_typ
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
_LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::replace received nullptr");
size_type __sz = size();
@@ -2952,6 +2602,8 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __
}
traits_type::move(__p + __pos, __s, __n2);
__finish:
+// __sz += __n2 - __n1; in this and the below function below can cause unsigned integer overflow,
+// but this is a safe operation, so we disable the check.
__sz += __n2 - __n1;
__set_size(__sz);
__invalidate_iterators_past(__sz);
@@ -2965,6 +2617,7 @@ __finish:
template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, size_type __n2, value_type __c)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
size_type __sz = size();
if (__pos > __sz)
@@ -3005,22 +2658,8 @@ typename enable_if
basic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2,
_InputIterator __j1, _InputIterator __j2)
{
- for (; true; ++__i1, ++__j1)
- {
- if (__i1 == __i2)
- {
- if (__j1 != __j2)
- insert(__i1, __j1, __j2);
- break;
- }
- if (__j1 == __j2)
- {
- erase(__i1, __i2);
- break;
- }
- traits_type::assign(const_cast<value_type&>(*__i1), *__j1);
- }
- return *this;
+ const basic_string __temp(__j1, __j2, __alloc());
+ return this->replace(__i1, __i2, __temp);
}
template <class _CharT, class _Traits, class _Allocator>
@@ -3043,6 +2682,23 @@ basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type _
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+typename enable_if
+<
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ basic_string<_CharT, _Traits, _Allocator>&
+>::type
+basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type __n1, const _Tp& __t,
+ size_type __pos2, size_type __n2)
+{
+ __self_view __sv = __t;
+ size_type __str_sz = __sv.size();
+ if (__pos2 > __str_sz)
+ this->__throw_out_of_range();
+ return replace(__pos1, __n1, __sv.data() + __pos2, _VSTD::min(__n2, __str_sz - __pos2));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s)
{
@@ -3290,7 +2946,7 @@ basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __res_arg)
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::const_reference
-basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) const
+basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
return *(data() + __pos);
@@ -3299,7 +2955,7 @@ basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) const
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::reference
-basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos)
+basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) _NOEXCEPT
{
_LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
return *(__get_pointer() + __pos);
@@ -3384,9 +3040,9 @@ inline _LIBCPP_INLINE_VISIBILITY
void
basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
+ _NOEXCEPT_DEBUG
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value)
#endif
{
@@ -3397,6 +3053,10 @@ basic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)
__get_db()->__invalidate_all(&__str);
__get_db()->swap(this, &__str);
#endif
+ _LIBCPP_ASSERT(
+ __alloc_traits::propagate_on_container_swap::value ||
+ __alloc_traits::is_always_equal::value ||
+ __alloc() == __str.__alloc(), "swapping non-equal allocators");
_VSTD::swap(__r_.first(), __str.__r_.first());
__swap_allocator(__alloc(), __str.__alloc());
}
@@ -3419,7 +3079,7 @@ basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find(): received nullptr");
- return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ return __str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3429,18 +3089,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ return __str_find<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find(): received nullptr");
- return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ return __str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3449,7 +3119,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ return __str_find<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3462,7 +3132,7 @@ basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");
- return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ return __str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3472,18 +3142,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ return __str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::rfind(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::rfind(): received nullptr");
- return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ return __str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3492,7 +3172,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ return __str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3505,7 +3185,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");
- return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3515,18 +3195,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find_first_of(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_first_of(): received nullptr");
- return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3548,7 +3238,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");
- return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3558,18 +3248,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find_last_of(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_last_of(): received nullptr");
- return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3591,7 +3291,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* _
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");
- return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3601,18 +3301,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_first_not_of(): received nullptr");
- return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3622,7 +3332,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3635,7 +3345,7 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");
- return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3645,18 +3355,28 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
+basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(__self_view __sv,
+ size_type __pos) const _NOEXCEPT
+{
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __sv.data(), __pos, __sv.size());
+}
+
+template<class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_last_not_of(): received nullptr");
- return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3666,7 +3386,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3675,11 +3395,11 @@ basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c,
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
int
-basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT
+basic_string<_CharT, _Traits, _Allocator>::compare(__self_view __sv) const _NOEXCEPT
{
size_t __lhs_sz = size();
- size_t __rhs_sz = __str.size();
- int __result = traits_type::compare(data(), __str.data(),
+ size_t __rhs_sz = __sv.size();
+ int __result = traits_type::compare(data(), __sv.data(),
_VSTD::min(__lhs_sz, __rhs_sz));
if (__result != 0)
return __result;
@@ -3693,6 +3413,47 @@ basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) co
template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
int
+basic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT
+{
+ return compare(__self_view(__str));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+int
+basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
+ size_type __n1,
+ const value_type* __s,
+ size_type __n2) const
+{
+ _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr");
+ size_type __sz = size();
+ if (__pos1 > __sz || __n2 == npos)
+ this->__throw_out_of_range();
+ size_type __rlen = _VSTD::min(__n1, __sz - __pos1);
+ int __r = traits_type::compare(data() + __pos1, __s, _VSTD::min(__rlen, __n2));
+ if (__r == 0)
+ {
+ if (__rlen < __n2)
+ __r = -1;
+ else if (__rlen > __n2)
+ __r = 1;
+ }
+ return __r;
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+int
+basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
+ size_type __n1,
+ __self_view __sv) const
+{
+ return compare(__pos1, __n1, __sv.data(), __sv.size());
+}
+
+template <class _CharT, class _Traits, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+int
basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __n1,
const basic_string& __str) const
@@ -3701,6 +3462,23 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
}
template <class _CharT, class _Traits, class _Allocator>
+template <class _Tp>
+typename enable_if
+<
+ __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
+ int
+>::type
+basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
+ size_type __n1,
+ const _Tp& __t,
+ size_type __pos2,
+ size_type __n2) const
+{
+ __self_view __sv = __t;
+ return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
+}
+
+template <class _CharT, class _Traits, class _Allocator>
int
basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __n1,
@@ -3708,11 +3486,7 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
size_type __pos2,
size_type __n2) const
{
- size_type __sz = __str.size();
- if (__pos2 > __sz)
- this->__throw_out_of_range();
- return compare(__pos1, __n1, __str.data() + __pos2, _VSTD::min(__n2,
- __sz - __pos2));
+ return compare(__pos1, __n1, __self_view(__str), __pos2, __n2);
}
template <class _CharT, class _Traits, class _Allocator>
@@ -3733,29 +3507,6 @@ basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
return compare(__pos1, __n1, __s, traits_type::length(__s));
}
-template <class _CharT, class _Traits, class _Allocator>
-int
-basic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,
- size_type __n1,
- const value_type* __s,
- size_type __n2) const
-{
- _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr");
- size_type __sz = size();
- if (__pos1 > __sz || __n2 == npos)
- this->__throw_out_of_range();
- size_type __rlen = _VSTD::min(__n1, __sz - __pos1);
- int __r = traits_type::compare(data() + __pos1, __s, _VSTD::min(__rlen, __n2));
- if (__r == 0)
- {
- if (__rlen < __n2)
- __r = -1;
- else if (__rlen > __n2)
- __r = 1;
- }
- return __r;
-}
-
// __invariants
template<class _CharT, class _Traits, class _Allocator>
@@ -3833,8 +3584,6 @@ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
return __lhs.compare(0, _String::npos, __rhs, __rhs_len) == 0;
}
-// operator!=
-
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
@@ -4039,7 +3788,7 @@ operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs)
return __r;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -4099,7 +3848,7 @@ operator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, _CharT __rhs)
return _VSTD::move(__lhs);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
// swap
@@ -4165,7 +3914,7 @@ template<class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>::npos;
template<class _CharT, class _Traits, class _Allocator>
-struct _LIBCPP_TYPE_VIS_ONLY hash<basic_string<_CharT, _Traits, _Allocator> >
+struct _LIBCPP_TEMPLATE_VIS hash<basic_string<_CharT, _Traits, _Allocator> >
: public unary_function<basic_string<_CharT, _Traits, _Allocator>, size_t>
{
size_t
@@ -4201,7 +3950,7 @@ basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>& __is,
basic_string<_CharT, _Traits, _Allocator>& __str);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -4215,7 +3964,7 @@ basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Allocator>& __str);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_DEBUG_LEVEL >= 2
@@ -4286,8 +4035,8 @@ inline namespace literals
}
#endif
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_string<char>)
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_string<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<wchar_t>)
_LIBCPP_EXTERN_TEMPLATE(string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&))
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/string.h b/chromium/buildtools/third_party/libc++/trunk/include/string.h
new file mode 100644
index 00000000000..a1ce56cbcd6
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/string.h
@@ -0,0 +1,110 @@
+// -*- C++ -*-
+//===--------------------------- string.h ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_STRING_H
+#define _LIBCPP_STRING_H
+
+/*
+ string.h synopsis
+
+Macros:
+
+ NULL
+
+Types:
+
+ size_t
+
+void* memcpy(void* restrict s1, const void* restrict s2, size_t n);
+void* memmove(void* s1, const void* s2, size_t n);
+char* strcpy (char* restrict s1, const char* restrict s2);
+char* strncpy(char* restrict s1, const char* restrict s2, size_t n);
+char* strcat (char* restrict s1, const char* restrict s2);
+char* strncat(char* restrict s1, const char* restrict s2, size_t n);
+int memcmp(const void* s1, const void* s2, size_t n);
+int strcmp (const char* s1, const char* s2);
+int strncmp(const char* s1, const char* s2, size_t n);
+int strcoll(const char* s1, const char* s2);
+size_t strxfrm(char* restrict s1, const char* restrict s2, size_t n);
+const void* memchr(const void* s, int c, size_t n);
+ void* memchr( void* s, int c, size_t n);
+const char* strchr(const char* s, int c);
+ char* strchr( char* s, int c);
+size_t strcspn(const char* s1, const char* s2);
+const char* strpbrk(const char* s1, const char* s2);
+ char* strpbrk( char* s1, const char* s2);
+const char* strrchr(const char* s, int c);
+ char* strrchr( char* s, int c);
+size_t strspn(const char* s1, const char* s2);
+const char* strstr(const char* s1, const char* s2);
+ char* strstr( char* s1, const char* s2);
+char* strtok(char* restrict s1, const char* restrict s2);
+void* memset(void* s, int c, size_t n);
+char* strerror(int errnum);
+size_t strlen(const char* s);
+
+*/
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#include_next <string.h>
+
+// MSVCRT, GNU libc and its derivates may already have the correct prototype in
+// <string.h>. This macro can be defined by users if their C library provides
+// the right signature.
+#if defined(__CORRECT_ISO_CPP_STRING_H_PROTO) || defined(_LIBCPP_MSVCRT) || \
+ defined(__sun__) || defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_)
+#define _LIBCPP_STRING_H_HAS_CONST_OVERLOADS
+#endif
+
+#if defined(__cplusplus) && !defined(_LIBCPP_STRING_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
+extern "C++" {
+inline _LIBCPP_INLINE_VISIBILITY
+char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const char* strpbrk(const char* __s1, const char* __s2) {return __libcpp_strpbrk(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ char* strpbrk( char* __s1, const char* __s2) {return __libcpp_strpbrk(__s1, __s2);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const char* strrchr(const char* __s, int __c) {return __libcpp_strrchr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ char* strrchr( char* __s, int __c) {return __libcpp_strrchr(__s, __c);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const void* memchr(const void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ void* memchr( void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const char* strstr(const char* __s1, const char* __s2) {return __libcpp_strstr(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ char* strstr( char* __s1, const char* __s2) {return __libcpp_strstr(__s1, __s2);}
+}
+#endif
+
+#endif // _LIBCPP_STRING_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/string_view b/chromium/buildtools/third_party/libc++/trunk/include/string_view
new file mode 100644
index 00000000000..e59f099f16e
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/string_view
@@ -0,0 +1,787 @@
+// -*- C++ -*-
+//===------------------------ string_view ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_STRING_VIEW
+#define _LIBCPP_STRING_VIEW
+
+/*
+string_view synopsis
+
+namespace std {
+
+ // 7.2, Class template basic_string_view
+ template<class charT, class traits = char_traits<charT>>
+ class basic_string_view;
+
+ // 7.9, basic_string_view non-member comparison functions
+ template<class charT, class traits>
+ constexpr bool operator==(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator!=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator< (basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator> (basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator<=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator>=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ // see below, sufficient additional overloads of comparison functions
+
+ // 7.10, Inserters and extractors
+ template<class charT, class traits>
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os,
+ basic_string_view<charT, traits> str);
+
+ // basic_string_view typedef names
+ typedef basic_string_view<char> string_view;
+ typedef basic_string_view<char16_t> u16string_view;
+ typedef basic_string_view<char32_t> u32string_view;
+ typedef basic_string_view<wchar_t> wstring_view;
+
+ template<class charT, class traits = char_traits<charT>>
+ class basic_string_view {
+ public:
+ // types
+ typedef traits traits_type;
+ typedef charT value_type;
+ typedef charT* pointer;
+ typedef const charT* const_pointer;
+ typedef charT& reference;
+ typedef const charT& const_reference;
+ typedef implementation-defined const_iterator;
+ typedef const_iterator iterator;
+ typedef reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef const_reverse_iterator reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ static constexpr size_type npos = size_type(-1);
+
+ // 7.3, basic_string_view constructors and assignment operators
+ constexpr basic_string_view() noexcept;
+ constexpr basic_string_view(const basic_string_view&) noexcept = default;
+ basic_string_view& operator=(const basic_string_view&) noexcept = default;
+ template<class Allocator>
+ constexpr basic_string_view(const charT* str);
+ constexpr basic_string_view(const charT* str, size_type len);
+
+ // 7.4, basic_string_view iterator support
+ constexpr const_iterator begin() const noexcept;
+ constexpr const_iterator end() const noexcept;
+ constexpr const_iterator cbegin() const noexcept;
+ constexpr const_iterator cend() const noexcept;
+ const_reverse_iterator rbegin() const noexcept;
+ const_reverse_iterator rend() const noexcept;
+ const_reverse_iterator crbegin() const noexcept;
+ const_reverse_iterator crend() const noexcept;
+
+ // 7.5, basic_string_view capacity
+ constexpr size_type size() const noexcept;
+ constexpr size_type length() const noexcept;
+ constexpr size_type max_size() const noexcept;
+ constexpr bool empty() const noexcept;
+
+ // 7.6, basic_string_view element access
+ constexpr const_reference operator[](size_type pos) const;
+ constexpr const_reference at(size_type pos) const;
+ constexpr const_reference front() const;
+ constexpr const_reference back() const;
+ constexpr const_pointer data() const noexcept;
+
+ // 7.7, basic_string_view modifiers
+ constexpr void remove_prefix(size_type n);
+ constexpr void remove_suffix(size_type n);
+ constexpr void swap(basic_string_view& s) noexcept;
+
+ size_type copy(charT* s, size_type n, size_type pos = 0) const;
+
+ constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
+ constexpr int compare(basic_string_view s) const noexcept;
+ constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const;
+ constexpr int compare(size_type pos1, size_type n1,
+ basic_string_view s, size_type pos2, size_type n2) const;
+ constexpr int compare(const charT* s) const;
+ constexpr int compare(size_type pos1, size_type n1, const charT* s) const;
+ constexpr int compare(size_type pos1, size_type n1,
+ const charT* s, size_type n2) const;
+ constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find(const charT* s, size_type pos = 0) const;
+ constexpr size_type rfind(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type rfind(charT c, size_type pos = npos) const noexcept;
+ constexpr size_type rfind(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type rfind(const charT* s, size_type pos = npos) const;
+ constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_first_of(const charT* s, size_type pos = 0) const;
+ constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_last_of(const charT* s, size_type pos = npos) const;
+ constexpr size_type find_first_not_of(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const;
+ constexpr size_type find_last_not_of(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
+
+ private:
+ const_pointer data_; // exposition only
+ size_type size_; // exposition only
+ };
+
+ // 7.11, Hash support
+ template <class T> struct hash;
+ template <> struct hash<string_view>;
+ template <> struct hash<u16string_view>;
+ template <> struct hash<u32string_view>;
+ template <> struct hash<wstring_view>;
+
+ constexpr basic_string<char> operator "" s( const char *str, size_t len ); // C++17
+ constexpr basic_string<wchar_t> operator "" s( const wchar_t *str, size_t len ); // C++17
+ constexpr basic_string<char16_t> operator "" s( const char16_t *str, size_t len ); // C++17
+ constexpr basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++17
+
+} // namespace std
+
+
+*/
+
+#include <__config>
+
+#include <__string>
+#include <algorithm>
+#include <iterator>
+#include <limits>
+#include <stdexcept>
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+template<class _CharT, class _Traits = char_traits<_CharT> >
+class _LIBCPP_TEMPLATE_VIS basic_string_view {
+public:
+ // types
+ typedef _Traits traits_type;
+ typedef _CharT value_type;
+ typedef const _CharT* pointer;
+ typedef const _CharT* const_pointer;
+ typedef const _CharT& reference;
+ typedef const _CharT& const_reference;
+ typedef const_pointer const_iterator; // See [string.view.iterators]
+ typedef const_iterator iterator;
+ typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef const_reverse_iterator reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1);
+
+ static_assert(is_pod<value_type>::value, "Character type of basic_string_view must be a POD");
+ static_assert((is_same<_CharT, typename traits_type::char_type>::value),
+ "traits_type::char_type must be the same type as CharT");
+
+ // [string.view.cons], construct/copy
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view() _NOEXCEPT : __data (nullptr), __size(0) {}
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const basic_string_view&) _NOEXCEPT = default;
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default;
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const _CharT* __s, size_type __len)
+ : __data(__s), __size(__len)
+ {
+// #if _LIBCPP_STD_VER > 11
+// _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr");
+// #endif
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const _CharT* __s)
+ : __data(__s), __size(_Traits::length(__s)) {}
+
+ // [string.view.iterators], iterators
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator begin() const _NOEXCEPT { return cbegin(); }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator end() const _NOEXCEPT { return cend(); }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator cbegin() const _NOEXCEPT { return __data; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator cend() const _NOEXCEPT { return __data + __size; }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX14 _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX14 _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(cbegin()); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX14 _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator crbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX14 _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator crend() const _NOEXCEPT { return const_reverse_iterator(cbegin()); }
+
+ // [string.view.capacity], capacity
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type size() const _NOEXCEPT { return __size; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type length() const _NOEXCEPT { return __size; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type max_size() const _NOEXCEPT { return numeric_limits<size_type>::max(); }
+
+ _LIBCPP_CONSTEXPR bool _LIBCPP_INLINE_VISIBILITY
+ empty() const _NOEXCEPT { return __size == 0; }
+
+ // [string.view.access], element access
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference operator[](size_type __pos) const _NOEXCEPT { return __data[__pos]; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference at(size_type __pos) const
+ {
+ return __pos >= size()
+ ? (__throw_out_of_range("string_view::at"), __data[0])
+ : __data[__pos];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference front() const
+ {
+ return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data[0];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference back() const
+ {
+ return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data[__size-1];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_pointer data() const _NOEXCEPT { return __data; }
+
+ // [string.view.modifiers], modifiers:
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void remove_prefix(size_type __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()");
+ __data += __n;
+ __size -= __n;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void remove_suffix(size_type __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__n <= size(), "remove_suffix() can't remove more than size()");
+ __size -= __n;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void swap(basic_string_view& __other) _NOEXCEPT
+ {
+ const value_type *__p = __data;
+ __data = __other.__data;
+ __other.__data = __p;
+
+ size_type __sz = __size;
+ __size = __other.__size;
+ __other.__size = __sz;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const
+ {
+ if (__pos > size())
+ __throw_out_of_range("string_view::copy");
+ size_type __rlen = _VSTD::min(__n, size() - __pos);
+ _Traits::copy(__s, data() + __pos, __rlen);
+ return __rlen;
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view substr(size_type __pos = 0, size_type __n = npos) const
+ {
+ return __pos > size()
+ ? (__throw_out_of_range("string_view::substr"), basic_string_view())
+ : basic_string_view(data() + __pos, _VSTD::min(__n, size() - __pos));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 int compare(basic_string_view __sv) const _NOEXCEPT
+ {
+ size_type __rlen = _VSTD::min( size(), __sv.size());
+ int __retval = _Traits::compare(data(), __sv.data(), __rlen);
+ if ( __retval == 0 ) // first __rlen chars matched
+ __retval = size() == __sv.size() ? 0 : ( size() < __sv.size() ? -1 : 1 );
+ return __retval;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, basic_string_view __sv) const
+ {
+ return substr(__pos1, __n1).compare(__sv);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare( size_type __pos1, size_type __n1,
+ basic_string_view _sv, size_type __pos2, size_type __n2) const
+ {
+ return substr(__pos1, __n1).compare(_sv.substr(__pos2, __n2));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(const _CharT* __s) const _NOEXCEPT
+ {
+ return compare(basic_string_view(__s));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, const _CharT* __s) const
+ {
+ return substr(__pos1, __n1).compare(basic_string_view(__s));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const
+ {
+ return substr(__pos1, __n1).compare(basic_string_view(__s, __n2));
+ }
+
+ // find
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(_CharT __c, size_type __pos = 0) const _NOEXCEPT
+ {
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(const _CharT* __s, size_type __pos = 0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): received nullptr");
+ return __str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // rfind
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(_CharT __c, size_type __pos = npos) const _NOEXCEPT
+ {
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): received nullptr");
+ return __str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_first_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): received nullptr");
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(_CharT __c, size_type __pos = 0) const _NOEXCEPT
+ { return find(__c, __pos); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(const _CharT* __s, size_type __pos=0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): received nullptr");
+ return __str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_last_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): received nullptr");
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(_CharT __c, size_type __pos = npos) const _NOEXCEPT
+ { return rfind(__c, __pos); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): received nullptr");
+ return __str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_first_not_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(basic_string_view __s, size_type __pos=0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): received nullptr");
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(_CharT __c, size_type __pos=0) const _NOEXCEPT
+ {
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
+ return __str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_last_not_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): received nullptr");
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(_CharT __c, size_type __pos=npos) const _NOEXCEPT
+ {
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
+ return __str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+private:
+ const value_type* __data;
+ size_type __size;
+};
+
+
+// [string.view.comparison]
+// operator ==
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator==(basic_string_view<_CharT, _Traits> __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator==(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator==(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+}
+
+
+// operator !=
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator!=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator!=(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator!=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+}
+
+
+// operator <
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) < 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) < 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) < 0;
+}
+
+
+// operator >
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator> (basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) > 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) > 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) > 0;
+}
+
+
+// operator <=
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) <= 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<=(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) <= 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator<=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) <= 0;
+}
+
+
+// operator >=
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) >= 0;
+}
+
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>=(basic_string_view<_CharT, _Traits> __lhs,
+ typename common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) >= 0;
+}
+
+template<class _CharT, class _Traits>
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+bool operator>=(typename common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+{
+ return __lhs.compare(__rhs) >= 0;
+}
+
+typedef basic_string_view<char> string_view;
+typedef basic_string_view<char16_t> u16string_view;
+typedef basic_string_view<char32_t> u32string_view;
+typedef basic_string_view<wchar_t> wstring_view;
+
+// [string.view.hash]
+template<class _CharT, class _Traits>
+struct _LIBCPP_TEMPLATE_VIS hash<basic_string_view<_CharT, _Traits> >
+ : public unary_function<basic_string_view<_CharT, _Traits>, size_t>
+{
+ size_t operator()(const basic_string_view<_CharT, _Traits> __val) const _NOEXCEPT;
+};
+
+template<class _CharT, class _Traits>
+size_t
+hash<basic_string_view<_CharT, _Traits> >::operator()(
+ const basic_string_view<_CharT, _Traits> __val) const _NOEXCEPT
+{
+ return __do_string_hash(__val.data(), __val.data() + __val.size());
+}
+
+
+#if _LIBCPP_STD_VER > 11
+inline namespace literals
+{
+ inline namespace string_view_literals
+ {
+ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ basic_string_view<char> operator "" sv(const char *__str, size_t __len)
+ {
+ return basic_string_view<char> (__str, __len);
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len)
+ {
+ return basic_string_view<wchar_t> (__str, __len);
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len)
+ {
+ return basic_string_view<char16_t> (__str, __len);
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ basic_string_view<char32_t> operator "" sv(const char32_t *__str, size_t __len)
+ {
+ return basic_string_view<char32_t> (__str, __len);
+ }
+ }
+}
+#endif
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_STRING_VIEW
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/strstream b/chromium/buildtools/third_party/libc++/trunk/include/strstream
index 81eef2ab484..b00b9d830df 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/strstream
+++ b/chromium/buildtools/third_party/libc++/trunk/include/strstream
@@ -151,12 +151,12 @@ public:
strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0);
strstreambuf(const unsigned char* __gnext, streamsize __n);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
strstreambuf(strstreambuf&& __rhs);
_LIBCPP_INLINE_VISIBILITY
strstreambuf& operator=(strstreambuf&& __rhs);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
virtual ~strstreambuf();
@@ -191,7 +191,7 @@ private:
void __init(char* __gnext, streamsize __n, char* __pbeg);
};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
inline _LIBCPP_INLINE_VISIBILITY
strstreambuf::strstreambuf(strstreambuf&& __rhs)
@@ -226,7 +226,7 @@ strstreambuf::operator=(strstreambuf&& __rhs)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
class _LIBCPP_TYPE_VIS istrstream
: public istream
@@ -245,7 +245,7 @@ public:
istrstream(char* __s, streamsize __n)
: istream(&__sb_), __sb_(__s, __n) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
istrstream(istrstream&& __rhs)
: istream(_VSTD::move(__rhs)),
@@ -261,7 +261,7 @@ public:
__sb_ = _VSTD::move(__rhs.__sb_);
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
virtual ~istrstream();
@@ -294,7 +294,7 @@ public:
__sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
ostrstream(ostrstream&& __rhs)
: ostream(_VSTD::move(__rhs)),
@@ -310,7 +310,7 @@ public:
__sb_ = _VSTD::move(__rhs.__sb_);
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
virtual ~ostrstream();
@@ -354,7 +354,7 @@ public:
__sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
strstream(strstream&& __rhs)
: iostream(_VSTD::move(__rhs)),
@@ -370,7 +370,7 @@ public:
__sb_ = _VSTD::move(__rhs.__sb_);
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
virtual ~strstream();
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/android/locale_bionic.h b/chromium/buildtools/third_party/libc++/trunk/include/support/android/locale_bionic.h
index 3a020da67e6..482e2343358 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/android/locale_bionic.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/android/locale_bionic.h
@@ -11,7 +11,7 @@
#ifndef _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
#define _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
-#if defined(__ANDROID__)
+#if defined(__BIONIC__)
#ifdef __cplusplus
extern "C" {
@@ -24,8 +24,8 @@ extern "C" {
}
#endif
-// Share implementation with Newlib
-#include <support/xlocale/xlocale.h>
+#include <support/xlocale/__posix_l_fallback.h>
+#include <support/xlocale/__strtonum_fallback.h>
-#endif // defined(__ANDROID__)
+#endif // defined(__BIONIC__)
#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/fuchsia/xlocale.h b/chromium/buildtools/third_party/libc++/trunk/include/support/fuchsia/xlocale.h
new file mode 100644
index 00000000000..1de2fca28e2
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/fuchsia/xlocale.h
@@ -0,0 +1,23 @@
+// -*- C++ -*-
+//===------------------- support/fuchsia/xlocale.h ------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
+#define _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
+
+#if defined(__Fuchsia__)
+
+#include <cstdlib>
+#include <cwchar>
+#include <support/xlocale/__posix_l_fallback.h>
+#include <support/xlocale/__strtonum_fallback.h>
+
+#endif // defined(__Fuchsia__)
+
+#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/ibm/locale_mgmt_aix.h b/chromium/buildtools/third_party/libc++/trunk/include/support/ibm/locale_mgmt_aix.h
new file mode 100644
index 00000000000..e3b7a78c45a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/ibm/locale_mgmt_aix.h
@@ -0,0 +1,85 @@
+// -*- C++ -*-
+//===------------------- support/ibm/locale_mgmt_aix.h --------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
+#define _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
+
+#if defined(_AIX)
+#include "cstdlib"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined(_AIX71)
+// AIX 7.1 and higher has these definitions. Definitions and stubs
+// are provied here as a temporary workaround on AIX 6.1.
+
+#define LC_COLLATE_MASK 1
+#define LC_CTYPE_MASK 2
+#define LC_MESSAGES_MASK 4
+#define LC_MONETARY_MASK 8
+#define LC_NUMERIC_MASK 16
+#define LC_TIME_MASK 32
+#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | \
+ LC_MESSAGES_MASK | LC_MONETARY_MASK |\
+ LC_NUMERIC_MASK | LC_TIME_MASK)
+
+typedef void* locale_t;
+
+// The following are stubs. They are not supported on AIX 6.1.
+static inline
+locale_t newlocale(int category_mask, const char *locale, locale_t base)
+{
+ _LC_locale_t *newloc, *loc;
+ if ((loc = (_LC_locale_t *)__xopen_locale(locale)) == NULL)
+ {
+ errno = EINVAL;
+ return (locale_t)0;
+ }
+ if ((newloc = (_LC_locale_t *)calloc(1, sizeof(_LC_locale_t))) == NULL)
+ {
+ errno = ENOMEM;
+ return (locale_t)0;
+ }
+ if (!base)
+ base = (_LC_locale_t *)__xopen_locale("C");
+ memcpy(newloc, base, sizeof (_LC_locale_t));
+ if (category_mask & LC_COLLATE_MASK)
+ newloc->lc_collate = loc->lc_collate;
+ if (category_mask & LC_CTYPE_MASK)
+ newloc->lc_ctype = loc->lc_ctype;
+ //if (category_mask & LC_MESSAGES_MASK)
+ // newloc->lc_messages = loc->lc_messages;
+ if (category_mask & LC_MONETARY_MASK)
+ newloc->lc_monetary = loc->lc_monetary;
+ if (category_mask & LC_TIME_MASK)
+ newloc->lc_time = loc->lc_time;
+ if (category_mask & LC_NUMERIC_MASK)
+ newloc->lc_numeric = loc->lc_numeric;
+ return (locale_t)newloc;
+}
+static inline
+void freelocale(locale_t locobj)
+{
+ free(locobj);
+}
+static inline
+locale_t uselocale(locale_t newloc)
+{
+ return (locale_t)0;
+}
+#endif // !defined(_AIX71)
+
+#ifdef __cplusplus
+}
+#endif
+#endif // defined(_AIX)
+#endif // _LIBCPP_SUPPORT_IBM_LOCALE_MGMT_AIX_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/ibm/xlocale.h b/chromium/buildtools/third_party/libc++/trunk/include/support/ibm/xlocale.h
index 8d99a5c7d34..f39c0ba95d9 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/ibm/xlocale.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/ibm/xlocale.h
@@ -10,6 +10,7 @@
#ifndef _LIBCPP_SUPPORT_IBM_XLOCALE_H
#define _LIBCPP_SUPPORT_IBM_XLOCALE_H
+#include <support/ibm/locale_mgmt_aix.h>
#if defined(_AIX)
#include "cstdlib"
@@ -21,62 +22,6 @@ extern "C" {
#if !defined(_AIX71)
// AIX 7.1 and higher has these definitions. Definitions and stubs
// are provied here as a temporary workaround on AIX 6.1.
-
-#define LC_COLLATE_MASK 1
-#define LC_CTYPE_MASK 2
-#define LC_MESSAGES_MASK 4
-#define LC_MONETARY_MASK 8
-#define LC_NUMERIC_MASK 16
-#define LC_TIME_MASK 32
-#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | \
- LC_MESSAGES_MASK | LC_MONETARY_MASK |\
- LC_NUMERIC_MASK | LC_TIME_MASK)
-
-typedef void* locale_t;
-
-// The following are stubs. They are not supported on AIX 6.1.
-static inline
-locale_t newlocale(int category_mask, const char *locale, locale_t base)
-{
- _LC_locale_t *newloc, *loc;
- if ((loc = (_LC_locale_t *)__xopen_locale(locale)) == NULL)
- {
- errno = EINVAL;
- return (locale_t)0;
- }
- if ((newloc = (_LC_locale_t *)calloc(1, sizeof(_LC_locale_t))) == NULL)
- {
- errno = ENOMEM;
- return (locale_t)0;
- }
- if (!base)
- base = (_LC_locale_t *)__xopen_locale("C");
- memcpy(newloc, base, sizeof (_LC_locale_t));
- if (category_mask & LC_COLLATE_MASK)
- newloc->lc_collate = loc->lc_collate;
- if (category_mask & LC_CTYPE_MASK)
- newloc->lc_ctype = loc->lc_ctype;
- //if (category_mask & LC_MESSAGES_MASK)
- // newloc->lc_messages = loc->lc_messages;
- if (category_mask & LC_MONETARY_MASK)
- newloc->lc_monetary = loc->lc_monetary;
- if (category_mask & LC_TIME_MASK)
- newloc->lc_time = loc->lc_time;
- if (category_mask & LC_NUMERIC_MASK)
- newloc->lc_numeric = loc->lc_numeric;
- return (locale_t)newloc;
-}
-static inline
-void freelocale(locale_t locobj)
-{
- free(locobj);
-}
-static inline
-locale_t uselocale(locale_t newloc)
-{
- return (locale_t)0;
-}
-
static inline
int isalnum_l(int c, locale_t locale)
{
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/newlib/xlocale.h b/chromium/buildtools/third_party/libc++/trunk/include/support/newlib/xlocale.h
index d067cf85a3b..4e4b23be8d6 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/newlib/xlocale.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/newlib/xlocale.h
@@ -16,47 +16,9 @@
#include <clocale>
#include <cwctype>
#include <ctype.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Patch over newlib's lack of extended locale support
-typedef void *locale_t;
-static inline locale_t duplocale(locale_t) {
- return NULL;
-}
-
-static inline void freelocale(locale_t) {
-}
-
-static inline locale_t newlocale(int, const char *, locale_t) {
- return NULL;
-}
-
-static inline locale_t uselocale(locale_t) {
- return NULL;
-}
-
-#define LC_COLLATE_MASK (1 << LC_COLLATE)
-#define LC_CTYPE_MASK (1 << LC_CTYPE)
-#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
-#define LC_MONETARY_MASK (1 << LC_MONETARY)
-#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
-#define LC_TIME_MASK (1 << LC_TIME)
-#define LC_ALL_MASK (LC_COLLATE_MASK|\
- LC_CTYPE_MASK|\
- LC_MONETARY_MASK|\
- LC_NUMERIC_MASK|\
- LC_TIME_MASK|\
- LC_MESSAGES_MASK)
-
-// Share implementation with Android's Bionic
-#include <support/xlocale/xlocale.h>
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+#include <support/xlocale/__nop_locale_mgmt.h>
+#include <support/xlocale/__posix_l_fallback.h>
+#include <support/xlocale/__strtonum_fallback.h>
#endif // _NEWLIB_VERSION
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/solaris/xlocale.h b/chromium/buildtools/third_party/libc++/trunk/include/support/solaris/xlocale.h
index 62b0d74a6d2..e20ef7a6e53 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/solaris/xlocale.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/solaris/xlocale.h
@@ -44,11 +44,6 @@ long strtol_l(const char *__nptr, char **__endptr,
return strtol(__nptr, __endptr, __base);
}
static inline
-long double strtold_l(const char *__nptr, char **__endptr,
- locale_t __loc) {
- return strtold(__nptr, __endptr);
-}
-static inline
unsigned long long strtoull_l(const char *__nptr, char **__endptr,
int __base, locale_t __loc) {
return strtoull(__nptr, __endptr, __base);
@@ -58,6 +53,21 @@ unsigned long strtoul_l(const char *__nptr, char **__endptr,
int __base, locale_t __loc) {
return strtoul(__nptr, __endptr, __base);
}
+static inline
+float strtof_l(const char *__nptr, char **__endptr,
+ locale_t __loc) {
+ return strtof(__nptr, __endptr);
+}
+static inline
+double strtod_l(const char *__nptr, char **__endptr,
+ locale_t __loc) {
+ return strtod(__nptr, __endptr);
+}
+static inline
+long double strtold_l(const char *__nptr, char **__endptr,
+ locale_t __loc) {
+ return strtold(__nptr, __endptr);
+}
#ifdef __cplusplus
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/win32/limits_win32.h b/chromium/buildtools/third_party/libc++/trunk/include/support/win32/limits_msvc_win32.h
index 406cd3025bf..1ab2e0b6dc1 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/win32/limits_win32.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/win32/limits_msvc_win32.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
-//===--------------------- support/win32/limits_win32.h -------------------===//
+//===------------------ support/win32/limits_msvc_win32.h -----------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -8,17 +8,21 @@
//
//===----------------------------------------------------------------------===//
-#ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H
-#define _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H
+#ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
+#define _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
#if !defined(_LIBCPP_MSVCRT)
#error "This header complements the Microsoft C Runtime library, and should not be included otherwise."
-#else
+#endif
+#if defined(__clang__)
+#error "This header should only be included when using Microsofts C1XX frontend"
+#endif
#include <limits.h> // CHAR_BIT
#include <float.h> // limit constants
+#include <math.h> // HUGE_VAL
+#include <ymath.h> // internal MSVC header providing the needed functionality
-#if ! defined(__clang__)
#define __CHAR_BIT__ CHAR_BIT
#define __FLT_MANT_DIG__ FLT_MANT_DIG
@@ -61,19 +65,8 @@
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
// __builtin replacements/workarounds
-#include <math.h> // HUGE_VAL
-#include <ymath.h> // internal MSVC header providing the needed functionality
-#define __builtin_huge_val() HUGE_VAL
-#define __builtin_huge_valf() _FInf._Float
#define __builtin_huge_vall() _LInf._Long_double
-#define __builtin_nan(__dummy) _Nan._Double
-#define __builtin_nanf(__dummy) _FNan._Float
#define __builtin_nanl(__dummmy) _LNan._Long_double
-#define __builtin_nans(__dummy) _Snan._Double
-#define __builtin_nansf(__dummy) _FSnan._Float
#define __builtin_nansl(__dummy) _LSnan._Long_double
-#endif // ! defined(__clang__)
-
-#endif // _LIBCPP_MSVCRT
-#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H
+#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/win32/locale_win32.h b/chromium/buildtools/third_party/libc++/trunk/include/support/win32/locale_win32.h
index f728d234472..7a6c44ca900 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/win32/locale_win32.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/win32/locale_win32.h
@@ -11,14 +11,10 @@
#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
#define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
-// ctype mask table defined in msvcrt.dll
-extern "C" unsigned short __declspec(dllimport) _ctype[];
-
-#include "support/win32/support.h"
+#include <__config>
#include <stdio.h>
-#include <memory>
#include <xlocinfo.h> // _locale_t
-#define locale_t _locale_t
+
#define LC_COLLATE_MASK _M_COLLATE
#define LC_CTYPE_MASK _M_CTYPE
#define LC_MONETARY_MASK _M_MONETARY
@@ -31,10 +27,16 @@ extern "C" unsigned short __declspec(dllimport) _ctype[];
| LC_MONETARY_MASK \
| LC_NUMERIC_MASK \
| LC_TIME_MASK )
+
+#define locale_t _locale_t
+
+// Locale management functions
#define freelocale _free_locale
// FIXME: base currently unused. Needs manual work to construct the new locale
locale_t newlocale( int mask, const char * locale, locale_t base );
locale_t uselocale( locale_t newloc );
+
+
lconv *localeconv_l( locale_t loc );
size_t mbrlen_l( const char *__restrict s, size_t n,
mbstate_t *__restrict ps, locale_t loc);
@@ -50,21 +52,19 @@ size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src,
size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc);
wint_t btowc_l( int c, locale_t loc );
int wctob_l( wint_t c, locale_t loc );
-typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
-typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
inline _LIBCPP_ALWAYS_INLINE
decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l )
{
- __locale_raii __current( uselocale(__l), uselocale );
- return MB_CUR_MAX;
+ return ___mb_cur_max_l_func(__l);
}
// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
#define mbtowc_l _mbtowc_l
#define strtoll_l _strtoi64_l
#define strtoull_l _strtoui64_l
-// FIXME: current msvcrt does not know about long double
-#define strtold_l _strtod_l
+#define strtof_l _strtof_l
+#define strtod_l _strtod_l
+#define strtold_l _strtold_l
inline _LIBCPP_INLINE_VISIBILITY
int
@@ -105,10 +105,9 @@ isupper_l(int c, _locale_t loc)
#define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
#define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
#define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
-int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...);
-int asprintf_l( char **ret, locale_t loc, const char *format, ... );
-int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
-
+_LIBCPP_FUNC_VIS int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...);
+_LIBCPP_FUNC_VIS int asprintf_l( char **ret, locale_t loc, const char *format, ... );
+_LIBCPP_FUNC_VIS int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
// not-so-pressing FIXME: use locale to determine blank characters
inline int isblank_l( int c, locale_t /*loc*/ )
@@ -120,10 +119,4 @@ inline int iswblank_l( wint_t c, locale_t /*loc*/ )
return ( c == L' ' || c == L'\t' );
}
-#if defined(_LIBCPP_MSVCRT)
-inline int isblank( int c, locale_t /*loc*/ )
-{ return ( c == ' ' || c == '\t' ); }
-inline int iswblank( wint_t c, locale_t /*loc*/ )
-{ return ( c == L' ' || c == L'\t' ); }
-#endif // _LIBCPP_MSVCRT
#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/win32/math_win32.h b/chromium/buildtools/third_party/libc++/trunk/include/support/win32/math_win32.h
deleted file mode 100644
index 0d6b422a165..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/win32/math_win32.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// -*- C++ -*-
-//===---------------------- support/win32/math_win32.h --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H
-#define _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H
-
-#if !defined(_LIBCPP_MSVCRT)
-#error "This header complements Microsoft's C Runtime library, and should not be included otherwise."
-#else
-
-#include <math.h>
-#include <float.h> // _FPCLASS_PN etc.
-#include <crtversion.h>
-
-#if ((_VC_CRT_MAJOR_VERSION-0) < 12)
-// Necessary?
-typedef float float_t;
-typedef double double_t;
-
-_LIBCPP_ALWAYS_INLINE bool isfinite( double num )
-{
- return _finite(num) != 0;
-}
-_LIBCPP_ALWAYS_INLINE bool isinf( double num )
-{
- return !isfinite(num) && !_isnan(num);
-}
-_LIBCPP_ALWAYS_INLINE bool isnan( double num )
-{
- return _isnan(num) != 0;
-}
-_LIBCPP_ALWAYS_INLINE bool isnormal( double num )
-{
- int class_ = _fpclass(num);
- return class_ == _FPCLASS_NN || class_ == _FPCLASS_PN;
-}
-
-_LIBCPP_ALWAYS_INLINE bool isgreater( double x, double y )
-{
- if(_fpclass(x) == _FPCLASS_SNAN || _fpclass(y) == _FPCLASS_SNAN) return false;
- else return x > y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool isgreaterequal( double x, double y )
-{
- if(_fpclass(x) == _FPCLASS_SNAN || _fpclass(y) == _FPCLASS_SNAN) return false;
- else return x >= y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool isless( double x, double y )
-{
- if(_fpclass(x) == _FPCLASS_SNAN || _fpclass(y) == _FPCLASS_SNAN) return false;
- else return x < y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool islessequal( double x, double y )
-{
- if(::_fpclass(x) == _FPCLASS_SNAN || ::_fpclass(y) == _FPCLASS_SNAN) return false;
- else return x <= y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool islessgreater( double x, double y )
-{
- if(::_fpclass(x) == _FPCLASS_SNAN || ::_fpclass(y) == _FPCLASS_SNAN) return false;
- else return x < y || x > y;
-}
-
-_LIBCPP_ALWAYS_INLINE bool isunordered( double x, double y )
-{
- return isnan(x) || isnan(y);
-}
-_LIBCPP_ALWAYS_INLINE bool signbit( double num )
-{
- switch(_fpclass(num))
- {
- case _FPCLASS_SNAN:
- case _FPCLASS_QNAN:
- case _FPCLASS_NINF:
- case _FPCLASS_NN:
- case _FPCLASS_ND:
- case _FPCLASS_NZ:
- return true;
- case _FPCLASS_PZ:
- case _FPCLASS_PD:
- case _FPCLASS_PN:
- case _FPCLASS_PINF:
- return false;
- }
- return false;
-}
-_LIBCPP_ALWAYS_INLINE float copysignf( float x, float y )
-{
- return (signbit (x) != signbit (y) ? - x : x);
-}
-_LIBCPP_ALWAYS_INLINE double copysign( double x, double y )
-{
- return ::_copysign(x,y);
-}
-_LIBCPP_ALWAYS_INLINE double copysignl( long double x, long double y )
-{
- return ::_copysignl(x,y);
-}
-_LIBCPP_ALWAYS_INLINE int fpclassify( double num )
-{
- return _fpclass(num);
-}
-#endif
-#endif // _LIBCPP_MSVCRT
-
-#endif // _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/win32/support.h b/chromium/buildtools/third_party/libc++/trunk/include/support/win32/support.h
deleted file mode 100644
index 5765babcd13..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/win32/support.h
+++ /dev/null
@@ -1,206 +0,0 @@
-// -*- C++ -*-
-//===----------------------- support/win32/support.h ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_SUPPORT_WIN32_SUPPORT_H
-#define _LIBCPP_SUPPORT_WIN32_SUPPORT_H
-
-// Functions and constants used in libc++ that
-// are missing from the Windows C library.
-
-#include <wchar.h> // mbstate_t
-#include <cstdarg> // va_ macros
-// "builtins" not implemented here for Clang or GCC as they provide
-// implementations. Assuming required for elsewhere else, certainly MSVC.
-#if defined(_LIBCPP_MSVC)
-#include <intrin.h>
-#endif
-#if defined(_LIBCPP_MSVCRT)
-#include <xlocinfo.h>
-#endif
-#define swprintf _snwprintf
-#define vswprintf _vsnwprintf
-
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-
-// The mingw headers already define these as static.
-#ifndef __MINGW32__
-extern "C" {
-
-int vasprintf(char **sptr, const char *__restrict fmt, va_list ap);
-int asprintf(char **sptr, const char *__restrict fmt, ...);
-size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
- size_t nmc, size_t len, mbstate_t *__restrict ps);
-size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
- size_t nwc, size_t len, mbstate_t *__restrict ps);
-}
-#endif // __MINGW32__
-
-#if defined(_LIBCPP_MSVCRT)
-#define snprintf _snprintf
-#define atoll _atoi64
-#define strtoll _strtoi64
-#define strtoull _strtoui64
-#define wcstoll _wcstoi64
-#define wcstoull _wcstoui64
-_LIBCPP_ALWAYS_INLINE float strtof(const char *nptr, char **endptr)
-{
- return _Stof(nptr, endptr, 0);
-}
-_LIBCPP_ALWAYS_INLINE double strtod(const char *nptr, char **endptr)
-{
- return _Stod(nptr, endptr, 0);
-}
-_LIBCPP_ALWAYS_INLINE long double strtold(const char *nptr, char **endptr)
-{
- return _Stold(nptr, endptr, 0);
-}
-
-#define _Exit _exit
-#endif
-
-#if defined(_LIBCPP_MSVC)
-
-// Bit builtin's make these assumptions when calling _BitScanForward/Reverse
-// etc. These assumptions are expected to be true for Win32/Win64 which this
-// file supports.
-static_assert(sizeof(unsigned long long) == 8, "");
-static_assert(sizeof(unsigned long) == 4, "");
-static_assert(sizeof(unsigned int) == 4, "");
-
-_LIBCPP_ALWAYS_INLINE int __builtin_popcount(unsigned int x)
-{
- // Binary: 0101...
- static const unsigned int m1 = 0x55555555;
- // Binary: 00110011..
- static const unsigned int m2 = 0x33333333;
- // Binary: 4 zeros, 4 ones ...
- static const unsigned int m4 = 0x0f0f0f0f;
- // The sum of 256 to the power of 0,1,2,3...
- static const unsigned int h01 = 0x01010101;
- // Put count of each 2 bits into those 2 bits.
- x -= (x >> 1) & m1;
- // Put count of each 4 bits into those 4 bits.
- x = (x & m2) + ((x >> 2) & m2);
- // Put count of each 8 bits into those 8 bits.
- x = (x + (x >> 4)) & m4;
- // Returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24).
- return (x * h01) >> 24;
-}
-
-_LIBCPP_ALWAYS_INLINE int __builtin_popcountl(unsigned long x)
-{
- return __builtin_popcount(static_cast<int>(x));
-}
-
-_LIBCPP_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x)
-{
- // Binary: 0101...
- static const unsigned long long m1 = 0x5555555555555555;
- // Binary: 00110011..
- static const unsigned long long m2 = 0x3333333333333333;
- // Binary: 4 zeros, 4 ones ...
- static const unsigned long long m4 = 0x0f0f0f0f0f0f0f0f;
- // The sum of 256 to the power of 0,1,2,3...
- static const unsigned long long h01 = 0x0101010101010101;
- // Put count of each 2 bits into those 2 bits.
- x -= (x >> 1) & m1;
- // Put count of each 4 bits into those 4 bits.
- x = (x & m2) + ((x >> 2) & m2);
- // Put count of each 8 bits into those 8 bits.
- x = (x + (x >> 4)) & m4;
- // Returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ...
- return static_cast<int>((x * h01) >> 56);
-}
-
-// Returns the number of trailing 0-bits in x, starting at the least significant
-// bit position. If x is 0, the result is undefined.
-_LIBCPP_ALWAYS_INLINE int __builtin_ctzll(unsigned long long mask)
-{
- unsigned long where;
-// Search from LSB to MSB for first set bit.
-// Returns zero if no set bit is found.
-#if defined(_WIN64)
- if (_BitScanForward64(&where, mask))
- return static_cast<int>(where);
-#elif defined(_WIN32)
- // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
- // Scan the Low Word.
- if (_BitScanForward(&where, static_cast<unsigned long>(mask)))
- return static_cast<int>(where);
- // Scan the High Word.
- if (_BitScanForward(&where, static_cast<unsigned long>(mask >> 32)))
- return static_cast<int>(where + 32); // Create a bit offset from the LSB.
-#else
-#error "Implementation of __builtin_ctzll required"
-#endif
- return 64;
-}
-
-_LIBCPP_ALWAYS_INLINE int __builtin_ctzl(unsigned long mask)
-{
- unsigned long where;
- // Search from LSB to MSB for first set bit.
- // Returns zero if no set bit is found.
- if (_BitScanForward(&where, mask))
- return static_cast<int>(where);
- return 32;
-}
-
-_LIBCPP_ALWAYS_INLINE int __builtin_ctz(unsigned int mask)
-{
- // Win32 and Win64 expectations.
- static_assert(sizeof(mask) == 4, "");
- static_assert(sizeof(unsigned long) == 4, "");
- return __builtin_ctzl(static_cast<unsigned long>(mask));
-}
-
-// Returns the number of leading 0-bits in x, starting at the most significant
-// bit position. If x is 0, the result is undefined.
-_LIBCPP_ALWAYS_INLINE int __builtin_clzll(unsigned long long mask)
-{
- unsigned long where;
-// BitScanReverse scans from MSB to LSB for first set bit.
-// Returns 0 if no set bit is found.
-#if defined(_WIN64)
- if (_BitScanReverse64(&where, mask))
- return static_cast<int>(63 - where);
-#elif defined(_WIN32)
- // Scan the high 32 bits.
- if (_BitScanReverse(&where, static_cast<unsigned long>(mask >> 32)))
- return static_cast<int>(63 -
- (where + 32)); // Create a bit offset from the MSB.
- // Scan the low 32 bits.
- if (_BitScanReverse(&where, static_cast<unsigned long>(mask)))
- return static_cast<int>(63 - where);
-#else
-#error "Implementation of __builtin_clzll required"
-#endif
- return 64; // Undefined Behavior.
-}
-
-_LIBCPP_ALWAYS_INLINE int __builtin_clzl(unsigned long mask)
-{
- unsigned long where;
- // Search from LSB to MSB for first set bit.
- // Returns zero if no set bit is found.
- if (_BitScanReverse(&where, mask))
- return static_cast<int>(31 - where);
- return 32; // Undefined Behavior.
-}
-
-_LIBCPP_ALWAYS_INLINE int __builtin_clz(unsigned int x)
-{
- return __builtin_clzl(x);
-}
-#endif // _LIBCPP_MSVC
-
-#endif // _LIBCPP_SUPPORT_WIN32_SUPPORT_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__nop_locale_mgmt.h b/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__nop_locale_mgmt.h
new file mode 100644
index 00000000000..0d3f23a2c96
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__nop_locale_mgmt.h
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//===------------ support/xlocale/__nop_locale_mgmt.h -----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
+#define _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Patch over lack of extended locale support
+typedef void *locale_t;
+static inline locale_t duplocale(locale_t) {
+ return NULL;
+}
+
+static inline void freelocale(locale_t) {
+}
+
+static inline locale_t newlocale(int, const char *, locale_t) {
+ return NULL;
+}
+
+static inline locale_t uselocale(locale_t) {
+ return NULL;
+}
+
+#define LC_COLLATE_MASK (1 << LC_COLLATE)
+#define LC_CTYPE_MASK (1 << LC_CTYPE)
+#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
+#define LC_MONETARY_MASK (1 << LC_MONETARY)
+#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
+#define LC_TIME_MASK (1 << LC_TIME)
+#define LC_ALL_MASK (LC_COLLATE_MASK|\
+ LC_CTYPE_MASK|\
+ LC_MONETARY_MASK|\
+ LC_NUMERIC_MASK|\
+ LC_TIME_MASK|\
+ LC_MESSAGES_MASK)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__posix_l_fallback.h b/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__posix_l_fallback.h
new file mode 100644
index 00000000000..c893a67313c
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__posix_l_fallback.h
@@ -0,0 +1,165 @@
+// -*- C++ -*-
+//===--------------- support/xlocale/__posix_l_fallback.h -----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// These are reimplementations of some extended locale functions ( *_l ) that
+// are normally part of POSIX. This shared implementation provides parts of the
+// extended locale support for libc's that normally don't have any (like
+// Android's bionic and Newlib).
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
+#define _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inline _LIBCPP_ALWAYS_INLINE int isalnum_l(int c, locale_t) {
+ return ::isalnum(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int isalpha_l(int c, locale_t) {
+ return ::isalpha(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int isblank_l(int c, locale_t) {
+ return ::isblank(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iscntrl_l(int c, locale_t) {
+ return ::iscntrl(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int isdigit_l(int c, locale_t) {
+ return ::isdigit(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int isgraph_l(int c, locale_t) {
+ return ::isgraph(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int islower_l(int c, locale_t) {
+ return ::islower(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int isprint_l(int c, locale_t) {
+ return ::isprint(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int ispunct_l(int c, locale_t) {
+ return ::ispunct(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int isspace_l(int c, locale_t) {
+ return ::isspace(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int isupper_l(int c, locale_t) {
+ return ::isupper(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int isxdigit_l(int c, locale_t) {
+ return ::isxdigit(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswalnum_l(wint_t c, locale_t) {
+ return ::iswalnum(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswalpha_l(wint_t c, locale_t) {
+ return ::iswalpha(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswblank_l(wint_t c, locale_t) {
+ return ::iswblank(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswcntrl_l(wint_t c, locale_t) {
+ return ::iswcntrl(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswdigit_l(wint_t c, locale_t) {
+ return ::iswdigit(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswgraph_l(wint_t c, locale_t) {
+ return ::iswgraph(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswlower_l(wint_t c, locale_t) {
+ return ::iswlower(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswprint_l(wint_t c, locale_t) {
+ return ::iswprint(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswpunct_l(wint_t c, locale_t) {
+ return ::iswpunct(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswspace_l(wint_t c, locale_t) {
+ return ::iswspace(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswupper_l(wint_t c, locale_t) {
+ return ::iswupper(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int iswxdigit_l(wint_t c, locale_t) {
+ return ::iswxdigit(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int toupper_l(int c, locale_t) {
+ return ::toupper(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int tolower_l(int c, locale_t) {
+ return ::tolower(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE wint_t towupper_l(wint_t c, locale_t) {
+ return ::towupper(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE wint_t towlower_l(wint_t c, locale_t) {
+ return ::towlower(c);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int strcoll_l(const char *s1, const char *s2,
+ locale_t) {
+ return ::strcoll(s1, s2);
+}
+
+inline _LIBCPP_ALWAYS_INLINE size_t strxfrm_l(char *dest, const char *src,
+ size_t n, locale_t) {
+ return ::strxfrm(dest, src, n);
+}
+
+inline _LIBCPP_ALWAYS_INLINE size_t strftime_l(char *s, size_t max,
+ const char *format,
+ const struct tm *tm, locale_t) {
+ return ::strftime(s, max, format, tm);
+}
+
+inline _LIBCPP_ALWAYS_INLINE int wcscoll_l(const wchar_t *ws1,
+ const wchar_t *ws2, locale_t) {
+ return ::wcscoll(ws1, ws2);
+}
+
+inline _LIBCPP_ALWAYS_INLINE size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src,
+ size_t n, locale_t) {
+ return ::wcsxfrm(dest, src, n);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__strtonum_fallback.h b/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__strtonum_fallback.h
new file mode 100644
index 00000000000..4ae3918b3d3
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/__strtonum_fallback.h
@@ -0,0 +1,67 @@
+// -*- C++ -*-
+//===-------------- support/xlocale/__strtonum_fallback.h -----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// These are reimplementations of some extended locale functions ( *_l ) that
+// aren't part of POSIX. They are widely available though (GLIBC, BSD, maybe
+// others). The unifying aspect in this case is that all of these functions
+// convert strings to some numeric type.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
+#define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+inline _LIBCPP_ALWAYS_INLINE float strtof_l(const char *nptr,
+ char **endptr, locale_t) {
+ return ::strtof(nptr, endptr);
+}
+
+inline _LIBCPP_ALWAYS_INLINE double strtod_l(const char *nptr,
+ char **endptr, locale_t) {
+ return ::strtod(nptr, endptr);
+}
+
+inline _LIBCPP_ALWAYS_INLINE long double strtold_l(const char *nptr,
+ char **endptr, locale_t) {
+ return ::strtold(nptr, endptr);
+}
+
+inline _LIBCPP_ALWAYS_INLINE long long
+strtoll_l(const char *nptr, char **endptr, int base, locale_t) {
+ return ::strtoll(nptr, endptr, base);
+}
+
+inline _LIBCPP_ALWAYS_INLINE unsigned long long
+strtoull_l(const char *nptr, char **endptr, int base, locale_t) {
+ return ::strtoull(nptr, endptr, base);
+}
+
+inline _LIBCPP_ALWAYS_INLINE long long
+wcstoll_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
+ return ::wcstoll(nptr, endptr, base);
+}
+
+inline _LIBCPP_ALWAYS_INLINE unsigned long long
+wcstoull_l(const wchar_t *nptr, wchar_t **endptr, int base, locale_t) {
+ return ::wcstoull(nptr, endptr, base);
+}
+
+inline _LIBCPP_ALWAYS_INLINE long double wcstold_l(const wchar_t *nptr,
+ wchar_t **endptr, locale_t) {
+ return ::wcstold(nptr, endptr);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/xlocale.h b/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/xlocale.h
index 99f710e8f44..e69de29bb2d 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/xlocale.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/support/xlocale/xlocale.h
@@ -1,194 +0,0 @@
-// -*- C++ -*-
-//===------------------- support/xlocale/xlocale.h ------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// This is a shared implementation of a shim to provide extended locale support
-// on top of libc's that don't support it (like Android's bionic, and Newlib).
-//
-// The 'illusion' only works when the specified locale is "C" or "POSIX", but
-// that's about as good as we can do without implementing full xlocale support
-// in the underlying libc.
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_SUPPORT_XLOCALE_XLOCALE_H
-#define _LIBCPP_SUPPORT_XLOCALE_XLOCALE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-static inline int isalnum_l(int c, locale_t) {
- return isalnum(c);
-}
-
-static inline int isalpha_l(int c, locale_t) {
- return isalpha(c);
-}
-
-static inline int isblank_l(int c, locale_t) {
- return isblank(c);
-}
-
-static inline int iscntrl_l(int c, locale_t) {
- return iscntrl(c);
-}
-
-static inline int isdigit_l(int c, locale_t) {
- return isdigit(c);
-}
-
-static inline int isgraph_l(int c, locale_t) {
- return isgraph(c);
-}
-
-static inline int islower_l(int c, locale_t) {
- return islower(c);
-}
-
-static inline int isprint_l(int c, locale_t) {
- return isprint(c);
-}
-
-static inline int ispunct_l(int c, locale_t) {
- return ispunct(c);
-}
-
-static inline int isspace_l(int c, locale_t) {
- return isspace(c);
-}
-
-static inline int isupper_l(int c, locale_t) {
- return isupper(c);
-}
-
-static inline int isxdigit_l(int c, locale_t) {
- return isxdigit(c);
-}
-
-static inline int iswalnum_l(wint_t c, locale_t) {
- return iswalnum(c);
-}
-
-static inline int iswalpha_l(wint_t c, locale_t) {
- return iswalpha(c);
-}
-
-static inline int iswblank_l(wint_t c, locale_t) {
- return iswblank(c);
-}
-
-static inline int iswcntrl_l(wint_t c, locale_t) {
- return iswcntrl(c);
-}
-
-static inline int iswdigit_l(wint_t c, locale_t) {
- return iswdigit(c);
-}
-
-static inline int iswgraph_l(wint_t c, locale_t) {
- return iswgraph(c);
-}
-
-static inline int iswlower_l(wint_t c, locale_t) {
- return iswlower(c);
-}
-
-static inline int iswprint_l(wint_t c, locale_t) {
- return iswprint(c);
-}
-
-static inline int iswpunct_l(wint_t c, locale_t) {
- return iswpunct(c);
-}
-
-static inline int iswspace_l(wint_t c, locale_t) {
- return iswspace(c);
-}
-
-static inline int iswupper_l(wint_t c, locale_t) {
- return iswupper(c);
-}
-
-static inline int iswxdigit_l(wint_t c, locale_t) {
- return iswxdigit(c);
-}
-
-static inline int toupper_l(int c, locale_t) {
- return toupper(c);
-}
-
-static inline int tolower_l(int c, locale_t) {
- return tolower(c);
-}
-
-static inline int towupper_l(int c, locale_t) {
- return towupper(c);
-}
-
-static inline int towlower_l(int c, locale_t) {
- return towlower(c);
-}
-
-static inline int strcoll_l(const char *s1, const char *s2, locale_t) {
- return strcoll(s1, s2);
-}
-
-static inline size_t strxfrm_l(char *dest, const char *src, size_t n,
- locale_t) {
- return strxfrm(dest, src, n);
-}
-
-static inline size_t strftime_l(char *s, size_t max, const char *format,
- const struct tm *tm, locale_t) {
- return strftime(s, max, format, tm);
-}
-
-static inline int wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t) {
- return wcscoll(ws1, ws2);
-}
-
-static inline size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t n,
- locale_t) {
- return wcsxfrm(dest, src, n);
-}
-
-static inline long double strtold_l(const char *nptr, char **endptr, locale_t) {
- return strtold(nptr, endptr);
-}
-
-static inline long long strtoll_l(const char *nptr, char **endptr, int base,
- locale_t) {
- return strtoll(nptr, endptr, base);
-}
-
-static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
- int base, locale_t) {
- return strtoull(nptr, endptr, base);
-}
-
-static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
- int base, locale_t) {
- return wcstoll(nptr, endptr, base);
-}
-
-static inline unsigned long long wcstoull_l(const wchar_t *nptr,
- wchar_t **endptr, int base,
- locale_t) {
- return wcstoull(nptr, endptr, base);
-}
-
-static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
- locale_t) {
- return wcstold(nptr, endptr);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _LIBCPP_SUPPORT_XLOCALE_XLOCALE_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/system_error b/chromium/buildtools/third_party/libc++/trunk/include/system_error
index 134bb327403..a29807db0d6 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/system_error
+++ b/chromium/buildtools/third_party/libc++/trunk/include/system_error
@@ -46,6 +46,12 @@ template <class T> struct is_error_code_enum
template <class T> struct is_error_condition_enum
: public false_type {};
+template <class _Tp>
+constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value; // C++17
+
+template <class _Tp>
+constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value; // C++17
+
class error_code
{
public:
@@ -213,6 +219,7 @@ bool operator!=(const error_condition& lhs, const error_code& rhs) noexcept;
bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept;
template <> struct hash<std::error_code>;
+template <> struct hash<std::error_condition>;
} // std
@@ -233,15 +240,25 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// is_error_code_enum
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum
+struct _LIBCPP_TEMPLATE_VIS is_error_code_enum
: public false_type {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_error_code_enum_v = is_error_code_enum<_Tp>::value;
+#endif
+
// is_error_condition_enum
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_error_condition_enum
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum
: public false_type {};
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t is_error_condition_enum_v = is_error_condition_enum<_Tp>::value;
+#endif
+
// Some error codes are not present on all platforms, so we provide equivalents
// for them:
@@ -346,12 +363,12 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc)
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)
template <>
-struct _LIBCPP_TYPE_VIS_ONLY is_error_condition_enum<errc>
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc>
: true_type { };
#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
-struct _LIBCPP_TYPE_VIS_ONLY is_error_condition_enum<errc::__lx>
+struct _LIBCPP_TEMPLATE_VIS is_error_condition_enum<errc::__lx>
: true_type { };
#endif
@@ -367,7 +384,8 @@ class _LIBCPP_TYPE_VIS error_category
public:
virtual ~error_category() _NOEXCEPT;
-#ifdef _LIBCPP_BUILDING_SYSTEM_ERROR
+#if defined(_LIBCPP_BUILDING_SYSTEM_ERROR) && \
+ defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
error_category() _NOEXCEPT;
#else
_LIBCPP_ALWAYS_INLINE
@@ -603,7 +621,7 @@ operator!=(const error_condition& __x, const error_condition& __y) _NOEXCEPT
{return !(__x == __y);}
template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<error_code>
+struct _LIBCPP_TEMPLATE_VIS hash<error_code>
: public unary_function<error_code, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -613,6 +631,17 @@ struct _LIBCPP_TYPE_VIS_ONLY hash<error_code>
}
};
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<error_condition>
+ : public unary_function<error_condition, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(const error_condition& __ec) const _NOEXCEPT
+ {
+ return static_cast<size_t>(__ec.value());
+ }
+};
+
// system_error
class _LIBCPP_TYPE_VIS system_error
@@ -635,7 +664,8 @@ private:
static string __init(const error_code&, string);
};
-_LIBCPP_FUNC_VIS void __throw_system_error(int ev, const char* what_arg);
+_LIBCPP_NORETURN _LIBCPP_FUNC_VIS
+void __throw_system_error(int ev, const char* what_arg);
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/thread b/chromium/buildtools/third_party/libc++/trunk/include/thread
index 6857e9edb68..360b43d5e55 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/thread
+++ b/chromium/buildtools/third_party/libc++/trunk/include/thread
@@ -95,11 +95,11 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
#include <system_error>
#include <chrono>
#include <__mutex_base>
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
#include <tuple>
#endif
-#include <pthread.h>
-#include <sched.h>
+#include <__threading_support>
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -137,7 +137,7 @@ public:
template <class _Tp>
class __thread_specific_ptr
{
- pthread_key_t __key_;
+ __libcpp_tls_key __key_;
// Only __thread_local_data() may construct a __thread_specific_ptr
// and only with _Tp == __thread_struct.
@@ -148,24 +148,24 @@ class __thread_specific_ptr
__thread_specific_ptr(const __thread_specific_ptr&);
__thread_specific_ptr& operator=(const __thread_specific_ptr&);
- static void __at_thread_exit(void*);
+ static void _LIBCPP_TLS_DESTRUCTOR_CC __at_thread_exit(void*);
+
public:
typedef _Tp* pointer;
~__thread_specific_ptr();
_LIBCPP_INLINE_VISIBILITY
- pointer get() const {return static_cast<_Tp*>(pthread_getspecific(__key_));}
+ pointer get() const {return static_cast<_Tp*>(__libcpp_tls_get(__key_));}
_LIBCPP_INLINE_VISIBILITY
pointer operator*() const {return *get();}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {return get();}
- pointer release();
- void reset(pointer __p = nullptr);
+ void set_pointer(pointer __p);
};
template <class _Tp>
-void
+void _LIBCPP_TLS_DESTRUCTOR_CC
__thread_specific_ptr<_Tp>::__at_thread_exit(void* __p)
{
delete static_cast<pointer>(__p);
@@ -174,12 +174,10 @@ __thread_specific_ptr<_Tp>::__at_thread_exit(void* __p)
template <class _Tp>
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
{
- int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- if (__ec)
- throw system_error(error_code(__ec, system_category()),
- "__thread_specific_ptr construction failed");
-#endif
+ int __ec =
+ __libcpp_tls_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
+ if (__ec)
+ __throw_system_error(__ec, "__thread_specific_ptr construction failed");
}
template <class _Tp>
@@ -192,21 +190,12 @@ __thread_specific_ptr<_Tp>::~__thread_specific_ptr()
}
template <class _Tp>
-typename __thread_specific_ptr<_Tp>::pointer
-__thread_specific_ptr<_Tp>::release()
-{
- pointer __p = get();
- pthread_setspecific(__key_, 0);
- return __p;
-}
-
-template <class _Tp>
void
-__thread_specific_ptr<_Tp>::reset(pointer __p)
+__thread_specific_ptr<_Tp>::set_pointer(pointer __p)
{
- pointer __p_old = get();
- pthread_setspecific(__key_, __p);
- delete __p_old;
+ _LIBCPP_ASSERT(get() == nullptr,
+ "Attempting to overwrite thread local data");
+ __libcpp_tls_set(__key_, __p);
}
class _LIBCPP_TYPE_VIS thread;
@@ -219,14 +208,14 @@ _LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
} // this_thread
-template<> struct _LIBCPP_TYPE_VIS_ONLY hash<__thread_id>;
+template<> struct hash<__thread_id>;
-class _LIBCPP_TYPE_VIS_ONLY __thread_id
+class _LIBCPP_TEMPLATE_VIS __thread_id
{
// FIXME: pthread_t is a pointer on Darwin but a long on Linux.
// NULL is the no-thread value on Darwin. Someone needs to check
// on other platforms. We assume 0 works everywhere for now.
- pthread_t __id_;
+ __libcpp_thread_id __id_;
public:
_LIBCPP_INLINE_VISIBILITY
@@ -234,13 +223,13 @@ public:
friend _LIBCPP_INLINE_VISIBILITY
bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT
- {return __x.__id_ == __y.__id_;}
+ {return __libcpp_thread_id_equal(__x.__id_, __y.__id_);}
friend _LIBCPP_INLINE_VISIBILITY
bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT
{return !(__x == __y);}
friend _LIBCPP_INLINE_VISIBILITY
bool operator< (__thread_id __x, __thread_id __y) _NOEXCEPT
- {return __x.__id_ < __y.__id_;}
+ {return __libcpp_thread_id_less(__x.__id_, __y.__id_);}
friend _LIBCPP_INLINE_VISIBILITY
bool operator<=(__thread_id __x, __thread_id __y) _NOEXCEPT
{return !(__y < __x);}
@@ -260,21 +249,21 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY
- __thread_id(pthread_t __id) : __id_(__id) {}
+ __thread_id(__libcpp_thread_id __id) : __id_(__id) {}
friend __thread_id this_thread::get_id() _NOEXCEPT;
friend class _LIBCPP_TYPE_VIS thread;
- friend struct _LIBCPP_TYPE_VIS_ONLY hash<__thread_id>;
+ friend struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>;
};
template<>
-struct _LIBCPP_TYPE_VIS_ONLY hash<__thread_id>
+struct _LIBCPP_TEMPLATE_VIS hash<__thread_id>
: public unary_function<__thread_id, size_t>
{
_LIBCPP_INLINE_VISIBILITY
- size_t operator()(__thread_id __v) const
+ size_t operator()(__thread_id __v) const _NOEXCEPT
{
- return hash<pthread_t>()(__v.__id_);
+ return hash<__libcpp_thread_id>()(__v.__id_);
}
};
@@ -285,75 +274,78 @@ inline _LIBCPP_INLINE_VISIBILITY
__thread_id
get_id() _NOEXCEPT
{
- return pthread_self();
+ return __libcpp_thread_get_current_id();
}
} // this_thread
class _LIBCPP_TYPE_VIS thread
{
- pthread_t __t_;
+ __libcpp_thread_t __t_;
thread(const thread&);
thread& operator=(const thread&);
public:
typedef __thread_id id;
- typedef pthread_t native_handle_type;
+ typedef __libcpp_thread_t native_handle_type;
_LIBCPP_INLINE_VISIBILITY
- thread() _NOEXCEPT : __t_(0) {}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+ thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {}
+#ifndef _LIBCPP_CXX03_LANG
template <class _Fp, class ..._Args,
class = typename enable_if
<
!is_same<typename decay<_Fp>::type, thread>::value
>::type
>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
explicit thread(_Fp&& __f, _Args&&... __args);
-#else // _LIBCPP_HAS_NO_VARIADICS
- template <class _Fp> explicit thread(_Fp __f);
+#else // _LIBCPP_CXX03_LANG
+ template <class _Fp>
+ _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+ explicit thread(_Fp __f);
#endif
~thread();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
- thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {__t.__t_ = 0;}
+ thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {__t.__t_ = _LIBCPP_NULL_THREAD;}
_LIBCPP_INLINE_VISIBILITY
thread& operator=(thread&& __t) _NOEXCEPT;
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void swap(thread& __t) _NOEXCEPT {_VSTD::swap(__t_, __t.__t_);}
_LIBCPP_INLINE_VISIBILITY
- bool joinable() const _NOEXCEPT {return __t_ != 0;}
+ bool joinable() const _NOEXCEPT {return !__libcpp_thread_isnull(&__t_);}
void join();
void detach();
_LIBCPP_INLINE_VISIBILITY
- id get_id() const _NOEXCEPT {return __t_;}
+ id get_id() const _NOEXCEPT {return __libcpp_thread_get_id(&__t_);}
_LIBCPP_INLINE_VISIBILITY
native_handle_type native_handle() _NOEXCEPT {return __t_;}
static unsigned hardware_concurrency() _NOEXCEPT;
};
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
-template <class _Fp, class ..._Args, size_t ..._Indices>
+template <class _TSp, class _Fp, class ..._Args, size_t ..._Indices>
inline _LIBCPP_INLINE_VISIBILITY
void
-__thread_execute(tuple<_Fp, _Args...>& __t, __tuple_indices<_Indices...>)
+__thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>)
{
- __invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
+ __invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
}
template <class _Fp>
-void*
-__thread_proxy(void* __vp)
+void* __thread_proxy(void* __vp)
{
- __thread_local_data().reset(new __thread_struct);
+ // _Fp = std::tuple< unique_ptr<__thread_struct>, Functor, Args...>
std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
- typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
+ __thread_local_data().set_pointer(_VSTD::get<0>(*__p).release());
+ typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 2>::type _Index;
__thread_execute(*__p, _Index());
return nullptr;
}
@@ -363,55 +355,67 @@ template <class _Fp, class ..._Args,
>
thread::thread(_Fp&& __f, _Args&&... __args)
{
- typedef tuple<typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;
- _VSTD::unique_ptr<_Gp> __p(new _Gp(__decay_copy(_VSTD::forward<_Fp>(__f)),
- __decay_copy(_VSTD::forward<_Args>(__args))...));
- int __ec = pthread_create(&__t_, 0, &__thread_proxy<_Gp>, __p.get());
+ typedef unique_ptr<__thread_struct> _TSPtr;
+ _TSPtr __tsp(new __thread_struct);
+ typedef tuple<_TSPtr, typename decay<_Fp>::type, typename decay<_Args>::type...> _Gp;
+ _VSTD::unique_ptr<_Gp> __p(
+ new _Gp(std::move(__tsp),
+ __decay_copy(_VSTD::forward<_Fp>(__f)),
+ __decay_copy(_VSTD::forward<_Args>(__args))...));
+ int __ec = __libcpp_thread_create(&__t_, &__thread_proxy<_Gp>, __p.get());
if (__ec == 0)
__p.release();
else
__throw_system_error(__ec, "thread constructor failed");
}
-#else // _LIBCPP_HAS_NO_VARIADICS
+inline
+thread&
+thread::operator=(thread&& __t) _NOEXCEPT
+{
+ if (!__libcpp_thread_isnull(&__t_))
+ terminate();
+ __t_ = __t.__t_;
+ __t.__t_ = _LIBCPP_NULL_THREAD;
+ return *this;
+}
+
+#else // _LIBCPP_CXX03_LANG
template <class _Fp>
-void*
-__thread_proxy(void* __vp)
+struct __thread_invoke_pair {
+ // This type is used to pass memory for thread local storage and a functor
+ // to a newly created thread because std::pair doesn't work with
+ // std::unique_ptr in C++03.
+ __thread_invoke_pair(_Fp& __f) : __tsp_(new __thread_struct), __fn_(__f) {}
+ unique_ptr<__thread_struct> __tsp_;
+ _Fp __fn_;
+};
+
+template <class _Fp>
+void* __thread_proxy_cxx03(void* __vp)
{
- __thread_local_data().reset(new __thread_struct);
std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
- (*__p)();
+ __thread_local_data().set_pointer(__p->__tsp_.release());
+ (__p->__fn_)();
return nullptr;
}
template <class _Fp>
thread::thread(_Fp __f)
{
- std::unique_ptr<_Fp> __p(new _Fp(__f));
- int __ec = pthread_create(&__t_, 0, &__thread_proxy<_Fp>, __p.get());
+
+ typedef __thread_invoke_pair<_Fp> _InvokePair;
+ typedef std::unique_ptr<_InvokePair> _PairPtr;
+ _PairPtr __pp(new _InvokePair(__f));
+ int __ec = __libcpp_thread_create(&__t_, &__thread_proxy_cxx03<_InvokePair>, __pp.get());
if (__ec == 0)
- __p.release();
+ __pp.release();
else
__throw_system_error(__ec, "thread constructor failed");
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-inline
-thread&
-thread::operator=(thread&& __t) _NOEXCEPT
-{
- if (__t_ != 0)
- terminate();
- __t_ = __t.__t_;
- __t.__t_ = 0;
- return *this;
-}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
inline _LIBCPP_INLINE_VISIBILITY
void swap(thread& __x, thread& __y) _NOEXCEPT {__x.swap(__y);}
@@ -419,7 +423,7 @@ void swap(thread& __x, thread& __y) _NOEXCEPT {__x.swap(__y);}
namespace this_thread
{
-_LIBCPP_FUNC_VIS void sleep_for(const chrono::nanoseconds& ns);
+_LIBCPP_FUNC_VIS void sleep_for(const chrono::nanoseconds& __ns);
template <class _Rep, class _Period>
void
@@ -464,7 +468,7 @@ sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
}
inline _LIBCPP_INLINE_VISIBILITY
-void yield() _NOEXCEPT {sched_yield();}
+void yield() _NOEXCEPT {__libcpp_thread_yield();}
} // this_thread
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/tuple b/chromium/buildtools/third_party/libc++/trunk/include/tuple
index cb1e27d93cf..b869b861cce 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/tuple
+++ b/chromium/buildtools/third_party/libc++/trunk/include/tuple
@@ -76,10 +76,18 @@ template <class... T> tuple<V...> make_tuple(T&&...); // constexpr in C++14
template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept; // constexpr in C++14
template <class... T> tuple<T&...> tie(T&...) noexcept; // constexpr in C++14
template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls); // constexpr in C++14
-
+
+// [tuple.apply], calling a function with a tuple of arguments:
+template <class F, class Tuple>
+ constexpr decltype(auto) apply(F&& f, Tuple&& t); // C++17
+template <class T, class Tuple>
+ constexpr T make_from_tuple(Tuple&& t); // C++17
+
// 20.4.1.4, tuple helper classes:
template <class T> class tuple_size; // undefined
template <class... T> class tuple_size<tuple<T...>>;
+template <class T>
+ constexpr size_t tuple_size_v = tuple_size<T>::value; // C++17
template <size_t I, class T> class tuple_element; // undefined
template <size_t I, class... T> class tuple_element<I, tuple<T...>>;
template <size_t I, class T>
@@ -140,29 +148,8 @@ template <class... Types>
_LIBCPP_BEGIN_NAMESPACE_STD
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-// tuple_size
-
-template <class ..._Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_size<tuple<_Tp...> >
- : public integral_constant<size_t, sizeof...(_Tp)>
-{
-};
-
-// tuple_element
-
-template <size_t _Ip, class ..._Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, tuple<_Tp...> >
-{
-public:
- typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
-};
+#ifndef _LIBCPP_CXX03_LANG
-#if _LIBCPP_STD_VER > 11
-template <size_t _Ip, class ..._Tp>
-using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type;
-#endif
// __tuple_leaf
@@ -184,6 +171,20 @@ class __tuple_leaf
{
_Hp value;
+ template <class _Tp>
+ static constexpr bool __can_bind_reference() {
+ using _RawTp = typename remove_reference<_Tp>::type;
+ using _RawHp = typename remove_reference<_Hp>::type;
+ using _CheckLValueArg = integral_constant<bool,
+ is_lvalue_reference<_Tp>::value
+ || is_same<_RawTp, reference_wrapper<_RawHp>>::value
+ || is_same<_RawTp, reference_wrapper<typename remove_const<_RawHp>::type>>::value
+ >;
+ return !is_reference<_Hp>::value
+ || (is_lvalue_reference<_Hp>::value && _CheckLValueArg::value)
+ || (is_rvalue_reference<_Hp>::value && !is_lvalue_reference<_Tp>::value);
+ }
+
__tuple_leaf& operator=(const __tuple_leaf&);
public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
@@ -223,59 +224,29 @@ public:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
: value(_VSTD::forward<_Tp>(__t))
- {static_assert(!is_reference<_Hp>::value ||
- (is_lvalue_reference<_Hp>::value &&
- (is_lvalue_reference<_Tp>::value ||
- is_same<typename remove_reference<_Tp>::type,
- reference_wrapper<
- typename remove_reference<_Hp>::type
- >
- >::value)) ||
- (is_rvalue_reference<_Hp>::value &&
- !is_lvalue_reference<_Tp>::value),
+ {static_assert(__can_bind_reference<_Tp>(),
"Attempted to construct a reference element in a tuple with an rvalue");}
template <class _Tp, class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
: value(_VSTD::forward<_Tp>(__t))
- {static_assert(!is_lvalue_reference<_Hp>::value ||
- (is_lvalue_reference<_Hp>::value &&
- (is_lvalue_reference<_Tp>::value ||
- is_same<typename remove_reference<_Tp>::type,
- reference_wrapper<
- typename remove_reference<_Hp>::type
- >
- >::value)),
+ {static_assert(__can_bind_reference<_Tp>(),
"Attempted to construct a reference element in a tuple with an rvalue");}
template <class _Tp, class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
: value(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t))
- {static_assert(!is_lvalue_reference<_Hp>::value ||
- (is_lvalue_reference<_Hp>::value &&
- (is_lvalue_reference<_Tp>::value ||
- is_same<typename remove_reference<_Tp>::type,
- reference_wrapper<
- typename remove_reference<_Hp>::type
- >
- >::value)),
- "Attempted to construct a reference element in a tuple with an rvalue");}
+ {static_assert(!is_reference<_Hp>::value,
+ "Attempted to uses-allocator construct a reference element in a tuple");}
template <class _Tp, class _Alloc>
_LIBCPP_INLINE_VISIBILITY
explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
: value(_VSTD::forward<_Tp>(__t), __a)
- {static_assert(!is_lvalue_reference<_Hp>::value ||
- (is_lvalue_reference<_Hp>::value &&
- (is_lvalue_reference<_Tp>::value ||
- is_same<typename remove_reference<_Tp>::type,
- reference_wrapper<
- typename remove_reference<_Hp>::type
- >
- >::value)),
- "Attempted to construct a reference element in a tuple with an rvalue");}
+ {static_assert(!is_reference<_Hp>::value,
+ "Attempted to uses-allocator construct a reference element in a tuple");}
__tuple_leaf(const __tuple_leaf& __t) = default;
__tuple_leaf(__tuple_leaf&& __t) = default;
@@ -379,10 +350,8 @@ template <class ..._Tp>
_LIBCPP_INLINE_VISIBILITY
void __swallow(_Tp&&...) _NOEXCEPT {}
-template <bool ..._Pred>
-struct __all
- : is_same<__all<_Pred...>, __all<(_Pred, true)...>>
-{ };
+template <class ..._Tp>
+struct __lazy_all : __all<_Tp::value...> {};
template <class _Tp>
struct __all_default_constructible;
@@ -397,7 +366,7 @@ struct __all_default_constructible<__tuple_types<_Tp...>>
template<class _Indx, class ..._Tp> struct __tuple_impl;
template<size_t ..._Indx, class ..._Tp>
-struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
+struct _LIBCPP_DECLSPEC_EMPTY_BASES __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
: public __tuple_leaf<_Indx, _Tp>...
{
_LIBCPP_INLINE_VISIBILITY
@@ -446,7 +415,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
template <class _Alloc, class _Tuple,
class = typename enable_if
<
- __tuple_convertible<_Tuple, tuple<_Tp...> >::value
+ __tuple_constructible<_Tuple, tuple<_Tp...> >::value
>::type
>
_LIBCPP_INLINE_VISIBILITY
@@ -499,13 +468,138 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
}
};
+
+
template <class ..._Tp>
-class _LIBCPP_TYPE_VIS_ONLY tuple
+class _LIBCPP_TEMPLATE_VIS tuple
{
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
base base_;
+#if defined(_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION)
+ static constexpr bool _EnableImplicitReducedArityExtension = true;
+#else
+ static constexpr bool _EnableImplicitReducedArityExtension = false;
+#endif
+
+ template <class ..._Args>
+ struct _PackExpandsToThisTuple : false_type {};
+
+ template <class _Arg>
+ struct _PackExpandsToThisTuple<_Arg>
+ : is_same<typename __uncvref<_Arg>::type, tuple> {};
+
+ template <bool _MaybeEnable, class _Dummy = void>
+ struct _CheckArgsConstructor : __check_tuple_constructor_fail {};
+
+ template <class _Dummy>
+ struct _CheckArgsConstructor<true, _Dummy>
+ {
+ template <class ..._Args>
+ static constexpr bool __enable_default() {
+ return __all<is_default_constructible<_Args>::value...>::value;
+ }
+
+ template <class ..._Args>
+ static constexpr bool __enable_explicit() {
+ return
+ __tuple_constructible<
+ tuple<_Args...>,
+ typename __make_tuple_types<tuple,
+ sizeof...(_Args) < sizeof...(_Tp) ?
+ sizeof...(_Args) :
+ sizeof...(_Tp)>::type
+ >::value &&
+ !__tuple_convertible<
+ tuple<_Args...>,
+ typename __make_tuple_types<tuple,
+ sizeof...(_Args) < sizeof...(_Tp) ?
+ sizeof...(_Args) :
+ sizeof...(_Tp)>::type
+ >::value &&
+ __all_default_constructible<
+ typename __make_tuple_types<tuple, sizeof...(_Tp),
+ sizeof...(_Args) < sizeof...(_Tp) ?
+ sizeof...(_Args) :
+ sizeof...(_Tp)>::type
+ >::value;
+ }
+
+ template <class ..._Args>
+ static constexpr bool __enable_implicit() {
+ return
+ __tuple_convertible<
+ tuple<_Args...>,
+ typename __make_tuple_types<tuple,
+ sizeof...(_Args) < sizeof...(_Tp) ?
+ sizeof...(_Args) :
+ sizeof...(_Tp)>::type
+ >::value &&
+ __all_default_constructible<
+ typename __make_tuple_types<tuple, sizeof...(_Tp),
+ sizeof...(_Args) < sizeof...(_Tp) ?
+ sizeof...(_Args) :
+ sizeof...(_Tp)>::type
+ >::value;
+ }
+ };
+
+ template <bool _MaybeEnable,
+ bool = sizeof...(_Tp) == 1,
+ class _Dummy = void>
+ struct _CheckTupleLikeConstructor : __check_tuple_constructor_fail {};
+
+ template <class _Dummy>
+ struct _CheckTupleLikeConstructor<true, false, _Dummy>
+ {
+ template <class _Tuple>
+ static constexpr bool __enable_implicit() {
+ return __tuple_convertible<_Tuple, tuple>::value;
+ }
+
+ template <class _Tuple>
+ static constexpr bool __enable_explicit() {
+ return __tuple_constructible<_Tuple, tuple>::value
+ && !__tuple_convertible<_Tuple, tuple>::value;
+ }
+ };
+
+ template <class _Dummy>
+ struct _CheckTupleLikeConstructor<true, true, _Dummy>
+ {
+ // This trait is used to disable the tuple-like constructor when
+ // the UTypes... constructor should be selected instead.
+ // See LWG issue #2549.
+ template <class _Tuple>
+ using _PreferTupleLikeConstructor = __lazy_or<
+ // Don't attempt the two checks below if the tuple we are given
+ // has the same type as this tuple.
+ is_same<typename __uncvref<_Tuple>::type, tuple>,
+ __lazy_and<
+ __lazy_not<is_constructible<_Tp..., _Tuple>>,
+ __lazy_not<is_convertible<_Tuple, _Tp...>>
+ >
+ >;
+
+ template <class _Tuple>
+ static constexpr bool __enable_implicit() {
+ return __lazy_and<
+ __tuple_convertible<_Tuple, tuple>,
+ _PreferTupleLikeConstructor<_Tuple>
+ >::value;
+ }
+
+ template <class _Tuple>
+ static constexpr bool __enable_explicit() {
+ return __lazy_and<
+ __tuple_constructible<_Tuple, tuple>,
+ _PreferTupleLikeConstructor<_Tuple>,
+ __lazy_not<__tuple_convertible<_Tuple, tuple>>
+ >::value;
+ }
+ };
+
template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Jp, tuple<_Up...> >::type& get(tuple<_Up...>&) _NOEXCEPT;
template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -517,14 +611,39 @@ class _LIBCPP_TYPE_VIS_ONLY tuple
public:
template <bool _Dummy = true, class = typename enable_if<
- __all<__dependent_type<is_default_constructible<_Tp>, _Dummy>::value...>::value
+ _CheckArgsConstructor<_Dummy>::template __enable_default<_Tp...>()
>::type>
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR tuple()
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
+ tuple(tuple const&) = default;
+ tuple(tuple&&) = default;
+
+ template <class _AllocArgT, class _Alloc, bool _Dummy = true, class = typename enable_if<
+ __lazy_and<
+ is_same<allocator_arg_t, _AllocArgT>,
+ __lazy_all<__dependent_type<is_default_constructible<_Tp>, _Dummy>...>
+ >::value
+ >::type>
+ _LIBCPP_INLINE_VISIBILITY
+ tuple(_AllocArgT, _Alloc const& __a)
+ : base_(allocator_arg_t(), __a,
+ __tuple_indices<>(), __tuple_types<>(),
+ typename __make_tuple_indices<sizeof...(_Tp), 0>::type(),
+ __tuple_types<_Tp...>()) {}
+
+ template <bool _Dummy = true,
+ typename enable_if
+ <
+ _CheckArgsConstructor<
+ _Dummy
+ >::template __enable_implicit<_Tp const&...>(),
+ bool
+ >::type = false
+ >
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- explicit tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
+ tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
: base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
typename __make_tuple_indices<0>::type(),
@@ -532,7 +651,33 @@ public:
__t...
) {}
- template <class _Alloc>
+ template <bool _Dummy = true,
+ typename enable_if
+ <
+ _CheckArgsConstructor<
+ _Dummy
+ >::template __enable_explicit<_Tp const&...>(),
+ bool
+ >::type = false
+ >
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
+ : base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
+ typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
+ typename __make_tuple_indices<0>::type(),
+ typename __make_tuple_types<tuple, 0>::type(),
+ __t...
+ ) {}
+
+ template <class _Alloc, bool _Dummy = true,
+ typename enable_if
+ <
+ _CheckArgsConstructor<
+ _Dummy
+ >::template __enable_implicit<_Tp const&...>(),
+ bool
+ >::type = false
+ >
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
: base_(allocator_arg_t(), __a,
@@ -543,24 +688,39 @@ public:
__t...
) {}
+ template <class _Alloc, bool _Dummy = true,
+ typename enable_if
+ <
+ _CheckArgsConstructor<
+ _Dummy
+ >::template __enable_explicit<_Tp const&...>(),
+ bool
+ >::type = false
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit
+ tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
+ : base_(allocator_arg_t(), __a,
+ typename __make_tuple_indices<sizeof...(_Tp)>::type(),
+ typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
+ typename __make_tuple_indices<0>::type(),
+ typename __make_tuple_types<tuple, 0>::type(),
+ __t...
+ ) {}
+
template <class ..._Up,
+ bool _PackIsTuple = _PackExpandsToThisTuple<_Up...>::value,
typename enable_if
<
- sizeof...(_Up) <= sizeof...(_Tp) &&
- __tuple_convertible
- <
- tuple<_Up...>,
- typename __make_tuple_types<tuple,
- sizeof...(_Up) < sizeof...(_Tp) ?
- sizeof...(_Up) :
- sizeof...(_Tp)>::type
- >::value &&
- __all_default_constructible<
- typename __make_tuple_types<tuple, sizeof...(_Tp),
- sizeof...(_Up) < sizeof...(_Tp) ?
- sizeof...(_Up) :
- sizeof...(_Tp)>::type
- >::value,
+ _CheckArgsConstructor<
+ sizeof...(_Up) == sizeof...(_Tp)
+ && !_PackIsTuple
+ >::template __enable_implicit<_Up...>() ||
+ _CheckArgsConstructor<
+ _EnableImplicitReducedArityExtension
+ && sizeof...(_Up) < sizeof...(_Tp)
+ && !_PackIsTuple
+ >::template __enable_implicit<_Up...>(),
bool
>::type = false
>
@@ -584,31 +744,17 @@ public:
template <class ..._Up,
typename enable_if
<
- sizeof...(_Up) <= sizeof...(_Tp) &&
- __tuple_constructible
- <
- tuple<_Up...>,
- typename __make_tuple_types<tuple,
- sizeof...(_Up) < sizeof...(_Tp) ?
- sizeof...(_Up) :
- sizeof...(_Tp)>::type
- >::value &&
- !__tuple_convertible
- <
- tuple<_Up...>,
- typename __make_tuple_types<tuple,
- sizeof...(_Up) < sizeof...(_Tp) ?
- sizeof...(_Up) :
- sizeof...(_Tp)>::type
- >::value &&
- __all_default_constructible<
- typename __make_tuple_types<tuple, sizeof...(_Tp),
- sizeof...(_Up) < sizeof...(_Tp) ?
- sizeof...(_Up) :
- sizeof...(_Tp)>::type
- >::value,
+ _CheckArgsConstructor<
+ sizeof...(_Up) <= sizeof...(_Tp)
+ && !_PackExpandsToThisTuple<_Up...>::value
+ >::template __enable_explicit<_Up...>() ||
+ _CheckArgsConstructor<
+ !_EnableImplicitReducedArityExtension
+ && sizeof...(_Up) < sizeof...(_Tp)
+ && !_PackExpandsToThisTuple<_Up...>::value
+ >::template __enable_implicit<_Up...>(),
bool
- >::type =false
+ >::type = false
>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit
@@ -629,24 +775,14 @@ public:
_VSTD::forward<_Up>(__u)...) {}
template <class _Alloc, class ..._Up,
- class = typename enable_if
+ typename enable_if
<
- sizeof...(_Up) <= sizeof...(_Tp) &&
- __tuple_convertible
- <
- tuple<_Up...>,
- typename __make_tuple_types<tuple,
- sizeof...(_Up) < sizeof...(_Tp) ?
- sizeof...(_Up) :
- sizeof...(_Tp)>::type
- >::value &&
- __all_default_constructible<
- typename __make_tuple_types<tuple, sizeof...(_Tp),
- sizeof...(_Up) < sizeof...(_Tp) ?
- sizeof...(_Up) :
- sizeof...(_Tp)>::type
- >::value
- >::type
+ _CheckArgsConstructor<
+ sizeof...(_Up) == sizeof...(_Tp) &&
+ !_PackExpandsToThisTuple<_Up...>::value
+ >::template __enable_implicit<_Up...>(),
+ bool
+ >::type = false
>
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
@@ -657,10 +793,33 @@ public:
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
_VSTD::forward<_Up>(__u)...) {}
+ template <class _Alloc, class ..._Up,
+ typename enable_if
+ <
+ _CheckArgsConstructor<
+ sizeof...(_Up) == sizeof...(_Tp) &&
+ !_PackExpandsToThisTuple<_Up...>::value
+ >::template __enable_explicit<_Up...>(),
+ bool
+ >::type = false
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ explicit
+ tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
+ : base_(allocator_arg_t(), __a,
+ typename __make_tuple_indices<sizeof...(_Up)>::type(),
+ typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
+ typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
+ typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
+ _VSTD::forward<_Up>(__u)...) {}
+
template <class _Tuple,
typename enable_if
<
- __tuple_convertible<_Tuple, tuple>::value,
+ _CheckTupleLikeConstructor<
+ __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value
+ && !_PackExpandsToThisTuple<_Tuple>::value
+ >::template __enable_implicit<_Tuple>(),
bool
>::type = false
>
@@ -671,8 +830,10 @@ public:
template <class _Tuple,
typename enable_if
<
- __tuple_constructible<_Tuple, tuple>::value &&
- !__tuple_convertible<_Tuple, tuple>::value,
+ _CheckTupleLikeConstructor<
+ __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value
+ && !_PackExpandsToThisTuple<_Tuple>::value
+ >::template __enable_explicit<_Tuple>(),
bool
>::type = false
>
@@ -682,15 +843,51 @@ public:
: base_(_VSTD::forward<_Tuple>(__t)) {}
template <class _Alloc, class _Tuple,
- class = typename enable_if
+ typename enable_if
<
- __tuple_convertible<_Tuple, tuple>::value
- >::type
+ _CheckTupleLikeConstructor<
+ __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value
+ >::template __enable_implicit<_Tuple>(),
+ bool
+ >::type = false
+ >
+ _LIBCPP_INLINE_VISIBILITY
+ tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
+ : base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
+
+ template <class _Alloc, class _Tuple,
+ typename enable_if
+ <
+ _CheckTupleLikeConstructor<
+ __tuple_like_with_size<_Tuple, sizeof...(_Tp)>::value
+ >::template __enable_explicit<_Tuple>(),
+ bool
+ >::type = false
>
_LIBCPP_INLINE_VISIBILITY
+ explicit
tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
: base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
+ using _CanCopyAssign = __all<is_copy_assignable<_Tp>::value...>;
+ using _CanMoveAssign = __all<is_move_assignable<_Tp>::value...>;
+
+ _LIBCPP_INLINE_VISIBILITY
+ tuple& operator=(typename conditional<_CanCopyAssign::value, tuple, __nat>::type const& __t)
+ _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
+ {
+ base_.operator=(__t.base_);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ tuple& operator=(typename conditional<_CanMoveAssign::value, tuple, __nat>::type&& __t)
+ _NOEXCEPT_((__all<is_nothrow_move_assignable<_Tp>::value...>::value))
+ {
+ base_.operator=(static_cast<base&&>(__t.base_));
+ return *this;
+ }
+
template <class _Tuple,
class = typename enable_if
<
@@ -711,7 +908,7 @@ public:
};
template <>
-class _LIBCPP_TYPE_VIS_ONLY tuple<>
+class _LIBCPP_TEMPLATE_VIS tuple<>
{
public:
_LIBCPP_INLINE_VISIBILITY
@@ -784,39 +981,44 @@ get(const tuple<_Tp...>&& __t) _NOEXCEPT
}
#if _LIBCPP_STD_VER > 11
-// get by type
-template <typename _T1, size_t _Idx, typename... _Args>
-struct __find_exactly_one_t_helper;
-
-// -- find exactly one
-template <typename _T1, size_t _Idx, typename... _Args>
-struct __find_exactly_one_t_checker {
- static constexpr size_t value = _Idx;
-// Check the rest of the list to make sure there's only one
- static_assert ( __find_exactly_one_t_helper<_T1, 0, _Args...>::value == -1, "type can only occur once in type list" );
- };
+namespace __find_detail {
-template <typename _T1, size_t _Idx>
-struct __find_exactly_one_t_helper <_T1, _Idx> {
- static constexpr size_t value = -1;
- };
+static constexpr size_t __not_found = -1;
+static constexpr size_t __ambiguous = __not_found - 1;
-template <typename _T1, size_t _Idx, typename _Head, typename... _Args>
-struct __find_exactly_one_t_helper <_T1, _Idx, _Head, _Args...> {
- static constexpr size_t value =
- std::conditional<
- std::is_same<_T1, _Head>::value,
- __find_exactly_one_t_checker<_T1, _Idx, _Args...>,
- __find_exactly_one_t_helper <_T1, _Idx+1, _Args...>
- >::type::value;
- };
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr size_t __find_idx_return(size_t __curr_i, size_t __res, bool __matches) {
+ return !__matches ? __res :
+ (__res == __not_found ? __curr_i : __ambiguous);
+}
+
+template <size_t _Nx>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr size_t __find_idx(size_t __i, const bool (&__matches)[_Nx]) {
+ return __i == _Nx ? __not_found :
+ __find_idx_return(__i, __find_idx(__i + 1, __matches), __matches[__i]);
+}
+
+template <class _T1, class ..._Args>
+struct __find_exactly_one_checked {
+ static constexpr bool __matches[] = {is_same<_T1, _Args>::value...};
+ static constexpr size_t value = __find_detail::__find_idx(0, __matches);
+ static_assert (value != __not_found, "type not found in type list" );
+ static_assert(value != __ambiguous,"type occurs more than once in type list");
+};
+
+template <class _T1>
+struct __find_exactly_one_checked<_T1> {
+ static_assert(!is_same<_T1, _T1>::value, "type not in empty type list");
+};
+
+} // namespace __find_detail;
template <typename _T1, typename... _Args>
-struct __find_exactly_one_t {
- static constexpr size_t value = __find_exactly_one_t_helper<_T1, 0, _Args...>::value;
- static_assert ( value != -1, "type not found in type list" );
- };
+struct __find_exactly_one_t
+ : public __find_detail::__find_exactly_one_checked<_T1, _Args...> {
+};
template <class _T1, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
@@ -862,11 +1064,13 @@ template <class _Up>
struct __ignore_t
{
template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- const __ignore_t& operator=(_Tp&&) const {return *this;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ const __ignore_t& operator=(_Tp&&) const {return *this;}
};
-namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }
+namespace {
+ constexpr __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>();
+}
template <class _Tp>
struct __make_tuple_return_impl
@@ -1138,7 +1342,7 @@ tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
}
template <class ..._Tp, class _Alloc>
-struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<tuple<_Tp...>, _Alloc>
+struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
: true_type {};
template <class _T1, class _T2>
@@ -1152,7 +1356,51 @@ pair<_T1, _T2>::pair(piecewise_construct_t,
{
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#if _LIBCPP_STD_VER > 14
+template <class _Tp>
+constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
+
+#define _LIBCPP_NOEXCEPT_RETURN(...) noexcept(noexcept(__VA_ARGS__)) { return __VA_ARGS__; }
+
+template <class _Fn, class _Tuple, size_t ..._Id>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr decltype(auto) __apply_tuple_impl(_Fn && __f, _Tuple && __t,
+ __tuple_indices<_Id...>)
+_LIBCPP_NOEXCEPT_RETURN(
+ _VSTD::__invoke_constexpr(
+ _VSTD::forward<_Fn>(__f),
+ _VSTD::get<_Id>(_VSTD::forward<_Tuple>(__t))...)
+)
+
+template <class _Fn, class _Tuple>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr decltype(auto) apply(_Fn && __f, _Tuple && __t)
+_LIBCPP_NOEXCEPT_RETURN(
+ _VSTD::__apply_tuple_impl(
+ _VSTD::forward<_Fn>(__f), _VSTD::forward<_Tuple>(__t),
+ typename __make_tuple_indices<tuple_size_v<decay_t<_Tuple>>>::type{})
+)
+
+template <class _Tp, class _Tuple, size_t... _Idx>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, __tuple_indices<_Idx...>)
+_LIBCPP_NOEXCEPT_RETURN(
+ _Tp(_VSTD::get<_Idx>(_VSTD::forward<_Tuple>(__t))...)
+)
+
+template <class _Tp, class _Tuple>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Tp make_from_tuple(_Tuple&& __t)
+_LIBCPP_NOEXCEPT_RETURN(
+ _VSTD::__make_from_tuple_impl<_Tp>(_VSTD::forward<_Tuple>(__t),
+ typename __make_tuple_indices<tuple_size_v<decay_t<_Tuple>>>::type{})
+)
+
+#undef _LIBCPP_NOEXCEPT_RETURN
+
+#endif // _LIBCPP_STD_VER > 14
+
+#endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/type_traits b/chromium/buildtools/third_party/libc++/trunk/include/type_traits
index b7adfebceeb..9db4d66145f 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/type_traits
+++ b/chromium/buildtools/third_party/libc++/trunk/include/type_traits
@@ -97,6 +97,7 @@ namespace std
template <class T> struct is_polymorphic;
template <class T> struct is_abstract;
template <class T> struct is_final; // C++14
+ template <class T> struct is_aggregate; // C++17
template <class T, class... Args> struct is_constructible;
template <class T> struct is_default_constructible;
@@ -105,6 +106,8 @@ namespace std
template <class T, class U> struct is_assignable;
template <class T> struct is_copy_assignable;
template <class T> struct is_move_assignable;
+ template <class T, class U> struct is_swappable_with; // C++17
+ template <class T> struct is_swappable; // C++17
template <class T> struct is_destructible;
template <class T, class... Args> struct is_trivially_constructible;
@@ -123,6 +126,8 @@ namespace std
template <class T, class U> struct is_nothrow_assignable;
template <class T> struct is_nothrow_copy_assignable;
template <class T> struct is_nothrow_move_assignable;
+ template <class T, class U> struct is_nothrow_swappable_with; // C++17
+ template <class T> struct is_nothrow_swappable; // C++17
template <class T> struct is_nothrow_destructible;
template <class T> struct has_virtual_destructor;
@@ -132,6 +137,14 @@ namespace std
template <class Base, class Derived> struct is_base_of;
template <class From, class To> struct is_convertible;
+ template <class, class R = void> struct is_callable; // not defined
+ template <class Fn, class... ArgTypes, class R>
+ struct is_callable<Fn(ArgTypes...), R>;
+
+ template <class, class R = void> struct is_nothrow_callable; // not defined
+ template <class Fn, class... ArgTypes, class R>
+ struct is_nothrow_callable<Fn(ArgTypes...), R>;
+
// Alignment properties and transformations:
template <class T> struct alignment_of;
template <size_t Len, size_t Align = most_stringent_alignment_requirement>
@@ -274,6 +287,8 @@ namespace std
= is_abstract<T>::value; // C++17
template <class T> constexpr bool is_final_v
= is_final<T>::value; // C++17
+ template <class T> constexpr bool is_aggregate_v
+ = is_aggregate<T>::value; // C++17
template <class T> constexpr bool is_signed_v
= is_signed<T>::value; // C++17
template <class T> constexpr bool is_unsigned_v
@@ -292,6 +307,10 @@ namespace std
= is_copy_assignable<T>::value; // C++17
template <class T> constexpr bool is_move_assignable_v
= is_move_assignable<T>::value; // C++17
+ template <class T, class U> constexpr bool is_swappable_with_v
+ = is_swappable_with<T, U>::value; // C++17
+ template <class T> constexpr bool is_swappable_v
+ = is_swappable<T>::value; // C++17
template <class T> constexpr bool is_destructible_v
= is_destructible<T>::value; // C++17
template <class T, class... Args> constexpr bool is_trivially_constructible_v
@@ -324,6 +343,10 @@ namespace std
= is_nothrow_copy_assignable<T>::value; // C++17
template <class T> constexpr bool is_nothrow_move_assignable_v
= is_nothrow_move_assignable<T>::value; // C++17
+ template <class T, class U> constexpr bool is_nothrow_swappable_with_v
+ = is_nothrow_swappable_with<T, U>::value; // C++17
+ template <class T> constexpr bool is_nothrow_swappable_v
+ = is_nothrow_swappable<T>::value; // C++17
template <class T> constexpr bool is_nothrow_destructible_v
= is_nothrow_destructible<T>::value; // C++17
template <class T> constexpr bool has_virtual_destructor_v
@@ -344,6 +367,10 @@ namespace std
= is_base_of<Base, Derived>::value; // C++17
template <class From, class To> constexpr bool is_convertible_v
= is_convertible<From, To>::value; // C++17
+ template <class T, class R = void> constexpr bool is_callable_v
+ = is_callable<T, R>::value; // C++17
+ template <class T, class R = void> constexpr bool is_nothrow_callable_v
+ = is_nothrow_callable<T, R>::value; // C++17
// [meta.logical], logical operator traits:
template<class... B> struct conjunction; // C++17
@@ -368,6 +395,10 @@ namespace std
_LIBCPP_BEGIN_NAMESPACE_STD
+template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS pair;
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS reference_wrapper;
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
+
template <class>
struct __void_t { typedef void type; };
@@ -375,37 +406,52 @@ template <class _Tp>
struct __identity { typedef _Tp type; };
template <class _Tp, bool>
-struct _LIBCPP_TYPE_VIS_ONLY __dependent_type : public _Tp {};
+struct _LIBCPP_TEMPLATE_VIS __dependent_type : public _Tp {};
template <bool _Bp, class _If, class _Then>
- struct _LIBCPP_TYPE_VIS_ONLY conditional {typedef _If type;};
+ struct _LIBCPP_TEMPLATE_VIS conditional {typedef _If type;};
template <class _If, class _Then>
- struct _LIBCPP_TYPE_VIS_ONLY conditional<false, _If, _Then> {typedef _Then type;};
+ struct _LIBCPP_TEMPLATE_VIS conditional<false, _If, _Then> {typedef _Then type;};
#if _LIBCPP_STD_VER > 11
template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type;
#endif
-template <bool, class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __lazy_enable_if {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __lazy_enable_if<true, _Tp> {typedef typename _Tp::type type;};
+template <bool, class _Tp> struct _LIBCPP_TEMPLATE_VIS __lazy_enable_if {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __lazy_enable_if<true, _Tp> {typedef typename _Tp::type type;};
-template <bool, class _Tp = void> struct _LIBCPP_TYPE_VIS_ONLY enable_if {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY enable_if<true, _Tp> {typedef _Tp type;};
+template <bool, class _Tp = void> struct _LIBCPP_TEMPLATE_VIS enable_if {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS enable_if<true, _Tp> {typedef _Tp type;};
#if _LIBCPP_STD_VER > 11
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
#endif
// addressof
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_CONSTEXPR_AFTER_CXX14
+_LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
_Tp*
addressof(_Tp& __x) _NOEXCEPT
{
- return (_Tp*)&reinterpret_cast<const volatile char&>(__x);
+ return __builtin_addressof(__x);
}
+#else
+
+template <class _Tp>
+inline _LIBCPP_NO_CFI _LIBCPP_INLINE_VISIBILITY
+_Tp*
+addressof(_Tp& __x) _NOEXCEPT
+{
+ return reinterpret_cast<_Tp *>(
+ const_cast<char *>(&reinterpret_cast<const volatile char &>(__x)));
+}
+
+#endif // _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+
#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
// Objective-C++ Automatic Reference Counting uses qualified pointers
// that require special addressof() signatures. When
@@ -446,12 +492,16 @@ addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
}
#endif
+#if !defined(_LIBCPP_CXX03_LANG)
+template <class _Tp> _Tp* addressof(const _Tp&&) noexcept = delete;
+#endif
+
struct __two {char __lx[2];};
// helper class:
template <class _Tp, _Tp __v>
-struct _LIBCPP_TYPE_VIS_ONLY integral_constant
+struct _LIBCPP_TEMPLATE_VIS integral_constant
{
static _LIBCPP_CONSTEXPR const _Tp value = __v;
typedef _Tp value_type;
@@ -478,7 +528,7 @@ using bool_constant = integral_constant<bool, __b>;
typedef _LIBCPP_BOOL_CONSTANT(true) true_type;
typedef _LIBCPP_BOOL_CONSTANT(false) false_type;
-#if !defined(_LIBCPP_HAS_NO_VARIADICS)
+#if !defined(_LIBCPP_CXX03_LANG)
// __lazy_and
@@ -553,12 +603,12 @@ struct __or_<_B0, _B1, _B2, _Bn...>
template<class _Tp>
struct __not_ : conditional<_Tp::value, false_type, true_type>::type {};
-#endif // !defined(_LIBCPP_HAS_NO_VARIADICS)
+#endif // !defined(_LIBCPP_CXX03_LANG)
// is_const
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_const : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_const<_Tp const> : public true_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const : public false_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_const_v
@@ -567,8 +617,8 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_const_v
// is_volatile
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_volatile : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_volatile<_Tp volatile> : public true_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile : public false_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_volatile_v
@@ -577,23 +627,23 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_volatile_v
// remove_const
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_const {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_const<const _Tp> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const<const _Tp> {typedef _Tp type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using remove_const_t = typename remove_const<_Tp>::type;
#endif
// remove_volatile
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_volatile {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_volatile<volatile _Tp> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type;
#endif
// remove_cv
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_cv
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
@@ -604,7 +654,7 @@ template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
template <class _Tp> struct __libcpp_is_void : public false_type {};
template <> struct __libcpp_is_void<void> : public true_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_void
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_void
: public __libcpp_is_void<typename remove_cv<_Tp>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -617,11 +667,11 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_void_v
template <class _Tp> struct __is_nullptr_t_impl : public false_type {};
template <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __is_nullptr_t
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t
: public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
#if _LIBCPP_STD_VER > 11
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_null_pointer
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_null_pointer
: public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -655,7 +705,7 @@ template <> struct __libcpp_is_integral<__int128_t> : public tr
template <> struct __libcpp_is_integral<__uint128_t> : public true_type {};
#endif
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_integral
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_integral
: public __libcpp_is_integral<typename remove_cv<_Tp>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -670,7 +720,7 @@ template <> struct __libcpp_is_floating_point<float> : public tru
template <> struct __libcpp_is_floating_point<double> : public true_type {};
template <> struct __libcpp_is_floating_point<long double> : public true_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_floating_point
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point
: public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -680,11 +730,11 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_floating_point_v
// is_array
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_array
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array
: public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_array<_Tp[]>
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[]>
: public true_type {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY is_array<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[_Np]>
: public true_type {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -697,7 +747,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_array_v
template <class _Tp> struct __libcpp_is_pointer : public false_type {};
template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pointer
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer
: public __libcpp_is_pointer<typename remove_cv<_Tp>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -707,18 +757,18 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_pointer_v
// is_reference
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_lvalue_reference : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_lvalue_reference<_Tp&> : public true_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : public false_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_rvalue_reference : public false_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : public false_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_rvalue_reference<_Tp&&> : public true_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference<_Tp&&> : public true_type {};
#endif
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&> : public true_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference : public false_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&> : public true_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&&> : public true_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_reference<_Tp&&> : public true_type {};
#endif
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -735,13 +785,13 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_rvalue_reference_v
#if __has_feature(is_union) || (_GNUC_VER >= 403)
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union
: public integral_constant<bool, __is_union(_Tp)> {};
#else
template <class _Tp> struct __libcpp_union : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_union
: public __libcpp_union<typename remove_cv<_Tp>::type> {};
#endif
@@ -755,7 +805,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_union_v
#if __has_feature(is_class) || (_GNUC_VER >= 403)
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_class
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class
: public integral_constant<bool, __is_class(_Tp)> {};
#else
@@ -766,7 +816,7 @@ template <class _Tp> char __test(int _Tp::*);
template <class _Tp> __two __test(...);
}
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_class
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_class
: public integral_constant<bool, sizeof(__is_class_imp::__test<_Tp>(0)) == 1 && !is_union<_Tp>::value> {};
#endif
@@ -778,8 +828,8 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_class_v
// is_same
-template <class _Tp, class _Up> struct _LIBCPP_TYPE_VIS_ONLY is_same : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_same<_Tp, _Tp> : public true_type {};
+template <class _Tp, class _Up> struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_same<_Tp, _Tp> : public true_type {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp, class _Up> _LIBCPP_CONSTEXPR bool is_same_v
@@ -808,7 +858,7 @@ struct __libcpp_is_function
{};
template <class _Tp> struct __libcpp_is_function<_Tp, true> : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_function
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_function
: public __libcpp_is_function<_Tp> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -835,7 +885,7 @@ template <class _Ret, class _Class>
struct __libcpp_is_member_function_pointer<_Ret _Class::*>
: public is_function<_Ret> {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
: public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type>::type {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -848,7 +898,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_function_pointer_v
template <class _Tp> struct __libcpp_is_member_pointer : public false_type {};
template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> : public true_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_pointer
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_pointer
: public __libcpp_is_member_pointer<typename remove_cv<_Tp>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -858,7 +908,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_pointer_v
// is_member_object_pointer
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_object_pointer
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
: public integral_constant<bool, is_member_pointer<_Tp>::value &&
!is_member_function_pointer<_Tp>::value> {};
@@ -871,12 +921,12 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_member_object_pointer_v
#if __has_feature(is_enum) || (_GNUC_VER >= 403)
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum
: public integral_constant<bool, __is_enum(_Tp)> {};
#else
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_enum
: public integral_constant<bool, !is_void<_Tp>::value &&
!is_integral<_Tp>::value &&
!is_floating_point<_Tp>::value &&
@@ -897,7 +947,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_enum_v
// is_arithmetic
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_arithmetic
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_arithmetic
: public integral_constant<bool, is_integral<_Tp>::value ||
is_floating_point<_Tp>::value> {};
@@ -908,7 +958,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_arithmetic_v
// is_fundamental
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_fundamental
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_fundamental
: public integral_constant<bool, is_void<_Tp>::value ||
__is_nullptr_t<_Tp>::value ||
is_arithmetic<_Tp>::value> {};
@@ -920,14 +970,14 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_fundamental_v
// is_scalar
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_scalar
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_scalar
: public integral_constant<bool, is_arithmetic<_Tp>::value ||
is_member_pointer<_Tp>::value ||
is_pointer<_Tp>::value ||
__is_nullptr_t<_Tp>::value ||
is_enum<_Tp>::value > {};
-template <> struct _LIBCPP_TYPE_VIS_ONLY is_scalar<nullptr_t> : public true_type {};
+template <> struct _LIBCPP_TEMPLATE_VIS is_scalar<nullptr_t> : public true_type {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_scalar_v
@@ -936,7 +986,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_scalar_v
// is_object
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_object
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_object
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_array<_Tp>::value ||
is_union<_Tp>::value ||
@@ -949,7 +999,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_object_v
// is_compound
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_compound
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_compound
: public integral_constant<bool, !is_fundamental<_Tp>::value> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -957,6 +1007,19 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_compound_v
= is_compound<_Tp>::value;
#endif
+
+// __is_referenceable [defns.referenceable]
+
+struct __is_referenceable_impl {
+ template <class _Tp> static _Tp& __test(int);
+ template <class _Tp> static __two __test(...);
+};
+
+template <class _Tp>
+struct __is_referenceable : integral_constant<bool,
+ !is_same<decltype(__is_referenceable_impl::__test<_Tp>(0)), __two>::value> {};
+
+
// add_const
template <class _Tp, bool = is_reference<_Tp>::value ||
@@ -967,7 +1030,7 @@ struct __add_const {typedef _Tp type;};
template <class _Tp>
struct __add_const<_Tp, false> {typedef const _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_const
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_const
{typedef typename __add_const<_Tp>::type type;};
#if _LIBCPP_STD_VER > 11
@@ -984,7 +1047,7 @@ struct __add_volatile {typedef _Tp type;};
template <class _Tp>
struct __add_volatile<_Tp, false> {typedef volatile _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_volatile
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_volatile
{typedef typename __add_volatile<_Tp>::type type;};
#if _LIBCPP_STD_VER > 11
@@ -993,7 +1056,7 @@ template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type;
// add_cv
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_cv
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_cv
{typedef typename add_const<typename add_volatile<_Tp>::type>::type type;};
#if _LIBCPP_STD_VER > 11
@@ -1002,10 +1065,10 @@ template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type;
// remove_reference
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_reference {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_reference<_Tp&> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _Tp type;};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_reference<_Tp&&> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _Tp type;};
#endif
#if _LIBCPP_STD_VER > 11
@@ -1014,12 +1077,11 @@ template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::
// add_lvalue_reference
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference {typedef _Tp& type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference<_Tp&> {typedef _Tp& type;}; // for older compiler
-template <> struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference<void> {typedef void type;};
-template <> struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference<const void> {typedef const void type;};
-template <> struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference<volatile void> {typedef volatile void type;};
-template <> struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference<const volatile void> {typedef const volatile void type;};
+template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_lvalue_reference_impl { typedef _Tp type; };
+template <class _Tp > struct __add_lvalue_reference_impl<_Tp, true> { typedef _Tp& type; };
+
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference
+{typedef typename __add_lvalue_reference_impl<_Tp>::type type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
@@ -1027,11 +1089,11 @@ template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_referenc
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference {typedef _Tp&& type;};
-template <> struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference<void> {typedef void type;};
-template <> struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference<const void> {typedef const void type;};
-template <> struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference<volatile void> {typedef volatile void type;};
-template <> struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference<const volatile void> {typedef const volatile void type;};
+template <class _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_impl { typedef _Tp type; };
+template <class _Tp > struct __add_rvalue_reference_impl<_Tp, true> { typedef _Tp&& type; };
+
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference
+{typedef typename __add_rvalue_reference_impl<_Tp>::type type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
@@ -1041,8 +1103,11 @@ template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_referenc
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+template <class _Tp> _Tp&& __declval(int);
+template <class _Tp> _Tp __declval(long);
+
template <class _Tp>
-typename add_rvalue_reference<_Tp>::type
+decltype(_VSTD::__declval<_Tp>(0))
declval() _NOEXCEPT;
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1053,6 +1118,29 @@ declval();
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+// __uncvref
+
+template <class _Tp>
+struct __uncvref {
+ typedef typename remove_cv<typename remove_reference<_Tp>::type>::type type;
+};
+
+template <class _Tp>
+struct __unconstref {
+ typedef typename remove_const<typename remove_reference<_Tp>::type>::type type;
+};
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Tp>
+using __uncvref_t = typename __uncvref<_Tp>::type;
+#endif
+
+// __is_same_uncvref
+
+template <class _Tp, class _Up>
+struct __is_same_uncvref : is_same<typename __uncvref<_Tp>::type,
+ typename __uncvref<_Up>::type> {};
+
struct __any
{
__any(...);
@@ -1060,11 +1148,11 @@ struct __any
// remove_pointer
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_pointer {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_pointer<_Tp*> {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_pointer<_Tp* const> {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_pointer<_Tp* volatile> {typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_pointer<_Tp* const volatile> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _Tp type;};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _Tp type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type;
@@ -1072,8 +1160,16 @@ template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type
// add_pointer
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_pointer
+template <class _Tp,
+ bool = __is_referenceable<_Tp>::value ||
+ is_same<typename remove_cv<_Tp>::type, void>::value>
+struct __add_pointer_impl
{typedef typename remove_reference<_Tp>::type* type;};
+template <class _Tp> struct __add_pointer_impl<_Tp, false>
+ {typedef _Tp type;};
+
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_pointer
+ {typedef typename __add_pointer_impl<_Tp>::type type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
@@ -1092,7 +1188,7 @@ struct __libcpp_is_signed : public __libcpp_is_signed_impl<_Tp> {};
template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_signed : public __libcpp_is_signed<_Tp> {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_signed : public __libcpp_is_signed<_Tp> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_signed_v
@@ -1112,7 +1208,7 @@ struct __libcpp_is_unsigned : public __libcpp_is_unsigned_impl<_Tp> {};
template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_unsigned : public __libcpp_is_unsigned<_Tp> {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_unsigned_v
@@ -1121,11 +1217,11 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_unsigned_v
// rank
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY rank
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS rank
: public integral_constant<size_t, 0> {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY rank<_Tp[]>
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[]>
: public integral_constant<size_t, rank<_Tp>::value + 1> {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY rank<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS rank<_Tp[_Np]>
: public integral_constant<size_t, rank<_Tp>::value + 1> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -1135,15 +1231,15 @@ template <class _Tp> _LIBCPP_CONSTEXPR size_t rank_v
// extent
-template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TYPE_VIS_ONLY extent
+template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TEMPLATE_VIS extent
: public integral_constant<size_t, 0> {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[], 0>
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], 0>
: public integral_constant<size_t, 0> {};
-template <class _Tp, unsigned _Ip> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[], _Ip>
+template <class _Tp, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], _Ip>
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
-template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[_Np], 0>
+template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], 0>
: public integral_constant<size_t, _Np> {};
-template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[_Np], _Ip>
+template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TEMPLATE_VIS extent<_Tp[_Np], _Ip>
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -1153,11 +1249,11 @@ template <class _Tp, unsigned _Ip = 0> _LIBCPP_CONSTEXPR size_t extent_v
// remove_extent
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_extent
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent
{typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_extent<_Tp[]>
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]>
{typedef _Tp type;};
-template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY remove_extent<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]>
{typedef _Tp type;};
#if _LIBCPP_STD_VER > 11
@@ -1166,11 +1262,11 @@ template <class _Tp> using remove_extent_t = typename remove_extent<_Tp>::type;
// remove_all_extents
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_all_extents
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents
{typedef _Tp type;};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_all_extents<_Tp[]>
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]>
{typedef typename remove_all_extents<_Tp>::type type;};
-template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY remove_all_extents<_Tp[_Np]>
+template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]>
{typedef typename remove_all_extents<_Tp>::type type;};
#if _LIBCPP_STD_VER > 11
@@ -1179,11 +1275,13 @@ template <class _Tp> using remove_all_extents_t = typename remove_all_extents<_T
// decay
-template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY decay
-{
-private:
- typedef typename remove_reference<_Tp>::type _Up;
+template <class _Up, bool>
+struct __decay {
+ typedef typename remove_cv<_Up>::type type;
+};
+
+template <class _Up>
+struct __decay<_Up, true> {
public:
typedef typename conditional
<
@@ -1198,24 +1296,23 @@ public:
>::type type;
};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS decay
+{
+private:
+ typedef typename remove_reference<_Tp>::type _Up;
+public:
+ typedef typename __decay<_Up, __is_referenceable<_Up>::value>::type type;
+};
+
#if _LIBCPP_STD_VER > 11
template <class _Tp> using decay_t = typename decay<_Tp>::type;
#endif
// is_abstract
-namespace __is_abstract_imp
-{
-template <class _Tp> char __test(_Tp (*)[1]);
-template <class _Tp> __two __test(...);
-}
-
-template <class _Tp, bool = is_class<_Tp>::value>
-struct __libcpp_abstract : public integral_constant<bool, sizeof(__is_abstract_imp::__test<_Tp>(0)) != 1> {};
-
-template <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {};
-
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_abstract : public __libcpp_abstract<_Tp> {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_abstract
+ : public integral_constant<bool, __is_abstract(_Tp)> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_abstract_v
@@ -1225,15 +1322,15 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_abstract_v
// is_final
#if defined(_LIBCPP_HAS_IS_FINAL)
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
__libcpp_is_final : public integral_constant<bool, __is_final(_Tp)> {};
#else
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
__libcpp_is_final : public false_type {};
#endif
#if defined(_LIBCPP_HAS_IS_FINAL) && _LIBCPP_STD_VER > 11
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
is_final : public integral_constant<bool, __is_final(_Tp)> {};
#endif
@@ -1242,12 +1339,25 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_final_v
= is_final<_Tp>::value;
#endif
+// is_aggregate
+#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE)
+
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
+is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {};
+
+#if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
+template <class _Tp>
+constexpr bool is_aggregate_v = is_aggregate<_Tp>::value;
+#endif
+
+#endif // _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE)
+
// is_base_of
#ifdef _LIBCPP_HAS_IS_BASE_OF
template <class _Bp, class _Dp>
-struct _LIBCPP_TYPE_VIS_ONLY is_base_of
+struct _LIBCPP_TEMPLATE_VIS is_base_of
: public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
#else // _LIBCPP_HAS_IS_BASE_OF
@@ -1271,7 +1381,7 @@ template <class _Bp, class _Dp> __two __test(...);
}
template <class _Bp, class _Dp>
-struct _LIBCPP_TYPE_VIS_ONLY is_base_of
+struct _LIBCPP_TEMPLATE_VIS is_base_of
: public integral_constant<bool, is_class<_Bp>::value &&
sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {};
@@ -1286,7 +1396,7 @@ template <class _Bp, class _Dp> _LIBCPP_CONSTEXPR bool is_base_of_v
#if __has_feature(is_convertible_to) && !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK)
-template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY is_convertible
+template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible
: public integral_constant<bool, __is_convertible_to(_T1, _T2) &&
!is_abstract<_T2>::value> {};
@@ -1301,16 +1411,9 @@ struct __is_convertible_test : public false_type {};
template <class _From, class _To>
struct __is_convertible_test<_From, _To,
- decltype(__test_convert<_To>(_VSTD::declval<_From>()))> : public true_type
+ decltype(_VSTD::__is_convertible_imp::__test_convert<_To>(_VSTD::declval<_From>()))> : public true_type
{};
-template <class _Tp> __two __test(...);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _Tp> _Tp&& __source();
-#else
-template <class _Tp> typename remove_reference<_Tp>::type& __source();
-#endif
-
template <class _Tp, bool _IsArray = is_array<_Tp>::value,
bool _IsFunction = is_function<_Tp>::value,
bool _IsVoid = is_void<_Tp>::value>
@@ -1350,41 +1453,6 @@ struct __is_convertible
>
{};
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 0> : false_type {};
-
-template <class _T1> struct __is_convertible<_T1, const _T1&, 1, 0> : true_type {};
-template <class _T1> struct __is_convertible<const _T1, const _T1&, 1, 0> : true_type {};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _T1> struct __is_convertible<_T1, _T1&&, 1, 0> : true_type {};
-template <class _T1> struct __is_convertible<_T1, const _T1&&, 1, 0> : true_type {};
-template <class _T1> struct __is_convertible<_T1, volatile _T1&&, 1, 0> : true_type {};
-template <class _T1> struct __is_convertible<_T1, const volatile _T1&&, 1, 0> : true_type {};
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2*, 1, 0>
- : public integral_constant<bool, __is_convertible<typename remove_all_extents<_T1>::type*, _T2*>::value> {};
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2* const, 1, 0>
- : public integral_constant<bool, __is_convertible<typename remove_all_extents<_T1>::type*, _T2*const>::value> {};
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2* volatile, 1, 0>
- : public integral_constant<bool, __is_convertible<typename remove_all_extents<_T1>::type*, _T2*volatile>::value> {};
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2* const volatile, 1, 0>
- : public integral_constant<bool, __is_convertible<typename remove_all_extents<_T1>::type*, _T2*const volatile>::value> {};
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 0> : public false_type {};
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-template <class _T1> struct __is_convertible<_T1, _T1&&, 2, 0> : public true_type {};
-#endif
-template <class _T1> struct __is_convertible<_T1, _T1&, 2, 0> : public true_type {};
-template <class _T1> struct __is_convertible<_T1, _T1*, 2, 0> : public true_type {};
-template <class _T1> struct __is_convertible<_T1, _T1*const, 2, 0> : public true_type {};
-template <class _T1> struct __is_convertible<_T1, _T1*volatile, 2, 0> : public true_type {};
-template <class _T1> struct __is_convertible<_T1, _T1*const volatile, 2, 0> : public true_type {};
-
-template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 0> : public false_type {};
-
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 1> : public false_type {};
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 1> : public false_type {};
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 1> : public false_type {};
@@ -1400,7 +1468,7 @@ template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 3> : public
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 3> : public false_type {};
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 3> : public true_type {};
-template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY is_convertible
+template <class _T1, class _T2> struct _LIBCPP_TEMPLATE_VIS is_convertible
: public __is_convertible<_T1, _T2>
{
static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
@@ -1419,7 +1487,7 @@ template <class _From, class _To> _LIBCPP_CONSTEXPR bool is_convertible_v
#if __has_feature(is_empty) || (_GNUC_VER >= 407)
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_empty
+struct _LIBCPP_TEMPLATE_VIS is_empty
: public integral_constant<bool, __is_empty(_Tp)> {};
#else // __has_feature(is_empty)
@@ -1441,7 +1509,7 @@ struct __libcpp_empty : public integral_constant<bool, sizeof(__is_empty1<_Tp>)
template <class _Tp> struct __libcpp_empty<_Tp, false> : public false_type {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_empty : public __libcpp_empty<_Tp> {};
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_empty : public __libcpp_empty<_Tp> {};
#endif // __has_feature(is_empty)
@@ -1452,10 +1520,10 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_empty_v
// is_polymorphic
-#if __has_feature(is_polymorphic) || defined(_LIBCPP_MSVC)
+#if __has_feature(is_polymorphic) || defined(_LIBCPP_COMPILER_MSVC)
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
+struct _LIBCPP_TEMPLATE_VIS is_polymorphic
: public integral_constant<bool, __is_polymorphic(_Tp)> {};
#else
@@ -1465,7 +1533,7 @@ template<typename _Tp> char &__is_polymorphic_impl(
int>::type);
template<typename _Tp> __two &__is_polymorphic_impl(...);
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_polymorphic
: public integral_constant<bool, sizeof(__is_polymorphic_impl<_Tp>(0)) == 1> {};
#endif // __has_feature(is_polymorphic)
@@ -1479,12 +1547,12 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_polymorphic_v
#if __has_feature(has_virtual_destructor) || (_GNUC_VER >= 403)
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor
: public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
#else
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS has_virtual_destructor
: public false_type {};
#endif
@@ -1496,7 +1564,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool has_virtual_destructor_v
// alignment_of
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS alignment_of
: public integral_constant<size_t, __alignof__(_Tp)> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
@@ -1515,7 +1583,7 @@ struct __type_list
struct __nat
{
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#ifndef _LIBCPP_CXX03_LANG
__nat() = delete;
__nat(const __nat&) = delete;
__nat& operator=(const __nat&) = delete;
@@ -1589,7 +1657,7 @@ struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
: public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {};
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
-struct _LIBCPP_TYPE_VIS_ONLY aligned_storage
+struct _LIBCPP_TEMPLATE_VIS aligned_storage
{
typedef typename __find_pod<__all_types, _Align>::type _Aligner;
static_assert(!is_void<_Aligner>::value, "");
@@ -1607,7 +1675,7 @@ template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::valu
#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
template <size_t _Len>\
-struct _LIBCPP_TYPE_VIS_ONLY aligned_storage<_Len, n>\
+struct _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n>\
{\
struct _ALIGNAS(n) type\
{\
@@ -1629,10 +1697,10 @@ _CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x400);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x800);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1000);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2000);
-// MSDN says that MSVC does not support alignment beyond 8192 (=0x2000)
-#if !defined(_LIBCPP_MSVC)
+// PE/COFF does not support alignment beyond 8192 (=0x2000)
+#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000);
-#endif // !_LIBCPP_MSVC
+#endif // !defined(_LIBCPP_OBJECT_FORMAT_COFF)
#undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION
@@ -1862,7 +1930,7 @@ template <> struct __make_signed<__uint128_t, true> {typedef __int128_t t
#endif
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY make_signed
+struct _LIBCPP_TEMPLATE_VIS make_signed
{
typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
};
@@ -1895,7 +1963,7 @@ template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_
#endif
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY make_unsigned
+struct _LIBCPP_TEMPLATE_VIS make_unsigned
{
typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
};
@@ -1907,21 +1975,28 @@ template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type;
#ifdef _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Up = void, class _Vp = void>
-struct _LIBCPP_TYPE_VIS_ONLY common_type
+struct _LIBCPP_TEMPLATE_VIS common_type
{
public:
typedef typename common_type<typename common_type<_Tp, _Up>::type, _Vp>::type type;
};
+template <>
+struct _LIBCPP_TEMPLATE_VIS common_type<void, void, void>
+{
+public:
+ typedef void type;
+};
+
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, void, void>
+struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, void, void>
{
public:
- typedef typename decay<_Tp>::type type;
+ typedef typename common_type<_Tp, _Tp>::type type;
};
template <class _Tp, class _Up>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, void>
+struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up, void>
{
typedef typename decay<decltype(
true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
@@ -1933,23 +2008,21 @@ struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, void>
// bullet 1 - sizeof...(Tp) == 0
template <class ..._Tp>
-struct _LIBCPP_TYPE_VIS_ONLY common_type {};
+struct _LIBCPP_TEMPLATE_VIS common_type {};
// bullet 2 - sizeof...(Tp) == 1
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp>
-{
- typedef typename decay<_Tp>::type type;
-};
+struct _LIBCPP_TEMPLATE_VIS common_type<_Tp>
+ : public common_type<_Tp, _Tp> {};
// bullet 3 - sizeof...(Tp) == 2
template <class _Tp, class _Up, class = void>
-struct __common_type2 {};
+struct __common_type2_imp {};
template <class _Tp, class _Up>
-struct __common_type2<_Tp, _Up,
+struct __common_type2_imp<_Tp, _Up,
typename __void_t<decltype(
true ? _VSTD::declval<_Tp>() : _VSTD::declval<_Up>()
)>::type>
@@ -1959,8 +2032,18 @@ struct __common_type2<_Tp, _Up,
)>::type type;
};
+template <class _Tp, class _Up,
+ class _DTp = typename decay<_Tp>::type,
+ class _DUp = typename decay<_Up>::type>
+using __common_type2 =
+ typename conditional<
+ is_same<_Tp, _DTp>::value && is_same<_Up, _DUp>::value,
+ __common_type2_imp<_Tp, _Up>,
+ common_type<_DTp, _DUp>
+ >::type;
+
template <class _Tp, class _Up>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up>
+struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up>
: __common_type2<_Tp, _Up> {};
// bullet 4 - sizeof...(Tp) > 2
@@ -1970,17 +2053,25 @@ template <class ...Tp> struct __common_types;
template <class, class = void>
struct __common_type_impl {};
+template <class _Tp, class _Up>
+struct __common_type_impl<
+ __common_types<_Tp, _Up>,
+ typename __void_t<typename common_type<_Tp, _Up>::type>::type>
+{
+ typedef typename common_type<_Tp, _Up>::type type;
+};
+
template <class _Tp, class _Up, class ..._Vp>
struct __common_type_impl<__common_types<_Tp, _Up, _Vp...>,
typename __void_t<typename common_type<_Tp, _Up>::type>::type>
+ : __common_type_impl<
+ __common_types<typename common_type<_Tp, _Up>::type, _Vp...> >
{
- typedef typename common_type<
- typename common_type<_Tp, _Up>::type, _Vp...
- >::type type;
+
};
template <class _Tp, class _Up, class ..._Vp>
-struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, _Vp...>
+struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, _Up, _Vp...>
: __common_type_impl<__common_types<_Tp, _Up, _Vp...> > {};
#if _LIBCPP_STD_VER > 11
@@ -1995,26 +2086,15 @@ template<typename, typename _Tp> struct __select_2nd { typedef _Tp type; };
template <class _Tp, class _Arg>
typename __select_2nd<decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>())), true_type>::type
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-__is_assignable_test(_Tp&&, _Arg&&);
-#else
-__is_assignable_test(_Tp, _Arg&);
-#endif
+__is_assignable_test(int);
+
+template <class, class>
+false_type __is_assignable_test(...);
-template <class _Arg>
-false_type
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-__is_assignable_test(__any, _Arg&&);
-#else
-__is_assignable_test(__any, _Arg&);
-#endif
template <class _Tp, class _Arg, bool = is_void<_Tp>::value || is_void<_Arg>::value>
struct __is_assignable_imp
- : public common_type
- <
- decltype(_VSTD::__is_assignable_test(declval<_Tp>(), declval<_Arg>()))
- >::type {};
+ : public decltype((_VSTD::__is_assignable_test<_Tp, _Arg>(0))) {};
template <class _Tp, class _Arg>
struct __is_assignable_imp<_Tp, _Arg, true>
@@ -2033,7 +2113,7 @@ template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_assignable_v
// is_copy_assignable
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_copy_assignable
: public is_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
@@ -2044,10 +2124,10 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_assignable_v
// is_move_assignable
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_move_assignable
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_assignable<typename add_lvalue_reference<_Tp>::type,
- const typename add_rvalue_reference<_Tp>::type> {};
+ typename add_rvalue_reference<_Tp>::type> {};
#else
: public is_copy_assignable<_Tp> {};
#endif
@@ -2125,7 +2205,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_destructible_v
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
typename remove_reference<_Tp>::type&&
move(_Tp&& __t) _NOEXCEPT
{
@@ -2134,20 +2214,20 @@ move(_Tp&& __t) _NOEXCEPT
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
_Tp&&
-forward(typename std::remove_reference<_Tp>::type& __t) _NOEXCEPT
+forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT
{
return static_cast<_Tp&&>(__t);
}
template <class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
_Tp&&
-forward(typename std::remove_reference<_Tp>::type&& __t) _NOEXCEPT
+forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT
{
- static_assert(!std::is_lvalue_reference<_Tp>::value,
- "Can not forward an rvalue as an lvalue.");
+ static_assert(!is_lvalue_reference<_Tp>::value,
+ "can not forward an rvalue as an lvalue");
return static_cast<_Tp&&>(__t);
}
@@ -2172,7 +2252,7 @@ move(const _Tp& __t)
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp&
-forward(typename std::remove_reference<_Tp>::type& __t) _NOEXCEPT
+forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT
{
return __t;
}
@@ -2691,6 +2771,15 @@ struct __member_pointer_traits
// typedef ... _FnType;
};
+
+template <class _DecayedFp>
+struct __member_pointer_class_type {};
+
+template <class _Ret, class _ClassType>
+struct __member_pointer_class_type<_Ret _ClassType::*> {
+ typedef _ClassType type;
+};
+
// result_of
template <class _Callable> class result_of;
@@ -2802,7 +2891,7 @@ class __result_of<_Fn(_Tp, _A0, _A1, _A2), false, true> // _Fn must be member p
// result_of
template <class _Fn>
-class _LIBCPP_TYPE_VIS_ONLY result_of<_Fn()>
+class _LIBCPP_TEMPLATE_VIS result_of<_Fn()>
: public __result_of<_Fn(),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
@@ -2812,7 +2901,7 @@ class _LIBCPP_TYPE_VIS_ONLY result_of<_Fn()>
};
template <class _Fn, class _A0>
-class _LIBCPP_TYPE_VIS_ONLY result_of<_Fn(_A0)>
+class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0)>
: public __result_of<_Fn(_A0),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
@@ -2822,7 +2911,7 @@ class _LIBCPP_TYPE_VIS_ONLY result_of<_Fn(_A0)>
};
template <class _Fn, class _A0, class _A1>
-class _LIBCPP_TYPE_VIS_ONLY result_of<_Fn(_A0, _A1)>
+class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0, _A1)>
: public __result_of<_Fn(_A0, _A1),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
@@ -2832,7 +2921,7 @@ class _LIBCPP_TYPE_VIS_ONLY result_of<_Fn(_A0, _A1)>
};
template <class _Fn, class _A0, class _A1, class _A2>
-class _LIBCPP_TYPE_VIS_ONLY result_of<_Fn(_A0, _A1, _A2)>
+class _LIBCPP_TEMPLATE_VIS result_of<_Fn(_A0, _A1, _A2)>
: public __result_of<_Fn(_A0, _A1, _A2),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<typename remove_reference<_Fn>::type>::type>::value,
@@ -2850,135 +2939,132 @@ namespace __is_construct
struct __nat {};
}
-#if __has_feature(is_constructible)
-
-template <class _Tp, class ..._Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_constructible
- : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
- {};
-
-#else
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-// main is_constructible test
-
-template <class _Tp, class ..._Args>
-typename __select_2nd<decltype(_VSTD::move(_Tp(_VSTD::declval<_Args>()...))), true_type>::type
-__is_constructible_test(_Tp&&, _Args&& ...);
-
-template <class ..._Args>
-false_type
-__is_constructible_test(__any, _Args&& ...);
-
-template <bool, class _Tp, class... _Args>
-struct __libcpp_is_constructible // false, _Tp is not a scalar
- : public common_type
- <
- decltype(__is_constructible_test(declval<_Tp>(), declval<_Args>()...))
- >::type
- {};
-
-// function types are not constructible
+#if !defined(_LIBCPP_CXX03_LANG) && (!__has_feature(is_constructible) || \
+ defined(_LIBCPP_TESTING_FALLBACK_IS_CONSTRUCTIBLE))
-template <class _Rp, class... _A1, class... _A2>
-struct __libcpp_is_constructible<false, _Rp(_A1...), _A2...>
- : public false_type
- {};
-
-// handle scalars and reference types
-
-// Scalars are default constructible, references are not
+template <class _Tp, class... _Args>
+struct __libcpp_is_constructible;
+
+template <class _To, class _From>
+struct __is_invalid_base_to_derived_cast {
+ static_assert(is_reference<_To>::value, "Wrong specialization");
+ using _RawFrom = __uncvref_t<_From>;
+ using _RawTo = __uncvref_t<_To>;
+ static const bool value = __lazy_and<
+ __lazy_not<is_same<_RawFrom, _RawTo>>,
+ is_base_of<_RawFrom, _RawTo>,
+ __lazy_not<__libcpp_is_constructible<_RawTo, _From>>
+ >::value;
+};
+
+template <class _To, class _From>
+struct __is_invalid_lvalue_to_rvalue_cast : false_type {
+ static_assert(is_reference<_To>::value, "Wrong specialization");
+};
+
+template <class _ToRef, class _FromRef>
+struct __is_invalid_lvalue_to_rvalue_cast<_ToRef&&, _FromRef&> {
+ using _RawFrom = __uncvref_t<_FromRef>;
+ using _RawTo = __uncvref_t<_ToRef>;
+ static const bool value = __lazy_and<
+ __lazy_not<is_function<_RawTo>>,
+ __lazy_or<
+ is_same<_RawFrom, _RawTo>,
+ is_base_of<_RawTo, _RawFrom>>
+ >::value;
+};
+
+struct __is_constructible_helper
+{
+ template <class _To>
+ static void __eat(_To);
+
+ // This overload is needed to work around a Clang bug that disallows
+ // static_cast<T&&>(e) for non-reference-compatible types.
+ // Example: static_cast<int&&>(declval<double>());
+ // NOTE: The static_cast implementation below is required to support
+ // classes with explicit conversion operators.
+ template <class _To, class _From,
+ class = decltype(__eat<_To>(_VSTD::declval<_From>()))>
+ static true_type __test_cast(int);
+
+ template <class _To, class _From,
+ class = decltype(static_cast<_To>(_VSTD::declval<_From>()))>
+ static integral_constant<bool,
+ !__is_invalid_base_to_derived_cast<_To, _From>::value &&
+ !__is_invalid_lvalue_to_rvalue_cast<_To, _From>::value
+ > __test_cast(long);
+
+ template <class, class>
+ static false_type __test_cast(...);
+
+ template <class _Tp, class ..._Args,
+ class = decltype(_Tp(_VSTD::declval<_Args>()...))>
+ static true_type __test_nary(int);
+ template <class _Tp, class...>
+ static false_type __test_nary(...);
+
+ template <class _Tp, class _A0, class = decltype(::new _Tp(_VSTD::declval<_A0>()))>
+ static is_destructible<_Tp> __test_unary(int);
+ template <class, class>
+ static false_type __test_unary(...);
+};
+
+template <class _Tp, bool = is_void<_Tp>::value>
+struct __is_default_constructible
+ : decltype(__is_constructible_helper::__test_nary<_Tp>(0))
+{};
template <class _Tp>
-struct __libcpp_is_constructible<true, _Tp>
- : public is_scalar<_Tp>
- {};
-
-// Scalars and references are constructible from one arg if that arg is
-// implicitly convertible to the scalar or reference.
+struct __is_default_constructible<_Tp, true> : false_type {};
template <class _Tp>
-struct __is_constructible_ref
-{
- true_type static __lxx(_Tp);
- false_type static __lxx(...);
-};
-
-template <class _Tp, class _A0>
-struct __libcpp_is_constructible<true, _Tp, _A0>
- : public common_type
- <
- decltype(__is_constructible_ref<_Tp>::__lxx(declval<_A0>()))
- >::type
- {};
+struct __is_default_constructible<_Tp[], false> : false_type {};
-// Scalars and references are not constructible from multiple args.
-
-template <class _Tp, class _A0, class ..._Args>
-struct __libcpp_is_constructible<true, _Tp, _A0, _Args...>
- : public false_type
- {};
-
-// Treat scalars and reference types separately
-
-template <bool, class _Tp, class... _Args>
-struct __is_constructible_void_check
- : public __libcpp_is_constructible<is_scalar<_Tp>::value || is_reference<_Tp>::value,
- _Tp, _Args...>
- {};
-
-// If any of T or Args is void, is_constructible should be false
+template <class _Tp, size_t _Nx>
+struct __is_default_constructible<_Tp[_Nx], false>
+ : __is_default_constructible<typename remove_all_extents<_Tp>::type> {};
template <class _Tp, class... _Args>
-struct __is_constructible_void_check<true, _Tp, _Args...>
- : public false_type
- {};
-
-template <class ..._Args> struct __contains_void;
-
-template <> struct __contains_void<> : false_type {};
-
-template <class _A0, class ..._Args>
-struct __contains_void<_A0, _Args...>
+struct __libcpp_is_constructible
{
- static const bool value = is_void<_A0>::value ||
- __contains_void<_Args...>::value;
+ static_assert(sizeof...(_Args) > 1, "Wrong specialization");
+ typedef decltype(__is_constructible_helper::__test_nary<_Tp, _Args...>(0))
+ type;
};
-// is_constructible entry point
-
-template <class _Tp, class... _Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_constructible
- : public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
- || is_abstract<_Tp>::value,
- _Tp, _Args...>
- {};
-
-// Array types are default constructible if their element type
-// is default constructible
+template <class _Tp>
+struct __libcpp_is_constructible<_Tp> : __is_default_constructible<_Tp> {};
-template <class _Ap, size_t _Np>
-struct __libcpp_is_constructible<false, _Ap[_Np]>
- : public is_constructible<typename remove_all_extents<_Ap>::type>
- {};
+template <class _Tp, class _A0>
+struct __libcpp_is_constructible<_Tp, _A0>
+ : public decltype(__is_constructible_helper::__test_unary<_Tp, _A0>(0))
+{};
-// Otherwise array types are not constructible by this syntax
+template <class _Tp, class _A0>
+struct __libcpp_is_constructible<_Tp&, _A0>
+ : public decltype(__is_constructible_helper::
+ __test_cast<_Tp&, _A0>(0))
+{};
-template <class _Ap, size_t _Np, class ..._Args>
-struct __libcpp_is_constructible<false, _Ap[_Np], _Args...>
- : public false_type
- {};
+template <class _Tp, class _A0>
+struct __libcpp_is_constructible<_Tp&&, _A0>
+ : public decltype(__is_constructible_helper::
+ __test_cast<_Tp&&, _A0>(0))
+{};
-// Incomplete array types are not constructible
+#endif
-template <class _Ap, class ..._Args>
-struct __libcpp_is_constructible<false, _Ap[], _Args...>
- : public false_type
+#if __has_feature(is_constructible)
+template <class _Tp, class ..._Args>
+struct _LIBCPP_TEMPLATE_VIS is_constructible
+ : public integral_constant<bool, __is_constructible(_Tp, _Args...)>
{};
-
-#else // _LIBCPP_HAS_NO_VARIADICS
-
+#elif !defined(_LIBCPP_CXX03_LANG)
+template <class _Tp, class... _Args>
+struct _LIBCPP_TEMPLATE_VIS is_constructible
+ : public __libcpp_is_constructible<_Tp, _Args...>::type {};
+#else
// template <class T> struct is_constructible0;
// main is_constructible0 test
@@ -3090,7 +3176,7 @@ struct __is_constructible2_void_check<true, _Tp, _A0, _A1>
template <class _Tp, class _A0 = __is_construct::__nat,
class _A1 = __is_construct::__nat>
-struct _LIBCPP_TYPE_VIS_ONLY is_constructible
+struct _LIBCPP_TEMPLATE_VIS is_constructible
: public __is_constructible2_void_check<is_void<_Tp>::value
|| is_abstract<_Tp>::value
|| is_function<_Tp>::value
@@ -3100,7 +3186,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_constructible
{};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_constructible<_Tp, __is_construct::__nat, __is_construct::__nat>
+struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, __is_construct::__nat, __is_construct::__nat>
: public __is_constructible0_void_check<is_void<_Tp>::value
|| is_abstract<_Tp>::value
|| is_function<_Tp>::value,
@@ -3108,7 +3194,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_constructible<_Tp, __is_construct::__nat, __is_c
{};
template <class _Tp, class _A0>
-struct _LIBCPP_TYPE_VIS_ONLY is_constructible<_Tp, _A0, __is_construct::__nat>
+struct _LIBCPP_TEMPLATE_VIS is_constructible<_Tp, _A0, __is_construct::__nat>
: public __is_constructible1_void_check<is_void<_Tp>::value
|| is_abstract<_Tp>::value
|| is_function<_Tp>::value
@@ -3151,8 +3237,8 @@ struct __is_constructible2_imp<false, _Ap[], _A0, _A1>
: public false_type
{};
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // __has_feature(is_constructible)
+#endif // __has_feature(is_constructible)
+
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class _Tp, class ..._Args> _LIBCPP_CONSTEXPR bool is_constructible_v
@@ -3162,7 +3248,7 @@ template <class _Tp, class ..._Args> _LIBCPP_CONSTEXPR bool is_constructible_v
// is_default_constructible
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_default_constructible
+struct _LIBCPP_TEMPLATE_VIS is_default_constructible
: public is_constructible<_Tp>
{};
@@ -3174,7 +3260,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_default_constructible_v
// is_copy_constructible
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_copy_constructible
+struct _LIBCPP_TEMPLATE_VIS is_copy_constructible
: public is_constructible<_Tp,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
@@ -3186,7 +3272,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_constructible_v
// is_move_constructible
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_move_constructible
+struct _LIBCPP_TEMPLATE_VIS is_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
@@ -3206,7 +3292,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_constructible_v
#if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501
template <class _Tp, class... _Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
: integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)>
{
};
@@ -3214,13 +3300,13 @@ struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible
#else // !__has_feature(is_trivially_constructible)
template <class _Tp, class... _Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
: false_type
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp>
#if __has_feature(has_trivial_constructor) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_trivial_constructor(_Tp)>
#else
@@ -3231,22 +3317,22 @@ struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp>
template <class _Tp>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&&>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&&>
#else
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp>
#endif
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, const _Tp&>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&>
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
@@ -3257,7 +3343,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&>
template <class _Tp, class _A0 = __is_construct::__nat,
class _A1 = __is_construct::__nat>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible
: false_type
{
};
@@ -3265,28 +3351,28 @@ struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible
#if __has_feature(is_trivially_constructible) || _GNUC_VER >= 501
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, __is_construct::__nat,
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, __is_construct::__nat,
__is_construct::__nat>
: integral_constant<bool, __is_trivially_constructible(_Tp)>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp,
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp,
__is_construct::__nat>
: integral_constant<bool, __is_trivially_constructible(_Tp, _Tp)>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, const _Tp&,
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&,
__is_construct::__nat>
: integral_constant<bool, __is_trivially_constructible(_Tp, const _Tp&)>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&,
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&,
__is_construct::__nat>
: integral_constant<bool, __is_trivially_constructible(_Tp, _Tp&)>
{
@@ -3295,28 +3381,28 @@ struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&,
#else // !__has_feature(is_trivially_constructible)
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, __is_construct::__nat,
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, __is_construct::__nat,
__is_construct::__nat>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp,
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp,
__is_construct::__nat>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, const _Tp&,
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, const _Tp&,
__is_construct::__nat>
: integral_constant<bool, is_scalar<_Tp>::value>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&,
+struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&,
__is_construct::__nat>
: integral_constant<bool, is_scalar<_Tp>::value>
{
@@ -3333,7 +3419,7 @@ template <class _Tp, class... _Args> _LIBCPP_CONSTEXPR bool is_trivially_constru
// is_trivially_default_constructible
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_default_constructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_default_constructible
: public is_trivially_constructible<_Tp>
{};
@@ -3344,7 +3430,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_default_constructible_v
// is_trivially_copy_constructible
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_constructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
: public is_trivially_constructible<_Tp, typename add_lvalue_reference<const _Tp>::type>
{};
@@ -3355,7 +3441,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v
// is_trivially_move_constructible
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_constructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
@@ -3413,7 +3499,7 @@ template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_trivially_assignable_
// is_trivially_copy_assignable
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_assignable
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
@@ -3424,7 +3510,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v
// is_trivially_move_assignable
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_assignable
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
typename add_rvalue_reference<_Tp>::type>
@@ -3442,7 +3528,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_assignable_v
#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403)
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
: public integral_constant<bool, is_destructible<_Tp>::value && __has_trivial_destructor(_Tp)> {};
#else
@@ -3451,10 +3537,10 @@ template <class _Tp> struct __libcpp_trivial_destructor
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_reference<_Tp>::value> {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible
: public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible<_Tp[]>
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible<_Tp[]>
: public false_type {};
#endif
@@ -3468,7 +3554,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_destructible_v
#if 0
template <class _Tp, class... _Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
: public integral_constant<bool, __is_nothrow_constructible(_Tp(_Args...))>
{
};
@@ -3503,13 +3589,13 @@ struct __libcpp_is_nothrow_constructible</*is constructible*/false, _IsReference
};
template <class _Tp, class... _Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
: __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, is_reference<_Tp>::value, _Tp, _Args...>
{
};
template <class _Tp, size_t _Ns>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp[_Ns]>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp[_Ns]>
: __libcpp_is_nothrow_constructible<is_constructible<_Tp>::value, is_reference<_Tp>::value, _Tp>
{
};
@@ -3517,13 +3603,13 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp[_Ns]>
#else // __has_feature(cxx_noexcept)
template <class _Tp, class... _Args>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
: false_type
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp>
#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_constructor(_Tp)>
#else
@@ -3534,9 +3620,9 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp>
template <class _Tp>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&&>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&&>
#else
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp>
#endif
#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
@@ -3547,7 +3633,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp>
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&>
#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
@@ -3557,7 +3643,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&>
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&>
#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
@@ -3572,13 +3658,13 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&>
template <class _Tp, class _A0 = __is_construct::__nat,
class _A1 = __is_construct::__nat>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
: false_type
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, __is_construct::__nat,
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, __is_construct::__nat,
__is_construct::__nat>
#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_constructor(_Tp)>
@@ -3589,7 +3675,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, __is_construct::__nat
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp,
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp,
__is_construct::__nat>
#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
@@ -3600,7 +3686,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp,
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&,
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&,
__is_construct::__nat>
#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
@@ -3611,7 +3697,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&,
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&,
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&,
__is_construct::__nat>
#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
@@ -3631,7 +3717,7 @@ template <class _Tp, class ..._Args> _LIBCPP_CONSTEXPR bool is_nothrow_construct
// is_nothrow_default_constructible
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_default_constructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_default_constructible
: public is_nothrow_constructible<_Tp>
{};
@@ -3642,7 +3728,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_default_constructible_v
// is_nothrow_copy_constructible
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
: public is_nothrow_constructible<_Tp,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
@@ -3653,7 +3739,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v
// is_nothrow_move_constructible
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_constructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
: public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
@@ -3685,7 +3771,7 @@ struct __libcpp_is_nothrow_assignable<true, _Tp, _Arg>
};
template <class _Tp, class _Arg>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable
: public __libcpp_is_nothrow_assignable<is_assignable<_Tp, _Arg>::value, _Tp, _Arg>
{
};
@@ -3693,11 +3779,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable
#else // __has_feature(cxx_noexcept)
template <class _Tp, class _Arg>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable
: public false_type {};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, _Tp>
#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
@@ -3705,7 +3791,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp>
#endif
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp&>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, _Tp&>
#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
@@ -3713,7 +3799,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp&>
#endif
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, const _Tp&>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, const _Tp&>
#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
@@ -3741,7 +3827,7 @@ template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_nothrow_assignable_v
// is_nothrow_copy_assignable
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_assignable
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable
: public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
@@ -3752,7 +3838,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v
// is_nothrow_move_assignable
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_assignable
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable
: public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
typename add_rvalue_reference<_Tp>::type>
@@ -3785,19 +3871,19 @@ struct __libcpp_is_nothrow_destructible<true, _Tp>
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
: public __libcpp_is_nothrow_destructible<is_destructible<_Tp>::value, _Tp>
{
};
template <class _Tp, size_t _Ns>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp[_Ns]>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[_Ns]>
: public is_nothrow_destructible<_Tp>
{
};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp&>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&>
: public true_type
{
};
@@ -3805,7 +3891,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp&>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp&&>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&>
: public true_type
{
};
@@ -3818,11 +3904,11 @@ template <class _Tp> struct __libcpp_nothrow_destructor
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_reference<_Tp>::value> {};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
: public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
template <class _Tp>
-struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp[]>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]>
: public false_type {};
#endif
@@ -3836,12 +3922,12 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_destructible_v
#if __has_feature(is_pod) || (_GNUC_VER >= 403)
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
: public integral_constant<bool, __is_pod(_Tp)> {};
#else
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pod
: public integral_constant<bool, is_trivially_default_constructible<_Tp>::value &&
is_trivially_copy_constructible<_Tp>::value &&
is_trivially_copy_assignable<_Tp>::value &&
@@ -3856,7 +3942,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_pod_v
// is_literal_type;
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_literal_type
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_literal_type
#ifdef _LIBCPP_IS_LITERAL
: public integral_constant<bool, _LIBCPP_IS_LITERAL(_Tp)>
#else
@@ -3872,7 +3958,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_literal_type_v
// is_standard_layout;
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_standard_layout
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_standard_layout
#if __has_feature(is_standard_layout) || (_GNUC_VER >= 407)
: public integral_constant<bool, __is_standard_layout(_Tp)>
#else
@@ -3887,7 +3973,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_standard_layout_v
// is_trivially_copyable;
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copyable
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copyable
#if __has_feature(is_trivially_copyable)
: public integral_constant<bool, __is_trivially_copyable(_Tp)>
#elif _GNUC_VER >= 501
@@ -3904,7 +3990,7 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copyable_v
// is_trivial;
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivial
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivial
#if __has_feature(is_trivial) || _GNUC_VER >= 407
: public integral_constant<bool, __is_trivial(_Tp)>
#else
@@ -3918,7 +4004,12 @@ template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivial_v
= is_trivial<_Tp>::value;
#endif
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
+template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
+template <class _Tp> struct __is_reference_wrapper
+ : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};
+
+#ifndef _LIBCPP_CXX03_LANG
// Check for complete types
@@ -4006,8 +4097,6 @@ struct __check_complete<_Rp (_Class::*)(_Param...) const volatile>
{
};
-#if __has_feature(cxx_reference_qualified_functions)
-
template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) &>
: private __check_complete<_Class>
@@ -4056,127 +4145,259 @@ struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&>
{
};
-#endif
-
template <class _Rp, class _Class>
struct __check_complete<_Rp _Class::*>
: private __check_complete<_Class>
{
};
+
+template <class _Fp, class _A0,
+ class _DecayFp = typename decay<_Fp>::type,
+ class _DecayA0 = typename decay<_A0>::type,
+ class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
+using __enable_if_bullet1 = typename enable_if
+ <
+ is_member_function_pointer<_DecayFp>::value
+ && is_base_of<_ClassT, _DecayA0>::value
+ >::type;
+
+template <class _Fp, class _A0,
+ class _DecayFp = typename decay<_Fp>::type,
+ class _DecayA0 = typename decay<_A0>::type>
+using __enable_if_bullet2 = typename enable_if
+ <
+ is_member_function_pointer<_DecayFp>::value
+ && __is_reference_wrapper<_DecayA0>::value
+ >::type;
+
+template <class _Fp, class _A0,
+ class _DecayFp = typename decay<_Fp>::type,
+ class _DecayA0 = typename decay<_A0>::type,
+ class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
+using __enable_if_bullet3 = typename enable_if
+ <
+ is_member_function_pointer<_DecayFp>::value
+ && !is_base_of<_ClassT, _DecayA0>::value
+ && !__is_reference_wrapper<_DecayA0>::value
+ >::type;
+
+template <class _Fp, class _A0,
+ class _DecayFp = typename decay<_Fp>::type,
+ class _DecayA0 = typename decay<_A0>::type,
+ class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
+using __enable_if_bullet4 = typename enable_if
+ <
+ is_member_object_pointer<_DecayFp>::value
+ && is_base_of<_ClassT, _DecayA0>::value
+ >::type;
+
+template <class _Fp, class _A0,
+ class _DecayFp = typename decay<_Fp>::type,
+ class _DecayA0 = typename decay<_A0>::type>
+using __enable_if_bullet5 = typename enable_if
+ <
+ is_member_object_pointer<_DecayFp>::value
+ && __is_reference_wrapper<_DecayA0>::value
+ >::type;
+
+template <class _Fp, class _A0,
+ class _DecayFp = typename decay<_Fp>::type,
+ class _DecayA0 = typename decay<_A0>::type,
+ class _ClassT = typename __member_pointer_class_type<_DecayFp>::type>
+using __enable_if_bullet6 = typename enable_if
+ <
+ is_member_object_pointer<_DecayFp>::value
+ && !is_base_of<_ClassT, _DecayA0>::value
+ && !__is_reference_wrapper<_DecayA0>::value
+ >::type;
+
// __invoke forward declarations
// fall back - none of the bullets
+#define _LIBCPP_INVOKE_RETURN(...) \
+ noexcept(noexcept(__VA_ARGS__)) -> decltype(__VA_ARGS__) \
+ { return __VA_ARGS__; }
+
template <class ..._Args>
+auto __invoke(__any, _Args&& ...__args) -> __nat;
+
+template <class ..._Args>
+auto __invoke_constexpr(__any, _Args&& ...__args) -> __nat;
+
+// bullets 1, 2 and 3
+
+template <class _Fp, class _A0, class ..._Args,
+ class = __enable_if_bullet1<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
auto
-__invoke(__any, _Args&& ...__args)
- -> __nat;
+__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
+_LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
-// bullets 1 and 2
+template <class _Fp, class _A0, class ..._Args,
+ class = __enable_if_bullet1<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR auto
+__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
+_LIBCPP_INVOKE_RETURN((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
template <class _Fp, class _A0, class ..._Args,
- class = typename enable_if
- <
- is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
- is_base_of<typename remove_reference<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType>::type,
- typename remove_reference<_A0>::type>::value
- >::type
- >
-_LIBCPP_INLINE_VISIBILITY
+ class = __enable_if_bullet2<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
- -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
+_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))
+
+template <class _Fp, class _A0, class ..._Args,
+ class = __enable_if_bullet2<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR auto
+__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
+_LIBCPP_INVOKE_RETURN((__a0.get().*__f)(_VSTD::forward<_Args>(__args)...))
template <class _Fp, class _A0, class ..._Args,
- class = typename enable_if
- <
- is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
- !is_base_of<typename remove_reference<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType>::type,
- typename remove_reference<_A0>::type>::value
- >::type
- >
-_LIBCPP_INLINE_VISIBILITY
+ class = __enable_if_bullet3<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
- -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
+_LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
+
+template <class _Fp, class _A0, class ..._Args,
+ class = __enable_if_bullet3<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR auto
+__invoke_constexpr(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
+_LIBCPP_INVOKE_RETURN(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
-// bullets 3 and 4
+// bullets 4, 5 and 6
template <class _Fp, class _A0,
- class = typename enable_if
- <
- is_member_object_pointer<typename remove_reference<_Fp>::type>::value &&
- is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
- typename remove_reference<_A0>::type>::value
- >::type
- >
-_LIBCPP_INLINE_VISIBILITY
+ class = __enable_if_bullet4<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
- -> decltype(_VSTD::forward<_A0>(__a0).*__f);
+_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
+
+template <class _Fp, class _A0,
+ class = __enable_if_bullet4<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR auto
+__invoke_constexpr(_Fp&& __f, _A0&& __a0)
+_LIBCPP_INVOKE_RETURN(_VSTD::forward<_A0>(__a0).*__f)
template <class _Fp, class _A0,
- class = typename enable_if
- <
- is_member_object_pointer<typename remove_reference<_Fp>::type>::value &&
- !is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
- typename remove_reference<_A0>::type>::value
- >::type
- >
-_LIBCPP_INLINE_VISIBILITY
+ class = __enable_if_bullet5<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
- -> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
+_LIBCPP_INVOKE_RETURN(__a0.get().*__f)
-// bullet 5
+template <class _Fp, class _A0,
+ class = __enable_if_bullet5<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR auto
+__invoke_constexpr(_Fp&& __f, _A0&& __a0)
+_LIBCPP_INVOKE_RETURN(__a0.get().*__f)
+
+template <class _Fp, class _A0,
+ class = __enable_if_bullet6<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
+auto
+__invoke(_Fp&& __f, _A0&& __a0)
+_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
+
+template <class _Fp, class _A0,
+ class = __enable_if_bullet6<_Fp, _A0>>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR auto
+__invoke_constexpr(_Fp&& __f, _A0&& __a0)
+_LIBCPP_INVOKE_RETURN((*_VSTD::forward<_A0>(__a0)).*__f)
+
+// bullet 7
template <class _Fp, class ..._Args>
-_LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _Args&& ...__args)
- -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...));
+_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
+
+template <class _Fp, class ..._Args>
+inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR auto
+__invoke_constexpr(_Fp&& __f, _Args&& ...__args)
+_LIBCPP_INVOKE_RETURN(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
+
+#undef _LIBCPP_INVOKE_RETURN
// __invokable
-template <class _Fp, class ..._Args>
-struct __invokable_imp
+template <class _Ret, class _Fp, class ..._Args>
+struct __invokable_r
: private __check_complete<_Fp>
{
- typedef decltype(
- __invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)
- ) type;
- static const bool value = !is_same<type, __nat>::value;
+ using _Result = decltype(
+ _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...));
+
+ static const bool value =
+ conditional<
+ !is_same<_Result, __nat>::value,
+ typename conditional<
+ is_void<_Ret>::value,
+ true_type,
+ is_convertible<_Result, _Ret>
+ >::type,
+ false_type
+ >::type::value;
};
template <class _Fp, class ..._Args>
-struct __invokable
- : public integral_constant<bool,
- __invokable_imp<_Fp, _Args...>::value>
-{
-};
+using __invokable = __invokable_r<void, _Fp, _Args...>;
-// __invoke_of
+template <bool _IsInvokable, bool _IsCVVoid, class _Ret, class _Fp, class ..._Args>
+struct __nothrow_invokable_r_imp {
+ static const bool value = false;
+};
-template <bool _Invokable, class _Fp, class ..._Args>
-struct __invoke_of_imp // false
+template <class _Ret, class _Fp, class ..._Args>
+struct __nothrow_invokable_r_imp<true, false, _Ret, _Fp, _Args...>
{
+ typedef __nothrow_invokable_r_imp _ThisT;
+
+ template <class _Tp>
+ static void __test_noexcept(_Tp) noexcept;
+
+ static const bool value = noexcept(_ThisT::__test_noexcept<_Ret>(
+ _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)));
};
-template <class _Fp, class ..._Args>
-struct __invoke_of_imp<true, _Fp, _Args...>
+template <class _Ret, class _Fp, class ..._Args>
+struct __nothrow_invokable_r_imp<true, true, _Ret, _Fp, _Args...>
{
- typedef typename __invokable_imp<_Fp, _Args...>::type type;
+ static const bool value = noexcept(
+ _VSTD::__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...));
};
+template <class _Ret, class _Fp, class ..._Args>
+using __nothrow_invokable_r =
+ __nothrow_invokable_r_imp<
+ __invokable_r<_Ret, _Fp, _Args...>::value,
+ is_void<_Ret>::value,
+ _Ret, _Fp, _Args...
+ >;
+
template <class _Fp, class ..._Args>
struct __invoke_of
- : public __invoke_of_imp<__invokable<_Fp, _Args...>::value, _Fp, _Args...>
+ : public enable_if<
+ __invokable<_Fp, _Args...>::value,
+ typename __invokable_r<void, _Fp, _Args...>::_Result>
{
};
+// result_of
+
template <class _Fp, class ..._Args>
-class _LIBCPP_TYPE_VIS_ONLY result_of<_Fp(_Args...)>
+class _LIBCPP_TEMPLATE_VIS result_of<_Fp(_Args...)>
: public __invoke_of<_Fp, _Args...>
{
};
@@ -4185,11 +4406,43 @@ class _LIBCPP_TYPE_VIS_ONLY result_of<_Fp(_Args...)>
template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
#endif
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#if _LIBCPP_STD_VER > 14
+
+// is_callable
+
+template <class _Fn, class _Ret = void>
+struct _LIBCPP_TEMPLATE_VIS is_callable;
+
+template <class _Fn, class ..._Args, class _Ret>
+struct _LIBCPP_TEMPLATE_VIS is_callable<_Fn(_Args...), _Ret>
+ : integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
+
+template <class _Fn, class _Ret = void>
+constexpr bool is_callable_v = is_callable<_Fn, _Ret>::value;
+
+// is_nothrow_callable
+
+template <class _Fn, class _Ret = void>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_callable;
+
+template <class _Fn, class ..._Args, class _Ret>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_callable<_Fn(_Args...), _Ret>
+ : integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value>
+{};
+
+template <class _Fn, class _Ret = void>
+constexpr bool is_nothrow_callable_v = is_nothrow_callable<_Fn, _Ret>::value;
+
+#endif // _LIBCPP_STD_VER > 14
+
+#endif // !defined(_LIBCPP_CXX03_LANG)
+
+template <class _Tp> struct __is_swappable;
+template <class _Tp> struct __is_nothrow_swappable;
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
typename enable_if
<
is_move_constructible<_Tp>::value &&
@@ -4206,6 +4459,13 @@ swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&
__y = _VSTD::move(__t);
}
+template<class _Tp, size_t _Np>
+inline _LIBCPP_INLINE_VISIBILITY
+typename enable_if<
+ __is_swappable<_Tp>::value
+>::type
+swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
+
template <class _ForwardIterator1, class _ForwardIterator2>
inline _LIBCPP_INLINE_VISIBILITY
void
@@ -4221,55 +4481,108 @@ iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
namespace __detail
{
+// ALL generic swap overloads MUST already have a declaration available at this point.
-using _VSTD::swap;
-__nat swap(__any, __any);
-
-template <class _Tp>
-struct __swappable
+template <class _Tp, class _Up = _Tp,
+ bool _NotVoid = !is_void<_Tp>::value && !is_void<_Up>::value>
+struct __swappable_with
{
- typedef decltype(swap(_VSTD::declval<_Tp&>(), _VSTD::declval<_Tp&>())) type;
- static const bool value = !is_same<type, __nat>::value;
+ template <class _LHS, class _RHS>
+ static decltype(swap(_VSTD::declval<_LHS>(), _VSTD::declval<_RHS>()))
+ __test_swap(int);
+ template <class, class>
+ static __nat __test_swap(long);
+
+ // Extra parens are needed for the C++03 definition of decltype.
+ typedef decltype((__test_swap<_Tp, _Up>(0))) __swap1;
+ typedef decltype((__test_swap<_Up, _Tp>(0))) __swap2;
+
+ static const bool value = !is_same<__swap1, __nat>::value
+ && !is_same<__swap2, __nat>::value;
+};
+
+template <class _Tp, class _Up>
+struct __swappable_with<_Tp, _Up, false> : false_type {};
+
+template <class _Tp, class _Up = _Tp, bool _Swappable = __swappable_with<_Tp, _Up>::value>
+struct __nothrow_swappable_with {
+ static const bool value =
+#ifndef _LIBCPP_HAS_NO_NOEXCEPT
+ noexcept(swap(_VSTD::declval<_Tp>(), _VSTD::declval<_Up>()))
+ && noexcept(swap(_VSTD::declval<_Up>(), _VSTD::declval<_Tp>()));
+#else
+ false;
+#endif
};
+template <class _Tp, class _Up>
+struct __nothrow_swappable_with<_Tp, _Up, false> : false_type {};
+
} // __detail
template <class _Tp>
struct __is_swappable
- : public integral_constant<bool, __detail::__swappable<_Tp>::value>
+ : public integral_constant<bool, __detail::__swappable_with<_Tp&>::value>
{
};
-#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
-
-template <bool, class _Tp>
-struct __is_nothrow_swappable_imp
- : public integral_constant<bool, noexcept(swap(_VSTD::declval<_Tp&>(),
- _VSTD::declval<_Tp&>()))>
+template <class _Tp>
+struct __is_nothrow_swappable
+ : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp&>::value>
{
};
-template <class _Tp>
-struct __is_nothrow_swappable_imp<false, _Tp>
- : public false_type
+#if _LIBCPP_STD_VER > 14
+
+template <class _Tp, class _Up>
+struct _LIBCPP_TEMPLATE_VIS is_swappable_with
+ : public integral_constant<bool, __detail::__swappable_with<_Tp, _Up>::value>
{
};
template <class _Tp>
-struct __is_nothrow_swappable
- : public __is_nothrow_swappable_imp<__is_swappable<_Tp>::value, _Tp>
+struct _LIBCPP_TEMPLATE_VIS is_swappable
+ : public conditional<
+ __is_referenceable<_Tp>::value,
+ is_swappable_with<
+ typename add_lvalue_reference<_Tp>::type,
+ typename add_lvalue_reference<_Tp>::type>,
+ false_type
+ >::type
{
};
-#else // __has_feature(cxx_noexcept)
+template <class _Tp, class _Up>
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with
+ : public integral_constant<bool, __detail::__nothrow_swappable_with<_Tp, _Up>::value>
+{
+};
template <class _Tp>
-struct __is_nothrow_swappable
- : public false_type
+struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable
+ : public conditional<
+ __is_referenceable<_Tp>::value,
+ is_nothrow_swappable_with<
+ typename add_lvalue_reference<_Tp>::type,
+ typename add_lvalue_reference<_Tp>::type>,
+ false_type
+ >::type
{
};
-#endif // __has_feature(cxx_noexcept)
+template <class _Tp, class _Up>
+constexpr bool is_swappable_with_v = is_swappable_with<_Tp, _Up>::value;
+
+template <class _Tp>
+constexpr bool is_swappable_v = is_swappable<_Tp>::value;
+
+template <class _Tp, class _Up>
+constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<_Tp, _Up>::value;
+
+template <class _Tp>
+constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<_Tp>::value;
+
+#endif // _LIBCPP_STD_VER > 14
#ifdef _LIBCPP_UNDERLYING_TYPE
@@ -4296,7 +4609,7 @@ struct underlying_type
#endif // _LIBCPP_UNDERLYING_TYPE
-template <class _Tp, bool = std::is_enum<_Tp>::value>
+template <class _Tp, bool = is_enum<_Tp>::value>
struct __sfinae_underlying_type
{
typedef typename underlying_type<_Tp>::type type;
@@ -4337,7 +4650,7 @@ inline _LIBCPP_INLINE_VISIBILITY
typename __sfinae_underlying_type<_Tp>::__promoted_type
__convert_to_integral(_Tp __val) { return __val; }
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
struct __has_operator_addressof_member_imp
@@ -4369,9 +4682,11 @@ struct __has_operator_addressof
|| __has_operator_addressof_free_imp<_Tp>::value>
{};
-#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
+
+#define __cpp_lib_void_t 201411
template <class...> using void_t = void;
# ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -4389,6 +4704,70 @@ template<class _Tp> constexpr bool negation_v = negation<_Tp>::value;
# endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_STD_VER > 14
+// These traits are used in __tree and __hash_table
+#ifndef _LIBCPP_CXX03_LANG
+struct __extract_key_fail_tag {};
+struct __extract_key_self_tag {};
+struct __extract_key_first_tag {};
+
+template <class _ValTy, class _Key,
+ class _RawValTy = typename __unconstref<_ValTy>::type>
+struct __can_extract_key
+ : conditional<is_same<_RawValTy, _Key>::value, __extract_key_self_tag,
+ __extract_key_fail_tag>::type {};
+
+template <class _Pair, class _Key, class _First, class _Second>
+struct __can_extract_key<_Pair, _Key, pair<_First, _Second>>
+ : conditional<is_same<typename remove_const<_First>::type, _Key>::value,
+ __extract_key_first_tag, __extract_key_fail_tag>::type {};
+
+// __can_extract_map_key uses true_type/false_type instead of the tags.
+// It returns true if _Key != _ContainerValueTy (the container is a map not a set)
+// and _ValTy == _Key.
+template <class _ValTy, class _Key, class _ContainerValueTy,
+ class _RawValTy = typename __unconstref<_ValTy>::type>
+struct __can_extract_map_key
+ : integral_constant<bool, is_same<_RawValTy, _Key>::value> {};
+
+// This specialization returns __extract_key_fail_tag for non-map containers
+// because _Key == _ContainerValueTy
+template <class _ValTy, class _Key, class _RawValTy>
+struct __can_extract_map_key<_ValTy, _Key, _Key, _RawValTy>
+ : false_type {};
+
+#endif
+
_LIBCPP_END_NAMESPACE_STD
+#if _LIBCPP_STD_VER > 14
+// std::byte
+namespace std // purposefully not versioned
+{
+template <class _Integer>
+ constexpr typename enable_if<is_integral_v<_Integer>, byte>::type &
+ operator<<=(byte& __lhs, _Integer __shift) noexcept
+ { return __lhs = byte(static_cast<unsigned char>(__lhs) << __shift); }
+
+template <class _Integer>
+ constexpr typename enable_if<is_integral_v<_Integer>, byte>::type
+ operator<< (byte __lhs, _Integer __shift) noexcept
+ { return byte(static_cast<unsigned char>(__lhs) << __shift); }
+
+template <class _Integer>
+ constexpr typename enable_if<is_integral_v<_Integer>, byte>::type &
+ operator>>=(byte& __lhs, _Integer __shift) noexcept
+ { return __lhs = byte(static_cast<unsigned char>(__lhs) >> __shift); }
+
+template <class _Integer>
+ constexpr typename enable_if<is_integral_v<_Integer>, byte>::type
+ operator>> (byte __lhs, _Integer __shift) noexcept
+ { return byte(static_cast<unsigned char>(__lhs) >> __shift); }
+
+template <class _Integer>
+ constexpr typename enable_if<is_integral_v<_Integer>, _Integer>::type
+ to_integer(byte __b) noexcept { return _Integer(__b); }
+
+}
+#endif
+
#endif // _LIBCPP_TYPE_TRAITS
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/typeindex b/chromium/buildtools/third_party/libc++/trunk/include/typeindex
index d4d6ca96ba4..0565ca913e3 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/typeindex
+++ b/chromium/buildtools/third_party/libc++/trunk/include/typeindex
@@ -55,7 +55,7 @@ struct hash<type_index>
_LIBCPP_BEGIN_NAMESPACE_STD
-class _LIBCPP_TYPE_VIS_ONLY type_index
+class _LIBCPP_TEMPLATE_VIS type_index
{
const type_info* __t_;
public:
@@ -87,10 +87,10 @@ public:
const char* name() const _NOEXCEPT {return __t_->name();}
};
-template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash;
+template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;
template <>
-struct _LIBCPP_TYPE_VIS_ONLY hash<type_index>
+struct _LIBCPP_TEMPLATE_VIS hash<type_index>
: public unary_function<type_index, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/typeinfo b/chromium/buildtools/third_party/libc++/trunk/include/typeinfo
index 14ef77b31c3..8624b349764 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/typeinfo
+++ b/chromium/buildtools/third_party/libc++/trunk/include/typeinfo
@@ -61,88 +61,116 @@ public:
#include <exception>
#include <cstddef>
#include <cstdint>
+#ifdef _LIBCPP_NO_EXCEPTIONS
+#include <cstdlib>
+#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
+#if defined(_LIBCPP_ABI_MICROSOFT)
+#include <vcruntime_typeinfo.h>
+#elif defined(_LIBCPP_NONUNIQUE_RTTI_BIT)
+#define _LIBCPP_HAS_NONUNIQUE_TYPEINFO
+#else
+#define _LIBCPP_HAS_UNIQUE_TYPEINFO
+#endif
+
namespace std // purposefully not using versioning namespace
{
+#if !defined(_LIBCPP_ABI_MICROSOFT)
class _LIBCPP_EXCEPTION_ABI type_info
{
type_info& operator=(const type_info&);
type_info(const type_info&);
+
+#if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO)
+ _LIBCPP_INLINE_VISIBILITY
+ int __compare_nonunique_names(const type_info &__arg) const _NOEXCEPT
+ { return __builtin_strcmp(name(), __arg.name()); }
+#endif
+
protected:
-#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
- const char* __type_name;
-#else
+#if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO)
// A const char* with the non-unique RTTI bit possibly set.
uintptr_t __type_name;
-#endif
_LIBCPP_INLINE_VISIBILITY
explicit type_info(const char* __n)
-#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
- : __type_name(__n) {}
+ : __type_name(reinterpret_cast<uintptr_t>(__n)) {}
#else
- : __type_name(reinterpret_cast<uintptr_t>(__n)) {}
+ const char *__type_name;
+
+ _LIBCPP_INLINE_VISIBILITY
+ explicit type_info(const char* __n) : __type_name(__n) {}
#endif
public:
+ _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
virtual ~type_info();
+#if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO)
_LIBCPP_INLINE_VISIBILITY
const char* name() const _NOEXCEPT
-#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
- {return __type_name;}
-#else
- {return reinterpret_cast<const char*>(__type_name & ~_LIBCPP_NONUNIQUE_RTTI_BIT);}
-#endif
+ {
+ return reinterpret_cast<const char*>(__type_name &
+ ~_LIBCPP_NONUNIQUE_RTTI_BIT);
+ }
_LIBCPP_INLINE_VISIBILITY
bool before(const type_info& __arg) const _NOEXCEPT
-#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
- {return __type_name < __arg.__type_name;}
-#else
- {if (!((__type_name & __arg.__type_name) & _LIBCPP_NONUNIQUE_RTTI_BIT))
- return __type_name < __arg.__type_name;
- return __compare_nonunique_names(__arg) < 0;}
-#endif
+ {
+ if (!((__type_name & __arg.__type_name) & _LIBCPP_NONUNIQUE_RTTI_BIT))
+ return __type_name < __arg.__type_name;
+ return __compare_nonunique_names(__arg) < 0;
+ }
_LIBCPP_INLINE_VISIBILITY
size_t hash_code() const _NOEXCEPT
-#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
- {return *reinterpret_cast<const size_t*>(&__type_name);}
-#else
- {if (!(__type_name & _LIBCPP_NONUNIQUE_RTTI_BIT)) return __type_name;
- const char *__ptr = name();
- size_t __hash = 5381;
- while (unsigned char __c = static_cast<unsigned char>(*__ptr++))
- __hash = (__hash * 33) ^ __c;
- return __hash;}
-#endif
+ {
+ if (!(__type_name & _LIBCPP_NONUNIQUE_RTTI_BIT))
+ return __type_name;
+
+ const char* __ptr = name();
+ size_t __hash = 5381;
+ while (unsigned char __c = static_cast<unsigned char>(*__ptr++))
+ __hash = (__hash * 33) ^ __c;
+ return __hash;
+ }
_LIBCPP_INLINE_VISIBILITY
bool operator==(const type_info& __arg) const _NOEXCEPT
-#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
- {return __type_name == __arg.__type_name;}
+ {
+ if (__type_name == __arg.__type_name)
+ return true;
+
+ if (!((__type_name & __arg.__type_name) & _LIBCPP_NONUNIQUE_RTTI_BIT))
+ return false;
+ return __compare_nonunique_names(__arg) == 0;
+ }
#else
- {if (__type_name == __arg.__type_name) return true;
- if (!((__type_name & __arg.__type_name) & _LIBCPP_NONUNIQUE_RTTI_BIT))
- return false;
- return __compare_nonunique_names(__arg) == 0;}
-#endif
_LIBCPP_INLINE_VISIBILITY
- bool operator!=(const type_info& __arg) const _NOEXCEPT
- {return !operator==(__arg);}
+ const char* name() const _NOEXCEPT
+ { return __type_name; }
-#ifdef _LIBCPP_NONUNIQUE_RTTI_BIT
- private:
_LIBCPP_INLINE_VISIBILITY
- int __compare_nonunique_names(const type_info &__arg) const _NOEXCEPT
- {return __builtin_strcmp(name(), __arg.name());}
+ bool before(const type_info& __arg) const _NOEXCEPT
+ { return __type_name < __arg.__type_name; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ size_t hash_code() const _NOEXCEPT
+ { return reinterpret_cast<size_t>(__type_name); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator==(const type_info& __arg) const _NOEXCEPT
+ { return __type_name == __arg.__type_name; }
#endif
+
+ _LIBCPP_INLINE_VISIBILITY
+ bool operator!=(const type_info& __arg) const _NOEXCEPT
+ { return !operator==(__arg); }
};
class _LIBCPP_EXCEPTION_ABI bad_cast
@@ -163,6 +191,20 @@ public:
virtual const char* what() const _NOEXCEPT;
};
+#endif // !_LIBCPP_ABI_MICROSOFT
+
} // std
+_LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
+void __throw_bad_cast()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_cast();
+#else
+ _VSTD::abort();
+#endif
+}
+_LIBCPP_END_NAMESPACE_STD
+
#endif // __LIBCPP_TYPEINFO
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/unordered_map b/chromium/buildtools/third_party/libc++/trunk/include/unordered_map
index 3c774d4094e..0546c0e2f9f 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/unordered_map
+++ b/chromium/buildtools/third_party/libc++/trunk/include/unordered_map
@@ -369,6 +369,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <__hash_table>
#include <functional>
#include <stdexcept>
+#include <tuple>
#include <__debug>
@@ -378,9 +379,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Key, class _Cp, class _Hash,
- bool = is_empty<_Hash>::value && !__libcpp_is_final<_Hash>::value
- >
+template <class _Key, class _Cp, class _Hash, bool _IsEmpty>
class __unordered_map_hasher
: private _Hash
{
@@ -405,7 +404,7 @@ public:
_NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
{
using _VSTD::swap;
- swap(static_cast<const _Hash&>(*this), static_cast<const _Hash&>(__y));
+ swap(static_cast<_Hash&>(*this), static_cast<_Hash&>(__y));
}
};
@@ -413,7 +412,6 @@ template <class _Key, class _Cp, class _Hash>
class __unordered_map_hasher<_Key, _Cp, _Hash, false>
{
_Hash __hash_;
-
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher()
@@ -449,9 +447,7 @@ swap(__unordered_map_hasher<_Key, _Cp, _Hash, __b>& __x,
__x.swap(__y);
}
-template <class _Key, class _Cp, class _Pred,
- bool = is_empty<_Pred>::value && !__libcpp_is_final<_Pred>::value
- >
+template <class _Key, class _Cp, class _Pred, bool _IsEmpty>
class __unordered_map_equal
: private _Pred
{
@@ -479,7 +475,7 @@ public:
_NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
{
using _VSTD::swap;
- swap(static_cast<const _Pred&>(*this), static_cast<const _Pred&>(__y));
+ swap(static_cast<_Pred&>(*this), static_cast<_Pred&>(__y));
}
};
@@ -487,7 +483,6 @@ template <class _Key, class _Cp, class _Pred>
class __unordered_map_equal<_Key, _Cp, _Pred, false>
{
_Pred __pred_;
-
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal()
@@ -531,12 +526,11 @@ class __hash_map_node_destructor
{
typedef _Alloc allocator_type;
typedef allocator_traits<allocator_type> __alloc_traits;
- typedef typename __alloc_traits::value_type::value_type value_type;
+
public:
- typedef typename __alloc_traits::pointer pointer;
+
+ typedef typename __alloc_traits::pointer pointer;
private:
- typedef typename value_type::value_type::first_type first_type;
- typedef typename value_type::value_type::second_type second_type;
allocator_type& __na_;
@@ -553,7 +547,7 @@ public:
__second_constructed(false)
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
_NOEXCEPT
@@ -563,7 +557,7 @@ public:
{
__x.__value_constructed = false;
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
: __na_(__x.__na_),
@@ -572,7 +566,7 @@ public:
{
const_cast<bool&>(__x.__value_constructed) = false;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void operator()(pointer __p) _NOEXCEPT
@@ -586,8 +580,7 @@ public:
}
};
-#if __cplusplus >= 201103L
-
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp>
union __hash_value_type
{
@@ -599,19 +592,6 @@ union __hash_value_type
value_type __cc;
__nc_value_type __nc;
- template <class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- __hash_value_type(_Args&& ...__args)
- : __cc(std::forward<_Args>(__args)...) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __hash_value_type(const __hash_value_type& __v)
- : __cc(__v.__cc) {}
-
- _LIBCPP_INLINE_VISIBILITY
- __hash_value_type(__hash_value_type&& __v)
- : __nc(_VSTD::move(__v.__nc)) {}
-
_LIBCPP_INLINE_VISIBILITY
__hash_value_type& operator=(const __hash_value_type& __v)
{__nc = __v.__cc; return *this;}
@@ -620,8 +600,23 @@ union __hash_value_type
__hash_value_type& operator=(__hash_value_type&& __v)
{__nc = _VSTD::move(__v.__nc); return *this;}
+ template <class _ValueTp,
+ class = typename enable_if<
+ __is_same_uncvref<_ValueTp, value_type>::value
+ >::type
+ >
_LIBCPP_INLINE_VISIBILITY
- ~__hash_value_type() {__cc.~value_type();}
+ __hash_value_type& operator=(_ValueTp&& __v) {
+ __nc = _VSTD::forward<_ValueTp>(__v); return *this;
+ }
+
+private:
+ __hash_value_type(const __hash_value_type& __v) = delete;
+ __hash_value_type(__hash_value_type&& __v) = delete;
+ template <class ..._Args>
+ explicit __hash_value_type(_Args&& ...__args) = delete;
+
+ ~__hash_value_type() = delete;
};
#else
@@ -635,42 +630,25 @@ struct __hash_value_type
value_type __cc;
- _LIBCPP_INLINE_VISIBILITY
- __hash_value_type() {}
-
- template <class _A0>
- _LIBCPP_INLINE_VISIBILITY
- __hash_value_type(const _A0& __a0)
- : __cc(__a0) {}
-
- template <class _A0, class _A1>
- _LIBCPP_INLINE_VISIBILITY
- __hash_value_type(const _A0& __a0, const _A1& __a1)
- : __cc(__a0, __a1) {}
+private:
+ ~__hash_value_type();
};
#endif
template <class _HashIterator>
-class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator
+class _LIBCPP_TEMPLATE_VIS __hash_map_iterator
{
_HashIterator __i_;
- typedef pointer_traits<typename _HashIterator::pointer> __pointer_traits;
- typedef const typename _HashIterator::value_type::value_type::first_type key_type;
- typedef typename _HashIterator::value_type::value_type::second_type mapped_type;
+ typedef __hash_node_types_from_iterator<_HashIterator> _NodeTypes;
+
public:
typedef forward_iterator_tag iterator_category;
- typedef pair<key_type, mapped_type> value_type;
- typedef typename _HashIterator::difference_type difference_type;
+ typedef typename _NodeTypes::__map_value_type value_type;
+ typedef typename _NodeTypes::difference_type difference_type;
typedef value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<value_type>
-#else
- rebind<value_type>::other
-#endif
- pointer;
+ typedef typename _NodeTypes::__map_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY
__hash_map_iterator() _NOEXCEPT {}
@@ -700,33 +678,26 @@ public:
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator;
};
template <class _HashIterator>
-class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator
+class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator
{
_HashIterator __i_;
- typedef pointer_traits<typename _HashIterator::pointer> __pointer_traits;
- typedef const typename _HashIterator::value_type::value_type::first_type key_type;
- typedef typename _HashIterator::value_type::value_type::second_type mapped_type;
+ typedef __hash_node_types_from_iterator<_HashIterator> _NodeTypes;
+
public:
typedef forward_iterator_tag iterator_category;
- typedef pair<key_type, mapped_type> value_type;
- typedef typename _HashIterator::difference_type difference_type;
+ typedef typename _NodeTypes::__map_value_type value_type;
+ typedef typename _NodeTypes::difference_type difference_type;
typedef const value_type& reference;
- typedef typename __pointer_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind<const value_type>
-#else
- rebind<const value_type>::other
-#endif
- pointer;
+ typedef typename _NodeTypes::__const_map_value_type_pointer pointer;
_LIBCPP_INLINE_VISIBILITY
__hash_map_const_iterator() _NOEXCEPT {}
@@ -761,15 +732,15 @@ public:
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS unordered_multimap;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator;
};
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TYPE_VIS_ONLY unordered_map
+class _LIBCPP_TEMPLATE_VIS unordered_map
{
public:
// types
@@ -797,6 +768,7 @@ private:
__table __table_;
+ typedef typename __table::_NodeTypes _NodeTypes;
typedef typename __table::__node_pointer __node_pointer;
typedef typename __table::__node_const_pointer __node_const_pointer;
typedef typename __table::__node_traits __node_traits;
@@ -805,11 +777,14 @@ private:
typedef __hash_map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;
typedef allocator_traits<allocator_type> __alloc_traits;
+
+ static_assert((is_same<typename __table::__container_value_type, value_type>::value), "");
+ static_assert((is_same<typename __table::__node_value_type, __value_type>::value), "");
public:
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
- typedef typename __alloc_traits::size_type size_type;
- typedef typename __alloc_traits::difference_type difference_type;
+ typedef typename __table::size_type size_type;
+ typedef typename __table::difference_type difference_type;
typedef __hash_map_iterator<typename __table::iterator> iterator;
typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
@@ -840,22 +815,22 @@ public:
size_type __n, const hasher& __hf,
const key_equal& __eql,
const allocator_type& __a);
+ _LIBCPP_INLINE_VISIBILITY
explicit unordered_map(const allocator_type& __a);
unordered_map(const unordered_map& __u);
unordered_map(const unordered_map& __u, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
unordered_map(unordered_map&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
unordered_map(unordered_map&& __u, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
unordered_map(initializer_list<value_type> __il);
unordered_map(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
unordered_map(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 11
_LIBCPP_INLINE_VISIBILITY
unordered_map(size_type __n, const allocator_type& __a)
@@ -884,7 +859,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
unordered_map& operator=(const unordered_map& __u)
{
-#if __cplusplus >= 201103L
+#ifndef _LIBCPP_CXX03_LANG
__table_ = __u.__table_;
#else
if (this != &__u) {
@@ -898,13 +873,13 @@ public:
#endif
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
unordered_map& operator=(unordered_map&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
unordered_map& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
@@ -930,189 +905,174 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const _NOEXCEPT {return __table_.end();}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> insert(const value_type& __x)
+ {return __table_.__insert_unique(__x);}
- template <class... _Args>
- pair<iterator, bool> emplace(_Args&&... __args);
+ iterator insert(const_iterator __p, const value_type& __x) {
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
+ "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
+ " referring to this unordered_map");
+#else
+ ((void)__p);
+#endif
+ return insert(__x).first;
+ }
- template <class... _Args>
+ template <class _InputIterator>
_LIBCPP_INLINE_VISIBILITY
+ void insert(_InputIterator __first, _InputIterator __last);
+
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(initializer_list<value_type> __il)
+ {insert(__il.begin(), __il.end());}
+
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> insert(value_type&& __x)
+ {return __table_.__insert_unique(_VSTD::move(__x));}
+
+ iterator insert(const_iterator __p, value_type&& __x) {
#if _LIBCPP_DEBUG_LEVEL >= 2
- iterator emplace_hint(const_iterator __p, _Args&&... __args)
- {
- _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
- " referring to this unordered_map");
- return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;
- }
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
+ "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
+ " referring to this unordered_map");
#else
- iterator emplace_hint(const_iterator, _Args&&... __args)
- {return emplace(_VSTD::forward<_Args>(__args)...).first;}
+ ((void)__p);
#endif
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> insert(const value_type& __x)
- {return __table_.__insert_unique(__x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ return __table_.__insert_unique(_VSTD::move(__x)).first;
+ }
+
template <class _Pp,
class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(_Pp&& __x)
{return __table_.__insert_unique(_VSTD::forward<_Pp>(__x));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- _LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_DEBUG_LEVEL >= 2
- iterator insert(const_iterator __p, const value_type& __x)
- {
- _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
- " referring to this unordered_map");
- return insert(__x).first;
- }
-#else
- iterator insert(const_iterator, const value_type& __x)
- {return insert(__x).first;}
-#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
template <class _Pp,
class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
_LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_DEBUG_LEVEL >= 2
iterator insert(const_iterator __p, _Pp&& __x)
{
+#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
"unordered_map::insert(const_iterator, value_type&&) called with an iterator not"
" referring to this unordered_map");
+#else
+ ((void)__p);
+#endif
return insert(_VSTD::forward<_Pp>(__x)).first;
}
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> emplace(_Args&&... __args) {
+ return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...);
+ }
+
+ template <class... _Args>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
+ "unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
+ " referring to this unordered_map");
#else
- iterator insert(const_iterator, _Pp&& __x)
- {return insert(_VSTD::forward<_Pp>(__x)).first;}
+ ((void)__p);
#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _InputIterator>
- void insert(_InputIterator __first, _InputIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
- void insert(initializer_list<value_type> __il)
- {insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;
+ }
+
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 14
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> try_emplace(const key_type& __k, _Args&&... __args)
{
- iterator __p = __table_.find(__k);
- if ( __p != end())
- return _VSTD::make_pair(__p, false);
- else
- return _VSTD::make_pair(
- emplace_hint(__p,
- _VSTD::piecewise_construct, _VSTD::forward_as_tuple(__k),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)),
- true);
+ return __table_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct,
+ _VSTD::forward_as_tuple(__k),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> try_emplace(key_type&& __k, _Args&&... __args)
{
- iterator __p = __table_.find(__k);
- if ( __p != end())
- return _VSTD::make_pair(__p, false);
- else
- return _VSTD::make_pair(
- emplace_hint(__p,
- _VSTD::piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__k)),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)),
- true);
+ return __table_.__emplace_unique_key_args(__k, _VSTD::piecewise_construct,
+ _VSTD::forward_as_tuple(_VSTD::move(__k)),
+ _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator try_emplace(const_iterator __h, const key_type& __k, _Args&&... __args)
{
- iterator __p = __table_.find(__k);
- if ( __p != end())
- return __p;
- else
- return emplace_hint(__h,
- _VSTD::piecewise_construct, _VSTD::forward_as_tuple(__k),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
+ "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
+ " referring to this unordered_map");
+#else
+ ((void)__h);
+#endif
+ return try_emplace(__k, _VSTD::forward<_Args>(__args)...).first;
}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator try_emplace(const_iterator __h, key_type&& __k, _Args&&... __args)
{
- iterator __p = __table_.find(__k);
- if ( __p != end())
- return __p;
- else
- return emplace_hint(__h,
- _VSTD::piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__k)),
- _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...));
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__h) == this,
+ "unordered_map::try_emplace(const_iterator, key, args...) called with an iterator not"
+ " referring to this unordered_map");
+#else
+ ((void)__h);
+#endif
+ return try_emplace(_VSTD::move(__k), _VSTD::forward<_Args>(__args)...).first;
}
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert_or_assign(const key_type& __k, _Vp&& __v)
{
- iterator __p = __table_.find(__k);
- if ( __p != end())
- {
- __p->second = _VSTD::move(__v);
- return _VSTD::make_pair(__p, false);
+ pair<iterator, bool> __res = __table_.__emplace_unique_key_args(__k,
+ __k, _VSTD::forward<_Vp>(__v));
+ if (!__res.second) {
+ __res.first->second = _VSTD::forward<_Vp>(__v);
}
- return _VSTD::make_pair(emplace_hint(__p, __k, _VSTD::forward<_Vp>(__v)), true);
+ return __res;
}
-
+
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert_or_assign(key_type&& __k, _Vp&& __v)
{
- iterator __p = __table_.find(__k);
- if ( __p != end())
- {
- __p->second = _VSTD::move(__v);
- return _VSTD::make_pair(__p, false);
+ pair<iterator, bool> __res = __table_.__emplace_unique_key_args(__k,
+ _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
+ if (!__res.second) {
+ __res.first->second = _VSTD::forward<_Vp>(__v);
}
- return _VSTD::make_pair(emplace_hint(__p, _VSTD::forward<key_type>(__k), _VSTD::forward<_Vp>(__v)), true);
+ return __res;
}
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
- iterator insert_or_assign(const_iterator __h, const key_type& __k, _Vp&& __v)
+ iterator insert_or_assign(const_iterator, const key_type& __k, _Vp&& __v)
{
- iterator __p = __table_.find(__k);
- if ( __p != end())
- {
- __p->second = _VSTD::move(__v);
- return __p;
- }
- return emplace_hint(__h, __k, _VSTD::forward<_Vp>(__v));
+ // FIXME: Add debug mode checking for the iterator input
+ return insert_or_assign(__k, _VSTD::forward<_Vp>(__v)).first;
}
template <class _Vp>
_LIBCPP_INLINE_VISIBILITY
- iterator insert_or_assign(const_iterator __h, key_type&& __k, _Vp&& __v)
+ iterator insert_or_assign(const_iterator, key_type&& __k, _Vp&& __v)
{
- iterator __p = __table_.find(__k);
- if ( __p != end())
- {
- __p->second = _VSTD::move(__v);
- return __p;
- }
- return emplace_hint(__h, _VSTD::forward<key_type>(__k), _VSTD::forward<_Vp>(__v));
+ // FIXME: Add debug mode checking for the iterator input
+ return insert_or_assign(_VSTD::move(__k), _VSTD::forward<_Vp>(__v)).first;
}
-#endif
-#endif
-#endif
+#endif // _LIBCPP_STD_VER > 14
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
@@ -1129,7 +1089,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
void swap(unordered_map& __u)
_NOEXCEPT_(__is_nothrow_swappable<__table>::value)
- {__table_.swap(__u.__table_);}
+ { __table_.swap(__u.__table_);}
_LIBCPP_INLINE_VISIBILITY
hasher hash_function() const
@@ -1152,7 +1112,7 @@ public:
{return __table_.__equal_range_unique(__k);}
mapped_type& operator[](const key_type& __k);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
mapped_type& operator[](key_type&& __k);
#endif
@@ -1208,18 +1168,10 @@ public:
#endif // _LIBCPP_DEBUG_LEVEL >= 2
private:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- __node_holder __construct_node();
- template <class _A0>
- __node_holder
- __construct_node(_A0&& __a0);
- __node_holder __construct_node_with_key(key_type&& __k);
-#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class _A0, class _A1, class ..._Args>
- __node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifdef _LIBCPP_CXX03_LANG
__node_holder __construct_node_with_key(const key_type& __k);
+#endif
};
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -1237,7 +1189,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a)
- : __table_(__hf, __eql, __a)
+ : __table_(__hf, __eql, typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1246,10 +1198,10 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const allocator_type& __a)
- : __table_(__a)
+ : __table_(typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1286,7 +1238,7 @@ template <class _InputIterator>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
_InputIterator __first, _InputIterator __last, size_type __n,
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
- : __table_(__hf, __eql, __a)
+ : __table_(__hf, __eql, typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1310,7 +1262,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const unordered_map& __u, const allocator_type& __a)
- : __table_(__u.__table_, __a)
+ : __table_(__u.__table_, typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1319,10 +1271,10 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
unordered_map&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
@@ -1337,7 +1289,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
unordered_map&& __u, const allocator_type& __a)
- : __table_(_VSTD::move(__u.__table_), __a)
+ : __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1345,10 +1297,10 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
if (__a != __u.get_allocator())
{
iterator __i = __u.begin();
- while (__u.size() != 0)
- __table_.__insert_unique(
- _VSTD::move(__u.__table_.remove((__i++).__i_)->__value_)
- );
+ while (__u.size() != 0) {
+ __table_.__emplace_unique(_VSTD::move(
+ __u.__table_.remove((__i++).__i_)->__value_.__nc));
+ }
}
#if _LIBCPP_DEBUG_LEVEL >= 2
else
@@ -1356,10 +1308,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
initializer_list<value_type> __il)
@@ -1387,7 +1335,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
initializer_list<value_type> __il, size_type __n, const hasher& __hf,
const key_equal& __eql, const allocator_type& __a)
- : __table_(__hf, __eql, __a)
+ : __table_(__hf, __eql, typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1396,12 +1344,8 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
insert(__il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
@@ -1410,12 +1354,8 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
initializer_list<value_type> __il)
@@ -1424,82 +1364,39 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node()
-{
- __node_allocator& __na = __table_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_));
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class _A0>
-typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
-{
- __node_allocator& __na = __table_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
- _VSTD::forward<_A0>(__a0));
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(key_type&& __k)
+template <class _InputIterator>
+inline
+void
+unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
+ _InputIterator __last)
{
- __node_allocator& __na = __table_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), _VSTD::move(__k));
- __h.get_deleter().__first_constructed = true;
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
- __h.get_deleter().__second_constructed = true;
- return __h;
+ for (; __first != __last; ++__first)
+ __table_.__insert_unique(*__first);
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class _A0, class _A1, class ..._Args>
-typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0,
- _A1&& __a1,
- _Args&&... __args)
+_Tp&
+unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
{
- __node_allocator& __na = __table_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
- _VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
- _VSTD::forward<_Args>(__args)...);
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
+ return __table_.__emplace_unique_key_args(__k,
+ std::piecewise_construct, std::forward_as_tuple(__k),
+ std::forward_as_tuple()).first->__cc.second;
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class... _Args>
-pair<typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator, bool>
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_Args&&... __args)
+_Tp&
+unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)
{
- __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
- if (__r.second)
- __h.release();
- return __r;
+ return __table_.__emplace_unique_key_args(__k,
+ std::piecewise_construct, std::forward_as_tuple(std::move(__k)),
+ std::forward_as_tuple()).first->__cc.second;
}
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
@@ -1515,17 +1412,6 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
-void
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
- _InputIterator __last)
-{
- for (; __first != __last; ++__first)
- __table_.__insert_unique(*__first);
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
_Tp&
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
{
@@ -1538,22 +1424,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
return __r.first->second;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-_Tp&
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)
-{
- iterator __i = find(__k);
- if (__i != end())
- return __i->second;
- __node_holder __h = __construct_node_with_key(_VSTD::move(__k));
- pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
- __h.release();
- return __r.first->second;
-}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_MODE
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
_Tp&
@@ -1619,7 +1490,7 @@ operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TYPE_VIS_ONLY unordered_multimap
+class _LIBCPP_TEMPLATE_VIS unordered_multimap
{
public:
// types
@@ -1647,17 +1518,21 @@ private:
__table __table_;
+ typedef typename __table::_NodeTypes _NodeTypes;
typedef typename __table::__node_traits __node_traits;
typedef typename __table::__node_allocator __node_allocator;
typedef typename __table::__node __node;
typedef __hash_map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;
typedef allocator_traits<allocator_type> __alloc_traits;
+ static_assert((is_same<typename __node_traits::size_type,
+ typename __alloc_traits::size_type>::value),
+ "Allocator uses different size_type for different types");
public:
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
- typedef typename __alloc_traits::size_type size_type;
- typedef typename __alloc_traits::difference_type difference_type;
+ typedef typename __table::size_type size_type;
+ typedef typename __table::difference_type difference_type;
typedef __hash_map_iterator<typename __table::iterator> iterator;
typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
@@ -1688,15 +1563,15 @@ public:
size_type __n, const hasher& __hf,
const key_equal& __eql,
const allocator_type& __a);
+ _LIBCPP_INLINE_VISIBILITY
explicit unordered_multimap(const allocator_type& __a);
unordered_multimap(const unordered_multimap& __u);
unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
unordered_multimap(unordered_multimap&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
unordered_multimap(initializer_list<value_type> __il);
unordered_multimap(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(),
@@ -1704,7 +1579,7 @@ public:
unordered_multimap(initializer_list<value_type> __il, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 11
_LIBCPP_INLINE_VISIBILITY
unordered_multimap(size_type __n, const allocator_type& __a)
@@ -1733,7 +1608,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
unordered_multimap& operator=(const unordered_multimap& __u)
{
-#if __cplusplus >= 201103L
+#ifndef _LIBCPP_CXX03_LANG
__table_ = __u.__table_;
#else
if (this != &__u) {
@@ -1747,13 +1622,13 @@ public:
#endif
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
unordered_multimap& operator=(unordered_multimap&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
unordered_multimap& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
@@ -1779,42 +1654,51 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const _NOEXCEPT {return __table_.end();}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
- template <class... _Args>
- iterator emplace(_Args&&... __args);
-
- template <class... _Args>
- iterator emplace_hint(const_iterator __p, _Args&&... __args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _Pp,
- class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(_Pp&& __x)
- {return __table_.__insert_multi(_VSTD::forward<_Pp>(__x));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, const value_type& __x)
{return __table_.__insert_multi(__p.__i_, __x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _Pp,
- class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, _Pp&& __x)
- {return __table_.__insert_multi(__p.__i_, _VSTD::forward<_Pp>(__x));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
template <class _InputIterator>
- void insert(_InputIterator __first, _InputIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(_InputIterator __first, _InputIterator __last);
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, value_type&& __x)
+ {return __table_.__insert_multi(__p.__i_, _VSTD::move(__x));}
+
+ template <class _Pp,
+ class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(_Pp&& __x)
+ {return __table_.__insert_multi(_VSTD::forward<_Pp>(__x));}
+
+ template <class _Pp,
+ class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, _Pp&& __x)
+ {return __table_.__insert_multi(__p.__i_, _VSTD::forward<_Pp>(__x));}
+
+ template <class... _Args>
+ iterator emplace(_Args&&... __args) {
+ return __table_.__emplace_multi(_VSTD::forward<_Args>(__args)...);
+ }
+
+ template <class... _Args>
+ iterator emplace_hint(const_iterator __p, _Args&&... __args) {
+ return __table_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_Args>(__args)...);
+ }
+#endif // _LIBCPP_CXX03_LANG
+
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
@@ -1902,17 +1786,7 @@ public:
#endif // _LIBCPP_DEBUG_LEVEL >= 2
-private:
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- __node_holder __construct_node();
- template <class _A0>
- __node_holder
- __construct_node(_A0&& __a0);
-#ifndef _LIBCPP_HAS_NO_VARIADICS
- template <class _A0, class _A1, class ..._Args>
- __node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
};
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -1930,7 +1804,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a)
- : __table_(__hf, __eql, __a)
+ : __table_(__hf, __eql, typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1968,7 +1842,7 @@ template <class _InputIterator>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
_InputIterator __first, _InputIterator __last, size_type __n,
const hasher& __hf, const key_equal& __eql, const allocator_type& __a)
- : __table_(__hf, __eql, __a)
+ : __table_(__hf, __eql, typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -1978,10 +1852,10 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const allocator_type& __a)
- : __table_(__a)
+ : __table_(typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -2003,7 +1877,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const unordered_multimap& __u, const allocator_type& __a)
- : __table_(__u.__table_, __a)
+ : __table_(__u.__table_, typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -2012,10 +1886,10 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
unordered_multimap&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
@@ -2030,7 +1904,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
unordered_multimap&& __u, const allocator_type& __a)
- : __table_(_VSTD::move(__u.__table_), __a)
+ : __table_(_VSTD::move(__u.__table_), typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -2041,7 +1915,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
while (__u.size() != 0)
{
__table_.__insert_multi(
- _VSTD::move(__u.__table_.remove((__i++).__i_)->__value_)
+ _VSTD::move(__u.__table_.remove((__i++).__i_)->__value_.__nc)
);
}
}
@@ -2051,10 +1925,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
initializer_list<value_type> __il)
@@ -2082,7 +1952,7 @@ template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
initializer_list<value_type> __il, size_type __n, const hasher& __hf,
const key_equal& __eql, const allocator_type& __a)
- : __table_(__hf, __eql, __a)
+ : __table_(__hf, __eql, typename __table::allocator_type(__a))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_c(this);
@@ -2091,12 +1961,8 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
insert(__il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multimap&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
@@ -2105,12 +1971,8 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multima
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
initializer_list<value_type> __il)
@@ -2119,83 +1981,13 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node()
-{
- __node_allocator& __na = __table_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_));
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class _A0>
-typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
-{
- __node_allocator& __na = __table_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
- _VSTD::forward<_A0>(__a0));
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class _A0, class _A1, class ..._Args>
-typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(
- _A0&& __a0, _A1&& __a1, _Args&&... __args)
-{
- __node_allocator& __na = __table_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
- _VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
- _VSTD::forward<_Args>(__args)...);
- __h.get_deleter().__first_constructed = true;
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class... _Args>
-typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_Args&&... __args)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- iterator __r = __table_.__node_insert_multi(__h.get());
- __h.release();
- return __r;
-}
+#endif // _LIBCPP_CXX03_LANG
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class... _Args>
-typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace_hint(
- const_iterator __p, _Args&&... __args)
-{
- __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
- iterator __r = __table_.__node_insert_multi(__p.__i_, __h.get());
- __h.release();
- return __r;
-}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/unordered_set b/chromium/buildtools/third_party/libc++/trunk/include/unordered_set
index f6ccdc3734f..a14fb000492 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/unordered_set
+++ b/chromium/buildtools/third_party/libc++/trunk/include/unordered_set
@@ -333,7 +333,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_TYPE_VIS_ONLY unordered_set
+class _LIBCPP_TEMPLATE_VIS unordered_set
{
public:
// types
@@ -404,15 +404,15 @@ public:
size_type __n, const hasher& __hf, const allocator_type& __a)
: unordered_set(__first, __last, __n, __hf, key_equal(), __a) {}
#endif
+ _LIBCPP_INLINE_VISIBILITY
explicit unordered_set(const allocator_type& __a);
unordered_set(const unordered_set& __u);
unordered_set(const unordered_set& __u, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
unordered_set(unordered_set&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
unordered_set(unordered_set&& __u, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
unordered_set(initializer_list<value_type> __il);
unordered_set(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(),
@@ -430,7 +430,7 @@ public:
const hasher& __hf, const allocator_type& __a)
: unordered_set(__il, __n, __hf, key_equal(), __a) {}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// ~unordered_set() = default;
_LIBCPP_INLINE_VISIBILITY
unordered_set& operator=(const unordered_set& __u)
@@ -438,13 +438,13 @@ public:
__table_ = __u.__table_;
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
unordered_set& operator=(unordered_set&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+ _LIBCPP_INLINE_VISIBILITY
unordered_set& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
@@ -470,7 +470,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const _NOEXCEPT {return __table_.end();}
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> emplace(_Args&&... __args)
@@ -489,50 +489,47 @@ public:
iterator emplace_hint(const_iterator, _Args&&... __args)
{return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;}
#endif
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> insert(const value_type& __x)
- {return __table_.__insert_unique(__x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(value_type&& __x)
{return __table_.__insert_unique(_VSTD::move(__x));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
#if _LIBCPP_DEBUG_LEVEL >= 2
- iterator insert(const_iterator __p, const value_type& __x)
+ iterator insert(const_iterator __p, value_type&& __x)
{
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "unordered_set::insert(const_iterator, const value_type&) called with an iterator not"
+ "unordered_set::insert(const_iterator, value_type&&) called with an iterator not"
" referring to this unordered_set");
- return insert(__x).first;
+ return insert(_VSTD::move(__x)).first;
}
#else
- iterator insert(const_iterator, const value_type& __x)
- {return insert(__x).first;}
+ iterator insert(const_iterator, value_type&& __x)
+ {return insert(_VSTD::move(__x)).first;}
#endif
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(initializer_list<value_type> __il)
+ {insert(__il.begin(), __il.end());}
+#endif // _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ pair<iterator, bool> insert(const value_type& __x)
+ {return __table_.__insert_unique(__x);}
+
_LIBCPP_INLINE_VISIBILITY
#if _LIBCPP_DEBUG_LEVEL >= 2
- iterator insert(const_iterator __p, value_type&& __x)
+ iterator insert(const_iterator __p, const value_type& __x)
{
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
- "unordered_set::insert(const_iterator, value_type&&) called with an iterator not"
+ "unordered_set::insert(const_iterator, const value_type&) called with an iterator not"
" referring to this unordered_set");
- return insert(_VSTD::move(__x)).first;
+ return insert(__x).first;
}
#else
- iterator insert(const_iterator, value_type&& __x)
- {return insert(_VSTD::move(__x)).first;}
+ iterator insert(const_iterator, const value_type& __x)
+ {return insert(__x).first;}
#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
void insert(_InputIterator __first, _InputIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
- void insert(initializer_list<value_type> __il)
- {insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p);}
@@ -678,7 +675,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const allocator_type& __a)
: __table_(__a)
@@ -712,10 +709,10 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
unordered_set&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
@@ -747,10 +744,6 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
initializer_list<value_type> __il)
@@ -787,12 +780,8 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
insert(__il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_set<_Value, _Hash, _Pred, _Alloc>&
unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value)
@@ -801,12 +790,8 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_set<_Value, _Hash, _Pred, _Alloc>&
unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(
initializer_list<value_type> __il)
@@ -815,11 +800,11 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
@@ -868,7 +853,7 @@ operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_TYPE_VIS_ONLY unordered_multiset
+class _LIBCPP_TEMPLATE_VIS unordered_multiset
{
public:
// types
@@ -940,15 +925,15 @@ public:
size_type __n, const hasher& __hf, const allocator_type& __a)
: unordered_multiset(__first, __last, __n, __hf, key_equal(), __a) {}
#endif
+ _LIBCPP_INLINE_VISIBILITY
explicit unordered_multiset(const allocator_type& __a);
unordered_multiset(const unordered_multiset& __u);
unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
unordered_multiset(unordered_multiset&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
unordered_multiset(initializer_list<value_type> __il);
unordered_multiset(initializer_list<value_type> __il, size_type __n,
const hasher& __hf = hasher(),
@@ -964,7 +949,7 @@ public:
unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
: unordered_multiset(__il, __n, __hf, key_equal(), __a) {}
#endif
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
// ~unordered_multiset() = default;
_LIBCPP_INLINE_VISIBILITY
unordered_multiset& operator=(const unordered_multiset& __u)
@@ -972,13 +957,12 @@ public:
__table_ = __u.__table_;
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
unordered_multiset& operator=(unordered_multiset&& __u)
_NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
-#endif
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
unordered_multiset& operator=(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
@@ -1004,7 +988,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const _NOEXCEPT {return __table_.end();}
-#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator emplace(_Args&&... __args)
@@ -1013,28 +997,27 @@ public:
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _Args&&... __args)
{return __table_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
-#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
_LIBCPP_INLINE_VISIBILITY
iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
-#endif
- _LIBCPP_INLINE_VISIBILITY
- iterator insert(const_iterator __p, const value_type& __x)
- {return __table_.__insert_multi(__p, __x);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, value_type&& __x)
{return __table_.__insert_multi(__p, _VSTD::move(__x));}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- template <class _InputIterator>
- void insert(_InputIterator __first, _InputIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
+
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator __p, const value_type& __x)
+ {return __table_.__insert_multi(__p, __x);}
+
+ template <class _InputIterator>
+ _LIBCPP_INLINE_VISIBILITY
+ void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p);}
@@ -1181,7 +1164,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const allocator_type& __a)
: __table_(__a)
@@ -1215,10 +1198,10 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
insert(__u.begin(), __u.end());
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
unordered_multiset&& __u)
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
@@ -1250,10 +1233,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
initializer_list<value_type> __il)
@@ -1290,12 +1269,8 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
insert(__il.begin(), __il.end());
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
unordered_multiset&& __u)
@@ -1305,10 +1280,6 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
@@ -1319,11 +1290,11 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline
void
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/utility b/chromium/buildtools/third_party/libc++/trunk/include/utility
index c9f5785b3d4..be73207133b 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/utility
+++ b/chromium/buildtools/third_party/libc++/trunk/include/utility
@@ -82,8 +82,8 @@ struct pair
is_nothrow_move_assignable<T2>::value);
template <class U, class V> pair& operator=(pair<U, V>&& p);
- void swap(pair& p) noexcept(noexcept(swap(first, p.first)) &&
- noexcept(swap(second, p.second)));
+ void swap(pair& p) noexcept(is_nothrow_swappable_v<T1> &&
+ is_nothrow_swappable_v<T2>);
};
template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&); // constexpr in C++14
@@ -169,8 +169,27 @@ template<size_t N>
template<class... T>
using index_sequence_for = make_index_sequence<sizeof...(T)>;
-template<class T, class U=T>
+template<class T, class U=T>
T exchange(T& obj, U&& new_value);
+
+// 20.2.7, in-place construction // C++17
+struct in_place_t {
+ explicit in_place_t() = default;
+};
+inline constexpr in_place_t in_place{};
+template <class T>
+ struct in_place_type_t {
+ explicit in_place_type_t() = default;
+ };
+template <class T>
+ inline constexpr in_place_type_t<T> in_place_type{};
+template <size_t I>
+ struct in_place_index_t {
+ explicit in_place_index_t() = default;
+ };
+template <size_t I>
+ inline constexpr in_place_index_t<I> in_place_index{};
+
} // std
*/
@@ -178,6 +197,11 @@ template<class T, class U=T>
#include <__config>
#include <__tuple>
#include <type_traits>
+#include <initializer_list>
+#include <cstddef>
+#include <cstring>
+#include <cstdint>
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -224,10 +248,6 @@ operator>=(const _Tp& __x, const _Tp& __y)
// swap_ranges
-// forward
-template<class _Tp, size_t _Np>
-inline _LIBCPP_INLINE_VISIBILITY
-void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
template <class _ForwardIterator1, class _ForwardIterator2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -239,9 +259,12 @@ swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardItera
return __first2;
}
+// forward declared in <type_traits>
template<class _Tp, size_t _Np>
inline _LIBCPP_INLINE_VISIBILITY
-void
+typename enable_if<
+ __is_swappable<_Tp>::value
+>::type
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
{
_VSTD::swap_ranges(__a, __a + _Np, __b);
@@ -249,14 +272,14 @@ swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::v
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
typename conditional
<
!is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value,
const _Tp&,
_Tp&&
>::type
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
const _Tp&
#endif
move_if_noexcept(_Tp& __x) _NOEXCEPT
@@ -269,15 +292,27 @@ template <class _Tp> constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { r
template <class _Tp> void as_const(const _Tp&&) = delete;
#endif
-struct _LIBCPP_TYPE_VIS_ONLY piecewise_construct_t { };
-#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY)
+struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { };
+#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_UTILITY)
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
#else
constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
+#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+struct __non_trivially_copyable_base {
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ __non_trivially_copyable_base() _NOEXCEPT {}
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {}
+};
+#endif
+
template <class _T1, class _T2>
-struct _LIBCPP_TYPE_VIS_ONLY pair
+struct _LIBCPP_TEMPLATE_VIS pair
+#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+: private __non_trivially_copyable_base
+#endif
{
typedef _T1 first_type;
typedef _T2 second_type;
@@ -285,137 +320,211 @@ struct _LIBCPP_TYPE_VIS_ONLY pair
_T1 first;
_T2 second;
- // pair(const pair&) = default;
- // pair(pair&&) = default;
-
-#ifndef _LIBCPP_HAS_NO_DEFAULT_FUNCTION_TEMPLATE_ARGS
- template <bool _Dummy = true, class = typename enable_if<
- __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
- __dependent_type<is_default_constructible<_T2>, _Dummy>::value
- >::type>
+#if !defined(_LIBCPP_CXX03_LANG)
+ pair(pair const&) = default;
+ pair(pair&&) = default;
+#else
+ // Use the implicitly declared copy constructor in C++03
#endif
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() : first(), second() {}
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(const _T1& __x, const _T2& __y)
- : first(__x), second(__y) {}
-
- template<class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(const pair<_U1, _U2>& __p
-#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
- ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
- is_convertible<const _U2&, _T2>::value>::type* = 0
-#endif
- )
- : first(__p.first), second(__p.second) {}
+#ifdef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ pair() : first(), second() {}
-#if !defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
_LIBCPP_INLINE_VISIBILITY
- pair(const pair& __p) = default;
-#elif !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) || !_LIBCPP_TRIVIAL_PAIR_COPY_CTOR
+ pair(_T1 const& __t1, _T2 const& __t2) : first(__t1), second(__t2) {}
+
+ template <class _U1, class _U2>
_LIBCPP_INLINE_VISIBILITY
- pair(const pair& __p)
- _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
- is_nothrow_copy_constructible<second_type>::value)
- : first(__p.first),
- second(__p.second)
- {
- }
-#endif
+ pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
_LIBCPP_INLINE_VISIBILITY
- pair& operator=(const pair& __p)
- _NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value &&
- is_nothrow_copy_assignable<second_type>::value)
- {
+ pair& operator=(pair const& __p) {
first = __p.first;
second = __p.second;
return *this;
}
+#else
+ template <bool _Val>
+ using _EnableB = typename enable_if<_Val, bool>::type;
+
+ struct _CheckArgs {
+ template <class _U1, class _U2>
+ static constexpr bool __enable_default() {
+ return is_default_constructible<_U1>::value
+ && is_default_constructible<_U2>::value;
+ }
+
+ template <class _U1, class _U2>
+ static constexpr bool __enable_explicit() {
+ return is_constructible<first_type, _U1>::value
+ && is_constructible<second_type, _U2>::value
+ && (!is_convertible<_U1, first_type>::value
+ || !is_convertible<_U2, second_type>::value);
+ }
+
+ template <class _U1, class _U2>
+ static constexpr bool __enable_implicit() {
+ return is_constructible<first_type, _U1>::value
+ && is_constructible<second_type, _U2>::value
+ && is_convertible<_U1, first_type>::value
+ && is_convertible<_U2, second_type>::value;
+ }
+ };
+
+ template <bool _MaybeEnable>
+ using _CheckArgsDep = typename conditional<
+ _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
+
+ struct _CheckTupleLikeConstructor {
+ template <class _Tuple>
+ static constexpr bool __enable_implicit() {
+ return __tuple_convertible<_Tuple, pair>::value;
+ }
+
+ template <class _Tuple>
+ static constexpr bool __enable_explicit() {
+ return __tuple_constructible<_Tuple, pair>::value
+ && !__tuple_convertible<_Tuple, pair>::value;
+ }
+
+ template <class _Tuple>
+ static constexpr bool __enable_assign() {
+ return __tuple_assignable<_Tuple, pair>::value;
+ }
+ };
+
+ template <class _Tuple>
+ using _CheckTLC = typename conditional<
+ __tuple_like_with_size<_Tuple, 2>::value
+ && !is_same<typename decay<_Tuple>::type, pair>::value,
+ _CheckTupleLikeConstructor,
+ __check_tuple_constructor_fail
+ >::type;
+
+ template<bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::template __enable_default<_T1, _T2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
+ pair() : first(), second() {}
+
+ template <bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_T1 const& __t1, _T2 const& __t2)
+ : first(__t1), second(__t2) {}
+
+ template<bool _Dummy = true, _EnableB<
+ _CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_T1 const& __t1, _T2 const& __t2)
+ : first(__t1), second(__t2) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_U1&& __u1, _U2&& __u2)
+ : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_U1&& __u1, _U2&& __u2)
+ : first(_VSTD::forward<_U1>(__u1)), second(_VSTD::forward<_U2>(__u2)) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(pair<_U1, _U2> const& __p)
+ : first(__p.first), second(__p.second) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(pair<_U1, _U2> const& __p)
+ : first(__p.first), second(__p.second) {}
+
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_explicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(pair<_U1, _U2>&&__p)
+ : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ template<class _U1, class _U2, _EnableB<
+ _CheckArgs::template __enable_implicit<_U1, _U2>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(pair<_U1, _U2>&& __p)
+ : first(_VSTD::forward<_U1>(__p.first)), second(_VSTD::forward<_U2>(__p.second)) {}
- template <class _U1, class _U2,
- class = typename enable_if<is_convertible<_U1, first_type>::value &&
- is_convertible<_U2, second_type>::value>::type>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(_U1&& __u1, _U2&& __u2)
- : first(_VSTD::forward<_U1>(__u1)),
- second(_VSTD::forward<_U2>(__u2))
- {}
+ template<class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_explicit<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ explicit pair(_Tuple&& __p)
+ : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
+ second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
- template<class _U1, class _U2>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(pair<_U1, _U2>&& __p,
- typename enable_if<is_convertible<_U1, _T1>::value &&
- is_convertible<_U2, _T2>::value>::type* = 0)
- : first(_VSTD::forward<_U1>(__p.first)),
- second(_VSTD::forward<_U2>(__p.second)) {}
+ template<class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_implicit<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
+ pair(_Tuple&& __p)
+ : first(_VSTD::get<0>(_VSTD::forward<_Tuple>(__p))),
+ second(_VSTD::get<1>(_VSTD::forward<_Tuple>(__p))) {}
-#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+ template <class... _Args1, class... _Args2>
_LIBCPP_INLINE_VISIBILITY
- pair(pair&& __p) = default;
-#else
+ pair(piecewise_construct_t __pc,
+ tuple<_Args1...> __first_args, tuple<_Args2...> __second_args)
+ : pair(__pc, __first_args, __second_args,
+ typename __make_tuple_indices<sizeof...(_Args1)>::type(),
+ typename __make_tuple_indices<sizeof...(_Args2) >::type()) {}
+
_LIBCPP_INLINE_VISIBILITY
- pair(pair&& __p) _NOEXCEPT_(is_nothrow_move_constructible<first_type>::value &&
- is_nothrow_move_constructible<second_type>::value)
- : first(_VSTD::forward<first_type>(__p.first)),
- second(_VSTD::forward<second_type>(__p.second))
+ pair& operator=(typename conditional<
+ is_copy_assignable<first_type>::value &&
+ is_copy_assignable<second_type>::value,
+ pair, __nat>::type const& __p)
+ _NOEXCEPT_(is_nothrow_copy_assignable<first_type>::value &&
+ is_nothrow_copy_assignable<second_type>::value)
{
+ first = __p.first;
+ second = __p.second;
+ return *this;
}
-#endif
_LIBCPP_INLINE_VISIBILITY
- pair&
- operator=(pair&& __p) _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
- is_nothrow_move_assignable<second_type>::value)
+ pair& operator=(typename conditional<
+ is_move_assignable<first_type>::value &&
+ is_move_assignable<second_type>::value,
+ pair, __nat>::type&& __p)
+ _NOEXCEPT_(is_nothrow_move_assignable<first_type>::value &&
+ is_nothrow_move_assignable<second_type>::value)
{
first = _VSTD::forward<first_type>(__p.first);
second = _VSTD::forward<second_type>(__p.second);
return *this;
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
- template<class _Tuple,
- class = typename enable_if<__tuple_convertible<_Tuple, pair>::value>::type>
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
- pair(_Tuple&& __p)
- : first(_VSTD::forward<typename tuple_element<0,
- typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<0>(__p))),
- second(_VSTD::forward<typename tuple_element<1,
- typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<1>(__p)))
- {}
-
-
-
- template <class... _Args1, class... _Args2>
- _LIBCPP_INLINE_VISIBILITY
- pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
- tuple<_Args2...> __second_args)
- : pair(__pc, __first_args, __second_args,
- typename __make_tuple_indices<sizeof...(_Args1)>::type(),
- typename __make_tuple_indices<sizeof...(_Args2) >::type())
- {}
-
- template <class _Tuple,
- class = typename enable_if<__tuple_assignable<_Tuple, pair>::value>::type>
- _LIBCPP_INLINE_VISIBILITY
- pair&
- operator=(_Tuple&& __p)
- {
- typedef typename __make_tuple_types<_Tuple>::type _TupleRef;
- typedef typename tuple_element<0, _TupleRef>::type _U0;
- typedef typename tuple_element<1, _TupleRef>::type _U1;
- first = _VSTD::forward<_U0>(_VSTD::get<0>(__p));
- second = _VSTD::forward<_U1>(_VSTD::get<1>(__p));
- return *this;
- }
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
+ template <class _Tuple, _EnableB<
+ _CheckTLC<_Tuple>::template __enable_assign<_Tuple>()
+ > = false>
+ _LIBCPP_INLINE_VISIBILITY
+ pair& operator=(_Tuple&& __p) {
+ first = _VSTD::get<0>(_VSTD::forward<_Tuple>(__p));
+ second = _VSTD::get<1>(_VSTD::forward<_Tuple>(__p));
+ return *this;
+ }
+#endif
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
void
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
@@ -427,13 +536,13 @@ struct _LIBCPP_TYPE_VIS_ONLY pair
}
private:
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+#ifndef _LIBCPP_CXX03_LANG
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
pair(piecewise_construct_t,
tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
__tuple_indices<_I1...>, __tuple_indices<_I2...>);
-#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif
};
template <class _T1, class _T2>
@@ -499,9 +608,7 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
__x.swap(__y);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY reference_wrapper;
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
struct __make_pair_return_impl
@@ -530,7 +637,7 @@ make_pair(_T1&& __t1, _T2&& __t2)
(_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
}
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#else // _LIBCPP_CXX03_LANG
template <class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY
@@ -540,21 +647,21 @@ make_pair(_T1 __x, _T2 __y)
return pair<_T1, _T2>(__x, __y);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _T1, class _T2>
- class _LIBCPP_TYPE_VIS_ONLY tuple_size<pair<_T1, _T2> >
+ class _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> >
: public integral_constant<size_t, 2> {};
template <class _T1, class _T2>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<0, pair<_T1, _T2> >
+class _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> >
{
public:
typedef _T1 type;
};
template <class _T1, class _T2>
-class _LIBCPP_TYPE_VIS_ONLY tuple_element<1, pair<_T1, _T2> >
+class _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> >
{
public:
typedef _T2 type;
@@ -577,8 +684,7 @@ struct __get_pair<0>
const _T1&
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
template <class _T1, class _T2>
static
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -590,8 +696,7 @@ struct __get_pair<0>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _T1&&
get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
};
template <>
@@ -609,8 +714,7 @@ struct __get_pair<1>
const _T2&
get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
template <class _T1, class _T2>
static
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -622,8 +726,7 @@ struct __get_pair<1>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _T2&&
get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
};
template <size_t _Ip, class _T1, class _T2>
@@ -642,8 +745,7 @@ get(const pair<_T1, _T2>& __p) _NOEXCEPT
return __get_pair<_Ip>::get(__p);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
+#ifndef _LIBCPP_CXX03_LANG
template <size_t _Ip, class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
@@ -659,8 +761,7 @@ get(const pair<_T1, _T2>&& __p) _NOEXCEPT
{
return __get_pair<_Ip>::get(_VSTD::move(__p));
}
-
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
#if _LIBCPP_STD_VER > 11
template <class _T1, class _T2>
@@ -724,7 +825,7 @@ constexpr _T1 const && get(pair<_T2, _T1> const&& __p) _NOEXCEPT
#if _LIBCPP_STD_VER > 11
template<class _Tp, _Tp... _Ip>
-struct _LIBCPP_TYPE_VIS_ONLY integer_sequence
+struct _LIBCPP_TEMPLATE_VIS integer_sequence
{
typedef _Tp value_type;
static_assert( is_integral<_Tp>::value,
@@ -742,63 +843,15 @@ template<size_t... _Ip>
#if __has_builtin(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
template <class _Tp, _Tp _Ep>
-struct __make_integer_sequence
-{
- typedef __make_integer_seq<integer_sequence, _Tp, _Ep> type;
-};
+using __make_integer_sequence = __make_integer_seq<integer_sequence, _Tp, _Ep>;
#else
-namespace __detail {
-
-template<typename _Tp, size_t ..._Extra> struct __repeat;
-template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<integer_sequence<_Tp, _Np...>, _Extra...> {
- typedef integer_sequence<_Tp,
- _Np...,
- sizeof...(_Np) + _Np...,
- 2 * sizeof...(_Np) + _Np...,
- 3 * sizeof...(_Np) + _Np...,
- 4 * sizeof...(_Np) + _Np...,
- 5 * sizeof...(_Np) + _Np...,
- 6 * sizeof...(_Np) + _Np...,
- 7 * sizeof...(_Np) + _Np...,
- _Extra...> type;
-};
-
-template<size_t _Np> struct __parity;
-template<size_t _Np> struct __make : __parity<_Np % 8>::template __pmake<_Np> {};
-
-template<> struct __make<0> { typedef integer_sequence<size_t> type; };
-template<> struct __make<1> { typedef integer_sequence<size_t, 0> type; };
-template<> struct __make<2> { typedef integer_sequence<size_t, 0, 1> type; };
-template<> struct __make<3> { typedef integer_sequence<size_t, 0, 1, 2> type; };
-template<> struct __make<4> { typedef integer_sequence<size_t, 0, 1, 2, 3> type; };
-template<> struct __make<5> { typedef integer_sequence<size_t, 0, 1, 2, 3, 4> type; };
-template<> struct __make<6> { typedef integer_sequence<size_t, 0, 1, 2, 3, 4, 5> type; };
-template<> struct __make<7> { typedef integer_sequence<size_t, 0, 1, 2, 3, 4, 5, 6> type; };
-
-template<> struct __parity<0> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type> {}; };
-template<> struct __parity<1> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 1> {}; };
-template<> struct __parity<2> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 2, _Np - 1> {}; };
-template<> struct __parity<3> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 3, _Np - 2, _Np - 1> {}; };
-template<> struct __parity<4> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
-template<> struct __parity<5> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
-template<> struct __parity<6> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
-template<> struct __parity<7> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 7, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
-
-template<typename _Tp, typename _Up> struct __convert {
- template<typename> struct __result;
- template<_Tp ..._Np> struct __result<integer_sequence<_Tp, _Np...> > { typedef integer_sequence<_Up, _Np...> type; };
-};
-template<typename _Tp> struct __convert<_Tp, _Tp> { template<typename _Up> struct __result { typedef _Up type; }; };
-
-}
-
template<typename _Tp, _Tp _Np> using __make_integer_sequence_unchecked =
- typename __detail::__convert<size_t, _Tp>::template __result<typename __detail::__make<_Np>::type>::type;
+ typename __detail::__make<_Np>::type::template __convert<integer_sequence, _Tp>;
template <class _Tp, _Tp _Ep>
-struct __make_integer_sequence
+struct __make_integer_sequence_checked
{
static_assert(is_integral<_Tp>::value,
"std::make_integer_sequence can only be instantiated with an integral type" );
@@ -808,17 +861,20 @@ struct __make_integer_sequence
typedef __make_integer_sequence_unchecked<_Tp, 0 <= _Ep ? _Ep : 0> type;
};
+template <class _Tp, _Tp _Ep>
+using __make_integer_sequence = typename __make_integer_sequence_checked<_Tp, _Ep>::type;
+
#endif
template<class _Tp, _Tp _Np>
- using make_integer_sequence = typename __make_integer_sequence<_Tp, _Np>::type;
+ using make_integer_sequence = __make_integer_sequence<_Tp, _Np>;
template<size_t _Np>
using make_index_sequence = make_integer_sequence<size_t, _Np>;
template<class... _Tp>
using index_sequence_for = make_index_sequence<sizeof...(_Tp)>;
-
+
#endif // _LIBCPP_STD_VER > 11
#if _LIBCPP_STD_VER > 11
@@ -829,9 +885,702 @@ _T1 exchange(_T1& __obj, _T2 && __new_value)
_T1 __old_value = _VSTD::move(__obj);
__obj = _VSTD::forward<_T2>(__new_value);
return __old_value;
-}
+}
#endif // _LIBCPP_STD_VER > 11
+#if _LIBCPP_STD_VER > 14
+
+struct _LIBCPP_TYPE_VIS in_place_t {
+ explicit in_place_t() = default;
+};
+#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
+inline
+#endif
+constexpr in_place_t in_place{};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS in_place_type_t {
+ explicit in_place_type_t() = default;
+};
+template <class _Tp>
+#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
+inline
+#endif
+constexpr in_place_type_t<_Tp> in_place_type{};
+
+template <size_t _Idx>
+struct _LIBCPP_TYPE_VIS in_place_index_t {
+ explicit in_place_index_t() = default;
+};
+template <size_t _Idx>
+#ifndef _LIBCPP_HAS_NO_INLINE_VARIABLES
+inline
+#endif
+constexpr in_place_index_t<_Idx> in_place_index{};
+
+template <class _Tp> struct __is_inplace_type_imp : false_type {};
+template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
+
+template <class _Tp>
+using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>;
+
+#endif // _LIBCPP_STD_VER > 14
+
+template <class _Arg, class _Result>
+struct _LIBCPP_TEMPLATE_VIS unary_function
+{
+ typedef _Arg argument_type;
+ typedef _Result result_type;
+};
+
+template <class _Size>
+inline _LIBCPP_INLINE_VISIBILITY
+_Size
+__loadword(const void* __p)
+{
+ _Size __r;
+ std::memcpy(&__r, __p, sizeof(__r));
+ return __r;
+}
+
+// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
+// is 64 bits. This is because cityhash64 uses 64bit x 64bit
+// multiplication, which can be very slow on 32-bit systems.
+template <class _Size, size_t = sizeof(_Size)*__CHAR_BIT__>
+struct __murmur2_or_cityhash;
+
+template <class _Size>
+struct __murmur2_or_cityhash<_Size, 32>
+{
+ inline _Size operator()(const void* __key, _Size __len)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+};
+
+// murmur2
+template <class _Size>
+_Size
+__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
+{
+ const _Size __m = 0x5bd1e995;
+ const _Size __r = 24;
+ _Size __h = __len;
+ const unsigned char* __data = static_cast<const unsigned char*>(__key);
+ for (; __len >= 4; __data += 4, __len -= 4)
+ {
+ _Size __k = __loadword<_Size>(__data);
+ __k *= __m;
+ __k ^= __k >> __r;
+ __k *= __m;
+ __h *= __m;
+ __h ^= __k;
+ }
+ switch (__len)
+ {
+ case 3:
+ __h ^= __data[2] << 16;
+ case 2:
+ __h ^= __data[1] << 8;
+ case 1:
+ __h ^= __data[0];
+ __h *= __m;
+ }
+ __h ^= __h >> 13;
+ __h *= __m;
+ __h ^= __h >> 15;
+ return __h;
+}
+
+template <class _Size>
+struct __murmur2_or_cityhash<_Size, 64>
+{
+ inline _Size operator()(const void* __key, _Size __len) _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK;
+
+ private:
+ // Some primes between 2^63 and 2^64.
+ static const _Size __k0 = 0xc3a5c85c97cb3127ULL;
+ static const _Size __k1 = 0xb492b66fbe98f273ULL;
+ static const _Size __k2 = 0x9ae16a3b2f90404fULL;
+ static const _Size __k3 = 0xc949d7c7509e6557ULL;
+
+ static _Size __rotate(_Size __val, int __shift) {
+ return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift)));
+ }
+
+ static _Size __rotate_by_at_least_1(_Size __val, int __shift) {
+ return (__val >> __shift) | (__val << (64 - __shift));
+ }
+
+ static _Size __shift_mix(_Size __val) {
+ return __val ^ (__val >> 47);
+ }
+
+ static _Size __hash_len_16(_Size __u, _Size __v)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ const _Size __mul = 0x9ddfea08eb382d69ULL;
+ _Size __a = (__u ^ __v) * __mul;
+ __a ^= (__a >> 47);
+ _Size __b = (__v ^ __a) * __mul;
+ __b ^= (__b >> 47);
+ __b *= __mul;
+ return __b;
+ }
+
+ static _Size __hash_len_0_to_16(const char* __s, _Size __len)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ if (__len > 8) {
+ const _Size __a = __loadword<_Size>(__s);
+ const _Size __b = __loadword<_Size>(__s + __len - 8);
+ return __hash_len_16(__a, __rotate_by_at_least_1(__b + __len, __len)) ^ __b;
+ }
+ if (__len >= 4) {
+ const uint32_t __a = __loadword<uint32_t>(__s);
+ const uint32_t __b = __loadword<uint32_t>(__s + __len - 4);
+ return __hash_len_16(__len + (__a << 3), __b);
+ }
+ if (__len > 0) {
+ const unsigned char __a = __s[0];
+ const unsigned char __b = __s[__len >> 1];
+ const unsigned char __c = __s[__len - 1];
+ const uint32_t __y = static_cast<uint32_t>(__a) +
+ (static_cast<uint32_t>(__b) << 8);
+ const uint32_t __z = __len + (static_cast<uint32_t>(__c) << 2);
+ return __shift_mix(__y * __k2 ^ __z * __k3) * __k2;
+ }
+ return __k2;
+ }
+
+ static _Size __hash_len_17_to_32(const char *__s, _Size __len)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ const _Size __a = __loadword<_Size>(__s) * __k1;
+ const _Size __b = __loadword<_Size>(__s + 8);
+ const _Size __c = __loadword<_Size>(__s + __len - 8) * __k2;
+ const _Size __d = __loadword<_Size>(__s + __len - 16) * __k0;
+ return __hash_len_16(__rotate(__a - __b, 43) + __rotate(__c, 30) + __d,
+ __a + __rotate(__b ^ __k3, 20) - __c + __len);
+ }
+
+ // Return a 16-byte hash for 48 bytes. Quick and dirty.
+ // Callers do best to use "random-looking" values for a and b.
+ static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
+ _Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ __a += __w;
+ __b = __rotate(__b + __a + __z, 21);
+ const _Size __c = __a;
+ __a += __x;
+ __a += __y;
+ __b += __rotate(__a, 44);
+ return pair<_Size, _Size>(__a + __z, __b + __c);
+ }
+
+ // Return a 16-byte hash for s[0] ... s[31], a, and b. Quick and dirty.
+ static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
+ const char* __s, _Size __a, _Size __b)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ return __weak_hash_len_32_with_seeds(__loadword<_Size>(__s),
+ __loadword<_Size>(__s + 8),
+ __loadword<_Size>(__s + 16),
+ __loadword<_Size>(__s + 24),
+ __a,
+ __b);
+ }
+
+ // Return an 8-byte hash for 33 to 64 bytes.
+ static _Size __hash_len_33_to_64(const char *__s, size_t __len)
+ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
+ {
+ _Size __z = __loadword<_Size>(__s + 24);
+ _Size __a = __loadword<_Size>(__s) +
+ (__len + __loadword<_Size>(__s + __len - 16)) * __k0;
+ _Size __b = __rotate(__a + __z, 52);
+ _Size __c = __rotate(__a, 37);
+ __a += __loadword<_Size>(__s + 8);
+ __c += __rotate(__a, 7);
+ __a += __loadword<_Size>(__s + 16);
+ _Size __vf = __a + __z;
+ _Size __vs = __b + __rotate(__a, 31) + __c;
+ __a = __loadword<_Size>(__s + 16) + __loadword<_Size>(__s + __len - 32);
+ __z += __loadword<_Size>(__s + __len - 8);
+ __b = __rotate(__a + __z, 52);
+ __c = __rotate(__a, 37);
+ __a += __loadword<_Size>(__s + __len - 24);
+ __c += __rotate(__a, 7);
+ __a += __loadword<_Size>(__s + __len - 16);
+ _Size __wf = __a + __z;
+ _Size __ws = __b + __rotate(__a, 31) + __c;
+ _Size __r = __shift_mix((__vf + __ws) * __k2 + (__wf + __vs) * __k0);
+ return __shift_mix(__r * __k0 + __vs) * __k2;
+ }
+};
+
+// cityhash64
+template <class _Size>
+_Size
+__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
+{
+ const char* __s = static_cast<const char*>(__key);
+ if (__len <= 32) {
+ if (__len <= 16) {
+ return __hash_len_0_to_16(__s, __len);
+ } else {
+ return __hash_len_17_to_32(__s, __len);
+ }
+ } else if (__len <= 64) {
+ return __hash_len_33_to_64(__s, __len);
+ }
+
+ // For strings over 64 bytes we hash the end first, and then as we
+ // loop we keep 56 bytes of state: v, w, x, y, and z.
+ _Size __x = __loadword<_Size>(__s + __len - 40);
+ _Size __y = __loadword<_Size>(__s + __len - 16) +
+ __loadword<_Size>(__s + __len - 56);
+ _Size __z = __hash_len_16(__loadword<_Size>(__s + __len - 48) + __len,
+ __loadword<_Size>(__s + __len - 24));
+ pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
+ pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
+ __x = __x * __k1 + __loadword<_Size>(__s);
+
+ // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
+ __len = (__len - 1) & ~static_cast<_Size>(63);
+ do {
+ __x = __rotate(__x + __y + __v.first + __loadword<_Size>(__s + 8), 37) * __k1;
+ __y = __rotate(__y + __v.second + __loadword<_Size>(__s + 48), 42) * __k1;
+ __x ^= __w.second;
+ __y += __v.first + __loadword<_Size>(__s + 40);
+ __z = __rotate(__z + __w.first, 33) * __k1;
+ __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
+ __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
+ __y + __loadword<_Size>(__s + 16));
+ std::swap(__z, __x);
+ __s += 64;
+ __len -= 64;
+ } while (__len != 0);
+ return __hash_len_16(
+ __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
+ __hash_len_16(__v.second, __w.second) + __x);
+}
+
+template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)>
+struct __scalar_hash;
+
+template <class _Tp>
+struct __scalar_hash<_Tp, 0>
+ : public unary_function<_Tp, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ size_t __a;
+ } __u;
+ __u.__a = 0;
+ __u.__t = __v;
+ return __u.__a;
+ }
+};
+
+template <class _Tp>
+struct __scalar_hash<_Tp, 1>
+ : public unary_function<_Tp, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ size_t __a;
+ } __u;
+ __u.__t = __v;
+ return __u.__a;
+ }
+};
+
+template <class _Tp>
+struct __scalar_hash<_Tp, 2>
+ : public unary_function<_Tp, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ } __s;
+ } __u;
+ __u.__t = __v;
+ return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
+ }
+};
+
+template <class _Tp>
+struct __scalar_hash<_Tp, 3>
+ : public unary_function<_Tp, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ size_t __c;
+ } __s;
+ } __u;
+ __u.__t = __v;
+ return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
+ }
+};
+
+template <class _Tp>
+struct __scalar_hash<_Tp, 4>
+ : public unary_function<_Tp, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ size_t __c;
+ size_t __d;
+ } __s;
+ } __u;
+ __u.__t = __v;
+ return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
+ }
+};
+
+struct _PairT {
+ size_t first;
+ size_t second;
+};
+
+_LIBCPP_INLINE_VISIBILITY
+inline size_t __hash_combine(size_t __lhs, size_t __rhs) _NOEXCEPT {
+ typedef __scalar_hash<_PairT> _HashT;
+ const _PairT __p = {__lhs, __rhs};
+ return _HashT()(__p);
+}
+
+template<class _Tp>
+struct _LIBCPP_TEMPLATE_VIS hash<_Tp*>
+ : public unary_function<_Tp*, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp* __v) const _NOEXCEPT
+ {
+ union
+ {
+ _Tp* __t;
+ size_t __a;
+ } __u;
+ __u.__t = __v;
+ return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
+ }
+};
+
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<bool>
+ : public unary_function<bool, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<char>
+ : public unary_function<char, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<signed char>
+ : public unary_function<signed char, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(signed char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned char>
+ : public unary_function<unsigned char, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<char16_t>
+ : public unary_function<char16_t, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<char32_t>
+ : public unary_function<char32_t, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+#endif // _LIBCPP_HAS_NO_UNICODE_CHARS
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<wchar_t>
+ : public unary_function<wchar_t, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(wchar_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<short>
+ : public unary_function<short, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned short>
+ : public unary_function<unsigned short, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<int>
+ : public unary_function<int, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned int>
+ : public unary_function<unsigned int, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(unsigned int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<long>
+ : public unary_function<long, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned long>
+ : public unary_function<unsigned long, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<long long>
+ : public __scalar_hash<long long>
+{
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<unsigned long long>
+ : public __scalar_hash<unsigned long long>
+{
+};
+
+#ifndef _LIBCPP_HAS_NO_INT128
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<__int128_t>
+ : public __scalar_hash<__int128_t>
+{
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<__uint128_t>
+ : public __scalar_hash<__uint128_t>
+{
+};
+
+#endif
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<float>
+ : public __scalar_hash<float>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(float __v) const _NOEXCEPT
+ {
+ // -0.0 and 0.0 should return same hash
+ if (__v == 0)
+ return 0;
+ return __scalar_hash<float>::operator()(__v);
+ }
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<double>
+ : public __scalar_hash<double>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(double __v) const _NOEXCEPT
+ {
+ // -0.0 and 0.0 should return same hash
+ if (__v == 0)
+ return 0;
+ return __scalar_hash<double>::operator()(__v);
+ }
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<long double>
+ : public __scalar_hash<long double>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(long double __v) const _NOEXCEPT
+ {
+ // -0.0 and 0.0 should return same hash
+ if (__v == 0)
+ return 0;
+#if defined(__i386__)
+ // Zero out padding bits
+ union
+ {
+ long double __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ size_t __c;
+ size_t __d;
+ } __s;
+ } __u;
+ __u.__s.__a = 0;
+ __u.__s.__b = 0;
+ __u.__s.__c = 0;
+ __u.__s.__d = 0;
+ __u.__t = __v;
+ return __u.__s.__a ^ __u.__s.__b ^ __u.__s.__c ^ __u.__s.__d;
+#elif defined(__x86_64__)
+ // Zero out padding bits
+ union
+ {
+ long double __t;
+ struct
+ {
+ size_t __a;
+ size_t __b;
+ } __s;
+ } __u;
+ __u.__s.__a = 0;
+ __u.__s.__b = 0;
+ __u.__t = __v;
+ return __u.__s.__a ^ __u.__s.__b;
+#else
+ return __scalar_hash<long double>::operator()(__v);
+#endif
+ }
+};
+
+#if _LIBCPP_STD_VER > 11
+
+template <class _Tp, bool = is_enum<_Tp>::value>
+struct _LIBCPP_TEMPLATE_VIS __enum_hash
+ : public unary_function<_Tp, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(_Tp __v) const _NOEXCEPT
+ {
+ typedef typename underlying_type<_Tp>::type type;
+ return hash<type>{}(static_cast<type>(__v));
+ }
+};
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS __enum_hash<_Tp, false> {
+ __enum_hash() = delete;
+ __enum_hash(__enum_hash const&) = delete;
+ __enum_hash& operator=(__enum_hash const&) = delete;
+};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS hash : public __enum_hash<_Tp>
+{
+};
+#endif
+
+#if _LIBCPP_STD_VER > 14
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<nullptr_t>
+ : public unary_function<nullptr_t, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(nullptr_t) const _NOEXCEPT {
+ return 662607004ull;
+ }
+};
+#endif
+
+#ifndef _LIBCPP_CXX03_LANG
+template <class _Key, class _Hash>
+using __check_hash_requirements = integral_constant<bool,
+ is_copy_constructible<_Hash>::value &&
+ is_move_constructible<_Hash>::value &&
+ __invokable_r<size_t, _Hash, _Key const&>::value
+>;
+
+template <class _Key, class _Hash = std::hash<_Key> >
+using __has_enabled_hash = integral_constant<bool,
+ __check_hash_requirements<_Key, _Hash>::value &&
+ is_default_constructible<_Hash>::value
+>;
+
+#if _LIBCPP_STD_VER > 14
+template <class _Type, class>
+using __enable_hash_helper_imp = _Type;
+
+template <class _Type, class ..._Keys>
+using __enable_hash_helper = __enable_hash_helper_imp<_Type,
+ typename enable_if<__all<__has_enabled_hash<_Keys>::value...>::value>::type
+>;
+#else
+template <class _Type, class ...>
+using __enable_hash_helper = _Type;
+#endif
+
+#endif // !_LIBCPP_CXX03_LANG
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_UTILITY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/valarray b/chromium/buildtools/third_party/libc++/trunk/include/valarray
index bde644e8719..f8e19acdb71 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/valarray
+++ b/chromium/buildtools/third_party/libc++/trunk/include/valarray
@@ -348,7 +348,6 @@ template <class T> unspecified2 end(const valarray<T>& v);
#include <new>
#include <__undef_min_max>
-#include <__undef___deallocate>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -356,9 +355,9 @@ template <class T> unspecified2 end(const valarray<T>& v);
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY valarray;
+template<class _Tp> class _LIBCPP_TEMPLATE_VIS valarray;
-class _LIBCPP_TYPE_VIS_ONLY slice
+class _LIBCPP_TEMPLATE_VIS slice
{
size_t __start_;
size_t __size_;
@@ -383,11 +382,11 @@ public:
_LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;}
};
-template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY slice_array;
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS slice_array;
class _LIBCPP_TYPE_VIS gslice;
-template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY gslice_array;
-template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY mask_array;
-template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY indirect_array;
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS gslice_array;
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS mask_array;
+template <class _Tp> class _LIBCPP_TEMPLATE_VIS indirect_array;
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
@@ -673,7 +672,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __size_;}
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY valarray;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS valarray;
};
template <class _ValExpr>
@@ -788,7 +787,7 @@ template<class _Tp>
struct __is_val_expr<valarray<_Tp> > : true_type {};
template<class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY valarray
+class _LIBCPP_TEMPLATE_VIS valarray
{
public:
typedef _Tp value_type;
@@ -802,36 +801,32 @@ public:
// construct/destroy:
_LIBCPP_INLINE_VISIBILITY
valarray() : __begin_(0), __end_(0) {}
- _LIBCPP_INLINE_VISIBILITY
- inline explicit valarray(size_t __n);
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
+ explicit valarray(size_t __n);
_LIBCPP_INLINE_VISIBILITY
valarray(const value_type& __x, size_t __n);
valarray(const value_type* __p, size_t __n);
valarray(const valarray& __v);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
valarray(valarray&& __v) _NOEXCEPT;
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
valarray(initializer_list<value_type> __il);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
valarray(const slice_array<value_type>& __sa);
valarray(const gslice_array<value_type>& __ga);
valarray(const mask_array<value_type>& __ma);
valarray(const indirect_array<value_type>& __ia);
- inline _LIBCPP_INLINE_VISIBILITY
+ inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
~valarray();
// assignment:
valarray& operator=(const valarray& __v);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
valarray& operator=(valarray&& __v) _NOEXCEPT;
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
_LIBCPP_INLINE_VISIBILITY
valarray& operator=(initializer_list<value_type>);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
valarray& operator=(const value_type& __x);
_LIBCPP_INLINE_VISIBILITY
@@ -862,32 +857,32 @@ public:
__val_expr<__indirect_expr<const valarray&> > operator[](const gslice& __gs) const;
_LIBCPP_INLINE_VISIBILITY
gslice_array<value_type> operator[](const gslice& __gs);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const;
_LIBCPP_INLINE_VISIBILITY
gslice_array<value_type> operator[](gslice&& __gs);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__val_expr<__mask_expr<const valarray&> > operator[](const valarray<bool>& __vb) const;
_LIBCPP_INLINE_VISIBILITY
mask_array<value_type> operator[](const valarray<bool>& __vb);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__val_expr<__mask_expr<const valarray&> > operator[](valarray<bool>&& __vb) const;
_LIBCPP_INLINE_VISIBILITY
mask_array<value_type> operator[](valarray<bool>&& __vb);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const;
_LIBCPP_INLINE_VISIBILITY
indirect_array<value_type> operator[](const valarray<size_t>& __vs);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const;
_LIBCPP_INLINE_VISIBILITY
indirect_array<value_type> operator[](valarray<size_t>&& __vs);
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
// unary operators:
valarray operator+() const;
@@ -1028,12 +1023,12 @@ public:
void resize(size_t __n, value_type __x = value_type());
private:
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY valarray;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY slice_array;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY gslice_array;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY mask_array;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS valarray;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS slice_array;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS gslice_array;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS mask_array;
template <class> friend class __mask_expr;
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY indirect_array;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS indirect_array;
template <class> friend class __indirect_expr;
template <class> friend class __val_expr;
@@ -1147,7 +1142,7 @@ struct _BinaryOp<_Op, valarray<_Tp>, valarray<_Tp> >
// slice_array
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY slice_array
+class _LIBCPP_TEMPLATE_VIS slice_array
{
public:
typedef _Tp value_type;
@@ -1481,7 +1476,7 @@ public:
__stride_(__stride)
{__init(__start);}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
gslice(size_t __start, const valarray<size_t>& __size,
@@ -1504,7 +1499,7 @@ public:
__stride_(move(__stride))
{__init(__start);}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
// gslice(const gslice&) = default;
// gslice(gslice&&) = default;
@@ -1531,7 +1526,7 @@ private:
// gslice_array
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY gslice_array
+class _LIBCPP_TEMPLATE_VIS gslice_array
{
public:
typedef _Tp value_type;
@@ -1657,12 +1652,12 @@ private:
__1d_(__gs.__1d_)
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
gslice_array(gslice&& __gs, const valarray<value_type>& __v)
: __vp_(const_cast<value_type*>(__v.__begin_)),
__1d_(move(__gs.__1d_))
{}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class> friend class valarray;
};
@@ -1869,7 +1864,7 @@ gslice_array<_Tp>::operator=(const value_type& __x) const
// mask_array
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY mask_array
+class _LIBCPP_TEMPLATE_VIS mask_array
{
public:
typedef _Tp value_type;
@@ -2227,7 +2222,7 @@ public:
// indirect_array
template <class _Tp>
-class _LIBCPP_TYPE_VIS_ONLY indirect_array
+class _LIBCPP_TEMPLATE_VIS indirect_array
{
public:
typedef _Tp value_type;
@@ -2354,7 +2349,7 @@ private:
__1d_(__ia)
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
indirect_array(valarray<size_t>&& __ia, const valarray<value_type>& __v)
@@ -2362,7 +2357,7 @@ private:
__1d_(move(__ia))
{}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class> friend class valarray;
};
@@ -2573,7 +2568,7 @@ private:
__1d_(__ia)
{}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
__indirect_expr(valarray<size_t>&& __ia, const _RmExpr& __e)
@@ -2581,7 +2576,7 @@ private:
__1d_(move(__ia))
{}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
public:
_LIBCPP_INLINE_VISIBILITY
@@ -2591,7 +2586,7 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_t size() const {return __1d_.size();}
- template <class> friend class _LIBCPP_TYPE_VIS_ONLY valarray;
+ template <class> friend class _LIBCPP_TEMPLATE_VIS valarray;
};
template<class _ValExpr>
@@ -2815,7 +2810,7 @@ valarray<_Tp>::valarray(const valarray& __v)
}
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
inline
@@ -2826,10 +2821,6 @@ valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT
__v.__begin_ = __v.__end_ = nullptr;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Tp>
valarray<_Tp>::valarray(initializer_list<value_type> __il)
: __begin_(0),
@@ -2856,7 +2847,7 @@ valarray<_Tp>::valarray(initializer_list<value_type> __il)
}
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
@@ -2991,7 +2982,7 @@ valarray<_Tp>::operator=(const valarray& __v)
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
inline
@@ -3006,10 +2997,6 @@ valarray<_Tp>::operator=(valarray&& __v) _NOEXCEPT
return *this;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Tp>
inline
valarray<_Tp>&
@@ -3021,7 +3008,7 @@ valarray<_Tp>::operator=(initializer_list<value_type> __il)
return *this;
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
inline
@@ -3133,7 +3120,7 @@ valarray<_Tp>::operator[](const gslice& __gs)
return gslice_array<value_type>(__gs, *this);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
inline
@@ -3151,7 +3138,7 @@ valarray<_Tp>::operator[](gslice&& __gs)
return gslice_array<value_type>(move(__gs), *this);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
inline
@@ -3169,7 +3156,7 @@ valarray<_Tp>::operator[](const valarray<bool>& __vb)
return mask_array<value_type>(__vb, *this);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
inline
@@ -3187,7 +3174,7 @@ valarray<_Tp>::operator[](valarray<bool>&& __vb)
return mask_array<value_type>(move(__vb), *this);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
inline
@@ -3205,7 +3192,7 @@ valarray<_Tp>::operator[](const valarray<size_t>& __vs)
return indirect_array<value_type>(__vs, *this);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
inline
@@ -3223,7 +3210,7 @@ valarray<_Tp>::operator[](valarray<size_t>&& __vs)
return indirect_array<value_type>(move(__vs), *this);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_CXX03_LANG
template <class _Tp>
valarray<_Tp>
@@ -3697,7 +3684,7 @@ valarray<_Tp>::resize(size_t __n, value_type __x)
{
while (__end_ != __begin_)
(--__end_)->~value_type();
- _VSTD::__deallocate(__begin_);
+ _VSTD::__libcpp_deallocate(__begin_);
__begin_ = __end_ = nullptr;
}
if (__n)
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/variant b/chromium/buildtools/third_party/libc++/trunk/include/variant
new file mode 100644
index 00000000000..ba15ed8c4a1
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/include/variant
@@ -0,0 +1,1567 @@
+// -*- C++ -*-
+//===------------------------------ variant -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_VARIANT
+#define _LIBCPP_VARIANT
+
+/*
+ variant synopsis
+
+namespace std {
+
+ // 20.7.2, class template variant
+ template <class... Types>
+ class variant {
+ public:
+
+ // 20.7.2.1, constructors
+ constexpr variant() noexcept(see below);
+ variant(const variant&);
+ variant(variant&&) noexcept(see below);
+
+ template <class T> constexpr variant(T&&) noexcept(see below);
+
+ template <class T, class... Args>
+ constexpr explicit variant(in_place_type_t<T>, Args&&...);
+
+ template <class T, class U, class... Args>
+ constexpr explicit variant(
+ in_place_type_t<T>, initializer_list<U>, Args&&...);
+
+ template <size_t I, class... Args>
+ constexpr explicit variant(in_place_index_t<I>, Args&&...);
+
+ template <size_t I, class U, class... Args>
+ constexpr explicit variant(
+ in_place_index_t<I>, initializer_list<U>, Args&&...);
+
+ // 20.7.2.2, destructor
+ ~variant();
+
+ // 20.7.2.3, assignment
+ variant& operator=(const variant&);
+ variant& operator=(variant&&) noexcept(see below);
+
+ template <class T> variant& operator=(T&&) noexcept(see below);
+
+ // 20.7.2.4, modifiers
+ template <class T, class... Args>
+ T& emplace(Args&&...);
+
+ template <class T, class U, class... Args>
+ T& emplace(initializer_list<U>, Args&&...);
+
+ template <size_t I, class... Args>
+ variant_alternative_t<I, variant>& emplace(Args&&...);
+
+ template <size_t I, class U, class... Args>
+ variant_alternative_t<I, variant>& emplace(initializer_list<U>, Args&&...);
+
+ // 20.7.2.5, value status
+ constexpr bool valueless_by_exception() const noexcept;
+ constexpr size_t index() const noexcept;
+
+ // 20.7.2.6, swap
+ void swap(variant&) noexcept(see below);
+ };
+
+ // 20.7.3, variant helper classes
+ template <class T> struct variant_size; // undefined
+
+ template <class T>
+ constexpr size_t variant_size_v = variant_size<T>::value;
+
+ template <class T> struct variant_size<const T>;
+ template <class T> struct variant_size<volatile T>;
+ template <class T> struct variant_size<const volatile T>;
+
+ template <class... Types>
+ struct variant_size<variant<Types...>>;
+
+ template <size_t I, class T> struct variant_alternative; // undefined
+
+ template <size_t I, class T>
+ using variant_alternative_t = typename variant_alternative<I, T>::type;
+
+ template <size_t I, class T> struct variant_alternative<I, const T>;
+ template <size_t I, class T> struct variant_alternative<I, volatile T>;
+ template <size_t I, class T> struct variant_alternative<I, const volatile T>;
+
+ template <size_t I, class... Types>
+ struct variant_alternative<I, variant<Types...>>;
+
+ constexpr size_t variant_npos = -1;
+
+ // 20.7.4, value access
+ template <class T, class... Types>
+ constexpr bool holds_alternative(const variant<Types...>&) noexcept;
+
+ template <size_t I, class... Types>
+ constexpr variant_alternative_t<I, variant<Types...>>&
+ get(variant<Types...>&);
+
+ template <size_t I, class... Types>
+ constexpr variant_alternative_t<I, variant<Types...>>&&
+ get(variant<Types...>&&);
+
+ template <size_t I, class... Types>
+ constexpr variant_alternative_t<I, variant<Types...>> const&
+ get(const variant<Types...>&);
+
+ template <size_t I, class... Types>
+ constexpr variant_alternative_t<I, variant<Types...>> const&&
+ get(const variant<Types...>&&);
+
+ template <class T, class... Types>
+ constexpr T& get(variant<Types...>&);
+
+ template <class T, class... Types>
+ constexpr T&& get(variant<Types...>&&);
+
+ template <class T, class... Types>
+ constexpr const T& get(const variant<Types...>&);
+
+ template <class T, class... Types>
+ constexpr const T&& get(const variant<Types...>&&);
+
+ template <size_t I, class... Types>
+ constexpr add_pointer_t<variant_alternative_t<I, variant<Types...>>>
+ get_if(variant<Types...>*) noexcept;
+
+ template <size_t I, class... Types>
+ constexpr add_pointer_t<const variant_alternative_t<I, variant<Types...>>>
+ get_if(const variant<Types...>*) noexcept;
+
+ template <class T, class... Types>
+ constexpr add_pointer_t<T>
+ get_if(variant<Types...>*) noexcept;
+
+ template <class T, class... Types>
+ constexpr add_pointer_t<const T>
+ get_if(const variant<Types...>*) noexcept;
+
+ // 20.7.5, relational operators
+ template <class... Types>
+ constexpr bool operator==(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator!=(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator<(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator>(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator<=(const variant<Types...>&, const variant<Types...>&);
+
+ template <class... Types>
+ constexpr bool operator>=(const variant<Types...>&, const variant<Types...>&);
+
+ // 20.7.6, visitation
+ template <class Visitor, class... Variants>
+ constexpr see below visit(Visitor&&, Variants&&...);
+
+ // 20.7.7, class monostate
+ struct monostate;
+
+ // 20.7.8, monostate relational operators
+ constexpr bool operator<(monostate, monostate) noexcept;
+ constexpr bool operator>(monostate, monostate) noexcept;
+ constexpr bool operator<=(monostate, monostate) noexcept;
+ constexpr bool operator>=(monostate, monostate) noexcept;
+ constexpr bool operator==(monostate, monostate) noexcept;
+ constexpr bool operator!=(monostate, monostate) noexcept;
+
+ // 20.7.9, specialized algorithms
+ template <class... Types>
+ void swap(variant<Types...>&, variant<Types...>&) noexcept(see below);
+
+ // 20.7.10, class bad_variant_access
+ class bad_variant_access;
+
+ // 20.7.11, hash support
+ template <class T> struct hash;
+ template <class... Types> struct hash<variant<Types...>>;
+ template <> struct hash<monostate>;
+
+} // namespace std
+
+*/
+
+#include <__config>
+#include <__tuple>
+#include <array>
+#include <exception>
+#include <functional>
+#include <initializer_list>
+#include <new>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+namespace std { // explicitly not using versioning namespace
+
+class _LIBCPP_EXCEPTION_ABI bad_variant_access : public exception {
+public:
+ virtual const char* what() const _NOEXCEPT;
+};
+
+} // namespace std
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER > 14
+
+_LIBCPP_NORETURN
+inline _LIBCPP_INLINE_VISIBILITY
+void __throw_bad_variant_access() {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_variant_access();
+#else
+ _VSTD::abort();
+#endif
+}
+
+template <class... _Types>
+class _LIBCPP_TEMPLATE_VIS variant;
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_size;
+
+template <class _Tp>
+constexpr size_t variant_size_v = variant_size<_Tp>::value;
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_size<const _Tp> : variant_size<_Tp> {};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_size<volatile _Tp> : variant_size<_Tp> {};
+
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_size<const volatile _Tp>
+ : variant_size<_Tp> {};
+
+template <class... _Types>
+struct _LIBCPP_TEMPLATE_VIS variant_size<variant<_Types...>>
+ : integral_constant<size_t, sizeof...(_Types)> {};
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_alternative;
+
+template <size_t _Ip, class _Tp>
+using variant_alternative_t = typename variant_alternative<_Ip, _Tp>::type;
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, const _Tp>
+ : add_const<variant_alternative_t<_Ip, _Tp>> {};
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, volatile _Tp>
+ : add_volatile<variant_alternative_t<_Ip, _Tp>> {};
+
+template <size_t _Ip, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, const volatile _Tp>
+ : add_cv<variant_alternative_t<_Ip, _Tp>> {};
+
+template <size_t _Ip, class... _Types>
+struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> {
+ static_assert(_Ip < sizeof...(_Types));
+ using type = __type_pack_element<_Ip, _Types...>;
+};
+
+constexpr size_t variant_npos = static_cast<size_t>(-1);
+constexpr unsigned int __variant_npos = static_cast<unsigned int>(-1);
+
+namespace __find_detail {
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr size_t __find_index() {
+ constexpr bool __matches[] = {is_same_v<_Tp, _Types>...};
+ size_t __result = __not_found;
+ for (size_t __i = 0; __i < sizeof...(_Types); ++__i) {
+ if (__matches[__i]) {
+ if (__result != __not_found) {
+ return __ambiguous;
+ }
+ __result = __i;
+ }
+ }
+ return __result;
+}
+
+template <size_t _Index>
+struct __find_unambiguous_index_sfinae_impl
+ : integral_constant<size_t, _Index> {};
+
+template <>
+struct __find_unambiguous_index_sfinae_impl<__not_found> {};
+
+template <>
+struct __find_unambiguous_index_sfinae_impl<__ambiguous> {};
+
+template <class _Tp, class... _Types>
+struct __find_unambiguous_index_sfinae
+ : __find_unambiguous_index_sfinae_impl<__find_index<_Tp, _Types...>()> {};
+
+} // namespace __find_detail
+
+namespace __variant_detail {
+
+struct __valueless_t {};
+
+enum class _Trait { _TriviallyAvailable, _Available, _Unavailable };
+
+template <typename _Tp,
+ template <typename> class _IsTriviallyAvailable,
+ template <typename> class _IsAvailable>
+constexpr _Trait __trait =
+ _IsTriviallyAvailable<_Tp>::value
+ ? _Trait::_TriviallyAvailable
+ : _IsAvailable<_Tp>::value ? _Trait::_Available : _Trait::_Unavailable;
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Trait __common_trait(initializer_list<_Trait> __traits) {
+ _Trait __result = _Trait::_TriviallyAvailable;
+ for (_Trait __t : __traits) {
+ if (static_cast<int>(__t) > static_cast<int>(__result)) {
+ __result = __t;
+ }
+ }
+ return __result;
+}
+
+template <typename... _Types>
+struct __traits {
+ static constexpr _Trait __copy_constructible_trait =
+ __common_trait({__trait<_Types,
+ is_trivially_copy_constructible,
+ is_copy_constructible>...});
+
+ static constexpr _Trait __move_constructible_trait =
+ __common_trait({__trait<_Types,
+ is_trivially_move_constructible,
+ is_move_constructible>...});
+
+ static constexpr _Trait __copy_assignable_trait = __common_trait(
+ {__copy_constructible_trait,
+ __move_constructible_trait,
+ __trait<_Types, is_trivially_copy_assignable, is_copy_assignable>...});
+
+ static constexpr _Trait __move_assignable_trait = __common_trait(
+ {__move_constructible_trait,
+ __trait<_Types, is_trivially_move_assignable, is_move_assignable>...});
+
+ static constexpr _Trait __destructible_trait = __common_trait(
+ {__trait<_Types, is_trivially_destructible, is_destructible>...});
+};
+
+namespace __access {
+
+struct __union {
+ template <class _Vp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __get_alt(_Vp&& __v, in_place_index_t<0>) {
+ return _VSTD::forward<_Vp>(__v).__head;
+ }
+
+ template <class _Vp, size_t _Ip>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __get_alt(_Vp&& __v, in_place_index_t<_Ip>) {
+ return __get_alt(_VSTD::forward<_Vp>(__v).__tail, in_place_index<_Ip - 1>);
+ }
+};
+
+struct __base {
+ template <size_t _Ip, class _Vp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __get_alt(_Vp&& __v) {
+ return __union::__get_alt(_VSTD::forward<_Vp>(__v).__data,
+ in_place_index<_Ip>);
+ }
+};
+
+struct __variant {
+ template <size_t _Ip, class _Vp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __get_alt(_Vp&& __v) {
+ return __base::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v).__impl);
+ }
+};
+
+} // namespace __access
+
+namespace __visitation {
+
+struct __base {
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto)
+ __visit_alt_at(size_t __index, _Visitor&& __visitor, _Vs&&... __vs) {
+ constexpr auto __fdiagonal =
+ __make_fdiagonal<_Visitor&&,
+ decltype(_VSTD::forward<_Vs>(__vs).__as_base())...>();
+ return __fdiagonal[__index](_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs).__as_base()...);
+ }
+
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto) __visit_alt(_Visitor&& __visitor,
+ _Vs&&... __vs) {
+ constexpr auto __fmatrix =
+ __make_fmatrix<_Visitor&&,
+ decltype(_VSTD::forward<_Vs>(__vs).__as_base())...>();
+ return __at(__fmatrix, __vs.index()...)(
+ _VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs).__as_base()...);
+ }
+
+private:
+ template <class _Tp>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr const _Tp& __at(const _Tp& __elem) { return __elem; }
+
+ template <class _Tp, size_t _Np, typename... _Indices>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto&& __at(const array<_Tp, _Np>& __elems,
+ size_t __index, _Indices... __indices) {
+ return __at(__elems[__index], __indices...);
+ }
+
+ template <class _Fp, class... _Fs>
+ static constexpr void __std_visit_visitor_return_type_check() {
+ static_assert(
+ __all<is_same_v<_Fp, _Fs>...>::value,
+ "`std::visit` requires the visitor to have a single return type.");
+ }
+
+ template <class... _Fs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_farray(_Fs&&... __fs) {
+ __std_visit_visitor_return_type_check<decay_t<_Fs>...>();
+ using __result = array<common_type_t<decay_t<_Fs>...>, sizeof...(_Fs)>;
+ return __result{{_VSTD::forward<_Fs>(__fs)...}};
+ }
+
+ template <std::size_t... _Is>
+ struct __dispatcher {
+ template <class _Fp, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto) __dispatch(_Fp __f, _Vs... __vs) {
+ return __invoke_constexpr(
+ static_cast<_Fp>(__f),
+ __access::__base::__get_alt<_Is>(static_cast<_Vs>(__vs))...);
+ }
+ };
+
+ template <class _Fp, class... _Vs, size_t... _Is>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_dispatch(index_sequence<_Is...>) {
+ return __dispatcher<_Is...>::template __dispatch<_Fp, _Vs...>;
+ }
+
+ template <size_t _Ip, class _Fp, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fdiagonal_impl() {
+ return __make_dispatch<_Fp, _Vs...>(
+ index_sequence<(__identity<_Vs>{}, _Ip)...>{});
+ }
+
+ template <class _Fp, class... _Vs, size_t... _Is>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fdiagonal_impl(index_sequence<_Is...>) {
+ return __base::__make_farray(__make_fdiagonal_impl<_Is, _Fp, _Vs...>()...);
+ }
+
+ template <class _Fp, class _Vp, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fdiagonal() {
+ constexpr size_t _Np = decay_t<_Vp>::__size();
+ static_assert(__all<(_Np == decay_t<_Vs>::__size())...>::value);
+ return __make_fdiagonal_impl<_Fp, _Vp, _Vs...>(make_index_sequence<_Np>{});
+ }
+
+ template <class _Fp, class... _Vs, size_t... _Is>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fmatrix_impl(index_sequence<_Is...> __is) {
+ return __make_dispatch<_Fp, _Vs...>(__is);
+ }
+
+ template <class _Fp, class... _Vs, size_t... _Is, size_t... _Js, class... _Ls>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fmatrix_impl(index_sequence<_Is...>,
+ index_sequence<_Js...>,
+ _Ls... __ls) {
+ return __base::__make_farray(__make_fmatrix_impl<_Fp, _Vs...>(
+ index_sequence<_Is..., _Js>{}, __ls...)...);
+ }
+
+ template <class _Fp, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_fmatrix() {
+ return __make_fmatrix_impl<_Fp, _Vs...>(
+ index_sequence<>{}, make_index_sequence<decay_t<_Vs>::__size()>{}...);
+ }
+};
+
+struct __variant {
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto)
+ __visit_alt_at(size_t __index, _Visitor&& __visitor, _Vs&&... __vs) {
+ return __base::__visit_alt_at(__index,
+ _VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs).__impl...);
+ }
+
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto) __visit_alt(_Visitor&& __visitor,
+ _Vs&&... __vs) {
+ return __base::__visit_alt(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs).__impl...);
+ }
+
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto)
+ __visit_value_at(size_t __index, _Visitor&& __visitor, _Vs&&... __vs) {
+ return __visit_alt_at(
+ __index,
+ __make_value_visitor(_VSTD::forward<_Visitor>(__visitor)),
+ _VSTD::forward<_Vs>(__vs)...);
+ }
+
+ template <class _Visitor, class... _Vs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr decltype(auto) __visit_value(_Visitor&& __visitor,
+ _Vs&&... __vs) {
+ return __visit_alt(
+ __make_value_visitor(_VSTD::forward<_Visitor>(__visitor)),
+ _VSTD::forward<_Vs>(__vs)...);
+ }
+
+private:
+ template <class _Visitor, class... _Values>
+ static constexpr void __std_visit_exhaustive_visitor_check() {
+ static_assert(is_callable_v<_Visitor(_Values...)>,
+ "`std::visit` requires the visitor to be exhaustive.");
+ }
+
+ template <class _Visitor>
+ struct __value_visitor {
+ template <class... _Alts>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr decltype(auto) operator()(_Alts&&... __alts) const {
+ __std_visit_exhaustive_visitor_check<
+ _Visitor,
+ decltype((_VSTD::forward<_Alts>(__alts).__value))...>();
+ return __invoke_constexpr(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Alts>(__alts).__value...);
+ }
+ _Visitor&& __visitor;
+ };
+
+ template <class _Visitor>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr auto __make_value_visitor(_Visitor&& __visitor) {
+ return __value_visitor<_Visitor>{_VSTD::forward<_Visitor>(__visitor)};
+ }
+};
+
+} // namespace __visitation
+
+template <size_t _Index, class _Tp>
+struct _LIBCPP_TEMPLATE_VIS __alt {
+ using __value_type = _Tp;
+
+ template <class... _Args>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr __alt(in_place_t, _Args&&... __args)
+ : __value(_VSTD::forward<_Args>(__args)...) {}
+
+ __value_type __value;
+};
+
+template <_Trait _DestructibleTrait, size_t _Index, class... _Types>
+union _LIBCPP_TEMPLATE_VIS __union;
+
+template <_Trait _DestructibleTrait, size_t _Index>
+union _LIBCPP_TEMPLATE_VIS __union<_DestructibleTrait, _Index> {};
+
+#define _LIBCPP_VARIANT_UNION(destructible_trait, destructor) \
+ template <size_t _Index, class _Tp, class... _Types> \
+ union _LIBCPP_TEMPLATE_VIS __union<destructible_trait, \
+ _Index, \
+ _Tp, \
+ _Types...> { \
+ public: \
+ inline _LIBCPP_INLINE_VISIBILITY \
+ explicit constexpr __union(__valueless_t) noexcept : __dummy{} {} \
+ \
+ template <class... _Args> \
+ inline _LIBCPP_INLINE_VISIBILITY \
+ explicit constexpr __union(in_place_index_t<0>, _Args&&... __args) \
+ : __head(in_place, _VSTD::forward<_Args>(__args)...) {} \
+ \
+ template <size_t _Ip, class... _Args> \
+ inline _LIBCPP_INLINE_VISIBILITY \
+ explicit constexpr __union(in_place_index_t<_Ip>, _Args&&... __args) \
+ : __tail(in_place_index<_Ip - 1>, _VSTD::forward<_Args>(__args)...) {} \
+ \
+ __union(const __union&) = default; \
+ __union(__union&&) = default; \
+ \
+ destructor \
+ \
+ __union& operator=(const __union&) = default; \
+ __union& operator=(__union&&) = default; \
+ \
+ private: \
+ char __dummy; \
+ __alt<_Index, _Tp> __head; \
+ __union<destructible_trait, _Index + 1, _Types...> __tail; \
+ \
+ friend struct __access::__union; \
+ }
+
+_LIBCPP_VARIANT_UNION(_Trait::_TriviallyAvailable, ~__union() = default;);
+_LIBCPP_VARIANT_UNION(_Trait::_Available, ~__union() {});
+_LIBCPP_VARIANT_UNION(_Trait::_Unavailable, ~__union() = delete;);
+
+#undef _LIBCPP_VARIANT_UNION
+
+template <_Trait _DestructibleTrait, class... _Types>
+class _LIBCPP_TEMPLATE_VIS __base {
+public:
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr __base(__valueless_t tag) noexcept
+ : __data(tag), __index(__variant_npos) {}
+
+ template <size_t _Ip, class... _Args>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr __base(in_place_index_t<_Ip>, _Args&&... __args)
+ :
+ __data(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...),
+ __index(_Ip) {}
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr bool valueless_by_exception() const noexcept {
+ return index() == variant_npos;
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr size_t index() const noexcept {
+ return __index == __variant_npos ? variant_npos : __index;
+ }
+
+protected:
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr auto&& __as_base() & { return *this; }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr auto&& __as_base() && { return _VSTD::move(*this); }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr auto&& __as_base() const & { return *this; }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr auto&& __as_base() const && { return _VSTD::move(*this); }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ static constexpr size_t __size() { return sizeof...(_Types); }
+
+ __union<_DestructibleTrait, 0, _Types...> __data;
+ unsigned int __index;
+
+ friend struct __access::__base;
+ friend struct __visitation::__base;
+};
+
+template <class _Traits, _Trait = _Traits::__destructible_trait>
+class _LIBCPP_TEMPLATE_VIS __destructor;
+
+#define _LIBCPP_VARIANT_DESTRUCTOR(destructible_trait, destructor, destroy) \
+ template <class... _Types> \
+ class _LIBCPP_TEMPLATE_VIS __destructor<__traits<_Types...>, \
+ destructible_trait> \
+ : public __base<destructible_trait, _Types...> { \
+ using __base_type = __base<destructible_trait, _Types...>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ __destructor(const __destructor&) = default; \
+ __destructor(__destructor&&) = default; \
+ destructor \
+ __destructor& operator=(const __destructor&) = default; \
+ __destructor& operator=(__destructor&&) = default; \
+ \
+ protected: \
+ inline _LIBCPP_INLINE_VISIBILITY \
+ destroy \
+ }
+
+_LIBCPP_VARIANT_DESTRUCTOR(
+ _Trait::_TriviallyAvailable,
+ ~__destructor() = default;,
+ void __destroy() noexcept { this->__index = __variant_npos; });
+
+_LIBCPP_VARIANT_DESTRUCTOR(
+ _Trait::_Available,
+ ~__destructor() { __destroy(); },
+ void __destroy() noexcept {
+ if (!this->valueless_by_exception()) {
+ __visitation::__base::__visit_alt(
+ [](auto& __alt) noexcept {
+ using __alt_type = decay_t<decltype(__alt)>;
+ __alt.~__alt_type();
+ },
+ *this);
+ }
+ this->__index = __variant_npos;
+ });
+
+_LIBCPP_VARIANT_DESTRUCTOR(
+ _Trait::_Unavailable,
+ ~__destructor() = delete;,
+ void __destroy() noexcept = delete;);
+
+#undef _LIBCPP_VARIANT_DESTRUCTOR
+
+template <class _Traits>
+class _LIBCPP_TEMPLATE_VIS __constructor : public __destructor<_Traits> {
+ using __base_type = __destructor<_Traits>;
+
+public:
+ using __base_type::__base_type;
+ using __base_type::operator=;
+
+protected:
+ template <size_t _Ip, class _Tp, class... _Args>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static _Tp& __construct_alt(__alt<_Ip, _Tp>& __a, _Args&&... __args) {
+ ::new ((void*)_VSTD::addressof(__a))
+ __alt<_Ip, _Tp>(in_place, _VSTD::forward<_Args>(__args)...);
+ return __a.__value;
+ }
+
+ template <class _Rhs>
+ inline _LIBCPP_INLINE_VISIBILITY
+ static void __generic_construct(__constructor& __lhs, _Rhs&& __rhs) {
+ __lhs.__destroy();
+ if (!__rhs.valueless_by_exception()) {
+ __visitation::__base::__visit_alt_at(
+ __rhs.index(),
+ [](auto& __lhs_alt, auto&& __rhs_alt) {
+ __construct_alt(
+ __lhs_alt,
+ _VSTD::forward<decltype(__rhs_alt)>(__rhs_alt).__value);
+ },
+ __lhs, _VSTD::forward<_Rhs>(__rhs));
+ __lhs.__index = __rhs.index();
+ }
+ }
+};
+
+template <class _Traits, _Trait = _Traits::__move_constructible_trait>
+class _LIBCPP_TEMPLATE_VIS __move_constructor;
+
+#define _LIBCPP_VARIANT_MOVE_CONSTRUCTOR(move_constructible_trait, \
+ move_constructor) \
+ template <class... _Types> \
+ class _LIBCPP_TEMPLATE_VIS __move_constructor<__traits<_Types...>, \
+ move_constructible_trait> \
+ : public __constructor<__traits<_Types...>> { \
+ using __base_type = __constructor<__traits<_Types...>>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ __move_constructor(const __move_constructor&) = default; \
+ move_constructor \
+ ~__move_constructor() = default; \
+ __move_constructor& operator=(const __move_constructor&) = default; \
+ __move_constructor& operator=(__move_constructor&&) = default; \
+ }
+
+_LIBCPP_VARIANT_MOVE_CONSTRUCTOR(
+ _Trait::_TriviallyAvailable,
+ __move_constructor(__move_constructor&& __that) = default;);
+
+_LIBCPP_VARIANT_MOVE_CONSTRUCTOR(
+ _Trait::_Available,
+ __move_constructor(__move_constructor&& __that) noexcept(
+ __all<is_nothrow_move_constructible_v<_Types>...>::value)
+ : __move_constructor(__valueless_t{}) {
+ this->__generic_construct(*this, _VSTD::move(__that));
+ });
+
+_LIBCPP_VARIANT_MOVE_CONSTRUCTOR(
+ _Trait::_Unavailable,
+ __move_constructor(__move_constructor&&) = delete;);
+
+#undef _LIBCPP_VARIANT_MOVE_CONSTRUCTOR
+
+template <class _Traits, _Trait = _Traits::__copy_constructible_trait>
+class _LIBCPP_TEMPLATE_VIS __copy_constructor;
+
+#define _LIBCPP_VARIANT_COPY_CONSTRUCTOR(copy_constructible_trait, \
+ copy_constructor) \
+ template <class... _Types> \
+ class _LIBCPP_TEMPLATE_VIS __copy_constructor<__traits<_Types...>, \
+ copy_constructible_trait> \
+ : public __move_constructor<__traits<_Types...>> { \
+ using __base_type = __move_constructor<__traits<_Types...>>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ copy_constructor \
+ __copy_constructor(__copy_constructor&&) = default; \
+ ~__copy_constructor() = default; \
+ __copy_constructor& operator=(const __copy_constructor&) = default; \
+ __copy_constructor& operator=(__copy_constructor&&) = default; \
+ }
+
+_LIBCPP_VARIANT_COPY_CONSTRUCTOR(
+ _Trait::_TriviallyAvailable,
+ __copy_constructor(const __copy_constructor& __that) = default;);
+
+_LIBCPP_VARIANT_COPY_CONSTRUCTOR(
+ _Trait::_Available,
+ __copy_constructor(const __copy_constructor& __that)
+ : __copy_constructor(__valueless_t{}) {
+ this->__generic_construct(*this, __that);
+ });
+
+_LIBCPP_VARIANT_COPY_CONSTRUCTOR(
+ _Trait::_Unavailable,
+ __copy_constructor(const __copy_constructor&) = delete;);
+
+#undef _LIBCPP_VARIANT_COPY_CONSTRUCTOR
+
+template <class _Traits>
+class _LIBCPP_TEMPLATE_VIS __assignment : public __copy_constructor<_Traits> {
+ using __base_type = __copy_constructor<_Traits>;
+
+public:
+ using __base_type::__base_type;
+ using __base_type::operator=;
+
+ template <size_t _Ip, class... _Args>
+ inline _LIBCPP_INLINE_VISIBILITY
+ auto& __emplace(_Args&&... __args) {
+ this->__destroy();
+ auto& __res = this->__construct_alt(__access::__base::__get_alt<_Ip>(*this),
+ _VSTD::forward<_Args>(__args)...);
+ this->__index = _Ip;
+ return __res;
+ }
+
+protected:
+ template <bool _CopyAssign, size_t _Ip, class _Tp, class _Arg>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __assign_alt(__alt<_Ip, _Tp>& __a,
+ _Arg&& __arg,
+ bool_constant<_CopyAssign> __tag) {
+ if (this->index() == _Ip) {
+ __a.__value = _VSTD::forward<_Arg>(__arg);
+ } else {
+ struct {
+ void operator()(true_type) const {
+ __this->__emplace<_Ip>(_Tp(_VSTD::forward<_Arg>(__arg)));
+ }
+ void operator()(false_type) const {
+ __this->__emplace<_Ip>(_VSTD::forward<_Arg>(__arg));
+ }
+ __assignment* __this;
+ _Arg&& __arg;
+ } __impl{this, _VSTD::forward<_Arg>(__arg)};
+ __impl(__tag);
+ }
+ }
+
+ template <class _That>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __generic_assign(_That&& __that) {
+ if (this->valueless_by_exception() && __that.valueless_by_exception()) {
+ // do nothing.
+ } else if (__that.valueless_by_exception()) {
+ this->__destroy();
+ } else {
+ __visitation::__base::__visit_alt_at(
+ __that.index(),
+ [this](auto& __this_alt, auto&& __that_alt) {
+ this->__assign_alt(
+ __this_alt,
+ _VSTD::forward<decltype(__that_alt)>(__that_alt).__value,
+ is_lvalue_reference<_That>{});
+ },
+ *this, _VSTD::forward<_That>(__that));
+ }
+ }
+};
+
+template <class _Traits, _Trait = _Traits::__move_assignable_trait>
+class _LIBCPP_TEMPLATE_VIS __move_assignment;
+
+#define _LIBCPP_VARIANT_MOVE_ASSIGNMENT(move_assignable_trait, \
+ move_assignment) \
+ template <class... _Types> \
+ class _LIBCPP_TEMPLATE_VIS __move_assignment<__traits<_Types...>, \
+ move_assignable_trait> \
+ : public __assignment<__traits<_Types...>> { \
+ using __base_type = __assignment<__traits<_Types...>>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ __move_assignment(const __move_assignment&) = default; \
+ __move_assignment(__move_assignment&&) = default; \
+ ~__move_assignment() = default; \
+ __move_assignment& operator=(const __move_assignment&) = default; \
+ move_assignment \
+ }
+
+_LIBCPP_VARIANT_MOVE_ASSIGNMENT(
+ _Trait::_TriviallyAvailable,
+ __move_assignment& operator=(__move_assignment&& __that) = default;);
+
+_LIBCPP_VARIANT_MOVE_ASSIGNMENT(
+ _Trait::_Available,
+ __move_assignment& operator=(__move_assignment&& __that) noexcept(
+ __all<(is_nothrow_move_constructible_v<_Types> &&
+ is_nothrow_move_assignable_v<_Types>)...>::value) {
+ this->__generic_assign(_VSTD::move(__that));
+ return *this;
+ });
+
+_LIBCPP_VARIANT_MOVE_ASSIGNMENT(
+ _Trait::_Unavailable,
+ __move_assignment& operator=(__move_assignment&&) = delete;);
+
+#undef _LIBCPP_VARIANT_MOVE_ASSIGNMENT
+
+template <class _Traits, _Trait = _Traits::__copy_assignable_trait>
+class _LIBCPP_TEMPLATE_VIS __copy_assignment;
+
+#define _LIBCPP_VARIANT_COPY_ASSIGNMENT(copy_assignable_trait, \
+ copy_assignment) \
+ template <class... _Types> \
+ class _LIBCPP_TEMPLATE_VIS __copy_assignment<__traits<_Types...>, \
+ copy_assignable_trait> \
+ : public __move_assignment<__traits<_Types...>> { \
+ using __base_type = __move_assignment<__traits<_Types...>>; \
+ \
+ public: \
+ using __base_type::__base_type; \
+ using __base_type::operator=; \
+ \
+ __copy_assignment(const __copy_assignment&) = default; \
+ __copy_assignment(__copy_assignment&&) = default; \
+ ~__copy_assignment() = default; \
+ copy_assignment \
+ __copy_assignment& operator=(__copy_assignment&&) = default; \
+ }
+
+_LIBCPP_VARIANT_COPY_ASSIGNMENT(
+ _Trait::_TriviallyAvailable,
+ __copy_assignment& operator=(const __copy_assignment& __that) = default;);
+
+_LIBCPP_VARIANT_COPY_ASSIGNMENT(
+ _Trait::_Available,
+ __copy_assignment& operator=(const __copy_assignment& __that) {
+ this->__generic_assign(__that);
+ return *this;
+ });
+
+_LIBCPP_VARIANT_COPY_ASSIGNMENT(
+ _Trait::_Unavailable,
+ __copy_assignment& operator=(const __copy_assignment&) = delete;);
+
+#undef _LIBCPP_VARIANT_COPY_ASSIGNMENT
+
+template <class... _Types>
+class _LIBCPP_TEMPLATE_VIS __impl
+ : public __copy_assignment<__traits<_Types...>> {
+ using __base_type = __copy_assignment<__traits<_Types...>>;
+
+public:
+ using __base_type::__base_type;
+ using __base_type::operator=;
+
+ template <size_t _Ip, class _Arg>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __assign(_Arg&& __arg) {
+ this->__assign_alt(__access::__base::__get_alt<_Ip>(*this),
+ _VSTD::forward<_Arg>(__arg),
+ false_type{});
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ void __swap(__impl& __that) {
+ if (this->valueless_by_exception() && __that.valueless_by_exception()) {
+ // do nothing.
+ } else if (this->index() == __that.index()) {
+ __visitation::__base::__visit_alt_at(
+ this->index(),
+ [](auto& __this_alt, auto& __that_alt) {
+ using _VSTD::swap;
+ swap(__this_alt.__value, __that_alt.__value);
+ },
+ *this,
+ __that);
+ } else {
+ __impl* __lhs = this;
+ __impl* __rhs = _VSTD::addressof(__that);
+ if (__lhs->__move_nothrow() && !__rhs->__move_nothrow()) {
+ _VSTD::swap(__lhs, __rhs);
+ }
+ __impl __tmp(_VSTD::move(*__rhs));
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ // EXTENSION: When the move construction of `__lhs` into `__rhs` throws
+ // and `__tmp` is nothrow move constructible then we move `__tmp` back
+ // into `__rhs` and provide the strong exception safety guarentee.
+ try {
+ this->__generic_construct(*__rhs, _VSTD::move(*__lhs));
+ } catch (...) {
+ if (__tmp.__move_nothrow()) {
+ this->__generic_construct(*__rhs, _VSTD::move(__tmp));
+ }
+ throw;
+ }
+#else
+ this->__generic_construct(*__rhs, _VSTD::move(*__lhs));
+#endif
+ this->__generic_construct(*__lhs, _VSTD::move(__tmp));
+ }
+ }
+
+private:
+ inline _LIBCPP_INLINE_VISIBILITY
+ bool __move_nothrow() const {
+ constexpr bool __results[] = {is_nothrow_move_constructible_v<_Types>...};
+ return this->valueless_by_exception() || __results[this->index()];
+ }
+};
+
+template <class... _Types>
+struct __overload;
+
+template <>
+struct __overload<> { void operator()() const; };
+
+template <class _Tp, class... _Types>
+struct __overload<_Tp, _Types...> : __overload<_Types...> {
+ using __overload<_Types...>::operator();
+ __identity<_Tp> operator()(_Tp) const;
+};
+
+template <class _Tp, class... _Types>
+using __best_match_t = typename result_of_t<__overload<_Types...>(_Tp&&)>::type;
+
+} // __variant_detail
+
+template <class... _Types>
+class _LIBCPP_TEMPLATE_VIS variant
+ : private __sfinae_ctor_base<
+ __all<is_copy_constructible_v<_Types>...>::value,
+ __all<is_move_constructible_v<_Types>...>::value>,
+ private __sfinae_assign_base<
+ __all<(is_copy_constructible_v<_Types> &&
+ is_move_constructible_v<_Types> &&
+ is_copy_assignable_v<_Types>)...>::value,
+ __all<(is_move_constructible_v<_Types> &&
+ is_move_assignable_v<_Types>)...>::value> {
+ static_assert(0 < sizeof...(_Types),
+ "variant must consist of at least one alternative.");
+
+ static_assert(__all<!is_array_v<_Types>...>::value,
+ "variant can not have an array type as an alternative.");
+
+ static_assert(__all<!is_reference_v<_Types>...>::value,
+ "variant can not have a reference type as an alternative.");
+
+ static_assert(__all<!is_void_v<_Types>...>::value,
+ "variant can not have a void type as an alternative.");
+
+ using __first_type = variant_alternative_t<0, variant>;
+
+public:
+ template <bool _Dummy = true,
+ enable_if_t<__dependent_type<is_default_constructible<__first_type>,
+ _Dummy>::value,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>)
+ : __impl(in_place_index<0>) {}
+
+ variant(const variant&) = default;
+ variant(variant&&) = default;
+
+ template <
+ class _Arg,
+ enable_if_t<!is_same_v<decay_t<_Arg>, variant>, int> = 0,
+ class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, _Arg>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr variant(_Arg&& __arg) noexcept(
+ is_nothrow_constructible_v<_Tp, _Arg>)
+ : __impl(in_place_index<_Ip>, _VSTD::forward<_Arg>(__arg)) {}
+
+ template <size_t _Ip, class... _Args,
+ class = enable_if_t<(_Ip < sizeof...(_Types)), int>,
+ class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
+ enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr variant(
+ in_place_index_t<_Ip>,
+ _Args&&... __args) noexcept(is_nothrow_constructible_v<_Tp, _Args...>)
+ : __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {}
+
+ template <
+ size_t _Ip,
+ class _Up,
+ class... _Args,
+ enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
+ class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
+ enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr variant(
+ in_place_index_t<_Ip>,
+ initializer_list<_Up> __il,
+ _Args&&... __args) noexcept(
+ is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>)
+ : __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
+
+ template <
+ class _Tp,
+ class... _Args,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr variant(in_place_type_t<_Tp>, _Args&&... __args) noexcept(
+ is_nothrow_constructible_v<_Tp, _Args...>)
+ : __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {}
+
+ template <
+ class _Tp,
+ class _Up,
+ class... _Args,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ explicit constexpr variant(
+ in_place_type_t<_Tp>,
+ initializer_list<_Up> __il,
+ _Args&&... __args) noexcept(
+ is_nothrow_constructible_v<_Tp, initializer_list< _Up>&, _Args...>)
+ : __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
+
+ ~variant() = default;
+
+ variant& operator=(const variant&) = default;
+ variant& operator=(variant&&) = default;
+
+ template <
+ class _Arg,
+ enable_if_t<!is_same_v<decay_t<_Arg>, variant>, int> = 0,
+ class _Tp = __variant_detail::__best_match_t<_Arg, _Types...>,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_assignable_v<_Tp&, _Arg> && is_constructible_v<_Tp, _Arg>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ variant& operator=(_Arg&& __arg) noexcept(
+ is_nothrow_assignable_v<_Tp&, _Arg> &&
+ is_nothrow_constructible_v<_Tp, _Arg>) {
+ __impl.template __assign<_Ip>(_VSTD::forward<_Arg>(__arg));
+ return *this;
+ }
+
+ template <
+ size_t _Ip,
+ class... _Args,
+ enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
+ class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
+ enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ _Tp& emplace(_Args&&... __args) {
+ return __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
+ }
+
+ template <
+ size_t _Ip,
+ class _Up,
+ class... _Args,
+ enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
+ class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
+ enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
+ return __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
+ }
+
+ template <
+ class _Tp,
+ class... _Args,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ _Tp& emplace(_Args&&... __args) {
+ return __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
+ }
+
+ template <
+ class _Tp,
+ class _Up,
+ class... _Args,
+ size_t _Ip =
+ __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
+ enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
+ return __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr bool valueless_by_exception() const noexcept {
+ return __impl.valueless_by_exception();
+ }
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ constexpr size_t index() const noexcept { return __impl.index(); }
+
+ template <
+ bool _Dummy = true,
+ enable_if_t<
+ __all<(
+ __dependent_type<is_move_constructible<_Types>, _Dummy>::value &&
+ __dependent_type<is_swappable<_Types>, _Dummy>::value)...>::value,
+ int> = 0>
+ inline _LIBCPP_INLINE_VISIBILITY
+ void swap(variant& __that) noexcept(
+ __all<(is_nothrow_move_constructible_v<_Types> &&
+ is_nothrow_swappable_v<_Types>)...>::value) {
+ __impl.__swap(__that.__impl);
+ }
+
+private:
+ __variant_detail::__impl<_Types...> __impl;
+
+ friend struct __variant_detail::__access::__variant;
+ friend struct __variant_detail::__visitation::__variant;
+};
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool __holds_alternative(const variant<_Types...>& __v) noexcept {
+ return __v.index() == _Ip;
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool holds_alternative(const variant<_Types...>& __v) noexcept {
+ return __holds_alternative<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <size_t _Ip, class _Vp>
+inline _LIBCPP_INLINE_VISIBILITY
+static constexpr auto&& __generic_get(_Vp&& __v) {
+ using __variant_detail::__access::__variant;
+ if (!__holds_alternative<_Ip>(__v)) {
+ __throw_bad_variant_access();
+ }
+ return __variant::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v)).__value;
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr variant_alternative_t<_Ip, variant<_Types...>>& get(
+ variant<_Types...>& __v) {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get<_Ip>(__v);
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr variant_alternative_t<_Ip, variant<_Types...>>&& get(
+ variant<_Types...>&& __v) {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get<_Ip>(_VSTD::move(__v));
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr const variant_alternative_t<_Ip, variant<_Types...>>& get(
+ const variant<_Types...>& __v) {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get<_Ip>(__v);
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr const variant_alternative_t<_Ip, variant<_Types...>>&& get(
+ const variant<_Types...>&& __v) {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get<_Ip>(_VSTD::move(__v));
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Tp& get(variant<_Types...>& __v) {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Tp&& get(variant<_Types...>&& __v) {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get<__find_exactly_one_t<_Tp, _Types...>::value>(
+ _VSTD::move(__v));
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr const _Tp& get(const variant<_Types...>& __v) {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr const _Tp&& get(const variant<_Types...>&& __v) {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get<__find_exactly_one_t<_Tp, _Types...>::value>(
+ _VSTD::move(__v));
+}
+
+template <size_t _Ip, class _Vp>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr auto* __generic_get_if(_Vp* __v) noexcept {
+ using __variant_detail::__access::__variant;
+ return __v && __holds_alternative<_Ip>(*__v)
+ ? _VSTD::addressof(__variant::__get_alt<_Ip>(*__v).__value)
+ : nullptr;
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr add_pointer_t<variant_alternative_t<_Ip, variant<_Types...>>>
+get_if(variant<_Types...>* __v) noexcept {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get_if<_Ip>(__v);
+}
+
+template <size_t _Ip, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr add_pointer_t<const variant_alternative_t<_Ip, variant<_Types...>>>
+get_if(const variant<_Types...>* __v) noexcept {
+ static_assert(_Ip < sizeof...(_Types));
+ static_assert(!is_void_v<variant_alternative_t<_Ip, variant<_Types...>>>);
+ return __generic_get_if<_Ip>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr add_pointer_t<_Tp>
+get_if(variant<_Types...>* __v) noexcept {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class _Tp, class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr add_pointer_t<const _Tp>
+get_if(const variant<_Types...>* __v) noexcept {
+ static_assert(!is_void_v<_Tp>);
+ return _VSTD::get_if<__find_exactly_one_t<_Tp, _Types...>::value>(__v);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator==(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__lhs.index() != __rhs.index()) return false;
+ if (__lhs.valueless_by_exception()) return true;
+ return __variant::__visit_value_at(__lhs.index(), equal_to<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator!=(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__lhs.index() != __rhs.index()) return true;
+ if (__lhs.valueless_by_exception()) return false;
+ return __variant::__visit_value_at(
+ __lhs.index(), not_equal_to<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__rhs.valueless_by_exception()) return false;
+ if (__lhs.valueless_by_exception()) return true;
+ if (__lhs.index() < __rhs.index()) return true;
+ if (__lhs.index() > __rhs.index()) return false;
+ return __variant::__visit_value_at(__lhs.index(), less<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__lhs.valueless_by_exception()) return false;
+ if (__rhs.valueless_by_exception()) return true;
+ if (__lhs.index() > __rhs.index()) return true;
+ if (__lhs.index() < __rhs.index()) return false;
+ return __variant::__visit_value_at(__lhs.index(), greater<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<=(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__lhs.valueless_by_exception()) return true;
+ if (__rhs.valueless_by_exception()) return false;
+ if (__lhs.index() < __rhs.index()) return true;
+ if (__lhs.index() > __rhs.index()) return false;
+ return __variant::__visit_value_at(
+ __lhs.index(), less_equal<>{}, __lhs, __rhs);
+}
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>=(const variant<_Types...>& __lhs,
+ const variant<_Types...>& __rhs) {
+ using __variant_detail::__visitation::__variant;
+ if (__rhs.valueless_by_exception()) return true;
+ if (__lhs.valueless_by_exception()) return false;
+ if (__lhs.index() > __rhs.index()) return true;
+ if (__lhs.index() < __rhs.index()) return false;
+ return __variant::__visit_value_at(
+ __lhs.index(), greater_equal<>{}, __lhs, __rhs);
+}
+
+template <class _Visitor, class... _Vs>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
+ using __variant_detail::__visitation::__variant;
+ bool __results[] = {__vs.valueless_by_exception()...};
+ for (bool __result : __results) {
+ if (__result) {
+ __throw_bad_variant_access();
+ }
+ }
+ return __variant::__visit_value(_VSTD::forward<_Visitor>(__visitor),
+ _VSTD::forward<_Vs>(__vs)...);
+}
+
+struct _LIBCPP_TEMPLATE_VIS monostate {};
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<(monostate, monostate) noexcept { return false; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>(monostate, monostate) noexcept { return false; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator<=(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator>=(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator==(monostate, monostate) noexcept { return true; }
+
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr bool operator!=(monostate, monostate) noexcept { return false; }
+
+template <class... _Types>
+inline _LIBCPP_INLINE_VISIBILITY
+auto swap(variant<_Types...>& __lhs,
+ variant<_Types...>& __rhs) noexcept(noexcept(__lhs.swap(__rhs)))
+ -> decltype(__lhs.swap(__rhs)) {
+ __lhs.swap(__rhs);
+}
+
+template <class... _Types>
+struct _LIBCPP_TEMPLATE_VIS hash<
+ __enable_hash_helper<variant<_Types...>, remove_const_t<_Types>...>> {
+ using argument_type = variant<_Types...>;
+ using result_type = size_t;
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ result_type operator()(const argument_type& __v) const {
+ using __variant_detail::__visitation::__variant;
+ size_t __res =
+ __v.valueless_by_exception()
+ ? 299792458 // Random value chosen by the universe upon creation
+ : __variant::__visit_alt(
+ [](const auto& __alt) {
+ using __alt_type = decay_t<decltype(__alt)>;
+ using __value_type = remove_const_t<
+ typename __alt_type::__value_type>;
+ return hash<__value_type>{}(__alt.__value);
+ },
+ __v);
+ return __hash_combine(__res, hash<size_t>{}(__v.index()));
+ }
+};
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
+ using argument_type = monostate;
+ using result_type = size_t;
+
+ inline _LIBCPP_INLINE_VISIBILITY
+ result_type operator()(const argument_type&) const _NOEXCEPT {
+ return 66740831; // return a fundamentally attractive random value.
+ }
+};
+
+#endif // _LIBCPP_STD_VER > 14
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_VARIANT
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/vector b/chromium/buildtools/third_party/libc++/trunk/include/vector
index dbc0dd32182..6759dbd8a58 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/vector
+++ b/chromium/buildtools/third_party/libc++/trunk/include/vector
@@ -99,7 +99,7 @@ public:
void push_back(const value_type& x);
void push_back(value_type&& x);
template <class... Args>
- void emplace_back(Args&&... args);
+ reference emplace_back(Args&&... args); // reference in C++17
void pop_back();
template <class... Args> iterator emplace(const_iterator position, Args&&... args);
@@ -218,7 +218,7 @@ public:
const_reference back() const;
void push_back(const value_type& x);
- template <class... Args> void emplace_back(Args&&... args); // C++14
+ template <class... Args> reference emplace_back(Args&&... args); // C++14; reference in C++17
void pop_back();
template <class... Args> iterator emplace(const_iterator position, Args&&... args); // C++14
@@ -262,6 +262,7 @@ void swap(vector<T,Allocator>& x, vector<T,Allocator>& y)
*/
#include <__config>
+#include <iosfwd> // for forward declaration of vector
#include <__bit_reference>
#include <type_traits>
#include <climits>
@@ -289,37 +290,29 @@ class __vector_base_common
{
protected:
_LIBCPP_ALWAYS_INLINE __vector_base_common() {}
- void __throw_length_error() const;
- void __throw_out_of_range() const;
+ _LIBCPP_NORETURN void __throw_length_error() const;
+ _LIBCPP_NORETURN void __throw_out_of_range() const;
};
template <bool __b>
void
__vector_base_common<__b>::__throw_length_error() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw length_error("vector");
-#else
- assert(!"vector length_error");
-#endif
+ _VSTD::__throw_length_error("vector");
}
template <bool __b>
void
__vector_base_common<__b>::__throw_out_of_range() const
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw out_of_range("vector");
-#else
- assert(!"vector out_of_range");
-#endif
+ _VSTD::__throw_out_of_range("vector");
}
#ifdef _LIBCPP_MSVC
#pragma warning( push )
#pragma warning( disable: 4231 )
#endif // _LIBCPP_MSVC
-_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS __vector_base_common<true>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __vector_base_common<true>)
#ifdef _LIBCPP_MSVC
#pragma warning( pop )
#endif // _LIBCPP_MSVC
@@ -420,8 +413,10 @@ inline _LIBCPP_INLINE_VISIBILITY
void
__vector_base<_Tp, _Allocator>::__destruct_at_end(pointer __new_last) _NOEXCEPT
{
- while (__new_last != __end_)
- __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(--__end_));
+ pointer __soon_to_be_end = __end_;
+ while (__new_last != __soon_to_be_end)
+ __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(--__soon_to_be_end));
+ __end_ = __new_last;
}
template <class _Tp, class _Allocator>
@@ -453,8 +448,8 @@ __vector_base<_Tp, _Allocator>::~__vector_base()
}
}
-template <class _Tp, class _Allocator = allocator<_Tp> >
-class _LIBCPP_TYPE_VIS_ONLY vector
+template <class _Tp, class _Allocator /* = allocator<_Tp> */>
+class _LIBCPP_TEMPLATE_VIS vector
: private __vector_base<_Tp, _Allocator>
{
private:
@@ -532,12 +527,7 @@ public:
is_constructible<
value_type,
typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
- _LIBCPP_INLINE_VISIBILITY
- vector(initializer_list<value_type> __il);
- _LIBCPP_INLINE_VISIBILITY
- vector(initializer_list<value_type> __il, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_INLINE_VISIBILITY
~vector()
@@ -550,7 +540,14 @@ public:
vector(const vector& __x, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
vector& operator=(const vector& __x);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_CXX03_LANG
+ _LIBCPP_INLINE_VISIBILITY
+ vector(initializer_list<value_type> __il);
+
+ _LIBCPP_INLINE_VISIBILITY
+ vector(initializer_list<value_type> __il, const allocator_type& __a);
+
_LIBCPP_INLINE_VISIBILITY
vector(vector&& __x)
#if _LIBCPP_STD_VER > 14
@@ -558,17 +555,18 @@ public:
#else
_NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
#endif
+
_LIBCPP_INLINE_VISIBILITY
vector(vector&& __x, const allocator_type& __a);
_LIBCPP_INLINE_VISIBILITY
vector& operator=(vector&& __x)
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
_LIBCPP_INLINE_VISIBILITY
vector& operator=(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end()); return *this;}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#endif // !_LIBCPP_CXX03_LANG
template <class _InputIterator>
typename enable_if
@@ -593,11 +591,12 @@ public:
assign(_ForwardIterator __first, _ForwardIterator __last);
void assign(size_type __n, const_reference __u);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void assign(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const _NOEXCEPT
@@ -681,25 +680,30 @@ public:
{return _VSTD::__to_raw_pointer(this->__begin_);}
_LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
-#ifndef _LIBCPP_HAS_NO_VARIADICS
+
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
- void emplace_back(_Args&&... __args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_STD_VER > 14
+ reference emplace_back(_Args&&... __args);
+#else
+ void emplace_back(_Args&&... __args);
+#endif
+#endif // !_LIBCPP_CXX03_LANG
+
_LIBCPP_INLINE_VISIBILITY
void pop_back();
iterator insert(const_iterator __position, const_reference __x);
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_CXX03_LANG
iterator insert(const_iterator __position, value_type&& __x);
-#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
iterator emplace(const_iterator __position, _Args&&... __args);
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // !_LIBCPP_CXX03_LANG
+
iterator insert(const_iterator __position, size_type __n, const_reference __x);
template <class _InputIterator>
typename enable_if
@@ -722,11 +726,12 @@ public:
iterator
>::type
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __position, initializer_list<value_type> __il)
{return insert(__position, __il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif
_LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
iterator erase(const_iterator __first, const_iterator __last);
@@ -745,9 +750,9 @@ public:
void swap(vector&)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT;
+ _NOEXCEPT_DEBUG;
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
@@ -764,6 +769,7 @@ public:
private:
_LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
+ _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(pointer __new_last);
void allocate(size_type __n);
void deallocate() _NOEXCEPT;
_LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
@@ -793,65 +799,59 @@ private:
_LIBCPP_INLINE_VISIBILITY
void __destruct_at_end(pointer __new_last) _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- __c_node* __c = __get_db()->__find_c_and_lock(this);
- for (__i_node** __p = __c->end_; __p != __c->beg_; )
- {
- --__p;
- const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
- if (__i->base() > __new_last)
- {
- (*__p)->__c_ = nullptr;
- if (--__c->end_ != __p)
- memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
- }
- }
- __get_db()->unlock();
-#endif
+ __invalidate_iterators_past(__new_last);
size_type __old_size = size();
__base::__destruct_at_end(__new_last);
__annotate_shrink(__old_size);
}
- template <class _Up>
- void
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- __push_back_slow_path(_Up&& __x);
-#else
- __push_back_slow_path(_Up& __x);
-#endif
-#if !defined(_LIBCPP_HAS_NO_VARIADICS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _Up> void __push_back_slow_path(_Up&& __x);
+
template <class... _Args>
- void
- __emplace_back_slow_path(_Args&&... __args);
+ void __emplace_back_slow_path(_Args&&... __args);
+#else
+ template <class _Up> void __push_back_slow_path(_Up& __x);
#endif
+
// The following functions are no-ops outside of AddressSanitizer mode.
// We call annotatations only for the default Allocator because other allocators
// may not meet the AddressSanitizer alignment constraints.
// See the documentation for __sanitizer_annotate_contiguous_container for more details.
- void __annotate_contiguous_container
- (const void *__beg, const void *__end, const void *__old_mid, const void *__new_mid) const
- {
#ifndef _LIBCPP_HAS_NO_ASAN
+ void __annotate_contiguous_container(const void *__beg, const void *__end,
+ const void *__old_mid,
+ const void *__new_mid) const
+ {
+
if (__beg && is_same<allocator_type, __default_allocator_type>::value)
__sanitizer_annotate_contiguous_container(__beg, __end, __old_mid, __new_mid);
-#endif
}
-
- void __annotate_new(size_type __current_size) const
- {
+#else
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_contiguous_container(const void*, const void*, const void*,
+ const void*) const {}
+#endif
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_new(size_type __current_size) const {
__annotate_contiguous_container(data(), data() + capacity(),
data() + capacity(), data() + __current_size);
}
- void __annotate_delete() const
- {
+
+ _LIBCPP_INLINE_VISIBILITY
+ void __annotate_delete() const {
__annotate_contiguous_container(data(), data() + capacity(),
data() + size(), data() + capacity());
}
+
+ _LIBCPP_INLINE_VISIBILITY
void __annotate_increase(size_type __n) const
{
__annotate_contiguous_container(data(), data() + capacity(),
data() + size(), data() + size() + __n);
}
+
+ _LIBCPP_INLINE_VISIBILITY
void __annotate_shrink(size_type __old_size) const
{
__annotate_contiguous_container(data(), data() + capacity(),
@@ -876,8 +876,9 @@ private:
};
#else
struct __RAII_IncreaseAnnotator {
- inline __RAII_IncreaseAnnotator(const vector &, size_type __n = 1) {}
- inline void __done() {}
+ _LIBCPP_INLINE_VISIBILITY
+ __RAII_IncreaseAnnotator(const vector &, size_type = 1) {}
+ _LIBCPP_INLINE_VISIBILITY void __done() {}
};
#endif
@@ -948,7 +949,8 @@ template <class _Tp, class _Allocator>
typename vector<_Tp, _Allocator>::size_type
vector<_Tp, _Allocator>::max_size() const _NOEXCEPT
{
- return _VSTD::min<size_type>(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2); // end() >= begin(), always
+ return _VSTD::min<size_type>(__alloc_traits::max_size(this->__alloc()),
+ numeric_limits<difference_type>::max());
}
// Precondition: __new_size > capacity()
@@ -1221,7 +1223,7 @@ vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a)
}
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1268,8 +1270,6 @@ vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)
}
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
@@ -1299,8 +1299,6 @@ vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il, const allocat
}
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>&
@@ -1342,7 +1340,7 @@ vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
#endif
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // !_LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1410,6 +1408,7 @@ vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __las
allocate(__recommend(__new_size));
__construct_at_end(__first, __last, __new_size);
}
+ __invalidate_all_iterators();
}
template <class _Tp, class _Allocator>
@@ -1431,6 +1430,7 @@ vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
allocate(__recommend(static_cast<size_type>(__n)));
__construct_at_end(__n, __u);
}
+ __invalidate_all_iterators();
}
template <class _Tp, class _Allocator>
@@ -1562,7 +1562,7 @@ vector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
template <class _Tp, class _Allocator>
template <class _Up>
void
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
vector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x)
#else
vector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x)
@@ -1593,7 +1593,7 @@ vector<_Tp, _Allocator>::push_back(const_reference __x)
__push_back_slow_path(__x);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1613,8 +1613,6 @@ vector<_Tp, _Allocator>::push_back(value_type&& __x)
__push_back_slow_path(_VSTD::move(__x));
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Allocator>
template <class... _Args>
void
@@ -1631,7 +1629,11 @@ vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args)
template <class _Tp, class _Allocator>
template <class... _Args>
inline
+#if _LIBCPP_STD_VER > 14
+typename vector<_Tp, _Allocator>::reference
+#else
void
+#endif
vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
if (this->__end_ < this->__end_cap())
@@ -1645,10 +1647,12 @@ vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
}
else
__emplace_back_slow_path(_VSTD::forward<_Args>(__args)...);
+#if _LIBCPP_STD_VER > 14
+ return this->back();
+#endif
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // !_LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
inline
@@ -1673,8 +1677,9 @@ vector<_Tp, _Allocator>::erase(const_iterator __position)
"vector::erase(iterator) called with a non-dereferenceable iterator");
difference_type __ps = __position - cbegin();
pointer __p = this->__begin_ + __ps;
- iterator __r = __make_iter(__p);
this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
+ this->__invalidate_iterators_past(__p-1);
+ iterator __r = __make_iter(__p);
return __r;
}
@@ -1686,12 +1691,17 @@ vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
"vector::erase(iterator, iterator) called with an iterator not"
" referring to this vector");
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__last) == this,
+ "vector::erase(iterator, iterator) called with an iterator not"
+ " referring to this vector");
#endif
_LIBCPP_ASSERT(__first <= __last, "vector::erase(first, last) called with invalid range");
pointer __p = this->__begin_ + (__first - begin());
- iterator __r = __make_iter(__p);
- if (__first != __last)
+ if (__first != __last) {
this->__destruct_at_end(_VSTD::move(__p + (__last - __first), this->__end_, __p));
+ this->__invalidate_iterators_past(__p - 1);
+ }
+ iterator __r = __make_iter(__p);
return __r;
}
@@ -1747,7 +1757,7 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)
return __make_iter(__p);
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
typename vector<_Tp, _Allocator>::iterator
@@ -1786,8 +1796,6 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)
return __make_iter(__p);
}
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
template <class _Tp, class _Allocator>
template <class... _Args>
typename vector<_Tp, _Allocator>::iterator
@@ -1811,9 +1819,9 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
}
else
{
- value_type __tmp(_VSTD::forward<_Args>(__args)...);
+ __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
__move_range(__p, this->__end_, __p + 1);
- *__p = _VSTD::move(__tmp);
+ *__p = _VSTD::move(__tmp.get());
}
__annotator.__done();
}
@@ -1827,8 +1835,7 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
return __make_iter(__p);
}
-#endif // _LIBCPP_HAS_NO_VARIADICS
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // !_LIBCPP_CXX03_LANG
template <class _Tp, class _Allocator>
typename vector<_Tp, _Allocator>::iterator
@@ -2012,9 +2019,9 @@ template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::swap(vector& __x)
#if _LIBCPP_STD_VER >= 14
- _NOEXCEPT
+ _NOEXCEPT_DEBUG
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value)
#endif
{
@@ -2025,7 +2032,7 @@ vector<_Tp, _Allocator>::swap(vector& __x)
_VSTD::swap(this->__begin_, __x.__begin_);
_VSTD::swap(this->__end_, __x.__end_);
_VSTD::swap(this->__end_cap(), __x.__end_cap());
- __swap_allocator(this->__alloc(), __x.__alloc(),
+ __swap_allocator(this->__alloc(), __x.__alloc(),
integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->swap(this, &__x);
@@ -2097,6 +2104,28 @@ vector<_Tp, _Allocator>::__invalidate_all_iterators()
#endif // _LIBCPP_DEBUG_LEVEL >= 2
}
+
+template <class _Tp, class _Allocator>
+inline _LIBCPP_INLINE_VISIBILITY
+void
+vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ __c_node* __c = __get_db()->__find_c_and_lock(this);
+ for (__i_node** __p = __c->end_; __p != __c->beg_; ) {
+ --__p;
+ const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
+ if (__i->base() > __new_last) {
+ (*__p)->__c_ = nullptr;
+ if (--__c->end_ != __p)
+ memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
+ }
+ }
+ __get_db()->unlock();
+#else
+ ((void)__new_last);
+#endif
+}
+
// vector<bool>
template <class _Allocator> class vector<bool, _Allocator>;
@@ -2110,7 +2139,7 @@ struct __has_storage_type<vector<bool, _Allocator> >
};
template <class _Allocator>
-class _LIBCPP_TYPE_VIS_ONLY vector<bool, _Allocator>
+class _LIBCPP_TEMPLATE_VIS vector<bool, _Allocator>
: private __vector_base_common<true>
{
public:
@@ -2198,12 +2227,11 @@ public:
vector(const vector& __v);
vector(const vector& __v, const allocator_type& __a);
vector& operator=(const vector& __v);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_CXX03_LANG
vector(initializer_list<value_type> __il);
vector(initializer_list<value_type> __il, const allocator_type& __a);
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
vector(vector&& __v)
#if _LIBCPP_STD_VER > 14
@@ -2215,12 +2243,12 @@ public:
_LIBCPP_INLINE_VISIBILITY
vector& operator=(vector&& __v)
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
_LIBCPP_INLINE_VISIBILITY
vector& operator=(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end()); return *this;}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#endif // !_LIBCPP_CXX03_LANG
template <class _InputIterator>
typename enable_if
@@ -2239,11 +2267,12 @@ public:
assign(_ForwardIterator __first, _ForwardIterator __last);
void assign(size_type __n, const value_type& __x);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
void assign(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif
_LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT
{return allocator_type(this->__alloc());}
@@ -2313,8 +2342,17 @@ public:
void push_back(const value_type& __x);
#if _LIBCPP_STD_VER > 11
template <class... _Args>
- _LIBCPP_INLINE_VISIBILITY void emplace_back(_Args&&... __args)
- { push_back ( value_type ( _VSTD::forward<_Args>(__args)... )); }
+#if _LIBCPP_STD_VER > 14
+ _LIBCPP_INLINE_VISIBILITY reference emplace_back(_Args&&... __args)
+#else
+ _LIBCPP_INLINE_VISIBILITY void emplace_back(_Args&&... __args)
+#endif
+ {
+ push_back ( value_type ( _VSTD::forward<_Args>(__args)... ));
+#if _LIBCPP_STD_VER > 14
+ return this->back();
+#endif
+ }
#endif
_LIBCPP_INLINE_VISIBILITY void pop_back() {--__size_;}
@@ -2343,11 +2381,12 @@ public:
iterator
>::type
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __position, initializer_list<value_type> __il)
{return insert(__position, __il.begin(), __il.end());}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif
_LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
iterator erase(const_iterator __first, const_iterator __last);
@@ -2359,9 +2398,10 @@ public:
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT;
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value);
#endif
+ static void swap(reference __x, reference __y) _NOEXCEPT { _VSTD::swap(__x, __y); }
void resize(size_type __sz, value_type __x = false);
void flip() _NOEXCEPT;
@@ -2446,7 +2486,7 @@ private:
friend class __bit_iterator<vector, false>;
friend class __bit_iterator<vector, true>;
friend struct __bit_array<vector>;
- friend struct _LIBCPP_TYPE_VIS_ONLY hash<vector>;
+ friend struct _LIBCPP_TEMPLATE_VIS hash<vector>;
};
template <class _Allocator>
@@ -2706,7 +2746,7 @@ vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __la
}
}
-#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_CXX03_LANG
template <class _Allocator>
vector<bool, _Allocator>::vector(initializer_list<value_type> __il)
@@ -2736,7 +2776,7 @@ vector<bool, _Allocator>::vector(initializer_list<value_type> __il, const alloca
}
}
-#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#endif // _LIBCPP_CXX03_LANG
template <class _Allocator>
vector<bool, _Allocator>::~vector()
@@ -2793,7 +2833,7 @@ vector<bool, _Allocator>::operator=(const vector& __v)
return *this;
}
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_CXX03_LANG
template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -2868,7 +2908,7 @@ vector<bool, _Allocator>::__move_assign(vector& __c, true_type)
__c.__cap() = __c.__size_ = 0;
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // !_LIBCPP_CXX03_LANG
template <class _Allocator>
void
@@ -2889,6 +2929,7 @@ vector<bool, _Allocator>::assign(size_type __n, const value_type& __x)
}
_VSTD::fill_n(begin(), __n, __x);
}
+ __invalidate_all_iterators();
}
template <class _Allocator>
@@ -2916,7 +2957,9 @@ typename enable_if
vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
{
clear();
- difference_type __n = _VSTD::distance(__first, __last);
+ difference_type __ns = _VSTD::distance(__first, __last);
+ _LIBCPP_ASSERT(__ns >= 0, "invalid range specified");
+ const size_t __n = static_cast<size_type>(__ns);
if (__n)
{
if (__n > capacity())
@@ -3095,7 +3138,9 @@ typename enable_if
>::type
vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
{
- difference_type __n = _VSTD::distance(__first, __last);
+ const difference_type __n_signed = _VSTD::distance(__first, __last);
+ _LIBCPP_ASSERT(__n_signed >= 0, "invalid range specified");
+ const size_type __n = static_cast<size_type>(__n_signed);
iterator __r;
size_type __c = capacity();
if (__n <= __c && size() <= __c - __n)
@@ -3146,14 +3191,14 @@ vector<bool, _Allocator>::swap(vector& __x)
#if _LIBCPP_STD_VER >= 14
_NOEXCEPT
#else
- _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
+ _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
__is_nothrow_swappable<allocator_type>::value)
#endif
{
_VSTD::swap(this->__begin_, __x.__begin_);
_VSTD::swap(this->__size_, __x.__size_);
_VSTD::swap(this->__cap(), __x.__cap());
- __swap_allocator(this->__alloc(), __x.__alloc(),
+ __swap_allocator(this->__alloc(), __x.__alloc(),
integral_constant<bool, __alloc_traits::propagate_on_container_swap::value>());
}
@@ -3244,7 +3289,7 @@ vector<bool, _Allocator>::__hash_code() const _NOEXCEPT
}
template <class _Allocator>
-struct _LIBCPP_TYPE_VIS_ONLY hash<vector<bool, _Allocator> >
+struct _LIBCPP_TEMPLATE_VIS hash<vector<bool, _Allocator> >
: public unary_function<vector<bool, _Allocator>, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/wchar.h b/chromium/buildtools/third_party/libc++/trunk/include/wchar.h
index da34f735edf..25a318faff2 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/wchar.h
+++ b/chromium/buildtools/third_party/libc++/trunk/include/wchar.h
@@ -118,7 +118,7 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
#include_next <wchar.h>
-// Let <cwchar> know if we have const-correct overloads for wcschr and friends.
+// Determine whether we have const-correct overloads for wcschr and friends.
#if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
#elif defined(__GLIBC_PREREQ)
@@ -127,9 +127,51 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
# endif
#endif
-#if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT) || defined(__MINGW32__))
+#if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
extern "C++" {
-#include <support/win32/support.h> // pull in *swprintf defines
+inline _LIBCPP_INLINE_VISIBILITY
+wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcschr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcspbrk(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcspbrk(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcspbrk(__s1, __s2);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcsrchr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcsrchr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return __libcpp_wcsrchr(__s, __c);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcsstr(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcsstr(__s1, __s2);}
+
+inline _LIBCPP_INLINE_VISIBILITY
+wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return (wchar_t*)wmemchr(__s, __c, __n);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
+ wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
+}
+#endif
+
+#if defined(__cplusplus) && defined(_LIBCPP_MSVCRT)
+extern "C" {
+size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
+ size_t nmc, size_t len, mbstate_t *__restrict ps);
+size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
+ size_t nwc, size_t len, mbstate_t *__restrict ps);
} // extern "C++"
#endif // __cplusplus && _LIBCPP_MSVCRT
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/CMakeLists.txt b/chromium/buildtools/third_party/libc++/trunk/lib/CMakeLists.txt
index d6a35f8eba2..6161838d0df 100644
--- a/chromium/buildtools/third_party/libc++/trunk/lib/CMakeLists.txt
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/CMakeLists.txt
@@ -6,7 +6,7 @@ if(WIN32)
file(GLOB LIBCXX_WIN32_SOURCES ../src/support/win32/*.cpp)
list(APPEND LIBCXX_SOURCES ${LIBCXX_WIN32_SOURCES})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
- file(GLOB LIBCXX_SOLARIS_SOURCES ../src/support/solaris/*.c)
+ file(GLOB LIBCXX_SOLARIS_SOURCES ../src/support/solaris/*.cpp)
list(APPEND LIBCXX_SOURCES ${LIBCXX_SOLARIS_SOURCES})
endif()
@@ -28,40 +28,45 @@ if(NOT LIBCXX_INSTALL_LIBRARY)
set(exclude_from_all EXCLUDE_FROM_ALL)
endif()
-if (LIBCXX_ENABLE_SHARED)
- add_library(cxx SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
-else()
- add_library(cxx STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
-endif()
-
-if (DEFINED LIBCXX_CXX_ABI_DEPS)
- add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
-endif()
+# If LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.
+add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH
+ "${CMAKE_LIBRARY_PATH_FLAG}${LIBCXX_CXX_ABI_LIBRARY_PATH}")
-#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.
-add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
+if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
+ find_compiler_rt_library(profile LIBCXX_COVERAGE_LIBRARY)
+endif()
add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
-add_library_flags_if(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "-Wl,--whole-archive" "-Wl,-Bstatic")
-add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
-add_library_flags_if(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "-Wl,-Bdynamic" "-Wl,--no-whole-archive")
+if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
+ LIBCXX_CXX_ABI_LIBNAME STREQUAL "default"))
+ set(LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY ON)
+endif()
+
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+ add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
+ add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
+ add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
+elseif (LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY)
+ add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")
+else ()
+ add_interface_library("${LIBCXX_CXX_ABI_LIBRARY}")
+endif()
if (APPLE AND LLVM_USE_SANITIZER)
- if ("${LLVM_USE_SANITIZER}" STREQUAL "Address")
+ if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
+ ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
+ ("${LLVM_USE_SANITIZER}" STREQUAL "Undefined;Address"))
set(LIBFILE "libclang_rt.asan_osx_dynamic.dylib")
elseif("${LLVM_USE_SANITIZER}" STREQUAL "Undefined")
set(LIBFILE "libclang_rt.ubsan_osx_dynamic.dylib")
+ elseif("${LLVM_USE_SANITIZER}" STREQUAL "Thread")
+ set(LIBFILE "libclang_rt.tsan_osx_dynamic.dylib")
else()
message(WARNING "LLVM_USE_SANITIZER=${LLVM_USE_SANITIZER} is not supported on OS X")
endif()
if (LIBFILE)
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=lib OUTPUT_VARIABLE LIBDIR RESULT_VARIABLE Result)
- if (NOT ${Result} EQUAL "0")
- message(FATAL "Failed to find library resource directory")
- endif()
- string(STRIP "${LIBDIR}" LIBDIR)
- set(LIBDIR "${LIBDIR}/darwin/")
+ find_compiler_rt_dir(LIBDIR)
if (NOT IS_DIRECTORY "${LIBDIR}")
message(FATAL_ERROR "Cannot find compiler-rt directory on OS X required for LLVM_USE_SANITIZER")
endif()
@@ -73,21 +78,72 @@ if (APPLE AND LLVM_USE_SANITIZER)
endif()
endif()
-# Generate library list.
+# Generate private library list.
add_library_flags_if(LIBCXX_HAS_PTHREAD_LIB pthread)
add_library_flags_if(LIBCXX_HAS_C_LIB c)
add_library_flags_if(LIBCXX_HAS_M_LIB m)
add_library_flags_if(LIBCXX_HAS_RT_LIB rt)
-add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)
+if (LIBCXX_USE_COMPILER_RT)
+ find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
+ add_library_flags_if(LIBCXX_BUILTINS_LIBRARY "${LIBCXX_BUILTINS_LIBRARY}")
+else()
+ add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)
+endif()
+add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic)
+
+# Add the unwinder library.
+if (LIBCXXABI_USE_LLVM_UNWINDER)
+ if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
+ add_interface_library(unwind_shared)
+ elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
+ add_interface_library(unwind_static)
+ else()
+ add_interface_library(unwind)
+ endif()
+endif()
# Setup flags.
-add_flags_if_supported(-fPIC)
+if (NOT WIN32)
+ add_flags_if_supported(-fPIC)
+endif()
+
add_link_flags_if_supported(-nodefaultlibs)
-if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
- LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
+if (LIBCXX_TARGETING_MSVC)
+ if (LIBCXX_DEBUG_BUILD)
+ set(LIB_SUFFIX "d")
+ else()
+ set(LIB_SUFFIX "")
+ endif()
+ add_compile_flags(/Zl)
+ add_link_flags(/nodefaultlib)
+
+ add_library_flags(ucrt${LIB_SUFFIX}) # Universal C runtime
+ add_library_flags(vcruntime${LIB_SUFFIX}) # C++ runtime
+ add_library_flags(msvcrt${LIB_SUFFIX}) # C runtime startup files
+ add_library_flags(msvcprt${LIB_SUFFIX}) # C++ standard library. Required for exception_ptr internals.
+ # Required for standards-complaint wide character formatting functions
+ # (e.g. `printfw`/`scanfw`)
+ add_library_flags(iso_stdio_wide_specifiers)
+endif()
+
+if (LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY)
if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION)
- set(LIBCXX_LIBCPPABI_VERSION "2")
+ set(LIBCXX_LIBCPPABI_VERSION "2") # Default value
+ execute_process(
+ COMMAND xcrun --show-sdk-version
+ OUTPUT_VARIABLE sdk_ver
+ RESULT_VARIABLE res
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (res EQUAL 0)
+ message(STATUS "Found SDK version ${sdk_ver}")
+ string(REPLACE "10." "" sdk_ver "${sdk_ver}")
+ if (sdk_ver LESS 9)
+ set(LIBCXX_LIBCPPABI_VERSION "")
+ else()
+ set(LIBCXX_LIBCPPABI_VERSION "2")
+ endif()
+ endif()
endif()
if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
@@ -100,9 +156,9 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
"/usr/lib/libSystem.B.dylib")
else()
- if ( ${CMAKE_OSX_SYSROOT} )
- list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7)
- if (OSX_HAS_ARMV7)
+ if (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "")
+ list(FIND CMAKE_OSX_ARCHITECTURES "armv7" OSX_HAS_ARMV7)
+ if (NOT OSX_HAS_ARMV7 EQUAL -1)
set(OSX_RE_EXPORT_LINE
"${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib"
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
@@ -112,8 +168,10 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
endif()
else()
set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
+ if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
+ add_link_flags("/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi-new-delete.exp")
+ endif()
endif()
-
add_link_flags(
"-compatibility_version 1"
"-install_name /usr/lib/libc++.1.dylib"
@@ -124,48 +182,187 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
endif()
endif()
-target_link_libraries(cxx ${LIBCXX_LIBRARIES})
split_list(LIBCXX_COMPILE_FLAGS)
split_list(LIBCXX_LINK_FLAGS)
-set_target_properties(cxx
+# Add an object library that contains the compiled source files.
+add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
+if(WIN32 AND NOT MINGW)
+ target_compile_definitions(cxx_objects
+ PRIVATE
+ # Ignore the -MSC_VER mismatch, as we may build
+ # with a different compatibility version.
+ _ALLOW_MSC_VER_MISMATCH
+ # Don't check the msvcprt iterator debug levels
+ # as we will define the iterator types; libc++
+ # uses a different macro to identify the debug
+ # level.
+ _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH
+ # We are building the c++ runtime, don't pull in
+ # msvcprt.
+ _CRTBLD
+ # Don't warn on the use of "deprecated"
+ # "insecure" functions which are standards
+ # specified.
+ _CRT_SECURE_NO_WARNINGS
+ # Use the ISO conforming behaviour for conversion
+ # in printf, scanf.
+ _CRT_STDIO_ISO_WIDE_SPECIFIERS)
+endif()
+
+set_target_properties(cxx_objects
PROPERTIES
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
- LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
- OUTPUT_NAME "c++"
- VERSION "${LIBCXX_ABI_VERSION}.0"
- SOVERSION "${LIBCXX_ABI_VERSION}"
+)
+
+set(LIBCXX_TARGETS)
+
+# Build the shared library.
+if (LIBCXX_ENABLE_SHARED)
+ add_library(cxx_shared SHARED $<TARGET_OBJECTS:cxx_objects>)
+ target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
+ set_target_properties(cxx_shared
+ PROPERTIES
+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+ OUTPUT_NAME "c++"
+ VERSION "${LIBCXX_ABI_VERSION}.0"
+ SOVERSION "${LIBCXX_ABI_VERSION}"
+ )
+ list(APPEND LIBCXX_TARGETS "cxx_shared")
+ if(WIN32 AND NOT MINGW AND NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
+ # Since we most likely do not have a mt.exe replacement, disable the
+ # manifest bundling. This allows a normal cmake invocation to pass which
+ # will attempt to use the manifest tool to generate the bundled manifest
+ set_target_properties(cxx_shared PROPERTIES
+ APPEND_STRING PROPERTY LINK_FLAGS " /MANIFEST:NO")
+ endif()
+endif()
+
+# Build the static library.
+if (LIBCXX_ENABLE_STATIC)
+ add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>)
+ target_link_libraries(cxx_static ${LIBCXX_LIBRARIES})
+ set(STATIC_OUTPUT_NAME "c++")
+ if (WIN32)
+ set(STATIC_OUTPUT_NAME "libc++")
+ endif()
+ set_target_properties(cxx_static
+ PROPERTIES
+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+ OUTPUT_NAME "${STATIC_OUTPUT_NAME}"
)
+ list(APPEND LIBCXX_TARGETS "cxx_static")
+ # Attempt to merge the libc++.a archive and the ABI library archive into one.
+ if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
+ set(MERGE_ARCHIVES_SEARCH_PATHS "")
+ if (LIBCXX_CXX_ABI_LIBRARY_PATH)
+ set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
+ endif()
+ if ((TARGET ${LIBCXX_CXX_ABI_LIBRARY}) OR
+ (${LIBCXX_CXX_ABI_LIBRARY} STREQUAL "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI))
+ set(MERGE_ARCHIVES_ABI_TARGET "$<TARGET_LINKER_FILE:${LIBCXX_CXX_ABI_LIBRARY}>")
+ else()
+ set(MERGE_ARCHIVES_ABI_TARGET
+ "${CMAKE_STATIC_LIBRARY_PREFIX}${LIBCXX_CXX_ABI_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ endif()
+ add_custom_command(TARGET cxx_static POST_BUILD
+ COMMAND
+ ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/merge_archives.py
+ ARGS
+ -o $<TARGET_LINKER_FILE:cxx_static>
+ "$<TARGET_LINKER_FILE:cxx_static>"
+ "${MERGE_ARCHIVES_ABI_TARGET}"
+ "${MERGE_ARCHIVES_SEARCH_PATHS}"
+ WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
+ )
+ endif()
+endif()
+
+# Add a meta-target for both libraries.
+add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS})
+
+if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+ file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)
+ if (LIBCXX_ENABLE_FILESYSTEM)
+ file(GLOB LIBCXX_FILESYSTEM_SOURCES ../src/experimental/filesystem/*.cpp)
+ endif()
+ add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES} ${LIBCXX_FILESYSTEM_SOURCES})
+ if (LIBCXX_ENABLE_SHARED)
+ target_link_libraries(cxx_experimental cxx_shared)
+ else()
+ target_link_libraries(cxx_experimental cxx_static)
+ endif()
+
+ set(experimental_flags "${LIBCXX_COMPILE_FLAGS}")
+ check_flag_supported(-std=c++14)
+ if (NOT MSVC AND LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG)
+ string(REPLACE "-std=c++11" "-std=c++14" experimental_flags "${LIBCXX_COMPILE_FLAGS}")
+ endif()
+ set_target_properties(cxx_experimental
+ PROPERTIES
+ COMPILE_FLAGS "${experimental_flags}"
+ OUTPUT_NAME "c++experimental"
+ )
+endif()
+
+if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
+ file(GLOB LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES ../test/support/external_threads.cpp)
+
+ if (LIBCXX_ENABLE_SHARED)
+ add_library(cxx_external_threads SHARED ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES})
+ else()
+ add_library(cxx_external_threads STATIC ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES})
+ endif()
+
+ set_target_properties(cxx_external_threads
+ PROPERTIES
+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+ COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
+ OUTPUT_NAME "c++external_threads"
+ )
+endif()
+
# Generate a linker script inplace of a libc++.so symlink. Rerun this command
# after cxx builds.
-if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
# Get the name of the ABI library and handle the case where CXXABI_LIBNAME
# is a target name and not a library. Ex cxxabi_shared.
- set(SCRIPT_ABI_LIBNAME "${LIBCXX_CXX_ABI_LIBRARY}")
- if (SCRIPT_ABI_LIBNAME STREQUAL "cxxabi_shared")
- set(SCRIPT_ABI_LIBNAME "c++abi")
- endif()
+ set(LIBCXX_INTERFACE_LIBRARY_NAMES)
+ foreach(lib ${LIBCXX_INTERFACE_LIBRARIES})
+ # FIXME: Handle cxxabi_static and unwind_static.
+ if (TARGET ${lib} OR
+ (${lib} MATCHES "cxxabi(_static|_shared)?" AND HAVE_LIBCXXABI) OR
+ (${lib} MATCHES "unwind(_static|_shared)?" AND HAVE_LIBUNWIND))
+ list(APPEND LIBCXX_INTERFACE_LIBRARY_NAMES "$<TARGET_PROPERTY:${lib},OUTPUT_NAME>")
+ else()
+ list(APPEND LIBCXX_INTERFACE_LIBRARY_NAMES "${lib}")
+ endif()
+ endforeach()
+ #split_list(LIBCXX_INTERFACE_LIBRARY_NAMES)
# Generate a linker script inplace of a libc++.so symlink. Rerun this command
# after cxx builds.
- add_custom_command(TARGET cxx POST_BUILD
+ add_custom_command(TARGET cxx_shared POST_BUILD
COMMAND
- ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
+ ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script.py
ARGS
- "$<TARGET_LINKER_FILE:cxx>"
- "${SCRIPT_ABI_LIBNAME}"
+ "$<TARGET_LINKER_FILE:cxx_shared>"
+ ${LIBCXX_INTERFACE_LIBRARY_NAMES}
WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
)
endif()
if (LIBCXX_INSTALL_LIBRARY)
- install(TARGETS cxx
- LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
- ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
+ if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+ set(experimental_lib cxx_experimental)
+ endif()
+ install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
+ LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
+ ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
)
# NOTE: This install command must go after the cxx install command otherwise
# it will not be executed after the library symlinks are installed.
- if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
# Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
# after we required CMake 3.0.
install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
@@ -177,11 +374,20 @@ endif()
if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR
LIBCXX_INSTALL_HEADERS))
if(LIBCXX_INSTALL_LIBRARY)
- set(deps DEPENDS cxx)
+ set(lib_install_target cxx)
+ endif()
+ if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+ set(experimental_lib_install_target cxx_experimental)
+ endif()
+ if(LIBCXX_INSTALL_HEADERS)
+ set(header_install_target install-cxx-headers)
endif()
- add_custom_target(install-libcxx
- ${deps}
+ add_custom_target(install-cxx
+ DEPENDS ${lib_install_target}
+ ${experimental_lib_install_target}
+ ${header_install_target}
COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=libcxx
+ -DCMAKE_INSTALL_COMPONENT=cxx
-P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
+ add_custom_target(install-libcxx DEPENDS install-cxx)
endif()
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/3.9/x86_64-apple-darwin16.abilist b/chromium/buildtools/third_party/libc++/trunk/lib/abi/3.9/x86_64-apple-darwin16.abilist
new file mode 100644
index 00000000000..ea361e9fc44
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/3.9/x86_64-apple-darwin16.abilist
@@ -0,0 +1,2448 @@
+{'type': 'U', 'name': '__DefaultRuneLocale'}
+{'type': 'U', 'name': '__Unwind_Resume'}
+{'type': 'I', 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'U', 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'I', 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'U', 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'}
+{'type': 'I', 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'U', 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'I', 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'U', 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'I', 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'U', 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt16nested_exception14rethrow_nestedEv'}
+{'type': 'I', 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'U', 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110error_code7messageEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db15__decrementableEPKv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db15__find_c_from_iEPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db15__subscriptableEPKvl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db17__dereferenceableEPKv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db17__find_c_and_lockEPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db8__find_cEPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__111__libcpp_db9__addableEPKvl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112bad_weak_ptr4whatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEjw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEwc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__112strstreambuf6pcountEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__113random_device7entropyEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__114error_category23default_error_conditionEi'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__115error_condition7messageEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE3__XEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE3__cEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE3__rEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE3__xEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE7__weeksEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIcE8__monthsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE3__XEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE3__cEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE3__rEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE3__xEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE7__weeksEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__time_get_c_storageIwE8__monthsEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE10do_toupperEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE8do_widenEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIcE9do_narrowEcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE10do_toupperEw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE5do_isEjw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE8do_widenEc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__15ctypeIwE9do_narrowEwc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__16locale4nameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__16locale9has_facetERNS0_2idE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__16locale9use_facetERNS0_2idE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__16localeeqERKS0_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIcE7do_hashEPKcS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17collateIwE7do_hashEPKwS3_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'}
+{'type': 'FUNC', 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18ios_base6getlocEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIcE8do_closeEl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18messagesIwE8do_closeEl'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE11do_truenameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE12do_falsenameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIcE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE11do_groupingEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE11do_truenameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE12do_falsenameEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18numpunctIwE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'}
+{'type': 'FUNC', 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'}
+{'type': 'I', 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'U', 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'I', 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'U', 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'I', 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'U', 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'I', 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'U', 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC1ERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_errorC2ERKS_'}
+{'type': 'I', 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt11logic_erroraSERKS_'}
+{'type': 'I', 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'I', 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt12experimental19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt12experimental19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt12experimental19bad_optional_accessD2Ev'}
+{'type': 'I', 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'I', 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'U', 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'I', 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'U', 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'I', 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'U', 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'I', 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'U', 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'I', 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'U', 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'I', 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'U', 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptrC1ERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptrC2ERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptrD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptrD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt13exception_ptraSERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC1ERKS_'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_errorC2ERKS_'}
+{'type': 'I', 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt13runtime_erroraSERKS_'}
+{'type': 'I', 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'I', 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'U', 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'I', 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'U', 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'I', 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'U', 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'I', 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'U', 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'I', 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'U', 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'I', 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'U', 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'I', 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'U', 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt16nested_exceptionD2Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'I', 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'U', 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_getD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110__time_putD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__110adopt_lockE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5alnumE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5alphaE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5blankE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5cntrlE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5digitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5graphE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5lowerE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5printE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5punctE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5spaceE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base5upperE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110ctype_base6xdigitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110defer_lockE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110istrstreamD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIcLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIcLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIwLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIwLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110ostrstreamD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEd'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEe'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEf'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEx'}
+{'type': 'FUNC', 'name': '__ZNSt3__110to_wstringEy'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__call_onceERVmPvPFvS2_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db10__insert_cEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db10__insert_iEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db11__insert_icEPvPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db15__iterator_copyEPvPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db16__invalidate_allEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db4swapEPvS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db9__erase_cEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_db9__erase_iEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_dbC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_dbC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_dbD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__libcpp_dbD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'}
+{'type': 'FUNC', 'name': '__ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111regex_errorD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutexD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__111timed_mutexD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__111try_to_lockE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112__do_nothingEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__get_sp_mutEPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__next_primeEm'}
+{'type': 'OBJECT', 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultC1ERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultC2ERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112__rs_defaultclEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112bad_weak_ptrD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112bad_weak_ptrD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112bad_weak_ptrD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'OBJECT', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'OBJECT', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112ctype_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112future_errorD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_1E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_2E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_3E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_4E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_5E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_6E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_7E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_8E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders2_9E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__112placeholders3_10E', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf3strEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf4swapERS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf6__initEPclS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf6freezeEb'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf8overflowEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf9pbackfailEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambuf9underflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPKal'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPKhl'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPalS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPclS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1EPhlS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC1El'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPKal'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPKhl'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPalS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPclS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2EPhlS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufC2El'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112strstreambufD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__112system_errorD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__113allocator_argE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreEli'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx'}
+{'type': 'FUNC', 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113random_deviceclEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__113shared_futureIvED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113shared_futureIvED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__113shared_futureIvEaSERKS1_'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__get_const_dbEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE'}
+{'type': 'OBJECT', 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__114__num_put_base12__format_intEPcPKcbj'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__num_put_base14__format_floatEPcPKcj'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_count12__add_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_count16__release_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_countD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_countD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114__shared_countD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114collate_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114error_categoryC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114error_categoryD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114error_categoryD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__114error_categoryD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__get_classnameEPKcb'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_structC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_structC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_structD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115__thread_structD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__115future_categoryEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcE6__initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwE6__initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115numpunct_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutexC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutexC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutexD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115recursive_mutexD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__115system_categoryEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__116generic_categoryEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state12__make_readyEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state16__on_zero_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state4copyEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state4waitEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state9__executeEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__assoc_sub_state9set_valueEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117__widen_from_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__117declare_reachableEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117iostream_categoryEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcEC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcEC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwEC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwEC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variable10notify_allEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variable10notify_oneEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variableD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__118condition_variableD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__118get_pointer_safetyEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex11lock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex13unlock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex15try_lock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__118shared_timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base11lock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base13unlock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base15try_lock_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_base8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_baseC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_mutex_baseC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count10__add_weakEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count12__add_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count14__release_weakEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count16__release_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_count4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_countD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_countD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__119__shared_weak_countD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__119__start_std_streamsE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__119__thread_local_dataEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__119declare_no_pointersEPcm'}
+{'type': 'OBJECT', 'name': '__ZNSt3__119piecewise_constructE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__120__get_collation_nameEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__120__throw_system_errorEiPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121__throw_runtime_errorEPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__121__undeclare_reachableEPv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutexD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__121recursive_timed_mutexD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__121undeclare_no_pointersEPcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__13cinE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__14cerrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__14clogE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__14coutE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'name': '__ZNSt3__14wcinE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__15alignEmmRPvRm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcE13classic_tableEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcEC1EPKjbm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcEC2EPKjbm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIcED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15ctypeIwED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutex4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutex6unlockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutexD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15mutexD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'name': '__ZNSt3__15wcerrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__15wclogE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__15wcoutE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16chrono12steady_clock3nowEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__16chrono12system_clock3nowEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvE3getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16futureIvED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16gslice6__initEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale2id5__getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale2id6__initEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale2id9__next_idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale3allE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale4noneE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale4timeE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale5ctypeE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale5facet16__on_zero_sharedEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale5facetD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale5facetD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale5facetD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale6globalERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale7classicEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale7collateE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale7numericE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16locale8__globalEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale8messagesE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__16locale8monetaryE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKS0_PKci'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1ERKS0_S2_i'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2EPKc'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKS0_PKci'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2ERKS0_S2_i'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16localeaSERKS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '__ZNSt3__16thread20hardware_concurrencyEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16thread4joinEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16thread6detachEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__16threadD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__16threadD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17collateIcE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIcED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17collateIwE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17collateIwED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE10get_futureEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvE9set_valueEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvEC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvEC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__17promiseIvED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__c_node5__addEPNS_8__i_nodeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__c_nodeD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__c_nodeD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__c_nodeD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__get_dbEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__i_nodeD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__i_nodeD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__rs_getEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__sp_mut4lockEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18__sp_mut6unlockEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base10floatfieldE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base10scientificE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base11adjustfieldE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base15sync_with_stdioEb'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base16__call_callbacksENS0_5eventE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base2inE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3appE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3ateE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3decE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3hexE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3octE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base3outE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4InitC1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4InitC2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4InitD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4InitD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4initEPv'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base4leftE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4moveERS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base4swapERS0_'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base5clearEj'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base5iwordEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base5pwordEi'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base5rightE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base5truncE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base6badbitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base6binaryE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base6eofbitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base6skipwsE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base6xallocEv'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7copyfmtERKS0_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_base7failureD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base7goodbitE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base7showposE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base8internalE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18ios_base9uppercaseE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_baseD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_baseD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18ios_baseD2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18messagesIcE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18messagesIwE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18numpunctIcE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcEC1Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcEC2Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIcED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwEC1Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwEC2Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18numpunctIwED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImE6resizeEmm'}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImEC1Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImEC2Em'}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__18valarrayImED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'OBJECT', 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'}
+{'type': 'OBJECT', 'name': '__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'name': '__ZNSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19strstreamD2Ev'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEd'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEe'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEf'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEi'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEj'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEl'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEm'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEx'}
+{'type': 'FUNC', 'name': '__ZNSt3__19to_stringEy'}
+{'type': 'FUNC', 'name': '__ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'}
+{'type': 'I', 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'I', 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'I', 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'I', 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'I', 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'U', 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'I', 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'U', 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'I', 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'U', 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'I', 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'U', 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'I', 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'U', 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'I', 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'U', 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'I', 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'U', 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'I', 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'U', 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'I', 'name': '__ZSt10unexpectedv'}
+{'type': 'U', 'name': '__ZSt10unexpectedv'}
+{'type': 'I', 'name': '__ZSt13get_terminatev'}
+{'type': 'U', 'name': '__ZSt13get_terminatev'}
+{'type': 'I', 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'U', 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'I', 'name': '__ZSt14get_unexpectedv'}
+{'type': 'U', 'name': '__ZSt14get_unexpectedv'}
+{'type': 'I', 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'U', 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'I', 'name': '__ZSt15get_new_handlerv'}
+{'type': 'U', 'name': '__ZSt15get_new_handlerv'}
+{'type': 'I', 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'U', 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'FUNC', 'name': '__ZSt17__throw_bad_allocv'}
+{'type': 'FUNC', 'name': '__ZSt17current_exceptionv'}
+{'type': 'FUNC', 'name': '__ZSt17rethrow_exceptionSt13exception_ptr'}
+{'type': 'FUNC', 'name': '__ZSt18uncaught_exceptionv'}
+{'type': 'FUNC', 'name': '__ZSt19uncaught_exceptionsv'}
+{'type': 'OBJECT', 'name': '__ZSt7nothrow', 'size': 0}
+{'type': 'I', 'name': '__ZSt9terminatev'}
+{'type': 'U', 'name': '__ZSt9terminatev'}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'I', 'name': '__ZTIDi'}
+{'type': 'U', 'name': '__ZTIDi'}
+{'type': 'I', 'name': '__ZTIDn'}
+{'type': 'U', 'name': '__ZTIDn'}
+{'type': 'I', 'name': '__ZTIDs'}
+{'type': 'U', 'name': '__ZTIDs'}
+{'type': 'OBJECT', 'name': '__ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110__time_getE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110__time_putE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111__money_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111__money_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111__money_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111__money_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__num_get_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__num_put_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__118__time_get_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__118__time_get_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__time_get_c_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__120__time_get_c_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTINSt3__19time_baseE', 'size': 0}
+{'type': 'I', 'name': '__ZTIPDi'}
+{'type': 'U', 'name': '__ZTIPDi'}
+{'type': 'I', 'name': '__ZTIPDn'}
+{'type': 'U', 'name': '__ZTIPDn'}
+{'type': 'I', 'name': '__ZTIPDs'}
+{'type': 'U', 'name': '__ZTIPDs'}
+{'type': 'I', 'name': '__ZTIPKDi'}
+{'type': 'U', 'name': '__ZTIPKDi'}
+{'type': 'I', 'name': '__ZTIPKDn'}
+{'type': 'U', 'name': '__ZTIPKDn'}
+{'type': 'I', 'name': '__ZTIPKDs'}
+{'type': 'U', 'name': '__ZTIPKDs'}
+{'type': 'I', 'name': '__ZTIPKa'}
+{'type': 'U', 'name': '__ZTIPKa'}
+{'type': 'I', 'name': '__ZTIPKb'}
+{'type': 'U', 'name': '__ZTIPKb'}
+{'type': 'I', 'name': '__ZTIPKc'}
+{'type': 'U', 'name': '__ZTIPKc'}
+{'type': 'I', 'name': '__ZTIPKd'}
+{'type': 'U', 'name': '__ZTIPKd'}
+{'type': 'I', 'name': '__ZTIPKe'}
+{'type': 'U', 'name': '__ZTIPKe'}
+{'type': 'I', 'name': '__ZTIPKf'}
+{'type': 'U', 'name': '__ZTIPKf'}
+{'type': 'I', 'name': '__ZTIPKh'}
+{'type': 'U', 'name': '__ZTIPKh'}
+{'type': 'I', 'name': '__ZTIPKi'}
+{'type': 'U', 'name': '__ZTIPKi'}
+{'type': 'I', 'name': '__ZTIPKj'}
+{'type': 'U', 'name': '__ZTIPKj'}
+{'type': 'I', 'name': '__ZTIPKl'}
+{'type': 'U', 'name': '__ZTIPKl'}
+{'type': 'I', 'name': '__ZTIPKm'}
+{'type': 'U', 'name': '__ZTIPKm'}
+{'type': 'I', 'name': '__ZTIPKs'}
+{'type': 'U', 'name': '__ZTIPKs'}
+{'type': 'I', 'name': '__ZTIPKt'}
+{'type': 'U', 'name': '__ZTIPKt'}
+{'type': 'I', 'name': '__ZTIPKv'}
+{'type': 'U', 'name': '__ZTIPKv'}
+{'type': 'I', 'name': '__ZTIPKw'}
+{'type': 'U', 'name': '__ZTIPKw'}
+{'type': 'I', 'name': '__ZTIPKx'}
+{'type': 'U', 'name': '__ZTIPKx'}
+{'type': 'I', 'name': '__ZTIPKy'}
+{'type': 'U', 'name': '__ZTIPKy'}
+{'type': 'I', 'name': '__ZTIPa'}
+{'type': 'U', 'name': '__ZTIPa'}
+{'type': 'I', 'name': '__ZTIPb'}
+{'type': 'U', 'name': '__ZTIPb'}
+{'type': 'I', 'name': '__ZTIPc'}
+{'type': 'U', 'name': '__ZTIPc'}
+{'type': 'I', 'name': '__ZTIPd'}
+{'type': 'U', 'name': '__ZTIPd'}
+{'type': 'I', 'name': '__ZTIPe'}
+{'type': 'U', 'name': '__ZTIPe'}
+{'type': 'I', 'name': '__ZTIPf'}
+{'type': 'U', 'name': '__ZTIPf'}
+{'type': 'I', 'name': '__ZTIPh'}
+{'type': 'U', 'name': '__ZTIPh'}
+{'type': 'I', 'name': '__ZTIPi'}
+{'type': 'U', 'name': '__ZTIPi'}
+{'type': 'I', 'name': '__ZTIPj'}
+{'type': 'U', 'name': '__ZTIPj'}
+{'type': 'I', 'name': '__ZTIPl'}
+{'type': 'U', 'name': '__ZTIPl'}
+{'type': 'I', 'name': '__ZTIPm'}
+{'type': 'U', 'name': '__ZTIPm'}
+{'type': 'I', 'name': '__ZTIPs'}
+{'type': 'U', 'name': '__ZTIPs'}
+{'type': 'I', 'name': '__ZTIPt'}
+{'type': 'U', 'name': '__ZTIPt'}
+{'type': 'I', 'name': '__ZTIPv'}
+{'type': 'U', 'name': '__ZTIPv'}
+{'type': 'I', 'name': '__ZTIPw'}
+{'type': 'U', 'name': '__ZTIPw'}
+{'type': 'I', 'name': '__ZTIPx'}
+{'type': 'U', 'name': '__ZTIPx'}
+{'type': 'I', 'name': '__ZTIPy'}
+{'type': 'U', 'name': '__ZTIPy'}
+{'type': 'I', 'name': '__ZTISt10bad_typeid'}
+{'type': 'U', 'name': '__ZTISt10bad_typeid'}
+{'type': 'I', 'name': '__ZTISt11logic_error'}
+{'type': 'U', 'name': '__ZTISt11logic_error'}
+{'type': 'I', 'name': '__ZTISt11range_error'}
+{'type': 'U', 'name': '__ZTISt11range_error'}
+{'type': 'I', 'name': '__ZTISt12domain_error'}
+{'type': 'U', 'name': '__ZTISt12domain_error'}
+{'type': 'I', 'name': '__ZTISt12length_error'}
+{'type': 'U', 'name': '__ZTISt12length_error'}
+{'type': 'I', 'name': '__ZTISt12out_of_range'}
+{'type': 'U', 'name': '__ZTISt12out_of_range'}
+{'type': 'I', 'name': '__ZTISt13bad_exception'}
+{'type': 'U', 'name': '__ZTISt13bad_exception'}
+{'type': 'I', 'name': '__ZTISt13runtime_error'}
+{'type': 'U', 'name': '__ZTISt13runtime_error'}
+{'type': 'I', 'name': '__ZTISt14overflow_error'}
+{'type': 'U', 'name': '__ZTISt14overflow_error'}
+{'type': 'I', 'name': '__ZTISt15underflow_error'}
+{'type': 'U', 'name': '__ZTISt15underflow_error'}
+{'type': 'I', 'name': '__ZTISt16bad_array_length'}
+{'type': 'U', 'name': '__ZTISt16bad_array_length'}
+{'type': 'I', 'name': '__ZTISt16invalid_argument'}
+{'type': 'U', 'name': '__ZTISt16invalid_argument'}
+{'type': 'OBJECT', 'name': '__ZTISt16nested_exception', 'size': 0}
+{'type': 'I', 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'U', 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'I', 'name': '__ZTISt8bad_cast'}
+{'type': 'U', 'name': '__ZTISt8bad_cast'}
+{'type': 'I', 'name': '__ZTISt9bad_alloc'}
+{'type': 'U', 'name': '__ZTISt9bad_alloc'}
+{'type': 'I', 'name': '__ZTISt9exception'}
+{'type': 'U', 'name': '__ZTISt9exception'}
+{'type': 'I', 'name': '__ZTISt9type_info'}
+{'type': 'U', 'name': '__ZTISt9type_info'}
+{'type': 'I', 'name': '__ZTIa'}
+{'type': 'U', 'name': '__ZTIa'}
+{'type': 'I', 'name': '__ZTIb'}
+{'type': 'U', 'name': '__ZTIb'}
+{'type': 'I', 'name': '__ZTIc'}
+{'type': 'U', 'name': '__ZTIc'}
+{'type': 'I', 'name': '__ZTId'}
+{'type': 'U', 'name': '__ZTId'}
+{'type': 'I', 'name': '__ZTIe'}
+{'type': 'U', 'name': '__ZTIe'}
+{'type': 'I', 'name': '__ZTIf'}
+{'type': 'U', 'name': '__ZTIf'}
+{'type': 'I', 'name': '__ZTIh'}
+{'type': 'U', 'name': '__ZTIh'}
+{'type': 'I', 'name': '__ZTIi'}
+{'type': 'U', 'name': '__ZTIi'}
+{'type': 'I', 'name': '__ZTIj'}
+{'type': 'U', 'name': '__ZTIj'}
+{'type': 'I', 'name': '__ZTIl'}
+{'type': 'U', 'name': '__ZTIl'}
+{'type': 'I', 'name': '__ZTIm'}
+{'type': 'U', 'name': '__ZTIm'}
+{'type': 'I', 'name': '__ZTIs'}
+{'type': 'U', 'name': '__ZTIs'}
+{'type': 'I', 'name': '__ZTIt'}
+{'type': 'U', 'name': '__ZTIt'}
+{'type': 'I', 'name': '__ZTIv'}
+{'type': 'U', 'name': '__ZTIv'}
+{'type': 'I', 'name': '__ZTIw'}
+{'type': 'U', 'name': '__ZTIw'}
+{'type': 'I', 'name': '__ZTIx'}
+{'type': 'U', 'name': '__ZTIx'}
+{'type': 'I', 'name': '__ZTIy'}
+{'type': 'U', 'name': '__ZTIy'}
+{'type': 'I', 'name': '__ZTSDi'}
+{'type': 'U', 'name': '__ZTSDi'}
+{'type': 'I', 'name': '__ZTSDn'}
+{'type': 'U', 'name': '__ZTSDn'}
+{'type': 'I', 'name': '__ZTSDs'}
+{'type': 'U', 'name': '__ZTSDs'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'U', 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'name': '__ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTSNSt3__19time_baseE', 'size': 0}
+{'type': 'I', 'name': '__ZTSPDi'}
+{'type': 'U', 'name': '__ZTSPDi'}
+{'type': 'I', 'name': '__ZTSPDn'}
+{'type': 'U', 'name': '__ZTSPDn'}
+{'type': 'I', 'name': '__ZTSPDs'}
+{'type': 'U', 'name': '__ZTSPDs'}
+{'type': 'I', 'name': '__ZTSPKDi'}
+{'type': 'U', 'name': '__ZTSPKDi'}
+{'type': 'I', 'name': '__ZTSPKDn'}
+{'type': 'U', 'name': '__ZTSPKDn'}
+{'type': 'I', 'name': '__ZTSPKDs'}
+{'type': 'U', 'name': '__ZTSPKDs'}
+{'type': 'I', 'name': '__ZTSPKa'}
+{'type': 'U', 'name': '__ZTSPKa'}
+{'type': 'I', 'name': '__ZTSPKb'}
+{'type': 'U', 'name': '__ZTSPKb'}
+{'type': 'I', 'name': '__ZTSPKc'}
+{'type': 'U', 'name': '__ZTSPKc'}
+{'type': 'I', 'name': '__ZTSPKd'}
+{'type': 'U', 'name': '__ZTSPKd'}
+{'type': 'I', 'name': '__ZTSPKe'}
+{'type': 'U', 'name': '__ZTSPKe'}
+{'type': 'I', 'name': '__ZTSPKf'}
+{'type': 'U', 'name': '__ZTSPKf'}
+{'type': 'I', 'name': '__ZTSPKh'}
+{'type': 'U', 'name': '__ZTSPKh'}
+{'type': 'I', 'name': '__ZTSPKi'}
+{'type': 'U', 'name': '__ZTSPKi'}
+{'type': 'I', 'name': '__ZTSPKj'}
+{'type': 'U', 'name': '__ZTSPKj'}
+{'type': 'I', 'name': '__ZTSPKl'}
+{'type': 'U', 'name': '__ZTSPKl'}
+{'type': 'I', 'name': '__ZTSPKm'}
+{'type': 'U', 'name': '__ZTSPKm'}
+{'type': 'I', 'name': '__ZTSPKs'}
+{'type': 'U', 'name': '__ZTSPKs'}
+{'type': 'I', 'name': '__ZTSPKt'}
+{'type': 'U', 'name': '__ZTSPKt'}
+{'type': 'I', 'name': '__ZTSPKv'}
+{'type': 'U', 'name': '__ZTSPKv'}
+{'type': 'I', 'name': '__ZTSPKw'}
+{'type': 'U', 'name': '__ZTSPKw'}
+{'type': 'I', 'name': '__ZTSPKx'}
+{'type': 'U', 'name': '__ZTSPKx'}
+{'type': 'I', 'name': '__ZTSPKy'}
+{'type': 'U', 'name': '__ZTSPKy'}
+{'type': 'I', 'name': '__ZTSPa'}
+{'type': 'U', 'name': '__ZTSPa'}
+{'type': 'I', 'name': '__ZTSPb'}
+{'type': 'U', 'name': '__ZTSPb'}
+{'type': 'I', 'name': '__ZTSPc'}
+{'type': 'U', 'name': '__ZTSPc'}
+{'type': 'I', 'name': '__ZTSPd'}
+{'type': 'U', 'name': '__ZTSPd'}
+{'type': 'I', 'name': '__ZTSPe'}
+{'type': 'U', 'name': '__ZTSPe'}
+{'type': 'I', 'name': '__ZTSPf'}
+{'type': 'U', 'name': '__ZTSPf'}
+{'type': 'I', 'name': '__ZTSPh'}
+{'type': 'U', 'name': '__ZTSPh'}
+{'type': 'I', 'name': '__ZTSPi'}
+{'type': 'U', 'name': '__ZTSPi'}
+{'type': 'I', 'name': '__ZTSPj'}
+{'type': 'U', 'name': '__ZTSPj'}
+{'type': 'I', 'name': '__ZTSPl'}
+{'type': 'U', 'name': '__ZTSPl'}
+{'type': 'I', 'name': '__ZTSPm'}
+{'type': 'U', 'name': '__ZTSPm'}
+{'type': 'I', 'name': '__ZTSPs'}
+{'type': 'U', 'name': '__ZTSPs'}
+{'type': 'I', 'name': '__ZTSPt'}
+{'type': 'U', 'name': '__ZTSPt'}
+{'type': 'I', 'name': '__ZTSPv'}
+{'type': 'U', 'name': '__ZTSPv'}
+{'type': 'I', 'name': '__ZTSPw'}
+{'type': 'U', 'name': '__ZTSPw'}
+{'type': 'I', 'name': '__ZTSPx'}
+{'type': 'U', 'name': '__ZTSPx'}
+{'type': 'I', 'name': '__ZTSPy'}
+{'type': 'U', 'name': '__ZTSPy'}
+{'type': 'I', 'name': '__ZTSSt10bad_typeid'}
+{'type': 'U', 'name': '__ZTSSt10bad_typeid'}
+{'type': 'I', 'name': '__ZTSSt11logic_error'}
+{'type': 'U', 'name': '__ZTSSt11logic_error'}
+{'type': 'I', 'name': '__ZTSSt11range_error'}
+{'type': 'U', 'name': '__ZTSSt11range_error'}
+{'type': 'I', 'name': '__ZTSSt12domain_error'}
+{'type': 'U', 'name': '__ZTSSt12domain_error'}
+{'type': 'I', 'name': '__ZTSSt12length_error'}
+{'type': 'U', 'name': '__ZTSSt12length_error'}
+{'type': 'I', 'name': '__ZTSSt12out_of_range'}
+{'type': 'U', 'name': '__ZTSSt12out_of_range'}
+{'type': 'I', 'name': '__ZTSSt13bad_exception'}
+{'type': 'U', 'name': '__ZTSSt13bad_exception'}
+{'type': 'I', 'name': '__ZTSSt13runtime_error'}
+{'type': 'U', 'name': '__ZTSSt13runtime_error'}
+{'type': 'I', 'name': '__ZTSSt14overflow_error'}
+{'type': 'U', 'name': '__ZTSSt14overflow_error'}
+{'type': 'I', 'name': '__ZTSSt15underflow_error'}
+{'type': 'U', 'name': '__ZTSSt15underflow_error'}
+{'type': 'I', 'name': '__ZTSSt16bad_array_length'}
+{'type': 'U', 'name': '__ZTSSt16bad_array_length'}
+{'type': 'I', 'name': '__ZTSSt16invalid_argument'}
+{'type': 'U', 'name': '__ZTSSt16invalid_argument'}
+{'type': 'OBJECT', 'name': '__ZTSSt16nested_exception', 'size': 0}
+{'type': 'I', 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'U', 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'I', 'name': '__ZTSSt8bad_cast'}
+{'type': 'U', 'name': '__ZTSSt8bad_cast'}
+{'type': 'I', 'name': '__ZTSSt9bad_alloc'}
+{'type': 'U', 'name': '__ZTSSt9bad_alloc'}
+{'type': 'I', 'name': '__ZTSSt9exception'}
+{'type': 'U', 'name': '__ZTSSt9exception'}
+{'type': 'I', 'name': '__ZTSSt9type_info'}
+{'type': 'U', 'name': '__ZTSSt9type_info'}
+{'type': 'I', 'name': '__ZTSa'}
+{'type': 'U', 'name': '__ZTSa'}
+{'type': 'I', 'name': '__ZTSb'}
+{'type': 'U', 'name': '__ZTSb'}
+{'type': 'I', 'name': '__ZTSc'}
+{'type': 'U', 'name': '__ZTSc'}
+{'type': 'I', 'name': '__ZTSd'}
+{'type': 'U', 'name': '__ZTSd'}
+{'type': 'I', 'name': '__ZTSe'}
+{'type': 'U', 'name': '__ZTSe'}
+{'type': 'I', 'name': '__ZTSf'}
+{'type': 'U', 'name': '__ZTSf'}
+{'type': 'I', 'name': '__ZTSh'}
+{'type': 'U', 'name': '__ZTSh'}
+{'type': 'I', 'name': '__ZTSi'}
+{'type': 'U', 'name': '__ZTSi'}
+{'type': 'I', 'name': '__ZTSj'}
+{'type': 'U', 'name': '__ZTSj'}
+{'type': 'I', 'name': '__ZTSl'}
+{'type': 'U', 'name': '__ZTSl'}
+{'type': 'I', 'name': '__ZTSm'}
+{'type': 'U', 'name': '__ZTSm'}
+{'type': 'I', 'name': '__ZTSs'}
+{'type': 'U', 'name': '__ZTSs'}
+{'type': 'I', 'name': '__ZTSt'}
+{'type': 'U', 'name': '__ZTSt'}
+{'type': 'I', 'name': '__ZTSv'}
+{'type': 'U', 'name': '__ZTSv'}
+{'type': 'I', 'name': '__ZTSw'}
+{'type': 'U', 'name': '__ZTSw'}
+{'type': 'I', 'name': '__ZTSx'}
+{'type': 'U', 'name': '__ZTSx'}
+{'type': 'I', 'name': '__ZTSy'}
+{'type': 'U', 'name': '__ZTSy'}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTTNSt3__19strstreamE', 'size': 0}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'U', 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'name': '__ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'name': '__ZTVNSt3__19strstreamE', 'size': 0}
+{'type': 'I', 'name': '__ZTVSt10bad_typeid'}
+{'type': 'U', 'name': '__ZTVSt10bad_typeid'}
+{'type': 'I', 'name': '__ZTVSt11logic_error'}
+{'type': 'U', 'name': '__ZTVSt11logic_error'}
+{'type': 'I', 'name': '__ZTVSt11range_error'}
+{'type': 'U', 'name': '__ZTVSt11range_error'}
+{'type': 'I', 'name': '__ZTVSt12domain_error'}
+{'type': 'U', 'name': '__ZTVSt12domain_error'}
+{'type': 'I', 'name': '__ZTVSt12length_error'}
+{'type': 'U', 'name': '__ZTVSt12length_error'}
+{'type': 'I', 'name': '__ZTVSt12out_of_range'}
+{'type': 'U', 'name': '__ZTVSt12out_of_range'}
+{'type': 'I', 'name': '__ZTVSt13bad_exception'}
+{'type': 'U', 'name': '__ZTVSt13bad_exception'}
+{'type': 'I', 'name': '__ZTVSt13runtime_error'}
+{'type': 'U', 'name': '__ZTVSt13runtime_error'}
+{'type': 'I', 'name': '__ZTVSt14overflow_error'}
+{'type': 'U', 'name': '__ZTVSt14overflow_error'}
+{'type': 'I', 'name': '__ZTVSt15underflow_error'}
+{'type': 'U', 'name': '__ZTVSt15underflow_error'}
+{'type': 'I', 'name': '__ZTVSt16bad_array_length'}
+{'type': 'U', 'name': '__ZTVSt16bad_array_length'}
+{'type': 'I', 'name': '__ZTVSt16invalid_argument'}
+{'type': 'U', 'name': '__ZTVSt16invalid_argument'}
+{'type': 'OBJECT', 'name': '__ZTVSt16nested_exception', 'size': 0}
+{'type': 'I', 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'U', 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'I', 'name': '__ZTVSt8bad_cast'}
+{'type': 'U', 'name': '__ZTVSt8bad_cast'}
+{'type': 'I', 'name': '__ZTVSt9bad_alloc'}
+{'type': 'U', 'name': '__ZTVSt9bad_alloc'}
+{'type': 'I', 'name': '__ZTVSt9exception'}
+{'type': 'U', 'name': '__ZTVSt9exception'}
+{'type': 'I', 'name': '__ZTVSt9type_info'}
+{'type': 'U', 'name': '__ZTVSt9type_info'}
+{'type': 'FUNC', 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZThn16_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZThn16_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '__ZTv0_n24_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '__ZdaPv'}
+{'type': 'FUNC', 'name': '__ZdaPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '__ZdaPvm'}
+{'type': 'FUNC', 'name': '__ZdlPv'}
+{'type': 'FUNC', 'name': '__ZdlPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '__ZdlPvm'}
+{'type': 'FUNC', 'name': '__Znam'}
+{'type': 'FUNC', 'name': '__ZnamRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '__Znwm'}
+{'type': 'FUNC', 'name': '__ZnwmRKSt9nothrow_t'}
+{'type': 'U', 'name': '____mb_cur_max_l'}
+{'type': 'U', 'name': '____tolower_l'}
+{'type': 'U', 'name': '____toupper_l'}
+{'type': 'U', 'name': '___assert_rtn'}
+{'type': 'U', 'name': '___bzero'}
+{'type': 'I', 'name': '___cxa_allocate_exception'}
+{'type': 'U', 'name': '___cxa_allocate_exception'}
+{'type': 'U', 'name': '___cxa_atexit'}
+{'type': 'I', 'name': '___cxa_bad_cast'}
+{'type': 'U', 'name': '___cxa_bad_cast'}
+{'type': 'I', 'name': '___cxa_bad_typeid'}
+{'type': 'U', 'name': '___cxa_bad_typeid'}
+{'type': 'I', 'name': '___cxa_begin_catch'}
+{'type': 'U', 'name': '___cxa_begin_catch'}
+{'type': 'I', 'name': '___cxa_call_unexpected'}
+{'type': 'U', 'name': '___cxa_call_unexpected'}
+{'type': 'I', 'name': '___cxa_current_exception_type'}
+{'type': 'U', 'name': '___cxa_current_exception_type'}
+{'type': 'U', 'name': '___cxa_current_primary_exception'}
+{'type': 'U', 'name': '___cxa_decrement_exception_refcount'}
+{'type': 'I', 'name': '___cxa_demangle'}
+{'type': 'U', 'name': '___cxa_demangle'}
+{'type': 'I', 'name': '___cxa_end_catch'}
+{'type': 'U', 'name': '___cxa_end_catch'}
+{'type': 'I', 'name': '___cxa_free_exception'}
+{'type': 'U', 'name': '___cxa_free_exception'}
+{'type': 'I', 'name': '___cxa_get_exception_ptr'}
+{'type': 'U', 'name': '___cxa_get_exception_ptr'}
+{'type': 'I', 'name': '___cxa_get_globals'}
+{'type': 'U', 'name': '___cxa_get_globals'}
+{'type': 'I', 'name': '___cxa_get_globals_fast'}
+{'type': 'U', 'name': '___cxa_get_globals_fast'}
+{'type': 'I', 'name': '___cxa_guard_abort'}
+{'type': 'U', 'name': '___cxa_guard_abort'}
+{'type': 'I', 'name': '___cxa_guard_acquire'}
+{'type': 'U', 'name': '___cxa_guard_acquire'}
+{'type': 'I', 'name': '___cxa_guard_release'}
+{'type': 'U', 'name': '___cxa_guard_release'}
+{'type': 'U', 'name': '___cxa_increment_exception_refcount'}
+{'type': 'I', 'name': '___cxa_pure_virtual'}
+{'type': 'U', 'name': '___cxa_pure_virtual'}
+{'type': 'I', 'name': '___cxa_rethrow'}
+{'type': 'U', 'name': '___cxa_rethrow'}
+{'type': 'U', 'name': '___cxa_rethrow_primary_exception'}
+{'type': 'I', 'name': '___cxa_throw'}
+{'type': 'U', 'name': '___cxa_throw'}
+{'type': 'U', 'name': '___cxa_uncaught_exception'}
+{'type': 'I', 'name': '___cxa_vec_cctor'}
+{'type': 'U', 'name': '___cxa_vec_cctor'}
+{'type': 'I', 'name': '___cxa_vec_cleanup'}
+{'type': 'U', 'name': '___cxa_vec_cleanup'}
+{'type': 'I', 'name': '___cxa_vec_ctor'}
+{'type': 'U', 'name': '___cxa_vec_ctor'}
+{'type': 'I', 'name': '___cxa_vec_delete'}
+{'type': 'U', 'name': '___cxa_vec_delete'}
+{'type': 'I', 'name': '___cxa_vec_delete2'}
+{'type': 'U', 'name': '___cxa_vec_delete2'}
+{'type': 'I', 'name': '___cxa_vec_delete3'}
+{'type': 'U', 'name': '___cxa_vec_delete3'}
+{'type': 'I', 'name': '___cxa_vec_dtor'}
+{'type': 'U', 'name': '___cxa_vec_dtor'}
+{'type': 'I', 'name': '___cxa_vec_new'}
+{'type': 'U', 'name': '___cxa_vec_new'}
+{'type': 'I', 'name': '___cxa_vec_new2'}
+{'type': 'U', 'name': '___cxa_vec_new2'}
+{'type': 'I', 'name': '___cxa_vec_new3'}
+{'type': 'U', 'name': '___cxa_vec_new3'}
+{'type': 'I', 'name': '___dynamic_cast'}
+{'type': 'U', 'name': '___dynamic_cast'}
+{'type': 'U', 'name': '___error'}
+{'type': 'I', 'name': '___gxx_personality_v0'}
+{'type': 'U', 'name': '___gxx_personality_v0'}
+{'type': 'U', 'name': '___maskrune_l'}
+{'type': 'U', 'name': '___stack_chk_fail'}
+{'type': 'U', 'name': '___stack_chk_guard'}
+{'type': 'U', 'name': '___stderrp'}
+{'type': 'U', 'name': '___stdinp'}
+{'type': 'U', 'name': '___stdoutp'}
+{'type': 'U', 'name': '_abort'}
+{'type': 'U', 'name': '_asprintf_l'}
+{'type': 'U', 'name': '_btowc_l'}
+{'type': 'U', 'name': '_calloc'}
+{'type': 'U', 'name': '_catclose'}
+{'type': 'U', 'name': '_catgets'}
+{'type': 'U', 'name': '_catopen'}
+{'type': 'U', 'name': '_clock_gettime'}
+{'type': 'U', 'name': '_close'}
+{'type': 'U', 'name': '_dlopen'}
+{'type': 'U', 'name': '_dlsym'}
+{'type': 'U', 'name': '_fflush'}
+{'type': 'U', 'name': '_fprintf'}
+{'type': 'U', 'name': '_free'}
+{'type': 'U', 'name': '_freelocale'}
+{'type': 'U', 'name': '_fwrite'}
+{'type': 'U', 'name': '_getc'}
+{'type': 'U', 'name': '_localeconv_l'}
+{'type': 'U', 'name': '_malloc'}
+{'type': 'U', 'name': '_mbrlen_l'}
+{'type': 'U', 'name': '_mbrtowc_l'}
+{'type': 'U', 'name': '_mbsnrtowcs_l'}
+{'type': 'U', 'name': '_mbsrtowcs_l'}
+{'type': 'U', 'name': '_mbtowc_l'}
+{'type': 'U', 'name': '_memchr'}
+{'type': 'U', 'name': '_memcmp'}
+{'type': 'U', 'name': '_memcpy'}
+{'type': 'U', 'name': '_memmove'}
+{'type': 'U', 'name': '_memset'}
+{'type': 'U', 'name': '_nanosleep'}
+{'type': 'U', 'name': '_newlocale'}
+{'type': 'U', 'name': '_open'}
+{'type': 'U', 'name': '_pthread_cond_broadcast'}
+{'type': 'U', 'name': '_pthread_cond_destroy'}
+{'type': 'U', 'name': '_pthread_cond_signal'}
+{'type': 'U', 'name': '_pthread_cond_timedwait'}
+{'type': 'U', 'name': '_pthread_cond_wait'}
+{'type': 'U', 'name': '_pthread_detach'}
+{'type': 'U', 'name': '_pthread_equal'}
+{'type': 'U', 'name': '_pthread_getspecific'}
+{'type': 'U', 'name': '_pthread_join'}
+{'type': 'U', 'name': '_pthread_key_create'}
+{'type': 'U', 'name': '_pthread_mutex_destroy'}
+{'type': 'U', 'name': '_pthread_mutex_init'}
+{'type': 'U', 'name': '_pthread_mutex_lock'}
+{'type': 'U', 'name': '_pthread_mutex_trylock'}
+{'type': 'U', 'name': '_pthread_mutex_unlock'}
+{'type': 'U', 'name': '_pthread_mutexattr_destroy'}
+{'type': 'U', 'name': '_pthread_mutexattr_init'}
+{'type': 'U', 'name': '_pthread_mutexattr_settype'}
+{'type': 'U', 'name': '_pthread_self'}
+{'type': 'U', 'name': '_read'}
+{'type': 'U', 'name': '_realloc'}
+{'type': 'U', 'name': '_sched_yield'}
+{'type': 'U', 'name': '_setlocale'}
+{'type': 'U', 'name': '_snprintf'}
+{'type': 'U', 'name': '_snprintf_l'}
+{'type': 'U', 'name': '_sscanf'}
+{'type': 'U', 'name': '_sscanf_l'}
+{'type': 'U', 'name': '_strcmp'}
+{'type': 'U', 'name': '_strcoll_l'}
+{'type': 'U', 'name': '_strerror_r'}
+{'type': 'U', 'name': '_strftime_l'}
+{'type': 'U', 'name': '_strlen'}
+{'type': 'U', 'name': '_strtod'}
+{'type': 'U', 'name': '_strtod_l'}
+{'type': 'U', 'name': '_strtof'}
+{'type': 'U', 'name': '_strtof_l'}
+{'type': 'U', 'name': '_strtol'}
+{'type': 'U', 'name': '_strtold'}
+{'type': 'U', 'name': '_strtold_l'}
+{'type': 'U', 'name': '_strtoll'}
+{'type': 'U', 'name': '_strtoll_l'}
+{'type': 'U', 'name': '_strtoul'}
+{'type': 'U', 'name': '_strtoull'}
+{'type': 'U', 'name': '_strtoull_l'}
+{'type': 'U', 'name': '_strxfrm_l'}
+{'type': 'U', 'name': '_swprintf'}
+{'type': 'U', 'name': '_sysctl'}
+{'type': 'U', 'name': '_ungetc'}
+{'type': 'U', 'name': '_wcrtomb_l'}
+{'type': 'U', 'name': '_wcscoll_l'}
+{'type': 'U', 'name': '_wcslen'}
+{'type': 'U', 'name': '_wcsnrtombs_l'}
+{'type': 'U', 'name': '_wcstod'}
+{'type': 'U', 'name': '_wcstof'}
+{'type': 'U', 'name': '_wcstol'}
+{'type': 'U', 'name': '_wcstold'}
+{'type': 'U', 'name': '_wcstoll'}
+{'type': 'U', 'name': '_wcstoul'}
+{'type': 'U', 'name': '_wcstoull'}
+{'type': 'U', 'name': '_wcsxfrm_l'}
+{'type': 'U', 'name': '_wctob_l'}
+{'type': 'U', 'name': '_wmemchr'}
+{'type': 'U', 'name': '_wmemcmp'}
+{'type': 'U', 'name': '_wmemcpy'}
+{'type': 'U', 'name': '_wmemmove'}
+{'type': 'U', 'name': '_wmemset'}
+{'type': 'U', 'name': 'dyld_stub_binder'}
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/3.9/x86_64-linux-gnu.abilist b/chromium/buildtools/third_party/libc++/trunk/lib/abi/3.9/x86_64-linux-gnu.abilist
new file mode 100644
index 00000000000..8edeffbcd34
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/3.9/x86_64-linux-gnu.abilist
@@ -0,0 +1,2010 @@
+{'type': 'FUNC', 'name': '_Unwind_Resume@GCC_3.0'}
+{'type': 'FUNC', 'name': '_ZNKSt11logic_error4whatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt13runtime_error4whatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt16nested_exception14rethrow_nestedEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110error_code7messageEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__decrementableEPKv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__find_c_from_iEPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db15__subscriptableEPKvl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db17__dereferenceableEPKv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db17__find_c_and_lockEPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db8__find_cEPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__111__libcpp_db9__addableEPKvl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112bad_weak_ptr4whatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_scan_isEtPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE11do_scan_notEtPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pt'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEtw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEwc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__112strstreambuf6pcountEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__113random_device7entropyEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114error_category10equivalentERKNS_10error_codeEi'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__114error_category23default_error_conditionEi'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__115error_condition7messageEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__XEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__cEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__rEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE3__xEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE7__am_pmEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE7__weeksEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIcE8__monthsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__XEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__cEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__rEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE3__xEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE7__am_pmEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE7__weeksEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__time_get_c_storageIwE8__monthsEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE10do_toupperEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE8do_widenEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIcE9do_narrowEcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_scan_isEtPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE10do_toupperEw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE11do_scan_notEtPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE5do_isEPKwS3_Pt'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE5do_isEtw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE8do_widenEc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__15ctypeIwE9do_narrowEwc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__16locale4nameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__16locale9has_facetERNS0_2idE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__16locale9use_facetERNS0_2idE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__16localeeqERKS0_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIcE7do_hashEPKcS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17collateIwE7do_hashEPKwS3_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'}
+{'type': 'FUNC', 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18ios_base6getlocEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIcE8do_closeEl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18messagesIwE8do_closeEl'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE11do_truenameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE12do_falsenameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIcE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE11do_groupingEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE11do_truenameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE12do_falsenameEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE16do_decimal_pointEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18numpunctIwE16do_thousands_sepEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'}
+{'type': 'FUNC', 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC1ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorC2ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_errorD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt11logic_erroraSERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt12experimental15fundamentals_v112bad_any_castD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12experimental19bad_optional_accessD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12length_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt12out_of_rangeD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptrC1ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptrC2ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptrD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptrD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13exception_ptraSERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC1ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorC2ERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_errorD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt13runtime_erroraSERKS_'}
+{'type': 'FUNC', 'name': '_ZNSt14overflow_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16invalid_argumentD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt16nested_exceptionD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_getD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110__time_putD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__110adopt_lockE', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5alnumE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5alphaE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5blankE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5cntrlE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5digitE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5graphE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5lowerE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5printE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5punctE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5spaceE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base5upperE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110ctype_base6xdigitE', 'size': 2}
+{'type': 'OBJECT', 'name': '_ZNSt3__110defer_lockE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110istrstreamD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb0EE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb1EE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb0EE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb1EE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110ostrstreamD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEd'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEe'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEf'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEx'}
+{'type': 'FUNC', 'name': '_ZNSt3__110to_wstringEy'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__call_onceERVmPvPFvS2_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db10__insert_cEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db10__insert_iEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db11__insert_icEPvPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db15__iterator_copyEPvPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db16__invalidate_allEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db4swapEPvS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db9__erase_cEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_db9__erase_iEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__libcpp_dbD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'}
+{'type': 'FUNC', 'name': '_ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111regex_errorD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__111timed_mutexD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__111try_to_lockE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__112__do_nothingEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__get_sp_mutEPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__next_primeEm'}
+{'type': 'OBJECT', 'name': '_ZNSt3__112__rs_default4__c_E', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC1ERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC2ERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112__rs_defaultclEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112bad_weak_ptrD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'OBJECT', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 8}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPKcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendIPcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertIPKcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPcEEE4typeENSB_IS8_EESA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceIPKcEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'OBJECT', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 8}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initIPKwEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendIPwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignIPwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertIPKwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPwEEE4typeENSB_IS8_EESA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceIPKwEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112ctype_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112future_errorD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_1E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_2E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_3E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_4E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_5E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_6E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_7E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_8E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders2_9E', 'size': 1}
+{'type': 'OBJECT', 'name': '_ZNSt3__112placeholders3_10E', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf3strEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf4swapERS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf6__initEPclS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf6freezeEb'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf8overflowEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf9pbackfailEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambuf9underflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKal'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPKhl'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPalS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPclS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1EPhlS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC1El'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKal'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPKhl'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPalS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPclS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2EPhlS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufC2El'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112strstreambufD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__112system_errorD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__113allocator_argE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreElj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx'}
+{'type': 'FUNC', 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113random_deviceclEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__113shared_futureIvEaSERKS1_'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__codecvt_utf8IDiED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__codecvt_utf8IDsED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__codecvt_utf8IwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__get_const_dbEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE'}
+{'type': 'OBJECT', 'name': '_ZNSt3__114__num_get_base5__srcE', 'size': 33}
+{'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base14__format_floatEPcPKcj'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_count12__add_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_count16__release_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114__shared_countD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114collate_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114error_categoryC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__114error_categoryD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IDiLb0EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IDiLb1EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IDsLb0EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IDsLb1EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IwLb0EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__codecvt_utf16IwLb1EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__get_classnameEPKcb'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__num_get_floatIdEET_PKcS3_Rj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__num_get_floatIeEET_PKcS3_Rj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__num_get_floatIfEET_PKcS3_Rj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_structC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_structC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_structD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115__thread_structD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__115future_categoryEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcE6__initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIcED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwE6__initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115numpunct_bynameIwED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115recursive_mutexD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__115system_categoryEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__116generic_categoryEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state12__make_readyEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state16__on_zero_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state4copyEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state4waitEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state9__executeEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_state9set_valueEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_stateD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__assoc_sub_stateD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__libcpp_sscanf_lEPKcP15__locale_structS1_z'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117__widen_from_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__117declare_reachableEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117iostream_categoryEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variable10notify_allEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variable10notify_oneEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variableD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__118condition_variableD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__118get_pointer_safetyEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex11lock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex13unlock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex15try_lock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__118shared_timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__libcpp_asprintf_lEPPcP15__locale_structPKcz'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__libcpp_snprintf_lEPcmP15__locale_structPKcz'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base11lock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base13unlock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base15try_lock_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_base8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_baseC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_mutex_baseC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count10__add_weakEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count12__add_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count14__release_weakEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count16__release_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_count4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__119__shared_weak_countD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__119__start_std_streamsE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__119__thread_local_dataEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__119declare_no_pointersEPcm'}
+{'type': 'OBJECT', 'name': '_ZNSt3__119piecewise_constructE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__120__codecvt_utf8_utf16IDiED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__120__codecvt_utf8_utf16IDsED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__120__codecvt_utf8_utf16IwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__120__get_collation_nameEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__120__throw_system_errorEiPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121__throw_runtime_errorEPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__121__undeclare_reachableEPv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__121recursive_timed_mutexD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__121undeclare_no_pointersEPcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__125__num_get_signed_integralIlEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__125__num_get_signed_integralIxEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralIjEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralImEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralItEET_PKcS3_Rji'}
+{'type': 'FUNC', 'name': '_ZNSt3__127__num_get_unsigned_integralIyEET_PKcS3_Rji'}
+{'type': 'OBJECT', 'name': '_ZNSt3__13cinE', 'size': 168}
+{'type': 'OBJECT', 'name': '_ZNSt3__14cerrE', 'size': 160}
+{'type': 'OBJECT', 'name': '_ZNSt3__14clogE', 'size': 160}
+{'type': 'OBJECT', 'name': '_ZNSt3__14coutE', 'size': 160}
+{'type': 'FUNC', 'name': '_ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'name': '_ZNSt3__14wcinE', 'size': 168}
+{'type': 'FUNC', 'name': '_ZNSt3__15alignEmmRPvRm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE13classic_tableEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE21__classic_lower_tableEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcE21__classic_upper_tableEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__15ctypeIcE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcEC1EPKtbm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcEC2EPKtbm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIcED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__15ctypeIwE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15ctypeIwED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutex4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutex6unlockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutex8try_lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutexD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15mutexD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'name': '_ZNSt3__15wcerrE', 'size': 160}
+{'type': 'OBJECT', 'name': '_ZNSt3__15wclogE', 'size': 160}
+{'type': 'OBJECT', 'name': '_ZNSt3__15wcoutE', 'size': 160}
+{'type': 'FUNC', 'name': '_ZNSt3__16__clocEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16chrono12steady_clock3nowEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock11from_time_tEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock3nowEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'size': 1}
+{'type': 'FUNC', 'name': '_ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvE3getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16futureIvED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16gslice6__initEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale2id5__getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale2id6__initEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale2id9__next_idE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale3allE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale4noneE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale4timeE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale5ctypeE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale5facet16__on_zero_sharedEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale5facetD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale6globalERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale7classicEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale7collateE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale7numericE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__16locale8__globalEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale8messagesE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__16locale8monetaryE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_PKci'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1ERKS0_S2_i'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2EPKc'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_PKci'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2ERKS0_S2_i'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16localeaSERKS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'name': '_ZNSt3__16thread20hardware_concurrencyEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16thread4joinEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16thread6detachEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__16threadD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__16threadD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIaaEEPaEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'FUNC', 'name': '_ZNSt3__17__sort5IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17collateIcE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIcED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17collateIwE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17collateIwED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE10get_futureEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvE9set_valueEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvEC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvEC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__17promiseIvED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__c_node5__addEPNS_8__i_nodeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__c_nodeD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__get_dbEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__i_nodeD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__i_nodeD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__rs_getEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__sp_mut4lockEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18__sp_mut6unlockEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base10floatfieldE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base10scientificE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base11adjustfieldE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base15sync_with_stdioEb'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base16__call_callbacksENS0_5eventE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base2inE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3appE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3ateE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3decE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3hexE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3octE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base3outE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitC2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4InitD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4initEPv'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base4leftE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4moveERS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base4swapERS0_'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base5clearEj'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5fixedE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base5iwordEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base5pwordEi'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5rightE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base5truncE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6badbitE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6binaryE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6eofbitE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base6skipwsE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base6xallocEv'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7copyfmtERKS0_'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7failbitE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_base7failureD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7goodbitE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7showposE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base7unitbufE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base8internalE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base8showbaseE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9__xindex_E', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9basefieldE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9boolalphaE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9showpointE', 'size': 4}
+{'type': 'OBJECT', 'name': '_ZNSt3__18ios_base9uppercaseE', 'size': 4}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18ios_baseD2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18messagesIcE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18messagesIwE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18numpunctIcE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcEC1Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcEC2Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIcED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18numpunctIwE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwEC1Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwEC2Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18numpunctIwED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImE6resizeEmm'}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImEC1Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImEC2Em'}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__18valarrayImED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'OBJECT', 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'}
+{'type': 'OBJECT', 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'}
+{'type': 'OBJECT', 'name': '_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16}
+{'type': 'FUNC', 'name': '_ZNSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19strstreamD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEd'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEe'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEf'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEi'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEj'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEl'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEm'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEx'}
+{'type': 'FUNC', 'name': '_ZNSt3__19to_stringEy'}
+{'type': 'FUNC', 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'}
+{'type': 'FUNC', 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_'}
+{'type': 'FUNC', 'name': '_ZNSt8bad_castC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt8bad_castD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt8bad_castD2Ev'}
+{'type': 'FUNC', 'name': '_ZNSt9bad_allocC1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt9bad_allocD1Ev'}
+{'type': 'FUNC', 'name': '_ZNSt9exceptionD2Ev'}
+{'type': 'FUNC', 'name': '_ZSt15get_new_handlerv'}
+{'type': 'FUNC', 'name': '_ZSt17__throw_bad_allocv'}
+{'type': 'FUNC', 'name': '_ZSt17current_exceptionv'}
+{'type': 'FUNC', 'name': '_ZSt17rethrow_exceptionSt13exception_ptr'}
+{'type': 'FUNC', 'name': '_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_'}
+{'type': 'FUNC', 'name': '_ZSt18uncaught_exceptionv'}
+{'type': 'FUNC', 'name': '_ZSt19uncaught_exceptionsv'}
+{'type': 'OBJECT', 'name': '_ZSt7nothrow', 'size': 1}
+{'type': 'FUNC', 'name': '_ZSt9terminatev'}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120}
+{'type': 'OBJECT', 'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt12experimental19bad_optional_accessE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110__time_getE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110__time_putE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110ctype_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110istrstreamE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110money_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIcLb0EEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIcLb1EEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIwLb0EEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110moneypunctIwLb1EEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__110ostrstreamE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111__money_getIcEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111__money_getIwEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111__money_putIcEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111__money_putIwEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__111regex_errorE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112bad_weak_ptrE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112codecvt_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112ctype_bynameIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112ctype_bynameIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112future_errorE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112strstreambufE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__112system_errorE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__113messages_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IDiEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IDsEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__codecvt_utf8IwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__num_get_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__num_put_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114__shared_countE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114collate_bynameIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114collate_bynameIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__114error_categoryE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115messages_bynameIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115messages_bynameIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115numpunct_bynameIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115numpunct_bynameIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117__assoc_sub_stateE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__118__time_get_storageIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__118__time_get_storageIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__119__shared_weak_countE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__time_get_c_storageIcEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__120__time_get_c_storageIwEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__15ctypeIcEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__15ctypeIwEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__16locale5facetE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17collateIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17collateIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18__c_nodeE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18ios_base7failureE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18ios_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18messagesIcEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18messagesIwEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18numpunctIcEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18numpunctIwEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 72}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 72}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19__num_getIcEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19__num_getIwEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19__num_putIcEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19__num_putIwEE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19strstreamE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTINSt3__19time_baseE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTISt11logic_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt12length_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt12out_of_range', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt13runtime_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt14overflow_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt16invalid_argument', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt16nested_exception', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTISt8bad_cast', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt9bad_alloc', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTISt9exception', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 50}
+{'type': 'OBJECT', 'name': '_ZTSNSt12experimental19bad_optional_accessE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110__time_getE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110__time_putE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110ctype_baseE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110istrstreamE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110money_baseE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIcLb0EEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIcLb1EEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIwLb0EEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110moneypunctIwLb1EEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__110ostrstreamE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_getIcEE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_getIwEE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_putIcEE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111__money_putIwEE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__111regex_errorE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112bad_weak_ptrE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112codecvt_baseE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112ctype_bynameIcEE', 'size': 26}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112ctype_bynameIwEE', 'size': 26}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112future_errorE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112strstreambufE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__112system_errorE', 'size': 23}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 47}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 47}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 47}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 47}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__113messages_baseE', 'size': 24}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IDiEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IDsEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__codecvt_utf8IwEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__num_get_baseE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__num_put_baseE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114__shared_countE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 43}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 43}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 42}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 42}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114collate_bynameIcEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114collate_bynameIwEE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__114error_categoryE', 'size': 25}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'size': 33}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'size': 33}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 49}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 49}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115messages_bynameIcEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115messages_bynameIwEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115numpunct_bynameIcEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115numpunct_bynameIwEE', 'size': 29}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117__assoc_sub_stateE', 'size': 28}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__118__time_get_storageIcEE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__118__time_get_storageIwEE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__119__shared_weak_countE', 'size': 30}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__time_get_c_storageIcEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__120__time_get_c_storageIwEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__15ctypeIcEE', 'size': 18}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__15ctypeIwEE', 'size': 18}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__16locale5facetE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 35}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 34}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17collateIcEE', 'size': 20}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17collateIwEE', 'size': 20}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18__c_nodeE', 'size': 18}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18ios_base7failureE', 'size': 26}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18ios_baseE', 'size': 18}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18messagesIcEE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18messagesIwEE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18numpunctIcEE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18numpunctIwEE', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_getIcEE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_getIwEE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_putIcEE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19__num_putIwEE', 'size': 22}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 42}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 42}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19strstreamE', 'size': 19}
+{'type': 'OBJECT', 'name': '_ZTSNSt3__19time_baseE', 'size': 19}
+{'type': 'OBJECT', 'name': '_ZTSSt16nested_exception', 'size': 21}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__110istrstreamE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__110ostrstreamE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 16}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTTNSt3__19strstreamE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv117__class_type_infoE', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv120__si_class_type_infoE', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVN10__cxxabiv121__vmi_class_type_infoE', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt12experimental19bad_optional_accessE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110istrstreamE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIcLb0EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIcLb1EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIwLb0EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110moneypunctIwLb1EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__110ostrstreamE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__111regex_errorE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112bad_weak_ptrE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112ctype_bynameIcEE', 'size': 104}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112ctype_bynameIwEE', 'size': 136}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112future_errorE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112strstreambufE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__112system_errorE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114__codecvt_utf8IwEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114__shared_countE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114collate_bynameIcEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114collate_bynameIwEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__114error_categoryE', 'size': 72}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115messages_bynameIcEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115messages_bynameIwEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115numpunct_bynameIcEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115numpunct_bynameIwEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 224}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 224}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117__assoc_sub_stateE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 112}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__119__shared_weak_countE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__15ctypeIcEE', 'size': 104}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__15ctypeIwEE', 'size': 136}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__16locale5facetE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 96}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17collateIcEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17collateIwEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 128}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 104}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 104}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18__c_nodeE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18ios_base7failureE', 'size': 40}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18ios_baseE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18messagesIcEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18messagesIwEE', 'size': 64}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18numpunctIcEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18numpunctIwEE', 'size': 80}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 168}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 168}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 32}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56}
+{'type': 'OBJECT', 'name': '_ZTVNSt3__19strstreamE', 'size': 120}
+{'type': 'OBJECT', 'name': '_ZTVSt11logic_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt12length_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt12out_of_range', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt13runtime_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt14overflow_error', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt16invalid_argument', 'size': 0}
+{'type': 'OBJECT', 'name': '_ZTVSt16nested_exception', 'size': 32}
+{'type': 'FUNC', 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZThn16_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZThn16_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'name': '_ZdaPv'}
+{'type': 'FUNC', 'name': '_ZdaPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '_ZdaPvm'}
+{'type': 'FUNC', 'name': '_ZdlPv'}
+{'type': 'FUNC', 'name': '_ZdlPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '_ZdlPvm'}
+{'type': 'FUNC', 'name': '_Znam'}
+{'type': 'FUNC', 'name': '_ZnamRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '_Znwm'}
+{'type': 'FUNC', 'name': '_ZnwmRKSt9nothrow_t'}
+{'type': 'FUNC', 'name': '__assert_fail@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__ctype_get_mb_cur_max@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__cxa_allocate_exception'}
+{'type': 'FUNC', 'name': '__cxa_atexit@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__cxa_begin_catch'}
+{'type': 'FUNC', 'name': '__cxa_current_primary_exception'}
+{'type': 'FUNC', 'name': '__cxa_decrement_exception_refcount'}
+{'type': 'FUNC', 'name': '__cxa_end_catch'}
+{'type': 'FUNC', 'name': '__cxa_finalize@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__cxa_free_exception'}
+{'type': 'FUNC', 'name': '__cxa_guard_abort'}
+{'type': 'FUNC', 'name': '__cxa_guard_acquire'}
+{'type': 'FUNC', 'name': '__cxa_guard_release'}
+{'type': 'FUNC', 'name': '__cxa_increment_exception_refcount'}
+{'type': 'FUNC', 'name': '__cxa_pure_virtual'}
+{'type': 'FUNC', 'name': '__cxa_rethrow'}
+{'type': 'FUNC', 'name': '__cxa_rethrow_primary_exception'}
+{'type': 'FUNC', 'name': '__cxa_throw'}
+{'type': 'FUNC', 'name': '__cxa_uncaught_exception'}
+{'type': 'FUNC', 'name': '__errno_location@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': '__gxx_personality_v0'}
+{'type': 'FUNC', 'name': '_fini'}
+{'type': 'FUNC', 'name': '_init'}
+{'type': 'FUNC', 'name': 'abort@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'btowc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'calloc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'catclose@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'catgets@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'catopen@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'clock_gettime@GLIBC_2.17'}
+{'type': 'FUNC', 'name': 'close@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'fflush@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'fprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'free@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'freelocale@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'fwrite@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'getc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'iswalpha_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswblank_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswcntrl_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswdigit_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswlower_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswprint_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswpunct_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswspace_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswupper_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'iswxdigit_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'localeconv@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'malloc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'mbrtowc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'mbsnrtowcs@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'mbsrtowcs@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'mbtowc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'memchr@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'memcmp@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'memcpy@GLIBC_2.14'}
+{'type': 'FUNC', 'name': 'memmove@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'memset@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'nanosleep@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'newlocale@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'open@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_cond_broadcast@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_cond_destroy@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_cond_signal@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_cond_timedwait@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_cond_wait@GLIBC_2.3.2'}
+{'type': 'FUNC', 'name': 'pthread_detach@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_getspecific@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_join@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_key_create@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_destroy@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_init@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_lock@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_trylock@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutex_unlock@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutexattr_destroy@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutexattr_init@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_mutexattr_settype@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'pthread_self@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'read@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'realloc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'sched_yield@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'setlocale@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'snprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'sscanf@GLIBC_2.2.5'}
+{'type': 'OBJECT', 'name': 'stderr@GLIBC_2.2.5', 'size': 0}
+{'type': 'OBJECT', 'name': 'stdin@GLIBC_2.2.5', 'size': 0}
+{'type': 'OBJECT', 'name': 'stdout@GLIBC_2.2.5', 'size': 0}
+{'type': 'FUNC', 'name': 'strcmp@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strcoll_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strerror_r@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strftime_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strlen@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtod@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtod_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strtof@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtof_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strtol@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtold@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtold_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'strtoll@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtoll_l@GLIBC_2.3.3'}
+{'type': 'FUNC', 'name': 'strtoul@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtoull@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'strtoull_l@GLIBC_2.3.3'}
+{'type': 'FUNC', 'name': 'strxfrm_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'swprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'sysconf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'tolower_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'toupper_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'towlower_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'towupper_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'ungetc@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'uselocale@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'vasprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'vsnprintf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'vsscanf@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcrtomb@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcscoll_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'wcslen@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcsnrtombs@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstod@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstof@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstol@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstold@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstoll@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstoul@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcstoull@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wcsxfrm_l@GLIBC_2.3'}
+{'type': 'FUNC', 'name': 'wctob@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemchr@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemcmp@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemcpy@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemmove@GLIBC_2.2.5'}
+{'type': 'FUNC', 'name': 'wmemset@GLIBC_2.2.5'}
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/4.0/x86_64-apple-darwin16.abilist b/chromium/buildtools/third_party/libc++/trunk/lib/abi/4.0/x86_64-apple-darwin16.abilist
new file mode 100644
index 00000000000..5d91c4b6278
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/4.0/x86_64-apple-darwin16.abilist
@@ -0,0 +1,2376 @@
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12bad_any_cast4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt16nested_exception14rethrow_nestedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt18bad_variant_access4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt19bad_optional_access4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110error_code7messageEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__decrementableEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__find_c_from_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__subscriptableEPKvl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__dereferenceableEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__find_c_and_lockEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db8__find_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db9__addableEPKvl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112bad_weak_ptr4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEjw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEwc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112strstreambuf6pcountEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__113random_device7entropyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category23default_error_conditionEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115error_condition7messageEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__XEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__cEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__rEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__xEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__weeksEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE8__monthsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__XEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__cEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__rEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__xEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__weeksEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE8__monthsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__124__libcpp_debug_exception4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEjw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEwc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale4nameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale9has_facetERNS0_2idE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale9use_facetERNS0_2idE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16localeeqERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE7do_hashEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE7do_hashEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18ios_base6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE8do_closeEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE8do_closeEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_truenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE12do_falsenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_truenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE12do_falsenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_erroraSERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrC2ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptraSERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_erroraSERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110adopt_lockE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5alnumE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5alphaE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5blankE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5cntrlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5digitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5graphE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5lowerE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5printE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5punctE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5spaceE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5upperE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base6xdigitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110defer_lockE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__call_onceERVmPvPFvS2_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db11__insert_icEPvPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db15__iterator_copyEPvPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db16__invalidate_allEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db4swapEPvS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__111try_to_lockE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__do_nothingEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__get_sp_mutEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__next_primeEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultclEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_1E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_2E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_3E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_4E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_5E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_6E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_7E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_8E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_9E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders3_10E', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf3strEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf4swapERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf6__initEPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf6freezeEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKal'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKhl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPalS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPhlS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1El'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKal'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKhl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPalS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPhlS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2El'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__113allocator_argE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreEli'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceclEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvEaSERKS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__get_const_dbEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base12__format_intEPcPKcbj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base14__format_floatEPcPKcj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_count12__add_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_count16__release_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__get_classnameEPKcb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115future_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcE6__initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwE6__initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115system_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116generic_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state12__make_readyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state16__on_zero_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4copyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4waitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9__executeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9set_valueEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117declare_reachableEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117iostream_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_allEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_oneEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variableD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variableD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118get_pointer_safetyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex11lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex13unlock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex15try_lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base11lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base13unlock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base15try_lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count10__add_weakEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count12__add_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count14__release_weakEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count16__release_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119__start_std_streamsE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__thread_local_dataEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119declare_no_pointersEPcm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119piecewise_constructE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__get_collation_nameEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__throw_system_errorEiPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__throw_runtime_errorEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__undeclare_reachableEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121undeclare_no_pointersEPcm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__123__libcpp_debug_functionE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__13cinE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14cerrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14clogE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14coutE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC1EPKjbm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC2EPKjbm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wcerrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wclogE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wcoutE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock3nowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock3nowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16gslice6__initEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale2id5__getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale2id6__initEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale2id9__next_idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale3allE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale4noneE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale4timeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale5ctypeE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facet16__on_zero_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale6globalERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale7classicEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7collateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7numericE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale8__globalEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8messagesE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8monetaryE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_PKci'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_S2_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_PKci'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_S2_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeaSERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread20hardware_concurrencyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread4joinEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread6detachEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16threadD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16threadD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE10get_futureEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE9set_valueEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_node5__addEPNS_8__i_nodeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__get_dbEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__i_nodeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__i_nodeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__rs_getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__sp_mut4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__sp_mut6unlockEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base10floatfieldE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base10scientificE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base11adjustfieldE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base15sync_with_stdioEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base16__call_callbacksENS0_5eventE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base2inE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3appE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3ateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3decE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3hexE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3octE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3outE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4initEPv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base4leftE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4moveERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4swapERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5clearEj'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5iwordEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5pwordEi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5rightE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5truncE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6badbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6binaryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6eofbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6skipwsE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base6xallocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7copyfmtERKS0_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7goodbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7showposE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base8internalE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9uppercaseE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18messagesIcE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18messagesIwE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImE6resizeEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt10unexpectedv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt10unexpectedv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt13get_terminatev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt13get_terminatev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt14get_unexpectedv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt14get_unexpectedv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt15get_new_handlerv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt15get_new_handlerv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17__throw_bad_allocv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17current_exceptionv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17rethrow_exceptionSt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt18uncaught_exceptionv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt19uncaught_exceptionsv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZSt7nothrow', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt9terminatev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt9terminatev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDs'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110__time_getE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110__time_putE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__num_get_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__num_put_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__118__time_get_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__118__time_get_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__time_get_c_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__time_get_c_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__124__libcpp_debug_exceptionE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19time_baseE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9type_info'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTId'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTId'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19time_baseE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9type_info'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSy'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__19strstreamE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__124__libcpp_debug_exceptionE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19strstreamE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9type_info'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__Znam'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__Znwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_allocate_exception'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_allocate_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_atexit'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_begin_catch'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_begin_catch'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_call_unexpected'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_call_unexpected'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_current_exception_type'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_current_exception_type'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_current_primary_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_decrement_exception_refcount'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_demangle'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_demangle'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_end_catch'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_end_catch'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_free_exception'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_free_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_exception_ptr'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_exception_ptr'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals_fast'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals_fast'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_abort'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_abort'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_acquire'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_acquire'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_release'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_release'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_increment_exception_refcount'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_pure_virtual'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_pure_virtual'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_rethrow'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow_primary_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_throw'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_throw'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_uncaught_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cctor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cctor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cleanup'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cleanup'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_ctor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_ctor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete2'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete2'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete3'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete3'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_dtor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_dtor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new2'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new2'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new3'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new3'}
+{'type': 'U', 'is_defined': False, 'name': '___dynamic_cast'}
+{'type': 'I', 'is_defined': True, 'name': '___dynamic_cast'}
+{'type': 'U', 'is_defined': False, 'name': '___gxx_personality_v0'}
+{'type': 'I', 'is_defined': True, 'name': '___gxx_personality_v0'}
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/4.0/x86_64-unknown-linux-gnu.abilist b/chromium/buildtools/third_party/libc++/trunk/lib/abi/4.0/x86_64-unknown-linux-gnu.abilist
new file mode 100644
index 00000000000..70ac5944356
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/4.0/x86_64-unknown-linux-gnu.abilist
@@ -0,0 +1,1905 @@
+{'name': '_ZNKSt11logic_error4whatEv', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNKSt12bad_any_cast4whatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt13runtime_error4whatEv', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNKSt16nested_exception14rethrow_nestedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt18bad_variant_access4whatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt19bad_optional_access4whatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110error_code7messageEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db15__decrementableEPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db15__find_c_from_iEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db15__subscriptableEPKvl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db17__dereferenceableEPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db17__find_c_and_lockEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db6unlockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db8__find_cEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__111__libcpp_db9__addableEPKvl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112bad_weak_ptr4whatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE10do_scan_isEtPKwS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE11do_scan_notEtPKwS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pt', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE5do_isEtw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEwc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__112strstreambuf6pcountEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__113random_device7entropyEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IwE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114error_category10equivalentERKNS_10error_codeEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__114error_category23default_error_conditionEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__115error_condition7messageEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIcE3__XEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIcE3__cEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIcE3__rEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIcE3__xEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIcE7__am_pmEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIcE7__weeksEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIcE8__monthsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIwE3__XEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIwE3__cEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIwE3__rEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIwE3__xEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIwE7__am_pmEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIwE7__weeksEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__time_get_c_storageIwE8__monthsEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__124__libcpp_debug_exception4whatEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIcE10do_tolowerEPcPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIcE10do_tolowerEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIcE10do_toupperEPcPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIcE10do_toupperEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIcE8do_widenEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIcE9do_narrowEcc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE10do_scan_isEtPKwS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE10do_tolowerEPwPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE10do_tolowerEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE10do_toupperEPwPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE10do_toupperEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE11do_scan_notEtPKwS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE5do_isEPKwS3_Pt', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE5do_isEtw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE8do_widenEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__15ctypeIwE9do_narrowEwc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__16locale4nameEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__16locale9has_facetERNS0_2idE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__16locale9use_facetERNS0_2idE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__16localeeqERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17collateIcE12do_transformEPKcS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17collateIcE7do_hashEPKcS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17collateIwE12do_transformEPKwS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17collateIwE7do_hashEPKwS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18ios_base6getlocEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18messagesIcE8do_closeEl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18messagesIwE8do_closeEl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIcE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIcE11do_truenameEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIcE12do_falsenameEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIcE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIcE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIwE11do_groupingEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIwE11do_truenameEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIwE12do_falsenameEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIwE16do_decimal_pointEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18numpunctIwE16do_thousands_sepEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt11logic_errorC1EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt11logic_errorC1ERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt11logic_errorC2EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt11logic_errorC2ERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt11logic_errorD2Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt11logic_erroraSERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt12length_errorD1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt12out_of_rangeD1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt13exception_ptrC1ERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13exception_ptrC2ERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13exception_ptrD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13exception_ptrD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13exception_ptraSERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_errorC1EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_errorC1ERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_errorC2EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_errorC2ERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_errorD1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_errorD2Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt13runtime_erroraSERKS_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt14overflow_errorD1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt16invalid_argumentD1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt16nested_exceptionC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt16nested_exceptionC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt16nested_exceptionD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt16nested_exceptionD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt16nested_exceptionD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt19bad_optional_accessD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt19bad_optional_accessD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt19bad_optional_accessD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_getC1EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_getC2EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_getD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_getD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_putC1EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_putC2EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_putD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110__time_putD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110adopt_lockE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5alnumE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5alphaE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5blankE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5cntrlE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5digitE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5graphE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5lowerE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5printE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5punctE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5spaceE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base5upperE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ctype_base6xdigitE', 'size': 2, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110defer_lockE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110istrstreamD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110istrstreamD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110istrstreamD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110moneypunctIcLb0EE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110moneypunctIcLb1EE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110moneypunctIwLb0EE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110moneypunctIwLb1EE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__110ostrstreamD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110ostrstreamD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110ostrstreamD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEf', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__110to_wstringEy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__call_onceERVmPvPFvS2_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_db10__insert_cEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_db10__insert_iEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_db11__insert_icEPvPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_db15__iterator_copyEPvPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_db16__invalidate_allEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_db4swapEPvS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_db9__erase_cEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_db9__erase_iEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_dbC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_dbC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_dbD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__libcpp_dbD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111regex_errorD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111regex_errorD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111regex_errorD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111timed_mutex4lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111timed_mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111timed_mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111timed_mutexC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111timed_mutexC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111timed_mutexD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111timed_mutexD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__111try_to_lockE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112__do_nothingEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__get_sp_mutEPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__next_primeEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__rs_default4__c_E', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112__rs_defaultC1ERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__rs_defaultC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__rs_defaultC2ERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__rs_defaultC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__rs_defaultD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__rs_defaultD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112__rs_defaultclEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112bad_weak_ptrD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112bad_weak_ptrD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112bad_weak_ptrD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 8, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertIPKcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPcEEE4typeENSB_IS8_EESA_SA_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceIPKcEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 8, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertIPKwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPwEEE4typeENSB_IS8_EESA_SA_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceIPKwEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIcEC1EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIcEC2EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIcED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIcED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIcED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIwEC1EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIwEC2EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIwED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIwED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112ctype_bynameIwED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112future_errorC1ENS_10error_codeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112future_errorC2ENS_10error_codeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112future_errorD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112future_errorD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112future_errorD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112placeholders2_1E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders2_2E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders2_3E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders2_4E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders2_5E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders2_6E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders2_7E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders2_8E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders2_9E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112placeholders3_10E', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__112strstreambuf3strEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambuf4swapERS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambuf6__initEPclS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambuf6freezeEb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambuf8overflowEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambuf9pbackfailEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambuf9underflowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC1EPFPvmEPFvS1_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC1EPKal', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC1EPKcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC1EPKhl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC1EPalS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC1EPclS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC1EPhlS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC1El', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC2EPFPvmEPFvS1_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC2EPKal', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC2EPKcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC2EPKhl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC2EPalS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC2EPclS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC2EPhlS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufC2El', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112strstreambufD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC1ENS_10error_codeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC1ENS_10error_codeEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC2ENS_10error_codeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC2ENS_10error_codeEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__112system_errorD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113allocator_argE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreElj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113random_deviceD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113random_deviceD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113random_deviceclEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113shared_futureIvED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113shared_futureIvED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__113shared_futureIvEaSERKS1_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__get_const_dbEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__num_get_base5__srcE', 'size': 33, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__num_put_base14__format_floatEPcPKcj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__shared_count12__add_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__shared_count16__release_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__shared_countD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__shared_countD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114__shared_countD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIcEC1EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIcEC2EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIcED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIcED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIcED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIwEC1EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIwEC2EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIwED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIwED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114collate_bynameIwED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114error_categoryC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114error_categoryD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114error_categoryD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__114error_categoryD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115__get_classnameEPKcb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115__thread_structC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115__thread_structC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115__thread_structD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115__thread_structD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115future_categoryEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIcE6__initEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIcEC1EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIcEC2EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIcED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIcED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIcED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIwE6__initEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIwEC1EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIwEC2EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIwED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIwED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115numpunct_bynameIwED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115recursive_mutex4lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115recursive_mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115recursive_mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115recursive_mutexC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115recursive_mutexC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115recursive_mutexD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115recursive_mutexD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__115system_categoryEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__116__narrow_to_utf8ILm16EED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__116__narrow_to_utf8ILm16EED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__116__narrow_to_utf8ILm16EED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__116__narrow_to_utf8ILm32EED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__116__narrow_to_utf8ILm32EED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__116__narrow_to_utf8ILm32EED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__116generic_categoryEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state12__make_readyEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state16__on_zero_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state4copyEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state4waitEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state9__executeEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__assoc_sub_state9set_valueEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__widen_from_utf8ILm16EED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__widen_from_utf8ILm16EED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__widen_from_utf8ILm16EED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__widen_from_utf8ILm32EED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__widen_from_utf8ILm32EED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117__widen_from_utf8ILm32EED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117declare_reachableEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117iostream_categoryEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIcEC1EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIcEC2EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIwEC1EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIwEC2EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118condition_variable10notify_allEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118condition_variable10notify_oneEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118condition_variableD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118condition_variableD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118get_pointer_safetyEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118shared_timed_mutex11lock_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118shared_timed_mutex13unlock_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118shared_timed_mutex15try_lock_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118shared_timed_mutex4lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118shared_timed_mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118shared_timed_mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118shared_timed_mutexC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__118shared_timed_mutexC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_mutex_base11lock_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_mutex_base13unlock_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_mutex_base15try_lock_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_mutex_base4lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_mutex_base6unlockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_mutex_base8try_lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_mutex_baseC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_mutex_baseC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_weak_count10__add_weakEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_weak_count12__add_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_weak_count14__release_weakEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_weak_count16__release_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_weak_count4lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_weak_countD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_weak_countD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__shared_weak_countD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119__start_std_streamsE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__119__thread_local_dataEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119declare_no_pointersEPcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__119piecewise_constructE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__120__get_collation_nameEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__120__throw_system_errorEiPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121__undeclare_reachableEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121recursive_timed_mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121recursive_timed_mutexC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121recursive_timed_mutexC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121recursive_timed_mutexD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121recursive_timed_mutexD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__121undeclare_no_pointersEPcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__123__libcpp_debug_functionE', 'size': 8, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__124__libcpp_debug_exceptionD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__125__num_get_signed_integralIlEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__125__num_get_signed_integralIxEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__num_get_unsigned_integralIjEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__num_get_unsigned_integralImEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__num_get_unsigned_integralItEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__127__num_get_unsigned_integralIyEET_PKcS3_Rji', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__13cinE', 'size': 168, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__14cerrE', 'size': 160, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__14clogE', 'size': 160, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__14coutE', 'size': 160, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__14wcinE', 'size': 168, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__15alignEmmRPvRm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIcE13classic_tableEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIcE21__classic_lower_tableEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIcE21__classic_upper_tableEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIcE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__15ctypeIcEC1EPKtbm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIcEC2EPKtbm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIcED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIcED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIcED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIwE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__15ctypeIwED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIwED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15ctypeIwED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15mutex4lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15mutex6unlockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15mutex8try_lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15mutexD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15mutexD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__15wcerrE', 'size': 160, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__15wclogE', 'size': 160, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__15wcoutE', 'size': 160, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16__clocEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16chrono12steady_clock3nowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16chrono12system_clock11from_time_tEl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16chrono12system_clock3nowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16futureIvE3getEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16futureIvED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16futureIvED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16gslice6__initEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale2id5__getEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale2id6__initEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale2id9__next_idE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16locale3allE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16locale4noneE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16locale4timeE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16locale5ctypeE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16locale5facet16__on_zero_sharedEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale5facetD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale5facetD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale5facetD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale6globalERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale7classicEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale7collateE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16locale7numericE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16locale8__globalEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16locale8messagesE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16locale8monetaryE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__16localeC1EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC1ERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC1ERKS0_PKci', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC1ERKS0_S2_i', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC2EPKc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC2ERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC2ERKS0_PKci', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC2ERKS0_S2_i', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16localeaSERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16thread20hardware_concurrencyEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16thread4joinEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16thread6detachEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16threadD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__16threadD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIaaEEPaEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17__sort5IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_S5_T_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17codecvtIDic11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIDic11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIDic11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17codecvtIcc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIcc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIcc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1Em', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2Em', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIwc11__mbstate_tED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIwc11__mbstate_tED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17codecvtIwc11__mbstate_tED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17collateIcE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17collateIcED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17collateIcED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17collateIcED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17collateIwE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17collateIwED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17collateIwED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17collateIwED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__17promiseIvE10get_futureEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17promiseIvE24set_value_at_thread_exitEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17promiseIvE9set_valueEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17promiseIvEC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17promiseIvEC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17promiseIvED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__17promiseIvED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__c_node5__addEPNS_8__i_nodeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__c_nodeD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__c_nodeD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__c_nodeD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__get_dbEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__i_nodeD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__i_nodeD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__rs_getEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__sp_mut4lockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18__sp_mut6unlockEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base10floatfieldE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base10scientificE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base11adjustfieldE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base15sync_with_stdioEb', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base16__call_callbacksENS0_5eventE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base2inE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base3appE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base3ateE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base3decE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base3hexE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base3octE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base3outE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base4InitC1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base4InitC2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base4InitD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base4InitD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base4initEPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base4leftE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base4moveERS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base4swapERS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base5clearEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base5fixedE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base5imbueERKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base5iwordEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base5pwordEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base5rightE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base5truncE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base6badbitE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base6binaryE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base6eofbitE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base6skipwsE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base6xallocEv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7copyfmtERKS0_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7failbitE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7failureD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7failureD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7failureD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_base7goodbitE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base7showposE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base7unitbufE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base8internalE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base8showbaseE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base9__xindex_E', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base9basefieldE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base9boolalphaE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base9showpointE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_base9uppercaseE', 'size': 4, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18ios_baseD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_baseD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18ios_baseD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18messagesIcE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18messagesIwE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18numpunctIcE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18numpunctIcEC1Em', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIcEC2Em', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIcED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIcED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIcED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIwE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18numpunctIwEC1Em', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIwEC2Em', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIwED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIwED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18numpunctIwED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__18valarrayImE6resizeEmm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18valarrayImEC1Em', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18valarrayImEC2Em', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18valarrayImED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__18valarrayImED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZNSt3__19strstreamD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19strstreamD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19strstreamD2Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEd', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEe', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEf', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEi', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEj', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEl', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEx', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__19to_stringEy', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZNSt8bad_castC1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt8bad_castD1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt8bad_castD2Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt9bad_allocC1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt9bad_allocD1Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZNSt9exceptionD2Ev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZSt15get_new_handlerv', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZSt17__throw_bad_allocv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZSt17current_exceptionv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZSt17rethrow_exceptionSt13exception_ptr', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZSt18uncaught_exceptionv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZSt19uncaught_exceptionsv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZSt7nothrow', 'size': 1, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZSt9terminatev', 'is_defined': False, 'type': 'FUNC'}
+{'name': '_ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt12experimental19bad_optional_accessE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110__time_getE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110__time_putE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110ctype_baseE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110istrstreamE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110money_baseE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110moneypunctIcLb0EEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110moneypunctIcLb1EEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110moneypunctIwLb0EEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110moneypunctIwLb1EEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__110ostrstreamE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__111__money_getIcEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__111__money_getIwEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__111__money_putIcEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__111__money_putIwEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__111regex_errorE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__112bad_weak_ptrE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__112codecvt_baseE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__112ctype_bynameIcEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__112ctype_bynameIwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__112future_errorE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__112strstreambufE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__112system_errorE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__113messages_baseE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114__codecvt_utf8IDiEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114__codecvt_utf8IDsEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114__codecvt_utf8IwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114__num_get_baseE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114__num_put_baseE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114__shared_countE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114collate_bynameIcEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114collate_bynameIwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__114error_categoryE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115messages_bynameIcEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115messages_bynameIwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115numpunct_bynameIcEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115numpunct_bynameIwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__117__assoc_sub_stateE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__118__time_get_storageIcEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__118__time_get_storageIwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__119__shared_weak_countE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__120__time_get_c_storageIcEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__120__time_get_c_storageIwEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__124__libcpp_debug_exceptionE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__15ctypeIcEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__15ctypeIwEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__16locale5facetE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17collateIcEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17collateIwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18__c_nodeE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18ios_base7failureE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18ios_baseE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18messagesIcEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18messagesIwEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18numpunctIcEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18numpunctIwEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 72, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 72, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19__num_getIcEE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19__num_getIwEE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19__num_putIcEE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19__num_putIwEE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19strstreamE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTINSt3__19time_baseE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTISt11logic_error', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTISt12bad_any_cast', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTISt12length_error', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTISt12out_of_range', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTISt13runtime_error', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTISt14overflow_error', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTISt16invalid_argument', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTISt16nested_exception', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTISt18bad_variant_access', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTISt19bad_optional_access', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTISt8bad_cast', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTISt9bad_alloc', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTISt9exception', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 50, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt12experimental19bad_optional_accessE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110__time_getE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110__time_putE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110ctype_baseE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110istrstreamE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110money_baseE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110moneypunctIcLb0EEE', 'size': 28, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110moneypunctIcLb1EEE', 'size': 28, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110moneypunctIwLb0EEE', 'size': 28, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110moneypunctIwLb1EEE', 'size': 28, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__110ostrstreamE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__111__money_getIcEE', 'size': 25, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__111__money_getIwEE', 'size': 25, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__111__money_putIcEE', 'size': 25, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__111__money_putIwEE', 'size': 25, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__111regex_errorE', 'size': 22, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__112bad_weak_ptrE', 'size': 23, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__112codecvt_baseE', 'size': 23, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__112ctype_bynameIcEE', 'size': 26, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__112ctype_bynameIwEE', 'size': 26, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__112future_errorE', 'size': 23, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__112strstreambufE', 'size': 23, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__112system_errorE', 'size': 23, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 47, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 47, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 47, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 47, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__113messages_baseE', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114__codecvt_utf8IDiEE', 'size': 29, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114__codecvt_utf8IDsEE', 'size': 29, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114__codecvt_utf8IwEE', 'size': 28, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114__num_get_baseE', 'size': 25, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114__num_put_baseE', 'size': 25, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114__shared_countE', 'size': 25, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 48, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 43, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 43, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 42, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 42, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114collate_bynameIcEE', 'size': 28, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114collate_bynameIwEE', 'size': 28, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__114error_categoryE', 'size': 25, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'size': 33, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'size': 33, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 49, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 49, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115messages_bynameIcEE', 'size': 29, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115messages_bynameIwEE', 'size': 29, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115numpunct_bynameIcEE', 'size': 29, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115numpunct_bynameIwEE', 'size': 29, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 77, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 77, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__117__assoc_sub_stateE', 'size': 28, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__118__time_get_storageIcEE', 'size': 32, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__118__time_get_storageIwEE', 'size': 32, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__119__shared_weak_countE', 'size': 30, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__120__time_get_c_storageIcEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__120__time_get_c_storageIwEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__124__libcpp_debug_exceptionE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__15ctypeIcEE', 'size': 18, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__15ctypeIwEE', 'size': 18, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__16locale5facetE', 'size': 22, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 35, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 34, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17collateIcEE', 'size': 20, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17collateIwEE', 'size': 20, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 68, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 68, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18__c_nodeE', 'size': 18, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18ios_base7failureE', 'size': 26, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18ios_baseE', 'size': 18, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18messagesIcEE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18messagesIwEE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18numpunctIcEE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18numpunctIwEE', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 69, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 69, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19__num_getIcEE', 'size': 22, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19__num_getIwEE', 'size': 22, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19__num_putIcEE', 'size': 22, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19__num_putIwEE', 'size': 22, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 42, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 42, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 70, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 70, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19strstreamE', 'size': 19, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSNSt3__19time_baseE', 'size': 19, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSSt12bad_any_cast', 'size': 17, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSSt16nested_exception', 'size': 21, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSSt18bad_variant_access', 'size': 23, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTSSt19bad_optional_access', 'size': 24, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTTNSt3__110istrstreamE', 'size': 32, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTTNSt3__110ostrstreamE', 'size': 32, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 16, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTTNSt3__19strstreamE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVN10__cxxabiv117__class_type_infoE', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVN10__cxxabiv120__si_class_type_infoE', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVN10__cxxabiv121__vmi_class_type_infoE', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt12experimental19bad_optional_accessE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__110istrstreamE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__110moneypunctIcLb0EEE', 'size': 112, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__110moneypunctIcLb1EEE', 'size': 112, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__110moneypunctIwLb0EEE', 'size': 112, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__110moneypunctIwLb1EEE', 'size': 112, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__110ostrstreamE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__111regex_errorE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__112bad_weak_ptrE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__112ctype_bynameIcEE', 'size': 104, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__112ctype_bynameIwEE', 'size': 136, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__112future_errorE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__112strstreambufE', 'size': 128, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__112system_errorE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114__codecvt_utf8IwEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114__shared_countE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 120, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114collate_bynameIcEE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114collate_bynameIwEE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__114error_categoryE', 'size': 72, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 128, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 128, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115messages_bynameIcEE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115messages_bynameIwEE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115numpunct_bynameIcEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115numpunct_bynameIwEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 224, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 224, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__117__assoc_sub_stateE', 'size': 48, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 112, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 112, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 112, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 112, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__119__shared_weak_countE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__124__libcpp_debug_exceptionE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__15ctypeIcEE', 'size': 104, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__15ctypeIwEE', 'size': 136, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__16locale5facetE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 96, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17collateIcEE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17collateIwEE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 128, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 128, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 104, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 104, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18__c_nodeE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18ios_base7failureE', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18ios_baseE', 'size': 32, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18messagesIcEE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18messagesIwEE', 'size': 64, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18numpunctIcEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18numpunctIwEE', 'size': 80, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 168, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 168, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 48, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 48, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 32, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 32, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 56, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVNSt3__19strstreamE', 'size': 120, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVSt11logic_error', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVSt12bad_any_cast', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVSt12length_error', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVSt12out_of_range', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVSt13runtime_error', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVSt14overflow_error', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVSt16invalid_argument', 'size': 0, 'is_defined': False, 'type': 'OBJECT'}
+{'name': '_ZTVSt16nested_exception', 'size': 32, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVSt18bad_variant_access', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZTVSt19bad_optional_access', 'size': 40, 'is_defined': True, 'type': 'OBJECT'}
+{'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZThn16_NSt3__19strstreamD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZThn16_NSt3__19strstreamD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__110istrstreamD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__110istrstreamD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__110ostrstreamD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__110ostrstreamD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__19strstreamD0Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdaPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdaPvRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdaPvSt11align_val_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdaPvSt11align_val_tRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdaPvm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdaPvmSt11align_val_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdlPv', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdlPvRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdlPvSt11align_val_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdlPvSt11align_val_tRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdlPvm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZdlPvmSt11align_val_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_Znam', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZnamRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZnamSt11align_val_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZnamSt11align_val_tRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_Znwm', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZnwmRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZnwmSt11align_val_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '_ZnwmSt11align_val_tRKSt9nothrow_t', 'is_defined': True, 'type': 'FUNC'}
+{'name': '__cxa_allocate_exception', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_begin_catch', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_current_primary_exception', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_decrement_exception_refcount', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_end_catch', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_free_exception', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_guard_abort', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_guard_acquire', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_guard_release', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_increment_exception_refcount', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_pure_virtual', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_rethrow', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_rethrow_primary_exception', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_throw', 'is_defined': False, 'type': 'FUNC'}
+{'name': '__cxa_uncaught_exception', 'is_defined': False, 'type': 'FUNC'}
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/CHANGELOG.TXT b/chromium/buildtools/third_party/libc++/trunk/lib/abi/CHANGELOG.TXT
new file mode 100644
index 00000000000..b979b46945b
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/CHANGELOG.TXT
@@ -0,0 +1,186 @@
+ABI Changelog
+==============
+This changelog contains information about ABI changes in libc++. Specifically
+the addition and deletion of symbols from the libc++ dylib.
+
+Each entry should start with the revision number followed by a description of
+the change. The entry should contain a summary of the ABI changes made,
+including what symbols were added, removed, or changed.
+
+To generate a summary use "sym_diff.py" diffing against the appropriate ABI list.
+Afterwards the ABI list should be updated to include the new changes.
+
+New entries should be added directly below the "Version" header.
+
+-----------
+Version 5.0
+-----------
+
+* r296729 - Remove std::num_get template methods which should be inline
+
+ These functions should never have had visible definitions in the dylib but
+ since they were previously not specified with 'inline' they accidentally
+ got emitted. This change is non-ABI breaking because every "linkage unit"
+ must contain its own definition.
+
+ x86_64-linux-gnu
+ ----------------
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIlEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__do_get_signedIxEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIjEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedImEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedItEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__do_get_unsignedIyEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIdEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIeEES4_S4_S4_RNS_8ios_baseERjRT_
+ SYMBOL REMOVED: _ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE23__do_get_floating_pointIfEES4_S4_S4_RNS_8ios_baseERjRT_
+
+ x86_64-apple-darwin16.0
+ -----------------------
+ No changes
+
+-----------
+Version 4.0
+-----------
+
+* r290651 - Add _LIBCPP_ASSERT debug handling functions
+
+ All Platforms
+ -------------
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionD1Ev
+ Symbol added: _ZTINSt3__124__libcpp_debug_exceptionE
+ Symbol added: _ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionD2Ev
+ Symbol added: _ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC2ERKS0_
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC1Ev
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC2Ev
+ Symbol added: _ZTSNSt3__124__libcpp_debug_exceptionE
+ Symbol added: _ZNSt3__123__libcpp_debug_functionE
+ Symbol added: _ZNKSt3__124__libcpp_debug_exception4whatEv
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionC1ERKS0_
+ Symbol added: _ZNSt3__124__libcpp_debug_exceptionD0Ev
+ Symbol added: _ZTVNSt3__124__libcpp_debug_exceptionE
+ Symbol added: _ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE
+
+* r288547 - Implement C++17 <variant>
+
+ All Platforms
+ -------------
+ Symbol added: _ZTVSt18bad_variant_access
+ Symbol added: _ZTISt18bad_variant_access
+ Symbol added: _ZTSSt18bad_variant_access
+ Symbol added: _ZNKSt18bad_variant_access4whatEv
+
+* r285537 - Remove std::string::append template methods which should be inline
+
+ These functions should never have had visible definitions in the dylib but
+ since they were previously not specified with 'inline' they accidentally
+ got emitted. This change is non-ABI breaking because every "linkage unit"
+ must contain its own definition.
+
+ x86_64-linux-gnu
+ ----------------
+ SYMBOL REMOVED: _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendIPcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_
+ SYMBOL REMOVED: _ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendIPwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorIS9_EE5valueERS5_E4typeES9_S9_
+
+ x86_64-apple-darwin16.0
+ -----------------------
+ No changes
+
+* r285101 - Add -fvisibility-inlines-hidden when building libc++.
+
+ Although this change removes symbols, it should still be non-ABI breaking
+ since all of the definitions removed are inline functions. For this reason
+ removing these symbols is safe because every "linkage unit" which uses these
+ functions will contain their own definition.
+
+ x86_64-linux-gnu
+ ----------------
+ SYMBOL REMOVED: _ZNSt12bad_any_castD0Ev
+ SYMBOL REMOVED: _ZNSt12experimental15fundamentals_v112bad_any_castD0Ev
+ SYMBOL REMOVED: _ZNSt3__114__codecvt_utf8IDiED0Ev
+ SYMBOL REMOVED: _ZNSt3__114__codecvt_utf8IDsED0Ev
+ SYMBOL REMOVED: _ZNSt3__114__codecvt_utf8IwED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IDiLb0EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IDiLb1EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IDsLb0EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IDsLb1EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IwLb0EED0Ev
+ SYMBOL REMOVED: _ZNSt3__115__codecvt_utf16IwLb1EED0Ev
+ SYMBOL REMOVED: _ZNSt3__117__assoc_sub_stateD0Ev
+ SYMBOL REMOVED: _ZNSt3__117__assoc_sub_stateD2Ev
+ SYMBOL REMOVED: _ZNSt3__117__libcpp_sscanf_lEPKcP15__locale_structS1_z
+ SYMBOL REMOVED: _ZNSt3__119__libcpp_asprintf_lEPPcP15__locale_structPKcz
+ SYMBOL REMOVED: _ZNSt3__119__libcpp_snprintf_lEPcmP15__locale_structPKcz
+ SYMBOL REMOVED: _ZNSt3__120__codecvt_utf8_utf16IDiED0Ev
+ SYMBOL REMOVED: _ZNSt3__120__codecvt_utf8_utf16IDsED0Ev
+ SYMBOL REMOVED: _ZNSt3__120__codecvt_utf8_utf16IwED0Ev
+
+ x86_64-apple-darwin16.0
+ -----------------------
+ No Changes - inline symbols are already hidden
+
+
+* r284206 - Implement C++17 aligned allocation in <new>
+
+ x86_64-linux-gnu
+ ----------------
+ Symbol added: posix_memalign@GLIBC_2.2.5
+ Symbol added: _ZdaPvSt11align_val_t
+ Symbol added: _ZdlPvSt11align_val_t
+ Symbol added: _ZnamSt11align_val_t
+ Symbol added: _ZdaPvmSt11align_val_t
+ Symbol added: _ZdlPvmSt11align_val_t
+ Symbol added: _ZdlPvSt11align_val_tRKSt9nothrow_t
+ Symbol added: _ZnwmSt11align_val_tRKSt9nothrow_t
+ Symbol added: _ZnamSt11align_val_tRKSt9nothrow_t
+ Symbol added: _ZdaPvSt11align_val_tRKSt9nothrow_t
+ Symbol added: _ZnwmSt11align_val_t
+
+* r283980 - Implement C++17 <optional>
+
+ x86_64-linux-gnu
+ ----------------
+ Symbol added: _ZTISt19bad_optional_access
+ Symbol added: _ZNSt19bad_optional_accessD0Ev
+ Symbol added: _ZNSt19bad_optional_accessD1Ev
+ Symbol added: _ZNSt19bad_optional_accessD2Ev
+ Symbol added: _ZTVSt19bad_optional_access
+ Symbol added: _ZTSSt19bad_optional_access
+
+* r278310 - Implement C++17 <any>
+
+ x86_64-linux-gnu
+ ----------------
+ Symbol added: _ZNKSt12bad_any_cast4whatEv
+ Symbol added: _ZNSt12bad_any_castD0Ev
+ Symbol added: _ZTISt12bad_any_cast
+ Symbol added: _ZTSSt12bad_any_cast
+ Symbol added: _ZTVSt12bad_any_cast
+
+* r295398 - Remove basic_string::insert and basic_string::replace template methods
+ which should be inline.
+
+ These functions should never have had visible definitions in the dylib but
+ since they were previously not specified with 'inline' they accidentally
+ got emitted. This change is non-ABI breaking because every "linkage unit"
+ must contain its own definition.
+
+ x86_64-linux-gnu
+ ----------------
+ SYMBOL REMOVED: _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertIPKcEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPcEEE4typeENSB_IS8_EESA_SA_
+ SYMBOL REMOVED: _ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceIPKcEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_
+ SYMBOL REMOVED: _ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertIPKwEENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr38__libcpp_string_gets_noexcept_iteratorISA_EE5valueENS_11__wrap_iterIPwEEE4typeENSB_IS8_EESA_SA_
+ SYMBOL REMOVED: _ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceIPKwEENS_9enable_ifIXsr19__is_input_iteratorIT_EE5valueERS5_E4typeENS_11__wrap_iterIS8_EESF_SA_SA_
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/CMakeLists.txt b/chromium/buildtools/third_party/libc++/trunk/lib/abi/CMakeLists.txt
new file mode 100644
index 00000000000..c207674258a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/CMakeLists.txt
@@ -0,0 +1,36 @@
+
+if (DEFINED TARGET_TRIPLE)
+ # Ignore the minor and patchlevel versions of the darwin
+ # target.
+ string(REGEX REPLACE "darwin16\\.[0-9]\\.[0-9]" "darwin16"
+ GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}")
+endif()
+
+# Detect if we are building in the same configuration used to generate
+# the abilist files.
+if (DEFINED GENERIC_TARGET_TRIPLE
+ AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist"
+ AND TARGET cxx_shared
+ AND ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi" OR
+ (APPLE AND "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "default"))
+ AND NOT LIBCXX_ABI_UNSTABLE
+ AND LIBCXX_ABI_VERSION EQUAL "1")
+ set(LIBCXX_HAS_ABILIST_CONFIGURATION 1 CACHE INTERNAL "")
+else()
+ if (NOT DEFINED LIBCXX_HAS_ABILIST_CONFIGURATION)
+ message(STATUS "libc++ configuration differs from the abilist configuration. "
+ "check-cxx-abilist target is not supported")
+ endif()
+ set(LIBCXX_HAS_ABILIST_CONFIGURATION 0 CACHE INTERNAL "")
+endif()
+
+
+if (LIBCXX_HAS_ABILIST_CONFIGURATION)
+ set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist")
+ set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_diff.py")
+ add_custom_target(check-cxx-abilist
+ ${SYMDIFF_EXE} --only-stdlib-symbols --strict ${ABILIST_FILE}
+ $<TARGET_SONAME_FILE:cxx_shared>
+ DEPENDS cxx_shared
+ COMMENT "Testing ABI compatibility...")
+endif()
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/README.TXT b/chromium/buildtools/third_party/libc++/trunk/lib/abi/README.TXT
new file mode 100644
index 00000000000..f098b80403a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/README.TXT
@@ -0,0 +1,8 @@
+This directory contains abi lists representing the symbols exported
+by the libc++ library. The lists are generated using sym_extract.py.
+
+Every time a symbol is added or removed from the libc++ library each of the
+lists *MUST* be updated to reflect the changes.
+
+TODO Add more documentation about generating and using the lists.
+TODO Add more documentation about the build configuration the lists are generated against.
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/x86_64-apple-darwin16.abilist b/chromium/buildtools/third_party/libc++/trunk/lib/abi/x86_64-apple-darwin16.abilist
new file mode 100644
index 00000000000..5d91c4b6278
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/x86_64-apple-darwin16.abilist
@@ -0,0 +1,2376 @@
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt10bad_typeid4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt11logic_error4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12bad_any_cast4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt16bad_array_length4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt16nested_exception14rethrow_nestedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt18bad_variant_access4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt19bad_optional_access4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt20bad_array_new_length4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110error_code7messageEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__decrementableEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__find_c_from_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db15__subscriptableEPKvl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__dereferenceableEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db17__find_c_and_lockEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db8__find_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__111__libcpp_db9__addableEPKvl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112bad_weak_ptr4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_tolowerEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIcE10do_toupperEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_tolowerEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE10do_toupperEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE5do_isEjw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112ctype_bynameIwE9do_narrowEwc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__112strstreambuf6pcountEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__113random_device7entropyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentERKNS_10error_codeEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__114error_category23default_error_conditionEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__115error_condition7messageEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIcE15__do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__118__time_get_storageIwE15__do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__XEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__cEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__rEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE3__xEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__am_pmEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE7__weeksEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIcE8__monthsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__XEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__cEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__rEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE3__xEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__am_pmEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE7__weeksEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__time_get_c_storageIwE8__monthsEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__124__libcpp_debug_exception4whatEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_tolowerEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEPcPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE10do_toupperEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIcE9do_narrowEcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_scan_isEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_tolowerEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEPwPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE10do_toupperEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE11do_scan_notEjPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEPKwS3_Pj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE5do_isEjw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE8do_widenEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__15ctypeIwE9do_narrowEwc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale4nameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale9has_facetERNS0_2idE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16locale9use_facetERNS0_2idE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__16localeeqERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE12do_transformEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIcE7do_hashEPKcS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE12do_transformEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17collateIwE7do_hashEPKwS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18ios_base6getlocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIcE8do_closeEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18messagesIwE8do_closeEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE11do_truenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE12do_falsenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIcE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_groupingEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE11do_truenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE12do_falsenameEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_decimal_pointEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18numpunctIwE16do_thousands_sepEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt8bad_cast4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9bad_alloc4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNKSt9exception4whatEv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt10bad_typeidD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_errorC2ERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11logic_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt11logic_erroraSERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt11range_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12domain_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt12experimental19bad_optional_accessD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12length_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt12out_of_rangeD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13bad_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrC2ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptrD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13exception_ptraSERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC1ERKS_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_errorC2ERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt13runtime_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt13runtime_erroraSERKS_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt14overflow_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt16nested_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt19bad_optional_accessD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt20bad_array_new_lengthD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_getD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110__time_putD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110adopt_lockE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5alnumE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5alphaE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5blankE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5cntrlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5digitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5graphE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5lowerE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5printE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5punctE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5spaceE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base5upperE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110ctype_base6xdigitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110defer_lockE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110istrstreamD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIcLb1EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb0EE4intlE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__110moneypunctIwLb1EE4intlE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110ostrstreamD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__110to_wstringEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__call_onceERVmPvPFvS2_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db10__insert_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db11__insert_icEPvPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db15__iterator_copyEPvPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db16__invalidate_allEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db4swapEPvS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_cEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_db9__erase_iEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__libcpp_dbD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111regex_errorD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__111timed_mutexD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__111try_to_lockE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__do_nothingEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__get_sp_mutEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__next_primeEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112__rs_default4__c_E', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112__rs_defaultclEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112ctype_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112future_errorD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_1E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_2E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_3E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_4E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_5E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_6E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_7E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_8E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders2_9E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__112placeholders3_10E', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf3strEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf4swapERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf6__initEPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf6freezeEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambuf9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKal'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPKhl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPalS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1EPhlS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC1El'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPFPvmEPFvS1_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKal'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPKhl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPalS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPclS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2EPhlS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufC2El'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112strstreambufD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__112system_errorD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__113allocator_argE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreEli'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113random_deviceclEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__113shared_futureIvEaSERKS1_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__get_const_dbEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__114__num_get_base5__srcE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base12__format_intEPcPKcbj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base14__format_floatEPcPKcj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_count12__add_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_count16__release_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114__shared_countD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114collate_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__114error_categoryD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__get_classnameEPKcb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115__thread_structD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115future_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcE6__initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIcED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwE6__initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115numpunct_bynameIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115recursive_mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__115system_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116__narrow_to_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__116generic_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state12__make_readyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state16__on_zero_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4copyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state4waitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9__executeEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__assoc_sub_state9set_valueEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm16EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117__widen_from_utf8ILm32EED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117declare_reachableEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117iostream_categoryEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_allEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable10notify_oneEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variableD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118condition_variableD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118get_pointer_safetyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex11lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex13unlock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex15try_lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__118shared_timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base11lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base13unlock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base15try_lock_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_base8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_mutex_baseC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count10__add_weakEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count12__add_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count14__release_weakEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count16__release_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_count4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__shared_weak_countD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119__start_std_streamsE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119__thread_local_dataEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__119declare_no_pointersEPcm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__119piecewise_constructE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__get_collation_nameEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__120__throw_system_errorEiPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__throw_runtime_errorEPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121__undeclare_reachableEPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121recursive_timed_mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__121undeclare_no_pointersEPcm'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__123__libcpp_debug_functionE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__124__libcpp_debug_exceptionD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__13cinE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14cerrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14clogE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14coutE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC1EPKjbm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC2EPKjbm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15ctypeIwED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex6unlockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutex8try_lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutexD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15mutexD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wcerrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wclogE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__15wcoutE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock3nowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12steady_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock11from_time_tEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock3nowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9is_steadyE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvE3getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16futureIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16gslice6__initEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale2id5__getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale2id6__initEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale2id9__next_idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale3allE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale4noneE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale4timeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale5ctypeE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facet16__on_zero_sharedEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale5facetD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale6globalERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale7classicEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7collateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale7numericE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16locale8__globalEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8messagesE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__16locale8monetaryE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_PKci'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1ERKS0_S2_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2EPKc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_PKci'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2ERKS0_S2_i'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16localeaSERKS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread20hardware_concurrencyEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread4joinEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16thread6detachEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16threadD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__16threadD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDic11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIDsc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIcc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17codecvtIwc11__mbstate_tED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17collateIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17collateIwED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE10get_futureEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE24set_value_at_thread_exitEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvE9set_valueEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvEC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvEC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__17promiseIvED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_node5__addEPNS_8__i_nodeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__c_nodeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__get_dbEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__i_nodeD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__i_nodeD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__rs_getEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__sp_mut4lockEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18__sp_mut6unlockEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base10floatfieldE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base10scientificE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base11adjustfieldE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base15sync_with_stdioEb'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base16__call_callbacksENS0_5eventE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base2inE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3appE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3ateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3decE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3hexE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3octE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base3outE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitC2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4InitD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4initEPv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base4leftE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4moveERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base4swapERS0_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5clearEj'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5fixedE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5imbueERKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5iwordEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base5pwordEi'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5rightE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base5truncE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6badbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6binaryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6eofbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base6skipwsE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base6xallocEv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7copyfmtERKS0_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failbitE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_base7failureD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7goodbitE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7showposE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base7unitbufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base8internalE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base8showbaseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9__xindex_E', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9basefieldE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9boolalphaE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9showpointE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18ios_base9uppercaseE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18ios_baseD2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18messagesIcE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18messagesIwE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIcED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18numpunctIwED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImE6resizeEmm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImEC1Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImEC2Em'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__18valarrayImED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'size': 0}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19strstreamD2Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEd'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEe'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEf'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEi'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEj'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEl'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEx'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__19to_stringEy'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt8bad_castD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocC2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9bad_allocD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9exceptionD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD0Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD1Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZNSt9type_infoD2Ev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt10unexpectedv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt10unexpectedv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt13get_terminatev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt13get_terminatev'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt13set_terminatePFvvE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt14get_unexpectedv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt14get_unexpectedv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt14set_unexpectedPFvvE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt15get_new_handlerv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt15get_new_handlerv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt15set_new_handlerPFvvE'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17__throw_bad_allocv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17current_exceptionv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt17rethrow_exceptionSt13exception_ptr'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt18uncaught_exceptionv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZSt19uncaught_exceptionsv'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZSt7nothrow', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZSt9terminatev'}
+{'type': 'I', 'is_defined': True, 'name': '__ZSt9terminatev'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIDs'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110__time_getE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110__time_putE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111__money_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__num_get_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__num_put_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__118__time_get_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__118__time_get_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__time_get_c_storageIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__120__time_get_c_storageIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__124__libcpp_debug_exceptionE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTINSt3__19time_baseE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPKy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPKy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIPy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIPy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTISt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTISt9type_info'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTId'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTId'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTIy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTIy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110ctype_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110money_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112codecvt_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__113messages_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_getIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_getIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_putIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19__num_putIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19strstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSNSt3__19time_baseE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDn'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDn'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKDs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKDs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPKy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPKy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSPy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSPy'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSSt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSSt9type_info'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSa'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSa'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSb'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSb'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSd'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSd'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSe'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSe'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSf'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSf'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSh'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSh'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSi'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSi'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSj'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSj'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSl'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSl'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSm'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSm'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSs'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSs'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSt'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSt'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSv'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSv'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSw'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSw'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSx'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSx'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTSy'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTSy'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTTNSt3__19strstreamE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv116__enum_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__array_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv117__pbase_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv119__pointer_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__function_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv120__si_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv121__vmi_class_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv123__fundamental_type_infoE'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVN10__cxxabiv129__pointer_to_member_type_infoE'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt12experimental19bad_optional_accessE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110istrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110moneypunctIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__110ostrstreamE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__111regex_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112bad_weak_ptrE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112ctype_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112future_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112strstreambufE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__112system_errorE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__codecvt_utf8IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114__shared_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114collate_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__114error_categoryE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115messages_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115numpunct_bynameIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__assoc_sub_stateE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__119__shared_weak_countE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__124__libcpp_debug_exceptionE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__15ctypeIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__15ctypeIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__16locale5facetE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17collateIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17collateIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18__c_nodeE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18ios_base7failureE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18ios_baseE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18messagesIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18messagesIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18numpunctIcEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18numpunctIwEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVNSt3__19strstreamE', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt10bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt10bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11logic_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11logic_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt11range_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt11range_error'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt12bad_any_cast', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12domain_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12domain_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12length_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12length_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt12out_of_range'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt12out_of_range'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13bad_exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13bad_exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt13runtime_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt13runtime_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt14overflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt14overflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt15underflow_error'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt15underflow_error'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16bad_array_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16bad_array_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16invalid_argument'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16invalid_argument'}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt16nested_exception', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt18bad_variant_access', 'size': 0}
+{'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt19bad_optional_access', 'size': 0}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt20bad_array_new_length'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt8bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt8bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9bad_alloc'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9bad_alloc'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9exception'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9exception'}
+{'type': 'U', 'is_defined': False, 'name': '__ZTVSt9type_info'}
+{'type': 'I', 'is_defined': True, 'name': '__ZTVSt9type_info'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZThn16_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110istrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__110ostrstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD0Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZTv0_n24_NSt3__19strstreamD1Ev'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdaPvmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPv'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZdlPvmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__Znam'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnamSt11align_val_tRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__Znwm'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmRKSt9nothrow_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_t'}
+{'type': 'FUNC', 'is_defined': True, 'name': '__ZnwmSt11align_val_tRKSt9nothrow_t'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_allocate_exception'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_allocate_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_atexit'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_cast'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_cast'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_bad_typeid'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_bad_typeid'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_begin_catch'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_begin_catch'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_call_unexpected'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_call_unexpected'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_current_exception_type'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_current_exception_type'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_current_primary_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_decrement_exception_refcount'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_demangle'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_demangle'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_end_catch'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_end_catch'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_free_exception'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_free_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_exception_ptr'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_exception_ptr'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_get_globals_fast'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_get_globals_fast'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_abort'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_abort'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_acquire'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_acquire'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_guard_release'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_guard_release'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_increment_exception_refcount'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_pure_virtual'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_pure_virtual'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_rethrow'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_rethrow_primary_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_throw'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_throw'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_uncaught_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cctor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cctor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_cleanup'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_cleanup'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_ctor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_ctor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete2'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete2'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_delete3'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_delete3'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_dtor'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_dtor'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new2'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new2'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_vec_new3'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_vec_new3'}
+{'type': 'U', 'is_defined': False, 'name': '___dynamic_cast'}
+{'type': 'I', 'is_defined': True, 'name': '___dynamic_cast'}
+{'type': 'U', 'is_defined': False, 'name': '___gxx_personality_v0'}
+{'type': 'I', 'is_defined': True, 'name': '___gxx_personality_v0'}
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/abi/x86_64-unknown-linux-gnu.abilist b/chromium/buildtools/third_party/libc++/trunk/lib/abi/x86_64-unknown-linux-gnu.abilist
new file mode 100644
index 00000000000..d6fd52488a6
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/abi/x86_64-unknown-linux-gnu.abilist
@@ -0,0 +1,1883 @@
+{'is_defined': False, 'name': '_ZNKSt11logic_error4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt12bad_any_cast4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt12experimental15fundamentals_v112bad_any_cast4whatEv', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNKSt13runtime_error4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt16nested_exception14rethrow_nestedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt18bad_variant_access4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt19bad_optional_access4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110__time_put8__do_putEPcRS1_PK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110__time_put8__do_putEPwRS1_PK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110error_code7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIcLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db15__decrementableEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db15__find_c_from_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db15__subscriptableEPKvl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db17__dereferenceableEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db17__find_c_and_lockEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db22__less_than_comparableEPKvS2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db8__find_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__111__libcpp_db9__addableEPKvl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112bad_weak_ptr4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE16find_last_not_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17find_first_not_ofEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5rfindEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE12find_last_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE13find_first_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE16find_last_not_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE17find_first_not_ofEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4copyEPwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4findEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5rfindEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7compareEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIcE10do_tolowerEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIcE10do_toupperEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_scan_isEtPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_tolowerEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE10do_toupperEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE11do_scan_notEtPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEPKwS3_Pt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE5do_isEtw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEPKcS3_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEPKwS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112ctype_bynameIwE9do_narrowEwc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__112strstreambuf6pcountEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__113random_device7entropyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDiE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IDsE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114__codecvt_utf8IwE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114collate_bynameIcE10do_compareEPKcS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114collate_bynameIcE12do_transformEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114collate_bynameIwE10do_compareEPKwS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114collate_bynameIwE12do_transformEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114error_category10equivalentERKNS_10error_codeEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114error_category10equivalentEiRKNS_15error_conditionE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__114error_category23default_error_conditionEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDiLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IDsLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb0EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115__codecvt_utf16IwLb1EE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115basic_streambufIcNS_11char_traitsIcEEE6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115basic_streambufIwNS_11char_traitsIwEEE6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__115error_condition7messageEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIcLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb0EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_neg_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE13do_pos_formatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_curr_symbolEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE14do_frac_digitsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__117moneypunct_bynameIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__118__time_get_storageIcE15__do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__118__time_get_storageIwE15__do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__119__shared_weak_count13__get_deleterERKSt9type_info', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE5do_inER11__mbstate_tPKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE6do_outER11__mbstate_tPKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDiE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE5do_inER11__mbstate_tPKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE6do_outER11__mbstate_tPKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IDsE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE10do_unshiftER11__mbstate_tPcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE5do_inER11__mbstate_tPKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE6do_outER11__mbstate_tPKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__codecvt_utf8_utf16IwE9do_lengthER11__mbstate_tPKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE3__XEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE3__cEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE3__rEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE3__xEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE7__am_pmEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE7__weeksEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIcE8__monthsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE3__XEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE3__cEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE3__rEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE3__xEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE7__am_pmEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE7__weeksEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__time_get_c_storageIwE8__monthsEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__120__vector_base_commonILb1EE20__throw_out_of_rangeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__123__match_any_but_newlineIcE6__execERNS_7__stateIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__123__match_any_but_newlineIwE6__execERNS_7__stateIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__124__libcpp_debug_exception4whatEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE10do_tolowerEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE10do_toupperEPcPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE10do_toupperEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE8do_widenEPKcS3_Pc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE9do_narrowEPKcS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIcE9do_narrowEcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_scan_isEtPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_tolowerEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_toupperEPwPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE10do_toupperEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE11do_scan_notEtPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE5do_isEPKwS3_Pt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE5do_isEtw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE8do_widenEPKcS3_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE8do_widenEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE9do_narrowEPKwS3_cPc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__15ctypeIwE9do_narrowEwc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__16locale4nameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__16locale9has_facetERNS0_2idE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__16locale9use_facetERNS0_2idE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__16localeeqERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE5do_inERS1_PKcS5_RS5_PDiS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE6do_outERS1_PKDiS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDic11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE5do_inERS1_PKcS5_RS5_PDsS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE6do_outERS1_PKDsS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIDsc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE5do_inERS1_PKcS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE6do_outERS1_PKcS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIcc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE10do_unshiftERS1_PcS4_RS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE11do_encodingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE13do_max_lengthEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE16do_always_noconvEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE5do_inERS1_PKcS5_RS5_PwS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE6do_outERS1_PKwS5_RS5_PcS7_RS7_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17codecvtIwc11__mbstate_tE9do_lengthERS1_PKcS5_m', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIcE10do_compareEPKcS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIcE12do_transformEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIcE7do_hashEPKcS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIwE10do_compareEPKwS3_S3_S3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIwE12do_transformEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17collateIwE7do_hashEPKwS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjS8_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEce', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18ios_base6getlocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIcE6do_getEliiRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIcE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIcE8do_closeEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIwE6do_getEliiRKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIwE7do_openERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18messagesIwE8do_closeEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE11do_truenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE12do_falsenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIcE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE11do_groupingEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE11do_truenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE12do_falsenameEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE16do_decimal_pointEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18numpunctIwE16do_thousands_sepEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE13do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKcSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE10__get_yearERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_am_pmERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_monthERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11__get_year4ERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_dateES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_timeES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE11do_get_yearES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_minuteERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE12__get_secondERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_12_hourERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_percentERS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13__get_weekdayERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE13do_date_orderEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE14do_get_weekdayES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE15__get_monthnameERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE16do_get_monthnameES4_S4_RNS_8ios_baseERjP2tm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_weekdaynameERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE17__get_white_spaceERS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE18__get_day_year_numERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE3getES4_S4_RNS_8ios_baseERjP2tmPKwSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjP2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE9__get_dayERiRS4_S4_RjRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE3putES4_RNS_8ios_baseEcPK2tmPKcSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_RNS_8ios_baseEcPK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE3putES4_RNS_8ios_baseEwPK2tmPKwSC_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPK2tmcc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_bRNS_8ios_baseERjRe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEcRKNS_12basic_stringIcS3_NS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_putES4_bRNS_8ios_baseEce', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwRKNS_12basic_stringIwS3_NS_9allocatorIwEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNKSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_bRNS_8ios_baseEwe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_errorC2ERKS_', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt11logic_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt11logic_erroraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt12experimental19bad_optional_accessD2Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt12length_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt12out_of_rangeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptrC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptrC2ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptrD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptrD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13exception_ptraSERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC1ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC1ERKS_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_errorC2ERKS_', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt13runtime_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt13runtime_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt13runtime_erroraSERKS_', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt14overflow_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt16invalid_argumentD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt16nested_exceptionD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt19bad_optional_accessD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt19bad_optional_accessD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt19bad_optional_accessD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_getD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110__time_putD2Ev', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110adopt_lockE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5alnumE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5alphaE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5blankE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5cntrlE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5digitE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5graphE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5lowerE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5printE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5punctE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5spaceE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base5upperE', 'type': 'OBJECT'}
+{'size': 2, 'is_defined': True, 'name': '_ZNSt3__110ctype_base6xdigitE', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110defer_lockE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110istrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110istrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110istrstreamD2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb0EE2idE', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb0EE4intlE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb1EE2idE', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIcLb1EE4intlE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb0EE2idE', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb0EE4intlE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb1EE2idE', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__110moneypunctIwLb1EE4intlE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__110ostrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110ostrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110ostrstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__110to_wstringEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__call_onceERVmPvPFvS2_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db10__insert_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db10__insert_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db11__insert_icEPvPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db15__iterator_copyEPvPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db16__invalidate_allEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db4swapEPvS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db9__erase_cEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_db9__erase_iEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_dbC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_dbC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_dbD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__libcpp_dbD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_getIcE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_SF_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_getIwE13__gather_infoEbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_SJ_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_putIcE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERcS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESF_SF_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_putIcE8__formatEPcRS2_S3_jPKcS5_RKNS_5ctypeIcEEbRKNS_10money_base7patternEccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEESL_SL_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_putIwE13__gather_infoEbbRKNS_6localeERNS_10money_base7patternERwS8_RNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS9_IwNSA_IwEENSC_IwEEEESJ_Ri', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111__money_putIwE8__formatEPwRS2_S3_jPKwS5_RKNS_5ctypeIwEEbRKNS_10money_base7patternEwwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNSE_IwNSF_IwEENSH_IwEEEESQ_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorC1ENS_15regex_constants10error_typeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorC2ENS_15regex_constants10error_typeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111regex_errorD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__111timed_mutexD2Ev', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__111try_to_lockE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112__do_nothingEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__get_sp_mutEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__next_primeEm', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__112__rs_default4__c_E', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultclEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE21__grow_by_and_replaceEmmmmmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE2atEm', 'type': 'FUNC'}
+{'size': 8, 'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4nposE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE5eraseEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertENS_11__wrap_iterIPKcEEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6insertEmmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6resizeEmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7replaceEmmmc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC1ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE21__grow_by_and_replaceEmmmmmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE2atEm', 'type': 'FUNC'}
+{'size': 8, 'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE4nposE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE5eraseEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEPKwmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6__initEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignERKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6assignEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertENS_11__wrap_iterIPKwEEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6insertEmmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmPKwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmRKS5_mm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7replaceEmmmw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE7reserveEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9__grow_byEmmmmmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC1ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_RKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEC2ERKS5_mmRKS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSERKS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEaSEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112ctype_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorC1ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorC2ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112future_errorD2Ev', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_1E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_2E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_3E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_4E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_5E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_6E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_7E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_8E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders2_9E', 'type': 'OBJECT'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__112placeholders3_10E', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf3strEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf4swapERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf6__initEPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf6freezeEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambuf9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPFPvmEPFvS1_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPKal', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPKhl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPalS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1EPhlS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC1El', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPFPvmEPFvS1_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPKal', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPKhl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPalS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPclS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2EPhlS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufC2El', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112strstreambufD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_error6__initERKNS_10error_codeENS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1ENS_10error_codeEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC1EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2ENS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2ENS_10error_codeEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2ENS_10error_codeERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorC2EiRKNS_14error_categoryERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__112system_errorD2Ev', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__113allocator_argE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEPclc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERNS_15basic_streambufIcS2_EEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getERc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4peekEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4readEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5seekgExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5tellgEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE5ungetEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6ignoreEli', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC1ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE6sentryC2ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7getlineEPclc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE7putbackEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEE8readsomeEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRNS_9basic_iosIcS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsEPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIcNS_11char_traitsIcEEErsERy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEPwlw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERNS_15basic_streambufIwS2_EEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getERw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4peekEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4readEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5seekgExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5tellgEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE5ungetEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6ignoreElj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC1ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE6sentryC2ERS3_b', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7getlineEPwlw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE7putbackEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEE8readsomeEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRNS_9basic_iosIwS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsEPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_istreamIwNS_11char_traitsIwEEErsERy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE3putEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5seekpExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5tellpEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5writeEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC1ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryC2ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRNS_9basic_iosIcS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE3putEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpENS_4fposI11__mbstate_tEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5seekpExNS_8ios_base7seekdirE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5tellpEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5writeEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC1ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryC2ERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE6sentryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC1EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEEC2EPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_8ios_baseES5_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRNS_9basic_iosIwS2_EES6_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPFRS3_S4_E', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPKv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEPNS_15basic_streambufIwS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEs', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEt', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEElsEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113random_deviceclEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__113shared_futureIvEaSERKS1_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__get_const_dbEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_get_base10__get_baseERNS_8ios_baseE', 'type': 'FUNC'}
+{'size': 33, 'is_defined': True, 'name': '_ZNSt3__114__num_get_base5__srcE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_put_base12__format_intEPcPKcbj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_put_base14__format_floatEPcPKcj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__num_put_base18__identify_paddingEPcS1_RKNS_8ios_baseE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_count12__add_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_count16__release_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_countD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_countD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114__shared_countD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC1EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEEC2EPNS_15basic_streambufIcS2_EE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114basic_iostreamIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDic11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIDsc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIcc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114codecvt_bynameIwc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114collate_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114error_categoryC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114error_categoryD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114error_categoryD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__114error_categoryD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__get_classnameEPKcb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_struct25notify_all_at_thread_exitEPNS_18condition_variableEPNS_5mutexE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_struct27__make_ready_at_thread_exitEPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_structC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_structC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_structD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115__thread_structD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setgEPcS4_S4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4setpEPcS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5gbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5pbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sgetnEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputcEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5sputnEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE5uflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6sbumpcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6setbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6snextcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsgetnEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE6xsputnEPKcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7pubsyncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE7sungetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8in_availEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8overflowEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE8pubimbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pbackfailEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9pubsetbufEPcl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9showmanycEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9sputbackcEc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEEaSERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE10pubseekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setgEPwS4_S4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4setpEPwS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4swapERS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE4syncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5gbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5pbumpEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sgetnEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputcEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5sputnEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE5uflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6sbumpcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6setbufEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6snextcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsgetnEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE6xsputnEPKwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7pubsyncEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekposENS_4fposI11__mbstate_tEEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7sungetcEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8in_availEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8overflowEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE8pubimbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pbackfailEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9pubsetbufEPwl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9showmanycEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9sputbackcEw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE9underflowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2ERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEEaSERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115future_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcE6__initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIcED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwE6__initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115numpunct_bynameIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115recursive_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__115system_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__check_groupingERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjS8_Rj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm16EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116__narrow_to_utf8ILm32EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__116generic_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state10__sub_waitERNS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state12__make_readyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state13set_exceptionESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state16__on_zero_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state24set_value_at_thread_exitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state28set_exception_at_thread_exitESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state4copyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state4waitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state9__executeEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__assoc_sub_state9set_valueEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm16EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm16EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm16EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117declare_reachableEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117iostream_categoryEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb1EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIwLb0EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIwLb1EE4initEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcE4initERKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcE9__analyzeEcRKNS_5ctypeIcEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcEC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcEC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIcEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwE4initERKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwE9__analyzeEcRKNS_5ctypeIwEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwEC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwEC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwEC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118__time_get_storageIwEC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variable10notify_allEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variable10notify_oneEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variable15__do_timed_waitERNS_11unique_lockINS_5mutexEEENS_6chrono10time_pointINS5_12system_clockENS5_8durationIxNS_5ratioILl1ELl1000000000EEEEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variable4waitERNS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variableD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118condition_variableD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118get_pointer_safetyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex11lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex13unlock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex15try_lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__118shared_timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base11lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base13unlock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base15try_lock_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_base8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_baseC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_mutex_baseC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count10__add_weakEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count12__add_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count14__release_weakEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count16__release_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_count4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119__shared_weak_countD2Ev', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__119__start_std_streamsE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__119__thread_local_dataEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__119declare_no_pointersEPcm', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__119piecewise_constructE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__120__get_collation_nameEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__120__throw_system_errorEiPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE16__at_thread_exitEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121__throw_runtime_errorEPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121__undeclare_reachableEPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutexC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutexC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121recursive_timed_mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__121undeclare_no_pointersEPcm', 'type': 'FUNC'}
+{'size': 8, 'is_defined': True, 'name': '_ZNSt3__123__libcpp_debug_functionE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__124__libcpp_debug_exceptionD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__125__num_get_signed_integralIlEET_PKcS3_Rji', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__125__num_get_signed_integralIxEET_PKcS3_Rji', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__125notify_all_at_thread_exitERNS_18condition_variableENS_11unique_lockINS_5mutexEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIaaEEPaEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIccEEPcEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIddEEPdEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIeeEEPeEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIffEEPfEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIhhEEPhEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIiiEEPiEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIjjEEPjEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIllEEPlEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessImmEEPmEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIssEEPsEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIttEEPtEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIwwEEPwEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIxxEEPxEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__insertion_sort_incompleteIRNS_6__lessIyyEEPyEEbT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__libcpp_set_debug_functionEPFvRKNS_19__libcpp_debug_infoEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__num_get_unsigned_integralIjEET_PKcS3_Rji', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__num_get_unsigned_integralImEET_PKcS3_Rji', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__num_get_unsigned_integralItEET_PKcS3_Rji', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__127__num_get_unsigned_integralIyEET_PKcS3_Rji', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__129__libcpp_abort_debug_functionERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__129__libcpp_throw_debug_functionERKNS_19__libcpp_debug_infoE', 'type': 'FUNC'}
+{'size': 168, 'is_defined': True, 'name': '_ZNSt3__13cinE', 'type': 'OBJECT'}
+{'size': 160, 'is_defined': True, 'name': '_ZNSt3__14cerrE', 'type': 'OBJECT'}
+{'size': 160, 'is_defined': True, 'name': '_ZNSt3__14clogE', 'type': 'OBJECT'}
+{'size': 160, 'is_defined': True, 'name': '_ZNSt3__14coutE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__14stodERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stodERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stofERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stofERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stoiERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stoiERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stolERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'size': 168, 'is_defined': True, 'name': '_ZNSt3__14wcinE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__15alignEmmRPvRm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcE13classic_tableEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcE21__classic_lower_tableEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcE21__classic_upper_tableEv', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__15ctypeIcE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcEC1EPKtbm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcEC2EPKtbm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIcED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__15ctypeIwE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutex4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutex6unlockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutexD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15mutexD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stoldERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stoldERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stollERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stollERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stoulERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__15stoulERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'size': 160, 'is_defined': True, 'name': '_ZNSt3__15wcerrE', 'type': 'OBJECT'}
+{'size': 160, 'is_defined': True, 'name': '_ZNSt3__15wclogE', 'type': 'OBJECT'}
+{'size': 160, 'is_defined': True, 'name': '_ZNSt3__15wcoutE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16__clocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIaaEEPaEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIccEEPcEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIddEEPdEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIeeEEPeEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIffEEPfEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIhhEEPhEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIiiEEPiEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIjjEEPjEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIllEEPlEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessImmEEPmEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIssEEPsEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIttEEPtEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIwwEEPwEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIxxEEPxEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16__sortIRNS_6__lessIyyEEPyEEvT0_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12steady_clock3nowEv', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__16chrono12steady_clock9is_steadyE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock11from_time_tEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock3nowEv', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock9is_steadyE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16chrono12system_clock9to_time_tERKNS0_10time_pointIS1_NS0_8durationIxNS_5ratioILl1ELl1000000EEEEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvE3getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvEC1EPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvEC2EPNS_17__assoc_sub_stateE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16futureIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16gslice6__initEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale14__install_ctorERKS0_PNS0_5facetEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale2id5__getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale2id6__initEv', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale2id9__next_idE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale3allE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale4noneE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale4timeE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale5ctypeE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5facet16__on_zero_sharedEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5facetD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5facetD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale5facetD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale6globalERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16locale7classicEv', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale7collateE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale7numericE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16locale8__globalEv', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale8messagesE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__16locale8monetaryE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKS0_PKci', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1ERKS0_S2_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2EPKc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKS0_PKci', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKS0_RKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2ERKS0_S2_i', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16localeaSERKS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16stoullERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16stoullERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16thread20hardware_concurrencyEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16thread4joinEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16thread6detachEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16threadD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__16threadD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIaaEEPaEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIccEEPcEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIddEEPdEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIeeEEPeEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIffEEPfEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIhhEEPhEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIiiEEPiEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIjjEEPjEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIllEEPlEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessImmEEPmEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIssEEPsEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIttEEPtEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIxxEEPxEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17__sort5IRNS_6__lessIyyEEPyEEjT0_S5_S5_S5_S5_T_', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDic11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIDsc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIcc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2EPKcm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17codecvtIwc11__mbstate_tED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17collateIcE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIcED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17collateIwE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17collateIwED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE10get_futureEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE13set_exceptionESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE24set_value_at_thread_exitEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE28set_exception_at_thread_exitESt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvE9set_valueEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvEC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvEC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__17promiseIvED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__c_node5__addEPNS_8__i_nodeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__c_nodeD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__c_nodeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__c_nodeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__get_dbEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__i_nodeD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__i_nodeD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__rs_getEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__sp_mut4lockEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18__sp_mut6unlockEv', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base10floatfieldE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base10scientificE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base11adjustfieldE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base15sync_with_stdioEb', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base16__call_callbacksENS0_5eventE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base17register_callbackEPFvNS0_5eventERS0_iEi', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base2inE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base34__set_failbit_and_consider_rethrowEv', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3appE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3ateE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3decE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3hexE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3octE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base3outE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4InitC1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4InitC2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4InitD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4InitD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4initEPv', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base4leftE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4moveERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base4swapERS0_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5clearEj', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base5fixedE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5imbueERKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5iwordEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base5pwordEi', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base5rightE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base5truncE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base6badbitE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base6binaryE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base6eofbitE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base6skipwsE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base6xallocEv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7copyfmtERKS0_', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base7failbitE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureC1EPKcRKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureC1ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureC2EPKcRKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureC2ERKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10error_codeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_base7failureD2Ev', 'type': 'FUNC'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base7goodbitE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base7showposE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base7unitbufE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base8internalE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base8showbaseE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9__xindex_E', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9basefieldE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9boolalphaE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9showpointE', 'type': 'OBJECT'}
+{'size': 4, 'is_defined': True, 'name': '_ZNSt3__18ios_base9uppercaseE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_baseD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_baseD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18ios_baseD2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18messagesIcE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18messagesIwE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18numpunctIcE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIcED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18numpunctIwE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18numpunctIwED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImE6resizeEmm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImEC1Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImEC2Em', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__18valarrayImED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIcE17__stage2_int_loopEciPcRS2_RjcRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_S2_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIcE17__stage2_int_prepERNS_8ios_baseEPcRc', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIcE19__stage2_float_loopEcRbRcPcRS4_ccRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjS4_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIcE19__stage2_float_prepERNS_8ios_baseEPcRcS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIwE17__stage2_int_loopEwiPcRS2_RjwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSD_Pw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIwE17__stage2_int_prepERNS_8ios_baseEPwRw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIwE19__stage2_float_loopEwRbRcPcRS4_wwRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPjRSE_RjPw', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_getIwE19__stage2_float_prepERNS_8ios_baseEPwRwS5_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_putIcE21__widen_and_group_intEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_putIcE23__widen_and_group_floatEPcS2_S2_S2_RS2_S3_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_putIwE21__widen_and_group_intEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19__num_putIwE23__widen_and_group_floatEPcS2_S2_PwRS3_S4_RKNS_6localeE', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEE7copyfmtERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIcNS_11char_traitsIcEEED2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEE7copyfmtERKS3_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19basic_iosIwNS_11char_traitsIwEEED2Ev', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIcEERNS_10unique_ptrIcPFvPvEEERPcSM_', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE8__do_getERS4_S4_bRKNS_6localeEjRjRbRKNS_5ctypeIwEERNS_10unique_ptrIwPFvPvEEERPwSM_', 'type': 'FUNC'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEE2idE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE2idE', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZNSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19strstreamD2Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEd', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEe', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEf', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEi', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEj', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEl', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEx', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__19to_stringEy', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EEPKS6_RKS9_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZNSt3__1plIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_12basic_stringIT_T0_T1_EERKS9_PKS6_', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt8bad_castC1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt8bad_castD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt8bad_castD2Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt9bad_allocC1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt9bad_allocD1Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZNSt9exceptionD2Ev', 'type': 'FUNC'}
+{'is_defined': False, 'name': '_ZSt15get_new_handlerv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt17__throw_bad_allocv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt17current_exceptionv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt17rethrow_exceptionSt13exception_ptr', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt18make_exception_ptrINSt3__112future_errorEESt13exception_ptrT_', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt18uncaught_exceptionv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZSt19uncaught_exceptionsv', 'type': 'FUNC'}
+{'size': 1, 'is_defined': True, 'name': '_ZSt7nothrow', 'type': 'OBJECT'}
+{'is_defined': False, 'name': '_ZSt9terminatev', 'type': 'FUNC'}
+{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__110istrstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__110ostrstreamE0_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE0_NS_13basic_istreamIcS2_EE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE16_NS_13basic_ostreamIcS2_EE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__19strstreamE0_NS_13basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 120, 'is_defined': True, 'name': '_ZTCNSt3__19strstreamE0_NS_14basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt12experimental19bad_optional_accessE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__110__time_getE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__110__time_putE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__110ctype_baseE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__110istrstreamE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__110money_baseE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__110moneypunctIcLb0EEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__110moneypunctIcLb1EEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__110moneypunctIwLb0EEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__110moneypunctIwLb1EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__110ostrstreamE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__111__money_getIcEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__111__money_getIwEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__111__money_putIcEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__111__money_putIwEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__111regex_errorE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112bad_weak_ptrE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__112codecvt_baseE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112ctype_bynameIcEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112ctype_bynameIwEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112future_errorE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112strstreambufE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__112system_errorE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__113messages_baseE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IDiEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IDsEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114__codecvt_utf8IwEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__114__num_get_baseE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__114__num_put_baseE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__114__shared_countE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIDic11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIcc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114codecvt_bynameIwc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114collate_bynameIcEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__114collate_bynameIwEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__114error_categoryE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDiLb0EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDiLb1EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDsLb0EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IDsLb1EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IwLb0EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115__codecvt_utf16IwLb1EEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115messages_bynameIcEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115messages_bynameIwEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115numpunct_bynameIcEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115numpunct_bynameIwEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__116__narrow_to_utf8ILm16EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__116__narrow_to_utf8ILm32EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117__assoc_sub_stateE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIwLb1EEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__118__time_get_storageIcEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__118__time_get_storageIwEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__119__shared_weak_countE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDiEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IDsEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__120__codecvt_utf8_utf16IwEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__120__time_get_c_storageIcEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__120__time_get_c_storageIwEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__124__libcpp_debug_exceptionE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__15ctypeIcEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__15ctypeIwEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__16locale5facetE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17codecvtIDic11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17codecvtIDsc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17codecvtIcc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17codecvtIwc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__17collateIcEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__17collateIwEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__18__c_nodeE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__18ios_base7failureE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__18ios_baseE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__18messagesIcEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__18messagesIwEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__18numpunctIcEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__18numpunctIwEE', 'type': 'OBJECT'}
+{'size': 72, 'is_defined': True, 'name': '_ZTINSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 72, 'is_defined': True, 'name': '_ZTINSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__19__num_getIcEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__19__num_getIwEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__19__num_putIcEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTINSt3__19__num_putIwEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTINSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTINSt3__19strstreamE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTINSt3__19time_baseE', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt11logic_error', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTISt12bad_any_cast', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt12length_error', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt12out_of_range', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt13runtime_error', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt14overflow_error', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt16invalid_argument', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTISt16nested_exception', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTISt18bad_variant_access', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTISt19bad_optional_access', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt8bad_cast', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt9bad_alloc', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTISt9exception', 'type': 'OBJECT'}
+{'size': 50, 'is_defined': True, 'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTSNSt12experimental19bad_optional_accessE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110__time_getE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110__time_putE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110ctype_baseE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110istrstreamE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110money_baseE', 'type': 'OBJECT'}
+{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIcLb0EEE', 'type': 'OBJECT'}
+{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIcLb1EEE', 'type': 'OBJECT'}
+{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIwLb0EEE', 'type': 'OBJECT'}
+{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__110moneypunctIwLb1EEE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__110ostrstreamE', 'type': 'OBJECT'}
+{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__111__money_getIcEE', 'type': 'OBJECT'}
+{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__111__money_getIwEE', 'type': 'OBJECT'}
+{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__111__money_putIcEE', 'type': 'OBJECT'}
+{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__111__money_putIwEE', 'type': 'OBJECT'}
+{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__111regex_errorE', 'type': 'OBJECT'}
+{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112bad_weak_ptrE', 'type': 'OBJECT'}
+{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112codecvt_baseE', 'type': 'OBJECT'}
+{'size': 26, 'is_defined': True, 'name': '_ZTSNSt3__112ctype_bynameIcEE', 'type': 'OBJECT'}
+{'size': 26, 'is_defined': True, 'name': '_ZTSNSt3__112ctype_bynameIwEE', 'type': 'OBJECT'}
+{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112future_errorE', 'type': 'OBJECT'}
+{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112strstreambufE', 'type': 'OBJECT'}
+{'size': 23, 'is_defined': True, 'name': '_ZTSNSt3__112system_errorE', 'type': 'OBJECT'}
+{'size': 47, 'is_defined': True, 'name': '_ZTSNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 47, 'is_defined': True, 'name': '_ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 47, 'is_defined': True, 'name': '_ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 47, 'is_defined': True, 'name': '_ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTSNSt3__113messages_baseE', 'type': 'OBJECT'}
+{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IDiEE', 'type': 'OBJECT'}
+{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IDsEE', 'type': 'OBJECT'}
+{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__114__codecvt_utf8IwEE', 'type': 'OBJECT'}
+{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__114__num_get_baseE', 'type': 'OBJECT'}
+{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__114__num_put_baseE', 'type': 'OBJECT'}
+{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__114__shared_countE', 'type': 'OBJECT'}
+{'size': 48, 'is_defined': True, 'name': '_ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 43, 'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 43, 'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 42, 'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 42, 'is_defined': True, 'name': '_ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__114collate_bynameIcEE', 'type': 'OBJECT'}
+{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__114collate_bynameIwEE', 'type': 'OBJECT'}
+{'size': 25, 'is_defined': True, 'name': '_ZTSNSt3__114error_categoryE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'type': 'OBJECT'}
+{'size': 33, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'type': 'OBJECT'}
+{'size': 33, 'is_defined': True, 'name': '_ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'type': 'OBJECT'}
+{'size': 49, 'is_defined': True, 'name': '_ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 49, 'is_defined': True, 'name': '_ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__115messages_bynameIcEE', 'type': 'OBJECT'}
+{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__115messages_bynameIwEE', 'type': 'OBJECT'}
+{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__115numpunct_bynameIcEE', 'type': 'OBJECT'}
+{'size': 29, 'is_defined': True, 'name': '_ZTSNSt3__115numpunct_bynameIwEE', 'type': 'OBJECT'}
+{'size': 77, 'is_defined': True, 'name': '_ZTSNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 77, 'is_defined': True, 'name': '_ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 77, 'is_defined': True, 'name': '_ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 77, 'is_defined': True, 'name': '_ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'type': 'OBJECT'}
+{'size': 28, 'is_defined': True, 'name': '_ZTSNSt3__117__assoc_sub_stateE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'type': 'OBJECT'}
+{'size': 32, 'is_defined': True, 'name': '_ZTSNSt3__118__time_get_storageIcEE', 'type': 'OBJECT'}
+{'size': 32, 'is_defined': True, 'name': '_ZTSNSt3__118__time_get_storageIwEE', 'type': 'OBJECT'}
+{'size': 30, 'is_defined': True, 'name': '_ZTSNSt3__119__shared_weak_countE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__120__time_get_c_storageIcEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__120__time_get_c_storageIwEE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__124__libcpp_debug_exceptionE', 'type': 'OBJECT'}
+{'size': 18, 'is_defined': True, 'name': '_ZTSNSt3__15ctypeIcEE', 'type': 'OBJECT'}
+{'size': 18, 'is_defined': True, 'name': '_ZTSNSt3__15ctypeIwEE', 'type': 'OBJECT'}
+{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__16locale5facetE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__17codecvtIDic11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 35, 'is_defined': True, 'name': '_ZTSNSt3__17codecvtIDsc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__17codecvtIcc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 34, 'is_defined': True, 'name': '_ZTSNSt3__17codecvtIwc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 20, 'is_defined': True, 'name': '_ZTSNSt3__17collateIcEE', 'type': 'OBJECT'}
+{'size': 20, 'is_defined': True, 'name': '_ZTSNSt3__17collateIwEE', 'type': 'OBJECT'}
+{'size': 68, 'is_defined': True, 'name': '_ZTSNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 68, 'is_defined': True, 'name': '_ZTSNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 68, 'is_defined': True, 'name': '_ZTSNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 68, 'is_defined': True, 'name': '_ZTSNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 18, 'is_defined': True, 'name': '_ZTSNSt3__18__c_nodeE', 'type': 'OBJECT'}
+{'size': 26, 'is_defined': True, 'name': '_ZTSNSt3__18ios_base7failureE', 'type': 'OBJECT'}
+{'size': 18, 'is_defined': True, 'name': '_ZTSNSt3__18ios_baseE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__18messagesIcEE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__18messagesIwEE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__18numpunctIcEE', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSNSt3__18numpunctIwEE', 'type': 'OBJECT'}
+{'size': 69, 'is_defined': True, 'name': '_ZTSNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 69, 'is_defined': True, 'name': '_ZTSNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 69, 'is_defined': True, 'name': '_ZTSNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 69, 'is_defined': True, 'name': '_ZTSNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__19__num_getIcEE', 'type': 'OBJECT'}
+{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__19__num_getIwEE', 'type': 'OBJECT'}
+{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__19__num_putIcEE', 'type': 'OBJECT'}
+{'size': 22, 'is_defined': True, 'name': '_ZTSNSt3__19__num_putIwEE', 'type': 'OBJECT'}
+{'size': 42, 'is_defined': True, 'name': '_ZTSNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 42, 'is_defined': True, 'name': '_ZTSNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 70, 'is_defined': True, 'name': '_ZTSNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 70, 'is_defined': True, 'name': '_ZTSNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 70, 'is_defined': True, 'name': '_ZTSNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 70, 'is_defined': True, 'name': '_ZTSNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 19, 'is_defined': True, 'name': '_ZTSNSt3__19strstreamE', 'type': 'OBJECT'}
+{'size': 19, 'is_defined': True, 'name': '_ZTSNSt3__19time_baseE', 'type': 'OBJECT'}
+{'size': 17, 'is_defined': True, 'name': '_ZTSSt12bad_any_cast', 'type': 'OBJECT'}
+{'size': 21, 'is_defined': True, 'name': '_ZTSSt16nested_exception', 'type': 'OBJECT'}
+{'size': 23, 'is_defined': True, 'name': '_ZTSSt18bad_variant_access', 'type': 'OBJECT'}
+{'size': 24, 'is_defined': True, 'name': '_ZTSSt19bad_optional_access', 'type': 'OBJECT'}
+{'size': 32, 'is_defined': True, 'name': '_ZTTNSt3__110istrstreamE', 'type': 'OBJECT'}
+{'size': 32, 'is_defined': True, 'name': '_ZTTNSt3__110ostrstreamE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTTNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTTNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTTNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 16, 'is_defined': True, 'name': '_ZTTNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTTNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTTNSt3__19strstreamE', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVN10__cxxabiv117__class_type_infoE', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVN10__cxxabiv120__si_class_type_infoE', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVN10__cxxabiv121__vmi_class_type_infoE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt12experimental15fundamentals_v112bad_any_castE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt12experimental19bad_optional_accessE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__110istrstreamE', 'type': 'OBJECT'}
+{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIcLb0EEE', 'type': 'OBJECT'}
+{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIcLb1EEE', 'type': 'OBJECT'}
+{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIwLb0EEE', 'type': 'OBJECT'}
+{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__110moneypunctIwLb1EEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__110ostrstreamE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__111regex_errorE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__112bad_weak_ptrE', 'type': 'OBJECT'}
+{'size': 104, 'is_defined': True, 'name': '_ZTVNSt3__112ctype_bynameIcEE', 'type': 'OBJECT'}
+{'size': 136, 'is_defined': True, 'name': '_ZTVNSt3__112ctype_bynameIwEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__112future_errorE', 'type': 'OBJECT'}
+{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__112strstreambufE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__112system_errorE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__113basic_istreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IDiEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IDsEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114__codecvt_utf8IwEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__114__shared_countE', 'type': 'OBJECT'}
+{'size': 120, 'is_defined': True, 'name': '_ZTVNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__114collate_bynameIcEE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__114collate_bynameIwEE', 'type': 'OBJECT'}
+{'size': 72, 'is_defined': True, 'name': '_ZTVNSt3__114error_categoryE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb0EEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDiLb1EEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb0EEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IDsLb1EEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IwLb0EEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__115__codecvt_utf16IwLb1EEE', 'type': 'OBJECT'}
+{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__115messages_bynameIcEE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__115messages_bynameIwEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__115numpunct_bynameIcEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__115numpunct_bynameIwEE', 'type': 'OBJECT'}
+{'size': 224, 'is_defined': True, 'name': '_ZTVNSt3__115time_get_bynameIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 224, 'is_defined': True, 'name': '_ZTVNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__116__narrow_to_utf8ILm16EEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__116__narrow_to_utf8ILm32EEE', 'type': 'OBJECT'}
+{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__117__assoc_sub_stateE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'type': 'OBJECT'}
+{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'type': 'OBJECT'}
+{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'type': 'OBJECT'}
+{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'type': 'OBJECT'}
+{'size': 112, 'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIwLb1EEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__119__shared_weak_countE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDiEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IDsEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__120__codecvt_utf8_utf16IwEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__124__libcpp_debug_exceptionE', 'type': 'OBJECT'}
+{'size': 104, 'is_defined': True, 'name': '_ZTVNSt3__15ctypeIcEE', 'type': 'OBJECT'}
+{'size': 136, 'is_defined': True, 'name': '_ZTVNSt3__15ctypeIwEE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__16locale5facetE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__17codecvtIDic11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__17codecvtIDsc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__17codecvtIcc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 96, 'is_defined': True, 'name': '_ZTVNSt3__17codecvtIwc11__mbstate_tEE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__17collateIcEE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__17collateIwEE', 'type': 'OBJECT'}
+{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 128, 'is_defined': True, 'name': '_ZTVNSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 104, 'is_defined': True, 'name': '_ZTVNSt3__17num_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 104, 'is_defined': True, 'name': '_ZTVNSt3__17num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__18__c_nodeE', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVNSt3__18ios_base7failureE', 'type': 'OBJECT'}
+{'size': 32, 'is_defined': True, 'name': '_ZTVNSt3__18ios_baseE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__18messagesIcEE', 'type': 'OBJECT'}
+{'size': 64, 'is_defined': True, 'name': '_ZTVNSt3__18messagesIwEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__18numpunctIcEE', 'type': 'OBJECT'}
+{'size': 80, 'is_defined': True, 'name': '_ZTVNSt3__18numpunctIwEE', 'type': 'OBJECT'}
+{'size': 168, 'is_defined': True, 'name': '_ZTVNSt3__18time_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 168, 'is_defined': True, 'name': '_ZTVNSt3__18time_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__18time_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 48, 'is_defined': True, 'name': '_ZTVNSt3__18time_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 32, 'is_defined': True, 'name': '_ZTVNSt3__19basic_iosIcNS_11char_traitsIcEEEE', 'type': 'OBJECT'}
+{'size': 32, 'is_defined': True, 'name': '_ZTVNSt3__19basic_iosIwNS_11char_traitsIwEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__19money_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__19money_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__19money_putIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'type': 'OBJECT'}
+{'size': 56, 'is_defined': True, 'name': '_ZTVNSt3__19money_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'type': 'OBJECT'}
+{'size': 120, 'is_defined': True, 'name': '_ZTVNSt3__19strstreamE', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVSt11logic_error', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVSt12bad_any_cast', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVSt12length_error', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVSt12out_of_range', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVSt13runtime_error', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVSt14overflow_error', 'type': 'OBJECT'}
+{'size': 0, 'is_defined': False, 'name': '_ZTVSt16invalid_argument', 'type': 'OBJECT'}
+{'size': 32, 'is_defined': True, 'name': '_ZTVSt16nested_exception', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVSt18bad_variant_access', 'type': 'OBJECT'}
+{'size': 40, 'is_defined': True, 'name': '_ZTVSt19bad_optional_access', 'type': 'OBJECT'}
+{'is_defined': True, 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZThn16_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZThn16_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZThn16_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__110istrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__110istrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__110ostrstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__110ostrstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_istreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_istreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_ostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__113basic_ostreamIwNS_11char_traitsIwEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD0Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZTv0_n24_NSt3__19strstreamD1Ev', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdaPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdaPvRKSt9nothrow_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdaPvSt11align_val_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdaPvSt11align_val_tRKSt9nothrow_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdaPvm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdaPvmSt11align_val_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdlPv', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdlPvRKSt9nothrow_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdlPvSt11align_val_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdlPvSt11align_val_tRKSt9nothrow_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdlPvm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZdlPvmSt11align_val_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_Znam', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZnamRKSt9nothrow_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZnamSt11align_val_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZnamSt11align_val_tRKSt9nothrow_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_Znwm', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZnwmRKSt9nothrow_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZnwmSt11align_val_t', 'type': 'FUNC'}
+{'is_defined': True, 'name': '_ZnwmSt11align_val_tRKSt9nothrow_t', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_allocate_exception', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_begin_catch', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_current_primary_exception', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_decrement_exception_refcount', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_end_catch', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_free_exception', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_guard_abort', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_guard_acquire', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_guard_release', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_increment_exception_refcount', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_pure_virtual', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_rethrow', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_rethrow_primary_exception', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_throw', 'type': 'FUNC'}
+{'is_defined': False, 'name': '__cxa_uncaught_exception', 'type': 'FUNC'}
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/buildit b/chromium/buildtools/third_party/libc++/trunk/lib/buildit
deleted file mode 100755
index 7e3bc2ed2a9..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/lib/buildit
+++ /dev/null
@@ -1,179 +0,0 @@
-#! /bin/sh
-#
-# Set the $TRIPLE environment variable to your system's triple before
-# running this script. If you set $CXX, that will be used to compile
-# the library. Otherwise we'll use clang++.
-
-set -e
-
-if [ `basename $(pwd)` != "lib" ]
-then
- echo "current directory must be lib"
- exit 1
-fi
-
-if [ -z "$CXX" ]
-then
- CXX=clang++
-fi
-
-if [ -z "$CXX_LANG" ]
-then
- CXX_LANG=c++11
-fi
-
-if [ -z "$CC" ]
-then
- CC=clang
-fi
-
-if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]
-then
- if [ -z "$IPHONEOS_DEPLOYMENT_TARGET" ]
- then
- MACOSX_DEPLOYMENT_TARGET=10.7
- fi
-fi
-
-if [ -z "$RC_ProjectSourceVersion" ]
-then
- RC_ProjectSourceVersion=1
-fi
-
-EXTRA_FLAGS="-nostdinc++ -std=${CXX_LANG} -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
- -Wpadded -Wstrict-aliasing=2 -Wstrict-overflow=4 "
-
-case $TRIPLE in
- *-apple-*)
- if [ -z $RC_XBS ]
- then
- RC_CFLAGS="-arch i386 -arch x86_64"
- fi
- SOEXT=dylib
- if [ "$MACOSX_DEPLOYMENT_TARGET" = "10.6" ]
- then
- EXTRA_FLAGS="-nostdinc++ -std=c++11 -U__STRICT_ANSI__"
- LDSHARED_FLAGS="-o libc++.1.dylib \
- -dynamiclib -nodefaultlibs -current_version 1 \
- -compatibility_version 1 \
- -install_name /usr/lib/libc++.1.dylib \
- -Wl,-reexport_library,/usr/lib/libc++abi.dylib \
- -Wl,-unexported_symbols_list,libc++unexp.exp \
- /usr/lib/libSystem.B.dylib"
- else
- if [ -n "$SDKROOT" ]
- then
- EXTRA_FLAGS+="-isysroot ${SDKROOT} "
- if echo "${RC_ARCHS}" | grep -q "armv7"
- then
- RE_EXPORT_LINE="${SDKROOT}/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++sjlj-abi.exp"
- else
- RE_EXPORT_LINE="-Wl,-reexport_library,${SDKROOT}/usr/lib/libc++abi.dylib"
- fi
- CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
- CC=`xcrun -sdk "${SDKROOT}" -find clang`
- else
- # Check if we have _LIBCPPABI_VERSION, to determine the reexport list to use.
- if (echo "#include <cxxabi.h>" | $CXX -E -dM -x c++ - | \
- grep _LIBCPPABI_VERSION > /dev/null)
- then
- RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi2.exp"
- else
- RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi.exp"
- fi
- fi
- LDSHARED_FLAGS="-o libc++.1.dylib \
- -dynamiclib -nodefaultlibs \
- -current_version ${RC_ProjectSourceVersion} \
- -compatibility_version 1 \
- -install_name /usr/lib/libc++.1.dylib \
- -lSystem \
- -Wl,-unexported_symbols_list,libc++unexp.exp \
- ${RE_EXPORT_LINE} \
- -Wl,-force_symbols_not_weak_list,notweak.exp \
- -Wl,-force_symbols_weak_list,weak.exp"
- fi
- ;;
- *-*-mingw*)
- # FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
- SOEXT=dll
- LDSHARED_FLAGS="-o libc++.dll \
- -shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++.dll.a \
- -lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
- ;;
- *-ibm-*)
- hostOS=`uname`
- hostOS=`echo $hostOS | sed -e "s/\s+$//"`
- hostOS=`echo $hostOS | tr '[A-Z]' '[a-z]'`
-
- if [ $hostOS = "linux" ]
- then
- LDSHARED_FLAGS="-o libc++.so.1 \
- -qmkshrobj -Wl,-soname,libc++.so.1 \
- -lpthread -lrt -lc -lstdc++"
- EXTRA_FLAGS="-qlanglvl=extended0x -D__GLIBCXX__=1"
- else
- LDSHARED_FLAGS="-o shr.o -qmkshrobj -lpthread -bnoquiet"
- EXTRA_FLAGS="-qlanglvl=extended0x"
- fi
- RC_CFLAGS="-qpic=large"
- ;;
- *)
- RC_CFLAGS="-fPIC"
- SOEXT=so
- LDSHARED_FLAGS="-o libc++.so.1.0 \
- -shared -nodefaultlibs -Wl,-soname,libc++.so.1 \
- -lpthread -lrt -lc -lstdc++"
- ;;
-esac
-
-if [ -z "$RC_XBS" ]
-then
- rm -f libc++.1.$SOEXT*
-fi
-
-set -x
-
-for FILE in ../src/*.cpp; do
- $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
-done
-case $TRIPLE in
- *-*-mingw*)
- for FILE in ../src/support/win32/*.cpp; do
- $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
- done
- ;;
-esac
-$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
-
-#libtool -static -o libc++.a *.o
-
-# Create the link for the final library name, so that we can use this directory
-# as a link target for the tests.
-case $TRIPLE in
- *-apple-*)
- rm -f libc++.dylib
- ln -s libc++.1.dylib libc++.dylib
- ;;
- *-*-mingw*)
- ;;
- *-ibm-*)
- if [ $hostOS = "linux" ]
- then
- rm -f libc++.so
- ln -s libc++.so.1 libc++.so
- else #AIX
- rm -f libc++.a
- ar r libc++.a shr.o
- fi
- ;;
- *)
- rm -f libc++.so
- ln -s libc++.so.1 libc++.so
- ;;
-esac
-
-if [ -z "$RC_XBS" ]
-then
- rm *.o
-fi
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/libc++abi-new-delete.exp b/chromium/buildtools/third_party/libc++/trunk/lib/libc++abi-new-delete.exp
new file mode 100644
index 00000000000..a9e651dd67e
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/libc++abi-new-delete.exp
@@ -0,0 +1,8 @@
+__ZdaPv
+__ZdlPv
+__ZdlPvRKSt9nothrow_t
+__Znam
+__ZdaPvRKSt9nothrow_t
+__Znwm
+__ZnwmRKSt9nothrow_t
+__ZnamRKSt9nothrow_t
diff --git a/chromium/buildtools/third_party/libc++/trunk/lib/libc++abi2.exp b/chromium/buildtools/third_party/libc++/trunk/lib/libc++abi2.exp
index 47dcbbb88fc..eb088f37057 100644
--- a/chromium/buildtools/third_party/libc++/trunk/lib/libc++abi2.exp
+++ b/chromium/buildtools/third_party/libc++/trunk/lib/libc++abi2.exp
@@ -209,14 +209,6 @@ __ZNSt20bad_array_new_lengthC2Ev
__ZNSt20bad_array_new_lengthD0Ev
__ZNSt20bad_array_new_lengthD2Ev
__ZSt10unexpectedv
-# __ZdaPv
-# __ZdlPv
-# __ZdlPvRKSt9nothrow_t
-# __Znam
-# __ZdaPvRKSt9nothrow_t
-# __Znwm
-# __ZnwmRKSt9nothrow_t
-# __ZnamRKSt9nothrow_t
__ZTISt10bad_typeid
__ZTISt8bad_cast
___cxa_bad_typeid
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/algorithm.cpp b/chromium/buildtools/third_party/libc++/trunk/src/algorithm.cpp
index e548856ff6e..f036eb7abe1 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/algorithm.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/algorithm.cpp
@@ -48,14 +48,14 @@ template bool __insertion_sort_incomplete<__less<long double>&, long double*>(lo
template unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
#ifndef _LIBCPP_HAS_NO_THREADS
-static pthread_mutex_t __rs_mut = PTHREAD_MUTEX_INITIALIZER;
+_LIBCPP_SAFE_STATIC static __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;
#endif
unsigned __rs_default::__c_ = 0;
__rs_default::__rs_default()
{
#ifndef _LIBCPP_HAS_NO_THREADS
- pthread_mutex_lock(&__rs_mut);
+ __libcpp_mutex_lock(&__rs_mut);
#endif
__c_ = 1;
}
@@ -69,7 +69,7 @@ __rs_default::~__rs_default()
{
#ifndef _LIBCPP_HAS_NO_THREADS
if (--__c_ == 0)
- pthread_mutex_unlock(&__rs_mut);
+ __libcpp_mutex_unlock(&__rs_mut);
#else
--__c_;
#endif
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/any.cpp b/chromium/buildtools/third_party/libc++/trunk/src/any.cpp
index f7768457890..45b2337eb35 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/any.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/any.cpp
@@ -7,12 +7,17 @@
//
//===----------------------------------------------------------------------===//
+#include "any"
#include "experimental/any"
-_LIBCPP_BEGIN_NAMESPACE_LFTS
-
+namespace std {
const char* bad_any_cast::what() const _NOEXCEPT {
return "bad any cast";
}
+}
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+const char* bad_any_cast::what() const _NOEXCEPT {
+ return "bad any cast";
+}
_LIBCPP_END_NAMESPACE_LFTS
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/bind.cpp b/chromium/buildtools/third_party/libc++/trunk/src/bind.cpp
index cab0b7c03a9..b318fc16979 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/bind.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/bind.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#define _LIBCPP_BUILDING_BIND
#include "functional"
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -14,16 +15,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace placeholders
{
-__ph<1> _1;
-__ph<2> _2;
-__ph<3> _3;
-__ph<4> _4;
-__ph<5> _5;
-__ph<6> _6;
-__ph<7> _7;
-__ph<8> _8;
-__ph<9> _9;
-__ph<10> _10;
+const __ph<1> _1{};
+const __ph<2> _2{};
+const __ph<3> _3{};
+const __ph<4> _4{};
+const __ph<5> _5{};
+const __ph<6> _6{};
+const __ph<7> _7{};
+const __ph<8> _8{};
+const __ph<9> _9{};
+const __ph<10> _10{};
} // placeholders
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/chrono.cpp b/chromium/buildtools/third_party/libc++/trunk/src/chrono.cpp
index 62149fbf420..9b277a610cd 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/chrono.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/chrono.cpp
@@ -12,14 +12,45 @@
#include "system_error" // __throw_system_error
#include <time.h> // clock_gettime, CLOCK_MONOTONIC and CLOCK_REALTIME
-#if !defined(CLOCK_REALTIME)
-#include <sys/time.h> // for gettimeofday and timeval
+#if (__APPLE__)
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101200
+#define _LIBCXX_USE_CLOCK_GETTIME
+#endif
+#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
+#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 100000
+#define _LIBCXX_USE_CLOCK_GETTIME
+#endif
+#elif defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__)
+#if __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 100000
+#define _LIBCXX_USE_CLOCK_GETTIME
+#endif
+#elif defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__)
+#if __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 30000
+#define _LIBCXX_USE_CLOCK_GETTIME
+#endif
+#endif // __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__
+#else
+#define _LIBCXX_USE_CLOCK_GETTIME
+#endif // __APPLE__
+
+#if defined(_LIBCPP_WIN32API)
+#define WIN32_LEAN_AND_MEAN
+#define VC_EXTRA_LEAN
+#include <Windows.h>
+#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
+#include <winapifamily.h>
#endif
+#else
+#if !defined(CLOCK_REALTIME) || !defined(_LIBCXX_USE_CLOCK_GETTIME)
+#include <sys/time.h> // for gettimeofday and timeval
+#endif // !defined(CLOCK_REALTIME)
+#endif // defined(_LIBCPP_WIN32API)
-#if !defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(CLOCK_MONOTONIC)
+#if !defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK)
#if __APPLE__
#include <mach/mach_time.h> // mach_absolute_time, mach_timebase_info_data_t
-#else
+#elif !defined(_LIBCPP_WIN32API) && !defined(CLOCK_MONOTONIC)
#error "Monotonic clock not implemented"
#endif
#endif
@@ -36,16 +67,42 @@ const bool system_clock::is_steady;
system_clock::time_point
system_clock::now() _NOEXCEPT
{
-#ifdef CLOCK_REALTIME
+#if defined(_LIBCPP_WIN32API)
+ // FILETIME is in 100ns units
+ using filetime_duration =
+ _VSTD::chrono::duration<__int64,
+ _VSTD::ratio_multiply<_VSTD::ratio<100, 1>,
+ nanoseconds::period>>;
+
+ // The Windows epoch is Jan 1 1601, the Unix epoch Jan 1 1970.
+ static _LIBCPP_CONSTEXPR const seconds nt_to_unix_epoch{11644473600};
+
+ FILETIME ft;
+#if _WIN32_WINNT >= _WIN32_WINNT_WIN8
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ GetSystemTimePreciseAsFileTime(&ft);
+#else
+ GetSystemTimeAsFileTime(&ft);
+#endif
+#else
+ GetSystemTimeAsFileTime(&ft);
+#endif
+
+ filetime_duration d{(static_cast<__int64>(ft.dwHighDateTime) << 32) |
+ static_cast<__int64>(ft.dwLowDateTime)};
+ return time_point(duration_cast<duration>(d - nt_to_unix_epoch));
+#else
+#if defined(_LIBCXX_USE_CLOCK_GETTIME) && defined(CLOCK_REALTIME)
struct timespec tp;
if (0 != clock_gettime(CLOCK_REALTIME, &tp))
__throw_system_error(errno, "clock_gettime(CLOCK_REALTIME) failed");
return time_point(seconds(tp.tv_sec) + microseconds(tp.tv_nsec / 1000));
-#else // !CLOCK_REALTIME
+#else
timeval tv;
gettimeofday(&tv, 0);
return time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec));
-#endif // CLOCK_REALTIME
+#endif // _LIBCXX_USE_CLOCK_GETTIME && CLOCK_REALTIME
+#endif
}
time_t
@@ -69,19 +126,20 @@ system_clock::from_time_t(time_t t) _NOEXCEPT
const bool steady_clock::is_steady;
-#ifdef CLOCK_MONOTONIC
+#if defined(__APPLE__)
+// Darwin libc versions >= 1133 provide ns precision via CLOCK_UPTIME_RAW
+#if defined(_LIBCXX_USE_CLOCK_GETTIME) && defined(CLOCK_UPTIME_RAW)
steady_clock::time_point
steady_clock::now() _NOEXCEPT
{
struct timespec tp;
- if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
- __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed");
+ if (0 != clock_gettime(CLOCK_UPTIME_RAW, &tp))
+ __throw_system_error(errno, "clock_gettime(CLOCK_UPTIME_RAW) failed");
return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
}
-#elif defined(__APPLE__)
-
+#else
// mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of
// nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom
// are run time constants supplied by the OS. This clock has no relationship
@@ -90,8 +148,6 @@ steady_clock::now() _NOEXCEPT
// MachInfo.numer / MachInfo.denom is often 1 on the latest equipment. Specialize
// for that case as an optimization.
-#pragma GCC visibility push(hidden)
-
static
steady_clock::rep
steady_simplified()
@@ -129,14 +185,46 @@ init_steady_clock()
return &steady_full;
}
-#pragma GCC visibility pop
-
steady_clock::time_point
steady_clock::now() _NOEXCEPT
{
static FP fp = init_steady_clock();
return time_point(duration(fp()));
}
+#endif // defined(_LIBCXX_USE_CLOCK_GETTIME) && defined(CLOCK_UPTIME_RAW)
+
+#elif defined(_LIBCPP_WIN32API)
+
+steady_clock::time_point
+steady_clock::now() _NOEXCEPT
+{
+ static LARGE_INTEGER freq;
+ static BOOL initialized = FALSE;
+ if (!initialized)
+ initialized = QueryPerformanceFrequency(&freq); // always succceeds
+
+ LARGE_INTEGER counter;
+ QueryPerformanceCounter(&counter);
+ return time_point(duration(counter.QuadPart * nano::den / freq.QuadPart));
+}
+
+#elif defined(CLOCK_MONOTONIC)
+
+// On Apple platforms only CLOCK_UPTIME_RAW or mach_absolute_time are able to
+// time functions in the nanosecond range. Thus, they are the only acceptable
+// implementations of steady_clock.
+#ifdef __APPLE__
+#error "Never use CLOCK_MONOTONIC for steady_clock::now on Apple platforms"
+#endif
+
+steady_clock::time_point
+steady_clock::now() _NOEXCEPT
+{
+ struct timespec tp;
+ if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
+ __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed");
+ return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
+}
#else
#error "Monotonic clock not implemented"
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/condition_variable.cpp b/chromium/buildtools/third_party/libc++/trunk/src/condition_variable.cpp
index 5fd5fc891c1..3f607271b9e 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/condition_variable.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/condition_variable.cpp
@@ -14,25 +14,24 @@
#include "condition_variable"
#include "thread"
#include "system_error"
-#include "cassert"
_LIBCPP_BEGIN_NAMESPACE_STD
condition_variable::~condition_variable()
{
- pthread_cond_destroy(&__cv_);
+ __libcpp_condvar_destroy(&__cv_);
}
void
condition_variable::notify_one() _NOEXCEPT
{
- pthread_cond_signal(&__cv_);
+ __libcpp_condvar_signal(&__cv_);
}
void
condition_variable::notify_all() _NOEXCEPT
{
- pthread_cond_broadcast(&__cv_);
+ __libcpp_condvar_broadcast(&__cv_);
}
void
@@ -41,7 +40,7 @@ condition_variable::wait(unique_lock<mutex>& lk) _NOEXCEPT
if (!lk.owns_lock())
__throw_system_error(EPERM,
"condition_variable::wait: mutex not locked");
- int ec = pthread_cond_wait(&__cv_, lk.mutex()->native_handle());
+ int ec = __libcpp_condvar_wait(&__cv_, lk.mutex()->native_handle());
if (ec)
__throw_system_error(ec, "condition_variable wait failed");
}
@@ -71,7 +70,7 @@ condition_variable::__do_timed_wait(unique_lock<mutex>& lk,
ts.tv_sec = ts_sec_max;
ts.tv_nsec = giga::num - 1;
}
- int ec = pthread_cond_timedwait(&__cv_, lk.mutex()->native_handle(), &ts);
+ int ec = __libcpp_condvar_timedwait(&__cv_, lk.mutex()->native_handle(), &ts);
if (ec != 0 && ec != ETIMEDOUT)
__throw_system_error(ec, "condition_variable timed_wait failed");
}
@@ -79,6 +78,12 @@ condition_variable::__do_timed_wait(unique_lock<mutex>& lk,
void
notify_all_at_thread_exit(condition_variable& cond, unique_lock<mutex> lk)
{
+ auto& tl_ptr = __thread_local_data();
+ // If this thread was not created using std::thread then it will not have
+ // previously allocated.
+ if (tl_ptr.get() == nullptr) {
+ tl_ptr.set_pointer(new __thread_struct);
+ }
__thread_local_data()->notify_all_at_thread_exit(&cond, lk.release());
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/debug.cpp b/chromium/buildtools/third_party/libc++/trunk/src/debug.cpp
index b1a16e6e72d..f2fc1ceb495 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/debug.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/debug.cpp
@@ -7,16 +7,79 @@
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_DEBUG 1
#include "__config"
#include "__debug"
#include "functional"
#include "algorithm"
+#include "string"
+#include "cstdio"
#include "__hash_table"
#include "mutex"
_LIBCPP_BEGIN_NAMESPACE_STD
+static std::string make_what_str(__libcpp_debug_info const& info) {
+ string msg = info.__file_;
+ msg += ":" + to_string(info.__line_) + ": _LIBCPP_ASSERT '";
+ msg += info.__pred_;
+ msg += "' failed. ";
+ msg += info.__msg_;
+ return msg;
+}
+
+_LIBCPP_SAFE_STATIC __libcpp_debug_function_type
+ __libcpp_debug_function = __libcpp_abort_debug_function;
+
+bool __libcpp_set_debug_function(__libcpp_debug_function_type __func) {
+ __libcpp_debug_function = __func;
+ return true;
+}
+
+_LIBCPP_NORETURN void __libcpp_abort_debug_function(__libcpp_debug_info const& info) {
+ std::fprintf(stderr, "%s\n", make_what_str(info).c_str());
+ std::abort();
+}
+
+_LIBCPP_NORETURN void __libcpp_throw_debug_function(__libcpp_debug_info const& info) {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw __libcpp_debug_exception(info);
+#else
+ __libcpp_abort_debug_function(info);
+#endif
+}
+
+struct __libcpp_debug_exception::__libcpp_debug_exception_imp {
+ __libcpp_debug_info __info_;
+ std::string __what_str_;
+};
+
+__libcpp_debug_exception::__libcpp_debug_exception() _NOEXCEPT
+ : __imp_(nullptr) {
+}
+
+__libcpp_debug_exception::__libcpp_debug_exception(
+ __libcpp_debug_info const& info) : __imp_(new __libcpp_debug_exception_imp)
+{
+ __imp_->__info_ = info;
+ __imp_->__what_str_ = make_what_str(info);
+}
+__libcpp_debug_exception::__libcpp_debug_exception(
+ __libcpp_debug_exception const& other) : __imp_(nullptr) {
+ if (other.__imp_)
+ __imp_ = new __libcpp_debug_exception_imp(*other.__imp_);
+}
+
+__libcpp_debug_exception::~__libcpp_debug_exception() _NOEXCEPT {
+ if (__imp_)
+ delete __imp_;
+}
+
+const char* __libcpp_debug_exception::what() const _NOEXCEPT {
+ if (__imp_)
+ return __imp_->__what_str_.c_str();
+ return "__libcpp_debug_exception";
+}
+
_LIBCPP_FUNC_VIS
__libcpp_db*
__get_db()
@@ -152,11 +215,8 @@ __libcpp_db::__insert_c(void* __c)
size_t nc = __next_prime(2*static_cast<size_t>(__cend_ - __cbeg_) + 1);
__c_node** cbeg = static_cast<__c_node**>(calloc(nc, sizeof(void*)));
if (cbeg == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
for (__c_node** p = __cbeg_; p != __cend_; ++p)
{
__c_node* q = *p;
@@ -178,11 +238,8 @@ __libcpp_db::__insert_c(void* __c)
__c_node* r = __cbeg_[hc] =
static_cast<__c_node*>(malloc(sizeof(__c_node)));
if (__cbeg_[hc] == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
r->__c_ = __c;
r->__next_ = p;
++__csz_;
@@ -475,11 +532,8 @@ __c_node::__add(__i_node* i)
__i_node** beg =
static_cast<__i_node**>(malloc(nc * sizeof(__i_node*)));
if (beg == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
if (nc > 1)
memcpy(beg, beg_, nc/2*sizeof(__i_node*));
free(beg_);
@@ -501,11 +555,8 @@ __libcpp_db::__insert_iterator(void* __i)
size_t nc = __next_prime(2*static_cast<size_t>(__iend_ - __ibeg_) + 1);
__i_node** ibeg = static_cast<__i_node**>(calloc(nc, sizeof(void*)));
if (ibeg == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
for (__i_node** p = __ibeg_; p != __iend_; ++p)
{
__i_node* q = *p;
@@ -527,11 +578,8 @@ __libcpp_db::__insert_iterator(void* __i)
__i_node* r = __ibeg_[hi] =
static_cast<__i_node*>(malloc(sizeof(__i_node)));
if (r == nullptr)
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#else
- abort();
-#endif
+ __throw_bad_alloc();
+
::new(r) __i_node(__i, p, nullptr);
++__isz_;
return r;
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/exception.cpp b/chromium/buildtools/third_party/libc++/trunk/src/exception.cpp
index e172f642d48..4359d126173 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/exception.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/exception.cpp
@@ -6,304 +6,31 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#include <stdlib.h>
-#include <stdio.h>
#include "exception"
#include "new"
+#include "typeinfo"
-#if defined(__APPLE__) && !defined(LIBCXXRT)
+#if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) || \
+ (defined(__APPLE__) && !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY))
#include <cxxabi.h>
-
using namespace __cxxabiv1;
#define HAVE_DEPENDENT_EH_ABI 1
- #ifndef _LIBCPPABI_VERSION
- using namespace __cxxabiapple;
- // On Darwin, there are two STL shared libraries and a lower level ABI
- // shared library. The globals holding the current terminate handler and
- // current unexpected handler are in the ABI library.
- #define __terminate_handler __cxxabiapple::__cxa_terminate_handler
- #define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler
- #endif // _LIBCPPABI_VERSION
-#elif defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
- #include <cxxabi.h>
- using namespace __cxxabiv1;
- #if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION)
- #define HAVE_DEPENDENT_EH_ABI 1
- #endif
-#elif !defined(__GLIBCXX__) // defined(LIBCXX_BUILDING_LIBCXXABI)
- static std::terminate_handler __terminate_handler;
- static std::unexpected_handler __unexpected_handler;
-#endif // defined(LIBCXX_BUILDING_LIBCXXABI)
-
-namespace std
-{
-
-#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
-
-// libcxxrt provides implementations of these functions itself.
-unexpected_handler
-set_unexpected(unexpected_handler func) _NOEXCEPT
-{
- return __sync_lock_test_and_set(&__unexpected_handler, func);
-}
-
-unexpected_handler
-get_unexpected() _NOEXCEPT
-{
- return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
-}
-
-_LIBCPP_NORETURN
-void
-unexpected()
-{
- (*get_unexpected())();
- // unexpected handler should not return
- terminate();
-}
-
-terminate_handler
-set_terminate(terminate_handler func) _NOEXCEPT
-{
- return __sync_lock_test_and_set(&__terminate_handler, func);
-}
-
-terminate_handler
-get_terminate() _NOEXCEPT
-{
- return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
-}
-
-#ifndef __EMSCRIPTEN__ // We provide this in JS
-_LIBCPP_NORETURN
-void
-terminate() _NOEXCEPT
-{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- try
- {
-#endif // _LIBCPP_NO_EXCEPTIONS
- (*get_terminate())();
- // handler should not return
- fprintf(stderr, "terminate_handler unexpectedly returned\n");
- ::abort();
-#ifndef _LIBCPP_NO_EXCEPTIONS
- }
- catch (...)
- {
- // handler should not throw exception
- fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
- ::abort();
- }
-#endif // _LIBCPP_NO_EXCEPTIONS
-}
-#endif // !__EMSCRIPTEN__
-#endif // !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
-
-#if !defined(LIBCXXRT) && !defined(__GLIBCXX__) && !defined(__EMSCRIPTEN__)
-bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
-
-int uncaught_exceptions() _NOEXCEPT
-{
-#if defined(__APPLE__) || defined(_LIBCPPABI_VERSION)
- // on Darwin, there is a helper function so __cxa_get_globals is private
-# if _LIBCPPABI_VERSION > 1101
- return __cxa_uncaught_exceptions();
-# else
- return __cxa_uncaught_exception() ? 1 : 0;
-# endif
-#else // __APPLE__
-# if defined(_MSC_VER) && ! defined(__clang__)
- _LIBCPP_WARNING("uncaught_exceptions not yet implemented")
-# else
-# warning uncaught_exception not yet implemented
-# endif
- fprintf(stderr, "uncaught_exceptions not yet implemented\n");
- ::abort();
-#endif // __APPLE__
-}
-
-
-#ifndef _LIBCPPABI_VERSION
-
-exception::~exception() _NOEXCEPT
-{
-}
-
-const char* exception::what() const _NOEXCEPT
-{
- return "std::exception";
-}
-
-#endif // _LIBCPPABI_VERSION
-#endif //LIBCXXRT
-#if !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
-
-bad_exception::~bad_exception() _NOEXCEPT
-{
-}
-
-const char* bad_exception::what() const _NOEXCEPT
-{
- return "std::bad_exception";
-}
-
#endif
-#if defined(__GLIBCXX__)
-
-// libsupc++ does not implement the dependent EH ABI and the functionality
-// it uses to implement std::exception_ptr (which it declares as an alias of
-// std::__exception_ptr::exception_ptr) is not directly exported to clients. So
-// we have little choice but to hijack std::__exception_ptr::exception_ptr's
-// (which fortunately has the same layout as our std::exception_ptr) copy
-// constructor, assignment operator and destructor (which are part of its
-// stable ABI), and its rethrow_exception(std::__exception_ptr::exception_ptr)
-// function.
-
-namespace __exception_ptr
-{
-
-struct exception_ptr
-{
- void* __ptr_;
-
- exception_ptr(const exception_ptr&) _NOEXCEPT;
- exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
- ~exception_ptr() _NOEXCEPT;
-};
-
-}
-
-_LIBCPP_NORETURN void rethrow_exception(__exception_ptr::exception_ptr);
-
-#endif
-
-exception_ptr::~exception_ptr() _NOEXCEPT
-{
-#if HAVE_DEPENDENT_EH_ABI
- __cxa_decrement_exception_refcount(__ptr_);
-#elif defined(__GLIBCXX__)
- reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr();
-#else
-# if defined(_MSC_VER) && ! defined(__clang__)
- _LIBCPP_WARNING("exception_ptr not yet implemented")
-# else
-# warning exception_ptr not yet implemented
-# endif
- fprintf(stderr, "exception_ptr not yet implemented\n");
- ::abort();
-#endif
-}
-
-exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
- : __ptr_(other.__ptr_)
-{
-#if HAVE_DEPENDENT_EH_ABI
- __cxa_increment_exception_refcount(__ptr_);
-#elif defined(__GLIBCXX__)
- new (reinterpret_cast<void*>(this)) __exception_ptr::exception_ptr(
- reinterpret_cast<const __exception_ptr::exception_ptr&>(other));
-#else
-# if defined(_MSC_VER) && ! defined(__clang__)
- _LIBCPP_WARNING("exception_ptr not yet implemented")
-# else
-# warning exception_ptr not yet implemented
-# endif
- fprintf(stderr, "exception_ptr not yet implemented\n");
- ::abort();
-#endif
-}
-
-exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
-{
-#if HAVE_DEPENDENT_EH_ABI
- if (__ptr_ != other.__ptr_)
- {
- __cxa_increment_exception_refcount(other.__ptr_);
- __cxa_decrement_exception_refcount(__ptr_);
- __ptr_ = other.__ptr_;
- }
- return *this;
-#elif defined(__GLIBCXX__)
- *reinterpret_cast<__exception_ptr::exception_ptr*>(this) =
- reinterpret_cast<const __exception_ptr::exception_ptr&>(other);
- return *this;
-#else
-# if defined(_MSC_VER) && ! defined(__clang__)
- _LIBCPP_WARNING("exception_ptr not yet implemented")
-# else
-# warning exception_ptr not yet implemented
-# endif
- fprintf(stderr, "exception_ptr not yet implemented\n");
- ::abort();
-#endif
-}
-
-nested_exception::nested_exception() _NOEXCEPT
- : __ptr_(current_exception())
-{
-}
-
-#if !defined(__GLIBCXX__)
-
-nested_exception::~nested_exception() _NOEXCEPT
-{
-}
-
-#endif
-
-_LIBCPP_NORETURN
-void
-nested_exception::rethrow_nested() const
-{
- if (__ptr_ == nullptr)
- terminate();
- rethrow_exception(__ptr_);
-}
-
-#if !defined(__GLIBCXX__)
-
-exception_ptr current_exception() _NOEXCEPT
-{
-#if HAVE_DEPENDENT_EH_ABI
- // be nicer if there was a constructor that took a ptr, then
- // this whole function would be just:
- // return exception_ptr(__cxa_current_primary_exception());
- exception_ptr ptr;
- ptr.__ptr_ = __cxa_current_primary_exception();
- return ptr;
-#else
-# if defined(_MSC_VER) && ! defined(__clang__)
- _LIBCPP_WARNING( "exception_ptr not yet implemented" )
-# else
-# warning exception_ptr not yet implemented
-# endif
- fprintf(stderr, "exception_ptr not yet implemented\n");
- ::abort();
-#endif
-}
-
-#endif // !__GLIBCXX__
-
-_LIBCPP_NORETURN
-void rethrow_exception(exception_ptr p)
-{
-#if HAVE_DEPENDENT_EH_ABI
- __cxa_rethrow_primary_exception(p.__ptr_);
- // if p.__ptr_ is NULL, above returns so we terminate
- terminate();
+#if defined(_LIBCPP_ABI_MICROSOFT)
+#include "support/runtime/exception_msvc.ipp"
+#include "support/runtime/exception_pointer_msvc.ipp"
+#elif defined(_LIBCPPABI_VERSION)
+#include "support/runtime/exception_libcxxabi.ipp"
+#include "support/runtime/exception_pointer_cxxabi.ipp"
+#elif defined(LIBCXXRT)
+#include "support/runtime/exception_libcxxrt.ipp"
+#include "support/runtime/exception_pointer_cxxabi.ipp"
#elif defined(__GLIBCXX__)
- rethrow_exception(reinterpret_cast<__exception_ptr::exception_ptr&>(p));
+#include "support/runtime/exception_glibcxx.ipp"
+#include "support/runtime/exception_pointer_glibcxx.ipp"
#else
-# if defined(_MSC_VER) && ! defined(__clang__)
- _LIBCPP_WARNING("exception_ptr not yet implemented")
-# else
-# warning exception_ptr not yet implemented
-# endif
- fprintf(stderr, "exception_ptr not yet implemented\n");
- ::abort();
+#include "support/runtime/exception_fallback.ipp"
+#include "support/runtime/exception_pointer_unimplemented.ipp"
#endif
-}
-} // std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/directory_iterator.cpp b/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/directory_iterator.cpp
new file mode 100644
index 00000000000..25135857d40
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/directory_iterator.cpp
@@ -0,0 +1,323 @@
+//===------------------ directory_iterator.cpp ----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "experimental/filesystem"
+#include "__config"
+#if defined(_LIBCPP_WIN32API)
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
+#else
+#include <dirent.h>
+#endif
+#include <errno.h>
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
+
+namespace { namespace detail {
+
+#if !defined(_LIBCPP_WIN32API)
+inline error_code capture_errno() {
+ _LIBCPP_ASSERT(errno, "Expected errno to be non-zero");
+ return error_code{errno, std::generic_category()};
+}
+#endif
+
+template <class ...Args>
+inline bool set_or_throw(std::error_code& my_ec,
+ std::error_code* user_ec,
+ const char* msg, Args&&... args)
+{
+ if (user_ec) {
+ *user_ec = my_ec;
+ return true;
+ }
+ __throw_filesystem_error(msg, std::forward<Args>(args)..., my_ec);
+ return false;
+}
+
+#if !defined(_LIBCPP_WIN32API)
+inline path::string_type posix_readdir(DIR *dir_stream, error_code& ec) {
+ struct dirent* dir_entry_ptr = nullptr;
+ errno = 0; // zero errno in order to detect errors
+ ec.clear();
+ if ((dir_entry_ptr = ::readdir(dir_stream)) == nullptr) {
+ if (errno)
+ ec = capture_errno();
+ return {};
+ } else {
+ return dir_entry_ptr->d_name;
+ }
+}
+#endif
+
+}} // namespace detail
+
+using detail::set_or_throw;
+
+#if defined(_LIBCPP_WIN32API)
+class __dir_stream {
+public:
+ __dir_stream() = delete;
+ __dir_stream& operator=(const __dir_stream&) = delete;
+
+ __dir_stream(__dir_stream&& __ds) noexcept
+ : __stream_(__ds.__stream_), __root_(std::move(__ds.__root_)),
+ __entry_(std::move(__ds.__entry_)) {
+ __ds.__stream_ = INVALID_HANDLE_VALUE;
+ }
+
+ __dir_stream(const path& root, directory_options opts, error_code& ec)
+ : __stream_(INVALID_HANDLE_VALUE), __root_(root) {
+ __stream_ = ::FindFirstFile(root.c_str(), &__data_);
+ if (__stream_ == INVALID_HANDLE_VALUE) {
+ ec = error_code(::GetLastError(), std::generic_category());
+ const bool ignore_permission_denied =
+ bool(opts & directory_options::skip_permission_denied);
+ if (ignore_permission_denied && ec.value() == ERROR_ACCESS_DENIED)
+ ec.clear();
+ return;
+ }
+ }
+
+ ~__dir_stream() noexcept {
+ if (__stream_ == INVALID_HANDLE_VALUE)
+ return;
+ close();
+ }
+
+ bool good() const noexcept { return __stream_ != INVALID_HANDLE_VALUE; }
+
+ bool advance(error_code& ec) {
+ while (::FindNextFile(__stream_, &__data_)) {
+ if (!strcmp(__data_.cFileName, ".") || strcmp(__data_.cFileName, ".."))
+ continue;
+ __entry_.assign(__root_ / __data_.cFileName);
+ return true;
+ }
+ ec = error_code(::GetLastError(), std::generic_category());
+ close();
+ return false;
+ }
+
+private:
+ std::error_code close() noexcept {
+ std::error_code ec;
+ if (!::FindClose(__stream_))
+ ec = error_code(::GetLastError(), std::generic_category());
+ __stream_ = INVALID_HANDLE_VALUE;
+ return ec;
+ }
+
+ HANDLE __stream_{INVALID_HANDLE_VALUE};
+ WIN32_FIND_DATA __data_;
+
+public:
+ path __root_;
+ directory_entry __entry_;
+};
+#else
+class __dir_stream {
+public:
+ __dir_stream() = delete;
+ __dir_stream& operator=(const __dir_stream&) = delete;
+
+ __dir_stream(__dir_stream&& other) noexcept
+ : __stream_(other.__stream_), __root_(std::move(other.__root_)),
+ __entry_(std::move(other.__entry_))
+ {
+ other.__stream_ = nullptr;
+ }
+
+
+ __dir_stream(const path& root, directory_options opts, error_code& ec)
+ : __stream_(nullptr),
+ __root_(root)
+ {
+ if ((__stream_ = ::opendir(root.c_str())) == nullptr) {
+ ec = detail::capture_errno();
+ const bool allow_eacess =
+ bool(opts & directory_options::skip_permission_denied);
+ if (allow_eacess && ec.value() == EACCES)
+ ec.clear();
+ return;
+ }
+ advance(ec);
+ }
+
+ ~__dir_stream() noexcept
+ { if (__stream_) close(); }
+
+ bool good() const noexcept { return __stream_ != nullptr; }
+
+ bool advance(error_code &ec) {
+ while (true) {
+ auto str = detail::posix_readdir(__stream_, ec);
+ if (str == "." || str == "..") {
+ continue;
+ } else if (ec || str.empty()) {
+ close();
+ return false;
+ } else {
+ __entry_.assign(__root_ / str);
+ return true;
+ }
+ }
+ }
+private:
+ std::error_code close() noexcept {
+ std::error_code m_ec;
+ if (::closedir(__stream_) == -1)
+ m_ec = detail::capture_errno();
+ __stream_ = nullptr;
+ return m_ec;
+ }
+
+ DIR * __stream_{nullptr};
+public:
+ path __root_;
+ directory_entry __entry_;
+};
+#endif
+
+// directory_iterator
+
+directory_iterator::directory_iterator(const path& p, error_code *ec,
+ directory_options opts)
+{
+ std::error_code m_ec;
+ __imp_ = make_shared<__dir_stream>(p, opts, m_ec);
+ if (ec) *ec = m_ec;
+ if (!__imp_->good()) {
+ __imp_.reset();
+ if (m_ec)
+ set_or_throw(m_ec, ec,
+ "directory_iterator::directory_iterator(...)", p);
+ }
+}
+
+directory_iterator& directory_iterator::__increment(error_code *ec)
+{
+ _LIBCPP_ASSERT(__imp_, "Attempting to increment an invalid iterator");
+ std::error_code m_ec;
+ if (!__imp_->advance(m_ec)) {
+ __imp_.reset();
+ if (m_ec)
+ set_or_throw(m_ec, ec, "directory_iterator::operator++()");
+ } else {
+ if (ec) ec->clear();
+ }
+ return *this;
+
+}
+
+directory_entry const& directory_iterator::__dereference() const {
+ _LIBCPP_ASSERT(__imp_, "Attempting to dereference an invalid iterator");
+ return __imp_->__entry_;
+}
+
+// recursive_directory_iterator
+
+struct recursive_directory_iterator::__shared_imp {
+ stack<__dir_stream> __stack_;
+ directory_options __options_;
+};
+
+recursive_directory_iterator::recursive_directory_iterator(const path& p,
+ directory_options opt, error_code *ec)
+ : __imp_(nullptr), __rec_(true)
+{
+ if (ec) ec->clear();
+ std::error_code m_ec;
+ __dir_stream new_s(p, opt, m_ec);
+ if (m_ec) set_or_throw(m_ec, ec, "recursive_directory_iterator", p);
+ if (m_ec || !new_s.good()) return;
+
+ __imp_ = _VSTD::make_shared<__shared_imp>();
+ __imp_->__options_ = opt;
+ __imp_->__stack_.push(_VSTD::move(new_s));
+}
+
+void recursive_directory_iterator::__pop(error_code* ec)
+{
+ _LIBCPP_ASSERT(__imp_, "Popping the end iterator");
+ if (ec) ec->clear();
+ __imp_->__stack_.pop();
+ if (__imp_->__stack_.size() == 0)
+ __imp_.reset();
+ else
+ __advance(ec);
+}
+
+directory_options recursive_directory_iterator::options() const {
+ return __imp_->__options_;
+}
+
+int recursive_directory_iterator::depth() const {
+ return __imp_->__stack_.size() - 1;
+}
+
+const directory_entry& recursive_directory_iterator::__dereference() const {
+ return __imp_->__stack_.top().__entry_;
+}
+
+recursive_directory_iterator&
+recursive_directory_iterator::__increment(error_code *ec)
+{
+ if (ec) ec->clear();
+ if (recursion_pending()) {
+ if (__try_recursion(ec) || (ec && *ec))
+ return *this;
+ }
+ __rec_ = true;
+ __advance(ec);
+ return *this;
+}
+
+void recursive_directory_iterator::__advance(error_code* ec) {
+ // REQUIRES: ec must be cleared before calling this function.
+ const directory_iterator end_it;
+ auto& stack = __imp_->__stack_;
+ std::error_code m_ec;
+ while (stack.size() > 0) {
+ if (stack.top().advance(m_ec))
+ return;
+ if (m_ec) break;
+ stack.pop();
+ }
+ __imp_.reset();
+ if (m_ec)
+ set_or_throw(m_ec, ec, "recursive_directory_iterator::operator++()");
+}
+
+bool recursive_directory_iterator::__try_recursion(error_code *ec) {
+
+ bool rec_sym =
+ bool(options() & directory_options::follow_directory_symlink);
+ auto& curr_it = __imp_->__stack_.top();
+
+ if (is_directory(curr_it.__entry_.status()) &&
+ (!is_symlink(curr_it.__entry_.symlink_status()) || rec_sym))
+ {
+ std::error_code m_ec;
+ __dir_stream new_it(curr_it.__entry_.path(), __imp_->__options_, m_ec);
+ if (new_it.good()) {
+ __imp_->__stack_.push(_VSTD::move(new_it));
+ return true;
+ }
+ if (m_ec) {
+ __imp_.reset();
+ set_or_throw(m_ec, ec,
+ "recursive_directory_iterator::operator++()");
+ }
+ }
+ return false;
+}
+
+
+_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/operations.cpp b/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/operations.cpp
new file mode 100644
index 00000000000..2856ae453a6
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/operations.cpp
@@ -0,0 +1,940 @@
+//===--------------------- filesystem/ops.cpp -----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "experimental/filesystem"
+#include "iterator"
+#include "fstream"
+#include "type_traits"
+#include "random" /* for unique_path */
+#include "cstdlib"
+#include "climits"
+
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/statvfs.h>
+#include <fcntl.h> /* values for fchmodat */
+#if !defined(UTIME_OMIT)
+#include <sys/time.h> // for ::utimes as used in __last_write_time
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
+
+filesystem_error::~filesystem_error() {}
+
+
+// POSIX HELPERS
+
+namespace detail { namespace {
+
+using value_type = path::value_type;
+using string_type = path::string_type;
+
+inline std::error_code capture_errno() {
+ _LIBCPP_ASSERT(errno, "Expected errno to be non-zero");
+ return std::error_code(errno, std::generic_category());
+}
+
+void set_or_throw(std::error_code const& m_ec, std::error_code* ec,
+ const char* msg, path const& p = {}, path const& p2 = {})
+{
+ if (ec) {
+ *ec = m_ec;
+ } else {
+ string msg_s("std::experimental::filesystem::");
+ msg_s += msg;
+ __throw_filesystem_error(msg_s, p, p2, m_ec);
+ }
+}
+
+void set_or_throw(std::error_code* ec, const char* msg,
+ path const& p = {}, path const& p2 = {})
+{
+ return set_or_throw(capture_errno(), ec, msg, p, p2);
+}
+
+perms posix_get_perms(const struct ::stat & st) noexcept {
+ return static_cast<perms>(st.st_mode) & perms::mask;
+}
+
+::mode_t posix_convert_perms(perms prms) {
+ return static_cast< ::mode_t>(prms & perms::mask);
+}
+
+file_status create_file_status(std::error_code& m_ec, path const& p,
+ struct ::stat& path_stat,
+ std::error_code* ec)
+{
+ if (ec) *ec = m_ec;
+ if (m_ec && (m_ec.value() == ENOENT || m_ec.value() == ENOTDIR)) {
+ return file_status(file_type::not_found);
+ }
+ else if (m_ec) {
+ set_or_throw(m_ec, ec, "posix_stat", p);
+ return file_status(file_type::none);
+ }
+ // else
+
+ file_status fs_tmp;
+ auto const mode = path_stat.st_mode;
+ if (S_ISLNK(mode)) fs_tmp.type(file_type::symlink);
+ else if (S_ISREG(mode)) fs_tmp.type(file_type::regular);
+ else if (S_ISDIR(mode)) fs_tmp.type(file_type::directory);
+ else if (S_ISBLK(mode)) fs_tmp.type(file_type::block);
+ else if (S_ISCHR(mode)) fs_tmp.type(file_type::character);
+ else if (S_ISFIFO(mode)) fs_tmp.type(file_type::fifo);
+ else if (S_ISSOCK(mode)) fs_tmp.type(file_type::socket);
+ else fs_tmp.type(file_type::unknown);
+
+ fs_tmp.permissions(detail::posix_get_perms(path_stat));
+ return fs_tmp;
+}
+
+file_status posix_stat(path const & p, struct ::stat& path_stat,
+ std::error_code* ec)
+{
+ std::error_code m_ec;
+ if (::stat(p.c_str(), &path_stat) == -1)
+ m_ec = detail::capture_errno();
+ return create_file_status(m_ec, p, path_stat, ec);
+}
+
+file_status posix_stat(path const & p, std::error_code* ec) {
+ struct ::stat path_stat;
+ return posix_stat(p, path_stat, ec);
+}
+
+file_status posix_lstat(path const & p, struct ::stat & path_stat,
+ std::error_code* ec)
+{
+ std::error_code m_ec;
+ if (::lstat(p.c_str(), &path_stat) == -1)
+ m_ec = detail::capture_errno();
+ return create_file_status(m_ec, p, path_stat, ec);
+}
+
+file_status posix_lstat(path const & p, std::error_code* ec) {
+ struct ::stat path_stat;
+ return posix_lstat(p, path_stat, ec);
+}
+
+bool stat_equivalent(struct ::stat& st1, struct ::stat& st2) {
+ return (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino);
+}
+
+// DETAIL::MISC
+
+
+bool copy_file_impl(const path& from, const path& to, perms from_perms,
+ std::error_code *ec)
+{
+ std::ifstream in(from.c_str(), std::ios::binary);
+ std::ofstream out(to.c_str(), std::ios::binary);
+
+ if (in.good() && out.good()) {
+ using InIt = std::istreambuf_iterator<char>;
+ using OutIt = std::ostreambuf_iterator<char>;
+ InIt bin(in);
+ InIt ein;
+ OutIt bout(out);
+ std::copy(bin, ein, bout);
+ }
+ if (out.fail() || in.fail()) {
+ set_or_throw(make_error_code(errc::operation_not_permitted),
+ ec, "copy_file", from, to);
+ return false;
+ }
+ __permissions(to, from_perms, ec);
+ // TODO what if permissions fails?
+ return true;
+}
+
+}} // end namespace detail
+
+using detail::set_or_throw;
+
+path __canonical(path const & orig_p, const path& base, std::error_code *ec)
+{
+ path p = absolute(orig_p, base);
+ char buff[PATH_MAX + 1];
+ char *ret;
+ if ((ret = ::realpath(p.c_str(), buff)) == nullptr) {
+ set_or_throw(ec, "canonical", orig_p, base);
+ return {};
+ }
+ if (ec) ec->clear();
+ return {ret};
+}
+
+void __copy(const path& from, const path& to, copy_options options,
+ std::error_code *ec)
+{
+ const bool sym_status = bool(options &
+ (copy_options::create_symlinks | copy_options::skip_symlinks));
+
+ const bool sym_status2 = bool(options &
+ copy_options::copy_symlinks);
+
+ std::error_code m_ec;
+ struct ::stat f_st = {};
+ const file_status f = sym_status || sym_status2
+ ? detail::posix_lstat(from, f_st, &m_ec)
+ : detail::posix_stat(from, f_st, &m_ec);
+ if (m_ec)
+ return set_or_throw(m_ec, ec, "copy", from, to);
+
+ struct ::stat t_st = {};
+ const file_status t = sym_status ? detail::posix_lstat(to, t_st, &m_ec)
+ : detail::posix_stat(to, t_st, &m_ec);
+
+ if (not status_known(t))
+ return set_or_throw(m_ec, ec, "copy", from, to);
+
+ if (!exists(f) || is_other(f) || is_other(t)
+ || (is_directory(f) && is_regular_file(t))
+ || detail::stat_equivalent(f_st, t_st))
+ {
+ return set_or_throw(make_error_code(errc::function_not_supported),
+ ec, "copy", from, to);
+ }
+
+ if (ec) ec->clear();
+
+ if (is_symlink(f)) {
+ if (bool(copy_options::skip_symlinks & options)) {
+ // do nothing
+ } else if (not exists(t)) {
+ __copy_symlink(from, to, ec);
+ } else {
+ set_or_throw(make_error_code(errc::file_exists),
+ ec, "copy", from, to);
+ }
+ return;
+ }
+ else if (is_regular_file(f)) {
+ if (bool(copy_options::directories_only & options)) {
+ // do nothing
+ }
+ else if (bool(copy_options::create_symlinks & options)) {
+ __create_symlink(from, to, ec);
+ }
+ else if (bool(copy_options::create_hard_links & options)) {
+ __create_hard_link(from, to, ec);
+ }
+ else if (is_directory(t)) {
+ __copy_file(from, to / from.filename(), options, ec);
+ } else {
+ __copy_file(from, to, options, ec);
+ }
+ return;
+ }
+ else if (is_directory(f) && bool(copy_options::create_symlinks & options)) {
+ return set_or_throw(make_error_code(errc::is_a_directory), ec, "copy");
+ }
+ else if (is_directory(f) && (bool(copy_options::recursive & options) ||
+ copy_options::none == options)) {
+
+ if (!exists(t)) {
+ // create directory to with attributes from 'from'.
+ __create_directory(to, from, ec);
+ if (ec && *ec) { return; }
+ }
+ directory_iterator it = ec ? directory_iterator(from, *ec)
+ : directory_iterator(from);
+ if (ec && *ec) { return; }
+ std::error_code m_ec;
+ for (; it != directory_iterator(); it.increment(m_ec)) {
+ if (m_ec) return set_or_throw(m_ec, ec, "copy", from, to);
+ __copy(it->path(), to / it->path().filename(),
+ options | copy_options::__in_recursive_copy, ec);
+ if (ec && *ec) { return; }
+ }
+ }
+}
+
+
+bool __copy_file(const path& from, const path& to, copy_options options,
+ std::error_code *ec)
+{
+ if (ec) ec->clear();
+
+ std::error_code m_ec;
+ auto from_st = detail::posix_stat(from, &m_ec);
+ if (not is_regular_file(from_st)) {
+ if (not m_ec)
+ m_ec = make_error_code(errc::not_supported);
+ set_or_throw(m_ec, ec, "copy_file", from, to);
+ return false;
+ }
+
+ auto to_st = detail::posix_stat(to, &m_ec);
+ if (!status_known(to_st)) {
+ set_or_throw(m_ec, ec, "copy_file", from, to);
+ return false;
+ }
+
+ const bool to_exists = exists(to_st);
+ if (to_exists && !is_regular_file(to_st)) {
+ set_or_throw(make_error_code(errc::not_supported), ec, "copy_file", from, to);
+ return false;
+ }
+ if (to_exists && bool(copy_options::skip_existing & options)) {
+ return false;
+ }
+ else if (to_exists && bool(copy_options::update_existing & options)) {
+ auto from_time = __last_write_time(from, ec);
+ if (ec && *ec) { return false; }
+ auto to_time = __last_write_time(to, ec);
+ if (ec && *ec) { return false; }
+ if (from_time <= to_time) {
+ return false;
+ }
+ return detail::copy_file_impl(from, to, from_st.permissions(), ec);
+ }
+ else if (!to_exists || bool(copy_options::overwrite_existing & options)) {
+ return detail::copy_file_impl(from, to, from_st.permissions(), ec);
+ }
+ else {
+ set_or_throw(make_error_code(errc::file_exists), ec, "copy", from, to);
+ return false;
+ }
+
+ _LIBCPP_UNREACHABLE();
+}
+
+void __copy_symlink(const path& existing_symlink, const path& new_symlink,
+ std::error_code *ec)
+{
+ const path real_path(__read_symlink(existing_symlink, ec));
+ if (ec && *ec) { return; }
+ // NOTE: proposal says you should detect if you should call
+ // create_symlink or create_directory_symlink. I don't think this
+ // is needed with POSIX
+ __create_symlink(real_path, new_symlink, ec);
+}
+
+
+bool __create_directories(const path& p, std::error_code *ec)
+{
+ std::error_code m_ec;
+ auto const st = detail::posix_stat(p, &m_ec);
+ if (!status_known(st)) {
+ set_or_throw(m_ec, ec, "create_directories", p);
+ return false;
+ }
+ else if (is_directory(st)) {
+ if (ec) ec->clear();
+ return false;
+ }
+ else if (exists(st)) {
+ set_or_throw(make_error_code(errc::file_exists),
+ ec, "create_directories", p);
+ return false;
+ }
+
+ const path parent = p.parent_path();
+ if (!parent.empty()) {
+ const file_status parent_st = status(parent, m_ec);
+ if (not status_known(parent_st)) {
+ set_or_throw(m_ec, ec, "create_directories", p);
+ return false;
+ }
+ if (not exists(parent_st)) {
+ __create_directories(parent, ec);
+ if (ec && *ec) { return false; }
+ }
+ }
+ return __create_directory(p, ec);
+}
+
+bool __create_directory(const path& p, std::error_code *ec)
+{
+ if (ec) ec->clear();
+ if (::mkdir(p.c_str(), static_cast<int>(perms::all)) == 0)
+ return true;
+ if (errno != EEXIST || !is_directory(p))
+ set_or_throw(ec, "create_directory", p);
+ return false;
+}
+
+bool __create_directory(path const & p, path const & attributes,
+ std::error_code *ec)
+{
+ struct ::stat attr_stat;
+ std::error_code mec;
+ auto st = detail::posix_stat(attributes, attr_stat, &mec);
+ if (!status_known(st)) {
+ set_or_throw(mec, ec, "create_directory", p, attributes);
+ return false;
+ }
+ if (ec) ec->clear();
+ if (::mkdir(p.c_str(), attr_stat.st_mode) == 0)
+ return true;
+ if (errno != EEXIST || !is_directory(p))
+ set_or_throw(ec, "create_directory", p, attributes);
+ return false;
+}
+
+void __create_directory_symlink(path const & from, path const & to,
+ std::error_code *ec){
+ if (::symlink(from.c_str(), to.c_str()) != 0)
+ set_or_throw(ec, "create_directory_symlink", from, to);
+ else if (ec)
+ ec->clear();
+}
+
+void __create_hard_link(const path& from, const path& to, std::error_code *ec){
+ if (::link(from.c_str(), to.c_str()) == -1)
+ set_or_throw(ec, "create_hard_link", from, to);
+ else if (ec)
+ ec->clear();
+}
+
+void __create_symlink(path const & from, path const & to, std::error_code *ec) {
+
+ if (::symlink(from.c_str(), to.c_str()) == -1)
+ set_or_throw(ec, "create_symlink", from, to);
+ else if (ec)
+ ec->clear();
+}
+
+path __current_path(std::error_code *ec) {
+ auto size = ::pathconf(".", _PC_PATH_MAX);
+ _LIBCPP_ASSERT(size >= 0, "pathconf returned a 0 as max size");
+
+ auto buff = std::unique_ptr<char[]>(new char[size + 1]);
+ char* ret;
+ if ((ret = ::getcwd(buff.get(), static_cast<size_t>(size))) == nullptr) {
+ set_or_throw(ec, "current_path");
+ return {};
+ }
+ if (ec) ec->clear();
+ return {buff.get()};
+}
+
+void __current_path(const path& p, std::error_code *ec) {
+ if (::chdir(p.c_str()) == -1)
+ set_or_throw(ec, "current_path", p);
+ else if (ec)
+ ec->clear();
+}
+
+bool __equivalent(const path& p1, const path& p2, std::error_code *ec)
+{
+ std::error_code ec1, ec2;
+ struct ::stat st1 = {};
+ struct ::stat st2 = {};
+ auto s1 = detail::posix_stat(p1.native(), st1, &ec1);
+ auto s2 = detail::posix_stat(p2.native(), st2, &ec2);
+
+ if ((!exists(s1) && !exists(s2)) || (is_other(s1) && is_other(s2))) {
+ set_or_throw(make_error_code(errc::not_supported), ec,
+ "equivalent", p1, p2);
+ return false;
+ }
+ if (ec) ec->clear();
+ return (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino);
+}
+
+
+std::uintmax_t __file_size(const path& p, std::error_code *ec)
+{
+ std::error_code m_ec;
+ struct ::stat st;
+ file_status fst = detail::posix_stat(p, st, &m_ec);
+ if (!exists(fst) || !is_regular_file(fst)) {
+ if (!m_ec)
+ m_ec = make_error_code(errc::not_supported);
+ set_or_throw(m_ec, ec, "file_size", p);
+ return static_cast<uintmax_t>(-1);
+ }
+ // is_regular_file(p) == true
+ if (ec) ec->clear();
+ return static_cast<std::uintmax_t>(st.st_size);
+}
+
+std::uintmax_t __hard_link_count(const path& p, std::error_code *ec)
+{
+ std::error_code m_ec;
+ struct ::stat st;
+ detail::posix_stat(p, st, &m_ec);
+ if (m_ec) {
+ set_or_throw(m_ec, ec, "hard_link_count", p);
+ return static_cast<std::uintmax_t>(-1);
+ }
+ if (ec) ec->clear();
+ return static_cast<std::uintmax_t>(st.st_nlink);
+}
+
+
+bool __fs_is_empty(const path& p, std::error_code *ec)
+{
+ if (ec) ec->clear();
+ std::error_code m_ec;
+ struct ::stat pst;
+ auto st = detail::posix_stat(p, pst, &m_ec);
+ if (m_ec) {
+ set_or_throw(m_ec, ec, "is_empty", p);
+ return false;
+ }
+ else if (!is_directory(st) && !is_regular_file(st)) {
+ m_ec = make_error_code(errc::not_supported);
+ set_or_throw(m_ec, ec, "is_empty");
+ return false;
+ }
+ else if (is_directory(st)) {
+ auto it = ec ? directory_iterator(p, *ec) : directory_iterator(p);
+ if (ec && *ec)
+ return false;
+ return it == directory_iterator{};
+ }
+ else if (is_regular_file(st))
+ return static_cast<std::uintmax_t>(pst.st_size) == 0;
+
+ _LIBCPP_UNREACHABLE();
+}
+
+
+namespace detail { namespace {
+
+using namespace std::chrono;
+
+template <class CType, class ChronoType>
+bool checked_set(CType* out, ChronoType time) {
+ using Lim = numeric_limits<CType>;
+ if (time > Lim::max() || time < Lim::min())
+ return false;
+ *out = static_cast<CType>(time);
+ return true;
+}
+
+using TimeSpec = struct timespec;
+using StatT = struct stat;
+
+#if defined(__APPLE__)
+TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
+TimeSpec extract_atime(StatT const& st) { return st.st_atimespec; }
+#else
+TimeSpec extract_mtime(StatT const& st) { return st.st_mtim; }
+__attribute__((unused)) // Suppress warning
+TimeSpec extract_atime(StatT const& st) { return st.st_atim; }
+#endif
+
+constexpr auto max_seconds = duration_cast<seconds>(
+ file_time_type::duration::max()).count();
+
+constexpr auto max_nsec = duration_cast<nanoseconds>(
+ file_time_type::duration::max() - seconds(max_seconds)).count();
+
+constexpr auto min_seconds = duration_cast<seconds>(
+ file_time_type::duration::min()).count();
+
+constexpr auto min_nsec_timespec = duration_cast<nanoseconds>(
+ (file_time_type::duration::min() - seconds(min_seconds)) + seconds(1)).count();
+
+// Static assert that these values properly round trip.
+static_assert((seconds(min_seconds) + duration_cast<microseconds>(nanoseconds(min_nsec_timespec)))
+ - duration_cast<microseconds>(seconds(1))
+ == file_time_type::duration::min(), "");
+
+constexpr auto max_time_t = numeric_limits<time_t>::max();
+constexpr auto min_time_t = numeric_limits<time_t>::min();
+
+#if !defined(__LP64__) && defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare"
+#endif
+
+_LIBCPP_CONSTEXPR_AFTER_CXX11
+bool is_representable(TimeSpec const& tm) {
+ if (tm.tv_sec >= 0) {
+ return (tm.tv_sec < max_seconds) ||
+ (tm.tv_sec == max_seconds && tm.tv_nsec <= max_nsec);
+ } else if (tm.tv_sec == (min_seconds - 1)) {
+ return tm.tv_nsec >= min_nsec_timespec;
+ } else {
+ return (tm.tv_sec >= min_seconds);
+ }
+}
+#ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#if defined(__LP64__)
+static_assert(is_representable({max_seconds, max_nsec}), "");
+static_assert(!is_representable({max_seconds + 1, 0}), "");
+static_assert(!is_representable({max_seconds, max_nsec + 1}), "");
+static_assert(!is_representable({max_time_t, 0}), "");
+static_assert(is_representable({min_seconds, 0}), "");
+static_assert(is_representable({min_seconds - 1, min_nsec_timespec}), "");
+static_assert(is_representable({min_seconds - 1, min_nsec_timespec + 1}), "");
+static_assert(!is_representable({min_seconds - 1, min_nsec_timespec - 1}), "");
+static_assert(!is_representable({min_time_t, 999999999}), "");
+#else
+static_assert(is_representable({max_time_t, 999999999}), "");
+static_assert(is_representable({max_time_t, 1000000000}), "");
+static_assert(is_representable({min_time_t, 0}), "");
+#endif
+#endif
+
+_LIBCPP_CONSTEXPR_AFTER_CXX11
+bool is_representable(file_time_type const& tm) {
+ auto secs = duration_cast<seconds>(tm.time_since_epoch());
+ auto nsecs = duration_cast<nanoseconds>(tm.time_since_epoch() - secs);
+ if (nsecs.count() < 0) {
+ secs = secs + seconds(1);
+ nsecs = nsecs + seconds(1);
+ }
+ using TLim = numeric_limits<time_t>;
+ if (secs.count() >= 0)
+ return secs.count() <= TLim::max();
+ return secs.count() >= TLim::min();
+}
+#ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#if defined(__LP64__)
+static_assert(is_representable(file_time_type::max()), "");
+static_assert(is_representable(file_time_type::min()), "");
+#else
+static_assert(!is_representable(file_time_type::max()), "");
+static_assert(!is_representable(file_time_type::min()), "");
+static_assert(is_representable(file_time_type(seconds(max_time_t))), "");
+static_assert(is_representable(file_time_type(seconds(min_time_t))), "");
+#endif
+#endif
+
+_LIBCPP_CONSTEXPR_AFTER_CXX11
+file_time_type convert_timespec(TimeSpec const& tm) {
+ auto adj_msec = duration_cast<microseconds>(nanoseconds(tm.tv_nsec));
+ if (tm.tv_sec >= 0) {
+ auto Dur = seconds(tm.tv_sec) + microseconds(adj_msec);
+ return file_time_type(Dur);
+ } else if (duration_cast<microseconds>(nanoseconds(tm.tv_nsec)).count() == 0) {
+ return file_time_type(seconds(tm.tv_sec));
+ } else { // tm.tv_sec < 0
+ auto adj_subsec = duration_cast<microseconds>(seconds(1) - nanoseconds(tm.tv_nsec));
+ auto Dur = seconds(tm.tv_sec + 1) - adj_subsec;
+ return file_time_type(Dur);
+ }
+}
+#ifndef _LIBCPP_HAS_NO_CXX14_CONSTEXPR
+#if defined(__LP64__)
+static_assert(convert_timespec({max_seconds, max_nsec}) == file_time_type::max(), "");
+static_assert(convert_timespec({max_seconds, max_nsec - 1}) < file_time_type::max(), "");
+static_assert(convert_timespec({max_seconds - 1, 999999999}) < file_time_type::max(), "");
+static_assert(convert_timespec({min_seconds - 1, min_nsec_timespec}) == file_time_type::min(), "");
+static_assert(convert_timespec({min_seconds - 1, min_nsec_timespec + 1}) > file_time_type::min(), "");
+static_assert(convert_timespec({min_seconds , 0}) > file_time_type::min(), "");
+#else
+// FIXME add tests for 32 bit builds
+#endif
+#endif
+
+#if !defined(__LP64__) && defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
+template <class SubSecDurT, class SubSecT>
+bool set_times_checked(time_t* sec_out, SubSecT* subsec_out, file_time_type tp) {
+ using namespace chrono;
+ auto dur = tp.time_since_epoch();
+ auto sec_dur = duration_cast<seconds>(dur);
+ auto subsec_dur = duration_cast<SubSecDurT>(dur - sec_dur);
+ // The tv_nsec and tv_usec fields must not be negative so adjust accordingly
+ if (subsec_dur.count() < 0) {
+ if (sec_dur.count() > min_seconds) {
+ sec_dur -= seconds(1);
+ subsec_dur += seconds(1);
+ } else {
+ subsec_dur = SubSecDurT::zero();
+ }
+ }
+ return checked_set(sec_out, sec_dur.count())
+ && checked_set(subsec_out, subsec_dur.count());
+}
+
+}} // end namespace detail
+
+file_time_type __last_write_time(const path& p, std::error_code *ec)
+{
+ using namespace ::std::chrono;
+ std::error_code m_ec;
+ struct ::stat st;
+ detail::posix_stat(p, st, &m_ec);
+ if (m_ec) {
+ set_or_throw(m_ec, ec, "last_write_time", p);
+ return file_time_type::min();
+ }
+ if (ec) ec->clear();
+ auto ts = detail::extract_mtime(st);
+ if (!detail::is_representable(ts)) {
+ set_or_throw(error_code(EOVERFLOW, generic_category()), ec,
+ "last_write_time", p);
+ return file_time_type::min();
+ }
+ return detail::convert_timespec(ts);
+}
+
+void __last_write_time(const path& p, file_time_type new_time,
+ std::error_code *ec)
+{
+ using namespace std::chrono;
+ std::error_code m_ec;
+
+ // We can use the presence of UTIME_OMIT to detect platforms that do not
+ // provide utimensat.
+#if !defined(UTIME_OMIT)
+ // This implementation has a race condition between determining the
+ // last access time and attempting to set it to the same value using
+ // ::utimes
+ struct ::stat st;
+ file_status fst = detail::posix_stat(p, st, &m_ec);
+ if (m_ec && !status_known(fst)) {
+ set_or_throw(m_ec, ec, "last_write_time", p);
+ return;
+ }
+ auto atime = detail::extract_atime(st);
+ struct ::timeval tbuf[2];
+ tbuf[0].tv_sec = atime.tv_sec;
+ tbuf[0].tv_usec = duration_cast<microseconds>(nanoseconds(atime.tv_nsec)).count();
+ const bool overflowed = !detail::set_times_checked<microseconds>(
+ &tbuf[1].tv_sec, &tbuf[1].tv_usec, new_time);
+
+ if (overflowed) {
+ set_or_throw(make_error_code(errc::invalid_argument), ec,
+ "last_write_time", p);
+ return;
+ }
+ if (::utimes(p.c_str(), tbuf) == -1) {
+ m_ec = detail::capture_errno();
+ }
+#else
+ struct ::timespec tbuf[2];
+ tbuf[0].tv_sec = 0;
+ tbuf[0].tv_nsec = UTIME_OMIT;
+
+ const bool overflowed = !detail::set_times_checked<nanoseconds>(
+ &tbuf[1].tv_sec, &tbuf[1].tv_nsec, new_time);
+ if (overflowed) {
+ set_or_throw(make_error_code(errc::invalid_argument),
+ ec, "last_write_time", p);
+ return;
+ }
+ if (::utimensat(AT_FDCWD, p.c_str(), tbuf, 0) == -1) {
+ m_ec = detail::capture_errno();
+ }
+#endif
+ if (m_ec)
+ set_or_throw(m_ec, ec, "last_write_time", p);
+ else if (ec)
+ ec->clear();
+}
+
+
+void __permissions(const path& p, perms prms, std::error_code *ec)
+{
+
+ const bool resolve_symlinks = !bool(perms::symlink_nofollow & prms);
+ const bool add_perms = bool(perms::add_perms & prms);
+ const bool remove_perms = bool(perms::remove_perms & prms);
+ _LIBCPP_ASSERT(!(add_perms && remove_perms),
+ "Both add_perms and remove_perms are set");
+
+ bool set_sym_perms = false;
+ prms &= perms::mask;
+ if (!resolve_symlinks || (add_perms || remove_perms)) {
+ std::error_code m_ec;
+ file_status st = resolve_symlinks ? detail::posix_stat(p, &m_ec)
+ : detail::posix_lstat(p, &m_ec);
+ set_sym_perms = is_symlink(st);
+ if (m_ec) return set_or_throw(m_ec, ec, "permissions", p);
+ _LIBCPP_ASSERT(st.permissions() != perms::unknown,
+ "Permissions unexpectedly unknown");
+ if (add_perms)
+ prms |= st.permissions();
+ else if (remove_perms)
+ prms = st.permissions() & ~prms;
+ }
+ const auto real_perms = detail::posix_convert_perms(prms);
+
+# if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_FDCWD)
+ const int flags = set_sym_perms ? AT_SYMLINK_NOFOLLOW : 0;
+ if (::fchmodat(AT_FDCWD, p.c_str(), real_perms, flags) == -1) {
+ return set_or_throw(ec, "permissions", p);
+ }
+# else
+ if (set_sym_perms)
+ return set_or_throw(make_error_code(errc::operation_not_supported),
+ ec, "permissions", p);
+ if (::chmod(p.c_str(), real_perms) == -1) {
+ return set_or_throw(ec, "permissions", p);
+ }
+# endif
+ if (ec) ec->clear();
+}
+
+
+path __read_symlink(const path& p, std::error_code *ec) {
+ char buff[PATH_MAX + 1];
+ std::error_code m_ec;
+ ::ssize_t ret;
+ if ((ret = ::readlink(p.c_str(), buff, PATH_MAX)) == -1) {
+ set_or_throw(ec, "read_symlink", p);
+ return {};
+ }
+ _LIBCPP_ASSERT(ret <= PATH_MAX, "TODO");
+ _LIBCPP_ASSERT(ret > 0, "TODO");
+ if (ec) ec->clear();
+ buff[ret] = 0;
+ return {buff};
+}
+
+
+bool __remove(const path& p, std::error_code *ec) {
+ if (ec) ec->clear();
+ if (::remove(p.c_str()) == -1) {
+ set_or_throw(ec, "remove", p);
+ return false;
+ }
+ return true;
+}
+
+namespace {
+
+std::uintmax_t remove_all_impl(path const & p, std::error_code& ec)
+{
+ const auto npos = static_cast<std::uintmax_t>(-1);
+ const file_status st = __symlink_status(p, &ec);
+ if (ec) return npos;
+ std::uintmax_t count = 1;
+ if (is_directory(st)) {
+ for (directory_iterator it(p, ec); !ec && it != directory_iterator();
+ it.increment(ec)) {
+ auto other_count = remove_all_impl(it->path(), ec);
+ if (ec) return npos;
+ count += other_count;
+ }
+ if (ec) return npos;
+ }
+ if (!__remove(p, &ec)) return npos;
+ return count;
+}
+
+} // end namespace
+
+std::uintmax_t __remove_all(const path& p, std::error_code *ec) {
+ std::error_code mec;
+ auto count = remove_all_impl(p, mec);
+ if (mec) {
+ set_or_throw(mec, ec, "remove_all", p);
+ return static_cast<std::uintmax_t>(-1);
+ }
+ if (ec) ec->clear();
+ return count;
+}
+
+void __rename(const path& from, const path& to, std::error_code *ec) {
+ if (::rename(from.c_str(), to.c_str()) == -1)
+ set_or_throw(ec, "rename", from, to);
+ else if (ec)
+ ec->clear();
+}
+
+void __resize_file(const path& p, std::uintmax_t size, std::error_code *ec) {
+ if (::truncate(p.c_str(), static_cast<long>(size)) == -1)
+ set_or_throw(ec, "resize_file", p);
+ else if (ec)
+ ec->clear();
+}
+
+space_info __space(const path& p, std::error_code *ec) {
+ space_info si;
+ struct statvfs m_svfs = {};
+ if (::statvfs(p.c_str(), &m_svfs) == -1) {
+ set_or_throw(ec, "space", p);
+ si.capacity = si.free = si.available =
+ static_cast<std::uintmax_t>(-1);
+ return si;
+ }
+ if (ec) ec->clear();
+ // Multiply with overflow checking.
+ auto do_mult = [&](std::uintmax_t& out, std::uintmax_t other) {
+ out = other * m_svfs.f_frsize;
+ if (other == 0 || out / other != m_svfs.f_frsize)
+ out = static_cast<std::uintmax_t>(-1);
+ };
+ do_mult(si.capacity, m_svfs.f_blocks);
+ do_mult(si.free, m_svfs.f_bfree);
+ do_mult(si.available, m_svfs.f_bavail);
+ return si;
+}
+
+file_status __status(const path& p, std::error_code *ec) {
+ return detail::posix_stat(p, ec);
+}
+
+file_status __symlink_status(const path& p, std::error_code *ec) {
+ return detail::posix_lstat(p, ec);
+}
+
+path __system_complete(const path& p, std::error_code *ec) {
+ if (ec) ec->clear();
+ return absolute(p, current_path());
+}
+
+path __temp_directory_path(std::error_code* ec) {
+ const char* env_paths[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"};
+ const char* ret = nullptr;
+
+ for (auto& ep : env_paths)
+ if ((ret = std::getenv(ep)))
+ break;
+ if (ret == nullptr)
+ ret = "/tmp";
+
+ path p(ret);
+ std::error_code m_ec;
+ if (!exists(p, m_ec) || !is_directory(p, m_ec)) {
+ if (!m_ec || m_ec == make_error_code(errc::no_such_file_or_directory))
+ m_ec = make_error_code(errc::not_a_directory);
+ set_or_throw(m_ec, ec, "temp_directory_path");
+ return {};
+ }
+
+ if (ec)
+ ec->clear();
+ return p;
+}
+
+// An absolute path is composed according to the table in [fs.op.absolute].
+path absolute(const path& p, const path& base) {
+ auto root_name = p.root_name();
+ auto root_dir = p.root_directory();
+
+ if (!root_name.empty() && !root_dir.empty())
+ return p;
+
+ auto abs_base = base.is_absolute() ? base : absolute(base);
+
+ /* !has_root_name && !has_root_dir */
+ if (root_name.empty() && root_dir.empty())
+ {
+ return abs_base / p;
+ }
+ else if (!root_name.empty()) /* has_root_name && !has_root_dir */
+ {
+ return root_name / abs_base.root_directory()
+ /
+ abs_base.relative_path() / p.relative_path();
+ }
+ else /* !has_root_name && has_root_dir */
+ {
+ if (abs_base.has_root_name())
+ return abs_base.root_name() / p;
+ // else p is absolute, return outside of block
+ }
+ return p;
+}
+
+_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/path.cpp b/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/path.cpp
new file mode 100644
index 00000000000..f49d4cd2d41
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/experimental/filesystem/path.cpp
@@ -0,0 +1,447 @@
+//===--------------------- filesystem/path.cpp ----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include "experimental/filesystem"
+#include "string_view"
+#include "utility"
+
+namespace { namespace parser
+{
+using namespace std;
+using namespace std::experimental::filesystem;
+
+using string_view_t = path::__string_view;
+using string_view_pair = pair<string_view_t, string_view_t>;
+using PosPtr = path::value_type const*;
+
+struct PathParser {
+ enum ParserState : unsigned char {
+ // Zero is a special sentinel value used by default constructed iterators.
+ PS_BeforeBegin = 1,
+ PS_InRootName,
+ PS_InRootDir,
+ PS_InFilenames,
+ PS_InTrailingSep,
+ PS_AtEnd
+ };
+
+ const string_view_t Path;
+ string_view_t RawEntry;
+ ParserState State;
+
+private:
+ PathParser(string_view_t P, ParserState State) noexcept
+ : Path(P), State(State) {}
+
+public:
+ PathParser(string_view_t P, string_view_t E, unsigned char S)
+ : Path(P), RawEntry(E), State(static_cast<ParserState>(S)) {
+ // S cannot be '0' or PS_BeforeBegin.
+ }
+
+ static PathParser CreateBegin(string_view_t P) noexcept {
+ PathParser PP(P, PS_BeforeBegin);
+ PP.increment();
+ return PP;
+ }
+
+ static PathParser CreateEnd(string_view_t P) noexcept {
+ PathParser PP(P, PS_AtEnd);
+ return PP;
+ }
+
+ PosPtr peek() const noexcept {
+ auto TkEnd = getNextTokenStartPos();
+ auto End = getAfterBack();
+ return TkEnd == End ? nullptr : TkEnd;
+ }
+
+ void increment() noexcept {
+ const PosPtr End = getAfterBack();
+ const PosPtr Start = getNextTokenStartPos();
+ if (Start == End)
+ return makeState(PS_AtEnd);
+
+ switch (State) {
+ case PS_BeforeBegin: {
+ PosPtr TkEnd = consumeSeparator(Start, End);
+ // If we consumed exactly two separators we have a root name.
+ if (TkEnd && TkEnd == Start + 2) {
+ // FIXME Do we need to consume a name or is '//' a root name on its own?
+ // what about '//.', '//..', '//...'?
+ auto NameEnd = consumeName(TkEnd, End);
+ if (NameEnd)
+ TkEnd = NameEnd;
+ return makeState(PS_InRootName, Start, TkEnd);
+ }
+ else if (TkEnd)
+ return makeState(PS_InRootDir, Start, TkEnd);
+ else
+ return makeState(PS_InFilenames, Start, consumeName(Start, End));
+ }
+
+ case PS_InRootName:
+ return makeState(PS_InRootDir, Start, consumeSeparator(Start, End));
+ case PS_InRootDir:
+ return makeState(PS_InFilenames, Start, consumeName(Start, End));
+
+ case PS_InFilenames: {
+ PosPtr SepEnd = consumeSeparator(Start, End);
+ if (SepEnd != End) {
+ PosPtr TkEnd = consumeName(SepEnd, End);
+ if (TkEnd)
+ return makeState(PS_InFilenames, SepEnd, TkEnd);
+ }
+ return makeState(PS_InTrailingSep, Start, SepEnd);
+ }
+
+ case PS_InTrailingSep:
+ return makeState(PS_AtEnd);
+
+ case PS_AtEnd:
+ _LIBCPP_UNREACHABLE();
+ }
+ }
+
+ void decrement() noexcept {
+ const PosPtr REnd = getBeforeFront();
+ const PosPtr RStart = getCurrentTokenStartPos() - 1;
+
+ switch (State) {
+ case PS_AtEnd: {
+ // Try to consume a trailing separator or root directory first.
+ if (PosPtr SepEnd = consumeSeparator(RStart, REnd)) {
+ if (SepEnd == REnd)
+ return makeState((RStart == REnd + 2) ? PS_InRootName : PS_InRootDir,
+ Path.data(), RStart + 1);
+ // Check if we're seeing the root directory separator
+ auto PP = CreateBegin(Path);
+ bool InRootDir = PP.State == PS_InRootName &&
+ &PP.RawEntry.back() == SepEnd;
+ return makeState(InRootDir ? PS_InRootDir : PS_InTrailingSep,
+ SepEnd + 1, RStart + 1);
+ } else {
+ PosPtr TkStart = consumeName(RStart, REnd);
+ if (TkStart == REnd + 2 && consumeSeparator(TkStart, REnd) == REnd)
+ return makeState(PS_InRootName, Path.data(), RStart + 1);
+ else
+ return makeState(PS_InFilenames, TkStart + 1, RStart + 1);
+ }
+ }
+ case PS_InTrailingSep:
+ return makeState(PS_InFilenames, consumeName(RStart, REnd) + 1, RStart + 1);
+ case PS_InFilenames: {
+ PosPtr SepEnd = consumeSeparator(RStart, REnd);
+ if (SepEnd == REnd)
+ return makeState((RStart == REnd + 2) ? PS_InRootName : PS_InRootDir,
+ Path.data(), RStart + 1);
+ PosPtr TkEnd = consumeName(SepEnd, REnd);
+ if (TkEnd == REnd + 2 && consumeSeparator(TkEnd, REnd) == REnd)
+ return makeState(PS_InRootDir, SepEnd + 1, RStart + 1);
+ return makeState(PS_InFilenames, TkEnd + 1, SepEnd + 1);
+ }
+ case PS_InRootDir:
+ return makeState(PS_InRootName, Path.data(), RStart + 1);
+ case PS_InRootName:
+ case PS_BeforeBegin:
+ _LIBCPP_UNREACHABLE();
+ }
+ }
+
+ /// \brief Return a view with the "preferred representation" of the current
+ /// element. For example trailing separators are represented as a '.'
+ string_view_t operator*() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ case PS_AtEnd:
+ return "";
+ case PS_InRootDir:
+ return "/";
+ case PS_InTrailingSep:
+ return ".";
+ case PS_InRootName:
+ case PS_InFilenames:
+ return RawEntry;
+ }
+ _LIBCPP_UNREACHABLE();
+ }
+
+ explicit operator bool() const noexcept {
+ return State != PS_BeforeBegin && State != PS_AtEnd;
+ }
+
+ PathParser& operator++() noexcept {
+ increment();
+ return *this;
+ }
+
+ PathParser& operator--() noexcept {
+ decrement();
+ return *this;
+ }
+
+private:
+ void makeState(ParserState NewState, PosPtr Start, PosPtr End) noexcept {
+ State = NewState;
+ RawEntry = string_view_t(Start, End - Start);
+ }
+ void makeState(ParserState NewState) noexcept {
+ State = NewState;
+ RawEntry = {};
+ }
+
+ PosPtr getAfterBack() const noexcept {
+ return Path.data() + Path.size();
+ }
+
+ PosPtr getBeforeFront() const noexcept {
+ return Path.data() - 1;
+ }
+
+ /// \brief Return a pointer to the first character after the currently
+ /// lexed element.
+ PosPtr getNextTokenStartPos() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ return Path.data();
+ case PS_InRootName:
+ case PS_InRootDir:
+ case PS_InFilenames:
+ return &RawEntry.back() + 1;
+ case PS_InTrailingSep:
+ case PS_AtEnd:
+ return getAfterBack();
+ }
+ _LIBCPP_UNREACHABLE();
+ }
+
+ /// \brief Return a pointer to the first character in the currently lexed
+ /// element.
+ PosPtr getCurrentTokenStartPos() const noexcept {
+ switch (State) {
+ case PS_BeforeBegin:
+ case PS_InRootName:
+ return &Path.front();
+ case PS_InRootDir:
+ case PS_InFilenames:
+ case PS_InTrailingSep:
+ return &RawEntry.front();
+ case PS_AtEnd:
+ return &Path.back() + 1;
+ }
+ _LIBCPP_UNREACHABLE();
+ }
+
+ PosPtr consumeSeparator(PosPtr P, PosPtr End) const noexcept {
+ if (P == End || *P != '/')
+ return nullptr;
+ const int Inc = P < End ? 1 : -1;
+ P += Inc;
+ while (P != End && *P == '/')
+ P += Inc;
+ return P;
+ }
+
+ PosPtr consumeName(PosPtr P, PosPtr End) const noexcept {
+ if (P == End || *P == '/')
+ return nullptr;
+ const int Inc = P < End ? 1 : -1;
+ P += Inc;
+ while (P != End && *P != '/')
+ P += Inc;
+ return P;
+ }
+};
+
+string_view_pair separate_filename(string_view_t const & s) {
+ if (s == "." || s == ".." || s.empty()) return string_view_pair{s, ""};
+ auto pos = s.find_last_of('.');
+ if (pos == string_view_t::npos) return string_view_pair{s, string_view{}};
+ return string_view_pair{s.substr(0, pos), s.substr(pos)};
+}
+
+string_view_t createView(PosPtr S, PosPtr E) noexcept {
+ return {S, static_cast<size_t>(E - S) + 1};
+}
+
+}} // namespace parser
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
+
+using parser::string_view_t;
+using parser::string_view_pair;
+using parser::PathParser;
+using parser::createView;
+
+///////////////////////////////////////////////////////////////////////////////
+// path definitions
+///////////////////////////////////////////////////////////////////////////////
+
+constexpr path::value_type path::preferred_separator;
+
+path & path::replace_extension(path const & replacement)
+{
+ path p = extension();
+ if (not p.empty()) {
+ __pn_.erase(__pn_.size() - p.native().size());
+ }
+ if (!replacement.empty()) {
+ if (replacement.native()[0] != '.') {
+ __pn_ += ".";
+ }
+ __pn_.append(replacement.__pn_);
+ }
+ return *this;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// path.decompose
+
+string_view_t path::__root_name() const
+{
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName)
+ return *PP;
+ return {};
+}
+
+string_view_t path::__root_directory() const
+{
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName)
+ ++PP;
+ if (PP.State == PathParser::PS_InRootDir)
+ return *PP;
+ return {};
+}
+
+string_view_t path::__root_path_raw() const
+{
+ auto PP = PathParser::CreateBegin(__pn_);
+ if (PP.State == PathParser::PS_InRootName) {
+ auto NextCh = PP.peek();
+ if (NextCh && *NextCh == '/') {
+ ++PP;
+ return createView(__pn_.data(), &PP.RawEntry.back());
+ }
+ return PP.RawEntry;
+ }
+ if (PP.State == PathParser::PS_InRootDir)
+ return *PP;
+ return {};
+}
+
+string_view_t path::__relative_path() const
+{
+ auto PP = PathParser::CreateBegin(__pn_);
+ while (PP.State <= PathParser::PS_InRootDir)
+ ++PP;
+ if (PP.State == PathParser::PS_AtEnd)
+ return {};
+ return createView(PP.RawEntry.data(), &__pn_.back());
+}
+
+string_view_t path::__parent_path() const
+{
+ if (empty())
+ return {};
+ auto PP = PathParser::CreateEnd(__pn_);
+ --PP;
+ if (PP.RawEntry.data() == __pn_.data())
+ return {};
+ --PP;
+ return createView(__pn_.data(), &PP.RawEntry.back());
+}
+
+string_view_t path::__filename() const
+{
+ if (empty()) return {};
+ return *(--PathParser::CreateEnd(__pn_));
+}
+
+string_view_t path::__stem() const
+{
+ return parser::separate_filename(__filename()).first;
+}
+
+string_view_t path::__extension() const
+{
+ return parser::separate_filename(__filename()).second;
+}
+
+////////////////////////////////////////////////////////////////////////////
+// path.comparisons
+int path::__compare(string_view_t __s) const {
+ auto PP = PathParser::CreateBegin(__pn_);
+ auto PP2 = PathParser::CreateBegin(__s);
+ while (PP && PP2) {
+ int res = (*PP).compare(*PP2);
+ if (res != 0) return res;
+ ++PP; ++PP2;
+ }
+ if (PP.State == PP2.State && PP.State == PathParser::PS_AtEnd)
+ return 0;
+ if (PP.State == PathParser::PS_AtEnd)
+ return -1;
+ return 1;
+}
+
+////////////////////////////////////////////////////////////////////////////
+// path.nonmembers
+size_t hash_value(const path& __p) noexcept {
+ auto PP = PathParser::CreateBegin(__p.native());
+ size_t hash_value = 0;
+ std::hash<string_view> hasher;
+ while (PP) {
+ hash_value = __hash_combine(hash_value, hasher(*PP));
+ ++PP;
+ }
+ return hash_value;
+}
+
+////////////////////////////////////////////////////////////////////////////
+// path.itr
+path::iterator path::begin() const
+{
+ auto PP = PathParser::CreateBegin(__pn_);
+ iterator it;
+ it.__path_ptr_ = this;
+ it.__state_ = PP.State;
+ it.__entry_ = PP.RawEntry;
+ it.__stashed_elem_.__assign_view(*PP);
+ return it;
+}
+
+path::iterator path::end() const
+{
+ iterator it{};
+ it.__state_ = PathParser::PS_AtEnd;
+ it.__path_ptr_ = this;
+ return it;
+}
+
+path::iterator& path::iterator::__increment() {
+ static_assert(__at_end == PathParser::PS_AtEnd, "");
+ PathParser PP(__path_ptr_->native(), __entry_, __state_);
+ ++PP;
+ __state_ = PP.State;
+ __entry_ = PP.RawEntry;
+ __stashed_elem_.__assign_view(*PP);
+ return *this;
+}
+
+path::iterator& path::iterator::__decrement() {
+ PathParser PP(__path_ptr_->native(), __entry_, __state_);
+ --PP;
+ __state_ = PP.State;
+ __entry_ = PP.RawEntry;
+ __stashed_elem_.__assign_view(*PP);
+ return *this;
+}
+
+_LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/experimental/memory_resource.cpp b/chromium/buildtools/third_party/libc++/trunk/src/experimental/memory_resource.cpp
new file mode 100644
index 00000000000..c4dc1ca894a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/experimental/memory_resource.cpp
@@ -0,0 +1,143 @@
+//===------------------------ memory_resource.cpp -------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "experimental/memory_resource"
+
+#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
+#include "atomic"
+#elif !defined(_LIBCPP_HAS_NO_THREADS)
+#include "mutex"
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
+
+// memory_resource
+
+//memory_resource::~memory_resource() {}
+
+// new_delete_resource()
+
+class _LIBCPP_TYPE_VIS __new_delete_memory_resource_imp
+ : public memory_resource
+{
+public:
+ ~__new_delete_memory_resource_imp() = default;
+
+protected:
+ virtual void* do_allocate(size_t __size, size_t __align)
+ { return __allocate(__size); }
+
+ virtual void do_deallocate(void * __p, size_t, size_t)
+ { _VSTD::__libcpp_deallocate(__p); }
+
+ virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT
+ { return &__other == this; }
+};
+
+// null_memory_resource()
+
+class _LIBCPP_TYPE_VIS __null_memory_resource_imp
+ : public memory_resource
+{
+public:
+ ~__null_memory_resource_imp() = default;
+
+protected:
+ virtual void* do_allocate(size_t, size_t) {
+ __throw_bad_alloc();
+ }
+ virtual void do_deallocate(void *, size_t, size_t) {}
+ virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT
+ { return &__other == this; }
+};
+
+namespace {
+
+union ResourceInitHelper {
+ struct {
+ __new_delete_memory_resource_imp new_delete_res;
+ __null_memory_resource_imp null_res;
+ } resources;
+ char dummy;
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 ResourceInitHelper() : resources() {}
+ ~ResourceInitHelper() {}
+};
+// When compiled in C++14 this initialization should be a constant expression.
+// Only in C++11 is "init_priority" needed to ensure initialization order.
+#if _LIBCPP_STD_VER > 11
+_LIBCPP_SAFE_STATIC
+#endif
+ResourceInitHelper res_init __attribute__((init_priority (101)));
+
+} // end namespace
+
+
+memory_resource * new_delete_resource() _NOEXCEPT {
+ return &res_init.resources.new_delete_res;
+}
+
+memory_resource * null_memory_resource() _NOEXCEPT {
+ return &res_init.resources.null_res;
+}
+
+// default_memory_resource()
+
+static memory_resource *
+__default_memory_resource(bool set = false, memory_resource * new_res = nullptr) _NOEXCEPT
+{
+#ifndef _LIBCPP_HAS_NO_ATOMIC_HEADER
+ _LIBCPP_SAFE_STATIC static atomic<memory_resource*> __res =
+ ATOMIC_VAR_INIT(&res_init.resources.new_delete_res);
+ if (set) {
+ new_res = new_res ? new_res : new_delete_resource();
+ // TODO: Can a weaker ordering be used?
+ return _VSTD::atomic_exchange_explicit(
+ &__res, new_res, memory_order::memory_order_acq_rel);
+ }
+ else {
+ return _VSTD::atomic_load_explicit(
+ &__res, memory_order::memory_order_acquire);
+ }
+#elif !defined(_LIBCPP_HAS_NO_THREADS)
+ _LIBCPP_SAFE_STATIC static memory_resource * res = &res_init.resources.new_delete_res;
+ static mutex res_lock;
+ if (set) {
+ new_res = new_res ? new_res : new_delete_resource();
+ lock_guard<mutex> guard(res_lock);
+ memory_resource * old_res = res;
+ res = new_res;
+ return old_res;
+ } else {
+ lock_guard<mutex> guard(res_lock);
+ return res;
+ }
+#else
+ _LIBCPP_SAFE_STATIC static memory_resource* res = &res_init.resources.new_delete_res;
+ if (set) {
+ new_res = new_res ? new_res : new_delete_resource();
+ memory_resource * old_res = res;
+ res = new_res;
+ return old_res;
+ } else {
+ return res;
+ }
+#endif
+}
+
+memory_resource * get_default_resource() _NOEXCEPT
+{
+ return __default_memory_resource();
+}
+
+memory_resource * set_default_resource(memory_resource * __new_res) _NOEXCEPT
+{
+ return __default_memory_resource(true, __new_res);
+}
+
+_LIBCPP_END_NAMESPACE_LFTS_PMR
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/functional.cpp b/chromium/buildtools/third_party/libc++/trunk/src/functional.cpp
new file mode 100644
index 00000000000..5c2646f01b2
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/functional.cpp
@@ -0,0 +1,26 @@
+//===----------------------- functional.cpp -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "functional"
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
+bad_function_call::~bad_function_call() _NOEXCEPT
+{
+}
+
+const char*
+bad_function_call::what() const _NOEXCEPT
+{
+ return "std::bad_function_call";
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/include/atomic_support.h b/chromium/buildtools/third_party/libc++/trunk/src/include/atomic_support.h
index dbf3b9c81ea..08847e63070 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/include/atomic_support.h
+++ b/chromium/buildtools/third_party/libc++/trunk/src/include/atomic_support.h
@@ -1,3 +1,12 @@
+//===----------------------------------------------------------------------===////
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===////
+
#ifndef ATOMIC_SUPPORT_H
#define ATOMIC_SUPPORT_H
@@ -20,7 +29,7 @@
#endif
#if !defined(_LIBCPP_HAS_ATOMIC_BUILTINS) && !defined(_LIBCPP_HAS_NO_THREADS)
-# if defined(_MSC_VER) && !defined(__clang__)
+# if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("Building libc++ without __atomic builtins is unsupported")
# else
# warning Building libc++ without __atomic builtins is unsupported
@@ -36,7 +45,7 @@ namespace {
enum __libcpp_atomic_order {
_AO_Relaxed = __ATOMIC_RELAXED,
_AO_Consume = __ATOMIC_CONSUME,
- _AO_Aquire = __ATOMIC_ACQUIRE,
+ _AO_Acquire = __ATOMIC_ACQUIRE,
_AO_Release = __ATOMIC_RELEASE,
_AO_Acq_Rel = __ATOMIC_ACQ_REL,
_AO_Seq = __ATOMIC_SEQ_CST
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/include/config_elast.h b/chromium/buildtools/third_party/libc++/trunk/src/include/config_elast.h
index 9d6a76b0c00..8328978ef95 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/include/config_elast.h
+++ b/chromium/buildtools/third_party/libc++/trunk/src/include/config_elast.h
@@ -10,7 +10,9 @@
#ifndef _LIBCPP_CONFIG_ELAST
#define _LIBCPP_CONFIG_ELAST
-#if defined(_WIN32)
+#include <__config>
+
+#if defined(_LIBCPP_MSVCRT)
#include <stdlib.h>
#else
#include <errno.h>
@@ -20,14 +22,16 @@
#define _LIBCPP_ELAST ELAST
#elif defined(_NEWLIB_VERSION)
#define _LIBCPP_ELAST __ELASTERROR
+#elif defined(__Fuchsia__)
+// No _LIBCPP_ELAST needed on Fuchsia
#elif defined(__linux__)
#define _LIBCPP_ELAST 4095
#elif defined(__APPLE__)
// No _LIBCPP_ELAST needed on Apple
#elif defined(__sun__)
#define _LIBCPP_ELAST ESTALE
-#elif defined(_WIN32)
-#define _LIBCPP_ELAST _sys_nerr
+#elif defined(_LIBCPP_MSVCRT)
+#define _LIBCPP_ELAST (_sys_nerr - 1)
#else
// Warn here so that the person doing the libcxx port has an easier time:
#warning ELAST for this platform not yet implemented
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/ios.cpp b/chromium/buildtools/third_party/libc++/trunk/src/ios.cpp
index 23e3ee0ca04..7c76ca258b2 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/ios.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/ios.cpp
@@ -25,19 +25,19 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template class basic_ios<char>;
-template class basic_ios<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
-template class basic_streambuf<char>;
-template class basic_streambuf<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
-template class basic_istream<char>;
-template class basic_istream<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
-template class basic_ostream<char>;
-template class basic_ostream<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
-template class basic_iostream<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
class _LIBCPP_HIDDEN __iostream_category
: public __do_message
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/iostream.cpp b/chromium/buildtools/third_party/libc++/trunk/src/iostream.cpp
index e073aec6ead..534b47a917d 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/iostream.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/iostream.cpp
@@ -14,32 +14,64 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_HAS_NO_STDIN
-_ALIGNAS_TYPE (istream) _LIBCPP_FUNC_VIS char cin [sizeof(istream)];
-_ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
+_ALIGNAS_TYPE (istream) _LIBCPP_FUNC_VIS char cin[sizeof(istream)]
+#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+__asm__("?cin@__1@std@@3V?$basic_istream@DU?$char_traits@D@__1@std@@@12@A")
+#endif
+;
+_ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin[sizeof(__stdinbuf <char>)];
static mbstate_t mb_cin;
-_ALIGNAS_TYPE (wistream) _LIBCPP_FUNC_VIS char wcin [sizeof(wistream)];
-_ALIGNAS_TYPE (__stdinbuf<wchar_t> ) static char __wcin [sizeof(__stdinbuf <wchar_t>)];
+_ALIGNAS_TYPE (wistream) _LIBCPP_FUNC_VIS char wcin[sizeof(wistream)]
+#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+__asm__("?wcin@__1@std@@3V?$basic_istream@_WU?$char_traits@_W@__1@std@@@12@A")
+#endif
+;
+_ALIGNAS_TYPE (__stdinbuf<wchar_t> ) static char __wcin[sizeof(__stdinbuf <wchar_t>)];
static mbstate_t mb_wcin;
#endif
#ifndef _LIBCPP_HAS_NO_STDOUT
-_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)];
+_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)]
+#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+__asm__("?cout@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
+#endif
+;
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
static mbstate_t mb_cout;
-_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcout[sizeof(wostream)];
+_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcout[sizeof(wostream)]
+#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+__asm__("?wcout@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
+#endif
+;
_ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcout[sizeof(__stdoutbuf<wchar_t>)];
static mbstate_t mb_wcout;
#endif
-_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)];
+_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)]
+#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+__asm__("?cerr@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
+#endif
+;
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
static mbstate_t mb_cerr;
-_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcerr[sizeof(wostream)];
+_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcerr[sizeof(wostream)]
+#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+__asm__("?wcerr@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
+#endif
+;
_ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcerr[sizeof(__stdoutbuf<wchar_t>)];
static mbstate_t mb_wcerr;
-_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char clog[sizeof(ostream)];
-_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wclog[sizeof(wostream)];
+_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char clog[sizeof(ostream)]
+#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+__asm__("?clog@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
+#endif
+;
+_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wclog[sizeof(wostream)]
+#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+__asm__("?wclog@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
+#endif
+;
ios_base::Init __start_std_streams;
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/locale.cpp b/chromium/buildtools/third_party/libc++/trunk/src/locale.cpp
index 6b04e788176..4163c2c0af6 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/locale.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/locale.cpp
@@ -24,11 +24,14 @@
#endif
#include "clocale"
#include "cstring"
+#if defined(_LIBCPP_MSVCRT)
+#define _CTYPE_DISABLE_MACROS
+#endif
#include "cwctype"
#include "__sso_allocator"
#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
#include "support/win32/locale_win32.h"
-#elif !defined(__ANDROID__)
+#elif !defined(__BIONIC__)
#include <langinfo.h>
#endif
#include <stdlib.h>
@@ -42,6 +45,24 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+struct __libcpp_unique_locale {
+ __libcpp_unique_locale(const char* nm) : __loc_(newlocale(LC_ALL_MASK, nm, 0)) {}
+
+ ~__libcpp_unique_locale() {
+ if (__loc_)
+ freelocale(__loc_);
+ }
+
+ explicit operator bool() const { return __loc_; }
+
+ locale_t& get() { return __loc_; }
+
+ locale_t __loc_;
+private:
+ __libcpp_unique_locale(__libcpp_unique_locale const&);
+ __libcpp_unique_locale& operator=(__libcpp_unique_locale const&);
+};
+
#ifdef __cloc_defined
locale_t __cloc() {
// In theory this could create a race condition. In practice
@@ -65,8 +86,8 @@ T&
make(A0 a0)
{
static typename aligned_storage<sizeof(T)>::type buf;
- ::new (&buf) T(a0);
- return *reinterpret_cast<T*>(&buf);
+ auto *obj = ::new (&buf) T(a0);
+ return *obj;
}
template <class T, class A0, class A1>
@@ -85,8 +106,8 @@ T&
make(A0 a0, A1 a1, A2 a2)
{
static typename aligned_storage<sizeof(T)>::type buf;
- ::new (&buf) T(a0, a1, a2);
- return *reinterpret_cast<T*>(&buf);
+ auto *obj = ::new (&buf) T(a0, a1, a2);
+ return *obj;
}
template <typename T, size_t N>
@@ -107,6 +128,16 @@ countof(const T * const begin, const T * const end)
return static_cast<size_t>(end - begin);
}
+_LIBCPP_NORETURN static void __throw_runtime_error(const string &msg)
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw runtime_error(msg);
+#else
+ (void)msg;
+ _VSTD::abort();
+#endif
+}
+
}
#if defined(_AIX)
@@ -123,16 +154,11 @@ const locale::category locale::time;
const locale::category locale::messages;
const locale::category locale::all;
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
class _LIBCPP_HIDDEN locale::__imp
: public facet
{
enum {N = 28};
-#if defined(_LIBCPP_MSVC)
+#if defined(_LIBCPP_COMPILER_MSVC)
// FIXME: MSVC doesn't support aligned parameters by value.
// I can't get the __sso_allocator to work here
// for MSVC I think for this reason.
@@ -163,10 +189,6 @@ private:
template <class F> void install_from(const __imp& other);
};
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
locale::__imp::__imp(size_t refs)
: facet(refs),
facets_(N),
@@ -476,8 +498,8 @@ locale::__imp::make_global()
{
// only one thread can get in here and it only gets in once
static aligned_storage<sizeof(locale)>::type buf;
- ::new (&buf) locale(locale::classic());
- return *reinterpret_cast<locale*>(&buf);
+ auto *obj = ::new (&buf) locale(locale::classic());
+ return *obj;
}
locale&
@@ -575,10 +597,8 @@ locale::global(const locale& loc)
locale& g = __global();
locale r = g;
g = loc;
-#ifndef __CloudABI__
if (g.name() != "*")
setlocale(LC_ALL, g.name().c_str());
-#endif
return r;
}
@@ -655,22 +675,18 @@ collate_byname<char>::collate_byname(const char* n, size_t refs)
: collate<char>(refs),
__l(newlocale(LC_ALL_MASK, n, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("collate_byname<char>::collate_byname"
+ __throw_runtime_error("collate_byname<char>::collate_byname"
" failed to construct for " + string(n));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
collate_byname<char>::collate_byname(const string& name, size_t refs)
: collate<char>(refs),
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("collate_byname<char>::collate_byname"
+ __throw_runtime_error("collate_byname<char>::collate_byname"
" failed to construct for " + name);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
collate_byname<char>::~collate_byname()
@@ -707,22 +723,18 @@ collate_byname<wchar_t>::collate_byname(const char* n, size_t refs)
: collate<wchar_t>(refs),
__l(newlocale(LC_ALL_MASK, n, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
+ __throw_runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
" failed to construct for " + string(n));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
collate_byname<wchar_t>::collate_byname(const string& name, size_t refs)
: collate<wchar_t>(refs),
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
+ __throw_runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
" failed to construct for " + name);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
collate_byname<wchar_t>::~collate_byname()
@@ -1115,9 +1127,7 @@ ctype<char>::classic_table() _NOEXCEPT
#elif __sun__
return __ctype_mask;
#elif defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
- return _ctype+1; // internal ctype mask table defined in msvcrt.dll
-// This is assumed to be safe, which is a nonsense assumption because we're
-// going to end up dereferencing it later...
+ return __pctype_func();
#elif defined(__EMSCRIPTEN__)
return *__ctype_b_loc();
#elif defined(_NEWLIB_VERSION)
@@ -1181,22 +1191,18 @@ ctype_byname<char>::ctype_byname(const char* name, size_t refs)
: ctype<char>(0, false, refs),
__l(newlocale(LC_ALL_MASK, name, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("ctype_byname<char>::ctype_byname"
+ __throw_runtime_error("ctype_byname<char>::ctype_byname"
" failed to construct for " + string(name));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
ctype_byname<char>::ctype_byname(const string& name, size_t refs)
: ctype<char>(0, false, refs),
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("ctype_byname<char>::ctype_byname"
+ __throw_runtime_error("ctype_byname<char>::ctype_byname"
" failed to construct for " + name);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
ctype_byname<char>::~ctype_byname()
@@ -1238,22 +1244,18 @@ ctype_byname<wchar_t>::ctype_byname(const char* name, size_t refs)
: ctype<wchar_t>(refs),
__l(newlocale(LC_ALL_MASK, name, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("ctype_byname<wchar_t>::ctype_byname"
+ __throw_runtime_error("ctype_byname<wchar_t>::ctype_byname"
" failed to construct for " + string(name));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
ctype_byname<wchar_t>::ctype_byname(const string& name, size_t refs)
: ctype<wchar_t>(refs),
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("ctype_byname<wchar_t>::ctype_byname"
+ __throw_runtime_error("ctype_byname<wchar_t>::ctype_byname"
" failed to construct for " + name);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
ctype_byname<wchar_t>::~ctype_byname()
@@ -1409,33 +1411,21 @@ ctype_byname<wchar_t>::do_tolower(char_type* low, const char_type* high) const
wchar_t
ctype_byname<wchar_t>::do_widen(char c) const
{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return btowc_l(c, __l);
-#else
- return __btowc_l(c, __l);
-#endif
+ return __libcpp_btowc_l(c, __l);
}
const char*
ctype_byname<wchar_t>::do_widen(const char* low, const char* high, char_type* dest) const
{
for (; low != high; ++low, ++dest)
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- *dest = btowc_l(*low, __l);
-#else
- *dest = __btowc_l(*low, __l);
-#endif
+ *dest = __libcpp_btowc_l(*low, __l);
return low;
}
char
ctype_byname<wchar_t>::do_narrow(char_type c, char dfault) const
{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int r = wctob_l(c, __l);
-#else
- int r = __wctob_l(c, __l);
-#endif
+ int r = __libcpp_wctob_l(c, __l);
return r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
}
@@ -1444,11 +1434,7 @@ ctype_byname<wchar_t>::do_narrow(const char_type* low, const char_type* high, ch
{
for (; low != high; ++low, ++dest)
{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- int r = wctob_l(*low, __l);
-#else
- int r = __wctob_l(*low, __l);
-#endif
+ int r = __libcpp_wctob_l(*low, __l);
*dest = r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
}
return low;
@@ -1529,11 +1515,9 @@ codecvt<wchar_t, char, mbstate_t>::codecvt(const char* nm, size_t refs)
: locale::facet(refs),
__l(newlocale(LC_ALL_MASK, nm, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__l == 0)
- throw runtime_error("codecvt_byname<wchar_t, char, mbstate_t>::codecvt_byname"
+ __throw_runtime_error("codecvt_byname<wchar_t, char, mbstate_t>::codecvt_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
codecvt<wchar_t, char, mbstate_t>::~codecvt()
@@ -1558,22 +1542,14 @@ codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
{
// save state in case it is needed to recover to_nxt on error
mbstate_t save_state = st;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t n = wcsnrtombs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
- static_cast<size_t>(to_end-to), &st, __l);
-#else
- size_t n = __wcsnrtombs_l(to, &frm_nxt, fend-frm, to_end-to, &st, __l);
-#endif
+ size_t n = __libcpp_wcsnrtombs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
+ static_cast<size_t>(to_end-to), &st, __l);
if (n == size_t(-1))
{
// need to recover to_nxt
for (to_nxt = to; frm != frm_nxt; ++frm)
{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- n = wcrtomb_l(to_nxt, *frm, &save_state, __l);
-#else
- n = __wcrtomb_l(to_nxt, *frm, &save_state, __l);
-#endif
+ n = __libcpp_wcrtomb_l(to_nxt, *frm, &save_state, __l);
if (n == size_t(-1))
break;
to_nxt += n;
@@ -1590,11 +1566,7 @@ codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
{
// Try to write the terminating null
extern_type tmp[MB_LEN_MAX];
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- n = wcrtomb_l(tmp, intern_type(), &st, __l);
-#else
- n = __wcrtomb_l(tmp, intern_type(), &st, __l);
-#endif
+ n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l);
if (n == size_t(-1)) // on error
return error;
if (n > static_cast<size_t>(to_end-to_nxt)) // is there room?
@@ -1627,23 +1599,15 @@ codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st,
{
// save state in case it is needed to recover to_nxt on error
mbstate_t save_state = st;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t n = mbsnrtowcs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
- static_cast<size_t>(to_end-to), &st, __l);
-#else
- size_t n = __mbsnrtowcs_l(to, &frm_nxt, fend-frm, to_end-to, &st, __l);
-#endif
+ size_t n = __libcpp_mbsnrtowcs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
+ static_cast<size_t>(to_end-to), &st, __l);
if (n == size_t(-1))
{
// need to recover to_nxt
for (to_nxt = to; frm != frm_nxt; ++to_nxt)
{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- n = mbrtowc_l(to_nxt, frm, static_cast<size_t>(fend-frm),
- &save_state, __l);
-#else
- n = __mbrtowc_l(to_nxt, frm, fend-frm, &save_state, __l);
-#endif
+ n = __libcpp_mbrtowc_l(to_nxt, frm, static_cast<size_t>(fend-frm),
+ &save_state, __l);
switch (n)
{
case 0:
@@ -1671,11 +1635,7 @@ codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st,
if (fend != frm_end) // set up next null terminated sequence
{
// Try to write the terminating null
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- n = mbrtowc_l(to_nxt, frm_nxt, 1, &st, __l);
-#else
- n = __mbrtowc_l(to_nxt, frm_nxt, 1, &st, __l);
-#endif
+ n = __libcpp_mbrtowc_l(to_nxt, frm_nxt, 1, &st, __l);
if (n != 0) // on error
return error;
++to_nxt;
@@ -1695,11 +1655,7 @@ codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& st,
{
to_nxt = to;
extern_type tmp[MB_LEN_MAX];
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t n = wcrtomb_l(tmp, intern_type(), &st, __l);
-#else
- size_t n = __wcrtomb_l(tmp, intern_type(), &st, __l);
-#endif
+ size_t n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l);
if (n == size_t(-1) || n == 0) // on error
return error;
--n;
@@ -1713,21 +1669,11 @@ codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& st,
int
codecvt<wchar_t, char, mbstate_t>::do_encoding() const _NOEXCEPT
{
-#ifndef __CloudABI__
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- if (mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l) != 0)
-#else
- if (__mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l) != 0)
-#endif
+ if (__libcpp_mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l) != 0)
return -1;
-#endif
// stateless encoding
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- if (__l == 0 || MB_CUR_MAX_L(__l) == 1) // there are no known constant length encodings
-#else
- if (__l == 0 || __mb_cur_max_l(__l) == 1) // there are no known constant length encodings
-#endif
+ if (__l == 0 || __libcpp_mb_cur_max_l(__l) == 1) // there are no known constant length encodings
return 1; // which take more than 1 char to form a wchar_t
return 0;
}
@@ -1745,11 +1691,7 @@ codecvt<wchar_t, char, mbstate_t>::do_length(state_type& st,
int nbytes = 0;
for (size_t nwchar_t = 0; nwchar_t < mx && frm != frm_end; ++nwchar_t)
{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t n = mbrlen_l(frm, static_cast<size_t>(frm_end-frm), &st, __l);
-#else
- size_t n = __mbrlen_l(frm, frm_end-frm, &st, __l);
-#endif
+ size_t n = __libcpp_mbrlen_l(frm, static_cast<size_t>(frm_end-frm), &st, __l);
switch (n)
{
case 0:
@@ -1771,11 +1713,7 @@ codecvt<wchar_t, char, mbstate_t>::do_length(state_type& st,
int
codecvt<wchar_t, char, mbstate_t>::do_max_length() const _NOEXCEPT
{
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- return __l == 0 ? 1 : static_cast<int>( MB_CUR_MAX_L(__l));
-#else
- return __l == 0 ? 1 : static_cast<int>(__mb_cur_max_l(__l));
-#endif
+ return __l == 0 ? 1 : static_cast<int>(__libcpp_mb_cur_max_l(__l));
}
// Valid UTF ranges
@@ -2894,10 +2832,10 @@ ucs4_to_utf16le(const uint32_t* frm, const uint32_t* frm_end, const uint32_t*& f
to_nxt = to;
if (mode & generate_header)
{
- if (to_end-to_nxt < 2)
+ if (to_end - to_nxt < 2)
return codecvt_base::partial;
- *to_nxt++ = static_cast<uint8_t>(0xFF);
- *to_nxt++ = static_cast<uint8_t>(0xFE);
+ *to_nxt++ = static_cast<uint8_t>(0xFF);
+ *to_nxt++ = static_cast<uint8_t>(0xFE);
}
for (; frm_nxt < frm_end; ++frm_nxt)
{
@@ -3326,7 +3264,7 @@ __codecvt_utf8<wchar_t>::do_out(state_type&,
const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
{
-#if _WIN32
+#if defined(_LIBCPP_SHORT_WCHAR)
const uint16_t* _frm = reinterpret_cast<const uint16_t*>(frm);
const uint16_t* _frm_end = reinterpret_cast<const uint16_t*>(frm_end);
const uint16_t* _frm_nxt = _frm;
@@ -3338,7 +3276,7 @@ __codecvt_utf8<wchar_t>::do_out(state_type&,
uint8_t* _to = reinterpret_cast<uint8_t*>(to);
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
uint8_t* _to_nxt = _to;
-#if _WIN32
+#if defined(_LIBCPP_SHORT_WCHAR)
result r = ucs2_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
_Maxcode_, _Mode_);
#else
@@ -3358,7 +3296,7 @@ __codecvt_utf8<wchar_t>::do_in(state_type&,
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
const uint8_t* _frm_nxt = _frm;
-#if _WIN32
+#if defined(_LIBCPP_SHORT_WCHAR)
uint16_t* _to = reinterpret_cast<uint16_t*>(to);
uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
uint16_t* _to_nxt = _to;
@@ -4262,6 +4200,54 @@ __widen_from_utf8<32>::~__widen_from_utf8()
{
}
+
+static bool checked_string_to_wchar_convert(wchar_t& dest,
+ const char* ptr,
+ locale_t loc) {
+ if (*ptr == '\0')
+ return false;
+ mbstate_t mb = {};
+ wchar_t out;
+ size_t ret = __libcpp_mbrtowc_l(&out, ptr, strlen(ptr), &mb, loc);
+ if (ret == static_cast<size_t>(-1) || ret == static_cast<size_t>(-2)) {
+ return false;
+ }
+ dest = out;
+ return true;
+}
+
+static bool checked_string_to_char_convert(char& dest,
+ const char* ptr,
+ locale_t __loc) {
+ if (*ptr == '\0')
+ return false;
+ if (!ptr[1]) {
+ dest = *ptr;
+ return true;
+ }
+ // First convert the MBS into a wide char then attempt to narrow it using
+ // wctob_l.
+ wchar_t wout;
+ if (!checked_string_to_wchar_convert(wout, ptr, __loc))
+ return false;
+ int res;
+ if ((res = __libcpp_wctob_l(wout, __loc)) != char_traits<char>::eof()) {
+ dest = res;
+ return true;
+ }
+ // FIXME: Work around specific multibyte sequences that we can reasonable
+ // translate into a different single byte.
+ switch (wout) {
+ case L'\u00A0': // non-breaking space
+ dest = ' ';
+ return true;
+ default:
+ return false;
+ }
+ _LIBCPP_UNREACHABLE();
+}
+
+
// numpunct<char> && numpunct<wchar_t>
locale::id numpunct< char >::id;
@@ -4327,21 +4313,16 @@ numpunct_byname<char>::__init(const char* nm)
{
if (strcmp(nm, "C") != 0)
{
- __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- if (loc == nullptr)
- throw runtime_error("numpunct_byname<char>::numpunct_byname"
+ __libcpp_unique_locale loc(nm);
+ if (!loc)
+ __throw_runtime_error("numpunct_byname<char>::numpunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- lconv* lc = localeconv_l(loc.get());
-#else
- lconv* lc = __localeconv_l(loc.get());
-#endif
- if (*lc->decimal_point)
- __decimal_point_ = *lc->decimal_point;
- if (*lc->thousands_sep)
- __thousands_sep_ = *lc->thousands_sep;
+
+ lconv* lc = __libcpp_localeconv_l(loc.get());
+ checked_string_to_char_convert(__decimal_point_, lc->decimal_point,
+ loc.get());
+ checked_string_to_char_convert(__thousands_sep_, lc->thousands_sep,
+ loc.get());
__grouping_ = lc->grouping;
// localization for truename and falsename is not available
}
@@ -4370,23 +4351,18 @@ numpunct_byname<wchar_t>::__init(const char* nm)
{
if (strcmp(nm, "C") != 0)
{
- __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- if (loc == nullptr)
- throw runtime_error("numpunct_byname<char>::numpunct_byname"
+ __libcpp_unique_locale loc(nm);
+ if (!loc)
+ __throw_runtime_error("numpunct_byname<wchar_t>::numpunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- lconv* lc = localeconv_l(loc.get());
-#else
- lconv* lc = __localeconv_l(loc.get());
-#endif
- if (*lc->decimal_point)
- __decimal_point_ = *lc->decimal_point;
- if (*lc->thousands_sep)
- __thousands_sep_ = *lc->thousands_sep;
+
+ lconv* lc = __libcpp_localeconv_l(loc.get());
+ checked_string_to_wchar_convert(__decimal_point_, lc->decimal_point,
+ loc.get());
+ checked_string_to_wchar_convert(__thousands_sep_, lc->thousands_sep,
+ loc.get());
__grouping_ = lc->grouping;
- // locallization for truename and falsename is not available
+ // localization for truename and falsename is not available
}
}
@@ -4782,21 +4758,17 @@ __time_get_c_storage<wchar_t>::__r() const
__time_get::__time_get(const char* nm)
: __loc_(newlocale(LC_ALL_MASK, nm, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__loc_ == 0)
- throw runtime_error("time_get_byname"
+ __throw_runtime_error("time_get_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
__time_get::__time_get(const string& nm)
: __loc_(newlocale(LC_ALL_MASK, nm.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__loc_ == 0)
- throw runtime_error("time_get_byname"
+ __throw_runtime_error("time_get_byname"
" failed to construct for " + nm);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
__time_get::~__time_get()
@@ -4981,11 +4953,7 @@ __time_get_storage<wchar_t>::__analyze(char fmt, const ctype<wchar_t>& ct)
wchar_t* wbb = wbuf;
mbstate_t mb = {0};
const char* bb = buf;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t j = mbsrtowcs_l( wbb, &bb, countof(wbuf), &mb, __loc_);
-#else
- size_t j = __mbsrtowcs_l( wbb, &bb, countof(wbuf), &mb, __loc_);
-#endif
+ size_t j = __libcpp_mbsrtowcs_l( wbb, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wchar_t* wbe = wbb + j;
@@ -5165,11 +5133,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
strftime_l(buf, countof(buf), "%A", &t, __loc_);
mb = mbstate_t();
const char* bb = buf;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#else
- size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#endif
+ size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -5177,11 +5141,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
strftime_l(buf, countof(buf), "%a", &t, __loc_);
mb = mbstate_t();
bb = buf;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#else
- j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#endif
+ j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -5194,11 +5154,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
strftime_l(buf, countof(buf), "%B", &t, __loc_);
mb = mbstate_t();
const char* bb = buf;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#else
- size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#endif
+ size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -5206,11 +5162,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
strftime_l(buf, countof(buf), "%b", &t, __loc_);
mb = mbstate_t();
bb = buf;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#else
- j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#endif
+ j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -5221,11 +5173,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
strftime_l(buf, countof(buf), "%p", &t, __loc_);
mb = mbstate_t();
const char* bb = buf;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#else
- size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#endif
+ size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -5234,11 +5182,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
strftime_l(buf, countof(buf), "%p", &t, __loc_);
mb = mbstate_t();
bb = buf;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#else
- j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
-#endif
+ j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, __loc_);
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -5470,21 +5414,17 @@ __time_get_storage<wchar_t>::__do_date_order() const
__time_put::__time_put(const char* nm)
: __loc_(newlocale(LC_ALL_MASK, nm, 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__loc_ == 0)
- throw runtime_error("time_put_byname"
+ __throw_runtime_error("time_put_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
}
__time_put::__time_put(const string& nm)
: __loc_(newlocale(LC_ALL_MASK, nm.c_str(), 0))
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
if (__loc_ == 0)
- throw runtime_error("time_put_byname"
+ __throw_runtime_error("time_put_byname"
" failed to construct for " + nm);
-#endif // _LIBCPP_NO_EXCEPTIONS
}
__time_put::~__time_put()
@@ -5513,11 +5453,7 @@ __time_put::__do_put(wchar_t* __wb, wchar_t*& __we, const tm* __tm,
__do_put(__nar, __ne, __tm, __fmt, __mod);
mbstate_t mb = {0};
const char* __nb = __nar;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t j = mbsrtowcs_l(__wb, &__nb, countof(__wb, __we), &mb, __loc_);
-#else
- size_t j = __mbsrtowcs_l(__wb, &__nb, countof(__wb, __we), &mb, __loc_);
-#endif
+ size_t j = __libcpp_mbsrtowcs_l(__wb, &__nb, countof(__wb, __we), &mb, __loc_);
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
__we = __wb + j;
@@ -5902,25 +5838,21 @@ void
moneypunct_byname<char, false>::init(const char* nm)
{
typedef moneypunct<char, false> base;
- __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- if (loc == nullptr)
- throw runtime_error("moneypunct_byname"
+ __libcpp_unique_locale loc(nm);
+ if (!loc)
+ __throw_runtime_error("moneypunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- lconv* lc = localeconv_l(loc.get());
-#else
- lconv* lc = __localeconv_l(loc.get());
-#endif
- if (*lc->mon_decimal_point)
- __decimal_point_ = *lc->mon_decimal_point;
- else
- __decimal_point_ = base::do_decimal_point();
- if (*lc->mon_thousands_sep)
- __thousands_sep_ = *lc->mon_thousands_sep;
- else
- __thousands_sep_ = base::do_thousands_sep();
+
+ lconv* lc = __libcpp_localeconv_l(loc.get());
+ if (!checked_string_to_char_convert(__decimal_point_,
+ lc->mon_decimal_point,
+ loc.get()))
+ __decimal_point_ = base::do_decimal_point();
+ if (!checked_string_to_char_convert(__thousands_sep_,
+ lc->mon_thousands_sep,
+ loc.get()))
+ __thousands_sep_ = base::do_thousands_sep();
+
__grouping_ = lc->mon_grouping;
__curr_symbol_ = lc->currency_symbol;
if (lc->frac_digits != CHAR_MAX)
@@ -5950,25 +5882,20 @@ void
moneypunct_byname<char, true>::init(const char* nm)
{
typedef moneypunct<char, true> base;
- __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- if (loc == nullptr)
- throw runtime_error("moneypunct_byname"
+ __libcpp_unique_locale loc(nm);
+ if (!loc)
+ __throw_runtime_error("moneypunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- lconv* lc = localeconv_l(loc.get());
-#else
- lconv* lc = __localeconv_l(loc.get());
-#endif
- if (*lc->mon_decimal_point)
- __decimal_point_ = *lc->mon_decimal_point;
- else
- __decimal_point_ = base::do_decimal_point();
- if (*lc->mon_thousands_sep)
- __thousands_sep_ = *lc->mon_thousands_sep;
- else
- __thousands_sep_ = base::do_thousands_sep();
+
+ lconv* lc = __libcpp_localeconv_l(loc.get());
+ if (!checked_string_to_char_convert(__decimal_point_,
+ lc->mon_decimal_point,
+ loc.get()))
+ __decimal_point_ = base::do_decimal_point();
+ if (!checked_string_to_char_convert(__thousands_sep_,
+ lc->mon_thousands_sep,
+ loc.get()))
+ __thousands_sep_ = base::do_thousands_sep();
__grouping_ = lc->mon_grouping;
__curr_symbol_ = lc->int_curr_symbol;
if (lc->int_frac_digits != CHAR_MAX)
@@ -6015,34 +5942,24 @@ void
moneypunct_byname<wchar_t, false>::init(const char* nm)
{
typedef moneypunct<wchar_t, false> base;
- __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- if (loc == nullptr)
- throw runtime_error("moneypunct_byname"
+ __libcpp_unique_locale loc(nm);
+ if (!loc)
+ __throw_runtime_error("moneypunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- lconv* lc = localeconv_l(loc.get());
-#else
- lconv* lc = __localeconv_l(loc.get());
-#endif
- if (*lc->mon_decimal_point)
- __decimal_point_ = static_cast<wchar_t>(*lc->mon_decimal_point);
- else
- __decimal_point_ = base::do_decimal_point();
- if (*lc->mon_thousands_sep)
- __thousands_sep_ = static_cast<wchar_t>(*lc->mon_thousands_sep);
- else
- __thousands_sep_ = base::do_thousands_sep();
+ lconv* lc = __libcpp_localeconv_l(loc.get());
+ if (!checked_string_to_wchar_convert(__decimal_point_,
+ lc->mon_decimal_point,
+ loc.get()))
+ __decimal_point_ = base::do_decimal_point();
+ if (!checked_string_to_wchar_convert(__thousands_sep_,
+ lc->mon_thousands_sep,
+ loc.get()))
+ __thousands_sep_ = base::do_thousands_sep();
__grouping_ = lc->mon_grouping;
wchar_t wbuf[100];
mbstate_t mb = {0};
const char* bb = lc->currency_symbol;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#else
- size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#endif
+ size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wchar_t* wbe = wbuf + j;
@@ -6057,11 +5974,7 @@ moneypunct_byname<wchar_t, false>::init(const char* nm)
{
mb = mbstate_t();
bb = lc->positive_sign;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#else
- j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#endif
+ j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -6073,11 +5986,7 @@ moneypunct_byname<wchar_t, false>::init(const char* nm)
{
mb = mbstate_t();
bb = lc->negative_sign;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#else
- j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#endif
+ j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -6098,34 +6007,25 @@ void
moneypunct_byname<wchar_t, true>::init(const char* nm)
{
typedef moneypunct<wchar_t, true> base;
- __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
-#ifndef _LIBCPP_NO_EXCEPTIONS
- if (loc == nullptr)
- throw runtime_error("moneypunct_byname"
+ __libcpp_unique_locale loc(nm);
+ if (!loc)
+ __throw_runtime_error("moneypunct_byname"
" failed to construct for " + string(nm));
-#endif // _LIBCPP_NO_EXCEPTIONS
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- lconv* lc = localeconv_l(loc.get());
-#else
- lconv* lc = __localeconv_l(loc.get());
-#endif
- if (*lc->mon_decimal_point)
- __decimal_point_ = static_cast<wchar_t>(*lc->mon_decimal_point);
- else
- __decimal_point_ = base::do_decimal_point();
- if (*lc->mon_thousands_sep)
- __thousands_sep_ = static_cast<wchar_t>(*lc->mon_thousands_sep);
- else
- __thousands_sep_ = base::do_thousands_sep();
+
+ lconv* lc = __libcpp_localeconv_l(loc.get());
+ if (!checked_string_to_wchar_convert(__decimal_point_,
+ lc->mon_decimal_point,
+ loc.get()))
+ __decimal_point_ = base::do_decimal_point();
+ if (!checked_string_to_wchar_convert(__thousands_sep_,
+ lc->mon_thousands_sep,
+ loc.get()))
+ __thousands_sep_ = base::do_thousands_sep();
__grouping_ = lc->mon_grouping;
wchar_t wbuf[100];
mbstate_t mb = {0};
const char* bb = lc->int_curr_symbol;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- size_t j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#else
- size_t j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#endif
+ size_t j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wchar_t* wbe = wbuf + j;
@@ -6144,11 +6044,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
{
mb = mbstate_t();
bb = lc->positive_sign;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#else
- j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#endif
+ j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -6164,11 +6060,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
{
mb = mbstate_t();
bb = lc->negative_sign;
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
- j = mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#else
- j = __mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
-#endif
+ j = __libcpp_mbsrtowcs_l(wbuf, &bb, countof(wbuf), &mb, loc.get());
if (j == size_t(-1))
__throw_runtime_error("locale not supported");
wbe = wbuf + j;
@@ -6201,69 +6093,70 @@ void __throw_runtime_error(const char* msg)
throw runtime_error(msg);
#else
(void)msg;
+ _VSTD::abort();
#endif
}
-template class collate<char>;
-template class collate<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate<wchar_t>;
-template class num_get<char>;
-template class num_get<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get<wchar_t>;
-template struct __num_get<char>;
-template struct __num_get<wchar_t>;
+template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<char>;
+template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get<wchar_t>;
-template class num_put<char>;
-template class num_put<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put<wchar_t>;
-template struct __num_put<char>;
-template struct __num_put<wchar_t>;
+template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<char>;
+template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put<wchar_t>;
-template class time_get<char>;
-template class time_get<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get<wchar_t>;
-template class time_get_byname<char>;
-template class time_get_byname<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname<wchar_t>;
-template class time_put<char>;
-template class time_put<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put<wchar_t>;
-template class time_put_byname<char>;
-template class time_put_byname<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname<wchar_t>;
-template class moneypunct<char, false>;
-template class moneypunct<char, true>;
-template class moneypunct<wchar_t, false>;
-template class moneypunct<wchar_t, true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, false>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<char, true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, false>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct<wchar_t, true>;
-template class moneypunct_byname<char, false>;
-template class moneypunct_byname<char, true>;
-template class moneypunct_byname<wchar_t, false>;
-template class moneypunct_byname<wchar_t, true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, false>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<char, true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, false>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname<wchar_t, true>;
-template class money_get<char>;
-template class money_get<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get<wchar_t>;
-template class __money_get<char>;
-template class __money_get<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get<wchar_t>;
-template class money_put<char>;
-template class money_put<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put<wchar_t>;
-template class __money_put<char>;
-template class __money_put<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put<wchar_t>;
-template class messages<char>;
-template class messages<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages<wchar_t>;
-template class messages_byname<char>;
-template class messages_byname<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname<wchar_t>;
-template class codecvt_byname<char, char, mbstate_t>;
-template class codecvt_byname<wchar_t, char, mbstate_t>;
-template class codecvt_byname<char16_t, char, mbstate_t>;
-template class codecvt_byname<char32_t, char, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char, char, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<wchar_t, char, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char16_t, char, mbstate_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname<char32_t, char, mbstate_t>;
-template class __vector_base_common<true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __vector_base_common<true>;
_LIBCPP_END_NAMESPACE_STD
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/memory.cpp b/chromium/buildtools/third_party/libc++/trunk/src/memory.cpp
index 5b81f26e3dc..4e0d3af9167 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/memory.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/memory.cpp
@@ -17,28 +17,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-namespace
-{
-
-// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)
-// should be sufficient for thread safety.
-// See https://llvm.org/bugs/show_bug.cgi?id=22803
-template <class T>
-inline T
-increment(T& t) _NOEXCEPT
-{
- return __libcpp_atomic_add(&t, 1, _AO_Relaxed);
-}
-
-template <class T>
-inline T
-decrement(T& t) _NOEXCEPT
-{
- return __libcpp_atomic_add(&t, -1, _AO_Acq_Rel);
-}
-
-} // namespace
-
const allocator_arg_t allocator_arg = allocator_arg_t();
bad_weak_ptr::~bad_weak_ptr() _NOEXCEPT {}
@@ -53,16 +31,21 @@ __shared_count::~__shared_count()
{
}
+__shared_weak_count::~__shared_weak_count()
+{
+}
+
+#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
void
__shared_count::__add_shared() _NOEXCEPT
{
- increment(__shared_owners_);
+ __libcpp_atomic_refcount_increment(__shared_owners_);
}
bool
__shared_count::__release_shared() _NOEXCEPT
{
- if (decrement(__shared_owners_) == -1)
+ if (__libcpp_atomic_refcount_decrement(__shared_owners_) == -1)
{
__on_zero_shared();
return true;
@@ -70,10 +53,6 @@ __shared_count::__release_shared() _NOEXCEPT
return false;
}
-__shared_weak_count::~__shared_weak_count()
-{
-}
-
void
__shared_weak_count::__add_shared() _NOEXCEPT
{
@@ -83,7 +62,7 @@ __shared_weak_count::__add_shared() _NOEXCEPT
void
__shared_weak_count::__add_weak() _NOEXCEPT
{
- increment(__shared_weak_owners_);
+ __libcpp_atomic_refcount_increment(__shared_weak_owners_);
}
void
@@ -93,10 +72,40 @@ __shared_weak_count::__release_shared() _NOEXCEPT
__release_weak();
}
+#endif // _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
+
void
__shared_weak_count::__release_weak() _NOEXCEPT
{
- if (decrement(__shared_weak_owners_) == -1)
+ // NOTE: The acquire load here is an optimization of the very
+ // common case where a shared pointer is being destructed while
+ // having no other contended references.
+ //
+ // BENEFIT: We avoid expensive atomic stores like XADD and STREX
+ // in a common case. Those instructions are slow and do nasty
+ // things to caches.
+ //
+ // IS THIS SAFE? Yes. During weak destruction, if we see that we
+ // are the last reference, we know that no-one else is accessing
+ // us. If someone were accessing us, then they would be doing so
+ // while the last shared / weak_ptr was being destructed, and
+ // that's undefined anyway.
+ //
+ // If we see anything other than a 0, then we have possible
+ // contention, and need to use an atomicrmw primitive.
+ // The same arguments don't apply for increment, where it is legal
+ // (though inadvisable) to share shared_ptr references between
+ // threads, and have them all get copied at once. The argument
+ // also doesn't apply for __release_shared, because an outstanding
+ // weak_ptr::lock() could read / modify the shared count.
+ if (__libcpp_atomic_load(&__shared_weak_owners_, _AO_Acquire) == 0)
+ {
+ // no need to do this store, because we are about
+ // to destroy everything.
+ //__libcpp_atomic_store(&__shared_weak_owners_, -1, _AO_Release);
+ __on_zero_shared_weak();
+ }
+ else if (__libcpp_atomic_refcount_decrement(__shared_weak_owners_) == -1)
__on_zero_shared_weak();
}
@@ -111,7 +120,7 @@ __shared_weak_count::lock() _NOEXCEPT
object_owners+1))
return this;
}
- return 0;
+ return nullptr;
}
#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
@@ -119,24 +128,22 @@ __shared_weak_count::lock() _NOEXCEPT
const void*
__shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
{
- return 0;
+ return nullptr;
}
#endif // _LIBCPP_NO_RTTI
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
-static const std::size_t __sp_mut_count = 16;
-static pthread_mutex_t mut_back_imp[__sp_mut_count] =
+_LIBCPP_SAFE_STATIC static const std::size_t __sp_mut_count = 16;
+_LIBCPP_SAFE_STATIC static __libcpp_mutex_t mut_back[__sp_mut_count] =
{
- PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
- PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
- PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER,
- PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER
+ _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER,
+ _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER,
+ _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER,
+ _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER, _LIBCPP_MUTEX_INITIALIZER
};
-static mutex* mut_back = reinterpret_cast<std::mutex*>(mut_back_imp);
-
_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
: __lx(p)
{
@@ -145,13 +152,13 @@ _LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
void
__sp_mut::lock() _NOEXCEPT
{
- mutex& m = *static_cast<mutex*>(__lx);
+ auto m = static_cast<__libcpp_mutex_t*>(__lx);
unsigned count = 0;
- while (!m.try_lock())
+ while (!__libcpp_mutex_trylock(m))
{
if (++count > 16)
{
- m.lock();
+ __libcpp_mutex_lock(m);
break;
}
this_thread::yield();
@@ -161,13 +168,13 @@ __sp_mut::lock() _NOEXCEPT
void
__sp_mut::unlock() _NOEXCEPT
{
- static_cast<mutex*>(__lx)->unlock();
+ __libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx));
}
__sp_mut&
__get_sp_mut(const void* p)
{
- static __sp_mut muts[__sp_mut_count]
+ static __sp_mut muts[__sp_mut_count]
{
&mut_back[ 0], &mut_back[ 1], &mut_back[ 2], &mut_back[ 3],
&mut_back[ 4], &mut_back[ 5], &mut_back[ 6], &mut_back[ 7],
@@ -177,7 +184,7 @@ __get_sp_mut(const void* p)
return muts[hash<const void*>()(p) & (__sp_mut_count-1)];
}
-#endif // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
void
declare_reachable(void*)
@@ -194,11 +201,12 @@ undeclare_no_pointers(char*, size_t)
{
}
-pointer_safety
-get_pointer_safety() _NOEXCEPT
+#if !defined(_LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE)
+pointer_safety get_pointer_safety() _NOEXCEPT
{
return pointer_safety::relaxed;
}
+#endif
void*
__undeclare_reachable(void* p)
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/mutex.cpp b/chromium/buildtools/third_party/libc++/trunk/src/mutex.cpp
index 127e67a2627..b858e8877ae 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/mutex.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/mutex.cpp
@@ -11,7 +11,6 @@
#include "mutex"
#include "limits"
#include "system_error"
-#include "cassert"
#include "include/atomic_support.h"
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -23,13 +22,13 @@ const adopt_lock_t adopt_lock = {};
mutex::~mutex()
{
- pthread_mutex_destroy(&__m_);
+ __libcpp_mutex_destroy(&__m_);
}
void
mutex::lock()
{
- int ec = pthread_mutex_lock(&__m_);
+ int ec = __libcpp_mutex_lock(&__m_);
if (ec)
__throw_system_error(ec, "mutex lock failed");
}
@@ -37,59 +36,37 @@ mutex::lock()
bool
mutex::try_lock() _NOEXCEPT
{
- return pthread_mutex_trylock(&__m_) == 0;
+ return __libcpp_mutex_trylock(&__m_);
}
void
mutex::unlock() _NOEXCEPT
{
- int ec = pthread_mutex_unlock(&__m_);
+ int ec = __libcpp_mutex_unlock(&__m_);
(void)ec;
- assert(ec == 0);
+ _LIBCPP_ASSERT(ec == 0, "call to mutex::unlock failed");
}
// recursive_mutex
recursive_mutex::recursive_mutex()
{
- pthread_mutexattr_t attr;
- int ec = pthread_mutexattr_init(&attr);
+ int ec = __libcpp_recursive_mutex_init(&__m_);
if (ec)
- goto fail;
- ec = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- if (ec)
- {
- pthread_mutexattr_destroy(&attr);
- goto fail;
- }
- ec = pthread_mutex_init(&__m_, &attr);
- if (ec)
- {
- pthread_mutexattr_destroy(&attr);
- goto fail;
- }
- ec = pthread_mutexattr_destroy(&attr);
- if (ec)
- {
- pthread_mutex_destroy(&__m_);
- goto fail;
- }
- return;
-fail:
- __throw_system_error(ec, "recursive_mutex constructor failed");
+ __throw_system_error(ec, "recursive_mutex constructor failed");
}
recursive_mutex::~recursive_mutex()
{
- int e = pthread_mutex_destroy(&__m_);
+ int e = __libcpp_recursive_mutex_destroy(&__m_);
(void)e;
- assert(e == 0);
+ _LIBCPP_ASSERT(e == 0, "call to ~recursive_mutex() failed");
}
void
recursive_mutex::lock()
{
- int ec = pthread_mutex_lock(&__m_);
+ int ec = __libcpp_recursive_mutex_lock(&__m_);
if (ec)
__throw_system_error(ec, "recursive_mutex lock failed");
}
@@ -97,15 +74,15 @@ recursive_mutex::lock()
void
recursive_mutex::unlock() _NOEXCEPT
{
- int e = pthread_mutex_unlock(&__m_);
+ int e = __libcpp_recursive_mutex_unlock(&__m_);
(void)e;
- assert(e == 0);
+ _LIBCPP_ASSERT(e == 0, "call to recursive_mutex::unlock() failed");
}
bool
recursive_mutex::try_lock() _NOEXCEPT
{
- return pthread_mutex_trylock(&__m_) == 0;
+ return __libcpp_recursive_mutex_trylock(&__m_);
}
// timed_mutex
@@ -165,9 +142,9 @@ recursive_timed_mutex::~recursive_timed_mutex()
void
recursive_timed_mutex::lock()
{
- pthread_t id = pthread_self();
+ __libcpp_thread_id id = __libcpp_thread_get_current_id();
unique_lock<mutex> lk(__m_);
- if (pthread_equal(id, __id_))
+ if (__libcpp_thread_id_equal(id, __id_))
{
if (__count_ == numeric_limits<size_t>::max())
__throw_system_error(EAGAIN, "recursive_timed_mutex lock limit reached");
@@ -183,9 +160,9 @@ recursive_timed_mutex::lock()
bool
recursive_timed_mutex::try_lock() _NOEXCEPT
{
- pthread_t id = pthread_self();
+ __libcpp_thread_id id = __libcpp_thread_get_current_id();
unique_lock<mutex> lk(__m_, try_to_lock);
- if (lk.owns_lock() && (__count_ == 0 || pthread_equal(id, __id_)))
+ if (lk.owns_lock() && (__count_ == 0 || __libcpp_thread_id_equal(id, __id_)))
{
if (__count_ == numeric_limits<size_t>::max())
return false;
@@ -217,13 +194,10 @@ recursive_timed_mutex::unlock() _NOEXCEPT
// keep in sync with: 7741191.
#ifndef _LIBCPP_HAS_NO_THREADS
-static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
+_LIBCPP_SAFE_STATIC static __libcpp_mutex_t mut = _LIBCPP_MUTEX_INITIALIZER;
+_LIBCPP_SAFE_STATIC static __libcpp_condvar_t cv = _LIBCPP_CONDVAR_INITIALIZER;
#endif
-/// NOTE: Changes to flag are done via relaxed atomic stores
-/// even though the accesses are protected by a mutex because threads
-/// just entering 'call_once` concurrently read from flag.
void
__call_once(volatile unsigned long& flag, void* arg, void(*func)(void*))
{
@@ -247,9 +221,9 @@ __call_once(volatile unsigned long& flag, void* arg, void(*func)(void*))
#endif // _LIBCPP_NO_EXCEPTIONS
}
#else // !_LIBCPP_HAS_NO_THREADS
- pthread_mutex_lock(&mut);
+ __libcpp_mutex_lock(&mut);
while (flag == 1)
- pthread_cond_wait(&cv, &mut);
+ __libcpp_condvar_wait(&cv, &mut);
if (flag == 0)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
@@ -257,26 +231,26 @@ __call_once(volatile unsigned long& flag, void* arg, void(*func)(void*))
{
#endif // _LIBCPP_NO_EXCEPTIONS
__libcpp_relaxed_store(&flag, 1ul);
- pthread_mutex_unlock(&mut);
+ __libcpp_mutex_unlock(&mut);
func(arg);
- pthread_mutex_lock(&mut);
- __libcpp_relaxed_store(&flag, ~0ul);
- pthread_mutex_unlock(&mut);
- pthread_cond_broadcast(&cv);
+ __libcpp_mutex_lock(&mut);
+ __libcpp_atomic_store(&flag, ~0ul, _AO_Release);
+ __libcpp_mutex_unlock(&mut);
+ __libcpp_condvar_broadcast(&cv);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
{
- pthread_mutex_lock(&mut);
+ __libcpp_mutex_lock(&mut);
__libcpp_relaxed_store(&flag, 0ul);
- pthread_mutex_unlock(&mut);
- pthread_cond_broadcast(&cv);
+ __libcpp_mutex_unlock(&mut);
+ __libcpp_condvar_broadcast(&cv);
throw;
}
#endif // _LIBCPP_NO_EXCEPTIONS
}
else
- pthread_mutex_unlock(&mut);
+ __libcpp_mutex_unlock(&mut);
#endif // !_LIBCPP_HAS_NO_THREADS
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/new.cpp b/chromium/buildtools/third_party/libc++/trunk/src/new.cpp
index f4f73d86803..21b30740196 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/new.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/new.cpp
@@ -13,36 +13,56 @@
#include "new"
-#if defined(__APPLE__) && !defined(LIBCXXRT)
- #include <cxxabi.h>
-
- #ifndef _LIBCPPABI_VERSION
- // On Darwin, there are two STL shared libraries and a lower level ABI
- // shared library. The global holding the current new handler is
- // in the ABI library and named __cxa_new_handler.
- #define __new_handler __cxxabiapple::__cxa_new_handler
- #endif
-#else // __APPLE__
- #if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI)
- #include <cxxabi.h>
- #endif // defined(LIBCXX_BUILDING_LIBCXXABI)
- #if !defined(_LIBCPPABI_VERSION) && !defined(__GLIBCXX__)
- static std::new_handler __new_handler;
- #endif // _LIBCPPABI_VERSION
+#if defined(_LIBCPP_ABI_MICROSOFT)
+// nothing todo
+#elif defined(LIBCXX_BUILDING_LIBCXXABI)
+#include <cxxabi.h>
+#elif defined(LIBCXXRT)
+#include <cxxabi.h>
+#include "support/runtime/new_handler_fallback.ipp"
+#elif defined(__GLIBCXX__)
+// nothing todo
+#else
+# if defined(__APPLE__) && !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY)
+# include <cxxabi.h> // FIXME: remove this once buildit is gone.
+# else
+# include "support/runtime/new_handler_fallback.ipp"
+# endif
#endif
+namespace std
+{
+
#ifndef __GLIBCXX__
+const nothrow_t nothrow = {};
+#endif
+
+#ifndef LIBSTDCXX
+
+void
+__throw_bad_alloc()
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw bad_alloc();
+#else
+ _VSTD::abort();
+#endif
+}
+
+#endif // !LIBSTDCXX
+
+} // std
+
+#if !defined(__GLIBCXX__) && !defined(_LIBCPP_ABI_MICROSOFT) && \
+ !defined(_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
// Implement all new and delete operators as weak definitions
// in this shared library, so that they can be overridden by programs
// that define non-weak copies of the functions.
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void *
-operator new(std::size_t size)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
-#endif
+operator new(std::size_t size) _THROW_BAD_ALLOC
{
if (size == 0)
size = 1;
@@ -64,7 +84,7 @@ operator new(std::size_t size)
return p;
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void*
operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
{
@@ -83,17 +103,14 @@ operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
return p;
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void*
-operator new[](size_t size)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
-#endif
+operator new[](size_t size) _THROW_BAD_ALLOC
{
return ::operator new(size);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void*
operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
{
@@ -112,7 +129,7 @@ operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
return p;
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void
operator delete(void* ptr) _NOEXCEPT
{
@@ -120,130 +137,166 @@ operator delete(void* ptr) _NOEXCEPT
::free(ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void
operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
{
::operator delete(ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void
operator delete(void* ptr, size_t) _NOEXCEPT
{
::operator delete(ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void
operator delete[] (void* ptr) _NOEXCEPT
{
::operator delete(ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void
operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
{
::operator delete[](ptr);
}
-_LIBCPP_WEAK _LIBCPP_NEW_DELETE_VIS
+_LIBCPP_WEAK
void
operator delete[] (void* ptr, size_t) _NOEXCEPT
{
::operator delete[](ptr);
}
-#endif // !__GLIBCXX__
+#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
-namespace std
+_LIBCPP_WEAK
+void *
+operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
{
-
-#ifndef __GLIBCXX__
-const nothrow_t nothrow = {};
+ if (size == 0)
+ size = 1;
+ if (static_cast<size_t>(alignment) < sizeof(void*))
+ alignment = std::align_val_t(sizeof(void*));
+ void* p;
+#if defined(_LIBCPP_MSVCRT)
+ while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
+#else
+ while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
#endif
-
-#ifndef _LIBCPPABI_VERSION
-
-#ifndef __GLIBCXX__
-
-new_handler
-set_new_handler(new_handler handler) _NOEXCEPT
-{
- return __sync_lock_test_and_set(&__new_handler, handler);
-}
-
-new_handler
-get_new_handler() _NOEXCEPT
-{
- return __sync_fetch_and_add(&__new_handler, nullptr);
-}
-
-#endif // !__GLIBCXX__
-
-#ifndef LIBCXXRT
-
-bad_alloc::bad_alloc() _NOEXCEPT
-{
+ {
+ // If posix_memalign fails and there is a new_handler,
+ // call it to try free up memory.
+ std::new_handler nh = std::get_new_handler();
+ if (nh)
+ nh();
+ else {
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ throw std::bad_alloc();
+#else
+ p = nullptr; // posix_memalign doesn't initialize 'p' on failure
+ break;
+#endif
+ }
+ }
+ return p;
}
-#ifndef __GLIBCXX__
-
-bad_alloc::~bad_alloc() _NOEXCEPT
+_LIBCPP_WEAK
+void*
+operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
{
+ void* p = 0;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ p = ::operator new(size, alignment);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+ return p;
}
-const char*
-bad_alloc::what() const _NOEXCEPT
+_LIBCPP_WEAK
+void*
+operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
{
- return "std::bad_alloc";
+ return ::operator new(size, alignment);
}
-#endif // !__GLIBCXX__
-
-bad_array_new_length::bad_array_new_length() _NOEXCEPT
+_LIBCPP_WEAK
+void*
+operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
{
+ void* p = 0;
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ p = ::operator new[](size, alignment);
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+ return p;
}
-bad_array_new_length::~bad_array_new_length() _NOEXCEPT
+_LIBCPP_WEAK
+void
+operator delete(void* ptr, std::align_val_t) _NOEXCEPT
{
+ if (ptr)
+#if defined(_LIBCPP_MSVCRT)
+ ::_aligned_free(ptr);
+#else
+ ::free(ptr);
+#endif
}
-const char*
-bad_array_new_length::what() const _NOEXCEPT
+_LIBCPP_WEAK
+void
+operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
{
- return "bad_array_new_length";
+ ::operator delete(ptr, alignment);
}
-#endif //LIBCXXRT
-
-const char*
-bad_array_length::what() const _NOEXCEPT
+_LIBCPP_WEAK
+void
+operator delete(void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
{
- return "bad_array_length";
+ ::operator delete(ptr, alignment);
}
-bad_array_length::bad_array_length() _NOEXCEPT
+_LIBCPP_WEAK
+void
+operator delete[] (void* ptr, std::align_val_t alignment) _NOEXCEPT
{
+ ::operator delete(ptr, alignment);
}
-bad_array_length::~bad_array_length() _NOEXCEPT
+_LIBCPP_WEAK
+void
+operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
{
+ ::operator delete[](ptr, alignment);
}
-#endif // _LIBCPPABI_VERSION
-
-#ifndef LIBSTDCXX
-
+_LIBCPP_WEAK
void
-__throw_bad_alloc()
+operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
{
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw bad_alloc();
-#endif
+ ::operator delete[](ptr, alignment);
}
-#endif // !LIBSTDCXX
-
-} // std
+#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+#endif // !__GLIBCXX__ && !_LIBCPP_ABI_MICROSOFT && !_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/optional.cpp b/chromium/buildtools/third_party/libc++/trunk/src/optional.cpp
index 8c5dd76d86d..2877d175bc1 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/optional.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/optional.cpp
@@ -7,18 +7,22 @@
//
//===----------------------------------------------------------------------===//
+#include "optional"
#include "experimental/optional"
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
+namespace std
+{
-#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
-bad_optional_access::~bad_optional_access() _NOEXCEPT {}
+const char* bad_optional_access::what() const _NOEXCEPT {
+ return "bad_optional_access";
+ }
-#else
+} // std
-bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
-#endif
+bad_optional_access::~bad_optional_access() _NOEXCEPT = default;
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/random.cpp b/chromium/buildtools/third_party/libc++/trunk/src/random.cpp
index 4ab424eaa6e..eb2510a48c8 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/random.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/random.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+#include <__config>
+
#if defined(_LIBCPP_USING_WIN32_RANDOM)
// Must be defined before including stdlib.h to enable rand_s().
#define _CRT_RAND_S
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/regex.cpp b/chromium/buildtools/third_party/libc++/trunk/src/regex.cpp
index 17dd6eaa60a..a7363599d5a 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/regex.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/regex.cpp
@@ -69,21 +69,12 @@ regex_error::~regex_error() throw() {}
namespace {
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
struct collationnames
{
const char* elem_;
char char_;
};
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
const collationnames collatenames[] =
{
{"A", 0x41},
@@ -199,21 +190,12 @@ const collationnames collatenames[] =
{"zero", 0x30}
};
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
struct classnames
{
const char* elem_;
regex_traits<char>::char_class_type mask_;
};
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
const classnames ClassNames[] =
{
{"alnum", ctype_base::alnum},
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/stdexcept.cpp b/chromium/buildtools/third_party/libc++/trunk/src/stdexcept.cpp
index 0a08bfec27e..3f333309dd8 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/stdexcept.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/stdexcept.cpp
@@ -7,19 +7,21 @@
//
//===----------------------------------------------------------------------===//
-#include "__refstring"
#include "stdexcept"
#include "new"
#include "string"
#include "system_error"
+#include "__refstring"
/* For _LIBCPPABI_VERSION */
-#if defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE__) || defined(LIBCXXRT)
+#if !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) && \
+ (defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE__) || defined(LIBCXXRT))
#include <cxxabi.h>
#endif
static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
+
namespace std // purposefully not using versioning namespace
{
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/string.cpp b/chromium/buildtools/third_party/libc++/trunk/src/string.cpp
index d3f29df639f..d7ebdd3e5c9 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/string.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/string.cpp
@@ -13,17 +13,14 @@
#include "cerrno"
#include "limits"
#include "stdexcept"
-#ifdef _LIBCPP_MSVCRT
-#include "support/win32/support.h"
-#endif // _LIBCPP_MSVCRT
#include <stdio.h>
_LIBCPP_BEGIN_NAMESPACE_STD
-template class __basic_string_common<true>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __basic_string_common<true>;
-template class basic_string<char>;
-template class basic_string<wchar_t>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_string<char>;
+template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_string<wchar_t>;
template
string
@@ -40,7 +37,7 @@ void throw_helper( const string& msg )
throw T( msg );
#else
fprintf(stderr, "%s\n", msg.c_str());
- abort();
+ _VSTD::abort();
#endif
}
@@ -430,7 +427,7 @@ get_swprintf()
#ifndef _LIBCPP_MSVCRT
return swprintf;
#else
- return static_cast<int (__cdecl*)(wchar_t* __restrict, size_t, const wchar_t*__restrict, ...)>(swprintf);
+ return static_cast<int (__cdecl*)(wchar_t* __restrict, size_t, const wchar_t*__restrict, ...)>(_snwprintf);
#endif
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/strstream.cpp b/chromium/buildtools/third_party/libc++/trunk/src/strstream.cpp
index ea728138db6..be94f9c89e8 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/strstream.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/strstream.cpp
@@ -11,6 +11,8 @@
#include "algorithm"
#include "climits"
#include "cstring"
+#include "cstdlib"
+#include "__debug"
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -167,11 +169,13 @@ strstreambuf::overflow(int_type __c)
buf = new char[new_size];
if (buf == nullptr)
return int_type(EOF);
- memcpy(buf, eback(), static_cast<size_t>(old_size));
+ if (old_size != 0) {
+ _LIBCPP_ASSERT(eback(), "overflow copying from NULL");
+ memcpy(buf, eback(), static_cast<size_t>(old_size));
+ }
ptrdiff_t ninp = gptr() - eback();
ptrdiff_t einp = egptr() - eback();
ptrdiff_t nout = pptr() - pbase();
- ptrdiff_t eout = epptr() - pbase();
if (__strmode_ & __allocated)
{
if (__pfree_)
@@ -180,7 +184,7 @@ strstreambuf::overflow(int_type __c)
delete [] eback();
}
setg(buf, buf + ninp, buf + einp);
- setp(buf + einp, buf + einp + eout);
+ setp(buf + einp, buf + new_size);
pbump(static_cast<int>(nout));
__strmode_ |= __allocated;
}
@@ -263,6 +267,8 @@ strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmod
case ios::end:
newoff = seekhigh - eback();
break;
+ default:
+ _LIBCPP_UNREACHABLE();
}
newoff += __off;
if (0 <= newoff && newoff <= seekhigh - eback())
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_fallback.ipp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_fallback.ipp
new file mode 100644
index 00000000000..69c06a9ce3a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_fallback.ipp
@@ -0,0 +1,182 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <cstdio>
+
+namespace std {
+
+_LIBCPP_SAFE_STATIC static std::terminate_handler __terminate_handler;
+_LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
+
+
+// libcxxrt provides implementations of these functions itself.
+unexpected_handler
+set_unexpected(unexpected_handler func) _NOEXCEPT
+{
+ return __sync_lock_test_and_set(&__unexpected_handler, func);
+}
+
+unexpected_handler
+get_unexpected() _NOEXCEPT
+{
+ return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
+
+}
+
+_LIBCPP_NORETURN
+void unexpected()
+{
+ (*get_unexpected())();
+ // unexpected handler should not return
+ terminate();
+}
+
+terminate_handler
+set_terminate(terminate_handler func) _NOEXCEPT
+{
+ return __sync_lock_test_and_set(&__terminate_handler, func);
+}
+
+terminate_handler
+get_terminate() _NOEXCEPT
+{
+ return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
+
+}
+
+#ifndef __EMSCRIPTEN__ // We provide this in JS
+_LIBCPP_NORETURN
+void
+terminate() _NOEXCEPT
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ (*get_terminate())();
+ // handler should not return
+ fprintf(stderr, "terminate_handler unexpectedly returned\n");
+ ::abort();
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ // handler should not throw exception
+ fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
+ ::abort();
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+}
+#endif // !__EMSCRIPTEN__
+
+#if !defined(__EMSCRIPTEN__)
+bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
+
+int uncaught_exceptions() _NOEXCEPT
+{
+#warning uncaught_exception not yet implemented
+ fprintf(stderr, "uncaught_exceptions not yet implemented\n");
+ ::abort();
+}
+#endif // !__EMSCRIPTEN__
+
+
+exception::~exception() _NOEXCEPT
+{
+}
+
+const char* exception::what() const _NOEXCEPT
+{
+ return "std::exception";
+}
+
+bad_exception::~bad_exception() _NOEXCEPT
+{
+}
+
+const char* bad_exception::what() const _NOEXCEPT
+{
+ return "std::bad_exception";
+}
+
+
+bad_alloc::bad_alloc() _NOEXCEPT
+{
+}
+
+bad_alloc::~bad_alloc() _NOEXCEPT
+{
+}
+
+const char*
+bad_alloc::what() const _NOEXCEPT
+{
+ return "std::bad_alloc";
+}
+
+bad_array_new_length::bad_array_new_length() _NOEXCEPT
+{
+}
+
+bad_array_new_length::~bad_array_new_length() _NOEXCEPT
+{
+}
+
+const char*
+bad_array_new_length::what() const _NOEXCEPT
+{
+ return "bad_array_new_length";
+}
+
+
+bad_array_length::bad_array_length() _NOEXCEPT
+{
+}
+
+bad_array_length::~bad_array_length() _NOEXCEPT
+{
+}
+
+const char*
+bad_array_length::what() const _NOEXCEPT
+{
+ return "bad_array_length";
+}
+
+
+bad_cast::bad_cast() _NOEXCEPT
+{
+}
+
+bad_typeid::bad_typeid() _NOEXCEPT
+{
+}
+
+bad_cast::~bad_cast() _NOEXCEPT
+{
+}
+
+const char*
+bad_cast::what() const _NOEXCEPT
+{
+ return "std::bad_cast";
+}
+
+bad_typeid::~bad_typeid() _NOEXCEPT
+{
+}
+
+const char*
+bad_typeid::what() const _NOEXCEPT
+{
+ return "std::bad_typeid";
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_glibcxx.ipp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_glibcxx.ipp
new file mode 100644
index 00000000000..0f78932f6f9
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_glibcxx.ipp
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef __GLIBCXX__
+#error header can only be used when targeting libstdc++ or libsupc++
+#endif
+
+namespace std {
+
+bad_alloc::bad_alloc() _NOEXCEPT
+{
+}
+
+bad_array_new_length::bad_array_new_length() _NOEXCEPT
+{
+}
+
+bad_array_length::bad_array_length() _NOEXCEPT
+{
+}
+
+
+bad_cast::bad_cast() _NOEXCEPT
+{
+}
+
+bad_typeid::bad_typeid() _NOEXCEPT
+{
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_libcxxabi.ipp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_libcxxabi.ipp
new file mode 100644
index 00000000000..c3dcf1ec591
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_libcxxabi.ipp
@@ -0,0 +1,28 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPPABI_VERSION
+#error this header can only be used with libc++abi
+#endif
+
+namespace std {
+
+bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
+
+int uncaught_exceptions() _NOEXCEPT
+{
+# if _LIBCPPABI_VERSION > 1101
+ return __cxa_uncaught_exceptions();
+# else
+ return __cxa_uncaught_exception() ? 1 : 0;
+# endif
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/exception.cpp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_libcxxrt.ipp
index c47a9b76266..6d9e0cff58d 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/exception.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_libcxxrt.ipp
@@ -1,4 +1,5 @@
-//===---------------------------- exception.cpp ---------------------------===//
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,35 +8,34 @@
//
//===----------------------------------------------------------------------===//
-#include <exception>
-
-#pragma GCC visibility push(default)
-
-namespace std
-{
+#ifndef LIBCXXRT
+#error this header may only be used when targeting libcxxrt
+#endif
-// exception
+namespace std {
-exception::~exception() _NOEXCEPT
+bad_exception::~bad_exception() _NOEXCEPT
{
}
-const char* exception::what() const _NOEXCEPT
+const char* bad_exception::what() const _NOEXCEPT
{
- return "std::exception";
+ return "std::bad_exception";
}
-// bad_exception
-bad_exception::~bad_exception() _NOEXCEPT
+bad_array_length::bad_array_length() _NOEXCEPT
{
}
-const char* bad_exception::what() const _NOEXCEPT
+bad_array_length::~bad_array_length() _NOEXCEPT
{
- return "std::bad_exception";
}
-} // std
+const char*
+bad_array_length::what() const _NOEXCEPT
+{
+ return "bad_array_length";
+}
-#pragma GCC visibility pop
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_msvc.ipp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_msvc.ipp
new file mode 100644
index 00000000000..950ec0cebfe
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_msvc.ipp
@@ -0,0 +1,89 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_ABI_MICROSOFT
+#error this header can only be used when targeting the MSVC ABI
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <eh.h>
+#include <corecrt_terminate.h>
+
+namespace std {
+
+// libcxxrt provides implementations of these functions itself.
+unexpected_handler
+set_unexpected(unexpected_handler func) _NOEXCEPT {
+ return ::set_unexpected(func);
+}
+
+unexpected_handler get_unexpected() _NOEXCEPT {
+ return ::_get_unexpected();
+}
+
+_LIBCPP_NORETURN
+void unexpected() {
+ (*get_unexpected())();
+ // unexpected handler should not return
+ terminate();
+}
+
+terminate_handler set_terminate(terminate_handler func) _NOEXCEPT {
+ return ::set_terminate(func);
+}
+
+terminate_handler get_terminate() _NOEXCEPT {
+ return ::_get_terminate();
+}
+
+_LIBCPP_NORETURN
+void terminate() _NOEXCEPT
+{
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCPP_NO_EXCEPTIONS
+ (*get_terminate())();
+ // handler should not return
+ fprintf(stderr, "terminate_handler unexpectedly returned\n");
+ ::abort();
+#ifndef _LIBCPP_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ // handler should not throw exception
+ fprintf(stderr, "terminate_handler unexpectedly threw an exception\n");
+ ::abort();
+ }
+#endif // _LIBCPP_NO_EXCEPTIONS
+}
+
+bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
+
+int uncaught_exceptions() _NOEXCEPT {
+ return __uncaught_exceptions();
+}
+
+bad_array_length::bad_array_length() _NOEXCEPT
+{
+}
+
+bad_array_length::~bad_array_length() _NOEXCEPT
+{
+}
+
+const char*
+bad_array_length::what() const _NOEXCEPT
+{
+ return "bad_array_length";
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_cxxabi.ipp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_cxxabi.ipp
new file mode 100644
index 00000000000..dfac8648c49
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_cxxabi.ipp
@@ -0,0 +1,74 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef HAVE_DEPENDENT_EH_ABI
+#error this header may only be used with libc++abi or libcxxrt
+#endif
+
+namespace std {
+
+exception_ptr::~exception_ptr() _NOEXCEPT {
+ __cxa_decrement_exception_refcount(__ptr_);
+}
+
+exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
+ : __ptr_(other.__ptr_)
+{
+ __cxa_increment_exception_refcount(__ptr_);
+}
+
+exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
+{
+ if (__ptr_ != other.__ptr_)
+ {
+ __cxa_increment_exception_refcount(other.__ptr_);
+ __cxa_decrement_exception_refcount(__ptr_);
+ __ptr_ = other.__ptr_;
+ }
+ return *this;
+}
+
+nested_exception::nested_exception() _NOEXCEPT
+ : __ptr_(current_exception())
+{
+}
+
+nested_exception::~nested_exception() _NOEXCEPT
+{
+}
+
+_LIBCPP_NORETURN
+void
+nested_exception::rethrow_nested() const
+{
+ if (__ptr_ == nullptr)
+ terminate();
+ rethrow_exception(__ptr_);
+}
+
+exception_ptr current_exception() _NOEXCEPT
+{
+ // be nicer if there was a constructor that took a ptr, then
+ // this whole function would be just:
+ // return exception_ptr(__cxa_current_primary_exception());
+ exception_ptr ptr;
+ ptr.__ptr_ = __cxa_current_primary_exception();
+ return ptr;
+}
+
+_LIBCPP_NORETURN
+void rethrow_exception(exception_ptr p)
+{
+ __cxa_rethrow_primary_exception(p.__ptr_);
+ // if p.__ptr_ is NULL, above returns so we terminate
+ terminate();
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_glibcxx.ipp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_glibcxx.ipp
new file mode 100644
index 00000000000..9d20dfe4862
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_glibcxx.ipp
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// libsupc++ does not implement the dependent EH ABI and the functionality
+// it uses to implement std::exception_ptr (which it declares as an alias of
+// std::__exception_ptr::exception_ptr) is not directly exported to clients. So
+// we have little choice but to hijack std::__exception_ptr::exception_ptr's
+// (which fortunately has the same layout as our std::exception_ptr) copy
+// constructor, assignment operator and destructor (which are part of its
+// stable ABI), and its rethrow_exception(std::__exception_ptr::exception_ptr)
+// function.
+
+namespace std {
+
+namespace __exception_ptr
+{
+
+struct exception_ptr
+{
+ void* __ptr_;
+
+ exception_ptr(const exception_ptr&) _NOEXCEPT;
+ exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
+ ~exception_ptr() _NOEXCEPT;
+};
+
+}
+
+_LIBCPP_NORETURN void rethrow_exception(__exception_ptr::exception_ptr);
+
+exception_ptr::~exception_ptr() _NOEXCEPT
+{
+ reinterpret_cast<__exception_ptr::exception_ptr*>(this)->~exception_ptr();
+}
+
+exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
+ : __ptr_(other.__ptr_)
+{
+ new (reinterpret_cast<void*>(this)) __exception_ptr::exception_ptr(
+ reinterpret_cast<const __exception_ptr::exception_ptr&>(other));
+}
+
+exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
+{
+ *reinterpret_cast<__exception_ptr::exception_ptr*>(this) =
+ reinterpret_cast<const __exception_ptr::exception_ptr&>(other);
+ return *this;
+}
+
+nested_exception::nested_exception() _NOEXCEPT
+ : __ptr_(current_exception())
+{
+}
+
+
+_LIBCPP_NORETURN
+void
+nested_exception::rethrow_nested() const
+{
+ if (__ptr_ == nullptr)
+ terminate();
+ rethrow_exception(__ptr_);
+}
+
+_LIBCPP_NORETURN
+void rethrow_exception(exception_ptr p)
+{
+ rethrow_exception(reinterpret_cast<__exception_ptr::exception_ptr&>(p));
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_msvc.ipp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_msvc.ipp
new file mode 100644
index 00000000000..eab5d30a948
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_msvc.ipp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <yvals.h> // for _CRTIMP2_PURE
+
+_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate(_Out_ void*);
+_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy(_Inout_ void*);
+_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy(_Out_ void*,
+ _In_ const void*);
+_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
+__ExceptionPtrAssign(_Inout_ void*, _In_ const void*);
+_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL
+__ExceptionPtrCompare(_In_ const void*, _In_ const void*);
+_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL
+__ExceptionPtrToBool(_In_ const void*);
+_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(_Inout_ void*,
+ _Inout_ void*);
+_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
+__ExceptionPtrCurrentException(_Out_ void*);
+[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
+__ExceptionPtrRethrow(_In_ const void*);
+_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
+__ExceptionPtrCopyException(_Inout_ void*, _In_ const void*, _In_ const void*);
+
+namespace std {
+
+exception_ptr::exception_ptr() _NOEXCEPT { __ExceptionPtrCreate(this); }
+exception_ptr::exception_ptr(nullptr_t) _NOEXCEPT { __ExceptionPtrCreate(this); }
+
+exception_ptr::exception_ptr(const exception_ptr& __other) _NOEXCEPT {
+ __ExceptionPtrCopy(this, &__other);
+}
+exception_ptr& exception_ptr::operator=(const exception_ptr& __other) _NOEXCEPT {
+ __ExceptionPtrAssign(this, &__other);
+ return *this;
+}
+
+exception_ptr& exception_ptr::operator=(nullptr_t) _NOEXCEPT {
+ exception_ptr dummy;
+ __ExceptionPtrAssign(this, &dummy);
+ return *this;
+}
+
+exception_ptr::~exception_ptr() _NOEXCEPT { __ExceptionPtrDestroy(this); }
+
+exception_ptr::operator bool() const _NOEXCEPT {
+ return __ExceptionPtrToBool(this);
+}
+
+bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
+ return __ExceptionPtrCompare(&__x, &__y);
+}
+
+
+void swap(exception_ptr& lhs, exception_ptr& rhs) _NOEXCEPT {
+ __ExceptionPtrSwap(&rhs, &lhs);
+}
+
+exception_ptr __copy_exception_ptr(void* __except, const void* __ptr) {
+ exception_ptr __ret = nullptr;
+ if (__ptr)
+ __ExceptionPtrCopyException(&__ret, __except, __ptr);
+ return __ret;
+}
+
+exception_ptr current_exception() _NOEXCEPT {
+ exception_ptr __ret;
+ __ExceptionPtrCurrentException(&__ret);
+ return __ret;
+}
+
+_LIBCPP_NORETURN
+void rethrow_exception(exception_ptr p) { __ExceptionPtrRethrow(&p); }
+
+nested_exception::nested_exception() _NOEXCEPT : __ptr_(current_exception()) {}
+
+nested_exception::~nested_exception() _NOEXCEPT {}
+
+_LIBCPP_NORETURN
+void nested_exception::rethrow_nested() const {
+ if (__ptr_ == nullptr)
+ terminate();
+ rethrow_exception(__ptr_);
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_unimplemented.ipp b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_unimplemented.ipp
new file mode 100644
index 00000000000..21c182c8597
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/exception_pointer_unimplemented.ipp
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdio.h>
+#include <stdlib.h>
+
+namespace std {
+
+exception_ptr::~exception_ptr() _NOEXCEPT
+{
+# warning exception_ptr not yet implemented
+ fprintf(stderr, "exception_ptr not yet implemented\n");
+ ::abort();
+}
+
+exception_ptr::exception_ptr(const exception_ptr& other) _NOEXCEPT
+ : __ptr_(other.__ptr_)
+{
+# warning exception_ptr not yet implemented
+ fprintf(stderr, "exception_ptr not yet implemented\n");
+ ::abort();
+}
+
+exception_ptr& exception_ptr::operator=(const exception_ptr& other) _NOEXCEPT
+{
+# warning exception_ptr not yet implemented
+ fprintf(stderr, "exception_ptr not yet implemented\n");
+ ::abort();
+}
+
+nested_exception::nested_exception() _NOEXCEPT
+ : __ptr_(current_exception())
+{
+}
+
+#if !defined(__GLIBCXX__)
+
+nested_exception::~nested_exception() _NOEXCEPT
+{
+}
+
+#endif
+
+_LIBCPP_NORETURN
+void
+nested_exception::rethrow_nested() const
+{
+# warning exception_ptr not yet implemented
+ fprintf(stderr, "exception_ptr not yet implemented\n");
+ ::abort();
+#if 0
+ if (__ptr_ == nullptr)
+ terminate();
+ rethrow_exception(__ptr_);
+#endif // FIXME
+}
+
+exception_ptr current_exception() _NOEXCEPT
+{
+# warning exception_ptr not yet implemented
+ fprintf(stderr, "exception_ptr not yet implemented\n");
+ ::abort();
+}
+
+_LIBCPP_NORETURN
+void rethrow_exception(exception_ptr p)
+{
+# warning exception_ptr not yet implemented
+ fprintf(stderr, "exception_ptr not yet implemented\n");
+ ::abort();
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/include/__undef___deallocate b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/new_handler_fallback.ipp
index 2b4ad99dad3..b7092d542d9 100644
--- a/chromium/buildtools/third_party/libc++/trunk/include/__undef___deallocate
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/runtime/new_handler_fallback.ipp
@@ -8,11 +8,20 @@
//
//===----------------------------------------------------------------------===//
-#ifdef __deallocate
-#if defined(_MSC_VER) && !defined(__clang__)
-_LIBCPP_WARNING("macro __deallocate is incompatible with C++. #undefining __deallocate")
-#else
-#warning: macro __deallocate is incompatible with C++. #undefining __deallocate
-#endif
-#undef __deallocate
-#endif
+namespace std {
+
+_LIBCPP_SAFE_STATIC static std::new_handler __new_handler;
+
+new_handler
+set_new_handler(new_handler handler) _NOEXCEPT
+{
+ return __sync_lock_test_and_set(&__new_handler, handler);
+}
+
+new_handler
+get_new_handler() _NOEXCEPT
+{
+ return __sync_fetch_and_add(&__new_handler, nullptr);
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/solaris/xlocale.c b/chromium/buildtools/third_party/libc++/trunk/src/support/solaris/xlocale.cpp
index 9125eea7377..6eaf317c768 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/support/solaris/xlocale.c
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/solaris/xlocale.cpp
@@ -14,12 +14,13 @@
#include <stdio.h>
#include <sys/localedef.h>
+extern "C" {
int isxdigit_l(int __c, locale_t __l) {
return isxdigit(__c);
}
-int iswxdigit_l(wchar_t __c, locale_t __l) {
+int iswxdigit_l(wint_t __c, locale_t __l) {
return isxdigit(__c);
}
@@ -63,4 +64,6 @@ struct lconv *localeconv_l(locale_t __l) {
return localeconv();
}
+};
+
#endif // __sun__
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/support/win32/locale_win32.cpp b/chromium/buildtools/third_party/libc++/trunk/src/support/win32/locale_win32.cpp
index 5a43743470d..28cb4491781 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/support/win32/locale_win32.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/support/win32/locale_win32.cpp
@@ -10,12 +10,17 @@
#include <locale>
#include <cstdarg> // va_start, va_end
+#include <memory>
+#include <type_traits>
+
+using std::__libcpp_locale_guard;
// FIXME: base currently unused. Needs manual work to construct the new locale
locale_t newlocale( int mask, const char * locale, locale_t /*base*/ )
{
return _create_locale( mask, locale );
}
+
locale_t uselocale( locale_t newloc )
{
locale_t old_locale = _get_current_locale();
@@ -24,65 +29,66 @@ locale_t uselocale( locale_t newloc )
// uselocale sets the thread's locale by definition, so unconditionally use thread-local locale
_configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
// uselocale sets all categories
- setlocale( LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale );
+ // disable setting locale on Windows temporarily because the structure is opaque (PR31516)
+ //setlocale( LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale );
// uselocale returns the old locale_t
return old_locale;
}
lconv *localeconv_l( locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return localeconv();
}
size_t mbrlen_l( const char *__restrict s, size_t n,
mbstate_t *__restrict ps, locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return mbrlen( s, n, ps );
}
size_t mbsrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
size_t len, mbstate_t *__restrict ps, locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return mbsrtowcs( dst, src, len, ps );
}
size_t wcrtomb_l( char *__restrict s, wchar_t wc, mbstate_t *__restrict ps,
locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return wcrtomb( s, wc, ps );
}
size_t mbrtowc_l( wchar_t *__restrict pwc, const char *__restrict s,
size_t n, mbstate_t *__restrict ps, locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return mbrtowc( pwc, s, n, ps );
}
size_t mbsnrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
size_t nms, size_t len, mbstate_t *__restrict ps, locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return mbsnrtowcs( dst, src, nms, len, ps );
}
size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src,
size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return wcsnrtombs( dst, src, nwc, len, ps );
}
wint_t btowc_l( int c, locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return btowc( c );
}
int wctob_l( wint_t c, locale_t loc )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return wctob( c );
}
int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...)
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
va_list ap;
va_start( ap, format );
int result = vsnprintf( ret, n, format, ap );
@@ -100,6 +106,6 @@ int asprintf_l( char **ret, locale_t loc, const char *format, ... )
}
int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap )
{
- __locale_raii __current( uselocale(loc), uselocale );
+ __libcpp_locale_guard __current(loc);
return vasprintf( ret, format, ap );
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/system_error.cpp b/chromium/buildtools/third_party/libc++/trunk/src/system_error.cpp
index 3023e200aa3..cbbbb5dcd15 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/system_error.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/system_error.cpp
@@ -13,16 +13,27 @@
#include "system_error"
#include "include/config_elast.h"
+#include "cerrno"
#include "cstring"
+#include "cstdio"
+#include "cstdlib"
#include "string"
+#include "string.h"
+#include "__debug"
+
+#if defined(__ANDROID__)
+#include <android/api-level.h>
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
// class error_category
+#if defined(_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS)
error_category::error_category() _NOEXCEPT
{
}
+#endif
error_category::~error_category() _NOEXCEPT
{
@@ -46,10 +57,66 @@ error_category::equivalent(const error_code& code, int condition) const _NOEXCEP
return *this == code.category() && code.value() == condition;
}
+#if !defined(_LIBCPP_HAS_NO_THREADS)
+namespace {
+
+// GLIBC also uses 1024 as the maximum buffer size internally.
+constexpr size_t strerror_buff_size = 1024;
+
+string do_strerror_r(int ev);
+
+#if defined(_LIBCPP_MSVCRT)
+string do_strerror_r(int ev) {
+ char buffer[strerror_buff_size];
+ if (::strerror_s(buffer, strerror_buff_size, ev) == 0)
+ return string(buffer);
+ std::snprintf(buffer, strerror_buff_size, "unknown error %d", ev);
+ return string(buffer);
+}
+#elif defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) && \
+ (!defined(__ANDROID__) || __ANDROID_API__ >= 23)
+// GNU Extended version
+string do_strerror_r(int ev) {
+ char buffer[strerror_buff_size];
+ char* ret = ::strerror_r(ev, buffer, strerror_buff_size);
+ return string(ret);
+}
+#else
+// POSIX version
+string do_strerror_r(int ev) {
+ char buffer[strerror_buff_size];
+ const int old_errno = errno;
+ int ret;
+ if ((ret = ::strerror_r(ev, buffer, strerror_buff_size)) != 0) {
+ // If `ret == -1` then the error is specified using `errno`, otherwise
+ // `ret` represents the error.
+ const int new_errno = ret == -1 ? errno : ret;
+ errno = old_errno;
+ if (new_errno == EINVAL) {
+ std::snprintf(buffer, strerror_buff_size, "Unknown error %d", ev);
+ return string(buffer);
+ } else {
+ _LIBCPP_ASSERT(new_errno == ERANGE, "unexpected error from ::strerr_r");
+ // FIXME maybe? 'strerror_buff_size' is likely to exceed the
+ // maximum error size so ERANGE shouldn't be returned.
+ std::abort();
+ }
+ }
+ return string(buffer);
+}
+#endif
+
+} // end namespace
+#endif
+
string
__do_message::message(int ev) const
{
- return string(strerror(ev));
+#if defined(_LIBCPP_HAS_NO_THREADS)
+ return string(::strerror(ev));
+#else
+ return do_strerror_r(ev);
+#endif
}
class _LIBCPP_HIDDEN __generic_error_category
@@ -203,6 +270,7 @@ __throw_system_error(int ev, const char* what_arg)
#else
(void)ev;
(void)what_arg;
+ _VSTD::abort();
#endif
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/thread.cpp b/chromium/buildtools/third_party/libc++/trunk/src/thread.cpp
index bd27f287838..412a8fa0a62 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/thread.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/thread.cpp
@@ -16,55 +16,62 @@
#include "future"
#include "limits"
#include <sys/types.h>
-#if !defined(_WIN32)
-# if !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) && !defined(__CloudABI__)
+
+#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+# include <sys/param.h>
+# if defined(BSD)
# include <sys/sysctl.h>
-# endif // !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) && !defined(__CloudABI__)
+# endif // defined(BSD)
+#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+
+#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__CloudABI__) || defined(__Fuchsia__)
# include <unistd.h>
-#endif // !_WIN32
+#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__CloudABI__) || defined(__Fuchsia__)
#if defined(__NetBSD__)
#pragma weak pthread_create // Do not create libpthread dependency
#endif
-#if defined(_WIN32)
+
+#if defined(_LIBCPP_WIN32API)
#include <windows.h>
-#endif
+#endif // defined(_LIBCPP_WIN32API)
_LIBCPP_BEGIN_NAMESPACE_STD
thread::~thread()
{
- if (__t_ != 0)
+ if (!__libcpp_thread_isnull(&__t_))
terminate();
}
void
thread::join()
{
- int ec = pthread_join(__t_, 0);
-#ifndef _LIBCPP_NO_EXCEPTIONS
+ int ec = EINVAL;
+ if (!__libcpp_thread_isnull(&__t_))
+ {
+ ec = __libcpp_thread_join(&__t_);
+ if (ec == 0)
+ __t_ = _LIBCPP_NULL_THREAD;
+ }
+
if (ec)
- throw system_error(error_code(ec, system_category()), "thread::join failed");
-#else
- (void)ec;
-#endif // _LIBCPP_NO_EXCEPTIONS
- __t_ = 0;
+ __throw_system_error(ec, "thread::join failed");
}
void
thread::detach()
{
int ec = EINVAL;
- if (__t_ != 0)
+ if (!__libcpp_thread_isnull(&__t_))
{
- ec = pthread_detach(__t_);
+ ec = __libcpp_thread_detach(&__t_);
if (ec == 0)
- __t_ = 0;
+ __t_ = _LIBCPP_NULL_THREAD;
}
-#ifndef _LIBCPP_NO_EXCEPTIONS
+
if (ec)
- throw system_error(error_code(ec, system_category()), "thread::detach failed");
-#endif // _LIBCPP_NO_EXCEPTIONS
+ __throw_system_error(ec, "thread::detach failed");
}
unsigned
@@ -85,14 +92,14 @@ thread::hardware_concurrency() _NOEXCEPT
if (result < 0)
return 0;
return static_cast<unsigned>(result);
-#elif defined(_WIN32)
+#elif defined(_LIBCPP_WIN32API)
SYSTEM_INFO info;
GetSystemInfo(&info);
return info.dwNumberOfProcessors;
#else // defined(CTL_HW) && defined(HW_NCPU)
// TODO: grovel through /proc or check cpuid on x86 and similar
// instructions on other architectures.
-# if defined(_MSC_VER) && ! defined(__clang__)
+# if defined(_LIBCPP_WARNING)
_LIBCPP_WARNING("hardware_concurrency not yet implemented")
# else
# warning hardware_concurrency not yet implemented
@@ -107,26 +114,9 @@ namespace this_thread
void
sleep_for(const chrono::nanoseconds& ns)
{
- using namespace chrono;
- if (ns > nanoseconds::zero())
+ if (ns > chrono::nanoseconds::zero())
{
- seconds s = duration_cast<seconds>(ns);
- timespec ts;
- typedef decltype(ts.tv_sec) ts_sec;
- _LIBCPP_CONSTEXPR ts_sec ts_sec_max = numeric_limits<ts_sec>::max();
- if (s.count() < ts_sec_max)
- {
- ts.tv_sec = static_cast<ts_sec>(s.count());
- ts.tv_nsec = static_cast<decltype(ts.tv_nsec)>((ns-s).count());
- }
- else
- {
- ts.tv_sec = ts_sec_max;
- ts.tv_nsec = giga::num - 1;
- }
-
- while (nanosleep(&ts, &ts) == -1 && errno == EINTR)
- ;
+ __libcpp_thread_sleep_for(ns);
}
}
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/typeinfo.cpp b/chromium/buildtools/third_party/libc++/trunk/src/typeinfo.cpp
index 5c0a609b5e5..02778f36870 100644
--- a/chromium/buildtools/third_party/libc++/trunk/src/typeinfo.cpp
+++ b/chromium/buildtools/third_party/libc++/trunk/src/typeinfo.cpp
@@ -6,63 +6,15 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#include <stdlib.h>
-
-#if defined(__APPLE__) || defined(LIBCXXRT) || \
- defined(LIBCXX_BUILDING_LIBCXXABI)
-#include <cxxabi.h>
-#endif
#include "typeinfo"
-#if !defined(LIBCXXRT) && !defined(_LIBCPPABI_VERSION)
-
-std::bad_cast::bad_cast() _NOEXCEPT
-{
-}
-
-std::bad_typeid::bad_typeid() _NOEXCEPT
+// FIXME: Remove __APPLE__ default here once buildit is gone.
+#if (!defined(_LIBCPP_ABI_MICROSOFT) && !defined(LIBCXX_BUILDING_LIBCXXABI) && \
+ !defined(LIBCXXRT) && !defined(__GLIBCXX__) && \
+ !defined(__APPLE__)) || \
+ defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) // FIXME: remove this configuration.
+std::type_info::~type_info()
{
}
-
-#ifndef __GLIBCXX__
-
-std::bad_cast::~bad_cast() _NOEXCEPT
-{
-}
-
-const char*
-std::bad_cast::what() const _NOEXCEPT
-{
- return "std::bad_cast";
-}
-
-std::bad_typeid::~bad_typeid() _NOEXCEPT
-{
-}
-
-const char*
-std::bad_typeid::what() const _NOEXCEPT
-{
- return "std::bad_typeid";
-}
-
-#ifdef __APPLE__
- // On Darwin, the cxa_bad_* functions cannot be in the lower level library
- // because bad_cast and bad_typeid are defined in his higher level library
- void __cxxabiv1::__cxa_bad_typeid()
- {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw std::bad_typeid();
-#endif
- }
- void __cxxabiv1::__cxa_bad_cast()
- {
-#ifndef _LIBCPP_NO_EXCEPTIONS
- throw std::bad_cast();
#endif
- }
-#endif
-
-#endif // !__GLIBCXX__
-#endif // !LIBCXXRT && !_LIBCPPABI_VERSION
diff --git a/chromium/buildtools/third_party/libc++/trunk/src/variant.cpp b/chromium/buildtools/third_party/libc++/trunk/src/variant.cpp
new file mode 100644
index 00000000000..5bb508c3f46
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/src/variant.cpp
@@ -0,0 +1,18 @@
+//===------------------------ variant.cpp ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "variant"
+
+namespace std {
+
+const char* bad_variant_access::what() const noexcept {
+ return "bad_variant_access";
+}
+
+} // namespace std
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/cat_files.py b/chromium/buildtools/third_party/libc++/trunk/utils/cat_files.py
new file mode 100755
index 00000000000..83e7632f34a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/cat_files.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
+from argparse import ArgumentParser
+import sys
+
+def print_and_exit(msg):
+ sys.stderr.write(msg + '\n')
+ sys.exit(1)
+
+def main():
+ parser = ArgumentParser(
+ description="Concatenate two files into a single file")
+ parser.add_argument(
+ '-o', '--output', dest='output', required=True,
+ help='The output file. stdout is used if not given',
+ type=str, action='store')
+ parser.add_argument(
+ 'files', metavar='files', nargs='+',
+ help='The files to concatenate')
+
+ args = parser.parse_args()
+
+ if len(args.files) < 2:
+ print_and_exit('fewer than 2 inputs provided')
+ data = ''
+ for filename in args.files:
+ with open(filename, 'r') as f:
+ data += f.read()
+ if len(data) != 0 and data[-1] != '\n':
+ data += '\n'
+ assert len(data) > 0 and "cannot cat empty files"
+ with open(args.output, 'w') as f:
+ f.write(data)
+
+
+if __name__ == '__main__':
+ main()
+ sys.exit(0)
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/gen_link_script/gen_link_script.py b/chromium/buildtools/third_party/libc++/trunk/utils/gen_link_script.py
index 5de18f9129c..24fe5ce9904 100755
--- a/chromium/buildtools/third_party/libc++/trunk/utils/gen_link_script/gen_link_script.py
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/gen_link_script.py
@@ -1,4 +1,13 @@
#!/usr/bin/env python
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
import os
import sys
@@ -7,13 +16,13 @@ def print_and_exit(msg):
sys.exit(1)
def usage_and_exit():
- print_and_exit("Usage: ./gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <abi_libname>")
+ print_and_exit("Usage: ./gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <public_libs>...")
def help_and_exit():
help_msg = \
"""Usage
- gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <abi_libname>
+ gen_link_script.py [--help] [--dryrun] <path/to/libcxx.so> <public_libs>...
Generate a linker script that links libc++ to the proper ABI library.
The script replaces the specified libc++ symlink.
@@ -22,8 +31,7 @@ def help_and_exit():
Arguments
<path/to/libcxx.so> - The top level symlink to the versioned libc++ shared
library. This file is replaced with a linker script.
- <abi_libname> - The name of the ABI library to use in the linker script.
- The name must be one of [c++abi, stdc++, supc++, cxxrt].
+ <public_libs> - List of library names to include in linker script.
Exit Status:
0 if OK,
@@ -41,14 +49,14 @@ def parse_args():
dryrun = '--dryrun' == args[0]
if dryrun:
del args[0]
- if len(args) != 2:
+ if len(args) < 2:
usage_and_exit()
symlink_file = args[0]
- abi_libname = args[1]
- return dryrun, symlink_file, abi_libname
+ public_libs = args[1:]
+ return dryrun, symlink_file, public_libs
def main():
- dryrun, symlink_file, abi_libname = parse_args()
+ dryrun, symlink_file, public_libs = parse_args()
# Check that the given libc++.so file is a valid symlink.
if not os.path.islink(symlink_file):
@@ -57,15 +65,12 @@ def main():
# Read the symlink so we know what libc++ to link to in the linker script.
linked_libcxx = os.readlink(symlink_file)
- # Check that the abi_libname is one of the supported values.
- supported_abi_list = ['c++abi', 'stdc++', 'supc++', 'cxxrt']
- if abi_libname not in supported_abi_list:
- print_and_exit("abi name '%s' is not supported: Use one of %r" %
- (abi_libname, supported_abi_list))
+ # Prepare the list of public libraries to link.
+ public_libs = ['-l%s' % l for l in public_libs]
# Generate the linker script contents and print the script and destination
# information.
- contents = "INPUT(%s -l%s)" % (linked_libcxx, abi_libname)
+ contents = "INPUT(%s %s)" % (linked_libcxx, ' '.join(public_libs))
print("GENERATING SCRIPT: '%s' as file %s" % (contents, symlink_file))
# Remove the existing libc++ symlink and replace it with the script.
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/AUTHORS b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/AUTHORS
new file mode 100644
index 00000000000..c4b059df258
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/AUTHORS
@@ -0,0 +1,38 @@
+# This is the official list of benchmark authors for copyright purposes.
+# This file is distinct from the CONTRIBUTORS files.
+# See the latter for an explanation.
+#
+# Names should be added to this file as:
+# Name or Organization <email address>
+# The email address is not required for organizations.
+#
+# Please keep the list sorted.
+
+Albert Pretorius <pretoalb@gmail.com>
+Arne Beer <arne@twobeer.de>
+Christopher Seymour <chris.j.seymour@hotmail.com>
+David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
+Dominic Hamon <dma@stripysock.com>
+Eric Fiselier <eric@efcs.ca>
+Eugene Zhuk <eugene.zhuk@gmail.com>
+Evgeny Safronov <division494@gmail.com>
+Felix Homann <linuxaudio@showlabor.de>
+Google Inc.
+International Business Machines Corporation
+Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
+Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
+JianXiong Zhou <zhoujianxiong2@gmail.com>
+Jussi Knuuttila <jussi.knuuttila@gmail.com>
+Kaito Udagawa <umireon@gmail.com>
+Lei Xu <eddyxu@gmail.com>
+Matt Clarkson <mattyclarkson@gmail.com>
+Maxim Vafin <maxvafin@gmail.com>
+Nick Hutchinson <nshutchinson@gmail.com>
+Oleksandr Sochka <sasha.sochka@gmail.com>
+Paul Redmond <paul.redmond@gmail.com>
+Radoslav Yovchev <radoslav.tm@gmail.com>
+Shuo Chen <chenshuo@chenshuo.com>
+Yusuke Suzuki <utatane.tea@gmail.com>
+Dirac Research
+Zbigniew Skowron <zbychs@gmail.com>
+Dominik Czarnota <dominik.b.czarnota@gmail.com>
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CMakeLists.txt b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CMakeLists.txt
new file mode 100644
index 00000000000..1ba31331944
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CMakeLists.txt
@@ -0,0 +1,201 @@
+cmake_minimum_required (VERSION 2.8.12)
+project (benchmark)
+
+foreach(p
+ CMP0054 # CMake 3.1
+ CMP0056 # export EXE_LINKER_FLAGS to try_run
+ )
+ if(POLICY ${p})
+ cmake_policy(SET ${p} NEW)
+ endif()
+endforeach()
+
+option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
+option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON)
+option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF)
+option(BENCHMARK_USE_LIBCXX "Build and test using libc++ as the standard library." OFF)
+option(BENCHMARK_BUILD_32_BITS "Build a 32 bit version of the library" OFF)
+
+# Make sure we can import out CMake functions
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+
+# Read the git tags to determine the project version
+include(GetGitVersion)
+get_git_version(GIT_VERSION)
+
+# Tell the user what versions we are using
+string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION ${GIT_VERSION})
+message("-- Version: ${VERSION}")
+
+# The version of the libraries
+set(GENERIC_LIB_VERSION ${VERSION})
+string(SUBSTRING ${VERSION} 0 1 GENERIC_LIB_SOVERSION)
+
+# Import our CMake modules
+include(CheckCXXCompilerFlag)
+include(AddCXXCompilerFlag)
+include(CXXFeatureCheck)
+
+if (BENCHMARK_BUILD_32_BITS)
+ add_required_cxx_compiler_flag(-m32)
+endif()
+
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ # Turn compiler warnings up to 11
+ string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+
+ if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
+ add_cxx_compiler_flag(-EHs-)
+ add_cxx_compiler_flag(-EHa-)
+ endif()
+ # Link time optimisation
+ if (BENCHMARK_ENABLE_LTO)
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
+ set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
+ set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG")
+ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
+
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL")
+ string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO}")
+ set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
+ string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}")
+ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
+ string(REGEX REPLACE "[-/]INCREMENTAL" "/INCREMENTAL:NO" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
+ set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /LTCG")
+
+ set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /GL")
+ set(CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL "${CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL} /LTCG")
+ set(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL} /LTCG")
+ set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /LTCG")
+ endif()
+else()
+ # Try and enable C++11. Don't use C++14 because it doesn't work in some
+ # configurations.
+ add_cxx_compiler_flag(-std=c++11)
+ if (NOT HAVE_CXX_FLAG_STD_CXX11)
+ add_cxx_compiler_flag(-std=c++0x)
+ endif()
+
+ # Turn compiler warnings up to 11
+ add_cxx_compiler_flag(-Wall)
+
+ add_cxx_compiler_flag(-Wextra)
+ add_cxx_compiler_flag(-Wshadow)
+ add_cxx_compiler_flag(-Werror RELEASE)
+ add_cxx_compiler_flag(-Werror RELWITHDEBINFO)
+ add_cxx_compiler_flag(-Werror MINSIZEREL)
+ add_cxx_compiler_flag(-pedantic)
+ add_cxx_compiler_flag(-pedantic-errors)
+ add_cxx_compiler_flag(-Wshorten-64-to-32)
+ add_cxx_compiler_flag(-Wfloat-equal)
+ add_cxx_compiler_flag(-fstrict-aliasing)
+ if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
+ add_cxx_compiler_flag(-fno-exceptions)
+ endif()
+ if (NOT BENCHMARK_USE_LIBCXX)
+ add_cxx_compiler_flag(-Wzero-as-null-pointer-constant)
+ endif()
+ if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
+ if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") #ICC17u2: Many false positives for Wstrict-aliasing
+ add_cxx_compiler_flag(-Wstrict-aliasing)
+ endif()
+ endif()
+ # ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially overridden
+ # (because of deprecated overload)
+ add_cxx_compiler_flag(-wd654)
+ add_cxx_compiler_flag(-Wthread-safety)
+ if (HAVE_CXX_FLAG_WTHREAD_SAFETY)
+ cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
+ endif()
+
+ # On most UNIX like platforms g++ and clang++ define _GNU_SOURCE as a
+ # predefined macro, which turns on all of the wonderful libc extensions.
+ # However g++ doesn't do this in Cygwin so we have to define it ourselfs
+ # since we depend on GNU/POSIX/BSD extensions.
+ if (CYGWIN)
+ add_definitions(-D_GNU_SOURCE=1)
+ endif()
+
+ # Link time optimisation
+ if (BENCHMARK_ENABLE_LTO)
+ add_cxx_compiler_flag(-flto)
+ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ find_program(GCC_AR gcc-ar)
+ if (GCC_AR)
+ set(CMAKE_AR ${GCC_AR})
+ endif()
+ find_program(GCC_RANLIB gcc-ranlib)
+ if (GCC_RANLIB)
+ set(CMAKE_RANLIB ${GCC_RANLIB})
+ endif()
+ endif()
+ endif()
+
+ # Coverage build type
+ set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
+ "Flags used by the C++ compiler during coverage builds."
+ FORCE)
+ set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
+ "Flags used for linking binaries during coverage builds."
+ FORCE)
+ set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+ "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
+ "Flags used by the shared libraries linker during coverage builds."
+ FORCE)
+ mark_as_advanced(
+ CMAKE_CXX_FLAGS_COVERAGE
+ CMAKE_EXE_LINKER_FLAGS_COVERAGE
+ CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
+ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage."
+ FORCE)
+ add_cxx_compiler_flag(--coverage COVERAGE)
+endif()
+
+if (BENCHMARK_USE_LIBCXX)
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ add_cxx_compiler_flag(-stdlib=libc++)
+ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
+ "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
+ add_cxx_compiler_flag(-nostdinc++)
+ message("libc++ header path must be manually specified using CMAKE_CXX_FLAGS")
+ # Adding -nodefaultlibs directly to CMAKE_<TYPE>_LINKER_FLAGS will break
+ # configuration checks such as 'find_package(Threads)'
+ list(APPEND BENCHMARK_CXX_LINKER_FLAGS -nodefaultlibs)
+ # -lc++ cannot be added directly to CMAKE_<TYPE>_LINKER_FLAGS because
+ # linker flags appear before all linker inputs and -lc++ must appear after.
+ list(APPEND BENCHMARK_CXX_LIBRARIES c++)
+ else()
+ message(FATAL "-DBENCHMARK_USE_LIBCXX:BOOL=ON is not supported for compiler")
+ endif()
+endif(BENCHMARK_USE_LIBCXX)
+
+# C++ feature checks
+# Determine the correct regular expression engine to use
+cxx_feature_check(STD_REGEX)
+cxx_feature_check(GNU_POSIX_REGEX)
+cxx_feature_check(POSIX_REGEX)
+if(NOT HAVE_STD_REGEX AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
+ message(FATAL_ERROR "Failed to determine the source files for the regular expression backend")
+endif()
+if (NOT BENCHMARK_ENABLE_EXCEPTIONS AND HAVE_STD_REGEX
+ AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
+ message(WARNING "Using std::regex with exceptions disabled is not fully supported")
+endif()
+cxx_feature_check(STEADY_CLOCK)
+# Ensure we have pthreads
+find_package(Threads REQUIRED)
+
+# Set up directories
+include_directories(${PROJECT_SOURCE_DIR}/include)
+
+# Build the targets
+add_subdirectory(src)
+
+if (BENCHMARK_ENABLE_TESTING)
+ enable_testing()
+ add_subdirectory(test)
+endif()
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CONTRIBUTING.md b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CONTRIBUTING.md
new file mode 100644
index 00000000000..43de4c9d470
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CONTRIBUTING.md
@@ -0,0 +1,58 @@
+# How to contribute #
+
+We'd love to accept your patches and contributions to this project. There are
+a just a few small guidelines you need to follow.
+
+
+## Contributor License Agreement ##
+
+Contributions to any Google project must be accompanied by a Contributor
+License Agreement. This is not a copyright **assignment**, it simply gives
+Google permission to use and redistribute your contributions as part of the
+project.
+
+ * If you are an individual writing original source code and you're sure you
+ own the intellectual property, then you'll need to sign an [individual
+ CLA][].
+
+ * If you work for a company that wants to allow you to contribute your work,
+ then you'll need to sign a [corporate CLA][].
+
+You generally only need to submit a CLA once, so if you've already submitted
+one (even if it was for a different project), you probably don't need to do it
+again.
+
+[individual CLA]: https://developers.google.com/open-source/cla/individual
+[corporate CLA]: https://developers.google.com/open-source/cla/corporate
+
+Once your CLA is submitted (or if you already submitted one for
+another Google project), make a commit adding yourself to the
+[AUTHORS][] and [CONTRIBUTORS][] files. This commit can be part
+of your first [pull request][].
+
+[AUTHORS]: AUTHORS
+[CONTRIBUTORS]: CONTRIBUTORS
+
+
+## Submitting a patch ##
+
+ 1. It's generally best to start by opening a new issue describing the bug or
+ feature you're intending to fix. Even if you think it's relatively minor,
+ it's helpful to know what people are working on. Mention in the initial
+ issue that you are planning to work on that bug or feature so that it can
+ be assigned to you.
+
+ 1. Follow the normal process of [forking][] the project, and setup a new
+ branch to work in. It's important that each group of changes be done in
+ separate branches in order to ensure that a pull request only includes the
+ commits related to that bug or feature.
+
+ 1. Do your best to have [well-formed commit messages][] for each change.
+ This provides consistency throughout the project, and ensures that commit
+ messages are able to be formatted properly by various git tools.
+
+ 1. Finally, push the commits to your fork and submit a [pull request][].
+
+[forking]: https://help.github.com/articles/fork-a-repo
+[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
+[pull request]: https://help.github.com/articles/creating-a-pull-request
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CONTRIBUTORS b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CONTRIBUTORS
new file mode 100644
index 00000000000..8ca4565aa74
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/CONTRIBUTORS
@@ -0,0 +1,56 @@
+# People who have agreed to one of the CLAs and can contribute patches.
+# The AUTHORS file lists the copyright holders; this file
+# lists people. For example, Google employees are listed here
+# but not in AUTHORS, because Google holds the copyright.
+#
+# Names should be added to this file only after verifying that
+# the individual or the individual's organization has agreed to
+# the appropriate Contributor License Agreement, found here:
+#
+# https://developers.google.com/open-source/cla/individual
+# https://developers.google.com/open-source/cla/corporate
+#
+# The agreement for individuals can be filled out on the web.
+#
+# When adding J Random Contributor's name to this file,
+# either J's name or J's organization's name should be
+# added to the AUTHORS file, depending on whether the
+# individual or corporate CLA was used.
+#
+# Names should be added to this file as:
+# Name <email address>
+#
+# Please keep the list sorted.
+
+Albert Pretorius <pretoalb@gmail.com>
+Arne Beer <arne@twobeer.de>
+Billy Robert O'Neal III <billy.oneal@gmail.com> <bion@microsoft.com>
+Chris Kennelly <ckennelly@google.com> <ckennelly@ckennelly.com>
+Christopher Seymour <chris.j.seymour@hotmail.com>
+David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
+Dominic Hamon <dma@stripysock.com>
+Eric Fiselier <eric@efcs.ca>
+Eugene Zhuk <eugene.zhuk@gmail.com>
+Evgeny Safronov <division494@gmail.com>
+Felix Homann <linuxaudio@showlabor.de>
+Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
+Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
+JianXiong Zhou <zhoujianxiong2@gmail.com>
+Jussi Knuuttila <jussi.knuuttila@gmail.com>
+Kaito Udagawa <umireon@gmail.com>
+Kai Wolf <kai.wolf@gmail.com>
+Lei Xu <eddyxu@gmail.com>
+Matt Clarkson <mattyclarkson@gmail.com>
+Maxim Vafin <maxvafin@gmail.com>
+Nick Hutchinson <nshutchinson@gmail.com>
+Oleksandr Sochka <sasha.sochka@gmail.com>
+Pascal Leroy <phl@google.com>
+Paul Redmond <paul.redmond@gmail.com>
+Pierre Phaneuf <pphaneuf@google.com>
+Radoslav Yovchev <radoslav.tm@gmail.com>
+Ray Glover <ray.glover@uk.ibm.com>
+Shuo Chen <chenshuo@chenshuo.com>
+Yusuke Suzuki <utatane.tea@gmail.com>
+Tobias Ulvgård <tobias.ulvgard@dirac.se>
+Zbigniew Skowron <zbychs@gmail.com>
+Dominik Czarnota <dominik.b.czarnota@gmail.com>
diff --git a/chromium/third_party/afl/src/docs/COPYING b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/LICENSE
index d6456956733..d6456956733 100644
--- a/chromium/third_party/afl/src/docs/COPYING
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/LICENSE
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/README.LLVM b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/README.LLVM
new file mode 100644
index 00000000000..e51e2571bf6
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/README.LLVM
@@ -0,0 +1,6 @@
+LLVM notes
+----------
+
+This directory contains the Google Benchmark source code with some unnecessary
+files removed. Note that this directory is under a different license than
+libc++.
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/README.md b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/README.md
new file mode 100644
index 00000000000..f16a9d7906a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/README.md
@@ -0,0 +1,659 @@
+# benchmark
+[![Build Status](https://travis-ci.org/google/benchmark.svg?branch=master)](https://travis-ci.org/google/benchmark)
+[![Build status](https://ci.appveyor.com/api/projects/status/u0qsyp7t1tk7cpxs/branch/master?svg=true)](https://ci.appveyor.com/project/google/benchmark/branch/master)
+[![Coverage Status](https://coveralls.io/repos/google/benchmark/badge.svg)](https://coveralls.io/r/google/benchmark)
+
+A library to support the benchmarking of functions, similar to unit-tests.
+
+Discussion group: https://groups.google.com/d/forum/benchmark-discuss
+
+IRC channel: https://freenode.net #googlebenchmark
+
+[Known issues and common problems](#known-issues)
+
+[Additional Tooling Documentation](docs/tools.md)
+
+## Example usage
+### Basic usage
+Define a function that executes the code to be measured.
+
+```c++
+static void BM_StringCreation(benchmark::State& state) {
+ while (state.KeepRunning())
+ std::string empty_string;
+}
+// Register the function as a benchmark
+BENCHMARK(BM_StringCreation);
+
+// Define another benchmark
+static void BM_StringCopy(benchmark::State& state) {
+ std::string x = "hello";
+ while (state.KeepRunning())
+ std::string copy(x);
+}
+BENCHMARK(BM_StringCopy);
+
+BENCHMARK_MAIN();
+```
+
+### Passing arguments
+Sometimes a family of benchmarks can be implemented with just one routine that
+takes an extra argument to specify which one of the family of benchmarks to
+run. For example, the following code defines a family of benchmarks for
+measuring the speed of `memcpy()` calls of different lengths:
+
+```c++
+static void BM_memcpy(benchmark::State& state) {
+ char* src = new char[state.range(0)];
+ char* dst = new char[state.range(0)];
+ memset(src, 'x', state.range(0));
+ while (state.KeepRunning())
+ memcpy(dst, src, state.range(0));
+ state.SetBytesProcessed(int64_t(state.iterations()) *
+ int64_t(state.range(0)));
+ delete[] src;
+ delete[] dst;
+}
+BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(1<<10)->Arg(8<<10);
+```
+
+The preceding code is quite repetitive, and can be replaced with the following
+short-hand. The following invocation will pick a few appropriate arguments in
+the specified range and will generate a benchmark for each such argument.
+
+```c++
+BENCHMARK(BM_memcpy)->Range(8, 8<<10);
+```
+
+By default the arguments in the range are generated in multiples of eight and
+the command above selects [ 8, 64, 512, 4k, 8k ]. In the following code the
+range multiplier is changed to multiples of two.
+
+```c++
+BENCHMARK(BM_memcpy)->RangeMultiplier(2)->Range(8, 8<<10);
+```
+Now arguments generated are [ 8, 16, 32, 64, 128, 256, 512, 1024, 2k, 4k, 8k ].
+
+You might have a benchmark that depends on two or more inputs. For example, the
+following code defines a family of benchmarks for measuring the speed of set
+insertion.
+
+```c++
+static void BM_SetInsert(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ state.PauseTiming();
+ std::set<int> data = ConstructRandomSet(state.range(0));
+ state.ResumeTiming();
+ for (int j = 0; j < state.range(1); ++j)
+ data.insert(RandomNumber());
+ }
+}
+BENCHMARK(BM_SetInsert)
+ ->Args({1<<10, 1})
+ ->Args({1<<10, 8})
+ ->Args({1<<10, 64})
+ ->Args({1<<10, 512})
+ ->Args({8<<10, 1})
+ ->Args({8<<10, 8})
+ ->Args({8<<10, 64})
+ ->Args({8<<10, 512});
+```
+
+The preceding code is quite repetitive, and can be replaced with the following
+short-hand. The following macro will pick a few appropriate arguments in the
+product of the two specified ranges and will generate a benchmark for each such
+pair.
+
+```c++
+BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {1, 512}});
+```
+
+For more complex patterns of inputs, passing a custom function to `Apply` allows
+programmatic specification of an arbitrary set of arguments on which to run the
+benchmark. The following example enumerates a dense range on one parameter,
+and a sparse range on the second.
+
+```c++
+static void CustomArguments(benchmark::internal::Benchmark* b) {
+ for (int i = 0; i <= 10; ++i)
+ for (int j = 32; j <= 1024*1024; j *= 8)
+ b->Args({i, j});
+}
+BENCHMARK(BM_SetInsert)->Apply(CustomArguments);
+```
+
+### Calculate asymptotic complexity (Big O)
+Asymptotic complexity might be calculated for a family of benchmarks. The
+following code will calculate the coefficient for the high-order term in the
+running time and the normalized root-mean square error of string comparison.
+
+```c++
+static void BM_StringCompare(benchmark::State& state) {
+ std::string s1(state.range(0), '-');
+ std::string s2(state.range(0), '-');
+ while (state.KeepRunning()) {
+ benchmark::DoNotOptimize(s1.compare(s2));
+ }
+ state.SetComplexityN(state.range(0));
+}
+BENCHMARK(BM_StringCompare)
+ ->RangeMultiplier(2)->Range(1<<10, 1<<18)->Complexity(benchmark::oN);
+```
+
+As shown in the following invocation, asymptotic complexity might also be
+calculated automatically.
+
+```c++
+BENCHMARK(BM_StringCompare)
+ ->RangeMultiplier(2)->Range(1<<10, 1<<18)->Complexity();
+```
+
+The following code will specify asymptotic complexity with a lambda function,
+that might be used to customize high-order term calculation.
+
+```c++
+BENCHMARK(BM_StringCompare)->RangeMultiplier(2)
+ ->Range(1<<10, 1<<18)->Complexity([](int n)->double{return n; });
+```
+
+### Templated benchmarks
+Templated benchmarks work the same way: This example produces and consumes
+messages of size `sizeof(v)` `range_x` times. It also outputs throughput in the
+absence of multiprogramming.
+
+```c++
+template <class Q> int BM_Sequential(benchmark::State& state) {
+ Q q;
+ typename Q::value_type v;
+ while (state.KeepRunning()) {
+ for (int i = state.range(0); i--; )
+ q.push(v);
+ for (int e = state.range(0); e--; )
+ q.Wait(&v);
+ }
+ // actually messages, not bytes:
+ state.SetBytesProcessed(
+ static_cast<int64_t>(state.iterations())*state.range(0));
+}
+BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10);
+```
+
+Three macros are provided for adding benchmark templates.
+
+```c++
+#if __cplusplus >= 201103L // C++11 and greater.
+#define BENCHMARK_TEMPLATE(func, ...) // Takes any number of parameters.
+#else // C++ < C++11
+#define BENCHMARK_TEMPLATE(func, arg1)
+#endif
+#define BENCHMARK_TEMPLATE1(func, arg1)
+#define BENCHMARK_TEMPLATE2(func, arg1, arg2)
+```
+
+## Passing arbitrary arguments to a benchmark
+In C++11 it is possible to define a benchmark that takes an arbitrary number
+of extra arguments. The `BENCHMARK_CAPTURE(func, test_case_name, ...args)`
+macro creates a benchmark that invokes `func` with the `benchmark::State` as
+the first argument followed by the specified `args...`.
+The `test_case_name` is appended to the name of the benchmark and
+should describe the values passed.
+
+```c++
+template <class ...ExtraArgs>`
+void BM_takes_args(benchmark::State& state, ExtraArgs&&... extra_args) {
+ [...]
+}
+// Registers a benchmark named "BM_takes_args/int_string_test` that passes
+// the specified values to `extra_args`.
+BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc"));
+```
+Note that elements of `...args` may refer to global variables. Users should
+avoid modifying global state inside of a benchmark.
+
+## Using RegisterBenchmark(name, fn, args...)
+
+The `RegisterBenchmark(name, func, args...)` function provides an alternative
+way to create and register benchmarks.
+`RegisterBenchmark(name, func, args...)` creates, registers, and returns a
+pointer to a new benchmark with the specified `name` that invokes
+`func(st, args...)` where `st` is a `benchmark::State` object.
+
+Unlike the `BENCHMARK` registration macros, which can only be used at the global
+scope, the `RegisterBenchmark` can be called anywhere. This allows for
+benchmark tests to be registered programmatically.
+
+Additionally `RegisterBenchmark` allows any callable object to be registered
+as a benchmark. Including capturing lambdas and function objects. This
+allows the creation
+
+For Example:
+```c++
+auto BM_test = [](benchmark::State& st, auto Inputs) { /* ... */ };
+
+int main(int argc, char** argv) {
+ for (auto& test_input : { /* ... */ })
+ benchmark::RegisterBenchmark(test_input.name(), BM_test, test_input);
+ benchmark::Initialize(&argc, argv);
+ benchmark::RunSpecifiedBenchmarks();
+}
+```
+
+### Multithreaded benchmarks
+In a multithreaded test (benchmark invoked by multiple threads simultaneously),
+it is guaranteed that none of the threads will start until all have called
+`KeepRunning`, and all will have finished before KeepRunning returns false. As
+such, any global setup or teardown can be wrapped in a check against the thread
+index:
+
+```c++
+static void BM_MultiThreaded(benchmark::State& state) {
+ if (state.thread_index == 0) {
+ // Setup code here.
+ }
+ while (state.KeepRunning()) {
+ // Run the test as normal.
+ }
+ if (state.thread_index == 0) {
+ // Teardown code here.
+ }
+}
+BENCHMARK(BM_MultiThreaded)->Threads(2);
+```
+
+If the benchmarked code itself uses threads and you want to compare it to
+single-threaded code, you may want to use real-time ("wallclock") measurements
+for latency comparisons:
+
+```c++
+BENCHMARK(BM_test)->Range(8, 8<<10)->UseRealTime();
+```
+
+Without `UseRealTime`, CPU time is used by default.
+
+
+## Manual timing
+For benchmarking something for which neither CPU time nor real-time are
+correct or accurate enough, completely manual timing is supported using
+the `UseManualTime` function.
+
+When `UseManualTime` is used, the benchmarked code must call
+`SetIterationTime` once per iteration of the `KeepRunning` loop to
+report the manually measured time.
+
+An example use case for this is benchmarking GPU execution (e.g. OpenCL
+or CUDA kernels, OpenGL or Vulkan or Direct3D draw calls), which cannot
+be accurately measured using CPU time or real-time. Instead, they can be
+measured accurately using a dedicated API, and these measurement results
+can be reported back with `SetIterationTime`.
+
+```c++
+static void BM_ManualTiming(benchmark::State& state) {
+ int microseconds = state.range(0);
+ std::chrono::duration<double, std::micro> sleep_duration {
+ static_cast<double>(microseconds)
+ };
+
+ while (state.KeepRunning()) {
+ auto start = std::chrono::high_resolution_clock::now();
+ // Simulate some useful workload with a sleep
+ std::this_thread::sleep_for(sleep_duration);
+ auto end = std::chrono::high_resolution_clock::now();
+
+ auto elapsed_seconds =
+ std::chrono::duration_cast<std::chrono::duration<double>>(
+ end - start);
+
+ state.SetIterationTime(elapsed_seconds.count());
+ }
+}
+BENCHMARK(BM_ManualTiming)->Range(1, 1<<17)->UseManualTime();
+```
+
+### Preventing optimisation
+To prevent a value or expression from being optimized away by the compiler
+the `benchmark::DoNotOptimize(...)` and `benchmark::ClobberMemory()`
+functions can be used.
+
+```c++
+static void BM_test(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ int x = 0;
+ for (int i=0; i < 64; ++i) {
+ benchmark::DoNotOptimize(x += i);
+ }
+ }
+}
+```
+
+`DoNotOptimize(<expr>)` forces the *result* of `<expr>` to be stored in either
+memory or a register. For GNU based compilers it acts as read/write barrier
+for global memory. More specifically it forces the compiler to flush pending
+writes to memory and reload any other values as necessary.
+
+Note that `DoNotOptimize(<expr>)` does not prevent optimizations on `<expr>`
+in any way. `<expr>` may even be removed entirely when the result is already
+known. For example:
+
+```c++
+ /* Example 1: `<expr>` is removed entirely. */
+ int foo(int x) { return x + 42; }
+ while (...) DoNotOptimize(foo(0)); // Optimized to DoNotOptimize(42);
+
+ /* Example 2: Result of '<expr>' is only reused */
+ int bar(int) __attribute__((const));
+ while (...) DoNotOptimize(bar(0)); // Optimized to:
+ // int __result__ = bar(0);
+ // while (...) DoNotOptimize(__result__);
+```
+
+The second tool for preventing optimizations is `ClobberMemory()`. In essence
+`ClobberMemory()` forces the compiler to perform all pending writes to global
+memory. Memory managed by block scope objects must be "escaped" using
+`DoNotOptimize(...)` before it can be clobbered. In the below example
+`ClobberMemory()` prevents the call to `v.push_back(42)` from being optimized
+away.
+
+```c++
+static void BM_vector_push_back(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ std::vector<int> v;
+ v.reserve(1);
+ benchmark::DoNotOptimize(v.data()); // Allow v.data() to be clobbered.
+ v.push_back(42);
+ benchmark::ClobberMemory(); // Force 42 to be written to memory.
+ }
+}
+```
+
+Note that `ClobberMemory()` is only available for GNU or MSVC based compilers.
+
+### Set time unit manually
+If a benchmark runs a few milliseconds it may be hard to visually compare the
+measured times, since the output data is given in nanoseconds per default. In
+order to manually set the time unit, you can specify it manually:
+
+```c++
+BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
+```
+
+## Controlling number of iterations
+In all cases, the number of iterations for which the benchmark is run is
+governed by the amount of time the benchmark takes. Concretely, the number of
+iterations is at least one, not more than 1e9, until CPU time is greater than
+the minimum time, or the wallclock time is 5x minimum time. The minimum time is
+set as a flag `--benchmark_min_time` or per benchmark by calling `MinTime` on
+the registered benchmark object.
+
+## Reporting the mean and standard devation by repeated benchmarks
+By default each benchmark is run once and that single result is reported.
+However benchmarks are often noisy and a single result may not be representative
+of the overall behavior. For this reason it's possible to repeatedly rerun the
+benchmark.
+
+The number of runs of each benchmark is specified globally by the
+`--benchmark_repetitions` flag or on a per benchmark basis by calling
+`Repetitions` on the registered benchmark object. When a benchmark is run
+more than once the mean and standard deviation of the runs will be reported.
+
+Additionally the `--benchmark_report_aggregates_only={true|false}` flag or
+`ReportAggregatesOnly(bool)` function can be used to change how repeated tests
+are reported. By default the result of each repeated run is reported. When this
+option is 'true' only the mean and standard deviation of the runs is reported.
+Calling `ReportAggregatesOnly(bool)` on a registered benchmark object overrides
+the value of the flag for that benchmark.
+
+## Fixtures
+Fixture tests are created by
+first defining a type that derives from ::benchmark::Fixture and then
+creating/registering the tests using the following macros:
+
+* `BENCHMARK_F(ClassName, Method)`
+* `BENCHMARK_DEFINE_F(ClassName, Method)`
+* `BENCHMARK_REGISTER_F(ClassName, Method)`
+
+For Example:
+
+```c++
+class MyFixture : public benchmark::Fixture {};
+
+BENCHMARK_F(MyFixture, FooTest)(benchmark::State& st) {
+ while (st.KeepRunning()) {
+ ...
+ }
+}
+
+BENCHMARK_DEFINE_F(MyFixture, BarTest)(benchmark::State& st) {
+ while (st.KeepRunning()) {
+ ...
+ }
+}
+/* BarTest is NOT registered */
+BENCHMARK_REGISTER_F(MyFixture, BarTest)->Threads(2);
+/* BarTest is now registered */
+```
+
+
+## User-defined counters
+
+You can add your own counters with user-defined names. The example below
+will add columns "Foo", "Bar" and "Baz" in its output:
+
+```c++
+static void UserCountersExample1(benchmark::State& state) {
+ double numFoos = 0, numBars = 0, numBazs = 0;
+ while (state.KeepRunning()) {
+ // ... count Foo,Bar,Baz events
+ }
+ state.counters["Foo"] = numFoos;
+ state.counters["Bar"] = numBars;
+ state.counters["Baz"] = numBazs;
+}
+```
+
+The `state.counters` object is a `std::map` with `std::string` keys
+and `Counter` values. The latter is a `double`-like class, via an implicit
+conversion to `double&`. Thus you can use all of the standard arithmetic
+assignment operators (`=,+=,-=,*=,/=`) to change the value of each counter.
+
+In multithreaded benchmarks, each counter is set on the calling thread only.
+When the benchmark finishes, the counters from each thread will be summed;
+the resulting sum is the value which will be shown for the benchmark.
+
+The `Counter` constructor accepts two parameters: the value as a `double`
+and a bit flag which allows you to show counters as rates and/or as
+per-thread averages:
+
+```c++
+ // sets a simple counter
+ state.counters["Foo"] = numFoos;
+
+ // Set the counter as a rate. It will be presented divided
+ // by the duration of the benchmark.
+ state.counters["FooRate"] = Counter(numFoos, benchmark::Counter::kIsRate);
+
+ // Set the counter as a thread-average quantity. It will
+ // be presented divided by the number of threads.
+ state.counters["FooAvg"] = Counter(numFoos, benchmark::Counter::kAvgThreads);
+
+ // There's also a combined flag:
+ state.counters["FooAvgRate"] = Counter(numFoos,benchmark::Counter::kAvgThreadsRate);
+```
+
+When you're compiling in C++11 mode or later you can use `insert()` with
+`std::initializer_list`:
+
+```c++
+ // With C++11, this can be done:
+ state.counters.insert({{"Foo", numFoos}, {"Bar", numBars}, {"Baz", numBazs}});
+ // ... instead of:
+ state.counters["Foo"] = numFoos;
+ state.counters["Bar"] = numBars;
+ state.counters["Baz"] = numBazs;
+```
+
+## Exiting Benchmarks in Error
+
+When errors caused by external influences, such as file I/O and network
+communication, occur within a benchmark the
+`State::SkipWithError(const char* msg)` function can be used to skip that run
+of benchmark and report the error. Note that only future iterations of the
+`KeepRunning()` are skipped. Users may explicitly return to exit the
+benchmark immediately.
+
+The `SkipWithError(...)` function may be used at any point within the benchmark,
+including before and after the `KeepRunning()` loop.
+
+For example:
+
+```c++
+static void BM_test(benchmark::State& state) {
+ auto resource = GetResource();
+ if (!resource.good()) {
+ state.SkipWithError("Resource is not good!");
+ // KeepRunning() loop will not be entered.
+ }
+ while (state.KeepRunning()) {
+ auto data = resource.read_data();
+ if (!resource.good()) {
+ state.SkipWithError("Failed to read data!");
+ break; // Needed to skip the rest of the iteration.
+ }
+ do_stuff(data);
+ }
+}
+```
+
+## Running a subset of the benchmarks
+
+The `--benchmark_filter=<regex>` option can be used to only run the benchmarks
+which match the specified `<regex>`. For example:
+
+```bash
+$ ./run_benchmarks.x --benchmark_filter=BM_memcpy/32
+Run on (1 X 2300 MHz CPU )
+2016-06-25 19:34:24
+Benchmark Time CPU Iterations
+----------------------------------------------------
+BM_memcpy/32 11 ns 11 ns 79545455
+BM_memcpy/32k 2181 ns 2185 ns 324074
+BM_memcpy/32 12 ns 12 ns 54687500
+BM_memcpy/32k 1834 ns 1837 ns 357143
+```
+
+
+## Output Formats
+The library supports multiple output formats. Use the
+`--benchmark_format=<console|json|csv>` flag to set the format type. `console`
+is the default format.
+
+The Console format is intended to be a human readable format. By default
+the format generates color output. Context is output on stderr and the
+tabular data on stdout. Example tabular output looks like:
+```
+Benchmark Time(ns) CPU(ns) Iterations
+----------------------------------------------------------------------
+BM_SetInsert/1024/1 28928 29349 23853 133.097kB/s 33.2742k items/s
+BM_SetInsert/1024/8 32065 32913 21375 949.487kB/s 237.372k items/s
+BM_SetInsert/1024/10 33157 33648 21431 1.13369MB/s 290.225k items/s
+```
+
+The JSON format outputs human readable json split into two top level attributes.
+The `context` attribute contains information about the run in general, including
+information about the CPU and the date.
+The `benchmarks` attribute contains a list of ever benchmark run. Example json
+output looks like:
+```json
+{
+ "context": {
+ "date": "2015/03/17-18:40:25",
+ "num_cpus": 40,
+ "mhz_per_cpu": 2801,
+ "cpu_scaling_enabled": false,
+ "build_type": "debug"
+ },
+ "benchmarks": [
+ {
+ "name": "BM_SetInsert/1024/1",
+ "iterations": 94877,
+ "real_time": 29275,
+ "cpu_time": 29836,
+ "bytes_per_second": 134066,
+ "items_per_second": 33516
+ },
+ {
+ "name": "BM_SetInsert/1024/8",
+ "iterations": 21609,
+ "real_time": 32317,
+ "cpu_time": 32429,
+ "bytes_per_second": 986770,
+ "items_per_second": 246693
+ },
+ {
+ "name": "BM_SetInsert/1024/10",
+ "iterations": 21393,
+ "real_time": 32724,
+ "cpu_time": 33355,
+ "bytes_per_second": 1199226,
+ "items_per_second": 299807
+ }
+ ]
+}
+```
+
+The CSV format outputs comma-separated values. The `context` is output on stderr
+and the CSV itself on stdout. Example CSV output looks like:
+```
+name,iterations,real_time,cpu_time,bytes_per_second,items_per_second,label
+"BM_SetInsert/1024/1",65465,17890.7,8407.45,475768,118942,
+"BM_SetInsert/1024/8",116606,18810.1,9766.64,3.27646e+06,819115,
+"BM_SetInsert/1024/10",106365,17238.4,8421.53,4.74973e+06,1.18743e+06,
+```
+
+## Output Files
+The library supports writing the output of the benchmark to a file specified
+by `--benchmark_out=<filename>`. The format of the output can be specified
+using `--benchmark_out_format={json|console|csv}`. Specifying
+`--benchmark_out` does not suppress the console output.
+
+## Debug vs Release
+By default, benchmark builds as a debug library. You will see a warning in the output when this is the case. To build it as a release library instead, use:
+
+```
+cmake -DCMAKE_BUILD_TYPE=Release
+```
+
+To enable link-time optimisation, use
+
+```
+cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_LTO=true
+```
+
+## Linking against the library
+When using gcc, it is necessary to link against pthread to avoid runtime exceptions.
+This is due to how gcc implements std::thread.
+See [issue #67](https://github.com/google/benchmark/issues/67) for more details.
+
+## Compiler Support
+
+Google Benchmark uses C++11 when building the library. As such we require
+a modern C++ toolchain, both compiler and standard library.
+
+The following minimum versions are strongly recommended build the library:
+
+* GCC 4.8
+* Clang 3.4
+* Visual Studio 2013
+* Intel 2015 Update 1
+
+Anything older *may* work.
+
+Note: Using the library and its headers in C++03 is supported. C++11 is only
+required to build the library.
+
+# Known Issues
+
+### Windows
+
+* Users must manually link `shlwapi.lib`. Failure to do so may result
+in unresolved symbols.
+
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake
new file mode 100644
index 00000000000..0b176ba27f1
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake
@@ -0,0 +1,64 @@
+# - Adds a compiler flag if it is supported by the compiler
+#
+# This function checks that the supplied compiler flag is supported and then
+# adds it to the corresponding compiler flags
+#
+# add_cxx_compiler_flag(<FLAG> [<VARIANT>])
+#
+# - Example
+#
+# include(AddCXXCompilerFlag)
+# add_cxx_compiler_flag(-Wall)
+# add_cxx_compiler_flag(-no-strict-aliasing RELEASE)
+# Requires CMake 2.6+
+
+if(__add_cxx_compiler_flag)
+ return()
+endif()
+set(__add_cxx_compiler_flag INCLUDED)
+
+include(CheckCXXCompilerFlag)
+
+function(mangle_compiler_flag FLAG OUTPUT)
+ string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
+ string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
+ string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
+ string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
+ set(${OUTPUT} "${SANITIZED_FLAG}" PARENT_SCOPE)
+endfunction(mangle_compiler_flag)
+
+function(add_cxx_compiler_flag FLAG)
+ mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
+ set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
+ check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
+ set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
+ if(${MANGLED_FLAG})
+ set(VARIANT ${ARGV1})
+ if(ARGV1)
+ string(TOUPPER "_${VARIANT}" VARIANT)
+ endif()
+ set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(add_required_cxx_compiler_flag FLAG)
+ mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
+ set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
+ check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
+ set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
+ if(${MANGLED_FLAG})
+ set(VARIANT ${ARGV1})
+ if(ARGV1)
+ string(TOUPPER "_${VARIANT}" VARIANT)
+ endif()
+ set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}" PARENT_SCOPE)
+ else()
+ message(FATAL_ERROR "Required flag '${FLAG}' is not supported by the compiler")
+ endif()
+endfunction()
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/CXXFeatureCheck.cmake b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/CXXFeatureCheck.cmake
new file mode 100644
index 00000000000..6efe6a84ee4
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/CXXFeatureCheck.cmake
@@ -0,0 +1,44 @@
+# - Compile and run code to check for C++ features
+#
+# This functions compiles a source file under the `cmake` folder
+# and adds the corresponding `HAVE_[FILENAME]` flag to the CMake
+# environment
+#
+# cxx_feature_check(<FLAG> [<VARIANT>])
+#
+# - Example
+#
+# include(CXXFeatureCheck)
+# cxx_feature_check(STD_REGEX)
+# Requires CMake 2.8.12+
+
+if(__cxx_feature_check)
+ return()
+endif()
+set(__cxx_feature_check INCLUDED)
+
+function(cxx_feature_check FILE)
+ string(TOLOWER ${FILE} FILE)
+ string(TOUPPER ${FILE} VAR)
+ string(TOUPPER "HAVE_${VAR}" FEATURE)
+ if (DEFINED HAVE_${VAR})
+ return()
+ endif()
+ message("-- Performing Test ${FEATURE}")
+ try_run(RUN_${FEATURE} COMPILE_${FEATURE}
+ ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp
+ CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS}
+ LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES})
+ if(RUN_${FEATURE} EQUAL 0)
+ message("-- Performing Test ${FEATURE} -- success")
+ set(HAVE_${VAR} 1 CACHE INTERNAL "Feature test for ${FILE}" PARENT_SCOPE)
+ add_definitions(-DHAVE_${VAR})
+ else()
+ if(NOT COMPILE_${FEATURE})
+ message("-- Performing Test ${FEATURE} -- failed to compile")
+ else()
+ message("-- Performing Test ${FEATURE} -- compiled but failed to run")
+ endif()
+ endif()
+endfunction()
+
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/Config.cmake.in b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/Config.cmake.in
new file mode 100644
index 00000000000..6e9256eea8a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/Config.cmake.in
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/GetGitVersion.cmake b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/GetGitVersion.cmake
new file mode 100644
index 00000000000..8dd94800459
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/GetGitVersion.cmake
@@ -0,0 +1,51 @@
+# - Returns a version string from Git tags
+#
+# This function inspects the annotated git tags for the project and returns a string
+# into a CMake variable
+#
+# get_git_version(<var>)
+#
+# - Example
+#
+# include(GetGitVersion)
+# get_git_version(GIT_VERSION)
+#
+# Requires CMake 2.8.11+
+find_package(Git)
+
+if(__get_git_version)
+ return()
+endif()
+set(__get_git_version INCLUDED)
+
+function(get_git_version var)
+ if(GIT_EXECUTABLE)
+ execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8
+ RESULT_VARIABLE status
+ OUTPUT_VARIABLE GIT_VERSION
+ ERROR_QUIET)
+ if(${status})
+ set(GIT_VERSION "v0.0.0")
+ else()
+ string(STRIP ${GIT_VERSION} GIT_VERSION)
+ string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION})
+ endif()
+
+ # Work out if the repository is dirty
+ execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh
+ OUTPUT_QUIET
+ ERROR_QUIET)
+ execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD --
+ OUTPUT_VARIABLE GIT_DIFF_INDEX
+ ERROR_QUIET)
+ string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY)
+ if (${GIT_DIRTY})
+ set(GIT_VERSION "${GIT_VERSION}-dirty")
+ endif()
+ else()
+ set(GIT_VERSION "v0.0.0")
+ endif()
+
+ message("-- git Version: ${GIT_VERSION}")
+ set(${var} ${GIT_VERSION} PARENT_SCOPE)
+endfunction()
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/gnu_posix_regex.cpp b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/gnu_posix_regex.cpp
new file mode 100644
index 00000000000..b5b91cdab7c
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/gnu_posix_regex.cpp
@@ -0,0 +1,12 @@
+#include <gnuregex.h>
+#include <string>
+int main() {
+ std::string str = "test0159";
+ regex_t re;
+ int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
+ if (ec != 0) {
+ return ec;
+ }
+ return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
+}
+
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/posix_regex.cpp b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/posix_regex.cpp
new file mode 100644
index 00000000000..466dc62560a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/posix_regex.cpp
@@ -0,0 +1,14 @@
+#include <regex.h>
+#include <string>
+int main() {
+ std::string str = "test0159";
+ regex_t re;
+ int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB);
+ if (ec != 0) {
+ return ec;
+ }
+ int ret = regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0;
+ regfree(&re);
+ return ret;
+}
+
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/std_regex.cpp b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/std_regex.cpp
new file mode 100644
index 00000000000..696f2a26bce
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/std_regex.cpp
@@ -0,0 +1,10 @@
+#include <regex>
+#include <string>
+int main() {
+ const std::string str = "test0159";
+ std::regex re;
+ re = std::regex("^[a-z]+[0-9]+$",
+ std::regex_constants::extended | std::regex_constants::nosubs);
+ return std::regex_search(str, re) ? 0 : -1;
+}
+
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/steady_clock.cpp b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/steady_clock.cpp
new file mode 100644
index 00000000000..66d50d17e9e
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/steady_clock.cpp
@@ -0,0 +1,7 @@
+#include <chrono>
+
+int main() {
+ typedef std::chrono::steady_clock Clock;
+ Clock::time_point tp = Clock::now();
+ ((void)tp);
+}
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/thread_safety_attributes.cpp b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/thread_safety_attributes.cpp
new file mode 100644
index 00000000000..46161babdb1
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/cmake/thread_safety_attributes.cpp
@@ -0,0 +1,4 @@
+#define HAVE_THREAD_SAFETY_ATTRIBUTES
+#include "../src/mutex.h"
+
+int main() {}
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/docs/tools.md b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/docs/tools.md
new file mode 100644
index 00000000000..f176f74a48f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/docs/tools.md
@@ -0,0 +1,59 @@
+# Benchmark Tools
+
+## compare_bench.py
+
+The `compare_bench.py` utility which can be used to compare the result of benchmarks.
+The program is invoked like:
+
+``` bash
+$ compare_bench.py <old-benchmark> <new-benchmark> [benchmark options]...
+```
+
+Where `<old-benchmark>` and `<new-benchmark>` either specify a benchmark executable file, or a JSON output file. The type of the input file is automatically detected. If a benchmark executable is specified then the benchmark is run to obtain the results. Otherwise the results are simply loaded from the output file.
+
+The sample output using the JSON test files under `Inputs/` gives:
+
+``` bash
+$ ./compare_bench.py ./gbench/Inputs/test1_run1.json ./gbench/Inputs/test1_run2.json
+Comparing ./gbench/Inputs/test1_run1.json to ./gbench/Inputs/test1_run2.json
+Benchmark Time CPU
+----------------------------------------------
+BM_SameTimes +0.00 +0.00
+BM_2xFaster -0.50 -0.50
+BM_2xSlower +1.00 +1.00
+BM_10PercentFaster -0.10 -0.10
+BM_10PercentSlower +0.10 +0.10
+```
+
+When a benchmark executable is run, the raw output from the benchmark is printed in real time to stdout. The sample output using `benchmark/basic_test` for both arguments looks like:
+
+```
+./compare_bench.py test/basic_test test/basic_test --benchmark_filter=BM_empty.*
+RUNNING: test/basic_test --benchmark_filter=BM_empty.*
+Run on (4 X 4228.32 MHz CPU s)
+2016-08-02 19:21:33
+Benchmark Time CPU Iterations
+--------------------------------------------------------------------
+BM_empty 9 ns 9 ns 79545455
+BM_empty/threads:4 4 ns 9 ns 75268816
+BM_empty_stop_start 8 ns 8 ns 83333333
+BM_empty_stop_start/threads:4 3 ns 8 ns 83333332
+RUNNING: test/basic_test --benchmark_filter=BM_empty.*
+Run on (4 X 4228.32 MHz CPU s)
+2016-08-02 19:21:35
+Benchmark Time CPU Iterations
+--------------------------------------------------------------------
+BM_empty 9 ns 9 ns 76086957
+BM_empty/threads:4 4 ns 9 ns 76086956
+BM_empty_stop_start 8 ns 8 ns 87500000
+BM_empty_stop_start/threads:4 3 ns 8 ns 88607596
+Comparing test/basic_test to test/basic_test
+Benchmark Time CPU
+---------------------------------------------------------
+BM_empty +0.00 +0.00
+BM_empty/threads:4 +0.00 +0.00
+BM_empty_stop_start +0.00 +0.00
+BM_empty_stop_start/threads:4 +0.00 +0.00
+```
+
+Obviously this example doesn't give any useful output, but it's intended to show the output format when 'compare_bench.py' needs to run benchmarks.
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/benchmark.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/benchmark.h
new file mode 100644
index 00000000000..b3b0a8e947f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/benchmark.h
@@ -0,0 +1,21 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef BENCHMARK_BENCHMARK_H_
+#define BENCHMARK_BENCHMARK_H_
+
+#include "benchmark_api.h"
+#include "macros.h"
+#include "reporter.h"
+
+#endif // BENCHMARK_BENCHMARK_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/benchmark_api.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/benchmark_api.h
new file mode 100644
index 00000000000..1e853e2cd4e
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/benchmark_api.h
@@ -0,0 +1,915 @@
+// Support for registering benchmarks for functions.
+
+/* Example usage:
+// Define a function that executes the code to be measured a
+// specified number of times:
+static void BM_StringCreation(benchmark::State& state) {
+ while (state.KeepRunning())
+ std::string empty_string;
+}
+
+// Register the function as a benchmark
+BENCHMARK(BM_StringCreation);
+
+// Define another benchmark
+static void BM_StringCopy(benchmark::State& state) {
+ std::string x = "hello";
+ while (state.KeepRunning())
+ std::string copy(x);
+}
+BENCHMARK(BM_StringCopy);
+
+// Augment the main() program to invoke benchmarks if specified
+// via the --benchmarks command line flag. E.g.,
+// my_unittest --benchmark_filter=all
+// my_unittest --benchmark_filter=BM_StringCreation
+// my_unittest --benchmark_filter=String
+// my_unittest --benchmark_filter='Copy|Creation'
+int main(int argc, char** argv) {
+ benchmark::Initialize(&argc, argv);
+ benchmark::RunSpecifiedBenchmarks();
+ return 0;
+}
+
+// Sometimes a family of microbenchmarks can be implemented with
+// just one routine that takes an extra argument to specify which
+// one of the family of benchmarks to run. For example, the following
+// code defines a family of microbenchmarks for measuring the speed
+// of memcpy() calls of different lengths:
+
+static void BM_memcpy(benchmark::State& state) {
+ char* src = new char[state.range(0)]; char* dst = new char[state.range(0)];
+ memset(src, 'x', state.range(0));
+ while (state.KeepRunning())
+ memcpy(dst, src, state.range(0));
+ state.SetBytesProcessed(int64_t(state.iterations()) *
+ int64_t(state.range(0)));
+ delete[] src; delete[] dst;
+}
+BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(1<<10)->Arg(8<<10);
+
+// The preceding code is quite repetitive, and can be replaced with the
+// following short-hand. The following invocation will pick a few
+// appropriate arguments in the specified range and will generate a
+// microbenchmark for each such argument.
+BENCHMARK(BM_memcpy)->Range(8, 8<<10);
+
+// You might have a microbenchmark that depends on two inputs. For
+// example, the following code defines a family of microbenchmarks for
+// measuring the speed of set insertion.
+static void BM_SetInsert(benchmark::State& state) {
+ while (state.KeepRunning()) {
+ state.PauseTiming();
+ set<int> data = ConstructRandomSet(state.range(0));
+ state.ResumeTiming();
+ for (int j = 0; j < state.range(1); ++j)
+ data.insert(RandomNumber());
+ }
+}
+BENCHMARK(BM_SetInsert)
+ ->Args({1<<10, 1})
+ ->Args({1<<10, 8})
+ ->Args({1<<10, 64})
+ ->Args({1<<10, 512})
+ ->Args({8<<10, 1})
+ ->Args({8<<10, 8})
+ ->Args({8<<10, 64})
+ ->Args({8<<10, 512});
+
+// The preceding code is quite repetitive, and can be replaced with
+// the following short-hand. The following macro will pick a few
+// appropriate arguments in the product of the two specified ranges
+// and will generate a microbenchmark for each such pair.
+BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {1, 512}});
+
+// For more complex patterns of inputs, passing a custom function
+// to Apply allows programmatic specification of an
+// arbitrary set of arguments to run the microbenchmark on.
+// The following example enumerates a dense range on
+// one parameter, and a sparse range on the second.
+static void CustomArguments(benchmark::internal::Benchmark* b) {
+ for (int i = 0; i <= 10; ++i)
+ for (int j = 32; j <= 1024*1024; j *= 8)
+ b->Args({i, j});
+}
+BENCHMARK(BM_SetInsert)->Apply(CustomArguments);
+
+// Templated microbenchmarks work the same way:
+// Produce then consume 'size' messages 'iters' times
+// Measures throughput in the absence of multiprogramming.
+template <class Q> int BM_Sequential(benchmark::State& state) {
+ Q q;
+ typename Q::value_type v;
+ while (state.KeepRunning()) {
+ for (int i = state.range(0); i--; )
+ q.push(v);
+ for (int e = state.range(0); e--; )
+ q.Wait(&v);
+ }
+ // actually messages, not bytes:
+ state.SetBytesProcessed(
+ static_cast<int64_t>(state.iterations())*state.range(0));
+}
+BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10);
+
+Use `Benchmark::MinTime(double t)` to set the minimum time used to run the
+benchmark. This option overrides the `benchmark_min_time` flag.
+
+void BM_test(benchmark::State& state) {
+ ... body ...
+}
+BENCHMARK(BM_test)->MinTime(2.0); // Run for at least 2 seconds.
+
+In a multithreaded test, it is guaranteed that none of the threads will start
+until all have called KeepRunning, and all will have finished before KeepRunning
+returns false. As such, any global setup or teardown you want to do can be
+wrapped in a check against the thread index:
+
+static void BM_MultiThreaded(benchmark::State& state) {
+ if (state.thread_index == 0) {
+ // Setup code here.
+ }
+ while (state.KeepRunning()) {
+ // Run the test as normal.
+ }
+ if (state.thread_index == 0) {
+ // Teardown code here.
+ }
+}
+BENCHMARK(BM_MultiThreaded)->Threads(4);
+
+
+If a benchmark runs a few milliseconds it may be hard to visually compare the
+measured times, since the output data is given in nanoseconds per default. In
+order to manually set the time unit, you can specify it manually:
+
+BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
+*/
+
+#ifndef BENCHMARK_BENCHMARK_API_H_
+#define BENCHMARK_BENCHMARK_API_H_
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <string>
+#include <vector>
+#include <map>
+
+#include "macros.h"
+
+#if defined(BENCHMARK_HAS_CXX11)
+#include <type_traits>
+#include <initializer_list>
+#include <utility>
+#endif
+
+#if defined(_MSC_VER)
+#include <intrin.h> // for _ReadWriteBarrier
+#endif
+
+namespace benchmark {
+class BenchmarkReporter;
+
+void Initialize(int* argc, char** argv);
+
+// Report to stdout all arguments in 'argv' as unrecognized except the first.
+// Returns true there is at least on unrecognized argument (i.e. 'argc' > 1).
+bool ReportUnrecognizedArguments(int argc, char** argv);
+
+// Generate a list of benchmarks matching the specified --benchmark_filter flag
+// and if --benchmark_list_tests is specified return after printing the name
+// of each matching benchmark. Otherwise run each matching benchmark and
+// report the results.
+//
+// The second and third overload use the specified 'console_reporter' and
+// 'file_reporter' respectively. 'file_reporter' will write to the file
+// specified
+// by '--benchmark_output'. If '--benchmark_output' is not given the
+// 'file_reporter' is ignored.
+//
+// RETURNS: The number of matching benchmarks.
+size_t RunSpecifiedBenchmarks();
+size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter);
+size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter,
+ BenchmarkReporter* file_reporter);
+
+// If this routine is called, peak memory allocation past this point in the
+// benchmark is reported at the end of the benchmark report line. (It is
+// computed by running the benchmark once with a single iteration and a memory
+// tracer.)
+// TODO(dominic)
+// void MemoryUsage();
+
+namespace internal {
+class Benchmark;
+class BenchmarkImp;
+class BenchmarkFamilies;
+
+void UseCharPointer(char const volatile*);
+
+// Take ownership of the pointer and register the benchmark. Return the
+// registered benchmark.
+Benchmark* RegisterBenchmarkInternal(Benchmark*);
+
+// Ensure that the standard streams are properly initialized in every TU.
+int InitializeStreams();
+BENCHMARK_UNUSED static int stream_init_anchor = InitializeStreams();
+
+} // end namespace internal
+
+
+#if !defined(__GNUC__) || defined(__pnacl__) || defined(EMSCRIPTN)
+# define BENCHMARK_HAS_NO_INLINE_ASSEMBLY
+#endif
+
+// The DoNotOptimize(...) function can be used to prevent a value or
+// expression from being optimized away by the compiler. This function is
+// intended to add little to no overhead.
+// See: https://youtu.be/nXaxk27zwlk?t=2441
+#ifndef BENCHMARK_HAS_NO_INLINE_ASSEMBLY
+template <class Tp>
+inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
+ asm volatile("" : : "g"(value) : "memory");
+}
+// Force the compiler to flush pending writes to global memory. Acts as an
+// effective read/write barrier
+inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() {
+ asm volatile("" : : : "memory");
+}
+#elif defined(_MSC_VER)
+template <class Tp>
+inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
+ internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value));
+ _ReadWriteBarrier();
+}
+
+inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() {
+ _ReadWriteBarrier();
+}
+#else
+template <class Tp>
+inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
+ internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value));
+}
+// FIXME Add ClobberMemory() for non-gnu and non-msvc compilers
+#endif
+
+
+
+// This class is used for user-defined counters.
+class Counter {
+public:
+
+ enum Flags {
+ kDefaults = 0,
+ // Mark the counter as a rate. It will be presented divided
+ // by the duration of the benchmark.
+ kIsRate = 1,
+ // Mark the counter as a thread-average quantity. It will be
+ // presented divided by the number of threads.
+ kAvgThreads = 2,
+ // Mark the counter as a thread-average rate. See above.
+ kAvgThreadsRate = kIsRate|kAvgThreads
+ };
+
+ double value;
+ Flags flags;
+
+ BENCHMARK_ALWAYS_INLINE
+ Counter(double v = 0., Flags f = kDefaults) : value(v), flags(f) {}
+
+ BENCHMARK_ALWAYS_INLINE operator double const& () const { return value; }
+ BENCHMARK_ALWAYS_INLINE operator double & () { return value; }
+
+};
+
+// This is the container for the user-defined counters.
+typedef std::map<std::string, Counter> UserCounters;
+
+
+// TimeUnit is passed to a benchmark in order to specify the order of magnitude
+// for the measured time.
+enum TimeUnit { kNanosecond, kMicrosecond, kMillisecond };
+
+// BigO is passed to a benchmark in order to specify the asymptotic
+// computational
+// complexity for the benchmark. In case oAuto is selected, complexity will be
+// calculated automatically to the best fit.
+enum BigO { oNone, o1, oN, oNSquared, oNCubed, oLogN, oNLogN, oAuto, oLambda };
+
+// BigOFunc is passed to a benchmark in order to specify the asymptotic
+// computational complexity for the benchmark.
+typedef double(BigOFunc)(int);
+
+namespace internal {
+class ThreadTimer;
+class ThreadManager;
+
+#if defined(BENCHMARK_HAS_CXX11)
+enum ReportMode : unsigned {
+#else
+enum ReportMode {
+#endif
+ RM_Unspecified, // The mode has not been manually specified
+ RM_Default, // The mode is user-specified as default.
+ RM_ReportAggregatesOnly
+};
+}
+
+// State is passed to a running Benchmark and contains state for the
+// benchmark to use.
+class State {
+ public:
+ // Returns true if the benchmark should continue through another iteration.
+ // NOTE: A benchmark may not return from the test until KeepRunning() has
+ // returned false.
+ bool KeepRunning() {
+ if (BENCHMARK_BUILTIN_EXPECT(!started_, false)) {
+ StartKeepRunning();
+ }
+ bool const res = total_iterations_++ < max_iterations;
+ if (BENCHMARK_BUILTIN_EXPECT(!res, false)) {
+ FinishKeepRunning();
+ }
+ return res;
+ }
+
+ // REQUIRES: timer is running and 'SkipWithError(...)' has not been called
+ // by the current thread.
+ // Stop the benchmark timer. If not called, the timer will be
+ // automatically stopped after KeepRunning() returns false for the first time.
+ //
+ // For threaded benchmarks the PauseTiming() function only pauses the timing
+ // for the current thread.
+ //
+ // NOTE: The "real time" measurement is per-thread. If different threads
+ // report different measurements the largest one is reported.
+ //
+ // NOTE: PauseTiming()/ResumeTiming() are relatively
+ // heavyweight, and so their use should generally be avoided
+ // within each benchmark iteration, if possible.
+ void PauseTiming();
+
+ // REQUIRES: timer is not running and 'SkipWithError(...)' has not been called
+ // by the current thread.
+ // Start the benchmark timer. The timer is NOT running on entrance to the
+ // benchmark function. It begins running after the first call to KeepRunning()
+ //
+ // NOTE: PauseTiming()/ResumeTiming() are relatively
+ // heavyweight, and so their use should generally be avoided
+ // within each benchmark iteration, if possible.
+ void ResumeTiming();
+
+ // REQUIRES: 'SkipWithError(...)' has not been called previously by the
+ // current thread.
+ // Skip any future iterations of the 'KeepRunning()' loop in the current
+ // thread and report an error with the specified 'msg'. After this call
+ // the user may explicitly 'return' from the benchmark.
+ //
+ // For threaded benchmarks only the current thread stops executing and future
+ // calls to `KeepRunning()` will block until all threads have completed
+ // the `KeepRunning()` loop. If multiple threads report an error only the
+ // first error message is used.
+ //
+ // NOTE: Calling 'SkipWithError(...)' does not cause the benchmark to exit
+ // the current scope immediately. If the function is called from within
+ // the 'KeepRunning()' loop the current iteration will finish. It is the users
+ // responsibility to exit the scope as needed.
+ void SkipWithError(const char* msg);
+
+ // REQUIRES: called exactly once per iteration of the KeepRunning loop.
+ // Set the manually measured time for this benchmark iteration, which
+ // is used instead of automatically measured time if UseManualTime() was
+ // specified.
+ //
+ // For threaded benchmarks the final value will be set to the largest
+ // reported values.
+ void SetIterationTime(double seconds);
+
+ // Set the number of bytes processed by the current benchmark
+ // execution. This routine is typically called once at the end of a
+ // throughput oriented benchmark. If this routine is called with a
+ // value > 0, the report is printed in MB/sec instead of nanoseconds
+ // per iteration.
+ //
+ // REQUIRES: a benchmark has exited its KeepRunning loop.
+ BENCHMARK_ALWAYS_INLINE
+ void SetBytesProcessed(size_t bytes) { bytes_processed_ = bytes; }
+
+ BENCHMARK_ALWAYS_INLINE
+ size_t bytes_processed() const { return bytes_processed_; }
+
+ // If this routine is called with complexity_n > 0 and complexity report is
+ // requested for the
+ // family benchmark, then current benchmark will be part of the computation
+ // and complexity_n will
+ // represent the length of N.
+ BENCHMARK_ALWAYS_INLINE
+ void SetComplexityN(int complexity_n) { complexity_n_ = complexity_n; }
+
+ BENCHMARK_ALWAYS_INLINE
+ int complexity_length_n() { return complexity_n_; }
+
+ // If this routine is called with items > 0, then an items/s
+ // label is printed on the benchmark report line for the currently
+ // executing benchmark. It is typically called at the end of a processing
+ // benchmark where a processing items/second output is desired.
+ //
+ // REQUIRES: a benchmark has exited its KeepRunning loop.
+ BENCHMARK_ALWAYS_INLINE
+ void SetItemsProcessed(size_t items) { items_processed_ = items; }
+
+ BENCHMARK_ALWAYS_INLINE
+ size_t items_processed() const { return items_processed_; }
+
+ // If this routine is called, the specified label is printed at the
+ // end of the benchmark report line for the currently executing
+ // benchmark. Example:
+ // static void BM_Compress(benchmark::State& state) {
+ // ...
+ // double compress = input_size / output_size;
+ // state.SetLabel(StringPrintf("compress:%.1f%%", 100.0*compression));
+ // }
+ // Produces output that looks like:
+ // BM_Compress 50 50 14115038 compress:27.3%
+ //
+ // REQUIRES: a benchmark has exited its KeepRunning loop.
+ void SetLabel(const char* label);
+
+ void BENCHMARK_ALWAYS_INLINE SetLabel(const std::string& str) {
+ this->SetLabel(str.c_str());
+ }
+
+ // Range arguments for this run. CHECKs if the argument has been set.
+ BENCHMARK_ALWAYS_INLINE
+ int range(std::size_t pos = 0) const {
+ assert(range_.size() > pos);
+ return range_[pos];
+ }
+
+ BENCHMARK_DEPRECATED_MSG("use 'range(0)' instead")
+ int range_x() const { return range(0); }
+
+ BENCHMARK_DEPRECATED_MSG("use 'range(1)' instead")
+ int range_y() const { return range(1); }
+
+ BENCHMARK_ALWAYS_INLINE
+ size_t iterations() const { return total_iterations_; }
+
+ private:
+ bool started_;
+ bool finished_;
+ size_t total_iterations_;
+
+ std::vector<int> range_;
+
+ size_t bytes_processed_;
+ size_t items_processed_;
+
+ int complexity_n_;
+
+ bool error_occurred_;
+
+ public:
+ // Container for user-defined counters.
+ UserCounters counters;
+ // Index of the executing thread. Values from [0, threads).
+ const int thread_index;
+ // Number of threads concurrently executing the benchmark.
+ const int threads;
+ const size_t max_iterations;
+
+ // TODO make me private
+ State(size_t max_iters, const std::vector<int>& ranges, int thread_i,
+ int n_threads, internal::ThreadTimer* timer,
+ internal::ThreadManager* manager);
+
+ private:
+ void StartKeepRunning();
+ void FinishKeepRunning();
+ internal::ThreadTimer* timer_;
+ internal::ThreadManager* manager_;
+ BENCHMARK_DISALLOW_COPY_AND_ASSIGN(State);
+};
+
+namespace internal {
+
+typedef void(Function)(State&);
+
+// ------------------------------------------------------
+// Benchmark registration object. The BENCHMARK() macro expands
+// into an internal::Benchmark* object. Various methods can
+// be called on this object to change the properties of the benchmark.
+// Each method returns "this" so that multiple method calls can
+// chained into one expression.
+class Benchmark {
+ public:
+ virtual ~Benchmark();
+
+ // Note: the following methods all return "this" so that multiple
+ // method calls can be chained together in one expression.
+
+ // Run this benchmark once with "x" as the extra argument passed
+ // to the function.
+ // REQUIRES: The function passed to the constructor must accept an arg1.
+ Benchmark* Arg(int x);
+
+ // Run this benchmark with the given time unit for the generated output report
+ Benchmark* Unit(TimeUnit unit);
+
+ // Run this benchmark once for a number of values picked from the
+ // range [start..limit]. (start and limit are always picked.)
+ // REQUIRES: The function passed to the constructor must accept an arg1.
+ Benchmark* Range(int start, int limit);
+
+ // Run this benchmark once for all values in the range [start..limit] with
+ // specific step
+ // REQUIRES: The function passed to the constructor must accept an arg1.
+ Benchmark* DenseRange(int start, int limit, int step = 1);
+
+ // Run this benchmark once with "args" as the extra arguments passed
+ // to the function.
+ // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
+ Benchmark* Args(const std::vector<int>& args);
+
+ // Equivalent to Args({x, y})
+ // NOTE: This is a legacy C++03 interface provided for compatibility only.
+ // New code should use 'Args'.
+ Benchmark* ArgPair(int x, int y) {
+ std::vector<int> args;
+ args.push_back(x);
+ args.push_back(y);
+ return Args(args);
+ }
+
+ // Run this benchmark once for a number of values picked from the
+ // ranges [start..limit]. (starts and limits are always picked.)
+ // REQUIRES: The function passed to the constructor must accept arg1, arg2 ...
+ Benchmark* Ranges(const std::vector<std::pair<int, int> >& ranges);
+
+ // Equivalent to ArgNames({name})
+ Benchmark* ArgName(const std::string& name);
+
+ // Set the argument names to display in the benchmark name. If not called,
+ // only argument values will be shown.
+ Benchmark* ArgNames(const std::vector<std::string>& names);
+
+ // Equivalent to Ranges({{lo1, hi1}, {lo2, hi2}}).
+ // NOTE: This is a legacy C++03 interface provided for compatibility only.
+ // New code should use 'Ranges'.
+ Benchmark* RangePair(int lo1, int hi1, int lo2, int hi2) {
+ std::vector<std::pair<int, int> > ranges;
+ ranges.push_back(std::make_pair(lo1, hi1));
+ ranges.push_back(std::make_pair(lo2, hi2));
+ return Ranges(ranges);
+ }
+
+ // Pass this benchmark object to *func, which can customize
+ // the benchmark by calling various methods like Arg, Args,
+ // Threads, etc.
+ Benchmark* Apply(void (*func)(Benchmark* benchmark));
+
+ // Set the range multiplier for non-dense range. If not called, the range
+ // multiplier kRangeMultiplier will be used.
+ Benchmark* RangeMultiplier(int multiplier);
+
+ // Set the minimum amount of time to use when running this benchmark. This
+ // option overrides the `benchmark_min_time` flag.
+ // REQUIRES: `t > 0` and `Iterations` has not been called on this benchmark.
+ Benchmark* MinTime(double t);
+
+ // Specify the amount of iterations that should be run by this benchmark.
+ // REQUIRES: 'n > 0' and `MinTime` has not been called on this benchmark.
+ //
+ // NOTE: This function should only be used when *exact* iteration control is
+ // needed and never to control or limit how long a benchmark runs, where
+ // `--benchmark_min_time=N` or `MinTime(...)` should be used instead.
+ Benchmark* Iterations(size_t n);
+
+ // Specify the amount of times to repeat this benchmark. This option overrides
+ // the `benchmark_repetitions` flag.
+ // REQUIRES: `n > 0`
+ Benchmark* Repetitions(int n);
+
+ // Specify if each repetition of the benchmark should be reported separately
+ // or if only the final statistics should be reported. If the benchmark
+ // is not repeated then the single result is always reported.
+ Benchmark* ReportAggregatesOnly(bool v = true);
+
+ // If a particular benchmark is I/O bound, runs multiple threads internally or
+ // if for some reason CPU timings are not representative, call this method. If
+ // called, the elapsed time will be used to control how many iterations are
+ // run, and in the printing of items/second or MB/seconds values. If not
+ // called, the cpu time used by the benchmark will be used.
+ Benchmark* UseRealTime();
+
+ // If a benchmark must measure time manually (e.g. if GPU execution time is
+ // being
+ // measured), call this method. If called, each benchmark iteration should
+ // call
+ // SetIterationTime(seconds) to report the measured time, which will be used
+ // to control how many iterations are run, and in the printing of items/second
+ // or MB/second values.
+ Benchmark* UseManualTime();
+
+ // Set the asymptotic computational complexity for the benchmark. If called
+ // the asymptotic computational complexity will be shown on the output.
+ Benchmark* Complexity(BigO complexity = benchmark::oAuto);
+
+ // Set the asymptotic computational complexity for the benchmark. If called
+ // the asymptotic computational complexity will be shown on the output.
+ Benchmark* Complexity(BigOFunc* complexity);
+
+ // Support for running multiple copies of the same benchmark concurrently
+ // in multiple threads. This may be useful when measuring the scaling
+ // of some piece of code.
+
+ // Run one instance of this benchmark concurrently in t threads.
+ Benchmark* Threads(int t);
+
+ // Pick a set of values T from [min_threads,max_threads].
+ // min_threads and max_threads are always included in T. Run this
+ // benchmark once for each value in T. The benchmark run for a
+ // particular value t consists of t threads running the benchmark
+ // function concurrently. For example, consider:
+ // BENCHMARK(Foo)->ThreadRange(1,16);
+ // This will run the following benchmarks:
+ // Foo in 1 thread
+ // Foo in 2 threads
+ // Foo in 4 threads
+ // Foo in 8 threads
+ // Foo in 16 threads
+ Benchmark* ThreadRange(int min_threads, int max_threads);
+
+ // For each value n in the range, run this benchmark once using n threads.
+ // min_threads and max_threads are always included in the range.
+ // stride specifies the increment. E.g. DenseThreadRange(1, 8, 3) starts
+ // a benchmark with 1, 4, 7 and 8 threads.
+ Benchmark* DenseThreadRange(int min_threads, int max_threads, int stride = 1);
+
+ // Equivalent to ThreadRange(NumCPUs(), NumCPUs())
+ Benchmark* ThreadPerCpu();
+
+ virtual void Run(State& state) = 0;
+
+ // Used inside the benchmark implementation
+ struct Instance;
+
+ protected:
+ explicit Benchmark(const char* name);
+ Benchmark(Benchmark const&);
+ void SetName(const char* name);
+
+ int ArgsCnt() const;
+
+ static void AddRange(std::vector<int>* dst, int lo, int hi, int mult);
+
+ private:
+ friend class BenchmarkFamilies;
+
+ std::string name_;
+ ReportMode report_mode_;
+ std::vector<std::string> arg_names_; // Args for all benchmark runs
+ std::vector<std::vector<int> > args_; // Args for all benchmark runs
+ TimeUnit time_unit_;
+ int range_multiplier_;
+ double min_time_;
+ size_t iterations_;
+ int repetitions_;
+ bool use_real_time_;
+ bool use_manual_time_;
+ BigO complexity_;
+ BigOFunc* complexity_lambda_;
+ std::vector<int> thread_counts_;
+
+ Benchmark& operator=(Benchmark const&);
+};
+
+} // namespace internal
+
+// Create and register a benchmark with the specified 'name' that invokes
+// the specified functor 'fn'.
+//
+// RETURNS: A pointer to the registered benchmark.
+internal::Benchmark* RegisterBenchmark(const char* name,
+ internal::Function* fn);
+
+#if defined(BENCHMARK_HAS_CXX11)
+template <class Lambda>
+internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn);
+#endif
+
+namespace internal {
+// The class used to hold all Benchmarks created from static function.
+// (ie those created using the BENCHMARK(...) macros.
+class FunctionBenchmark : public Benchmark {
+ public:
+ FunctionBenchmark(const char* name, Function* func)
+ : Benchmark(name), func_(func) {}
+
+ virtual void Run(State& st);
+
+ private:
+ Function* func_;
+};
+
+#ifdef BENCHMARK_HAS_CXX11
+template <class Lambda>
+class LambdaBenchmark : public Benchmark {
+ public:
+ virtual void Run(State& st) { lambda_(st); }
+
+ private:
+ template <class OLambda>
+ LambdaBenchmark(const char* name, OLambda&& lam)
+ : Benchmark(name), lambda_(std::forward<OLambda>(lam)) {}
+
+ LambdaBenchmark(LambdaBenchmark const&) = delete;
+
+ private:
+ template <class Lam>
+ friend Benchmark* ::benchmark::RegisterBenchmark(const char*, Lam&&);
+
+ Lambda lambda_;
+};
+#endif
+
+} // end namespace internal
+
+inline internal::Benchmark* RegisterBenchmark(const char* name,
+ internal::Function* fn) {
+ return internal::RegisterBenchmarkInternal(
+ ::new internal::FunctionBenchmark(name, fn));
+}
+
+#ifdef BENCHMARK_HAS_CXX11
+template <class Lambda>
+internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn) {
+ using BenchType =
+ internal::LambdaBenchmark<typename std::decay<Lambda>::type>;
+ return internal::RegisterBenchmarkInternal(
+ ::new BenchType(name, std::forward<Lambda>(fn)));
+}
+#endif
+
+#if defined(BENCHMARK_HAS_CXX11) && \
+ (!defined(BENCHMARK_GCC_VERSION) || BENCHMARK_GCC_VERSION >= 409)
+template <class Lambda, class... Args>
+internal::Benchmark* RegisterBenchmark(const char* name, Lambda&& fn,
+ Args&&... args) {
+ return benchmark::RegisterBenchmark(
+ name, [=](benchmark::State& st) { fn(st, args...); });
+}
+#else
+#define BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK
+#endif
+
+// The base class for all fixture tests.
+class Fixture : public internal::Benchmark {
+ public:
+ Fixture() : internal::Benchmark("") {}
+
+ virtual void Run(State& st) {
+ this->SetUp(st);
+ this->BenchmarkCase(st);
+ this->TearDown(st);
+ }
+
+ // These will be deprecated ...
+ virtual void SetUp(const State&) {}
+ virtual void TearDown(const State&) {}
+ // ... In favor of these.
+ virtual void SetUp(State& st) { SetUp(const_cast<const State&>(st)); }
+ virtual void TearDown(State& st) { TearDown(const_cast<const State&>(st)); }
+
+ protected:
+ virtual void BenchmarkCase(State&) = 0;
+};
+
+} // end namespace benchmark
+
+// ------------------------------------------------------
+// Macro to register benchmarks
+
+// Check that __COUNTER__ is defined and that __COUNTER__ increases by 1
+// every time it is expanded. X + 1 == X + 0 is used in case X is defined to be
+// empty. If X is empty the expression becomes (+1 == +0).
+#if defined(__COUNTER__) && (__COUNTER__ + 1 == __COUNTER__ + 0)
+#define BENCHMARK_PRIVATE_UNIQUE_ID __COUNTER__
+#else
+#define BENCHMARK_PRIVATE_UNIQUE_ID __LINE__
+#endif
+
+// Helpers for generating unique variable names
+#define BENCHMARK_PRIVATE_NAME(n) \
+ BENCHMARK_PRIVATE_CONCAT(_benchmark_, BENCHMARK_PRIVATE_UNIQUE_ID, n)
+#define BENCHMARK_PRIVATE_CONCAT(a, b, c) BENCHMARK_PRIVATE_CONCAT2(a, b, c)
+#define BENCHMARK_PRIVATE_CONCAT2(a, b, c) a##b##c
+
+#define BENCHMARK_PRIVATE_DECLARE(n) \
+ static ::benchmark::internal::Benchmark* BENCHMARK_PRIVATE_NAME(n) \
+ BENCHMARK_UNUSED
+
+#define BENCHMARK(n) \
+ BENCHMARK_PRIVATE_DECLARE(n) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark(#n, n)))
+
+// Old-style macros
+#define BENCHMARK_WITH_ARG(n, a) BENCHMARK(n)->Arg((a))
+#define BENCHMARK_WITH_ARG2(n, a1, a2) BENCHMARK(n)->Args({(a1), (a2)})
+#define BENCHMARK_WITH_UNIT(n, t) BENCHMARK(n)->Unit((t))
+#define BENCHMARK_RANGE(n, lo, hi) BENCHMARK(n)->Range((lo), (hi))
+#define BENCHMARK_RANGE2(n, l1, h1, l2, h2) \
+ BENCHMARK(n)->RangePair({{(l1), (h1)}, {(l2), (h2)}})
+
+#if __cplusplus >= 201103L
+
+// Register a benchmark which invokes the function specified by `func`
+// with the additional arguments specified by `...`.
+//
+// For example:
+//
+// template <class ...ExtraArgs>`
+// void BM_takes_args(benchmark::State& state, ExtraArgs&&... extra_args) {
+// [...]
+//}
+// /* Registers a benchmark named "BM_takes_args/int_string_test` */
+// BENCHMARK_CAPTURE(BM_takes_args, int_string_test, 42, std::string("abc"));
+#define BENCHMARK_CAPTURE(func, test_case_name, ...) \
+ BENCHMARK_PRIVATE_DECLARE(func) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark( \
+ #func "/" #test_case_name, \
+ [](::benchmark::State& st) { func(st, __VA_ARGS__); })))
+
+#endif // __cplusplus >= 11
+
+// This will register a benchmark for a templatized function. For example:
+//
+// template<int arg>
+// void BM_Foo(int iters);
+//
+// BENCHMARK_TEMPLATE(BM_Foo, 1);
+//
+// will register BM_Foo<1> as a benchmark.
+#define BENCHMARK_TEMPLATE1(n, a) \
+ BENCHMARK_PRIVATE_DECLARE(n) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark(#n "<" #a ">", n<a>)))
+
+#define BENCHMARK_TEMPLATE2(n, a, b) \
+ BENCHMARK_PRIVATE_DECLARE(n) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark(#n "<" #a "," #b ">", \
+ n<a, b>)))
+
+#if __cplusplus >= 201103L
+#define BENCHMARK_TEMPLATE(n, ...) \
+ BENCHMARK_PRIVATE_DECLARE(n) = \
+ (::benchmark::internal::RegisterBenchmarkInternal( \
+ new ::benchmark::internal::FunctionBenchmark( \
+ #n "<" #__VA_ARGS__ ">", n<__VA_ARGS__>)))
+#else
+#define BENCHMARK_TEMPLATE(n, a) BENCHMARK_TEMPLATE1(n, a)
+#endif
+
+#define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
+ class BaseClass##_##Method##_Benchmark : public BaseClass { \
+ public: \
+ BaseClass##_##Method##_Benchmark() : BaseClass() { \
+ this->SetName(#BaseClass "/" #Method); \
+ } \
+ \
+ protected: \
+ virtual void BenchmarkCase(::benchmark::State&); \
+ };
+
+#define BENCHMARK_DEFINE_F(BaseClass, Method) \
+ BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
+ void BaseClass##_##Method##_Benchmark::BenchmarkCase
+
+#define BENCHMARK_REGISTER_F(BaseClass, Method) \
+ BENCHMARK_PRIVATE_REGISTER_F(BaseClass##_##Method##_Benchmark)
+
+#define BENCHMARK_PRIVATE_REGISTER_F(TestName) \
+ BENCHMARK_PRIVATE_DECLARE(TestName) = \
+ (::benchmark::internal::RegisterBenchmarkInternal(new TestName()))
+
+// This macro will define and register a benchmark within a fixture class.
+#define BENCHMARK_F(BaseClass, Method) \
+ BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
+ BENCHMARK_REGISTER_F(BaseClass, Method); \
+ void BaseClass##_##Method##_Benchmark::BenchmarkCase
+
+// Helper macro to create a main routine in a test that runs the benchmarks
+#define BENCHMARK_MAIN() \
+ int main(int argc, char** argv) { \
+ ::benchmark::Initialize(&argc, argv); \
+ if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; \
+ ::benchmark::RunSpecifiedBenchmarks(); \
+ }
+
+#endif // BENCHMARK_BENCHMARK_API_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/macros.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/macros.h
new file mode 100644
index 00000000000..2466fd3fad0
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/macros.h
@@ -0,0 +1,66 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef BENCHMARK_MACROS_H_
+#define BENCHMARK_MACROS_H_
+
+#if __cplusplus >= 201103L
+#define BENCHMARK_HAS_CXX11
+#endif
+
+#ifndef BENCHMARK_HAS_CXX11
+#define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ TypeName& operator=(const TypeName&)
+#else
+#define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&) = delete; \
+ TypeName& operator=(const TypeName&) = delete
+#endif
+
+#if defined(__GNUC__)
+#define BENCHMARK_UNUSED __attribute__((unused))
+#define BENCHMARK_ALWAYS_INLINE __attribute__((always_inline))
+#define BENCHMARK_NOEXCEPT noexcept
+#define BENCHMARK_NOEXCEPT_OP(x) noexcept(x)
+#elif defined(_MSC_VER) && !defined(__clang__)
+#define BENCHMARK_UNUSED
+#define BENCHMARK_ALWAYS_INLINE __forceinline
+#if _MSC_VER >= 1900
+#define BENCHMARK_NOEXCEPT noexcept
+#define BENCHMARK_NOEXCEPT_OP(x) noexcept(x)
+#else
+#define BENCHMARK_NOEXCEPT
+#define BENCHMARK_NOEXCEPT_OP(x)
+#endif
+#define __func__ __FUNCTION__
+#else
+#define BENCHMARK_UNUSED
+#define BENCHMARK_ALWAYS_INLINE
+#define BENCHMARK_NOEXCEPT
+#define BENCHMARK_NOEXCEPT_OP(x)
+#endif
+
+#if defined(__GNUC__)
+#define BENCHMARK_BUILTIN_EXPECT(x, y) __builtin_expect(x, y)
+#define BENCHMARK_DEPRECATED_MSG(msg) __attribute__((deprecated(msg)))
+#else
+#define BENCHMARK_BUILTIN_EXPECT(x, y) x
+#define BENCHMARK_DEPRECATED_MSG(msg)
+#endif
+
+#if defined(__GNUC__) && !defined(__clang__)
+#define BENCHMARK_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#endif
+
+#endif // BENCHMARK_MACROS_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/reporter.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/reporter.h
new file mode 100644
index 00000000000..789124ba813
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/include/benchmark/reporter.h
@@ -0,0 +1,230 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef BENCHMARK_REPORTER_H_
+#define BENCHMARK_REPORTER_H_
+
+#include <cassert>
+#include <iosfwd>
+#include <string>
+#include <utility>
+#include <vector>
+#include <set>
+
+#include "benchmark_api.h" // For forward declaration of BenchmarkReporter
+
+namespace benchmark {
+
+// Interface for custom benchmark result printers.
+// By default, benchmark reports are printed to stdout. However an application
+// can control the destination of the reports by calling
+// RunSpecifiedBenchmarks and passing it a custom reporter object.
+// The reporter object must implement the following interface.
+class BenchmarkReporter {
+ public:
+ struct Context {
+ int num_cpus;
+ double mhz_per_cpu;
+ bool cpu_scaling_enabled;
+
+ // The number of chars in the longest benchmark name.
+ size_t name_field_width;
+ };
+
+ struct Run {
+ Run()
+ : error_occurred(false),
+ iterations(1),
+ time_unit(kNanosecond),
+ real_accumulated_time(0),
+ cpu_accumulated_time(0),
+ bytes_per_second(0),
+ items_per_second(0),
+ max_heapbytes_used(0),
+ complexity(oNone),
+ complexity_lambda(),
+ complexity_n(0),
+ report_big_o(false),
+ report_rms(false),
+ counters() {}
+
+ std::string benchmark_name;
+ std::string report_label; // Empty if not set by benchmark.
+ bool error_occurred;
+ std::string error_message;
+
+ int64_t iterations;
+ TimeUnit time_unit;
+ double real_accumulated_time;
+ double cpu_accumulated_time;
+
+ // Return a value representing the real time per iteration in the unit
+ // specified by 'time_unit'.
+ // NOTE: If 'iterations' is zero the returned value represents the
+ // accumulated time.
+ double GetAdjustedRealTime() const;
+
+ // Return a value representing the cpu time per iteration in the unit
+ // specified by 'time_unit'.
+ // NOTE: If 'iterations' is zero the returned value represents the
+ // accumulated time.
+ double GetAdjustedCPUTime() const;
+
+ // Zero if not set by benchmark.
+ double bytes_per_second;
+ double items_per_second;
+
+ // This is set to 0.0 if memory tracing is not enabled.
+ double max_heapbytes_used;
+
+ // Keep track of arguments to compute asymptotic complexity
+ BigO complexity;
+ BigOFunc* complexity_lambda;
+ int complexity_n;
+
+ // Inform print function whether the current run is a complexity report
+ bool report_big_o;
+ bool report_rms;
+
+ UserCounters counters;
+ };
+
+ // Construct a BenchmarkReporter with the output stream set to 'std::cout'
+ // and the error stream set to 'std::cerr'
+ BenchmarkReporter();
+
+ // Called once for every suite of benchmarks run.
+ // The parameter "context" contains information that the
+ // reporter may wish to use when generating its report, for example the
+ // platform under which the benchmarks are running. The benchmark run is
+ // never started if this function returns false, allowing the reporter
+ // to skip runs based on the context information.
+ virtual bool ReportContext(const Context& context) = 0;
+
+ // Called once for each group of benchmark runs, gives information about
+ // cpu-time and heap memory usage during the benchmark run. If the group
+ // of runs contained more than two entries then 'report' contains additional
+ // elements representing the mean and standard deviation of those runs.
+ // Additionally if this group of runs was the last in a family of benchmarks
+ // 'reports' contains additional entries representing the asymptotic
+ // complexity and RMS of that benchmark family.
+ virtual void ReportRuns(const std::vector<Run>& report) = 0;
+
+ // Called once and only once after ever group of benchmarks is run and
+ // reported.
+ virtual void Finalize() {}
+
+ // REQUIRES: The object referenced by 'out' is valid for the lifetime
+ // of the reporter.
+ void SetOutputStream(std::ostream* out) {
+ assert(out);
+ output_stream_ = out;
+ }
+
+ // REQUIRES: The object referenced by 'err' is valid for the lifetime
+ // of the reporter.
+ void SetErrorStream(std::ostream* err) {
+ assert(err);
+ error_stream_ = err;
+ }
+
+ std::ostream& GetOutputStream() const { return *output_stream_; }
+
+ std::ostream& GetErrorStream() const { return *error_stream_; }
+
+ virtual ~BenchmarkReporter();
+
+ // Write a human readable string to 'out' representing the specified
+ // 'context'.
+ // REQUIRES: 'out' is non-null.
+ static void PrintBasicContext(std::ostream* out, Context const& context);
+
+ private:
+ std::ostream* output_stream_;
+ std::ostream* error_stream_;
+};
+
+// Simple reporter that outputs benchmark data to the console. This is the
+// default reporter used by RunSpecifiedBenchmarks().
+class ConsoleReporter : public BenchmarkReporter {
+ public:
+ enum OutputOptions { OO_None, OO_Color };
+ explicit ConsoleReporter(OutputOptions color_output = OO_Color)
+ : name_field_width_(0), color_output_(color_output == OO_Color) {}
+
+ virtual bool ReportContext(const Context& context);
+ virtual void ReportRuns(const std::vector<Run>& reports);
+
+ protected:
+ virtual void PrintRunData(const Run& report);
+ virtual void PrintHeader(const Run& report);
+
+ size_t name_field_width_;
+ bool printed_header_;
+
+ private:
+ bool color_output_;
+};
+
+class JSONReporter : public BenchmarkReporter {
+ public:
+ JSONReporter() : first_report_(true) {}
+ virtual bool ReportContext(const Context& context);
+ virtual void ReportRuns(const std::vector<Run>& reports);
+ virtual void Finalize();
+
+ private:
+ void PrintRunData(const Run& report);
+
+ bool first_report_;
+};
+
+class CSVReporter : public BenchmarkReporter {
+ public:
+ CSVReporter() : printed_header_(false) {}
+ virtual bool ReportContext(const Context& context);
+ virtual void ReportRuns(const std::vector<Run>& reports);
+
+ private:
+ void PrintRunData(const Run& report);
+
+ bool printed_header_;
+ std::set< std::string > user_counter_names_;
+};
+
+inline const char* GetTimeUnitString(TimeUnit unit) {
+ switch (unit) {
+ case kMillisecond:
+ return "ms";
+ case kMicrosecond:
+ return "us";
+ case kNanosecond:
+ default:
+ return "ns";
+ }
+}
+
+inline double GetTimeUnitMultiplier(TimeUnit unit) {
+ switch (unit) {
+ case kMillisecond:
+ return 1e3;
+ case kMicrosecond:
+ return 1e6;
+ case kNanosecond:
+ default:
+ return 1e9;
+ }
+}
+
+} // end namespace benchmark
+#endif // BENCHMARK_REPORTER_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/mingw.py b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/mingw.py
new file mode 100644
index 00000000000..706ad559db9
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/mingw.py
@@ -0,0 +1,320 @@
+#! /usr/bin/env python
+# encoding: utf-8
+
+import argparse
+import errno
+import logging
+import os
+import platform
+import re
+import sys
+import subprocess
+import tempfile
+
+try:
+ import winreg
+except ImportError:
+ import _winreg as winreg
+try:
+ import urllib.request as request
+except ImportError:
+ import urllib as request
+try:
+ import urllib.parse as parse
+except ImportError:
+ import urlparse as parse
+
+class EmptyLogger(object):
+ '''
+ Provides an implementation that performs no logging
+ '''
+ def debug(self, *k, **kw):
+ pass
+ def info(self, *k, **kw):
+ pass
+ def warn(self, *k, **kw):
+ pass
+ def error(self, *k, **kw):
+ pass
+ def critical(self, *k, **kw):
+ pass
+ def setLevel(self, *k, **kw):
+ pass
+
+urls = (
+ 'http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20'
+ 'targetting%20Win32/Personal%20Builds/mingw-builds/installer/'
+ 'repository.txt',
+ 'http://downloads.sourceforge.net/project/mingwbuilds/host-windows/'
+ 'repository.txt'
+)
+'''
+A list of mingw-build repositories
+'''
+
+def repository(urls = urls, log = EmptyLogger()):
+ '''
+ Downloads and parse mingw-build repository files and parses them
+ '''
+ log.info('getting mingw-builds repository')
+ versions = {}
+ re_sourceforge = re.compile(r'http://sourceforge.net/projects/([^/]+)/files')
+ re_sub = r'http://downloads.sourceforge.net/project/\1'
+ for url in urls:
+ log.debug(' - requesting: %s', url)
+ socket = request.urlopen(url)
+ repo = socket.read()
+ if not isinstance(repo, str):
+ repo = repo.decode();
+ socket.close()
+ for entry in repo.split('\n')[:-1]:
+ value = entry.split('|')
+ version = tuple([int(n) for n in value[0].strip().split('.')])
+ version = versions.setdefault(version, {})
+ arch = value[1].strip()
+ if arch == 'x32':
+ arch = 'i686'
+ elif arch == 'x64':
+ arch = 'x86_64'
+ arch = version.setdefault(arch, {})
+ threading = arch.setdefault(value[2].strip(), {})
+ exceptions = threading.setdefault(value[3].strip(), {})
+ revision = exceptions.setdefault(int(value[4].strip()[3:]),
+ re_sourceforge.sub(re_sub, value[5].strip()))
+ return versions
+
+def find_in_path(file, path=None):
+ '''
+ Attempts to find an executable in the path
+ '''
+ if platform.system() == 'Windows':
+ file += '.exe'
+ if path is None:
+ path = os.environ.get('PATH', '')
+ if type(path) is type(''):
+ path = path.split(os.pathsep)
+ return list(filter(os.path.exists,
+ map(lambda dir, file=file: os.path.join(dir, file), path)))
+
+def find_7zip(log = EmptyLogger()):
+ '''
+ Attempts to find 7zip for unpacking the mingw-build archives
+ '''
+ log.info('finding 7zip')
+ path = find_in_path('7z')
+ if not path:
+ key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\7-Zip')
+ path, _ = winreg.QueryValueEx(key, 'Path')
+ path = [os.path.join(path, '7z.exe')]
+ log.debug('found \'%s\'', path[0])
+ return path[0]
+
+find_7zip()
+
+def unpack(archive, location, log = EmptyLogger()):
+ '''
+ Unpacks a mingw-builds archive
+ '''
+ sevenzip = find_7zip(log)
+ log.info('unpacking %s', os.path.basename(archive))
+ cmd = [sevenzip, 'x', archive, '-o' + location, '-y']
+ log.debug(' - %r', cmd)
+ with open(os.devnull, 'w') as devnull:
+ subprocess.check_call(cmd, stdout = devnull)
+
+def download(url, location, log = EmptyLogger()):
+ '''
+ Downloads and unpacks a mingw-builds archive
+ '''
+ log.info('downloading MinGW')
+ log.debug(' - url: %s', url)
+ log.debug(' - location: %s', location)
+
+ re_content = re.compile(r'attachment;[ \t]*filename=(")?([^"]*)(")?[\r\n]*')
+
+ stream = request.urlopen(url)
+ try:
+ content = stream.getheader('Content-Disposition') or ''
+ except AttributeError:
+ content = stream.headers.getheader('Content-Disposition') or ''
+ matches = re_content.match(content)
+ if matches:
+ filename = matches.group(2)
+ else:
+ parsed = parse.urlparse(stream.geturl())
+ filename = os.path.basename(parsed.path)
+
+ try:
+ os.makedirs(location)
+ except OSError as e:
+ if e.errno == errno.EEXIST and os.path.isdir(location):
+ pass
+ else:
+ raise
+
+ archive = os.path.join(location, filename)
+ with open(archive, 'wb') as out:
+ while True:
+ buf = stream.read(1024)
+ if not buf:
+ break
+ out.write(buf)
+ unpack(archive, location, log = log)
+ os.remove(archive)
+
+ possible = os.path.join(location, 'mingw64')
+ if not os.path.exists(possible):
+ possible = os.path.join(location, 'mingw32')
+ if not os.path.exists(possible):
+ raise ValueError('Failed to find unpacked MinGW: ' + possible)
+ return possible
+
+def root(location = None, arch = None, version = None, threading = None,
+ exceptions = None, revision = None, log = EmptyLogger()):
+ '''
+ Returns the root folder of a specific version of the mingw-builds variant
+ of gcc. Will download the compiler if needed
+ '''
+
+ # Get the repository if we don't have all the information
+ if not (arch and version and threading and exceptions and revision):
+ versions = repository(log = log)
+
+ # Determine some defaults
+ version = version or max(versions.keys())
+ if not arch:
+ arch = platform.machine().lower()
+ if arch == 'x86':
+ arch = 'i686'
+ elif arch == 'amd64':
+ arch = 'x86_64'
+ if not threading:
+ keys = versions[version][arch].keys()
+ if 'posix' in keys:
+ threading = 'posix'
+ elif 'win32' in keys:
+ threading = 'win32'
+ else:
+ threading = keys[0]
+ if not exceptions:
+ keys = versions[version][arch][threading].keys()
+ if 'seh' in keys:
+ exceptions = 'seh'
+ elif 'sjlj' in keys:
+ exceptions = 'sjlj'
+ else:
+ exceptions = keys[0]
+ if revision == None:
+ revision = max(versions[version][arch][threading][exceptions].keys())
+ if not location:
+ location = os.path.join(tempfile.gettempdir(), 'mingw-builds')
+
+ # Get the download url
+ url = versions[version][arch][threading][exceptions][revision]
+
+ # Tell the user whatzzup
+ log.info('finding MinGW %s', '.'.join(str(v) for v in version))
+ log.debug(' - arch: %s', arch)
+ log.debug(' - threading: %s', threading)
+ log.debug(' - exceptions: %s', exceptions)
+ log.debug(' - revision: %s', revision)
+ log.debug(' - url: %s', url)
+
+ # Store each specific revision differently
+ slug = '{version}-{arch}-{threading}-{exceptions}-rev{revision}'
+ slug = slug.format(
+ version = '.'.join(str(v) for v in version),
+ arch = arch,
+ threading = threading,
+ exceptions = exceptions,
+ revision = revision
+ )
+ if arch == 'x86_64':
+ root_dir = os.path.join(location, slug, 'mingw64')
+ elif arch == 'i686':
+ root_dir = os.path.join(location, slug, 'mingw32')
+ else:
+ raise ValueError('Unknown MinGW arch: ' + arch)
+
+ # Download if needed
+ if not os.path.exists(root_dir):
+ downloaded = download(url, os.path.join(location, slug), log = log)
+ if downloaded != root_dir:
+ raise ValueError('The location of mingw did not match\n%s\n%s'
+ % (downloaded, root_dir))
+
+ return root_dir
+
+def str2ver(string):
+ '''
+ Converts a version string into a tuple
+ '''
+ try:
+ version = tuple(int(v) for v in string.split('.'))
+ if len(version) is not 3:
+ raise ValueError()
+ except ValueError:
+ raise argparse.ArgumentTypeError(
+ 'please provide a three digit version string')
+ return version
+
+def main():
+ '''
+ Invoked when the script is run directly by the python interpreter
+ '''
+ parser = argparse.ArgumentParser(
+ description = 'Downloads a specific version of MinGW',
+ formatter_class = argparse.ArgumentDefaultsHelpFormatter
+ )
+ parser.add_argument('--location',
+ help = 'the location to download the compiler to',
+ default = os.path.join(tempfile.gettempdir(), 'mingw-builds'))
+ parser.add_argument('--arch', required = True, choices = ['i686', 'x86_64'],
+ help = 'the target MinGW architecture string')
+ parser.add_argument('--version', type = str2ver,
+ help = 'the version of GCC to download')
+ parser.add_argument('--threading', choices = ['posix', 'win32'],
+ help = 'the threading type of the compiler')
+ parser.add_argument('--exceptions', choices = ['sjlj', 'seh', 'dwarf'],
+ help = 'the method to throw exceptions')
+ parser.add_argument('--revision', type=int,
+ help = 'the revision of the MinGW release')
+ group = parser.add_mutually_exclusive_group()
+ group.add_argument('-v', '--verbose', action='store_true',
+ help='increase the script output verbosity')
+ group.add_argument('-q', '--quiet', action='store_true',
+ help='only print errors and warning')
+ args = parser.parse_args()
+
+ # Create the logger
+ logger = logging.getLogger('mingw')
+ handler = logging.StreamHandler()
+ formatter = logging.Formatter('%(message)s')
+ handler.setFormatter(formatter)
+ logger.addHandler(handler)
+ logger.setLevel(logging.INFO)
+ if args.quiet:
+ logger.setLevel(logging.WARN)
+ if args.verbose:
+ logger.setLevel(logging.DEBUG)
+
+ # Get MinGW
+ root_dir = root(location = args.location, arch = args.arch,
+ version = args.version, threading = args.threading,
+ exceptions = args.exceptions, revision = args.revision,
+ log = logger)
+
+ sys.stdout.write('%s\n' % os.path.join(root_dir, 'bin'))
+
+if __name__ == '__main__':
+ try:
+ main()
+ except IOError as e:
+ sys.stderr.write('IO error: %s\n' % e)
+ sys.exit(1)
+ except OSError as e:
+ sys.stderr.write('OS error: %s\n' % e)
+ sys.exit(1)
+ except KeyboardInterrupt as e:
+ sys.stderr.write('Killed\n')
+ sys.exit(1)
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/CMakeLists.txt b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/CMakeLists.txt
new file mode 100644
index 00000000000..7707773930c
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/CMakeLists.txt
@@ -0,0 +1,75 @@
+# Allow the source files to find headers in src/
+include_directories(${PROJECT_SOURCE_DIR}/src)
+
+if (DEFINED BENCHMARK_CXX_LINKER_FLAGS)
+ list(APPEND CMAKE_SHARED_LINKER_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS})
+ list(APPEND CMAKE_MODULE_LINKER_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS})
+endif()
+
+file(GLOB
+ SOURCE_FILES
+ *.cc
+ ${PROJECT_SOURCE_DIR}/include/benchmark/*.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
+
+add_library(benchmark ${SOURCE_FILES})
+set_target_properties(benchmark PROPERTIES
+ OUTPUT_NAME "benchmark"
+ VERSION ${GENERIC_LIB_VERSION}
+ SOVERSION ${GENERIC_LIB_SOVERSION}
+)
+
+# Link threads.
+target_link_libraries(benchmark ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+find_library(LIBRT rt)
+if(LIBRT)
+ target_link_libraries(benchmark ${LIBRT})
+endif()
+
+# We need extra libraries on Windows
+if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+ target_link_libraries(benchmark Shlwapi)
+endif()
+
+set(include_install_dir "include")
+set(lib_install_dir "lib/")
+set(bin_install_dir "bin/")
+set(config_install_dir "lib/cmake/${PROJECT_NAME}")
+
+set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
+
+set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
+set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
+set(targets_export_name "${PROJECT_NAME}Targets")
+
+set(namespace "${PROJECT_NAME}::")
+
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file(
+ "${version_config}" VERSION ${GIT_VERSION} COMPATIBILITY SameMajorVersion
+)
+
+configure_file("${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" @ONLY)
+
+# Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable)
+install(
+ TARGETS benchmark
+ EXPORT ${targets_export_name}
+ ARCHIVE DESTINATION ${lib_install_dir}
+ LIBRARY DESTINATION ${lib_install_dir}
+ RUNTIME DESTINATION ${bin_install_dir}
+ INCLUDES DESTINATION ${include_install_dir})
+
+install(
+ DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark"
+ DESTINATION ${include_install_dir}
+ FILES_MATCHING PATTERN "*.*h")
+
+install(
+ FILES "${project_config}" "${version_config}"
+ DESTINATION "${config_install_dir}")
+
+install(
+ EXPORT "${targets_export_name}"
+ NAMESPACE "${namespace}"
+ DESTINATION "${config_install_dir}")
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/arraysize.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/arraysize.h
new file mode 100644
index 00000000000..51a50f2dff2
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/arraysize.h
@@ -0,0 +1,33 @@
+#ifndef BENCHMARK_ARRAYSIZE_H_
+#define BENCHMARK_ARRAYSIZE_H_
+
+#include "internal_macros.h"
+
+namespace benchmark {
+namespace internal {
+// The arraysize(arr) macro returns the # of elements in an array arr.
+// The expression is a compile-time constant, and therefore can be
+// used in defining new arrays, for example. If you use arraysize on
+// a pointer by mistake, you will get a compile-time error.
+//
+
+// This template function declaration is used in defining arraysize.
+// Note that the function doesn't need an implementation, as we only
+// use its type.
+template <typename T, size_t N>
+char (&ArraySizeHelper(T (&array)[N]))[N];
+
+// That gcc wants both of these prototypes seems mysterious. VC, for
+// its part, can't decide which to use (another mystery). Matching of
+// template overloads: the final frontier.
+#ifndef COMPILER_MSVC
+template <typename T, size_t N>
+char (&ArraySizeHelper(const T (&array)[N]))[N];
+#endif
+
+#define arraysize(array) (sizeof(::benchmark::internal::ArraySizeHelper(array)))
+
+} // end namespace internal
+} // end namespace benchmark
+
+#endif // BENCHMARK_ARRAYSIZE_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark.cc
new file mode 100644
index 00000000000..00ffa07ff56
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark.cc
@@ -0,0 +1,690 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/benchmark.h"
+#include "benchmark_api_internal.h"
+#include "internal_macros.h"
+
+#ifndef BENCHMARK_OS_WINDOWS
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#include <algorithm>
+#include <atomic>
+#include <condition_variable>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <fstream>
+#include <iostream>
+#include <memory>
+#include <thread>
+
+#include "check.h"
+#include "colorprint.h"
+#include "commandlineflags.h"
+#include "complexity.h"
+#include "counter.h"
+#include "log.h"
+#include "mutex.h"
+#include "re.h"
+#include "stat.h"
+#include "string_util.h"
+#include "sysinfo.h"
+#include "timers.h"
+
+DEFINE_bool(benchmark_list_tests, false,
+ "Print a list of benchmarks. This option overrides all other "
+ "options.");
+
+DEFINE_string(benchmark_filter, ".",
+ "A regular expression that specifies the set of benchmarks "
+ "to execute. If this flag is empty, no benchmarks are run. "
+ "If this flag is the string \"all\", all benchmarks linked "
+ "into the process are run.");
+
+DEFINE_double(benchmark_min_time, 0.5,
+ "Minimum number of seconds we should run benchmark before "
+ "results are considered significant. For cpu-time based "
+ "tests, this is the lower bound on the total cpu time "
+ "used by all threads that make up the test. For real-time "
+ "based tests, this is the lower bound on the elapsed time "
+ "of the benchmark execution, regardless of number of "
+ "threads.");
+
+DEFINE_int32(benchmark_repetitions, 1,
+ "The number of runs of each benchmark. If greater than 1, the "
+ "mean and standard deviation of the runs will be reported.");
+
+DEFINE_bool(benchmark_report_aggregates_only, false,
+ "Report the result of each benchmark repetitions. When 'true' is "
+ "specified only the mean, standard deviation, and other statistics "
+ "are reported for repeated benchmarks.");
+
+DEFINE_string(benchmark_format, "console",
+ "The format to use for console output. Valid values are "
+ "'console', 'json', or 'csv'.");
+
+DEFINE_string(benchmark_out_format, "json",
+ "The format to use for file output. Valid values are "
+ "'console', 'json', or 'csv'.");
+
+DEFINE_string(benchmark_out, "", "The file to write additonal output to");
+
+DEFINE_string(benchmark_color, "auto",
+ "Whether to use colors in the output. Valid values: "
+ "'true'/'yes'/1, 'false'/'no'/0, and 'auto'. 'auto' means to use "
+ "colors if the output is being sent to a terminal and the TERM "
+ "environment variable is set to a terminal type that supports "
+ "colors.");
+
+DEFINE_int32(v, 0, "The level of verbose logging to output");
+
+namespace benchmark {
+namespace internal {
+
+void UseCharPointer(char const volatile*) {}
+
+} // end namespace internal
+
+namespace {
+
+static const size_t kMaxIterations = 1000000000;
+
+} // end namespace
+
+namespace internal {
+
+class ThreadManager {
+ public:
+ ThreadManager(int num_threads)
+ : alive_threads_(num_threads), start_stop_barrier_(num_threads) {}
+
+ Mutex& GetBenchmarkMutex() const RETURN_CAPABILITY(benchmark_mutex_) {
+ return benchmark_mutex_;
+ }
+
+ bool StartStopBarrier() EXCLUDES(end_cond_mutex_) {
+ return start_stop_barrier_.wait();
+ }
+
+ void NotifyThreadComplete() EXCLUDES(end_cond_mutex_) {
+ start_stop_barrier_.removeThread();
+ if (--alive_threads_ == 0) {
+ MutexLock lock(end_cond_mutex_);
+ end_condition_.notify_all();
+ }
+ }
+
+ void WaitForAllThreads() EXCLUDES(end_cond_mutex_) {
+ MutexLock lock(end_cond_mutex_);
+ end_condition_.wait(lock.native_handle(),
+ [this]() { return alive_threads_ == 0; });
+ }
+
+ public:
+ struct Result {
+ double real_time_used = 0;
+ double cpu_time_used = 0;
+ double manual_time_used = 0;
+ int64_t bytes_processed = 0;
+ int64_t items_processed = 0;
+ int complexity_n = 0;
+ std::string report_label_;
+ std::string error_message_;
+ bool has_error_ = false;
+ UserCounters counters;
+ };
+ GUARDED_BY(GetBenchmarkMutex()) Result results;
+
+ private:
+ mutable Mutex benchmark_mutex_;
+ std::atomic<int> alive_threads_;
+ Barrier start_stop_barrier_;
+ Mutex end_cond_mutex_;
+ Condition end_condition_;
+};
+
+// Timer management class
+class ThreadTimer {
+ public:
+ ThreadTimer() = default;
+
+ // Called by each thread
+ void StartTimer() {
+ running_ = true;
+ start_real_time_ = ChronoClockNow();
+ start_cpu_time_ = ThreadCPUUsage();
+ }
+
+ // Called by each thread
+ void StopTimer() {
+ CHECK(running_);
+ running_ = false;
+ real_time_used_ += ChronoClockNow() - start_real_time_;
+ cpu_time_used_ += ThreadCPUUsage() - start_cpu_time_;
+ }
+
+ // Called by each thread
+ void SetIterationTime(double seconds) { manual_time_used_ += seconds; }
+
+ bool running() const { return running_; }
+
+ // REQUIRES: timer is not running
+ double real_time_used() {
+ CHECK(!running_);
+ return real_time_used_;
+ }
+
+ // REQUIRES: timer is not running
+ double cpu_time_used() {
+ CHECK(!running_);
+ return cpu_time_used_;
+ }
+
+ // REQUIRES: timer is not running
+ double manual_time_used() {
+ CHECK(!running_);
+ return manual_time_used_;
+ }
+
+ private:
+ bool running_ = false; // Is the timer running
+ double start_real_time_ = 0; // If running_
+ double start_cpu_time_ = 0; // If running_
+
+ // Accumulated time so far (does not contain current slice if running_)
+ double real_time_used_ = 0;
+ double cpu_time_used_ = 0;
+ // Manually set iteration time. User sets this with SetIterationTime(seconds).
+ double manual_time_used_ = 0;
+};
+
+namespace {
+
+BenchmarkReporter::Run CreateRunReport(
+ const benchmark::internal::Benchmark::Instance& b,
+ const internal::ThreadManager::Result& results, size_t iters,
+ double seconds) {
+ // Create report about this benchmark run.
+ BenchmarkReporter::Run report;
+
+ report.benchmark_name = b.name;
+ report.error_occurred = results.has_error_;
+ report.error_message = results.error_message_;
+ report.report_label = results.report_label_;
+ // Report the total iterations across all threads.
+ report.iterations = static_cast<int64_t>(iters) * b.threads;
+ report.time_unit = b.time_unit;
+
+ if (!report.error_occurred) {
+ double bytes_per_second = 0;
+ if (results.bytes_processed > 0 && seconds > 0.0) {
+ bytes_per_second = (results.bytes_processed / seconds);
+ }
+ double items_per_second = 0;
+ if (results.items_processed > 0 && seconds > 0.0) {
+ items_per_second = (results.items_processed / seconds);
+ }
+
+ if (b.use_manual_time) {
+ report.real_accumulated_time = results.manual_time_used;
+ } else {
+ report.real_accumulated_time = results.real_time_used;
+ }
+ report.cpu_accumulated_time = results.cpu_time_used;
+ report.bytes_per_second = bytes_per_second;
+ report.items_per_second = items_per_second;
+ report.complexity_n = results.complexity_n;
+ report.complexity = b.complexity;
+ report.complexity_lambda = b.complexity_lambda;
+ report.counters = results.counters;
+ }
+ return report;
+}
+
+// Execute one thread of benchmark b for the specified number of iterations.
+// Adds the stats collected for the thread into *total.
+void RunInThread(const benchmark::internal::Benchmark::Instance* b,
+ size_t iters, int thread_id,
+ internal::ThreadManager* manager) {
+ internal::ThreadTimer timer;
+ State st(iters, b->arg, thread_id, b->threads, &timer, manager);
+ b->benchmark->Run(st);
+ CHECK(st.iterations() == st.max_iterations)
+ << "Benchmark returned before State::KeepRunning() returned false!";
+ {
+ MutexLock l(manager->GetBenchmarkMutex());
+ internal::ThreadManager::Result& results = manager->results;
+ results.cpu_time_used += timer.cpu_time_used();
+ results.real_time_used += timer.real_time_used();
+ results.manual_time_used += timer.manual_time_used();
+ results.bytes_processed += st.bytes_processed();
+ results.items_processed += st.items_processed();
+ results.complexity_n += st.complexity_length_n();
+ internal::Increment(&results.counters, st.counters);
+ }
+ manager->NotifyThreadComplete();
+}
+
+std::vector<BenchmarkReporter::Run> RunBenchmark(
+ const benchmark::internal::Benchmark::Instance& b,
+ std::vector<BenchmarkReporter::Run>* complexity_reports) {
+ std::vector<BenchmarkReporter::Run> reports; // return value
+
+ const bool has_explicit_iteration_count = b.iterations != 0;
+ size_t iters = has_explicit_iteration_count ? b.iterations : 1;
+ std::unique_ptr<internal::ThreadManager> manager;
+ std::vector<std::thread> pool(b.threads - 1);
+ const int repeats =
+ b.repetitions != 0 ? b.repetitions : FLAGS_benchmark_repetitions;
+ const bool report_aggregates_only =
+ repeats != 1 &&
+ (b.report_mode == internal::RM_Unspecified
+ ? FLAGS_benchmark_report_aggregates_only
+ : b.report_mode == internal::RM_ReportAggregatesOnly);
+ for (int repetition_num = 0; repetition_num < repeats; repetition_num++) {
+ for (;;) {
+ // Try benchmark
+ VLOG(2) << "Running " << b.name << " for " << iters << "\n";
+
+ manager.reset(new internal::ThreadManager(b.threads));
+ for (std::size_t ti = 0; ti < pool.size(); ++ti) {
+ pool[ti] = std::thread(&RunInThread, &b, iters,
+ static_cast<int>(ti + 1), manager.get());
+ }
+ RunInThread(&b, iters, 0, manager.get());
+ manager->WaitForAllThreads();
+ for (std::thread& thread : pool) thread.join();
+ internal::ThreadManager::Result results;
+ {
+ MutexLock l(manager->GetBenchmarkMutex());
+ results = manager->results;
+ }
+ manager.reset();
+ // Adjust real/manual time stats since they were reported per thread.
+ results.real_time_used /= b.threads;
+ results.manual_time_used /= b.threads;
+
+ VLOG(2) << "Ran in " << results.cpu_time_used << "/"
+ << results.real_time_used << "\n";
+
+ // Base decisions off of real time if requested by this benchmark.
+ double seconds = results.cpu_time_used;
+ if (b.use_manual_time) {
+ seconds = results.manual_time_used;
+ } else if (b.use_real_time) {
+ seconds = results.real_time_used;
+ }
+
+ const double min_time =
+ !IsZero(b.min_time) ? b.min_time : FLAGS_benchmark_min_time;
+
+ // Determine if this run should be reported; Either it has
+ // run for a sufficient amount of time or because an error was reported.
+ const bool should_report = repetition_num > 0
+ || has_explicit_iteration_count // An exact iteration count was requested
+ || results.has_error_
+ || iters >= kMaxIterations
+ || seconds >= min_time // the elapsed time is large enough
+ // CPU time is specified but the elapsed real time greatly exceeds the
+ // minimum time. Note that user provided timers are except from this
+ // sanity check.
+ || ((results.real_time_used >= 5 * min_time) && !b.use_manual_time);
+
+ if (should_report) {
+ BenchmarkReporter::Run report =
+ CreateRunReport(b, results, iters, seconds);
+ if (!report.error_occurred && b.complexity != oNone)
+ complexity_reports->push_back(report);
+ reports.push_back(report);
+ break;
+ }
+
+ // See how much iterations should be increased by
+ // Note: Avoid division by zero with max(seconds, 1ns).
+ double multiplier = min_time * 1.4 / std::max(seconds, 1e-9);
+ // If our last run was at least 10% of FLAGS_benchmark_min_time then we
+ // use the multiplier directly. Otherwise we use at most 10 times
+ // expansion.
+ // NOTE: When the last run was at least 10% of the min time the max
+ // expansion should be 14x.
+ bool is_significant = (seconds / min_time) > 0.1;
+ multiplier = is_significant ? multiplier : std::min(10.0, multiplier);
+ if (multiplier <= 1.0) multiplier = 2.0;
+ double next_iters = std::max(multiplier * iters, iters + 1.0);
+ if (next_iters > kMaxIterations) {
+ next_iters = kMaxIterations;
+ }
+ VLOG(3) << "Next iters: " << next_iters << ", " << multiplier << "\n";
+ iters = static_cast<int>(next_iters + 0.5);
+ }
+ }
+ // Calculate additional statistics
+ auto stat_reports = ComputeStats(reports);
+ if ((b.complexity != oNone) && b.last_benchmark_instance) {
+ auto additional_run_stats = ComputeBigO(*complexity_reports);
+ stat_reports.insert(stat_reports.end(), additional_run_stats.begin(),
+ additional_run_stats.end());
+ complexity_reports->clear();
+ }
+
+ if (report_aggregates_only) reports.clear();
+ reports.insert(reports.end(), stat_reports.begin(), stat_reports.end());
+ return reports;
+}
+
+} // namespace
+} // namespace internal
+
+State::State(size_t max_iters, const std::vector<int>& ranges, int thread_i,
+ int n_threads, internal::ThreadTimer* timer,
+ internal::ThreadManager* manager)
+ : started_(false),
+ finished_(false),
+ total_iterations_(0),
+ range_(ranges),
+ bytes_processed_(0),
+ items_processed_(0),
+ complexity_n_(0),
+ error_occurred_(false),
+ counters(),
+ thread_index(thread_i),
+ threads(n_threads),
+ max_iterations(max_iters),
+ timer_(timer),
+ manager_(manager) {
+ CHECK(max_iterations != 0) << "At least one iteration must be run";
+ CHECK_LT(thread_index, threads) << "thread_index must be less than threads";
+}
+
+void State::PauseTiming() {
+ // Add in time accumulated so far
+ CHECK(started_ && !finished_ && !error_occurred_);
+ timer_->StopTimer();
+}
+
+void State::ResumeTiming() {
+ CHECK(started_ && !finished_ && !error_occurred_);
+ timer_->StartTimer();
+}
+
+void State::SkipWithError(const char* msg) {
+ CHECK(msg);
+ error_occurred_ = true;
+ {
+ MutexLock l(manager_->GetBenchmarkMutex());
+ if (manager_->results.has_error_ == false) {
+ manager_->results.error_message_ = msg;
+ manager_->results.has_error_ = true;
+ }
+ }
+ total_iterations_ = max_iterations;
+ if (timer_->running()) timer_->StopTimer();
+}
+
+void State::SetIterationTime(double seconds) {
+ timer_->SetIterationTime(seconds);
+}
+
+void State::SetLabel(const char* label) {
+ MutexLock l(manager_->GetBenchmarkMutex());
+ manager_->results.report_label_ = label;
+}
+
+void State::StartKeepRunning() {
+ CHECK(!started_ && !finished_);
+ started_ = true;
+ manager_->StartStopBarrier();
+ if (!error_occurred_) ResumeTiming();
+}
+
+void State::FinishKeepRunning() {
+ CHECK(started_ && (!finished_ || error_occurred_));
+ if (!error_occurred_) {
+ PauseTiming();
+ }
+ // Total iterations now is one greater than max iterations. Fix this.
+ total_iterations_ = max_iterations;
+ finished_ = true;
+ manager_->StartStopBarrier();
+}
+
+namespace internal {
+namespace {
+
+void RunBenchmarks(const std::vector<Benchmark::Instance>& benchmarks,
+ BenchmarkReporter* console_reporter,
+ BenchmarkReporter* file_reporter) {
+ // Note the file_reporter can be null.
+ CHECK(console_reporter != nullptr);
+
+ // Determine the width of the name field using a minimum width of 10.
+ bool has_repetitions = FLAGS_benchmark_repetitions > 1;
+ size_t name_field_width = 10;
+ for (const Benchmark::Instance& benchmark : benchmarks) {
+ name_field_width =
+ std::max<size_t>(name_field_width, benchmark.name.size());
+ has_repetitions |= benchmark.repetitions > 1;
+ }
+ if (has_repetitions) name_field_width += std::strlen("_stddev");
+
+ // Print header here
+ BenchmarkReporter::Context context;
+ context.num_cpus = NumCPUs();
+ context.mhz_per_cpu = CyclesPerSecond() / 1000000.0f;
+
+ context.cpu_scaling_enabled = CpuScalingEnabled();
+ context.name_field_width = name_field_width;
+
+ // Keep track of runing times of all instances of current benchmark
+ std::vector<BenchmarkReporter::Run> complexity_reports;
+
+ // We flush streams after invoking reporter methods that write to them. This
+ // ensures users get timely updates even when streams are not line-buffered.
+ auto flushStreams = [](BenchmarkReporter* reporter) {
+ if (!reporter) return;
+ std::flush(reporter->GetOutputStream());
+ std::flush(reporter->GetErrorStream());
+ };
+
+ if (console_reporter->ReportContext(context) &&
+ (!file_reporter || file_reporter->ReportContext(context))) {
+ flushStreams(console_reporter);
+ flushStreams(file_reporter);
+ for (const auto& benchmark : benchmarks) {
+ std::vector<BenchmarkReporter::Run> reports =
+ RunBenchmark(benchmark, &complexity_reports);
+ console_reporter->ReportRuns(reports);
+ if (file_reporter) file_reporter->ReportRuns(reports);
+ flushStreams(console_reporter);
+ flushStreams(file_reporter);
+ }
+ }
+ console_reporter->Finalize();
+ if (file_reporter) file_reporter->Finalize();
+ flushStreams(console_reporter);
+ flushStreams(file_reporter);
+}
+
+std::unique_ptr<BenchmarkReporter> CreateReporter(
+ std::string const& name, ConsoleReporter::OutputOptions allow_color) {
+ typedef std::unique_ptr<BenchmarkReporter> PtrType;
+ if (name == "console") {
+ return PtrType(new ConsoleReporter(allow_color));
+ } else if (name == "json") {
+ return PtrType(new JSONReporter);
+ } else if (name == "csv") {
+ return PtrType(new CSVReporter);
+ } else {
+ std::cerr << "Unexpected format: '" << name << "'\n";
+ std::exit(1);
+ }
+}
+
+} // end namespace
+} // end namespace internal
+
+size_t RunSpecifiedBenchmarks() {
+ return RunSpecifiedBenchmarks(nullptr, nullptr);
+}
+
+size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter) {
+ return RunSpecifiedBenchmarks(console_reporter, nullptr);
+}
+
+size_t RunSpecifiedBenchmarks(BenchmarkReporter* console_reporter,
+ BenchmarkReporter* file_reporter) {
+ std::string spec = FLAGS_benchmark_filter;
+ if (spec.empty() || spec == "all")
+ spec = "."; // Regexp that matches all benchmarks
+
+ // Setup the reporters
+ std::ofstream output_file;
+ std::unique_ptr<BenchmarkReporter> default_console_reporter;
+ std::unique_ptr<BenchmarkReporter> default_file_reporter;
+ if (!console_reporter) {
+ auto output_opts = ConsoleReporter::OO_None;
+ if (FLAGS_benchmark_color == "auto")
+ output_opts = IsColorTerminal() ? ConsoleReporter::OO_Color
+ : ConsoleReporter::OO_None;
+ else
+ output_opts = IsTruthyFlagValue(FLAGS_benchmark_color)
+ ? ConsoleReporter::OO_Color
+ : ConsoleReporter::OO_None;
+ default_console_reporter =
+ internal::CreateReporter(FLAGS_benchmark_format, output_opts);
+ console_reporter = default_console_reporter.get();
+ }
+ auto& Out = console_reporter->GetOutputStream();
+ auto& Err = console_reporter->GetErrorStream();
+
+ std::string const& fname = FLAGS_benchmark_out;
+ if (fname == "" && file_reporter) {
+ Err << "A custom file reporter was provided but "
+ "--benchmark_out=<file> was not specified."
+ << std::endl;
+ std::exit(1);
+ }
+ if (fname != "") {
+ output_file.open(fname);
+ if (!output_file.is_open()) {
+ Err << "invalid file name: '" << fname << std::endl;
+ std::exit(1);
+ }
+ if (!file_reporter) {
+ default_file_reporter = internal::CreateReporter(
+ FLAGS_benchmark_out_format, ConsoleReporter::OO_None);
+ file_reporter = default_file_reporter.get();
+ }
+ file_reporter->SetOutputStream(&output_file);
+ file_reporter->SetErrorStream(&output_file);
+ }
+
+ std::vector<internal::Benchmark::Instance> benchmarks;
+ if (!FindBenchmarksInternal(spec, &benchmarks, &Err)) return 0;
+
+ if (benchmarks.empty()) {
+ Err << "Failed to match any benchmarks against regex: " << spec << "\n";
+ return 0;
+ }
+
+ if (FLAGS_benchmark_list_tests) {
+ for (auto const& benchmark : benchmarks) Out << benchmark.name << "\n";
+ } else {
+ internal::RunBenchmarks(benchmarks, console_reporter, file_reporter);
+ }
+
+ return benchmarks.size();
+}
+
+namespace internal {
+
+void PrintUsageAndExit() {
+ fprintf(stdout,
+ "benchmark"
+ " [--benchmark_list_tests={true|false}]\n"
+ " [--benchmark_filter=<regex>]\n"
+ " [--benchmark_min_time=<min_time>]\n"
+ " [--benchmark_repetitions=<num_repetitions>]\n"
+ " [--benchmark_report_aggregates_only={true|false}\n"
+ " [--benchmark_format=<console|json|csv>]\n"
+ " [--benchmark_out=<filename>]\n"
+ " [--benchmark_out_format=<json|console|csv>]\n"
+ " [--benchmark_color={auto|true|false}]\n"
+ " [--v=<verbosity>]\n");
+ exit(0);
+}
+
+void ParseCommandLineFlags(int* argc, char** argv) {
+ using namespace benchmark;
+ for (int i = 1; i < *argc; ++i) {
+ if (ParseBoolFlag(argv[i], "benchmark_list_tests",
+ &FLAGS_benchmark_list_tests) ||
+ ParseStringFlag(argv[i], "benchmark_filter", &FLAGS_benchmark_filter) ||
+ ParseDoubleFlag(argv[i], "benchmark_min_time",
+ &FLAGS_benchmark_min_time) ||
+ ParseInt32Flag(argv[i], "benchmark_repetitions",
+ &FLAGS_benchmark_repetitions) ||
+ ParseBoolFlag(argv[i], "benchmark_report_aggregates_only",
+ &FLAGS_benchmark_report_aggregates_only) ||
+ ParseStringFlag(argv[i], "benchmark_format", &FLAGS_benchmark_format) ||
+ ParseStringFlag(argv[i], "benchmark_out", &FLAGS_benchmark_out) ||
+ ParseStringFlag(argv[i], "benchmark_out_format",
+ &FLAGS_benchmark_out_format) ||
+ ParseStringFlag(argv[i], "benchmark_color", &FLAGS_benchmark_color) ||
+ // "color_print" is the deprecated name for "benchmark_color".
+ // TODO: Remove this.
+ ParseStringFlag(argv[i], "color_print", &FLAGS_benchmark_color) ||
+ ParseInt32Flag(argv[i], "v", &FLAGS_v)) {
+ for (int j = i; j != *argc - 1; ++j) argv[j] = argv[j + 1];
+
+ --(*argc);
+ --i;
+ } else if (IsFlag(argv[i], "help")) {
+ PrintUsageAndExit();
+ }
+ }
+ for (auto const* flag :
+ {&FLAGS_benchmark_format, &FLAGS_benchmark_out_format})
+ if (*flag != "console" && *flag != "json" && *flag != "csv") {
+ PrintUsageAndExit();
+ }
+ if (FLAGS_benchmark_color.empty()) {
+ PrintUsageAndExit();
+ }
+}
+
+int InitializeStreams() {
+ static std::ios_base::Init init;
+ return 0;
+}
+
+} // end namespace internal
+
+void Initialize(int* argc, char** argv) {
+ internal::ParseCommandLineFlags(argc, argv);
+ internal::LogLevel() = FLAGS_v;
+}
+
+bool ReportUnrecognizedArguments(int argc, char** argv) {
+ for (int i = 1; i < argc; ++i) {
+ fprintf(stderr, "%s: error: unrecognized command-line flag: %s\n", argv[0], argv[i]);
+ }
+ return argc > 1;
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark_api_internal.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark_api_internal.h
new file mode 100644
index 00000000000..828ed12165f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark_api_internal.h
@@ -0,0 +1,49 @@
+#ifndef BENCHMARK_API_INTERNAL_H
+#define BENCHMARK_API_INTERNAL_H
+
+#include "benchmark/benchmark_api.h"
+
+#include <cmath>
+#include <iosfwd>
+#include <limits>
+#include <string>
+#include <vector>
+
+namespace benchmark {
+namespace internal {
+
+// Information kept per benchmark we may want to run
+struct Benchmark::Instance {
+ std::string name;
+ Benchmark* benchmark;
+ ReportMode report_mode;
+ std::vector<int> arg;
+ TimeUnit time_unit;
+ int range_multiplier;
+ bool use_real_time;
+ bool use_manual_time;
+ BigO complexity;
+ BigOFunc* complexity_lambda;
+ UserCounters counters;
+ bool last_benchmark_instance;
+ int repetitions;
+ double min_time;
+ size_t iterations;
+ int threads; // Number of concurrent threads to us
+};
+
+bool FindBenchmarksInternal(const std::string& re,
+ std::vector<Benchmark::Instance>* benchmarks,
+ std::ostream* Err);
+
+namespace {
+
+bool IsZero(double n) {
+ return std::abs(n) < std::numeric_limits<double>::epsilon();
+}
+
+} // end namespace
+} // end namespace internal
+} // end namespace benchmark
+
+#endif // BENCHMARK_API_INTERNAL_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark_register.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark_register.cc
new file mode 100644
index 00000000000..fe373204189
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/benchmark_register.cc
@@ -0,0 +1,452 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/benchmark.h"
+#include "benchmark_api_internal.h"
+#include "internal_macros.h"
+
+#ifndef BENCHMARK_OS_WINDOWS
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#include <algorithm>
+#include <atomic>
+#include <condition_variable>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <fstream>
+#include <iostream>
+#include <memory>
+#include <thread>
+
+#include "check.h"
+#include "commandlineflags.h"
+#include "complexity.h"
+#include "log.h"
+#include "mutex.h"
+#include "re.h"
+#include "stat.h"
+#include "string_util.h"
+#include "sysinfo.h"
+#include "timers.h"
+
+namespace benchmark {
+
+namespace {
+// For non-dense Range, intermediate values are powers of kRangeMultiplier.
+static const int kRangeMultiplier = 8;
+// The size of a benchmark family determines is the number of inputs to repeat
+// the benchmark on. If this is "large" then warn the user during configuration.
+static const size_t kMaxFamilySize = 100;
+} // end namespace
+
+namespace internal {
+
+//=============================================================================//
+// BenchmarkFamilies
+//=============================================================================//
+
+// Class for managing registered benchmarks. Note that each registered
+// benchmark identifies a family of related benchmarks to run.
+class BenchmarkFamilies {
+ public:
+ static BenchmarkFamilies* GetInstance();
+
+ // Registers a benchmark family and returns the index assigned to it.
+ size_t AddBenchmark(std::unique_ptr<Benchmark> family);
+
+ // Extract the list of benchmark instances that match the specified
+ // regular expression.
+ bool FindBenchmarks(const std::string& re,
+ std::vector<Benchmark::Instance>* benchmarks,
+ std::ostream* Err);
+
+ private:
+ BenchmarkFamilies() {}
+
+ std::vector<std::unique_ptr<Benchmark>> families_;
+ Mutex mutex_;
+};
+
+BenchmarkFamilies* BenchmarkFamilies::GetInstance() {
+ static BenchmarkFamilies instance;
+ return &instance;
+}
+
+size_t BenchmarkFamilies::AddBenchmark(std::unique_ptr<Benchmark> family) {
+ MutexLock l(mutex_);
+ size_t index = families_.size();
+ families_.push_back(std::move(family));
+ return index;
+}
+
+bool BenchmarkFamilies::FindBenchmarks(
+ const std::string& spec, std::vector<Benchmark::Instance>* benchmarks,
+ std::ostream* ErrStream) {
+ CHECK(ErrStream);
+ auto& Err = *ErrStream;
+ // Make regular expression out of command-line flag
+ std::string error_msg;
+ Regex re;
+ if (!re.Init(spec, &error_msg)) {
+ Err << "Could not compile benchmark re: " << error_msg << std::endl;
+ return false;
+ }
+
+ // Special list of thread counts to use when none are specified
+ const std::vector<int> one_thread = {1};
+
+ MutexLock l(mutex_);
+ for (std::unique_ptr<Benchmark>& family : families_) {
+ // Family was deleted or benchmark doesn't match
+ if (!family) continue;
+
+ if (family->ArgsCnt() == -1) {
+ family->Args({});
+ }
+ const std::vector<int>* thread_counts =
+ (family->thread_counts_.empty()
+ ? &one_thread
+ : &static_cast<const std::vector<int>&>(family->thread_counts_));
+ const size_t family_size = family->args_.size() * thread_counts->size();
+ // The benchmark will be run at least 'family_size' different inputs.
+ // If 'family_size' is very large warn the user.
+ if (family_size > kMaxFamilySize) {
+ Err << "The number of inputs is very large. " << family->name_
+ << " will be repeated at least " << family_size << " times.\n";
+ }
+ // reserve in the special case the regex ".", since we know the final
+ // family size.
+ if (spec == ".") benchmarks->reserve(family_size);
+
+ for (auto const& args : family->args_) {
+ for (int num_threads : *thread_counts) {
+ Benchmark::Instance instance;
+ instance.name = family->name_;
+ instance.benchmark = family.get();
+ instance.report_mode = family->report_mode_;
+ instance.arg = args;
+ instance.time_unit = family->time_unit_;
+ instance.range_multiplier = family->range_multiplier_;
+ instance.min_time = family->min_time_;
+ instance.iterations = family->iterations_;
+ instance.repetitions = family->repetitions_;
+ instance.use_real_time = family->use_real_time_;
+ instance.use_manual_time = family->use_manual_time_;
+ instance.complexity = family->complexity_;
+ instance.complexity_lambda = family->complexity_lambda_;
+ instance.threads = num_threads;
+
+ // Add arguments to instance name
+ size_t arg_i = 0;
+ for (auto const& arg : args) {
+ instance.name += "/";
+
+ if (arg_i < family->arg_names_.size()) {
+ const auto& arg_name = family->arg_names_[arg_i];
+ if (!arg_name.empty()) {
+ instance.name +=
+ StringPrintF("%s:", family->arg_names_[arg_i].c_str());
+ }
+ }
+
+ instance.name += std::to_string(arg);
+ ++arg_i;
+ }
+
+ if (!IsZero(family->min_time_))
+ instance.name += StringPrintF("/min_time:%0.3f", family->min_time_);
+ if (family->iterations_ != 0)
+ instance.name += StringPrintF("/iterations:%d", family->iterations_);
+ if (family->repetitions_ != 0)
+ instance.name += StringPrintF("/repeats:%d", family->repetitions_);
+
+ if (family->use_manual_time_) {
+ instance.name += "/manual_time";
+ } else if (family->use_real_time_) {
+ instance.name += "/real_time";
+ }
+
+ // Add the number of threads used to the name
+ if (!family->thread_counts_.empty()) {
+ instance.name += StringPrintF("/threads:%d", instance.threads);
+ }
+
+ if (re.Match(instance.name)) {
+ instance.last_benchmark_instance = (&args == &family->args_.back());
+ benchmarks->push_back(std::move(instance));
+ }
+ }
+ }
+ }
+ return true;
+}
+
+Benchmark* RegisterBenchmarkInternal(Benchmark* bench) {
+ std::unique_ptr<Benchmark> bench_ptr(bench);
+ BenchmarkFamilies* families = BenchmarkFamilies::GetInstance();
+ families->AddBenchmark(std::move(bench_ptr));
+ return bench;
+}
+
+// FIXME: This function is a hack so that benchmark.cc can access
+// `BenchmarkFamilies`
+bool FindBenchmarksInternal(const std::string& re,
+ std::vector<Benchmark::Instance>* benchmarks,
+ std::ostream* Err) {
+ return BenchmarkFamilies::GetInstance()->FindBenchmarks(re, benchmarks, Err);
+}
+
+//=============================================================================//
+// Benchmark
+//=============================================================================//
+
+Benchmark::Benchmark(const char* name)
+ : name_(name),
+ report_mode_(RM_Unspecified),
+ time_unit_(kNanosecond),
+ range_multiplier_(kRangeMultiplier),
+ min_time_(0),
+ iterations_(0),
+ repetitions_(0),
+ use_real_time_(false),
+ use_manual_time_(false),
+ complexity_(oNone),
+ complexity_lambda_(nullptr) {}
+
+Benchmark::~Benchmark() {}
+
+void Benchmark::AddRange(std::vector<int>* dst, int lo, int hi, int mult) {
+ CHECK_GE(lo, 0);
+ CHECK_GE(hi, lo);
+ CHECK_GE(mult, 2);
+
+ // Add "lo"
+ dst->push_back(lo);
+
+ static const int kint32max = std::numeric_limits<int32_t>::max();
+
+ // Now space out the benchmarks in multiples of "mult"
+ for (int32_t i = 1; i < kint32max / mult; i *= mult) {
+ if (i >= hi) break;
+ if (i > lo) {
+ dst->push_back(i);
+ }
+ }
+ // Add "hi" (if different from "lo")
+ if (hi != lo) {
+ dst->push_back(hi);
+ }
+}
+
+Benchmark* Benchmark::Arg(int x) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
+ args_.push_back({x});
+ return this;
+}
+
+Benchmark* Benchmark::Unit(TimeUnit unit) {
+ time_unit_ = unit;
+ return this;
+}
+
+Benchmark* Benchmark::Range(int start, int limit) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
+ std::vector<int> arglist;
+ AddRange(&arglist, start, limit, range_multiplier_);
+
+ for (int i : arglist) {
+ args_.push_back({i});
+ }
+ return this;
+}
+
+Benchmark* Benchmark::Ranges(const std::vector<std::pair<int, int>>& ranges) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(ranges.size()));
+ std::vector<std::vector<int>> arglists(ranges.size());
+ std::size_t total = 1;
+ for (std::size_t i = 0; i < ranges.size(); i++) {
+ AddRange(&arglists[i], ranges[i].first, ranges[i].second,
+ range_multiplier_);
+ total *= arglists[i].size();
+ }
+
+ std::vector<std::size_t> ctr(arglists.size(), 0);
+
+ for (std::size_t i = 0; i < total; i++) {
+ std::vector<int> tmp;
+ tmp.reserve(arglists.size());
+
+ for (std::size_t j = 0; j < arglists.size(); j++) {
+ tmp.push_back(arglists[j].at(ctr[j]));
+ }
+
+ args_.push_back(std::move(tmp));
+
+ for (std::size_t j = 0; j < arglists.size(); j++) {
+ if (ctr[j] + 1 < arglists[j].size()) {
+ ++ctr[j];
+ break;
+ }
+ ctr[j] = 0;
+ }
+ }
+ return this;
+}
+
+Benchmark* Benchmark::ArgName(const std::string& name) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
+ arg_names_ = {name};
+ return this;
+}
+
+Benchmark* Benchmark::ArgNames(const std::vector<std::string>& names) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(names.size()));
+ arg_names_ = names;
+ return this;
+}
+
+Benchmark* Benchmark::DenseRange(int start, int limit, int step) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == 1);
+ CHECK_GE(start, 0);
+ CHECK_LE(start, limit);
+ for (int arg = start; arg <= limit; arg += step) {
+ args_.push_back({arg});
+ }
+ return this;
+}
+
+Benchmark* Benchmark::Args(const std::vector<int>& args) {
+ CHECK(ArgsCnt() == -1 || ArgsCnt() == static_cast<int>(args.size()));
+ args_.push_back(args);
+ return this;
+}
+
+Benchmark* Benchmark::Apply(void (*custom_arguments)(Benchmark* benchmark)) {
+ custom_arguments(this);
+ return this;
+}
+
+Benchmark* Benchmark::RangeMultiplier(int multiplier) {
+ CHECK(multiplier > 1);
+ range_multiplier_ = multiplier;
+ return this;
+}
+
+
+Benchmark* Benchmark::MinTime(double t) {
+ CHECK(t > 0.0);
+ CHECK(iterations_ == 0);
+ min_time_ = t;
+ return this;
+}
+
+
+Benchmark* Benchmark::Iterations(size_t n) {
+ CHECK(n > 0);
+ CHECK(IsZero(min_time_));
+ iterations_ = n;
+ return this;
+}
+
+Benchmark* Benchmark::Repetitions(int n) {
+ CHECK(n > 0);
+ repetitions_ = n;
+ return this;
+}
+
+Benchmark* Benchmark::ReportAggregatesOnly(bool value) {
+ report_mode_ = value ? RM_ReportAggregatesOnly : RM_Default;
+ return this;
+}
+
+Benchmark* Benchmark::UseRealTime() {
+ CHECK(!use_manual_time_)
+ << "Cannot set UseRealTime and UseManualTime simultaneously.";
+ use_real_time_ = true;
+ return this;
+}
+
+Benchmark* Benchmark::UseManualTime() {
+ CHECK(!use_real_time_)
+ << "Cannot set UseRealTime and UseManualTime simultaneously.";
+ use_manual_time_ = true;
+ return this;
+}
+
+Benchmark* Benchmark::Complexity(BigO complexity) {
+ complexity_ = complexity;
+ return this;
+}
+
+Benchmark* Benchmark::Complexity(BigOFunc* complexity) {
+ complexity_lambda_ = complexity;
+ complexity_ = oLambda;
+ return this;
+}
+
+Benchmark* Benchmark::Threads(int t) {
+ CHECK_GT(t, 0);
+ thread_counts_.push_back(t);
+ return this;
+}
+
+Benchmark* Benchmark::ThreadRange(int min_threads, int max_threads) {
+ CHECK_GT(min_threads, 0);
+ CHECK_GE(max_threads, min_threads);
+
+ AddRange(&thread_counts_, min_threads, max_threads, 2);
+ return this;
+}
+
+Benchmark* Benchmark::DenseThreadRange(int min_threads, int max_threads,
+ int stride) {
+ CHECK_GT(min_threads, 0);
+ CHECK_GE(max_threads, min_threads);
+ CHECK_GE(stride, 1);
+
+ for (auto i = min_threads; i < max_threads; i += stride) {
+ thread_counts_.push_back(i);
+ }
+ thread_counts_.push_back(max_threads);
+ return this;
+}
+
+Benchmark* Benchmark::ThreadPerCpu() {
+ static int num_cpus = NumCPUs();
+ thread_counts_.push_back(num_cpus);
+ return this;
+}
+
+void Benchmark::SetName(const char* name) { name_ = name; }
+
+int Benchmark::ArgsCnt() const {
+ if (args_.empty()) {
+ if (arg_names_.empty()) return -1;
+ return static_cast<int>(arg_names_.size());
+ }
+ return static_cast<int>(args_.front().size());
+}
+
+//=============================================================================//
+// FunctionBenchmark
+//=============================================================================//
+
+void FunctionBenchmark::Run(State& st) { func_(st); }
+
+} // end namespace internal
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/check.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/check.h
new file mode 100644
index 00000000000..6f1fe0cf860
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/check.h
@@ -0,0 +1,71 @@
+#ifndef CHECK_H_
+#define CHECK_H_
+
+#include <cstdlib>
+#include <ostream>
+
+#include "internal_macros.h"
+#include "log.h"
+
+namespace benchmark {
+namespace internal {
+
+typedef void(AbortHandlerT)();
+
+inline AbortHandlerT*& GetAbortHandler() {
+ static AbortHandlerT* handler = &std::abort;
+ return handler;
+}
+
+BENCHMARK_NORETURN inline void CallAbortHandler() {
+ GetAbortHandler()();
+ std::abort(); // fallback to enforce noreturn
+}
+
+// CheckHandler is the class constructed by failing CHECK macros. CheckHandler
+// will log information about the failures and abort when it is destructed.
+class CheckHandler {
+ public:
+ CheckHandler(const char* check, const char* file, const char* func, int line)
+ : log_(GetErrorLogInstance()) {
+ log_ << file << ":" << line << ": " << func << ": Check `" << check
+ << "' failed. ";
+ }
+
+ LogType& GetLog() { return log_; }
+
+ BENCHMARK_NORETURN ~CheckHandler() BENCHMARK_NOEXCEPT_OP(false) {
+ log_ << std::endl;
+ CallAbortHandler();
+ }
+
+ CheckHandler& operator=(const CheckHandler&) = delete;
+ CheckHandler(const CheckHandler&) = delete;
+ CheckHandler() = delete;
+
+ private:
+ LogType& log_;
+};
+
+} // end namespace internal
+} // end namespace benchmark
+
+// The CHECK macro returns a std::ostream object that can have extra information
+// written to it.
+#ifndef NDEBUG
+#define CHECK(b) \
+ (b ? ::benchmark::internal::GetNullLogInstance() \
+ : ::benchmark::internal::CheckHandler(#b, __FILE__, __func__, __LINE__) \
+ .GetLog())
+#else
+#define CHECK(b) ::benchmark::internal::GetNullLogInstance()
+#endif
+
+#define CHECK_EQ(a, b) CHECK((a) == (b))
+#define CHECK_NE(a, b) CHECK((a) != (b))
+#define CHECK_GE(a, b) CHECK((a) >= (b))
+#define CHECK_LE(a, b) CHECK((a) <= (b))
+#define CHECK_GT(a, b) CHECK((a) > (b))
+#define CHECK_LT(a, b) CHECK((a) < (b))
+
+#endif // CHECK_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/colorprint.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/colorprint.cc
new file mode 100644
index 00000000000..513376b14b1
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/colorprint.cc
@@ -0,0 +1,188 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "colorprint.h"
+
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <memory>
+#include <string>
+
+#include "check.h"
+#include "internal_macros.h"
+
+#ifdef BENCHMARK_OS_WINDOWS
+#include <Windows.h>
+#include <io.h>
+#else
+#include <unistd.h>
+#endif // BENCHMARK_OS_WINDOWS
+
+namespace benchmark {
+namespace {
+#ifdef BENCHMARK_OS_WINDOWS
+typedef WORD PlatformColorCode;
+#else
+typedef const char* PlatformColorCode;
+#endif
+
+PlatformColorCode GetPlatformColorCode(LogColor color) {
+#ifdef BENCHMARK_OS_WINDOWS
+ switch (color) {
+ case COLOR_RED:
+ return FOREGROUND_RED;
+ case COLOR_GREEN:
+ return FOREGROUND_GREEN;
+ case COLOR_YELLOW:
+ return FOREGROUND_RED | FOREGROUND_GREEN;
+ case COLOR_BLUE:
+ return FOREGROUND_BLUE;
+ case COLOR_MAGENTA:
+ return FOREGROUND_BLUE | FOREGROUND_RED;
+ case COLOR_CYAN:
+ return FOREGROUND_BLUE | FOREGROUND_GREEN;
+ case COLOR_WHITE: // fall through to default
+ default:
+ return 0;
+ }
+#else
+ switch (color) {
+ case COLOR_RED:
+ return "1";
+ case COLOR_GREEN:
+ return "2";
+ case COLOR_YELLOW:
+ return "3";
+ case COLOR_BLUE:
+ return "4";
+ case COLOR_MAGENTA:
+ return "5";
+ case COLOR_CYAN:
+ return "6";
+ case COLOR_WHITE:
+ return "7";
+ default:
+ return nullptr;
+ };
+#endif
+}
+
+} // end namespace
+
+std::string FormatString(const char* msg, va_list args) {
+ // we might need a second shot at this, so pre-emptivly make a copy
+ va_list args_cp;
+ va_copy(args_cp, args);
+
+ std::size_t size = 256;
+ char local_buff[256];
+ auto ret = std::vsnprintf(local_buff, size, msg, args_cp);
+
+ va_end(args_cp);
+
+ // currently there is no error handling for failure, so this is hack.
+ CHECK(ret >= 0);
+
+ if (ret == 0) // handle empty expansion
+ return {};
+ else if (static_cast<size_t>(ret) < size)
+ return local_buff;
+ else {
+ // we did not provide a long enough buffer on our first attempt.
+ size = (size_t)ret + 1; // + 1 for the null byte
+ std::unique_ptr<char[]> buff(new char[size]);
+ ret = std::vsnprintf(buff.get(), size, msg, args);
+ CHECK(ret > 0 && ((size_t)ret) < size);
+ return buff.get();
+ }
+}
+
+std::string FormatString(const char* msg, ...) {
+ va_list args;
+ va_start(args, msg);
+ auto tmp = FormatString(msg, args);
+ va_end(args);
+ return tmp;
+}
+
+void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ ColorPrintf(out, color, fmt, args);
+ va_end(args);
+}
+
+void ColorPrintf(std::ostream& out, LogColor color, const char* fmt,
+ va_list args) {
+#ifdef BENCHMARK_OS_WINDOWS
+ ((void)out); // suppress unused warning
+
+ const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
+
+ // Gets the current text color.
+ CONSOLE_SCREEN_BUFFER_INFO buffer_info;
+ GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
+ const WORD old_color_attrs = buffer_info.wAttributes;
+
+ // We need to flush the stream buffers into the console before each
+ // SetConsoleTextAttribute call lest it affect the text that is already
+ // printed but has not yet reached the console.
+ fflush(stdout);
+ SetConsoleTextAttribute(stdout_handle,
+ GetPlatformColorCode(color) | FOREGROUND_INTENSITY);
+ vprintf(fmt, args);
+
+ fflush(stdout);
+ // Restores the text color.
+ SetConsoleTextAttribute(stdout_handle, old_color_attrs);
+#else
+ const char* color_code = GetPlatformColorCode(color);
+ if (color_code) out << FormatString("\033[0;3%sm", color_code);
+ out << FormatString(fmt, args) << "\033[m";
+#endif
+}
+
+bool IsColorTerminal() {
+#if BENCHMARK_OS_WINDOWS
+ // On Windows the TERM variable is usually not set, but the
+ // console there does support colors.
+ return 0 != _isatty(_fileno(stdout));
+#else
+ // On non-Windows platforms, we rely on the TERM variable. This list of
+ // supported TERM values is copied from Google Test:
+ // <https://github.com/google/googletest/blob/master/googletest/src/gtest.cc#L2925>.
+ const char* const SUPPORTED_TERM_VALUES[] = {
+ "xterm", "xterm-color", "xterm-256color",
+ "screen", "screen-256color", "tmux",
+ "tmux-256color", "rxvt-unicode", "rxvt-unicode-256color",
+ "linux", "cygwin",
+ };
+
+ const char* const term = getenv("TERM");
+
+ bool term_supports_color = false;
+ for (const char* candidate : SUPPORTED_TERM_VALUES) {
+ if (term && 0 == strcmp(term, candidate)) {
+ term_supports_color = true;
+ break;
+ }
+ }
+
+ return 0 != isatty(fileno(stdout)) && term_supports_color;
+#endif // BENCHMARK_OS_WINDOWS
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/colorprint.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/colorprint.h
new file mode 100644
index 00000000000..9f6fab9b342
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/colorprint.h
@@ -0,0 +1,33 @@
+#ifndef BENCHMARK_COLORPRINT_H_
+#define BENCHMARK_COLORPRINT_H_
+
+#include <cstdarg>
+#include <iostream>
+#include <string>
+
+namespace benchmark {
+enum LogColor {
+ COLOR_DEFAULT,
+ COLOR_RED,
+ COLOR_GREEN,
+ COLOR_YELLOW,
+ COLOR_BLUE,
+ COLOR_MAGENTA,
+ COLOR_CYAN,
+ COLOR_WHITE
+};
+
+std::string FormatString(const char* msg, va_list args);
+std::string FormatString(const char* msg, ...);
+
+void ColorPrintf(std::ostream& out, LogColor color, const char* fmt,
+ va_list args);
+void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, ...);
+
+// Returns true if stdout appears to be a terminal that supports colored
+// output, false otherwise.
+bool IsColorTerminal();
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_COLORPRINT_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/commandlineflags.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/commandlineflags.cc
new file mode 100644
index 00000000000..72534e022a8
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/commandlineflags.cc
@@ -0,0 +1,218 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "commandlineflags.h"
+
+#include <cctype>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <limits>
+
+namespace benchmark {
+// Parses 'str' for a 32-bit signed integer. If successful, writes
+// the result to *value and returns true; otherwise leaves *value
+// unchanged and returns false.
+bool ParseInt32(const std::string& src_text, const char* str, int32_t* value) {
+ // Parses the environment variable as a decimal integer.
+ char* end = nullptr;
+ const long long_value = strtol(str, &end, 10); // NOLINT
+
+ // Has strtol() consumed all characters in the string?
+ if (*end != '\0') {
+ // No - an invalid character was encountered.
+ std::cerr << src_text << " is expected to be a 32-bit integer, "
+ << "but actually has value \"" << str << "\".\n";
+ return false;
+ }
+
+ // Is the parsed value in the range of an Int32?
+ const int32_t result = static_cast<int32_t>(long_value);
+ if (long_value == std::numeric_limits<long>::max() ||
+ long_value == std::numeric_limits<long>::min() ||
+ // The parsed value overflows as a long. (strtol() returns
+ // LONG_MAX or LONG_MIN when the input overflows.)
+ result != long_value
+ // The parsed value overflows as an Int32.
+ ) {
+ std::cerr << src_text << " is expected to be a 32-bit integer, "
+ << "but actually has value \"" << str << "\", "
+ << "which overflows.\n";
+ return false;
+ }
+
+ *value = result;
+ return true;
+}
+
+// Parses 'str' for a double. If successful, writes the result to *value and
+// returns true; otherwise leaves *value unchanged and returns false.
+bool ParseDouble(const std::string& src_text, const char* str, double* value) {
+ // Parses the environment variable as a decimal integer.
+ char* end = nullptr;
+ const double double_value = strtod(str, &end); // NOLINT
+
+ // Has strtol() consumed all characters in the string?
+ if (*end != '\0') {
+ // No - an invalid character was encountered.
+ std::cerr << src_text << " is expected to be a double, "
+ << "but actually has value \"" << str << "\".\n";
+ return false;
+ }
+
+ *value = double_value;
+ return true;
+}
+
+// Returns the name of the environment variable corresponding to the
+// given flag. For example, FlagToEnvVar("foo") will return
+// "BENCHMARK_FOO" in the open-source version.
+static std::string FlagToEnvVar(const char* flag) {
+ const std::string flag_str(flag);
+
+ std::string env_var;
+ for (size_t i = 0; i != flag_str.length(); ++i)
+ env_var += static_cast<char>(::toupper(flag_str.c_str()[i]));
+
+ return "BENCHMARK_" + env_var;
+}
+
+// Reads and returns the Boolean environment variable corresponding to
+// the given flag; if it's not set, returns default_value.
+//
+// The value is considered true iff it's not "0".
+bool BoolFromEnv(const char* flag, bool default_value) {
+ const std::string env_var = FlagToEnvVar(flag);
+ const char* const string_value = getenv(env_var.c_str());
+ return string_value == nullptr ? default_value
+ : strcmp(string_value, "0") != 0;
+}
+
+// Reads and returns a 32-bit integer stored in the environment
+// variable corresponding to the given flag; if it isn't set or
+// doesn't represent a valid 32-bit integer, returns default_value.
+int32_t Int32FromEnv(const char* flag, int32_t default_value) {
+ const std::string env_var = FlagToEnvVar(flag);
+ const char* const string_value = getenv(env_var.c_str());
+ if (string_value == nullptr) {
+ // The environment variable is not set.
+ return default_value;
+ }
+
+ int32_t result = default_value;
+ if (!ParseInt32(std::string("Environment variable ") + env_var, string_value,
+ &result)) {
+ std::cout << "The default value " << default_value << " is used.\n";
+ return default_value;
+ }
+
+ return result;
+}
+
+// Reads and returns the string environment variable corresponding to
+// the given flag; if it's not set, returns default_value.
+const char* StringFromEnv(const char* flag, const char* default_value) {
+ const std::string env_var = FlagToEnvVar(flag);
+ const char* const value = getenv(env_var.c_str());
+ return value == nullptr ? default_value : value;
+}
+
+// Parses a string as a command line flag. The string should have
+// the format "--flag=value". When def_optional is true, the "=value"
+// part can be omitted.
+//
+// Returns the value of the flag, or nullptr if the parsing failed.
+const char* ParseFlagValue(const char* str, const char* flag,
+ bool def_optional) {
+ // str and flag must not be nullptr.
+ if (str == nullptr || flag == nullptr) return nullptr;
+
+ // The flag must start with "--".
+ const std::string flag_str = std::string("--") + std::string(flag);
+ const size_t flag_len = flag_str.length();
+ if (strncmp(str, flag_str.c_str(), flag_len) != 0) return nullptr;
+
+ // Skips the flag name.
+ const char* flag_end = str + flag_len;
+
+ // When def_optional is true, it's OK to not have a "=value" part.
+ if (def_optional && (flag_end[0] == '\0')) return flag_end;
+
+ // If def_optional is true and there are more characters after the
+ // flag name, or if def_optional is false, there must be a '=' after
+ // the flag name.
+ if (flag_end[0] != '=') return nullptr;
+
+ // Returns the string after "=".
+ return flag_end + 1;
+}
+
+bool ParseBoolFlag(const char* str, const char* flag, bool* value) {
+ // Gets the value of the flag as a string.
+ const char* const value_str = ParseFlagValue(str, flag, true);
+
+ // Aborts if the parsing failed.
+ if (value_str == nullptr) return false;
+
+ // Converts the string value to a bool.
+ *value = IsTruthyFlagValue(value_str);
+ return true;
+}
+
+bool ParseInt32Flag(const char* str, const char* flag, int32_t* value) {
+ // Gets the value of the flag as a string.
+ const char* const value_str = ParseFlagValue(str, flag, false);
+
+ // Aborts if the parsing failed.
+ if (value_str == nullptr) return false;
+
+ // Sets *value to the value of the flag.
+ return ParseInt32(std::string("The value of flag --") + flag, value_str,
+ value);
+}
+
+bool ParseDoubleFlag(const char* str, const char* flag, double* value) {
+ // Gets the value of the flag as a string.
+ const char* const value_str = ParseFlagValue(str, flag, false);
+
+ // Aborts if the parsing failed.
+ if (value_str == nullptr) return false;
+
+ // Sets *value to the value of the flag.
+ return ParseDouble(std::string("The value of flag --") + flag, value_str,
+ value);
+}
+
+bool ParseStringFlag(const char* str, const char* flag, std::string* value) {
+ // Gets the value of the flag as a string.
+ const char* const value_str = ParseFlagValue(str, flag, false);
+
+ // Aborts if the parsing failed.
+ if (value_str == nullptr) return false;
+
+ *value = value_str;
+ return true;
+}
+
+bool IsFlag(const char* str, const char* flag) {
+ return (ParseFlagValue(str, flag, true) != nullptr);
+}
+
+bool IsTruthyFlagValue(const std::string& str) {
+ if (str.empty()) return true;
+ char ch = str[0];
+ return isalnum(ch) &&
+ !(ch == '0' || ch == 'f' || ch == 'F' || ch == 'n' || ch == 'N');
+}
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/commandlineflags.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/commandlineflags.h
new file mode 100644
index 00000000000..945c9a9fc4a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/commandlineflags.h
@@ -0,0 +1,79 @@
+#ifndef BENCHMARK_COMMANDLINEFLAGS_H_
+#define BENCHMARK_COMMANDLINEFLAGS_H_
+
+#include <cstdint>
+#include <string>
+
+// Macro for referencing flags.
+#define FLAG(name) FLAGS_##name
+
+// Macros for declaring flags.
+#define DECLARE_bool(name) extern bool FLAG(name)
+#define DECLARE_int32(name) extern int32_t FLAG(name)
+#define DECLARE_int64(name) extern int64_t FLAG(name)
+#define DECLARE_double(name) extern double FLAG(name)
+#define DECLARE_string(name) extern std::string FLAG(name)
+
+// Macros for defining flags.
+#define DEFINE_bool(name, default_val, doc) bool FLAG(name) = (default_val)
+#define DEFINE_int32(name, default_val, doc) int32_t FLAG(name) = (default_val)
+#define DEFINE_int64(name, default_val, doc) int64_t FLAG(name) = (default_val)
+#define DEFINE_double(name, default_val, doc) double FLAG(name) = (default_val)
+#define DEFINE_string(name, default_val, doc) \
+ std::string FLAG(name) = (default_val)
+
+namespace benchmark {
+// Parses 'str' for a 32-bit signed integer. If successful, writes the result
+// to *value and returns true; otherwise leaves *value unchanged and returns
+// false.
+bool ParseInt32(const std::string& src_text, const char* str, int32_t* value);
+
+// Parses a bool/Int32/string from the environment variable
+// corresponding to the given Google Test flag.
+bool BoolFromEnv(const char* flag, bool default_val);
+int32_t Int32FromEnv(const char* flag, int32_t default_val);
+double DoubleFromEnv(const char* flag, double default_val);
+const char* StringFromEnv(const char* flag, const char* default_val);
+
+// Parses a string for a bool flag, in the form of either
+// "--flag=value" or "--flag".
+//
+// In the former case, the value is taken as true if it passes IsTruthyValue().
+//
+// In the latter case, the value is taken as true.
+//
+// On success, stores the value of the flag in *value, and returns
+// true. On failure, returns false without changing *value.
+bool ParseBoolFlag(const char* str, const char* flag, bool* value);
+
+// Parses a string for an Int32 flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true. On failure, returns false without changing *value.
+bool ParseInt32Flag(const char* str, const char* flag, int32_t* value);
+
+// Parses a string for a Double flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true. On failure, returns false without changing *value.
+bool ParseDoubleFlag(const char* str, const char* flag, double* value);
+
+// Parses a string for a string flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true. On failure, returns false without changing *value.
+bool ParseStringFlag(const char* str, const char* flag, std::string* value);
+
+// Returns true if the string matches the flag.
+bool IsFlag(const char* str, const char* flag);
+
+// Returns true unless value starts with one of: '0', 'f', 'F', 'n' or 'N', or
+// some non-alphanumeric character. As a special case, also returns true if
+// value is the empty string.
+bool IsTruthyFlagValue(const std::string& value);
+} // end namespace benchmark
+
+#endif // BENCHMARK_COMMANDLINEFLAGS_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/complexity.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/complexity.cc
new file mode 100644
index 00000000000..02adbef6292
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/complexity.cc
@@ -0,0 +1,324 @@
+// Copyright 2016 Ismael Jimenez Martinez. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Source project : https://github.com/ismaelJimenez/cpp.leastsq
+// Adapted to be used with google benchmark
+
+#include "benchmark/benchmark_api.h"
+
+#include <algorithm>
+#include <cmath>
+#include "check.h"
+#include "complexity.h"
+#include "stat.h"
+
+namespace benchmark {
+
+// Internal function to calculate the different scalability forms
+BigOFunc* FittingCurve(BigO complexity) {
+ switch (complexity) {
+ case oN:
+ return [](int n) -> double { return n; };
+ case oNSquared:
+ return [](int n) -> double { return std::pow(n, 2); };
+ case oNCubed:
+ return [](int n) -> double { return std::pow(n, 3); };
+ case oLogN:
+ return [](int n) { return std::log2(n); };
+ case oNLogN:
+ return [](int n) { return n * std::log2(n); };
+ case o1:
+ default:
+ return [](int) { return 1.0; };
+ }
+}
+
+// Function to return an string for the calculated complexity
+std::string GetBigOString(BigO complexity) {
+ switch (complexity) {
+ case oN:
+ return "N";
+ case oNSquared:
+ return "N^2";
+ case oNCubed:
+ return "N^3";
+ case oLogN:
+ return "lgN";
+ case oNLogN:
+ return "NlgN";
+ case o1:
+ return "(1)";
+ default:
+ return "f(N)";
+ }
+}
+
+// Find the coefficient for the high-order term in the running time, by
+// minimizing the sum of squares of relative error, for the fitting curve
+// given by the lambda expresion.
+// - n : Vector containing the size of the benchmark tests.
+// - time : Vector containing the times for the benchmark tests.
+// - fitting_curve : lambda expresion (e.g. [](int n) {return n; };).
+
+// For a deeper explanation on the algorithm logic, look the README file at
+// http://github.com/ismaelJimenez/Minimal-Cpp-Least-Squared-Fit
+
+LeastSq MinimalLeastSq(const std::vector<int>& n,
+ const std::vector<double>& time,
+ BigOFunc* fitting_curve) {
+ double sigma_gn = 0.0;
+ double sigma_gn_squared = 0.0;
+ double sigma_time = 0.0;
+ double sigma_time_gn = 0.0;
+
+ // Calculate least square fitting parameter
+ for (size_t i = 0; i < n.size(); ++i) {
+ double gn_i = fitting_curve(n[i]);
+ sigma_gn += gn_i;
+ sigma_gn_squared += gn_i * gn_i;
+ sigma_time += time[i];
+ sigma_time_gn += time[i] * gn_i;
+ }
+
+ LeastSq result;
+ result.complexity = oLambda;
+
+ // Calculate complexity.
+ result.coef = sigma_time_gn / sigma_gn_squared;
+
+ // Calculate RMS
+ double rms = 0.0;
+ for (size_t i = 0; i < n.size(); ++i) {
+ double fit = result.coef * fitting_curve(n[i]);
+ rms += pow((time[i] - fit), 2);
+ }
+
+ // Normalized RMS by the mean of the observed values
+ double mean = sigma_time / n.size();
+ result.rms = sqrt(rms / n.size()) / mean;
+
+ return result;
+}
+
+// Find the coefficient for the high-order term in the running time, by
+// minimizing the sum of squares of relative error.
+// - n : Vector containing the size of the benchmark tests.
+// - time : Vector containing the times for the benchmark tests.
+// - complexity : If different than oAuto, the fitting curve will stick to
+// this one. If it is oAuto, it will be calculated the best
+// fitting curve.
+LeastSq MinimalLeastSq(const std::vector<int>& n,
+ const std::vector<double>& time, const BigO complexity) {
+ CHECK_EQ(n.size(), time.size());
+ CHECK_GE(n.size(), 2); // Do not compute fitting curve is less than two
+ // benchmark runs are given
+ CHECK_NE(complexity, oNone);
+
+ LeastSq best_fit;
+
+ if (complexity == oAuto) {
+ std::vector<BigO> fit_curves = {oLogN, oN, oNLogN, oNSquared, oNCubed};
+
+ // Take o1 as default best fitting curve
+ best_fit = MinimalLeastSq(n, time, FittingCurve(o1));
+ best_fit.complexity = o1;
+
+ // Compute all possible fitting curves and stick to the best one
+ for (const auto& fit : fit_curves) {
+ LeastSq current_fit = MinimalLeastSq(n, time, FittingCurve(fit));
+ if (current_fit.rms < best_fit.rms) {
+ best_fit = current_fit;
+ best_fit.complexity = fit;
+ }
+ }
+ } else {
+ best_fit = MinimalLeastSq(n, time, FittingCurve(complexity));
+ best_fit.complexity = complexity;
+ }
+
+ return best_fit;
+}
+
+std::vector<BenchmarkReporter::Run> ComputeStats(
+ const std::vector<BenchmarkReporter::Run>& reports) {
+ typedef BenchmarkReporter::Run Run;
+ std::vector<Run> results;
+
+ auto error_count =
+ std::count_if(reports.begin(), reports.end(),
+ [](Run const& run) { return run.error_occurred; });
+
+ if (reports.size() - error_count < 2) {
+ // We don't report aggregated data if there was a single run.
+ return results;
+ }
+ // Accumulators.
+ Stat1_d real_accumulated_time_stat;
+ Stat1_d cpu_accumulated_time_stat;
+ Stat1_d bytes_per_second_stat;
+ Stat1_d items_per_second_stat;
+ // All repetitions should be run with the same number of iterations so we
+ // can take this information from the first benchmark.
+ int64_t const run_iterations = reports.front().iterations;
+ // create stats for user counters
+ struct CounterStat {
+ Counter c;
+ Stat1_d s;
+ };
+ std::map< std::string, CounterStat > counter_stats;
+ for(Run const& r : reports) {
+ for(auto const& cnt : r.counters) {
+ auto it = counter_stats.find(cnt.first);
+ if(it == counter_stats.end()) {
+ counter_stats.insert({cnt.first, {cnt.second, Stat1_d{}}});
+ } else {
+ CHECK_EQ(counter_stats[cnt.first].c.flags, cnt.second.flags);
+ }
+ }
+ }
+
+ // Populate the accumulators.
+ for (Run const& run : reports) {
+ CHECK_EQ(reports[0].benchmark_name, run.benchmark_name);
+ CHECK_EQ(run_iterations, run.iterations);
+ if (run.error_occurred) continue;
+ real_accumulated_time_stat +=
+ Stat1_d(run.real_accumulated_time / run.iterations, run.iterations);
+ cpu_accumulated_time_stat +=
+ Stat1_d(run.cpu_accumulated_time / run.iterations, run.iterations);
+ items_per_second_stat += Stat1_d(run.items_per_second, run.iterations);
+ bytes_per_second_stat += Stat1_d(run.bytes_per_second, run.iterations);
+ // user counters
+ for(auto const& cnt : run.counters) {
+ auto it = counter_stats.find(cnt.first);
+ CHECK_NE(it, counter_stats.end());
+ it->second.s += Stat1_d(cnt.second, run.iterations);
+ }
+ }
+
+ // Get the data from the accumulator to BenchmarkReporter::Run's.
+ Run mean_data;
+ mean_data.benchmark_name = reports[0].benchmark_name + "_mean";
+ mean_data.iterations = run_iterations;
+ mean_data.real_accumulated_time =
+ real_accumulated_time_stat.Mean() * run_iterations;
+ mean_data.cpu_accumulated_time =
+ cpu_accumulated_time_stat.Mean() * run_iterations;
+ mean_data.bytes_per_second = bytes_per_second_stat.Mean();
+ mean_data.items_per_second = items_per_second_stat.Mean();
+ mean_data.time_unit = reports[0].time_unit;
+ // user counters
+ for(auto const& kv : counter_stats) {
+ auto c = Counter(kv.second.s.Mean(), counter_stats[kv.first].c.flags);
+ mean_data.counters[kv.first] = c;
+ }
+
+ // Only add label to mean/stddev if it is same for all runs
+ mean_data.report_label = reports[0].report_label;
+ for (std::size_t i = 1; i < reports.size(); i++) {
+ if (reports[i].report_label != reports[0].report_label) {
+ mean_data.report_label = "";
+ break;
+ }
+ }
+
+ Run stddev_data;
+ stddev_data.benchmark_name = reports[0].benchmark_name + "_stddev";
+ stddev_data.report_label = mean_data.report_label;
+ stddev_data.iterations = 0;
+ stddev_data.real_accumulated_time = real_accumulated_time_stat.StdDev();
+ stddev_data.cpu_accumulated_time = cpu_accumulated_time_stat.StdDev();
+ stddev_data.bytes_per_second = bytes_per_second_stat.StdDev();
+ stddev_data.items_per_second = items_per_second_stat.StdDev();
+ stddev_data.time_unit = reports[0].time_unit;
+ // user counters
+ for(auto const& kv : counter_stats) {
+ auto c = Counter(kv.second.s.StdDev(), counter_stats[kv.first].c.flags);
+ stddev_data.counters[kv.first] = c;
+ }
+
+ results.push_back(mean_data);
+ results.push_back(stddev_data);
+ return results;
+}
+
+std::vector<BenchmarkReporter::Run> ComputeBigO(
+ const std::vector<BenchmarkReporter::Run>& reports) {
+ typedef BenchmarkReporter::Run Run;
+ std::vector<Run> results;
+
+ if (reports.size() < 2) return results;
+
+ // Accumulators.
+ std::vector<int> n;
+ std::vector<double> real_time;
+ std::vector<double> cpu_time;
+
+ // Populate the accumulators.
+ for (const Run& run : reports) {
+ CHECK_GT(run.complexity_n, 0) << "Did you forget to call SetComplexityN?";
+ n.push_back(run.complexity_n);
+ real_time.push_back(run.real_accumulated_time / run.iterations);
+ cpu_time.push_back(run.cpu_accumulated_time / run.iterations);
+ }
+
+ LeastSq result_cpu;
+ LeastSq result_real;
+
+ if (reports[0].complexity == oLambda) {
+ result_cpu = MinimalLeastSq(n, cpu_time, reports[0].complexity_lambda);
+ result_real = MinimalLeastSq(n, real_time, reports[0].complexity_lambda);
+ } else {
+ result_cpu = MinimalLeastSq(n, cpu_time, reports[0].complexity);
+ result_real = MinimalLeastSq(n, real_time, result_cpu.complexity);
+ }
+ std::string benchmark_name =
+ reports[0].benchmark_name.substr(0, reports[0].benchmark_name.find('/'));
+
+ // Get the data from the accumulator to BenchmarkReporter::Run's.
+ Run big_o;
+ big_o.benchmark_name = benchmark_name + "_BigO";
+ big_o.iterations = 0;
+ big_o.real_accumulated_time = result_real.coef;
+ big_o.cpu_accumulated_time = result_cpu.coef;
+ big_o.report_big_o = true;
+ big_o.complexity = result_cpu.complexity;
+
+ // All the time results are reported after being multiplied by the
+ // time unit multiplier. But since RMS is a relative quantity it
+ // should not be multiplied at all. So, here, we _divide_ it by the
+ // multiplier so that when it is multiplied later the result is the
+ // correct one.
+ double multiplier = GetTimeUnitMultiplier(reports[0].time_unit);
+
+ // Only add label to mean/stddev if it is same for all runs
+ Run rms;
+ big_o.report_label = reports[0].report_label;
+ rms.benchmark_name = benchmark_name + "_RMS";
+ rms.report_label = big_o.report_label;
+ rms.iterations = 0;
+ rms.real_accumulated_time = result_real.rms / multiplier;
+ rms.cpu_accumulated_time = result_cpu.rms / multiplier;
+ rms.report_rms = true;
+ rms.complexity = result_cpu.complexity;
+ // don't forget to keep the time unit, or we won't be able to
+ // recover the correct value.
+ rms.time_unit = reports[0].time_unit;
+
+ results.push_back(big_o);
+ results.push_back(rms);
+ return results;
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/complexity.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/complexity.h
new file mode 100644
index 00000000000..23cd9bbc8c7
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/complexity.h
@@ -0,0 +1,61 @@
+// Copyright 2016 Ismael Jimenez Martinez. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Source project : https://github.com/ismaelJimenez/cpp.leastsq
+// Adapted to be used with google benchmark
+
+#ifndef COMPLEXITY_H_
+#define COMPLEXITY_H_
+
+#include <string>
+#include <vector>
+
+#include "benchmark/benchmark_api.h"
+#include "benchmark/reporter.h"
+
+namespace benchmark {
+
+// Return a vector containing the mean and standard devation information for
+// the specified list of reports. If 'reports' contains less than two
+// non-errored runs an empty vector is returned
+std::vector<BenchmarkReporter::Run> ComputeStats(
+ const std::vector<BenchmarkReporter::Run>& reports);
+
+// Return a vector containing the bigO and RMS information for the specified
+// list of reports. If 'reports.size() < 2' an empty vector is returned.
+std::vector<BenchmarkReporter::Run> ComputeBigO(
+ const std::vector<BenchmarkReporter::Run>& reports);
+
+// This data structure will contain the result returned by MinimalLeastSq
+// - coef : Estimated coeficient for the high-order term as
+// interpolated from data.
+// - rms : Normalized Root Mean Squared Error.
+// - complexity : Scalability form (e.g. oN, oNLogN). In case a scalability
+// form has been provided to MinimalLeastSq this will return
+// the same value. In case BigO::oAuto has been selected, this
+// parameter will return the best fitting curve detected.
+
+struct LeastSq {
+ LeastSq() : coef(0.0), rms(0.0), complexity(oNone) {}
+
+ double coef;
+ double rms;
+ BigO complexity;
+};
+
+// Function to return an string for the calculated complexity
+std::string GetBigOString(BigO complexity);
+
+} // end namespace benchmark
+#endif // COMPLEXITY_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/console_reporter.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/console_reporter.cc
new file mode 100644
index 00000000000..3f3de02945a
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/console_reporter.cc
@@ -0,0 +1,155 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/reporter.h"
+#include "complexity.h"
+#include "counter.h"
+
+#include <algorithm>
+#include <cstdint>
+#include <cstdio>
+#include <iostream>
+#include <string>
+#include <tuple>
+#include <vector>
+
+#include "check.h"
+#include "colorprint.h"
+#include "commandlineflags.h"
+#include "internal_macros.h"
+#include "string_util.h"
+#include "timers.h"
+
+namespace benchmark {
+
+bool ConsoleReporter::ReportContext(const Context& context) {
+ name_field_width_ = context.name_field_width;
+ printed_header_ = false;
+
+ PrintBasicContext(&GetErrorStream(), context);
+
+#ifdef BENCHMARK_OS_WINDOWS
+ if (color_output_ && &std::cout != &GetOutputStream()) {
+ GetErrorStream()
+ << "Color printing is only supported for stdout on windows."
+ " Disabling color printing\n";
+ color_output_ = false;
+ }
+#endif
+
+ return true;
+}
+
+void ConsoleReporter::PrintHeader(const Run& run) {
+ std::string str =
+ FormatString("%-*s %13s %13s %10s\n", static_cast<int>(name_field_width_),
+ "Benchmark", "Time", "CPU", "Iterations");
+ if(!run.counters.empty()) {
+ str += " UserCounters...";
+ }
+ std::string line = std::string(str.length(), '-');
+ GetOutputStream() << line << "\n" << str << line << "\n";
+}
+
+void ConsoleReporter::ReportRuns(const std::vector<Run>& reports) {
+ for (const auto& run : reports) {
+ // print the header if none was printed yet
+ if (!printed_header_) {
+ printed_header_ = true;
+ PrintHeader(run);
+ }
+ // As an alternative to printing the headers like this, we could sort
+ // the benchmarks by header and then print like that.
+ PrintRunData(run);
+ }
+}
+
+static void IgnoreColorPrint(std::ostream& out, LogColor, const char* fmt,
+ ...) {
+ va_list args;
+ va_start(args, fmt);
+ out << FormatString(fmt, args);
+ va_end(args);
+}
+
+void ConsoleReporter::PrintRunData(const Run& result) {
+ typedef void(PrinterFn)(std::ostream&, LogColor, const char*, ...);
+ auto& Out = GetOutputStream();
+ PrinterFn* printer =
+ color_output_ ? (PrinterFn*)ColorPrintf : IgnoreColorPrint;
+ auto name_color =
+ (result.report_big_o || result.report_rms) ? COLOR_BLUE : COLOR_GREEN;
+ printer(Out, name_color, "%-*s ", name_field_width_,
+ result.benchmark_name.c_str());
+
+ if (result.error_occurred) {
+ printer(Out, COLOR_RED, "ERROR OCCURRED: \'%s\'",
+ result.error_message.c_str());
+ printer(Out, COLOR_DEFAULT, "\n");
+ return;
+ }
+ // Format bytes per second
+ std::string rate;
+ if (result.bytes_per_second > 0) {
+ rate = StrCat(" ", HumanReadableNumber(result.bytes_per_second), "B/s");
+ }
+
+ // Format items per second
+ std::string items;
+ if (result.items_per_second > 0) {
+ items =
+ StrCat(" ", HumanReadableNumber(result.items_per_second), " items/s");
+ }
+
+ const double real_time = result.GetAdjustedRealTime();
+ const double cpu_time = result.GetAdjustedCPUTime();
+
+ if (result.report_big_o) {
+ std::string big_o = GetBigOString(result.complexity);
+ printer(Out, COLOR_YELLOW, "%10.2f %s %10.2f %s ", real_time, big_o.c_str(),
+ cpu_time, big_o.c_str());
+ } else if (result.report_rms) {
+ printer(Out, COLOR_YELLOW, "%10.0f %% %10.0f %% ", real_time * 100,
+ cpu_time * 100);
+ } else {
+ const char* timeLabel = GetTimeUnitString(result.time_unit);
+ printer(Out, COLOR_YELLOW, "%10.0f %s %10.0f %s ", real_time, timeLabel,
+ cpu_time, timeLabel);
+ }
+
+ if (!result.report_big_o && !result.report_rms) {
+ printer(Out, COLOR_CYAN, "%10lld", result.iterations);
+ }
+
+ for (auto& c : result.counters) {
+ auto const& s = HumanReadableNumber(c.second.value);
+ printer(Out, COLOR_DEFAULT, " %s=%s", c.first.c_str(), s.c_str());
+ }
+
+ if (!rate.empty()) {
+ printer(Out, COLOR_DEFAULT, " %*s", 13, rate.c_str());
+ }
+
+ if (!items.empty()) {
+ printer(Out, COLOR_DEFAULT, " %*s", 18, items.c_str());
+ }
+
+ if (!result.report_label.empty()) {
+ printer(Out, COLOR_DEFAULT, " %s", result.report_label.c_str());
+ }
+
+ printer(Out, COLOR_DEFAULT, "\n");
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/counter.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/counter.cc
new file mode 100644
index 00000000000..307863d3c4d
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/counter.cc
@@ -0,0 +1,68 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "counter.h"
+
+namespace benchmark {
+namespace internal {
+
+double Finish(Counter const& c, double cpu_time, double num_threads) {
+ double v = c.value;
+ if (c.flags & Counter::kIsRate) {
+ v /= cpu_time;
+ }
+ if (c.flags & Counter::kAvgThreads) {
+ v /= num_threads;
+ }
+ return v;
+}
+
+void Finish(UserCounters *l, double cpu_time, double num_threads) {
+ for (auto &c : *l) {
+ c.second = Finish(c.second, cpu_time, num_threads);
+ }
+}
+
+void Increment(UserCounters *l, UserCounters const& r) {
+ // add counters present in both or just in *l
+ for (auto &c : *l) {
+ auto it = r.find(c.first);
+ if (it != r.end()) {
+ c.second = c.second + it->second;
+ }
+ }
+ // add counters present in r, but not in *l
+ for (auto const &tc : r) {
+ auto it = l->find(tc.first);
+ if (it == l->end()) {
+ (*l)[tc.first] = tc.second;
+ }
+ }
+}
+
+bool SameNames(UserCounters const& l, UserCounters const& r) {
+ if (&l == &r) return true;
+ if (l.size() != r.size()) {
+ return false;
+ }
+ for (auto const& c : l) {
+ if ( r.find(c.first) == r.end()) {
+ return false;
+ }
+ }
+ return true;
+}
+
+} // end namespace internal
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/counter.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/counter.h
new file mode 100644
index 00000000000..bbb92d9a298
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/counter.h
@@ -0,0 +1,26 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/benchmark_api.h"
+
+namespace benchmark {
+
+// these counter-related functions are hidden to reduce API surface.
+namespace internal {
+void Finish(UserCounters *l, double time, double num_threads);
+void Increment(UserCounters *l, UserCounters const& r);
+bool SameNames(UserCounters const& l, UserCounters const& r);
+} // end namespace internal
+
+} //end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/csv_reporter.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/csv_reporter.cc
new file mode 100644
index 00000000000..6779815b3c3
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/csv_reporter.cc
@@ -0,0 +1,146 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/reporter.h"
+#include "complexity.h"
+
+#include <algorithm>
+#include <cstdint>
+#include <iostream>
+#include <string>
+#include <tuple>
+#include <vector>
+
+#include "string_util.h"
+#include "timers.h"
+#include "check.h"
+
+// File format reference: http://edoceo.com/utilitas/csv-file-format.
+
+namespace benchmark {
+
+namespace {
+std::vector<std::string> elements = {
+ "name", "iterations", "real_time", "cpu_time",
+ "time_unit", "bytes_per_second", "items_per_second", "label",
+ "error_occurred", "error_message"};
+}
+
+bool CSVReporter::ReportContext(const Context& context) {
+ PrintBasicContext(&GetErrorStream(), context);
+ return true;
+}
+
+void CSVReporter::ReportRuns(const std::vector<Run> & reports) {
+ std::ostream& Out = GetOutputStream();
+
+ if (!printed_header_) {
+ // save the names of all the user counters
+ for (const auto& run : reports) {
+ for (const auto& cnt : run.counters) {
+ user_counter_names_.insert(cnt.first);
+ }
+ }
+
+ // print the header
+ for (auto B = elements.begin(); B != elements.end();) {
+ Out << *B++;
+ if (B != elements.end()) Out << ",";
+ }
+ for (auto B = user_counter_names_.begin(); B != user_counter_names_.end();) {
+ Out << ",\"" << *B++ << "\"";
+ }
+ Out << "\n";
+
+ printed_header_ = true;
+ } else {
+ // check that all the current counters are saved in the name set
+ for (const auto& run : reports) {
+ for (const auto& cnt : run.counters) {
+ CHECK(user_counter_names_.find(cnt.first) != user_counter_names_.end())
+ << "All counters must be present in each run. "
+ << "Counter named \"" << cnt.first
+ << "\" was not in a run after being added to the header";
+ }
+ }
+ }
+
+ // print results for each run
+ for (const auto& run : reports) {
+ PrintRunData(run);
+ }
+
+}
+
+void CSVReporter::PrintRunData(const Run & run) {
+ std::ostream& Out = GetOutputStream();
+
+ // Field with embedded double-quote characters must be doubled and the field
+ // delimited with double-quotes.
+ std::string name = run.benchmark_name;
+ ReplaceAll(&name, "\"", "\"\"");
+ Out << '"' << name << "\",";
+ if (run.error_occurred) {
+ Out << std::string(elements.size() - 3, ',');
+ Out << "true,";
+ std::string msg = run.error_message;
+ ReplaceAll(&msg, "\"", "\"\"");
+ Out << '"' << msg << "\"\n";
+ return;
+ }
+
+ // Do not print iteration on bigO and RMS report
+ if (!run.report_big_o && !run.report_rms) {
+ Out << run.iterations;
+ }
+ Out << ",";
+
+ Out << run.GetAdjustedRealTime() << ",";
+ Out << run.GetAdjustedCPUTime() << ",";
+
+ // Do not print timeLabel on bigO and RMS report
+ if (run.report_big_o) {
+ Out << GetBigOString(run.complexity);
+ } else if (!run.report_rms) {
+ Out << GetTimeUnitString(run.time_unit);
+ }
+ Out << ",";
+
+ if (run.bytes_per_second > 0.0) {
+ Out << run.bytes_per_second;
+ }
+ Out << ",";
+ if (run.items_per_second > 0.0) {
+ Out << run.items_per_second;
+ }
+ Out << ",";
+ if (!run.report_label.empty()) {
+ // Field with embedded double-quote characters must be doubled and the field
+ // delimited with double-quotes.
+ std::string label = run.report_label;
+ ReplaceAll(&label, "\"", "\"\"");
+ Out << "\"" << label << "\"";
+ }
+ Out << ",,"; // for error_occurred and error_message
+
+ // Print user counters
+ for (const auto &ucn : user_counter_names_) {
+ auto it = run.counters.find(ucn);
+ CHECK(it != run.counters.end());
+ Out << "," << it->second;
+ }
+ Out << '\n';
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/cycleclock.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/cycleclock.h
new file mode 100644
index 00000000000..e0f9b01f9d3
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/cycleclock.h
@@ -0,0 +1,172 @@
+// ----------------------------------------------------------------------
+// CycleClock
+// A CycleClock tells you the current time in Cycles. The "time"
+// is actually time since power-on. This is like time() but doesn't
+// involve a system call and is much more precise.
+//
+// NOTE: Not all cpu/platform/kernel combinations guarantee that this
+// clock increments at a constant rate or is synchronized across all logical
+// cpus in a system.
+//
+// If you need the above guarantees, please consider using a different
+// API. There are efforts to provide an interface which provides a millisecond
+// granularity and implemented as a memory read. A memory read is generally
+// cheaper than the CycleClock for many architectures.
+//
+// Also, in some out of order CPU implementations, the CycleClock is not
+// serializing. So if you're trying to count at cycles granularity, your
+// data might be inaccurate due to out of order instruction execution.
+// ----------------------------------------------------------------------
+
+#ifndef BENCHMARK_CYCLECLOCK_H_
+#define BENCHMARK_CYCLECLOCK_H_
+
+#include <cstdint>
+
+#include "benchmark/macros.h"
+#include "internal_macros.h"
+
+#if defined(BENCHMARK_OS_MACOSX)
+#include <mach/mach_time.h>
+#endif
+// For MSVC, we want to use '_asm rdtsc' when possible (since it works
+// with even ancient MSVC compilers), and when not possible the
+// __rdtsc intrinsic, declared in <intrin.h>. Unfortunately, in some
+// environments, <windows.h> and <intrin.h> have conflicting
+// declarations of some other intrinsics, breaking compilation.
+// Therefore, we simply declare __rdtsc ourselves. See also
+// http://connect.microsoft.com/VisualStudio/feedback/details/262047
+#if defined(COMPILER_MSVC) && !defined(_M_IX86)
+extern "C" uint64_t __rdtsc();
+#pragma intrinsic(__rdtsc)
+#endif
+
+#ifndef BENCHMARK_OS_WINDOWS
+#include <sys/time.h>
+#include <time.h>
+#endif
+
+#ifdef BENCHMARK_OS_EMSCRIPTEN
+#include <emscripten.h>
+#endif
+
+namespace benchmark {
+// NOTE: only i386 and x86_64 have been well tested.
+// PPC, sparc, alpha, and ia64 are based on
+// http://peter.kuscsik.com/wordpress/?p=14
+// with modifications by m3b. See also
+// https://setisvn.ssl.berkeley.edu/svn/lib/fftw-3.0.1/kernel/cycle.h
+namespace cycleclock {
+// This should return the number of cycles since power-on. Thread-safe.
+inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
+#if defined(BENCHMARK_OS_MACOSX)
+ // this goes at the top because we need ALL Macs, regardless of
+ // architecture, to return the number of "mach time units" that
+ // have passed since startup. See sysinfo.cc where
+ // InitializeSystemInfo() sets the supposed cpu clock frequency of
+ // macs to the number of mach time units per second, not actual
+ // CPU clock frequency (which can change in the face of CPU
+ // frequency scaling). Also note that when the Mac sleeps, this
+ // counter pauses; it does not continue counting, nor does it
+ // reset to zero.
+ return mach_absolute_time();
+#elif defined(BENCHMARK_OS_EMSCRIPTEN)
+ // this goes above x86-specific code because old versions of Emscripten
+ // define __x86_64__, although they have nothing to do with it.
+ return static_cast<int64_t>(emscripten_get_now() * 1e+6);
+#elif defined(__i386__)
+ int64_t ret;
+ __asm__ volatile("rdtsc" : "=A"(ret));
+ return ret;
+#elif defined(__x86_64__) || defined(__amd64__)
+ uint64_t low, high;
+ __asm__ volatile("rdtsc" : "=a"(low), "=d"(high));
+ return (high << 32) | low;
+#elif defined(__powerpc__) || defined(__ppc__)
+ // This returns a time-base, which is not always precisely a cycle-count.
+ int64_t tbl, tbu0, tbu1;
+ asm("mftbu %0" : "=r"(tbu0));
+ asm("mftb %0" : "=r"(tbl));
+ asm("mftbu %0" : "=r"(tbu1));
+ tbl &= -static_cast<int64_t>(tbu0 == tbu1);
+ // high 32 bits in tbu1; low 32 bits in tbl (tbu0 is garbage)
+ return (tbu1 << 32) | tbl;
+#elif defined(__sparc__)
+ int64_t tick;
+ asm(".byte 0x83, 0x41, 0x00, 0x00");
+ asm("mov %%g1, %0" : "=r"(tick));
+ return tick;
+#elif defined(__ia64__)
+ int64_t itc;
+ asm("mov %0 = ar.itc" : "=r"(itc));
+ return itc;
+#elif defined(COMPILER_MSVC) && defined(_M_IX86)
+ // Older MSVC compilers (like 7.x) don't seem to support the
+ // __rdtsc intrinsic properly, so I prefer to use _asm instead
+ // when I know it will work. Otherwise, I'll use __rdtsc and hope
+ // the code is being compiled with a non-ancient compiler.
+ _asm rdtsc
+#elif defined(COMPILER_MSVC)
+ return __rdtsc();
+#elif defined(BENCHMARK_OS_NACL)
+ // Native Client validator on x86/x86-64 allows RDTSC instructions,
+ // and this case is handled above. Native Client validator on ARM
+ // rejects MRC instructions (used in the ARM-specific sequence below),
+ // so we handle it here. Portable Native Client compiles to
+ // architecture-agnostic bytecode, which doesn't provide any
+ // cycle counter access mnemonics.
+
+ // Native Client does not provide any API to access cycle counter.
+ // Use clock_gettime(CLOCK_MONOTONIC, ...) instead of gettimeofday
+ // because is provides nanosecond resolution (which is noticable at
+ // least for PNaCl modules running on x86 Mac & Linux).
+ // Initialize to always return 0 if clock_gettime fails.
+ struct timespec ts = { 0, 0 };
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return static_cast<int64_t>(ts.tv_sec) * 1000000000 + ts.tv_nsec;
+#elif defined(__aarch64__)
+ // System timer of ARMv8 runs at a different frequency than the CPU's.
+ // The frequency is fixed, typically in the range 1-50MHz. It can be
+ // read at CNTFRQ special register. We assume the OS has set up
+ // the virtual timer properly.
+ int64_t virtual_timer_value;
+ asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
+ return virtual_timer_value;
+#elif defined(__ARM_ARCH)
+ // V6 is the earliest arch that has a standard cyclecount
+ // Native Client validator doesn't allow MRC instructions.
+#if (__ARM_ARCH >= 6)
+ uint32_t pmccntr;
+ uint32_t pmuseren;
+ uint32_t pmcntenset;
+ // Read the user mode perf monitor counter access permissions.
+ asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren));
+ if (pmuseren & 1) { // Allows reading perfmon counters for user mode code.
+ asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset));
+ if (pmcntenset & 0x80000000ul) { // Is it counting?
+ asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));
+ // The counter is set up to count every 64th cycle
+ return static_cast<int64_t>(pmccntr) * 64; // Should optimize to << 6
+ }
+ }
+#endif
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
+#elif defined(__mips__)
+ // mips apparently only allows rdtsc for superusers, so we fall
+ // back to gettimeofday. It's possible clock_gettime would be better.
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
+#else
+// The soft failover to a generic implementation is automatic only for ARM.
+// For other platforms the developer is expected to make an attempt to create
+// a fast implementation and use generic version if nothing better is available.
+#error You need to define CycleTimer for your OS and CPU
+#endif
+}
+} // end namespace cycleclock
+} // end namespace benchmark
+
+#endif // BENCHMARK_CYCLECLOCK_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/internal_macros.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/internal_macros.h
new file mode 100644
index 00000000000..ab9dd85c102
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/internal_macros.h
@@ -0,0 +1,55 @@
+#ifndef BENCHMARK_INTERNAL_MACROS_H_
+#define BENCHMARK_INTERNAL_MACROS_H_
+
+#include "benchmark/macros.h"
+
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+
+#if defined(__clang__)
+#define COMPILER_CLANG
+#elif defined(_MSC_VER)
+#define COMPILER_MSVC
+#elif defined(__GNUC__)
+#define COMPILER_GCC
+#endif
+
+#if __has_feature(cxx_attributes)
+#define BENCHMARK_NORETURN [[noreturn]]
+#elif defined(__GNUC__)
+#define BENCHMARK_NORETURN __attribute__((noreturn))
+#elif defined(COMPILER_MSVC)
+#define BENCHMARK_NORETURN __declspec(noreturn)
+#else
+#define BENCHMARK_NORETURN
+#endif
+
+#if defined(__CYGWIN__)
+#define BENCHMARK_OS_CYGWIN 1
+#elif defined(_WIN32)
+#define BENCHMARK_OS_WINDOWS 1
+#elif defined(__APPLE__)
+#include "TargetConditionals.h"
+ #if defined(TARGET_OS_MAC)
+ #define BENCHMARK_OS_MACOSX 1
+ #if defined(TARGET_OS_IPHONE)
+ #define BENCHMARK_OS_IOS 1
+ #endif
+ #endif
+#elif defined(__FreeBSD__)
+#define BENCHMARK_OS_FREEBSD 1
+#elif defined(__linux__)
+#define BENCHMARK_OS_LINUX 1
+#elif defined(__native_client__)
+#define BENCHMARK_OS_NACL 1
+#elif defined(EMSCRIPTEN)
+#define BENCHMARK_OS_EMSCRIPTEN 1
+#endif
+
+#if !__has_feature(cxx_exceptions) && !defined(__cpp_exceptions) \
+ && !defined(__EXCEPTIONS)
+#define BENCHMARK_HAS_NO_EXCEPTIONS
+#endif
+
+#endif // BENCHMARK_INTERNAL_MACROS_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/json_reporter.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/json_reporter.cc
new file mode 100644
index 00000000000..5a653088e5b
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/json_reporter.cc
@@ -0,0 +1,168 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/reporter.h"
+#include "complexity.h"
+
+#include <algorithm>
+#include <cstdint>
+#include <iostream>
+#include <string>
+#include <tuple>
+#include <vector>
+
+#include "string_util.h"
+#include "timers.h"
+
+namespace benchmark {
+
+namespace {
+
+std::string FormatKV(std::string const& key, std::string const& value) {
+ return StringPrintF("\"%s\": \"%s\"", key.c_str(), value.c_str());
+}
+
+std::string FormatKV(std::string const& key, const char* value) {
+ return StringPrintF("\"%s\": \"%s\"", key.c_str(), value);
+}
+
+std::string FormatKV(std::string const& key, bool value) {
+ return StringPrintF("\"%s\": %s", key.c_str(), value ? "true" : "false");
+}
+
+std::string FormatKV(std::string const& key, int64_t value) {
+ std::stringstream ss;
+ ss << '"' << key << "\": " << value;
+ return ss.str();
+}
+
+std::string FormatKV(std::string const& key, double value) {
+ return StringPrintF("\"%s\": %.2f", key.c_str(), value);
+}
+
+int64_t RoundDouble(double v) { return static_cast<int64_t>(v + 0.5); }
+
+} // end namespace
+
+bool JSONReporter::ReportContext(const Context& context) {
+ std::ostream& out = GetOutputStream();
+
+ out << "{\n";
+ std::string inner_indent(2, ' ');
+
+ // Open context block and print context information.
+ out << inner_indent << "\"context\": {\n";
+ std::string indent(4, ' ');
+
+ std::string walltime_value = LocalDateTimeString();
+ out << indent << FormatKV("date", walltime_value) << ",\n";
+
+ out << indent << FormatKV("num_cpus", static_cast<int64_t>(context.num_cpus))
+ << ",\n";
+ out << indent << FormatKV("mhz_per_cpu", RoundDouble(context.mhz_per_cpu))
+ << ",\n";
+ out << indent << FormatKV("cpu_scaling_enabled", context.cpu_scaling_enabled)
+ << ",\n";
+
+#if defined(NDEBUG)
+ const char build_type[] = "release";
+#else
+ const char build_type[] = "debug";
+#endif
+ out << indent << FormatKV("library_build_type", build_type) << "\n";
+ // Close context block and open the list of benchmarks.
+ out << inner_indent << "},\n";
+ out << inner_indent << "\"benchmarks\": [\n";
+ return true;
+}
+
+void JSONReporter::ReportRuns(std::vector<Run> const& reports) {
+ if (reports.empty()) {
+ return;
+ }
+ std::string indent(4, ' ');
+ std::ostream& out = GetOutputStream();
+ if (!first_report_) {
+ out << ",\n";
+ }
+ first_report_ = false;
+
+ for (auto it = reports.begin(); it != reports.end(); ++it) {
+ out << indent << "{\n";
+ PrintRunData(*it);
+ out << indent << '}';
+ auto it_cp = it;
+ if (++it_cp != reports.end()) {
+ out << ",\n";
+ }
+ }
+}
+
+void JSONReporter::Finalize() {
+ // Close the list of benchmarks and the top level object.
+ GetOutputStream() << "\n ]\n}\n";
+}
+
+void JSONReporter::PrintRunData(Run const& run) {
+ std::string indent(6, ' ');
+ std::ostream& out = GetOutputStream();
+ out << indent << FormatKV("name", run.benchmark_name) << ",\n";
+ if (run.error_occurred) {
+ out << indent << FormatKV("error_occurred", run.error_occurred) << ",\n";
+ out << indent << FormatKV("error_message", run.error_message) << ",\n";
+ }
+ if (!run.report_big_o && !run.report_rms) {
+ out << indent << FormatKV("iterations", run.iterations) << ",\n";
+ out << indent
+ << FormatKV("real_time", RoundDouble(run.GetAdjustedRealTime()))
+ << ",\n";
+ out << indent
+ << FormatKV("cpu_time", RoundDouble(run.GetAdjustedCPUTime()));
+ out << ",\n"
+ << indent << FormatKV("time_unit", GetTimeUnitString(run.time_unit));
+ } else if (run.report_big_o) {
+ out << indent
+ << FormatKV("cpu_coefficient", RoundDouble(run.GetAdjustedCPUTime()))
+ << ",\n";
+ out << indent
+ << FormatKV("real_coefficient", RoundDouble(run.GetAdjustedRealTime()))
+ << ",\n";
+ out << indent << FormatKV("big_o", GetBigOString(run.complexity)) << ",\n";
+ out << indent << FormatKV("time_unit", GetTimeUnitString(run.time_unit));
+ } else if (run.report_rms) {
+ out << indent
+ << FormatKV("rms", run.GetAdjustedCPUTime());
+ }
+ if (run.bytes_per_second > 0.0) {
+ out << ",\n"
+ << indent
+ << FormatKV("bytes_per_second", RoundDouble(run.bytes_per_second));
+ }
+ if (run.items_per_second > 0.0) {
+ out << ",\n"
+ << indent
+ << FormatKV("items_per_second", RoundDouble(run.items_per_second));
+ }
+ for(auto &c : run.counters) {
+ out << ",\n"
+ << indent
+ << FormatKV(c.first, RoundDouble(c.second));
+ }
+ if (!run.report_label.empty()) {
+ out << ",\n" << indent << FormatKV("label", run.report_label);
+ }
+ out << '\n';
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/log.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/log.h
new file mode 100644
index 00000000000..978cb0b4c8c
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/log.h
@@ -0,0 +1,73 @@
+#ifndef BENCHMARK_LOG_H_
+#define BENCHMARK_LOG_H_
+
+#include <iostream>
+#include <ostream>
+
+#include "benchmark/macros.h"
+
+namespace benchmark {
+namespace internal {
+
+typedef std::basic_ostream<char>&(EndLType)(std::basic_ostream<char>&);
+
+class LogType {
+ friend LogType& GetNullLogInstance();
+ friend LogType& GetErrorLogInstance();
+
+ // FIXME: Add locking to output.
+ template <class Tp>
+ friend LogType& operator<<(LogType&, Tp const&);
+ friend LogType& operator<<(LogType&, EndLType*);
+
+ private:
+ LogType(std::ostream* out) : out_(out) {}
+ std::ostream* out_;
+ BENCHMARK_DISALLOW_COPY_AND_ASSIGN(LogType);
+};
+
+template <class Tp>
+LogType& operator<<(LogType& log, Tp const& value) {
+ if (log.out_) {
+ *log.out_ << value;
+ }
+ return log;
+}
+
+inline LogType& operator<<(LogType& log, EndLType* m) {
+ if (log.out_) {
+ *log.out_ << m;
+ }
+ return log;
+}
+
+inline int& LogLevel() {
+ static int log_level = 0;
+ return log_level;
+}
+
+inline LogType& GetNullLogInstance() {
+ static LogType log(nullptr);
+ return log;
+}
+
+inline LogType& GetErrorLogInstance() {
+ static LogType log(&std::clog);
+ return log;
+}
+
+inline LogType& GetLogInstanceForLevel(int level) {
+ if (level <= LogLevel()) {
+ return GetErrorLogInstance();
+ }
+ return GetNullLogInstance();
+}
+
+} // end namespace internal
+} // end namespace benchmark
+
+#define VLOG(x) \
+ (::benchmark::internal::GetLogInstanceForLevel(x) << "-- LOG(" << x << "):" \
+ " ")
+
+#endif \ No newline at end of file
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/mutex.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/mutex.h
new file mode 100644
index 00000000000..5f461d05a0c
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/mutex.h
@@ -0,0 +1,155 @@
+#ifndef BENCHMARK_MUTEX_H_
+#define BENCHMARK_MUTEX_H_
+
+#include <condition_variable>
+#include <mutex>
+
+#include "check.h"
+
+// Enable thread safety attributes only with clang.
+// The attributes can be safely erased when compiling with other compilers.
+#if defined(HAVE_THREAD_SAFETY_ATTRIBUTES)
+#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
+#else
+#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op
+#endif
+
+#define CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
+
+#define SCOPED_CAPABILITY THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
+
+#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
+
+#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
+
+#define ACQUIRED_BEFORE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
+
+#define ACQUIRED_AFTER(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
+
+#define REQUIRES(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))
+
+#define REQUIRES_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(__VA_ARGS__))
+
+#define ACQUIRE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__))
+
+#define ACQUIRE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(__VA_ARGS__))
+
+#define RELEASE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__))
+
+#define RELEASE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(__VA_ARGS__))
+
+#define TRY_ACQUIRE(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(__VA_ARGS__))
+
+#define TRY_ACQUIRE_SHARED(...) \
+ THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(__VA_ARGS__))
+
+#define EXCLUDES(...) THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
+
+#define ASSERT_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
+
+#define ASSERT_SHARED_CAPABILITY(x) \
+ THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
+
+#define RETURN_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
+
+#define NO_THREAD_SAFETY_ANALYSIS \
+ THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
+
+namespace benchmark {
+
+typedef std::condition_variable Condition;
+
+// NOTE: Wrappers for std::mutex and std::unique_lock are provided so that
+// we can annotate them with thread safety attributes and use the
+// -Wthread-safety warning with clang. The standard library types cannot be
+// used directly because they do not provided the required annotations.
+class CAPABILITY("mutex") Mutex {
+ public:
+ Mutex() {}
+
+ void lock() ACQUIRE() { mut_.lock(); }
+ void unlock() RELEASE() { mut_.unlock(); }
+ std::mutex& native_handle() { return mut_; }
+
+ private:
+ std::mutex mut_;
+};
+
+class SCOPED_CAPABILITY MutexLock {
+ typedef std::unique_lock<std::mutex> MutexLockImp;
+
+ public:
+ MutexLock(Mutex& m) ACQUIRE(m) : ml_(m.native_handle()) {}
+ ~MutexLock() RELEASE() {}
+ MutexLockImp& native_handle() { return ml_; }
+
+ private:
+ MutexLockImp ml_;
+};
+
+class Barrier {
+ public:
+ Barrier(int num_threads) : running_threads_(num_threads) {}
+
+ // Called by each thread
+ bool wait() EXCLUDES(lock_) {
+ bool last_thread = false;
+ {
+ MutexLock ml(lock_);
+ last_thread = createBarrier(ml);
+ }
+ if (last_thread) phase_condition_.notify_all();
+ return last_thread;
+ }
+
+ void removeThread() EXCLUDES(lock_) {
+ MutexLock ml(lock_);
+ --running_threads_;
+ if (entered_ != 0) phase_condition_.notify_all();
+ }
+
+ private:
+ Mutex lock_;
+ Condition phase_condition_;
+ int running_threads_;
+
+ // State for barrier management
+ int phase_number_ = 0;
+ int entered_ = 0; // Number of threads that have entered this barrier
+
+ // Enter the barrier and wait until all other threads have also
+ // entered the barrier. Returns iff this is the last thread to
+ // enter the barrier.
+ bool createBarrier(MutexLock& ml) REQUIRES(lock_) {
+ CHECK_LT(entered_, running_threads_);
+ entered_++;
+ if (entered_ < running_threads_) {
+ // Wait for all threads to enter
+ int phase_number_cp = phase_number_;
+ auto cb = [this, phase_number_cp]() {
+ return this->phase_number_ > phase_number_cp ||
+ entered_ == running_threads_; // A thread has aborted in error
+ };
+ phase_condition_.wait(ml.native_handle(), cb);
+ if (phase_number_ > phase_number_cp) return false;
+ // else (running_threads_ == entered_) and we are the last thread.
+ }
+ // Last thread has reached the barrier
+ phase_number_++;
+ entered_ = 0;
+ return true;
+ }
+};
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_MUTEX_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/re.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/re.h
new file mode 100644
index 00000000000..01e9736505e
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/re.h
@@ -0,0 +1,140 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef BENCHMARK_RE_H_
+#define BENCHMARK_RE_H_
+
+#include "internal_macros.h"
+
+// Prefer C regex libraries when compiling w/o exceptions so that we can
+// correctly report errors.
+#if defined(BENCHMARK_HAS_NO_EXCEPTIONS) && defined(HAVE_STD_REGEX) && \
+ (defined(HAVE_GNU_POSIX_REGEX) || defined(HAVE_POSIX_REGEX))
+#undef HAVE_STD_REGEX
+#endif
+
+#if defined(HAVE_STD_REGEX)
+#include <regex>
+#elif defined(HAVE_GNU_POSIX_REGEX)
+#include <gnuregex.h>
+#elif defined(HAVE_POSIX_REGEX)
+#include <regex.h>
+#else
+#error No regular expression backend was found!
+#endif
+#include <string>
+
+#include "check.h"
+
+namespace benchmark {
+
+// A wrapper around the POSIX regular expression API that provides automatic
+// cleanup
+class Regex {
+ public:
+ Regex() : init_(false) {}
+
+ ~Regex();
+
+ // Compile a regular expression matcher from spec. Returns true on success.
+ //
+ // On failure (and if error is not nullptr), error is populated with a human
+ // readable error message if an error occurs.
+ bool Init(const std::string& spec, std::string* error);
+
+ // Returns whether str matches the compiled regular expression.
+ bool Match(const std::string& str);
+
+ private:
+ bool init_;
+// Underlying regular expression object
+#if defined(HAVE_STD_REGEX)
+ std::regex re_;
+#elif defined(HAVE_POSIX_REGEX) || defined(HAVE_GNU_POSIX_REGEX)
+ regex_t re_;
+#else
+#error No regular expression backend implementation available
+#endif
+};
+
+#if defined(HAVE_STD_REGEX)
+
+inline bool Regex::Init(const std::string& spec, std::string* error) {
+#ifdef BENCHMARK_HAS_NO_EXCEPTIONS
+ ((void)error); // suppress unused warning
+#else
+ try {
+#endif
+ re_ = std::regex(spec, std::regex_constants::extended);
+ init_ = true;
+#ifndef BENCHMARK_HAS_NO_EXCEPTIONS
+ } catch (const std::regex_error& e) {
+ if (error) {
+ *error = e.what();
+ }
+ }
+#endif
+ return init_;
+}
+
+inline Regex::~Regex() {}
+
+inline bool Regex::Match(const std::string& str) {
+ if (!init_) {
+ return false;
+ }
+ return std::regex_search(str, re_);
+}
+
+#else
+inline bool Regex::Init(const std::string& spec, std::string* error) {
+ int ec = regcomp(&re_, spec.c_str(), REG_EXTENDED | REG_NOSUB);
+ if (ec != 0) {
+ if (error) {
+ size_t needed = regerror(ec, &re_, nullptr, 0);
+ char* errbuf = new char[needed];
+ regerror(ec, &re_, errbuf, needed);
+
+ // regerror returns the number of bytes necessary to null terminate
+ // the string, so we move that when assigning to error.
+ CHECK_NE(needed, 0);
+ error->assign(errbuf, needed - 1);
+
+ delete[] errbuf;
+ }
+
+ return false;
+ }
+
+ init_ = true;
+ return true;
+}
+
+inline Regex::~Regex() {
+ if (init_) {
+ regfree(&re_);
+ }
+}
+
+inline bool Regex::Match(const std::string& str) {
+ if (!init_) {
+ return false;
+ }
+ return regexec(&re_, str.c_str(), 0, nullptr, 0) == 0;
+}
+#endif
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_RE_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/reporter.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/reporter.cc
new file mode 100644
index 00000000000..64742426cd3
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/reporter.cc
@@ -0,0 +1,68 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "benchmark/reporter.h"
+#include "timers.h"
+
+#include <cstdlib>
+
+#include <iostream>
+#include <tuple>
+#include <vector>
+
+#include "check.h"
+#include "stat.h"
+
+namespace benchmark {
+
+BenchmarkReporter::BenchmarkReporter()
+ : output_stream_(&std::cout), error_stream_(&std::cerr) {}
+
+BenchmarkReporter::~BenchmarkReporter() {}
+
+void BenchmarkReporter::PrintBasicContext(std::ostream *out_ptr,
+ Context const &context) {
+ CHECK(out_ptr) << "cannot be null";
+ auto &Out = *out_ptr;
+
+ Out << "Run on (" << context.num_cpus << " X " << context.mhz_per_cpu
+ << " MHz CPU " << ((context.num_cpus > 1) ? "s" : "") << ")\n";
+
+ Out << LocalDateTimeString() << "\n";
+
+ if (context.cpu_scaling_enabled) {
+ Out << "***WARNING*** CPU scaling is enabled, the benchmark "
+ "real time measurements may be noisy and will incur extra "
+ "overhead.\n";
+ }
+
+#ifndef NDEBUG
+ Out << "***WARNING*** Library was built as DEBUG. Timings may be "
+ "affected.\n";
+#endif
+}
+
+double BenchmarkReporter::Run::GetAdjustedRealTime() const {
+ double new_time = real_accumulated_time * GetTimeUnitMultiplier(time_unit);
+ if (iterations != 0) new_time /= static_cast<double>(iterations);
+ return new_time;
+}
+
+double BenchmarkReporter::Run::GetAdjustedCPUTime() const {
+ double new_time = cpu_accumulated_time * GetTimeUnitMultiplier(time_unit);
+ if (iterations != 0) new_time /= static_cast<double>(iterations);
+ return new_time;
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sleep.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sleep.cc
new file mode 100644
index 00000000000..54aa04a4224
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sleep.cc
@@ -0,0 +1,51 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "sleep.h"
+
+#include <cerrno>
+#include <cstdlib>
+#include <ctime>
+
+#include "internal_macros.h"
+
+#ifdef BENCHMARK_OS_WINDOWS
+#include <Windows.h>
+#endif
+
+namespace benchmark {
+#ifdef BENCHMARK_OS_WINDOWS
+// Window's Sleep takes milliseconds argument.
+void SleepForMilliseconds(int milliseconds) { Sleep(milliseconds); }
+void SleepForSeconds(double seconds) {
+ SleepForMilliseconds(static_cast<int>(kNumMillisPerSecond * seconds));
+}
+#else // BENCHMARK_OS_WINDOWS
+void SleepForMicroseconds(int microseconds) {
+ struct timespec sleep_time;
+ sleep_time.tv_sec = microseconds / kNumMicrosPerSecond;
+ sleep_time.tv_nsec = (microseconds % kNumMicrosPerSecond) * kNumNanosPerMicro;
+ while (nanosleep(&sleep_time, &sleep_time) != 0 && errno == EINTR)
+ ; // Ignore signals and wait for the full interval to elapse.
+}
+
+void SleepForMilliseconds(int milliseconds) {
+ SleepForMicroseconds(milliseconds * kNumMicrosPerMilli);
+}
+
+void SleepForSeconds(double seconds) {
+ SleepForMicroseconds(static_cast<int>(seconds * kNumMicrosPerSecond));
+}
+#endif // BENCHMARK_OS_WINDOWS
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sleep.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sleep.h
new file mode 100644
index 00000000000..f98551afe28
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sleep.h
@@ -0,0 +1,15 @@
+#ifndef BENCHMARK_SLEEP_H_
+#define BENCHMARK_SLEEP_H_
+
+namespace benchmark {
+const int kNumMillisPerSecond = 1000;
+const int kNumMicrosPerMilli = 1000;
+const int kNumMicrosPerSecond = kNumMillisPerSecond * 1000;
+const int kNumNanosPerMicro = 1000;
+const int kNumNanosPerSecond = kNumNanosPerMicro * kNumMicrosPerSecond;
+
+void SleepForMilliseconds(int milliseconds);
+void SleepForSeconds(double seconds);
+} // end namespace benchmark
+
+#endif // BENCHMARK_SLEEP_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/stat.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/stat.h
new file mode 100644
index 00000000000..136c3aa8d61
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/stat.h
@@ -0,0 +1,306 @@
+#ifndef BENCHMARK_STAT_H_
+#define BENCHMARK_STAT_H_
+
+#include <cmath>
+#include <limits>
+#include <ostream>
+#include <type_traits>
+
+namespace benchmark {
+
+template <typename VType, typename NumType>
+class Stat1;
+
+template <typename VType, typename NumType>
+class Stat1MinMax;
+
+typedef Stat1<float, int64_t> Stat1_f;
+typedef Stat1<double, int64_t> Stat1_d;
+typedef Stat1MinMax<float, int64_t> Stat1MinMax_f;
+typedef Stat1MinMax<double, int64_t> Stat1MinMax_d;
+
+template <typename VType>
+class Vector2;
+template <typename VType>
+class Vector3;
+template <typename VType>
+class Vector4;
+
+template <typename VType, typename NumType>
+class Stat1 {
+ public:
+ typedef Stat1<VType, NumType> Self;
+
+ Stat1() { Clear(); }
+ // Create a sample of value dat and weight 1
+ explicit Stat1(const VType &dat) {
+ sum_ = dat;
+ sum_squares_ = Sqr(dat);
+ numsamples_ = 1;
+ }
+ // Create statistics for all the samples between begin (included)
+ // and end(excluded)
+ explicit Stat1(const VType *begin, const VType *end) {
+ Clear();
+ for (const VType *item = begin; item < end; ++item) {
+ (*this) += Stat1(*item);
+ }
+ }
+ // Create a sample of value dat and weight w
+ Stat1(const VType &dat, const NumType &w) {
+ sum_ = w * dat;
+ sum_squares_ = w * Sqr(dat);
+ numsamples_ = w;
+ }
+ // Copy operator
+ Stat1(const Self &stat) {
+ sum_ = stat.sum_;
+ sum_squares_ = stat.sum_squares_;
+ numsamples_ = stat.numsamples_;
+ }
+
+ void Clear() {
+ numsamples_ = NumType();
+ sum_squares_ = sum_ = VType();
+ }
+
+ Self &operator=(const Self &stat) {
+ sum_ = stat.sum_;
+ sum_squares_ = stat.sum_squares_;
+ numsamples_ = stat.numsamples_;
+ return (*this);
+ }
+ // Merge statistics from two sample sets.
+ Self &operator+=(const Self &stat) {
+ sum_ += stat.sum_;
+ sum_squares_ += stat.sum_squares_;
+ numsamples_ += stat.numsamples_;
+ return (*this);
+ }
+ // The operation opposite to +=
+ Self &operator-=(const Self &stat) {
+ sum_ -= stat.sum_;
+ sum_squares_ -= stat.sum_squares_;
+ numsamples_ -= stat.numsamples_;
+ return (*this);
+ }
+ // Multiply the weight of the set of samples by a factor k
+ Self &operator*=(const VType &k) {
+ sum_ *= k;
+ sum_squares_ *= k;
+ numsamples_ *= k;
+ return (*this);
+ }
+
+ // Merge statistics from two sample sets.
+ Self operator+(const Self &stat) const { return Self(*this) += stat; }
+
+ // The operation opposite to +
+ Self operator-(const Self &stat) const { return Self(*this) -= stat; }
+
+ // Multiply the weight of the set of samples by a factor k
+ Self operator*(const VType &k) const { return Self(*this) *= k; }
+
+ // Return the total weight of this sample set
+ NumType numSamples() const { return numsamples_; }
+
+ // Return the sum of this sample set
+ VType Sum() const { return sum_; }
+
+ // Return the mean of this sample set
+ VType Mean() const {
+ if (numsamples_ == 0) return VType();
+ return sum_ * (1.0 / numsamples_);
+ }
+
+ // Return the mean of this sample set and compute the standard deviation at
+ // the same time.
+ VType Mean(VType *stddev) const {
+ if (numsamples_ == 0) return VType();
+ VType mean = sum_ * (1.0 / numsamples_);
+ if (stddev) {
+ VType avg_squares = sum_squares_ * (1.0 / numsamples_);
+ *stddev = Sqrt(avg_squares - Sqr(mean));
+ }
+ return mean;
+ }
+
+ // Return the standard deviation of the sample set
+ VType StdDev() const {
+ if (numsamples_ == 0) return VType();
+ VType mean = Mean();
+ VType avg_squares = sum_squares_ * (1.0 / numsamples_);
+ return Sqrt(avg_squares - Sqr(mean));
+ }
+
+ private:
+ static_assert(std::is_integral<NumType>::value &&
+ !std::is_same<NumType, bool>::value,
+ "NumType must be an integral type that is not bool.");
+ // Let i be the index of the samples provided (using +=)
+ // and weight[i],value[i] be the data of sample #i
+ // then the variables have the following meaning:
+ NumType numsamples_; // sum of weight[i];
+ VType sum_; // sum of weight[i]*value[i];
+ VType sum_squares_; // sum of weight[i]*value[i]^2;
+
+ // Template function used to square a number.
+ // For a vector we square all components
+ template <typename SType>
+ static inline SType Sqr(const SType &dat) {
+ return dat * dat;
+ }
+
+ template <typename SType>
+ static inline Vector2<SType> Sqr(const Vector2<SType> &dat) {
+ return dat.MulComponents(dat);
+ }
+
+ template <typename SType>
+ static inline Vector3<SType> Sqr(const Vector3<SType> &dat) {
+ return dat.MulComponents(dat);
+ }
+
+ template <typename SType>
+ static inline Vector4<SType> Sqr(const Vector4<SType> &dat) {
+ return dat.MulComponents(dat);
+ }
+
+ // Template function used to take the square root of a number.
+ // For a vector we square all components
+ template <typename SType>
+ static inline SType Sqrt(const SType &dat) {
+ // Avoid NaN due to imprecision in the calculations
+ if (dat < 0) return 0;
+ return sqrt(dat);
+ }
+
+ template <typename SType>
+ static inline Vector2<SType> Sqrt(const Vector2<SType> &dat) {
+ // Avoid NaN due to imprecision in the calculations
+ return Max(dat, Vector2<SType>()).Sqrt();
+ }
+
+ template <typename SType>
+ static inline Vector3<SType> Sqrt(const Vector3<SType> &dat) {
+ // Avoid NaN due to imprecision in the calculations
+ return Max(dat, Vector3<SType>()).Sqrt();
+ }
+
+ template <typename SType>
+ static inline Vector4<SType> Sqrt(const Vector4<SType> &dat) {
+ // Avoid NaN due to imprecision in the calculations
+ return Max(dat, Vector4<SType>()).Sqrt();
+ }
+};
+
+// Useful printing function
+template <typename VType, typename NumType>
+std::ostream &operator<<(std::ostream &out, const Stat1<VType, NumType> &s) {
+ out << "{ avg = " << s.Mean() << " std = " << s.StdDev()
+ << " nsamples = " << s.NumSamples() << "}";
+ return out;
+}
+
+// Stat1MinMax: same as Stat1, but it also
+// keeps the Min and Max values; the "-"
+// operator is disabled because it cannot be implemented
+// efficiently
+template <typename VType, typename NumType>
+class Stat1MinMax : public Stat1<VType, NumType> {
+ public:
+ typedef Stat1MinMax<VType, NumType> Self;
+
+ Stat1MinMax() { Clear(); }
+ // Create a sample of value dat and weight 1
+ explicit Stat1MinMax(const VType &dat) : Stat1<VType, NumType>(dat) {
+ max_ = dat;
+ min_ = dat;
+ }
+ // Create statistics for all the samples between begin (included)
+ // and end(excluded)
+ explicit Stat1MinMax(const VType *begin, const VType *end) {
+ Clear();
+ for (const VType *item = begin; item < end; ++item) {
+ (*this) += Stat1MinMax(*item);
+ }
+ }
+ // Create a sample of value dat and weight w
+ Stat1MinMax(const VType &dat, const NumType &w)
+ : Stat1<VType, NumType>(dat, w) {
+ max_ = dat;
+ min_ = dat;
+ }
+ // Copy operator
+ Stat1MinMax(const Self &stat) : Stat1<VType, NumType>(stat) {
+ max_ = stat.max_;
+ min_ = stat.min_;
+ }
+
+ void Clear() {
+ Stat1<VType, NumType>::Clear();
+ if (std::numeric_limits<VType>::has_infinity) {
+ min_ = std::numeric_limits<VType>::infinity();
+ max_ = -std::numeric_limits<VType>::infinity();
+ } else {
+ min_ = std::numeric_limits<VType>::max();
+ max_ = std::numeric_limits<VType>::min();
+ }
+ }
+
+ Self &operator=(const Self &stat) {
+ this->Stat1<VType, NumType>::operator=(stat);
+ max_ = stat.max_;
+ min_ = stat.min_;
+ return (*this);
+ }
+ // Merge statistics from two sample sets.
+ Self &operator+=(const Self &stat) {
+ this->Stat1<VType, NumType>::operator+=(stat);
+ if (stat.max_ > max_) max_ = stat.max_;
+ if (stat.min_ < min_) min_ = stat.min_;
+ return (*this);
+ }
+ // Multiply the weight of the set of samples by a factor k
+ Self &operator*=(const VType &stat) {
+ this->Stat1<VType, NumType>::operator*=(stat);
+ return (*this);
+ }
+ // Merge statistics from two sample sets.
+ Self operator+(const Self &stat) const { return Self(*this) += stat; }
+ // Multiply the weight of the set of samples by a factor k
+ Self operator*(const VType &k) const { return Self(*this) *= k; }
+
+ // Return the maximal value in this sample set
+ VType Max() const { return max_; }
+ // Return the minimal value in this sample set
+ VType Min() const { return min_; }
+
+ private:
+ // The - operation makes no sense with Min/Max
+ // unless we keep the full list of values (but we don't)
+ // make it private, and let it undefined so nobody can call it
+ Self &operator-=(const Self &stat); // senseless. let it undefined.
+
+ // The operation opposite to -
+ Self operator-(const Self &stat) const; // senseless. let it undefined.
+
+ // Let i be the index of the samples provided (using +=)
+ // and weight[i],value[i] be the data of sample #i
+ // then the variables have the following meaning:
+ VType max_; // max of value[i]
+ VType min_; // min of value[i]
+};
+
+// Useful printing function
+template <typename VType, typename NumType>
+std::ostream &operator<<(std::ostream &out,
+ const Stat1MinMax<VType, NumType> &s) {
+ out << "{ avg = " << s.Mean() << " std = " << s.StdDev()
+ << " nsamples = " << s.NumSamples() << " min = " << s.Min()
+ << " max = " << s.Max() << "}";
+ return out;
+}
+} // end namespace benchmark
+
+#endif // BENCHMARK_STAT_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/string_util.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/string_util.cc
new file mode 100644
index 00000000000..cd4e7cfde57
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/string_util.cc
@@ -0,0 +1,172 @@
+#include "string_util.h"
+
+#include <array>
+#include <cmath>
+#include <cstdarg>
+#include <cstdio>
+#include <memory>
+#include <sstream>
+
+#include "arraysize.h"
+
+namespace benchmark {
+namespace {
+
+// kilo, Mega, Giga, Tera, Peta, Exa, Zetta, Yotta.
+const char kBigSIUnits[] = "kMGTPEZY";
+// Kibi, Mebi, Gibi, Tebi, Pebi, Exbi, Zebi, Yobi.
+const char kBigIECUnits[] = "KMGTPEZY";
+// milli, micro, nano, pico, femto, atto, zepto, yocto.
+const char kSmallSIUnits[] = "munpfazy";
+
+// We require that all three arrays have the same size.
+static_assert(arraysize(kBigSIUnits) == arraysize(kBigIECUnits),
+ "SI and IEC unit arrays must be the same size");
+static_assert(arraysize(kSmallSIUnits) == arraysize(kBigSIUnits),
+ "Small SI and Big SI unit arrays must be the same size");
+
+static const int64_t kUnitsSize = arraysize(kBigSIUnits);
+
+} // end anonymous namespace
+
+void ToExponentAndMantissa(double val, double thresh, int precision,
+ double one_k, std::string* mantissa,
+ int64_t* exponent) {
+ std::stringstream mantissa_stream;
+
+ if (val < 0) {
+ mantissa_stream << "-";
+ val = -val;
+ }
+
+ // Adjust threshold so that it never excludes things which can't be rendered
+ // in 'precision' digits.
+ const double adjusted_threshold =
+ std::max(thresh, 1.0 / std::pow(10.0, precision));
+ const double big_threshold = adjusted_threshold * one_k;
+ const double small_threshold = adjusted_threshold;
+ // Values in ]simple_threshold,small_threshold[ will be printed as-is
+ const double simple_threshold = 0.01;
+
+ if (val > big_threshold) {
+ // Positive powers
+ double scaled = val;
+ for (size_t i = 0; i < arraysize(kBigSIUnits); ++i) {
+ scaled /= one_k;
+ if (scaled <= big_threshold) {
+ mantissa_stream << scaled;
+ *exponent = i + 1;
+ *mantissa = mantissa_stream.str();
+ return;
+ }
+ }
+ mantissa_stream << val;
+ *exponent = 0;
+ } else if (val < small_threshold) {
+ // Negative powers
+ if (val < simple_threshold) {
+ double scaled = val;
+ for (size_t i = 0; i < arraysize(kSmallSIUnits); ++i) {
+ scaled *= one_k;
+ if (scaled >= small_threshold) {
+ mantissa_stream << scaled;
+ *exponent = -static_cast<int64_t>(i + 1);
+ *mantissa = mantissa_stream.str();
+ return;
+ }
+ }
+ }
+ mantissa_stream << val;
+ *exponent = 0;
+ } else {
+ mantissa_stream << val;
+ *exponent = 0;
+ }
+ *mantissa = mantissa_stream.str();
+}
+
+std::string ExponentToPrefix(int64_t exponent, bool iec) {
+ if (exponent == 0) return "";
+
+ const int64_t index = (exponent > 0 ? exponent - 1 : -exponent - 1);
+ if (index >= kUnitsSize) return "";
+
+ const char* array =
+ (exponent > 0 ? (iec ? kBigIECUnits : kBigSIUnits) : kSmallSIUnits);
+ if (iec)
+ return array[index] + std::string("i");
+ else
+ return std::string(1, array[index]);
+}
+
+std::string ToBinaryStringFullySpecified(double value, double threshold,
+ int precision) {
+ std::string mantissa;
+ int64_t exponent;
+ ToExponentAndMantissa(value, threshold, precision, 1024.0, &mantissa,
+ &exponent);
+ return mantissa + ExponentToPrefix(exponent, false);
+}
+
+void AppendHumanReadable(int n, std::string* str) {
+ std::stringstream ss;
+ // Round down to the nearest SI prefix.
+ ss << ToBinaryStringFullySpecified(n, 1.0, 0);
+ *str += ss.str();
+}
+
+std::string HumanReadableNumber(double n) {
+ // 1.1 means that figures up to 1.1k should be shown with the next unit down;
+ // this softens edge effects.
+ // 1 means that we should show one decimal place of precision.
+ return ToBinaryStringFullySpecified(n, 1.1, 1);
+}
+
+std::string StringPrintFImp(const char* msg, va_list args) {
+ // we might need a second shot at this, so pre-emptivly make a copy
+ va_list args_cp;
+ va_copy(args_cp, args);
+
+ // TODO(ericwf): use std::array for first attempt to avoid one memory
+ // allocation guess what the size might be
+ std::array<char, 256> local_buff;
+ std::size_t size = local_buff.size();
+ // 2015-10-08: vsnprintf is used instead of snd::vsnprintf due to a limitation
+ // in the android-ndk
+ auto ret = vsnprintf(local_buff.data(), size, msg, args_cp);
+
+ va_end(args_cp);
+
+ // handle empty expansion
+ if (ret == 0) return std::string{};
+ if (static_cast<std::size_t>(ret) < size)
+ return std::string(local_buff.data());
+
+ // we did not provide a long enough buffer on our first attempt.
+ // add 1 to size to account for null-byte in size cast to prevent overflow
+ size = static_cast<std::size_t>(ret) + 1;
+ auto buff_ptr = std::unique_ptr<char[]>(new char[size]);
+ // 2015-10-08: vsnprintf is used instead of snd::vsnprintf due to a limitation
+ // in the android-ndk
+ ret = vsnprintf(buff_ptr.get(), size, msg, args);
+ return std::string(buff_ptr.get());
+}
+
+std::string StringPrintF(const char* format, ...) {
+ va_list args;
+ va_start(args, format);
+ std::string tmp = StringPrintFImp(format, args);
+ va_end(args);
+ return tmp;
+}
+
+void ReplaceAll(std::string* str, const std::string& from,
+ const std::string& to) {
+ std::size_t start = 0;
+ while ((start = str->find(from, start)) != std::string::npos) {
+ str->replace(start, from.length(), to);
+ start += to.length();
+ }
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/string_util.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/string_util.h
new file mode 100644
index 00000000000..0b190b91a16
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/string_util.h
@@ -0,0 +1,40 @@
+#ifndef BENCHMARK_STRING_UTIL_H_
+#define BENCHMARK_STRING_UTIL_H_
+
+#include <sstream>
+#include <string>
+#include <utility>
+#include "internal_macros.h"
+
+namespace benchmark {
+
+void AppendHumanReadable(int n, std::string* str);
+
+std::string HumanReadableNumber(double n);
+
+std::string StringPrintF(const char* format, ...);
+
+inline std::ostream& StringCatImp(std::ostream& out) BENCHMARK_NOEXCEPT {
+ return out;
+}
+
+template <class First, class... Rest>
+inline std::ostream& StringCatImp(std::ostream& out, First&& f,
+ Rest&&... rest) {
+ out << std::forward<First>(f);
+ return StringCatImp(out, std::forward<Rest>(rest)...);
+}
+
+template <class... Args>
+inline std::string StrCat(Args&&... args) {
+ std::ostringstream ss;
+ StringCatImp(ss, std::forward<Args>(args)...);
+ return ss.str();
+}
+
+void ReplaceAll(std::string* str, const std::string& from,
+ const std::string& to);
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_STRING_UTIL_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sysinfo.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sysinfo.cc
new file mode 100644
index 00000000000..7feb79e65f2
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sysinfo.cc
@@ -0,0 +1,355 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "sysinfo.h"
+#include "internal_macros.h"
+
+#ifdef BENCHMARK_OS_WINDOWS
+#include <Shlwapi.h>
+#include <VersionHelpers.h>
+#include <Windows.h>
+#else
+#include <fcntl.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h> // this header must be included before 'sys/sysctl.h' to avoid compilation error on FreeBSD
+#include <unistd.h>
+#if defined BENCHMARK_OS_FREEBSD || defined BENCHMARK_OS_MACOSX
+#include <sys/sysctl.h>
+#endif
+#endif
+
+#include <cerrno>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <limits>
+#include <mutex>
+
+#include "arraysize.h"
+#include "check.h"
+#include "cycleclock.h"
+#include "internal_macros.h"
+#include "log.h"
+#include "sleep.h"
+#include "string_util.h"
+
+namespace benchmark {
+namespace {
+std::once_flag cpuinfo_init;
+double cpuinfo_cycles_per_second = 1.0;
+int cpuinfo_num_cpus = 1; // Conservative guess
+
+#if !defined BENCHMARK_OS_MACOSX
+const int64_t estimate_time_ms = 1000;
+
+// Helper function estimates cycles/sec by observing cycles elapsed during
+// sleep(). Using small sleep time decreases accuracy significantly.
+int64_t EstimateCyclesPerSecond() {
+ const int64_t start_ticks = cycleclock::Now();
+ SleepForMilliseconds(estimate_time_ms);
+ return cycleclock::Now() - start_ticks;
+}
+#endif
+
+#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN
+// Helper function for reading an int from a file. Returns true if successful
+// and the memory location pointed to by value is set to the value read.
+bool ReadIntFromFile(const char* file, long* value) {
+ bool ret = false;
+ int fd = open(file, O_RDONLY);
+ if (fd != -1) {
+ char line[1024];
+ char* err;
+ memset(line, '\0', sizeof(line));
+ ssize_t read_err = read(fd, line, sizeof(line) - 1);
+ ((void)read_err); // prevent unused warning
+ CHECK(read_err >= 0);
+ const long temp_value = strtol(line, &err, 10);
+ if (line[0] != '\0' && (*err == '\n' || *err == '\0')) {
+ *value = temp_value;
+ ret = true;
+ }
+ close(fd);
+ }
+ return ret;
+}
+#endif
+
+#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN
+static std::string convertToLowerCase(std::string s) {
+ for (auto& ch : s)
+ ch = std::tolower(ch);
+ return s;
+}
+static bool startsWithKey(std::string Value, std::string Key,
+ bool IgnoreCase = true) {
+ if (IgnoreCase) {
+ Key = convertToLowerCase(std::move(Key));
+ Value = convertToLowerCase(std::move(Value));
+ }
+ return Value.compare(0, Key.size(), Key) == 0;
+}
+#endif
+
+void InitializeSystemInfo() {
+#if defined BENCHMARK_OS_LINUX || defined BENCHMARK_OS_CYGWIN
+ char line[1024];
+ char* err;
+ long freq;
+
+ bool saw_mhz = false;
+
+ // If the kernel is exporting the tsc frequency use that. There are issues
+ // where cpuinfo_max_freq cannot be relied on because the BIOS may be
+ // exporintg an invalid p-state (on x86) or p-states may be used to put the
+ // processor in a new mode (turbo mode). Essentially, those frequencies
+ // cannot always be relied upon. The same reasons apply to /proc/cpuinfo as
+ // well.
+ if (!saw_mhz &&
+ ReadIntFromFile("/sys/devices/system/cpu/cpu0/tsc_freq_khz", &freq)) {
+ // The value is in kHz (as the file name suggests). For example, on a
+ // 2GHz warpstation, the file contains the value "2000000".
+ cpuinfo_cycles_per_second = freq * 1000.0;
+ saw_mhz = true;
+ }
+
+ // If CPU scaling is in effect, we want to use the *maximum* frequency,
+ // not whatever CPU speed some random processor happens to be using now.
+ if (!saw_mhz &&
+ ReadIntFromFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq",
+ &freq)) {
+ // The value is in kHz. For example, on a 2GHz warpstation, the file
+ // contains the value "2000000".
+ cpuinfo_cycles_per_second = freq * 1000.0;
+ saw_mhz = true;
+ }
+
+ // Read /proc/cpuinfo for other values, and if there is no cpuinfo_max_freq.
+ const char* pname = "/proc/cpuinfo";
+ int fd = open(pname, O_RDONLY);
+ if (fd == -1) {
+ perror(pname);
+ if (!saw_mhz) {
+ cpuinfo_cycles_per_second =
+ static_cast<double>(EstimateCyclesPerSecond());
+ }
+ return;
+ }
+
+ double bogo_clock = 1.0;
+ bool saw_bogo = false;
+ long max_cpu_id = 0;
+ int num_cpus = 0;
+ line[0] = line[1] = '\0';
+ size_t chars_read = 0;
+ do { // we'll exit when the last read didn't read anything
+ // Move the next line to the beginning of the buffer
+ const size_t oldlinelen = strlen(line);
+ if (sizeof(line) == oldlinelen + 1) // oldlinelen took up entire line
+ line[0] = '\0';
+ else // still other lines left to save
+ memmove(line, line + oldlinelen + 1, sizeof(line) - (oldlinelen + 1));
+ // Terminate the new line, reading more if we can't find the newline
+ char* newline = strchr(line, '\n');
+ if (newline == nullptr) {
+ const size_t linelen = strlen(line);
+ const size_t bytes_to_read = sizeof(line) - 1 - linelen;
+ CHECK(bytes_to_read > 0); // because the memmove recovered >=1 bytes
+ chars_read = read(fd, line + linelen, bytes_to_read);
+ line[linelen + chars_read] = '\0';
+ newline = strchr(line, '\n');
+ }
+ if (newline != nullptr) *newline = '\0';
+
+ // When parsing the "cpu MHz" and "bogomips" (fallback) entries, we only
+ // accept postive values. Some environments (virtual machines) report zero,
+ // which would cause infinite looping in WallTime_Init.
+ if (!saw_mhz && startsWithKey(line, "cpu MHz")) {
+ const char* freqstr = strchr(line, ':');
+ if (freqstr) {
+ cpuinfo_cycles_per_second = strtod(freqstr + 1, &err) * 1000000.0;
+ if (freqstr[1] != '\0' && *err == '\0' && cpuinfo_cycles_per_second > 0)
+ saw_mhz = true;
+ }
+ } else if (startsWithKey(line, "bogomips")) {
+ const char* freqstr = strchr(line, ':');
+ if (freqstr) {
+ bogo_clock = strtod(freqstr + 1, &err) * 1000000.0;
+ if (freqstr[1] != '\0' && *err == '\0' && bogo_clock > 0)
+ saw_bogo = true;
+ }
+ } else if (startsWithKey(line, "processor", /*IgnoreCase*/false)) {
+ // The above comparison is case-sensitive because ARM kernels often
+ // include a "Processor" line that tells you about the CPU, distinct
+ // from the usual "processor" lines that give you CPU ids. No current
+ // Linux architecture is using "Processor" for CPU ids.
+ num_cpus++; // count up every time we see an "processor :" entry
+ const char* id_str = strchr(line, ':');
+ if (id_str) {
+ const long cpu_id = strtol(id_str + 1, &err, 10);
+ if (id_str[1] != '\0' && *err == '\0' && max_cpu_id < cpu_id)
+ max_cpu_id = cpu_id;
+ }
+ }
+ } while (chars_read > 0);
+ close(fd);
+
+ if (!saw_mhz) {
+ if (saw_bogo) {
+ // If we didn't find anything better, we'll use bogomips, but
+ // we're not happy about it.
+ cpuinfo_cycles_per_second = bogo_clock;
+ } else {
+ // If we don't even have bogomips, we'll use the slow estimation.
+ cpuinfo_cycles_per_second =
+ static_cast<double>(EstimateCyclesPerSecond());
+ }
+ }
+ if (num_cpus == 0) {
+ fprintf(stderr, "Failed to read num. CPUs correctly from /proc/cpuinfo\n");
+ } else {
+ if ((max_cpu_id + 1) != num_cpus) {
+ fprintf(stderr,
+ "CPU ID assignments in /proc/cpuinfo seem messed up."
+ " This is usually caused by a bad BIOS.\n");
+ }
+ cpuinfo_num_cpus = num_cpus;
+ }
+
+#elif defined BENCHMARK_OS_FREEBSD
+// For this sysctl to work, the machine must be configured without
+// SMP, APIC, or APM support. hz should be 64-bit in freebsd 7.0
+// and later. Before that, it's a 32-bit quantity (and gives the
+// wrong answer on machines faster than 2^32 Hz). See
+// http://lists.freebsd.org/pipermail/freebsd-i386/2004-November/001846.html
+// But also compare FreeBSD 7.0:
+// http://fxr.watson.org/fxr/source/i386/i386/tsc.c?v=RELENG70#L223
+// 231 error = sysctl_handle_quad(oidp, &freq, 0, req);
+// To FreeBSD 6.3 (it's the same in 6-STABLE):
+// http://fxr.watson.org/fxr/source/i386/i386/tsc.c?v=RELENG6#L131
+// 139 error = sysctl_handle_int(oidp, &freq, sizeof(freq), req);
+#if __FreeBSD__ >= 7
+ uint64_t hz = 0;
+#else
+ unsigned int hz = 0;
+#endif
+ size_t sz = sizeof(hz);
+ const char* sysctl_path = "machdep.tsc_freq";
+ if (sysctlbyname(sysctl_path, &hz, &sz, nullptr, 0) != 0) {
+ fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n",
+ sysctl_path, strerror(errno));
+ cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
+ } else {
+ cpuinfo_cycles_per_second = hz;
+ }
+// TODO: also figure out cpuinfo_num_cpus
+
+#elif defined BENCHMARK_OS_WINDOWS
+ // In NT, read MHz from the registry. If we fail to do so or we're in win9x
+ // then make a crude estimate.
+ DWORD data, data_size = sizeof(data);
+ if (IsWindowsXPOrGreater() &&
+ SUCCEEDED(
+ SHGetValueA(HKEY_LOCAL_MACHINE,
+ "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
+ "~MHz", nullptr, &data, &data_size)))
+ cpuinfo_cycles_per_second =
+ static_cast<double>((int64_t)data * (int64_t)(1000 * 1000)); // was mhz
+ else
+ cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
+
+ SYSTEM_INFO sysinfo;
+ // Use memset as opposed to = {} to avoid GCC missing initializer false
+ // positives.
+ std::memset(&sysinfo, 0, sizeof(SYSTEM_INFO));
+ GetSystemInfo(&sysinfo);
+ cpuinfo_num_cpus = sysinfo.dwNumberOfProcessors; // number of logical
+ // processors in the current
+ // group
+
+#elif defined BENCHMARK_OS_MACOSX
+ int32_t num_cpus = 0;
+ size_t size = sizeof(num_cpus);
+ if (::sysctlbyname("hw.ncpu", &num_cpus, &size, nullptr, 0) == 0 &&
+ (size == sizeof(num_cpus))) {
+ cpuinfo_num_cpus = num_cpus;
+ } else {
+ fprintf(stderr, "%s\n", strerror(errno));
+ std::exit(EXIT_FAILURE);
+ }
+ int64_t cpu_freq = 0;
+ size = sizeof(cpu_freq);
+ if (::sysctlbyname("hw.cpufrequency", &cpu_freq, &size, nullptr, 0) == 0 &&
+ (size == sizeof(cpu_freq))) {
+ cpuinfo_cycles_per_second = cpu_freq;
+ } else {
+ #if defined BENCHMARK_OS_IOS
+ fprintf(stderr, "CPU frequency cannot be detected. \n");
+ cpuinfo_cycles_per_second = 0;
+ #else
+ fprintf(stderr, "%s\n", strerror(errno));
+ std::exit(EXIT_FAILURE);
+ #endif
+ }
+#else
+ // Generic cycles per second counter
+ cpuinfo_cycles_per_second = static_cast<double>(EstimateCyclesPerSecond());
+#endif
+}
+
+} // end namespace
+
+double CyclesPerSecond(void) {
+ std::call_once(cpuinfo_init, InitializeSystemInfo);
+ return cpuinfo_cycles_per_second;
+}
+
+int NumCPUs(void) {
+ std::call_once(cpuinfo_init, InitializeSystemInfo);
+ return cpuinfo_num_cpus;
+}
+
+// The ""'s catch people who don't pass in a literal for "str"
+#define strliterallen(str) (sizeof("" str "") - 1)
+
+// Must use a string literal for prefix.
+#define memprefix(str, len, prefix) \
+ ((((len) >= strliterallen(prefix)) && \
+ std::memcmp(str, prefix, strliterallen(prefix)) == 0) \
+ ? str + strliterallen(prefix) \
+ : nullptr)
+
+bool CpuScalingEnabled() {
+#ifndef BENCHMARK_OS_WINDOWS
+ // On Linux, the CPUfreq subsystem exposes CPU information as files on the
+ // local file system. If reading the exported files fails, then we may not be
+ // running on Linux, so we silently ignore all the read errors.
+ for (int cpu = 0, num_cpus = NumCPUs(); cpu < num_cpus; ++cpu) {
+ std::string governor_file =
+ StrCat("/sys/devices/system/cpu/cpu", cpu, "/cpufreq/scaling_governor");
+ FILE* file = fopen(governor_file.c_str(), "r");
+ if (!file) break;
+ char buff[16];
+ size_t bytes_read = fread(buff, 1, sizeof(buff), file);
+ fclose(file);
+ if (memprefix(buff, bytes_read, "performance") == nullptr) return true;
+ }
+#endif
+ return false;
+}
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sysinfo.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sysinfo.h
new file mode 100644
index 00000000000..c5d9916d2dd
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/sysinfo.h
@@ -0,0 +1,10 @@
+#ifndef BENCHMARK_SYSINFO_H_
+#define BENCHMARK_SYSINFO_H_
+
+namespace benchmark {
+int NumCPUs();
+double CyclesPerSecond();
+bool CpuScalingEnabled();
+} // end namespace benchmark
+
+#endif // BENCHMARK_SYSINFO_H_
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/timers.cc b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/timers.cc
new file mode 100644
index 00000000000..8d56e8adf8d
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/timers.cc
@@ -0,0 +1,208 @@
+// Copyright 2015 Google Inc. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "timers.h"
+#include "internal_macros.h"
+
+#ifdef BENCHMARK_OS_WINDOWS
+#include <Shlwapi.h>
+#include <VersionHelpers.h>
+#include <Windows.h>
+#else
+#include <fcntl.h>
+#include <sys/resource.h>
+#include <sys/time.h>
+#include <sys/types.h> // this header must be included before 'sys/sysctl.h' to avoid compilation error on FreeBSD
+#include <unistd.h>
+#if defined BENCHMARK_OS_FREEBSD || defined BENCHMARK_OS_MACOSX
+#include <sys/sysctl.h>
+#endif
+#if defined(BENCHMARK_OS_MACOSX)
+#include <mach/mach_init.h>
+#include <mach/mach_port.h>
+#include <mach/thread_act.h>
+#endif
+#endif
+
+#ifdef BENCHMARK_OS_EMSCRIPTEN
+#include <emscripten.h>
+#endif
+
+#include <cerrno>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <iostream>
+#include <limits>
+#include <mutex>
+
+#include "check.h"
+#include "log.h"
+#include "sleep.h"
+#include "string_util.h"
+
+namespace benchmark {
+
+// Suppress unused warnings on helper functions.
+#if defined(__GNUC__)
+#pragma GCC diagnostic ignored "-Wunused-function"
+#endif
+
+namespace {
+#if defined(BENCHMARK_OS_WINDOWS)
+double MakeTime(FILETIME const& kernel_time, FILETIME const& user_time) {
+ ULARGE_INTEGER kernel;
+ ULARGE_INTEGER user;
+ kernel.HighPart = kernel_time.dwHighDateTime;
+ kernel.LowPart = kernel_time.dwLowDateTime;
+ user.HighPart = user_time.dwHighDateTime;
+ user.LowPart = user_time.dwLowDateTime;
+ return (static_cast<double>(kernel.QuadPart) +
+ static_cast<double>(user.QuadPart)) *
+ 1e-7;
+}
+#else
+double MakeTime(struct rusage const& ru) {
+ return (static_cast<double>(ru.ru_utime.tv_sec) +
+ static_cast<double>(ru.ru_utime.tv_usec) * 1e-6 +
+ static_cast<double>(ru.ru_stime.tv_sec) +
+ static_cast<double>(ru.ru_stime.tv_usec) * 1e-6);
+}
+#endif
+#if defined(BENCHMARK_OS_MACOSX)
+double MakeTime(thread_basic_info_data_t const& info) {
+ return (static_cast<double>(info.user_time.seconds) +
+ static_cast<double>(info.user_time.microseconds) * 1e-6 +
+ static_cast<double>(info.system_time.seconds) +
+ static_cast<double>(info.system_time.microseconds) * 1e-6);
+}
+#endif
+#if defined(CLOCK_PROCESS_CPUTIME_ID) || defined(CLOCK_THREAD_CPUTIME_ID)
+double MakeTime(struct timespec const& ts) {
+ return ts.tv_sec + (static_cast<double>(ts.tv_nsec) * 1e-9);
+}
+#endif
+
+BENCHMARK_NORETURN static void DiagnoseAndExit(const char* msg) {
+ std::cerr << "ERROR: " << msg << std::endl;
+ std::exit(EXIT_FAILURE);
+}
+
+} // end namespace
+
+double ProcessCPUUsage() {
+#if defined(BENCHMARK_OS_WINDOWS)
+ HANDLE proc = GetCurrentProcess();
+ FILETIME creation_time;
+ FILETIME exit_time;
+ FILETIME kernel_time;
+ FILETIME user_time;
+ if (GetProcessTimes(proc, &creation_time, &exit_time, &kernel_time,
+ &user_time))
+ return MakeTime(kernel_time, user_time);
+ DiagnoseAndExit("GetProccessTimes() failed");
+#elif defined(BENCHMARK_OS_EMSCRIPTEN)
+ // clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) returns 0 on Emscripten.
+ // Use Emscripten-specific API. Reported CPU time would be exactly the
+ // same as total time, but this is ok because there aren't long-latency
+ // syncronous system calls in Emscripten.
+ return emscripten_get_now() * 1e-3;
+#elif defined(CLOCK_PROCESS_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
+ // FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See
+ // https://github.com/google/benchmark/pull/292
+ struct timespec spec;
+ if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &spec) == 0)
+ return MakeTime(spec);
+ DiagnoseAndExit("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) failed");
+#else
+ struct rusage ru;
+ if (getrusage(RUSAGE_SELF, &ru) == 0) return MakeTime(ru);
+ DiagnoseAndExit("getrusage(RUSAGE_SELF, ...) failed");
+#endif
+}
+
+double ThreadCPUUsage() {
+#if defined(BENCHMARK_OS_WINDOWS)
+ HANDLE this_thread = GetCurrentThread();
+ FILETIME creation_time;
+ FILETIME exit_time;
+ FILETIME kernel_time;
+ FILETIME user_time;
+ GetThreadTimes(this_thread, &creation_time, &exit_time, &kernel_time,
+ &user_time);
+ return MakeTime(kernel_time, user_time);
+#elif defined(BENCHMARK_OS_MACOSX)
+ // FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See
+ // https://github.com/google/benchmark/pull/292
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
+ thread_basic_info_data_t info;
+ mach_port_t thread = pthread_mach_thread_np(pthread_self());
+ if (thread_info(thread, THREAD_BASIC_INFO, (thread_info_t)&info, &count) ==
+ KERN_SUCCESS) {
+ return MakeTime(info);
+ }
+ DiagnoseAndExit("ThreadCPUUsage() failed when evaluating thread_info");
+#elif defined(BENCHMARK_OS_EMSCRIPTEN)
+ // Emscripten doesn't support traditional threads
+ return ProcessCPUUsage();
+#elif defined(CLOCK_THREAD_CPUTIME_ID)
+ struct timespec ts;
+ if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) return MakeTime(ts);
+ DiagnoseAndExit("clock_gettime(CLOCK_THREAD_CPUTIME_ID, ...) failed");
+#else
+#error Per-thread timing is not available on your system.
+#endif
+}
+
+namespace {
+
+std::string DateTimeString(bool local) {
+ typedef std::chrono::system_clock Clock;
+ std::time_t now = Clock::to_time_t(Clock::now());
+ const std::size_t kStorageSize = 128;
+ char storage[kStorageSize];
+ std::size_t written;
+
+ if (local) {
+#if defined(BENCHMARK_OS_WINDOWS)
+ written =
+ std::strftime(storage, sizeof(storage), "%x %X", ::localtime(&now));
+#else
+ std::tm timeinfo;
+ std::memset(&timeinfo, 0, sizeof(std::tm));
+ ::localtime_r(&now, &timeinfo);
+ written = std::strftime(storage, sizeof(storage), "%F %T", &timeinfo);
+#endif
+ } else {
+#if defined(BENCHMARK_OS_WINDOWS)
+ written = std::strftime(storage, sizeof(storage), "%x %X", ::gmtime(&now));
+#else
+ std::tm timeinfo;
+ std::memset(&timeinfo, 0, sizeof(std::tm));
+ ::gmtime_r(&now, &timeinfo);
+ written = std::strftime(storage, sizeof(storage), "%F %T", &timeinfo);
+#endif
+ }
+ CHECK(written < kStorageSize);
+ ((void)written); // prevent unused variable in optimized mode.
+ return std::string(storage);
+}
+
+} // end namespace
+
+std::string LocalDateTimeString() { return DateTimeString(true); }
+
+} // end namespace benchmark
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/timers.h b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/timers.h
new file mode 100644
index 00000000000..65606ccd93d
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/src/timers.h
@@ -0,0 +1,48 @@
+#ifndef BENCHMARK_TIMERS_H
+#define BENCHMARK_TIMERS_H
+
+#include <chrono>
+#include <string>
+
+namespace benchmark {
+
+// Return the CPU usage of the current process
+double ProcessCPUUsage();
+
+// Return the CPU usage of the children of the current process
+double ChildrenCPUUsage();
+
+// Return the CPU usage of the current thread
+double ThreadCPUUsage();
+
+#if defined(HAVE_STEADY_CLOCK)
+template <bool HighResIsSteady = std::chrono::high_resolution_clock::is_steady>
+struct ChooseSteadyClock {
+ typedef std::chrono::high_resolution_clock type;
+};
+
+template <>
+struct ChooseSteadyClock<false> {
+ typedef std::chrono::steady_clock type;
+};
+#endif
+
+struct ChooseClockType {
+#if defined(HAVE_STEADY_CLOCK)
+ typedef ChooseSteadyClock<>::type type;
+#else
+ typedef std::chrono::high_resolution_clock type;
+#endif
+};
+
+inline double ChronoClockNow() {
+ typedef ChooseClockType::type ClockType;
+ using FpSeconds = std::chrono::duration<double, std::chrono::seconds::period>;
+ return FpSeconds(ClockType::now().time_since_epoch()).count();
+}
+
+std::string LocalDateTimeString();
+
+} // end namespace benchmark
+
+#endif // BENCHMARK_TIMERS_H
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/compare_bench.py b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/compare_bench.py
new file mode 100644
index 00000000000..d54baaa0e8f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/compare_bench.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+"""
+compare_bench.py - Compare two benchmarks or their results and report the
+ difference.
+"""
+import argparse
+from argparse import ArgumentParser
+import sys
+import gbench
+from gbench import util, report
+from gbench.util import *
+
+def check_inputs(in1, in2, flags):
+ """
+ Perform checking on the user provided inputs and diagnose any abnormalities
+ """
+ in1_kind, in1_err = classify_input_file(in1)
+ in2_kind, in2_err = classify_input_file(in2)
+ output_file = find_benchmark_flag('--benchmark_out=', flags)
+ output_type = find_benchmark_flag('--benchmark_out_format=', flags)
+ if in1_kind == IT_Executable and in2_kind == IT_Executable and output_file:
+ print(("WARNING: '--benchmark_out=%s' will be passed to both "
+ "benchmarks causing it to be overwritten") % output_file)
+ if in1_kind == IT_JSON and in2_kind == IT_JSON and len(flags) > 0:
+ print("WARNING: passing --benchmark flags has no effect since both "
+ "inputs are JSON")
+ if output_type is not None and output_type != 'json':
+ print(("ERROR: passing '--benchmark_out_format=%s' to 'compare_bench.py`"
+ " is not supported.") % output_type)
+ sys.exit(1)
+
+
+def main():
+ parser = ArgumentParser(
+ description='compare the results of two benchmarks')
+ parser.add_argument(
+ 'test1', metavar='test1', type=str, nargs=1,
+ help='A benchmark executable or JSON output file')
+ parser.add_argument(
+ 'test2', metavar='test2', type=str, nargs=1,
+ help='A benchmark executable or JSON output file')
+ # FIXME this is a dummy argument which will never actually match
+ # any --benchmark flags but it helps generate a better usage message
+ parser.add_argument(
+ 'benchmark_options', metavar='benchmark_option', nargs='*',
+ help='Arguments to pass when running benchmark executables'
+ )
+ args, unknown_args = parser.parse_known_args()
+ # Parse the command line flags
+ test1 = args.test1[0]
+ test2 = args.test2[0]
+ if args.benchmark_options:
+ print("Unrecognized positional argument arguments: '%s'"
+ % args.benchmark_options)
+ exit(1)
+ benchmark_options = unknown_args
+ check_inputs(test1, test2, benchmark_options)
+ # Run the benchmarks and report the results
+ json1 = gbench.util.run_or_load_benchmark(test1, benchmark_options)
+ json2 = gbench.util.run_or_load_benchmark(test2, benchmark_options)
+ output_lines = gbench.report.generate_difference_report(json1, json2)
+ print('Comparing %s to %s' % (test1, test2))
+ for ln in output_lines:
+ print(ln)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json
new file mode 100644
index 00000000000..37faed46d13
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json
@@ -0,0 +1,60 @@
+{
+ "context": {
+ "date": "2016-08-02 17:44:46",
+ "num_cpus": 4,
+ "mhz_per_cpu": 4228,
+ "cpu_scaling_enabled": false,
+ "library_build_type": "release"
+ },
+ "benchmarks": [
+ {
+ "name": "BM_SameTimes",
+ "iterations": 1000,
+ "real_time": 10,
+ "cpu_time": 10,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_2xFaster",
+ "iterations": 1000,
+ "real_time": 50,
+ "cpu_time": 50,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_2xSlower",
+ "iterations": 1000,
+ "real_time": 50,
+ "cpu_time": 50,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_10PercentFaster",
+ "iterations": 1000,
+ "real_time": 100,
+ "cpu_time": 100,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_10PercentSlower",
+ "iterations": 1000,
+ "real_time": 100,
+ "cpu_time": 100,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_100xSlower",
+ "iterations": 1000,
+ "real_time": 100,
+ "cpu_time": 100,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_100xFaster",
+ "iterations": 1000,
+ "real_time": 10000,
+ "cpu_time": 10000,
+ "time_unit": "ns"
+ }
+ ]
+} \ No newline at end of file
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json
new file mode 100644
index 00000000000..aed5151d392
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json
@@ -0,0 +1,60 @@
+{
+ "context": {
+ "date": "2016-08-02 17:44:46",
+ "num_cpus": 4,
+ "mhz_per_cpu": 4228,
+ "cpu_scaling_enabled": false,
+ "library_build_type": "release"
+ },
+ "benchmarks": [
+ {
+ "name": "BM_SameTimes",
+ "iterations": 1000,
+ "real_time": 10,
+ "cpu_time": 10,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_2xFaster",
+ "iterations": 1000,
+ "real_time": 25,
+ "cpu_time": 25,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_2xSlower",
+ "iterations": 20833333,
+ "real_time": 100,
+ "cpu_time": 100,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_10PercentFaster",
+ "iterations": 1000,
+ "real_time": 90,
+ "cpu_time": 90,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_10PercentSlower",
+ "iterations": 1000,
+ "real_time": 110,
+ "cpu_time": 110,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_100xSlower",
+ "iterations": 1000,
+ "real_time": 10000,
+ "cpu_time": 10000,
+ "time_unit": "ns"
+ },
+ {
+ "name": "BM_100xFaster",
+ "iterations": 1000,
+ "real_time": 100,
+ "cpu_time": 100,
+ "time_unit": "ns"
+ }
+ ]
+} \ No newline at end of file
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/__init__.py b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/__init__.py
new file mode 100644
index 00000000000..fce1a1acfbb
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/__init__.py
@@ -0,0 +1,8 @@
+"""Google Benchmark tooling"""
+
+__author__ = 'Eric Fiselier'
+__email__ = 'eric@efcs.ca'
+__versioninfo__ = (0, 5, 0)
+__version__ = '.'.join(str(v) for v in __versioninfo__) + 'dev'
+
+__all__ = []
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/report.py b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/report.py
new file mode 100644
index 00000000000..8f1b0fa8604
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/report.py
@@ -0,0 +1,144 @@
+"""report.py - Utilities for reporting statistics about benchmark results
+"""
+import os
+
+class BenchmarkColor(object):
+ def __init__(self, name, code):
+ self.name = name
+ self.code = code
+
+ def __repr__(self):
+ return '%s%r' % (self.__class__.__name__,
+ (self.name, self.code))
+
+ def __format__(self, format):
+ return self.code
+
+# Benchmark Colors Enumeration
+BC_NONE = BenchmarkColor('NONE', '')
+BC_MAGENTA = BenchmarkColor('MAGENTA', '\033[95m')
+BC_CYAN = BenchmarkColor('CYAN', '\033[96m')
+BC_OKBLUE = BenchmarkColor('OKBLUE', '\033[94m')
+BC_HEADER = BenchmarkColor('HEADER', '\033[92m')
+BC_WARNING = BenchmarkColor('WARNING', '\033[93m')
+BC_WHITE = BenchmarkColor('WHITE', '\033[97m')
+BC_FAIL = BenchmarkColor('FAIL', '\033[91m')
+BC_ENDC = BenchmarkColor('ENDC', '\033[0m')
+BC_BOLD = BenchmarkColor('BOLD', '\033[1m')
+BC_UNDERLINE = BenchmarkColor('UNDERLINE', '\033[4m')
+
+def color_format(use_color, fmt_str, *args, **kwargs):
+ """
+ Return the result of 'fmt_str.format(*args, **kwargs)' after transforming
+ 'args' and 'kwargs' according to the value of 'use_color'. If 'use_color'
+ is False then all color codes in 'args' and 'kwargs' are replaced with
+ the empty string.
+ """
+ assert use_color is True or use_color is False
+ if not use_color:
+ args = [arg if not isinstance(arg, BenchmarkColor) else BC_NONE
+ for arg in args]
+ kwargs = {key: arg if not isinstance(arg, BenchmarkColor) else BC_NONE
+ for key, arg in kwargs.items()}
+ return fmt_str.format(*args, **kwargs)
+
+
+def find_longest_name(benchmark_list):
+ """
+ Return the length of the longest benchmark name in a given list of
+ benchmark JSON objects
+ """
+ longest_name = 1
+ for bc in benchmark_list:
+ if len(bc['name']) > longest_name:
+ longest_name = len(bc['name'])
+ return longest_name
+
+
+def calculate_change(old_val, new_val):
+ """
+ Return a float representing the decimal change between old_val and new_val.
+ """
+ if old_val == 0 and new_val == 0:
+ return 0.0
+ if old_val == 0:
+ return float(new_val - old_val) / (float(old_val + new_val) / 2)
+ return float(new_val - old_val) / abs(old_val)
+
+
+def generate_difference_report(json1, json2, use_color=True):
+ """
+ Calculate and report the difference between each test of two benchmarks
+ runs specified as 'json1' and 'json2'.
+ """
+ first_col_width = find_longest_name(json1['benchmarks']) + 5
+ def find_test(name):
+ for b in json2['benchmarks']:
+ if b['name'] == name:
+ return b
+ return None
+ first_line = "{:<{}s} Time CPU Old New".format(
+ 'Benchmark', first_col_width)
+ output_strs = [first_line, '-' * len(first_line)]
+ for bn in json1['benchmarks']:
+ other_bench = find_test(bn['name'])
+ if not other_bench:
+ continue
+
+ def get_color(res):
+ if res > 0.05:
+ return BC_FAIL
+ elif res > -0.07:
+ return BC_WHITE
+ else:
+ return BC_CYAN
+ fmt_str = "{}{:<{}s}{endc}{}{:+9.2f}{endc}{}{:+14.2f}{endc}{:14d}{:14d}"
+ tres = calculate_change(bn['real_time'], other_bench['real_time'])
+ cpures = calculate_change(bn['cpu_time'], other_bench['cpu_time'])
+ output_strs += [color_format(use_color, fmt_str,
+ BC_HEADER, bn['name'], first_col_width,
+ get_color(tres), tres, get_color(cpures), cpures,
+ bn['cpu_time'], other_bench['cpu_time'],
+ endc=BC_ENDC)]
+ return output_strs
+
+###############################################################################
+# Unit tests
+
+import unittest
+
+class TestReportDifference(unittest.TestCase):
+ def load_results(self):
+ import json
+ testInputs = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Inputs')
+ testOutput1 = os.path.join(testInputs, 'test1_run1.json')
+ testOutput2 = os.path.join(testInputs, 'test1_run2.json')
+ with open(testOutput1, 'r') as f:
+ json1 = json.load(f)
+ with open(testOutput2, 'r') as f:
+ json2 = json.load(f)
+ return json1, json2
+
+ def test_basic(self):
+ expect_lines = [
+ ['BM_SameTimes', '+0.00', '+0.00', '10', '10'],
+ ['BM_2xFaster', '-0.50', '-0.50', '50', '25'],
+ ['BM_2xSlower', '+1.00', '+1.00', '50', '100'],
+ ['BM_10PercentFaster', '-0.10', '-0.10', '100', '90'],
+ ['BM_10PercentSlower', '+0.10', '+0.10', '100', '110'],
+ ['BM_100xSlower', '+99.00', '+99.00', '100', '10000'],
+ ['BM_100xFaster', '-0.99', '-0.99', '10000', '100'],
+ ]
+ json1, json2 = self.load_results()
+ output_lines_with_header = generate_difference_report(json1, json2, use_color=False)
+ output_lines = output_lines_with_header[2:]
+ print("\n".join(output_lines_with_header))
+ self.assertEqual(len(output_lines), len(expect_lines))
+ for i in xrange(0, len(output_lines)):
+ parts = [x for x in output_lines[i].split(' ') if x]
+ self.assertEqual(len(parts), 5)
+ self.assertEqual(parts, expect_lines[i])
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/util.py b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/util.py
new file mode 100644
index 00000000000..07c23772754
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/google-benchmark/tools/gbench/util.py
@@ -0,0 +1,159 @@
+"""util.py - General utilities for running, loading, and processing benchmarks
+"""
+import json
+import os
+import tempfile
+import subprocess
+import sys
+
+# Input file type enumeration
+IT_Invalid = 0
+IT_JSON = 1
+IT_Executable = 2
+
+_num_magic_bytes = 2 if sys.platform.startswith('win') else 4
+def is_executable_file(filename):
+ """
+ Return 'True' if 'filename' names a valid file which is likely
+ an executable. A file is considered an executable if it starts with the
+ magic bytes for a EXE, Mach O, or ELF file.
+ """
+ if not os.path.isfile(filename):
+ return False
+ with open(filename, mode='rb') as f:
+ magic_bytes = f.read(_num_magic_bytes)
+ if sys.platform == 'darwin':
+ return magic_bytes in [
+ b'\xfe\xed\xfa\xce', # MH_MAGIC
+ b'\xce\xfa\xed\xfe', # MH_CIGAM
+ b'\xfe\xed\xfa\xcf', # MH_MAGIC_64
+ b'\xcf\xfa\xed\xfe', # MH_CIGAM_64
+ b'\xca\xfe\xba\xbe', # FAT_MAGIC
+ b'\xbe\xba\xfe\xca' # FAT_CIGAM
+ ]
+ elif sys.platform.startswith('win'):
+ return magic_bytes == b'MZ'
+ else:
+ return magic_bytes == b'\x7FELF'
+
+
+def is_json_file(filename):
+ """
+ Returns 'True' if 'filename' names a valid JSON output file.
+ 'False' otherwise.
+ """
+ try:
+ with open(filename, 'r') as f:
+ json.load(f)
+ return True
+ except:
+ pass
+ return False
+
+
+def classify_input_file(filename):
+ """
+ Return a tuple (type, msg) where 'type' specifies the classified type
+ of 'filename'. If 'type' is 'IT_Invalid' then 'msg' is a human readable
+ string represeting the error.
+ """
+ ftype = IT_Invalid
+ err_msg = None
+ if not os.path.exists(filename):
+ err_msg = "'%s' does not exist" % filename
+ elif not os.path.isfile(filename):
+ err_msg = "'%s' does not name a file" % filename
+ elif is_executable_file(filename):
+ ftype = IT_Executable
+ elif is_json_file(filename):
+ ftype = IT_JSON
+ else:
+ err_msg = "'%s' does not name a valid benchmark executable or JSON file" % filename
+ return ftype, err_msg
+
+
+def check_input_file(filename):
+ """
+ Classify the file named by 'filename' and return the classification.
+ If the file is classified as 'IT_Invalid' print an error message and exit
+ the program.
+ """
+ ftype, msg = classify_input_file(filename)
+ if ftype == IT_Invalid:
+ print("Invalid input file: %s" % msg)
+ sys.exit(1)
+ return ftype
+
+def find_benchmark_flag(prefix, benchmark_flags):
+ """
+ Search the specified list of flags for a flag matching `<prefix><arg>` and
+ if it is found return the arg it specifies. If specified more than once the
+ last value is returned. If the flag is not found None is returned.
+ """
+ assert prefix.startswith('--') and prefix.endswith('=')
+ result = None
+ for f in benchmark_flags:
+ if f.startswith(prefix):
+ result = f[len(prefix):]
+ return result
+
+def remove_benchmark_flags(prefix, benchmark_flags):
+ """
+ Return a new list containing the specified benchmark_flags except those
+ with the specified prefix.
+ """
+ assert prefix.startswith('--') and prefix.endswith('=')
+ return [f for f in benchmark_flags if not f.startswith(prefix)]
+
+def load_benchmark_results(fname):
+ """
+ Read benchmark output from a file and return the JSON object.
+ REQUIRES: 'fname' names a file containing JSON benchmark output.
+ """
+ with open(fname, 'r') as f:
+ return json.load(f)
+
+
+def run_benchmark(exe_name, benchmark_flags):
+ """
+ Run a benchmark specified by 'exe_name' with the specified
+ 'benchmark_flags'. The benchmark is run directly as a subprocess to preserve
+ real time console output.
+ RETURNS: A JSON object representing the benchmark output
+ """
+ output_name = find_benchmark_flag('--benchmark_out=',
+ benchmark_flags)
+ is_temp_output = False
+ if output_name is None:
+ is_temp_output = True
+ thandle, output_name = tempfile.mkstemp()
+ os.close(thandle)
+ benchmark_flags = list(benchmark_flags) + \
+ ['--benchmark_out=%s' % output_name]
+
+ cmd = [exe_name] + benchmark_flags
+ print("RUNNING: %s" % ' '.join(cmd))
+ exitCode = subprocess.call(cmd)
+ if exitCode != 0:
+ print('TEST FAILED...')
+ sys.exit(exitCode)
+ json_res = load_benchmark_results(output_name)
+ if is_temp_output:
+ os.unlink(output_name)
+ return json_res
+
+
+def run_or_load_benchmark(filename, benchmark_flags):
+ """
+ Get the results for a specified benchmark. If 'filename' specifies
+ an executable benchmark then the results are generated by running the
+ benchmark. Otherwise 'filename' must name a valid JSON output file,
+ which is loaded and the result returned.
+ """
+ ftype = check_input_file(filename)
+ if ftype == IT_JSON:
+ return load_benchmark_results(filename)
+ elif ftype == IT_Executable:
+ return run_benchmark(filename, benchmark_flags)
+ else:
+ assert False # This branch is unreachable \ No newline at end of file
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/__init__.py b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/__init__.py
new file mode 100644
index 00000000000..7523a3d8bb9
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/__init__.py
@@ -0,0 +1,17 @@
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
+"""libcxx python utilities"""
+
+__author__ = 'Eric Fiselier'
+__email__ = 'eric@efcs.ca'
+__versioninfo__ = (0, 1, 0)
+__version__ = ' '.join(str(v) for v in __versioninfo__) + 'dev'
+
+__all__ = []
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/compiler.py b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/compiler.py
new file mode 100644
index 00000000000..e908e26089b
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/compiler.py
@@ -0,0 +1,291 @@
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
+import platform
+import os
+import libcxx.util
+
+
+class CXXCompiler(object):
+ CM_Default = 0
+ CM_PreProcess = 1
+ CM_Compile = 2
+ CM_Link = 3
+
+ def __init__(self, path, flags=None, compile_flags=None, link_flags=None,
+ warning_flags=None, verify_supported=None,
+ verify_flags=None, use_verify=False,
+ modules_flags=None, use_modules=False,
+ use_ccache=False, use_warnings=False, compile_env=None,
+ cxx_type=None, cxx_version=None):
+ self.source_lang = 'c++'
+ self.path = path
+ self.flags = list(flags or [])
+ self.compile_flags = list(compile_flags or [])
+ self.link_flags = list(link_flags or [])
+ self.warning_flags = list(warning_flags or [])
+ self.verify_supported = verify_supported
+ self.use_verify = use_verify
+ self.verify_flags = list(verify_flags or [])
+ assert not use_verify or verify_supported
+ assert not use_verify or verify_flags is not None
+ self.modules_flags = list(modules_flags or [])
+ self.use_modules = use_modules
+ assert not use_modules or modules_flags is not None
+ self.use_ccache = use_ccache
+ self.use_warnings = use_warnings
+ if compile_env is not None:
+ self.compile_env = dict(compile_env)
+ else:
+ self.compile_env = None
+ self.type = cxx_type
+ self.version = cxx_version
+ if self.type is None or self.version is None:
+ self._initTypeAndVersion()
+
+ def isVerifySupported(self):
+ if self.verify_supported is None:
+ self.verify_supported = self.hasCompileFlag(['-Xclang',
+ '-verify-ignore-unexpected'])
+ if self.verify_supported:
+ self.verify_flags = [
+ '-Xclang', '-verify',
+ '-Xclang', '-verify-ignore-unexpected=note',
+ '-ferror-limit=1024'
+ ]
+ return self.verify_supported
+
+ def useVerify(self, value=True):
+ self.use_verify = value
+ assert not self.use_verify or self.verify_flags is not None
+
+ def useModules(self, value=True):
+ self.use_modules = value
+ assert not self.use_modules or self.modules_flags is not None
+
+ def useCCache(self, value=True):
+ self.use_ccache = value
+
+ def useWarnings(self, value=True):
+ self.use_warnings = value
+
+ def _initTypeAndVersion(self):
+ # Get compiler type and version
+ macros = self.dumpMacros()
+ if macros is None:
+ return
+ compiler_type = None
+ major_ver = minor_ver = patchlevel = None
+ if '__clang__' in macros.keys():
+ compiler_type = 'clang'
+ # Treat apple's llvm fork differently.
+ if '__apple_build_version__' in macros.keys():
+ compiler_type = 'apple-clang'
+ major_ver = macros['__clang_major__']
+ minor_ver = macros['__clang_minor__']
+ patchlevel = macros['__clang_patchlevel__']
+ elif '__GNUC__' in macros.keys():
+ compiler_type = 'gcc'
+ major_ver = macros['__GNUC__']
+ minor_ver = macros['__GNUC_MINOR__']
+ patchlevel = macros['__GNUC_PATCHLEVEL__']
+ self.type = compiler_type
+ self.version = (major_ver, minor_ver, patchlevel)
+
+ def _basicCmd(self, source_files, out, mode=CM_Default, flags=[],
+ input_is_cxx=False):
+ cmd = []
+ if self.use_ccache \
+ and not mode == self.CM_Link \
+ and not mode == self.CM_PreProcess:
+ cmd += ['ccache']
+ cmd += [self.path]
+ if out is not None:
+ cmd += ['-o', out]
+ if input_is_cxx:
+ cmd += ['-x', self.source_lang]
+ if isinstance(source_files, list):
+ cmd += source_files
+ elif isinstance(source_files, str):
+ cmd += [source_files]
+ else:
+ raise TypeError('source_files must be a string or list')
+ if mode == self.CM_PreProcess:
+ cmd += ['-E']
+ elif mode == self.CM_Compile:
+ cmd += ['-c']
+ cmd += self.flags
+ if self.use_verify:
+ cmd += self.verify_flags
+ assert mode in [self.CM_Default, self.CM_Compile]
+ if self.use_modules:
+ cmd += self.modules_flags
+ if mode != self.CM_Link:
+ cmd += self.compile_flags
+ if self.use_warnings:
+ cmd += self.warning_flags
+ if mode != self.CM_PreProcess and mode != self.CM_Compile:
+ cmd += self.link_flags
+ cmd += flags
+ return cmd
+
+ def preprocessCmd(self, source_files, out=None, flags=[]):
+ return self._basicCmd(source_files, out, flags=flags,
+ mode=self.CM_PreProcess,
+ input_is_cxx=True)
+
+ def compileCmd(self, source_files, out=None, flags=[]):
+ return self._basicCmd(source_files, out, flags=flags,
+ mode=self.CM_Compile,
+ input_is_cxx=True) + ['-c']
+
+ def linkCmd(self, source_files, out=None, flags=[]):
+ return self._basicCmd(source_files, out, flags=flags,
+ mode=self.CM_Link)
+
+ def compileLinkCmd(self, source_files, out=None, flags=[]):
+ return self._basicCmd(source_files, out, flags=flags)
+
+ def preprocess(self, source_files, out=None, flags=[], cwd=None):
+ cmd = self.preprocessCmd(source_files, out, flags)
+ out, err, rc = libcxx.util.executeCommand(cmd, env=self.compile_env,
+ cwd=cwd)
+ return cmd, out, err, rc
+
+ def compile(self, source_files, out=None, flags=[], cwd=None):
+ cmd = self.compileCmd(source_files, out, flags)
+ out, err, rc = libcxx.util.executeCommand(cmd, env=self.compile_env,
+ cwd=cwd)
+ return cmd, out, err, rc
+
+ def link(self, source_files, out=None, flags=[], cwd=None):
+ cmd = self.linkCmd(source_files, out, flags)
+ out, err, rc = libcxx.util.executeCommand(cmd, env=self.compile_env,
+ cwd=cwd)
+ return cmd, out, err, rc
+
+ def compileLink(self, source_files, out=None, flags=[],
+ cwd=None):
+ cmd = self.compileLinkCmd(source_files, out, flags)
+ out, err, rc = libcxx.util.executeCommand(cmd, env=self.compile_env,
+ cwd=cwd)
+ return cmd, out, err, rc
+
+ def compileLinkTwoSteps(self, source_file, out=None, object_file=None,
+ flags=[], cwd=None):
+ if not isinstance(source_file, str):
+ raise TypeError('This function only accepts a single input file')
+ if object_file is None:
+ # Create, use and delete a temporary object file if none is given.
+ with_fn = lambda: libcxx.util.guardedTempFilename(suffix='.o')
+ else:
+ # Otherwise wrap the filename in a context manager function.
+ with_fn = lambda: libcxx.util.nullContext(object_file)
+ with with_fn() as object_file:
+ cc_cmd, cc_stdout, cc_stderr, rc = self.compile(
+ source_file, object_file, flags=flags, cwd=cwd)
+ if rc != 0:
+ return cc_cmd, cc_stdout, cc_stderr, rc
+
+ link_cmd, link_stdout, link_stderr, rc = self.link(
+ object_file, out=out, flags=flags, cwd=cwd)
+ return (cc_cmd + ['&&'] + link_cmd, cc_stdout + link_stdout,
+ cc_stderr + link_stderr, rc)
+
+ def dumpMacros(self, source_files=None, flags=[], cwd=None):
+ if source_files is None:
+ source_files = os.devnull
+ flags = ['-dM'] + flags
+ cmd, out, err, rc = self.preprocess(source_files, flags=flags, cwd=cwd)
+ if rc != 0:
+ return None
+ parsed_macros = {}
+ lines = [l.strip() for l in out.split('\n') if l.strip()]
+ for l in lines:
+ assert l.startswith('#define ')
+ l = l[len('#define '):]
+ macro, _, value = l.partition(' ')
+ parsed_macros[macro] = value
+ return parsed_macros
+
+ def getTriple(self):
+ cmd = [self.path] + self.flags + ['-dumpmachine']
+ return libcxx.util.capture(cmd).strip()
+
+ def hasCompileFlag(self, flag):
+ if isinstance(flag, list):
+ flags = list(flag)
+ else:
+ flags = [flag]
+ # Add -Werror to ensure that an unrecognized flag causes a non-zero
+ # exit code. -Werror is supported on all known compiler types.
+ if self.type is not None:
+ flags += ['-Werror', '-fsyntax-only']
+ cmd, out, err, rc = self.compile(os.devnull, out=os.devnull,
+ flags=flags)
+ return rc == 0
+
+ def addFlagIfSupported(self, flag):
+ if isinstance(flag, list):
+ flags = list(flag)
+ else:
+ flags = [flag]
+ if self.hasCompileFlag(flags):
+ self.flags += flags
+ return True
+ else:
+ return False
+
+ def addCompileFlagIfSupported(self, flag):
+ if isinstance(flag, list):
+ flags = list(flag)
+ else:
+ flags = [flag]
+ if self.hasCompileFlag(flags):
+ self.compile_flags += flags
+ return True
+ else:
+ return False
+
+ def hasWarningFlag(self, flag):
+ """
+ hasWarningFlag - Test if the compiler supports a given warning flag.
+ Unlike addCompileFlagIfSupported, this function detects when
+ "-Wno-<warning>" flags are unsupported. If flag is a
+ "-Wno-<warning>" GCC will not emit an unknown option diagnostic unless
+ another error is triggered during compilation.
+ """
+ assert isinstance(flag, str)
+ assert flag.startswith('-W')
+ if not flag.startswith('-Wno-'):
+ return self.hasCompileFlag(flag)
+ flags = ['-Werror', flag]
+ old_use_warnings = self.use_warnings
+ self.useWarnings(False)
+ cmd = self.compileCmd('-', os.devnull, flags)
+ self.useWarnings(old_use_warnings)
+ # Remove '-v' because it will cause the command line invocation
+ # to be printed as part of the error output.
+ # TODO(EricWF): Are there other flags we need to worry about?
+ if '-v' in cmd:
+ cmd.remove('-v')
+ out, err, rc = libcxx.util.executeCommand(
+ cmd, input=libcxx.util.to_bytes('#error\n'))
+
+ assert rc != 0
+ if flag in err:
+ return False
+ return True
+
+ def addWarningFlagIfSupported(self, flag):
+ if self.hasWarningFlag(flag):
+ if flag not in self.warning_flags:
+ self.warning_flags += [flag]
+ return True
+ return False
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/__init__.py b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/__init__.py
new file mode 100644
index 00000000000..1aa2b450c12
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/__init__.py
@@ -0,0 +1,17 @@
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
+"""libcxx abi symbol checker"""
+
+__author__ = 'Eric Fiselier'
+__email__ = 'eric@efcs.ca'
+__versioninfo__ = (0, 1, 0)
+__version__ = ' '.join(str(v) for v in __versioninfo__) + 'dev'
+
+__all__ = ['diff', 'extract', 'util']
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/diff.py b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/diff.py
index a16e54d34e0..0821ef6f780 100644
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/diff.py
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/diff.py
@@ -1,9 +1,17 @@
# -*- Python -*- vim: set syntax=python tabstop=4 expandtab cc=80:
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
"""
diff - A set of functions for diff-ing two symbol lists.
"""
-from sym_check import util
+from libcxx.sym_check import util
def _symbol_difference(lhs, rhs):
@@ -35,7 +43,7 @@ def changed_symbols(old, new):
continue
new_sym = _find_by_key(new, old_sym['name'])
if (new_sym is not None and not new_sym in old
- and cmp(old_sym, new_sym) != 0):
+ and old_sym != new_sym):
changed += [(old_sym, new_sym)]
return changed
@@ -90,4 +98,6 @@ def report_diff(added_syms, removed_syms, changed_syms, names_only=False,
report += 'ABI BREAKAGE: SYMBOLS ADDED OR REMOVED!'
else:
report += 'Symbols match.'
- return report, int(abi_break)
+ is_different = abi_break or bool(len(added_syms)) \
+ or bool(len(changed_syms))
+ return report, abi_break, is_different
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/extract.py b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/extract.py
index b4f4cee2dc5..152ff97db17 100644
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/extract.py
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/extract.py
@@ -1,12 +1,23 @@
# -*- Python -*- vim: set syntax=python tabstop=4 expandtab cc=80:
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
"""
extract - A set of function that extract symbol lists from shared libraries.
"""
import distutils.spawn
import sys
+import re
-from sym_check import util
+import libcxx.util
+from libcxx.sym_check import util
+extract_ignore_names = ['_init', '_fini']
class NMExtractor(object):
"""
@@ -38,7 +49,7 @@ class NMExtractor(object):
parsed symbols.
"""
cmd = [self.nm_exe] + self.flags + [lib]
- out, _, exit_code = util.execute_command_verbose(cmd)
+ out, _, exit_code = libcxx.util.executeCommandVerbose(cmd)
if exit_code != 0:
raise RuntimeError('Failed to run %s on %s' % (self.nm_exe, lib))
fmt_syms = (self._extract_sym(l)
@@ -57,7 +68,8 @@ class NMExtractor(object):
return None
new_sym = {
'name': bits[0],
- 'type': bits[1]
+ 'type': bits[1],
+ 'is_defined': (bits[1].lower() != 'u')
}
new_sym['name'] = new_sym['name'].replace('@@', '@')
new_sym = self._transform_sym_type(new_sym)
@@ -73,6 +85,8 @@ class NMExtractor(object):
"""
if sym is None or len(sym) < 2:
return False
+ if sym['name'] in extract_ignore_names:
+ return False
bad_types = ['t', 'b', 'r', 'd', 'w']
return (sym['type'] not in bad_types
and sym['name'] not in ['__bss_start', '_end', '_edata'])
@@ -121,7 +135,7 @@ class ReadElfExtractor(object):
parsed symbols.
"""
cmd = [self.tool] + self.flags + [lib]
- out, _, exit_code = util.execute_command_verbose(cmd)
+ out, _, exit_code = libcxx.util.executeCommandVerbose(cmd)
if exit_code != 0:
raise RuntimeError('Failed to run %s on %s' % (self.nm_exe, lib))
dyn_syms = self.get_dynsym_table(out)
@@ -140,8 +154,11 @@ class ReadElfExtractor(object):
'name': parts[7],
'size': int(parts[2]),
'type': parts[3],
+ 'is_defined': (parts[6] != 'UND')
}
assert new_sym['type'] in ['OBJECT', 'FUNC', 'NOTYPE']
+ if new_sym['name'] in extract_ignore_names:
+ continue
if new_sym['type'] == 'NOTYPE':
continue
if new_sym['type'] == 'FUNC':
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/match.py b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/match.py
index 9f496427e37..fae400e4e77 100644
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/match.py
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/match.py
@@ -1,4 +1,12 @@
# -*- Python -*- vim: set syntax=python tabstop=4 expandtab cc=80:
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
"""
match - A set of functions for matching symbols in a list to a list of regexs
"""
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/util.py b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/util.py
new file mode 100644
index 00000000000..8a4c4ab496f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/sym_check/util.py
@@ -0,0 +1,268 @@
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
+import ast
+import distutils.spawn
+import sys
+import re
+import libcxx.util
+
+
+def read_syms_from_list(slist):
+ """
+ Read a list of symbols from a list of strings.
+ Each string is one symbol.
+ """
+ return [ast.literal_eval(l) for l in slist]
+
+
+def read_syms_from_file(filename):
+ """
+ Read a list of symbols in from a file.
+ """
+ with open(filename, 'r') as f:
+ data = f.read()
+ return read_syms_from_list(data.splitlines())
+
+
+def read_blacklist(filename):
+ with open(filename, 'r') as f:
+ data = f.read()
+ lines = [l.strip() for l in data.splitlines() if l.strip()]
+ lines = [l for l in lines if not l.startswith('#')]
+ return lines
+
+
+def write_syms(sym_list, out=None, names_only=False):
+ """
+ Write a list of symbols to the file named by out.
+ """
+ out_str = ''
+ out_list = sym_list
+ out_list.sort(key=lambda x: x['name'])
+ if names_only:
+ out_list = [sym['name'] for sym in sym_list]
+ for sym in out_list:
+ out_str += '%s\n' % sym
+ if out is None:
+ sys.stdout.write(out_str)
+ else:
+ with open(out, 'w') as f:
+ f.write(out_str)
+
+
+_cppfilt_exe = distutils.spawn.find_executable('c++filt')
+
+
+def demangle_symbol(symbol):
+ if _cppfilt_exe is None:
+ return symbol
+ out, _, exit_code = libcxx.util.executeCommandVerbose(
+ [_cppfilt_exe], input=symbol)
+ if exit_code != 0:
+ return symbol
+ return out
+
+
+def is_elf(filename):
+ with open(filename, 'rb') as f:
+ magic_bytes = f.read(4)
+ return magic_bytes == b'\x7fELF'
+
+
+def is_mach_o(filename):
+ with open(filename, 'rb') as f:
+ magic_bytes = f.read(4)
+ return magic_bytes in [
+ '\xfe\xed\xfa\xce', # MH_MAGIC
+ '\xce\xfa\xed\xfe', # MH_CIGAM
+ '\xfe\xed\xfa\xcf', # MH_MAGIC_64
+ '\xcf\xfa\xed\xfe', # MH_CIGAM_64
+ '\xca\xfe\xba\xbe', # FAT_MAGIC
+ '\xbe\xba\xfe\xca' # FAT_CIGAM
+ ]
+
+
+def is_library_file(filename):
+ if sys.platform == 'darwin':
+ return is_mach_o(filename)
+ else:
+ return is_elf(filename)
+
+
+def extract_or_load(filename):
+ import libcxx.sym_check.extract
+ if is_library_file(filename):
+ return libcxx.sym_check.extract.extract_symbols(filename)
+ return read_syms_from_file(filename)
+
+def adjust_mangled_name(name):
+ if not name.startswith('__Z'):
+ return name
+ return name[1:]
+
+new_delete_std_symbols = [
+ '_Znam',
+ '_Znwm',
+ '_ZdaPv',
+ '_ZdaPvm',
+ '_ZdlPv',
+ '_ZdlPvm'
+]
+
+cxxabi_symbols = [
+ '___dynamic_cast',
+ '___gxx_personality_v0',
+ '_ZTIDi',
+ '_ZTIDn',
+ '_ZTIDs',
+ '_ZTIPDi',
+ '_ZTIPDn',
+ '_ZTIPDs',
+ '_ZTIPKDi',
+ '_ZTIPKDn',
+ '_ZTIPKDs',
+ '_ZTIPKa',
+ '_ZTIPKb',
+ '_ZTIPKc',
+ '_ZTIPKd',
+ '_ZTIPKe',
+ '_ZTIPKf',
+ '_ZTIPKh',
+ '_ZTIPKi',
+ '_ZTIPKj',
+ '_ZTIPKl',
+ '_ZTIPKm',
+ '_ZTIPKs',
+ '_ZTIPKt',
+ '_ZTIPKv',
+ '_ZTIPKw',
+ '_ZTIPKx',
+ '_ZTIPKy',
+ '_ZTIPa',
+ '_ZTIPb',
+ '_ZTIPc',
+ '_ZTIPd',
+ '_ZTIPe',
+ '_ZTIPf',
+ '_ZTIPh',
+ '_ZTIPi',
+ '_ZTIPj',
+ '_ZTIPl',
+ '_ZTIPm',
+ '_ZTIPs',
+ '_ZTIPt',
+ '_ZTIPv',
+ '_ZTIPw',
+ '_ZTIPx',
+ '_ZTIPy',
+ '_ZTIa',
+ '_ZTIb',
+ '_ZTIc',
+ '_ZTId',
+ '_ZTIe',
+ '_ZTIf',
+ '_ZTIh',
+ '_ZTIi',
+ '_ZTIj',
+ '_ZTIl',
+ '_ZTIm',
+ '_ZTIs',
+ '_ZTIt',
+ '_ZTIv',
+ '_ZTIw',
+ '_ZTIx',
+ '_ZTIy',
+ '_ZTSDi',
+ '_ZTSDn',
+ '_ZTSDs',
+ '_ZTSPDi',
+ '_ZTSPDn',
+ '_ZTSPDs',
+ '_ZTSPKDi',
+ '_ZTSPKDn',
+ '_ZTSPKDs',
+ '_ZTSPKa',
+ '_ZTSPKb',
+ '_ZTSPKc',
+ '_ZTSPKd',
+ '_ZTSPKe',
+ '_ZTSPKf',
+ '_ZTSPKh',
+ '_ZTSPKi',
+ '_ZTSPKj',
+ '_ZTSPKl',
+ '_ZTSPKm',
+ '_ZTSPKs',
+ '_ZTSPKt',
+ '_ZTSPKv',
+ '_ZTSPKw',
+ '_ZTSPKx',
+ '_ZTSPKy',
+ '_ZTSPa',
+ '_ZTSPb',
+ '_ZTSPc',
+ '_ZTSPd',
+ '_ZTSPe',
+ '_ZTSPf',
+ '_ZTSPh',
+ '_ZTSPi',
+ '_ZTSPj',
+ '_ZTSPl',
+ '_ZTSPm',
+ '_ZTSPs',
+ '_ZTSPt',
+ '_ZTSPv',
+ '_ZTSPw',
+ '_ZTSPx',
+ '_ZTSPy',
+ '_ZTSa',
+ '_ZTSb',
+ '_ZTSc',
+ '_ZTSd',
+ '_ZTSe',
+ '_ZTSf',
+ '_ZTSh',
+ '_ZTSi',
+ '_ZTSj',
+ '_ZTSl',
+ '_ZTSm',
+ '_ZTSs',
+ '_ZTSt',
+ '_ZTSv',
+ '_ZTSw',
+ '_ZTSx',
+ '_ZTSy'
+]
+
+def is_stdlib_symbol_name(name):
+ name = adjust_mangled_name(name)
+ if re.search("@GLIBC|@GCC", name):
+ return False
+ if re.search('(St[0-9])|(__cxa)|(__cxxabi)', name):
+ return True
+ if name in new_delete_std_symbols:
+ return True
+ if name in cxxabi_symbols:
+ return True
+ if name.startswith('_Z'):
+ return True
+ return False
+
+def filter_stdlib_symbols(syms):
+ stdlib_symbols = []
+ other_symbols = []
+ for s in syms:
+ canon_name = adjust_mangled_name(s['name'])
+ if not is_stdlib_symbol_name(canon_name):
+ assert not s['is_defined'] and "found defined non-std symbol"
+ other_symbols += [s]
+ else:
+ stdlib_symbols += [s]
+ return stdlib_symbols, other_symbols
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/util.py b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/util.py
new file mode 100644
index 00000000000..ecfb9afb73b
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/libcxx/util.py
@@ -0,0 +1,286 @@
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
+from contextlib import contextmanager
+import errno
+import os
+import platform
+import signal
+import subprocess
+import sys
+import tempfile
+import threading
+
+
+# FIXME: Most of these functions are cribbed from LIT
+def to_bytes(str):
+ # Encode to UTF-8 to get binary data.
+ if isinstance(str, bytes):
+ return str
+ return str.encode('utf-8')
+
+def to_string(bytes):
+ if isinstance(bytes, str):
+ return bytes
+ return to_bytes(bytes)
+
+def convert_string(bytes):
+ try:
+ return to_string(bytes.decode('utf-8'))
+ except AttributeError: # 'str' object has no attribute 'decode'.
+ return str(bytes)
+ except UnicodeError:
+ return str(bytes)
+
+
+def cleanFile(filename):
+ try:
+ os.remove(filename)
+ except OSError:
+ pass
+
+
+@contextmanager
+def guardedTempFilename(suffix='', prefix='', dir=None):
+ # Creates and yeilds a temporary filename within a with statement. The file
+ # is removed upon scope exit.
+ handle, name = tempfile.mkstemp(suffix=suffix, prefix=prefix, dir=dir)
+ os.close(handle)
+ yield name
+ cleanFile(name)
+
+
+@contextmanager
+def guardedFilename(name):
+ # yeilds a filename within a with statement. The file is removed upon scope
+ # exit.
+ yield name
+ cleanFile(name)
+
+
+@contextmanager
+def nullContext(value):
+ # yeilds a variable within a with statement. No action is taken upon scope
+ # exit.
+ yield value
+
+
+def makeReport(cmd, out, err, rc):
+ report = "Command: %s\n" % cmd
+ report += "Exit Code: %d\n" % rc
+ if out:
+ report += "Standard Output:\n--\n%s--\n" % out
+ if err:
+ report += "Standard Error:\n--\n%s--\n" % err
+ report += '\n'
+ return report
+
+
+def capture(args, env=None):
+ """capture(command) - Run the given command (or argv list) in a shell and
+ return the standard output. Raises a CalledProcessError if the command
+ exits with a non-zero status."""
+ p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ env=env)
+ out, err = p.communicate()
+ out = convert_string(out)
+ err = convert_string(err)
+ if p.returncode != 0:
+ raise subprocess.CalledProcessError(cmd=args,
+ returncode=p.returncode,
+ output="{}\n{}".format(out, err))
+ return out
+
+
+def which(command, paths = None):
+ """which(command, [paths]) - Look up the given command in the paths string
+ (or the PATH environment variable, if unspecified)."""
+
+ if paths is None:
+ paths = os.environ.get('PATH','')
+
+ # Check for absolute match first.
+ if os.path.isfile(command):
+ return command
+
+ # Would be nice if Python had a lib function for this.
+ if not paths:
+ paths = os.defpath
+
+ # Get suffixes to search.
+ # On Cygwin, 'PATHEXT' may exist but it should not be used.
+ if os.pathsep == ';':
+ pathext = os.environ.get('PATHEXT', '').split(';')
+ else:
+ pathext = ['']
+
+ # Search the paths...
+ for path in paths.split(os.pathsep):
+ for ext in pathext:
+ p = os.path.join(path, command + ext)
+ if os.path.exists(p) and not os.path.isdir(p):
+ return p
+
+ return None
+
+
+def checkToolsPath(dir, tools):
+ for tool in tools:
+ if not os.path.exists(os.path.join(dir, tool)):
+ return False
+ return True
+
+
+def whichTools(tools, paths):
+ for path in paths.split(os.pathsep):
+ if checkToolsPath(path, tools):
+ return path
+ return None
+
+def mkdir_p(path):
+ """mkdir_p(path) - Make the "path" directory, if it does not exist; this
+ will also make directories for any missing parent directories."""
+ if not path or os.path.exists(path):
+ return
+
+ parent = os.path.dirname(path)
+ if parent != path:
+ mkdir_p(parent)
+
+ try:
+ os.mkdir(path)
+ except OSError:
+ e = sys.exc_info()[1]
+ # Ignore EEXIST, which may occur during a race condition.
+ if e.errno != errno.EEXIST:
+ raise
+
+
+class ExecuteCommandTimeoutException(Exception):
+ def __init__(self, msg, out, err, exitCode):
+ assert isinstance(msg, str)
+ assert isinstance(out, str)
+ assert isinstance(err, str)
+ assert isinstance(exitCode, int)
+ self.msg = msg
+ self.out = out
+ self.err = err
+ self.exitCode = exitCode
+
+# Close extra file handles on UNIX (on Windows this cannot be done while
+# also redirecting input).
+kUseCloseFDs = not (platform.system() == 'Windows')
+def executeCommand(command, cwd=None, env=None, input=None, timeout=0):
+ """
+ Execute command ``command`` (list of arguments or string)
+ with
+ * working directory ``cwd`` (str), use None to use the current
+ working directory
+ * environment ``env`` (dict), use None for none
+ * Input to the command ``input`` (str), use string to pass
+ no input.
+ * Max execution time ``timeout`` (int) seconds. Use 0 for no timeout.
+
+ Returns a tuple (out, err, exitCode) where
+ * ``out`` (str) is the standard output of running the command
+ * ``err`` (str) is the standard error of running the command
+ * ``exitCode`` (int) is the exitCode of running the command
+
+ If the timeout is hit an ``ExecuteCommandTimeoutException``
+ is raised.
+ """
+ if input is not None:
+ input = to_bytes(input)
+ p = subprocess.Popen(command, cwd=cwd,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env=env, close_fds=kUseCloseFDs)
+ timerObject = None
+ # FIXME: Because of the way nested function scopes work in Python 2.x we
+ # need to use a reference to a mutable object rather than a plain
+ # bool. In Python 3 we could use the "nonlocal" keyword but we need
+ # to support Python 2 as well.
+ hitTimeOut = [False]
+ try:
+ if timeout > 0:
+ def killProcess():
+ # We may be invoking a shell so we need to kill the
+ # process and all its children.
+ hitTimeOut[0] = True
+ killProcessAndChildren(p.pid)
+
+ timerObject = threading.Timer(timeout, killProcess)
+ timerObject.start()
+
+ out,err = p.communicate(input=input)
+ exitCode = p.wait()
+ finally:
+ if timerObject != None:
+ timerObject.cancel()
+
+ # Ensure the resulting output is always of string type.
+ out = convert_string(out)
+ err = convert_string(err)
+
+ if hitTimeOut[0]:
+ raise ExecuteCommandTimeoutException(
+ msg='Reached timeout of {} seconds'.format(timeout),
+ out=out,
+ err=err,
+ exitCode=exitCode
+ )
+
+ # Detect Ctrl-C in subprocess.
+ if exitCode == -signal.SIGINT:
+ raise KeyboardInterrupt
+
+ return out, err, exitCode
+
+
+def killProcessAndChildren(pid):
+ """
+ This function kills a process with ``pid`` and all its
+ running children (recursively). It is currently implemented
+ using the psutil module which provides a simple platform
+ neutral implementation.
+
+ TODO: Reimplement this without using psutil so we can
+ remove our dependency on it.
+ """
+ import psutil
+ try:
+ psutilProc = psutil.Process(pid)
+ # Handle the different psutil API versions
+ try:
+ # psutil >= 2.x
+ children_iterator = psutilProc.children(recursive=True)
+ except AttributeError:
+ # psutil 1.x
+ children_iterator = psutilProc.get_children(recursive=True)
+ for child in children_iterator:
+ try:
+ child.kill()
+ except psutil.NoSuchProcess:
+ pass
+ psutilProc.kill()
+ except psutil.NoSuchProcess:
+ pass
+
+
+def executeCommandVerbose(cmd, *args, **kwargs):
+ """
+ Execute a command and print its output on failure.
+ """
+ out, err, exitCode = executeCommand(cmd, *args, **kwargs)
+ if exitCode != 0:
+ report = makeReport(cmd, out, err, exitCode)
+ report += "\n\nFailed!"
+ sys.stderr.write('%s\n' % report)
+ return out, err, exitCode
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/merge_archives.py b/chromium/buildtools/third_party/libc++/trunk/utils/merge_archives.py
new file mode 100755
index 00000000000..856dd3bfae9
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/merge_archives.py
@@ -0,0 +1,130 @@
+#!/usr/bin/env python
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
+from argparse import ArgumentParser
+from ctypes.util import find_library
+import distutils.spawn
+import glob
+import tempfile
+import os
+import shutil
+import subprocess
+import signal
+import sys
+
+temp_directory_root = None
+def exit_with_cleanups(status):
+ if temp_directory_root is not None:
+ shutil.rmtree(temp_directory_root)
+ sys.exit(status)
+
+def print_and_exit(msg):
+ sys.stderr.write(msg + '\n')
+ exit_with_cleanups(1)
+
+def find_and_diagnose_missing(lib, search_paths):
+ if os.path.exists(lib):
+ return os.path.abspath(lib)
+ if not lib.startswith('lib') or not lib.endswith('.a'):
+ print_and_exit(("input file '%s' not not name a static library. "
+ "It should start with 'lib' and end with '.a") % lib)
+ for sp in search_paths:
+ assert type(sp) is list and len(sp) == 1
+ path = os.path.join(sp[0], lib)
+ if os.path.exists(path):
+ return os.path.abspath(path)
+ print_and_exit("input '%s' does not exist" % lib)
+
+
+def execute_command(cmd, cwd=None):
+ """
+ Execute a command, capture and return its output.
+ """
+ kwargs = {
+ 'stdin': subprocess.PIPE,
+ 'stdout': subprocess.PIPE,
+ 'stderr': subprocess.PIPE,
+ 'cwd': cwd
+ }
+ p = subprocess.Popen(cmd, **kwargs)
+ out, err = p.communicate()
+ exitCode = p.wait()
+ if exitCode == -signal.SIGINT:
+ raise KeyboardInterrupt
+ return out, err, exitCode
+
+
+def execute_command_verbose(cmd, cwd=None, verbose=False):
+ """
+ Execute a command and print its output on failure.
+ """
+ out, err, exitCode = execute_command(cmd, cwd=cwd)
+ if exitCode != 0 or verbose:
+ report = "Command: %s\n" % ' '.join(["'%s'" % a for a in cmd])
+ if exitCode != 0:
+ report += "Exit Code: %d\n" % exitCode
+ if out:
+ report += "Standard Output:\n--\n%s--" % out
+ if err:
+ report += "Standard Error:\n--\n%s--" % err
+ if exitCode != 0:
+ report += "\n\nFailed!"
+ sys.stderr.write('%s\n' % report)
+ if exitCode != 0:
+ exit_with_cleanups(exitCode)
+
+def main():
+ parser = ArgumentParser(
+ description="Merge multiple archives into a single library")
+ parser.add_argument(
+ '-v', '--verbose', dest='verbose', action='store_true', default=False)
+ parser.add_argument(
+ '-o', '--output', dest='output', required=True,
+ help='The output file. stdout is used if not given',
+ type=str, action='store')
+ parser.add_argument(
+ '-L', dest='search_paths',
+ help='Paths to search for the libraries along', action='append',
+ nargs=1)
+ parser.add_argument(
+ 'archives', metavar='archives', nargs='+',
+ help='The archives to merge')
+
+ args = parser.parse_args()
+
+ ar_exe = distutils.spawn.find_executable('ar')
+ if not ar_exe:
+ print_and_exit("failed to find 'ar' executable")
+
+ if len(args.archives) < 2:
+ print_and_exit('fewer than 2 inputs provided')
+ archives = [find_and_diagnose_missing(ar, args.search_paths)
+ for ar in args.archives]
+ print ('Merging archives: %s' % archives)
+ if not os.path.exists(os.path.dirname(args.output)):
+ print_and_exit("output path doesn't exist: '%s'" % args.output)
+
+ global temp_directory_root
+ temp_directory_root = tempfile.mkdtemp('.libcxx.merge.archives')
+
+ for arc in archives:
+ execute_command_verbose([ar_exe, '-x', arc], cwd=temp_directory_root,
+ verbose=args.verbose)
+
+ files = glob.glob(os.path.join(temp_directory_root, '*.o'))
+ if not files:
+ print_and_exit('Failed to glob for %s' % glob_path)
+ cmd = [ar_exe, '-qc', args.output] + files
+ execute_command_verbose(cmd, cwd=temp_directory_root, verbose=args.verbose)
+
+
+if __name__ == '__main__':
+ main()
+ exit_with_cleanups(0)
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/not/not.py b/chromium/buildtools/third_party/libc++/trunk/utils/not.py
index 96e4ea7eee1..d9ceb8515d0 100644
--- a/chromium/buildtools/third_party/libc++/trunk/utils/not/not.py
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/not.py
@@ -1,3 +1,12 @@
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
"""not.py is a utility for inverting the return code of commands.
It acts similar to llvm/utils/not.
ex: python /path/to/not.py ' echo hello
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/__init__.py b/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/__init__.py
deleted file mode 100644
index 3c668036e47..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/__init__.py
+++ /dev/null
@@ -1,8 +0,0 @@
-"""libcxx abi symbol checker"""
-
-__author__ = 'Eric Fiselier'
-__email__ = 'eric@efcs.ca'
-__versioninfo__ = (0, 1, 0)
-__version__ = ' '.join(str(v) for v in __versioninfo__) + 'dev'
-
-__all__ = ['diff', 'extract', 'util']
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/util.py b/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/util.py
deleted file mode 100644
index 1d3b424f6f3..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_check/util.py
+++ /dev/null
@@ -1,128 +0,0 @@
-import ast
-import distutils.spawn
-import signal
-import subprocess
-import sys
-
-
-def execute_command(cmd, input_str=None):
- """
- Execute a command, capture and return its output.
- """
- kwargs = {
- 'stdin': subprocess.PIPE,
- 'stdout': subprocess.PIPE,
- 'stderr': subprocess.PIPE,
- }
- p = subprocess.Popen(cmd, **kwargs)
- out, err = p.communicate(input=input_str)
- exitCode = p.wait()
- if exitCode == -signal.SIGINT:
- raise KeyboardInterrupt
- return out, err, exitCode
-
-
-def execute_command_verbose(cmd, input_str=None):
- """
- Execute a command and print its output on failure.
- """
- out, err, exitCode = execute_command(cmd, input_str=input_str)
- if exitCode != 0:
- report = "Command: %s\n" % ' '.join(["'%s'" % a for a in cmd])
- report += "Exit Code: %d\n" % exitCode
- if out:
- report += "Standard Output:\n--\n%s--" % out
- if err:
- report += "Standard Error:\n--\n%s--" % err
- report += "\n\nFailed!"
- sys.stderr.write('%s\n' % report)
- return out, err, exitCode
-
-
-def read_syms_from_list(slist):
- """
- Read a list of symbols from a list of strings.
- Each string is one symbol.
- """
- return [ast.literal_eval(l) for l in slist]
-
-
-def read_syms_from_file(filename):
- """
- Read a list of symbols in from a file.
- """
- with open(filename, 'r') as f:
- data = f.read()
- return read_syms_from_list(data.splitlines())
-
-
-def read_blacklist(filename):
- with open(filename, 'r') as f:
- data = f.read()
- lines = [l.strip() for l in data.splitlines() if l.strip()]
- lines = [l for l in lines if not l.startswith('#')]
- return lines
-
-
-def write_syms(sym_list, out=None, names_only=False):
- """
- Write a list of symbols to the file named by out.
- """
- out_str = ''
- out_list = sym_list
- if names_only:
- out_list = [sym['name'] for sym in sym_list]
- out_list.sort()
- for sym in out_list:
- out_str += '%s\n' % sym
- if out is None:
- sys.stdout.write(out_str)
- else:
- with open(out, 'w') as f:
- f.write(out_str)
-
-
-_cppfilt_exe = distutils.spawn.find_executable('c++filt')
-
-
-def demangle_symbol(symbol):
- if _cppfilt_exe is None:
- return symbol
- out, _, exit_code = execute_command_verbose(
- [_cppfilt_exe], input_str=symbol)
- if exit_code != 0:
- return symbol
- return out
-
-
-def is_elf(filename):
- with open(filename, 'r') as f:
- magic_bytes = f.read(4)
- return magic_bytes == '\x7fELF'
-
-
-def is_mach_o(filename):
- with open(filename, 'r') as f:
- magic_bytes = f.read(4)
- return magic_bytes in [
- '\xfe\xed\xfa\xce', # MH_MAGIC
- '\xce\xfa\xed\xfe', # MH_CIGAM
- '\xfe\xed\xfa\xcf', # MH_MAGIC_64
- '\xcf\xfa\xed\xfe', # MH_CIGAM_64
- '\xca\xfe\xba\xbe', # FAT_MAGIC
- '\xbe\xba\xfe\xca' # FAT_CIGAM
- ]
-
-
-def is_library_file(filename):
- if sys.platform == 'darwin':
- return is_mach_o(filename)
- else:
- return is_elf(filename)
-
-
-def extract_or_load(filename):
- import sym_check.extract
- if is_library_file(filename):
- return sym_check.extract.extract_symbols(filename)
- return read_syms_from_file(filename)
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_diff.py b/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_diff.py
deleted file mode 100755
index 054c6c18e3e..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_diff.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python
-"""
-sym_diff - Compare two symbol lists and output the differences.
-"""
-from argparse import ArgumentParser
-import sys
-from sym_check import diff, util
-
-
-def main():
- parser = ArgumentParser(
- description='Extract a list of symbols from a shared library.')
- parser.add_argument(
- '--names-only', dest='names_only',
- help='Only print symbol names',
- action='store_true', default=False)
- parser.add_argument(
- '-o', '--output', dest='output',
- help='The output file. stdout is used if not given',
- type=str, action='store', default=None)
- parser.add_argument(
- '--demangle', dest='demangle', action='store_true', default=False)
- parser.add_argument(
- 'old_syms', metavar='old-syms', type=str,
- help='The file containing the old symbol list or a library')
- parser.add_argument(
- 'new_syms', metavar='new-syms', type=str,
- help='The file containing the new symbol list or a library')
- args = parser.parse_args()
-
- old_syms_list = util.extract_or_load(args.old_syms)
- new_syms_list = util.extract_or_load(args.new_syms)
-
- added, removed, changed = diff.diff(old_syms_list, new_syms_list)
- report, is_break = diff.report_diff(added, removed, changed,
- names_only=args.names_only,
- demangle=args.demangle)
- if args.output is None:
- print(report)
- else:
- with open(args.output, 'w') as f:
- f.write(report + '\n')
- sys.exit(is_break)
-
-
-if __name__ == '__main__':
- main()
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_diff.py b/chromium/buildtools/third_party/libc++/trunk/utils/sym_diff.py
new file mode 100755
index 00000000000..c01f71c928d
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/sym_diff.py
@@ -0,0 +1,73 @@
+#!/usr/bin/env python
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+"""
+sym_diff - Compare two symbol lists and output the differences.
+"""
+
+from argparse import ArgumentParser
+import sys
+from libcxx.sym_check import diff, util
+
+
+def main():
+ parser = ArgumentParser(
+ description='Extract a list of symbols from a shared library.')
+ parser.add_argument(
+ '--names-only', dest='names_only',
+ help='Only print symbol names',
+ action='store_true', default=False)
+ parser.add_argument(
+ '--removed-only', dest='removed_only',
+ help='Only print removed symbols',
+ action='store_true', default=False)
+ parser.add_argument('--only-stdlib-symbols', dest='only_stdlib',
+ help="Filter all symbols not related to the stdlib",
+ action='store_true', default=False)
+ parser.add_argument('--strict', dest='strict',
+ help="Exit with a non-zero status if any symbols "
+ "differ",
+ action='store_true', default=False)
+ parser.add_argument(
+ '-o', '--output', dest='output',
+ help='The output file. stdout is used if not given',
+ type=str, action='store', default=None)
+ parser.add_argument(
+ '--demangle', dest='demangle', action='store_true', default=False)
+ parser.add_argument(
+ 'old_syms', metavar='old-syms', type=str,
+ help='The file containing the old symbol list or a library')
+ parser.add_argument(
+ 'new_syms', metavar='new-syms', type=str,
+ help='The file containing the new symbol list or a library')
+ args = parser.parse_args()
+
+ old_syms_list = util.extract_or_load(args.old_syms)
+ new_syms_list = util.extract_or_load(args.new_syms)
+
+ if args.only_stdlib:
+ old_syms_list, _ = util.filter_stdlib_symbols(old_syms_list)
+ new_syms_list, _ = util.filter_stdlib_symbols(new_syms_list)
+
+ added, removed, changed = diff.diff(old_syms_list, new_syms_list)
+ if args.removed_only:
+ added = {}
+ report, is_break, is_different = diff.report_diff(
+ added, removed, changed, names_only=args.names_only,
+ demangle=args.demangle)
+ if args.output is None:
+ print(report)
+ else:
+ with open(args.output, 'w') as f:
+ f.write(report + '\n')
+ exit_code = 1 if is_break or (args.strict and is_different) else 0
+ sys.exit(exit_code)
+
+if __name__ == '__main__':
+ main()
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_extract.py b/chromium/buildtools/third_party/libc++/trunk/utils/sym_extract.py
index 5d8953986b2..0d9d2eeb8e5 100755
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_extract.py
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/sym_extract.py
@@ -1,9 +1,17 @@
#!/usr/bin/env python
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
"""
sym_extract - Extract and output a list of symbols from a shared library.
"""
from argparse import ArgumentParser
-from sym_check import extract, util
+from libcxx.sym_check import extract, util
def main():
@@ -17,11 +25,16 @@ def main():
parser.add_argument('--names-only', dest='names_only',
help='Output only the name of the symbol',
action='store_true', default=False)
+ parser.add_argument('--only-stdlib-symbols', dest='only_stdlib',
+ help="Filter all symbols not related to the stdlib",
+ action='store_true', default=False)
args = parser.parse_args()
if args.output is not None:
print('Extracting symbols from %s to %s.'
% (args.library, args.output))
syms = extract.extract_symbols(args.library)
+ if args.only_stdlib:
+ syms, other_syms = util.filter_stdlib_symbols(syms)
util.write_syms(syms, out=args.output, names_only=args.names_only)
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_match.py b/chromium/buildtools/third_party/libc++/trunk/utils/sym_match.py
index c60b2462935..48582ce6667 100755
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/sym_match.py
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/sym_match.py
@@ -1,10 +1,19 @@
#!/usr/bin/env python
+#===----------------------------------------------------------------------===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is dual licensed under the MIT and the University of Illinois Open
+# Source Licenses. See LICENSE.TXT for details.
+#
+#===----------------------------------------------------------------------===##
+
"""
sym_match - Match all symbols in a list against a list of regexes.
"""
from argparse import ArgumentParser
import sys
-from sym_check import util, match, extract
+from libcxx.sym_check import util, match, extract
def main():
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/linux_blacklist.txt b/chromium/buildtools/third_party/libc++/trunk/utils/symcheck-blacklists/linux_blacklist.txt
index 4d9d1d4b9e3..4d9d1d4b9e3 100644
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/linux_blacklist.txt
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/symcheck-blacklists/linux_blacklist.txt
diff --git a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/osx_blacklist.txt b/chromium/buildtools/third_party/libc++/trunk/utils/symcheck-blacklists/osx_blacklist.txt
index cfa911ed74e..cfa911ed74e 100644
--- a/chromium/buildtools/third_party/libc++/trunk/utils/sym_check/osx_blacklist.txt
+++ b/chromium/buildtools/third_party/libc++/trunk/utils/symcheck-blacklists/osx_blacklist.txt
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/atomic_design.html b/chromium/buildtools/third_party/libc++/trunk/www/atomic_design.html
index 67021b8736e..ab5ed6eb5f2 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/atomic_design.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/atomic_design.html
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_a.html b/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_a.html
index 8e9fef23f7e..8175469b351 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_a.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_a.html
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_b.html b/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_b.html
index 17ba9b3c1e3..78c7abd5127 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_b.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_b.html
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_c.html b/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_c.html
index 9c92b884704..b4319174aba 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_c.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/atomic_design_c.html
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/cxx1y_status.html b/chromium/buildtools/third_party/libc++/trunk/www/cxx1y_status.html
index f28d67a7dd3..28fd2397389 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/cxx1y_status.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/cxx1y_status.html
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/cxx1z_status.html b/chromium/buildtools/third_party/libc++/trunk/www/cxx1z_status.html
index 42bc3d76032..80b53021c1f 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/cxx1z_status.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/cxx1z_status.html
@@ -3,7 +3,7 @@
<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
<html>
<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>libc++ C++1Z Status</title>
<link type="text/css" rel="stylesheet" href="menu.css">
<link type="text/css" rel="stylesheet" href="content.css">
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
@@ -35,7 +35,8 @@
<h1>libc++ C++1z Status</h1>
<!--*********************************************************************-->
- <p>In November 2014, the C++ standard committee created a draft for the next version of the C++ standard, known here as "C++1z" (probably to be C++17)</p>
+ <p>In November 2014, the C++ standard committee created a draft for the next version of the C++ standard, known here as "C++1z" (probably to be C++17).</p>
+ <p>In February 2017, the C++ standard committee approved this draft, and sent it to ISO for approval as C++17</p>
<p>This page shows the status of libc++; the status of clang's support of the language features is <a href="http://clang.llvm.org/cxx_status.html#cxx17">here</a>.</p>
<p>The groups that have contributed papers:
@@ -53,146 +54,442 @@
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3346.pdf">3346</a></td><td>LWG</td><td>Terminology for Container Element Requirements - Rev 1</td><td>Kona</td><td>Complete</td><td>3.4</td></tr>
-->
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3911">N3911</a></td><td>LWG</td></td><td>TransformationTrait Alias <code>void_t</code>.</td><td>Urbana</td><td>Complete</td><td>3.6</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089">N4089</a></td><td>LWG</td></td><td>Safe conversions in <code>unique_ptr&lt;T[]&gt;</code>.</td><td>Urbana</td><td></td><td></td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089">N4089</a></td><td>LWG</td></td><td>Safe conversions in <code>unique_ptr&lt;T[]&gt;</code>.</td><td>Urbana</td><td>In progress</td><td>3.9</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4169">N4169</a></td><td>LWG</td></td><td>A proposal to add invoke function template</td><td>Urbana</td><td>Complete</td><td>3.7</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190">N4190</a></td></td><td>LWG</td><td>Removing auto_ptr, random_shuffle(), And Old <functional> Stuff.</td><td>Urbana</td><td></td><td></td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190">N4190</a></td></td><td>LWG</td><td>Removing auto_ptr, random_shuffle(), And Old <functional> Stuff.</td><td>Urbana</td><td>In progress</td><td></td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258">N4258</a></td><td>LWG</td></td><td>Cleaning-up noexcept in the Library.</td><td>Urbana</td><td>In progress</td><td>3.7</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4259">N4259</a></td><td>CWG</td></td><td>Wording for std::uncaught_exceptions</td><td>Urbana</td><td>Complete</td><td>3.7</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4277">N4277</a></td><td>LWG</td></td><td>TriviallyCopyable <code>reference_wrapper</code>.</td><td>Urbana</td><td>Complete</td><td>3.2</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279">N4279</a></td><td>LWG</td></td><td>Improved insertion interface for unique-key maps.</td><td>Urbana</td><td>Complete</td><td>3.7</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4280">N4280</a></td><td>LWG</td></td><td>Non-member size() and more</td><td>Urbana</td><td>Complete</td><td>3.6</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4284">N4284</a></td><td>LWG</td></td><td>Contiguous Iterators.</td><td>Urbana</td><td>Complete</td><td>3.6</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4285">N4285</a></td><td>CWG</td></td><td>Cleanup for exception-specification and throw-expression.</td><td>Urbana</td><td></td><td></td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4285">N4285</a></td><td>CWG</td></td><td>Cleanup for exception-specification and throw-expression.</td><td>Urbana</td><td>Complete</td><td>4.0</td></tr>
<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387">N4387</a></td><td>LWG</td></td><td>improving pair and tuple</td><td>Lenexa</td><td></td><td></td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387">N4387</a></td><td>LWG</td></td><td>improving pair and tuple</td><td>Lenexa</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4389">N4389</a></td><td>LWG</td></td><td>bool_constant</td><td>Lenexa</td><td>Complete</td><td>3.7</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4508">N4508</a></td><td>LWG</td></td><td>shared_mutex for C++17</td><td>Lenexa</td><td>Complete</td><td>3.7</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4366">N4366</a></td><td>LWG</td></td><td>LWG 2228 missing SFINAE rule</td><td>Lenexa</td><td>Complete</td><td>3.1</td></tr>
<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510">N4510</a></td><td>LWG</td></td><td>Minimal incomplete type support for standard containers, revision 4</td><td>Lenexa</td><td>Complete</td><td>3.6</td></tr>
<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0004R1.html">P0004R1</a></td><td>LWG</td><td>Remove Deprecated iostreams aliases.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0006R0.html">P0006R0</a></td><td>LWG</td><td>Adopt Type Traits Variable Templates for C++17.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0092R1.html">P0092R1</a></td><td>LWG</td><td>Polishing &lt;chrono&gt;</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0007R1.html">P0007R1</a></td><td>LWG</td><td>Constant View: A proposal for a <tt>std::as_const</tt> helper function template.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0156R0.htm" >P0156R0</a></td><td>LWG</td><td>Variadic lock_guard(rev 3).</td><td>Kona</td><td></td><td></td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0074R0.html">P0074R0</a></td><td>LWG</td><td>Making <tt>std::owner_less</tt> more flexible</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0013R1.html">P0013R1</a></td><td>LWG</td><td>Logical type traits rev 2</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0004r1.html">P0004R1</a></td><td>LWG</td><td>Remove Deprecated iostreams aliases.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0006r0.html">P0006R0</a></td><td>LWG</td><td>Adopt Type Traits Variable Templates for C++17.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0092r1.html">P0092R1</a></td><td>LWG</td><td>Polishing &lt;chrono&gt;</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0007r1.html">P0007R1</a></td><td>LWG</td><td>Constant View: A proposal for a <tt>std::as_const</tt> helper function template.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0156r0.html" >P0156R0</a></td><td>LWG</td><td>Variadic lock_guard(rev 3).</td><td>Kona</td><td><I>Reverted in Kona</I></td><td>3.9</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0074r0.html">P0074R0</a></td><td>LWG</td><td>Making <tt>std::owner_less</tt> more flexible</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0013r1.html">P0013R1</a></td><td>LWG</td><td>Logical type traits rev 2</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+ <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0024R2">P0024R2</a></td><td>LWG</td><td>The Parallelism TS Should be Standardized</td><td>Jacksonville</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0226R1">P0226R1</a></td><td>LWG</td><td>Mathematical Special Functions for C++17</td><td>Jacksonville</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0220R1">P0220R1</a></td><td>LWG</td><td>Adopt Library Fundamentals V1 TS Components for C++17</td><td>Jacksonville</td><td>In Progress</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0218R1">P0218R1</a></td><td>LWG</td><td>Adopt the File System TS for C++17</td><td>Jacksonville</td><td>In Progress</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0033R1">P0033R1</a></td><td>LWG</td><td>Re-enabling shared_from_this</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/P0005R4">P0005R4</a></td><td>LWG</td><td>Adopt not_fn from Library Fundamentals 2 for C++17</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/P0152R1">P0152R1</a></td><td>LWG</td><td>constexpr atomic::is_always_lock_free</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/P0185R1">P0185R1</a></td><td>LWG</td><td>Adding [nothrow-]swappable traits</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/P0253R1">P0253R1</a></td><td>LWG</td><td>Fixing a design mistake in the searchers interface</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/P0025R0">P0025R0</a></td><td>LWG</td><td>An algorithm to "clamp" a value between a pair of boundary values</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/P0154R1">P0154R1</a></td><td>LWG</td><td>constexpr std::hardware_{constructive,destructive}_interference_size</td><td>Jacksonville</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0030R1">P0030R1</a></td><td>LWG</td><td>Proposal to Introduce a 3-Argument Overload to std::hypot</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/P0031R0">P0031R0</a></td><td>LWG</td><td>A Proposal to Add Constexpr Modifiers to reverse_iterator, move_iterator, array and Range Access</td><td>Jacksonville</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0272R1">P0272R1</a></td><td>LWG</td><td>Give <tt>std::string</tt> a non-const <tt>.data()</tt> member function</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/P0077R2">P0077R2</a></td><td>LWG</td><td><tt>is_callable</tt>, the missing INVOKE related trait</td><td>Jacksonville</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0032r3">p0032r3</a></td><td>LWG</td><td>Homogeneous interface for variant, any and optional</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0040r3">p0040r3</a></td><td>LWG</td><td>Extending memory management tools</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0063r3">p0063r3</a></td><td>LWG</td><td>C++17 should refer to C11 instead of C99</td><td>Oulu</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/p0067r3">p0067r3</a></td><td>LWG</td><td>Elementary string conversions</td><td>Oulu</td><td>Now <a href="http://wg21.link/P0067R5">P0067R5</a></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0083r3">p0083r3</a></td><td>LWG</td><td>Splicing Maps and Sets</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0084r2">p0084r2</a></td><td>LWG</td><td>Emplace Return Type</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0088r3">p0088r3</a></td><td>LWG</td><td>Variant: a type-safe union for C++17</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0163r0">p0163r0</a></td><td>LWG</td><td>shared_ptr::weak_type</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/p0174r2">p0174r2</a></td><td>LWG</td><td>Deprecating Vestigial Library Parts in C++17</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0175r1">p0175r1</a></td><td>LWG</td><td>Synopses for the C library</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0180r2">p0180r2</a></td><td>LWG</td><td>Reserve a New Library Namespace for Future Standardization</td><td>Oulu</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/p0181r1">p0181r1</a></td><td>LWG</td><td>Ordered by Default</td><td>Oulu</td><td><i>Removed in Kona</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/p0209r2">p0209r2</a></td><td>LWG</td><td>make_from_tuple: apply for construction</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/p0219r1">p0219r1</a></td><td>LWG</td><td>Relative Paths for Filesystem</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0254r2">p0254r2</a></td><td>LWG</td><td>Integrating std::string_view and std::string</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0258r2">p0258r2</a></td><td>LWG</td><td>has_unique_object_representations</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0295r0">p0295r0</a></td><td>LWG</td><td>Adopt Selected Library Fundamentals V2 Components for C++17</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0302r1">p0302r1</a></td><td>LWG</td><td>Removing Allocator Support in std::function</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0307r2">p0307r2</a></td><td>LWG</td><td>Making Optional Greater Equal Again</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0336r1">p0336r1</a></td><td>LWG</td><td>Better Names for Parallel Execution Policies in C++17</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/p0337r0">p0337r0</a></td><td>LWG</td><td>Delete operator= for polymorphic_allocator</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/p0346r1">p0346r1</a></td><td>LWG</td><td>A &lt;random&gt; Nomenclature Tweak</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/p0358r1">p0358r1</a></td><td>LWG</td><td>Fixes for not_fn</td><td>Oulu</td><td>Complete</td><td>3.9</td></tr>
+ <tr><td><a href="http://wg21.link/p0371r1">p0371r1</a></td><td>LWG</td><td>Temporarily discourage memory_order_consume</td><td>Oulu</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/p0392r0">p0392r0</a></td><td>LWG</td><td>Adapting string_view by filesystem paths</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/p0393r3">p0393r3</a></td><td>LWG</td><td>Making Variant Greater Equal</td><td>Oulu</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0394r4">P0394r4</a></td><td>LWG</td><td>Hotel Parallelifornia: terminate() for Parallel Algorithms Exception Handling</td><td>Oulu</td><td></td><td></td></tr>
+ <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0003R5">P0003R5</a></td><td>LWG</td><td>Removing Deprecated Exception Specifications from C++17</td><td>Issaquah</td><td>Complete</td><td>5.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0067R5">P0067R5</a></td><td>LWG</td><td>Elementary string conversions, revision 5</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0403R1">P0403R1</a></td><td>LWG</td><td>Literal suffixes for <tt>basic_string_view</tt></td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0414R2">P0414R2</a></td><td>LWG</td><td>Merging shared_ptr changes from Library Fundamentals to C++17</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0418R2">P0418R2</a></td><td>LWG</td><td>Fail or succeed: there is no atomic lattice</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0426R1">P0426R1</a></td><td>LWG</td><td>Constexpr for <tt>std::char_traits</tt></td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0435R1">P0435R1</a></td><td>LWG</td><td>Resolving LWG Issues re <tt>common_type</tt></td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0502R0">P0502R0</a></td><td>LWG</td><td>Throwing out of a parallel algorithm terminates - but how?</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0503R0">P0503R0</a></td><td>LWG</td><td>Correcting library usage of "literal type"</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0504R0">P0504R0</a></td><td>LWG</td><td>Revisiting in-place tag types for any/optional/variant</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0505R0">P0505R0</a></td><td>LWG</td><td>Wording for GB 50 - constexpr for chrono</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0508R0">P0508R0</a></td><td>LWG</td><td>Wording for GB 58 - structured bindings for node_handles</td><td>Issaquah</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0509R1">P0509R1</a></td><td>LWG</td><td>Updating “Restrictions on exception handling”</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td><a href="http://wg21.link/P0510R0">P0510R0</a></td><td>LWG</td><td>Disallowing references, incomplete types, arrays, and empty variants</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0513R0">P0513R0</a></td><td>LWG</td><td>Poisoning the Hash</td><td>Issaquah</td><td>Complete</td><td>5.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0516R0">P0516R0</a></td><td>LWG</td><td>Clarify That shared_future’s Copy Operations have Wide Contracts</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0517R0">P0517R0</a></td><td>LWG</td><td>Make future_error Constructible</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0521R0">P0521R0</a></td><td>LWG</td><td>Proposed Resolution for CA 14 (shared_ptr use_count/unique)</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
+ <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0156R2">P0156R2</a></td><td>LWG</td><td>Variadic Lock guard(rev 5)</td><td>Kona</td><td>Complete</td><td>5.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0270R3">P0270R3</a></td><td>CWG</td><td>Removing C dependencies from signal handler wording</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0298R3">P0298R3</a></td><td>CWG</td><td>A byte type definition</td><td>Kona</td><td>Complete</td><td>5.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0317R1">P0317R1</a></td><td>LWG</td><td>Directory Entry Caching for Filesystem</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0430R2">P0430R2</a></td><td>LWG</td><td>File system library on non-POSIX-like operating systems</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0433R2">P0433R2</a></td><td>LWG</td><td>Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0452R1">P0452R1</a></td><td>LWG</td><td>Unifying &lt;numeric&gt; Parallel Algorithms</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0467R2">P0467R2</a></td><td>LWG</td><td>Iterator Concerns for Parallel Algorithms</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0492R2">P0492R2</a></td><td>LWG</td><td>Proposed Resolution of C++17 National Body Comments for Filesystems</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0518R1">P0518R1</a></td><td>LWG</td><td>Allowing copies as arguments to function objects given to parallel algorithms in response to CH11</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0523R1">P0523R1</a></td><td>LWG</td><td>Wording for CH 10: Complexity of parallel algorithms</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0548R1">P0548R1</a></td><td>LWG</td><td>common_type and duration</td><td>Kona</td><td>Complete</td><td>5.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0558R1">P0558R1</a></td><td>LWG</td><td>Resolving atomic&lt;T&gt; named base class inconsistencies</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0574R1">P0574R1</a></td><td>LWG</td><td>Algorithm Complexity Constraints and Parallel Overloads</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0599R1">P0599R1</a></td><td>LWG</td><td>noexcept for hash functions</td><td>Kona</td><td>Complete</td><td>5.0</td></tr>
+ <tr><td><a href="http://wg21.link/P0604R0">P0604R0</a></td><td>LWG</td><td>Resolving GB 55, US 84, US 85, US 86</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0607R0">P0607R0</a></td><td>LWG</td><td>Inline Variables for the Standard Library</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0618R0">P0618R0</a></td><td>LWG</td><td>Deprecating &lt;codecvt&gt;</td><td>Kona</td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/P0623R0">P0623R0</a></td><td>LWG</td><td>Final C++17 Parallel Algorithms Fixes</td><td>Kona</td><td></td><td></td></tr>
+
<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
</table>
+<p><i>[ Note: "Nothing to do" means that no library changes were needed to implement this change -- end note]</i></p>
+
<h3>Library Working group Issues Status</h3>
<!-- <I>Note: "NAD" means that the issue was deemed "Not a defect"</I> -->
<table id="issues" border="1">
<tr><th>Issue #</th><th>Issue Name</th><th>Meeting</th><th>Status</th></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2016">2016</a></td><td>Allocators must be no-throw swappable</td><td>Urbana</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2376">2118</td><td><code>unique_ptr</code> for array does not support cv qualification conversion of actual argument</td><td>Urbana</td><td>Will be resolved by N4089</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2170">2170</a></td><td>Aggregates cannot be <code>DefaultConstructible</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2308">2308</td><td>Clarify container destructor requirements w.r.t. <code>std::array</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2340">2340</a></td><td>Replacement allocation functions declared as inline</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2354">2354</a></td><td>Unnecessary copying when inserting into maps with braced-init syntax</td><td>Urbana</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2377">2377</a></td><td><code>std::align</code> requirements overly strict</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2396">2396</a></td><td><code>underlying_type</code> doesn't say what to do for an incomplete enumeration type</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2399">2399</a></td><td><code>shared_ptr</code>'s constructor from <code>unique_ptr</code> should be constrained</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2400">2400</a></td><td><code>shared_ptr</code>'s <code>get_deleter()</code> should use <code>addressof()</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2401">2401</a></td><td><code>std::function</code> needs more noexcept</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2404">2404</a></td><td><code>mismatch()</code>'s complexity needs to be updated</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2408">2408</a></td><td>SFINAE-friendly <code>common_type</code> / <code>iterator_traits</code> is missing in C++14</td><td>Urbana</td><td><code>common_type</code> is waiting on <a href="http://cplusplus.github.io/LWG/lwg-defects.html#2465">LWG#2465</a></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2016">2016</a></td><td>Allocators must be no-throw swappable</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2376">2118</td><td><code>unique_ptr</code> for array does not support cv qualification conversion of actual argument</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2170">2170</a></td><td>Aggregates cannot be <code>DefaultConstructible</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2308">2308</td><td>Clarify container destructor requirements w.r.t. <code>std::array</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2340">2340</a></td><td>Replacement allocation functions declared as inline</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2354">2354</a></td><td>Unnecessary copying when inserting into maps with braced-init syntax</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2377">2377</a></td><td><code>std::align</code> requirements overly strict</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2396">2396</a></td><td><code>underlying_type</code> doesn't say what to do for an incomplete enumeration type</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2399">2399</a></td><td><code>shared_ptr</code>'s constructor from <code>unique_ptr</code> should be constrained</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2400">2400</a></td><td><code>shared_ptr</code>'s <code>get_deleter()</code> should use <code>addressof()</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2401">2401</a></td><td><code>std::function</code> needs more noexcept</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2404">2404</a></td><td><code>mismatch()</code>'s complexity needs to be updated</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2408">2408</a></td><td>SFINAE-friendly <code>common_type</code> / <code>iterator_traits</code> is missing in C++14</td><td>Urbana</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2106">2106</td><td><code>move_iterator</code> wrapping iterators returning prvalues</td><td>Urbana</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2129">2129</td><td>User specializations of <code>std::initializer_list</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2212">2212</td><td><code>tuple_size</code> for <code>const pair</code> request <tuple> header</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2217">2217</td><td><code>operator==(sub_match, string)</code> slices on embedded '\0's</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2230">2230</td><td>"see below" for <code>initializer_list</code> constructors of unordered containers</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2233">2233</td><td><code>bad_function_call::what()</code> unhelpful</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2266">2266</td><td><code>vector</code> and <code>deque</code> have incorrect insert requirements</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2325">2325</td><td><code>minmax_element()</code>'s behavior differing from <code>max_element()</code>'s should be noted</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2361">2361</td><td>Apply 2299 resolution throughout library</td><td>Urbana</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2365">2365</td><td>Missing noexcept in <code>shared_ptr::shared_ptr(nullptr_t)</code></td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2376">2376</td><td><code>bad_weak_ptr::what()</code> overspecified</td><td>Urbana</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2387">2387</td><td>More nested types that must be accessible and unambiguous</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2106">2106</td><td><code>move_iterator</code> wrapping iterators returning prvalues</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2129">2129</td><td>User specializations of <code>std::initializer_list</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2212">2212</td><td><code>tuple_size</code> for <code>const pair</code> request <tuple> header</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2217">2217</td><td><code>operator==(sub_match, string)</code> slices on embedded '\0's</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2230">2230</td><td>"see below" for <code>initializer_list</code> constructors of unordered containers</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2233">2233</td><td><code>bad_function_call::what()</code> unhelpful</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2266">2266</td><td><code>vector</code> and <code>deque</code> have incorrect insert requirements</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2325">2325</td><td><code>minmax_element()</code>'s behavior differing from <code>max_element()</code>'s should be noted</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2361">2361</td><td>Apply 2299 resolution throughout library</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2365">2365</td><td>Missing noexcept in <code>shared_ptr::shared_ptr(nullptr_t)</code></td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2376">2376</td><td><code>bad_weak_ptr::what()</code> overspecified</td><td>Urbana</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2387">2387</td><td>More nested types that must be accessible and unambiguous</td><td>Urbana</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2059">2059</td><td>C++0x ambiguity problem with map::erase</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2063">2063</td><td>Contradictory requirements for string move assignment</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2076">2076</td><td>Bad CopyConstructible requirement in set constructors</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2160">2160</td><td>Unintended destruction ordering-specification of resize</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2168">2168</td><td>Inconsistent specification of uniform_real_distribution constructor</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2239">2239</td><td>min/max/minmax requirements</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2364">2364</td><td>deque and vector pop_back don't specify iterator invalidation requirements</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2369">2369</td><td>constexpr max(initializer_list) vs max_element</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2378">2378</td><td>Behaviour of standard exception types</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2403">2403</td><td>stof() should call strtof() and wcstof()</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2406">2406</td><td>negative_binomial_distribution should reject p == 1</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2407">2407</td><td>packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2411">2411</td><td>shared_ptr is only contextually convertible to bool</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2415">2415</td><td>Inconsistency between unique_ptr and shared_ptr</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2420">2420</td><td>function<void(ArgTypes...)> does not discard the return value of the target object</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2425">2425</td><td>operator delete(void*, size_t) doesn't invalidate pointers sufficiently</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2427">2427</td><td>Container adaptors as sequence containers, redux</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2428">2428</td><td>"External declaration" used without being defined</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2433">2433</td><td>uninitialized_copy()/etc. should tolerate overloaded operator&</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2434">2434</td><td>shared_ptr::use_count() is efficient</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2437">2437</td><td>iterator_traits::reference can and can't be void</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2438">2438</td><td>std::iterator inheritance shouldn't be mandated</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2439">2439</td><td>unique_copy() sometimes can't fall back to reading its output</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2440">2440</td><td>seed_seq::size() should be noexcept</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2442">2442</td><td>call_once() shouldn't DECAY_COPY()</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2448">2448</td><td>Non-normative Container destructor specification</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2454">2454</td><td>Add raw_storage_iterator::base() member</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2455">2455</td><td>Allocator default construction should be allowed to throw</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2458">2458</td><td>N3778 and new library deallocation signatures</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2459">2459</td><td>std::polar should require a non-negative rho</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2464">2464</td><td>try_emplace and insert_or_assign misspecified</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2467">2467</td><td>is_always_equal has slightly inconsistent default</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2470">2470</td><td>Allocator's destroy function should be allowed to fail to instantiate</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2482">2482</td><td>[c.strings] Table 73 mentions nonexistent functions</td><td>Lenexa</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2488">2488</td><td>Placeholders should be allowed and encouraged to be constexpr</td><td>Lenexa</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2059">2059</td><td>C++0x ambiguity problem with map::erase</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2063">2063</td><td>Contradictory requirements for string move assignment</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2076">2076</td><td>Bad CopyConstructible requirement in set constructors</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2160">2160</td><td>Unintended destruction ordering-specification of resize</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2168">2168</td><td>Inconsistent specification of uniform_real_distribution constructor</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2239">2239</td><td>min/max/minmax requirements</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2364">2364</td><td>deque and vector pop_back don't specify iterator invalidation requirements</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2369">2369</td><td>constexpr max(initializer_list) vs max_element</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2378">2378</td><td>Behaviour of standard exception types</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2403">2403</td><td>stof() should call strtof() and wcstof()</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2406">2406</td><td>negative_binomial_distribution should reject p == 1</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2407">2407</td><td>packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2411">2411</td><td>shared_ptr is only contextually convertible to bool</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2415">2415</td><td>Inconsistency between unique_ptr and shared_ptr</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2420">2420</td><td>function<void(ArgTypes...)> does not discard the return value of the target object</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2425">2425</td><td>operator delete(void*, size_t) doesn't invalidate pointers sufficiently</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2427">2427</td><td>Container adaptors as sequence containers, redux</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2428">2428</td><td>"External declaration" used without being defined</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2433">2433</td><td>uninitialized_copy()/etc. should tolerate overloaded operator&</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2434">2434</td><td>shared_ptr::use_count() is efficient</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2437">2437</td><td>iterator_traits::reference can and can't be void</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2438">2438</td><td>std::iterator inheritance shouldn't be mandated</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2439">2439</td><td>unique_copy() sometimes can't fall back to reading its output</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2440">2440</td><td>seed_seq::size() should be noexcept</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2442">2442</td><td>call_once() shouldn't DECAY_COPY()</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2448">2448</td><td>Non-normative Container destructor specification</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2454">2454</td><td>Add raw_storage_iterator::base() member</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2455">2455</td><td>Allocator default construction should be allowed to throw</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2458">2458</td><td>N3778 and new library deallocation signatures</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2459">2459</td><td>std::polar should require a non-negative rho</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2464">2464</td><td>try_emplace and insert_or_assign misspecified</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2467">2467</td><td>is_always_equal has slightly inconsistent default</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2470">2470</td><td>Allocator's destroy function should be allowed to fail to instantiate</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2482">2482</td><td>[c.strings] Table 73 mentions nonexistent functions</td><td>Lenexa</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2488">2488</td><td>Placeholders should be allowed and encouraged to be constexpr</td><td>Lenexa</td><td>Complete</td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1169">1169</a></td><td><tt>num_get</tt> not fully compatible with <tt>strto*</tt></td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2072">2072</a></td><td>Unclear wording about capacity of temporary buffers</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2101">2101</a></td><td>Some transformation types can produce impossible types</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2111">2111</a></td><td>Which <tt>unexpected</tt>&#47;<tt>terminate</tt> handler is called from the exception handling runtime?</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2119">2119</a></td><td>Missing <tt>hash</tt> specializations for extended integer types</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2127">2127</a></td><td>Move-construction with <tt>raw_storage_iterator</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2133">2133</a></td><td>Attitude to overloaded comma for iterators</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2156">2156</a></td><td>Unordered containers' <tt>reserve(n)</tt> reserves for <tt>n-1</tt> elements</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2218">2218</a></td><td>Unclear how containers use <tt>allocator_traits::construct()</tt></td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2219">2219</a></td><td><tt><i>INVOKE</i></tt>-ing a pointer to member with a <tt>reference_wrapper</tt> as the object expression</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2224">2224</a></td><td>Ambiguous status of access to non-live objects</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2234">2234</a></td><td><tt>assert()</tt> should allow usage in constant expressions</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2244">2244</a></td><td>Issue on <tt>basic_istream::seekg</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2250">2250</a></td><td>Follow-up On Library Issue 2207</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2259">2259</a></td><td>Issues in 17.6.5.5 rules for member functions</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2273">2273</a></td><td><tt>regex_match</tt> ambiguity</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2336">2336</a></td><td><tt>is_trivially_constructible/is_trivially_assignable</tt> traits are always false</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2353">2353</a></td><td><tt>std::next</tt> is over-constrained</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2367">2367</a></td><td><tt>pair</tt> and <tt>tuple</tt> are not correctly implemented for <tt>is_constructible</tt> with no args</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2380">2380</a></td><td>May <tt>&lt;cstdlib&gt;</tt> provide <tt>long ::abs(long)</tt> and <tt>long long ::abs(long long)</tt>?</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2384">2384</a></td><td>Allocator's <tt>deallocate</tt> function needs better specification</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2385">2385</a></td><td><tt>function::assign</tt> allocator argument doesn't make sense</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2435">2435</a></td><td><tt>reference_wrapper::operator()</tt>'s Remark should be deleted</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2447">2447</a></td><td>Allocators and <tt>volatile</tt>-qualified value types</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2462">2462</a></td><td><tt>std::ios_base::failure</tt> is overspecified</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2466">2466</a></td><td><tt>allocator_traits::max_size()</tt> default behavior is incorrect</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2469">2469</a></td><td>Wrong specification of Requires clause of <tt>operator[]</tt> for <tt>map</tt> and <tt>unordered_map</tt></td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2473">2473</a></td><td><tt>basic_filebuf</tt>'s relation to C <tt>FILE</tt> semantics</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2476">2476</a></td><td><tt>scoped_allocator_adaptor</tt> is not assignable</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2477">2477</a></td><td>Inconsistency of wordings in <tt>std::vector::erase()</tt> and <tt>std::deque::erase()</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2483">2483</a></td><td><tt>throw_with_nested()</tt> should use <tt>is_final</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2484">2484</a></td><td><tt>rethrow_if_nested()</tt> is doubly unimplementable</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2485">2485</a></td><td><tt>get()</tt> should be overloaded for <tt>const tuple&amp;&amp;</tt></td><td>Kona</td><td>Completed</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2486">2486</a></td><td><tt>mem_fn()</tt> should be required to use perfect forwarding</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2487">2487</a></td><td><tt>bind()</tt> should be <tt>const</tt>-overloaded, not <i>cv</i>-overloaded</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2489">2489</a></td><td><tt>mem_fn()</tt> should be <tt>noexcept</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2492">2492</a></td><td>Clarify requirements for <tt>comp</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2495">2495</a></td><td>There is no such thing as an Exception Safety element</td><td>Kona</td><td>Complete</td></tr>
-
+ <tr><td><a href="http://wg21.link/LWG1169">1169</a></td><td><tt>num_get</tt> not fully compatible with <tt>strto*</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2072">2072</a></td><td>Unclear wording about capacity of temporary buffers</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2101">2101</a></td><td>Some transformation types can produce impossible types</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2111">2111</a></td><td>Which <tt>unexpected</tt>&#47;<tt>terminate</tt> handler is called from the exception handling runtime?</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2119">2119</a></td><td>Missing <tt>hash</tt> specializations for extended integer types</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2127">2127</a></td><td>Move-construction with <tt>raw_storage_iterator</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2133">2133</a></td><td>Attitude to overloaded comma for iterators</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2156">2156</a></td><td>Unordered containers' <tt>reserve(n)</tt> reserves for <tt>n-1</tt> elements</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2218">2218</a></td><td>Unclear how containers use <tt>allocator_traits::construct()</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2219">2219</a></td><td><tt><i>INVOKE</i></tt>-ing a pointer to member with a <tt>reference_wrapper</tt> as the object expression</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2224">2224</a></td><td>Ambiguous status of access to non-live objects</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2234">2234</a></td><td><tt>assert()</tt> should allow usage in constant expressions</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2244">2244</a></td><td>Issue on <tt>basic_istream::seekg</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2250">2250</a></td><td>Follow-up On Library Issue 2207</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2259">2259</a></td><td>Issues in 17.6.5.5 rules for member functions</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2273">2273</a></td><td><tt>regex_match</tt> ambiguity</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2336">2336</a></td><td><tt>is_trivially_constructible/is_trivially_assignable</tt> traits are always false</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2353">2353</a></td><td><tt>std::next</tt> is over-constrained</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2367">2367</a></td><td><tt>pair</tt> and <tt>tuple</tt> are not correctly implemented for <tt>is_constructible</tt> with no args</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2380">2380</a></td><td>May <tt>&lt;cstdlib&gt;</tt> provide <tt>long ::abs(long)</tt> and <tt>long long ::abs(long long)</tt>?</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2384">2384</a></td><td>Allocator's <tt>deallocate</tt> function needs better specification</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2385">2385</a></td><td><tt>function::assign</tt> allocator argument doesn't make sense</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2435">2435</a></td><td><tt>reference_wrapper::operator()</tt>'s Remark should be deleted</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2447">2447</a></td><td>Allocators and <tt>volatile</tt>-qualified value types</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2462">2462</a></td><td><tt>std::ios_base::failure</tt> is overspecified</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2466">2466</a></td><td><tt>allocator_traits::max_size()</tt> default behavior is incorrect</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2469">2469</a></td><td>Wrong specification of Requires clause of <tt>operator[]</tt> for <tt>map</tt> and <tt>unordered_map</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2473">2473</a></td><td><tt>basic_filebuf</tt>'s relation to C <tt>FILE</tt> semantics</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2476">2476</a></td><td><tt>scoped_allocator_adaptor</tt> is not assignable</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2477">2477</a></td><td>Inconsistency of wordings in <tt>std::vector::erase()</tt> and <tt>std::deque::erase()</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2483">2483</a></td><td><tt>throw_with_nested()</tt> should use <tt>is_final</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2484">2484</a></td><td><tt>rethrow_if_nested()</tt> is doubly unimplementable</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2485">2485</a></td><td><tt>get()</tt> should be overloaded for <tt>const tuple&amp;&amp;</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2486">2486</a></td><td><tt>mem_fn()</tt> should be required to use perfect forwarding</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2487">2487</a></td><td><tt>bind()</tt> should be <tt>const</tt>-overloaded, not <i>cv</i>-overloaded</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2489">2489</a></td><td><tt>mem_fn()</tt> should be <tt>noexcept</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2492">2492</a></td><td>Clarify requirements for <tt>comp</tt></td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2495">2495</a></td><td>There is no such thing as an Exception Safety element</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2192">2192</a></td><td>Validity and return type of <tt>std::abs(0u)</tt> is unclear</td><td>Jacksonville</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2276">2276</a></td><td>Missing requirement on <tt>std::promise::set_exception</tt></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2296">2296</a></td><td><tt>std::addressof</tt> should be <tt>constexpr</td><td>Jacksonville</td><td>Complete (Clang Only)</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2450">2450</a></td><td><tt>(greater|less|greater_equal|less_equal)&lt;void&gt;</tt> do not yield a total order for pointers</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2520">2520</a></td><td>N4089 broke initializing <tt>unique_ptr&lt;T[]&gt;</tt> from a <tt>nullptr</tt></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2522">2522</a></td><td>[fund.ts.v2] Contradiction in <tt>set_default_resource</tt> specification</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2523">2523</a></td><td><tt>std::promise</tt> synopsis shows two <tt>set_value_at_thread_exit()</tt>'s for no apparent reason</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2537">2537</a></td><td>Constructors for <code>priority_queue</code> taking allocators should call <code>make_heap</code></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2539">2539</a></td><td>[fund.ts.v2] <tt>invocation_trait</tt> definition definition doesn't work for surrogate call functions</td><td>Jacksonville</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2545">2545</a></td><td>Simplify wording for <tt>bind</tt> without explicitly specified return type</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2557">2557</a></td><td>Logical operator traits are broken in the zero-argument case</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2558">2558</a></td><td>[fund.ts.v2] Logical operator traits are broken in the zero-argument case</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2559">2559</a></td><td>Error in LWG 2234's resolution</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2560">2560</a></td><td><tt>is_constructible</tt> underspecified when applied to a function type</td><td>Jacksonville</td><td>Broken in 3.6; See r261653.</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2565">2565</a></td><td><tt>std::function</tt>'s move constructor should guarantee nothrow for <tt>reference_wrapper</tt>s and function pointers</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2566">2566</a></td><td>Requirements on the first template parameter of container adaptors</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2571">2571</a></td><td>&sect;[map.modifiers]/2 imposes nonsensical requirement on <tt>insert(InputIterator, InputIterator)</tt></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2572">2572</a></td><td>The remarks for <tt>shared_ptr::operator*</tt> should apply to <i>cv</i>-qualified <tt>void</tt> as well</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2574">2574</a></td><td>[fund.ts.v2] <tt>std::experimental::function::operator=(F&amp;&amp;)</tt> should be constrained</td><td>Jacksonville</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2575">2575</a></td><td>[fund.ts.v2] <tt>experimental::function::assign</tt> should be removed</td><td>Jacksonville</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2576">2576</a></td><td><tt>istream_iterator</tt> and <tt>ostream_iterator</tt> should use <tt>std::addressof</tt></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2577">2577</a></td><td><tt>{shared,unique}_lock</tt> should use <tt>std::addressof</tt></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2579">2579</a></td><td>Inconsistency wrt Allocators in <tt>basic_string</tt> assignment vs. <tt>basic_string::assign</tt></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2581">2581</a></td><td>Specialization of <tt>&lt;type_traits&gt;</tt> variable templates should be prohibited</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2582">2582</a></td><td>&sect;[res.on.functions]/2's prohibition against incomplete types shouldn't apply to type traits</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2583">2583</a></td><td>There is no way to supply an allocator for <tt>basic_string(str, pos)</tt></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2585">2585</a></td><td><tt>forward_list::resize(size_type, const value_type&amp;)</tt> effects incorrect</td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2586">2586</a></td><td>Wrong value category used in <tt>scoped_allocator_adaptor::construct()</tt></td><td>Jacksonville</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2590">2590</a></td><td>Aggregate initialization for <tt>std::array</tt></td><td>Jacksonville</td><td>Complete</td></tr>
+ <tr><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2181">2181</a></td><td>Exceptions from seed sequence operations</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2309">2309</a></td><td>mutex::lock() should not throw device_or_resource_busy</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2310">2310</a></td><td>Public exposition only member in std::array</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2312">2312</a></td><td>tuple's constructor constraints need to be phrased more precisely</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2328">2328</a></td><td>Rvalue stream extraction should use perfect forwarding</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2393">2393</a></td><td>std::function's Callable definition is broken</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2422">2422</a></td><td>std::numeric_limits&lt;T&gt;::is_modulo description: "most machines" errata</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2426">2426</a></td><td>Issue about compare_exchange</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2436">2436</a></td><td>Comparators for associative containers should always be CopyConstructible</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2441">2441</a></td><td>Exact-width atomic typedefs should be provided</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2451">2451</a></td><td>[fund.ts.v2] optional should 'forward' T's implicit conversions</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2509">2509</a></td><td>[fund.ts.v2] any_cast doesn't work with rvalue reference targets and cannot move with a value target</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2516">2516</a></td><td>[fund.ts.v2] Public "exposition only" members in observer_ptr</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2542">2542</a></td><td>Missing const requirements for associative containers</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2549">2549</a></td><td>Tuple EXPLICIT constructor templates that take tuple parameters end up taking references to temporaries and will create dangling references</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2550">2550</a></td><td>Wording of unordered container's clear() method complexity</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2551">2551</a></td><td>[fund.ts.v2] "Exception safety" cleanup in library fundamentals required</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2555">2555</a></td><td>[fund.ts.v2] No handling for over-aligned types in optional</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2573">2573</a></td><td>[fund.ts.v2] std::hash&lt;std::experimental::shared_ptr&gt; does not work for arrays</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2596">2596</a></td><td>vector::data() should use addressof</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2667">2667</a></td><td>path::root_directory() description is confusing</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2669">2669</a></td><td>recursive_directory_iterator effects refers to non-existent functions</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2670">2670</a></td><td>system_complete refers to undefined variable 'base'</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2671">2671</a></td><td>Errors in Copy</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2673">2673</a></td><td>status() effects cannot be implemented as specified</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2674">2674</a></td><td>Bidirectional iterator requirement on path::iterator is very expensive</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2683">2683</a></td><td>filesystem::copy() says "no effects"</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2684">2684</a></td><td>priority_queue lacking comparator typedef</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2685">2685</a></td><td>shared_ptr deleters must not throw on move construction</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2687">2687</a></td><td>{inclusive,exclusive}_scan misspecified</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2688">2688</a></td><td>clamp misses preconditions and has extraneous condition on result</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2689">2689</a></td><td>Parallel versions of std::copy and std::move shouldn't be in order</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2698">2698</a></td><td>Effect of assign() on iterators/pointers/references</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2704">2704</a></td><td>recursive_directory_iterator's members should require '*this is dereferenceable'</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2706">2706</a></td><td>Error reporting for recursive_directory_iterator::pop() is under-specified</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2707">2707</a></td><td>path construction and assignment should have "string_type&&" overloads</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2709">2709</a></td><td>offsetof is unnecessarily imprecise</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2710">2710</a></td><td>"Effects: Equivalent to ..." doesn't count "Synchronization:" as determined semantics</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2711">2711</a></td><td>path is convertible from approximately everything under the sun</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2716">2716</a></td><td>Specification of shuffle and sample disallows lvalue URNGs</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2718">2718</a></td><td>Parallelism bug in [algorithms.parallel.exec] p2</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2719">2719</a></td><td>permissions function should not be noexcept due to narrow contract</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2720">2720</a></td><td>permissions function incorrectly specified for symlinks</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2721">2721</a></td><td>remove_all has incorrect post conditions</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2723">2723</a></td><td>Do directory_iterator and recursive_directory_iterator become the end iterator upon error?</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2724">2724</a></td><td>The protected virtual member functions of memory_resource should be private</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2725">2725</a></td><td>filesystem::exists(const path&, error_code&) error reporting</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2726">2726</a></td><td>[recursive_]directory_iterator::increment(error_code&) is underspecified</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2727">2727</a></td><td>Parallel algorithms with constexpr specifier</td><td>Oulu</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2728">2728</a></td><td>status(p).permissions() and symlink_status(p).permissions() are not specified</td><td>Oulu</td><td>Complete</td></tr>
+ <tr><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2062">2062</a></td><td>Effect contradictions w/o no-throw guarantee of std::function swaps</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2166">2166</a></td><td>Heap property underspecified?</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2221">2221</a></td><td>No formatted output operator for nullptr</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2223">2223</a></td><td>shrink_to_fit effect on iterator validity</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2261">2261</a></td><td>Are containers required to use their 'pointer' type internally?</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2394">2394</a></td><td>locale::name specification unclear - what is implementation-defined?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2460">2460</a></td><td>LWG issue 2408 and value categories</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2468">2468</a></td><td>Self-move-assignment of library types</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2475">2475</a></td><td>Allow overwriting of std::basic_string terminator with charT() to allow cleaner interoperation with legacy APIs</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2503">2503</a></td><td>multiline option should be added to syntax_option_type</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2510">2510</a></td><td>Tag types should not be DefaultConstructible</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2514">2514</a></td><td>Type traits must not be final</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2518">2518</a></td><td>[fund.ts.v2] Non-member swap for propagate_const should call member swap</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2519">2519</a></td><td>Iterator operator-= has gratuitous undefined behaviour</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2521">2521</a></td><td>[fund.ts.v2] weak_ptr's converting move constructor should be modified as well for array support</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2525">2525</a></td><td>[fund.ts.v2] get_memory_resource should be const and noexcept</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2527">2527</a></td><td>[fund.ts.v2] ALLOCATOR_OF for function::operator= has incorrect default</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2531">2531</a></td><td>future::get should explicitly state that the shared state is released</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2534">2534</a></td><td>Constrain rvalue stream operators</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2536">2536</a></td><td>What should &lt;complex.h&gt; do?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2540">2540</a></td><td>unordered_multimap::insert hint iterator</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2543">2543</a></td><td>LWG 2148 (hash support for enum types) seems under-specified</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2544">2544</a></td><td>istreambuf_iterator(basic_streambuf<charT, traits>* s) effects unclear when s is 0</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2556">2556</a></td><td>Wide contract for future::share()</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2562">2562</a></td><td>Consistent total ordering of pointers by comparison functors</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2567">2567</a></td><td>Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2568">2568</a></td><td>[fund.ts.v2] Specification of logical operator traits uses BaseCharacteristic, which is defined only for UnaryTypeTraits and BinaryTypeTraits</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2569">2569</a></td><td>conjunction and disjunction requirements are too strict</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2570">2570</a></td><td>[fund.ts.v2] conjunction and disjunction requirements are too strict</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2578">2578</a></td><td>Iterator requirements should reference iterator traits</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2584">2584</a></td><td><regex> ECMAScript IdentityEscape is ambiguous</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2588">2588</a></td><td>[fund.ts.v2] "Convertible to bool" requirement in conjunction and disjunction</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2589">2589</a></td><td>match_results can't satisfy the requirements of a container</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2591">2591</a></td><td>std::function's member template target() should not lead to undefined behaviour</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2598">2598</a></td><td>addressof works on temporaries</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2664">2664</a></td><td>operator/ (and other append) semantics not useful if argument has root</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2665">2665</a></td><td>remove_filename() post condition is incorrect</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2672">2672</a></td><td>Should is_empty use error_code in its specification?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2678">2678</a></td><td>std::filesystem enum classes overspecified</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2679">2679</a></td><td>Inconsistent Use of Effects and Equivalent To</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2680">2680</a></td><td>Add "Equivalent to" to filesystem</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2681">2681</a></td><td>filesystem::copy() cannot copy symlinks</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2682">2682</a></td><td>filesystem::copy() won't create a symlink to a directory</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2686">2686</a></td><td>Why is std::hash specialized for error_code, but not error_condition?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2694">2694</a></td><td>Application of LWG 436 accidentally deleted definition of "facet"</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2696">2696</a></td><td>Interaction between make_shared and enable_shared_from_this is underspecified</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2699">2699</a></td><td>Missing restriction in [numeric.requirements]</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2712">2712</a></td><td>copy_file(from, to, ...) has a number of unspecified error conditions</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2722">2722</a></td><td>equivalent incorrectly specifies throws clause</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2729">2729</a></td><td>Missing SFINAE on std::pair::operator=</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2732">2732</a></td><td>Questionable specification of path::operator/= and path::append</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2733">2733</a></td><td>[fund.ts.v2] gcd / lcm and bool</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2735">2735</a></td><td>std::abs(short), std::abs(signed char) and others should return int instead of double in order to be compatible with C++98 and C</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2736">2736</a></td><td>nullopt_t insufficiently constrained</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2738">2738</a></td><td>is_constructible with void types</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2739">2739</a></td><td>Issue with time_point non-member subtraction with an unsigned duration</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2740">2740</a></td><td>constexpr optional<T>::operator-></td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2742">2742</a></td><td>Inconsistent string interface taking string_view</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2744">2744</a></td><td>any's in_place constructors</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2745">2745</a></td><td>[fund.ts.v2] Implementability of LWG 2451</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2747">2747</a></td><td>Possibly redundant std::move in [alg.foreach]</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2748">2748</a></td><td>swappable traits for optionals</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2749">2749</a></td><td>swappable traits for variants</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2750">2750</a></td><td>[fund.ts.v2] LWG 2451 conversion constructor constraint</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2752">2752</a></td><td>"Throws:" clauses of async and packaged_task are unimplementable</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2755">2755</a></td><td>[string.view.io] uses non-existent basic_string_view::to_string function</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2756">2756</a></td><td>C++ WP optional<T> should 'forward' T's implicit conversions</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2758">2758</a></td><td>std::string{}.assign("ABCDE", 0, 1) is ambiguous</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2759">2759</a></td><td>gcd / lcm and bool for the WP</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2760">2760</a></td><td>non-const basic_string::data should not invalidate iterators</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2765">2765</a></td><td>Did LWG 1123 go too far?</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2767">2767</a></td><td>not_fn call_wrapper can form invalid types</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2769">2769</a></td><td>Redundant const in the return type of any_cast(const any&)</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2771">2771</a></td><td>Broken Effects of some basic_string::compare functions in terms of basic_string_view</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2773">2773</a></td><td>Making std::ignore constexpr</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2777">2777</a></td><td>basic_string_view::copy should use char_traits::copy</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2778">2778</a></td><td>basic_string_view is missing constexpr</td><td>Issaquah</td><td>Complete</td></tr>
+ <tr><td></td><td></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2260">2260</a></td><td>Missing requirement for Allocator::pointer</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2676">2676</a></td><td>Provide filesystem::path overloads for File-based streams</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2768">2768</a></td><td>any_cast and move semantics</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2769">2769</a></td><td>Redundant const in the return type of any_cast(const any&amp;)</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2781">2781</a></td><td>Contradictory requirements for std::function and std::reference_wrapper</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2782">2782</a></td><td>scoped_allocator_adaptor constructors must be constrained</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2784">2784</a></td><td>Resolution to LWG 2484 is missing "otherwise, no effects" and is hard to parse</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2785">2785</a></td><td>quoted should work with basic_string_view</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2786">2786</a></td><td>Annex C should mention shared_ptr changes for array support</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2787">2787</a></td><td>&sect;[file_status.cons] doesn't match class definition</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2788">2788</a></td><td>basic_string range mutators unintentionally require a default constructible allocator</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2789">2789</a></td><td>Equivalence of contained objects</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2790">2790</a></td><td>Missing specification of istreambuf_iterator::operator-&gt;</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2794">2794</a></td><td>Missing requirements for allocator pointers</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2795">2795</a></td><td>&sect;[global.functions] provides incorrect example of ADL use</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2796">2796</a></td><td>tuple should be a literal type</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2801">2801</a></td><td>Default-constructibility of unique_ptr</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2802">2802</a></td><td>shared_ptr constructor requirements for a deleter</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2804">2804</a></td><td>Unconditional constexpr default constructor for istream_iterator</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2806">2806</a></td><td>Base class of bad_optional_access</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2807">2807</a></td><td>std::invoke should use std::is_nothrow_callable</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2812">2812</a></td><td>Range access is available with &lt;string_view&gt;</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2824">2824</a></td><td>list::sort should say that the order of elements is unspecified if an exception is thrown</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2826">2826</a></td><td>string_view iterators use old wording</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2834">2834</a></td><td>Resolution LWG 2223 is missing wording about end iterators</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2835">2835</a></td><td>LWG 2536 seems to misspecify &lt;tgmath.h&gt;</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2837">2837</a></td><td>gcd and lcm should support a wider range of input values</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2838">2838</a></td><td>is_literal_type specification needs a little cleanup</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2842">2842</a></td><td>in_place_t check for optional::optional(U&amp;&amp;) should decay U</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2850">2850</a></td><td>std::function move constructor does unnecessary work</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2853">2853</a></td><td>Possible inconsistency in specification of erase in [vector.modifiers]</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2855">2855</a></td><td>std::throw_with_nested("string_literal")</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2857">2857</a></td><td>{variant,optional,any}::emplace should return the constructed value</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2861">2861</a></td><td>basic_string should require that charT match traits::char_type</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2866">2866</a></td><td>Incorrect derived classes constraints</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2868">2868</a></td><td>Missing specification of bad_any_cast::what()</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2872">2872</a></td><td>Add definition for direct-non-list-initialization</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2873">2873</a></td><td>Add noexcept to several shared_ptr related functions</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2874">2874</a></td><td>Constructor shared_ptr::shared_ptr(Y*) should be constrained</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2875">2875</a></td><td>shared_ptr::shared_ptr(Y*, D, [&hellip;]) constructors should be constrained</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2876">2876</a></td><td>shared_ptr::shared_ptr(const weak_ptr&lt;Y&gt;&amp;) constructor should be constrained</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2878">2878</a></td><td>Missing DefaultConstructible requirement for istream_iterator default constructor</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2890">2890</a></td><td>The definition of 'object state' applies only to class types</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2900">2900</a></td><td>The copy and move constructors of optional are not constexpr</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2903">2903</a></td><td>The form of initialization for the emplace-constructors is not specified</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2904">2904</a></td><td>Make variant move-assignment more exception safe</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2905">2905</a></td><td>is_constructible_v&lt;unique_ptr&lt;P, D&gt;, P, D const &amp;&gt; should be false when D is not copy constructible</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2908">2908</a></td><td>The less-than operator for shared pointers could do more</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2911">2911</a></td><td>An is_aggregate type trait is needed</td><td>Kona</td><td>Complete</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2921">2921</a></td><td>packaged_task and type-erased allocators</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2934">2934</a></td><td>optional&lt;const T&gt; doesn't compare with T</td><td>Kona</td><td>Complete</td></tr>
<!--
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Urbana</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Urbana</td><td></td></tr>
-->
<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
</table>
- <p>Last Updated: 5-Oct-2015</p>
+ <p>Last Updated: 25-May-2017</p>
</div>
</body>
</html>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/debug_mode.html b/chromium/buildtools/third_party/libc++/trunk/www/debug_mode.html
deleted file mode 100644
index 943c47db011..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/www/debug_mode.html
+++ /dev/null
@@ -1,162 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <title>libc++ debug mode status</title>
-</head>
-<body>
-
-<p>
-Work is beginning on a libc++ debug mode. The purpose of this table is to
-record which parts of libc++ have debug mode support.
-</p>
-
-<p>
-Note: Debug mode is currently not functional. Defining _LIBCPP_DEBUG will result
-in fairly nasty compile errors.
-</p>
-
-<table border=1>
-<tr>
-<th>Section</th>
-<th>Completed ?</th>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>vector&lt;T&gt;, T != bool</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;list&gt;</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;unordered_set&gt;</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;unordered_map&gt;</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;string&gt;</code>
-</p>
-</td>
-<td align="center"> &#10003; </td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;set&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;map&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>vector&lt;bool&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;deque&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;forward_list&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;array&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;stack&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;queue&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-<tr>
-<td>
-<p>
-<code>&lt;algorithm&gt;</code>
-</p>
-</td>
-<td align="center"><!-- &#10003; --></td>
-</tr>
-
-
-</table>
-
-<p>
-At present the table is known to not be a complete list. It is currently ordered
-in approximate priority order.
-</p>
-
-<p>Last Updated: 3-June-2014</p>
-
-</body>
-</html>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/index.html b/chromium/buildtools/third_party/libc++/trunk/www/index.html
index 821f25d7e04..5dc13858d40 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/index.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/index.html
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
@@ -140,11 +140,6 @@
"C++1z" (probably to be C++17) can be found <a href="cxx1z_status.html">here</a>.</p>
<p>Implementation of the post-c++14 Technical Specifications is in progress. A list of features and
the current status of these features can be found <a href="ts1z_status.html">here</a>.</p>
- <p>
- Ports to other platforms are underway. Here are recent test
- results for <a href="results.Windows.html">Windows</a>
- and <a href="results.Linux.html">Linux</a>.
- </p>
<!--======================================================================-->
<h2 id="buildbots">Build Bots</h2>
@@ -166,96 +161,18 @@
<p>First please review our
<a href="http://llvm.org/docs/DeveloperPolicy.html">Developer's Policy</a>.
- <p>
- On Mac OS 10.7 (Lion) and later, the easiest way to get this library is to install
- Xcode 4.2 or later. However if you want to install tip-of-trunk from here
- (getting the bleeding edge), read on. However, be warned that Mac OS
- 10.7 will not boot without a valid copy of <code>libc++.1.dylib</code> in
- <code>/usr/lib</code>.
- </p>
-
- <p>To check out the code, use:</p>
-
- <ul>
- <li><code>svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx</code></li>
- </ul>
-
- <p>
- Note that for an in-tree build, you should check out libcxx to
- llvm/projects.
- </p>
-
- <p>
- The following instructions are for building libc++ on FreeBSD, Linux, or Mac
- using <a href="http://libcxxabi.llvm.org/">libc++abi</a> as the C++ ABI
- library. On Linux, it is also possible to use
- <a href="#libsupcxx">libsupc++</a> or <a href="#libcxxrt">libcxxrt</a>.
- </p>
-
- <p>In-tree build:</p>
- <ul>
- <li><code>cd where-you-want-to-live</code></li>
- <li>Check out libcxx and <a href="http://libcxxabi.llvm.org/">libcxxabi</a>
- into llvm/projects</li>
- <li><code>cd where-you-want-to-build</code></li>
- <li><code>mkdir build &amp;&amp; cd build</code></li>
- <li><code>cmake path/to/llvm # Linux may require -DCMAKE_C_COMPILER=clang
- -DCMAKE_CXX_COMPILER=clang++</code></li>
- <li><code>make cxx</code></li>
- </ul>
-
- <p>Out-of-tree buildc:</p>
- <ul>
- <li><code>cd where-you-want-to-live</code></li>
- <li>Check out libcxx and llvm</li>
- <li>If not on a Mac, also check out
- <a href="http://libcxxabi.llvm.org/">libcxxabi</a></li>
- <li><code>cd where-you-want-to-build</code></li>
- <li><code>mkdir build &amp;&amp; cd build</code></li>
- <li><code>cmake -DLLVM_PATH=path/to/llvm
- -DLIBCXX_CXX_ABI=libcxxabi
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxabi/include
- -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
- path/to/libcxx
- </code></li>
- <li><code>make</code></li>
- </ul>
-
- <p>To run the tests:</p>
- <ul>
- <li><code>make check-libcxx</code></li>
- </ul>
-
- <p>If you wish to run a subset of the test suite:</p>
- <ul>
- <li><code>cd path/to/libcxx/libcxx</code></li>
- <li><code>alias lit='python path/to/llvm/utils/lit/lit.py'</code></li>
- <li><code>export
- LIBCXX_SITE_CONFIG=path/to/build/dir/projects/libcxx/test/lit.site.cfg
- </code></li>
- <li><code>lit -sv test/re/ # or whichever subset of tests you're interested
- in</code></li>
- </ul>
- <p>The above is currently quite inconvenient. Sorry! We're working on it!</p>
-
- <p>More information on using LIT can be found
- <a href="http://llvm.org/docs/CommandGuide/lit.html">here</a>. For more
- general information about the LLVM testing infrastructure, see the
- <a href="http://llvm.org/docs/TestingGuide.html">LLVM Testing Infrastructure
- Guide</a>
- </p>
-
- <p>
- Shared libraries for libc++ should now be present in llvm/build/lib. Note
- that it is safest to use this from its current location rather than
- replacing your system's libc++ (if it has one, if not, go right ahead).
- </p>
-
- <p>
- Mac users, remember to be careful when replacing the system's libc++.
- <strong>Your system will not be able to boot without a functioning
- libc++.</strong>
- </p>
+ The documentation for building and using libc++ can be found below.
+ <ul>
+ <li><a href="http://libcxx.llvm.org/docs/UsingLibcxx.html">
+ <b>Using libc++</b></a>
+ Documentation on using the library in your programs</li>
+ <li><a href="http://libcxx.llvm.org/docs/BuildingLibcxx.html">
+ <b>Building libc++</b></a>
+ Documentation on building the library using CMake</li>
+ <li><a href="http://libcxx.llvm.org/docs/TestingLibcxx.html">
+ <b>Testing libc++</b></a>
+ Documentation for developers wishing to test the library</li>
+ </ul>
<!--=====================================================================-->
<h3>Notes and Known Issues</h3>
@@ -279,65 +196,6 @@
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">clang mailing list</a>.</p>
<!--=====================================================================-->
- <h2>Using libc++ in your programs</h2>
- <!--=====================================================================-->
-
- <!--=====================================================================-->
- <h3>FreeBSD and Mac OS X</h3>
- <!--=====================================================================-->
-
- <p>
- To use your system-installed libc++ with clang you can:
- </p>
-
- <ul>
- <li><code>clang++ -stdlib=libc++ test.cpp</code></li>
- <li><code>clang++ -std=c++11 -stdlib=libc++ test.cpp</code></li>
- </ul>
-
- <p>
- To use your tip-of-trunk libc++ on Mac OS with clang you can:
- </p>
-
- <ul>
- <li><code>export DYLD_LIBRARY_PATH=path/to/build/lib</code>
- <li><code>clang++ -std=c++11 -stdlib=libc++ -nostdinc++
- -I&lt;path-to-libcxx&gt;/include -L&lt;path-to-libcxx&gt;/lib
- test.cpp</code></li>
- </ul>
-
- <!--=====================================================================-->
- <h3>Linux</h3>
- <!--=====================================================================-->
-
- <p>
- You will need to keep the source tree of
- <a href="http://libcxxabi.llvm.org">libc++abi</a> available on your build
- machine and your copy of the libc++abi shared library must be placed where
- your linker will find it.
- </p>
-
- <p>
- Unfortunately you can't simply run clang with "-stdlib=libc++" at this
- point, as clang is set up to link for libc++ linked to libsupc++. To get
- around this you'll have to set up your linker yourself (or patch clang).
- For example:
- </p>
-
- <ul>
- <li><code>clang++ -stdlib=libc++ helloworld.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc</code></li>
- </ul>
-
- <p>
- Alternately, you could just add libc++abi to your libraries list, which in
- most situations will give the same result:
- </p>
-
- <ul>
- <li><code>clang++ -stdlib=libc++ helloworld.cpp -lc++abi</code></li>
- </ul>
-
- <!--=====================================================================-->
<h2>Bug reports and patches</h2>
<!--=====================================================================-->
@@ -355,136 +213,6 @@
</p>
<!--=====================================================================-->
- <h2 id="libsupcxx">Build on Linux using CMake and libsupc++.</h2>
- <!--=====================================================================-->
-
- <p>
- You will need libstdc++ in order to provide libsupc++.
- </p>
-
- <p>
- Figure out where the libsupc++ headers are on your system. On Ubuntu this
- is <code>/usr/include/c++/&lt;version&gt;</code> and
- <code>/usr/include/c++/&lt;version&gt;/&lt;target-triple&gt;</code>
- </p>
-
- <p>
- You can also figure this out by running
- <pre>
-$ echo | g++ -Wp,-v -x c++ - -fsyntax-only
-ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
-ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../x86_64-linux-gnu/include"
-#include "..." search starts here:
-#include &lt;...&gt; search starts here:
- /usr/include/c++/4.7
- /usr/include/c++/4.7/x86_64-linux-gnu
- /usr/include/c++/4.7/backward
- /usr/lib/gcc/x86_64-linux-gnu/4.7/include
- /usr/local/include
- /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed
- /usr/include/x86_64-linux-gnu
- /usr/include
-End of search list.
- </pre>
-
- Note the first two entries happen to be what we are looking for. This
- may not be correct on other platforms.
- </p>
-
- <p>
- We can now run CMake:
- <ul>
- <li><code>CC=clang CXX=clang++ cmake -G "Unix Makefiles"
- -DLIBCXX_CXX_ABI=libstdc++
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/usr/include/c++/4.7/;/usr/include/c++/4.7/x86_64-linux-gnu/"
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- &lt;libc++-source-dir&gt;</code></li>
- <li>You can also substitute <code>-DLIBCXX_CXX_ABI=libsupc++</code>
- above, which will cause the library to be linked to libsupc++ instead
- of libstdc++, but this is only recommended if you know that you will
- never need to link against libstdc++ in the same executable as libc++.
- GCC ships libsupc++ separately but only as a static library. If a
- program also needs to link against libstdc++, it will provide its
- own copy of libsupc++ and this can lead to subtle problems.
- <li><code>make</code></li>
- <li><code>sudo make install</code></li>
- </ul>
- <p>
- You can now run clang with -stdlib=libc++.
- </p>
- </p>
-
- <!--=====================================================================-->
- <h2 id="libcxxrt">Build on Linux using CMake and libcxxrt.</h2>
- <!--=====================================================================-->
-
- <p>
- You will need to keep the source tree of
- <a href="https://github.com/pathscale/libcxxrt/">libcxxrt</a> available
- on your build machine and your copy of the libcxxrt shared library must
- be placed where your linker will find it.
- </p>
-
- <p>
- We can now run CMake:
- <ul>
- <li><code>CC=clang CXX=clang++ cmake -G "Unix Makefiles"
- -DLIBCXX_CXX_ABI=libcxxrt
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS="&lt;libcxxrt-source-dir&gt;/src"
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- &lt;libc++-source-dir&gt;</code></li>
- <li><code>make</code></li>
- <li><code>sudo make install</code></li>
- </ul>
- <p>
- Unfortunately you can't simply run clang with "-stdlib=libc++" at this point, as
- clang is set up to link for libc++ linked to libsupc++. To get around this
- you'll have to set up your linker yourself (or patch clang). For example,
- <ul>
- <li><code>clang++ -stdlib=libc++ helloworld.cpp -nodefaultlibs -lc++ -lcxxrt -lm -lc -lgcc_s -lgcc</code></li>
- </ul>
- Alternately, you could just add libcxxrt to your libraries list, which in most
- situations will give the same result:
- <ul>
- <li><code>clang++ -stdlib=libc++ helloworld.cpp -lcxxrt</code></li>
- </ul>
- </p>
- </p>
-
- <!--=====================================================================-->
- <h2 id="local-abi">Using a local ABI library</h2>
- <!--=====================================================================-->
- <p>
- <strong>Note: This is not recommended in almost all cases.</strong><br>
- Generally these instructions should only be used when you can't install
- your ABI library.
- </p>
- <p>
- Normally you must link libc++ against a ABI shared library that the
- linker can find. If you want to build and test libc++ against an ABI
- library not in the linker's path you need to set
- <code>-DLIBCXX_CXX_ABI_LIBRARY_PATH=/path/to/abi/lib</code> when
- configuring CMake.
- </p>
- <p>
- An example build using libc++abi would look like:
- <ul>
- <li><code>CC=clang CXX=clang++ cmake
- -DLIBCXX_CXX_ABI=libc++abi
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS="/path/to/libcxxabi/include"
- -DLIBCXX_CXX_ABI_LIBRARY_PATH="/path/to/libcxxabi-build/lib"
- path/to/libcxx</code></li>
- <li><code>make</code></li>
- </ul>
- </p>
- <p>
- When testing libc++ LIT will automatically link against the proper ABI
- library.
- </p>
-
- <!--=====================================================================-->
<h2>Design Documents</h2>
<!--=====================================================================-->
@@ -492,8 +220,6 @@ End of search list.
<li><a href="atomic_design.html"><tt>&lt;atomic&gt;</tt></a></li>
<li><a href="type_traits_design.html"><tt>&lt;type_traits&gt;</tt></a></li>
<li><a href="http://cplusplusmusings.wordpress.com/2012/07/05/clang-and-standard-libraries-on-mac-os-x/">Excellent notes by Marshall Clow</a></li>
-<li><a href="debug_mode.html">Status of debug mode</a></li>
-<li><a href="lit_usage.html">LIT usage guide</a></li>
</ul>
</div>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/kona.html b/chromium/buildtools/third_party/libc++/trunk/www/kona.html
deleted file mode 100644
index 8fdfba163e4..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/www/kona.html
+++ /dev/null
@@ -1,154 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
-<html>
-<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>libc++ Kona Status</title>
- <link type="text/css" rel="stylesheet" href="menu.css">
- <link type="text/css" rel="stylesheet" href="content.css">
-</head>
-
-<body>
-<div id="menu">
- <div>
- <a href="http://llvm.org/">LLVM Home</a>
- </div>
-
- <div class="submenu">
- <label>libc++ Info</label>
- <a href="/index.html">About</a>
- </div>
-
- <div class="submenu">
- <label>Quick Links</label>
- <a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
- <a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
- <a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
- <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
- </div>
-</div>
-
-<div id="content">
- <!--*********************************************************************-->
- <h1>libc++ Kona Status</h1>
- <!--*********************************************************************-->
-
- <p>This is a temporary page; please check the c++1z status <a href="http://libcxx.llvm.org/cxx1z_status.html">here</a></p>
- <p>This page shows the status of the papers and issues that are expected to be adopted in Kona.</p>
-
- <p>The groups that have contributed papers:
- <ul>
- <li>LWG - Library working group</li>
- <li>CWG - Core Language Working group</li>
- <li>SG1 - Study group #1 (Concurrency working group)</li>
- </ul>
- </p>
-
- <h3>Paper Status</h3>
- <table id="papers" border="1">
- <tr><th>Paper #</th><th>Group</th><th>Paper Name</th><th>Meeting</th><th>Status</th><th>First released version</th></tr>
-<!--
- <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3346.pdf">3346</a></td><td>LWG</td><td>Terminology for Container Element Requirements - Rev 1</td><td>Kona</td><td>Complete</td><td>3.4</td></tr>
--->
-<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
- </table>
-
- <h3>Library Working group Issues Status</h3>
- <table id="issues" border="1">
- <tr><th>Issue #</th><th>Issue Name</th><th>Meeting</th><th>Status</th></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1169">1169</a></td><td><tt>num_get</tt> not fully compatible with <tt>strto*</tt></td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2072">2072</a></td><td>Unclear wording about capacity of temporary buffers</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2101">2101</a></td><td>Some transformation types can produce impossible types</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2111">2111</a></td><td>Which <tt>unexpected</tt>&#47;<tt>terminate</tt> handler is called from the exception handling runtime?</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2119">2119</a></td><td>Missing <tt>hash</tt> specializations for extended integer types</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2127">2127</a></td><td>Move-construction with <tt>raw_storage_iterator</tt></td><td>Kona</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2133">2133</a></td><td>Attitude to overloaded comma for iterators</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2156">2156</a></td><td>Unordered containers' <tt>reserve(n)</tt> reserves for <tt>n-1</tt> elements</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2218">2218</a></td><td>Unclear how containers use <tt>allocator_traits::construct()</tt></td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2219">2219</a></td><td><tt><i>INVOKE</i></tt>-ing a pointer to member with a <tt>reference_wrapper</tt> as the object expression</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2224">2224</a></td><td>Ambiguous status of access to non-live objects</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2234">2234</a></td><td><tt>assert()</tt> should allow usage in constant expressions</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2244">2244</a></td><td>Issue on <tt>basic_istream::seekg</tt></td><td>Kona</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2250">2250</a></td><td>Follow-up On Library Issue 2207</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2259">2259</a></td><td>Issues in 17.6.5.5 rules for member functions</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2273">2273</a></td><td><tt>regex_match</tt> ambiguity</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2336">2336</a></td><td><tt>is_trivially_constructible/is_trivially_assignable</tt> traits are always false</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2353">2353</a></td><td><tt>std::next</tt> is over-constrained</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2367">2367</a></td><td><tt>pair</tt> and <tt>tuple</tt> are not correctly implemented for <tt>is_constructible</tt> with no args</td><td>Kona</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2380">2380</a></td><td>May <tt>&lt;cstdlib&gt;</tt> provide <tt>long ::abs(long)</tt> and <tt>long long ::abs(long long)</tt>?</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2384">2384</a></td><td>Allocator's <tt>deallocate</tt> function needs better specification</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2385">2385</a></td><td><tt>function::assign</tt> allocator argument doesn't make sense</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2435">2435</a></td><td><tt>reference_wrapper::operator()</tt>'s Remark should be deleted</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2447">2447</a></td><td>Allocators and <tt>volatile</tt>-qualified value types</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2462">2462</a></td><td><tt>std::ios_base::failure</tt> is overspecified</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2466">2466</a></td><td><tt>allocator_traits::max_size()</tt> default behavior is incorrect</td><td>Kona</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2469">2469</a></td><td>Wrong specification of Requires clause of <tt>operator[]</tt> for <tt>map</tt> and <tt>unordered_map</tt></td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2473">2473</a></td><td><tt>basic_filebuf</tt>'s relation to C <tt>FILE</tt> semantics</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2476">2476</a></td><td><tt>scoped_allocator_adaptor</tt> is not assignable</td><td>Kona</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2477">2477</a></td><td>Inconsistency of wordings in <tt>std::vector::erase()</tt> and <tt>std::deque::erase()</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2483">2483</a></td><td><tt>throw_with_nested()</tt> should use <tt>is_final</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2484">2484</a></td><td><tt>rethrow_if_nested()</tt> is doubly unimplementable</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2485">2485</a></td><td><tt>get()</tt> should be overloaded for <tt>const tuple&amp;&amp;</tt></td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2486">2486</a></td><td><tt>mem_fn()</tt> should be required to use perfect forwarding</td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2487">2487</a></td><td><tt>bind()</tt> should be <tt>const</tt>-overloaded, not <i>cv</i>-overloaded</td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2489">2489</a></td><td><tt>mem_fn()</tt> should be <tt>noexcept</tt></td><td>Kona</td><td>Patch Ready</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2492">2492</a></td><td>Clarify requirements for <tt>comp</tt></td><td>Kona</td><td>Complete</td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2494">2494</a></td><td>[fund.ts.v2] <tt>ostream_joiner</tt> needs <tt>noexcept</tt></td><td>Kona</td><td></td></tr>
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2495">2495</a></td><td>There is no such thing as an Exception Safety element</td><td>Kona</td><td></td></tr>
-
-<!--
- <tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Urbana</td><td></td></tr>
--->
-<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
- </table>
-
-<h3>Comments about the issues</h3>
-<ul>
-<li>1169 - We currently have a single function __num_get_float that calls strtold_l, and then casts down to the appropriate floating point type. That will have to change.</li>
-<li><i>2072 - We already do this; this is just making the wording better.</i></li>
-<li>2101 - Need to write some careful test cases. In particular, need to check function types with/without const/ref qualifiers. Currently we get this wrong. Installing metashell to play with these.</li>
-<li><i>2111 - Resolved an ambiguity by calling it out. No code change required.</i></li>
-<li>2119 - Hashes for all integral and enumeration types. Research needed</li>
-<li><i>2127 - Add a new member to raw_storage_iterator. Looks simple.</i> <b>Patch Available</b></li>
-<li><i>2133 - We do this already; thanks Eric.</i></li>
-<li>2156 - check and make sure that we already do this. Write a test.</li>
-<li>2181 - I suspect that this will not require any code changes, but will need to be read carefully.</li>
-<li>2218 - Shouldn't require any code changes.</li>
-<li>2219 - Sizable changes required. INVOKE needs 2 additional overloads and plenty of tests. I'm not going to back port this to C++03. (Eric)</li>
-<li>2224 - </li>
-<li>2234 - </li>
-<li><i>2244 - We don't do this; easy fix. <b>Patch Available</b></i></li>
-<li>2250 - Looks like wording cleanup. Need to check more closely, but I think there's no code changes here.</li>
-<li><i>2259 - No code changes needed here.</i></li>
-<li>2273 - </li>
-<li>2336 - <b>Check later</b></li>
-<li>2353 - Simple change, needs a test. (test probably used to exist)</li>
-<li><i>2367 - <b>Patch Available as D13750</b> (Eric)</i></li>
-<li><i>2380 - No code changes here; we already do this.</i></li>
-<li><i>2384 - Wording cleanup; no code change required</i></li>
-<li>2385 - Removing broken signatures. Only question is "how far back"?</li>
-<li><i>2435 - Wording cleanup; no code change required</i></li>
-<li><i>2447 - This is a relaxation of a requirement that we satisfy. No changes needed.</i>.</li>
-<li><i>2462 - Added a simple test. No code change needed</i> <b>Patch Available</b></li>
-<li><i>2466 - Simple change; need a test.</i> <b>Patch Available</b></li>
-<li>2469 - This is a follow on to 2464, which we're done. This restates a bunch of operations in terms of newer ops. Probably refactoring to do here, but tests shouldn't change.</li>
-<li><i>2473 - There are two changes here; one to <tt>filebuf::seekpos</tt> and the other to <tt>filebuf::sync</tt>. We do both of these already.</i></li>
-<li><i>2476 - Just needed tests.</i> <b>Patch Available</b></li>
-<li><i>2477 - Wording cleanup.</i></li>
-<li><i>2483 - We already do this.</i></li>
-<li><i>2484 - We already do this.</i></li>
-<li>2485 - Ask Eric to do it. </li>
-<li>2486 - Lots of code changes, all mechanical. Tests will be sizable.</li>
-<li><i>2487 - This is removing a requirement on bind(), which we don't currently satisfy. So, nothing to do.</i></li>
-<li><i>2489 - Looks easy. Just add some NOEXCEPT, and tests.</i> <b>Patch Available</b></li>
-<li><i>2492 - Wording cleanup; no code changes needed.</i></li>
-<li>2494 - My implementation of this (not checked in) already has these.</li>
-<li>2494 - </li>
-</ul>
-
-<p>Last Updated: 5-Oct-2015</p>
-</div>
-</body>
-</html>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/lit_usage.html b/chromium/buildtools/third_party/libc++/trunk/www/lit_usage.html
deleted file mode 100644
index 2fcb2d0a5f9..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/www/lit_usage.html
+++ /dev/null
@@ -1,207 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
-<html>
-<head>
- <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title>Testing libc++ using LIT</title>
- <link type="text/css" rel="stylesheet" href="menu.css">
- <link type="text/css" rel="stylesheet" href="content.css">
- <style>
- .lit-option {
- padding-top: 0.5em;
- margin-bottom: 0.0em;
- font-size: medium;
- color: #2d58b7
- }
- .lit-option-desc {
- display: block;
- margin-top: 0em;
- margin-bottom: 0em;
- margin-left: 20px;
- margin-right: 20px;
- }
- </style>
-</head>
-
-<body>
-<div id="menu">
- <div>
- <a href="http://llvm.org/">LLVM Home</a>
- </div>
-
- <div class="submenu">
- <label>libc++ Info</label>
- <a href="/index.html">About</a>
- </div>
-
- <div class="submenu">
- <label>Quick Links</label>
- <a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
- <a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
- <a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
- <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
- </div>
-</div>
-
-<div id="content">
-<!--*********************************************************************-->
- <h1>Testing libc++ using LIT</h1>
-<!--*********************************************************************-->
-<p>
-libc++ uses LIT to configure and run its tests. The primary way to run the
-libc++ tests is by using <code>make check-libcxx</code>. However since libc++
-can be used in any number of possible configurations it is important to
-customize the way LIT builds and runs the tests. This guide provides
-information on how to use LIT directly to test libc++.
-</p>
-<p>
-Documentation for LIT can be found
-<a href="http://llvm.org/docs/CommandGuide/lit.html">here</a>.
-</p>
-
-<!--*********************************************************************-->
- <h2>Getting Started</h2>
-<!--*********************************************************************-->
-<p>
-After building libc++ use the following commands before you start using LIT to
-test.
-</p>
-<ul>
- <li><code>alias lit='python path/to/llvm/utils/lit/lit.py'</code></li>
- <li><code>export LIBCXX_SITE_CONFIG=path/to/build-libcxx/test/lit.site.cfg</code></li>
-</ul>
-<p>
-You can now run the libc++ tests by running:
-</p>
-<ul>
- <li><code>cd path/to/libcxx</code></li>
- <li><code>lit -sv ./test</code></li>
-</ul>
-<p>
-To only run a subsection of the tests use:
-<ul>
- <li><code>lit -sv test/std/numerics # Run only the numeric tests</code></li>
-</ul>
-
-<!--*********************************************************************-->
- <h2>Customization Options</h2>
-<!--*********************************************************************-->
-<p>
-libc++'s testsuite provides multiple options to configure the way the tests
-are build and run. To use these options you pass them on the LIT command line
-as <code>--param NAME</code> or <code>--param NAME=VALUE</code>. Some options
-have default values specified during CMake's configuration. Passing the option
-on the command line will override the default.
-</p>
-
-
-<p>
-<h3 class="lit-option">libcxx_site_config=&lt;path/to/lit.site.cfg&gt;</h3>
-<blockquote class="lit-option-desc">
-Specify the site configuration to use when running the tests. This option
-overrides the enviroment variable <code>LIBCXX_SITE_CONFIG</code>
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">libcxx_headers=&lt;path/to/headers&gt;</h3>
-<blockquote class="lit-option-desc">
-Specify the libc++ headers that are tested. By default the headers in the source
-tree are used.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">libcxx_library=&lt;path/to/libc++.so&gt;</h3>
-<blockquote class="lit-option-desc">
-Specify the libc++ library that is tested. By default the library in the build
-directory is used. This option cannot be used when <code>use_system_lib</code>
-is provided.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">use_system_lib=&lt;bool&gt;</h3>
-<blockquote class="lit-option-desc">
-<b>Default: </b><code>False</code></br>
-Enable or disable testing against the installed version of libc++ library.
-Note: This does not use the installed headers.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">use_lit_shell=&lt;bool&gt;</h3>
-<blockquote class="lit-option-desc">
-Enable or disable the use of LIT's internal shell in ShTests. If the enviroment
-variable <code>LIT_USE_INTERNAL_SHELL</code> is present then that is used as the
-default value. Otherwise the default value is <code>True</code> on Windows and
-<code>False</code> on every other platform.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">no_default_flags=&lt;bool&gt;</h3>
-<blockquote class="lit-option-desc">
-<b>Default: </b><code>False</code></br>
-Disable all default compile and link flags from being added. When this option is
-used only flags specified using the <code>compile_flags</code> and
-<code>link_flags</code> will be used.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">compile_flags="&lt;list-of-args&gt;"</h3>
-<blockquote class="lit-option-desc">
-Specify additional compile flags as a space delimited string.
-Note: This options should not be used to change the standard version used.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">link_flags="&lt;list-of-args&gt;"</h3>
-<blockquote class="lit-option-desc">
-Specify additional link flags as a space delimited string.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">std=&lt;standard version&gt;</h3>
-<blockquote class="lit-option-desc">
-<b>Values: </b><code>c++98, c++03, c++11, c++14, c++1z</code></br>
-Change the standard version used when building the tests.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">debug_level=&lt;level&gt;</h3>
-<blockquote class="lit-option-desc">
-<b>Values: </b><code>0, 1</code></br>
-Enable the use of debug mode. Level 0 enables assertions and level 1 enables
-assertions and debugging of iterator misuse.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">use_sanitizer=&lt;sanitizer name&gt;</h3>
-<blockquote class="lit-option-desc">
-<b>Values: </b><code>Memory, MemoryWithOrigins, Address, Undefined</code></br>
-Run the tests using the given sanitizer. If <code>LLVM_USE_SANITIZER</code>
-was given when building libc++ then that sanitizer will be used by default.
-</blockquote>
-</p>
-
-<p>
-<h3 class="lit-option">color_diagnostics</h3>
-<blockquote class="lit-option-desc">
-Enable the use of colorized compile diagnostics. If the
-<code>color_diagnostics</code> option is specified or the enviroment variable
-<code>LIBCXX_COLOR_DIAGNOSTICS</code> is present then color diagnostics will be
-enabled.
-</blockquote>
-</p>
-
-</div>
-</body>
-</html>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/results.Linux.html b/chromium/buildtools/third_party/libc++/trunk/www/results.Linux.html
deleted file mode 100644
index 82416a36e13..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/www/results.Linux.html
+++ /dev/null
@@ -1,513 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>results.Linux</title>
-</head>
-<body>
-<pre>
-All failures in the libc++ test suite will be documented here.
-Note: glibc >= 2.16 is required for full C11 compatibility.
-
-Test Suite Run Information:
-Date: 8/18/2014
-Compiler: Clang Tip-of-Tree (r215809)
-ABI: libc++abi
-C Library: eglibc 2.19
-Platform: x86_64-linux-gnu
-Kernel: 3.13.0-32-generic
-Distribution: Ubuntu 14.04
-Run By: Eric Fiselier (eric at efcs dot ca)
-
-
-Testing Time: 1187.82s
-********************
-Failing Tests (33):
- libc++ :: localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp
- - GLIBC's locales collate strings differently. Needs investigation.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
- - Needs Investigation.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp
- - Idem
- libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp
- - Idem
- libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
- - Differences in GLIBC locales. Needs investigation.
- libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
- - Differences in GLIBC locales. Puts '-' before 'CNY' as opposed to after.
- libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
- - Differences in GLIBC locales. Needs investigation.
- libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
- - Differences in GLIBC locales. Puts '-' before 'CNY' as opposed to after.
- libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp
- - Expects ',' for ru_RU but gets '.'.
- libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp
- - Expects ',' for ru_RU but gets '.'.
- libc++ :: localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp
- - GLIBC puts "+nan" where "nan" is expected.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp
- - GLIBC has different locale data for fr_FR, ru_RU and zh_CN.
- The is also a possible bug in zh_CN tests. Needs investigation.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp
- - Some test cases are non-portible with GLIBC (include time zone).
- Other failures related to GLIBC locale data. Needs investigation.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp
- - GLIBC starts weekdays with lowercase letters. Test case expectes upper case.
- libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp
- - Idem.
- libc++ :: localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
- - GLIBC abbreviated days end with '.'. Test case expects no '.'.
- libc++ :: localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp
- - Needs investigation.
- libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp
- - Fails due to differences in GLIBC locales
- libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
- - Fails due to differences in GLIBC locales
- libc++ :: re/re.alg/re.alg.match/basic.pass.cpp
- - Needs investigation.
- libc++ :: re/re.alg/re.alg.match/ecma.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.match/extended.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.search/awk.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.search/basic.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.search/ecma.pass.cpp
- - Idem.
- libc++ :: re/re.alg/re.alg.search/extended.pass.cpp
- - Idem.
- libc++ :: re/re.traits/lookup_collatename.pass.cpp
- - Idem.
- libc++ :: re/re.traits/translate_nocase.pass.cpp
- - Idem.
-
-********************
-Expected Failing Tests (5):
- libc++ :: depr/depr.c.headers/math_h.pass.cpp
- - Fails a static assert that the return type of
- isnan(double) and isinf(double) is a bool. see PR18382.
- libc++ :: numerics/c.math/cmath_isinf.pass.cpp
- - Idem.
- libc++ :: numerics/c.math/cmath_isnan.pass.cpp
- - Idem.
- libc++ :: strings/c.strings/cuchar.pass.cpp
- - &lt;cuchar&gt; is not implemented.
- libc++ :: strings/c.strings/version_cuchar.pass.cpp
- - Idem.
-
- Expected Passes : 4716
- Expected Failures : 5
- Unexpected Failures: 33
-
-********************************************************************************
-
--- Testing: 4754 tests, 2 threads --
-FAIL: libc++ :: localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp (2073 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp4DtKocexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp4DtKocexe'
-Exit Code: -6
-Standard Error:
---
-tmp4DtKocexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp:38: int main(): Assertion `f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp (2152 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpAfkClkexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpAfkClkexe'
-Exit Code: -6
-Standard Error:
---
-tmpAfkClkexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp:38: int main(): Assertion `f.tolower('\xDA') == '\xFA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp (2153 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpGjakKeexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpGjakKeexe'
-Exit Code: -6
-Standard Error:
---
-tmpGjakKeexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp:35: int main(): Assertion `in[0] == '\xFA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp (2154 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp0gK3Y6exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp0gK3Y6exe'
-Exit Code: -6
-Standard Error:
---
-tmp0gK3Y6exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp:39: int main(): Assertion `f.toupper('\xFA') == '\xDA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp (2155 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpCoF624exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpCoF624exe'
-Exit Code: -6
-Standard Error:
---
-tmpCoF624exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp:35: int main(): Assertion `in[0] == '\xDA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp (2157 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpjOo8fnexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpjOo8fnexe'
-Exit Code: -6
-Standard Error:
---
-tmpjOo8fnexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp:53: int main(): Assertion `f.widen(char(-5)) == wchar_t(251)' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp (2158 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpDWZ5aNexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpDWZ5aNexe'
-Exit Code: -6
-Standard Error:
---
-tmpDWZ5aNexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp:60: int main(): Assertion `v[6] == wchar_t(133)' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp (2184 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpfA5HOrexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpfA5HOrexe'
-Exit Code: -6
-Standard Error:
---
-tmpfA5HOrexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp:71: int main(): Assertion `iter.base() == v.data() + v.size()' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp (2185 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpTI59qtexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpTI59qtexe'
-Exit Code: -6
-Standard Error:
---
-tmpTI59qtexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp:314: int main(): Assertion `iter.base() == v.data() + v.size()' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp (2192 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp1psSk2exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp1psSk2exe'
-Exit Code: -6
-Standard Error:
---
-tmp1psSk2exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp:70: int main(): Assertion `ex == "0,00 "' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp (2193 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpKwjbrPexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpKwjbrPexe'
-Exit Code: -6
-Standard Error:
---
-tmpKwjbrPexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp:218: int main(): Assertion `ex == "CNY -0.01"' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp (2198 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp4UnNQ2exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp4UnNQ2exe'
-Exit Code: -6
-Standard Error:
---
-tmp4UnNQ2exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/decimal_point.pass.cpp:114: int main(): Assertion `f.decimal_point() == ','' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp (2205 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp6MGZAmexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp6MGZAmexe'
-Exit Code: -6
-Standard Error:
---
-tmp6MGZAmexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.monetary/locale.moneypunct.byname/thousands_sep.pass.cpp:114: int main(): Assertion `f.thousands_sep() == ' '' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp (2229 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp7AME77exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp7AME77exe'
-Exit Code: -6
-Standard Error:
---
-tmp7AME77exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_long_double.pass.cpp:10886: void test5(): Assertion `ex == "nan"' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp (2249 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpooRjFgexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpooRjFgexe'
-Exit Code: -6
-Standard Error:
---
-tmpooRjFgexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date_wide.pass.cpp:64: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp (2250 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpcm_vb9exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpcm_vb9exe'
-Exit Code: -6
-Standard Error:
---
-tmpcm_vb9exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_date.pass.cpp:64: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp (2253 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpLKJQXHexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpLKJQXHexe'
-Exit Code: -6
-Standard Error:
---
-tmpLKJQXHexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one.pass.cpp:51: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp (2254 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpiDgYiqexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpiDgYiqexe'
-Exit Code: -6
-Standard Error:
---
-tmpiDgYiqexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_one_wide.pass.cpp:51: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp (2257 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpAUaH78exe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpAUaH78exe'
-Exit Code: -6
-Standard Error:
---
-tmpAUaH78exe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday.pass.cpp:74: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp (2258 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp7iGNTDexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp7iGNTDexe'
-Exit Code: -6
-Standard Error:
---
-tmp7iGNTDexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.get.byname/get_weekday_wide.pass.cpp:72: int main(): Assertion `i.base() == in+sizeof(in)/sizeof(in[0])-1' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp (2277 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpnT0vVFexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpnT0vVFexe'
-Exit Code: -6
-Standard Error:
---
-tmpnT0vVFexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp:73: int main(): Assertion `(ex == "Today is Samedi which is abbreviated Sam.")|| (ex == "Today is samedi which is abbreviated sam." )' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp (2281 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp47THCHexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp47THCHexe'
-Exit Code: -6
-Standard Error:
---
-tmp47THCHexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/category.time/locale.time.put/locale.time.put.members/put2.pass.cpp:185: int main(): Assertion `ex == "May"' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp (2285 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpn6fLHJexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpn6fLHJexe'
-Exit Code: -6
-Standard Error:
---
-tmpn6fLHJexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/grouping.pass.cpp:57: int main(): Assertion `np.grouping() == "\x7F"' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp (2286 of 4754)
-******************** TEST 'libc++ :: localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpkna8llexe' '/home/eric/workspace/staging-libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpkna8llexe'
-Exit Code: -6
-Standard Error:
---
-tmpkna8llexe: /home/eric/workspace/staging-libcxx/test/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp:57: int main(): Assertion `np.thousands_sep() == ','' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.match/basic.pass.cpp (3203 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.match/basic.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmp0wkTrlexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/basic.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmp0wkTrlexe'
-Exit Code: -6
-Standard Error:
---
-tmp0wkTrlexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/basic.pass.cpp:624: int main(): Assertion `std::regex_match(s, m, std::regex("[a[=M=]z]", std::regex_constants::basic))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.match/ecma.pass.cpp (3204 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.match/ecma.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpghcl7yexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/ecma.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpghcl7yexe'
-Exit Code: -6
-Standard Error:
---
-tmpghcl7yexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/ecma.pass.cpp:585: int main(): Assertion `std::regex_match(s, m, std::regex("[a[=M=]z]"))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.match/extended.pass.cpp (3208 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.match/extended.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpGVUdIMexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/extended.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpGVUdIMexe'
-Exit Code: -6
-Standard Error:
---
-tmpGVUdIMexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.match/extended.pass.cpp:622: int main(): Assertion `std::regex_match(s, m, std::regex("[a[=M=]z]", std::regex_constants::extended))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.search/awk.pass.cpp (3218 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.search/awk.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpgFuw4cexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/awk.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpgFuw4cexe'
-Exit Code: -6
-Standard Error:
---
-tmpgFuw4cexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/awk.pass.cpp:694: int main(): Assertion `std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::awk))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.search/basic.pass.cpp (3219 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.search/basic.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpXeQuwGexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/basic.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpXeQuwGexe'
-Exit Code: -6
-Standard Error:
---
-tmpXeQuwGexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/basic.pass.cpp:696: int main(): Assertion `std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::basic))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.search/ecma.pass.cpp (3220 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.search/ecma.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpvGAAImexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/ecma.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpvGAAImexe'
-Exit Code: -6
-Standard Error:
---
-tmpvGAAImexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/ecma.pass.cpp:675: int main(): Assertion `std::regex_search(s, m, std::regex("[a[=M=]z]"))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.alg/re.alg.search/extended.pass.cpp (3224 of 4754)
-******************** TEST 'libc++ :: re/re.alg/re.alg.search/extended.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpGvouurexe' '/home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/extended.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpGvouurexe'
-Exit Code: -6
-Standard Error:
---
-tmpGvouurexe: /home/eric/workspace/staging-libcxx/test/re/re.alg/re.alg.search/extended.pass.cpp:694: int main(): Assertion `std::regex_search(s, m, std::regex("[a[=M=]z]", std::regex_constants::extended))' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.traits/lookup_collatename.pass.cpp (3349 of 4754)
-******************** TEST 'libc++ :: re/re.traits/lookup_collatename.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpItXmtJexe' '/home/eric/workspace/staging-libcxx/test/re/re.traits/lookup_collatename.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpItXmtJexe'
-Exit Code: -6
-Standard Error:
---
-tmpItXmtJexe: /home/eric/workspace/staging-libcxx/test/re/re.traits/lookup_collatename.pass.cpp:31: void test(const char_type *, const std::basic_string<char_type> &) [char_type = char]: Assertion `t.lookup_collatename(F(A), F(A + t.length(A))) == expected' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-FAIL: libc++ :: re/re.traits/translate_nocase.pass.cpp (3354 of 4754)
-******************** TEST 'libc++ :: re/re.traits/translate_nocase.pass.cpp' FAILED ********************
-Compiled With: '/opt/llvm-tot/bin/clang++' '-o' '/tmp/tmpGsRNu3exe' '/home/eric/workspace/staging-libcxx/test/re/re.traits/translate_nocase.pass.cpp' '-nostdinc++' '-std=c++11' '-D__STDC_FORMAT_MACROS' '-D__STDC_LIMIT_MACROS' '-D__STDC_CONSTANT_MACROS' '-I/home/eric/workspace/staging-libcxx/test/../include' '-I/home/eric/workspace/staging-libcxx/test/../test/support' '-nodefaultlibs' '-L/home/eric/workspace/build-libcxx-staging/lib' '-lc++' '-lc++abi' '-lgcc_eh' '-lc' '-lm' '-lpthread' '-lrt' '-lgcc_s' '-Wl,-R' '/home/eric/workspace/build-libcxx-staging/lib'
-Command: '/tmp/tmpGsRNu3exe'
-Exit Code: -6
-Standard Error:
---
-tmpGsRNu3exe: /home/eric/workspace/staging-libcxx/test/re/re.traits/translate_nocase.pass.cpp:44: int main(): Assertion `t.translate_nocase('\xDA') == '\xFA'' failed.
---
-
-Compiled test failed unexpectedly!
-********************
-</pre>
-</body>
-</html>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/results.Windows.html b/chromium/buildtools/third_party/libc++/trunk/www/results.Windows.html
deleted file mode 100644
index a5ec1218a1b..00000000000
--- a/chromium/buildtools/third_party/libc++/trunk/www/results.Windows.html
+++ /dev/null
@@ -1,487 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>results.Windows</title>
-</head>
-<body>
-<pre>
-All failures in the libc++ test suite will be documented here.
-
-Last run was with Clang (pre-3.1) and GCC 4.6.3 (with dw2 exception handling) and
- mingw-w64 v2.0.3 on i686-w64-mingw32.
-
-The following line was added to ./lib/buildit to make a static libc++ library because a DLL requires "declspec(dllexport)" or a .def file:
-ar rcs libc++.a *.o
-I also deleted libc++.dll and libc++.dll.a to make sure libc++ was linked statically to prevent unrelated issues from contaminating the test results.
-The commands to build and test were (-nodefaultlibs does not work, lots of MinGW related stuff gets left out resulting in linker failures):
-TRIPLE=i686-w64-mingw32 ./buildit
-TRIPLE=i686-w64-mingw32 HEADER_INCLUDE="-I/home/Ruben/libcxx/include" LIBS="-L/home/ruben/libcxx/lib -lc++ -lpthread -lsupc++ -lmsvcr100 -Wl,--allow-multiple-definition" ./testit > test.log 2>&1
-
-Note: Some locale tests may "Need investigating", but I think most problems are
- caused by wrong/unportable locale naming in the tests.
-Note: Some tests failed to link because "test.exe" was still running when ld.exe
- tried to link the next test. I left these failures out of the list; they
- account for about 10-30 failures, and are counted in the total scores below.
- I reran some of these failures manually and they passed.
-Note: Some tests fail at runtime but pass when run manually. Usage of std::cout
- segfaults so further investigation is difficult. These also contribute to
- the failures total, but are left out of the failure list, as the cause is
- probably not located in that part of libc++, not locatable due to the lack
- of usable debug info generated by Clang at this time.
-
-TOTAL RESULTS:
-Section failures / total sections: 104 / 1064 = 9.8% failures
-Test failures / total number of tests: 292 / 4326 = 6.7% failures
-
-depr/
- depr.c.headers/
- inttypes_h.pass.cpp: missing macros for C++.
- uchar_h.pass.cpp: bug in mingw-w64 headers for C++11 builtin char types.
- wchar_h.pass.cpp: Windows does not have swprintf, should use _snwprintf.
- Suggest #define swprintf as _snwprintf for _WIN32.
-exception.unexpected/
- set.unexpected/
- get_unexpected.pass.cpp: Segmentation fault - needs investigation.
- set_unexpected.pass.cpp: idem.
-diagnostics/
- syserr/
- syserr.errcat/
- syserr.errcat.objects/
- system_category.pass.cpp: Needs investigation.
-input.output/
- file.streams/
- c.files/
- cinttypes.pass.cpp: missing macros for C++.
- fstreams/
- filebuf.assign/
- member_swap.pass.cpp: Segmentation fault - needs investigation.
- move_assign.pass.cpp: idem.
- nonmember_swap.pass.cpp: idem.
- filebuf.cons/
- move.pass.cpp: idem.
- filebuf.members/
- open_pointers.pass.cpp: idem.
- filebuf.virtuals/
- overflow.pass.cpp: idem.
- pbackfail.pass.cpp: idem.
- seekoff.pass.cpp: idem.
- underflow.pass.cpp: idem.
- fstream.assign/
- member_swap.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- nonmember_swap.pass.cpp: idem.
- fstream.cons/
- move.pass.cpp: idem.
- pointer.pass.cpp: idem.
- string.pass.cpp: idem.
- fstream.members/
- open_pointer.pass.cpp: idem.
- open_string.pass.cpp: idem.
- ifstream.assign/
- member_swap.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- nonmember_swap.pass.cpp: idem.
- ifstream.cons/
- move.pass.cpp: idem.
- pointer.pass.cpp: idem.
- string.pass.cpp: idem.
- ifstream.members/
- open_pointer.pass.cpp: idem.
- open_string.pass.cpp: idem.
- rdbuf.pass.cpp: idem.
- ofstream.assign/
- member_swap.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- nonmember_swap.pass.cpp: idem.
- ofstream.cons/
- move.pass.cpp: idem.
- pointer.pass.cpp: idem.
- string.pass.cpp: idem.
- ofstream.members/
- open_pointer.pass.cpp: idem.
- open_string.pass.cpp: idem.
- rdbuf.pass.cpp: idem.
- iostream.format/
- ext.manip
- get_money.pass.cpp: Windows locale names don't follow UNIX convention.
- get_time.pass.cpp: idem.
- put_money.pass.cpp: idem.
- put_time.pass.cpp: idem.
- output.streams/
- ostream.formatted/
- ostream.inserters.arithmetic/
- long_double.pass.cpp: Segfault - needs investigation.
- pointer.pass.cpp: idem.
- ostream_sentry/
- destruct.pass.cpp: idem.
- iostream.objects/
- narrow.stream.objects/
- cerr.pass.cpp: idem.
- cin.pass.cpp: idem.
- wide.stream.objects/
- wcerr.pass.cpp: idem.
- wcin.pass.cpp: idem.
- iostreams.base/
- ios/
- basic.ios.members/
- copyfmt.pass.cpp: Windows locale names don't follow UNIX convention.
- imbue.pass.cpp: idem.
- move.pass.cpp: idem.
- swap.pass.cpp: Windows locale names don't follow UNIX convention.
- ios.base/
- ios.base.callback/
- register_callback.pass.cpp: Windows locale names don't follow UNIX convention.
- ios.base.locales/
- imbue.pass.cpp: Windows locale names don't follow UNIX convention.
- stream.buffers/
- streambuf/
- streambuf.cons/
- copy.pass.cpp: Windows locale names don't follow UNIX convention.
- default.pass.cpp: idem.
- streambuf.members/
- streambuf.buffer/
- locales.pass.cpp: Windows locale names don't follow UNIX convention.
- streambuf.protected/
- streambuf.assign/
- assign.pass.cpp: Windows locale names don't follow UNIX convention.
- swap.pass.cpp: idem.
-language.support/
- support.exception/
- except.nested/
- assign.pass.cpp: Needs investigation.
- ctor_copy.pass.cpp: idem.
- ctor_default.pass.cpp: idem.
- rethrow_if_nested.pass.cpp: idem.
- rethrow_nested.pass.cpp: idem.
- throw_with_nested.pass.cpp: idem.
- propagation/
- current_exception.pass.cpp: Needs investigation.
- exception_ptr.pass.cpp: idem.
- make_exception_ptr.pass.cpp: idem.
- rethrow_exception.pass.cpp: idem.
- uncaught/
- uncaught_exception.pass.cpp: Needs investigation.
- support.limits/
- limits/
- numeric.limits.members/
- digits.pass.cpp: Needs investigation (wrong assumptions?).
- digits10.pass.cpp: idem.
- support.runtime/
- support.start.term/
- quick_exit.pass.cpp: Not declared in libc++ headers. Is it from the ABI lib?
- support.types/
- max_align_t.pass.cpp: needs investigation (wrong assumptions?).
-localization/
- locale.categories/
- category.collate/
- locale.collate.byname/
- compare.pass.cpp: Windows locale names don't follow UNIX convention.
- hash.pass.cpp: idem.
- transform.pass.cpp: getenv should be replaced by putenv for portability.
- Windows locale names don't follow UNIX convention.
- types.pass.cpp: Windows locale names don't follow UNIX convention.
- locale.categories/
- category.ctype/
- locale.codecvt/
- locale.codecvt.members/
- wchar_t_in.pass.cpp: Most likely wchar_t is assumed 4 bytes.
- wchar_t_length.pass.cpp: idem.
- wchar_t_out.pass.cpp: idem.
- wchar_t_unshift.pass.cpp: idem.
- locale.codecvt.byname/
- ctor_wchar_t.pass.cpp: Windows locale names don't follow UNIX convention.
- locale.ctype.byname/
- is_1.pass.cpp: Windows locale names don't follow UNIX convention.
- is_many.pass.cpp: idem.
- narrow_1.pass.cpp: idem.
- narrow_many.pass.cpp: idem.
- scan_is.pass.cpp: idem.
- scan_not.pass.cpp: idem.
- tolower_1.pass.cpp: idem.
- tolower_many.pass.cpp: idem.
- toupper_1.pass.cpp: idem.
- toupper_many.pass.cpp: idem.
- types.pass.cpp: idem.
- widen_1.pass.cpp: idem.
- widen_many.pass.cpp: idem.
- category.monetary/
- locale.money.get/
- locale.money.get.members/
- get_long_double_en_US.pass.cpp: Windows locale names don't follow UNIX convention.
- get_long_double_fr_FR.pass.cpp: idem.
- get_long_double_ru_RU.pass.cpp: idem.
- get_long_double_zh_CN.pass.cpp: idem.
- get_string_en_US.pass.cpp: idem.
- locale.money.put/
- locale.money.put.members/
- put_long_double_en_US.pass.cpp: Windows locale names don't follow UNIX convention.
- put_long_double_fr_FR.pass.cpp: idem.
- put_long_double_ru_RU.pass.cpp: idem.
- put_long_double_zh_CN.pass.cpp: idem.
- put_string_en_US.pass.cpp: idem.
- locale.moneypunct.byname/
- curr_symbol.pass.cpp: Failed constructing from C locale. Needs investigation.
- decimal_point.pass.cpp: idem.
- frac_digits.pass.cpp: idem.
- grouping.pass.cpp: idem.
- neg_format.pass.cpp: idem.
- negative_sign.pass.cpp: idem.
- pos_format.pass.cpp: idem.
- positive_sign.pass.cpp: idem.
- thousands_sep.pass.cpp: idem.
- category.numeric/
- locale.nm.put/
- facet.num.put.members/
- put_double.pass.cpp: idem. (different floating point format?)
- put_long_double.pass.cpp: idem.
- put_pointer.pass.cpp: idem.
- locale.num.get/
- facet.num.get.members/
- get_double.pass.cpp: Needs investigating.
- get_float.pass.cpp: idem.
- get_long_double.pass.cpp: idem.
- get_pointer.pass.cpp: idem.
- category.time/
- locale.time.get/
- locale.time.get.byname/
- date_order.pass.cpp: Windows locale names don't follow UNIX convention.
- date_order_wide.pass.cpp: idem.
- get_date.pass.cpp: idem.
- get_date_wide.pass.cpp: idem.
- get_monthname.pass.cpp: idem.
- get_monthname_wide.pass.cpp: idem.
- get_one.pass.cpp: idem.
- get_one_wide.pass.cpp: idem.
- get_time.pass.cpp: idem.
- get_time_wide.pass.cpp: idem.
- get_weekday.pass.cpp: idem.
- get_weekday_wide.pass.cpp: idem.
- get_year.pass.cpp: idem.
- get_year_wide.pass.cpp: idem.
- locale.time.put/
- locale.time.put.members/
- put1.pass.cpp: Needs investigating.
- put2.pass.cpp: idem.
- locale.time.put.byname/
- put1.pass.cpp: Windows locale names don't follow UNIX convention.
- facet.numpunct/
- locale.numpunct/
- locale.numpunct.byname/
- decimal_point.pass.cpp: Failed constructing from C locale. Needs investigation.
- grouping.pass.cpp: idem.
- thousands_sep.pass.cpp: idem.
- locale.stdcvt/
- codecvt_utf16_in.pass.cpp: 0x40003 does not fit in a 2-byte wchar_t.
- codecvt_utf16_out.pass.cpp: idem.
- codecvt_utf8_in.pass.cpp: idem.
- codecvt_utf8_out.pass.cpp: idem.
- codecvt_utf8_utf16_in.pass: idem.
- codecvt_utf8_utf16_out.pass.cpp: idem.
- locales/
- locale/
- locale.cons/
- assign.pass.cpp: Windows locale names don't follow UNIX convention.
- char_pointer.pass.cpp: idem.
- copy.pass.cpp: idem.
- default.pass.cpp: idem.
- locale_char_pointer_cat.pass.cpp: idem.
- locale_facetptr.pass.cpp: idem.
- locale_locale_cat.pass.cpp: idem.
- locale_string_cat.pass.cpp: idem.
- string.pass.cpp: idem.
- locale.members/
- name.pass.cpp: Windows locale names don't follow UNIX convention.
- locale.operators/
- eq.pass.cpp: Windows locale names don't follow UNIX convention.
- locale/locale.statics/
- classic.pass.cpp: Failed constructing from C locale. Needs investigation.
- global.pass.cpp: Windows locale names don't follow UNIX convention.
- locale.convenience/
- conversions/
- conversions.buffer/
- overflow.pass.cpp: Needs investigation.
- pbackfail.pass.cpp: idem.
- seekoff.pass.cpp: idem.
- test.pass.cpp: idem.
- underflow.pass.cpp: idem.
- conversions.string/
- converted.pass.cpp: out of range hex sequence due to 2-byte wchar_t.
- from_bytes.pass.cpp: idem (This test passed while it probably shouldn't!).
- to_bytes.pass.cpp: idem.
-numerics/
- complex.number/
- complex.value.ops/
- abs.pass.cpp: Failed assertion.
- arg.pass.cpp: idem.
- rand/
- rand.device/
- ctor.pass.cpp: No such thing as /dev/urandom on Windows. Need alternative.
- entropy.pass.cpp: idem.
- eval.pass.cpp: idem.
- rand.dis/
- rand.dist.bern/
- rand.dist.bern.bernoulli/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.bern.bin/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.bern.geo/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.bern.negbin/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm/
- rand.dist.norm.cauchy/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.chisq/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.norm.f/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.lognormal/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.normal/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.norm.t/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois/
- rand.dist.pois.exp/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois.extreme/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois.gamma/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois.poisson/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.pois.weibull/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.samp/
- rand.dist.samp.discrete/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.samp.pconst/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.samp.plinear/
- io.pass.cpp: Needs investigation. (different output double format?)
- rand.dist.uni/
- rand.dist.uni.real/
- io.pass.cpp: Needs investigation. (different output double format?)
-re/
- re.alg/
- re.alg.match/
- awk.pass.cpp: Needs investigation.
- basic.pass.cpp: idem.
- ecma.pass.cpp: idem.
- extended.pass.cpp: idem.
- re.alg.search/
- awk.pass.cpp: Needs investigation.
- basic.pass.cpp: idem.
- ecma.pass.cpp: idem.
- extended.pass.cpp: idem.
- re.regex/
- re.regex.locale/
- imbue.pass.cpp: Windows locale names don't follow UNIX convention.
- re.traits/
- default.pass.cpp: Windows locale names don't follow UNIX convention.
- getloc.pass.cpp: idem.
- imbue.pass.cpp: idem.
- isctype.pass.cpp: Needs investigation.
- lookup_classname.pass.cpp: idem.
- lookup_collatename.pass.cpp: Windows locale names don't follow UNIX convention.
- transform.pass.cpp: idem.
- transform_primary.pass.cpp: idem
- translate_nocase.pass.cpp: Needs investigation.
-strings/
- c.strings/
- cuchar.pass.cpp: see previous note about uchar.h.
- cwchar.pass.cpp: I suggest including the win32 support header which defines
- (v)swprintf to the Windows equivalent.
- version_cuchar.pass.cpp: see previous note about uchar.h.
- string.conversions/
- stod.pass.cpp: "no conversion". Needs investigation.
- stof.pass.cpp: idem.
- to_string.pass.cpp: Needs investigation.
- to_wstring.pass.cpp: idem.
-thread/
- futures/
- futures.async/
- async.pass.cpp: Needs investigation.
- futures.promise/
- alloc_ctor.pass.cpp: Needs investigation.
- default.pass.cpp: idem.
- dtor.pass.cpp: idem.
- get_future.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- move_ctor.pass.cpp: idem.
- set_exception.pass.cpp: idem.
- set_exception_at_thread_exit.pass.cpp: idem.
- set_lvalue.pass.cpp: idem.
- set_lvalue_at_thread_exit.pass.cpp: idem.
- set_rvalue.pass.cpp: idem.
- set_rvalue_at_thread_exit.pass.cpp: idem.
- set_value_at_thread_exit_const.pass.cpp: idem.
- set_value_at_thread_exit_void.pass.cpp: idem.
- set_value_const.pass.cpp: idem.
- set_value_void.pass.cpp: idem.
- swap.pass.cpp: idem.
- futures.shared_future/
- copy_assign.pass.cpp: Needs investigation.
- copy_ctor.pass.cpp: idem.
- ctor_future.pass.cpp: idem.
- dtor.pass.cpp: idem.
- get.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- move_ctor.pass.cpp: idem.
- wait.pass.cpp: idem.
- wait_for.pass.cpp: idem.
- wait_until.pass.cpp: idem.
- futures.tas/
- futures.task.members/
- assign_move.pass.cpp: Needs investigation.
- ctor_func.pass.cpp: idem.
- ctor_func_alloc.pass.cpp: idem.
- ctor_move.pass.cpp: idem.
- dtor.pass.cpp: idem.
- get_future.pass.cpp: idem.
- make_ready_at_thread_exit.pass.cpp: idem.
- operator.pass.cpp: idem.
- reset.pass.cpp: idem.
- swap.pass.cpp: idem.
- futures.task.nonmembers/
- swap.pass.cpp: Needs investigation.
- futures.unique_future/
- dtor.pass.cpp: Needs investigation.
- get.pass.cpp: idem.
- move_assign.pass.cpp: idem.
- move_ctor.pass.cpp: idem.
- share.pass.cpp: idem.
- wait.pass.cpp: idem.
- wait_for.pass.cpp: idem.
- wait_until.pass.cpp: idem.
- thread.condition/
- thread.condition.condvar/
- wait_for.pass.cpp: Needs investigation.
- thread.condition.condvarany/
- wait_for.pass.cpp: Needs investigation.
- thread.mutex/
- thread.lock/
- thread.lock.unique/
- thread.lock.unique.cons/
- mutex_try_to_lock.pass.cpp: Needs investigation.
- thread.threads/
- thread.thread.class/
- thread.thread.constr/
- move.pass.cpp: Needs investigation.
- thread.thread.id/
- join.pass.cpp: Needs investigation.
- thread.thread.static/
- hardware_concurrency.pass.cpp: Needs investigation.
-utilities/
- meta/
- meta.trans/
- meta.trans.other/
- aligned_storage.pass.cpp: Probably due to sizeof(long) != 8.
- meta.trans.sign/
- make_signed.pass.cpp: Probably due to sizeof(wchar_t) != 4.
- make_unsigned.pass.cpp: idem.
- meta.unary.prop.query/
- alignment_of.pass.cpp: Probably a Clang problem on Windows.
-</pre>
-</body>
-</html>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/ts1z_status.html b/chromium/buildtools/third_party/libc++/trunk/www/ts1z_status.html
index 9d4a000b0b9..48ce4542d38 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/ts1z_status.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/ts1z_status.html
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
@@ -72,6 +72,14 @@
<tr><td>Time Utilities</td><td>Complete</td></tr>
<tr><td>System Error Support</td><td>Complete</td></tr>
<tr><td></td><td></td></tr>
+ <tr><td>Class memory_resource</td><td>Complete</td></tr>
+ <tr><td>Class template polymorphic_allocator</td><td>Complete</td></tr>
+ <tr><td>Template alias resource_adaptor</td><td>Complete</td></tr>
+ <tr><td>Global memory resources</td><td>Complete</td></tr>
+ <tr><td>Pool resource classes</td><td>Implementation in progress</td></tr>
+ <tr><td>Class monotonic_buffer_resource</td><td>Implementation in progress</td></tr>
+ <tr><td>Alias templates using polymorphic memory resource</td><td>Complete</td></tr>
+ <tr><td></td><td></td></tr>
<tr><td>Searchers</td><td>Complete</td></tr>
<tr><td>Optional Objects</td><td>Initial implementation complete</td></tr>
<tr><td>class any</td><td>Complete</td></tr>
@@ -90,12 +98,12 @@
<h3>Features in Filesystem</h3>
<table id="Features" border="1">
- <tr><th>Feature Name</th><th>Status</th></tr>
- <tr><td>All features</td><td>Not started</td></tr>
+ <tr><th>Feature Name</th><th>Status</th><th>First released version</th></tr>
+ <tr><td>All features</td><td>Complete</td><td>3.9</td></tr>
</table>
- <p>Last Updated: 7-Dec-2015</p>
+ <p>Last Updated: 17-June-2016</p>
</div>
</body>
</html>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/type_traits_design.html b/chromium/buildtools/third_party/libc++/trunk/www/type_traits_design.html
index 422bba4a7f5..2c7f73b500e 100644
--- a/chromium/buildtools/third_party/libc++/trunk/www/type_traits_design.html
+++ b/chromium/buildtools/third_party/libc++/trunk/www/type_traits_design.html
@@ -24,7 +24,7 @@
<label>Quick Links</label>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
<a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
- <a href="http://llvm.org/bugs/">Bug Reports</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
<a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
</div>
diff --git a/chromium/buildtools/third_party/libc++/trunk/www/upcoming_meeting.html b/chromium/buildtools/third_party/libc++/trunk/www/upcoming_meeting.html
new file mode 100644
index 00000000000..90a192828e5
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++/trunk/www/upcoming_meeting.html
@@ -0,0 +1,129 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<!-- Material used from: HTML 4.01 specs: http://www.w3.org/TR/html401/ -->
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>libc++ Upcoming Meeting Status</title>
+ <link type="text/css" rel="stylesheet" href="menu.css">
+ <link type="text/css" rel="stylesheet" href="content.css">
+</head>
+
+<body>
+<div id="menu">
+ <div>
+ <a href="http://llvm.org/">LLVM Home</a>
+ </div>
+
+ <div class="submenu">
+ <label>libc++ Info</label>
+ <a href="/index.html">About</a>
+ </div>
+
+ <div class="submenu">
+ <label>Quick Links</label>
+ <a href="http://lists.llvm.org/mailman/listinfo/cfe-dev">cfe-dev</a>
+ <a href="http://lists.llvm.org/mailman/listinfo/cfe-commits">cfe-commits</a>
+ <a href="https://bugs.llvm.org/">Bug Reports</a>
+ <a href="http://llvm.org/svn/llvm-project/libcxx/trunk/">Browse SVN</a>
+ <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/">Browse ViewVC</a>
+ </div>
+</div>
+
+<div id="content">
+ <!--*********************************************************************-->
+ <h1>libc++ Issaquah Status</h1>
+ <!--*********************************************************************-->
+
+ <p>This is a temporary page; please check the c++1z status <a href="http://libcxx.llvm.org/cxx1z_status.html">here</a></p>
+ <p>This page shows the status of the papers and issues that are expected to be adopted in Issaquah.</p>
+
+ <p>The groups that have contributed papers:
+ <ul>
+ <li>LWG - Library working group</li>
+ <li>CWG - Core Language Working group</li>
+ <li>SG1 - Study group #1 (Concurrency working group)</li>
+ </ul>
+ </p>
+
+ <h3>Paper Status</h3>
+ <table id="papers" border="1">
+ <tr><th>Paper #</th><th>Group</th><th>Paper Name</th><th>Meeting</th><th>Status</th><th>First released version</th></tr>
+<!--
+ <tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3346.pdf">3346</a></td><td>LWG</td><td>Terminology for Container Element Requirements - Rev 1</td><td>Kona</td><td>Complete</td><td>3.4</td></tr>
+-->
+<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
+ </table>
+
+ <h3>Library Working group Issues Status</h3>
+ <table id="issues" border="1">
+ <tr><th>Issue #</th><th>Issue Name</th><th>Meeting</th><th>Status</th></tr>
+
+ <tr><td><a href="http://wg21.link/LWG2260">2260</a></td><td>Missing requirement for Allocator::pointer</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2768">2768</a></td><td>any_cast and move semantics</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2769">2769</a></td><td>Redundant const in the return type of any_cast(const any&amp;)</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2781">2781</a></td><td>Contradictory requirements for std::function and std::reference_wrapper</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2782">2782</a></td><td>scoped_allocator_adaptor constructors must be constrained</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2784">2784</a></td><td>Resolution to LWG 2484 is missing "otherwise, no effects" and is hard to parse</td><td>Kona</td><td><i>Patch Ready</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2785">2785</a></td><td>quoted should work with basic_string_view</td><td>Kona</td><td><i>We do this already</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2786">2786</a></td><td>Annex C should mention shared_ptr changes for array support</td><td>Kona</td><td><i>Nothing to do</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2787">2787</a></td><td>&sect;[file_status.cons] doesn't match class definition</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2789">2789</a></td><td>Equivalence of contained objects</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2794">2794</a></td><td>Missing requirements for allocator pointers</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2795">2795</a></td><td>&sect;[global.functions] provides incorrect example of ADL use</td><td>Kona</td><td><i>Nothing to do</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2804">2804</a></td><td>Unconditional constexpr default constructor for istream_iterator</td><td>Kona</td><td><i>We do this already</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2812">2812</a></td><td>Range access is available with &lt;string_view&gt;</td><td>Kona</td><td><i>We do this already</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2824">2824</a></td><td>list::sort should say that the order of elements is unspecified if an exception is thrown</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2826">2826</a></td><td>string_view iterators use old wording</td><td>Kona</td><td><i>Nothing to do</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2834">2834</a></td><td>Resolution LWG 2223 is missing wording about end iterators</td><td>Kona</td><td><i>Nothing to do</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2835">2835</a></td><td>LWG 2536 seems to misspecify &lt;tgmath.h&gt;</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2837">2837</a></td><td>gcd and lcm should support a wider range of input values</td><td>Kona</td><td><i>We do this already</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2838">2838</a></td><td>is_literal_type specification needs a little cleanup</td><td>Kona</td><td><i>Nothing to do</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2842">2842</a></td><td>in_place_t check for optional::optional(U&amp;&amp;) should decay U</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2850">2850</a></td><td>std::function move constructor does unnecessary work</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2853">2853</a></td><td>Possible inconsistency in specification of erase in [vector.modifiers]</td><td>Kona</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2855">2855</a></td><td>std::throw_with_nested("string_literal")</td><td>Kona</td><td></td></tr>
+
+ <tr><td></td><td><center><b>Priority 1 Bugs</b></center></td><td></td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2665">2665</a></td><td>remove_filename() post condition is incorrect</td><td>Kona</td><td>We do this already</td></tr>
+ <tr><td><a href="http://wg21.link/LWG2806">2806</a></td><td>Base class of bad_optional_access</td><td>Kona</td><td><i>We do this already</i></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2857">2857</a></td><td>{variant,optional,any}::emplace should return the constructed value</td><td>Kona</td><td></td></tr>
+
+ </table>
+
+<h3>Comments about the issues</h3>
+<ul>
+<li>2260 - Check our current allocators to make sure we do this</li>
+<li>2768 - Resolution is "apply 2769"</li>
+<li>2769 - This should be easy; trick will be devising tests.</li>
+<li>2781 - </li>
+<li>2782 - Looks straightforward.</li>
+<li>2784 - Patch Ready</li>
+<li>2785 - We do this already.</li>
+<li>2786 - Nothing to do; just moving words around</li>
+<li>2787 - Eric? </li>
+<li>2789 - I don't think there are any code changes required here</li>
+<li>2794 - I don't think there are any code changes required here - maybe a static_assert.</li>
+<li>2795 - Nothing to do; just moving words around</li>
+<li>2804 - We do this already.</li>
+<li>2812 - We do this already.</li>
+<li>2824 - Nothing do to here, but we should add some throwing sort tests.</li>
+<li>2826 - Nothing to do; just moving words around</li>
+<li>2834 - Nothing to do; just moving words around</li>
+<li>2835 - I'm pretty sure we already do this.</li>
+<li>2837 - Added some tests to ensure we do this already.</li>
+<li>2838 - Nothing to do; just moving words around</li>
+<li>2842 - This should be easy; trick will be devising tests.</li>
+<li>2850 - I think we already do this.</li>
+<li>2853 - I think that this will be mostly adding tests.</li>
+<li>2855 - This should be easy; trick will be devising tests.</li></li>
+<li></li>
+<li>2665 - We do this already.</li>
+<li>2806 - We do this already.</li>
+<li>2857 - This is the subject of several NB comments.</li>
+</ul>
+
+<p>Last Updated: 7-Feb-2017</p>
+</div>
+</body>
+</html>
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/.arcconfig b/chromium/buildtools/third_party/libc++abi/trunk/.arcconfig
index 98e96a840c2..0c5cf4e87ba 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/.arcconfig
+++ b/chromium/buildtools/third_party/libc++abi/trunk/.arcconfig
@@ -1,4 +1,4 @@
{
"project_id" : "libcxxabi",
- "conduit_uri" : "http://reviews.llvm.org/"
+ "conduit_uri" : "https://reviews.llvm.org/"
}
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/.clang-format b/chromium/buildtools/third_party/libc++abi/trunk/.clang-format
new file mode 100644
index 00000000000..2d1d3bee68f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/.clang-format
@@ -0,0 +1,12 @@
+BasedOnStyle: LLVM
+
+---
+Language: Cpp
+
+AlwaysBreakTemplateDeclarations: true
+PointerAlignment: Left
+
+# Disable formatting options which may break tests.
+SortIncludes: false
+ReflowComments: false
+---
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/CMakeLists.txt b/chromium/buildtools/third_party/libc++abi/trunk/CMakeLists.txt
index d77f7849ea5..2a0b4da1621 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/CMakeLists.txt
+++ b/chromium/buildtools/third_party/libc++abi/trunk/CMakeLists.txt
@@ -2,26 +2,35 @@
# Setup Project
#===============================================================================
-cmake_minimum_required(VERSION 2.8.8)
+cmake_minimum_required(VERSION 3.4.3)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
endif()
+# Add path for custom modules
+set(CMAKE_MODULE_PATH
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
+ ${CMAKE_MODULE_PATH}
+ )
+
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
project(libcxxabi)
# Rely on llvm-config.
set(CONFIG_OUTPUT)
- find_program(LLVM_CONFIG "llvm-config")
+ if (NOT LLVM_CONFIG_PATH)
+ find_program(LLVM_CONFIG_PATH "llvm-config")
+ endif()
if(DEFINED LLVM_PATH)
set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} CACHE PATH "Path to llvm/include")
set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
- elseif(LLVM_CONFIG)
- message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
- set(CONFIG_COMMAND ${LLVM_CONFIG}
+ elseif(LLVM_CONFIG_PATH)
+ message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}")
+ set(CONFIG_COMMAND ${LLVM_CONFIG_PATH}
"--includedir"
"--prefix"
"--src-root")
@@ -47,11 +56,23 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
- set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
set(LLVM_LIT_PATH "${LLVM_PATH}/utils/lit/lit.py")
+
+ # --cmakedir is supported since llvm r291218 (4.0 release)
+ execute_process(
+ COMMAND ${LLVM_CONFIG_PATH} --cmakedir
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE CONFIG_OUTPUT
+ ERROR_QUIET)
+ if(NOT HAD_ERROR)
+ string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH)
+ else()
+ set(LLVM_CMAKE_PATH
+ "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+ endif()
else()
message(FATAL_ERROR "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. "
- "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config "
+ "Reconfigure with -DLLVM_CONFIG_PATH=path/to/llvm-config "
"or -DLLVM_PATH=path/to/llvm-source-root.")
endif()
@@ -64,10 +85,14 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
endif()
set(PACKAGE_NAME libcxxabi)
- set(PACKAGE_VERSION 3.7.0svn)
+ set(PACKAGE_VERSION 5.0.0svn)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")
+ if (NOT DEFINED LLVM_INCLUDE_TESTS)
+ set(LLVM_INCLUDE_TESTS ON)
+ endif()
+
if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
else()
@@ -93,13 +118,10 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(LLVM_INCLUDE_TESTS OFF)
endif()
- set(LIBCXXABI_LIBDIR_SUFFIX "" CACHE STRING
+ set(LIBCXXABI_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
"Define suffix of library directory name (32/64)")
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
-
- set(LIBCXXABI_BUILT_STANDALONE 1)
+ set(LIBCXXABI_STANDALONE_BUILD 1)
else()
set(LLVM_MAIN_SRC_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Path to LLVM source tree")
set(LLVM_LIT "${CMAKE_SOURCE_DIR}/utils/lit/lit.py")
@@ -109,16 +131,37 @@ endif()
#===============================================================================
# Setup CMake Options
#===============================================================================
+include(HandleCompilerRT)
# Define options.
+option(LIBCXXABI_ENABLE_EXCEPTIONS "Use exceptions." ON)
option(LIBCXXABI_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
option(LIBCXXABI_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
option(LIBCXXABI_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
+option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF)
+option(LIBCXXABI_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
option(LIBCXXABI_ENABLE_THREADS "Build with threads enabled" ON)
-set(LIBCXXABI_GCC_TOOLCHAIN "" CACHE STRING "GCC toolchain for cross compiling.")
-set(LIBCXXABI_SYSROOT "" CACHE STRING "Sysroot for cross compiling.")
-set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE STRING "The path to libc++ library.")
+option(LIBCXXABI_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF)
+option(LIBCXXABI_HAS_EXTERNAL_THREAD_API
+ "Build libc++abi with an externalized threading API.
+ This option may only be set to ON when LIBCXXABI_ENABLE_THREADS=ON." OFF)
+option(LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY
+ "Build libc++abi with an externalized threading library.
+ This option may only be set to ON when LIBCXXABI_ENABLE_THREADS=ON" OFF)
+
+# FIXME: This option should default to off. Unfortunatly GCC 4.9 fails to link
+# programs to due undefined references to new/delete in libc++abi. Once this
+# has been fixed or worked around the default value should be changed.
+option(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS
+ "Build libc++abi with definitions for operator new/delete. Normally libc++
+ provides these definitions" ON)
+option(LIBCXXABI_BUILD_32_BITS "Build 32 bit libc++abi." ${LLVM_BUILD_32_BITS})
+option(LIBCXXABI_INCLUDE_TESTS "Generate build targets for the libc++abi unit tests." ${LLVM_INCLUDE_TESTS})
+set(LIBCXXABI_TARGET_TRIPLE "" CACHE STRING "Target triple for cross compiling.")
+set(LIBCXXABI_GCC_TOOLCHAIN "" CACHE PATH "GCC toolchain for cross compiling.")
+set(LIBCXXABI_SYSROOT "" CACHE PATH "Sysroot for cross compiling.")
+set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE PATH "The path to libc++ library.")
# Default to building a shared library so that the default options still test
# the libc++abi that is being built. There are two problems with testing a
@@ -129,17 +172,36 @@ set(LIBCXXABI_LIBCXX_LIBRARY_PATH "" CACHE STRING "The path to libc++ library.")
option(LIBCXXABI_ENABLE_SHARED "Build libc++abi as a shared library." ON)
option(LIBCXXABI_ENABLE_STATIC "Build libc++abi as a static library." ON)
+option(LIBCXXABI_BAREMETAL "Build libc++abi for baremetal targets." OFF)
+# The default terminate handler attempts to demangle uncaught exceptions, which
+# causes extra I/O and demangling code to be pulled in.
+option(LIBCXXABI_SILENT_TERMINATE "Set this to make the terminate handler default to a silent alternative" OFF)
+
if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC)
message(FATAL_ERROR "libc++abi must be built as either a shared or static library.")
endif()
+if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR)
+ set(LIBCXXABI_LIBCXX_SRC_DIRS ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
+else()
+ set(LIBCXXABI_LIBCXX_SRC_DIRS
+ "${LLVM_MAIN_SRC_DIR}/projects/libcxx"
+ "${LLVM_MAIN_SRC_DIR}/runtimes/libcxx"
+ )
+endif()
+
+set(LIBCXXABI_LIBCXX_INCLUDE_DIRS "")
+foreach(dir ${LIBCXXABI_LIBCXX_SRC_DIRS})
+ list(APPEND LIBCXXABI_LIBCXX_INCLUDE_DIRS "${dir}/include")
+endforeach()
+
find_path(
LIBCXXABI_LIBCXX_INCLUDES
vector
PATHS ${LIBCXXABI_LIBCXX_INCLUDES}
${LIBCXXABI_LIBCXX_PATH}/include
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES}
- ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include
+ ${LIBCXXABI_LIBCXX_INCLUDE_DIRS}
${LLVM_INCLUDE_DIR}/c++/v1
)
@@ -148,10 +210,10 @@ set(LIBCXXABI_LIBCXX_INCLUDES "${LIBCXXABI_LIBCXX_INCLUDES}" CACHE PATH
find_path(
LIBCXXABI_LIBCXX_PATH
- test/libcxx/__init__.py
+ utils/libcxx/test/__init__.py
PATHS ${LIBCXXABI_LIBCXX_PATH}
${LIBCXXABI_LIBCXX_INCLUDES}/../
- ${LLVM_MAIN_SRC_DIR}/projects/libcxx/
+ ${LIBCXXABI_LIBCXX_SRC_DIRS}
NO_DEFAULT_PATH
)
@@ -174,13 +236,33 @@ set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
)
-# Configure compiler.
-include(config-ix)
-
set(LIBCXXABI_COMPILER ${CMAKE_CXX_COMPILER})
set(LIBCXXABI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LIBCXXABI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
+if (LLVM_LIBRARY_OUTPUT_INTDIR)
+ set(LIBCXXABI_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+else()
+ set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_LIBDIR_SUFFIX})
+endif()
+
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXXABI_LIBRARY_DIR})
+
+# By default, for non-standalone builds, libcxx and libcxxabi share a library
+# directory.
+if (NOT LIBCXXABI_LIBCXX_LIBRARY_PATH)
+ set(LIBCXXABI_LIBCXX_LIBRARY_PATH "${LIBCXXABI_LIBRARY_DIR}" CACHE PATH
+ "The path to libc++ library.")
+endif()
+
+# Check that we can build with 32 bits if requested.
+if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32)
+ if (LIBCXXABI_BUILD_32_BITS AND NOT LLVM_BUILD_32_BITS) # Don't duplicate the output from LLVM
+ message(STATUS "Building 32 bits executables and libraries.")
+ endif()
+elseif(LIBCXXABI_BUILD_32_BITS)
+ message(FATAL_ERROR "LIBCXXABI_BUILD_32_BITS=ON is not supported on this platform.")
+endif()
#===============================================================================
# Setup Compiler Flags
@@ -193,11 +275,35 @@ macro(append_if list condition var)
endif()
endmacro()
+macro(add_target_flags_if condition var)
+ if (${condition})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${var}")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${var}")
+ list(APPEND LIBCXXABI_COMPILE_FLAGS ${var})
+ list(APPEND LIBCXXABI_LINK_FLAGS ${var})
+ endif()
+endmacro()
+
set(LIBCXXABI_C_FLAGS "")
set(LIBCXXABI_CXX_FLAGS "")
set(LIBCXXABI_COMPILE_FLAGS "")
set(LIBCXXABI_LINK_FLAGS "")
+# Configure target flags
+add_target_flags_if(LIBCXXABI_BUILD_32_BITS "-m32")
+add_target_flags_if(LIBCXXABI_TARGET_TRIPLE
+ "--target=${LIBCXXABI_TARGET_TRIPLE}")
+add_target_flags_if(LIBCXXABI_GCC_TOOLCHAIN
+ "--gcc-toolchain=${LIBCXXABI_GCC_TOOLCHAIN}")
+add_target_flags_if(LIBCXXABI_SYSROOT
+ "--sysroot=${LIBCXXABI_SYSROOT}")
+
+if (LIBCXXABI_TARGET_TRIPLE)
+ set(TARGET_TRIPLE "${LIBCXXABI_TARGET_TRIPLE}")
+endif()
+
+# Configure compiler. Must happen after setting the target flags.
+include(config-ix)
if (LIBCXXABI_HAS_NOSTDINCXX_FLAG)
list(APPEND LIBCXXABI_COMPILE_FLAGS -nostdinc++)
@@ -206,6 +312,18 @@ if (LIBCXXABI_HAS_NOSTDINCXX_FLAG)
string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
+if (LIBCXXABI_USE_COMPILER_RT)
+ list(APPEND LIBCXXABI_LINK_FLAGS "-rtlib=compiler-rt")
+endif()
+
+# Let the library headers know they are currently being used to build the
+# library.
+add_definitions(-D_LIBCXXABI_BUILDING_LIBRARY)
+
+# Disable DLL annotations on Windows for static builds.
+if (WIN32 AND LIBCXXABI_ENABLE_STATIC AND NOT LIBCXXABI_ENABLE_SHARED)
+ add_definitions(-D_LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT)
+endif()
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WERROR_FLAG -Werror=return-type)
@@ -217,7 +335,7 @@ append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WCONVERSION_FLAG -Wconversion)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WMISMATCHED_TAGS_FLAG -Wmismatched-tags)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WMISSING_BRACES_FLAG -Wmissing-braces)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WNEWLINE_EOF_FLAG -Wnewline-eof)
-append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WNO_UNUSED_FUNCTION_FLAG -Wno-unused-function)
+append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WUNUSED_FUNCTION_FLAG -Wunused-function)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WSHADOW_FLAG -Wshadow)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WSHORTEN_64_TO_32_FLAG -Wshorten-64-to-32)
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_WSIGN_COMPARE_FLAG -Wsign-compare)
@@ -241,13 +359,20 @@ if (LIBCXXABI_ENABLE_PEDANTIC)
endif()
# Get feature flags.
-# Exceptions
-# Catches C++ exceptions only and tells the compiler to assume that extern C
-# functions never throw a C++ exception.
append_if(LIBCXXABI_CXX_FLAGS LIBCXXABI_HAS_FSTRICT_ALIASING_FLAG -fstrict-aliasing)
-append_if(LIBCXXABI_CXX_FLAGS LIBCXXABI_HAS_EHSC_FLAG -EHsc)
-append_if(LIBCXXABI_C_FLAGS LIBCXXABI_HAS_FUNWIND_TABLES -funwind-tables)
+# Exceptions
+if (LIBCXXABI_ENABLE_EXCEPTIONS)
+ # Catches C++ exceptions only and tells the compiler to assume that extern C
+ # functions never throw a C++ exception.
+ append_if(LIBCXXABI_CXX_FLAGS LIBCXXABI_HAS_EHSC_FLAG -EHsc)
+ append_if(LIBCXXABI_C_FLAGS LIBCXXABI_HAS_FUNWIND_TABLES -funwind-tables)
+else()
+ add_definitions(-D_LIBCXXABI_NO_EXCEPTIONS)
+ append_if(LIBCXXABI_CXX_FLAGS LIBCXXABI_HAS_NO_EXCEPTIONS_FLAG -fno-exceptions)
+ append_if(LIBCXXABI_CXX_FLAGS LIBCXXABI_HAS_NO_EHS_FLAG -EHs-)
+ append_if(LIBCXXABI_CXX_FLAGS LIBCXXABI_HAS_NO_EHA_FLAG -EHa-)
+endif()
# Assert
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
@@ -271,26 +396,88 @@ if (NOT LIBCXXABI_ENABLE_SHARED)
list(APPEND LIBCXXABI_COMPILE_FLAGS -D_LIBCPP_BUILD_STATIC)
endif()
+# Threading
if (NOT LIBCXXABI_ENABLE_THREADS)
- add_definitions(-DLIBCXXABI_HAS_NO_THREADS=1)
+ if (LIBCXXABI_HAS_PTHREAD_API)
+ message(FATAL_ERROR "LIBCXXABI_HAS_PTHREAD_API can only"
+ " be set to ON when LIBCXXABI_ENABLE_THREADS"
+ " is also set to ON.")
+ endif()
+ if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
+ message(FATAL_ERROR "LIBCXXABI_HAS_EXTERNAL_THREAD_API can only"
+ " be set to ON when LIBCXXABI_ENABLE_THREADS"
+ " is also set to ON.")
+ endif()
+ if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
+ message(FATAL_ERROR "LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY can only"
+ " be set to ON when LIBCXXABI_ENABLE_THREADS"
+ " is also set to ON.")
+ endif()
+ add_definitions(-D_LIBCXXABI_HAS_NO_THREADS)
+endif()
+
+if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
+ if (LIBCXXABI_HAS_PTHREAD_API)
+ message(FATAL_ERROR "The options LIBCXXABI_HAS_EXTERNAL_THREAD_API"
+ " and LIBCXXABI_HAS_PTHREAD_API cannot be both"
+ " set to ON at the same time.")
+ endif()
+ if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
+ message(FATAL_ERROR "The options LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY"
+ " and LIBCXXABI_HAS_EXTERNAL_THREAD_API cannot be both"
+ " set to ON at the same time.")
+ endif()
+endif()
+
+set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS OFF)
+if ((NOT LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
+ OR (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY AND LIBCXXABI_ENABLE_SHARED)
+ OR MINGW)
+ set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS ON)
+endif()
+
+if (LIBCXXABI_HAS_UNDEFINED_SYMBOLS)
+ # Need to allow unresolved symbols if this is to work with shared library builds
+ if (APPLE)
+ list(APPEND LIBCXXABI_LINK_FLAGS "-undefined dynamic_lookup")
+ else()
+ # Relax this restriction from HandleLLVMOptions
+ string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+ endif()
+endif()
+
+if (LIBCXXABI_HAS_PTHREAD_API)
+ add_definitions(-D_LIBCPP_HAS_THREAD_API_PTHREAD)
+endif()
+
+if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
+ add_definitions(-D_LIBCPP_HAS_THREAD_API_EXTERNAL)
+endif()
+
+if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
+ add_definitions(-D_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL)
endif()
-# This is the _ONLY_ place where add_definitions is called.
+# Prevent libc++abi from having library dependencies on libc++
+add_definitions(-D_LIBCPP_DISABLE_EXTERN_TEMPLATE)
+
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
# Define LIBCXXABI_USE_LLVM_UNWINDER for conditional compilation.
-if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
- add_definitions(-DLIBCXXABI_USE_LLVM_UNWINDER=1)
+if (LIBCXXABI_USE_LLVM_UNWINDER)
+ add_definitions(-DLIBCXXABI_USE_LLVM_UNWINDER)
+endif()
+
+if (LIBCXXABI_SILENT_TERMINATE)
+ add_definitions(-DLIBCXXABI_SILENT_TERMINATE)
+endif()
+
+if (LIBCXXABI_BAREMETAL)
+ add_definitions(-DLIBCXXABI_BAREMETAL)
endif()
-append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_TARGET_TRIPLE
- "-target ${LIBCXXABI_TARGET_TRIPLE}")
-append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_GCC_TOOLCHAIN
- "-gcc-toolchain ${LIBCXXABI_GCC_TOOLCHAIN}")
-append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_SYSROOT
- "--sysroot ${LIBCXXABI_SYSROOT}")
string(REPLACE ";" " " LIBCXXABI_CXX_FLAGS "${LIBCXXABI_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXXABI_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}")
@@ -313,6 +500,7 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
${LIBCXXABI_LIBUNWIND_PATH}/include
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
${LLVM_MAIN_SRC_DIR}/projects/libunwind/include
+ ${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/include
NO_DEFAULT_PATH
)
@@ -322,31 +510,44 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
PATHS ${LIBCXXABI_LIBUNWIND_PATH}/src/
${LIBCXXABI_LIBUNWIND_INCLUDES}/../src/
${LLVM_MAIN_SRC_DIR}/projects/libunwind/src/
+ ${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/src/
NO_DEFAULT_PATH
)
if (LIBCXXABI_LIBUNWIND_SOURCES STREQUAL "LIBCXXABI_LIBUNWIND_SOURCES-NOTFOUND")
- message(WARNING "LIBCXXABI_LIBCXX_PATH was not specified and couldn't be infered.")
+ message(WARNING "LIBCXXABI_LIBUNWIND_SOURCES was not specified and couldn't be infered.")
set(LIBCXXABI_LIBUNWIND_SOURCES "")
endif()
- include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
- include_directories("${LIBCXXABI_LIBUNWIND_SOURCES}")
-endif ()
+ if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
+ set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
+ endif()
+
+ if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "")
+ include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
+ endif()
+
+ if (NOT LIBCXXABI_LIBUNWIND_SOURCES STREQUAL "")
+ include_directories("${LIBCXXABI_LIBUNWIND_SOURCES}")
+ endif()
+endif()
# Add source code. This also contains all of the logic for deciding linker flags
# soname, etc...
add_subdirectory(src)
-if(NOT LIBCXXABI_ENABLE_SHARED)
- # TODO: Fix the libc++ cmake files so that libc++abi can be statically linked.
- # As it is now, libc++ will prefer linking against a dynamic libc++abi in the
- # system library paths over a static libc++abi in the out directory. This
- # would test the system library rather than the one we just built, which isn't
- # very helpful.
- message(WARNING "The libc++abi tests are currently only valid when "
- "LIBCXXABI_ENABLE_SHARED is on, no check target will be "
+if (NOT LIBCXXABI_INCLUDE_TESTS OR (LIBCXXABI_STANDALONE_BUILD AND NOT LIBCXXABI_ENABLE_SHARED))
+ # We can't reasonably test the system C++ library with a static libc++abi.
+ # We either need to be able to replace libc++abi at run time (with a shared
+ # libc++abi), or we need to be able to replace the C++ runtime (with a non-
+ # standalone build).
+ message(WARNING "The libc++abi tests aren't valid when libc++abi is built "
+ "standalone (i.e. outside of llvm/projects/libcxxabi ) and "
+ "is built without a shared library. Either build a shared "
+ "library, build libc++abi at the same time as you build "
+ "libc++, or do without testing. No check target will be "
"available!")
else()
add_subdirectory(test)
+ add_subdirectory(fuzz)
endif()
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/LICENSE.TXT b/chromium/buildtools/third_party/libc++abi/trunk/LICENSE.TXT
index 7381b74c4df..f333f1fe48d 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/LICENSE.TXT
+++ b/chromium/buildtools/third_party/libc++abi/trunk/LICENSE.TXT
@@ -14,7 +14,7 @@ Full text of the relevant licenses is included below.
University of Illinois/NCSA
Open Source License
-Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
+Copyright (c) 2009-2017 by the contributors listed in CREDITS.TXT
All rights reserved.
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/cmake/Modules/HandleCompilerRT.cmake b/chromium/buildtools/third_party/libc++abi/trunk/cmake/Modules/HandleCompilerRT.cmake
new file mode 100644
index 00000000000..395c21ace66
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/cmake/Modules/HandleCompilerRT.cmake
@@ -0,0 +1,58 @@
+function(find_compiler_rt_library name dest)
+ if (NOT DEFINED LIBCXXABI_COMPILE_FLAGS)
+ message(FATAL_ERROR "LIBCXXABI_COMPILE_FLAGS must be defined when using this function")
+ endif()
+ set(dest "" PARENT_SCOPE)
+ set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXXABI_COMPILE_FLAGS}
+ "--rtlib=compiler-rt" "--print-libgcc-file-name")
+ if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET)
+ list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}")
+ endif()
+ execute_process(
+ COMMAND ${CLANG_COMMAND}
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE LIBRARY_FILE
+ )
+ string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE)
+ string(REPLACE "builtins" "${name}" LIBRARY_FILE "${LIBRARY_FILE}")
+ if (NOT HAD_ERROR AND EXISTS "${LIBRARY_FILE}")
+ message(STATUS "Found compiler-rt library: ${LIBRARY_FILE}")
+ set(${dest} "${LIBRARY_FILE}" PARENT_SCOPE)
+ else()
+ message(STATUS "Failed to find compiler-rt library")
+ endif()
+endfunction()
+
+function(find_compiler_rt_dir dest)
+ if (NOT DEFINED LIBCXXABI_COMPILE_FLAGS)
+ message(FATAL_ERROR "LIBCXXABI_COMPILE_FLAGS must be defined when using this function")
+ endif()
+ set(dest "" PARENT_SCOPE)
+ if (APPLE)
+ set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXXABI_COMPILE_FLAGS}
+ "-print-file-name=lib")
+ execute_process(
+ COMMAND ${CLANG_COMMAND}
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE LIBRARY_DIR
+ )
+ string(STRIP "${LIBRARY_DIR}" LIBRARY_DIR)
+ set(LIBRARY_DIR "${LIBRARY_DIR}/darwin")
+ else()
+ set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXXABI_COMPILE_FLAGS}
+ "--rtlib=compiler-rt" "--print-libgcc-file-name")
+ execute_process(
+ COMMAND ${CLANG_COMMAND}
+ RESULT_VARIABLE HAD_ERROR
+ OUTPUT_VARIABLE LIBRARY_FILE
+ )
+ string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE)
+ get_filename_component(LIBRARY_DIR "${LIBRARY_FILE}" DIRECTORY)
+ endif()
+ if (NOT HAD_ERROR AND EXISTS "${LIBRARY_DIR}")
+ message(STATUS "Found compiler-rt directory: ${LIBRARY_DIR}")
+ set(${dest} "${LIBRARY_DIR}" PARENT_SCOPE)
+ else()
+ message(STATUS "Failed to find compiler-rt directory")
+ endif()
+endfunction()
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/cmake/config-ix.cmake b/chromium/buildtools/third_party/libc++abi/trunk/cmake/config-ix.cmake
index 1d40b2a9e67..5541ed41a0f 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/cmake/config-ix.cmake
+++ b/chromium/buildtools/third_party/libc++abi/trunk/cmake/config-ix.cmake
@@ -2,17 +2,62 @@ include(CheckLibraryExists)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
+check_library_exists(c fopen "" LIBCXXABI_HAS_C_LIB)
+if (NOT LIBCXXABI_USE_COMPILER_RT)
+ check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXXABI_HAS_GCC_S_LIB)
+endif ()
+
+# libc++abi is built with -nodefaultlibs, so we want all our checks to also
+# use this option, otherwise we may end up with an inconsistency between
+# the flags we think we require during configuration (if the checks are
+# performed without -nodefaultlibs) and the flags that are actually
+# required during compilation (which has the -nodefaultlibs). libc is
+# required for the link to go through. We remove sanitizers from the
+# configuration checks to avoid spurious link errors.
+check_c_compiler_flag(-nodefaultlibs LIBCXXABI_HAS_NODEFAULTLIBS_FLAG)
+if (LIBCXXABI_HAS_NODEFAULTLIBS_FLAG)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
+ if (LIBCXXABI_HAS_C_LIB)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES c)
+ endif ()
+ if (LIBCXXABI_USE_COMPILER_RT)
+ list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt)
+ find_compiler_rt_library(builtins LIBCXXABI_BUILTINS_LIBRARY)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBCXXABI_BUILTINS_LIBRARY}")
+ elseif (LIBCXXABI_HAS_GCC_S_LIB)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
+ endif ()
+ if (MINGW)
+ # Mingw64 requires quite a few "C" runtime libraries in order for basic
+ # programs to link successfully with -nodefaultlibs.
+ if (LIBCXXABI_USE_COMPILER_RT)
+ set(MINGW_RUNTIME ${LIBCXXABI_BUILTINS_LIBRARY})
+ else ()
+ set(MINGW_RUNTIME gcc_s gcc)
+ endif()
+ set(MINGW_LIBRARIES mingw32 ${MINGW_RUNTIME} moldname mingwex msvcrt advapi32
+ shell32 user32 kernel32 iconv mingw32 ${MINGW_RUNTIME}
+ moldname mingwex msvcrt)
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
+ endif()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
+ endif ()
+ if (CMAKE_C_FLAGS MATCHES -fsanitize-coverage OR CMAKE_CXX_FLAGS MATCHES -fsanitize-coverage)
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize-coverage=edge,trace-cmp,indirect-calls,8bit-counters")
+ endif ()
+endif ()
+
# Check compiler flags
check_c_compiler_flag(-funwind-tables LIBCXXABI_HAS_FUNWIND_TABLES)
check_cxx_compiler_flag(-fPIC LIBCXXABI_HAS_FPIC_FLAG)
check_cxx_compiler_flag(-fno-exceptions LIBCXXABI_HAS_NO_EXCEPTIONS_FLAG)
check_cxx_compiler_flag(-fno-rtti LIBCXXABI_HAS_NO_RTTI_FLAG)
check_cxx_compiler_flag(-fstrict-aliasing LIBCXXABI_HAS_FSTRICT_ALIASING_FLAG)
-check_cxx_compiler_flag(-nodefaultlibs LIBCXXABI_HAS_NODEFAULTLIBS_FLAG)
check_cxx_compiler_flag(-nostdinc++ LIBCXXABI_HAS_NOSTDINCXX_FLAG)
check_cxx_compiler_flag(-Wall LIBCXXABI_HAS_WALL_FLAG)
check_cxx_compiler_flag(-W LIBCXXABI_HAS_W_FLAG)
-check_cxx_compiler_flag(-Wno-unused-function LIBCXXABI_HAS_WNO_UNUSED_FUNCTION_FLAG)
+check_cxx_compiler_flag(-Wunused-function LIBCXXABI_HAS_WUNUSED_FUNCTION_FLAG)
check_cxx_compiler_flag(-Wunused-variable LIBCXXABI_HAS_WUNUSED_VARIABLE_FLAG)
check_cxx_compiler_flag(-Wunused-parameter LIBCXXABI_HAS_WUNUSED_PARAMETER_FLAG)
check_cxx_compiler_flag(-Wstrict-aliasing LIBCXXABI_HAS_WSTRICT_ALIASING_FLAG)
@@ -37,11 +82,14 @@ check_cxx_compiler_flag(/EHsc LIBCXXABI_HAS_EHSC_FLAG)
check_cxx_compiler_flag(/EHs- LIBCXXABI_HAS_NO_EHS_FLAG)
check_cxx_compiler_flag(/EHa- LIBCXXABI_HAS_NO_EHA_FLAG)
check_cxx_compiler_flag(/GR- LIBCXXABI_HAS_NO_GR_FLAG)
+check_cxx_compiler_flag(-std=c++11 LIBCXXABI_HAS_STD_CXX11)
+
+if(LIBCXXABI_HAS_STD_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+endif()
# Check libraries
-check_library_exists(c fopen "" LIBCXXABI_HAS_C_LIB)
check_library_exists(dl dladdr "" LIBCXXABI_HAS_DL_LIB)
check_library_exists(pthread pthread_once "" LIBCXXABI_HAS_PTHREAD_LIB)
-check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXXABI_HAS_GCC_S_LIB)
check_library_exists(c __cxa_thread_atexit_impl ""
LIBCXXABI_HAS_CXA_THREAD_ATEXIT_IMPL)
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/fuzz/CMakeLists.txt b/chromium/buildtools/third_party/libc++abi/trunk/fuzz/CMakeLists.txt
new file mode 100644
index 00000000000..017427e4631
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/fuzz/CMakeLists.txt
@@ -0,0 +1,11 @@
+# See http://llvm.org/docs/LibFuzzer.html
+if( LLVM_USE_SANITIZE_COVERAGE )
+ add_executable(cxa_demangle_fuzzer
+ cxa_demangle_fuzzer.cpp
+ ../src/cxa_demangle.cpp
+ )
+
+ target_link_libraries(cxa_demangle_fuzzer
+ LLVMFuzzer
+ )
+endif()
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/fuzz/cxa_demangle_fuzzer.cpp b/chromium/buildtools/third_party/libc++abi/trunk/fuzz/cxa_demangle_fuzzer.cpp
new file mode 100644
index 00000000000..cc9b193670d
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/fuzz/cxa_demangle_fuzzer.cpp
@@ -0,0 +1,15 @@
+#include <stdint.h>
+#include <stddef.h>
+#include <string.h>
+#include <stdlib.h>
+extern "C" char *
+__cxa_demangle(const char *mangled_name, char *buf, size_t *n, int *status);
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ char *str = new char[size+1];
+ memcpy(str, data, size);
+ str[size] = 0;
+ free(__cxa_demangle(str, 0, 0, 0));
+ delete [] str;
+ return 0;
+}
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h b/chromium/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h
index 68e325ffef6..65b1961e68a 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h
+++ b/chromium/buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h
@@ -12,33 +12,52 @@
#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
!defined(__ARM_DWARF_EH__)
-#define LIBCXXABI_ARM_EHABI 1
-#else
-#define LIBCXXABI_ARM_EHABI 0
+#define _LIBCXXABI_ARM_EHABI
#endif
#if !defined(__has_attribute)
#define __has_attribute(_attribute_) 0
#endif
-#if defined(_LIBCXXABI_DLL)
- #if defined(cxxabi_EXPORTS)
+#if defined(_WIN32)
+ #if defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
+ #define _LIBCXXABI_HIDDEN
+ #define _LIBCXXABI_DATA_VIS
+ #define _LIBCXXABI_FUNC_VIS
+ #define _LIBCXXABI_TYPE_VIS
+ #elif defined(_LIBCXXABI_BUILDING_LIBRARY)
#define _LIBCXXABI_HIDDEN
+ #define _LIBCXXABI_DATA_VIS __declspec(dllexport)
#define _LIBCXXABI_FUNC_VIS __declspec(dllexport)
#define _LIBCXXABI_TYPE_VIS __declspec(dllexport)
#else
#define _LIBCXXABI_HIDDEN
+ #define _LIBCXXABI_DATA_VIS __declspec(dllimport)
#define _LIBCXXABI_FUNC_VIS __declspec(dllimport)
#define _LIBCXXABI_TYPE_VIS __declspec(dllimport)
#endif
#else
- #define _LIBCXXABI_HIDDEN __attribute__((__visibility__("hidden")))
- #define _LIBCXXABI_FUNC_VIS __attribute__((__visibility__("default")))
- #if __has_attribute(__type_visibility__)
- #define _LIBCXXABI_TYPE_VIS __attribute__((__type_visibility__("default")))
+ #if !defined(_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS)
+ #define _LIBCXXABI_HIDDEN __attribute__((__visibility__("hidden")))
+ #define _LIBCXXABI_DATA_VIS __attribute__((__visibility__("default")))
+ #define _LIBCXXABI_FUNC_VIS __attribute__((__visibility__("default")))
+ #if __has_attribute(__type_visibility__)
+ #define _LIBCXXABI_TYPE_VIS __attribute__((__type_visibility__("default")))
+ #else
+ #define _LIBCXXABI_TYPE_VIS __attribute__((__visibility__("default")))
+ #endif
#else
- #define _LIBCXXABI_TYPE_VIS __attribute__((__visibility__("default")))
+ #define _LIBCXXABI_HIDDEN
+ #define _LIBCXXABI_DATA_VIS
+ #define _LIBCXXABI_FUNC_VIS
+ #define _LIBCXXABI_TYPE_VIS
#endif
#endif
+#if defined(_WIN32)
+#define _LIBCXXABI_WEAK
+#else
+#define _LIBCXXABI_WEAK __attribute__((__weak__))
+#endif
+
#endif // ____CXXABI_CONFIG_H
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/include/cxxabi.h b/chromium/buildtools/third_party/libc++abi/trunk/include/cxxabi.h
index e4a6797a815..2596560d6e9 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/include/cxxabi.h
+++ b/chromium/buildtools/third_party/libc++abi/trunk/include/cxxabi.h
@@ -21,7 +21,7 @@
#include <__cxxabi_config.h>
#define _LIBCPPABI_VERSION 1002
-#define LIBCXXABI_NORETURN __attribute__((noreturn))
+#define _LIBCXXABI_NORETURN __attribute__((noreturn))
#ifdef __cplusplus
@@ -45,7 +45,7 @@ extern _LIBCXXABI_FUNC_VIS void
__cxa_free_exception(void *thrown_exception) throw();
// 2.4.3 Throwing the Exception Object
-extern _LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void
+extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void
__cxa_throw(void *thrown_exception, std::type_info *tinfo,
void (*dest)(void *));
@@ -55,7 +55,7 @@ __cxa_get_exception_ptr(void *exceptionObject) throw();
extern _LIBCXXABI_FUNC_VIS void *
__cxa_begin_catch(void *exceptionObject) throw();
extern _LIBCXXABI_FUNC_VIS void __cxa_end_catch();
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
extern _LIBCXXABI_FUNC_VIS bool
__cxa_begin_cleanup(void *exceptionObject) throw();
extern _LIBCXXABI_FUNC_VIS void __cxa_end_cleanup();
@@ -63,19 +63,19 @@ extern _LIBCXXABI_FUNC_VIS void __cxa_end_cleanup();
extern _LIBCXXABI_FUNC_VIS std::type_info *__cxa_current_exception_type();
// 2.5.4 Rethrowing Exceptions
-extern _LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_rethrow();
+extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_rethrow();
// 2.6 Auxiliary Runtime APIs
-extern _LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_bad_cast(void);
-extern _LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_bad_typeid(void);
-extern _LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void
+extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void);
+extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void);
+extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void
__cxa_throw_bad_array_new_length(void);
// 3.2.6 Pure Virtual Function API
-extern _LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_pure_virtual(void);
+extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_pure_virtual(void);
// 3.2.7 Deleted Virtual Function API
-extern _LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);
+extern _LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_deleted_virtual(void);
// 3.3.2 One-time Construction API
#ifdef __arm__
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt b/chromium/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt
index 502e08367d1..d844b7fb718 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/CMakeLists.txt
@@ -1,25 +1,37 @@
# Get sources
set(LIBCXXABI_SOURCES
- abort_message.cpp
+ # C++ABI files
cxa_aux_runtime.cpp
cxa_default_handlers.cpp
cxa_demangle.cpp
- cxa_exception.cpp
cxa_exception_storage.cpp
cxa_guard.cpp
cxa_handlers.cpp
- cxa_new_delete.cpp
- cxa_personality.cpp
cxa_unexpected.cpp
cxa_vector.cpp
cxa_virtual.cpp
- exception.cpp
+ # C++ STL files
+ stdlib_exception.cpp
+ stdlib_stdexcept.cpp
+ stdlib_typeinfo.cpp
+ # Internal files
+ abort_message.cpp
+ fallback_malloc.cpp
private_typeinfo.cpp
- stdexcept.cpp
- typeinfo.cpp
)
-if (UNIX AND NOT (APPLE OR CYGWIN))
+if (LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
+ list(APPEND LIBCXXABI_SOURCES stdlib_new_delete.cpp)
+endif()
+
+if (LIBCXXABI_ENABLE_EXCEPTIONS)
+ list(APPEND LIBCXXABI_SOURCES cxa_exception.cpp)
+ list(APPEND LIBCXXABI_SOURCES cxa_personality.cpp)
+else()
+ list(APPEND LIBCXXABI_SOURCES cxa_noexception.cpp)
+endif()
+
+if (LIBCXXABI_ENABLE_THREADS AND UNIX AND NOT (APPLE OR CYGWIN))
list(APPEND LIBCXXABI_SOURCES cxa_thread_atexit.cpp)
endif()
@@ -48,12 +60,24 @@ if (LIBCXXABI_ENABLE_THREADS)
endif()
append_if(libraries LIBCXXABI_HAS_C_LIB c)
-
if (LIBCXXABI_USE_LLVM_UNWINDER)
- list(APPEND libraries unwind)
+ # Prefer using the in-tree version of libunwind, either shared or static. If
+ # none are found fall back to using -lunwind.
+ # FIXME: Is it correct to prefer the static version of libunwind?
+ if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
+ list(APPEND libraries unwind_shared)
+ elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
+ list(APPEND libraries unwind_static)
+ else()
+ list(APPEND libraries unwind)
+ endif()
else()
append_if(libraries LIBCXXABI_HAS_GCC_S_LIB gcc_s)
endif()
+if (MINGW)
+ # MINGW_LIBRARIES is defined in config-ix.cmake
+ list(APPEND libraries ${MINGW_LIBRARIES})
+endif()
# Setup flags.
append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_FPIC_FLAG -fPIC)
@@ -81,6 +105,12 @@ string(REPLACE ";" " " LIBCXXABI_COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}")
string(REPLACE ";" " " LIBCXXABI_LINK_FLAGS "${LIBCXXABI_LINK_FLAGS}")
string(REPLACE ";" " " LIBCXXABI_SHARED_LINK_FLAGS "${LIBCXXABI_SHARED_LINK_FLAGS}")
+# FIXME: libc++abi.so will not link when modules are enabled because it depends
+# on symbols defined in libc++.so which has not yet been built.
+if (LLVM_ENABLE_MODULES)
+ string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+endif()
+
# Add a object library that contains the compiled source files.
add_library(cxxabi_objects OBJECT ${LIBCXXABI_SOURCES} ${LIBCXXABI_HEADERS})
@@ -121,14 +151,17 @@ endif()
add_custom_target(cxxabi DEPENDS ${LIBCXXABI_TARGETS})
install(TARGETS ${LIBCXXABI_TARGETS}
- LIBRARY DESTINATION lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT libcxxabi
- ARCHIVE DESTINATION lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT libcxxabi
+ LIBRARY DESTINATION lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
+ ARCHIVE DESTINATION lib${LIBCXXABI_LIBDIR_SUFFIX} COMPONENT cxxabi
)
if (NOT CMAKE_CONFIGURATION_TYPES)
- add_custom_target(install-libcxxabi
+ add_custom_target(install-cxxabi
DEPENDS cxxabi
COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=libcxxabi
+ -DCMAKE_INSTALL_COMPONENT=cxxabi
-P "${LIBCXXABI_BINARY_DIR}/cmake_install.cmake")
+
+ # TODO: This is a legacy target name and should be removed at some point.
+ add_custom_target(install-libcxxabi DEPENDS install-cxxabi)
endif()
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.cpp
index 5e25c0f3472..7a2a9f835bd 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.cpp
@@ -22,8 +22,6 @@ extern "C" void android_set_abort_message(const char* msg);
#endif // __ANDROID_API__ >= 21
#endif // __BIONIC__
-#pragma GCC visibility push(hidden)
-
#ifdef __APPLE__
# if defined(__has_include) && __has_include(<CrashReporterClient.h>)
# define HAVE_CRASHREPORTERCLIENT_H
@@ -31,10 +29,10 @@ extern "C" void android_set_abort_message(const char* msg);
# endif
#endif
-__attribute__((visibility("hidden"), noreturn))
void abort_message(const char* format, ...)
{
// write message to stderr
+#if !defined(NDEBUG) || !defined(LIBCXXABI_BAREMETAL)
#ifdef __APPLE__
fprintf(stderr, "libc++abi.dylib: ");
#endif
@@ -43,6 +41,7 @@ void abort_message(const char* format, ...)
vfprintf(stderr, format, list);
va_end(list);
fprintf(stderr, "\n");
+#endif
#if defined(__APPLE__) && defined(HAVE_CRASHREPORTERCLIENT_H)
// record message in crash report
@@ -77,5 +76,3 @@ void abort_message(const char* format, ...)
abort();
}
-
-#pragma GCC visibility pop
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.h b/chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.h
index 2c5cb204664..e8f9571cb56 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.h
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/abort_message.h
@@ -10,24 +10,18 @@
#ifndef __ABORT_MESSAGE_H_
#define __ABORT_MESSAGE_H_
-#include <stdio.h>
-
-#pragma GCC visibility push(hidden)
+#include "cxxabi.h"
#ifdef __cplusplus
extern "C" {
#endif
-__attribute__((visibility("hidden"), noreturn))
- void abort_message(const char* format, ...)
- __attribute__((format(printf, 1, 2)));
-
+_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN void
+abort_message(const char *format, ...) __attribute__((format(printf, 1, 2)));
#ifdef __cplusplus
}
#endif
-#pragma GCC visibility pop
-
#endif
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/config.h b/chromium/buildtools/third_party/libc++abi/trunk/src/config.h
deleted file mode 100644
index ac6d297d113..00000000000
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/config.h
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------- config.h -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//
-// Defines macros used within the libc++abi project.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef LIBCXXABI_CONFIG_H
-#define LIBCXXABI_CONFIG_H
-
-#include <unistd.h>
-
-// Set this in the CXXFLAGS when you need it
-#if !defined(LIBCXXABI_HAS_NO_THREADS)
-# define LIBCXXABI_HAS_NO_THREADS 0
-#endif
-
-// Set this in the CXXFLAGS when you need it, because otherwise we'd have to
-// #if !defined(__linux__) && !defined(__APPLE__) && ...
-// and so-on for *every* platform.
-#ifndef LIBCXXABI_BAREMETAL
-# define LIBCXXABI_BAREMETAL 0
-#endif
-
-#endif // LIBCXXABI_CONFIG_H
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_aux_runtime.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_aux_runtime.cpp
index a455fad6219..878d3bd034d 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_aux_runtime.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_aux_runtime.cpp
@@ -16,17 +16,29 @@
namespace __cxxabiv1 {
extern "C" {
-_LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_bad_cast(void) {
+_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_cast(void) {
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
throw std::bad_cast();
+#else
+ std::terminate();
+#endif
}
-_LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_bad_typeid(void) {
+_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void __cxa_bad_typeid(void) {
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
throw std::bad_typeid();
+#else
+ std::terminate();
+#endif
}
-_LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void
+_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN void
__cxa_throw_bad_array_new_length(void) {
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
throw std::bad_array_new_length();
+#else
+ std::terminate();
+#endif
}
} // extern "C"
} // abi
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_default_handlers.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_default_handlers.cpp
index d34341aa328..f2e36b4bc83 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_default_handlers.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_default_handlers.cpp
@@ -12,8 +12,8 @@
#include <stdexcept>
#include <new>
#include <exception>
+#include <cstdlib>
#include "abort_message.h"
-#include "config.h" // For __sync_swap
#include "cxxabi.h"
#include "cxa_handlers.hpp"
#include "cxa_exception.hpp"
@@ -22,7 +22,7 @@
static const char* cause = "uncaught";
__attribute__((noreturn))
-static void default_terminate_handler()
+static void demangling_terminate_handler()
{
// If there might be an uncaught exception
using namespace __cxxabiv1;
@@ -78,17 +78,27 @@ static void default_terminate_handler()
}
__attribute__((noreturn))
-static void default_unexpected_handler()
+static void demangling_unexpected_handler()
{
cause = "unexpected";
std::terminate();
}
+#if !defined(LIBCXXABI_SILENT_TERMINATE)
+static std::terminate_handler default_terminate_handler = demangling_terminate_handler;
+static std::terminate_handler default_unexpected_handler = demangling_unexpected_handler;
+#else
+static std::terminate_handler default_terminate_handler = std::abort;
+static std::terminate_handler default_unexpected_handler = std::terminate;
+#endif
//
// Global variables that hold the pointers to the current handler
//
-std::terminate_handler __cxa_terminate_handler = default_terminate_handler;
+_LIBCXXABI_DATA_VIS
+std::terminate_handler __cxa_terminate_handler = default_terminate_handler;
+
+_LIBCXXABI_DATA_VIS
std::unexpected_handler __cxa_unexpected_handler = default_unexpected_handler;
// In the future these will become:
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_demangle.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_demangle.cpp
index 04dc7110dd0..d8734fbbf9d 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_demangle.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_demangle.cpp
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#define _LIBCPP_EXTERN_TEMPLATE(...)
#define _LIBCPP_NO_EXCEPTIONS
#include "__cxxabi_config.h"
@@ -165,9 +164,10 @@ constexpr const char* float_data<double>::spec;
template <>
struct float_data<long double>
{
-#if defined(__mips__) && defined(__mips_n64) || defined(__aarch64__)
+#if defined(__mips__) && defined(__mips_n64) || defined(__aarch64__) || \
+ defined(__wasm__)
static const size_t mangled_size = 32;
-#elif defined(__arm__) || defined(__mips__)
+#elif defined(__arm__) || defined(__mips__) || defined(__hexagon__)
static const size_t mangled_size = 16;
#else
static const size_t mangled_size = 20; // May need to be adjusted to 16 or 24 on other platforms
@@ -623,6 +623,8 @@ parse_const_cast_expr(const char* first, const char* last, C& db)
return first;
auto expr = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back() = "const_cast<" + db.names.back().move_full() + ">(" + expr + ")";
first = t1;
}
@@ -649,6 +651,8 @@ parse_dynamic_cast_expr(const char* first, const char* last, C& db)
return first;
auto expr = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back() = "dynamic_cast<" + db.names.back().move_full() + ">(" + expr + ")";
first = t1;
}
@@ -675,6 +679,8 @@ parse_reinterpret_cast_expr(const char* first, const char* last, C& db)
return first;
auto expr = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back() = "reinterpret_cast<" + db.names.back().move_full() + ">(" + expr + ")";
first = t1;
}
@@ -1293,6 +1299,8 @@ parse_dot_expr(const char* first, const char* last, C& db)
return first;
auto name = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back().first += "." + name;
first = t1;
}
@@ -1602,7 +1610,8 @@ parse_function_type(const char* first, const char* last, C& db)
{
if (t == last)
{
- db.names.pop_back();
+ if (!db.names.empty())
+ db.names.pop_back();
return first;
}
if (*t == 'E')
@@ -1918,10 +1927,11 @@ parse_type(const char* first, const char* last, C& db)
if (is_function)
{
size_t p = db.names[k].second.size();
- if (db.names[k].second[p-2] == '&')
- p -= 3;
- else if (db.names[k].second.back() == '&')
+ if (db.names[k].second[p - 2] == '&' &&
+ db.names[k].second[p - 1] == '&')
p -= 2;
+ else if (db.names[k].second.back() == '&')
+ p -= 1;
if (cv & 1)
{
db.names[k].second.insert(p, " const");
@@ -2895,6 +2905,8 @@ base_name(String& s)
++c;
}
}
+ if (pe - pf <= 1)
+ return String();
const char* p0 = pe - 1;
for (; p0 != pf; --p0)
{
@@ -3003,6 +3015,7 @@ parse_unnamed_type_name(const char* first, const char* last, C& db)
break;
case 'l':
{
+ size_t lambda_pos = db.names.size();
db.names.push_back(typename C::String("'lambda'("));
const char* t0 = first+2;
if (first[2] == 'v')
@@ -3012,45 +3025,54 @@ parse_unnamed_type_name(const char* first, const char* last, C& db)
}
else
{
- const char* t1 = parse_type(t0, last, db);
- if (t1 == t0)
- {
- db.names.pop_back();
- return first;
- }
- if (db.names.size() < 2)
- return first;
- auto tmp = db.names.back().move_full();
- db.names.pop_back();
- db.names.back().first.append(tmp);
- t0 = t1;
+ bool is_first_it = true;
while (true)
{
- t1 = parse_type(t0, last, db);
+ long k0 = static_cast<long>(db.names.size());
+ const char* t1 = parse_type(t0, last, db);
+ long k1 = static_cast<long>(db.names.size());
if (t1 == t0)
break;
- if (db.names.size() < 2)
+ if (k0 >= k1)
return first;
- tmp = db.names.back().move_full();
- db.names.pop_back();
- if (!tmp.empty())
- {
- db.names.back().first.append(", ");
- db.names.back().first.append(tmp);
- }
+ // If the call to parse_type above found a pack expansion
+ // substitution, then multiple names could have been
+ // inserted into the name table. Walk through the names,
+ // appending each onto the lambda's parameter list.
+ std::for_each(db.names.begin() + k0, db.names.begin() + k1,
+ [&](typename C::sub_type::value_type &pair) {
+ if (pair.empty())
+ return;
+ auto &lambda = db.names[lambda_pos].first;
+ if (!is_first_it)
+ lambda.append(", ");
+ is_first_it = false;
+ lambda.append(pair.move_full());
+ });
+ db.names.erase(db.names.begin() + k0, db.names.end());
t0 = t1;
}
+ if (is_first_it)
+ {
+ if (!db.names.empty())
+ db.names.pop_back();
+ return first;
+ }
+ if (db.names.empty() || db.names.size() - 1 != lambda_pos)
+ return first;
db.names.back().first.append(")");
}
if (t0 == last || *t0 != 'E')
{
+ if (!db.names.empty())
db.names.pop_back();
- return first;
+ return first;
}
++t0;
if (t0 == last)
{
- db.names.pop_back();
+ if(!db.names.empty())
+ db.names.pop_back();
return first;
}
if (std::isdigit(*t0))
@@ -3063,7 +3085,8 @@ parse_unnamed_type_name(const char* first, const char* last, C& db)
}
if (t0 == last || *t0 != '_')
{
- db.names.pop_back();
+ if(!db.names.empty())
+ db.names.pop_back();
return first;
}
first = t0 + 1;
@@ -3250,7 +3273,7 @@ parse_binary_expression(const char* first, const char* last, const typename C::S
nm += ')';
first = t2;
}
- else
+ else if(!db.names.empty())
db.names.pop_back();
}
return first;
@@ -3489,7 +3512,7 @@ parse_expression(const char* first, const char* last, C& db)
db.names.back() = "(" + op1 + ")[" + op2 + "]";
first = t2;
}
- else
+ else if (!db.names.empty())
db.names.pop_back();
}
}
@@ -3685,11 +3708,13 @@ parse_expression(const char* first, const char* last, C& db)
}
else
{
+ if (db.names.size() < 2)
+ return first;
db.names.pop_back();
db.names.pop_back();
}
}
- else
+ else if (!db.names.empty())
db.names.pop_back();
}
}
@@ -3878,8 +3903,9 @@ parse_template_args(const char* first, const char* last, C& db)
args += ", ";
args += db.names[k].move_full();
}
- for (; k1 != k0; --k1)
- db.names.pop_back();
+ for (; k1 > k0; --k1)
+ if (!db.names.empty())
+ db.names.pop_back();
t = t1;
}
first = t + 1;
@@ -3958,6 +3984,8 @@ parse_nested_name(const char* first, const char* last, C& db,
{
auto name = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
if (!db.names.back().first.empty())
{
db.names.back().first += "::" + name;
@@ -3977,6 +4005,8 @@ parse_nested_name(const char* first, const char* last, C& db,
{
auto name = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
if (!db.names.back().first.empty())
db.names.back().first += "::" + name;
else
@@ -3996,6 +4026,8 @@ parse_nested_name(const char* first, const char* last, C& db,
{
auto name = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
if (!db.names.back().first.empty())
db.names.back().first += "::" + name;
else
@@ -4013,6 +4045,8 @@ parse_nested_name(const char* first, const char* last, C& db,
{
auto name = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back().first += name;
db.subs.push_back(typename C::sub_type(1, db.names.back(), db.names.get_allocator()));
t0 = t1;
@@ -4032,6 +4066,8 @@ parse_nested_name(const char* first, const char* last, C& db,
{
auto name = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
if (!db.names.back().first.empty())
db.names.back().first += "::" + name;
else
@@ -4129,11 +4165,13 @@ parse_local_name(const char* first, const char* last, C& db,
return first;
auto name = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back().first.append("::");
db.names.back().first.append(name);
first = t1;
}
- else
+ else if (!db.names.empty())
db.names.pop_back();
}
}
@@ -4150,10 +4188,12 @@ parse_local_name(const char* first, const char* last, C& db,
return first;
auto name = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back().first.append("::");
db.names.back().first.append(name);
}
- else
+ else if (!db.names.empty())
db.names.pop_back();
}
break;
@@ -4218,6 +4258,8 @@ parse_name(const char* first, const char* last, C& db,
return first;
auto tmp = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back().first += tmp;
first = t1;
if (ends_with_template_args)
@@ -4240,6 +4282,8 @@ parse_name(const char* first, const char* last, C& db,
return first;
auto tmp = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back().first += tmp;
first = t1;
if (ends_with_template_args)
@@ -4305,6 +4349,8 @@ parse_call_offset(const char* first, const char* last)
// # base is the nominal target function of thunk
// ::= GV <object name> # Guard variable for one-time initialization
// # No <type>
+// ::= TW <object name> # Thread-local wrapper
+// ::= TH <object name> # Thread-local initialization
// extension ::= TC <first type> <number> _ <second type> # construction vtable for second-in-first
// extension ::= GR <object name> # reference temporary for object
@@ -4398,6 +4444,8 @@ parse_special_name(const char* first, const char* last, C& db)
return first;
auto left = db.names.back().move_full();
db.names.pop_back();
+ if (db.names.empty())
+ return first;
db.names.back().first = "construction vtable for " +
std::move(left) + "-in-" +
db.names.back().move_full();
@@ -4406,6 +4454,28 @@ parse_special_name(const char* first, const char* last, C& db)
}
}
break;
+ case 'W':
+ // TW <object name> # Thread-local wrapper
+ t = parse_name(first + 2, last, db);
+ if (t != first + 2)
+ {
+ if (db.names.empty())
+ return first;
+ db.names.back().first.insert(0, "thread-local wrapper routine for ");
+ first = t;
+ }
+ break;
+ case 'H':
+ //TH <object name> # Thread-local initialization
+ t = parse_name(first + 2, last, db);
+ if (t != first + 2)
+ {
+ if (db.names.empty())
+ return first;
+ db.names.back().first.insert(0, "thread-local initialization routine for ");
+ first = t;
+ }
+ break;
default:
// T <call-offset> <base encoding>
{
@@ -4499,6 +4569,8 @@ parse_encoding(const char* first, const char* last, C& db)
save_value<decltype(db.tag_templates)> sb(db.tag_templates);
if (db.encoding_depth > 1)
db.tag_templates = true;
+ save_value<decltype(db.parsed_ctor_dtor_cv)> sp(db.parsed_ctor_dtor_cv);
+ db.parsed_ctor_dtor_cv = false;
switch (*first)
{
case 'G':
@@ -4537,6 +4609,9 @@ parse_encoding(const char* first, const char* last, C& db)
if (ret2.empty())
ret1 += ' ';
db.names.pop_back();
+ if (db.names.empty())
+ return first;
+
db.names.back().first.insert(0, ret1);
t = t2;
}
@@ -4564,8 +4639,11 @@ parse_encoding(const char* first, const char* last, C& db)
tmp += ", ";
tmp += db.names[k].move_full();
}
- for (size_t k = k0; k < k1; ++k)
+ for (size_t k = k0; k < k1; ++k) {
+ if (db.names.empty())
+ return first;
db.names.pop_back();
+ }
if (!tmp.empty())
{
if (db.names.empty())
@@ -4893,6 +4971,7 @@ struct string_pair
string_pair(const char (&s)[N]) : first(s, N-1) {}
size_t size() const {return first.size() + second.size();}
+ bool empty() const { return first.empty() && second.empty(); }
StrT full() const {return first + second;}
StrT move_full() {return std::move(first) + std::move(second);}
};
@@ -4906,13 +4985,13 @@ struct Db
sub_type names;
template_param_type subs;
Vector<template_param_type> template_param;
- unsigned cv;
- unsigned ref;
- unsigned encoding_depth;
- bool parsed_ctor_dtor_cv;
- bool tag_templates;
- bool fix_forward_references;
- bool try_to_parse_template_args;
+ unsigned cv = 0;
+ unsigned ref = 0;
+ unsigned encoding_depth = 0;
+ bool parsed_ctor_dtor_cv = false;
+ bool tag_templates = true;
+ bool fix_forward_references = false;
+ bool try_to_parse_template_args = true;
template <size_t N>
Db(arena<N>& ar) :
@@ -4932,17 +5011,11 @@ __cxa_demangle(const char *mangled_name, char *buf, size_t *n, int *status) {
*status = invalid_args;
return nullptr;
}
+
size_t internal_size = buf != nullptr ? *n : 0;
arena<bs> a;
Db db(a);
- db.cv = 0;
- db.ref = 0;
- db.encoding_depth = 0;
- db.parsed_ctor_dtor_cv = false;
- db.tag_templates = true;
db.template_param.emplace_back(a);
- db.fix_forward_references = false;
- db.try_to_parse_template_args = true;
int internal_status = success;
size_t len = std::strlen(mangled_name);
demangle(mangled_name, mangled_name + len, db,
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.cpp
index 50d1a468cea..0794444bcc5 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.cpp
@@ -11,17 +11,13 @@
//
//===----------------------------------------------------------------------===//
-#include "config.h"
#include "cxxabi.h"
#include <exception> // for std::terminate
-#include <cstdlib> // for malloc, free
#include <cstring> // for memset
-#if !LIBCXXABI_HAS_NO_THREADS
-# include <pthread.h> // for fallback_malloc.ipp's mutexes
-#endif
#include "cxa_exception.hpp"
#include "cxa_handlers.hpp"
+#include "fallback_malloc.h"
// +---------------------------+-----------------------------+---------------+
// | __cxa_exception | _Unwind_Exception CLNGC++\0 | thrown object |
@@ -36,8 +32,6 @@
namespace __cxxabiv1 {
-#pragma GCC visibility push(default)
-
// Utility routines
static
inline
@@ -68,12 +62,16 @@ cxa_exception_from_exception_unwind_exception(_Unwind_Exception* unwind_exceptio
return cxa_exception_from_thrown_object(unwind_exception + 1 );
}
-static
-inline
-size_t
-cxa_exception_size_from_exception_thrown_size(size_t size)
-{
- return size + sizeof (__cxa_exception);
+// Round s up to next multiple of a.
+static inline
+size_t aligned_allocation_size(size_t s, size_t a) {
+ return (s + a - 1) & ~(a - 1);
+}
+
+static inline
+size_t cxa_exception_size_from_exception_thrown_size(size_t size) {
+ return aligned_allocation_size(size + sizeof (__cxa_exception),
+ alignof(__cxa_exception));
}
static void setExceptionClass(_Unwind_Exception* unwind_exception) {
@@ -104,20 +102,6 @@ static inline int decrementHandlerCount(__cxa_exception *exception) {
return --exception->handlerCount;
}
-#include "fallback_malloc.ipp"
-
-// Allocate some memory from _somewhere_
-static void *do_malloc(size_t size) {
- void *ptr = std::malloc(size);
- if (NULL == ptr) // if malloc fails, fall back to emergency stash
- ptr = fallback_malloc(size);
- return ptr;
-}
-
-static void do_free(void *ptr) {
- is_fallback_ptr(ptr) ? fallback_free(ptr) : std::free(ptr);
-}
-
/*
If reason isn't _URC_FOREIGN_EXCEPTION_CAUGHT, then the terminateHandler
stored in exc is called. Otherwise the exceptionDestructor stored in
@@ -137,7 +121,7 @@ exception_cleanup_func(_Unwind_Reason_Code reason, _Unwind_Exception* unwind_exc
__cxa_decrement_exception_refcount(unwind_exception + 1);
}
-static LIBCXXABI_NORETURN void failed_throw(__cxa_exception* exception_header) {
+static _LIBCXXABI_NORETURN void failed_throw(__cxa_exception* exception_header) {
// Section 2.5.3 says:
// * For purposes of this ABI, several things are considered exception handlers:
// ** A terminate() call due to a throw.
@@ -156,9 +140,10 @@ extern "C" {
// object. Zero-fill the object. If memory can't be allocated, call
// std::terminate. Return a pointer to the memory to be used for the
// user's exception object.
-_LIBCXXABI_FUNC_VIS void *__cxa_allocate_exception(size_t thrown_size) throw() {
+void *__cxa_allocate_exception(size_t thrown_size) throw() {
size_t actual_size = cxa_exception_size_from_exception_thrown_size(thrown_size);
- __cxa_exception* exception_header = static_cast<__cxa_exception*>(do_malloc(actual_size));
+ __cxa_exception *exception_header =
+ static_cast<__cxa_exception *>(__aligned_malloc_with_fallback(actual_size));
if (NULL == exception_header)
std::terminate();
std::memset(exception_header, 0, actual_size);
@@ -167,8 +152,8 @@ _LIBCXXABI_FUNC_VIS void *__cxa_allocate_exception(size_t thrown_size) throw() {
// Free a __cxa_exception object allocated with __cxa_allocate_exception.
-_LIBCXXABI_FUNC_VIS void __cxa_free_exception(void *thrown_object) throw() {
- do_free(cxa_exception_from_thrown_object(thrown_object));
+void __cxa_free_exception(void *thrown_object) throw() {
+ __aligned_free_with_fallback(cxa_exception_from_thrown_object(thrown_object));
}
@@ -177,7 +162,7 @@ _LIBCXXABI_FUNC_VIS void __cxa_free_exception(void *thrown_object) throw() {
// Otherwise, it will work like __cxa_allocate_exception.
void * __cxa_allocate_dependent_exception () {
size_t actual_size = sizeof(__cxa_dependent_exception);
- void *ptr = do_malloc(actual_size);
+ void *ptr = __aligned_malloc_with_fallback(actual_size);
if (NULL == ptr)
std::terminate();
std::memset(ptr, 0, actual_size);
@@ -188,7 +173,7 @@ void * __cxa_allocate_dependent_exception () {
// This function shall free a dependent_exception.
// It does not affect the reference count of the primary exception.
void __cxa_free_dependent_exception (void * dependent_exception) {
- do_free(dependent_exception);
+ __aligned_free_with_fallback(dependent_exception);
}
@@ -218,7 +203,7 @@ handler, _Unwind_RaiseException may return. In that case, __cxa_throw
will call terminate, assuming that there was no handler for the
exception.
*/
-_LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void
+void
__cxa_throw(void *thrown_object, std::type_info *tinfo, void (*dest)(void *)) {
__cxa_eh_globals *globals = __cxa_get_globals();
__cxa_exception* exception_header = cxa_exception_from_thrown_object(thrown_object);
@@ -251,9 +236,8 @@ The adjusted pointer is computed by the personality routine during phase 1
Requires: exception is native
*/
-_LIBCXXABI_FUNC_VIS
void *__cxa_get_exception_ptr(void *unwind_exception) throw() {
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
return reinterpret_cast<void*>(
static_cast<_Unwind_Control_Block*>(unwind_exception)->barrier_cache.bitpattern[0]);
#else
@@ -262,12 +246,11 @@ void *__cxa_get_exception_ptr(void *unwind_exception) throw() {
#endif
}
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
/*
The routine to be called before the cleanup. This will save __cxa_exception in
__cxa_eh_globals, so that __cxa_end_cleanup() can recover later.
*/
-_LIBCXXABI_FUNC_VIS
bool __cxa_begin_cleanup(void *unwind_arg) throw() {
_Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(unwind_arg);
__cxa_eh_globals* globals = __cxa_get_globals();
@@ -345,7 +328,7 @@ asm (
" bl abort\n"
" .popsection"
);
-#endif // LIBCXXABI_ARM_EHABI
+#endif // defined(_LIBCXXABI_ARM_EHABI)
/*
This routine can catch foreign or native exceptions. If native, the exception
@@ -405,7 +388,7 @@ __cxa_begin_catch(void* unwind_arg) throw()
globals->caughtExceptions = exception_header;
}
globals->uncaughtExceptions -= 1; // Not atomically, since globals are thread-local
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
return reinterpret_cast<void*>(exception_header->unwindHeader.barrier_cache.bitpattern[0]);
#else
return exception_header->adjustedPtr;
@@ -439,7 +422,7 @@ For a foreign exception:
* If it has been rethrown, there is nothing to do.
* Otherwise delete the exception and pop the catch stack to empty.
*/
-_LIBCXXABI_FUNC_VIS void __cxa_end_catch() {
+void __cxa_end_catch() {
static_assert(sizeof(__cxa_exception) == sizeof(__cxa_dependent_exception),
"sizeof(__cxa_exception) must be equal to "
"sizeof(__cxa_dependent_exception)");
@@ -516,7 +499,7 @@ _LIBCXXABI_FUNC_VIS void __cxa_end_catch() {
// Note: exception_header may be masquerading as a __cxa_dependent_exception
// and that's ok. exceptionType is there too.
// However watch out for foreign exceptions. Return null for them.
-_LIBCXXABI_FUNC_VIS std::type_info *__cxa_current_exception_type() {
+std::type_info *__cxa_current_exception_type() {
// get the current exception
__cxa_eh_globals *globals = __cxa_get_globals_fast();
if (NULL == globals)
@@ -541,7 +524,7 @@ If the exception is native:
Note: exception_header may be masquerading as a __cxa_dependent_exception
and that's ok.
*/
-_LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_rethrow() {
+void __cxa_rethrow() {
__cxa_eh_globals* globals = __cxa_get_globals();
__cxa_exception* exception_header = globals->caughtExceptions;
if (NULL == exception_header)
@@ -586,7 +569,7 @@ _LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN void __cxa_rethrow() {
Requires: If thrown_object is not NULL, it is a native exception.
*/
-_LIBCXXABI_FUNC_VIS void
+void
__cxa_increment_exception_refcount(void *thrown_object) throw() {
if (thrown_object != NULL )
{
@@ -603,7 +586,7 @@ __cxa_increment_exception_refcount(void *thrown_object) throw() {
Requires: If thrown_object is not NULL, it is a native exception.
*/
-_LIBCXXABI_FUNC_VIS void
+void
__cxa_decrement_exception_refcount(void *thrown_object) throw() {
if (thrown_object != NULL )
{
@@ -627,7 +610,7 @@ __cxa_decrement_exception_refcount(void *thrown_object) throw() {
been no exceptions thrown, ever, on this thread, we can return NULL without
the need to allocate the exception-handling globals.
*/
-_LIBCXXABI_FUNC_VIS void *__cxa_current_primary_exception() throw() {
+void *__cxa_current_primary_exception() throw() {
// get the current exception
__cxa_eh_globals* globals = __cxa_get_globals_fast();
if (NULL == globals)
@@ -713,6 +696,4 @@ __cxa_uncaught_exceptions() throw()
} // extern "C"
-#pragma GCC visibility pop
-
} // abi
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.hpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.hpp
index 6e68f985389..b9f74e3b0bb 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.hpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception.hpp
@@ -15,19 +15,17 @@
#define _CXA_EXCEPTION_H
#include <exception> // for std::unexpected_handler and std::terminate_handler
-#include <cxxabi.h>
+#include "cxxabi.h"
#include "unwind.h"
namespace __cxxabiv1 {
-#pragma GCC visibility push(hidden)
-
static const uint64_t kOurExceptionClass = 0x434C4E47432B2B00; // CLNGC++\0
static const uint64_t kOurDependentExceptionClass = 0x434C4E47432B2B01; // CLNGC++\1
static const uint64_t get_vendor_and_language = 0xFFFFFFFFFFFFFF00; // mask for CLNGC++
-struct __cxa_exception {
-#if defined(__LP64__) || LIBCXXABI_ARM_EHABI
+struct _LIBCXXABI_HIDDEN __cxa_exception {
+#if defined(__LP64__) || defined(_LIBCXXABI_ARM_EHABI)
// This is a new field to support C++ 0x exception_ptr.
// For binary compatibility it is at the start of this
// struct which is prepended to the object thrown in
@@ -45,7 +43,7 @@ struct __cxa_exception {
int handlerCount;
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
__cxa_exception* nextPropagatingException;
int propagationCount;
#else
@@ -56,21 +54,35 @@ struct __cxa_exception {
void *adjustedPtr;
#endif
-#if !defined(__LP64__) && !LIBCXXABI_ARM_EHABI
+#if !defined(__LP64__) && !defined(_LIBCXXABI_ARM_EHABI)
// This is a new field to support C++ 0x exception_ptr.
// For binary compatibility it is placed where the compiler
// previously adding padded to 64-bit align unwindHeader.
size_t referenceCount;
#endif
+ // This field is annotated with attribute aligned so that the exception
+ // object following the field is sufficiently aligned and there is no
+ // gap between the field and the exception object. r276215 made a change to
+ // annotate _Unwind_Exception in unwind.h with __attribute__((aligned)), but
+ // we cannot incorporate the fix on Darwin since it is an ABI-breaking
+ // change, which is why we need the attribute on this field.
+ //
+ // For ARM EHABI, we do not align this field since _Unwind_Exception is an
+ // alias of _Unwind_Control_Block, which is not annotated with
+ // __attribute__((aligned).
+#if defined(_LIBCXXABI_ARM_EHABI)
_Unwind_Exception unwindHeader;
+#else
+ _Unwind_Exception unwindHeader __attribute__((aligned));
+#endif
};
// http://sourcery.mentor.com/archives/cxx-abi-dev/msg01924.html
// The layout of this structure MUST match the layout of __cxa_exception, with
// primaryException instead of referenceCount.
-struct __cxa_dependent_exception {
-#if defined(__LP64__) || LIBCXXABI_ARM_EHABI
+struct _LIBCXXABI_HIDDEN __cxa_dependent_exception {
+#if defined(__LP64__) || defined(_LIBCXXABI_ARM_EHABI)
void* primaryException;
#endif
@@ -83,7 +95,7 @@ struct __cxa_dependent_exception {
int handlerCount;
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
__cxa_exception* nextPropagatingException;
int propagationCount;
#else
@@ -94,31 +106,32 @@ struct __cxa_dependent_exception {
void *adjustedPtr;
#endif
-#if !defined(__LP64__) && !LIBCXXABI_ARM_EHABI
+#if !defined(__LP64__) && !defined(_LIBCXXABI_ARM_EHABI)
void* primaryException;
#endif
+ // See the comment in __cxa_exception as to why this field has attribute
+ // aligned.
+#if defined(_LIBCXXABI_ARM_EHABI)
_Unwind_Exception unwindHeader;
+#else
+ _Unwind_Exception unwindHeader __attribute__((aligned));
+#endif
};
-struct __cxa_eh_globals {
+struct _LIBCXXABI_HIDDEN __cxa_eh_globals {
__cxa_exception * caughtExceptions;
unsigned int uncaughtExceptions;
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
__cxa_exception* propagatingExceptions;
#endif
};
-#pragma GCC visibility pop
-#pragma GCC visibility push(default)
-
-extern "C" __cxa_eh_globals * __cxa_get_globals ();
-extern "C" __cxa_eh_globals * __cxa_get_globals_fast ();
-
-extern "C" void * __cxa_allocate_dependent_exception ();
-extern "C" void __cxa_free_dependent_exception (void * dependent_exception);
+extern "C" _LIBCXXABI_FUNC_VIS __cxa_eh_globals * __cxa_get_globals ();
+extern "C" _LIBCXXABI_FUNC_VIS __cxa_eh_globals * __cxa_get_globals_fast ();
-#pragma GCC visibility pop
+extern "C" _LIBCXXABI_FUNC_VIS void * __cxa_allocate_dependent_exception ();
+extern "C" _LIBCXXABI_FUNC_VIS void __cxa_free_dependent_exception (void * dependent_exception);
} // namespace __cxxabiv1
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception_storage.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception_storage.cpp
index a39b6db005f..eaac21734f9 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception_storage.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_exception_storage.cpp
@@ -13,9 +13,9 @@
#include "cxa_exception.hpp"
-#include "config.h"
+#include <__threading_support>
-#if LIBCXXABI_HAS_NO_THREADS
+#if defined(_LIBCXXABI_HAS_NO_THREADS)
namespace __cxxabiv1 {
extern "C" {
@@ -44,28 +44,27 @@ extern "C" {
#else
-#include <pthread.h>
-#include <cstdlib> // for calloc, free
#include "abort_message.h"
+#include "fallback_malloc.h"
-// In general, we treat all pthread errors as fatal.
+// In general, we treat all threading errors as fatal.
// We cannot call std::terminate() because that will in turn
// call __cxa_get_globals() and cause infinite recursion.
namespace __cxxabiv1 {
namespace {
- pthread_key_t key_;
- pthread_once_t flag_ = PTHREAD_ONCE_INIT;
+ std::__libcpp_tls_key key_;
+ std::__libcpp_exec_once_flag flag_ = _LIBCPP_EXEC_ONCE_INITIALIZER;
void destruct_ (void *p) {
- std::free ( p );
- if ( 0 != ::pthread_setspecific ( key_, NULL ) )
+ __free_with_fallback ( p );
+ if ( 0 != std::__libcpp_tls_set ( key_, NULL ) )
abort_message("cannot zero out thread value for __cxa_get_globals()");
}
void construct_ () {
- if ( 0 != pthread_key_create ( &key_, destruct_ ) )
- abort_message("cannot create pthread key for __cxa_get_globals()");
+ if ( 0 != std::__libcpp_tls_create ( &key_, destruct_ ) )
+ abort_message("cannot create thread specific key for __cxa_get_globals()");
}
}
@@ -77,11 +76,11 @@ extern "C" {
// If this is the first time we've been asked for these globals, create them
if ( NULL == retVal ) {
retVal = static_cast<__cxa_eh_globals*>
- (std::calloc (1, sizeof (__cxa_eh_globals)));
+ (__calloc_with_fallback (1, sizeof (__cxa_eh_globals)));
if ( NULL == retVal )
abort_message("cannot allocate __cxa_eh_globals");
- if ( 0 != pthread_setspecific ( key_, retVal ) )
- abort_message("pthread_setspecific failure in __cxa_get_globals()");
+ if ( 0 != std::__libcpp_tls_set ( key_, retVal ) )
+ abort_message("std::__libcpp_tls_set failure in __cxa_get_globals()");
}
return retVal;
}
@@ -92,10 +91,10 @@ extern "C" {
// libc++abi.
__cxa_eh_globals * __cxa_get_globals_fast () {
// First time through, create the key.
- if (0 != pthread_once(&flag_, construct_))
- abort_message("pthread_once failure in __cxa_get_globals_fast()");
+ if (0 != std::__libcpp_execute_once(&flag_, construct_))
+ abort_message("execute once failure in __cxa_get_globals_fast()");
// static int init = construct_();
- return static_cast<__cxa_eh_globals*>(::pthread_getspecific(key_));
+ return static_cast<__cxa_eh_globals*>(std::__libcpp_tls_get(key_));
}
}
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_guard.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_guard.cpp
index 72e868f787e..f4c2a184dc5 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_guard.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_guard.cpp
@@ -10,11 +10,8 @@
#include "__cxxabi_config.h"
#include "abort_message.h"
-#include "config.h"
+#include <__threading_support>
-#if !LIBCXXABI_HAS_NO_THREADS
-# include <pthread.h>
-#endif
#include <stdint.h>
/*
@@ -22,9 +19,9 @@
which will turn around and try to call __cxa_guard_acquire reentrantly.
For this reason, the headers of this file are as restricted as possible.
Previous implementations of this code for __APPLE__ have used
- pthread_mutex_lock and the abort_message utility without problem. This
- implementation also uses pthread_cond_wait which has tested to not be a
- problem.
+ std::__libcpp_mutex_lock and the abort_message utility without problem. This
+ implementation also uses std::__libcpp_condvar_wait which has tested
+ to not be a problem.
*/
namespace __cxxabiv1
@@ -34,39 +31,43 @@ namespace
{
#ifdef __arm__
-
// A 32-bit, 4-byte-aligned static data value. The least significant 2 bits must
// be statically initialized to 0.
typedef uint32_t guard_type;
-// Test the lowest bit.
-inline bool is_initialized(guard_type* guard_object) {
- return (*guard_object) & 1;
-}
-
inline void set_initialized(guard_type* guard_object) {
*guard_object |= 1;
}
-
#else
-
typedef uint64_t guard_type;
-bool is_initialized(guard_type* guard_object) {
+void set_initialized(guard_type* guard_object) {
char* initialized = (char*)guard_object;
- return *initialized;
+ *initialized = 1;
}
+#endif
-void set_initialized(guard_type* guard_object) {
+#if defined(_LIBCXXABI_HAS_NO_THREADS) || (defined(__APPLE__) && !defined(__arm__))
+#ifdef __arm__
+
+// Test the lowest bit.
+inline bool is_initialized(guard_type* guard_object) {
+ return (*guard_object) & 1;
+}
+
+#else
+
+bool is_initialized(guard_type* guard_object) {
char* initialized = (char*)guard_object;
- *initialized = 1;
+ return *initialized;
}
#endif
+#endif
-#if !LIBCXXABI_HAS_NO_THREADS
-pthread_mutex_t guard_mut = PTHREAD_MUTEX_INITIALIZER;
-pthread_cond_t guard_cv = PTHREAD_COND_INITIALIZER;
+#ifndef _LIBCXXABI_HAS_NO_THREADS
+std::__libcpp_mutex_t guard_mut = _LIBCPP_MUTEX_INITIALIZER;
+std::__libcpp_condvar_t guard_cv = _LIBCPP_CONDVAR_INITIALIZER;
#endif
#if defined(__APPLE__) && !defined(__arm__)
@@ -111,9 +112,10 @@ set_lock(uint64_t& x, lock_type y)
typedef bool lock_type;
-inline
-lock_type
-get_lock(uint64_t x)
+#if !defined(__arm__)
+static_assert(std::is_same<guard_type, uint64_t>::value, "");
+
+inline lock_type get_lock(uint64_t x)
{
union
{
@@ -123,9 +125,7 @@ get_lock(uint64_t x)
return f.lock[1] != 0;
}
-inline
-void
-set_lock(uint64_t& x, lock_type y)
+inline void set_lock(uint64_t& x, lock_type y)
{
union
{
@@ -135,10 +135,10 @@ set_lock(uint64_t& x, lock_type y)
f.lock[1] = y;
x = f.guard;
}
+#else // defined(__arm__)
+static_assert(std::is_same<guard_type, uint32_t>::value, "");
-inline
-lock_type
-get_lock(uint32_t x)
+inline lock_type get_lock(uint32_t x)
{
union
{
@@ -148,9 +148,7 @@ get_lock(uint32_t x)
return f.lock[1] != 0;
}
-inline
-void
-set_lock(uint32_t& x, lock_type y)
+inline void set_lock(uint32_t& x, lock_type y)
{
union
{
@@ -161,38 +159,37 @@ set_lock(uint32_t& x, lock_type y)
x = f.guard;
}
-#endif // __APPLE__
+#endif // !defined(__arm__)
+
+#endif // __APPLE__ && !__arm__
} // unnamed namespace
extern "C"
{
-#if LIBCXXABI_HAS_NO_THREADS
-_LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(guard_type *guard_object) {
- return !is_initialized(guard_object);
-}
-
-_LIBCXXABI_FUNC_VIS void __cxa_guard_release(guard_type *guard_object) {
- *guard_object = 0;
- set_initialized(guard_object);
-}
-
-_LIBCXXABI_FUNC_VIS void __cxa_guard_abort(guard_type *guard_object) {
- *guard_object = 0;
-}
-
-#else // !LIBCXXABI_HAS_NO_THREADS
-
+#ifndef _LIBCXXABI_HAS_NO_THREADS
_LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(guard_type *guard_object) {
char* initialized = (char*)guard_object;
- if (pthread_mutex_lock(&guard_mut))
+ if (std::__libcpp_mutex_lock(&guard_mut))
abort_message("__cxa_guard_acquire failed to acquire mutex");
int result = *initialized == 0;
if (result)
{
#if defined(__APPLE__) && !defined(__arm__)
- const lock_type id = pthread_mach_thread_np(pthread_self());
+ // This is a special-case pthread dependency for Mac. We can't pull this
+ // out into libcxx's threading API (__threading_support) because not all
+ // supported Mac environments provide this function (in pthread.h). To
+ // make it possible to build/use libcxx in those environments, we have to
+ // keep this pthread dependency local to libcxxabi. If there is some
+ // convenient way to detect precisely when pthread_mach_thread_np is
+ // available in a given Mac environment, it might still be possible to
+ // bury this dependency in __threading_support.
+ #ifdef _LIBCPP_HAS_THREAD_API_PTHREAD
+ const lock_type id = pthread_mach_thread_np(std::__libcpp_thread_get_current_id());
+ #else
+ #error "How do I pthread_mach_thread_np()?"
+ #endif
lock_type lock = get_lock(*guard_object);
if (lock)
{
@@ -201,7 +198,7 @@ _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(guard_type *guard_object) {
abort_message("__cxa_guard_acquire detected deadlock");
do
{
- if (pthread_cond_wait(&guard_cv, &guard_mut))
+ if (std::__libcpp_condvar_wait(&guard_cv, &guard_mut))
abort_message("__cxa_guard_acquire condition variable wait failed");
lock = get_lock(*guard_object);
} while (lock);
@@ -213,40 +210,55 @@ _LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(guard_type *guard_object) {
set_lock(*guard_object, id);
#else // !__APPLE__ || __arm__
while (get_lock(*guard_object))
- if (pthread_cond_wait(&guard_cv, &guard_mut))
+ if (std::__libcpp_condvar_wait(&guard_cv, &guard_mut))
abort_message("__cxa_guard_acquire condition variable wait failed");
result = *initialized == 0;
if (result)
set_lock(*guard_object, true);
#endif // !__APPLE__ || __arm__
}
- if (pthread_mutex_unlock(&guard_mut))
+ if (std::__libcpp_mutex_unlock(&guard_mut))
abort_message("__cxa_guard_acquire failed to release mutex");
return result;
}
_LIBCXXABI_FUNC_VIS void __cxa_guard_release(guard_type *guard_object) {
- if (pthread_mutex_lock(&guard_mut))
+ if (std::__libcpp_mutex_lock(&guard_mut))
abort_message("__cxa_guard_release failed to acquire mutex");
*guard_object = 0;
set_initialized(guard_object);
- if (pthread_mutex_unlock(&guard_mut))
+ if (std::__libcpp_mutex_unlock(&guard_mut))
abort_message("__cxa_guard_release failed to release mutex");
- if (pthread_cond_broadcast(&guard_cv))
+ if (std::__libcpp_condvar_broadcast(&guard_cv))
abort_message("__cxa_guard_release failed to broadcast condition variable");
}
_LIBCXXABI_FUNC_VIS void __cxa_guard_abort(guard_type *guard_object) {
- if (pthread_mutex_lock(&guard_mut))
+ if (std::__libcpp_mutex_lock(&guard_mut))
abort_message("__cxa_guard_abort failed to acquire mutex");
*guard_object = 0;
- if (pthread_mutex_unlock(&guard_mut))
+ if (std::__libcpp_mutex_unlock(&guard_mut))
abort_message("__cxa_guard_abort failed to release mutex");
- if (pthread_cond_broadcast(&guard_cv))
+ if (std::__libcpp_condvar_broadcast(&guard_cv))
abort_message("__cxa_guard_abort failed to broadcast condition variable");
}
-#endif // !LIBCXXABI_HAS_NO_THREADS
+#else // _LIBCXXABI_HAS_NO_THREADS
+
+_LIBCXXABI_FUNC_VIS int __cxa_guard_acquire(guard_type *guard_object) {
+ return !is_initialized(guard_object);
+}
+
+_LIBCXXABI_FUNC_VIS void __cxa_guard_release(guard_type *guard_object) {
+ *guard_object = 0;
+ set_initialized(guard_object);
+}
+
+_LIBCXXABI_FUNC_VIS void __cxa_guard_abort(guard_type *guard_object) {
+ *guard_object = 0;
+}
+
+#endif // !_LIBCXXABI_HAS_NO_THREADS
} // extern "C"
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.cpp
index 9c1c30291a6..2881a2a65fe 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.cpp
@@ -14,7 +14,6 @@
#include <new>
#include <exception>
#include "abort_message.h"
-#include "config.h"
#include "cxxabi.h"
#include "cxa_handlers.hpp"
#include "cxa_exception.hpp"
@@ -32,7 +31,6 @@ get_unexpected() _NOEXCEPT
// return __cxa_unexpected_handler.load(memory_order_acq);
}
-__attribute__((visibility("hidden"), noreturn))
void
__unexpected(unexpected_handler func)
{
@@ -57,25 +55,24 @@ get_terminate() _NOEXCEPT
// return __cxa_terminate_handler.load(memory_order_acq);
}
-__attribute__((visibility("hidden"), noreturn))
void
__terminate(terminate_handler func) _NOEXCEPT
{
-#if __has_feature(cxx_exceptions)
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
try
{
-#endif // __has_feature(cxx_exceptions)
+#endif // _LIBCXXABI_NO_EXCEPTIONS
func();
// handler should not return
abort_message("terminate_handler unexpectedly returned");
-#if __has_feature(cxx_exceptions)
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
}
catch (...)
{
// handler should not throw exception
abort_message("terminate_handler unexpectedly threw an exception");
}
-#endif // #if __has_feature(cxx_exceptions)
+#endif // _LIBCXXABI_NO_EXCEPTIONS
}
__attribute__((noreturn))
@@ -102,9 +99,11 @@ terminate() _NOEXCEPT
__terminate(get_terminate());
}
-extern "C" new_handler __cxa_new_handler = 0;
-// In the future these will become:
+// In the future this will become:
// std::atomic<std::new_handler> __cxa_new_handler(0);
+extern "C" {
+new_handler __cxa_new_handler = 0;
+}
new_handler
set_new_handler(new_handler handler) _NOEXCEPT
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.hpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.hpp
index ce567ec1471..14c0e10119d 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.hpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_handlers.hpp
@@ -13,16 +13,18 @@
#ifndef _CXA_HANDLERS_H
#define _CXA_HANDLERS_H
+#include <__cxxabi_config.h>
+
#include <exception>
namespace std
{
-__attribute__((visibility("hidden"), noreturn))
+_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
void
__unexpected(unexpected_handler func);
-__attribute__((visibility("hidden"), noreturn))
+_LIBCXXABI_HIDDEN _LIBCXXABI_NORETURN
void
__terminate(terminate_handler func) _NOEXCEPT;
@@ -31,9 +33,9 @@ __terminate(terminate_handler func) _NOEXCEPT;
extern "C"
{
-extern void (*__cxa_terminate_handler)();
-extern void (*__cxa_unexpected_handler)();
-extern void (*__cxa_new_handler)();
+_LIBCXXABI_DATA_VIS extern void (*__cxa_terminate_handler)();
+_LIBCXXABI_DATA_VIS extern void (*__cxa_unexpected_handler)();
+_LIBCXXABI_DATA_VIS extern void (*__cxa_new_handler)();
/*
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_new_delete.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_new_delete.cpp
deleted file mode 100644
index 25a5454e05e..00000000000
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_new_delete.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-//===------------------------ cxa_new_delete.cpp --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//
-// This file implements the new and delete operators.
-//===----------------------------------------------------------------------===//
-
-#define _LIBCPP_BUILDING_NEW
-
-#include <new>
-#include <cstdlib>
-
-/*
-[new.delete.single]
-
-* Executes a loop: Within the loop, the function first attempts to allocate
- the requested storage. Whether the attempt involves a call to the Standard C
- library function malloc is unspecified.
-
-* Returns a pointer to the allocated storage if the attempt is successful.
- Otherwise, if the current new_handler (18.6.2.5) is a null pointer value,
- throws bad_alloc.
-
-* Otherwise, the function calls the current new_handler function (18.6.2.3).
- If the called function returns, the loop repeats.
-
-* The loop terminates when an attempt to allocate the requested storage is
- successful or when a called new_handler function does not return.
-*/
-__attribute__((__weak__, __visibility__("default")))
-void *
-operator new(std::size_t size)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
-#endif
-{
- if (size == 0)
- size = 1;
- void* p;
- while ((p = std::malloc(size)) == 0)
- {
- std::new_handler nh = std::get_new_handler();
- if (nh)
- nh();
- else
- throw std::bad_alloc();
- }
- return p;
-}
-
-/*
-Note: The relationships among these operators is both carefully considered
-and standard in C++11. Please do not change them without fully understanding
-the consequences of doing so. Reference:
-http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2158.html
-*/
-/*
-[new.delete.single]
-
-Calls operator new(size). If the call returns normally, returns the result of
-that call. Otherwise, returns a null pointer.
-*/
-__attribute__((__weak__, __visibility__("default")))
-void*
-operator new(size_t size, const std::nothrow_t&)
-#if __has_feature(cxx_noexcept)
- noexcept
-#else
- throw()
-#endif
-{
- void* p = 0;
- try
- {
- p = ::operator new(size);
- }
- catch (...)
- {
- }
- return p;
-}
-
-/*
-[new.delete.array]
-
-Returns operator new(size).
-*/
-__attribute__((__weak__, __visibility__("default")))
-void*
-operator new[](size_t size)
-#if !__has_feature(cxx_noexcept)
- throw(std::bad_alloc)
-#endif
-{
- return ::operator new(size);
-}
-
-/*
-[new.delete.array]
-
-Calls operator new[](size). If the call returns normally, returns the result
-of that call. Otherwise, returns a null pointer.
-*/
-__attribute__((__weak__, __visibility__("default")))
-void*
-operator new[](size_t size, const std::nothrow_t&)
-#if __has_feature(cxx_noexcept)
- noexcept
-#else
- throw()
-#endif
-{
- void* p = 0;
- try
- {
- p = ::operator new[](size);
- }
- catch (...)
- {
- }
- return p;
-}
-
-/*
-[new.delete.single]
-
-If ptr is null, does nothing. Otherwise, reclaims the storage allocated by the
-earlier call to operator new.
-*/
-__attribute__((__weak__, __visibility__("default")))
-void
-operator delete(void* ptr)
-#if __has_feature(cxx_noexcept)
- noexcept
-#else
- throw()
-#endif
-{
- if (ptr)
- std::free(ptr);
-}
-
-/*
-[new.delete.single]
-
-calls operator delete(ptr)
-*/
-__attribute__((__weak__, __visibility__("default")))
-void
-operator delete(void* ptr, const std::nothrow_t&)
-#if __has_feature(cxx_noexcept)
- noexcept
-#else
- throw()
-#endif
-{
- ::operator delete(ptr);
-}
-
-/*
-[new.delete.array]
-
-Calls operator delete(ptr)
-*/
-__attribute__((__weak__, __visibility__("default")))
-void
-operator delete[] (void* ptr)
-#if __has_feature(cxx_noexcept)
- noexcept
-#else
- throw()
-#endif
-{
- ::operator delete(ptr);
-}
-
-/*
-[new.delete.array]
-
-calls operator delete[](ptr)
-*/
-__attribute__((__weak__, __visibility__("default")))
-void
-operator delete[] (void* ptr, const std::nothrow_t&)
-#if __has_feature(cxx_noexcept)
- noexcept
-#else
- throw()
-#endif
-{
- ::operator delete[](ptr);
-}
-
-namespace std
-{
-
-// bad_alloc
-
-bad_alloc::bad_alloc() _NOEXCEPT
-{
-}
-
-bad_alloc::~bad_alloc() _NOEXCEPT
-{
-}
-
-const char*
-bad_alloc::what() const _NOEXCEPT
-{
- return "std::bad_alloc";
-}
-
-// bad_array_new_length
-
-bad_array_new_length::bad_array_new_length() _NOEXCEPT
-{
-}
-
-bad_array_new_length::~bad_array_new_length() _NOEXCEPT
-{
-}
-
-const char*
-bad_array_new_length::what() const _NOEXCEPT
-{
- return "bad_array_new_length";
-}
-
-// bad_array_length
-
-#ifndef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
-
-class _LIBCPP_EXCEPTION_ABI bad_array_length
- : public bad_alloc
-{
-public:
- bad_array_length() _NOEXCEPT;
- virtual ~bad_array_length() _NOEXCEPT;
- virtual const char* what() const _NOEXCEPT;
-};
-
-#endif // _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
-
-bad_array_length::bad_array_length() _NOEXCEPT
-{
-}
-
-bad_array_length::~bad_array_length() _NOEXCEPT
-{
-}
-
-const char*
-bad_array_length::what() const _NOEXCEPT
-{
- return "bad_array_length";
-}
-
-} // std
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_noexception.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_noexception.cpp
new file mode 100644
index 00000000000..adda552b89f
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_noexception.cpp
@@ -0,0 +1,55 @@
+//===------------------------- cxa_exception.cpp --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//
+// This file implements the "Exception Handling APIs"
+// http://mentorembedded.github.io/cxx-abi/abi-eh.html
+//
+//===----------------------------------------------------------------------===//
+
+// Support functions for the no-exceptions libc++ library
+
+#include "cxxabi.h"
+
+#include <exception> // for std::terminate
+#include "cxa_exception.hpp"
+#include "cxa_handlers.hpp"
+
+namespace __cxxabiv1 {
+
+extern "C" {
+
+void
+__cxa_increment_exception_refcount(void *thrown_object) throw() {
+ if (thrown_object != nullptr)
+ std::terminate();
+}
+
+void
+__cxa_decrement_exception_refcount(void *thrown_object) throw() {
+ if (thrown_object != nullptr)
+ std::terminate();
+}
+
+
+void *__cxa_current_primary_exception() throw() { return nullptr; }
+
+void
+__cxa_rethrow_primary_exception(void* thrown_object) {
+ if (thrown_object != nullptr)
+ std::terminate();
+}
+
+bool
+__cxa_uncaught_exception() throw() { return false; }
+
+unsigned int
+__cxa_uncaught_exceptions() throw() { return 0; }
+
+} // extern "C"
+
+} // abi
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_personality.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_personality.cpp
index 63adf31f85a..7f857faf78f 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_personality.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_personality.cpp
@@ -17,7 +17,7 @@
#include <string.h>
#include <typeinfo>
-#include "config.h"
+#include "__cxxabi_config.h"
#include "cxa_exception.hpp"
#include "cxa_handlers.hpp"
#include "private_typeinfo.h"
@@ -316,7 +316,7 @@ call_terminate(bool native_exception, _Unwind_Exception* unwind_exception)
std::terminate();
}
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
static const void* read_target2_value(const void* ptr)
{
uintptr_t offset = *reinterpret_cast<const uintptr_t*>(ptr);
@@ -327,7 +327,7 @@ static const void* read_target2_value(const void* ptr)
// deferred to the linker. For bare-metal they turn into absolute
// relocations. For linux they turn into GOT-REL relocations."
// https://gcc.gnu.org/ml/gcc-patches/2009-08/msg00264.html
-#if LIBCXXABI_BAREMETAL
+#if defined(LIBCXXABI_BAREMETAL)
return reinterpret_cast<const void*>(reinterpret_cast<uintptr_t>(ptr) +
offset);
#else
@@ -347,14 +347,17 @@ get_shim_type_info(uint64_t ttypeIndex, const uint8_t* classInfo,
call_terminate(native_exception, unwind_exception);
}
- assert(ttypeEncoding == DW_EH_PE_absptr && "Unexpected TTypeEncoding");
+ assert(((ttypeEncoding == DW_EH_PE_absptr) || // LLVM or GCC 4.6
+ (ttypeEncoding == DW_EH_PE_pcrel) || // GCC 4.7 baremetal
+ (ttypeEncoding == (DW_EH_PE_pcrel | DW_EH_PE_indirect))) && // GCC 4.7 linux
+ "Unexpected TTypeEncoding");
(void)ttypeEncoding;
const uint8_t* ttypePtr = classInfo - ttypeIndex * sizeof(uintptr_t);
return reinterpret_cast<const __shim_type_info *>(
read_target2_value(ttypePtr));
}
-#else // !LIBCXXABI_ARM_EHABI
+#else // !defined(_LIBCXXABI_ARM_EHABI)
static
const __shim_type_info*
get_shim_type_info(uint64_t ttypeIndex, const uint8_t* classInfo,
@@ -390,7 +393,7 @@ get_shim_type_info(uint64_t ttypeIndex, const uint8_t* classInfo,
classInfo -= ttypeIndex;
return (const __shim_type_info*)readEncodedPointer(&classInfo, ttypeEncoding);
}
-#endif // !LIBCXXABI_ARM_EHABI
+#endif // !defined(_LIBCXXABI_ARM_EHABI)
/*
This is checking a thrown exception type, excpType, against a possibly empty
@@ -401,7 +404,7 @@ get_shim_type_info(uint64_t ttypeIndex, const uint8_t* classInfo,
the list will catch a excpType. If any catchType in the list can catch an
excpType, then this exception spec does not catch the excpType.
*/
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
static
bool
exception_spec_can_catch(int64_t specIndex, const uint8_t* classInfo,
@@ -414,7 +417,10 @@ exception_spec_can_catch(int64_t specIndex, const uint8_t* classInfo,
call_terminate(false, unwind_exception);
}
- assert(ttypeEncoding == DW_EH_PE_absptr && "Unexpected TTypeEncoding");
+ assert(((ttypeEncoding == DW_EH_PE_absptr) || // LLVM or GCC 4.6
+ (ttypeEncoding == DW_EH_PE_pcrel) || // GCC 4.7 baremetal
+ (ttypeEncoding == (DW_EH_PE_pcrel | DW_EH_PE_indirect))) && // GCC 4.7 linux
+ "Unexpected TTypeEncoding");
(void)ttypeEncoding;
// specIndex is negative of 1-based byte offset into classInfo;
@@ -927,8 +933,8 @@ _UA_CLEANUP_PHASE
Else a cleanup is not found: return _URC_CONTINUE_UNWIND
*/
-#if !LIBCXXABI_ARM_EHABI
-_Unwind_Reason_Code
+#if !defined(_LIBCXXABI_ARM_EHABI)
+_LIBCXXABI_FUNC_VIS _Unwind_Reason_Code
#ifdef __USING_SJLJ_EXCEPTIONS__
__gxx_personality_sj0
#else
@@ -1034,7 +1040,7 @@ static _Unwind_Reason_Code continue_unwind(_Unwind_Exception* unwind_exception,
}
// ARM register names
-#if !LIBCXXABI_USE_LLVM_UNWINDER
+#if !defined(LIBCXXABI_USE_LLVM_UNWINDER)
static const uint32_t REG_UCB = 12; // Register to save _Unwind_Control_Block
#endif
static const uint32_t REG_SP = 13;
@@ -1059,7 +1065,7 @@ static void load_results_from_barrier_cache(scan_results& results,
results.ttypeIndex = (int64_t)(int32_t)unwind_exception->barrier_cache.bitpattern[4];
}
-extern "C" _Unwind_Reason_Code
+extern "C" _LIBCXXABI_FUNC_VIS _Unwind_Reason_Code
__gxx_personality_v0(_Unwind_State state,
_Unwind_Exception* unwind_exception,
_Unwind_Context* context)
@@ -1070,7 +1076,7 @@ __gxx_personality_v0(_Unwind_State state,
bool native_exception = (unwind_exception->exception_class & get_vendor_and_language) ==
(kOurExceptionClass & get_vendor_and_language);
-#if !LIBCXXABI_USE_LLVM_UNWINDER
+#if !defined(LIBCXXABI_USE_LLVM_UNWINDER)
// Copy the address of _Unwind_Control_Block to r12 so that
// _Unwind_GetLanguageSpecificData() and _Unwind_GetRegionStart() can
// return correct address.
@@ -1165,7 +1171,7 @@ __gxx_personality_v0(_Unwind_State state,
__attribute__((noreturn))
-void
+_LIBCXXABI_FUNC_VIS void
__cxa_call_unexpected(void* arg)
{
_Unwind_Exception* unwind_exception = static_cast<_Unwind_Exception*>(arg);
@@ -1187,7 +1193,7 @@ __cxa_call_unexpected(void* arg)
u_handler = old_exception_header->unexpectedHandler;
// If std::__unexpected(u_handler) rethrows the same exception,
// these values get overwritten by the rethrow. So save them now:
-#if LIBCXXABI_ARM_EHABI
+#if defined(_LIBCXXABI_ARM_EHABI)
ttypeIndex = (int64_t)(int32_t)unwind_exception->barrier_cache.bitpattern[4];
lsda = (const uint8_t*)unwind_exception->barrier_cache.bitpattern[2];
#else
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_thread_atexit.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_thread_atexit.cpp
index 7962e28af70..49d15d6b145 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_thread_atexit.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_thread_atexit.cpp
@@ -7,20 +7,134 @@
//
//===----------------------------------------------------------------------===//
+#include "abort_message.h"
#include "cxxabi.h"
+#include <__threading_support>
+#include <cstdlib>
namespace __cxxabiv1 {
+
+ using Dtor = void(*)(void*);
+
+ extern "C"
+#ifndef HAVE___CXA_THREAD_ATEXIT_IMPL
+ // A weak symbol is used to detect this function's presence in the C library
+ // at runtime, even if libc++ is built against an older libc
+ _LIBCXXABI_WEAK
+#endif
+ int __cxa_thread_atexit_impl(Dtor, void*, void*);
+
+#ifndef HAVE___CXA_THREAD_ATEXIT_IMPL
+
+namespace {
+ // This implementation is used if the C library does not provide
+ // __cxa_thread_atexit_impl() for us. It has a number of limitations that are
+ // difficult to impossible to address without ..._impl():
+ //
+ // - dso_symbol is ignored. This means that a shared library may be unloaded
+ // (via dlclose()) before its thread_local destructors have run.
+ //
+ // - thread_local destructors for the main thread are run by the destructor of
+ // a static object. This is later than expected; they should run before the
+ // destructors of any objects with static storage duration.
+ //
+ // - thread_local destructors on non-main threads run on the first iteration
+ // through the __libccpp_tls_key destructors.
+ // std::notify_all_at_thread_exit() and similar functions must be careful to
+ // wait until the second iteration to provide their intended ordering
+ // guarantees.
+ //
+ // Another limitation, though one shared with ..._impl(), is that any
+ // thread_locals that are first initialized after non-thread_local global
+ // destructors begin to run will not be destroyed. [basic.start.term] states
+ // that all thread_local destructors are sequenced before the destruction of
+ // objects with static storage duration, resulting in a contradiction if a
+ // thread_local is constructed after that point. Thus we consider such
+ // programs ill-formed, and don't bother to run those destructors. (If the
+ // program terminates abnormally after such a thread_local is constructed,
+ // the destructor is not expected to run and thus there is no contradiction.
+ // So construction still has to work.)
+
+ struct DtorList {
+ Dtor dtor;
+ void* obj;
+ DtorList* next;
+ };
+
+ // The linked list of thread-local destructors to run
+ __thread DtorList* dtors = nullptr;
+ // True if the destructors are currently scheduled to run on this thread
+ __thread bool dtors_alive = false;
+ // Used to trigger destructors on thread exit; value is ignored
+ std::__libcpp_tls_key dtors_key;
+
+ void run_dtors(void*) {
+ while (auto head = dtors) {
+ dtors = head->next;
+ head->dtor(head->obj);
+ std::free(head);
+ }
+
+ dtors_alive = false;
+ }
+
+ struct DtorsManager {
+ DtorsManager() {
+ // There is intentionally no matching std::__libcpp_tls_delete call, as
+ // __cxa_thread_atexit() may be called arbitrarily late (for example, from
+ // global destructors or atexit() handlers).
+ if (std::__libcpp_tls_create(&dtors_key, run_dtors) != 0) {
+ abort_message("std::__libcpp_tls_create() failed in __cxa_thread_atexit()");
+ }
+ }
+
+ ~DtorsManager() {
+ // std::__libcpp_tls_key destructors do not run on threads that call exit()
+ // (including when the main thread returns from main()), so we explicitly
+ // call the destructor here. This runs at exit time (potentially earlier
+ // if libc++abi is dlclose()'d). Any thread_locals initialized after this
+ // point will not be destroyed.
+ run_dtors(nullptr);
+ }
+ };
+} // namespace
+
+#endif // HAVE___CXA_THREAD_ATEXIT_IMPL
+
extern "C" {
+ _LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(Dtor dtor, void* obj, void* dso_symbol) throw() {
#ifdef HAVE___CXA_THREAD_ATEXIT_IMPL
+ return __cxa_thread_atexit_impl(dtor, obj, dso_symbol);
+#else
+ if (__cxa_thread_atexit_impl) {
+ return __cxa_thread_atexit_impl(dtor, obj, dso_symbol);
+ } else {
+ // Initialize the dtors std::__libcpp_tls_key (uses __cxa_guard_*() for
+ // one-time initialization and __cxa_atexit() for destruction)
+ static DtorsManager manager;
+
+ if (!dtors_alive) {
+ if (std::__libcpp_tls_set(dtors_key, &dtors_key) != 0) {
+ return -1;
+ }
+ dtors_alive = true;
+ }
+
+ auto head = static_cast<DtorList*>(std::malloc(sizeof(DtorList)));
+ if (!head) {
+ return -1;
+ }
-_LIBCXXABI_FUNC_VIS int __cxa_thread_atexit(void (*dtor)(void *), void *obj,
- void *dso_symbol) throw() {
- extern int __cxa_thread_atexit_impl(void (*)(void *), void *, void *);
- return __cxa_thread_atexit_impl(dtor, obj, dso_symbol);
-}
+ head->dtor = dtor;
+ head->obj = obj;
+ head->next = dtors;
+ dtors = head;
-#endif // HAVE__CXA_THREAD_ATEXIT_IMPL
+ return 0;
+ }
+#endif // HAVE___CXA_THREAD_ATEXIT_IMPL
+ }
} // extern "C"
} // namespace __cxxabiv1
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_unexpected.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_unexpected.cpp
index f6e6b6ab97e..7d4ef80c39e 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_unexpected.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_unexpected.cpp
@@ -8,20 +8,16 @@
//===----------------------------------------------------------------------===//
#include <exception>
-#include <cxxabi.h>
+#include "cxxabi.h"
#include "cxa_exception.hpp"
namespace __cxxabiv1
{
-#pragma GCC visibility push(default)
-
extern "C"
{
}
-#pragma GCC visibility pop
-
} // namespace __cxxabiv1
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_virtual.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_virtual.cpp
index ac81ad39d07..f59fa7ee2c6 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_virtual.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/cxa_virtual.cpp
@@ -12,12 +12,12 @@
namespace __cxxabiv1 {
extern "C" {
-_LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN
+_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN
void __cxa_pure_virtual(void) {
abort_message("Pure virtual function called!");
}
-_LIBCXXABI_FUNC_VIS LIBCXXABI_NORETURN
+_LIBCXXABI_FUNC_VIS _LIBCXXABI_NORETURN
void __cxa_deleted_virtual(void) {
abort_message("Deleted virtual function called!");
}
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.cpp
new file mode 100644
index 00000000000..336ad31b017
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.cpp
@@ -0,0 +1,252 @@
+//===------------------------ fallback_malloc.cpp -------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "fallback_malloc.h"
+
+#include <__threading_support>
+
+#include <cstdlib> // for malloc, calloc, free
+#include <cstring> // for memset
+
+// A small, simple heap manager based (loosely) on
+// the startup heap manager from FreeBSD, optimized for space.
+//
+// Manages a fixed-size memory pool, supports malloc and free only.
+// No support for realloc.
+//
+// Allocates chunks in multiples of four bytes, with a four byte header
+// for each chunk. The overhead of each chunk is kept low by keeping pointers
+// as two byte offsets within the heap, rather than (4 or 8 byte) pointers.
+
+namespace {
+
+// When POSIX threads are not available, make the mutex operations a nop
+#ifndef _LIBCXXABI_HAS_NO_THREADS
+_LIBCPP_SAFE_STATIC
+static std::__libcpp_mutex_t heap_mutex = _LIBCPP_MUTEX_INITIALIZER;
+#else
+static void* heap_mutex = 0;
+#endif
+
+class mutexor {
+public:
+#ifndef _LIBCXXABI_HAS_NO_THREADS
+ mutexor(std::__libcpp_mutex_t* m) : mtx_(m) {
+ std::__libcpp_mutex_lock(mtx_);
+ }
+ ~mutexor() { std::__libcpp_mutex_unlock(mtx_); }
+#else
+ mutexor(void*) {}
+ ~mutexor() {}
+#endif
+private:
+ mutexor(const mutexor& rhs);
+ mutexor& operator=(const mutexor& rhs);
+#ifndef _LIBCXXABI_HAS_NO_THREADS
+ std::__libcpp_mutex_t* mtx_;
+#endif
+};
+
+static const size_t HEAP_SIZE = 512;
+char heap[HEAP_SIZE] __attribute__((aligned));
+
+typedef unsigned short heap_offset;
+typedef unsigned short heap_size;
+
+struct heap_node {
+ heap_offset next_node; // offset into heap
+ heap_size len; // size in units of "sizeof(heap_node)"
+};
+
+static const heap_node* list_end =
+ (heap_node*)(&heap[HEAP_SIZE]); // one past the end of the heap
+static heap_node* freelist = NULL;
+
+heap_node* node_from_offset(const heap_offset offset) {
+ return (heap_node*)(heap + (offset * sizeof(heap_node)));
+}
+
+heap_offset offset_from_node(const heap_node* ptr) {
+ return static_cast<heap_offset>(
+ static_cast<size_t>(reinterpret_cast<const char*>(ptr) - heap) /
+ sizeof(heap_node));
+}
+
+void init_heap() {
+ freelist = (heap_node*)heap;
+ freelist->next_node = offset_from_node(list_end);
+ freelist->len = HEAP_SIZE / sizeof(heap_node);
+}
+
+// How big a chunk we allocate
+size_t alloc_size(size_t len) {
+ return (len + sizeof(heap_node) - 1) / sizeof(heap_node) + 1;
+}
+
+bool is_fallback_ptr(void* ptr) {
+ return ptr >= heap && ptr < (heap + HEAP_SIZE);
+}
+
+void* fallback_malloc(size_t len) {
+ heap_node *p, *prev;
+ const size_t nelems = alloc_size(len);
+ mutexor mtx(&heap_mutex);
+
+ if (NULL == freelist)
+ init_heap();
+
+ // Walk the free list, looking for a "big enough" chunk
+ for (p = freelist, prev = 0; p && p != list_end;
+ prev = p, p = node_from_offset(p->next_node)) {
+
+ if (p->len > nelems) { // chunk is larger, shorten, and return the tail
+ heap_node* q;
+
+ p->len = static_cast<heap_size>(p->len - nelems);
+ q = p + p->len;
+ q->next_node = 0;
+ q->len = static_cast<heap_size>(nelems);
+ return (void*)(q + 1);
+ }
+
+ if (p->len == nelems) { // exact size match
+ if (prev == 0)
+ freelist = node_from_offset(p->next_node);
+ else
+ prev->next_node = p->next_node;
+ p->next_node = 0;
+ return (void*)(p + 1);
+ }
+ }
+ return NULL; // couldn't find a spot big enough
+}
+
+// Return the start of the next block
+heap_node* after(struct heap_node* p) { return p + p->len; }
+
+void fallback_free(void* ptr) {
+ struct heap_node* cp = ((struct heap_node*)ptr) - 1; // retrieve the chunk
+ struct heap_node *p, *prev;
+
+ mutexor mtx(&heap_mutex);
+
+#ifdef DEBUG_FALLBACK_MALLOC
+ std::cout << "Freeing item at " << offset_from_node(cp) << " of size "
+ << cp->len << std::endl;
+#endif
+
+ for (p = freelist, prev = 0; p && p != list_end;
+ prev = p, p = node_from_offset(p->next_node)) {
+#ifdef DEBUG_FALLBACK_MALLOC
+ std::cout << " p, cp, after (p), after(cp) " << offset_from_node(p) << ' '
+ << offset_from_node(cp) << ' ' << offset_from_node(after(p))
+ << ' ' << offset_from_node(after(cp)) << std::endl;
+#endif
+ if (after(p) == cp) {
+#ifdef DEBUG_FALLBACK_MALLOC
+ std::cout << " Appending onto chunk at " << offset_from_node(p)
+ << std::endl;
+#endif
+ p->len = static_cast<heap_size>(
+ p->len + cp->len); // make the free heap_node larger
+ return;
+ } else if (after(cp) == p) { // there's a free heap_node right after
+#ifdef DEBUG_FALLBACK_MALLOC
+ std::cout << " Appending free chunk at " << offset_from_node(p)
+ << std::endl;
+#endif
+ cp->len = static_cast<heap_size>(cp->len + p->len);
+ if (prev == 0) {
+ freelist = cp;
+ cp->next_node = p->next_node;
+ } else
+ prev->next_node = offset_from_node(cp);
+ return;
+ }
+ }
+// Nothing to merge with, add it to the start of the free list
+#ifdef DEBUG_FALLBACK_MALLOC
+ std::cout << " Making new free list entry " << offset_from_node(cp)
+ << std::endl;
+#endif
+ cp->next_node = offset_from_node(freelist);
+ freelist = cp;
+}
+
+#ifdef INSTRUMENT_FALLBACK_MALLOC
+size_t print_free_list() {
+ struct heap_node *p, *prev;
+ heap_size total_free = 0;
+ if (NULL == freelist)
+ init_heap();
+
+ for (p = freelist, prev = 0; p && p != list_end;
+ prev = p, p = node_from_offset(p->next_node)) {
+ std::cout << (prev == 0 ? "" : " ") << "Offset: " << offset_from_node(p)
+ << "\tsize: " << p->len << " Next: " << p->next_node << std::endl;
+ total_free += p->len;
+ }
+ std::cout << "Total Free space: " << total_free << std::endl;
+ return total_free;
+}
+#endif
+} // end unnamed namespace
+
+namespace __cxxabiv1 {
+
+struct __attribute__((aligned)) __aligned_type {};
+
+void* __aligned_malloc_with_fallback(size_t size) {
+#if defined(_WIN32)
+ if (void* dest = _aligned_malloc(size, alignof(__aligned_type)))
+ return dest;
+#elif defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
+ if (void* dest = std::malloc(size))
+ return dest;
+#else
+ if (size == 0)
+ size = 1;
+ void* dest;
+ if (::posix_memalign(&dest, alignof(__aligned_type), size) == 0)
+ return dest;
+#endif
+ return fallback_malloc(size);
+}
+
+void* __calloc_with_fallback(size_t count, size_t size) {
+ void* ptr = std::calloc(count, size);
+ if (NULL != ptr)
+ return ptr;
+ // if calloc fails, fall back to emergency stash
+ ptr = fallback_malloc(size * count);
+ if (NULL != ptr)
+ std::memset(ptr, 0, size * count);
+ return ptr;
+}
+
+void __aligned_free_with_fallback(void* ptr) {
+ if (is_fallback_ptr(ptr))
+ fallback_free(ptr);
+ else {
+#if defined(_WIN32)
+ ::_aligned_free(ptr);
+#else
+ std::free(ptr);
+#endif
+ }
+}
+
+void __free_with_fallback(void* ptr) {
+ if (is_fallback_ptr(ptr))
+ fallback_free(ptr);
+ else
+ std::free(ptr);
+}
+
+} // namespace __cxxabiv1
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.h b/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.h
new file mode 100644
index 00000000000..d6f471483a2
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.h
@@ -0,0 +1,29 @@
+//===------------------------- fallback_malloc.h --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _FALLBACK_MALLOC_H
+#define _FALLBACK_MALLOC_H
+
+#include "__cxxabi_config.h"
+#include <cstddef> // for size_t
+
+namespace __cxxabiv1 {
+
+// Allocate some memory from _somewhere_
+_LIBCXXABI_HIDDEN void * __aligned_malloc_with_fallback(size_t size);
+
+// Allocate and zero-initialize memory from _somewhere_
+_LIBCXXABI_HIDDEN void * __calloc_with_fallback(size_t count, size_t size);
+
+_LIBCXXABI_HIDDEN void __aligned_free_with_fallback(void *ptr);
+_LIBCXXABI_HIDDEN void __free_with_fallback(void *ptr);
+
+} // namespace __cxxabiv1
+
+#endif
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.ipp b/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.ipp
deleted file mode 100644
index 71b65bed888..00000000000
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/fallback_malloc.ipp
+++ /dev/null
@@ -1,188 +0,0 @@
-//===------------------------ fallback_malloc.ipp -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//
-// This file implements the "Exception Handling APIs"
-// http://mentorembedded.github.io/cxx-abi/abi-eh.html
-//
-//===----------------------------------------------------------------------===//
-
-#include "config.h"
-
-// A small, simple heap manager based (loosely) on
-// the startup heap manager from FreeBSD, optimized for space.
-//
-// Manages a fixed-size memory pool, supports malloc and free only.
-// No support for realloc.
-//
-// Allocates chunks in multiples of four bytes, with a four byte header
-// for each chunk. The overhead of each chunk is kept low by keeping pointers
-// as two byte offsets within the heap, rather than (4 or 8 byte) pointers.
-
-namespace {
-
-// When POSIX threads are not available, make the mutex operations a nop
-#if LIBCXXABI_HAS_NO_THREADS
-static void * heap_mutex = 0;
-#else
-static pthread_mutex_t heap_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif
-
-class mutexor {
-public:
-#if LIBCXXABI_HAS_NO_THREADS
- mutexor ( void * ) {}
- ~mutexor () {}
-#else
- mutexor ( pthread_mutex_t *m ) : mtx_(m) { pthread_mutex_lock ( mtx_ ); }
- ~mutexor () { pthread_mutex_unlock ( mtx_ ); }
-#endif
-private:
- mutexor ( const mutexor &rhs );
- mutexor & operator = ( const mutexor &rhs );
-#if !LIBCXXABI_HAS_NO_THREADS
- pthread_mutex_t *mtx_;
-#endif
- };
-
-
-#define HEAP_SIZE 512
-char heap [ HEAP_SIZE ];
-
-typedef unsigned short heap_offset;
-typedef unsigned short heap_size;
-
-struct heap_node {
- heap_offset next_node; // offset into heap
- heap_size len; // size in units of "sizeof(heap_node)"
-};
-
-static const heap_node *list_end = (heap_node *) ( &heap [ HEAP_SIZE ] ); // one past the end of the heap
-static heap_node *freelist = NULL;
-
-heap_node *node_from_offset ( const heap_offset offset )
- { return (heap_node *) ( heap + ( offset * sizeof (heap_node))); }
-
-heap_offset offset_from_node ( const heap_node *ptr )
- { return static_cast<heap_offset>(static_cast<size_t>(reinterpret_cast<const char *>(ptr) - heap) / sizeof (heap_node)); }
-
-void init_heap () {
- freelist = (heap_node *) heap;
- freelist->next_node = offset_from_node ( list_end );
- freelist->len = HEAP_SIZE / sizeof (heap_node);
- }
-
-// How big a chunk we allocate
-size_t alloc_size (size_t len)
- { return (len + sizeof(heap_node) - 1) / sizeof(heap_node) + 1; }
-
-bool is_fallback_ptr ( void *ptr )
- { return ptr >= heap && ptr < ( heap + HEAP_SIZE ); }
-
-void *fallback_malloc(size_t len) {
- heap_node *p, *prev;
- const size_t nelems = alloc_size ( len );
- mutexor mtx ( &heap_mutex );
-
- if ( NULL == freelist )
- init_heap ();
-
-// Walk the free list, looking for a "big enough" chunk
- for (p = freelist, prev = 0;
- p && p != list_end; prev = p, p = node_from_offset ( p->next_node)) {
-
- if (p->len > nelems) { // chunk is larger, shorten, and return the tail
- heap_node *q;
-
- p->len = static_cast<heap_size>(p->len - nelems);
- q = p + p->len;
- q->next_node = 0;
- q->len = static_cast<heap_size>(nelems);
- return (void *) (q + 1);
- }
-
- if (p->len == nelems) { // exact size match
- if (prev == 0)
- freelist = node_from_offset(p->next_node);
- else
- prev->next_node = p->next_node;
- p->next_node = 0;
- return (void *) (p + 1);
- }
- }
- return NULL; // couldn't find a spot big enough
-}
-
-// Return the start of the next block
-heap_node *after ( struct heap_node *p ) { return p + p->len; }
-
-void fallback_free (void *ptr) {
- struct heap_node *cp = ((struct heap_node *) ptr) - 1; // retrieve the chunk
- struct heap_node *p, *prev;
-
- mutexor mtx ( &heap_mutex );
-
-#ifdef DEBUG_FALLBACK_MALLOC
- std::cout << "Freeing item at " << offset_from_node ( cp ) << " of size " << cp->len << std::endl;
-#endif
-
- for (p = freelist, prev = 0;
- p && p != list_end; prev = p, p = node_from_offset (p->next_node)) {
-#ifdef DEBUG_FALLBACK_MALLOC
- std::cout << " p, cp, after (p), after(cp) "
- << offset_from_node ( p ) << ' '
- << offset_from_node ( cp ) << ' '
- << offset_from_node ( after ( p )) << ' '
- << offset_from_node ( after ( cp )) << std::endl;
-#endif
- if ( after ( p ) == cp ) {
-#ifdef DEBUG_FALLBACK_MALLOC
- std::cout << " Appending onto chunk at " << offset_from_node ( p ) << std::endl;
-#endif
- p->len = static_cast<heap_size>(p->len + cp->len); // make the free heap_node larger
- return;
- }
- else if ( after ( cp ) == p ) { // there's a free heap_node right after
-#ifdef DEBUG_FALLBACK_MALLOC
- std::cout << " Appending free chunk at " << offset_from_node ( p ) << std::endl;
-#endif
- cp->len = static_cast<heap_size>(cp->len + p->len);
- if ( prev == 0 ) {
- freelist = cp;
- cp->next_node = p->next_node;
- }
- else
- prev->next_node = offset_from_node(cp);
- return;
- }
- }
-// Nothing to merge with, add it to the start of the free list
-#ifdef DEBUG_FALLBACK_MALLOC
- std::cout << " Making new free list entry " << offset_from_node ( cp ) << std::endl;
-#endif
- cp->next_node = offset_from_node ( freelist );
- freelist = cp;
-}
-
-#ifdef INSTRUMENT_FALLBACK_MALLOC
-size_t print_free_list () {
- struct heap_node *p, *prev;
- heap_size total_free = 0;
- if ( NULL == freelist )
- init_heap ();
-
- for (p = freelist, prev = 0;
- p && p != list_end; prev = p, p = node_from_offset (p->next_node)) {
- std::cout << ( prev == 0 ? "" : " ") << "Offset: " << offset_from_node ( p )
- << "\tsize: " << p->len << " Next: " << p->next_node << std::endl;
- total_free += p->len;
- }
- std::cout << "Total Free space: " << total_free << std::endl;
- return total_free;
- }
-#endif
-} // end unnamed namespace
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.cpp
index df03596e8b6..58a2b0df6c0 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.cpp
@@ -55,12 +55,7 @@
#include <string.h>
#endif
-namespace __cxxabiv1
-{
-
-#pragma GCC visibility push(hidden)
-
-inline
+static inline
bool
is_equal(const std::type_info* x, const std::type_info* y, bool use_strcmp)
{
@@ -73,6 +68,8 @@ is_equal(const std::type_info* x, const std::type_info* y, bool use_strcmp)
#endif
}
+namespace __cxxabiv1
+{
// __shim_type_info
@@ -171,8 +168,12 @@ __pointer_to_member_type_info::~__pointer_to_member_type_info()
// catch (D2& d2) : adjustedPtr == &d2 (d2 is base class of thrown object)
// catch (D2* d2) : adjustedPtr == d2
// catch (D2*& d2) : adjustedPtr == d2
-//
+//
// catch (...) : adjustedPtr == & of the exception
+//
+// If the thrown type is nullptr_t and the caught type is a pointer to
+// member type, adjustedPtr points to a statically-allocated null pointer
+// representation of that type.
// Handles bullet 1
bool
@@ -337,12 +338,11 @@ __vmi_class_type_info::has_unambiguous_public_base(__dynamic_cast_info* info,
}
}
-// Handles bullets 1 and 4 for both pointers and member pointers
+// Handles bullet 1 for both pointers and member pointers
bool
__pbase_type_info::can_catch(const __shim_type_info* thrown_type,
void*&) const
{
- if (is_equal(thrown_type, &typeid(std::nullptr_t), false)) return true;
bool use_strcmp = this->__flags & (__incomplete_class_mask |
__incomplete_mask);
if (!use_strcmp) {
@@ -367,7 +367,13 @@ bool
__pointer_type_info::can_catch(const __shim_type_info* thrown_type,
void*& adjustedPtr) const
{
- // bullets 1 and 4
+ // bullet 4
+ if (is_equal(thrown_type, &typeid(std::nullptr_t), false)) {
+ adjustedPtr = nullptr;
+ return true;
+ }
+
+ // bullet 1
if (__pbase_type_info::can_catch(thrown_type, adjustedPtr)) {
if (adjustedPtr != NULL)
adjustedPtr = *static_cast<void**>(adjustedPtr);
@@ -381,8 +387,10 @@ __pointer_type_info::can_catch(const __shim_type_info* thrown_type,
// Do the dereference adjustment
if (adjustedPtr != NULL)
adjustedPtr = *static_cast<void**>(adjustedPtr);
- // bullet 3B
- if (thrown_pointer_type->__flags & ~__flags)
+ // bullet 3B and 3C
+ if (thrown_pointer_type->__flags & ~__flags & __no_remove_flags_mask)
+ return false;
+ if (__flags & ~thrown_pointer_type->__flags & __no_add_flags_mask)
return false;
if (is_equal(__pointee, thrown_pointer_type->__pointee, false))
return true;
@@ -468,7 +476,22 @@ bool __pointer_type_info::can_catch_nested(
bool __pointer_to_member_type_info::can_catch(
const __shim_type_info* thrown_type, void*& adjustedPtr) const {
- // bullets 1 and 4
+ // bullet 4
+ if (is_equal(thrown_type, &typeid(std::nullptr_t), false)) {
+ // We assume that the pointer to member representation is the same for
+ // all pointers to data members and for all pointers to member functions.
+ struct X {};
+ if (dynamic_cast<const __function_type_info*>(__pointee)) {
+ static int (X::*const null_ptr_rep)() = nullptr;
+ adjustedPtr = const_cast<int (X::**)()>(&null_ptr_rep);
+ } else {
+ static int X::*const null_ptr_rep = nullptr;
+ adjustedPtr = const_cast<int X::**>(&null_ptr_rep);
+ }
+ return true;
+ }
+
+ // bullet 1
if (__pbase_type_info::can_catch(thrown_type, adjustedPtr))
return true;
@@ -476,7 +499,9 @@ bool __pointer_to_member_type_info::can_catch(
dynamic_cast<const __pointer_to_member_type_info*>(thrown_type);
if (thrown_pointer_type == 0)
return false;
- if (thrown_pointer_type->__flags & ~__flags)
+ if (thrown_pointer_type->__flags & ~__flags & __no_remove_flags_mask)
+ return false;
+ if (__flags & ~thrown_pointer_type->__flags & __no_add_flags_mask)
return false;
if (!is_equal(__pointee, thrown_pointer_type->__pointee, false))
return false;
@@ -510,9 +535,6 @@ bool __pointer_to_member_type_info::can_catch_nested(
#pragma clang diagnostic pop
#endif
-#pragma GCC visibility pop
-#pragma GCC visibility push(default)
-
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
@@ -592,13 +614,11 @@ bool __pointer_to_member_type_info::can_catch_nested(
// If there is a public path from (dynamic_ptr, dynamic_type) to
// (static_ptr, static_type), then return dynamic_ptr.
// Else return nullptr.
-extern "C"
-void*
-__dynamic_cast(const void* static_ptr,
- const __class_type_info* static_type,
- const __class_type_info* dst_type,
- std::ptrdiff_t src2dst_offset)
-{
+
+extern "C" _LIBCXXABI_FUNC_VIS void *
+__dynamic_cast(const void *static_ptr, const __class_type_info *static_type,
+ const __class_type_info *dst_type,
+ std::ptrdiff_t src2dst_offset) {
// Possible future optimization: Take advantage of src2dst_offset
// Currently clang always sets src2dst_offset to -1 (no hint).
@@ -689,9 +709,6 @@ __dynamic_cast(const void* static_ptr,
#pragma clang diagnostic pop
#endif
-#pragma GCC visibility pop
-#pragma GCC visibility push(hidden)
-
// Call this function when you hit a static_type which is a base (above) a dst_type.
// Let caller know you hit a static_type. But only start recording details if
// this is (static_ptr, static_type) -- the node we are casting from.
@@ -1274,6 +1291,4 @@ __base_class_type_info::search_below_dst(__dynamic_cast_info* info,
use_strcmp);
}
-#pragma GCC visibility pop
-
} // __cxxabiv1
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.h b/chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.h
index ef98c3ae60b..3922ae6ef56 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.h
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/private_typeinfo.h
@@ -16,7 +16,6 @@
#include <cstddef>
namespace __cxxabiv1 {
-#pragma GCC visibility push(hidden)
class _LIBCXXABI_TYPE_VIS __shim_type_info : public std::type_info {
public:
@@ -67,7 +66,7 @@ enum
class _LIBCXXABI_TYPE_VIS __class_type_info;
-struct __dynamic_cast_info
+struct _LIBCXXABI_HIDDEN __dynamic_cast_info
{
// const data supplied to the search:
@@ -153,7 +152,7 @@ public:
has_unambiguous_public_base(__dynamic_cast_info *, void *, int) const;
};
-struct __base_class_type_info
+struct _LIBCXXABI_HIDDEN __base_class_type_info
{
public:
const __class_type_info* __base_type;
@@ -206,7 +205,22 @@ public:
__volatile_mask = 0x2,
__restrict_mask = 0x4,
__incomplete_mask = 0x8,
- __incomplete_class_mask = 0x10
+ __incomplete_class_mask = 0x10,
+ __transaction_safe_mask = 0x20,
+ // This implements the following proposal from cxx-abi-dev (not yet part of
+ // the ABI document):
+ //
+ // http://sourcerytools.com/pipermail/cxx-abi-dev/2016-October/002986.html
+ //
+ // This is necessary for support of http://wg21.link/p0012, which permits
+ // throwing noexcept function and member function pointers and catching
+ // them as non-noexcept pointers.
+ __noexcept_mask = 0x40,
+
+ // Flags that cannot be removed by a standard conversion.
+ __no_remove_flags_mask = __const_mask | __volatile_mask | __restrict_mask,
+ // Flags that cannot be added by a standard conversion.
+ __no_add_flags_mask = __transaction_safe_mask | __noexcept_mask
};
_LIBCXXABI_HIDDEN virtual ~__pbase_type_info();
@@ -233,8 +247,6 @@ public:
_LIBCXXABI_HIDDEN bool can_catch_nested(const __shim_type_info *) const;
};
-#pragma GCC visibility pop
-
} // __cxxabiv1
#endif // __PRIVATE_TYPEINFO_H_
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_exception.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_exception.cpp
new file mode 100644
index 00000000000..a8f71ab0ecc
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_exception.cpp
@@ -0,0 +1,103 @@
+//===---------------------------- exception.cpp ---------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#define _LIBCPP_BUILDING_LIBRARY
+#define _LIBCPP_BUILDING_NEW
+#include <new>
+#include <exception>
+
+namespace std
+{
+
+// exception
+
+exception::~exception() _NOEXCEPT
+{
+}
+
+const char* exception::what() const _NOEXCEPT
+{
+ return "std::exception";
+}
+
+// bad_exception
+
+bad_exception::~bad_exception() _NOEXCEPT
+{
+}
+
+const char* bad_exception::what() const _NOEXCEPT
+{
+ return "std::bad_exception";
+}
+
+
+// bad_alloc
+
+bad_alloc::bad_alloc() _NOEXCEPT
+{
+}
+
+bad_alloc::~bad_alloc() _NOEXCEPT
+{
+}
+
+const char*
+bad_alloc::what() const _NOEXCEPT
+{
+ return "std::bad_alloc";
+}
+
+// bad_array_new_length
+
+bad_array_new_length::bad_array_new_length() _NOEXCEPT
+{
+}
+
+bad_array_new_length::~bad_array_new_length() _NOEXCEPT
+{
+}
+
+const char*
+bad_array_new_length::what() const _NOEXCEPT
+{
+ return "bad_array_new_length";
+}
+
+// bad_array_length
+
+#ifndef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
+
+class _LIBCPP_EXCEPTION_ABI bad_array_length
+ : public bad_alloc
+{
+public:
+ bad_array_length() _NOEXCEPT;
+ virtual ~bad_array_length() _NOEXCEPT;
+ virtual const char* what() const _NOEXCEPT;
+};
+
+#endif // _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
+
+bad_array_length::bad_array_length() _NOEXCEPT
+{
+}
+
+bad_array_length::~bad_array_length() _NOEXCEPT
+{
+}
+
+const char*
+bad_array_length::what() const _NOEXCEPT
+{
+ return "bad_array_length";
+}
+
+
+} // std
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_new_delete.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_new_delete.cpp
new file mode 100644
index 00000000000..0e85f6ad299
--- /dev/null
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_new_delete.cpp
@@ -0,0 +1,264 @@
+//===--------------------- stdlib_new_delete.cpp --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//
+// This file implements the new and delete operators.
+//===----------------------------------------------------------------------===//
+
+#define _LIBCPP_BUILDING_NEW
+#define _LIBCPP_BUILDING_LIBRARY
+#include "__cxxabi_config.h"
+#include <new>
+#include <cstdlib>
+
+#if !defined(_THROW_BAD_ALLOC) || !defined(_NOEXCEPT) || !defined(_LIBCXXABI_WEAK)
+#error The _THROW_BAD_ALLOC, _NOEXCEPT, and _LIBCXXABI_WEAK libc++ macros must \
+ already be defined by libc++.
+#endif
+// Implement all new and delete operators as weak definitions
+// in this shared library, so that they can be overridden by programs
+// that define non-weak copies of the functions.
+
+_LIBCXXABI_WEAK
+void *
+operator new(std::size_t size) _THROW_BAD_ALLOC
+{
+ if (size == 0)
+ size = 1;
+ void* p;
+ while ((p = ::malloc(size)) == 0)
+ {
+ // If malloc fails and there is a new_handler,
+ // call it to try free up memory.
+ std::new_handler nh = std::get_new_handler();
+ if (nh)
+ nh();
+ else
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ throw std::bad_alloc();
+#else
+ break;
+#endif
+ }
+ return p;
+}
+
+_LIBCXXABI_WEAK
+void*
+operator new(size_t size, const std::nothrow_t&) _NOEXCEPT
+{
+ void* p = 0;
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCXXABI_NO_EXCEPTIONS
+ p = ::operator new(size);
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ }
+#endif // _LIBCXXABI_NO_EXCEPTIONS
+ return p;
+}
+
+_LIBCXXABI_WEAK
+void*
+operator new[](size_t size) _THROW_BAD_ALLOC
+{
+ return ::operator new(size);
+}
+
+_LIBCXXABI_WEAK
+void*
+operator new[](size_t size, const std::nothrow_t&) _NOEXCEPT
+{
+ void* p = 0;
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCXXABI_NO_EXCEPTIONS
+ p = ::operator new[](size);
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ }
+#endif // _LIBCXXABI_NO_EXCEPTIONS
+ return p;
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete(void* ptr) _NOEXCEPT
+{
+ if (ptr)
+ ::free(ptr);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete(void* ptr, const std::nothrow_t&) _NOEXCEPT
+{
+ ::operator delete(ptr);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete(void* ptr, size_t) _NOEXCEPT
+{
+ ::operator delete(ptr);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete[] (void* ptr) _NOEXCEPT
+{
+ ::operator delete(ptr);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete[] (void* ptr, const std::nothrow_t&) _NOEXCEPT
+{
+ ::operator delete[](ptr);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete[] (void* ptr, size_t) _NOEXCEPT
+{
+ ::operator delete[](ptr);
+}
+
+#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATION)
+
+_LIBCXXABI_WEAK
+void *
+operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
+{
+ if (size == 0)
+ size = 1;
+ if (static_cast<size_t>(alignment) < sizeof(void*))
+ alignment = std::align_val_t(sizeof(void*));
+ void* p;
+#if defined(_LIBCPP_WIN32API)
+ while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
+#else
+ while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
+#endif
+ {
+ // If posix_memalign fails and there is a new_handler,
+ // call it to try free up memory.
+ std::new_handler nh = std::get_new_handler();
+ if (nh)
+ nh();
+ else {
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ throw std::bad_alloc();
+#else
+ p = nullptr; // posix_memalign doesn't initialize 'p' on failure
+ break;
+#endif
+ }
+ }
+ return p;
+}
+
+_LIBCXXABI_WEAK
+void*
+operator new(size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+{
+ void* p = 0;
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCXXABI_NO_EXCEPTIONS
+ p = ::operator new(size, alignment);
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ }
+#endif // _LIBCXXABI_NO_EXCEPTIONS
+ return p;
+}
+
+_LIBCXXABI_WEAK
+void*
+operator new[](size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
+{
+ return ::operator new(size, alignment);
+}
+
+_LIBCXXABI_WEAK
+void*
+operator new[](size_t size, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+{
+ void* p = 0;
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ try
+ {
+#endif // _LIBCXXABI_NO_EXCEPTIONS
+ p = ::operator new[](size, alignment);
+#ifndef _LIBCXXABI_NO_EXCEPTIONS
+ }
+ catch (...)
+ {
+ }
+#endif // _LIBCXXABI_NO_EXCEPTIONS
+ return p;
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete(void* ptr, std::align_val_t) _NOEXCEPT
+{
+ if (ptr)
+#if defined(_LIBCPP_WIN32API)
+ ::_aligned_free(ptr);
+#else
+ ::free(ptr);
+#endif
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+{
+ ::operator delete(ptr, alignment);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete(void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
+{
+ ::operator delete(ptr, alignment);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete[] (void* ptr, std::align_val_t alignment) _NOEXCEPT
+{
+ ::operator delete(ptr, alignment);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete[] (void* ptr, std::align_val_t alignment, const std::nothrow_t&) _NOEXCEPT
+{
+ ::operator delete[](ptr, alignment);
+}
+
+_LIBCXXABI_WEAK
+void
+operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
+{
+ ::operator delete[](ptr, alignment);
+}
+
+#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/stdexcept.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_stdexcept.cpp
index bd6789ef227..bd6789ef227 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/stdexcept.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_stdexcept.cpp
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/src/typeinfo.cpp b/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_typeinfo.cpp
index 9313be04a39..9313be04a39 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/src/typeinfo.cpp
+++ b/chromium/buildtools/third_party/libc++abi/trunk/src/stdlib_typeinfo.cpp
diff --git a/chromium/buildtools/third_party/libc++abi/trunk/www/index.html b/chromium/buildtools/third_party/libc++abi/trunk/www/index.html
index bf4f8cf2dbe..66bbb64824e 100644
--- a/chromium/buildtools/third_party/libc++abi/trunk/www/index.html
+++ b/chromium/buildtools/third_party/libc++abi/trunk/www/index.html
@@ -104,7 +104,7 @@
configure CMake using either of the following options.
</p>
<ul>
- <li><code>-DLLVM_CONFIG=path/to/llvm-config</code></li>
+ <li><code>-DLLVM_CONFIG_PATH=path/to/llvm-config</code></li>
<li><code>-DLLVM_PATH=path/to/llvm-source-root</code></li>
</ul>
@@ -112,7 +112,7 @@
<p>To run the tests:</p>
<ul>
- <li><code>make check-libcxxabi</code></li>
+ <li><code>make check-cxxabi</code></li>
</ul>
<p>Note: in a standalone build, the system's libc++ will be used for tests. If
the system's libc++ was statically linked against libc++abi (or linked against
diff --git a/chromium/cc/base/math_util.cc b/chromium/cc/base/math_util.cc
index 53dde152d57..5f7544c0510 100644
--- a/chromium/cc/base/math_util.cc
+++ b/chromium/cc/base/math_util.cc
@@ -7,7 +7,7 @@
#include <algorithm>
#include <cmath>
#include <limits>
-#ifdef __SSE__
+#if defined(ARCH_CPU_X86_FAMILY)
#include <xmmintrin.h>
#endif
@@ -810,7 +810,7 @@ gfx::Vector3dF MathUtil::GetYAxis(const gfx::Transform& transform) {
}
ScopedSubnormalFloatDisabler::ScopedSubnormalFloatDisabler() {
-#ifdef __SSE__
+#if defined(ARCH_CPU_X86_FAMILY)
// Turn on "subnormals are zero" and "flush to zero" CSR flags.
orig_state_ = _mm_getcsr();
_mm_setcsr(orig_state_ | 0x8040);
@@ -818,7 +818,7 @@ ScopedSubnormalFloatDisabler::ScopedSubnormalFloatDisabler() {
}
ScopedSubnormalFloatDisabler::~ScopedSubnormalFloatDisabler() {
-#ifdef __SSE__
+#if defined(ARCH_CPU_X86_FAMILY)
_mm_setcsr(orig_state_);
#endif
}
diff --git a/chromium/cc/base/math_util.h b/chromium/cc/base/math_util.h
index f2c3784b97b..bf3c1813380 100644
--- a/chromium/cc/base/math_util.h
+++ b/chromium/cc/base/math_util.h
@@ -11,6 +11,7 @@
#include <vector>
#include "base/logging.h"
+#include "build/build_config.h"
#include "cc/base/base_export.h"
#include "ui/gfx/geometry/box_f.h"
#include "ui/gfx/geometry/point3_f.h"
@@ -325,7 +326,7 @@ class CC_BASE_EXPORT ScopedSubnormalFloatDisabler {
~ScopedSubnormalFloatDisabler();
private:
-#ifdef __SSE__
+#if defined(ARCH_CPU_X86_FAMILY)
unsigned int orig_state_;
#endif
DISALLOW_COPY_AND_ASSIGN(ScopedSubnormalFloatDisabler);
diff --git a/chromium/cc/ipc/cc_param_traits_macros.h b/chromium/cc/ipc/cc_param_traits_macros.h
index 019a16e127d..4d8104a6a58 100644
--- a/chromium/cc/ipc/cc_param_traits_macros.h
+++ b/chromium/cc/ipc/cc_param_traits_macros.h
@@ -144,6 +144,7 @@ IPC_STRUCT_TRAITS_BEGIN(cc::TransferableResource)
IPC_STRUCT_TRAITS_MEMBER(mailbox_holder)
IPC_STRUCT_TRAITS_MEMBER(read_lock_fences_enabled)
IPC_STRUCT_TRAITS_MEMBER(is_software)
+ IPC_STRUCT_TRAITS_MEMBER(shared_bitmap_sequence_number)
IPC_STRUCT_TRAITS_MEMBER(is_overlay_candidate)
IPC_STRUCT_TRAITS_MEMBER(color_space)
#if defined(OS_ANDROID)
diff --git a/chromium/cc/ipc/struct_traits_unittest.cc b/chromium/cc/ipc/struct_traits_unittest.cc
index 40c402b3dc0..8318cd3dfe5 100644
--- a/chromium/cc/ipc/struct_traits_unittest.cc
+++ b/chromium/cc/ipc/struct_traits_unittest.cc
@@ -1155,6 +1155,7 @@ TEST_F(StructTraitsTest, TransferableResource) {
const uint32_t texture_target = 1337;
const bool read_lock_fences_enabled = true;
const bool is_software = false;
+ const uint32_t shared_bitmap_sequence_number = 123456;
const bool is_overlay_candidate = true;
gpu::MailboxHolder mailbox_holder;
@@ -1171,6 +1172,7 @@ TEST_F(StructTraitsTest, TransferableResource) {
input.mailbox_holder = mailbox_holder;
input.read_lock_fences_enabled = read_lock_fences_enabled;
input.is_software = is_software;
+ input.shared_bitmap_sequence_number = shared_bitmap_sequence_number;
input.is_overlay_candidate = is_overlay_candidate;
mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
TransferableResource output;
@@ -1185,6 +1187,8 @@ TEST_F(StructTraitsTest, TransferableResource) {
output.mailbox_holder.texture_target);
EXPECT_EQ(read_lock_fences_enabled, output.read_lock_fences_enabled);
EXPECT_EQ(is_software, output.is_software);
+ EXPECT_EQ(shared_bitmap_sequence_number,
+ output.shared_bitmap_sequence_number);
EXPECT_EQ(is_overlay_candidate, output.is_overlay_candidate);
}
diff --git a/chromium/cc/ipc/transferable_resource.mojom b/chromium/cc/ipc/transferable_resource.mojom
index ea20a63f826..81696f65aaf 100644
--- a/chromium/cc/ipc/transferable_resource.mojom
+++ b/chromium/cc/ipc/transferable_resource.mojom
@@ -23,12 +23,13 @@ enum ResourceFormat {
struct TransferableResource {
uint32 id;
ResourceFormat format;
- gfx.mojom.BufferFormat buffer_format;
+ gfx.mojom.BufferFormat buffer_format;
uint32 filter;
gfx.mojom.Size size;
gpu.mojom.MailboxHolder mailbox_holder;
bool read_lock_fences_enabled;
bool is_software;
+ uint32 shared_bitmap_sequence_number;
bool is_overlay_candidate;
bool is_backed_by_surface_texture;
bool wants_promotion_hint;
diff --git a/chromium/cc/ipc/transferable_resource_struct_traits.cc b/chromium/cc/ipc/transferable_resource_struct_traits.cc
index ea6c56d3398..b9e9f4ad9fc 100644
--- a/chromium/cc/ipc/transferable_resource_struct_traits.cc
+++ b/chromium/cc/ipc/transferable_resource_struct_traits.cc
@@ -25,6 +25,7 @@ bool StructTraits<cc::mojom::TransferableResourceDataView,
out->filter = data.filter();
out->read_lock_fences_enabled = data.read_lock_fences_enabled();
out->is_software = data.is_software();
+ out->shared_bitmap_sequence_number = data.shared_bitmap_sequence_number();
out->is_overlay_candidate = data.is_overlay_candidate();
#if defined(OS_ANDROID)
out->is_backed_by_surface_texture = data.is_backed_by_surface_texture();
diff --git a/chromium/cc/ipc/transferable_resource_struct_traits.h b/chromium/cc/ipc/transferable_resource_struct_traits.h
index e9964c6fce3..526a7e1252f 100644
--- a/chromium/cc/ipc/transferable_resource_struct_traits.h
+++ b/chromium/cc/ipc/transferable_resource_struct_traits.h
@@ -50,6 +50,11 @@ struct StructTraits<cc::mojom::TransferableResourceDataView,
return resource.is_software;
}
+ static uint32_t shared_bitmap_sequence_number(
+ const cc::TransferableResource& resource) {
+ return resource.shared_bitmap_sequence_number;
+ }
+
static bool is_overlay_candidate(const cc::TransferableResource& resource) {
return resource.is_overlay_candidate;
}
diff --git a/chromium/cc/resources/resource_pool.cc b/chromium/cc/resources/resource_pool.cc
index 5ad2f6a5344..ad6b7faf850 100644
--- a/chromium/cc/resources/resource_pool.cc
+++ b/chromium/cc/resources/resource_pool.cc
@@ -15,6 +15,7 @@
#include "base/strings/stringprintf.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h"
+#include "build/build_config.h"
#include "cc/base/container_util.h"
#include "cc/resources/resource_provider.h"
#include "cc/resources/resource_util.h"
@@ -99,6 +100,12 @@ ResourcePool::ResourcePool(ResourceProvider* resource_provider,
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
this, "cc::ResourcePool", task_runner_.get());
+#if defined(OS_ANDROID)
+ // TODO(ericrk): This feature appears to be causing visual corruption on
+ // certain android devices. Will investigate and re-enable. crbug.com/746931
+ disallow_non_exact_reuse_ = true;
+#endif
+
// Register this component with base::MemoryCoordinatorClientRegistry.
base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this);
}
@@ -118,6 +125,12 @@ ResourcePool::ResourcePool(ResourceProvider* resource_provider,
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
this, "cc::ResourcePool", task_runner_.get());
+#if defined(OS_ANDROID)
+ // TODO(ericrk): This feature appears to be causing visual corruption on
+ // certain android devices. Will investigate and re-enable. crbug.com/746931
+ disallow_non_exact_reuse_ = true;
+#endif
+
// Register this component with base::MemoryCoordinatorClientRegistry.
base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this);
}
diff --git a/chromium/cc/resources/resource_pool.h b/chromium/cc/resources/resource_pool.h
index 33291874d26..18b4f5bdc20 100644
--- a/chromium/cc/resources/resource_pool.h
+++ b/chromium/cc/resources/resource_pool.h
@@ -193,7 +193,7 @@ class CC_EXPORT ResourcePool : public base::trace_event::MemoryDumpProvider,
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
bool evict_expired_resources_pending_ = false;
const base::TimeDelta resource_expiration_delay_;
- const bool disallow_non_exact_reuse_ = false;
+ bool disallow_non_exact_reuse_ = false;
base::WeakPtrFactory<ResourcePool> weak_ptr_factory_;
diff --git a/chromium/cc/resources/resource_provider.cc b/chromium/cc/resources/resource_provider.cc
index 8d5a3fce7fe..002f10a63e1 100644
--- a/chromium/cc/resources/resource_provider.cc
+++ b/chromium/cc/resources/resource_provider.cc
@@ -1799,6 +1799,12 @@ void ResourceProvider::TransferResource(Resource* source,
if (source->type == RESOURCE_TYPE_BITMAP) {
resource->mailbox_holder.mailbox = source->shared_bitmap_id;
resource->is_software = true;
+ if (source->shared_bitmap) {
+ resource->shared_bitmap_sequence_number =
+ source->shared_bitmap->sequence_number();
+ } else {
+ resource->shared_bitmap_sequence_number = 0;
+ }
} else {
DCHECK(source->mailbox().IsValid());
DCHECK(source->mailbox().IsTexture());
diff --git a/chromium/cc/resources/shared_bitmap.cc b/chromium/cc/resources/shared_bitmap.cc
index 2eb128af661..47bc4bf62b6 100644
--- a/chromium/cc/resources/shared_bitmap.cc
+++ b/chromium/cc/resources/shared_bitmap.cc
@@ -15,8 +15,9 @@
namespace cc {
-SharedBitmap::SharedBitmap(uint8_t* pixels, const SharedBitmapId& id)
- : pixels_(pixels), id_(id) {}
+SharedBitmap::SharedBitmap(uint8_t* pixels, const SharedBitmapId& id,
+ uint32_t sequence_number)
+ : pixels_(pixels), id_(id), sequence_number_(sequence_number) {}
SharedBitmap::~SharedBitmap() {
}
diff --git a/chromium/cc/resources/shared_bitmap.h b/chromium/cc/resources/shared_bitmap.h
index 464ac5c6d4c..20be61f92e0 100644
--- a/chromium/cc/resources/shared_bitmap.h
+++ b/chromium/cc/resources/shared_bitmap.h
@@ -22,7 +22,8 @@ GetSharedBitmapGUIDForTracing(const SharedBitmapId& bitmap_id);
class CC_EXPORT SharedBitmap {
public:
- SharedBitmap(uint8_t* pixels, const SharedBitmapId& id);
+ SharedBitmap(uint8_t* pixels, const SharedBitmapId& id,
+ uint32_t sequence_number);
virtual ~SharedBitmap();
@@ -30,6 +31,10 @@ class CC_EXPORT SharedBitmap {
const SharedBitmapId& id() { return id_; }
+ // The sequence number that ClientSharedBitmapManager assigned to this
+ // SharedBitmap.
+ uint32_t sequence_number() const { return sequence_number_; }
+
// Returns true if the size is valid and false otherwise.
static bool SizeInBytes(const gfx::Size& size, size_t* size_in_bytes);
// Dies with a CRASH() if the size can not be represented as a positive number
@@ -46,6 +51,7 @@ class CC_EXPORT SharedBitmap {
private:
uint8_t* pixels_;
SharedBitmapId id_;
+ const uint32_t sequence_number_;
DISALLOW_COPY_AND_ASSIGN(SharedBitmap);
};
diff --git a/chromium/cc/resources/transferable_resource.cc b/chromium/cc/resources/transferable_resource.cc
index 65ac1f6ecfc..1c9fece21bf 100644
--- a/chromium/cc/resources/transferable_resource.cc
+++ b/chromium/cc/resources/transferable_resource.cc
@@ -14,6 +14,7 @@ TransferableResource::TransferableResource()
filter(0),
read_lock_fences_enabled(false),
is_software(false),
+ shared_bitmap_sequence_number(0),
#if defined(OS_ANDROID)
is_backed_by_surface_texture(false),
wants_promotion_hint(false),
diff --git a/chromium/cc/resources/transferable_resource.h b/chromium/cc/resources/transferable_resource.h
index baa40486f8c..2764787fb23 100644
--- a/chromium/cc/resources/transferable_resource.h
+++ b/chromium/cc/resources/transferable_resource.h
@@ -42,6 +42,7 @@ struct CC_EXPORT TransferableResource {
gpu::MailboxHolder mailbox_holder;
bool read_lock_fences_enabled;
bool is_software;
+ uint32_t shared_bitmap_sequence_number;
#if defined(OS_ANDROID)
bool is_backed_by_surface_texture;
bool wants_promotion_hint;
diff --git a/chromium/cc/trees/layer_tree_host_common.cc b/chromium/cc/trees/layer_tree_host_common.cc
index e289a34db08..c7349e828b7 100644
--- a/chromium/cc/trees/layer_tree_host_common.cc
+++ b/chromium/cc/trees/layer_tree_host_common.cc
@@ -263,10 +263,7 @@ int LayerTreeHostCommon::CalculateLayerJitter(LayerImpl* layer) {
return jitter;
}
-enum PropertyTreeOption {
- BUILD_PROPERTY_TREES_IF_NEEDED,
- DONT_BUILD_PROPERTY_TREES
-};
+enum PropertyTreeOption { BUILD_PROPERTY_TREES, DONT_BUILD_PROPERTY_TREES };
static void AddSurfaceToRenderSurfaceList(
RenderSurfaceImpl* render_surface,
@@ -494,11 +491,11 @@ void CalculateDrawPropertiesInternal(
inputs->render_surface_list->clear();
const bool should_measure_property_tree_performance =
- property_tree_option == BUILD_PROPERTY_TREES_IF_NEEDED;
+ property_tree_option == BUILD_PROPERTY_TREES;
LayerImplList visible_layer_list;
switch (property_tree_option) {
- case BUILD_PROPERTY_TREES_IF_NEEDED: {
+ case BUILD_PROPERTY_TREES: {
// The translation from layer to property trees is an intermediate
// state. We will eventually get these data passed directly to the
// compositor.
@@ -665,7 +662,9 @@ void LayerTreeHostCommon::CalculateDrawProperties(
void LayerTreeHostCommon::CalculateDrawPropertiesForTesting(
CalcDrawPropsImplInputsForTesting* inputs) {
- CalculateDrawPropertiesInternal(inputs, BUILD_PROPERTY_TREES_IF_NEEDED);
+ CalculateDrawPropertiesInternal(inputs, inputs->property_trees->needs_rebuild
+ ? BUILD_PROPERTY_TREES
+ : DONT_BUILD_PROPERTY_TREES);
}
PropertyTrees* GetPropertyTrees(Layer* layer) {
diff --git a/chromium/cc/trees/layer_tree_host_common_unittest.cc b/chromium/cc/trees/layer_tree_host_common_unittest.cc
index a26ee7f4559..639bab1206e 100644
--- a/chromium/cc/trees/layer_tree_host_common_unittest.cc
+++ b/chromium/cc/trees/layer_tree_host_common_unittest.cc
@@ -247,20 +247,6 @@ class LayerTreeHostCommonTestBase : public LayerTestCommon::LayerImplTest {
update_layer_list_impl(), property_trees);
}
- void ExecuteCalculateDrawPropertiesWithoutSeparateSurfaces(
- LayerImpl* root_layer) {
- gfx::Size device_viewport_size =
- gfx::Size(root_layer->bounds().width(), root_layer->bounds().height());
- render_surface_list_impl_.reset(new RenderSurfaceList);
-
- DCHECK(!root_layer->bounds().IsEmpty());
- LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
- root_layer, device_viewport_size, render_surface_list_impl_.get());
- inputs.can_adjust_raster_scales = true;
-
- LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs);
- }
-
void ExecuteCalculateDrawPropertiesWithoutAdjustingRasterScales(
LayerImpl* root_layer) {
gfx::Size device_viewport_size =
@@ -10214,5 +10200,63 @@ TEST_F(LayerTreeHostCommonTest, CanAdjustRasterScaleTest) {
EXPECT_EQ(gfx::Rect(10, 10), child->drawable_content_rect());
}
+TEST_F(LayerTreeHostCommonTest, SurfaceContentsScaleChangeWithCopyRequestTest) {
+ LayerImpl* root = root_layer_for_testing();
+ LayerImpl* scale_layer = AddChild<LayerImpl>(root);
+ LayerImpl* copy_layer = AddChild<LayerImpl>(scale_layer);
+ LayerImpl* clip_layer = AddChild<LayerImpl>(copy_layer);
+ LayerImpl* test_layer = AddChild<LayerImpl>(clip_layer);
+
+ root->SetBounds(gfx::Size(150, 150));
+
+ scale_layer->SetBounds(gfx::Size(30, 30));
+ gfx::Transform transform;
+ transform.Scale(5.f, 5.f);
+ scale_layer->test_properties()->transform = transform;
+
+ // Need to persist the render surface after copy request is cleared.
+ copy_layer->test_properties()->force_render_surface = true;
+ copy_layer->test_properties()->copy_requests.push_back(
+ CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback)));
+
+ clip_layer->SetDrawsContent(true);
+ clip_layer->SetMasksToBounds(true);
+ clip_layer->SetBounds(gfx::Size(10, 10));
+
+ test_layer->SetDrawsContent(true);
+ test_layer->SetMasksToBounds(true);
+ test_layer->SetBounds(gfx::Size(20, 20));
+
+ ExecuteCalculateDrawPropertiesWithoutAdjustingRasterScales(root);
+
+ // Check surface with copy request draw properties.
+ EXPECT_EQ(gfx::Rect(50, 50), GetRenderSurface(copy_layer)->content_rect());
+ EXPECT_EQ(gfx::Transform(), GetRenderSurface(copy_layer)->draw_transform());
+ EXPECT_EQ(gfx::RectF(50.0f, 50.0f),
+ GetRenderSurface(copy_layer)->DrawableContentRect());
+
+ // Check test layer draw properties.
+ EXPECT_EQ(gfx::Rect(10, 10), test_layer->visible_layer_rect());
+ EXPECT_EQ(transform, test_layer->DrawTransform());
+ EXPECT_EQ(gfx::Rect(50, 50), test_layer->clip_rect());
+ EXPECT_EQ(gfx::Rect(50, 50), test_layer->drawable_content_rect());
+
+ // Clear the copy request and call UpdateSurfaceContentsScale.
+ host_impl()->active_tree()->property_trees()->effect_tree.ClearCopyRequests();
+ ExecuteCalculateDrawPropertiesWithoutAdjustingRasterScales(root);
+
+ // Check surface draw properties without copy request.
+ EXPECT_EQ(gfx::Rect(10, 10), GetRenderSurface(copy_layer)->content_rect());
+ EXPECT_EQ(transform, GetRenderSurface(copy_layer)->draw_transform());
+ EXPECT_EQ(gfx::RectF(50.0f, 50.0f),
+ GetRenderSurface(copy_layer)->DrawableContentRect());
+
+ // Check test layer draw properties without copy request.
+ EXPECT_EQ(gfx::Rect(10, 10), test_layer->visible_layer_rect());
+ EXPECT_EQ(gfx::Transform(), test_layer->DrawTransform());
+ EXPECT_EQ(gfx::Rect(10, 10), test_layer->clip_rect());
+ EXPECT_EQ(gfx::Rect(10, 10), test_layer->drawable_content_rect());
+}
+
} // namespace
} // namespace cc
diff --git a/chromium/cc/trees/property_tree.cc b/chromium/cc/trees/property_tree.cc
index f450baa7067..ff214e50038 100644
--- a/chromium/cc/trees/property_tree.cc
+++ b/chromium/cc/trees/property_tree.cc
@@ -854,11 +854,19 @@ void EffectTree::UpdateSurfaceContentsScale(EffectNode* effect_node) {
bool use_transform_for_contents_scale =
property_trees()->can_adjust_raster_scales ||
effect_node->has_copy_request;
+ const gfx::Vector2dF old_scale = effect_node->surface_contents_scale;
effect_node->surface_contents_scale =
use_transform_for_contents_scale
? MathUtil::ComputeTransform2dScaleComponents(
transform_tree.ToScreen(transform_node->id), layer_scale_factor)
: gfx::Vector2dF(layer_scale_factor, layer_scale_factor);
+
+ // If surface contents scale changes, draw transforms are no longer valid.
+ // Invalidates the draw transform cache and updates the clip for the surface.
+ if (old_scale != effect_node->surface_contents_scale) {
+ property_trees()->clip_tree.set_needs_update(true);
+ property_trees()->UpdateTransformTreeUpdateNumber();
+ }
}
EffectNode* EffectTree::FindNodeFromElementId(ElementId id) {
diff --git a/chromium/chrome/VERSION b/chromium/chrome/VERSION
index a43540c76c6..e5bd2740dcd 100644
--- a/chromium/chrome/VERSION
+++ b/chromium/chrome/VERSION
@@ -1,4 +1,4 @@
MAJOR=60
MINOR=0
BUILD=3112
-PATCH=70
+PATCH=78
diff --git a/chromium/chrome/app/resources/chromium_strings_ko.xtb b/chromium/chrome/app/resources/chromium_strings_ko.xtb
index f7254f3b73f..2289f5fb856 100644
--- a/chromium/chrome/app/resources/chromium_strings_ko.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_ko.xtb
@@ -268,7 +268,7 @@ Chromium에서 설정을 복구할 수 없습니다.</translation>
<translation id="9022552996538154597">Chromium에 로그인</translation>
<translation id="9036189287518468038">Chromium 앱 런처</translation>
<translation id="9089354809943900324">Chromium이 이전 버전임</translation>
-<translation id="911206726377975832">인터넷 사용정보도 삭제하시겠습니까?</translation>
+<translation id="911206726377975832">인터넷 사용 기록도 삭제하시겠습니까?</translation>
<translation id="918373042641772655"><ph name="USERNAME" />의 연결을 해제하면 이 기기에 저장된 방문 기록, 북마크, 설정 및 Chromium 데이터가 삭제됩니다. Google 계정에 저장된 데이터는 삭제되지 않으며 <ph name="GOOGLE_DASHBOARD_LINK" />Google 대시보드<ph name="END_GOOGLE_DASHBOARD_LINK" />에서 관리될 수 있습니다.</translation>
<translation id="9190841055450128916">Chromium(mDNS-In)</translation>
<translation id="9197815481970649201">이제 Chromium에 로그인되었습니다.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_mr.xtb b/chromium/chrome/app/resources/chromium_strings_mr.xtb
index 82c636787ad..07bb7f328e5 100644
--- a/chromium/chrome/app/resources/chromium_strings_mr.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_mr.xtb
@@ -242,7 +242,7 @@ Chromium आपली सेटिंग्ज पुनर्प्राप्
<translation id="8563206822260884157">Chromium द्वारे व्युत्पन्न केलेला सशक्त संकेतशब्द वापरा</translation>
<translation id="85843667276690461">Chromium वापरून मदत मिळवा</translation>
<translation id="8586442755830160949">Copyright <ph name="YEAR" /> The Chromium लेखक. सर्व हक्क राखीव.</translation>
-<translation id="8590769996813453836">Chromium ला तुमच्या कॉंप्युटरवर धोकादायक सॉफ्टवेअर आढळले आहे. Chromium ते काढून टाकू आणि तुमचा ब्राउझर पुन्हा नीट चालावा यासाठी तुमच्या सेटिंग्ज रीस्टोअर करू शकते.</translation>
+<translation id="8590769996813453836">Chromium ला तुमच्या काँप्युटरवर धोकादायक सॉफ्टवेअर आढळले आहे. Chromium ते काढून टाकू आणि तुमचा ब्राउझर पुन्हा नीट चालावा यासाठी तुमच्या सेटिंग्ज रीस्टोअर करू शकते.</translation>
<translation id="8621669128220841554">अनिर्दिष्ट त्रुटीमुळे स्थापना अयशस्वी झाली. कृपया Chromium पुन्‍हा डाउनलोड करा.</translation>
<translation id="8628626585870903697">Chromium कार्य करण्यासाठी मुद्रण पूर्वावलोकनास आवश्यक असलेले PDF viewer समाविष्ट करीत नाही.</translation>
<translation id="8667808506758191620">आपले <ph name="DEVICE_TYPE" /> अद्ययावत आहे.</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_ar.xtb b/chromium/chrome/app/resources/generated_resources_ar.xtb
index 18441eaeec2..2a6d22e5420 100644
--- a/chromium/chrome/app/resources/generated_resources_ar.xtb
+++ b/chromium/chrome/app/resources/generated_resources_ar.xtb
@@ -3118,7 +3118,7 @@
<translation id="5535941515421698170">إزالة البيانات الحالية من هذا الجهاز أيضًا</translation>
<translation id="5537725057119320332">إرسال</translation>
<translation id="5541687815721799001">استخدام التطبيق</translation>
-<translation id="5542132724887566711">ملف تعريف</translation>
+<translation id="5542132724887566711">الملف التعريفي</translation>
<translation id="5543983818738093899">جارٍ التحقق من الحالة ...</translation>
<translation id="554517032089923082">GTC</translation>
<translation id="5546477470896554111">إدارة مصدر الطاقة...</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_ca.xtb b/chromium/chrome/app/resources/generated_resources_ca.xtb
index 8adaf2ec87f..50c9be23edb 100644
--- a/chromium/chrome/app/resources/generated_resources_ca.xtb
+++ b/chromium/chrome/app/resources/generated_resources_ca.xtb
@@ -825,7 +825,7 @@
<translation id="2193365732679659387">Configuració de confiança</translation>
<translation id="2195729137168608510">Protecció del correu electrònic</translation>
<translation id="2198315389084035571">Xinès simplificat</translation>
-<translation id="219985413780390209">Protegeix-me a mi i al meu dispositiu de llocs perillosos</translation>
+<translation id="219985413780390209">Protegeix-me a mi i al meu dispositiu de llocs web perillosos</translation>
<translation id="220138918934036434">Amaga el botó</translation>
<translation id="2202898655984161076">S'ha produït un problema en enumerar les impressores. Pot ser que algunes impressores no s'hagin registrat correctament a <ph name="CLOUD_PRINT_NAME" />.</translation>
<translation id="2203682048752833055">Motor de cerca utilitzat a la <ph name="BEGIN_LINK" />barra d'adreces<ph name="END_LINK" /></translation>
@@ -2095,7 +2095,7 @@ Del domini <ph name="DOWNLOAD_DOMAIN" /></translation>
<translation id="3950820424414687140">Inicia la sessió</translation>
<translation id="3951872452847539732">Una extensió gestiona la configuració del servidor intermediari de la vostra xarxa.</translation>
<translation id="3954354850384043518">En curs</translation>
-<translation id="3955193568934677022">Permet que els llocs reprodueixin contingut protegit (opció recomanada)</translation>
+<translation id="3955193568934677022">Permet que els llocs web reprodueixin contingut protegit (opció recomanada)</translation>
<translation id="3958088479270651626">Importació de les adreces d'interès i de la configuració</translation>
<translation id="3960566196862329469">ONC</translation>
<translation id="3966072572894326936">Tria una altra carpeta...</translation>
@@ -5466,7 +5466,7 @@ Deseu el fitxer de clau en una ubicació segura. El necessitareu per crear versi
<translation id="9057119625587205566">No hi ha cap impressora a prop</translation>
<translation id="9059868303873565140">Menú d'estat</translation>
<translation id="9064142312330104323">Foto del perfil de Google (s'està carregant)</translation>
-<translation id="9064275926664971810">Activa l'emplenament automàtic per emplenar els formularis amb un sol clic</translation>
+<translation id="9064275926664971810">Activa Emplenament automàtic per emplenar els formularis amb un sol clic</translation>
<translation id="9064939804718829769">S'està transferint...</translation>
<translation id="9065203028668620118">Edita</translation>
<translation id="9066782832737749352">Síntesi de veu</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_de.xtb b/chromium/chrome/app/resources/generated_resources_de.xtb
index 38f146a8154..b0882054596 100644
--- a/chromium/chrome/app/resources/generated_resources_de.xtb
+++ b/chromium/chrome/app/resources/generated_resources_de.xtb
@@ -2226,7 +2226,7 @@ Alle Nutzer müssen sich abmelden, um fortfahren zu können.</translation>
<translation id="4195814663415092787">Zuletzt angesehene Seiten öffnen</translation>
<translation id="4197674956721858839">Auswahl zippen</translation>
<translation id="4200689466366162458">Benutzerdefinierte Wörter</translation>
-<translation id="4200983522494130825">&amp;Neuer Tab</translation>
+<translation id="4200983522494130825">Neuer &amp;Tab</translation>
<translation id="4206144641569145248">Außerirdischer</translation>
<translation id="4206323443866416204">Feedbackbericht</translation>
<translation id="420665587194630159">Diese Erweiterung wird verwaltet und kann nicht entfernt oder deaktiviert werden.</translation>
@@ -3794,7 +3794,7 @@ Drücken Sie eine beliebige Taste, um fortzufahren.</translation>
<translation id="6544215763872433504">Der Webbrowser von Google, für Sie</translation>
<translation id="6545325945815270297">Verwalten Sie Ihre synchronisierten Daten und Geräte über <ph name="BEGIN_LINK" />Chrome Dashboard<ph name="END_LINK" />.</translation>
<translation id="6545665334409411530">Wiederholungsrate</translation>
-<translation id="6545834809683560467">Dienst zur Vervollständigung von Suchanfragen und URLs verwenden, die in die Adressleiste oder die Suchleiste des App Launchers eingegeben werden</translation>
+<translation id="6545834809683560467">Funktion zur Vervollständigung von Suchanfragen und URLs verwenden, die in die Adressleiste oder die Suchleiste des App Launchers eingegeben werden</translation>
<translation id="6546686722964485737">Mit WiMAX-Netzwerk verbinden</translation>
<translation id="6547316139431024316">Für diese Erweiterung keine Warnung mehr</translation>
<translation id="6547354035488017500">Geben Sie mindestens 512 MB Speicherplatz frei oder Ihr Gerät reagiert nicht mehr. Löschen Sie Dateien aus dem Gerätespeicher, um Speicherplatz freizugeben.</translation>
@@ -3817,7 +3817,7 @@ Drücken Sie eine beliebige Taste, um fortzufahren.</translation>
<translation id="657402800789773160">&amp;Diese Seite neu laden</translation>
<translation id="6575134580692778371">Nicht konfiguriert</translation>
<translation id="6575251558004911012">Nachfragen, wenn eine Website auf Ihre Kamera zugreifen möchte (empfohlen)</translation>
-<translation id="6578664922716508575">Synchronisierte Passwörter mit Ihrem Google-Nutzernamen und Ihrem Passwort verschlüsseln</translation>
+<translation id="6578664922716508575">Synchronisierte Passwörter mit meinem Google-Nutzernamen und meinem Passwort verschlüsseln</translation>
<translation id="6580151766480067746">ARC-Version</translation>
<translation id="6580955892089546165">Dank dieser Funktion können Sie schnell auf alle angemeldeten Nutzerkonten zugreifen, ohne ein Passwort eingeben zu müssen.
@@ -4031,7 +4031,7 @@ Nutzen Sie diese Funktion nur mit vertrauenswürdigen Konten.</translation>
<translation id="6922128026973287222">Mit dem Google-Datensparmodus verbrauchen Sie weniger Daten und surfen schneller. Klicken Sie hier, um mehr zu erfahren.</translation>
<translation id="6929555043669117778">Pop-ups weiterhin blockieren</translation>
<translation id="6930242544192836755">Dauer</translation>
-<translation id="6935867720248834680">GMS-Dienste sind nicht verfügbar</translation>
+<translation id="6935867720248834680">GMD sind nicht verfügbar</translation>
<translation id="6937152069980083337">Google Japanese Input (für US-Tastatur)</translation>
<translation id="693807610556624488">Der Schreibvorgang auf das folgende Gerät überschreitet die maximal zulässige Attributlänge: "<ph name="DEVICE_NAME" />".</translation>
<translation id="6939777852457331078">US-amerikanische Workman-Tastatur</translation>
@@ -5457,7 +5457,7 @@ Nachfolgende Benachrichtigungen, Fenster und Dialogfenster werden unter Umständ
<translation id="9034909046124500346">Starten Sie Ihren Computer neu, um den Vorgang abzuschließen</translation>
<translation id="9037008143807155145">https://www.google.com/calendar/render?cid=%s</translation>
<translation id="9037965129289936994">Original anzeigen</translation>
-<translation id="9038649477754266430">Vorhersagedienst zum schnelleren Laden von Seiten verwenden</translation>
+<translation id="9038649477754266430">Vervollständigungsfunktion zum schnelleren Laden von Seiten verwenden</translation>
<translation id="9039663905644212491">PEAP</translation>
<translation id="9039890312082871605">Tabs stummschalten</translation>
<translation id="9040421302519041149">Der Zugriff auf dieses Netzwerk ist geschützt.</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_es.xtb b/chromium/chrome/app/resources/generated_resources_es.xtb
index 206e437b593..c7644384770 100644
--- a/chromium/chrome/app/resources/generated_resources_es.xtb
+++ b/chromium/chrome/app/resources/generated_resources_es.xtb
@@ -284,7 +284,7 @@
<translation id="1408789165795197664">Configuración avanzada</translation>
<translation id="1409390508152595145">Crear usuario supervisado</translation>
<translation id="1410616244180625362">Seguir permitiendo que <ph name="HOST" /> acceda a la cámara</translation>
-<translation id="1413372529771027206">Ha cambiado el teléfono utilizado para Smart Lock. Escribe tu contraseña para actualizar Smart Lock para Chromebook en este dispositivo. La próxima vez solo tendrás que hacer clic en tu imagen para acceder.</translation>
+<translation id="1413372529771027206">Ha cambiado el teléfono utilizado para Smart Lock. Introduce tu contraseña para actualizar Smart Lock para Chromebook en este dispositivo. La próxima vez solo tendrás que hacer clic en tu imagen para acceder.</translation>
<translation id="1414648216875402825">Vas a actualizar a una versión inestable de <ph name="PRODUCT_NAME" /> que incluye funciones que están en desarrollo. Se producirán fallos y errores inesperados. Utiliza esta versión con precaución.</translation>
<translation id="1415990189994829608"><ph name="EXTENSION_NAME" /> (ID de extensión "<ph name="EXTENSION_ID" />") no se puede utilizar en este tipo de sesión.</translation>
<translation id="1416836038590872660">EAP-MD5</translation>
@@ -492,7 +492,7 @@
<translation id="1666058115165804494">Hora de creación</translation>
<translation id="1666288758713846745">Dinámico</translation>
<translation id="1666788816626221136">Tienes certificados registrados que no corresponden a ninguna otra categoría:</translation>
-<translation id="1670399744444387456">Básicas</translation>
+<translation id="1670399744444387456">Básico</translation>
<translation id="1673103856845176271">No se ha podido acceder al archivo por razones de seguridad.</translation>
<translation id="167832068858235403">disminuir volumen</translation>
<translation id="1679068421605151609">Herramientas para desarrolladores</translation>
@@ -1984,7 +1984,7 @@ Si no cambias la configuración predeterminada, <ph name="USER_DISPLAY_NAME" />
<translation id="3801082500826908679">Feroés</translation>
<translation id="3802282970260083766">Ajustes del dispositivo</translation>
<translation id="3803991353670408298">Añade otro método de entrada antes de eliminar este.</translation>
-<translation id="380408572480438692">Habilitar la recopilación de datos de rendimiento ayudará a Google a mejorar el sistema en el futuro. No se enviará ningún dato hasta que no envíes un informe de comentarios (Alt-Mayús-I) e incluyas datos de rendimiento. Puedes volver a esta pantalla para inhabilitar la recopilación de datos en cualquier momento.</translation>
+<translation id="380408572480438692">Habilitar la recogida de datos de rendimiento ayudará a Google a mejorar el sistema en el futuro. No se enviará ningún dato hasta que no envíes un informe de comentarios (Alt-Mayús-I) e incluyas datos de rendimiento. Puedes volver a esta pantalla para inhabilitar la recogida de datos en cualquier momento.</translation>
<translation id="3807249107536149332"><ph name="EXTENSION_NAME" /> (ID de extensión "<ph name="EXTENSION_ID" />") no se puede utilizar en una pantalla de inicio de sesión.</translation>
<translation id="3807747707162121253">&amp;Cancelar</translation>
<translation id="3809280248639369696">Alienígena</translation>
@@ -2680,7 +2680,7 @@ Pulsa cualquier tecla para seguir con la exploración.</translation>
<translation id="4891089016822695758">Foro beta</translation>
<translation id="4893336867552636863">Se eliminarán de forma permanente los datos de navegación del dispositivo.</translation>
<translation id="4898011734382862273">El certificado "<ph name="CERTIFICATE_NAME" />" representa a una entidad emisora de certificados</translation>
-<translation id="4899376560703610051">Tu <ph name="DEVICE_TYPE" /> se ha bloqueado manualmente. Deberás escribir tu contraseña para acceder.</translation>
+<translation id="4899376560703610051">Tu <ph name="DEVICE_TYPE" /> se ha bloqueado manualmente. Deberás introducir tu contraseña para acceder.</translation>
<translation id="4900392736118574277">Tu página de inicio ha cambiado a <ph name="URL" />.</translation>
<translation id="490074449735753175">Utilizar un servicio web para revisar la ortografía</translation>
<translation id="49027928311173603">La política que has descargado del servidor no es válida (<ph name="VALIDATION_ERROR" />).</translation>
@@ -3794,7 +3794,7 @@ Exponente público (<ph name="PUBLIC_EXPONENT_NUM_BITS" /> bits):
<translation id="6531282281159901044">Conservar archivo peligroso</translation>
<translation id="6534583978616527129">Iniciar la conexión</translation>
<translation id="6537749439188020683">Conexión mediante dispositivo portátil</translation>
-<translation id="654039047105555694"><ph name="BEGIN_BOLD" />Nota:<ph name="END_BOLD" /> Habilita esta opción solo si tienes conciencia de los efectos de esta acción o si se te ha pedido que lo hagas, ya que la recopilación de datos puede reducir el rendimiento.</translation>
+<translation id="654039047105555694"><ph name="BEGIN_BOLD" />Nota:<ph name="END_BOLD" /> Habilita esta opción solo si tienes conciencia de los efectos de esta acción o si se te ha pedido que lo hagas, ya que la recogida de datos puede reducir el rendimiento.</translation>
<translation id="654233263479157500">Utilizar un servicio web para intentar resolver errores de navegación</translation>
<translation id="6544215763872433504">El navegador web de Google a tu disposición</translation>
<translation id="6545325945815270297">Administra tus dispositivos y datos sincronizados en el <ph name="BEGIN_LINK" />Panel de Control de Chrome<ph name="END_LINK" />.</translation>
@@ -4215,7 +4215,7 @@ Solo debes usar esta función con las cuentas de confianza.</translation>
<translation id="719009910964971313">Teclado Programmer Dvorak de EE. UU.</translation>
<translation id="7191454237977785534">Guardar archivo como</translation>
<translation id="7196835305346730603">Buscando Chromebox cercanos…</translation>
-<translation id="7198197644913728186">El Bluetooth está desactivado en este <ph name="DEVICE_TYPE" />. Escribe tu contraseña para acceder y activa el Bluetooth.</translation>
+<translation id="7198197644913728186">El Bluetooth está desactivado en este <ph name="DEVICE_TYPE" />. Introduce tu contraseña para acceder y activa el Bluetooth.</translation>
<translation id="7199158086730159431">Obtener a&amp;yuda</translation>
<translation id="7201354769043018523">Paréntesis de cierre</translation>
<translation id="7205869271332034173">SSID:</translation>
@@ -4462,7 +4462,7 @@ Solo debes usar esta función con las cuentas de confianza.</translation>
<translation id="7551643184018910560">Fijar en la estantería</translation>
<translation id="7553242001898162573">Introduce tu contraseña</translation>
<translation id="7554791636758816595">Nueva pestaña</translation>
-<translation id="7556033326131260574">Smart Lock no ha podido verificar tu cuenta. Escribe la contraseña para acceder.</translation>
+<translation id="7556033326131260574">Smart Lock no ha podido verificar tu cuenta. Introduce la contraseña para acceder.</translation>
<translation id="7556242789364317684">Lamentablemente, <ph name="SHORT_PRODUCT_NAME" /> no puede recuperar tu configuración. Para solucionar el error, <ph name="SHORT_PRODUCT_NAME" /> debe restablecer tu dispositivo con Powerwash.</translation>
<translation id="7558050486864662801">Preguntar cuando un sitio necesite acceder a tu micrófono (recomendado)</translation>
<translation id="7559719679815339381">Por favor, espera... La aplicación de kiosco se está actualizando. No extraigas el dispositivo USB.</translation>
@@ -4728,7 +4728,7 @@ Solo debes usar esta función con las cuentas de confianza.</translation>
<translation id="7966241909927244760">C&amp;opiar dirección de imagen</translation>
<translation id="7967437925638594022">Extensiones y aplicaciones</translation>
<translation id="7968742106503422125">Leer y modificar los datos que se copian y se pegan</translation>
-<translation id="7968833647796919681">Habilitar recopilación de datos de rendimiento</translation>
+<translation id="7968833647796919681">Habilitar recogida de datos de rendimiento</translation>
<translation id="7969525169268594403">Esloveno</translation>
<translation id="7972714317346275248">PKCS #1 SHA-384 con cifrado RSA</translation>
<translation id="7973320858902175766">Aplicador de parches para componentes</translation>
@@ -5233,7 +5233,7 @@ Calculando el tiempo de carga completa</translation>
<translation id="8708671767545720562">&amp;Más información</translation>
<translation id="8710187907779883426">breve (1 s)</translation>
<translation id="8711402221661888347">Hamburguesa</translation>
-<translation id="8711453844311572806">Si el teléfono está desbloqueado y se encuentra cerca, solo tienes que hacer clic para acceder. De lo contrario, se mostrará un icono de bloqueo y deberás escribir la contraseña.</translation>
+<translation id="8711453844311572806">Si el teléfono está desbloqueado y se encuentra cerca, solo tienes que hacer clic para acceder. De lo contrario, se mostrará un icono de bloqueo y deberás introducir la contraseña.</translation>
<translation id="8713570323158206935">Enviar <ph name="BEGIN_LINK1" />información del sistema<ph name="END_LINK1" /></translation>
<translation id="871476437400413057">Contraseñas guardadas de Google</translation>
<translation id="8714838604780058252">Gráficos de fondo</translation>
@@ -5532,7 +5532,7 @@ Puede que las notificaciones, las ventanas y los cuadros de diálogo que aparezc
<translation id="9137013805542155359">Mostrar original</translation>
<translation id="913758436357682283">Teclado birmano myansan</translation>
<translation id="9137916601698928395">Abrir enlace como <ph name="USER" /></translation>
-<translation id="9138978632494473300">Añadir combinaciones de teclas a las siguientes ubicaciones:</translation>
+<translation id="9138978632494473300">Añadir accesos directos a las siguientes ubicaciones:</translation>
<translation id="9147392381910171771">&amp;Opciones</translation>
<translation id="9148058034647219655">Salir</translation>
<translation id="9148126808321036104">Volver a iniciar sesión</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_fa.xtb b/chromium/chrome/app/resources/generated_resources_fa.xtb
index ddb96e5946b..93d40502042 100644
--- a/chromium/chrome/app/resources/generated_resources_fa.xtb
+++ b/chromium/chrome/app/resources/generated_resources_fa.xtb
@@ -3422,7 +3422,7 @@
<translation id="6003177993629630467"><ph name="PRODUCT_NAME" /> ممکن است نتواند خود را به روز نگه دارد.</translation>
<translation id="600424552813877586">برنامه کاربردی نامعتبر است.</translation>
<translation id="6005282720244019462">صفحه‌کلید لاتین آمریکایی</translation>
-<translation id="6005695835120147974">مسیریاب رسانه</translation>
+<translation id="6005695835120147974">رهیاب رسانه</translation>
<translation id="6006484371116297560">کلاسيک</translation>
<translation id="6007237601604674381">انتقال انجام نشد. <ph name="ERROR_MESSAGE" /></translation>
<translation id="6010869025736512584">در حال دسترسی به ورودی ویدئویی</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_hi.xtb b/chromium/chrome/app/resources/generated_resources_hi.xtb
index 3aa126f7456..2c7336842be 100644
--- a/chromium/chrome/app/resources/generated_resources_hi.xtb
+++ b/chromium/chrome/app/resources/generated_resources_hi.xtb
@@ -60,7 +60,7 @@
<translation id="1079766198702302550">कैमरा एक्सेस हमेशा अवरुद्ध करें</translation>
<translation id="1082398631555931481"><ph name="THIRD_PARTY_TOOL_NAME" /> आपकी Chrome सेटिंग को उनके मूल डिफ़ॉल्ट पर पुनः स्थापित करना चाहता है. इससे आपका होमपेज, नया टैब पेज और खोज इंजन रीसेट हो जाएंगे, आपके एक्सटेंशन अक्षम हो जाएंगे और सभी टैब अनपिन हो जाएंगे. इससे अन्य अस्‍थायी और संचित डेटा, जैसे कुकी, सामग्री और साइट डेटा भी साफ़ हो जाएगा.</translation>
<translation id="1082725763867769612">ऑफ़लाइन फ़ाइलें</translation>
-<translation id="1084824384139382525">लिंक के &amp;पते की प्रतिलिपि बनाएं</translation>
+<translation id="1084824384139382525">लिंक के &amp;पते की कॉपी बनाएं</translation>
<translation id="1090126737595388931">कोई पृष्ठभूमि ऐप्स चालू नहीं है</translation>
<translation id="1091767800771861448">छोड़ने के लिए ESCAPE दबाएं (केवल गैर-आधिकारिक बिल्ड).</translation>
<translation id="1093457606523402488">दृश्‍यमान नेटवर्क:</translation>
@@ -116,7 +116,7 @@
<translation id="1171135284592304528">ऑब्जेक्ट के बदलने पर उसे कीबोर्ड फ़ोकस के साथ हाइलाइट करें</translation>
<translation id="1173894706177603556">नाम बदलें</translation>
<translation id="1175364870820465910">&amp;प्रिंट करें...</translation>
-<translation id="117624967391683467"><ph name="FILE_NAME" /> की प्रतिलिपि बन रही है...</translation>
+<translation id="117624967391683467"><ph name="FILE_NAME" /> की कॉपी बन रही है...</translation>
<translation id="1177863135347784049">कस्टम</translation>
<translation id="1178581264944972037">पॉज़ करें</translation>
<translation id="1179803038870941185"><ph name="URL" /> आपके MIDI डिवाइस का पूर्ण नियंत्रण प्राप्त करना चाहता है.</translation>
@@ -346,7 +346,7 @@
<translation id="1497897566809397301">स्थानीय डेटा को सेट होने की अनुमति दें (सुझाये गये) </translation>
<translation id="1500297251995790841">अज्ञात डिवाइस [<ph name="VENDOR_ID" />:<ph name="PRODUCT_ID" />]</translation>
<translation id="1503394326855300303">किसी एकाधिक प्रवेश सत्र में इस मालिक खाते को पहला प्रवेश खाता होना चाहिए.</translation>
-<translation id="1503914375822320413">प्रतिलिपि बनाने का कार्य विफल रहा, अप्रत्याशित गड़बड़ी: $1</translation>
+<translation id="1503914375822320413">कॉपी बनाने का कार्य विफल रहा, अप्रत्याशित गड़बड़ी: $1</translation>
<translation id="150411034776756821"><ph name="SITE" /> को निकालें</translation>
<translation id="1504682556807808151">क्या आप चाहते हैं कि इस साइट के लिए <ph name="PASSWORD_MANAGER_BRAND" /> आपका पासवर्ड सहेजे?</translation>
<translation id="1506061864768559482">खोज इंजन</translation>
@@ -594,7 +594,7 @@
<translation id="1818196664359151069">रिज़ॉल्यूशन:</translation>
<translation id="1825832322945165090">डिवाइस पर पर्याप्‍त स्‍थान नहीं है</translation>
<translation id="1826516787628120939">जांच की जा रही है</translation>
-<translation id="1828149253358786390"><ph name="SITE" /> आपको नोटिफिकेशन भेजना चाहती है.</translation>
+<translation id="1828149253358786390"><ph name="SITE" /> आपको नोटिफ़िकेशन भेजना चाहती है.</translation>
<translation id="1828378091493947763">यह प्लग इन इस डिवाइस पर समर्थित नहीं है</translation>
<translation id="1828901632669367785">सिस्‍टम डॉयलॉग का उपयोग करके प्रिंट करें…</translation>
<translation id="1829192082282182671">ज़ूम &amp;आउट करें</translation>
@@ -647,7 +647,7 @@
<translation id="1903219944620007795">लेख इनपुट के लिए, उपलब्‍ध इनपुट पद्धतियां देखने के लिए किसी भाषा को चुनें.</translation>
<translation id="1905710495812624430">अधिकतम स्वीकार्य प्रयासों की सीमा पार हो गई है.</translation>
<translation id="1909880997794698664">क्या आप वाकई इस डिवाइस को स्थायी रूप से कियोस्क मोड में रखना चाहते हैं?</translation>
-<translation id="1910572251697014317">Google ने इस फ़ोन पर एक नोटिफिकेशन भेजा है. ध्‍यान रखें कि ब्‍लूटूथ के साथ, आपका फ़ोन 100 फ़ीट से अधिक दूरी से आपके <ph name="DEVICE_TYPE" /> को अनलॉक बनाए रख सकता है. ऐसी स्‍थितियों में, जहां इसके कारण समस्‍या हो सकती है, आप &lt;a&gt;इस सुविधा को अस्‍थायी रूप से अक्षम कर सकते हैं&lt;/a&gt;.</translation>
+<translation id="1910572251697014317">Google ने इस फ़ोन पर एक नोटिफ़िकेशन भेजा है. ध्‍यान रखें कि ब्‍लूटूथ के साथ, आपका फ़ोन 100 फ़ीट से अधिक दूरी से आपके <ph name="DEVICE_TYPE" /> को अनलॉक बनाए रख सकता है. ऐसी स्‍थितियों में, जहां इसके कारण समस्‍या हो सकती है, आप &lt;a&gt;इस सुविधा को अस्‍थायी रूप से अक्षम कर सकते हैं&lt;/a&gt;.</translation>
<translation id="1910721550319506122">आपका स्वागत है!</translation>
<translation id="1916502483199172559">डिफ़ॉल्ट लाल अवतार</translation>
<translation id="191688485499383649">"<ph name="DEVICE_NAME" />" से कनेक्ट करने का प्रयास करते समय एक अज्ञात गड़बड़ी आई.</translation>
@@ -799,7 +799,7 @@
<translation id="2150661552845026580">"<ph name="EXTENSION_NAME" />" जोड़ें?</translation>
<translation id="2151576029659734873">अमान्य टैब अनुक्रमणिका दर्ज की गई.</translation>
<translation id="2152580633399033274">सभी चित्र दिखाएं (सुझाये गये) </translation>
-<translation id="2154710561487035718">URL की प्रतिलिपि बनाएं</translation>
+<translation id="2154710561487035718">URL की कॉपी बनाएं</translation>
<translation id="2155931291251286316"><ph name="HOST" /> से पॉप-अप को हमेशा अनुमति दें</translation>
<translation id="215753907730220065">पूर्ण स्क्रीन से बाहर निकलें</translation>
<translation id="2157875535253991059">यह पेज अब पूर्ण स्‍क्रीन है.</translation>
@@ -1216,7 +1216,7 @@
<translation id="2739191690716947896">डीबग</translation>
<translation id="2739240477418971307">अपनी पहुंच-योग्यता सेटिंग बदलें</translation>
<translation id="2740393541869613458">निगरानी में रखे गए उपयोगकर्ता द्वारा देखी गई वेबसाइटों की समीक्षा करें, और</translation>
-<translation id="2743387203779672305">क्लिपबोर्ड पर प्रतिलिपि बनाएं</translation>
+<translation id="2743387203779672305">क्लिपबोर्ड में कॉपी करें</translation>
<translation id="2744221223678373668">साझा किए गए</translation>
<translation id="2745080116229976798">Microsoft Qualified Subordination</translation>
<translation id="2749756011735116528"><ph name="PRODUCT_NAME" /> में प्रवेश करें</translation>
@@ -1417,7 +1417,7 @@
<translation id="3004391367407090544">कृपया बाद में वापस आएं</translation>
<translation id="300544934591011246">पिछला पासवर्ड</translation>
<translation id="3007214526293698309">अनुपात ठीक करें</translation>
-<translation id="3007771295016901659">डुप्लिकेट टैब</translation>
+<translation id="3007771295016901659">डुप्लीकेट टैब</translation>
<translation id="3009300415590184725">क्‍या आप वाकई मोबाइल डेटा सेवा सेटअप प्रक्रिया को रद्द करना चाहते हैं?</translation>
<translation id="3009779501245596802">अनुक्रमित डेटाबेस</translation>
<translation id="3010279545267083280">पासवर्ड हटा दिया गया</translation>
@@ -1491,7 +1491,7 @@
<translation id="308903551226753393">अपने आप कॉन्फ़िगर करें</translation>
<translation id="3089231390674410424">ऐसा लगता है कि आपके क्रेडेंशियल में कोई समस्या है. कृपया सुनिश्चित करें कि आपने ठीक तरह से प्रवेश किया हुआ है और पुनः प्रयास करें.</translation>
<translation id="3090193911106258841">ऑडियो और वीडियो इनपुट ऐक्सेस हो रहा है</translation>
-<translation id="3090819949319990166">बाहरी crx फ़ाइल की <ph name="TEMP_CRX_FILE" /> में प्रतिलिपि नहीं बनाई जा सकती.</translation>
+<translation id="3090819949319990166">बाहरी crx फ़ाइल की <ph name="TEMP_CRX_FILE" /> में कॉपी नहीं बनाई जा सकती.</translation>
<translation id="3090871774332213558">"<ph name="DEVICE_NAME" />" युग्मित किया गया</translation>
<translation id="3095995014811312755">वर्शन</translation>
<translation id="3097628171361913691">ज़िप फ़ाइल इंस्‍टॉलर</translation>
@@ -1749,7 +1749,7 @@
<translation id="3468522857997926824"><ph name="FILE_COUNT" /> फ़ोटो का <ph name="BEGIN_LINK" />Google डिस्‍क<ph name="END_LINK" /> में बैक अप लिया गया</translation>
<translation id="3468745736289470383">अपनी स्क्रीन साझा करें</translation>
<translation id="3470442499439619530">इस उपयोगकर्ता को निकालें</translation>
-<translation id="3470502288861289375">प्रतिलिपि किया जा रहा है...</translation>
+<translation id="3470502288861289375">कॉपी किया जा रहा है...</translation>
<translation id="3473479545200714844">स्क्रीन आवर्द्धक</translation>
<translation id="3475447146579922140">Google spreadsheet</translation>
<translation id="3475843873335999118">माफ़ कीजिए, आपके फ़िंगरप्रिंट की अभी भी पहचान नहीं हुई हैैै. कृपया अपना पासवर्ड डालें.</translation>
@@ -1775,7 +1775,7 @@
<translation id="3507421388498836150">"<ph name="EXTENSION_NAME" />" के लिए वर्तमान अनुमतियां</translation>
<translation id="3508920295779105875">कोई अन्य फ़ोल्डर चुनें...</translation>
<translation id="3510797500218907545">WiMAX</translation>
-<translation id="3511307672085573050">लिंक के प&amp;ते की प्रतिलिपि बनाएं</translation>
+<translation id="3511307672085573050">लिंक के प&amp;ते की कॉपी बनाएं</translation>
<translation id="3511399794969432965">कनेक्‍ट करने में समस्‍या है?</translation>
<translation id="351152300840026870">निश्चित-चौड़ाई फ़ॉन्ट</translation>
<translation id="3511528412952710609">कम</translation>
@@ -2312,7 +2312,7 @@
<translation id="4333854382783149454">RSA सुरक्षित तरीका के साथ PKCS #1 SHA-1</translation>
<translation id="4335713051520279344">यह कंप्यूटर 1 सेकंड में रीसेट हो जाएगा.
अन्वेषण जारी रखने के लिए कोई भी कुंजी दबाएं.</translation>
-<translation id="4336032328163998280">प्रतिलिपि बनाने का कार्य विफल रहा. <ph name="ERROR_MESSAGE" /></translation>
+<translation id="4336032328163998280">कॉपी बनाने का कार्य विफल रहा. <ph name="ERROR_MESSAGE" /></translation>
<translation id="4336979451636460645">नेटवर्क लॉग के लिए, देखें: <ph name="DEVICE_LOG_LINK" /></translation>
<translation id="4337028641069424358">Android ऐप्लिकेशन डाउनलोड करने और उनका उपयोग करने के लिए, आपको सबसे पहले एक अपडेट इंस्टॉल करना होगा. जब आपका डिवाइस अपडेट हो रहा हो, तब आप उसका उपयोग नहीं कर सकते हैं. इंस्टॉलेशन पूरा हो जाने के बाद आपका <ph name="DEVICE_TYPE" /> फिर से चालू होगा.</translation>
<translation id="4340515029017875942"><ph name="ORIGIN" /> "<ph name="EXTENSION_NAME" />" से संचार करना चाहती है</translation>
@@ -2330,7 +2330,7 @@
<translation id="4363771538994847871">कोई कास्ट गंतव्य नहीं मिला. सहायता चाहिए?</translation>
<translation id="4364444725319685468"><ph name="FILE_NAME" /> डाउनलोड किया गया</translation>
<translation id="4364567974334641491"><ph name="APP_NAME" /> किसी विंडो को साझा कर रहा है.</translation>
-<translation id="4364830672918311045">प्रदर्शन नोटिफिकेशन</translation>
+<translation id="4364830672918311045">प्रदर्शन नोटिफ़िकेशन</translation>
<translation id="4365673000813822030">ओह, समन्‍वयन ने कार्य करना बंद कर दिया.</translation>
<translation id="4370975561335139969">आपके द्वारा डाले गए ईमेल और पासवर्ड का मिलान नहीं हो रहा</translation>
<translation id="437184764829821926">उन्नत फ़ॉन्ट सेटिंग</translation>
@@ -2761,7 +2761,7 @@
<translation id="5027550639139316293">ईमेल प्रमाणपत्र</translation>
<translation id="5027562294707732951">एक्‍सटेंशन जोड़ें</translation>
<translation id="5028012205542821824">इंस्टॉलेशन सक्षम नहीं है.</translation>
-<translation id="5029568752722684782">स्‍पष्‍ट प्रतिलिपि</translation>
+<translation id="5029568752722684782">स्‍पष्‍ट कॉपी</translation>
<translation id="5030338702439866405">जारीकर्ता</translation>
<translation id="5034510593013625357">होस्‍टनाम आकार</translation>
<translation id="5036662165765606524">किसी भी साइट को स्वचालित रूप से एकाधिक फ़ाइलें डाउनलोड न करने दें</translation>
@@ -3441,7 +3441,7 @@
<translation id="6020431688553761150">सर्वर ने इस स्रोत को एक्सेस करने के लिए आपको प्राधिकृत नहीं किया था.</translation>
<translation id="602251597322198729">साइट अनेक फ़ाइलों को डाउनलोड करने का प्रयास कर रही है. क्या आप इसकी अनुमति देना चाहते हैं?</translation>
<translation id="6022526133015258832">पूर्ण स्‍क्रीन खोलें</translation>
-<translation id="602369534869631690">इन नोटिफिकेशन को बंद करें</translation>
+<translation id="602369534869631690">इन नोटिफ़िकेशन को बंद करें</translation>
<translation id="6025215716629925253">स्टैक ट्रेस</translation>
<translation id="6026819612896463875"><ph name="WINDOW_TITLE" /> - USB डिवाइस कनेक्ट है</translation>
<translation id="6032912588568283682">फ़ाइल सिस्टम</translation>
@@ -3976,7 +3976,7 @@
<translation id="6820687829547641339">Gzip संकुचित tar संग्रह</translation>
<translation id="682123305478866682">डेस्कटॉप कास्ट करें</translation>
<translation id="6823506025919456619">आपको अपने डिवाइस को देखने के लिए Chrome में प्रवेश करने की आवश्यकता है</translation>
-<translation id="6824564591481349393">&amp;ईमेल पते की प्रतिलिपि बनाएं</translation>
+<translation id="6824564591481349393">&amp;ईमेल पते की कॉपी बनाएं</translation>
<translation id="6824725898506587159">भाषाएं प्रबंधित करें</translation>
<translation id="6825883775269213504">रूसी</translation>
<translation id="6827236167376090743">यह वीडियो शाम होने तक चलता रहेगा.</translation>
@@ -4020,7 +4020,7 @@
<translation id="6885771755599377173">सिस्टम जानकारी पूर्वावलोकन</translation>
<translation id="6886871292305414135">नए &amp;टैब में लिंक खोलें</translation>
<translation id="6892812721183419409">लिंक को <ph name="USER" /> के रूप में खोलें</translation>
-<translation id="6896758677409633944">प्रतिलिपि बनाएं</translation>
+<translation id="6896758677409633944">कॉपी बनाएं</translation>
<translation id="6898440773573063262">किओस्क ऐप्लिकेशन अब इस डिवाइस पर स्वत: लॉन्च होने के लिए कॉन्फ़िगर किए जा सकते हैं.</translation>
<translation id="6898699227549475383">संगठन (O)</translation>
<translation id="6900284862687837908">पृष्ठभूमि ऐप: <ph name="BACKGROUND_APP_URL" /></translation>
@@ -4234,7 +4234,7 @@
<translation id="7219989745826083607">डायल डिवाइस विवरण पार्सर</translation>
<translation id="722055596168483966">Google सेवाओं को वैयक्तिकृत करें</translation>
<translation id="7221155467930685510">$1 GB</translation>
-<translation id="7221855153210829124">नोटिफिकेशन दिखाएं</translation>
+<translation id="7221855153210829124">नोटिफ़िकेशन दिखाएं</translation>
<translation id="7221869452894271364">यह पेज फिर से लोड करें</translation>
<translation id="7222232353993864120">ईमेल पता</translation>
<translation id="7222373446505536781">F11</translation>
@@ -4263,7 +4263,7 @@
<translation id="7255935316994522020">लागू करें</translation>
<translation id="7256405249507348194">अपरिचित गड़बड़ी: <ph name="DESC" /></translation>
<translation id="7256710573727326513">टैब में खोलें</translation>
-<translation id="7257666756905341374">प्रतिलिपि बनाया और चिपकाया जाने वाला डेटा पढ़ें</translation>
+<translation id="7257666756905341374">कॉपी बनाया और चिपकाया जाने वाला डेटा पढ़ें</translation>
<translation id="7262004276116528033">यह प्रवेश सेवा <ph name="SAML_DOMAIN" /> द्वारा होस्‍ट की गई है</translation>
<translation id="7262221505565121">सैंडबॉक्स नहीं किए गए प्लग इन एेक्सेस अपवाद</translation>
<translation id="7264275118036872269">ब्लूटूथ डिवाइस का अन्‍वेषण प्रारंभ करने में विफल.</translation>
@@ -4679,7 +4679,7 @@
<translation id="7882358943899516840">प्रदाता का प्रकार</translation>
<translation id="7885253890047913815">हाल ही के गंतव्य</translation>
<translation id="7887192723714330082">स्‍क्रीन के चालू होने तथा अनलॉक होने पर "Ok Google" को प्रतिक्रिया दें</translation>
-<translation id="7887334752153342268">डुप्लिकेट</translation>
+<translation id="7887334752153342268">डुप्लीकेट</translation>
<translation id="7887864092952184874">ब्लूटूथ माउस युग्मित किया गया</translation>
<translation id="7892100671754994880">अगला उपयोगकर्ता</translation>
<translation id="7893008570150657497">आपके कंप्यूटर के फ़ोटो, संगीत, और अन्य मीडिया तक पहुंचें</translation>
@@ -5012,11 +5012,11 @@
<translation id="8366396658833131068">आपकी नेटवर्क कनेक्टिविटी पुनर्स्थापित हो गई है. कृपया अपना किओस्क ऐप्स लॉन्च करने के लिए भिन्न नेटवर्क चुनें या नीचे दिया गया 'जारी रखें' बटन दबाएं.</translation>
<translation id="8368859634510605990">सभी बुकमार्क &amp;खोलें</translation>
<translation id="8372369524088641025">ख़राब WEP कुंजी</translation>
-<translation id="8373360586245335572">सभी साइटों को नोटिफिकेशन दिखाने की अनुमति दें</translation>
+<translation id="8373360586245335572">सभी साइटों को नोटिफ़िकेशन दिखाने की अनुमति दें</translation>
<translation id="8373553483208508744">टैब की आवाज़ बंद करें</translation>
<translation id="8378285435971754261">Google की स्थान सेवा को आपका स्थान, तेज़ी से और सटीकता से ढूंढने में ऐप्लिकेशन की सहायता करने दें, जिससे बैटरी की खपत कम हो सकती है. अनाम स्थान डेटा Google को भेजा जाएगा, भले ही कोई भी ऐप्लिकेशन नहीं चल रहा हो. <ph name="BEGIN_LINK1" />अधिक जानें<ph name="END_LINK1" /></translation>
<translation id="8381179624334829711">कैमरा सेटिंग प्रबंधित करें...</translation>
-<translation id="8382913212082956454">ईमेल पते की प्रतिलिपि बनाएं</translation>
+<translation id="8382913212082956454">ईमेल पते की कॉपी बनाएं</translation>
<translation id="8389849690213170419">आपके प्रवेश किए हुए डिवाइस का इतिहास दिखाया जा रहा है.</translation>
<translation id="8390029840652165810">कृपया सुनिश्चित करें कि आपका नेटवर्क कनेक्शन कार्य कर रहा है और यदि समस्या बनी रहती है, तो कृपया अपने प्रमाणिकता रीफ्रेश करने के लिए प्रस्थान करें और पुन: प्रवेश करें.</translation>
<translation id="8390449457866780408">सर्वर अनुपलब्‍ध है.</translation>
@@ -5065,7 +5065,7 @@
<translation id="8449008133205184768">चिपकाएं और शैली का मिलान करें</translation>
<translation id="8449036207308062757">जगह प्रबंधित करें</translation>
<translation id="8452135315243592079">अनुपलब्ध SIM कार्ड</translation>
-<translation id="8453482423012550001">$1 आइटम की प्रतिलिपि बनाई जा रही है...</translation>
+<translation id="8453482423012550001">$1 आइटम को कॉपी किया जा रहा है...</translation>
<translation id="8454288007744638700">या, कोई नया नेटवर्क चुनें:</translation>
<translation id="845627346958584683">समाप्ति समय</translation>
<translation id="8456681095658380701">अमान्‍य नाम</translation>
@@ -5109,7 +5109,7 @@
<translation id="8513974249124254369">ChromeVox (बोला गया फ़ीडबैक) सक्षम है. अक्षम करने के लिए Ctrl+Alt+Z दबाएं.</translation>
<translation id="8520687380519886411">पारंपरिक स्क्रॉलिंग</translation>
<translation id="8521441079177373948">यूके</translation>
-<translation id="852269967951527627">किसी भी साइट को नोटिफिकेशन दिखाने की अनुमति ना दें</translation>
+<translation id="852269967951527627">किसी भी साइट को नोटिफ़िकेशन दिखाने की अनुमति ना दें</translation>
<translation id="8523493869875972733">बदलावों को बनाए रखें</translation>
<translation id="8523849605371521713">पॉलिसी द्वारा जोड़ा गया</translation>
<translation id="8524066305376229396">स्थायी मेमोरी:</translation>
@@ -5161,7 +5161,7 @@
<translation id="8605503133013456784">"<ph name="DEVICE_NAME" />" से डिस्‍कनेक्‍ट करने और अयुग्मित करने में विफल.</translation>
<translation id="8606726445206553943">अपने MIDI डिवाइस का उपयोग करें</translation>
<translation id="8609465669617005112">ऊपर जाएं</translation>
-<translation id="8610892630019863050">जब कोई साइट नोटिफिकेशन दिखाना चाहे, तो पूछें (अनुशंसित)</translation>
+<translation id="8610892630019863050">जब कोई साइट नोटिफ़िकेशन दिखाना चाहे, तो पूछें (अनुशंसित)</translation>
<translation id="8615618338313291042">गुप्‍त ऐप्स : <ph name="APP_NAME" /></translation>
<translation id="8619892228487928601"><ph name="CERTIFICATE_NAME" />: <ph name="ERROR" /></translation>
<translation id="8620617069779373398">रोमिंग की स्‍थिति</translation>
@@ -5263,7 +5263,7 @@
<translation id="8749863574775030885">किसी अज्ञात विक्रेता के USB डिवाइस ऐक्‍सेस करें</translation>
<translation id="8754200782896249056">&lt;p&gt;किसी समर्थित डेस्कटॉप वातावरण के अंतर्गत <ph name="PRODUCT_NAME" /> चलाते समय, सिस्टम प्रॉक्सी सेटिंग का उपयोग किया जाएगा. हालांकि, या तो आपका सिस्टम समर्थित नहीं है या आपके सिस्टम कॉन्फ़िगरेशन को लॉन्च करने में कोई समस्या थी.&lt;/p&gt;
- &lt;p&gt;लेकिन आप फिर भी कमांड लाइन के द्वारा कॉन्फ़िगर कर सकते हैं. फ़्लैग तथा वातावरण वैरिएबल पर अधिक जानकारी के लिए कृपया &lt;code&gt;man <ph name="PRODUCT_BINARY_NAME" />&lt;/code&gt; देखें.&lt;/p&gt;</translation>
+ &lt;p&gt;लेकिन आप फिर भी कमांड लाइन के द्वारा कॉन्फ़िगर कर सकते हैं. फ़्लैग तथा वातावरण वेरिएबल पर अधिक जानकारी के लिए कृपया &lt;code&gt;man <ph name="PRODUCT_BINARY_NAME" />&lt;/code&gt; देखें.&lt;/p&gt;</translation>
<translation id="8755376271068075440">&amp;बड़ा</translation>
<translation id="8757090071857742562">डेस्कटॉप कास्ट करने में असमर्थ. यह देखने के लिए जांचें कि आपने अपनी स्क्रीन साझा करना शुरू करने के लिए संकेत की पुष्टि की है या नहीं.</translation>
<translation id="8757640015637159332">सार्वजनिक सत्र में प्रवेश करें</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_kn.xtb b/chromium/chrome/app/resources/generated_resources_kn.xtb
index 001723c07ac..1a81fc8f233 100644
--- a/chromium/chrome/app/resources/generated_resources_kn.xtb
+++ b/chromium/chrome/app/resources/generated_resources_kn.xtb
@@ -1114,7 +1114,7 @@
<translation id="258932246702879617"><ph name="BEGIN_BOLD" />ಕಾರ್ಯಪಟ್ಟಿಗೆ ಪಿನ್ ಮಾಡಿ<ph name="END_BOLD" /> ಆಯ್ಕೆಮಾಡಿ</translation>
<translation id="259421303766146093">ವರ್ಧನೆ ಕುಗ್ಗಿಸು</translation>
<translation id="2594999711683503743">Google ನಲ್ಲಿ ಹುಡುಕಿ ಅಥವಾ URL ಟೈಪ್ ಮಾಡಿ</translation>
-<translation id="2597852038534460976">Chrome ಗೆ ವಾಲ್‌ಪೇಪರ್‌ಗಳನ್ನು ಪ್ರವೇಶಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ. ದಯವಿಟ್ಟು ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಪಡಿಸಿ.</translation>
+<translation id="2597852038534460976">Chrome ಗೆ ವಾಲ್‌ಪೇಪರ್‌ಗಳನ್ನು ಪ್ರವೇಶಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ. ದಯವಿಟ್ಟು ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಿ.</translation>
<translation id="2603463522847370204">&amp;ಅಜ್ಞಾತ ವಿಂಡೋದಲ್ಲಿ ತೆರೆಯಿರಿ</translation>
<translation id="2607101320794533334">ವಿಷಯ ಸಾರ್ವಜನಿಕ ಕೀಲಿ ಮಾಹಿತಿ</translation>
<translation id="2607459012323956820">ಈ ಮೇಲ್ವಿಚಾರಣೆ ಬಳಕೆದಾರರ ಸೆಟ್ಟಿಂಗ್‌ಗಳು ಮತ್ತು ಬ್ರೌಸಿಂಗ್ ಇತಿಹಾಸವು <ph name="BEGIN_LINK" /><ph name="DISPLAY_LINK" /><ph name="END_LINK" /> ನಲ್ಲಿ ಈಗಲೂ ನಿರ್ವಾಹಕರಿಗೆ ಗೋಚರಿಸಬಹುದು.</translation>
@@ -1131,7 +1131,7 @@
<translation id="26224892172169984">ಪ್ರೊಟೋಕಾಲ್‌‌ಗಳನ್ನು ನಿರ್ವಹಿಸಲು ಯಾವ ಸೈಟ್‌ ಅನ್ನು ಅನುಮತಿಸಬೇಡ</translation>
<translation id="2624142942574147739">ಈ ಪುಟವು ನಿಮ್ಮ ಕ್ಯಾಮರಾ ಹಾಗೂ ಮೈಕ್ರೋಫೋನ್ ಅನ್ನು ಪ್ರವೇಶಿಸುತ್ತಿದೆ.</translation>
<translation id="2626799779920242286">ದಯವಿಟ್ಟು ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ.</translation>
-<translation id="2630681426381349926">ಪ್ರಾರಂಭಿಸಲು ವೈ-ಫೈ ಗೆ ಸಂಪರ್ಕಪಡಿಸಿ</translation>
+<translation id="2630681426381349926">ಪ್ರಾರಂಭಿಸಲು ವೈ-ಫೈ ಗೆ ಸಂಪರ್ಕಿಸಿ</translation>
<translation id="2631006050119455616">ಉಳಿಸಲಾಗಿದೆ</translation>
<translation id="2631498379019108537">ಶೆಲ್ಫ್‌ನಲ್ಲಿ ಇನ್‌ಪುಟ್‌ ಆಯ್ಕೆಗಳನ್ನು ತೋರಿಸಿ</translation>
<translation id="2633199387167390344">ಡಿಸ್ಕ್ ಸ್ಥಳಾವಕಾಶದಲ್ಲಿ <ph name="USAGE" /> MB ಅನ್ನು <ph name="NAME" /> ಬಳಸಿಕೊಳ್ಳುತ್ತಿದೆ.</translation>
@@ -1293,7 +1293,7 @@
<translation id="2818476747334107629">ಪ್ರಿಂಟರ್ ವಿವರಗಳು</translation>
<translation id="2822634587701817431">ಕುಗ್ಗಿಸಿ/ವಿಸ್ತರಿಸಿ</translation>
<translation id="2825758591930162672">ವಿಷಯದ ಸಾರ್ವಜನಿಕ ಕೀಲಿ</translation>
-<translation id="2828650939514476812">ವೈ-ಫೈ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಪಡಿಸಿ</translation>
+<translation id="2828650939514476812">ವೈ-ಫೈ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಿ</translation>
<translation id="283278805979278081">ಚಿತ್ರವನ್ನು ತೆಗೆಯಿರಿ.</translation>
<translation id="2833791489321462313">ನಿದ್ದೆಯಿಂದ ಎಚ್ಚರಗೊಳ್ಳಲು ಪಾಸ್‌‌ವರ್ಡ್ ಅಗತ್ಯವಿದೆ</translation>
<translation id="2836269494620652131">ಕ್ರ್ಯಾಷ್</translation>
@@ -1917,7 +1917,7 @@
<translation id="3712897371525859903">&amp;ಪುಟವನ್ನು ಹೀಗೆ ಉಳಿಸಿ...</translation>
<translation id="371300529209814631">ಹಿಂದೆ ಮಾಡಿ/ಫಾರ್ವರ್ಡ್ ಮಾಡಿ</translation>
<translation id="3714633008798122362">ವೆಬ್ ಕ್ಯಾಲೆಂಡರ್</translation>
-<translation id="3715597595485130451">ವೈ-ಫೈಗೆ ಸಂಪರ್ಕಪಡಿಸಿ</translation>
+<translation id="3715597595485130451">ವೈ-ಫೈಗೆ ಸಂಪರ್ಕಿಸಿ</translation>
<translation id="3718288130002896473">ನಡವಳಿಕೆ</translation>
<translation id="3719826155360621982">ಮುಖಪುಟ</translation>
<translation id="3722396466546931176">ನಿಮ್ಮ ಆದ್ಯತೆಯ ಮೇರೆಗೆ ಭಾಷೆಗಳನ್ನು ಸೇರಿಸಿ ಮತ್ತು ಅವುಗಳನ್ನು ಕ್ರಮಗೊಳಿಸಲು ಡ್ರಾಗ್ ಮಾಡಿ.</translation>
@@ -2929,7 +2929,7 @@
ಫೈಲ್‌ಗಳಲ್ಲಿ ಇತರರೊಂದಿಗೆ ಒಂದೇ ಸ್ಥಳದಲ್ಲಿ<ph name="MARKUP_8" />
ಹಂಚಿ, ರಚಿಸಿ ಮತ್ತು ಸಹಯೋಗಿಸಿ.<ph name="MARKUP_9" /></translation>
-<translation id="5264252276333215551">ನಿಮ್ಮ ಅಪ್ಲಿಕೇಶನ್ ಅನ್ನು ಕಿಯೋಸ್ಕ್ ಮೋಡ್‌ನಲ್ಲಿ ಪ್ರಾರಂಭಿಸಲು ಇಂಟರ್ನೆಟ್‌ಗೆ ಸಂಪರ್ಕಪಡಿಸಿ.</translation>
+<translation id="5264252276333215551">ನಿಮ್ಮ ಅಪ್ಲಿಕೇಶನ್ ಅನ್ನು ಕಿಯೋಸ್ಕ್ ಮೋಡ್‌ನಲ್ಲಿ ಪ್ರಾರಂಭಿಸಲು ಇಂಟರ್ನೆಟ್‌ಗೆ ಸಂಪರ್ಕಿಸಿ.</translation>
<translation id="5265562206369321422">ಒಂದು ವಾರಕ್ಕಿಂತಲೂ ಹೆಚ್ಚು ಕಾಲ ಆಫ್‌ಲೈನ್</translation>
<translation id="5266113311903163739">ಪ್ರಮಾಣಪತ್ರದ ಅಧಿಕಾರ ಆಮದು ದೋಷ</translation>
<translation id="5269977353971873915">ಮುದ್ರಣ ವಿಫಲಗೊಂಡಿದೆ</translation>
@@ -3043,7 +3043,7 @@
<translation id="5422221874247253874">ಪ್ರವೇಶ ಬಿಂದು</translation>
<translation id="5422781158178868512">ಕ್ಷಮಸಿ, ನಿಮ್ಮ ಬಾಹ್ಯ ಸಂಗ್ರಹಣೆಯ ಸಾಧನವನ್ನು ಗುರುತಿಸಲಾಗಲಿಲ್ಲ.</translation>
<translation id="5423849171846380976">ಸಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ</translation>
-<translation id="5425722269016440406">Smart Lock ಆಫ್‌ ಮಾಡಲು ನೀವು ಆನ್‌ಲೈನ್‌ನಲ್ಲಿರಬೇಕು. ಏಕೆಂದರೆ ಈ ಸೆಟ್ಟಿಂಗ್‌ ಅನ್ನು ನಿಮ್ಮ ಫೋನ್‌ ಮತ್ತು ಇತರ ಸಾಧನಗಳಿಗೆ ಸಿಂಕ್‌ ಮಾಡಲಾಗಿದೆ. ದಯವಿಟ್ಟು ಮೊದಲು ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಪಡಿಸಿ.</translation>
+<translation id="5425722269016440406">Smart Lock ಆಫ್‌ ಮಾಡಲು ನೀವು ಆನ್‌ಲೈನ್‌ನಲ್ಲಿರಬೇಕು. ಏಕೆಂದರೆ ಈ ಸೆಟ್ಟಿಂಗ್‌ ಅನ್ನು ನಿಮ್ಮ ಫೋನ್‌ ಮತ್ತು ಇತರ ಸಾಧನಗಳಿಗೆ ಸಿಂಕ್‌ ಮಾಡಲಾಗಿದೆ. ದಯವಿಟ್ಟು ಮೊದಲು ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಿ.</translation>
<translation id="5425863515030416387">ಸಾಧನಗಳಾದ್ಯಂತ ಸುಲಭವಾಗಿ ಸೈನ್ ಇನ್ ಮಾಡಿ</translation>
<translation id="5427278936122846523">ಯಾವಾಗಲೂ ಅನುವಾದಿಸು</translation>
<translation id="5427459444770871191">&amp;ಪ್ರದಕ್ಷಿಣೆಯಂತೆ ತಿರುಗಿಸಿ</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_ko.xtb b/chromium/chrome/app/resources/generated_resources_ko.xtb
index 2a9bd78a7a6..660163274c1 100644
--- a/chromium/chrome/app/resources/generated_resources_ko.xtb
+++ b/chromium/chrome/app/resources/generated_resources_ko.xtb
@@ -827,7 +827,7 @@
<translation id="2193365732679659387">신뢰 설정</translation>
<translation id="2195729137168608510">이메일 보호</translation>
<translation id="2198315389084035571">중국어(간체)</translation>
-<translation id="219985413780390209">위험 사이트로부터 사용자와 기기를 보호합니다.</translation>
+<translation id="219985413780390209">위험한 사이트로부터 사용자와 기기 보호</translation>
<translation id="220138918934036434">버튼 숨기기</translation>
<translation id="2202898655984161076">프린터를 나열하는 데 문제가 발생했습니다. <ph name="CLOUD_PRINT_NAME" />에 성공적으로 등록되지 못한 프린터가 있을 수 있습니다.</translation>
<translation id="2203682048752833055"><ph name="BEGIN_LINK" />주소 표시줄<ph name="END_LINK" />에서 사용되는 검색 엔진입니다.</translation>
@@ -1854,7 +1854,7 @@
<translation id="3613134908380545408"><ph name="FOLDER_NAME" /> 표시</translation>
<translation id="3613422051106148727">새 탭에서 열기(&amp;O)</translation>
<translation id="3616113530831147358">오디오</translation>
-<translation id="3616741288025931835">인터넷 사용정보 삭제(&amp;C)...</translation>
+<translation id="3616741288025931835">인터넷 사용 기록 삭제(&amp;C)...</translation>
<translation id="3618849550573277856">'<ph name="LOOKUP_STRING" />' 찾기</translation>
<translation id="3620292326130836921">백업되지 않은 파일이 없습니다.</translation>
<translation id="3623574769078102674">이 관리 대상 사용자는 <ph name="MANAGER_EMAIL" />에서 관리합니다.</translation>
@@ -3459,7 +3459,7 @@
<translation id="6049065490165456785">내부 카메라의 사진</translation>
<translation id="6051354611314852653">시스템에서 이 기기에 대한 API 액세스를 승인하지 못했습니다.</translation>
<translation id="6052976518993719690">SSL 인증 기관</translation>
-<translation id="6053401458108962351">인터넷 사용정보 삭제(&amp;C)...</translation>
+<translation id="6053401458108962351">인터넷 사용 기록 삭제(&amp;C)...</translation>
<translation id="6054173164583630569">프랑스어 키보드</translation>
<translation id="6055171183283175969">입력한 비밀번호가 올바르지 않습니다.</translation>
<translation id="6055392876709372977">PKCS #1 SHA-256(RSA 암호화 사용)</translation>
@@ -4351,7 +4351,7 @@
개인정보처리방침에 따라 보호됩니다.<ph name="BEGIN_BOLD" /> 이 의견을 제출함으로써 귀하는 Google에서 Google 제품 또는 서비스 개선을 위해
귀하가 제공한 의견을 사용하는 데 동의하는 것으로 간주됩니다.
<ph name="END_BOLD" /></translation>
-<translation id="7387829944233909572">'인터넷 사용정보 삭제' 대화상자</translation>
+<translation id="7387829944233909572">'인터넷 사용 기록 삭제' 대화상자</translation>
<translation id="7388044238629873883">거의 완료되었습니다.</translation>
<translation id="7389722738210761877">태국어 키보드(TIS 820-2531)</translation>
<translation id="7392118418926456391">바이러스 검사 실패</translation>
@@ -4938,7 +4938,7 @@
<translation id="8248050856337841185">붙여넣기(&amp;P)</translation>
<translation id="8249048954461686687">OEM 폴더</translation>
<translation id="8249296373107784235">중단</translation>
-<translation id="8249672078237421304">사용 언어가 아닌 페이지에서 번역 옵션 제공</translation>
+<translation id="8249672078237421304">이 언어로 된 페이지에 대한 번역 옵션 제공</translation>
<translation id="8249681497942374579">바탕화면 바로가기 삭제</translation>
<translation id="8251578425305135684">미리보기 이미지가 삭제되었습니다.</translation>
<translation id="8253198102038551905">'+'를 클릭하여 네트워크 속성 보기</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_ml.xtb b/chromium/chrome/app/resources/generated_resources_ml.xtb
index 89fa9eefe52..694a09e8716 100644
--- a/chromium/chrome/app/resources/generated_resources_ml.xtb
+++ b/chromium/chrome/app/resources/generated_resources_ml.xtb
@@ -5414,7 +5414,7 @@ Google Chrome മൊബൈൽ ഡാറ്റ ഉപയോഗിക്കും.
<translation id="8972513834460200407">ഫയർവാൾ Google സെർവറുകളിൽ നിന്ന് ഡൗൺലോഡുകൾ തടയുന്നില്ലെന്ന് ഉറപ്പുവരുത്താൻ, നിങ്ങളുടെ നെറ്റ്‌വർക്ക് അഡ്‌മിനിസ്‌ട്രേറ്ററുടെ സഹായം തേടുക.</translation>
<translation id="8973557916016709913">സൂം ലെവൽ നീക്കംചെയ്യുക</translation>
<translation id="8973596347849323817">ആവശ്യങ്ങൾക്ക് അനുസരിച്ച് നിങ്ങൾക്ക് ഈ ഉപകരണം ഇഷ്ടാനുസൃതമാക്കാം. ഈ ഉപയോഗസഹായി ഫീച്ചറുകൾ പിന്നീട് ക്രമീകരണത്തിൽ മാറ്റാവുന്നതാണ്.</translation>
-<translation id="897414447285476047">കണക്ഷൻ പ്രശ്‌നം കാരണം ലക്ഷ്യസ്ഥാന ഫയൽ അപൂർണ്ണമായി.</translation>
+<translation id="897414447285476047">കണക്ഷൻ പ്രശ്‌നം കാരണം ലക്ഷ്യസ്ഥാന ഫയൽ പൂർത്തിയായില്ല.</translation>
<translation id="8977811652087512276">പാസ്‌വേഡ് തെറ്റോ ഫയൽ കേടോ ആണ്</translation>
<translation id="8978154919215542464">ഓണാണ് - എല്ലാം സമന്വയിപ്പിക്കുക</translation>
<translation id="8978526688207379569">ഈ സൈറ്റ് ഒന്നിലേറെ ഫയലുകളെ സ്വയമേവ ഡൗൺലോഡുചെയ്‌തു.</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_mr.xtb b/chromium/chrome/app/resources/generated_resources_mr.xtb
index 19a88e75bfd..f8a3a930555 100644
--- a/chromium/chrome/app/resources/generated_resources_mr.xtb
+++ b/chromium/chrome/app/resources/generated_resources_mr.xtb
@@ -4225,7 +4225,7 @@
<translation id="7214227951029819508">ब्राइटनेस:</translation>
<translation id="7216409898977639127">सेल्युलर सेवा देणारा</translation>
<translation id="7216595297012131718">आपल्या प्राधान्याच्या आधारावर भाषांची क्रमवारी लावा</translation>
-<translation id="7219989745826083607">डिव्हाइस वर्णन विश्लेषक डायल करा</translation>
+<translation id="7219989745826083607">डीव्हाइस वर्णन विश्लेषक डायल करा</translation>
<translation id="722055596168483966">Google सेेव वैयक्तिकृत करा</translation>
<translation id="7221155467930685510">$1 GB</translation>
<translation id="7221855153210829124">सूचना दर्शवा</translation>
@@ -4432,7 +4432,7 @@
<translation id="7511955381719512146">आपण वापरत असलेल्या Wi-Fi ला आपण <ph name="BEGIN_BOLD" /><ph name="LOGIN_URL" /><ph name="END_BOLD" /> ला भेट देण्याची आवश्यकता असू शकते.</translation>
<translation id="7513029293694390567">संचयित क्रेडेन्शियल वापरून वेबसाइटवर स्वयंचलितपणे साइन इन करा. अक्षम केले असल्यास, वेबसाइटवर साइन इन करण्यापूर्वी प्रत्येकवेळी आपल्याला पुष्टीकरणासाठी विचारले जाईल.</translation>
<translation id="751507702149411736">बेलारुशियन</translation>
-<translation id="7515670329462166359">संरक्षित आशय प्ले करण्यासाठी <ph name="URL" /> ला तुमचे डिव्हाइस विशिष्टपणे ओळखू इच्छिते.</translation>
+<translation id="7515670329462166359">संरक्षित आशय प्ले करण्यासाठी <ph name="URL" /> ला तुमचे डीव्हाइस विशिष्टपणे ओळखू इच्छिते.</translation>
<translation id="7517569744831774757">सेटिंग्ज त्यांच्या मूळ डीफॉल्टवर पुनर्संचयित करा.</translation>
<translation id="7517786267097410259">एक संकेतशब्द तयार करा -</translation>
<translation id="7518150891539970662">WebRTC लॉग (<ph name="WEBRTC_LOG_COUNT" />)</translation>
@@ -4492,7 +4492,7 @@
<translation id="7591957897535945411">हे पृष्ठ भाषांतरित केले गेले आहे.</translation>
<translation id="7595547011743502844"><ph name="ERROR" /> (त्रुटी कोड <ph name="ERROR_CODE" />).</translation>
<translation id="7596831438341298034">ठीक, आयात करा</translation>
-<translation id="7598466960084663009">कॉंप्युटर रीस्टार्ट करा</translation>
+<translation id="7598466960084663009">काँप्युटर रीस्टार्ट करा</translation>
<translation id="7600965453749440009">कधीही <ph name="LANGUAGE" /> चा भाषांतर करु नका</translation>
<translation id="760197030861754408">कनेक्ट करण्यासाठी <ph name="LANDING_PAGE" /> वर जा.</translation>
<translation id="7602079150116086782">अन्य डिव्हाइसेसवरील कोणतेही टॅब नाहीत</translation>
@@ -4824,7 +4824,7 @@
<translation id="8086015605808120405"><ph name="PRINTER_NAME" /> कॉन्फिगर करत आहे...</translation>
<translation id="8088137642766812908">सावधगिरी बाळगा, हे वैशिष्ट्य हानी करू शकते</translation>
<translation id="8090234456044969073">आपल्‍या सर्वाधिक वारंवार भेट दिलेल्‍या वेबसाइटची सूची वाचा</translation>
-<translation id="8093832608898425674">अधिक चांगल्या प्लेबॅकसाठीच्या संरक्षित आशयाची पात्रता ठरवण्यासाठी <ph name="DOMAIN" /> ला तुमच्या डिव्हाइसची Googleकडून ओळख पडताळणी करून हवी आहे. <ph name="LEARN_MORE" />.</translation>
+<translation id="8093832608898425674">अधिक चांगल्या प्लेबॅकसाठीच्या संरक्षित आशयाची पात्रता ठरवण्यासाठी <ph name="DOMAIN" /> ला तुमच्या डीव्हाइसची Googleकडून ओळख पडताळणी करून हवी आहे. <ph name="LEARN_MORE" />.</translation>
<translation id="8094917007353911263">आपण वापरत असलेल्या नेटवर्कला आपण <ph name="BEGIN_BOLD" /><ph name="LOGIN_URL" /><ph name="END_BOLD" /> ला भेट देण्याची आवश्यकता आहे.</translation>
<translation id="80974698889265265">पिन जुळत नाहीत</translation>
<translation id="8098975406164436557">आपले <ph name="DEVICE_TYPE" /> अनलॉक करण्यासाठी हा फोन वापरायचा?</translation>
@@ -5453,7 +5453,7 @@
<translation id="9030515284705930323">आपल्या संस्थेने आपल्या खात्यासाठी Google Play स्टोअर सक्षम केले नाही. अधिक माहितीसाठी आपल्या प्रशासकाशी संपर्क साधा.</translation>
<translation id="9033780830059217187">विस्ताराद्वारे प्रॉक्सी प्रवर्तित केला जातो.</translation>
<translation id="9033857511263905942">&amp;पेस्ट करा</translation>
-<translation id="9034909046124500346">पूर्ण करण्यासाठी, तुमचा कॉंप्युटर रीस्टार्ट करा</translation>
+<translation id="9034909046124500346">पूर्ण करण्यासाठी, तुमचा काँप्युटर रीस्टार्ट करा</translation>
<translation id="9037008143807155145">https://www.google.com/calendar/render?cid=%s</translation>
<translation id="9037965129289936994">मूळ दर्शवा</translation>
<translation id="9038649477754266430">पृष्ठे अधिक द्रुतपणे लोड करण्यासाठी पूर्वानुमान सेवेचा वापर करा</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_pt-BR.xtb b/chromium/chrome/app/resources/generated_resources_pt-BR.xtb
index ad446d94c7c..d2cc03193a3 100644
--- a/chromium/chrome/app/resources/generated_resources_pt-BR.xtb
+++ b/chromium/chrome/app/resources/generated_resources_pt-BR.xtb
@@ -26,7 +26,7 @@
<translation id="1036982837258183574">Pressione |<ph name="ACCELERATOR" />| para sair do modo tela cheia</translation>
<translation id="1038168778161626396">Somente codificar</translation>
<translation id="1039337018183941703">Arquivo inválido ou corrompido</translation>
-<translation id="1042174272890264476">Seu computador já vem com a biblioteca RLZ do <ph name="SHORT_PRODUCT_NAME" /> integrada. O RLZ atribui uma tag não exclusiva e sem identificação pessoal para medir as pesquisas e o uso do <ph name="SHORT_PRODUCT_NAME" /> gerados por uma campanha promocional específica. Esses marcadores às vezes aparecem em consultas da Pesquisa do Google no <ph name="PRODUCT_NAME" />.</translation>
+<translation id="1042174272890264476">Seu computador já vem com a biblioteca RLZ do <ph name="SHORT_PRODUCT_NAME" /> integrada. O RLZ atribui uma tag não exclusiva e sem identificação pessoal para medir as pesquisas e o uso do <ph name="SHORT_PRODUCT_NAME" /> gerados por uma campanha promocional específica. Esses marcadores às vezes aparecem em consultas da Pesquisa Google no <ph name="PRODUCT_NAME" />.</translation>
<translation id="1042574203789536285"><ph name="URL" /> deseja armazenar permanentemente um grande volume de dados em seu dispositivo.</translation>
<translation id="1045157690796831147">Transliteração (namaskar → നമസ്കാരം)</translation>
<translation id="1046059554679513793">Ops. Este nome já está em uso.</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_ru.xtb b/chromium/chrome/app/resources/generated_resources_ru.xtb
index 62e7657536c..7cedb3e20a4 100644
--- a/chromium/chrome/app/resources/generated_resources_ru.xtb
+++ b/chromium/chrome/app/resources/generated_resources_ru.xtb
@@ -1665,7 +1665,7 @@ http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/debugging-featur
<translation id="3337069537196930048">Плагин <ph name="PLUGIN_NAME" /> заблокирован, так как он устарел.</translation>
<translation id="3338239663705455570">Словенская раскладка</translation>
<translation id="3340978935015468852">настройках</translation>
-<translation id="3341703758641437857">Разрешить открывать файлы по ссылкам</translation>
+<translation id="3341703758641437857">Разрешить открывать локальные файлы по ссылкам</translation>
<translation id="3344786168130157628">Название точки доступа:</translation>
<translation id="3345886924813989455">Поддерживаемые браузеры не найдены</translation>
<translation id="3347086966102161372">&amp;Копировать URL картинки</translation>
@@ -5289,7 +5289,7 @@ http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/debugging-featur
<translation id="8785622406424941542">Стилус</translation>
<translation id="8787254343425541995">Использовать прокси-серверы для общих сетей</translation>
<translation id="878763818693997570">Слишком длинное имя</translation>
-<translation id="8791534160414513928">Отправлять запрет отслеживания с исходящим трафиком</translation>
+<translation id="8791534160414513928">Отправлять запрет на отслеживание с исходящим трафиком</translation>
<translation id="8794025342371547160">Ограниченный IP</translation>
<translation id="879413103056696865">Когда вы включите точку доступа, устройство "<ph name="PHONE_NAME" />":</translation>
<translation id="8795668016723474529">Добавить банковскую карту</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_sw.xtb b/chromium/chrome/app/resources/generated_resources_sw.xtb
index 9de9658562b..644f8deba1a 100644
--- a/chromium/chrome/app/resources/generated_resources_sw.xtb
+++ b/chromium/chrome/app/resources/generated_resources_sw.xtb
@@ -1528,7 +1528,7 @@ Tembelea <ph name="BEGIN_LINK" />Kituo chetu cha Usaidizi<ph name="END_LINK" />
<translation id="3144647712221361880">Fungua kiungo ukitumia</translation>
<translation id="3149510190863420837">Programu za Chrome</translation>
<translation id="3150927491400159470">Upakiaji upya Thabiti</translation>
-<translation id="315116470104423982">Data ya simu</translation>
+<translation id="315116470104423982">Data ya mtandao wa simu</translation>
<translation id="3151539355209957474">Wakati wa Kuanza</translation>
<translation id="3151562827395986343">Futa historia, vidakuzi, akiba na mengine mengi</translation>
<translation id="3151786313568798007">Mkao</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_te.xtb b/chromium/chrome/app/resources/generated_resources_te.xtb
index 0a792094d89..1bb719475a8 100644
--- a/chromium/chrome/app/resources/generated_resources_te.xtb
+++ b/chromium/chrome/app/resources/generated_resources_te.xtb
@@ -4439,7 +4439,7 @@
<translation id="7511955381719512146">మీరు ఉపయోగిస్తున్న Wi-Fiకి మీరు <ph name="BEGIN_BOLD" /><ph name="LOGIN_URL" /><ph name="END_BOLD" />ని సందర్శించడం అవసరం.</translation>
<translation id="7513029293694390567">నిల్వ చేసిన ఆధారాలను ఉపయోగించి స్వయంచాలకంగా వెబ్‌సైట్‌లకు సైన్ ఇన్ చేస్తుంది. దీన్ని నిలిపివేస్తే, మీరు వెబ్‌సైట్‌కు సైన్ ఇన్ చేసే ప్రతిసారి నిర్ధారణ కోసం మిమ్మల్ని అడుగుతుంది.</translation>
<translation id="751507702149411736">బెలారుషియన్</translation>
-<translation id="7515670329462166359">ప్రీమియం కంటెంట్‌ని ప్లే చేయడానికి <ph name="URL" /> మీ పరికరాన్ని ప్రత్యేకంగా గుర్తించాలనుకుంటోంది.</translation>
+<translation id="7515670329462166359">రక్షిత కంటెంట్‌ను ప్లే చేయడానికి <ph name="URL" /> మీ పరికరాన్ని ప్రత్యేకంగా గుర్తించాలనుకుంటోంది.</translation>
<translation id="7517569744831774757">సెట్టింగ్‌లను వాటి అసలు డిఫాల్ట్‌లకు పునరుద్ధరిస్తుంది.</translation>
<translation id="7517786267097410259">పాస్‌వర్డ్‌ను సృష్టించండి -</translation>
<translation id="7518150891539970662">WebRTC లాగ్‌లు (<ph name="WEBRTC_LOG_COUNT" />)</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_uk.xtb b/chromium/chrome/app/resources/generated_resources_uk.xtb
index bcccfdf9a7a..af2f3d66947 100644
--- a/chromium/chrome/app/resources/generated_resources_uk.xtb
+++ b/chromium/chrome/app/resources/generated_resources_uk.xtb
@@ -89,7 +89,7 @@
<translation id="1128109161498068552">Заборонити всім сайтам використовувати виняткові повідомлення системи, щоб отримувати доступ до пристроїв MIDI</translation>
<translation id="1128128132059598906">EAP – TTLS</translation>
<translation id="1128591060186966949">Змінити пошукову систему</translation>
-<translation id="1128987120443782698">Ємність пристрою пам’яті – <ph name="DEVICE_CAPACITY" />. Вставте карту SD чи карту флеш-пам’яті USB ємністю принаймні 4 Гб.</translation>
+<translation id="1128987120443782698">Ємність пристрою пам’яті – <ph name="DEVICE_CAPACITY" />. Вставте карту SD чи карту флеш-пам’яті USB ємністю принаймні 4 ГБ.</translation>
<translation id="1131167343343087859">Кредитні картки й адреси, додані в Google Payments.</translation>
<translation id="1140351953533677694">Отримувати доступ до пристроїв Bluetooth і серійних пристроїв</translation>
<translation id="114140604515785785">Кореневий каталог розширення:</translation>
@@ -948,7 +948,7 @@
<translation id="2351266942280602854">Мова та способи введення</translation>
<translation id="2351520734632194850"><ph name="MHZ" /> МГц</translation>
<translation id="2352467521400612932">Налаштування стилуса</translation>
-<translation id="2352662711729498748">&lt; 1 Мб</translation>
+<translation id="2352662711729498748">&lt; 1 МБ</translation>
<translation id="2356070529366658676">Запитати</translation>
<translation id="2357949918965361754">За допомогою цієї функції ви можете транслювати вміст із Chrome на телевізор чи інші пристрої.</translation>
<translation id="2359345697448000899">Керуйте своїми розширеннями, натиснувши вкладку "Розширення" в меню "Інструменти".</translation>
@@ -1037,7 +1037,7 @@
<translation id="249303669840926644">Не вдалося закінчити реєстрацію</translation>
<translation id="2494837236724268445">Клавіатура гуджараті (фонетична)</translation>
<translation id="2496180316473517155">Історія переглядів</translation>
-<translation id="2496540304887968742">Ємність пристрою має становити 4 Гб або більше.</translation>
+<translation id="2496540304887968742">Ємність пристрою має становити 4 ГБ або більше.</translation>
<translation id="2497229222757901769">Швидкість миші</translation>
<translation id="2497852260688568942">Ваш адміністратор вимкнув синхронізацію</translation>
<translation id="249819058197909513">Більше не попереджати для цього додатка</translation>
@@ -1079,7 +1079,7 @@
<translation id="2550212893339833758">Змінна пам’ять</translation>
<translation id="2553340429761841190"><ph name="PRODUCT_NAME" /> не вдалося з'єднатися з <ph name="NETWORK_ID" />. Виберіть іншу мережу або повторіть спробу.</translation>
<translation id="2553440850688409052">Сховати цей плагін</translation>
-<translation id="2554553592469060349">Вибраний файл завеликий (максимальний розмір – 3 Мб).</translation>
+<translation id="2554553592469060349">Вибраний файл завеликий (максимальний розмір – 3 МБ).</translation>
<translation id="2557899542277210112">Для швидкого доступу розташуйте свої закладки тут, на панелі закладок.</translation>
<translation id="2558578666171469771">Магазин Google Play тепер на вашому пристрої <ph name="DEVICE_TYPE" /></translation>
<translation id="255937426064304553">Міжнародна (США)</translation>
@@ -1133,7 +1133,7 @@
<translation id="2630681426381349926">Під’єднайтеся до Wi-Fi, щоб почати</translation>
<translation id="2631006050119455616">Збережено</translation>
<translation id="2631498379019108537">Показувати на полиці опції введення</translation>
-<translation id="2633199387167390344"><ph name="NAME" /> використовує <ph name="USAGE" /> Мб місця на диску.</translation>
+<translation id="2633199387167390344"><ph name="NAME" /> використовує <ph name="USAGE" /> МБ місця на диску.</translation>
<translation id="2633212996805280240">Видалити "<ph name="EXTENSION_NAME" />"?</translation>
<translation id="263325223718984101"><ph name="PRODUCT_NAME" /> не вдалося завершити встановлення, але він продовжить працювати, використовуючи своє зображення диска.</translation>
<translation id="2635276683026132559">Підписування</translation>
@@ -1346,7 +1346,7 @@
<translation id="2902127500170292085">Розширення <ph name="EXTENSION_NAME" /> не може зв’язатися з цим принтером. Перевірте, чи принтер підключено, і повторіть спробу.</translation>
<translation id="2902734494705624966">Американська розширена</translation>
<translation id="2903493209154104877">Адреси</translation>
-<translation id="290444763029043472"><ph name="DOWNLOADED_AMOUNT_MB" /> Мб / завантажено <ph name="TOTAL_AMOUNT_MB" /> Мб</translation>
+<translation id="290444763029043472"><ph name="DOWNLOADED_AMOUNT_MB" /> МБ / завантажено <ph name="TOTAL_AMOUNT_MB" /> МБ</translation>
<translation id="2904456025988372123">Запитувати, якщо сайт намагається завантажити файли автоматично після першого файлу</translation>
<translation id="2907619724991574506">URL-адреси автозавантаження</translation>
<translation id="2907798539022650680">Не вдалося під’єднатися до мережі "<ph name="NAME" />": <ph name="DETAILS" />
@@ -2183,7 +2183,7 @@
<translation id="4099060993766194518">Відновити пошукову систему за умовчанням?</translation>
<translation id="4100733287846229632">На пристрої дуже мало вільного місця</translation>
<translation id="4104163789986725820">Е&amp;кспортувати...</translation>
-<translation id="4105563239298244027">Отримайте безкоштовно 1 Тб на Диску Google</translation>
+<translation id="4105563239298244027">Отримайте безкоштовно 1 ТБ на Диску Google</translation>
<translation id="4109135793348361820">Перемістити вікно на робочий стіл користувача <ph name="USER_NAME" /> (<ph name="USER_EMAIL" />)</translation>
<translation id="4110342520124362335">Файли cookie з домену <ph name="DOMAIN" /> заблоковано.</translation>
<translation id="4110559665646603267">Вибрати полицю</translation>
@@ -2296,7 +2296,7 @@
<translation id="4300305918532693141">Щоб змінити це налаштування, <ph name="BEGIN_LINK" />скиньте синхронізацію<ph name="END_LINK" />.</translation>
<translation id="4305227814872083840">довга затримка (2 с)</translation>
<translation id="4307281933914537745">Докладніше про відновлення системи</translation>
-<translation id="4309420042698375243"><ph name="NUM_KILOBYTES" /> Кб (<ph name="NUM_KILOBYTES_LIVE" /> Кб у реальному часі)</translation>
+<translation id="4309420042698375243"><ph name="NUM_KILOBYTES" /> КБ (<ph name="NUM_KILOBYTES_LIVE" /> КБ у реальному часі)</translation>
<translation id="431076611119798497">&amp;Деталі</translation>
<translation id="4315548163539304064">Сканування носія…
<ph name="LINE_BREAK1" />
@@ -2652,7 +2652,7 @@
<translation id="4870177177395420201"><ph name="PRODUCT_NAME" /> не може визначити чи встановити веб-переглядач за умовчанням.</translation>
<translation id="48704129375571883">Додати більше функцій</translation>
<translation id="4870903493621965035">Немає підключених пристроїв</translation>
-<translation id="4871210892959306034">$1 Кб</translation>
+<translation id="4871210892959306034">$1 КБ</translation>
<translation id="4871308555310586478">Не з Веб-магазину Chrome.</translation>
<translation id="4871370605780490696">Додати закладку</translation>
<translation id="4871833665870725367">Оновити пароль <ph name="PASSWORD_MANAGER_BRAND" /> для <ph name="ORIGIN" />?</translation>
@@ -2769,7 +2769,7 @@
<translation id="5037676449506322593">Вибрати всі</translation>
<translation id="5038625366300922036">Більше…</translation>
<translation id="5038863510258510803">Увімкнення...</translation>
-<translation id="5039512255859636053">$1 Тб</translation>
+<translation id="5039512255859636053">$1 ТБ</translation>
<translation id="5039804452771397117">Дозволити</translation>
<translation id="5045550434625856497">Неправильний пароль</translation>
<translation id="5046747760454685637">Запитувати, перш ніж дозволити сайтам запускати Flash (рекомендовано)</translation>
@@ -3163,7 +3163,7 @@
<translation id="558918721941304263">Завантаження додатків…</translation>
<translation id="5592595402373377407">Ще недостатньо даних.</translation>
<translation id="5595485650161345191">Редагувати адресу</translation>
-<translation id="5600706100022181951">Щоб завантажити оновлення, буде використано <ph name="UPDATE_SIZE_MB" /> Мб мобільного Інтернету. Продовжити?</translation>
+<translation id="5600706100022181951">Щоб завантажити оновлення, буде використано <ph name="UPDATE_SIZE_MB" /> МБ мобільного Інтернету. Продовжити?</translation>
<translation id="5601503069213153581">PIN-код</translation>
<translation id="5604324414379907186">Завжди показувати панель закладок</translation>
<translation id="5605623530403479164">Інші пошукові системи</translation>
@@ -3696,7 +3696,7 @@
<translation id="6410328738210026208">Змінити версію й виконати Powerwash</translation>
<translation id="6410668567036790476">Додати пошукову систему</translation>
<translation id="641081527798843608">Збіг суб’єкта</translation>
-<translation id="641105183165925463">$1 Мб</translation>
+<translation id="641105183165925463">$1 МБ</translation>
<translation id="6412931879992742813">Нове анонімне вікно</translation>
<translation id="6418160186546245112">Повернення до попередньої встановленої версії <ph name="IDS_SHORT_PRODUCT_NAME" /></translation>
<translation id="6418481728190846787">Назавжди видалити доступ для всіх програм</translation>
@@ -3806,7 +3806,7 @@
<translation id="6545834809683560467">Використовувати підказки для завершення пошукових запитів і URL-адрес, введених в адресний рядок або вікно пошуку на панелі запуску додатків</translation>
<translation id="6546686722964485737">Приєднатися до мережі WiMAX</translation>
<translation id="6547316139431024316">Більше не попереджати для цього розширення</translation>
-<translation id="6547354035488017500">Звільніть принаймні 512 Мб пам’яті, інакше пристрій перестане відповідати. Щоб звільнити місце, видаліть файли з пам’яті пристрою.</translation>
+<translation id="6547354035488017500">Звільніть принаймні 512 МБ пам’яті, інакше пристрій перестане відповідати. Щоб звільнити місце, видаліть файли з пам’яті пристрою.</translation>
<translation id="6549689063733911810">Останні</translation>
<translation id="6550675742724504774">Параметри</translation>
<translation id="6551034508248154663">Увімкнення голосової й аудіоактивності…</translation>
@@ -4234,7 +4234,7 @@
<translation id="7216595297012131718">Мови замовлень на основі ваших налаштувань</translation>
<translation id="7219989745826083607">Синтаксичний аналізатор опису пристрою набору номера</translation>
<translation id="722055596168483966">Персоналізувати служби Google</translation>
-<translation id="7221155467930685510">$1 Гб</translation>
+<translation id="7221155467930685510">$1 ГБ</translation>
<translation id="7221855153210829124">показувати сповіщення</translation>
<translation id="7221869452894271364">Перезавантажити цю сторінку</translation>
<translation id="7222232353993864120">Електронна адреса</translation>
@@ -4829,7 +4829,7 @@
<translation id="8075191520954018715">Стан пам’яті</translation>
<translation id="8077684120002777443">Ім’я користувача (наприклад, imyakorystuvacha@pryklad.com)</translation>
<translation id="8079530767338315840">Повторити</translation>
-<translation id="8083739373364455075">Отримайте безкоштовно 100 Гб на Диску Google</translation>
+<translation id="8083739373364455075">Отримайте безкоштовно 100 ГБ на Диску Google</translation>
<translation id="8086015605808120405">Налаштування принтера <ph name="PRINTER_NAME" />…</translation>
<translation id="8088137642766812908">Увага, ця функція непередбачувана!</translation>
<translation id="8090234456044969073">Переглядати список ваших найчастіше відвідуваних веб-сайтів</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_vi.xtb b/chromium/chrome/app/resources/generated_resources_vi.xtb
index dfc8fcbce47..ea33594a34c 100644
--- a/chromium/chrome/app/resources/generated_resources_vi.xtb
+++ b/chromium/chrome/app/resources/generated_resources_vi.xtb
@@ -1616,7 +1616,7 @@ Vui lòng kiểm tra email của bạn tại <ph name="ACCOUNT_EMAIL" /> để b
<translation id="3280237271814976245">Lưu &amp;thành...</translation>
<translation id="3280243678470289153">Tiếp tục điều hướng trong Chrome</translation>
<translation id="3280431534455935878">Đang chuẩn bị</translation>
-<translation id="3282568296779691940">Đăng nhập Chrome</translation>
+<translation id="3282568296779691940">Đăng nhập vào Chrome</translation>
<translation id="3285322247471302225">&amp;Tab Mới</translation>
<translation id="3288047731229977326">Tiện ích chạy ở chế độ nhà phát triển có thể gây hại cho máy tính của bạn. Nếu bạn không phải là nhà phát triển, bạn nên vô hiệu hóa các tiện ích này chạy trong chế độ nhà phát triển để giữ an toàn.</translation>
<translation id="3289856944988573801">Để kiểm tra các cập nhật, hãy sử dụng kết nối Ethernet hoặc Wi-Fi.</translation>
@@ -4732,7 +4732,7 @@ Chỉ sử dụng tính năng này với các tài khoản mà bạn tin tưởn
<translation id="7957615753207896812">Mở cài đặt thiết bị bàn phím</translation>
<translation id="7959074893852789871">Tệp có chứa nhiều chứng chỉ, một vài chứng chỉ trong đó chưa được nhập:</translation>
<translation id="7959700692661109221"><ph name="BEGIN_PARAGRAPH" />Dịch vụ vị trí của Google sử dụng các nguồn như Wi-Fi để giúp ước đoán vị trí thiết bị của bạn nhanh hơn và chính xác hơn. Khi bạn bật dịch vụ vị trí của Google, thiết bị của bạn sẽ dùng chế độ sử dụng Wi-Fi để cung cấp thông tin vị trí. Bạn có thể tắt dịch vụ này trong cài đặt vị trí bất cứ lúc nào.<ph name="END_PARAGRAPH" /></translation>
-<translation id="7961015016161918242">Chưa bao giờ</translation>
+<translation id="7961015016161918242">Không bao giờ</translation>
<translation id="7965010376480416255">Bộ nhớ Dùng chung</translation>
<translation id="7966241909927244760">S&amp;ao chép địa chỉ hình ảnh</translation>
<translation id="7967437925638594022">Tiện ích và ứng dụng</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_ko.xtb b/chromium/chrome/app/resources/google_chrome_strings_ko.xtb
index 8cd71248a2d..31b2b547b7b 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_ko.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_ko.xtb
@@ -289,7 +289,7 @@ Chrome에서 설정을 복구할 수 없습니다.</translation>
<translation id="9026991721384951619">계정의 로그인 세부정보가 오래되어 Chrome OS에서 데이터를 동기화하지 못했습니다.</translation>
<translation id="9067395829937117663">Chrome은 Windows 7 이상 버전에서 사용할 수 있습니다.</translation>
<translation id="9107728822479888688"><ph name="BEGIN_BOLD" />경고:<ph name="END_BOLD" /> Chrome에서는 확장 프로그램에 인터넷 사용기록이 저장될 수 있습니다. 시크릿 모드에서 이 확장 프로그램을 사용 중지하려면 옵션을 선택 취소하세요.</translation>
-<translation id="911206726377975832">인터넷 사용정보도 삭제하시겠습니까?</translation>
+<translation id="911206726377975832">인터넷 사용 기록도 삭제하시겠습니까?</translation>
<translation id="919706545465235479">동기화를 시작하려면 Chrome을 업데이트하세요.</translation>
<translation id="924447568950697217">Chrome을 기본 브라우저로 지정</translation>
<translation id="989369509083708165">Chrome이 기본 브라우저로 설정되어 있습니다.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_mr.xtb b/chromium/chrome/app/resources/google_chrome_strings_mr.xtb
index 6c01e814fbf..5be397bd7e4 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_mr.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_mr.xtb
@@ -138,7 +138,7 @@
<translation id="4921569541910214635">एक संगणक सामायिक करायचा? आपल्याला आवडते त्या प्रकारे आपण आता Chrome सेट करू शकता.</translation>
<translation id="4953650215774548573">आपला डीफॉल्ट ब्राउझर म्हणून Google Chrome सेट करा</translation>
<translation id="495931528404527476">Chrome मध्ये</translation>
-<translation id="4965682129423310439">Chrome ला तुमच्या कॉंप्युटरवर धोकादायक सॉफ्टवेअर आढळले. Chrome ते काढून टाकून तुमचा ब्राउझर पुन्हा नीट चालावा यासाठी तुमच्या सेटिंग्ज रीस्टोअर करू शकते.</translation>
+<translation id="4965682129423310439">Chrome ला तुमच्या काँप्युटरवर धोकादायक सॉफ्टवेअर आढळले. Chrome ते काढून टाकून तुमचा ब्राउझर पुन्हा नीट चालावा यासाठी तुमच्या सेटिंग्ज रीस्टोअर करू शकते.</translation>
<translation id="4987308747895123092">कृपया सर्व Google Chrome विंडो बंद करा (Windows 8 मोडमधील अशासह) आणि पुन्हा प्रयत्न करा.</translation>
<translation id="4990567037958725628">Google Chrome कॅनरी</translation>
<translation id="5028489144783860647">Google Chrome आपला डेटा संकालित करू शकले नाही. कृपया आपला संकालन वाक्यांश अद्यतनित करा.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_ru.xtb b/chromium/chrome/app/resources/google_chrome_strings_ru.xtb
index 1c2191fa818..6b52ac094f0 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_ru.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_ru.xtb
@@ -63,7 +63,7 @@
<translation id="2586406160782125153">Данные о работе в браузере будут удалены с устройства. Чтобы восстановить данные позже, войдите в Chrome как <ph name="USER_EMAIL" />.</translation>
<translation id="2588322182880276190">Логотип Chrome</translation>
<translation id="2664962310688259219">Лицензии Chrome OS на ПО с открытым исходным кодом</translation>
-<translation id="2665296953892887393">Помочь улучшить Google Chrome, отправляя в Google отчеты о сбоях и <ph name="UMA_LINK" /></translation>
+<translation id="2665296953892887393">Отправлять в Google такие данные, как отчеты о сбоях и <ph name="UMA_LINK" />, чтобы помочь улучшить Google Chrome</translation>
<translation id="2689103672227170538">Расширение изменило стартовую страницу Chrome.</translation>
<translation id="2769762047821873045">Google Chrome не является браузером по умолчанию.</translation>
<translation id="2770231113462710648">Назначить браузером по умолчанию:</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_sk.xtb b/chromium/chrome/app/resources/google_chrome_strings_sk.xtb
index 0687586a299..3396ddc322a 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_sk.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_sk.xtb
@@ -244,7 +244,7 @@ Prehliadač Google Chrome nedokáže obnoviť vaše nastavenia.</translation>
<translation id="7787950393032327779">Zdá sa, že profil používa ďalší proces prehliadača Google Chrome (<ph name="PROCESS_ID" />) na inom počítači (<ph name="HOST_NAME" />). Prehliadač Chrome daný profil uzamkol, aby sa nepoškodil. Ak s istotou viete, že tento profil nepoužívajú žiadne iné procesy, môžete ho odomknúť a prehliadač Chrome znova spustiť.</translation>
<translation id="7808348361785373670">Odstrániť z prehliadača Chrome...</translation>
<translation id="7825851276765848807">Inštalácia zlyhala kvôli neznámej chybe. Skúste aplikáciu Google Chrome stiahnuť znova.</translation>
-<translation id="7855730255114109580">Prehliadač Google Chrome je aktuálny</translation>
+<translation id="7855730255114109580">Google Chrome je aktuálny.</translation>
<translation id="7888186132678118370">Pripnutie Chromu na paneli úloh</translation>
<translation id="7890208801193284374">Ak počítač zdieľate s rodinou a priateľmi, môžu v prehliadači Chrome prehliadať oddelene a tiež si ho nastaviť podľa vlastných požiadaviek.</translation>
<translation id="7896673875602241923">Do Chromu sa už na tomto počítači niekto prihlásil pomocou účtu <ph name="ACCOUNT_EMAIL_LAST" />. Ak chcete ponechať svoje informácie oddelené, vytvorte v Chrome nového používateľa.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_vi.xtb b/chromium/chrome/app/resources/google_chrome_strings_vi.xtb
index b7ef043777b..9d7e2d01b08 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_vi.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_vi.xtb
@@ -86,7 +86,7 @@
<ph name="BEGIN_LINK_2" />Tìm hiểu thêm<ph name="END_LINK_2" />
Vui lòng xem email của bạn tại <ph name="ACCOUNT_EMAIL" /> để biết thêm hướng dẫn.</translation>
-<translation id="3282568296779691940">Đăng nhập Chrome</translation>
+<translation id="3282568296779691940">Đăng nhập vào Chrome</translation>
<translation id="3311976847535831054">Máy tính này sẽ không còn nhận bản cập nhật Google Chrome 32 bit nữa. Vui lòng nâng cấp lên Google Chrome 64 bit.</translation>
<translation id="3360895254066713204">Trình trợ giúp của Chrome</translation>
<translation id="3395323229510056640">Nhận trợ giúp về Chrome OS</translation>
diff --git a/chromium/chrome/browser/extensions/api/automation/automation_apitest.cc b/chromium/chrome/browser/extensions/api/automation/automation_apitest.cc
index 2479fa6aca6..5e299f0d067 100644
--- a/chromium/chrome/browser/extensions/api/automation/automation_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/automation/automation_apitest.cc
@@ -31,6 +31,7 @@
#include "ui/accessibility/ax_tree.h"
#include "ui/accessibility/ax_tree_serializer.h"
#include "ui/accessibility/tree_generator.h"
+#include "ui/display/display_switches.h"
#if defined(OS_CHROMEOS)
#include "ash/accelerators/accelerator_controller.h"
@@ -298,4 +299,22 @@ IN_PROC_BROWSER_TEST_F(AutomationApiTest, HitTest) {
<< message_;
}
+#if defined(OS_CHROMEOS)
+
+class AutomationApiTestWithDeviceScaleFactor : public AutomationApiTest {
+ protected:
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ AutomationApiTest::SetUpCommandLine(command_line);
+ command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, "2.0");
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(AutomationApiTestWithDeviceScaleFactor, LocationScaled) {
+ StartEmbeddedTestServer();
+ ASSERT_TRUE(RunPlatformAppTest("automation/tests/location_scaled"))
+ << message_;
+}
+
+#endif // defined(OS_CHROMEOS)
+
} // namespace extensions
diff --git a/chromium/chrome/browser/printing/print_job_worker.cc b/chromium/chrome/browser/printing/print_job_worker.cc
index d06b61aaf61..07850f544b6 100644
--- a/chromium/chrome/browser/printing/print_job_worker.cc
+++ b/chromium/chrome/browser/printing/print_job_worker.cc
@@ -216,12 +216,13 @@ void PrintJobWorker::GetSettingsWithUI(
bool is_scripted) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ PrintingContextDelegate* printing_context_delegate =
+ static_cast<PrintingContextDelegate*>(printing_context_delegate_.get());
+ content::WebContents* web_contents =
+ printing_context_delegate->GetWebContents();
+
#if defined(OS_ANDROID)
if (is_scripted) {
- PrintingContextDelegate* printing_context_delegate =
- static_cast<PrintingContextDelegate*>(printing_context_delegate_.get());
- content::WebContents* web_contents =
- printing_context_delegate->GetWebContents();
TabAndroid* tab =
web_contents ? TabAndroid::FromWebContents(web_contents) : nullptr;
@@ -233,6 +234,11 @@ void PrintJobWorker::GetSettingsWithUI(
}
#endif
+ // Running a dialog causes an exit to webpage-initiated fullscreen.
+ // http://crbug.com/728276
+ if (web_contents->IsFullscreenForCurrentTab())
+ web_contents->ExitFullscreen(true);
+
// weak_factory_ creates pointers valid only on owner_ thread.
printing_context_->AskUserForSettings(
document_page_count, has_selection, is_scripted,
diff --git a/chromium/chrome/browser/printing/print_view_manager.cc b/chromium/chrome/browser/printing/print_view_manager.cc
index 29cb6876a50..fa54bcc082d 100644
--- a/chromium/chrome/browser/printing/print_view_manager.cc
+++ b/chromium/chrome/browser/printing/print_view_manager.cc
@@ -220,6 +220,11 @@ void PrintViewManager::OnShowScriptedPrintPreview(content::RenderFrameHost* rfh,
return;
}
+ // Running a dialog causes an exit to webpage-initiated fullscreen.
+ // http://crbug.com/728276
+ if (web_contents()->IsFullscreenForCurrentTab())
+ web_contents()->ExitFullscreen(true);
+
dialog_controller->PrintPreview(web_contents());
PrintHostMsg_RequestPrintPreview_Params params;
params.is_modifiable = source_is_modifiable;
diff --git a/chromium/chrome/browser/resources/print_preview/preview_generator.js b/chromium/chrome/browser/resources/print_preview/preview_generator.js
index 0e492e76e6b..55189a3c913 100644
--- a/chromium/chrome/browser/resources/print_preview/preview_generator.js
+++ b/chromium/chrome/browser/resources/print_preview/preview_generator.js
@@ -204,7 +204,7 @@ cr.define('print_preview', function() {
this.selectedDestination_ = this.destinationStore_.selectedDestination;
this.inFlightRequestId_++;
- this.generateDraft_ = this.documentInfo_.isModifiable && previewChanged;
+ this.generateDraft_ = this.documentInfo_.isModifiable;
this.nativeLayer_.startGetPreview(
this.destinationStore_.selectedDestination,
this.printTicketStore_,
diff --git a/chromium/codereview.settings b/chromium/codereview.settings
index cb9f5f956c3..e9a4d00087a 100644
--- a/chromium/codereview.settings
+++ b/chromium/codereview.settings
@@ -1,13 +1,9 @@
# This file is used by git-cl to get repository specific information.
+PROJECT: chromium
CODE_REVIEW_SERVER: codereview.chromium.org
+GERRIT_HOST: True
CC_LIST: chromium-reviews@chromium.org
VIEW_VC: https://chromium.googlesource.com/chromium/src/+/
STATUS: http://chromium-status.appspot.com/status
TRY_ON_UPLOAD: True
-TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try
-GITCL_PREUPLOAD: http://src.chromium.org/viewvc/trunk/tools/depot_tools/git-cl-upload-hook?revision=HEAD&root=chrome
-GITCL_PREDCOMMIT: http://src.chromium.org/viewvc/trunk/tools/depot_tools/git-cl-upload-hook?revision=HEAD&root=chrome
LINT_IGNORE_REGEX: webkit/api/.*
-PROJECT: chromium
-PENDING_REF_PREFIX: refs/pending/
-RUN_POST_UPLOAD_HOOK: True
diff --git a/chromium/components/printing/renderer/print_web_view_helper.cc b/chromium/components/printing/renderer/print_web_view_helper.cc
index 50ab353c84c..829b2dc1c65 100644
--- a/chromium/components/printing/renderer/print_web_view_helper.cc
+++ b/chromium/components/printing/renderer/print_web_view_helper.cc
@@ -581,7 +581,15 @@ void PrintWebViewHelper::PrintHeaderAndFooter(
blink::WebView::Create(nullptr, blink::kWebPageVisibilityStateVisible);
web_view->GetSettings()->SetJavaScriptEnabled(true);
- blink::WebFrameClient frame_client;
+ class HeaderAndFooterClient final : public blink::WebFrameClient {
+ public:
+ void FrameDetached(blink::WebLocalFrame* frame,
+ DetachType detach_type) override {
+ frame->FrameWidget()->Close();
+ frame->Close();
+ }
+ };
+ HeaderAndFooterClient frame_client;
blink::WebLocalFrame* frame = blink::WebLocalFrame::Create(
blink::WebTreeScopeType::kDocument, &frame_client, nullptr, nullptr);
web_view->SetMainFrame(frame);
@@ -680,6 +688,8 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
blink::WebSandboxFlags sandbox_flags,
const blink::WebParsedFeaturePolicy& container_policy,
const blink::WebFrameOwnerProperties& frame_owner_properties) override;
+ void FrameDetached(blink::WebLocalFrame* frame,
+ DetachType detach_type) override;
std::unique_ptr<blink::WebURLLoader> CreateURLLoader() override;
void CallOnReady();
@@ -846,6 +856,12 @@ blink::WebLocalFrame* PrepareFrameAndViewForPrint::CreateChildFrame(
return nullptr;
}
+void PrepareFrameAndViewForPrint::FrameDetached(blink::WebLocalFrame* frame,
+ DetachType detach_type) {
+ frame->FrameWidget()->Close();
+ frame->Close();
+}
+
std::unique_ptr<blink::WebURLLoader>
PrepareFrameAndViewForPrint::CreateURLLoader() {
// TODO(yhirano): Stop using Platform::CreateURLLoader() here.
@@ -883,7 +899,6 @@ void PrepareFrameAndViewForPrint::FinishPrinting() {
if (owns_web_view_) {
DCHECK(!frame->IsLoading());
owns_web_view_ = false;
- frame->FrameWidget()->Close();
web_view->Close();
}
}
diff --git a/chromium/components/safe_browsing/password_protection/password_protection_service.cc b/chromium/components/safe_browsing/password_protection/password_protection_service.cc
index bdc9cff88cd..69630426e8b 100644
--- a/chromium/components/safe_browsing/password_protection/password_protection_service.cc
+++ b/chromium/components/safe_browsing/password_protection/password_protection_service.cc
@@ -148,11 +148,14 @@ PasswordProtectionService::GetCachedVerdict(
for (base::DictionaryValue::Iterator it(*verdict_dictionary.get());
!it.IsAtEnd(); it.Advance()) {
base::DictionaryValue* verdict_entry = nullptr;
- CHECK(verdict_dictionary->GetDictionaryWithoutPathExpansion(
- it.key() /* cache_expression */, &verdict_entry));
+ verdict_dictionary->GetDictionaryWithoutPathExpansion(
+ it.key() /* cache_expression */, &verdict_entry);
int verdict_received_time;
LoginReputationClientResponse verdict;
- CHECK(ParseVerdictEntry(verdict_entry, &verdict_received_time, &verdict));
+ // Ignore any entry that we cannot parse. These invalid entries will be
+ // cleaned up during shutdown.
+ if (!ParseVerdictEntry(verdict_entry, &verdict_received_time, &verdict))
+ continue;
// Since password protection content settings are keyed by origin, we only
// need to compare the path part of the cache_expression and the given url.
std::string cache_expression_path =
@@ -229,13 +232,13 @@ void PasswordProtectionService::CleanUpExpiredVerdicts() {
for (base::DictionaryValue::Iterator it(*verdict_dictionary.get());
!it.IsAtEnd(); it.Advance()) {
base::DictionaryValue* verdict_entry = nullptr;
- CHECK(verdict_dictionary->GetDictionaryWithoutPathExpansion(
- it.key(), &verdict_entry));
+ verdict_dictionary->GetDictionaryWithoutPathExpansion(it.key(),
+ &verdict_entry);
int verdict_received_time;
LoginReputationClientResponse verdict;
- CHECK(ParseVerdictEntry(verdict_entry, &verdict_received_time, &verdict));
- if (IsCacheExpired(verdict_received_time, verdict.cache_duration_sec())) {
+ if (!ParseVerdictEntry(verdict_entry, &verdict_received_time, &verdict) ||
+ IsCacheExpired(verdict_received_time, verdict.cache_duration_sec())) {
// Since DictionaryValue::Iterator cannot be used to modify the
// dictionary, we record the keys of expired verdicts in |expired_keys|
// and remove them in the next for-loop.
diff --git a/chromium/components/safe_browsing/password_protection/password_protection_service_unittest.cc b/chromium/components/safe_browsing/password_protection/password_protection_service_unittest.cc
index 3deb72a2720..9748541fecb 100644
--- a/chromium/components/safe_browsing/password_protection/password_protection_service_unittest.cc
+++ b/chromium/components/safe_browsing/password_protection/password_protection_service_unittest.cc
@@ -208,6 +208,27 @@ class PasswordProtectionServiceTest : public testing::Test {
return password_protection_service_->GetStoredVerdictCount();
}
+ void CacheInvalidVerdict() {
+ GURL invalid_hostname("http://invalid.com");
+ std::unique_ptr<base::DictionaryValue> verdict_dictionary =
+ base::DictionaryValue::From(content_setting_map_->GetWebsiteSetting(
+ invalid_hostname, GURL(), CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION,
+ std::string(), nullptr));
+
+ if (!verdict_dictionary.get())
+ verdict_dictionary = base::MakeUnique<base::DictionaryValue>();
+
+ std::unique_ptr<base::DictionaryValue> invalid_verdict_entry =
+ base::MakeUnique<base::DictionaryValue>();
+ invalid_verdict_entry->SetString("invalid", "invalid_string");
+
+ verdict_dictionary->SetWithoutPathExpansion(
+ "invalid_cache_expression", std::move(invalid_verdict_entry));
+ content_setting_map_->SetWebsiteSettingDefaultScope(
+ invalid_hostname, GURL(), CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION,
+ std::string(), std::move(verdict_dictionary));
+ }
+
protected:
// |thread_bundle_| is needed here because this test involves both UI and IO
// threads.
@@ -593,6 +614,23 @@ TEST_F(PasswordProtectionServiceTest, TestCleanUpExpiredVerdict) {
std::string(), nullptr));
}
+TEST_F(PasswordProtectionServiceTest,
+ TestCleanUpExpiredVerdictWithInvalidEntry) {
+ CacheInvalidVerdict();
+ ContentSettingsForOneType password_protection_settings;
+ content_setting_map_->GetSettingsForOneType(
+ CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION, std::string(),
+ &password_protection_settings);
+ ASSERT_FALSE(password_protection_settings.empty());
+
+ password_protection_service_->CleanUpExpiredVerdicts();
+
+ content_setting_map_->GetSettingsForOneType(
+ CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION, std::string(),
+ &password_protection_settings);
+ EXPECT_TRUE(password_protection_settings.empty());
+}
+
TEST_F(PasswordProtectionServiceTest, VerifyPasswordOnFocusRequestProto) {
// Set up valid response.
net::TestURLFetcher fetcher(0, GURL("http://bar.com"), nullptr);
diff --git a/chromium/components/strings/components_strings_de.xtb b/chromium/components/strings/components_strings_de.xtb
index 16544a13fe6..b570217645e 100644
--- a/chromium/components/strings/components_strings_de.xtb
+++ b/chromium/components/strings/components_strings_de.xtb
@@ -924,7 +924,7 @@
<translation id="9020200922353704812">Rechnungsadresse für Kreditkarte erforderlich</translation>
<translation id="9020542370529661692">Die Seite wurde übersetzt und liegt nun auf <ph name="TARGET_LANGUAGE" /> vor.</translation>
<translation id="9035022520814077154">Sicherheitsfehler</translation>
-<translation id="9038649477754266430">Vorhersagedienst zum schnelleren Laden von Seiten verwenden</translation>
+<translation id="9038649477754266430">Vervollständigungsfunktion zum schnelleren Laden von Seiten verwenden</translation>
<translation id="9039213469156557790">Außerdem enthält diese Seite andere, nicht sichere Ressourcen. Diese Ressourcen können während der Übertragung von anderen Nutzern angezeigt und von Angreifern bearbeitet werden, die das Verhalten der Seite verändern.</translation>
<translation id="9049981332609050619">Sie haben versucht, auf <ph name="DOMAIN" /> zuzugreifen, der Server hat sich jedoch mit einem ungültigen Zertifikat ausgewiesen.</translation>
<translation id="9050666287014529139">Passphrase</translation>
diff --git a/chromium/components/strings/components_strings_gu.xtb b/chromium/components/strings/components_strings_gu.xtb
index 9b2a35ffb39..3b3e194d072 100644
--- a/chromium/components/strings/components_strings_gu.xtb
+++ b/chromium/components/strings/components_strings_gu.xtb
@@ -690,7 +690,7 @@
<translation id="6810899417690483278">કસ્ટમાઇઝેશન ID</translation>
<translation id="6820686453637990663">CVC</translation>
<translation id="6824266427216888781">પ્રદેશનો ડેટા લોડ કરવામાં નિષ્ફળ થયાં</translation>
-<translation id="6825578344716086703">તમે <ph name="DOMAIN" /> પર પહોંચવાનો પ્રયાસ કર્યો, પરંતુ સર્વરે નબળા હસ્તાક્ષર અલ્ગોરિધમ (જેમ કે SHA-1)નો ઉપયોગ કરીને હસ્તાક્ષરિત કરેલું પ્રમાણપત્ર પ્રસ્તુત કર્યું. આનો અર્થ એ છે કે સર્વરે પ્રસ્તુત કરેલા સુરક્ષા પ્રમાણપત્રો બનાવટી હોઈ શકે છે અને તે સર્વર તમારું અપેક્ષિત સર્વર (તમે કોઈ હુમલાખોર સાથે વાર્તાલાપ કરતા હોએ શકે) ન પણ હોય.</translation>
+<translation id="6825578344716086703">તમે <ph name="DOMAIN" /> પર પહોંચવાનો પ્રયાસ કર્યો, પરંતુ સર્વરે નબળા હસ્તાક્ષર અલ્ગોરિધમ (જેમ કે SHA-1)નો ઉપયોગ કરીને હસ્તાક્ષરિત કરેલું પ્રમાણપત્ર પ્રસ્તુત કર્યું. આનો અર્થ એ છે કે સર્વરે પ્રસ્તુત કરેલા સુરક્ષા પ્રમાણપત્રો બનાવટી હોઈ શકે છે અને તે સર્વર તમારું અપેક્ષિત સર્વર (તમે કોઈ હુમલાખોર સાથે વાર્તાલાપ કરતા હોય શકે) ન પણ હોય.</translation>
<translation id="6830728435402077660">સુરક્ષિત નથી</translation>
<translation id="6831043979455480757">અનુવાદ કરો</translation>
<translation id="6839929833149231406">વિસ્તાર</translation>
diff --git a/chromium/components/strings/components_strings_hi.xtb b/chromium/components/strings/components_strings_hi.xtb
index 9e86d87d351..f44ffd1e4c7 100644
--- a/chromium/components/strings/components_strings_hi.xtb
+++ b/chromium/components/strings/components_strings_hi.xtb
@@ -13,7 +13,7 @@
<translation id="1074497978438210769">सुरक्षित नहीं है</translation>
<translation id="1080116354587839789">चौड़ाई में फ़िट करें</translation>
<translation id="1103523840287552314"><ph name="LANGUAGE" /> का हमेशा अनुवाद करें</translation>
-<translation id="1107591249535594099">चेक किए होने पर, अधिक तेज़ फ़ॉर्म भरने के लिए Chrome इस डिवाइस पर आपके कार्ड की प्रतिलिपि संग्रहित कर लेगा.</translation>
+<translation id="1107591249535594099">चेक किए होने पर, अधिक तेज़ फ़ॉर्म भरने के लिए Chrome इस डिवाइस पर आपके कार्ड की कॉपी संग्रहित कर लेगा.</translation>
<translation id="1111153019813902504">हाल के बुकमार्क</translation>
<translation id="1113869188872983271">&amp;पुन: क्रमित करना वापस लाएं</translation>
<translation id="1126551341858583091">स्थानीय जगह का आकार <ph name="CRASH_SIZE" /> है.</translation>
@@ -254,7 +254,7 @@
<translation id="2986368408720340940">पिकअप का यह तरीका उपलब्ध नहीं है. कोई दूसरा तरीका आज़माएं.</translation>
<translation id="2991174974383378012">वेबसाइटों के साथ साझाकरण</translation>
<translation id="2991571918955627853">आप इस समय <ph name="SITE" /> पर नहीं जा सकते हैं क्योंकि वेबसाइट HSTS का उपयोग करती है. नेटवर्क की गड़बड़ियां और हमले आमतौर पर कुछ समय के लिए होते हैं, इसलिए पेज शायद बाद में ठीक से काम करेगा.</translation>
-<translation id="3005723025932146533">सहेजी गई प्रतिलिपि दिखाएं</translation>
+<translation id="3005723025932146533">सहेजी गई कॉपी दिखाएं</translation>
<translation id="3008447029300691911"><ph name="CREDIT_CARD" /> का CVC डालें. आपकी तरफ से पुष्टि हो जाने पर, आपके कार्ड के विवरण इस साइट के साथ साझा किए जाएंगे.</translation>
<translation id="3010559122411665027">सूची प्रविष्ट‍ि "<ph name="ENTRY_INDEX" />": <ph name="ERROR" /></translation>
<translation id="301521992641321250">ऑटोमैटिक रूप से ब्लॉक है</translation>
@@ -333,7 +333,7 @@
<translation id="3498215018399854026">हम इस समय आपके अभिभावक तक नहीं पहुंच पा रहे हैं. कृपया पुन: प्रयास करें.</translation>
<translation id="3528171143076753409">सर्वर का प्रमाणपत्र विश्वसनीय नहीं है.</translation>
<translation id="3530944546672790857">{COUNT,plural, =0{सिंक किए हुए डिवाइस पर कम से कम 1 आइटम}=1{1 आइटम (सिंक किए हुए डिवाइस पर और भी बहुत कुछ)}one{# आइटम (सिंक किए हुए डिवाइस पर और भी बहुत कुछ)}other{# आइटम (सिंक किए हुए डिवाइस पर और भी बहुत कुछ)}}</translation>
-<translation id="3539171420378717834">इस डिवाइस पर इस कार्ड की प्रतिलिपि रखें</translation>
+<translation id="3539171420378717834">इस डिवाइस पर इस कार्ड की कॉपी रखें</translation>
<translation id="3542684924769048008">इसके लिए पासवर्ड का उपयोग करें:</translation>
<translation id="3545341443414427877"><ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> से निजी कनेक्शन नहीं बनाया जा सका क्योंकि आपके कंप्यूटर का दिनांक और समय (<ph name="DATE_AND_TIME" />) गलत है. <ph name="BEGIN_LEARN_MORE_LINK" />अधिक जानें<ph name="END_LEARN_MORE_LINK" /></translation>
<translation id="3549644494707163724">सभी समन्वयित डेटा को अपने स्वयं के समन्वयन पासफ़्रेज़ के साथ एन्क्रिप्ट करें</translation>
@@ -498,7 +498,7 @@
<translation id="5018422839182700155">यह पेज खुल नहीं पा रहा है</translation>
<translation id="5019198164206649151">बैकिंग संग्रह खराब स्थिति में है</translation>
<translation id="5023310440958281426">अपने व्यवस्थापक की नीतियां देखें</translation>
-<translation id="5029568752722684782">स्‍पष्‍ट प्रतिलिपि</translation>
+<translation id="5029568752722684782">स्‍पष्‍ट कॉपी</translation>
<translation id="5031870354684148875">Google अनुवाद के बारे में</translation>
<translation id="5039804452771397117">अनुमति दें</translation>
<translation id="5040262127954254034">निजता</translation>
diff --git a/chromium/components/strings/components_strings_ko.xtb b/chromium/components/strings/components_strings_ko.xtb
index 1d70dfa7908..fa984e4970e 100644
--- a/chromium/components/strings/components_strings_ko.xtb
+++ b/chromium/components/strings/components_strings_ko.xtb
@@ -8,7 +8,7 @@
<translation id="1038842779957582377">알 수 없는 이름</translation>
<translation id="1050038467049342496">다른 앱 닫기</translation>
<translation id="1055184225775184556">추가 실행 취소(&amp;U)</translation>
-<translation id="10614374240317010">비밀번호를 저장하지 않은 사이트</translation>
+<translation id="10614374240317010">저장되지 않음</translation>
<translation id="106701514854093668">데스크톱 북마크</translation>
<translation id="1074497978438210769">안전하지 않음</translation>
<translation id="1080116354587839789">너비에 맞춤</translation>
diff --git a/chromium/components/strings/components_strings_mr.xtb b/chromium/components/strings/components_strings_mr.xtb
index 25c25ede970..d60c4b80d0b 100644
--- a/chromium/components/strings/components_strings_mr.xtb
+++ b/chromium/components/strings/components_strings_mr.xtb
@@ -339,7 +339,7 @@
<translation id="3549644494707163724">आपल्या स्वतःच्या वाक्यांशासह सर्व संंकालित केलेला डेटा कूटबद्ध करा</translation>
<translation id="3556433843310711081">आपला व्यवस्थापक आपल्यासाठी ती अनावरोधित करू शकतो</translation>
<translation id="3566021033012934673">आपले कनेक्शन खाजगी नाही</translation>
-<translation id="3569145463236695319">&lt;p&gt;तुमच्या डिव्हाइसची तारीख आणि वेळ (<ph name="DATE_AND_TIME" />) चुकीची असल्यामुळे <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> साठी एक खाजगी कनेक्शन तयार करू शकत नाही.&lt;/p&gt;
+<translation id="3569145463236695319">&lt;p&gt;तुमच्या डीव्हाइसची तारीख आणि वेळ (<ph name="DATE_AND_TIME" />) चुकीची असल्यामुळे <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> साठी एक खाजगी कनेक्शन तयार करू शकत नाही.&lt;/p&gt;
&lt;p&gt;कृपया अ‍ॅपच्या &lt;strong&gt;सेटिंग्ज&lt;/strong&gt; मधील &lt;strong&gt;सामान्य&lt;/strong&gt; विभागातून तारीख आणि वेळ नीट करा.&lt;/p&gt; <ph name="BEGIN_LEARN_MORE_LINK" />आणखी जाणून घ्या<ph name="END_LEARN_MORE_LINK" /></translation>
<translation id="3574305903863751447"><ph name="CITY" />, <ph name="STATE" /> <ph name="COUNTRY" /></translation>
@@ -567,7 +567,7 @@
<translation id="5622887735448669177">आपण ही साइट सोडू इच्छिता?</translation>
<translation id="5629630648637658800">धोरण सेटिंग्ज लोड करण्यात अयशस्वी</translation>
<translation id="5631439013527180824">अवैध डिव्हाइस व्यवस्थापन टोकन</translation>
-<translation id="5633066919399395251">सध्या <ph name="BEGIN_BOLD" /><ph name="SITE" /><ph name="END_BOLD" /> वर असलेले हल्लेखोर कदाचित तुमच्या कॉंप्युटरमधील तुमची माहिती चोरू किंवा हटवू शकणारे धोकादायक प्रोग्राम (उदाहरणार्थ, फोटो, पासवर्ड, संदेश आणि क्रेडिट कार्डे) इंस्टॉल करण्याचा प्रयत्न करू शकतील. <ph name="BEGIN_LEARN_MORE_LINK" />आणखी जाणून घ्या<ph name="END_LEARN_MORE_LINK" /></translation>
+<translation id="5633066919399395251">सध्या <ph name="BEGIN_BOLD" /><ph name="SITE" /><ph name="END_BOLD" /> वर असलेले हल्लेखोर कदाचित तुमच्या काँप्युटरमधील तुमची माहिती चोरू किंवा हटवू शकणारे धोकादायक प्रोग्राम (उदाहरणार्थ, फोटो, पासवर्ड, संदेश आणि क्रेडिट कार्डे) इंस्टॉल करण्याचा प्रयत्न करू शकतील. <ph name="BEGIN_LEARN_MORE_LINK" />आणखी जाणून घ्या<ph name="END_LEARN_MORE_LINK" /></translation>
<translation id="5646376287012673985">स्थान</translation>
<translation id="5659593005791499971">ईमेल</translation>
<translation id="5669703222995421982">वैयक्तीकृत सामग्री मिळवा</translation>
@@ -858,7 +858,7 @@
<translation id="8289355894181816810">याचा निश्चित अर्थ आपल्याला माहिती नसल्यास आपल्या नेटवर्क प्रशासकाशी संपर्क साधा.</translation>
<translation id="8293206222192510085">बुकमार्क जोडा</translation>
<translation id="8294431847097064396">स्रोत</translation>
-<translation id="8306404619377842860">तुमच्या डिव्हाइसची तारीख आणि वेळ (<ph name="DATE_AND_TIME" />)चुकीची असल्यामुळे <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> साठी खाजगी कनेक्शन तयार करू शकत नाही. <ph name="BEGIN_LEARN_MORE_LINK" />आणखी जाणून घ्या<ph name="END_LEARN_MORE_LINK" /></translation>
+<translation id="8306404619377842860">तुमच्या डीव्हाइसची तारीख आणि वेळ (<ph name="DATE_AND_TIME" />)चुकीची असल्यामुळे <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" /> साठी खाजगी कनेक्शन तयार करू शकत नाही. <ph name="BEGIN_LEARN_MORE_LINK" />आणखी जाणून घ्या<ph name="END_LEARN_MORE_LINK" /></translation>
<translation id="8308427013383895095">नेटवर्क कनेक्शनसह समस्या असल्यामुळे भाषांतर अयशस्वी झाला.</translation>
<translation id="8332188693563227489"><ph name="HOST_NAME" /> मधील प्रवेश नाकारला</translation>
<translation id="834457929814110454">आपल्याला आपल्या सुरक्षिततेच्या जोखमी समजत असल्यास, धोकादायक प्रोग्राम काढले जाण्यापूर्वी आपण <ph name="BEGIN_LINK" />या असुरक्षित साइटला भेट देऊ शकता<ph name="END_LINK" />.</translation>
@@ -918,7 +918,7 @@
<translation id="8986494364107987395">Google ला वापर आकडेवारी आणि क्रॅश अहवाल स्वयंचलितपणे पाठवा</translation>
<translation id="8989148748219918422"><ph name="ORGANIZATION" /> [<ph name="COUNTRY" />]</translation>
<translation id="8996941253935762404">पुढे असणार्‍या साइटमध्ये हानिकारक प्रोग्राम आहेत</translation>
-<translation id="8997023839087525404">सर्व्हरने प्रमाणपत्र पारदर्शकता धोरणाचा वापर करून सार्वजनिकरित्या उघड न केलेले एक प्रमाणपत्र सादर केले. काही प्रमाणपत्रे विश्वसनीय आहेत आणि आक्रमणकर्त्यांविरूद्ध संरक्षण करतात हे सुनिश्चित करण्‍यासाठी त्यांच्यासाठी ही एक आवश्यकता आहे.</translation>
+<translation id="8997023839087525404">सर्व्हरने प्रमाणपत्र पारदर्शकता धोरणाचा वापर करून सार्वजनिकरीत्या उघड न केलेले एक प्रमाणपत्र सादर केले. काही प्रमाणपत्रे विश्वसनीय आहेत आणि आक्रमणकर्त्यांविरूद्ध संरक्षण करतात हे सुनिश्चित करण्‍यासाठी त्यांच्यासाठी ही एक आवश्यकता आहे.</translation>
<translation id="9001074447101275817">प्रॉक्सी <ph name="DOMAIN" /> ला वापरकर्तानाव आणि संकेतशब्द आवश्यक आहेत.</translation>
<translation id="9005998258318286617">PDF दस्तऐवज लोड करण्यात अपयश आले.</translation>
<translation id="901974403500617787">सिस्टीम-व्याप्त लागू होणारी ध्वजांकने केवळ मालकाद्वारे सेट केली जाऊ शकतात: <ph name="OWNER_EMAIL" />.</translation>
diff --git a/chromium/components/strings/components_strings_pt-BR.xtb b/chromium/components/strings/components_strings_pt-BR.xtb
index 4d408a8f5dd..b50edcdd1fd 100644
--- a/chromium/components/strings/components_strings_pt-BR.xtb
+++ b/chromium/components/strings/components_strings_pt-BR.xtb
@@ -471,7 +471,7 @@
<translation id="4756388243121344051">&amp;Histórico</translation>
<translation id="4758311279753947758">Adicionar dados de contato</translation>
<translation id="4759118997339041434">Preenchimento automático de pagamento desativado</translation>
-<translation id="4764776831041365478">A página da web em <ph name="URL" /> pode estar temporariamente indisponível ou pode ter sido movida permanentemente para um novo endereço da web.</translation>
+<translation id="4764776831041365478">A página da web em <ph name="URL" /> pode estar temporariamente indisponível ou pode ter sido movida permanentemente para um novo endereço da Web.</translation>
<translation id="4771973620359291008">Ocorreu um erro desconhecido.</translation>
<translation id="4800132727771399293">Verifique sua data de validade e seu CVC e tente novamente</translation>
<translation id="4803924862070940586"><ph name="CURRENCY_CODE" /> <ph name="FORMATTED_TOTAL_AMOUNT" /></translation>
@@ -539,7 +539,7 @@
<translation id="5431657950005405462">O arquivo não foi encontrado</translation>
<translation id="5439770059721715174">Erro de validação de esquema em "<ph name="ERROR_PATH" />": <ph name="ERROR" /></translation>
<translation id="5452270690849572955">Não foi possível encontrar a página deste <ph name="HOST_NAME" /></translation>
-<translation id="5455374756549232013">Carimbo de data e hora da política inválido</translation>
+<translation id="5455374756549232013">Carimbo de data/hora da política inválido</translation>
<translation id="5455790498993699893"><ph name="ACTIVE_MATCH" /> de <ph name="TOTAL_MATCHCOUNT" /></translation>
<translation id="5457113250005438886">Inválidos</translation>
<translation id="5470861586879999274">&amp;Refazer editar</translation>
@@ -761,7 +761,7 @@
<translation id="7485870689360869515">Nenhum dado encontrado</translation>
<translation id="7508255263130623398">O código do dispositivo da política retornado está em branco ou não corresponde ao código do dispositivo atual</translation>
<translation id="7514365320538308">Fazer o download</translation>
-<translation id="7518003948725431193">Nenhuma página da web foi encontrada para o endereço da web:<ph name="URL" /></translation>
+<translation id="7518003948725431193">Nenhuma página da web foi encontrada para o endereço da Web:<ph name="URL" /></translation>
<translation id="7521387064766892559">JavaScript</translation>
<translation id="7535087603100972091">Valor</translation>
<translation id="7537536606612762813">Obrigatória</translation>
@@ -807,7 +807,7 @@
<translation id="7764225426217299476">Adicionar endereço</translation>
<translation id="777702478322588152">Prefeitura</translation>
<translation id="7791543448312431591">Adicionar</translation>
-<translation id="7793809570500803535">A página da web em <ph name="SITE" /> pode estar temporariamente indisponível ou pode ter sido movida permanentemente para um novo endereço da web.</translation>
+<translation id="7793809570500803535">A página da web em <ph name="SITE" /> pode estar temporariamente indisponível ou pode ter sido movida permanentemente para um novo endereço da Web.</translation>
<translation id="7800304661137206267">A conexão foi criptografada utilizando <ph name="CIPHER" />, com <ph name="MAC" /> para mensagem de autenticação e <ph name="KX" /> como o mecanismo de troca de chaves.</translation>
<translation id="780301667611848630">Não</translation>
<translation id="7805768142964895445">Status</translation>
diff --git a/chromium/components/strings/components_strings_sk.xtb b/chromium/components/strings/components_strings_sk.xtb
index d329c618e89..91e13881d3c 100644
--- a/chromium/components/strings/components_strings_sk.xtb
+++ b/chromium/components/strings/components_strings_sk.xtb
@@ -948,7 +948,7 @@
<translation id="935608979562296692">VYMAZAŤ FORMULÁR</translation>
<translation id="939736085109172342">Nový priečinok</translation>
<translation id="941721044073577244">Zdá sa, že nemáte povolenie pristupovať na tento web</translation>
-<translation id="969892804517981540">Oficiálne zostavenie</translation>
+<translation id="969892804517981540">oficiálna zostava</translation>
<translation id="975560348586398090">{COUNT,plural, =0{Žiadne}=1{1 položka}few{# položky}many{# položky}other{# položiek}}</translation>
<translation id="988159990683914416">Zostavenie pre vývojárov</translation>
<translation id="992115559265932548"><ph name="MICROSOFT_ACTIVE_DIRECTORY" /></translation>
diff --git a/chromium/components/strings/components_strings_te.xtb b/chromium/components/strings/components_strings_te.xtb
index 04744c6548a..0e5ae16314c 100644
--- a/chromium/components/strings/components_strings_te.xtb
+++ b/chromium/components/strings/components_strings_te.xtb
@@ -339,9 +339,9 @@
<translation id="3549644494707163724">మీ స్వంత సమకాలీకరణ రహస్య పదబంధంతో సమకాలీకరించబడిన డేటా మొత్తాన్ని గుప్తీకరించండి</translation>
<translation id="3556433843310711081">మీ నిర్వాహకుడు మీ కోసం దీన్ని అన్‌బ్లాక్ చేయగలరు</translation>
<translation id="3566021033012934673">మీ కనెక్షన్ ప్రైవేట్ కాదు</translation>
-<translation id="3569145463236695319">&lt;p&gt;మీ కంప్యూటర్ తేదీ మరియు సమయం (<ph name="DATE_AND_TIME" />) తప్పుగా ఉన్నందున <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" />కి ప్రైవేట్ కనెక్షన్ ఏర్పాటు కాలేదు.&lt;/p&gt;
+<translation id="3569145463236695319">&lt;p&gt;మీ పరికరం తేదీ మరియు సమయం (<ph name="DATE_AND_TIME" />) తప్పుగా ఉన్నందున <ph name="BEGIN_BOLD" /><ph name="DOMAIN" /><ph name="END_BOLD" />కి ప్రైవేట్ కనెక్షన్ ఏర్పాటు కాలేదు.&lt;/p&gt;
- &lt;p&gt;దయచేసి అనువర్తన &lt;strong&gt;సెట్టింగ్‌లు&lt;/strong&gt; యొక్క &lt;strong&gt;సాధారణ&lt;/strong&gt; వర్గం నుండి తేదీ మరియు సమయాన్ని సర్దుబాటు చేయండి.&lt;/p&gt; <ph name="BEGIN_LEARN_MORE_LINK" />మరింత తెలుసుకోండి<ph name="END_LEARN_MORE_LINK" /></translation>
+ &lt;p&gt;దయచేసి &lt;strong&gt;సెట్టింగ్‌లు&lt;/strong&gt; అనువర్తనం యొక్క &lt;strong&gt;సాధారణ&lt;/strong&gt; విభాగం నుండి తేదీ మరియు సమయాన్ని సర్దుబాటు చేయండి.&lt;/p&gt; <ph name="BEGIN_LEARN_MORE_LINK" />మరింత తెలుసుకోండి<ph name="END_LEARN_MORE_LINK" /></translation>
<translation id="3574305903863751447"><ph name="CITY" />, <ph name="STATE" /> <ph name="COUNTRY" /></translation>
<translation id="3582930987043644930">పేరు జోడించండి</translation>
<translation id="3583757800736429874">&amp;తరలించడాన్ని పునరావృతం చేయి</translation>
@@ -529,7 +529,7 @@
<translation id="5308689395849655368">క్రాష్ నివేదిక నిలిపివెయ్యబడింది.</translation>
<translation id="5317780077021120954">సేవ్ చేయి</translation>
<translation id="5327248766486351172">పేరు</translation>
-<translation id="5355557959165512791"><ph name="SITE" /> యొక్క ప్రమాణపత్రం రద్దు చేయబడినందున మీరు దీన్ని సందర్శించలేరు. నెట్‌వర్క్ లోపాలు మరియు దాడులు సాధారణంగా తాత్కాలికమే, కనుక ఈ పేజీ తర్వాత పని చేయవచ్చు.</translation>
+<translation id="5355557959165512791"><ph name="SITE" /> యొక్క ప్రమాణపత్రం రద్దు చేయబడినందున మీరు ప్రస్తుతం దీన్ని సందర్శించలేరు. నెట్‌వర్క్ లోపాలు మరియు దాడులు సాధారణంగా తాత్కాలికమే, కనుక ఈ పేజీ తర్వాత పని చేయవచ్చు.</translation>
<translation id="536296301121032821">విధాన సెట్టింగ్‌లను నిల్వ చేయడంలో విఫలమైంది</translation>
<translation id="5386426401304769735">ఈ సైట్ ప్రమాణపత్రం గొలుసులో SHA-1 ఉపయోగించి సంతకం చేసిన ప్రమాణపత్రం ఉంది.</translation>
<translation id="5402410679244714488">గడువు ముగింపు: <ph name="EXPIRATION_DATE_ABBR" />, చివరిగా దాదాపు సంవత్సరం క్రితం ఉపయోగించబడింది</translation>
diff --git a/chromium/components/strings/components_strings_uk.xtb b/chromium/components/strings/components_strings_uk.xtb
index 0ecb8fc0b57..90ed0373f46 100644
--- a/chromium/components/strings/components_strings_uk.xtb
+++ b/chromium/components/strings/components_strings_uk.xtb
@@ -391,7 +391,7 @@
<translation id="3964661563329879394">{COUNT,plural, =0{Немає}=1{З 1 сайту }one{З # сайту }few{З # сайтів }many{З # сайтів }other{З # сайту }}</translation>
<translation id="397105322502079400">Обчислення...</translation>
<translation id="3973234410852337861">Хост <ph name="HOST_NAME" /> заблокований</translation>
-<translation id="3987940399970879459">Менше 1 Мб</translation>
+<translation id="3987940399970879459">Менше 1 МБ</translation>
<translation id="40103911065039147">{URL_count,plural, =1{1 веб-сторінка поруч}one{# веб-сторінка поруч}few{# веб-сторінки поруч}many{# веб-сторінок поруч}other{# веб-сторінки поруч}}</translation>
<translation id="4021036232240155012">DNS – це мережева служба, яка перетворює назву веб-сайту на його інтернет-адресу.</translation>
<translation id="4030383055268325496">&amp;Відмінити додавання</translation>
@@ -835,7 +835,7 @@
<translation id="8041089156583427627">Надіслати відгук</translation>
<translation id="8041940743680923270">Використовувати глобальне налаштування за умовчанням (Запитувати)</translation>
<translation id="8088680233425245692">Не вдалося переглянути статтю.</translation>
-<translation id="8089520772729574115">менше 1 Мб</translation>
+<translation id="8089520772729574115">менше 1 МБ</translation>
<translation id="8091372947890762290">Активація очікує на сервері</translation>
<translation id="8118489163946903409">Спосіб оплати</translation>
<translation id="8131740175452115882">Підтвердити</translation>
diff --git a/chromium/components/strings/components_strings_vi.xtb b/chromium/components/strings/components_strings_vi.xtb
index 2220e4fe80a..3c8efcf9643 100644
--- a/chromium/components/strings/components_strings_vi.xtb
+++ b/chromium/components/strings/components_strings_vi.xtb
@@ -824,7 +824,7 @@
<translation id="7947285636476623132">Kiểm tra năm hết hạn của bạn và thử lại</translation>
<translation id="7951415247503192394">(32 bit)</translation>
<translation id="7956713633345437162">Dấu trang di động</translation>
-<translation id="7961015016161918242">Chưa bao giờ</translation>
+<translation id="7961015016161918242">Không bao giờ</translation>
<translation id="7983301409776629893">Luôn dịch <ph name="ORIGINAL_LANGUAGE" /> sang <ph name="TARGET_LANGUAGE" /></translation>
<translation id="7995512525968007366">Không chỉ định</translation>
<translation id="800218591365569300">Thử đóng các tab hoặc chương trình khác để giải phóng bộ nhớ.</translation>
diff --git a/chromium/components/viz/display_compositor/host_shared_bitmap_manager.cc b/chromium/components/viz/display_compositor/host_shared_bitmap_manager.cc
index d781c9439cb..938d5fea8ec 100644
--- a/chromium/components/viz/display_compositor/host_shared_bitmap_manager.cc
+++ b/chromium/components/viz/display_compositor/host_shared_bitmap_manager.cc
@@ -42,7 +42,7 @@ class HostSharedBitmap : public cc::SharedBitmap {
scoped_refptr<BitmapData> bitmap_data,
const cc::SharedBitmapId& id,
HostSharedBitmapManager* manager)
- : SharedBitmap(pixels, id),
+ : SharedBitmap(pixels, id, 0 /* sequence_number */),
bitmap_data_(bitmap_data),
manager_(manager) {}
@@ -63,48 +63,78 @@ base::LazyInstance<HostSharedBitmapManager>::DestructorAtExit
HostSharedBitmapManagerClient::HostSharedBitmapManagerClient(
HostSharedBitmapManager* manager)
- : manager_(manager), binding_(this) {}
+ : manager_(manager), binding_(this) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+}
HostSharedBitmapManagerClient::~HostSharedBitmapManagerClient() {
- for (const auto& id : owned_bitmaps_)
- manager_->ChildDeletedSharedBitmap(id);
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ ChildDied();
}
void HostSharedBitmapManagerClient::Bind(
- cc::mojom::SharedBitmapManagerAssociatedRequest request) {
+ cc::mojom::SharedBitmapManagerRequest request) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ if (binding_.is_bound()) {
+ DLOG(ERROR) << "Only one SharedBitmapAllocationNotifierRequest is "
+ << "expected from the renderer.";
+ return;
+ }
binding_.Bind(std::move(request));
}
void HostSharedBitmapManagerClient::DidAllocateSharedBitmap(
mojo::ScopedSharedBufferHandle buffer,
const cc::SharedBitmapId& id) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
base::SharedMemoryHandle memory_handle;
size_t size;
MojoResult result = mojo::UnwrapSharedMemoryHandle(
std::move(buffer), &memory_handle, &size, NULL);
DCHECK_EQ(result, MOJO_RESULT_OK);
this->ChildAllocatedSharedBitmap(size, memory_handle, id);
+ last_sequence_number_++;
+ for (SharedBitmapAllocationObserver& observer : observers_)
+ observer.DidAllocateSharedBitmap(last_sequence_number_);
}
void HostSharedBitmapManagerClient::ChildAllocatedSharedBitmap(
size_t buffer_size,
const base::SharedMemoryHandle& handle,
const cc::SharedBitmapId& id) {
- if (manager_->ChildAllocatedSharedBitmap(buffer_size, handle, id)) {
- base::AutoLock lock(lock_);
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ if (manager_->ChildAllocatedSharedBitmap(buffer_size, handle, id))
owned_bitmaps_.insert(id);
- }
}
void HostSharedBitmapManagerClient::DidDeleteSharedBitmap(
const cc::SharedBitmapId& id) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
manager_->ChildDeletedSharedBitmap(id);
- {
- base::AutoLock lock(lock_);
- owned_bitmaps_.erase(id);
- }
+ owned_bitmaps_.erase(id);
+}
+
+void HostSharedBitmapManagerClient::ChildDied() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ for (const auto& id : owned_bitmaps_)
+ manager_->ChildDeletedSharedBitmap(id);
+ owned_bitmaps_.clear();
+ binding_.Close();
+}
+
+void HostSharedBitmapManagerClient::AddObserver(
+ SharedBitmapAllocationObserver* observer) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ observers_.AddObserver(observer);
}
+void HostSharedBitmapManagerClient::RemoveObserver(
+ SharedBitmapAllocationObserver* observer) {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ observers_.RemoveObserver(observer);
+}
+
+
HostSharedBitmapManager::HostSharedBitmapManager() {}
HostSharedBitmapManager::~HostSharedBitmapManager() {
DCHECK(handle_map_.empty());
diff --git a/chromium/components/viz/display_compositor/host_shared_bitmap_manager.h b/chromium/components/viz/display_compositor/host_shared_bitmap_manager.h
index b64b89ba3a6..0c075d11fb1 100644
--- a/chromium/components/viz/display_compositor/host_shared_bitmap_manager.h
+++ b/chromium/components/viz/display_compositor/host_shared_bitmap_manager.h
@@ -16,12 +16,14 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory.h"
+#include "base/observer_list.h"
#include "base/synchronization/lock.h"
+#include "base/threading/thread_checker.h"
#include "base/trace_event/memory_dump_provider.h"
#include "cc/ipc/shared_bitmap_manager.mojom.h"
#include "cc/resources/shared_bitmap_manager.h"
#include "components/viz/viz_export.h"
-#include "mojo/public/cpp/bindings/associated_binding.h"
+#include "mojo/public/cpp/bindings/binding.h"
namespace BASE_HASH_NAMESPACE {
template <>
@@ -36,6 +38,11 @@ namespace viz {
class BitmapData;
class HostSharedBitmapManager;
+class SharedBitmapAllocationObserver {
+ public:
+ virtual void DidAllocateSharedBitmap(uint32_t sequence_number) = 0;
+};
+
class VIZ_EXPORT HostSharedBitmapManagerClient
: NON_EXPORTED_BASE(public cc::mojom::SharedBitmapManager) {
public:
@@ -43,7 +50,10 @@ class VIZ_EXPORT HostSharedBitmapManagerClient
~HostSharedBitmapManagerClient() override;
- void Bind(cc::mojom::SharedBitmapManagerAssociatedRequest request);
+ void AddObserver(SharedBitmapAllocationObserver* observer);
+ void RemoveObserver(SharedBitmapAllocationObserver* observer);
+
+ void Bind(cc::mojom::SharedBitmapManagerRequest request);
// cc::mojom::SharedBitmapManager overrides:
void DidAllocateSharedBitmap(mojo::ScopedSharedBufferHandle buffer,
@@ -54,13 +64,17 @@ class VIZ_EXPORT HostSharedBitmapManagerClient
const base::SharedMemoryHandle& handle,
const cc::SharedBitmapId& id);
+ void ChildDied();
+
+ uint32_t last_sequence_number() const { return last_sequence_number_; }
+
private:
+ THREAD_CHECKER(thread_checker_);
HostSharedBitmapManager* manager_;
- mojo::AssociatedBinding<cc::mojom::SharedBitmapManager> binding_;
-
- // Lock must be held around access to owned_bitmaps_.
- base::Lock lock_;
+ mojo::Binding<cc::mojom::SharedBitmapManager> binding_;
base::hash_set<cc::SharedBitmapId> owned_bitmaps_;
+ base::ObserverList<SharedBitmapAllocationObserver> observers_;
+ uint32_t last_sequence_number_ = 0;
DISALLOW_COPY_AND_ASSIGN(HostSharedBitmapManagerClient);
};
diff --git a/chromium/content/browser/renderer_host/render_message_filter.cc b/chromium/content/browser/renderer_host/render_message_filter.cc
index 1cda159fe01..08fb0ced345 100644
--- a/chromium/content/browser/renderer_host/render_message_filter.cc
+++ b/chromium/content/browser/renderer_host/render_message_filter.cc
@@ -130,7 +130,6 @@ RenderMessageFilter::RenderMessageFilter(
arraysize(kFilteredMessageClasses)),
BrowserAssociatedInterface<mojom::RenderMessageFilter>(this, this),
resource_dispatcher_host_(ResourceDispatcherHostImpl::Get()),
- bitmap_manager_client_(viz::HostSharedBitmapManager::current()),
request_context_(request_context),
resource_context_(browser_context->GetResourceContext()),
render_widget_helper_(render_widget_helper),
@@ -213,11 +212,6 @@ void RenderMessageFilter::CreateFullscreenWidget(
std::move(callback).Run(route_id);
}
-void RenderMessageFilter::GetSharedBitmapManager(
- cc::mojom::SharedBitmapManagerAssociatedRequest request) {
- bitmap_manager_client_.Bind(std::move(request));
-}
-
#if defined(OS_MACOSX)
void RenderMessageFilter::OnLoadFont(const FontDescriptor& font,
diff --git a/chromium/content/browser/renderer_host/render_message_filter.h b/chromium/content/browser/renderer_host/render_message_filter.h
index 7b80db2710b..e44481f1942 100644
--- a/chromium/content/browser/renderer_host/render_message_filter.h
+++ b/chromium/content/browser/renderer_host/render_message_filter.h
@@ -20,7 +20,6 @@
#include "base/strings/string16.h"
#include "build/build_config.h"
#include "cc/resources/shared_bitmap_manager.h"
-#include "components/viz/display_compositor/host_shared_bitmap_manager.h"
#include "content/common/cache_storage/cache_storage_types.h"
#include "content/common/render_message_filter.mojom.h"
#include "content/public/browser/browser_associated_interface.h"
@@ -116,8 +115,6 @@ class CONTENT_EXPORT RenderMessageFilter
CreateNewWidgetCallback callback) override;
void CreateFullscreenWidget(int opener_id,
CreateFullscreenWidgetCallback callback) override;
- void GetSharedBitmapManager(
- cc::mojom::SharedBitmapManagerAssociatedRequest request) override;
// Message handlers called on the browser IO thread:
void OnHasGpuProcess(IPC::Message* reply);
@@ -159,8 +156,6 @@ class CONTENT_EXPORT RenderMessageFilter
// than we do.
ResourceDispatcherHostImpl* resource_dispatcher_host_;
- viz::HostSharedBitmapManagerClient bitmap_manager_client_;
-
// Contextual information to be used for requests created here.
scoped_refptr<net::URLRequestContextGetter> request_context_;
diff --git a/chromium/content/browser/renderer_host/render_process_host_impl.cc b/chromium/content/browser/renderer_host/render_process_host_impl.cc
index 149e8f8a510..7db804cc0fc 100644
--- a/chromium/content/browser/renderer_host/render_process_host_impl.cc
+++ b/chromium/content/browser/renderer_host/render_process_host_impl.cc
@@ -55,6 +55,7 @@
#include "cc/output/buffer_to_texture_target_map.h"
#include "components/metrics/single_sample_metrics.h"
#include "components/tracing/common/tracing_switches.h"
+#include "components/viz/display_compositor/host_shared_bitmap_manager.h"
#include "content/browser/appcache/appcache_dispatcher_host.h"
#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/background_fetch/background_fetch_service_impl.h"
@@ -957,6 +958,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
instance_weak_factory_(
new base::WeakPtrFactory<RenderProcessHostImpl>(this)),
frame_sink_provider_(id_),
+ shared_bitmap_allocation_notifier_impl_(
+ viz::HostSharedBitmapManager::current()),
weak_factory_(this) {
widget_helper_ = new RenderWidgetHelper();
@@ -1489,6 +1492,11 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
AddUIThreadInterface(
registry.get(),
+ base::Bind(&RenderProcessHostImpl::BindSharedBitmapAllocationNotifier,
+ base::Unretained(this)));
+
+ AddUIThreadInterface(
+ registry.get(),
base::Bind(&BackgroundSyncContext::CreateService,
base::Unretained(
storage_partition_impl_->GetBackgroundSyncContext())));
@@ -1637,6 +1645,12 @@ void RenderProcessHostImpl::BindFrameSinkProvider(
frame_sink_provider_.Bind(std::move(request));
}
+void RenderProcessHostImpl::BindSharedBitmapAllocationNotifier(
+ const service_manager::BindSourceInfo& source_info,
+ cc::mojom::SharedBitmapManagerRequest request) {
+ shared_bitmap_allocation_notifier_impl_.Bind(std::move(request));
+}
+
void RenderProcessHostImpl::CreateStoragePartitionService(
const service_manager::BindSourceInfo& source_info,
mojom::StoragePartitionServiceRequest request) {
@@ -3196,6 +3210,8 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead,
// for that.
frame_sink_provider_.Unbind();
+ shared_bitmap_allocation_notifier_impl_.ChildDied();
+
// This object is not deleted at this point and might be reused later.
// TODO(darin): clean this up
}
@@ -3592,4 +3608,9 @@ void RenderProcessHostImpl::OnMojoError(int render_process_id,
bad_message::RPH_MOJO_PROCESS_ERROR);
}
+viz::HostSharedBitmapManagerClient*
+RenderProcessHostImpl::GetSharedBitmapAllocationNotifier() {
+ return &shared_bitmap_allocation_notifier_impl_;
+}
+
} // namespace content
diff --git a/chromium/content/browser/renderer_host/render_process_host_impl.h b/chromium/content/browser/renderer_host/render_process_host_impl.h
index 40b4649f930..861012ff196 100644
--- a/chromium/content/browser/renderer_host/render_process_host_impl.h
+++ b/chromium/content/browser/renderer_host/render_process_host_impl.h
@@ -21,6 +21,7 @@
#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
#include "build/build_config.h"
+#include "components/viz/display_compositor/host_shared_bitmap_manager.h"
#include "content/browser/child_process_launcher.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/renderer_host/frame_sink_provider_impl.h"
@@ -328,6 +329,9 @@ class CONTENT_EXPORT RenderProcessHostImpl
RenderProcessHost* render_process_host,
const GURL& site_url);
+ viz::HostSharedBitmapManagerClient* GetSharedBitmapAllocationNotifier()
+ override;
+
protected:
// A proxy for our IPC::Channel that lives on the IO thread.
std::unique_ptr<IPC::ChannelProxy> channel_;
@@ -387,6 +391,9 @@ class CONTENT_EXPORT RenderProcessHostImpl
blink::mojom::OffscreenCanvasProviderRequest request);
void BindFrameSinkProvider(const service_manager::BindSourceInfo& source_info,
mojom::FrameSinkProviderRequest request);
+ void BindSharedBitmapAllocationNotifier(
+ const service_manager::BindSourceInfo& source_info,
+ cc::mojom::SharedBitmapManagerRequest request);
void CreateStoragePartitionService(
const service_manager::BindSourceInfo& source_info,
mojom::StoragePartitionServiceRequest request);
@@ -688,6 +695,9 @@ class CONTENT_EXPORT RenderProcessHostImpl
FrameSinkProviderImpl frame_sink_provider_;
+ viz::HostSharedBitmapManagerClient
+ shared_bitmap_allocation_notifier_impl_;
+
base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
diff --git a/chromium/content/browser/renderer_host/render_widget_host_impl.cc b/chromium/content/browser/renderer_host/render_widget_host_impl.cc
index bdb1bc9fb3e..efb5b52f30f 100644
--- a/chromium/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/chromium/content/browser/renderer_host/render_widget_host_impl.cc
@@ -324,6 +324,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
CHECK(result.second) << "Inserting a duplicate item!";
process_->AddRoute(routing_id_, this);
process_->AddWidget(this);
+ process_->GetSharedBitmapAllocationNotifier()->AddObserver(this);
// If we're initially visible, tell the process host that we're alive.
// Otherwise we'll notify the process host when we are first shown.
@@ -1783,6 +1784,7 @@ void RenderWidgetHostImpl::Destroy(bool also_delete) {
view_.reset();
}
+ process_->GetSharedBitmapAllocationNotifier()->RemoveObserver(this);
process_->RemoveWidget(this);
process_->RemoveRoute(routing_id_);
g_routing_id_widget_map.Get().erase(
@@ -2563,6 +2565,28 @@ void RenderWidgetHostImpl::SubmitCompositorFrame(
return;
}
+ uint32_t max_sequence_number = 0;
+ for (const auto& resource : frame.resource_list) {
+ max_sequence_number =
+ std::max(max_sequence_number, resource.shared_bitmap_sequence_number);
+ }
+
+ // If the CompositorFrame references SharedBitmaps that we are not aware of,
+ // defer the submission until they are registered.
+ uint32_t last_registered_sequence_number =
+ GetProcess()->GetSharedBitmapAllocationNotifier()->last_sequence_number();
+ if (max_sequence_number > last_registered_sequence_number) {
+ saved_frame_.frame = std::move(frame);
+ saved_frame_.local_surface_id = local_surface_id;
+ saved_frame_.max_shared_bitmap_sequence_number = max_sequence_number;
+ TRACE_EVENT_ASYNC_BEGIN2("renderer_host", "PauseCompositorFrameSink", this,
+ "LastRegisteredSequenceNumber",
+ last_registered_sequence_number,
+ "RequiredSequenceNumber", max_sequence_number);
+ compositor_frame_sink_binding_.PauseIncomingMethodCallProcessing();
+ return;
+ }
+
last_local_surface_id_ = local_surface_id;
last_surface_properties_ = new_surface_properties;
@@ -2663,4 +2687,15 @@ device::mojom::WakeLockService* RenderWidgetHostImpl::GetWakeLockService() {
}
#endif
+void RenderWidgetHostImpl::DidAllocateSharedBitmap(uint32_t sequence_number) {
+ if (saved_frame_.local_surface_id.is_valid() &&
+ sequence_number >= saved_frame_.max_shared_bitmap_sequence_number) {
+ SubmitCompositorFrame(saved_frame_.local_surface_id,
+ std::move(saved_frame_.frame));
+ saved_frame_.local_surface_id = cc::LocalSurfaceId();
+ compositor_frame_sink_binding_.ResumeIncomingMethodCallProcessing();
+ TRACE_EVENT_ASYNC_END0("renderer_host", "PauseCompositorFrameSink", this);
+ }
+}
+
} // namespace content
diff --git a/chromium/content/browser/renderer_host/render_widget_host_impl.h b/chromium/content/browser/renderer_host/render_widget_host_impl.h
index 2cf98079c1f..aee977c03e6 100644
--- a/chromium/content/browser/renderer_host/render_widget_host_impl.h
+++ b/chromium/content/browser/renderer_host/render_widget_host_impl.h
@@ -28,6 +28,7 @@
#include "cc/ipc/mojo_compositor_frame_sink.mojom.h"
#include "cc/resources/shared_bitmap.h"
#include "cc/surfaces/frame_sink_id.h"
+#include "components/viz/display_compositor/host_shared_bitmap_manager.h"
#include "content/browser/renderer_host/event_with_latency_info.h"
#include "content/browser/renderer_host/input/input_ack_handler.h"
#include "content/browser/renderer_host/input/input_router_client.h"
@@ -102,6 +103,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl
public TouchEmulatorClient,
public NON_EXPORTED_BASE(SyntheticGestureController::Delegate),
public NON_EXPORTED_BASE(cc::mojom::MojoCompositorFrameSink),
+ public NON_EXPORTED_BASE(viz::SharedBitmapAllocationObserver),
public IPC::Listener {
public:
// |routing_id| must not be MSG_ROUTING_NONE.
@@ -761,6 +763,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// process the messages. Virtual for tests.
virtual void ProcessSwapMessages(std::vector<IPC::Message> messages);
+ // viz::SharedBitmapAllocationObserver implementation.
+ void DidAllocateSharedBitmap(
+ uint32_t last_shared_bitmap_sequence_number) override;
+
#if defined(OS_MACOSX)
device::mojom::WakeLockService* GetWakeLockService();
#endif
@@ -985,6 +991,14 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// Sorted by frame token.
std::queue<std::pair<uint32_t, std::vector<IPC::Message>>> queued_messages_;
+ // If a CompositorFrame is submitted that references SharedBitmaps that don't
+ // exist yet, we keep it here until they are available.
+ struct {
+ cc::LocalSurfaceId local_surface_id;
+ cc::CompositorFrame frame;
+ uint32_t max_shared_bitmap_sequence_number = 0;
+ } saved_frame_;
+
base::OnceClosure begin_frame_callback_;
base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
diff --git a/chromium/content/browser/renderer_host/text_input_manager.cc b/chromium/content/browser/renderer_host/text_input_manager.cc
index c327c98b174..8ab29925959 100644
--- a/chromium/content/browser/renderer_host/text_input_manager.cc
+++ b/chromium/content/browser/renderer_host/text_input_manager.cc
@@ -81,7 +81,10 @@ const TextInputManager::TextSelection* TextInputManager::GetTextSelection(
DCHECK(!view || IsRegistered(view));
if (!view)
view = active_view_;
- return !!view ? &text_selection_map_.at(view) : nullptr;
+ // A crash occurs when we end up here with an unregistered view.
+ // See crbug.com/735980
+ // TODO(ekaramad): Take a deeper look why this is happening.
+ return (view && IsRegistered(view)) ? &text_selection_map_.at(view) : nullptr;
}
void TextInputManager::UpdateTextInputState(
diff --git a/chromium/content/browser/web_contents/web_contents_impl.cc b/chromium/content/browser/web_contents/web_contents_impl.cc
index cf3111fe1c2..1dd24658e82 100644
--- a/chromium/content/browser/web_contents/web_contents_impl.cc
+++ b/chromium/content/browser/web_contents/web_contents_impl.cc
@@ -4417,6 +4417,11 @@ void WebContentsImpl::RunJavaScriptDialog(RenderFrameHost* render_frame_host,
const GURL& frame_url,
JavaScriptDialogType dialog_type,
IPC::Message* reply_msg) {
+ // Running a dialog causes an exit to webpage-initiated fullscreen.
+ // http://crbug.com/728276
+ if (IsFullscreenForCurrentTab())
+ ExitFullscreen(true);
+
// Suppress JavaScript dialogs when requested. Also suppress messages when
// showing an interstitial as it's shown over the previous page and we don't
// want the hidden page's dialogs to interfere with the interstitial.
@@ -4449,6 +4454,11 @@ void WebContentsImpl::RunBeforeUnloadConfirm(
RenderFrameHost* render_frame_host,
bool is_reload,
IPC::Message* reply_msg) {
+ // Running a dialog causes an exit to webpage-initiated fullscreen.
+ // http://crbug.com/728276
+ if (IsFullscreenForCurrentTab())
+ ExitFullscreen(true);
+
RenderFrameHostImpl* rfhi =
static_cast<RenderFrameHostImpl*>(render_frame_host);
if (delegate_)
diff --git a/chromium/content/browser/web_contents/web_contents_impl.h b/chromium/content/browser/web_contents/web_contents_impl.h
index 62b879b0954..097668f1090 100644
--- a/chromium/content/browser/web_contents/web_contents_impl.h
+++ b/chromium/content/browser/web_contents/web_contents_impl.h
@@ -448,6 +448,7 @@ class CONTENT_EXPORT WebContentsImpl
void StopFinding(StopFindAction action) override;
bool WasRecentlyAudible() override;
void GetManifest(const GetManifestCallback& callback) override;
+ bool IsFullscreenForCurrentTab() const override;
void ExitFullscreen(bool will_cause_resize) override;
void ResumeLoadingCreatedWebContents() override;
void OnPasswordInputShownOnHttp() override;
@@ -703,7 +704,8 @@ class CONTENT_EXPORT WebContentsImpl
bool user_gesture,
bool last_unlocked_by_target,
bool privileged) override;
- bool IsFullscreenForCurrentTab() const override;
+ // The following function is already listed under WebContents overrides:
+ // bool IsFullscreenForCurrentTab() const override;
blink::WebDisplayMode GetDisplayMode(
RenderWidgetHostImpl* render_widget_host) const override;
void LostCapture(RenderWidgetHostImpl* render_widget_host) override;
@@ -904,6 +906,8 @@ class CONTENT_EXPORT WebContentsImpl
CrossSiteIframeAccessibility);
FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
JavaScriptDialogsInMainAndSubframes);
+ FRIEND_TEST_ALL_PREFIXES(WebContentsImplBrowserTest,
+ DialogsFromJavaScriptEndFullscreen);
FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,
IframeBeforeUnloadParentHang);
FRIEND_TEST_ALL_PREFIXES(RenderFrameHostImplBrowserTest,
diff --git a/chromium/content/browser/web_contents/web_contents_impl_browsertest.cc b/chromium/content/browser/web_contents/web_contents_impl_browsertest.cc
index 71c3c423904..2f161b01344 100644
--- a/chromium/content/browser/web_contents/web_contents_impl_browsertest.cc
+++ b/chromium/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -942,7 +942,8 @@ namespace {
class TestJavaScriptDialogManager : public JavaScriptDialogManager,
public WebContentsDelegate {
public:
- TestJavaScriptDialogManager() : message_loop_runner_(new MessageLoopRunner) {}
+ TestJavaScriptDialogManager()
+ : is_fullscreen_(false), message_loop_runner_(new MessageLoopRunner) {}
~TestJavaScriptDialogManager() override {}
void Wait() {
@@ -959,6 +960,20 @@ class TestJavaScriptDialogManager : public JavaScriptDialogManager,
return this;
}
+ void EnterFullscreenModeForTab(WebContents* web_contents,
+ const GURL& origin) override {
+ is_fullscreen_ = true;
+ }
+
+ void ExitFullscreenModeForTab(WebContents*) override {
+ is_fullscreen_ = false;
+ }
+
+ bool IsFullscreenForTabOrPending(
+ const WebContents* web_contents) const override {
+ return is_fullscreen_;
+ }
+
// JavaScriptDialogManager
void RunJavaScriptDialog(WebContents* web_contents,
@@ -976,7 +991,10 @@ class TestJavaScriptDialogManager : public JavaScriptDialogManager,
void RunBeforeUnloadDialog(WebContents* web_contents,
bool is_reload,
- const DialogClosedCallback& callback) override {}
+ const DialogClosedCallback& callback) override {
+ callback.Run(true, base::string16());
+ message_loop_runner_->Quit();
+ }
bool HandleJavaScriptDialog(WebContents* web_contents,
bool accept,
@@ -990,6 +1008,8 @@ class TestJavaScriptDialogManager : public JavaScriptDialogManager,
private:
std::string last_message_;
+ bool is_fullscreen_;
+
// The MessageLoopRunner used to spin the message loop.
scoped_refptr<MessageLoopRunner> message_loop_runner_;
@@ -1395,4 +1415,56 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, UserAgentOverride) {
old_delegate));
}
+IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
+ DialogsFromJavaScriptEndFullscreen) {
+ WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell()->web_contents());
+ TestJavaScriptDialogManager dialog_manager;
+ wc->SetDelegate(&dialog_manager);
+
+ GURL url("about:blank");
+ EXPECT_TRUE(NavigateToURL(shell(), url));
+
+ // alert
+ wc->EnterFullscreenMode(url);
+ EXPECT_TRUE(wc->IsFullscreenForCurrentTab());
+ std::string script = "alert('hi')";
+ EXPECT_TRUE(content::ExecuteScript(wc, script));
+ dialog_manager.Wait();
+ EXPECT_FALSE(wc->IsFullscreenForCurrentTab());
+
+ // confirm
+ wc->EnterFullscreenMode(url);
+ EXPECT_TRUE(wc->IsFullscreenForCurrentTab());
+ script = "confirm('hi')";
+ EXPECT_TRUE(content::ExecuteScript(wc, script));
+ dialog_manager.Wait();
+ EXPECT_FALSE(wc->IsFullscreenForCurrentTab());
+
+ // prompt
+ wc->EnterFullscreenMode(url);
+ EXPECT_TRUE(wc->IsFullscreenForCurrentTab());
+ script = "prompt('hi')";
+ EXPECT_TRUE(content::ExecuteScript(wc, script));
+ dialog_manager.Wait();
+ EXPECT_FALSE(wc->IsFullscreenForCurrentTab());
+
+ // beforeunload
+ wc->EnterFullscreenMode(url);
+ EXPECT_TRUE(wc->IsFullscreenForCurrentTab());
+ // Disable the hang monitor (otherwise there will be a race between the
+ // beforeunload dialog and the beforeunload hang timer) and give the page a
+ // gesture to allow dialogs.
+ wc->GetMainFrame()->DisableBeforeUnloadHangMonitorForTesting();
+ wc->GetMainFrame()->ExecuteJavaScriptWithUserGestureForTests(
+ base::string16());
+ script = "window.onbeforeunload=function(e){ return 'x' };";
+ EXPECT_TRUE(content::ExecuteScript(wc, script));
+ EXPECT_TRUE(NavigateToURL(shell(), url));
+ dialog_manager.Wait();
+ EXPECT_FALSE(wc->IsFullscreenForCurrentTab());
+
+ wc->SetDelegate(nullptr);
+ wc->SetJavaScriptDialogManagerForTesting(nullptr);
+}
+
} // namespace content
diff --git a/chromium/content/common/render_message_filter.mojom b/chromium/content/common/render_message_filter.mojom
index 9998a0bf026..c044f1f20ef 100644
--- a/chromium/content/common/render_message_filter.mojom
+++ b/chromium/content/common/render_message_filter.mojom
@@ -19,6 +19,4 @@ interface RenderMessageFilter {
// Similar to CreateWidget except the widget is a full screen window.
[Sync] CreateFullscreenWidget(int32 opener_id)
=> (int32 route_id);
-
- GetSharedBitmapManager(associated cc.mojom.SharedBitmapManager& bitmap_manager);
};
diff --git a/chromium/content/public/app/mojo/content_browser_manifest.json b/chromium/content/public/app/mojo/content_browser_manifest.json
index c1047b3c40b..7efbaf00527 100644
--- a/chromium/content/public/app/mojo/content_browser_manifest.json
+++ b/chromium/content/public/app/mojo/content_browser_manifest.json
@@ -26,6 +26,7 @@
"blink::mojom::OffscreenCanvasProvider",
"blink::mojom::PermissionService",
"blink::mojom::WebSocket",
+ "cc::mojom::SharedBitmapManager",
"content::mojom::FieldTrialRecorder",
"content::mojom::MemoryCoordinatorHandle",
"content::mojom::PushMessaging",
diff --git a/chromium/content/public/browser/render_process_host.h b/chromium/content/public/browser/render_process_host.h
index 97595f18ea2..4e8c555f5b2 100644
--- a/chromium/content/public/browser/render_process_host.h
+++ b/chromium/content/public/browser/render_process_host.h
@@ -33,6 +33,10 @@ namespace service_manager {
class Identity;
}
+namespace viz {
+class HostSharedBitmapManagerClient;
+}
+
namespace content {
class BrowserContext;
class BrowserMessageFilter;
@@ -363,6 +367,12 @@ class CONTENT_EXPORT RenderProcessHost : public IPC::Sender,
// be posted back on the UI thread).
void PostTaskWhenProcessIsReady(base::OnceClosure task);
+ // Returns the SharedBitmapAllocationNotifier associated with this process.
+ // SharedBitmapAllocationNotifier manages viz::SharedBitmaps created by this
+ // process and can notify observers when a new SharedBitmap is allocated.
+ virtual viz::HostSharedBitmapManagerClient*
+ GetSharedBitmapAllocationNotifier() = 0;
+
// Static management functions -----------------------------------------------
// Flag to run the renderer in process. This is primarily
diff --git a/chromium/content/public/browser/web_contents.h b/chromium/content/public/browser/web_contents.h
index ebd18a09057..930880ca54f 100644
--- a/chromium/content/public/browser/web_contents.h
+++ b/chromium/content/public/browser/web_contents.h
@@ -739,6 +739,9 @@ class WebContents : public PageNavigator,
// Requests the manifest URL and the Manifest of the main frame's document.
virtual void GetManifest(const GetManifestCallback& callback) = 0;
+ // Returns whether the renderer is in fullscreen mode.
+ virtual bool IsFullscreenForCurrentTab() const = 0;
+
// Requests the renderer to exit fullscreen.
// |will_cause_resize| indicates whether the fullscreen change causes a
// view resize. e.g. This will be false when going from tab fullscreen to
diff --git a/chromium/content/renderer/render_thread_impl.cc b/chromium/content/renderer/render_thread_impl.cc
index d7a0de4e48c..574acb32ff2 100644
--- a/chromium/content/renderer/render_thread_impl.cc
+++ b/chromium/content/renderer/render_thread_impl.cc
@@ -664,13 +664,15 @@ void RenderThreadImpl::Init(
IsRunningInMash() ? ui::mojom::kServiceName : mojom::kBrowserServiceName,
GetIOTaskRunner());
- cc::mojom::SharedBitmapManagerAssociatedPtr shared_bitmap_manager_ptr;
- render_message_filter()->GetSharedBitmapManager(
- mojo::MakeRequest(&shared_bitmap_manager_ptr));
- shared_bitmap_manager_.reset(new ui::ChildSharedBitmapManager(
- cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr::Create(
- shared_bitmap_manager_ptr.PassInterface(),
- GetChannel()->ipc_task_runner_refptr())));
+ cc::mojom::SharedBitmapManagerPtr
+ shared_bitmap_allocation_notifier_ptr;
+ GetConnector()->BindInterface(
+ mojom::kBrowserServiceName,
+ mojo::MakeRequest(&shared_bitmap_allocation_notifier_ptr));
+ shared_bitmap_manager_ = base::MakeUnique<ui::ChildSharedBitmapManager>(
+ cc::mojom::ThreadSafeSharedBitmapManagerPtr::Create(
+ shared_bitmap_allocation_notifier_ptr.PassInterface(),
+ GetChannel()->ipc_task_runner_refptr()));
InitializeWebKit(resource_task_queue);
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 7c982457667..5c881c3d205 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3155,6 +3155,10 @@ bool GLES2DecoderImpl::Initialize(
context_ = context;
surface_ = surface;
+ // Set workarounds for the surface.
+ if (workarounds().rely_on_implicit_sync_for_swap_buffers)
+ surface_->SetRelyOnImplicitSync();
+
// Create GPU Tracer for timing values.
gpu_tracer_.reset(new GPUTracer(this));
diff --git a/chromium/gpu/config/gpu_driver_bug_list.json b/chromium/gpu/config/gpu_driver_bug_list.json
index 33e8a6e9753..b8f5489ce08 100644
--- a/chromium/gpu/config/gpu_driver_bug_list.json
+++ b/chromium/gpu/config/gpu_driver_bug_list.json
@@ -1,6 +1,6 @@
{
"name": "gpu driver bug list",
- "version": "10.92",
+ "version": "10.93",
"entries": [
{
"id": 1,
@@ -2530,6 +2530,18 @@
"features": [
"disable_chromium_framebuffer_multisample"
]
+ },
+ {
+ "id": 235,
+ "description": "Avoid waiting on a egl fence before pageflipping and rely on implicit sync.",
+ "cr_bugs": [721463],
+ "os": {
+ "type": "chromeos"
+ },
+ "gl_vendor": "Intel.*",
+ "features": [
+ "rely_on_implicit_sync_for_swap_buffers"
+ ]
}
],
"comment": [
diff --git a/chromium/gpu/config/gpu_driver_bug_workaround_type.h b/chromium/gpu/config/gpu_driver_bug_workaround_type.h
index bcf07fcf2c7..090093813ae 100644
--- a/chromium/gpu/config/gpu_driver_bug_workaround_type.h
+++ b/chromium/gpu/config/gpu_driver_bug_workaround_type.h
@@ -221,6 +221,8 @@
disable_non_empty_post_sub_buffers_for_onscreen_surfaces) \
GPU_OP(AVOID_STENCIL_BUFFERS, \
avoid_stencil_buffers) \
+ GPU_OP(RELY_ON_IMPLICIT_SYNC_FOR_SWAP_BUFFERS, \
+ rely_on_implicit_sync_for_swap_buffers) \
// clang-format on
namespace gpu {
diff --git a/chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.cc b/chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.cc
index 92fc4300b18..6e0b94559a7 100644
--- a/chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.cc
+++ b/chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.cc
@@ -24,21 +24,26 @@ namespace {
class ChildSharedBitmap : public cc::SharedBitmap {
public:
ChildSharedBitmap(
- const scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr>
+ const scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerPtr>
shared_bitmap_manager_ptr,
base::SharedMemory* shared_memory,
- const cc::SharedBitmapId& id)
- : cc::SharedBitmap(static_cast<uint8_t*>(shared_memory->memory()), id),
+ const cc::SharedBitmapId& id,
+ uint32_t sequence_number)
+ : cc::SharedBitmap(static_cast<uint8_t*>(shared_memory->memory()),
+ id,
+ sequence_number),
shared_bitmap_manager_ptr_(shared_bitmap_manager_ptr) {}
ChildSharedBitmap(
- const scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr>
+ const scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerPtr>
shared_bitmap_manager_ptr,
std::unique_ptr<base::SharedMemory> shared_memory_holder,
- const cc::SharedBitmapId& id)
+ const cc::SharedBitmapId& id,
+ uint32_t sequence_number)
: ChildSharedBitmap(shared_bitmap_manager_ptr,
shared_memory_holder.get(),
- id) {
+ id,
+ sequence_number) {
shared_memory_holder_ = std::move(shared_memory_holder);
}
@@ -47,7 +52,7 @@ class ChildSharedBitmap : public cc::SharedBitmap {
}
private:
- scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr>
+ scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerPtr>
shared_bitmap_manager_ptr_;
std::unique_ptr<base::SharedMemory> shared_memory_holder_;
};
@@ -99,7 +104,7 @@ std::unique_ptr<base::SharedMemory> AllocateSharedMemory(size_t buf_size) {
} // namespace
ChildSharedBitmapManager::ChildSharedBitmapManager(
- const scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr>&
+ const scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerPtr>&
shared_bitmap_manager_ptr)
: shared_bitmap_manager_ptr_(shared_bitmap_manager_ptr) {}
@@ -118,14 +123,14 @@ ChildSharedBitmapManager::AllocateSharedBitmap(const gfx::Size& size) {
if (!memory || !memory->Map(memory_size))
CollectMemoryUsageAndDie(size, memory_size);
- NotifyAllocatedSharedBitmap(memory.get(), id);
+ uint32_t sequence_number = NotifyAllocatedSharedBitmap(memory.get(), id);
// Close the associated FD to save resources, the previously mapped memory
// remains available.
memory->Close();
- return base::MakeUnique<ChildSharedBitmap>(shared_bitmap_manager_ptr_,
- std::move(memory), id);
+ return base::MakeUnique<ChildSharedBitmap>(
+ shared_bitmap_manager_ptr_, std::move(memory), id, sequence_number);
}
std::unique_ptr<cc::SharedBitmap>
@@ -138,28 +143,33 @@ ChildSharedBitmapManager::GetSharedBitmapFromId(const gfx::Size&,
std::unique_ptr<cc::SharedBitmap>
ChildSharedBitmapManager::GetBitmapForSharedMemory(base::SharedMemory* mem) {
cc::SharedBitmapId id = cc::SharedBitmap::GenerateId();
- NotifyAllocatedSharedBitmap(mem, cc::SharedBitmap::GenerateId());
- return base::MakeUnique<ChildSharedBitmap>(shared_bitmap_manager_ptr_,
- std::move(mem), id);
+ uint32_t sequence_number =
+ NotifyAllocatedSharedBitmap(mem, cc::SharedBitmap::GenerateId());
+ return base::MakeUnique<ChildSharedBitmap>(
+ shared_bitmap_manager_ptr_, std::move(mem), id, sequence_number);
}
// Notifies the browser process that a shared bitmap with the given ID was
// allocated. Caller keeps ownership of |memory|.
-void ChildSharedBitmapManager::NotifyAllocatedSharedBitmap(
+uint32_t ChildSharedBitmapManager::NotifyAllocatedSharedBitmap(
base::SharedMemory* memory,
const cc::SharedBitmapId& id) {
base::SharedMemoryHandle handle_to_send =
base::SharedMemory::DuplicateHandle(memory->handle());
if (!base::SharedMemory::IsHandleValid(handle_to_send)) {
LOG(ERROR) << "Failed to duplicate shared memory handle for bitmap.";
- return;
+ return 0;
}
mojo::ScopedSharedBufferHandle buffer_handle = mojo::WrapSharedMemoryHandle(
handle_to_send, memory->mapped_size(), true /* read_only */);
- (*shared_bitmap_manager_ptr_)
- ->DidAllocateSharedBitmap(std::move(buffer_handle), id);
+ {
+ base::AutoLock lock(lock_);
+ (*shared_bitmap_manager_ptr_)
+ ->DidAllocateSharedBitmap(std::move(buffer_handle), id);
+ return ++last_sequence_number_;
+ }
}
} // namespace ui
diff --git a/chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.h b/chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.h
index 7e8eb3a9058..98e5040ccff 100644
--- a/chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.h
+++ b/chromium/services/ui/public/cpp/bitmap/child_shared_bitmap_manager.h
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory.h"
+#include "base/synchronization/lock.h"
#include "cc/ipc/shared_bitmap_manager.mojom.h"
#include "cc/resources/shared_bitmap_manager.h"
#include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h"
@@ -21,8 +22,7 @@ namespace ui {
class ChildSharedBitmapManager : public cc::SharedBitmapManager {
public:
explicit ChildSharedBitmapManager(
- const scoped_refptr<
- cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr>&
+ const scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerPtr>&
shared_bitmap_manager_ptr);
~ChildSharedBitmapManager() override;
@@ -37,12 +37,18 @@ class ChildSharedBitmapManager : public cc::SharedBitmapManager {
base::SharedMemory* mem);
private:
- void NotifyAllocatedSharedBitmap(base::SharedMemory* memory,
- const cc::SharedBitmapId& id);
+ uint32_t NotifyAllocatedSharedBitmap(base::SharedMemory* memory,
+ const cc::SharedBitmapId& id);
- scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr>
+ scoped_refptr<cc::mojom::ThreadSafeSharedBitmapManagerPtr>
shared_bitmap_manager_ptr_;
+ base::Lock lock_;
+
+ // Each SharedBitmap allocated by this class is assigned a unique sequence
+ // number that is incremental.
+ uint32_t last_sequence_number_ = 0;
+
DISALLOW_COPY_AND_ASSIGN(ChildSharedBitmapManager);
};
diff --git a/chromium/skia/ext/skia_commit_hash.h b/chromium/skia/ext/skia_commit_hash.h
index 06a72ae120d..e969c71724f 100644
--- a/chromium/skia/ext/skia_commit_hash.h
+++ b/chromium/skia/ext/skia_commit_hash.h
@@ -3,6 +3,6 @@
#ifndef SKIA_EXT_SKIA_COMMIT_HASH_H_
#define SKIA_EXT_SKIA_COMMIT_HASH_H_
-#define SKIA_COMMIT_HASH "1a1dc0a9ca21ee9a4f79d5bbc2075f2c3e513ccd-"
+#define SKIA_COMMIT_HASH "a20ae70af542208b06c21413f13c4c86269c0b84-"
#endif // SKIA_EXT_SKIA_COMMIT_HASH_H_
diff --git a/chromium/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h b/chromium/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h
index 155dbe0c7c5..818d78cdd58 100644
--- a/chromium/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h
+++ b/chromium/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h
@@ -27,6 +27,7 @@
#define CSSTimingFunctionValue_h
#include "core/css/CSSValue.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/animation/TimingFunction.h"
#include "platform/wtf/PassRefPtr.h"
@@ -124,7 +125,9 @@ class CSSFramesTimingFunctionValue : public CSSValue {
private:
CSSFramesTimingFunctionValue(int frames)
- : CSSValue(kFramesTimingFunctionClass), frames_(frames) {}
+ : CSSValue(kFramesTimingFunctionClass), frames_(frames) {
+ DCHECK(RuntimeEnabledFeatures::framesTimingFunctionEnabled());
+ }
int frames_;
};
diff --git a/chromium/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/chromium/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index 0388e82893c..67a0770365c 100644
--- a/chromium/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/chromium/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -451,8 +451,10 @@ static CSSValue* ConsumeAnimationTimingFunction(CSSParserTokenRange& range) {
CSSValueID function = range.Peek().FunctionId();
if (function == CSSValueSteps)
return ConsumeSteps(range);
- if (function == CSSValueFrames)
+ if (RuntimeEnabledFeatures::framesTimingFunctionEnabled() &&
+ function == CSSValueFrames) {
return ConsumeFrames(range);
+ }
if (function == CSSValueCubicBezier)
return ConsumeCubicBezier(range);
return nullptr;
diff --git a/chromium/third_party/WebKit/Source/core/input/EventHandler.cpp b/chromium/third_party/WebKit/Source/core/input/EventHandler.cpp
index 85aa0c06f3c..ab3d3ac5d45 100644
--- a/chromium/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/chromium/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -118,26 +118,6 @@ bool ShouldRefetchEventTarget(const MouseEventWithHitTestResults& mev) {
isHTMLInputElement(ToShadowRoot(target_node)->host());
}
-bool ShouldShowIBeamForNode(const Node* node, const HitTestResult& result) {
- if (!node)
- return false;
-
- bool layout_object_selectable = false;
- if (LayoutObject* layout_object = node->GetLayoutObject()) {
- PaintLayer* layer = layout_object->EnclosingLayer();
- if (layer->GetScrollableArea() &&
- layer->GetScrollableArea()->IsPointInResizeControl(
- result.RoundedPointInMainFrame(), kResizerForPointer)) {
- return false;
- }
-
- layout_object_selectable =
- layout_object->IsText() && node->CanStartSelection();
- }
-
- return HasEditableStyle(*node) || layout_object_selectable;
-}
-
} // namespace
using namespace HTMLNames;
@@ -407,6 +387,39 @@ void EventHandler::UpdateCursor() {
}
}
+bool EventHandler::ShouldShowIBeamForNode(const Node* node,
+ const HitTestResult& result) {
+ if (!node)
+ return false;
+
+ if (LayoutObject* layout_object = node->GetLayoutObject()) {
+ PaintLayer* layer = layout_object->EnclosingLayer();
+ if (layer->GetScrollableArea() &&
+ layer->GetScrollableArea()->IsPointInResizeControl(
+ result.RoundedPointInMainFrame(), kResizerForPointer)) {
+ return false;
+ }
+
+ if (layout_object->IsText() && node->CanStartSelection())
+ return true;
+ }
+
+ // If a drag may be starting or we're capturing mouse events for a particular
+ // node, don't treat this as a selection. Note calling
+ // ComputeVisibleSelectionInDOMTreeDeprecated may update layout.
+ const bool mouse_selection =
+ !capturing_mouse_events_node_ &&
+ mouse_event_manager_->MousePressed() &&
+ GetSelectionController().MouseDownMayStartSelect() &&
+ !mouse_event_manager_->MouseDownMayStartDrag() &&
+ !frame_->Selection()
+ .ComputeVisibleSelectionInDOMTreeDeprecated()
+ .IsNone();
+ const bool mouse_selects_link = mouse_selection && result.IsOverLink();
+
+ return mouse_selects_link || HasEditableStyle(*node);
+}
+
OptionalCursor EventHandler::SelectCursor(const HitTestResult& result) {
if (scroll_manager_->InResizeMode())
return kNoCursorChange;
@@ -553,9 +566,8 @@ OptionalCursor EventHandler::SelectCursor(const HitTestResult& result) {
OptionalCursor EventHandler::SelectAutoCursor(const HitTestResult& result,
Node* node,
const Cursor& i_beam) {
- if (result.GetScrollbar()) {
+ if (result.GetScrollbar())
return PointerCursor();
- }
const bool is_over_link =
!GetSelectionController().MouseDownMayStartSelect() &&
@@ -563,22 +575,9 @@ OptionalCursor EventHandler::SelectAutoCursor(const HitTestResult& result,
if (UseHandCursor(node, is_over_link))
return HandCursor();
- // During selection, use an I-beam no matter what we're over.
- // If a drag may be starting or we're capturing mouse events for a particular
- // node, don't treat this as a selection. Note calling
- // ComputeVisibleSelectionInDOMTreeDeprecated may update layout.
- if (mouse_event_manager_->MousePressed() &&
- GetSelectionController().MouseDownMayStartSelect() &&
- !mouse_event_manager_->MouseDownMayStartDrag() &&
- !frame_->Selection()
- .ComputeVisibleSelectionInDOMTreeDeprecated()
- .IsNone() &&
- !capturing_mouse_events_node_) {
- return i_beam;
- }
-
if (ShouldShowIBeamForNode(node, result))
return i_beam;
+
return PointerCursor();
}
diff --git a/chromium/third_party/WebKit/Source/core/input/EventHandler.h b/chromium/third_party/WebKit/Source/core/input/EventHandler.h
index a2125c28963..5b2f5dad51f 100644
--- a/chromium/third_party/WebKit/Source/core/input/EventHandler.h
+++ b/chromium/third_party/WebKit/Source/core/input/EventHandler.h
@@ -278,6 +278,7 @@ class CORE_EXPORT EventHandler final
bool ShouldApplyTouchAdjustment(const WebGestureEvent&) const;
+ bool ShouldShowIBeamForNode(const Node*, const HitTestResult&);
OptionalCursor SelectCursor(const HitTestResult&);
OptionalCursor SelectAutoCursor(const HitTestResult&,
Node*,
@@ -384,6 +385,9 @@ class CORE_EXPORT EventHandler final
// triggering |touchstart| event was canceled. This suppresses mouse event
// firing for the current gesture sequence (i.e. until next GestureTapDown).
bool suppress_mouse_events_from_gestures_;
+
+ FRIEND_TEST_ALL_PREFIXES(EventHandlerTest, HitOnNothingDoesNotShowIBeam);
+ FRIEND_TEST_ALL_PREFIXES(EventHandlerTest, HitOnTextShowsIBeam);
};
} // namespace blink
diff --git a/chromium/third_party/WebKit/Source/core/input/EventHandlerTest.cpp b/chromium/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
index 641ba710be2..19bb57aa884 100644
--- a/chromium/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
+++ b/chromium/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
@@ -13,6 +13,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
+#include "core/layout/LayoutObject.h"
#include "core/loader/EmptyClients.h"
#include "core/page/AutoscrollController.h"
#include "core/page/Page.h"
@@ -318,6 +319,28 @@ TEST_F(EventHandlerTest, draggedSVGImagePositionTest) {
.DragDataTransferLocationForTesting());
}
+TEST_F(EventHandlerTest, HitOnNothingDoesNotShowIBeam) {
+ SetHtmlInnerHTML("");
+ HitTestResult hit =
+ GetDocument().GetFrame()->GetEventHandler().HitTestResultAtPoint(
+ LayoutPoint(10, 10));
+ EXPECT_FALSE(
+ GetDocument().GetFrame()->GetEventHandler().ShouldShowIBeamForNode(
+ GetDocument().body(), hit));
+}
+
+TEST_F(EventHandlerTest, HitOnTextShowsIBeam) {
+ SetHtmlInnerHTML("blabla");
+ Node* text = GetDocument().body()->firstChild();
+ LayoutPoint location = text->GetLayoutObject()->VisualRect().Center();
+ HitTestResult hit =
+ GetDocument().GetFrame()->GetEventHandler().HitTestResultAtPoint(
+ location);
+ EXPECT_TRUE(
+ GetDocument().GetFrame()->GetEventHandler().ShouldShowIBeamForNode(text,
+ hit));
+}
+
// Regression test for http://crbug.com/641403 to verify we use up-to-date
// layout tree for dispatching "contextmenu" event.
TEST_F(EventHandlerTest, sendContextMenuEventWithHover) {
diff --git a/chromium/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/chromium/third_party/WebKit/Source/core/input/MouseEventManager.cpp
index f6f20ea6985..2c7d191af92 100644
--- a/chromium/third_party/WebKit/Source/core/input/MouseEventManager.cpp
+++ b/chromium/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -755,12 +755,12 @@ WebInputEventResult MouseEventManager::HandleMouseDraggedEvent(
if (!mouse_pressed_)
return WebInputEventResult::kNotHandled;
- if (event.Event().pointer_type ==
- blink::WebPointerProperties::PointerType::kPen)
- return WebInputEventResult::kNotHandled;
-
- if (HandleDrag(event, DragInitiator::kMouse))
+ // We disable the drag and drop actions on pen input.
+ if (event.Event().pointer_type !=
+ blink::WebPointerProperties::PointerType::kPen &&
+ HandleDrag(event, DragInitiator::kMouse)) {
return WebInputEventResult::kHandledSystem;
+ }
Node* target_node = event.InnerNode();
if (!target_node)
diff --git a/chromium/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp b/chromium/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
index 30520dedadf..3cfa7d86c17 100644
--- a/chromium/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
+++ b/chromium/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
@@ -194,8 +194,11 @@ static CompositingReasons SubtreeReasonsForCompositing(
// We ignore LCD text here because we are required to composite
// scroll-dependant fixed position elements with composited descendants for
// correctness - even if we lose LCD.
+ //
+ // TODO(smcgruer): Only composite fixed if needed (http://crbug.com/742213)
const bool ignore_lcd_text = true;
- if (compositing_reason_finder.RequiresCompositingForScrollDependentPosition(
+ if (layer->GetLayoutObject().Style()->GetPosition() == EPosition::kFixed ||
+ compositing_reason_finder.RequiresCompositingForScrollDependentPosition(
layer, ignore_lcd_text)) {
subtree_reasons |=
kCompositingReasonPositionFixedOrStickyWithCompositedDescendants;
diff --git a/chromium/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp b/chromium/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp
index f1a2d5ce2ce..8a5bf7753d2 100644
--- a/chromium/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp
+++ b/chromium/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp
@@ -20,7 +20,7 @@
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * OF LIABILITY, WHETHER IN CONTRACTg, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@@ -180,12 +180,6 @@ bool MediaControlsPainter::PaintMediaOverlayPlayButton(
if (!HasSource(media_element) || !media_element->paused())
return false;
- // TODO(mlamouri): it might be possible to use the PanelLayoutObject() call
- // instead.
- HTMLDivElement* panel_element = nullptr;
- if (media_element->GetMediaControls())
- panel_element = media_element->GetMediaControls()->PanelElement();
-
static Image* media_overlay_play = PlatformResource("mediaplayerOverlayPlay");
IntRect button_rect(rect);
@@ -197,7 +191,20 @@ bool MediaControlsPainter::PaintMediaOverlayPlayButton(
if (!box)
return false;
int media_height = box->PixelSnappedHeight();
- int media_panel_height = panel_element ? panel_element->clientHeight() : 0;
+
+ int media_panel_height = 0;
+ if (media_element->GetMediaControls()) {
+ if (LayoutObject* object =
+ media_element->GetMediaControls()->PanelLayoutObject()) {
+ if (object->IsBox()) {
+ media_panel_height =
+ AdjustLayoutUnitForAbsoluteZoom(ToLayoutBox(object)->ClientHeight(),
+ *ToLayoutBox(object))
+ .Round();
+ }
+ }
+ }
+
button_rect.SetX(rect.Center().X() - kMediaOverlayPlayButtonWidth / 2);
button_rect.SetY(rect.Center().Y() - kMediaOverlayPlayButtonHeight / 2 +
(media_height - rect.Height() - media_panel_height) / 2);
diff --git a/chromium/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp b/chromium/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp
index 798060b2bc9..cdfaaef1a50 100644
--- a/chromium/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp
+++ b/chromium/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp
@@ -81,6 +81,8 @@ void WorkerScriptLoader::LoadSynchronously(
ResourceLoaderOptions resource_loader_options;
resource_loader_options.allow_credentials = kAllowStoredCredentials;
+ resource_loader_options.parser_disposition =
+ ParserDisposition::kNotParserInserted;
WorkerThreadableLoader::LoadResourceSynchronously(
ToWorkerGlobalScope(execution_context), request, *this, options,
diff --git a/chromium/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 b/chromium/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
index 9a36bd76bc0..0a5a50935f6 100644
--- a/chromium/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
+++ b/chromium/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
@@ -454,6 +454,10 @@
status: "experimental",
},
{
+ name: "FramesTimingFunction",
+ status: "experimental",
+ },
+ {
name: "FrameTimingSupport",
status: "experimental",
},
diff --git a/chromium/third_party/WebKit/Source/platform/animation/TimingFunction.h b/chromium/third_party/WebKit/Source/platform/animation/TimingFunction.h
index 9a7a777c3c3..02f1e661c34 100644
--- a/chromium/third_party/WebKit/Source/platform/animation/TimingFunction.h
+++ b/chromium/third_party/WebKit/Source/platform/animation/TimingFunction.h
@@ -27,6 +27,7 @@
#include "cc/animation/timing_function.h"
#include "platform/PlatformExport.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/wtf/Assertions.h"
#include "platform/wtf/PassRefPtr.h"
#include "platform/wtf/RefCounted.h"
@@ -214,7 +215,9 @@ class PLATFORM_EXPORT FramesTimingFunction final : public TimingFunction {
private:
FramesTimingFunction(int frames)
: TimingFunction(Type::FRAMES),
- frames_(cc::FramesTimingFunction::Create(frames)) {}
+ frames_(cc::FramesTimingFunction::Create(frames)) {
+ DCHECK(RuntimeEnabledFeatures::framesTimingFunctionEnabled());
+ }
std::unique_ptr<cc::FramesTimingFunction> frames_;
};
diff --git a/chromium/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp b/chromium/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp
index dddd3bb0508..65357b1147a 100644
--- a/chromium/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp
+++ b/chromium/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp
@@ -32,6 +32,7 @@
#include <sstream>
#include <string>
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/wtf/text/WTFString.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -51,6 +52,10 @@ namespace {
class TimingFunctionTest : public ::testing::Test {
public:
+ TimingFunctionTest() {
+ RuntimeEnabledFeatures::setFramesTimingFunctionEnabled(true);
+ }
+
void NotEqualHelperLoop(
Vector<std::pair<std::string, RefPtr<TimingFunction>>>& v) {
for (size_t i = 0; i < v.size(); ++i) {
diff --git a/chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index 5b97d0f3ad7..5c36c9a98ca 100644
--- a/chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -602,10 +602,15 @@ Resource* ResourceFetcher::RequestResource(
params.Options().initiator_info.name);
}
- // An URL with the "cid" scheme can only be handled by an MHTML Archive.
- // Abort the request when there is none.
- if (!archive_ && resource_request.Url().ProtocolIs(kContentIdScheme))
+ // A main resource request with the "cid" scheme can only be handled by an
+ // MHTML Archive. Abort the request when there is none.
+ // Note: There are some embedders of WebView that are using Content-ID
+ // URLs for sub-resources, even without any MHTMLArchive. Please see
+ // https://crbug.com/739658.
+ if (!archive_ && factory.GetType() == Resource::kMainResource &&
+ resource_request.Url().ProtocolIs(kContentIdScheme)) {
return nullptr;
+ }
bool is_data_url = resource_request.Url().ProtocolIsData();
bool is_static_data = is_data_url || substitute_data.IsValid() || archive_;
@@ -1369,10 +1374,8 @@ bool ResourceFetcher::StartLoad(Resource* resource) {
ResourceLoader* loader = nullptr;
{
- // Forbids JavaScript/addClient/removeClient/revalidation until start()
+ // Forbids JavaScript/revalidation until start()
// to prevent unintended state transitions.
- Resource::ProhibitAddRemoveClientInScope
- prohibit_add_remove_client_in_scope(resource);
Resource::RevalidationStartForbiddenScope
revalidation_start_forbidden_scope(resource);
ScriptForbiddenIfMainThreadScope script_forbidden_scope;
@@ -1414,6 +1417,10 @@ bool ResourceFetcher::StartLoad(Resource* resource) {
StorePerformanceTimingInitiatorInformation(resource);
resource->SetFetcherSecurityOrigin(source_origin);
+ // NotifyStartLoad() shouldn't cause AddClient/RemoveClient().
+ Resource::ProhibitAddRemoveClientInScope
+ prohibit_add_remove_client_in_scope(resource);
+
resource->NotifyStartLoad();
loader->ActivateCacheAwareLoadingIfNeeded(request);
}
diff --git a/chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp b/chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp
index 13638fc15d3..b445c118b08 100644
--- a/chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp
+++ b/chromium/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp
@@ -760,4 +760,38 @@ TEST_F(ResourceFetcherTest, ContentTypeDataURL) {
EXPECT_EQ("text/testmimetype", resource->GetResponse().HttpContentType());
}
+TEST_F(ResourceFetcherTest, ContentIdURL) {
+ KURL url(kParsedURLString, "cid:0123456789@example.com");
+ ResourceResponse response;
+ response.SetURL(url);
+ response.SetHTTPStatusCode(200);
+ RegisterMockedURLLoadWithCustomResponse(url, response);
+
+ ResourceFetcher* fetcher = ResourceFetcher::Create(Context());
+
+ // Fetching a main resource with the Content-ID scheme must be canceled if
+ // there is no MHTMLArchive.
+ {
+ ResourceRequest resource_request(url);
+ resource_request.SetRequestContext(WebURLRequest::kRequestContextIframe);
+ resource_request.SetFrameType(WebURLRequest::kFrameTypeNested);
+ FetchParameters fetch_params(resource_request);
+ RawResource* resource =
+ RawResource::FetchMainResource(fetch_params, fetcher, SubstituteData());
+ EXPECT_EQ(nullptr, resource);
+ }
+
+ // For all the other resource type, it must not be canceled.
+ // Note: It is important not to cancel them because there are some embedders
+ // of WebView that are using Content-ID URLs for sub-resources, even without
+ // any MHTMLArchive. Please see https://crbug.com/739658.
+ {
+ ResourceRequest resource_request(url);
+ resource_request.SetRequestContext(WebURLRequest::kRequestContextVideo);
+ FetchParameters fetch_params(resource_request);
+ RawResource* resource = RawResource::FetchMedia(fetch_params, fetcher);
+ EXPECT_NE(nullptr, resource);
+ }
+}
+
} // namespace blink
diff --git a/chromium/third_party/afl/OWNERS b/chromium/third_party/afl/OWNERS
deleted file mode 100644
index f015b3257d8..00000000000
--- a/chromium/third_party/afl/OWNERS
+++ /dev/null
@@ -1,4 +0,0 @@
-inferno@chromium.org
-kcc@chromium.org
-mmoroz@chromium.org
-ochang@chromium.org
diff --git a/chromium/third_party/afl/README.chromium b/chromium/third_party/afl/README.chromium
deleted file mode 100644
index d5fea4278fd..00000000000
--- a/chromium/third_party/afl/README.chromium
+++ /dev/null
@@ -1,22 +0,0 @@
-Name: American Fuzzy Lop
-Short Name: AFL
-URL: http://lcamtuf.coredump.cx/afl/
-Version: 2.38b
-Date: January 29, 2017
-License: Apache 2.0
-License File: src/docs/COPYING
-Security Critical: no
-
-Description:
-Tool for in-process and out-of-process (fork) coverage-guided fuzz testing
-(fuzzing). Similar to libFuzzer.
-
-Local Modifications:
-- Use update.py to roll forward.
-- Renamed afl-2.38b/ to src/.
-- Removed the following unneeded files/directories:
- - src/experimental/argv_fuzzing/
- - src/docs/vuln_samples
- - src/testcases/others/elf
- - src/llvm_mode/afl-llvm-pass.so.cc
- - src/dictionaries/
diff --git a/chromium/third_party/afl/src/Makefile b/chromium/third_party/afl/src/Makefile
deleted file mode 100644
index 44d1ffa23f2..00000000000
--- a/chromium/third_party/afl/src/Makefile
+++ /dev/null
@@ -1,153 +0,0 @@
-#
-# american fuzzy lop - makefile
-# -----------------------------
-#
-# Written and maintained by Michal Zalewski <lcamtuf@google.com>
-#
-# Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-
-PROGNAME = afl
-VERSION = $(shell grep '^\#define VERSION ' config.h | cut -d '"' -f2)
-
-PREFIX ?= /usr/local
-BIN_PATH = $(PREFIX)/bin
-HELPER_PATH = $(PREFIX)/lib/afl
-DOC_PATH = $(PREFIX)/share/doc/afl
-MISC_PATH = $(PREFIX)/share/afl
-
-# PROGS intentionally omit afl-as, which gets installed elsewhere.
-
-PROGS = afl-gcc afl-fuzz afl-showmap afl-tmin afl-gotcpu afl-analyze
-SH_PROGS = afl-plot afl-cmin afl-whatsup
-
-CFLAGS ?= -O3 -funroll-loops
-CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \
- -DAFL_PATH=\"$(HELPER_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\" \
- -DBIN_PATH=\"$(BIN_PATH)\"
-
-ifneq "$(filter Linux GNU%,$(shell uname))" ""
- LDFLAGS += -ldl
-endif
-
-ifeq "$(findstring clang, $(shell $(CC) --version 2>/dev/null))" ""
- TEST_CC = afl-gcc
-else
- TEST_CC = afl-clang
-endif
-
-COMM_HDR = alloc-inl.h config.h debug.h types.h
-
-all: test_x86 $(PROGS) afl-as test_build all_done
-
-ifndef AFL_NO_X86
-
-test_x86:
- @echo "[*] Checking for the ability to compile x86 code..."
- @echo 'main() { __asm__("xorb %al, %al"); }' | $(CC) -w -x c - -o .test || ( echo; echo "Oops, looks like your compiler can't generate x86 code."; echo; echo "Don't panic! You can use the LLVM or QEMU mode, but see docs/INSTALL first."; echo "(To ignore this error, set AFL_NO_X86=1 and try again.)"; echo; exit 1 )
- @rm -f .test
- @echo "[+] Everything seems to be working, ready to compile."
-
-else
-
-test_x86:
- @echo "[!] Note: skipping x86 compilation checks (AFL_NO_X86 set)."
-
-endif
-
-afl-gcc: afl-gcc.c $(COMM_HDR) | test_x86
- $(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
- set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $$i; done
-
-afl-as: afl-as.c afl-as.h $(COMM_HDR) | test_x86
- $(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
- ln -sf afl-as as
-
-afl-fuzz: afl-fuzz.c $(COMM_HDR) | test_x86
- $(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
-
-afl-showmap: afl-showmap.c $(COMM_HDR) | test_x86
- $(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
-
-afl-tmin: afl-tmin.c $(COMM_HDR) | test_x86
- $(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
-
-afl-analyze: afl-analyze.c $(COMM_HDR) | test_x86
- $(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
-
-afl-gotcpu: afl-gotcpu.c $(COMM_HDR) | test_x86
- $(CC) $(CFLAGS) $@.c -o $@ $(LDFLAGS)
-
-ifndef AFL_NO_X86
-
-test_build: afl-gcc afl-as afl-showmap
- @echo "[*] Testing the CC wrapper and instrumentation output..."
- unset AFL_USE_ASAN AFL_USE_MSAN; AFL_QUIET=1 AFL_INST_RATIO=100 AFL_PATH=. ./$(TEST_CC) $(CFLAGS) test-instr.c -o test-instr $(LDFLAGS)
- echo 0 | ./afl-showmap -m none -q -o .test-instr0 ./test-instr
- echo 1 | ./afl-showmap -m none -q -o .test-instr1 ./test-instr
- @rm -f test-instr
- @cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; then echo; echo "Oops, the instrumentation does not seem to be behaving correctly!"; echo; echo "Please ping <lcamtuf@google.com> to troubleshoot the issue."; echo; exit 1; fi
- @echo "[+] All right, the instrumentation seems to be working!"
-
-else
-
-test_build: afl-gcc afl-as afl-showmap
- @echo "[!] Note: skipping build tests (you may need to use LLVM or QEMU mode)."
-
-endif
-
-all_done: test_build
- @if [ ! "`which clang 2>/dev/null`" = "" ]; then echo "[+] LLVM users: see llvm_mode/README.llvm for a faster alternative to afl-gcc."; fi
- @echo "[+] All done! Be sure to review README - it's pretty short and useful."
- @if [ "`uname`" = "Darwin" ]; then printf "\nWARNING: Fuzzing on MacOS X is slow because of the unusually high overhead of\nfork() on this OS. Consider using Linux or *BSD. You can also use VirtualBox\n(virtualbox.org) to put AFL inside a Linux or *BSD VM.\n\n"; fi
- @! tty <&1 >/dev/null || printf "\033[0;30mNOTE: If you can read this, your terminal probably uses white background.\nThis will make the UI hard to read. See docs/status_screen.txt for advice.\033[0m\n" 2>/dev/null
-
-.NOTPARALLEL: clean
-
-clean:
- rm -f $(PROGS) afl-as as afl-g++ afl-clang afl-clang++ *.o *~ a.out core core.[1-9][0-9]* *.stackdump test .test test-instr .test-instr0 .test-instr1 qemu_mode/qemu-2.3.0.tar.bz2 afl-qemu-trace
- rm -rf out_dir qemu_mode/qemu-2.3.0
- $(MAKE) -C llvm_mode clean
- $(MAKE) -C libdislocator clean
- $(MAKE) -C libtokencap clean
-
-install: all
- mkdir -p -m 755 $${DESTDIR}$(BIN_PATH) $${DESTDIR}$(HELPER_PATH) $${DESTDIR}$(DOC_PATH) $${DESTDIR}$(MISC_PATH)
- rm -f $${DESTDIR}$(BIN_PATH)/afl-plot.sh
- install -m 755 $(PROGS) $(SH_PROGS) $${DESTDIR}$(BIN_PATH)
- rm -f $${DESTDIR}$(BIN_PATH)/afl-as
- if [ -f afl-qemu-trace ]; then install -m 755 afl-qemu-trace $${DESTDIR}$(BIN_PATH); fi
-ifndef AFL_TRACE_PC
- if [ -f afl-clang-fast -a -f afl-llvm-pass.so -a -f afl-llvm-rt.o ]; then set -e; install -m 755 afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; install -m 755 afl-llvm-pass.so afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi
-else
- if [ -f afl-clang-fast -a -f afl-llvm-rt.o ]; then set -e; install -m 755 afl-clang-fast $${DESTDIR}$(BIN_PATH); ln -sf afl-clang-fast $${DESTDIR}$(BIN_PATH)/afl-clang-fast++; install -m 755 afl-llvm-rt.o $${DESTDIR}$(HELPER_PATH); fi
-endif
- if [ -f afl-llvm-rt-32.o ]; then set -e; install -m 755 afl-llvm-rt-32.o $${DESTDIR}$(HELPER_PATH); fi
- if [ -f afl-llvm-rt-64.o ]; then set -e; install -m 755 afl-llvm-rt-64.o $${DESTDIR}$(HELPER_PATH); fi
- set -e; for i in afl-g++ afl-clang afl-clang++; do ln -sf afl-gcc $${DESTDIR}$(BIN_PATH)/$$i; done
- install -m 755 afl-as $${DESTDIR}$(HELPER_PATH)
- ln -sf afl-as $${DESTDIR}$(HELPER_PATH)/as
- install -m 644 docs/README docs/ChangeLog docs/*.txt $${DESTDIR}$(DOC_PATH)
- cp -r testcases/ $${DESTDIR}$(MISC_PATH)
- cp -r dictionaries/ $${DESTDIR}$(MISC_PATH)
-
-publish: clean
- test "`basename $$PWD`" = "afl" || exit 1
- test -f ~/www/afl/releases/$(PROGNAME)-$(VERSION).tgz; if [ "$$?" = "0" ]; then echo; echo "Change program version in config.h, mmkay?"; echo; exit 1; fi
- cd ..; rm -rf $(PROGNAME)-$(VERSION); cp -pr $(PROGNAME) $(PROGNAME)-$(VERSION); \
- tar -cvz -f ~/www/afl/releases/$(PROGNAME)-$(VERSION).tgz $(PROGNAME)-$(VERSION)
- chmod 644 ~/www/afl/releases/$(PROGNAME)-$(VERSION).tgz
- ( cd ~/www/afl/releases/; ln -s -f $(PROGNAME)-$(VERSION).tgz $(PROGNAME)-latest.tgz )
- cat docs/README >~/www/afl/README.txt
- cat docs/status_screen.txt >~/www/afl/status_screen.txt
- cat docs/historical_notes.txt >~/www/afl/historical_notes.txt
- cat docs/technical_details.txt >~/www/afl/technical_details.txt
- cat docs/ChangeLog >~/www/afl/ChangeLog.txt
- cat docs/QuickStartGuide.txt >~/www/afl/QuickStartGuide.txt
- echo -n "$(VERSION)" >~/www/afl/version.txt
diff --git a/chromium/third_party/afl/src/QuickStartGuide.txt b/chromium/third_party/afl/src/QuickStartGuide.txt
deleted file mode 120000
index e1687eb5bea..00000000000
--- a/chromium/third_party/afl/src/QuickStartGuide.txt
+++ /dev/null
@@ -1 +0,0 @@
-docs/QuickStartGuide.txt \ No newline at end of file
diff --git a/chromium/third_party/afl/src/README b/chromium/third_party/afl/src/README
deleted file mode 120000
index a90f4af9594..00000000000
--- a/chromium/third_party/afl/src/README
+++ /dev/null
@@ -1 +0,0 @@
-docs/README \ No newline at end of file
diff --git a/chromium/third_party/afl/src/afl-analyze.c b/chromium/third_party/afl/src/afl-analyze.c
deleted file mode 100644
index fd0a5226eb1..00000000000
--- a/chromium/third_party/afl/src/afl-analyze.c
+++ /dev/null
@@ -1,1063 +0,0 @@
-/*
- american fuzzy lop - file format analyzer
- -----------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- A nifty utility that grabs an input file and takes a stab at explaining
- its structure by observing how changes to it affect the execution path.
-
- If the output scrolls past the edge of the screen, pipe it to 'less -r'.
-
- */
-
-#define AFL_MAIN
-
-#include "config.h"
-#include "types.h"
-#include "debug.h"
-#include "alloc-inl.h"
-#include "hash.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <ctype.h>
-
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <sys/shm.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-
-static s32 child_pid; /* PID of the tested program */
-
-static u8* trace_bits; /* SHM with instrumentation bitmap */
-
-static u8 *in_file, /* Analyzer input test case */
- *prog_in, /* Targeted program input file */
- *target_path, /* Path to target binary */
- *doc_path; /* Path to docs */
-
-static u8 *in_data; /* Input data for analysis */
-
-static u32 in_len, /* Input data length */
- orig_cksum, /* Original checksum */
- total_execs, /* Total number of execs */
- exec_hangs, /* Total number of hangs */
- exec_tmout = EXEC_TIMEOUT; /* Exec timeout (ms) */
-
-static u64 mem_limit = MEM_LIMIT; /* Memory limit (MB) */
-
-static s32 shm_id, /* ID of the SHM region */
- dev_null_fd = -1; /* FD to /dev/null */
-
-static u8 edges_only, /* Ignore hit counts? */
- use_stdin = 1; /* Use stdin for program input? */
-
-static volatile u8
- stop_soon, /* Ctrl-C pressed? */
- child_timed_out; /* Child timed out? */
-
-
-/* Constants used for describing byte behavior. */
-
-#define RESP_NONE 0x00 /* Changing byte is a no-op. */
-#define RESP_MINOR 0x01 /* Some changes have no effect. */
-#define RESP_VARIABLE 0x02 /* Changes produce variable paths. */
-#define RESP_FIXED 0x03 /* Changes produce fixed patterns. */
-
-#define RESP_LEN 0x04 /* Potential length field */
-#define RESP_CKSUM 0x05 /* Potential checksum */
-#define RESP_SUSPECT 0x06 /* Potential "suspect" blob */
-
-
-/* Classify tuple counts. This is a slow & naive version, but good enough here. */
-
-static u8 count_class_lookup[256] = {
-
- [0] = 0,
- [1] = 1,
- [2] = 2,
- [3] = 4,
- [4 ... 7] = 8,
- [8 ... 15] = 16,
- [16 ... 31] = 32,
- [32 ... 127] = 64,
- [128 ... 255] = 128
-
-};
-
-static void classify_counts(u8* mem) {
-
- u32 i = MAP_SIZE;
-
- if (edges_only) {
-
- while (i--) {
- if (*mem) *mem = 1;
- mem++;
- }
-
- } else {
-
- while (i--) {
- *mem = count_class_lookup[*mem];
- mem++;
- }
-
- }
-
-}
-
-
-/* See if any bytes are set in the bitmap. */
-
-static inline u8 anything_set(void) {
-
- u32* ptr = (u32*)trace_bits;
- u32 i = (MAP_SIZE >> 2);
-
- while (i--) if (*(ptr++)) return 1;
-
- return 0;
-
-}
-
-
-/* Get rid of shared memory and temp files (atexit handler). */
-
-static void remove_shm(void) {
-
- unlink(prog_in); /* Ignore errors */
- shmctl(shm_id, IPC_RMID, NULL);
-
-}
-
-
-/* Configure shared memory. */
-
-static void setup_shm(void) {
-
- u8* shm_str;
-
- shm_id = shmget(IPC_PRIVATE, MAP_SIZE, IPC_CREAT | IPC_EXCL | 0600);
-
- if (shm_id < 0) PFATAL("shmget() failed");
-
- atexit(remove_shm);
-
- shm_str = alloc_printf("%d", shm_id);
-
- setenv(SHM_ENV_VAR, shm_str, 1);
-
- ck_free(shm_str);
-
- trace_bits = shmat(shm_id, NULL, 0);
-
- if (!trace_bits) PFATAL("shmat() failed");
-
-}
-
-
-/* Read initial file. */
-
-static void read_initial_file(void) {
-
- struct stat st;
- s32 fd = open(in_file, O_RDONLY);
-
- if (fd < 0) PFATAL("Unable to open '%s'", in_file);
-
- if (fstat(fd, &st) || !st.st_size)
- FATAL("Zero-sized input file.");
-
- if (st.st_size >= TMIN_MAX_FILE)
- FATAL("Input file is too large (%u MB max)", TMIN_MAX_FILE / 1024 / 1024);
-
- in_len = st.st_size;
- in_data = ck_alloc_nozero(in_len);
-
- ck_read(fd, in_data, in_len, in_file);
-
- close(fd);
-
- OKF("Read %u byte%s from '%s'.", in_len, in_len == 1 ? "" : "s", in_file);
-
-}
-
-
-/* Write output file. */
-
-static s32 write_to_file(u8* path, u8* mem, u32 len) {
-
- s32 ret;
-
- unlink(path); /* Ignore errors */
-
- ret = open(path, O_RDWR | O_CREAT | O_EXCL, 0600);
-
- if (ret < 0) PFATAL("Unable to create '%s'", path);
-
- ck_write(ret, mem, len, path);
-
- lseek(ret, 0, SEEK_SET);
-
- return ret;
-
-}
-
-
-/* Handle timeout signal. */
-
-static void handle_timeout(int sig) {
-
- child_timed_out = 1;
- if (child_pid > 0) kill(child_pid, SIGKILL);
-
-}
-
-
-/* Execute target application. Returns exec checksum, or 0 if program
- times out. */
-
-static u32 run_target(char** argv, u8* mem, u32 len, u8 first_run) {
-
- static struct itimerval it;
- int status = 0;
-
- s32 prog_in_fd;
- u32 cksum;
-
- memset(trace_bits, 0, MAP_SIZE);
- MEM_BARRIER();
-
- prog_in_fd = write_to_file(prog_in, mem, len);
-
- child_pid = fork();
-
- if (child_pid < 0) PFATAL("fork() failed");
-
- if (!child_pid) {
-
- struct rlimit r;
-
- if (dup2(use_stdin ? prog_in_fd : dev_null_fd, 0) < 0 ||
- dup2(dev_null_fd, 1) < 0 ||
- dup2(dev_null_fd, 2) < 0) {
-
- *(u32*)trace_bits = EXEC_FAIL_SIG;
- PFATAL("dup2() failed");
-
- }
-
- close(dev_null_fd);
- close(prog_in_fd);
-
- if (mem_limit) {
-
- r.rlim_max = r.rlim_cur = ((rlim_t)mem_limit) << 20;
-
-#ifdef RLIMIT_AS
-
- setrlimit(RLIMIT_AS, &r); /* Ignore errors */
-
-#else
-
- setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
-
-#endif /* ^RLIMIT_AS */
-
- }
-
- r.rlim_max = r.rlim_cur = 0;
- setrlimit(RLIMIT_CORE, &r); /* Ignore errors */
-
- execv(target_path, argv);
-
- *(u32*)trace_bits = EXEC_FAIL_SIG;
- exit(0);
-
- }
-
- close(prog_in_fd);
-
- /* Configure timeout, wait for child, cancel timeout. */
-
- child_timed_out = 0;
- it.it_value.tv_sec = (exec_tmout / 1000);
- it.it_value.tv_usec = (exec_tmout % 1000) * 1000;
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- if (waitpid(child_pid, &status, 0) <= 0) FATAL("waitpid() failed");
-
- child_pid = 0;
- it.it_value.tv_sec = 0;
- it.it_value.tv_usec = 0;
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- MEM_BARRIER();
-
- /* Clean up bitmap, analyze exit condition, etc. */
-
- if (*(u32*)trace_bits == EXEC_FAIL_SIG)
- FATAL("Unable to execute '%s'", argv[0]);
-
- classify_counts(trace_bits);
- total_execs++;
-
- if (stop_soon) {
- SAYF(cRST cLRD "\n+++ Analysis aborted by user +++\n" cRST);
- exit(1);
- }
-
- /* Always discard inputs that time out. */
-
- if (child_timed_out) {
-
- exec_hangs++;
- return 0;
-
- }
-
- cksum = hash32(trace_bits, MAP_SIZE, HASH_CONST);
-
- /* We don't actually care if the target is crashing or not,
- except that when it does, the checksum should be different. */
-
- if (WIFSIGNALED(status) ||
- (WIFEXITED(status) && WEXITSTATUS(status) == MSAN_ERROR) ||
- (WIFEXITED(status) && WEXITSTATUS(status))) {
-
- cksum ^= 0xffffffff;
-
- }
-
- if (first_run) orig_cksum = cksum;
-
- return cksum;
-
-}
-
-
-#ifdef USE_COLOR
-
-/* Helper function to display a human-readable character. */
-
-static void show_char(u8 val) {
-
- switch (val) {
-
- case 0 ... 32:
- case 127 ... 255: SAYF("#%02x", val); break;
-
- default: SAYF(" %c ", val);
-
- }
-
-}
-
-
-/* Show the legend */
-
-static void show_legend(void) {
-
- SAYF(" " cLGR bgGRA " 01 " cRST " - no-op block "
- cBLK bgLGN " 01 " cRST " - suspected length field\n"
- " " cBRI bgGRA " 01 " cRST " - superficial content "
- cBLK bgYEL " 01 " cRST " - suspected cksum or magic int\n"
- " " cBLK bgCYA " 01 " cRST " - critical stream "
- cBLK bgLRD " 01 " cRST " - suspected checksummed block\n"
- " " cBLK bgMGN " 01 " cRST " - \"magic value\" section\n\n");
-
-}
-
-#endif /* USE_COLOR */
-
-
-/* Interpret and report a pattern in the input file. */
-
-static void dump_hex(u8* buf, u32 len, u8* b_data) {
-
- u32 i;
-
- for (i = 0; i < len; i++) {
-
-#ifdef USE_COLOR
- u32 rlen = 1, off;
-#else
- u32 rlen = 1;
-#endif /* ^USE_COLOR */
-
- u8 rtype = b_data[i] & 0x0f;
-
- /* Look ahead to determine the length of run. */
-
- while (i + rlen < len && (b_data[i] >> 7) == (b_data[i + rlen] >> 7)) {
-
- if (rtype < (b_data[i + rlen] & 0x0f)) rtype = b_data[i + rlen] & 0x0f;
- rlen++;
-
- }
-
- /* Try to do some further classification based on length & value. */
-
- if (rtype == RESP_FIXED) {
-
- switch (rlen) {
-
- case 2: {
-
- u16 val = *(u16*)(in_data + i);
-
- /* Small integers may be length fields. */
-
- if (val && (val <= in_len || SWAP16(val) <= in_len)) {
- rtype = RESP_LEN;
- break;
- }
-
- /* Uniform integers may be checksums. */
-
- if (val && abs(in_data[i] - in_data[i + 1]) > 32) {
- rtype = RESP_CKSUM;
- break;
- }
-
- break;
-
- }
-
- case 4: {
-
- u32 val = *(u32*)(in_data + i);
-
- /* Small integers may be length fields. */
-
- if (val && (val <= in_len || SWAP32(val) <= in_len)) {
- rtype = RESP_LEN;
- break;
- }
-
- /* Uniform integers may be checksums. */
-
- if (val && (in_data[i] >> 7 != in_data[i + 1] >> 7 ||
- in_data[i] >> 7 != in_data[i + 2] >> 7 ||
- in_data[i] >> 7 != in_data[i + 3] >> 7)) {
- rtype = RESP_CKSUM;
- break;
- }
-
- break;
-
- }
-
- case 1: case 3: case 5 ... MAX_AUTO_EXTRA - 1: break;
-
- default: rtype = RESP_SUSPECT;
-
- }
-
- }
-
- /* Print out the entire run. */
-
-#ifdef USE_COLOR
-
- for (off = 0; off < rlen; off++) {
-
- /* Every 16 digits, display offset. */
-
- if (!((i + off) % 16)) {
-
- if (off) SAYF(cRST cLCY ">");
- SAYF(cRST cGRA "%s[%06u] " cRST, (i + off) ? "\n" : "", i + off);
-
- }
-
- switch (rtype) {
-
- case RESP_NONE: SAYF(cLGR bgGRA); break;
- case RESP_MINOR: SAYF(cBRI bgGRA); break;
- case RESP_VARIABLE: SAYF(cBLK bgCYA); break;
- case RESP_FIXED: SAYF(cBLK bgMGN); break;
- case RESP_LEN: SAYF(cBLK bgLGN); break;
- case RESP_CKSUM: SAYF(cBLK bgYEL); break;
- case RESP_SUSPECT: SAYF(cBLK bgLRD); break;
-
- }
-
- show_char(in_data[i + off]);
-
- if (off != rlen - 1 && (i + off + 1) % 16) SAYF(" "); else SAYF(cRST " ");
-
- }
-
-#else
-
- SAYF(" Offset %u, length %u: ", i, rlen);
-
- switch (rtype) {
-
- case RESP_NONE: SAYF("no-op block\n"); break;
- case RESP_MINOR: SAYF("superficial content\n"); break;
- case RESP_VARIABLE: SAYF("critical stream\n"); break;
- case RESP_FIXED: SAYF("\"magic value\" section\n"); break;
- case RESP_LEN: SAYF("suspected length field\n"); break;
- case RESP_CKSUM: SAYF("suspected cksum or magic int\n"); break;
- case RESP_SUSPECT: SAYF("suspected checksummed block\n"); break;
-
- }
-
-#endif /* ^USE_COLOR */
-
- i += rlen - 1;
-
- }
-
-#ifdef USE_COLOR
- SAYF(cRST "\n");
-#endif /* USE_COLOR */
-
-}
-
-
-
-/* Actually analyze! */
-
-static void analyze(char** argv) {
-
- u32 i;
- u32 boring_len = 0, prev_xff = 0, prev_x01 = 0, prev_s10 = 0, prev_a10 = 0;
-
- u8* b_data = ck_alloc(in_len + 1);
- u8 seq_byte = 0;
-
- b_data[in_len] = 0xff; /* Intentional terminator. */
-
- ACTF("Analyzing input file (this may take a while)...\n");
-
-#ifdef USE_COLOR
- show_legend();
-#endif /* USE_COLOR */
-
- for (i = 0; i < in_len; i++) {
-
- u32 xor_ff, xor_01, sub_10, add_10;
- u8 xff_orig, x01_orig, s10_orig, a10_orig;
-
- /* Perform walking byte adjustments across the file. We perform four
- operations designed to elicit some response from the underlying
- code. */
-
- in_data[i] ^= 0xff;
- xor_ff = run_target(argv, in_data, in_len, 0);
-
- in_data[i] ^= 0xfe;
- xor_01 = run_target(argv, in_data, in_len, 0);
-
- in_data[i] = (in_data[i] ^ 0x01) - 0x10;
- sub_10 = run_target(argv, in_data, in_len, 0);
-
- in_data[i] += 0x20;
- add_10 = run_target(argv, in_data, in_len, 0);
- in_data[i] -= 0x10;
-
- /* Classify current behavior. */
-
- xff_orig = (xor_ff == orig_cksum);
- x01_orig = (xor_01 == orig_cksum);
- s10_orig = (sub_10 == orig_cksum);
- a10_orig = (add_10 == orig_cksum);
-
- if (xff_orig && x01_orig && s10_orig && a10_orig) {
-
- b_data[i] = RESP_NONE;
- boring_len++;
-
- } else if (xff_orig || x01_orig || s10_orig || a10_orig) {
-
- b_data[i] = RESP_MINOR;
- boring_len++;
-
- } else if (xor_ff == xor_01 && xor_ff == sub_10 && xor_ff == add_10) {
-
- b_data[i] = RESP_FIXED;
-
- } else b_data[i] = RESP_VARIABLE;
-
- /* When all checksums change, flip most significant bit of b_data. */
-
- if (prev_xff != xor_ff && prev_x01 != xor_01 &&
- prev_s10 != sub_10 && prev_a10 != add_10) seq_byte ^= 0x80;
-
- b_data[i] |= seq_byte;
-
- prev_xff = xor_ff;
- prev_x01 = xor_01;
- prev_s10 = sub_10;
- prev_a10 = add_10;
-
- }
-
- dump_hex(in_data, in_len, b_data);
-
- SAYF("\n");
-
- OKF("Analysis complete. Interesting bits: %0.02f%% of the input file.",
- 100.0 - ((double)boring_len * 100) / in_len);
-
- if (exec_hangs)
- WARNF(cLRD "Encountered %u timeouts - results may be skewed." cRST,
- exec_hangs);
-
- ck_free(b_data);
-
-}
-
-
-
-/* Handle Ctrl-C and the like. */
-
-static void handle_stop_sig(int sig) {
-
- stop_soon = 1;
-
- if (child_pid > 0) kill(child_pid, SIGKILL);
-
-}
-
-
-/* Do basic preparations - persistent fds, filenames, etc. */
-
-static void set_up_environment(void) {
-
- u8* x;
-
- dev_null_fd = open("/dev/null", O_RDWR);
- if (dev_null_fd < 0) PFATAL("Unable to open /dev/null");
-
- if (!prog_in) {
-
- u8* use_dir = ".";
-
- if (!access(use_dir, R_OK | W_OK | X_OK)) {
-
- use_dir = getenv("TMPDIR");
- if (!use_dir) use_dir = "/tmp";
-
- prog_in = alloc_printf("%s/.afl-tmin-temp-%u", use_dir, getpid());
-
- }
-
- }
-
- /* Set sane defaults... */
-
- x = getenv("ASAN_OPTIONS");
-
- if (x) {
-
- if (!strstr(x, "abort_on_error=1"))
- FATAL("Custom ASAN_OPTIONS set without abort_on_error=1 - please fix!");
-
- if (!strstr(x, "symbolize=0"))
- FATAL("Custom ASAN_OPTIONS set without symbolize=0 - please fix!");
-
- }
-
- x = getenv("MSAN_OPTIONS");
-
- if (x) {
-
- if (!strstr(x, "exit_code=" STRINGIFY(MSAN_ERROR)))
- FATAL("Custom MSAN_OPTIONS set without exit_code="
- STRINGIFY(MSAN_ERROR) " - please fix!");
-
- if (!strstr(x, "symbolize=0"))
- FATAL("Custom MSAN_OPTIONS set without symbolize=0 - please fix!");
-
- }
-
- setenv("ASAN_OPTIONS", "abort_on_error=1:"
- "detect_leaks=0:"
- "symbolize=0:"
- "allocator_may_return_null=1", 0);
-
- setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":"
- "symbolize=0:"
- "abort_on_error=1:"
- "allocator_may_return_null=1:"
- "msan_track_origins=0", 0);
-
- if (getenv("AFL_PRELOAD")) {
- setenv("LD_PRELOAD", getenv("AFL_PRELOAD"), 1);
- setenv("DYLD_INSERT_LIBRARIES", getenv("AFL_PRELOAD"), 1);
- }
-
-}
-
-
-/* Setup signal handlers, duh. */
-
-static void setup_signal_handlers(void) {
-
- struct sigaction sa;
-
- sa.sa_handler = NULL;
- sa.sa_flags = SA_RESTART;
- sa.sa_sigaction = NULL;
-
- sigemptyset(&sa.sa_mask);
-
- /* Various ways of saying "stop". */
-
- sa.sa_handler = handle_stop_sig;
- sigaction(SIGHUP, &sa, NULL);
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
-
- /* Exec timeout notifications. */
-
- sa.sa_handler = handle_timeout;
- sigaction(SIGALRM, &sa, NULL);
-
-}
-
-
-/* Detect @@ in args. */
-
-static void detect_file_args(char** argv) {
-
- u32 i = 0;
- u8* cwd = getcwd(NULL, 0);
-
- if (!cwd) PFATAL("getcwd() failed");
-
- while (argv[i]) {
-
- u8* aa_loc = strstr(argv[i], "@@");
-
- if (aa_loc) {
-
- u8 *aa_subst, *n_arg;
-
- /* Be sure that we're always using fully-qualified paths. */
-
- if (prog_in[0] == '/') aa_subst = prog_in;
- else aa_subst = alloc_printf("%s/%s", cwd, prog_in);
-
- /* Construct a replacement argv value. */
-
- *aa_loc = 0;
- n_arg = alloc_printf("%s%s%s", argv[i], aa_subst, aa_loc + 2);
- argv[i] = n_arg;
- *aa_loc = '@';
-
- if (prog_in[0] != '/') ck_free(aa_subst);
-
- }
-
- i++;
-
- }
-
- free(cwd); /* not tracked */
-
-}
-
-
-/* Display usage hints. */
-
-static void usage(u8* argv0) {
-
- SAYF("\n%s [ options ] -- /path/to/target_app [ ... ]\n\n"
-
- "Required parameters:\n\n"
-
- " -i file - input test case to be analyzed by the tool\n"
-
- "Execution control settings:\n\n"
-
- " -f file - input file read by the tested program (stdin)\n"
- " -t msec - timeout for each run (%u ms)\n"
- " -m megs - memory limit for child process (%u MB)\n"
- " -Q - use binary-only instrumentation (QEMU mode)\n\n"
-
- "Analysis settings:\n\n"
-
- " -e - look for edge coverage only, ignore hit counts\n\n"
-
- "For additional tips, please consult %s/README.\n\n",
-
- argv0, EXEC_TIMEOUT, MEM_LIMIT, doc_path);
-
- exit(1);
-
-}
-
-
-/* Find binary. */
-
-static void find_binary(u8* fname) {
-
- u8* env_path = 0;
- struct stat st;
-
- if (strchr(fname, '/') || !(env_path = getenv("PATH"))) {
-
- target_path = ck_strdup(fname);
-
- if (stat(target_path, &st) || !S_ISREG(st.st_mode) ||
- !(st.st_mode & 0111) || st.st_size < 4)
- FATAL("Program '%s' not found or not executable", fname);
-
- } else {
-
- while (env_path) {
-
- u8 *cur_elem, *delim = strchr(env_path, ':');
-
- if (delim) {
-
- cur_elem = ck_alloc(delim - env_path + 1);
- memcpy(cur_elem, env_path, delim - env_path);
- delim++;
-
- } else cur_elem = ck_strdup(env_path);
-
- env_path = delim;
-
- if (cur_elem[0])
- target_path = alloc_printf("%s/%s", cur_elem, fname);
- else
- target_path = ck_strdup(fname);
-
- ck_free(cur_elem);
-
- if (!stat(target_path, &st) && S_ISREG(st.st_mode) &&
- (st.st_mode & 0111) && st.st_size >= 4) break;
-
- ck_free(target_path);
- target_path = 0;
-
- }
-
- if (!target_path) FATAL("Program '%s' not found or not executable", fname);
-
- }
-
-}
-
-
-/* Fix up argv for QEMU. */
-
-static char** get_qemu_argv(u8* own_loc, char** argv, int argc) {
-
- char** new_argv = ck_alloc(sizeof(char*) * (argc + 4));
- u8 *tmp, *cp, *rsl, *own_copy;
-
- memcpy(new_argv + 3, argv + 1, sizeof(char*) * argc);
-
- /* Now we need to actually find qemu for argv[0]. */
-
- new_argv[2] = target_path;
- new_argv[1] = "--";
-
- tmp = getenv("AFL_PATH");
-
- if (tmp) {
-
- cp = alloc_printf("%s/afl-qemu-trace", tmp);
-
- if (access(cp, X_OK))
- FATAL("Unable to find '%s'", tmp);
-
- target_path = new_argv[0] = cp;
- return new_argv;
-
- }
-
- own_copy = ck_strdup(own_loc);
- rsl = strrchr(own_copy, '/');
-
- if (rsl) {
-
- *rsl = 0;
-
- cp = alloc_printf("%s/afl-qemu-trace", own_copy);
- ck_free(own_copy);
-
- if (!access(cp, X_OK)) {
-
- target_path = new_argv[0] = cp;
- return new_argv;
-
- }
-
- } else ck_free(own_copy);
-
- if (!access(BIN_PATH "/afl-qemu-trace", X_OK)) {
-
- target_path = new_argv[0] = BIN_PATH "/afl-qemu-trace";
- return new_argv;
-
- }
-
- FATAL("Unable to find 'afl-qemu-trace'.");
-
-}
-
-
-/* Main entry point */
-
-int main(int argc, char** argv) {
-
- s32 opt;
- u8 mem_limit_given = 0, timeout_given = 0, qemu_mode = 0;
- char** use_argv;
-
- doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
-
- SAYF(cCYA "afl-analyze " cBRI VERSION cRST " by <lcamtuf@google.com>\n");
-
- while ((opt = getopt(argc,argv,"+i:f:m:t:eQ")) > 0)
-
- switch (opt) {
-
- case 'i':
-
- if (in_file) FATAL("Multiple -i options not supported");
- in_file = optarg;
- break;
-
- case 'f':
-
- if (prog_in) FATAL("Multiple -f options not supported");
- use_stdin = 0;
- prog_in = optarg;
- break;
-
- case 'e':
-
- if (edges_only) FATAL("Multiple -e options not supported");
- edges_only = 1;
- break;
-
- case 'm': {
-
- u8 suffix = 'M';
-
- if (mem_limit_given) FATAL("Multiple -m options not supported");
- mem_limit_given = 1;
-
- if (!strcmp(optarg, "none")) {
-
- mem_limit = 0;
- break;
-
- }
-
- if (sscanf(optarg, "%llu%c", &mem_limit, &suffix) < 1 ||
- optarg[0] == '-') FATAL("Bad syntax used for -m");
-
- switch (suffix) {
-
- case 'T': mem_limit *= 1024 * 1024; break;
- case 'G': mem_limit *= 1024; break;
- case 'k': mem_limit /= 1024; break;
- case 'M': break;
-
- default: FATAL("Unsupported suffix or bad syntax for -m");
-
- }
-
- if (mem_limit < 5) FATAL("Dangerously low value of -m");
-
- if (sizeof(rlim_t) == 4 && mem_limit > 2000)
- FATAL("Value of -m out of range on 32-bit systems");
-
- }
-
- break;
-
- case 't':
-
- if (timeout_given) FATAL("Multiple -t options not supported");
- timeout_given = 1;
-
- exec_tmout = atoi(optarg);
-
- if (exec_tmout < 10 || optarg[0] == '-')
- FATAL("Dangerously low value of -t");
-
- break;
-
- case 'Q':
-
- if (qemu_mode) FATAL("Multiple -Q options not supported");
- if (!mem_limit_given) mem_limit = MEM_LIMIT_QEMU;
-
- qemu_mode = 1;
- break;
-
- default:
-
- usage(argv[0]);
-
- }
-
- if (optind == argc || !in_file) usage(argv[0]);
-
- setup_shm();
- setup_signal_handlers();
-
- set_up_environment();
-
- find_binary(argv[optind]);
- detect_file_args(argv + optind);
-
- if (qemu_mode)
- use_argv = get_qemu_argv(argv[0], argv + optind, argc - optind);
- else
- use_argv = argv + optind;
-
- SAYF("\n");
-
- read_initial_file();
-
- ACTF("Performing dry run (mem limit = %llu MB, timeout = %u ms%s)...",
- mem_limit, exec_tmout, edges_only ? ", edges only" : "");
-
- run_target(use_argv, in_data, in_len, 1);
-
- if (child_timed_out)
- FATAL("Target binary times out (adjusting -t may help).");
-
- if (!anything_set()) FATAL("No instrumentation detected.");
-
- analyze(use_argv);
-
- OKF("We're done here. Have a nice day!\n");
-
- exit(0);
-
-}
-
diff --git a/chromium/third_party/afl/src/afl-as.c b/chromium/third_party/afl/src/afl-as.c
deleted file mode 100644
index 7686fe8a802..00000000000
--- a/chromium/third_party/afl/src/afl-as.c
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- american fuzzy lop - wrapper for GNU as
- ---------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014, 2015 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- The sole purpose of this wrapper is to preprocess assembly files generated
- by GCC / clang and inject the instrumentation bits included from afl-as.h. It
- is automatically invoked by the toolchain when compiling programs using
- afl-gcc / afl-clang.
-
- Note that it's an explicit non-goal to instrument hand-written assembly,
- be it in separate .s files or in __asm__ blocks. The only aspiration this
- utility has right now is to be able to skip them gracefully and allow the
- compilation process to continue.
-
- That said, see experimental/clang_asm_normalize/ for a solution that may
- allow clang users to make things work even with hand-crafted assembly. Just
- note that there is no equivalent for GCC.
-
- */
-
-#define AFL_MAIN
-
-#include "config.h"
-#include "types.h"
-#include "debug.h"
-#include "alloc-inl.h"
-
-#include "afl-as.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <ctype.h>
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/time.h>
-
-static u8** as_params; /* Parameters passed to the real 'as' */
-
-static u8* input_file; /* Originally specified input file */
-static u8* modified_file; /* Instrumented file for the real 'as' */
-
-static u8 be_quiet, /* Quiet mode (no stderr output) */
- clang_mode, /* Running in clang mode? */
- pass_thru, /* Just pass data through? */
- just_version; /* Just show version? */
-
-static u32 inst_ratio = 100, /* Instrumentation probability (%) */
- as_par_cnt = 1; /* Number of params to 'as' */
-
-/* If we don't find --32 or --64 in the command line, default to
- instrumentation for whichever mode we were compiled with. This is not
- perfect, but should do the trick for almost all use cases. */
-
-#ifdef __x86_64__
-
-static u8 use_64bit = 1;
-
-#else
-
-static u8 use_64bit = 0;
-
-#ifdef __APPLE__
-# error "Sorry, 32-bit Apple platforms are not supported."
-#endif /* __APPLE__ */
-
-#endif /* ^__x86_64__ */
-
-
-/* Examine and modify parameters to pass to 'as'. Note that the file name
- is always the last parameter passed by GCC, so we exploit this property
- to keep the code simple. */
-
-static void edit_params(int argc, char** argv) {
-
- u8 *tmp_dir = getenv("TMPDIR"), *afl_as = getenv("AFL_AS");
- u32 i;
-
-#ifdef __APPLE__
-
- u8 use_clang_as = 0;
-
- /* On MacOS X, the Xcode cctool 'as' driver is a bit stale and does not work
- with the code generated by newer versions of clang that are hand-built
- by the user. See the thread here: http://goo.gl/HBWDtn.
-
- To work around this, when using clang and running without AFL_AS
- specified, we will actually call 'clang -c' instead of 'as -q' to
- compile the assembly file.
-
- The tools aren't cmdline-compatible, but at least for now, we can
- seemingly get away with this by making only very minor tweaks. Thanks
- to Nico Weber for the idea. */
-
- if (clang_mode && !afl_as) {
-
- use_clang_as = 1;
-
- afl_as = getenv("AFL_CC");
- if (!afl_as) afl_as = getenv("AFL_CXX");
- if (!afl_as) afl_as = "clang";
-
- }
-
-#endif /* __APPLE__ */
-
- /* Although this is not documented, GCC also uses TEMP and TMP when TMPDIR
- is not set. We need to check these non-standard variables to properly
- handle the pass_thru logic later on. */
-
- if (!tmp_dir) tmp_dir = getenv("TEMP");
- if (!tmp_dir) tmp_dir = getenv("TMP");
- if (!tmp_dir) tmp_dir = "/tmp";
-
- as_params = ck_alloc((argc + 32) * sizeof(u8*));
-
- as_params[0] = afl_as ? afl_as : (u8*)"as";
-
- as_params[argc] = 0;
-
- for (i = 1; i < argc - 1; i++) {
-
- if (!strcmp(argv[i], "--64")) use_64bit = 1;
- else if (!strcmp(argv[i], "--32")) use_64bit = 0;
-
-#ifdef __APPLE__
-
- /* The Apple case is a bit different... */
-
- if (!strcmp(argv[i], "-arch") && i + 1 < argc) {
-
- if (!strcmp(argv[i + 1], "x86_64")) use_64bit = 1;
- else if (!strcmp(argv[i + 1], "i386"))
- FATAL("Sorry, 32-bit Apple platforms are not supported.");
-
- }
-
- /* Strip options that set the preference for a particular upstream
- assembler in Xcode. */
-
- if (clang_mode && (!strcmp(argv[i], "-q") || !strcmp(argv[i], "-Q")))
- continue;
-
-#endif /* __APPLE__ */
-
- as_params[as_par_cnt++] = argv[i];
-
- }
-
-#ifdef __APPLE__
-
- /* When calling clang as the upstream assembler, append -c -x assembler
- and hope for the best. */
-
- if (use_clang_as) {
-
- as_params[as_par_cnt++] = "-c";
- as_params[as_par_cnt++] = "-x";
- as_params[as_par_cnt++] = "assembler";
-
- }
-
-#endif /* __APPLE__ */
-
- input_file = argv[argc - 1];
-
- if (input_file[0] == '-') {
-
- if (!strcmp(input_file + 1, "-version")) {
- just_version = 1;
- modified_file = input_file;
- goto wrap_things_up;
- }
-
- if (input_file[1]) FATAL("Incorrect use (not called through afl-gcc?)");
- else input_file = NULL;
-
- } else {
-
- /* Check if this looks like a standard invocation as a part of an attempt
- to compile a program, rather than using gcc on an ad-hoc .s file in
- a format we may not understand. This works around an issue compiling
- NSS. */
-
- if (strncmp(input_file, tmp_dir, strlen(tmp_dir)) &&
- strncmp(input_file, "/var/tmp/", 9) &&
- strncmp(input_file, "/tmp/", 5)) pass_thru = 1;
-
- }
-
- modified_file = alloc_printf("%s/.afl-%u-%u.s", tmp_dir, getpid(),
- (u32)time(NULL));
-
-wrap_things_up:
-
- as_params[as_par_cnt++] = modified_file;
- as_params[as_par_cnt] = NULL;
-
-}
-
-
-/* Process input file, generate modified_file. Insert instrumentation in all
- the appropriate places. */
-
-static void add_instrumentation(void) {
-
- static u8 line[MAX_LINE];
-
- FILE* inf;
- FILE* outf;
- s32 outfd;
- u32 ins_lines = 0;
-
- u8 instr_ok = 0, skip_csect = 0, skip_next_label = 0,
- skip_intel = 0, skip_app = 0, instrument_next = 0;
-
-#ifdef __APPLE__
-
- u8* colon_pos;
-
-#endif /* __APPLE__ */
-
- if (input_file) {
-
- inf = fopen(input_file, "r");
- if (!inf) PFATAL("Unable to read '%s'", input_file);
-
- } else inf = stdin;
-
- outfd = open(modified_file, O_WRONLY | O_EXCL | O_CREAT, 0600);
-
- if (outfd < 0) PFATAL("Unable to write to '%s'", modified_file);
-
- outf = fdopen(outfd, "w");
-
- if (!outf) PFATAL("fdopen() failed");
-
- while (fgets(line, MAX_LINE, inf)) {
-
- /* In some cases, we want to defer writing the instrumentation trampoline
- until after all the labels, macros, comments, etc. If we're in this
- mode, and if the line starts with a tab followed by a character, dump
- the trampoline now. */
-
- if (!pass_thru && !skip_intel && !skip_app && !skip_csect && instr_ok &&
- instrument_next && line[0] == '\t' && isalpha(line[1])) {
-
- fprintf(outf, use_64bit ? trampoline_fmt_64 : trampoline_fmt_32,
- R(MAP_SIZE));
-
- instrument_next = 0;
- ins_lines++;
-
- }
-
- /* Output the actual line, call it a day in pass-thru mode. */
-
- fputs(line, outf);
-
- if (pass_thru) continue;
-
- /* All right, this is where the actual fun begins. For one, we only want to
- instrument the .text section. So, let's keep track of that in processed
- files - and let's set instr_ok accordingly. */
-
- if (line[0] == '\t' && line[1] == '.') {
-
- /* OpenBSD puts jump tables directly inline with the code, which is
- a bit annoying. They use a specific format of p2align directives
- around them, so we use that as a signal. */
-
- if (!clang_mode && instr_ok && !strncmp(line + 2, "p2align ", 8) &&
- isdigit(line[10]) && line[11] == '\n') skip_next_label = 1;
-
- if (!strncmp(line + 2, "text\n", 5) ||
- !strncmp(line + 2, "section\t.text", 13) ||
- !strncmp(line + 2, "section\t__TEXT,__text", 21) ||
- !strncmp(line + 2, "section __TEXT,__text", 21)) {
- instr_ok = 1;
- continue;
- }
-
- if (!strncmp(line + 2, "section\t", 8) ||
- !strncmp(line + 2, "section ", 8) ||
- !strncmp(line + 2, "bss\n", 4) ||
- !strncmp(line + 2, "data\n", 5)) {
- instr_ok = 0;
- continue;
- }
-
- }
-
- /* Detect off-flavor assembly (rare, happens in gdb). When this is
- encountered, we set skip_csect until the opposite directive is
- seen, and we do not instrument. */
-
- if (strstr(line, ".code")) {
-
- if (strstr(line, ".code32")) skip_csect = use_64bit;
- if (strstr(line, ".code64")) skip_csect = !use_64bit;
-
- }
-
- /* Detect syntax changes, as could happen with hand-written assembly.
- Skip Intel blocks, resume instrumentation when back to AT&T. */
-
- if (strstr(line, ".intel_syntax")) skip_intel = 1;
- if (strstr(line, ".att_syntax")) skip_intel = 0;
-
- /* Detect and skip ad-hoc __asm__ blocks, likewise skipping them. */
-
- if (line[0] == '#' || line[1] == '#') {
-
- if (strstr(line, "#APP")) skip_app = 1;
- if (strstr(line, "#NO_APP")) skip_app = 0;
-
- }
-
- /* If we're in the right mood for instrumenting, check for function
- names or conditional labels. This is a bit messy, but in essence,
- we want to catch:
-
- ^main: - function entry point (always instrumented)
- ^.L0: - GCC branch label
- ^.LBB0_0: - clang branch label (but only in clang mode)
- ^\tjnz foo - conditional branches
-
- ...but not:
-
- ^# BB#0: - clang comments
- ^ # BB#0: - ditto
- ^.Ltmp0: - clang non-branch labels
- ^.LC0 - GCC non-branch labels
- ^.LBB0_0: - ditto (when in GCC mode)
- ^\tjmp foo - non-conditional jumps
-
- Additionally, clang and GCC on MacOS X follow a different convention
- with no leading dots on labels, hence the weird maze of #ifdefs
- later on.
-
- */
-
- if (skip_intel || skip_app || skip_csect || !instr_ok ||
- line[0] == '#' || line[0] == ' ') continue;
-
- /* Conditional branch instruction (jnz, etc). We append the instrumentation
- right after the branch (to instrument the not-taken path) and at the
- branch destination label (handled later on). */
-
- if (line[0] == '\t') {
-
- if (line[1] == 'j' && line[2] != 'm' && R(100) < inst_ratio) {
-
- fprintf(outf, use_64bit ? trampoline_fmt_64 : trampoline_fmt_32,
- R(MAP_SIZE));
-
- ins_lines++;
-
- }
-
- continue;
-
- }
-
- /* Label of some sort. This may be a branch destination, but we need to
- tread carefully and account for several different formatting
- conventions. */
-
-#ifdef __APPLE__
-
- /* Apple: L<whatever><digit>: */
-
- if ((colon_pos = strstr(line, ":"))) {
-
- if (line[0] == 'L' && isdigit(*(colon_pos - 1))) {
-
-#else
-
- /* Everybody else: .L<whatever>: */
-
- if (strstr(line, ":")) {
-
- if (line[0] == '.') {
-
-#endif /* __APPLE__ */
-
- /* .L0: or LBB0_0: style jump destination */
-
-#ifdef __APPLE__
-
- /* Apple: L<num> / LBB<num> */
-
- if ((isdigit(line[1]) || (clang_mode && !strncmp(line, "LBB", 3)))
- && R(100) < inst_ratio) {
-
-#else
-
- /* Apple: .L<num> / .LBB<num> */
-
- if ((isdigit(line[2]) || (clang_mode && !strncmp(line + 1, "LBB", 3)))
- && R(100) < inst_ratio) {
-
-#endif /* __APPLE__ */
-
- /* An optimization is possible here by adding the code only if the
- label is mentioned in the code in contexts other than call / jmp.
- That said, this complicates the code by requiring two-pass
- processing (messy with stdin), and results in a speed gain
- typically under 10%, because compilers are generally pretty good
- about not generating spurious intra-function jumps.
-
- We use deferred output chiefly to avoid disrupting
- .Lfunc_begin0-style exception handling calculations (a problem on
- MacOS X). */
-
- if (!skip_next_label) instrument_next = 1; else skip_next_label = 0;
-
- }
-
- } else {
-
- /* Function label (always instrumented, deferred mode). */
-
- instrument_next = 1;
-
- }
-
- }
-
- }
-
- if (ins_lines)
- fputs(use_64bit ? main_payload_64 : main_payload_32, outf);
-
- if (input_file) fclose(inf);
- fclose(outf);
-
- if (!be_quiet) {
-
- if (!ins_lines) WARNF("No instrumentation targets found%s.",
- pass_thru ? " (pass-thru mode)" : "");
- else OKF("Instrumented %u locations (%s-bit, %s mode, ratio %u%%).",
- ins_lines, use_64bit ? "64" : "32",
- getenv("AFL_HARDEN") ? "hardened" : "non-hardened",
- inst_ratio);
-
- }
-
-}
-
-
-/* Main entry point */
-
-int main(int argc, char** argv) {
-
- s32 pid;
- u32 rand_seed;
- int status;
- u8* inst_ratio_str = getenv("AFL_INST_RATIO");
-
- struct timeval tv;
- struct timezone tz;
-
- clang_mode = !!getenv(CLANG_ENV_VAR);
-
- if (isatty(2) && !getenv("AFL_QUIET")) {
-
- SAYF(cCYA "afl-as " cBRI VERSION cRST " by <lcamtuf@google.com>\n");
-
- } else be_quiet = 1;
-
- if (argc < 2) {
-
- SAYF("\n"
- "This is a helper application for afl-fuzz. It is a wrapper around GNU 'as',\n"
- "executed by the toolchain whenever using afl-gcc or afl-clang. You probably\n"
- "don't want to run this program directly.\n\n"
-
- "Rarely, when dealing with extremely complex projects, it may be advisable to\n"
- "set AFL_INST_RATIO to a value less than 100 in order to reduce the odds of\n"
- "instrumenting every discovered branch.\n\n");
-
- exit(1);
-
- }
-
- gettimeofday(&tv, &tz);
-
- rand_seed = tv.tv_sec ^ tv.tv_usec ^ getpid();
-
- srandom(rand_seed);
-
- edit_params(argc, argv);
-
- if (inst_ratio_str) {
-
- if (sscanf(inst_ratio_str, "%u", &inst_ratio) != 1 || inst_ratio > 100)
- FATAL("Bad value of AFL_INST_RATIO (must be between 0 and 100)");
-
- }
-
- if (getenv(AS_LOOP_ENV_VAR))
- FATAL("Endless loop when calling 'as' (remove '.' from your PATH)");
-
- setenv(AS_LOOP_ENV_VAR, "1", 1);
-
- /* When compiling with ASAN, we don't have a particularly elegant way to skip
- ASAN-specific branches. But we can probabilistically compensate for
- that... */
-
- if (getenv("AFL_USE_ASAN") || getenv("AFL_USE_MSAN")) inst_ratio /= 3;
-
- if (!just_version) add_instrumentation();
-
- if (!(pid = fork())) {
-
- execvp(as_params[0], (char**)as_params);
- FATAL("Oops, failed to execute '%s' - check your PATH", as_params[0]);
-
- }
-
- if (pid < 0) PFATAL("fork() failed");
-
- if (waitpid(pid, &status, 0) <= 0) PFATAL("waitpid() failed");
-
- if (!getenv("AFL_KEEP_ASSEMBLY")) unlink(modified_file);
-
- exit(WEXITSTATUS(status));
-
-}
-
diff --git a/chromium/third_party/afl/src/afl-as.h b/chromium/third_party/afl/src/afl-as.h
deleted file mode 100644
index ebd571095e5..00000000000
--- a/chromium/third_party/afl/src/afl-as.h
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
- american fuzzy lop - injectable parts
- -------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Forkserver design by Jann Horn <jannhorn@googlemail.com>
-
- Copyright 2013, 2014, 2015 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This file houses the assembly-level instrumentation injected into fuzzed
- programs. The instrumentation stores XORed pairs of data: identifiers of the
- currently executing branch and the one that executed immediately before.
-
- TL;DR: the instrumentation does shm_trace_map[cur_loc ^ prev_loc]++
-
- The code is designed for 32-bit and 64-bit x86 systems. Both modes should
- work everywhere except for Apple systems. Apple does relocations differently
- from everybody else, so since their OSes have been 64-bit for a longer while,
- I didn't go through the mental effort of porting the 32-bit code.
-
- In principle, similar code should be easy to inject into any well-behaved
- binary-only code (e.g., using DynamoRIO). Conditional jumps offer natural
- targets for instrumentation, and should offer comparable probe density.
-
- */
-
-#ifndef _HAVE_AFL_AS_H
-#define _HAVE_AFL_AS_H
-
-#include "config.h"
-#include "types.h"
-
-/*
- ------------------
- Performances notes
- ------------------
-
- Contributions to make this code faster are appreciated! Here are some
- rough notes that may help with the task:
-
- - Only the trampoline_fmt and the non-setup __afl_maybe_log code paths are
- really worth optimizing; the setup / fork server stuff matters a lot less
- and should be mostly just kept readable.
-
- - We're aiming for modern CPUs with out-of-order execution and large
- pipelines; the code is mostly follows intuitive, human-readable
- instruction ordering, because "textbook" manual reorderings make no
- substantial difference.
-
- - Interestingly, instrumented execution isn't a lot faster if we store a
- variable pointer to the setup, log, or return routine and then do a reg
- call from within trampoline_fmt. It does speed up non-instrumented
- execution quite a bit, though, since that path just becomes
- push-call-ret-pop.
-
- - There is also not a whole lot to be gained by doing SHM attach at a
- fixed address instead of retrieving __afl_area_ptr. Although it allows us
- to have a shorter log routine inserted for conditional jumps and jump
- labels (for a ~10% perf gain), there is a risk of bumping into other
- allocations created by the program or by tools such as ASAN.
-
- - popf is *awfully* slow, which is why we're doing the lahf / sahf +
- overflow test trick. Unfortunately, this forces us to taint eax / rax, but
- this dependency on a commonly-used register still beats the alternative of
- using pushf / popf.
-
- One possible optimization is to avoid touching flags by using a circular
- buffer that stores just a sequence of current locations, with the XOR stuff
- happening offline. Alas, this doesn't seem to have a huge impact:
-
- https://groups.google.com/d/msg/afl-users/MsajVf4fRLo/2u6t88ntUBIJ
-
- - Preforking one child a bit sooner, and then waiting for the "go" command
- from within the child, doesn't offer major performance gains; fork() seems
- to be relatively inexpensive these days. Preforking multiple children does
- help, but badly breaks the "~1 core per fuzzer" design, making it harder to
- scale up. Maybe there is some middle ground.
-
- Perhaps of note: in the 64-bit version for all platforms except for Apple,
- the instrumentation is done slightly differently than on 32-bit, with
- __afl_prev_loc and __afl_area_ptr being local to the object file (.lcomm),
- rather than global (.comm). This is to avoid GOTRELPC lookups in the critical
- code path, which AFAICT, are otherwise unavoidable if we want gcc -shared to
- work; simple relocations between .bss and .text won't work on most 64-bit
- platforms in such a case.
-
- (Fun fact: on Apple systems, .lcomm can segfault the linker.)
-
- The side effect is that state transitions are measured in a somewhat
- different way, with previous tuple being recorded separately within the scope
- of every .c file. This should have no impact in any practical sense.
-
- Another side effect of this design is that getenv() will be called once per
- every .o file when running in non-instrumented mode; and since getenv() tends
- to be optimized in funny ways, we need to be very careful to save every
- oddball register it may touch.
-
- */
-
-static const u8* trampoline_fmt_32 =
-
- "\n"
- "/* --- AFL TRAMPOLINE (32-BIT) --- */\n"
- "\n"
- ".align 4\n"
- "\n"
- "leal -16(%%esp), %%esp\n"
- "movl %%edi, 0(%%esp)\n"
- "movl %%edx, 4(%%esp)\n"
- "movl %%ecx, 8(%%esp)\n"
- "movl %%eax, 12(%%esp)\n"
- "movl $0x%08x, %%ecx\n"
- "call __afl_maybe_log\n"
- "movl 12(%%esp), %%eax\n"
- "movl 8(%%esp), %%ecx\n"
- "movl 4(%%esp), %%edx\n"
- "movl 0(%%esp), %%edi\n"
- "leal 16(%%esp), %%esp\n"
- "\n"
- "/* --- END --- */\n"
- "\n";
-
-static const u8* trampoline_fmt_64 =
-
- "\n"
- "/* --- AFL TRAMPOLINE (64-BIT) --- */\n"
- "\n"
- ".align 4\n"
- "\n"
- "leaq -(128+24)(%%rsp), %%rsp\n"
- "movq %%rdx, 0(%%rsp)\n"
- "movq %%rcx, 8(%%rsp)\n"
- "movq %%rax, 16(%%rsp)\n"
- "movq $0x%08x, %%rcx\n"
- "call __afl_maybe_log\n"
- "movq 16(%%rsp), %%rax\n"
- "movq 8(%%rsp), %%rcx\n"
- "movq 0(%%rsp), %%rdx\n"
- "leaq (128+24)(%%rsp), %%rsp\n"
- "\n"
- "/* --- END --- */\n"
- "\n";
-
-static const u8* main_payload_32 =
-
- "\n"
- "/* --- AFL MAIN PAYLOAD (32-BIT) --- */\n"
- "\n"
- ".text\n"
- ".att_syntax\n"
- ".code32\n"
- ".align 8\n"
- "\n"
-
- "__afl_maybe_log:\n"
- "\n"
- " lahf\n"
- " seto %al\n"
- "\n"
- " /* Check if SHM region is already mapped. */\n"
- "\n"
- " movl __afl_area_ptr, %edx\n"
- " testl %edx, %edx\n"
- " je __afl_setup\n"
- "\n"
- "__afl_store:\n"
- "\n"
- " /* Calculate and store hit for the code location specified in ecx. There\n"
- " is a double-XOR way of doing this without tainting another register,\n"
- " and we use it on 64-bit systems; but it's slower for 32-bit ones. */\n"
- "\n"
-#ifndef COVERAGE_ONLY
- " movl __afl_prev_loc, %edi\n"
- " xorl %ecx, %edi\n"
- " shrl $1, %ecx\n"
- " movl %ecx, __afl_prev_loc\n"
-#else
- " movl %ecx, %edi\n"
-#endif /* ^!COVERAGE_ONLY */
- "\n"
-#ifdef SKIP_COUNTS
- " orb $1, (%edx, %edi, 1)\n"
-#else
- " incb (%edx, %edi, 1)\n"
-#endif /* ^SKIP_COUNTS */
- "\n"
- "__afl_return:\n"
- "\n"
- " addb $127, %al\n"
- " sahf\n"
- " ret\n"
- "\n"
- ".align 8\n"
- "\n"
- "__afl_setup:\n"
- "\n"
- " /* Do not retry setup if we had previous failures. */\n"
- "\n"
- " cmpb $0, __afl_setup_failure\n"
- " jne __afl_return\n"
- "\n"
- " /* Map SHM, jumping to __afl_setup_abort if something goes wrong.\n"
- " We do not save FPU/MMX/SSE registers here, but hopefully, nobody\n"
- " will notice this early in the game. */\n"
- "\n"
- " pushl %eax\n"
- " pushl %ecx\n"
- "\n"
- " pushl $.AFL_SHM_ENV\n"
- " call getenv\n"
- " addl $4, %esp\n"
- "\n"
- " testl %eax, %eax\n"
- " je __afl_setup_abort\n"
- "\n"
- " pushl %eax\n"
- " call atoi\n"
- " addl $4, %esp\n"
- "\n"
- " pushl $0 /* shmat flags */\n"
- " pushl $0 /* requested addr */\n"
- " pushl %eax /* SHM ID */\n"
- " call shmat\n"
- " addl $12, %esp\n"
- "\n"
- " cmpl $-1, %eax\n"
- " je __afl_setup_abort\n"
- "\n"
- " /* Store the address of the SHM region. */\n"
- "\n"
- " movl %eax, __afl_area_ptr\n"
- " movl %eax, %edx\n"
- "\n"
- " popl %ecx\n"
- " popl %eax\n"
- "\n"
- "__afl_forkserver:\n"
- "\n"
- " /* Enter the fork server mode to avoid the overhead of execve() calls. */\n"
- "\n"
- " pushl %eax\n"
- " pushl %ecx\n"
- " pushl %edx\n"
- "\n"
- " /* Phone home and tell the parent that we're OK. (Note that signals with\n"
- " no SA_RESTART will mess it up). If this fails, assume that the fd is\n"
- " closed because we were execve()d from an instrumented binary, or because\n"
- " the parent doesn't want to use the fork server. */\n"
- "\n"
- " pushl $4 /* length */\n"
- " pushl $__afl_temp /* data */\n"
- " pushl $" STRINGIFY((FORKSRV_FD + 1)) " /* file desc */\n"
- " call write\n"
- " addl $12, %esp\n"
- "\n"
- " cmpl $4, %eax\n"
- " jne __afl_fork_resume\n"
- "\n"
- "__afl_fork_wait_loop:\n"
- "\n"
- " /* Wait for parent by reading from the pipe. Abort if read fails. */\n"
- "\n"
- " pushl $4 /* length */\n"
- " pushl $__afl_temp /* data */\n"
- " pushl $" STRINGIFY(FORKSRV_FD) " /* file desc */\n"
- " call read\n"
- " addl $12, %esp\n"
- "\n"
- " cmpl $4, %eax\n"
- " jne __afl_die\n"
- "\n"
- " /* Once woken up, create a clone of our process. This is an excellent use\n"
- " case for syscall(__NR_clone, 0, CLONE_PARENT), but glibc boneheadedly\n"
- " caches getpid() results and offers no way to update the value, breaking\n"
- " abort(), raise(), and a bunch of other things :-( */\n"
- "\n"
- " call fork\n"
- "\n"
- " cmpl $0, %eax\n"
- " jl __afl_die\n"
- " je __afl_fork_resume\n"
- "\n"
- " /* In parent process: write PID to pipe, then wait for child. */\n"
- "\n"
- " movl %eax, __afl_fork_pid\n"
- "\n"
- " pushl $4 /* length */\n"
- " pushl $__afl_fork_pid /* data */\n"
- " pushl $" STRINGIFY((FORKSRV_FD + 1)) " /* file desc */\n"
- " call write\n"
- " addl $12, %esp\n"
- "\n"
- " pushl $0 /* no flags */\n"
- " pushl $__afl_temp /* status */\n"
- " pushl __afl_fork_pid /* PID */\n"
- " call waitpid\n"
- " addl $12, %esp\n"
- "\n"
- " cmpl $0, %eax\n"
- " jle __afl_die\n"
- "\n"
- " /* Relay wait status to pipe, then loop back. */\n"
- "\n"
- " pushl $4 /* length */\n"
- " pushl $__afl_temp /* data */\n"
- " pushl $" STRINGIFY((FORKSRV_FD + 1)) " /* file desc */\n"
- " call write\n"
- " addl $12, %esp\n"
- "\n"
- " jmp __afl_fork_wait_loop\n"
- "\n"
- "__afl_fork_resume:\n"
- "\n"
- " /* In child process: close fds, resume execution. */\n"
- "\n"
- " pushl $" STRINGIFY(FORKSRV_FD) "\n"
- " call close\n"
- "\n"
- " pushl $" STRINGIFY((FORKSRV_FD + 1)) "\n"
- " call close\n"
- "\n"
- " addl $8, %esp\n"
- "\n"
- " popl %edx\n"
- " popl %ecx\n"
- " popl %eax\n"
- " jmp __afl_store\n"
- "\n"
- "__afl_die:\n"
- "\n"
- " xorl %eax, %eax\n"
- " call _exit\n"
- "\n"
- "__afl_setup_abort:\n"
- "\n"
- " /* Record setup failure so that we don't keep calling\n"
- " shmget() / shmat() over and over again. */\n"
- "\n"
- " incb __afl_setup_failure\n"
- " popl %ecx\n"
- " popl %eax\n"
- " jmp __afl_return\n"
- "\n"
- ".AFL_VARS:\n"
- "\n"
- " .comm __afl_area_ptr, 4, 32\n"
- " .comm __afl_setup_failure, 1, 32\n"
-#ifndef COVERAGE_ONLY
- " .comm __afl_prev_loc, 4, 32\n"
-#endif /* !COVERAGE_ONLY */
- " .comm __afl_fork_pid, 4, 32\n"
- " .comm __afl_temp, 4, 32\n"
- "\n"
- ".AFL_SHM_ENV:\n"
- " .asciz \"" SHM_ENV_VAR "\"\n"
- "\n"
- "/* --- END --- */\n"
- "\n";
-
-/* The OpenBSD hack is due to lahf and sahf not being recognized by some
- versions of binutils: http://marc.info/?l=openbsd-cvs&m=141636589924400
-
- The Apple code is a bit different when calling libc functions because
- they are doing relocations differently from everybody else. We also need
- to work around the crash issue with .lcomm and the fact that they don't
- recognize .string. */
-
-#ifdef __APPLE__
-# define CALL_L64(str) "call _" str "\n"
-#else
-# define CALL_L64(str) "call " str "@PLT\n"
-#endif /* ^__APPLE__ */
-
-static const u8* main_payload_64 =
-
- "\n"
- "/* --- AFL MAIN PAYLOAD (64-BIT) --- */\n"
- "\n"
- ".text\n"
- ".att_syntax\n"
- ".code64\n"
- ".align 8\n"
- "\n"
- "__afl_maybe_log:\n"
- "\n"
-#if defined(__OpenBSD__) || (defined(__FreeBSD__) && (__FreeBSD__ < 9))
- " .byte 0x9f /* lahf */\n"
-#else
- " lahf\n"
-#endif /* ^__OpenBSD__, etc */
- " seto %al\n"
- "\n"
- " /* Check if SHM region is already mapped. */\n"
- "\n"
- " movq __afl_area_ptr(%rip), %rdx\n"
- " testq %rdx, %rdx\n"
- " je __afl_setup\n"
- "\n"
- "__afl_store:\n"
- "\n"
- " /* Calculate and store hit for the code location specified in rcx. */\n"
- "\n"
-#ifndef COVERAGE_ONLY
- " xorq __afl_prev_loc(%rip), %rcx\n"
- " xorq %rcx, __afl_prev_loc(%rip)\n"
- " shrq $1, __afl_prev_loc(%rip)\n"
-#endif /* ^!COVERAGE_ONLY */
- "\n"
-#ifdef SKIP_COUNTS
- " orb $1, (%rdx, %rcx, 1)\n"
-#else
- " incb (%rdx, %rcx, 1)\n"
-#endif /* ^SKIP_COUNTS */
- "\n"
- "__afl_return:\n"
- "\n"
- " addb $127, %al\n"
-#if defined(__OpenBSD__) || (defined(__FreeBSD__) && (__FreeBSD__ < 9))
- " .byte 0x9e /* sahf */\n"
-#else
- " sahf\n"
-#endif /* ^__OpenBSD__, etc */
- " ret\n"
- "\n"
- ".align 8\n"
- "\n"
- "__afl_setup:\n"
- "\n"
- " /* Do not retry setup if we had previous failures. */\n"
- "\n"
- " cmpb $0, __afl_setup_failure(%rip)\n"
- " jne __afl_return\n"
- "\n"
- " /* Check out if we have a global pointer on file. */\n"
- "\n"
-#ifndef __APPLE__
- " movq __afl_global_area_ptr@GOTPCREL(%rip), %rdx\n"
- " movq (%rdx), %rdx\n"
-#else
- " movq __afl_global_area_ptr(%rip), %rdx\n"
-#endif /* !^__APPLE__ */
- " testq %rdx, %rdx\n"
- " je __afl_setup_first\n"
- "\n"
- " movq %rdx, __afl_area_ptr(%rip)\n"
- " jmp __afl_store\n"
- "\n"
- "__afl_setup_first:\n"
- "\n"
- " /* Save everything that is not yet saved and that may be touched by\n"
- " getenv() and several other libcalls we'll be relying on. */\n"
- "\n"
- " leaq -352(%rsp), %rsp\n"
- "\n"
- " movq %rax, 0(%rsp)\n"
- " movq %rcx, 8(%rsp)\n"
- " movq %rdi, 16(%rsp)\n"
- " movq %rsi, 32(%rsp)\n"
- " movq %r8, 40(%rsp)\n"
- " movq %r9, 48(%rsp)\n"
- " movq %r10, 56(%rsp)\n"
- " movq %r11, 64(%rsp)\n"
- "\n"
- " movq %xmm0, 96(%rsp)\n"
- " movq %xmm1, 112(%rsp)\n"
- " movq %xmm2, 128(%rsp)\n"
- " movq %xmm3, 144(%rsp)\n"
- " movq %xmm4, 160(%rsp)\n"
- " movq %xmm5, 176(%rsp)\n"
- " movq %xmm6, 192(%rsp)\n"
- " movq %xmm7, 208(%rsp)\n"
- " movq %xmm8, 224(%rsp)\n"
- " movq %xmm9, 240(%rsp)\n"
- " movq %xmm10, 256(%rsp)\n"
- " movq %xmm11, 272(%rsp)\n"
- " movq %xmm12, 288(%rsp)\n"
- " movq %xmm13, 304(%rsp)\n"
- " movq %xmm14, 320(%rsp)\n"
- " movq %xmm15, 336(%rsp)\n"
- "\n"
- " /* Map SHM, jumping to __afl_setup_abort if something goes wrong. */\n"
- "\n"
- " /* The 64-bit ABI requires 16-byte stack alignment. We'll keep the\n"
- " original stack ptr in the callee-saved r12. */\n"
- "\n"
- " pushq %r12\n"
- " movq %rsp, %r12\n"
- " subq $16, %rsp\n"
- " andq $0xfffffffffffffff0, %rsp\n"
- "\n"
- " leaq .AFL_SHM_ENV(%rip), %rdi\n"
- CALL_L64("getenv")
- "\n"
- " testq %rax, %rax\n"
- " je __afl_setup_abort\n"
- "\n"
- " movq %rax, %rdi\n"
- CALL_L64("atoi")
- "\n"
- " xorq %rdx, %rdx /* shmat flags */\n"
- " xorq %rsi, %rsi /* requested addr */\n"
- " movq %rax, %rdi /* SHM ID */\n"
- CALL_L64("shmat")
- "\n"
- " cmpq $-1, %rax\n"
- " je __afl_setup_abort\n"
- "\n"
- " /* Store the address of the SHM region. */\n"
- "\n"
- " movq %rax, %rdx\n"
- " movq %rax, __afl_area_ptr(%rip)\n"
- "\n"
-#ifdef __APPLE__
- " movq %rax, __afl_global_area_ptr(%rip)\n"
-#else
- " movq __afl_global_area_ptr@GOTPCREL(%rip), %rdx\n"
- " movq %rax, (%rdx)\n"
-#endif /* ^__APPLE__ */
- " movq %rax, %rdx\n"
- "\n"
- "__afl_forkserver:\n"
- "\n"
- " /* Enter the fork server mode to avoid the overhead of execve() calls. We\n"
- " push rdx (area ptr) twice to keep stack alignment neat. */\n"
- "\n"
- " pushq %rdx\n"
- " pushq %rdx\n"
- "\n"
- " /* Phone home and tell the parent that we're OK. (Note that signals with\n"
- " no SA_RESTART will mess it up). If this fails, assume that the fd is\n"
- " closed because we were execve()d from an instrumented binary, or because\n"
- " the parent doesn't want to use the fork server. */\n"
- "\n"
- " movq $4, %rdx /* length */\n"
- " leaq __afl_temp(%rip), %rsi /* data */\n"
- " movq $" STRINGIFY((FORKSRV_FD + 1)) ", %rdi /* file desc */\n"
- CALL_L64("write")
- "\n"
- " cmpq $4, %rax\n"
- " jne __afl_fork_resume\n"
- "\n"
- "__afl_fork_wait_loop:\n"
- "\n"
- " /* Wait for parent by reading from the pipe. Abort if read fails. */\n"
- "\n"
- " movq $4, %rdx /* length */\n"
- " leaq __afl_temp(%rip), %rsi /* data */\n"
- " movq $" STRINGIFY(FORKSRV_FD) ", %rdi /* file desc */\n"
- CALL_L64("read")
- " cmpq $4, %rax\n"
- " jne __afl_die\n"
- "\n"
- " /* Once woken up, create a clone of our process. This is an excellent use\n"
- " case for syscall(__NR_clone, 0, CLONE_PARENT), but glibc boneheadedly\n"
- " caches getpid() results and offers no way to update the value, breaking\n"
- " abort(), raise(), and a bunch of other things :-( */\n"
- "\n"
- CALL_L64("fork")
- " cmpq $0, %rax\n"
- " jl __afl_die\n"
- " je __afl_fork_resume\n"
- "\n"
- " /* In parent process: write PID to pipe, then wait for child. */\n"
- "\n"
- " movl %eax, __afl_fork_pid(%rip)\n"
- "\n"
- " movq $4, %rdx /* length */\n"
- " leaq __afl_fork_pid(%rip), %rsi /* data */\n"
- " movq $" STRINGIFY((FORKSRV_FD + 1)) ", %rdi /* file desc */\n"
- CALL_L64("write")
- "\n"
- " movq $0, %rdx /* no flags */\n"
- " leaq __afl_temp(%rip), %rsi /* status */\n"
- " movq __afl_fork_pid(%rip), %rdi /* PID */\n"
- CALL_L64("waitpid")
- " cmpq $0, %rax\n"
- " jle __afl_die\n"
- "\n"
- " /* Relay wait status to pipe, then loop back. */\n"
- "\n"
- " movq $4, %rdx /* length */\n"
- " leaq __afl_temp(%rip), %rsi /* data */\n"
- " movq $" STRINGIFY((FORKSRV_FD + 1)) ", %rdi /* file desc */\n"
- CALL_L64("write")
- "\n"
- " jmp __afl_fork_wait_loop\n"
- "\n"
- "__afl_fork_resume:\n"
- "\n"
- " /* In child process: close fds, resume execution. */\n"
- "\n"
- " movq $" STRINGIFY(FORKSRV_FD) ", %rdi\n"
- CALL_L64("close")
- "\n"
- " movq $" STRINGIFY((FORKSRV_FD + 1)) ", %rdi\n"
- CALL_L64("close")
- "\n"
- " popq %rdx\n"
- " popq %rdx\n"
- "\n"
- " movq %r12, %rsp\n"
- " popq %r12\n"
- "\n"
- " movq 0(%rsp), %rax\n"
- " movq 8(%rsp), %rcx\n"
- " movq 16(%rsp), %rdi\n"
- " movq 32(%rsp), %rsi\n"
- " movq 40(%rsp), %r8\n"
- " movq 48(%rsp), %r9\n"
- " movq 56(%rsp), %r10\n"
- " movq 64(%rsp), %r11\n"
- "\n"
- " movq 96(%rsp), %xmm0\n"
- " movq 112(%rsp), %xmm1\n"
- " movq 128(%rsp), %xmm2\n"
- " movq 144(%rsp), %xmm3\n"
- " movq 160(%rsp), %xmm4\n"
- " movq 176(%rsp), %xmm5\n"
- " movq 192(%rsp), %xmm6\n"
- " movq 208(%rsp), %xmm7\n"
- " movq 224(%rsp), %xmm8\n"
- " movq 240(%rsp), %xmm9\n"
- " movq 256(%rsp), %xmm10\n"
- " movq 272(%rsp), %xmm11\n"
- " movq 288(%rsp), %xmm12\n"
- " movq 304(%rsp), %xmm13\n"
- " movq 320(%rsp), %xmm14\n"
- " movq 336(%rsp), %xmm15\n"
- "\n"
- " leaq 352(%rsp), %rsp\n"
- "\n"
- " jmp __afl_store\n"
- "\n"
- "__afl_die:\n"
- "\n"
- " xorq %rax, %rax\n"
- CALL_L64("_exit")
- "\n"
- "__afl_setup_abort:\n"
- "\n"
- " /* Record setup failure so that we don't keep calling\n"
- " shmget() / shmat() over and over again. */\n"
- "\n"
- " incb __afl_setup_failure(%rip)\n"
- "\n"
- " movq %r12, %rsp\n"
- " popq %r12\n"
- "\n"
- " movq 0(%rsp), %rax\n"
- " movq 8(%rsp), %rcx\n"
- " movq 16(%rsp), %rdi\n"
- " movq 32(%rsp), %rsi\n"
- " movq 40(%rsp), %r8\n"
- " movq 48(%rsp), %r9\n"
- " movq 56(%rsp), %r10\n"
- " movq 64(%rsp), %r11\n"
- "\n"
- " movq 96(%rsp), %xmm0\n"
- " movq 112(%rsp), %xmm1\n"
- " movq 128(%rsp), %xmm2\n"
- " movq 144(%rsp), %xmm3\n"
- " movq 160(%rsp), %xmm4\n"
- " movq 176(%rsp), %xmm5\n"
- " movq 192(%rsp), %xmm6\n"
- " movq 208(%rsp), %xmm7\n"
- " movq 224(%rsp), %xmm8\n"
- " movq 240(%rsp), %xmm9\n"
- " movq 256(%rsp), %xmm10\n"
- " movq 272(%rsp), %xmm11\n"
- " movq 288(%rsp), %xmm12\n"
- " movq 304(%rsp), %xmm13\n"
- " movq 320(%rsp), %xmm14\n"
- " movq 336(%rsp), %xmm15\n"
- "\n"
- " leaq 352(%rsp), %rsp\n"
- "\n"
- " jmp __afl_return\n"
- "\n"
- ".AFL_VARS:\n"
- "\n"
-
-#ifdef __APPLE__
-
- " .comm __afl_area_ptr, 8\n"
-#ifndef COVERAGE_ONLY
- " .comm __afl_prev_loc, 8\n"
-#endif /* !COVERAGE_ONLY */
- " .comm __afl_fork_pid, 4\n"
- " .comm __afl_temp, 4\n"
- " .comm __afl_setup_failure, 1\n"
-
-#else
-
- " .lcomm __afl_area_ptr, 8\n"
-#ifndef COVERAGE_ONLY
- " .lcomm __afl_prev_loc, 8\n"
-#endif /* !COVERAGE_ONLY */
- " .lcomm __afl_fork_pid, 4\n"
- " .lcomm __afl_temp, 4\n"
- " .lcomm __afl_setup_failure, 1\n"
-
-#endif /* ^__APPLE__ */
-
- " .comm __afl_global_area_ptr, 8, 8\n"
- "\n"
- ".AFL_SHM_ENV:\n"
- " .asciz \"" SHM_ENV_VAR "\"\n"
- "\n"
- "/* --- END --- */\n"
- "\n";
-
-#endif /* !_HAVE_AFL_AS_H */
diff --git a/chromium/third_party/afl/src/afl-cmin b/chromium/third_party/afl/src/afl-cmin
deleted file mode 100755
index 5af4b7744c4..00000000000
--- a/chromium/third_party/afl/src/afl-cmin
+++ /dev/null
@@ -1,447 +0,0 @@
-#!/usr/bin/env bash
-#
-# american fuzzy lop - corpus minimization tool
-# ---------------------------------------------
-#
-# Written and maintained by Michal Zalewski <lcamtuf@google.com>
-#
-# Copyright 2014, 2015 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# This tool tries to find the smallest subset of files in the input directory
-# that still trigger the full range of instrumentation data points seen in
-# the starting corpus. This has two uses:
-#
-# - Screening large corpora of input files before using them as a seed for
-# afl-fuzz. The tool will remove functionally redundant files and likely
-# leave you with a much smaller set.
-#
-# (In this case, you probably also want to consider running afl-tmin on
-# the individual files later on to reduce their size.)
-#
-# - Minimizing the corpus generated organically by afl-fuzz, perhaps when
-# planning to feed it to more resource-intensive tools. The tool achieves
-# this by removing all entries that used to trigger unique behaviors in the
-# past, but have been made obsolete by later finds.
-#
-# Note that the tool doesn't modify the files themselves. For that, you want
-# afl-tmin.
-#
-# This script must use bash because other shells may have hardcoded limits on
-# array sizes.
-#
-
-echo "corpus minimization tool for afl-fuzz by <lcamtuf@google.com>"
-echo
-
-#########
-# SETUP #
-#########
-
-# Process command-line options...
-
-MEM_LIMIT=100
-TIMEOUT=none
-
-unset IN_DIR OUT_DIR STDIN_FILE EXTRA_PAR MEM_LIMIT_GIVEN \
- AFL_CMIN_CRASHES_ONLY AFL_CMIN_ALLOW_ANY QEMU_MODE
-
-while getopts "+i:o:f:m:t:eQC" opt; do
-
- case "$opt" in
-
- "i")
- IN_DIR="$OPTARG"
- ;;
-
- "o")
- OUT_DIR="$OPTARG"
- ;;
- "f")
- STDIN_FILE="$OPTARG"
- ;;
- "m")
- MEM_LIMIT="$OPTARG"
- MEM_LIMIT_GIVEN=1
- ;;
- "t")
- TIMEOUT="$OPTARG"
- ;;
- "e")
- EXTRA_PAR="$EXTRA_PAR -e"
- ;;
- "C")
- export AFL_CMIN_CRASHES_ONLY=1
- ;;
- "Q")
- EXTRA_PAR="$EXTRA_PAR -Q"
- test "$MEM_LIMIT_GIVEN" = "" && MEM_LIMIT=250
- QEMU_MODE=1
- ;;
- "?")
- exit 1
- ;;
-
- esac
-
-done
-
-shift $((OPTIND-1))
-
-TARGET_BIN="$1"
-
-if [ "$TARGET_BIN" = "" -o "$IN_DIR" = "" -o "$OUT_DIR" = "" ]; then
-
- cat 1>&2 <<_EOF_
-Usage: $0 [ options ] -- /path/to/target_app [ ... ]
-
-Required parameters:
-
- -i dir - input directory with the starting corpus
- -o dir - output directory for minimized files
-
-Execution control settings:
-
- -f file - location read by the fuzzed program (stdin)
- -m megs - memory limit for child process ($MEM_LIMIT MB)
- -t msec - run time limit for child process (none)
- -Q - use binary-only instrumentation (QEMU mode)
-
-Minimization settings:
-
- -C - keep crashing inputs, reject everything else
- -e - solve for edge coverage only, ignore hit counts
-
-For additional tips, please consult docs/README.
-
-_EOF_
- exit 1
-fi
-
-# Do a sanity check to discourage the use of /tmp, since we can't really
-# handle this safely from a shell script.
-
-echo "$IN_DIR" | grep -qE '^(/var)?/tmp/'
-T1="$?"
-
-echo "$TARGET_BIN" | grep -qE '^(/var)?/tmp/'
-T2="$?"
-
-echo "$OUT_DIR" | grep -qE '^(/var)?/tmp/'
-T3="$?"
-
-echo "$STDIN_FILE" | grep -qE '^(/var)?/tmp/'
-T4="$?"
-
-echo "$PWD" | grep -qE '^(/var)?/tmp/'
-T5="$?"
-
-if [ "$T1" = "0" -o "$T2" = "0" -o "$T3" = "0" -o "$T4" = "0" -o "$T5" = "0" ]; then
- echo "[-] Error: do not use this script in /tmp or /var/tmp." 1>&2
- exit 1
-fi
-
-# If @@ is specified, but there's no -f, let's come up with a temporary input
-# file name.
-
-TRACE_DIR="$OUT_DIR/.traces"
-
-if [ "$STDIN_FILE" = "" ]; then
-
- if echo "$*" | grep -qF '@@'; then
- STDIN_FILE="$TRACE_DIR/.cur_input"
- fi
-
-fi
-
-# Check for obvious errors.
-
-if [ ! "$MEM_LIMIT" = "none" ]; then
-
- if [ "$MEM_LIMIT" -lt "5" ]; then
- echo "[-] Error: dangerously low memory limit." 1>&2
- exit 1
- fi
-
-fi
-
-if [ ! "$TIMEOUT" = "none" ]; then
-
- if [ "$TIMEOUT" -lt "10" ]; then
- echo "[-] Error: dangerously low timeout." 1>&2
- exit 1
- fi
-
-fi
-
-if [ ! -f "$TARGET_BIN" -o ! -x "$TARGET_BIN" ]; then
-
- TNEW="`which "$TARGET_BIN" 2>/dev/null`"
-
- if [ ! -f "$TNEW" -o ! -x "$TNEW" ]; then
- echo "[-] Error: binary '$TARGET_BIN' not found or not executable." 1>&2
- exit 1
- fi
-
- TARGET_BIN="$TNEW"
-
-fi
-
-if [ "$AFL_SKIP_BIN_CHECK" = "" -a "$QEMU_MODE" = "" ]; then
-
- if ! grep -qF "__AFL_SHM_ID" "$TARGET_BIN"; then
- echo "[-] Error: binary '$TARGET_BIN' doesn't appear to be instrumented." 1>&2
- exit 1
- fi
-
-fi
-
-if [ ! -d "$IN_DIR" ]; then
- echo "[-] Error: directory '$IN_DIR' not found." 1>&2
- exit 1
-fi
-
-test -d "$IN_DIR/queue" && IN_DIR="$IN_DIR/queue"
-
-find "$OUT_DIR" -name 'id[:_]*' -maxdepth 1 -exec rm -- {} \; 2>/dev/null
-rm -rf "$TRACE_DIR" 2>/dev/null
-
-rmdir "$OUT_DIR" 2>/dev/null
-
-if [ -d "$OUT_DIR" ]; then
- echo "[-] Error: directory '$OUT_DIR' exists and is not empty - delete it first." 1>&2
- exit 1
-fi
-
-mkdir -m 700 -p "$TRACE_DIR" || exit 1
-
-if [ ! "$STDIN_FILE" = "" ]; then
- rm -f "$STDIN_FILE" || exit 1
- touch "$STDIN_FILE" || exit 1
-fi
-
-if [ "$AFL_PATH" = "" ]; then
- SHOWMAP="${0%/afl-cmin}/afl-showmap"
-else
- SHOWMAP="$AFL_PATH/afl-showmap"
-fi
-
-if [ ! -x "$SHOWMAP" ]; then
- echo "[-] Error: can't find 'afl-showmap' - please set AFL_PATH." 1>&2
- rm -rf "$TRACE_DIR"
- exit 1
-fi
-
-IN_COUNT=$((`ls -- "$IN_DIR" 2>/dev/null | wc -l`))
-
-if [ "$IN_COUNT" = "0" ]; then
- echo "No inputs in the target directory - nothing to be done."
- rm -rf "$TRACE_DIR"
- exit 1
-fi
-
-FIRST_FILE=`ls "$IN_DIR" | head -1`
-
-if ln "$IN_DIR/$FIRST_FILE" "$TRACE_DIR/.link_test" 2>/dev/null; then
- CP_TOOL=ln
-else
- CP_TOOL=cp
-fi
-
-# Make sure that we can actually get anything out of afl-showmap before we
-# waste too much time.
-
-echo "[*] Testing the target binary..."
-
-if [ "$STDIN_FILE" = "" ]; then
-
- AFL_CMIN_ALLOW_ANY=1 "$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/.run_test" -Z $EXTRA_PAR -- "$@" <"$IN_DIR/$FIRST_FILE"
-
-else
-
- cp "$IN_DIR/$FIRST_FILE" "$STDIN_FILE"
- AFL_CMIN_ALLOW_ANY=1 "$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/.run_test" -Z $EXTRA_PAR -A "$STDIN_FILE" -- "$@" </dev/null
-
-fi
-
-FIRST_COUNT=$((`grep -c . "$TRACE_DIR/.run_test"`))
-
-if [ "$FIRST_COUNT" -gt "0" ]; then
-
- echo "[+] OK, $FIRST_COUNT tuples recorded."
-
-else
-
- echo "[-] Error: no instrumentation output detected (perhaps crash or timeout)." 1>&2
- test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
- exit 1
-
-fi
-
-# Let's roll!
-
-#############################
-# STEP 1: COLLECTING TRACES #
-#############################
-
-echo "[*] Obtaining traces for input files in '$IN_DIR'..."
-
-(
-
- CUR=0
-
- if [ "$STDIN_FILE" = "" ]; then
-
- while read -r fn; do
-
- CUR=$((CUR+1))
- printf "\\r Processing file $CUR/$IN_COUNT... "
-
- "$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/$fn" -Z $EXTRA_PAR -- "$@" <"$IN_DIR/$fn"
-
- done < <(ls "$IN_DIR")
-
- else
-
- while read -r fn; do
-
- CUR=$((CUR+1))
- printf "\\r Processing file $CUR/$IN_COUNT... "
-
- cp "$IN_DIR/$fn" "$STDIN_FILE"
-
- "$SHOWMAP" -m "$MEM_LIMIT" -t "$TIMEOUT" -o "$TRACE_DIR/$fn" -Z $EXTRA_PAR -A "$STDIN_FILE" -- "$@" </dev/null
-
- done < <(ls "$IN_DIR")
-
-
- fi
-
-)
-
-echo
-
-##########################
-# STEP 2: SORTING TUPLES #
-##########################
-
-# With this out of the way, we sort all tuples by popularity across all
-# datasets. The reasoning here is that we won't be able to avoid the files
-# that trigger unique tuples anyway, so we will want to start with them and
-# see what's left.
-
-echo "[*] Sorting trace sets (this may take a while)..."
-
-ls "$IN_DIR" | sed "s#^#$TRACE_DIR/#" | tr '\n' '\0' | xargs -0 -n 1 cat | \
- sort | uniq -c | sort -n >"$TRACE_DIR/.all_uniq"
-
-TUPLE_COUNT=$((`grep -c . "$TRACE_DIR/.all_uniq"`))
-
-echo "[+] Found $TUPLE_COUNT unique tuples across $IN_COUNT files."
-
-#####################################
-# STEP 3: SELECTING CANDIDATE FILES #
-#####################################
-
-# The next step is to find the best candidate for each tuple. The "best"
-# part is understood simply as the smallest input that includes a particular
-# tuple in its trace. Empirical evidence suggests that this produces smaller
-# datasets than more involved algorithms that could be still pulled off in
-# a shell script.
-
-echo "[*] Finding best candidates for each tuple..."
-
-CUR=0
-
-while read -r fn; do
-
- CUR=$((CUR+1))
- printf "\\r Processing file $CUR/$IN_COUNT... "
-
- sed "s#\$# $fn#" "$TRACE_DIR/$fn" >>"$TRACE_DIR/.candidate_list"
-
-done < <(ls -rS "$IN_DIR")
-
-echo
-
-##############################
-# STEP 4: LOADING CANDIDATES #
-##############################
-
-# At this point, we have a file of tuple-file pairs, sorted by file size
-# in ascending order (as a consequence of ls -rS). By doing sort keyed
-# only by tuple (-k 1,1) and configured to output only the first line for
-# every key (-s -u), we end up with the smallest file for each tuple.
-
-echo "[*] Sorting candidate list (be patient)..."
-
-sort -k1,1 -s -u "$TRACE_DIR/.candidate_list" | \
- sed 's/^/BEST_FILE[/;s/ /]="/;s/$/"/' >"$TRACE_DIR/.candidate_script"
-
-if [ ! -s "$TRACE_DIR/.candidate_script" ]; then
- echo "[-] Error: no traces obtained from test cases, check syntax!"
- test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
- exit 1
-fi
-
-# The sed command converted the sorted list to a shell script that populates
-# BEST_FILE[tuple]="fname". Let's load that!
-
-. "$TRACE_DIR/.candidate_script"
-
-##########################
-# STEP 5: WRITING OUTPUT #
-##########################
-
-# The final trick is to grab the top pick for each tuple, unless said tuple is
-# already set due to the inclusion of an earlier candidate; and then put all
-# tuples associated with the newly-added file to the "already have" list. The
-# loop works from least popular tuples and toward the most common ones.
-
-echo "[*] Processing candidates and writing output files..."
-
-CUR=0
-
-touch "$TRACE_DIR/.already_have"
-
-while read -r cnt tuple; do
-
- CUR=$((CUR+1))
- printf "\\r Processing tuple $CUR/$TUPLE_COUNT... "
-
- # If we already have this tuple, skip it.
-
- grep -q "^$tuple\$" "$TRACE_DIR/.already_have" && continue
-
- FN=${BEST_FILE[tuple]}
-
- $CP_TOOL "$IN_DIR/$FN" "$OUT_DIR/$FN"
-
- if [ "$((CUR % 5))" = "0" ]; then
- sort -u "$TRACE_DIR/$FN" "$TRACE_DIR/.already_have" >"$TRACE_DIR/.tmp"
- mv -f "$TRACE_DIR/.tmp" "$TRACE_DIR/.already_have"
- else
- cat "$TRACE_DIR/$FN" >>"$TRACE_DIR/.already_have"
- fi
-
-done <"$TRACE_DIR/.all_uniq"
-
-echo
-
-OUT_COUNT=`ls -- "$OUT_DIR" | wc -l`
-
-if [ "$OUT_COUNT" = "1" ]; then
- echo "[!] WARNING: All test cases had the same traces, check syntax!"
-fi
-
-echo "[+] Narrowed down to $OUT_COUNT files, saved in '$OUT_DIR'."
-echo
-
-test "$AFL_KEEP_TRACES" = "" && rm -rf "$TRACE_DIR"
-
-exit 0
diff --git a/chromium/third_party/afl/src/afl-fuzz.c b/chromium/third_party/afl/src/afl-fuzz.c
deleted file mode 100644
index e730cb29364..00000000000
--- a/chromium/third_party/afl/src/afl-fuzz.c
+++ /dev/null
@@ -1,8005 +0,0 @@
-/*
- american fuzzy lop - fuzzer code
- --------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Forkserver design by Jann Horn <jannhorn@googlemail.com>
-
- Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This is the real deal: the program takes an instrumented binary and
- attempts a variety of basic fuzzing tricks, paying close attention to
- how they affect the execution path.
-
- */
-
-#define AFL_MAIN
-#define MESSAGES_TO_STDOUT
-
-#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
-
-#include "config.h"
-#include "types.h"
-#include "debug.h"
-#include "alloc-inl.h"
-#include "hash.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-#include <dirent.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <termios.h>
-#include <dlfcn.h>
-#include <sched.h>
-
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <sys/shm.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <sys/file.h>
-
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__)
-# include <sys/sysctl.h>
-#endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */
-
-/* For systems that have sched_setaffinity; right now just Linux, but one
- can hope... */
-
-#ifdef __linux__
-# define HAVE_AFFINITY 1
-#endif /* __linux__ */
-
-/* A toggle to export some variables when building as a library. Not very
- useful for the general public. */
-
-#ifdef AFL_LIB
-# define EXP_ST
-#else
-# define EXP_ST static
-#endif /* ^AFL_LIB */
-
-/* Lots of globals, but mostly for the status UI and other things where it
- really makes no sense to haul them around as function parameters. */
-
-
-EXP_ST u8 *in_dir, /* Input directory with test cases */
- *out_file, /* File to fuzz, if any */
- *out_dir, /* Working & output directory */
- *sync_dir, /* Synchronization directory */
- *sync_id, /* Fuzzer ID */
- *use_banner, /* Display banner */
- *in_bitmap, /* Input bitmap */
- *doc_path, /* Path to documentation dir */
- *target_path, /* Path to target binary */
- *orig_cmdline; /* Original command line */
-
-EXP_ST u32 exec_tmout = EXEC_TIMEOUT; /* Configurable exec timeout (ms) */
-EXP_ST u64 mem_limit = MEM_LIMIT; /* Memory cap for child (MB) */
-
-static u32 stats_update_freq = 1; /* Stats update frequency (execs) */
-
-EXP_ST u8 skip_deterministic, /* Skip deterministic stages? */
- force_deterministic, /* Force deterministic stages? */
- use_splicing, /* Recombine input files? */
- dumb_mode, /* Run in non-instrumented mode? */
- score_changed, /* Scoring for favorites changed? */
- kill_signal, /* Signal that killed the child */
- resuming_fuzz, /* Resuming an older fuzzing job? */
- timeout_given, /* Specific timeout given? */
- not_on_tty, /* stdout is not a tty */
- term_too_small, /* terminal dimensions too small */
- uses_asan, /* Target uses ASAN? */
- no_forkserver, /* Disable forkserver? */
- crash_mode, /* Crash mode! Yeah! */
- in_place_resume, /* Attempt in-place resume? */
- auto_changed, /* Auto-generated tokens changed? */
- no_cpu_meter_red, /* Feng shui on the status screen */
- shuffle_queue, /* Shuffle input queue? */
- bitmap_changed = 1, /* Time to update bitmap? */
- qemu_mode, /* Running in QEMU mode? */
- skip_requested, /* Skip request, via SIGUSR1 */
- run_over10m, /* Run time over 10 minutes? */
- persistent_mode; /* Running in persistent mode? */
-
-static s32 out_fd, /* Persistent fd for out_file */
- dev_urandom_fd = -1, /* Persistent fd for /dev/urandom */
- dev_null_fd = -1, /* Persistent fd for /dev/null */
- fsrv_ctl_fd, /* Fork server control pipe (write) */
- fsrv_st_fd; /* Fork server status pipe (read) */
-
-static s32 forksrv_pid, /* PID of the fork server */
- child_pid = -1, /* PID of the fuzzed program */
- out_dir_fd = -1; /* FD of the lock file */
-
-EXP_ST u8* trace_bits; /* SHM with instrumentation bitmap */
-
-EXP_ST u8 virgin_bits[MAP_SIZE], /* Regions yet untouched by fuzzing */
- virgin_hang[MAP_SIZE], /* Bits we haven't seen in hangs */
- virgin_crash[MAP_SIZE]; /* Bits we haven't seen in crashes */
-
-static u8 var_bytes[MAP_SIZE]; /* Bytes that appear to be variable */
-
-static s32 shm_id; /* ID of the SHM region */
-
-static volatile u8 stop_soon, /* Ctrl-C pressed? */
- clear_screen = 1, /* Window resized? */
- child_timed_out; /* Traced process timed out? */
-
-EXP_ST u32 queued_paths, /* Total number of queued testcases */
- queued_variable, /* Testcases with variable behavior */
- queued_at_start, /* Total number of initial inputs */
- queued_discovered, /* Items discovered during this run */
- queued_imported, /* Items imported via -S */
- queued_favored, /* Paths deemed favorable */
- queued_with_cov, /* Paths with new coverage bytes */
- pending_not_fuzzed, /* Queued but not done yet */
- pending_favored, /* Pending favored paths */
- cur_skipped_paths, /* Abandoned inputs in cur cycle */
- cur_depth, /* Current path depth */
- max_depth, /* Max path depth */
- useless_at_start, /* Number of useless starting paths */
- var_byte_count, /* Bitmap bytes with var behavior */
- current_entry, /* Current queue entry ID */
- havoc_div = 1; /* Cycle count divisor for havoc */
-
-EXP_ST u64 total_crashes, /* Total number of crashes */
- unique_crashes, /* Crashes with unique signatures */
- total_hangs, /* Total number of hangs */
- unique_hangs, /* Hangs with unique signatures */
- total_execs, /* Total execve() calls */
- start_time, /* Unix start time (ms) */
- last_path_time, /* Time for most recent path (ms) */
- last_crash_time, /* Time for most recent crash (ms) */
- last_hang_time, /* Time for most recent hang (ms) */
- last_crash_execs, /* Exec counter at last crash */
- queue_cycle, /* Queue round counter */
- cycles_wo_finds, /* Cycles without any new paths */
- trim_execs, /* Execs done to trim input files */
- bytes_trim_in, /* Bytes coming into the trimmer */
- bytes_trim_out, /* Bytes coming outa the trimmer */
- blocks_eff_total, /* Blocks subject to effector maps */
- blocks_eff_select; /* Blocks selected as fuzzable */
-
-static u32 subseq_hangs; /* Number of hangs in a row */
-
-static u8 *stage_name = "init", /* Name of the current fuzz stage */
- *stage_short, /* Short stage name */
- *syncing_party; /* Currently syncing with... */
-
-static s32 stage_cur, stage_max; /* Stage progression */
-static s32 splicing_with = -1; /* Splicing with which test case? */
-
-static u32 master_id, master_max; /* Master instance job splitting */
-
-static u32 syncing_case; /* Syncing with case #... */
-
-static s32 stage_cur_byte, /* Byte offset of current stage op */
- stage_cur_val; /* Value used for stage op */
-
-static u8 stage_val_type; /* Value type (STAGE_VAL_*) */
-
-static u64 stage_finds[32], /* Patterns found per fuzz stage */
- stage_cycles[32]; /* Execs per fuzz stage */
-
-static u32 rand_cnt; /* Random number counter */
-
-static u64 total_cal_us, /* Total calibration time (us) */
- total_cal_cycles; /* Total calibration cycles */
-
-static u64 total_bitmap_size, /* Total bit count for all bitmaps */
- total_bitmap_entries; /* Number of bitmaps counted */
-
-static s32 cpu_core_count; /* CPU core count */
-
-#ifdef HAVE_AFFINITY
-
-static s32 cpu_aff = -1; /* Selected CPU core */
-
-#endif /* HAVE_AFFINITY */
-
-static FILE* plot_file; /* Gnuplot output file */
-
-struct queue_entry {
-
- u8* fname; /* File name for the test case */
- u32 len; /* Input length */
-
- u8 cal_failed, /* Calibration failed? */
- trim_done, /* Trimmed? */
- was_fuzzed, /* Had any fuzzing done yet? */
- passed_det, /* Deterministic stages passed? */
- has_new_cov, /* Triggers new coverage? */
- var_behavior, /* Variable behavior? */
- favored, /* Currently favored? */
- fs_redundant; /* Marked as redundant in the fs? */
-
- u32 bitmap_size, /* Number of bits set in bitmap */
- exec_cksum; /* Checksum of the execution trace */
-
- u64 exec_us, /* Execution time (us) */
- handicap, /* Number of queue cycles behind */
- depth; /* Path depth */
-
- u8* trace_mini; /* Trace bytes, if kept */
- u32 tc_ref; /* Trace bytes ref count */
-
- struct queue_entry *next, /* Next element, if any */
- *next_100; /* 100 elements ahead */
-
-};
-
-static struct queue_entry *queue, /* Fuzzing queue (linked list) */
- *queue_cur, /* Current offset within the queue */
- *queue_top, /* Top of the list */
- *q_prev100; /* Previous 100 marker */
-
-static struct queue_entry*
- top_rated[MAP_SIZE]; /* Top entries for bitmap bytes */
-
-struct extra_data {
- u8* data; /* Dictionary token data */
- u32 len; /* Dictionary token length */
- u32 hit_cnt; /* Use count in the corpus */
-};
-
-static struct extra_data* extras; /* Extra tokens to fuzz with */
-static u32 extras_cnt; /* Total number of tokens read */
-
-static struct extra_data* a_extras; /* Automatically selected extras */
-static u32 a_extras_cnt; /* Total number of tokens available */
-
-static u8* (*post_handler)(u8* buf, u32* len);
-
-/* Interesting values, as per config.h */
-
-static s8 interesting_8[] = { INTERESTING_8 };
-static s16 interesting_16[] = { INTERESTING_8, INTERESTING_16 };
-static s32 interesting_32[] = { INTERESTING_8, INTERESTING_16, INTERESTING_32 };
-
-/* Fuzzing stages */
-
-enum {
- /* 00 */ STAGE_FLIP1,
- /* 01 */ STAGE_FLIP2,
- /* 02 */ STAGE_FLIP4,
- /* 03 */ STAGE_FLIP8,
- /* 04 */ STAGE_FLIP16,
- /* 05 */ STAGE_FLIP32,
- /* 06 */ STAGE_ARITH8,
- /* 07 */ STAGE_ARITH16,
- /* 08 */ STAGE_ARITH32,
- /* 09 */ STAGE_INTEREST8,
- /* 10 */ STAGE_INTEREST16,
- /* 11 */ STAGE_INTEREST32,
- /* 12 */ STAGE_EXTRAS_UO,
- /* 13 */ STAGE_EXTRAS_UI,
- /* 14 */ STAGE_EXTRAS_AO,
- /* 15 */ STAGE_HAVOC,
- /* 16 */ STAGE_SPLICE
-};
-
-/* Stage value types */
-
-enum {
- /* 00 */ STAGE_VAL_NONE,
- /* 01 */ STAGE_VAL_LE,
- /* 02 */ STAGE_VAL_BE
-};
-
-/* Execution status fault codes */
-
-enum {
- /* 00 */ FAULT_NONE,
- /* 01 */ FAULT_HANG,
- /* 02 */ FAULT_CRASH,
- /* 03 */ FAULT_ERROR,
- /* 04 */ FAULT_NOINST,
- /* 05 */ FAULT_NOBITS
-};
-
-
-/* Get unix time in milliseconds */
-
-static u64 get_cur_time(void) {
-
- struct timeval tv;
- struct timezone tz;
-
- gettimeofday(&tv, &tz);
-
- return (tv.tv_sec * 1000ULL) + (tv.tv_usec / 1000);
-
-}
-
-
-/* Get unix time in microseconds */
-
-static u64 get_cur_time_us(void) {
-
- struct timeval tv;
- struct timezone tz;
-
- gettimeofday(&tv, &tz);
-
- return (tv.tv_sec * 1000000ULL) + tv.tv_usec;
-
-}
-
-
-/* Generate a random number (from 0 to limit - 1). This may
- have slight bias. */
-
-static inline u32 UR(u32 limit) {
-
- if (unlikely(!rand_cnt--)) {
-
- u32 seed[2];
-
- ck_read(dev_urandom_fd, &seed, sizeof(seed), "/dev/urandom");
-
- srandom(seed[0]);
- rand_cnt = (RESEED_RNG / 2) + (seed[1] % RESEED_RNG);
-
- }
-
- return random() % limit;
-
-}
-
-
-/* Shuffle an array of pointers. Might be slightly biased. */
-
-static void shuffle_ptrs(void** ptrs, u32 cnt) {
-
- u32 i;
-
- for (i = 0; i < cnt - 2; i++) {
-
- u32 j = i + UR(cnt - i);
- void *s = ptrs[i];
- ptrs[i] = ptrs[j];
- ptrs[j] = s;
-
- }
-
-}
-
-
-#ifdef HAVE_AFFINITY
-
-/* Build a list of processes bound to specific cores. Returns -1 if nothing
- can be found. Assumes an upper bound of 4k CPUs. */
-
-static void bind_to_free_cpu(void) {
-
- DIR* d;
- struct dirent* de;
- cpu_set_t c;
-
- u8 cpu_used[4096] = { 0 };
- u32 i;
-
- if (cpu_core_count < 2) return;
-
- if (getenv("AFL_NO_AFFINITY")) {
-
- WARNF("Not binding to a CPU core (AFL_NO_AFFINITY set).");
- return;
-
- }
-
- d = opendir("/proc");
-
- if (!d) {
-
- WARNF("Unable to access /proc - can't scan for free CPU cores.");
- return;
-
- }
-
- ACTF("Checking CPU core loadout...");
-
- /* Introduce some jitter, in case multiple AFL tasks are doing the same
- thing at the same time... */
-
- usleep(R(1000) * 250);
-
- /* Scan all /proc/<pid>/status entries, checking for Cpus_allowed_list.
- Flag all processes bound to a specific CPU using cpu_used[]. This will
- fail for some exotic binding setups, but is likely good enough in almost
- all real-world use cases. */
-
- while ((de = readdir(d))) {
-
- u8* fn;
- FILE* f;
- u8 tmp[MAX_LINE];
- u8 has_vmsize = 0;
-
- if (!isdigit(de->d_name[0])) continue;
-
- fn = alloc_printf("/proc/%s/status", de->d_name);
-
- if (!(f = fopen(fn, "r"))) {
- ck_free(fn);
- continue;
- }
-
- while (fgets(tmp, MAX_LINE, f)) {
-
- u32 hval;
-
- /* Processes without VmSize are probably kernel tasks. */
-
- if (!strncmp(tmp, "VmSize:\t", 8)) has_vmsize = 1;
-
- if (!strncmp(tmp, "Cpus_allowed_list:\t", 19) &&
- !strchr(tmp, '-') && !strchr(tmp, ',') &&
- sscanf(tmp + 19, "%u", &hval) == 1 && hval < sizeof(cpu_used) &&
- has_vmsize) {
-
- cpu_used[hval] = 1;
- break;
-
- }
-
- }
-
- ck_free(fn);
- fclose(f);
-
- }
-
- closedir(d);
-
- for (i = 0; i < cpu_core_count; i++) if (!cpu_used[i]) break;
-
- if (i == cpu_core_count) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Uh-oh, looks like all %u CPU cores on your system are allocated to\n"
- " other instances of afl-fuzz (or similar CPU-locked tasks). Starting\n"
- " another fuzzer on this machine is probably a bad plan, but if you are\n"
- " absolutely sure, you can set AFL_NO_AFFINITY and try again.\n",
- cpu_core_count);
-
- FATAL("No more free CPU cores");
-
- }
-
- OKF("Found a free CPU core, binding to #%u.", i);
-
- cpu_aff = i;
-
- CPU_ZERO(&c);
- CPU_SET(i, &c);
-
- if (sched_setaffinity(0, sizeof(c), &c))
- PFATAL("sched_setaffinity failed");
-
-}
-
-#endif /* HAVE_AFFINITY */
-
-#ifndef IGNORE_FINDS
-
-/* Helper function to compare buffers; returns first and last differing offset. We
- use this to find reasonable locations for splicing two files. */
-
-static void locate_diffs(u8* ptr1, u8* ptr2, u32 len, s32* first, s32* last) {
-
- s32 f_loc = -1;
- s32 l_loc = -1;
- u32 pos;
-
- for (pos = 0; pos < len; pos++) {
-
- if (*(ptr1++) != *(ptr2++)) {
-
- if (f_loc == -1) f_loc = pos;
- l_loc = pos;
-
- }
-
- }
-
- *first = f_loc;
- *last = l_loc;
-
- return;
-
-}
-
-#endif /* !IGNORE_FINDS */
-
-
-/* Describe integer. Uses 12 cyclic static buffers for return values. The value
- returned should be five characters or less for all the integers we reasonably
- expect to see. */
-
-static u8* DI(u64 val) {
-
- static u8 tmp[12][16];
- static u8 cur;
-
- cur = (cur + 1) % 12;
-
-#define CHK_FORMAT(_divisor, _limit_mult, _fmt, _cast) do { \
- if (val < (_divisor) * (_limit_mult)) { \
- sprintf(tmp[cur], _fmt, ((_cast)val) / (_divisor)); \
- return tmp[cur]; \
- } \
- } while (0)
-
- /* 0-9999 */
- CHK_FORMAT(1, 10000, "%llu", u64);
-
- /* 10.0k - 99.9k */
- CHK_FORMAT(1000, 99.95, "%0.01fk", double);
-
- /* 100k - 999k */
- CHK_FORMAT(1000, 1000, "%lluk", u64);
-
- /* 1.00M - 9.99M */
- CHK_FORMAT(1000 * 1000, 9.995, "%0.02fM", double);
-
- /* 10.0M - 99.9M */
- CHK_FORMAT(1000 * 1000, 99.95, "%0.01fM", double);
-
- /* 100M - 999M */
- CHK_FORMAT(1000 * 1000, 1000, "%lluM", u64);
-
- /* 1.00G - 9.99G */
- CHK_FORMAT(1000LL * 1000 * 1000, 9.995, "%0.02fG", double);
-
- /* 10.0G - 99.9G */
- CHK_FORMAT(1000LL * 1000 * 1000, 99.95, "%0.01fG", double);
-
- /* 100G - 999G */
- CHK_FORMAT(1000LL * 1000 * 1000, 1000, "%lluG", u64);
-
- /* 1.00T - 9.99G */
- CHK_FORMAT(1000LL * 1000 * 1000 * 1000, 9.995, "%0.02fT", double);
-
- /* 10.0T - 99.9T */
- CHK_FORMAT(1000LL * 1000 * 1000 * 1000, 99.95, "%0.01fT", double);
-
- /* 100T+ */
- strcpy(tmp[cur], "infty");
- return tmp[cur];
-
-}
-
-
-/* Describe float. Similar to the above, except with a single
- static buffer. */
-
-static u8* DF(double val) {
-
- static u8 tmp[16];
-
- if (val < 99.995) {
- sprintf(tmp, "%0.02f", val);
- return tmp;
- }
-
- if (val < 999.95) {
- sprintf(tmp, "%0.01f", val);
- return tmp;
- }
-
- return DI((u64)val);
-
-}
-
-
-/* Describe integer as memory size. */
-
-static u8* DMS(u64 val) {
-
- static u8 tmp[12][16];
- static u8 cur;
-
- cur = (cur + 1) % 12;
-
- /* 0-9999 */
- CHK_FORMAT(1, 10000, "%llu B", u64);
-
- /* 10.0k - 99.9k */
- CHK_FORMAT(1024, 99.95, "%0.01f kB", double);
-
- /* 100k - 999k */
- CHK_FORMAT(1024, 1000, "%llu kB", u64);
-
- /* 1.00M - 9.99M */
- CHK_FORMAT(1024 * 1024, 9.995, "%0.02f MB", double);
-
- /* 10.0M - 99.9M */
- CHK_FORMAT(1024 * 1024, 99.95, "%0.01f MB", double);
-
- /* 100M - 999M */
- CHK_FORMAT(1024 * 1024, 1000, "%llu MB", u64);
-
- /* 1.00G - 9.99G */
- CHK_FORMAT(1024LL * 1024 * 1024, 9.995, "%0.02f GB", double);
-
- /* 10.0G - 99.9G */
- CHK_FORMAT(1024LL * 1024 * 1024, 99.95, "%0.01f GB", double);
-
- /* 100G - 999G */
- CHK_FORMAT(1024LL * 1024 * 1024, 1000, "%llu GB", u64);
-
- /* 1.00T - 9.99G */
- CHK_FORMAT(1024LL * 1024 * 1024 * 1024, 9.995, "%0.02f TB", double);
-
- /* 10.0T - 99.9T */
- CHK_FORMAT(1024LL * 1024 * 1024 * 1024, 99.95, "%0.01f TB", double);
-
-#undef CHK_FORMAT
-
- /* 100T+ */
- strcpy(tmp[cur], "infty");
- return tmp[cur];
-
-}
-
-
-/* Describe time delta. Returns one static buffer, 34 chars of less. */
-
-static u8* DTD(u64 cur_ms, u64 event_ms) {
-
- static u8 tmp[64];
- u64 delta;
- s32 t_d, t_h, t_m, t_s;
-
- if (!event_ms) return "none seen yet";
-
- delta = cur_ms - event_ms;
-
- t_d = delta / 1000 / 60 / 60 / 24;
- t_h = (delta / 1000 / 60 / 60) % 24;
- t_m = (delta / 1000 / 60) % 60;
- t_s = (delta / 1000) % 60;
-
- sprintf(tmp, "%s days, %u hrs, %u min, %u sec", DI(t_d), t_h, t_m, t_s);
- return tmp;
-
-}
-
-
-/* Mark deterministic checks as done for a particular queue entry. We use the
- .state file to avoid repeating deterministic fuzzing when resuming aborted
- scans. */
-
-static void mark_as_det_done(struct queue_entry* q) {
-
- u8* fn = strrchr(q->fname, '/');
- s32 fd;
-
- fn = alloc_printf("%s/queue/.state/deterministic_done/%s", out_dir, fn + 1);
-
- fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
- if (fd < 0) PFATAL("Unable to create '%s'", fn);
- close(fd);
-
- ck_free(fn);
-
- q->passed_det = 1;
-
-}
-
-
-/* Mark as variable. Create symlinks if possible to make it easier to examine
- the files. */
-
-static void mark_as_variable(struct queue_entry* q) {
-
- u8 *fn = strrchr(q->fname, '/') + 1, *ldest;
-
- ldest = alloc_printf("../../%s", fn);
- fn = alloc_printf("%s/queue/.state/variable_behavior/%s", out_dir, fn);
-
- if (symlink(ldest, fn)) {
-
- s32 fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
- if (fd < 0) PFATAL("Unable to create '%s'", fn);
- close(fd);
-
- }
-
- ck_free(ldest);
- ck_free(fn);
-
- q->var_behavior = 1;
-
-}
-
-
-/* Mark / unmark as redundant (edge-only). This is not used for restoring state,
- but may be useful for post-processing datasets. */
-
-static void mark_as_redundant(struct queue_entry* q, u8 state) {
-
- u8* fn;
- s32 fd;
-
- if (state == q->fs_redundant) return;
-
- q->fs_redundant = state;
-
- fn = strrchr(q->fname, '/');
- fn = alloc_printf("%s/queue/.state/redundant_edges/%s", out_dir, fn + 1);
-
- if (state) {
-
- fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
- if (fd < 0) PFATAL("Unable to create '%s'", fn);
- close(fd);
-
- } else {
-
- if (unlink(fn)) PFATAL("Unable to remove '%s'", fn);
-
- }
-
- ck_free(fn);
-
-}
-
-
-/* Append new test case to the queue. */
-
-static void add_to_queue(u8* fname, u32 len, u8 passed_det) {
-
- struct queue_entry* q = ck_alloc(sizeof(struct queue_entry));
-
- q->fname = fname;
- q->len = len;
- q->depth = cur_depth + 1;
- q->passed_det = passed_det;
-
- if (q->depth > max_depth) max_depth = q->depth;
-
- if (queue_top) {
-
- queue_top->next = q;
- queue_top = q;
-
- } else q_prev100 = queue = queue_top = q;
-
- queued_paths++;
- pending_not_fuzzed++;
-
- cycles_wo_finds = 0;
-
- if (!(queued_paths % 100)) {
-
- q_prev100->next_100 = q;
- q_prev100 = q;
-
- }
-
- last_path_time = get_cur_time();
-
-}
-
-
-/* Destroy the entire queue. */
-
-EXP_ST void destroy_queue(void) {
-
- struct queue_entry *q = queue, *n;
-
- while (q) {
-
- n = q->next;
- ck_free(q->fname);
- ck_free(q->trace_mini);
- ck_free(q);
- q = n;
-
- }
-
-}
-
-
-/* Write bitmap to file. The bitmap is useful mostly for the secret
- -B option, to focus a separate fuzzing session on a particular
- interesting input without rediscovering all the others. */
-
-EXP_ST void write_bitmap(void) {
-
- u8* fname;
- s32 fd;
-
- if (!bitmap_changed) return;
- bitmap_changed = 0;
-
- fname = alloc_printf("%s/fuzz_bitmap", out_dir);
- fd = open(fname, O_WRONLY | O_CREAT | O_TRUNC, 0600);
-
- if (fd < 0) PFATAL("Unable to open '%s'", fname);
-
- ck_write(fd, virgin_bits, MAP_SIZE, fname);
-
- close(fd);
- ck_free(fname);
-
-}
-
-
-/* Read bitmap from file. This is for the -B option again. */
-
-EXP_ST void read_bitmap(u8* fname) {
-
- s32 fd = open(fname, O_RDONLY);
-
- if (fd < 0) PFATAL("Unable to open '%s'", fname);
-
- ck_read(fd, virgin_bits, MAP_SIZE, fname);
-
- close(fd);
-
-}
-
-
-/* Check if the current execution path brings anything new to the table.
- Update virgin bits to reflect the finds. Returns 1 if the only change is
- the hit-count for a particular tuple; 2 if there are new tuples seen.
- Updates the map, so subsequent calls will always return 0.
-
- This function is called after every exec() on a fairly large buffer, so
- it needs to be fast. We do this in 32-bit and 64-bit flavors. */
-
-static inline u8 has_new_bits(u8* virgin_map) {
-
-#ifdef __x86_64__
-
- u64* current = (u64*)trace_bits;
- u64* virgin = (u64*)virgin_map;
-
- u32 i = (MAP_SIZE >> 3);
-
-#else
-
- u32* current = (u32*)trace_bits;
- u32* virgin = (u32*)virgin_map;
-
- u32 i = (MAP_SIZE >> 2);
-
-#endif /* ^__x86_64__ */
-
- u8 ret = 0;
-
- while (i--) {
-
- /* Optimize for (*current & *virgin) == 0 - i.e., no bits in current bitmap
- that have not been already cleared from the virgin map - since this will
- almost always be the case. */
-
- if (unlikely(*current) && unlikely(*current & *virgin)) {
-
- if (likely(ret < 2)) {
-
- u8* cur = (u8*)current;
- u8* vir = (u8*)virgin;
-
- /* Looks like we have not found any new bytes yet; see if any non-zero
- bytes in current[] are pristine in virgin[]. */
-
-#ifdef __x86_64__
-
- if ((cur[0] && vir[0] == 0xff) || (cur[1] && vir[1] == 0xff) ||
- (cur[2] && vir[2] == 0xff) || (cur[3] && vir[3] == 0xff) ||
- (cur[4] && vir[4] == 0xff) || (cur[5] && vir[5] == 0xff) ||
- (cur[6] && vir[6] == 0xff) || (cur[7] && vir[7] == 0xff)) ret = 2;
- else ret = 1;
-
-#else
-
- if ((cur[0] && vir[0] == 0xff) || (cur[1] && vir[1] == 0xff) ||
- (cur[2] && vir[2] == 0xff) || (cur[3] && vir[3] == 0xff)) ret = 2;
- else ret = 1;
-
-#endif /* ^__x86_64__ */
-
- }
-
- *virgin &= ~*current;
-
- }
-
- current++;
- virgin++;
-
- }
-
- if (ret && virgin_map == virgin_bits) bitmap_changed = 1;
-
- return ret;
-
-}
-
-
-/* Count the number of bits set in the provided bitmap. Used for the status
- screen several times every second, does not have to be fast. */
-
-static u32 count_bits(u8* mem) {
-
- u32* ptr = (u32*)mem;
- u32 i = (MAP_SIZE >> 2);
- u32 ret = 0;
-
- while (i--) {
-
- u32 v = *(ptr++);
-
- /* This gets called on the inverse, virgin bitmap; optimize for sparse
- data. */
-
- if (v == 0xffffffff) {
- ret += 32;
- continue;
- }
-
- v -= ((v >> 1) & 0x55555555);
- v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
- ret += (((v + (v >> 4)) & 0xF0F0F0F) * 0x01010101) >> 24;
-
- }
-
- return ret;
-
-}
-
-
-#define FF(_b) (0xff << ((_b) << 3))
-
-/* Count the number of bytes set in the bitmap. Called fairly sporadically,
- mostly to update the status screen or calibrate and examine confirmed
- new paths. */
-
-static u32 count_bytes(u8* mem) {
-
- u32* ptr = (u32*)mem;
- u32 i = (MAP_SIZE >> 2);
- u32 ret = 0;
-
- while (i--) {
-
- u32 v = *(ptr++);
-
- if (!v) continue;
- if (v & FF(0)) ret++;
- if (v & FF(1)) ret++;
- if (v & FF(2)) ret++;
- if (v & FF(3)) ret++;
-
- }
-
- return ret;
-
-}
-
-
-/* Count the number of non-255 bytes set in the bitmap. Used strictly for the
- status screen, several calls per second or so. */
-
-static u32 count_non_255_bytes(u8* mem) {
-
- u32* ptr = (u32*)mem;
- u32 i = (MAP_SIZE >> 2);
- u32 ret = 0;
-
- while (i--) {
-
- u32 v = *(ptr++);
-
- /* This is called on the virgin bitmap, so optimize for the most likely
- case. */
-
- if (v == 0xffffffff) continue;
- if ((v & FF(0)) != FF(0)) ret++;
- if ((v & FF(1)) != FF(1)) ret++;
- if ((v & FF(2)) != FF(2)) ret++;
- if ((v & FF(3)) != FF(3)) ret++;
-
- }
-
- return ret;
-
-}
-
-
-/* Destructively simplify trace by eliminating hit count information
- and replacing it with 0x80 or 0x01 depending on whether the tuple
- is hit or not. Called on every new crash or hang, should be
- reasonably fast. */
-
-static const u8 simplify_lookup[256] = {
-
- [0] = 1,
- [1 ... 255] = 128
-
-};
-
-#ifdef __x86_64__
-
-static void simplify_trace(u64* mem) {
-
- u32 i = MAP_SIZE >> 3;
-
- while (i--) {
-
- /* Optimize for sparse bitmaps. */
-
- if (unlikely(*mem)) {
-
- u8* mem8 = (u8*)mem;
-
- mem8[0] = simplify_lookup[mem8[0]];
- mem8[1] = simplify_lookup[mem8[1]];
- mem8[2] = simplify_lookup[mem8[2]];
- mem8[3] = simplify_lookup[mem8[3]];
- mem8[4] = simplify_lookup[mem8[4]];
- mem8[5] = simplify_lookup[mem8[5]];
- mem8[6] = simplify_lookup[mem8[6]];
- mem8[7] = simplify_lookup[mem8[7]];
-
- } else *mem = 0x0101010101010101ULL;
-
- mem++;
-
- }
-
-}
-
-#else
-
-static void simplify_trace(u32* mem) {
-
- u32 i = MAP_SIZE >> 2;
-
- while (i--) {
-
- /* Optimize for sparse bitmaps. */
-
- if (unlikely(*mem)) {
-
- u8* mem8 = (u8*)mem;
-
- mem8[0] = simplify_lookup[mem8[0]];
- mem8[1] = simplify_lookup[mem8[1]];
- mem8[2] = simplify_lookup[mem8[2]];
- mem8[3] = simplify_lookup[mem8[3]];
-
- } else *mem = 0x01010101;
-
- mem++;
- }
-
-}
-
-#endif /* ^__x86_64__ */
-
-
-/* Destructively classify execution counts in a trace. This is used as a
- preprocessing step for any newly acquired traces. Called on every exec,
- must be fast. */
-
-static const u8 count_class_lookup8[256] = {
-
- [0] = 0,
- [1] = 1,
- [2] = 2,
- [3] = 4,
- [4 ... 7] = 8,
- [8 ... 15] = 16,
- [16 ... 31] = 32,
- [32 ... 127] = 64,
- [128 ... 255] = 128
-
-};
-
-static u16 count_class_lookup16[65536];
-
-
-static void init_count_class16(void) {
-
- u32 b1, b2;
-
- for (b1 = 0; b1 < 256; b1++)
- for (b2 = 0; b2 < 256; b2++)
- count_class_lookup16[(b1 << 8) + b2] =
- (count_class_lookup8[b1] << 8) |
- count_class_lookup8[b2];
-
-}
-
-
-#ifdef __x86_64__
-
-static inline void classify_counts(u64* mem) {
-
- u32 i = MAP_SIZE >> 3;
-
- while (i--) {
-
- /* Optimize for sparse bitmaps. */
-
- if (unlikely(*mem)) {
-
- u16* mem16 = (u16*)mem;
-
- mem16[0] = count_class_lookup16[mem16[0]];
- mem16[1] = count_class_lookup16[mem16[1]];
- mem16[2] = count_class_lookup16[mem16[2]];
- mem16[3] = count_class_lookup16[mem16[3]];
-
- }
-
- mem++;
-
- }
-
-}
-
-#else
-
-static inline void classify_counts(u32* mem) {
-
- u32 i = MAP_SIZE >> 2;
-
- while (i--) {
-
- /* Optimize for sparse bitmaps. */
-
- if (unlikely(*mem)) {
-
- u16* mem16 = (u16*)mem;
-
- mem16[0] = count_class_lookup16[mem16[0]];
- mem16[1] = count_class_lookup16[mem16[1]];
-
- }
-
- mem++;
-
- }
-
-}
-
-#endif /* ^__x86_64__ */
-
-
-/* Get rid of shared memory (atexit handler). */
-
-static void remove_shm(void) {
-
- shmctl(shm_id, IPC_RMID, NULL);
-
-}
-
-
-/* Compact trace bytes into a smaller bitmap. We effectively just drop the
- count information here. This is called only sporadically, for some
- new paths. */
-
-static void minimize_bits(u8* dst, u8* src) {
-
- u32 i = 0;
-
- while (i < MAP_SIZE) {
-
- if (*(src++)) dst[i >> 3] |= 1 << (i & 7);
- i++;
-
- }
-
-}
-
-
-/* When we bump into a new path, we call this to see if the path appears
- more "favorable" than any of the existing ones. The purpose of the
- "favorables" is to have a minimal set of paths that trigger all the bits
- seen in the bitmap so far, and focus on fuzzing them at the expense of
- the rest.
-
- The first step of the process is to maintain a list of top_rated[] entries
- for every byte in the bitmap. We win that slot if there is no previous
- contender, or if the contender has a more favorable speed x size factor. */
-
-static void update_bitmap_score(struct queue_entry* q) {
-
- u32 i;
- u64 fav_factor = q->exec_us * q->len;
-
- /* For every byte set in trace_bits[], see if there is a previous winner,
- and how it compares to us. */
-
- for (i = 0; i < MAP_SIZE; i++)
-
- if (trace_bits[i]) {
-
- if (top_rated[i]) {
-
- /* Faster-executing or smaller test cases are favored. */
-
- if (fav_factor > top_rated[i]->exec_us * top_rated[i]->len) continue;
-
- /* Looks like we're going to win. Decrease ref count for the
- previous winner, discard its trace_bits[] if necessary. */
-
- if (!--top_rated[i]->tc_ref) {
- ck_free(top_rated[i]->trace_mini);
- top_rated[i]->trace_mini = 0;
- }
-
- }
-
- /* Insert ourselves as the new winner. */
-
- top_rated[i] = q;
- q->tc_ref++;
-
- if (!q->trace_mini) {
- q->trace_mini = ck_alloc(MAP_SIZE >> 3);
- minimize_bits(q->trace_mini, trace_bits);
- }
-
- score_changed = 1;
-
- }
-
-}
-
-
-/* The second part of the mechanism discussed above is a routine that
- goes over top_rated[] entries, and then sequentially grabs winners for
- previously-unseen bytes (temp_v) and marks them as favored, at least
- until the next run. The favored entries are given more air time during
- all fuzzing steps. */
-
-static void cull_queue(void) {
-
- struct queue_entry* q;
- static u8 temp_v[MAP_SIZE >> 3];
- u32 i;
-
- if (dumb_mode || !score_changed) return;
-
- score_changed = 0;
-
- memset(temp_v, 255, MAP_SIZE >> 3);
-
- queued_favored = 0;
- pending_favored = 0;
-
- q = queue;
-
- while (q) {
- q->favored = 0;
- q = q->next;
- }
-
- /* Let's see if anything in the bitmap isn't captured in temp_v.
- If yes, and if it has a top_rated[] contender, let's use it. */
-
- for (i = 0; i < MAP_SIZE; i++)
- if (top_rated[i] && (temp_v[i >> 3] & (1 << (i & 7)))) {
-
- u32 j = MAP_SIZE >> 3;
-
- /* Remove all bits belonging to the current entry from temp_v. */
-
- while (j--)
- if (top_rated[i]->trace_mini[j])
- temp_v[j] &= ~top_rated[i]->trace_mini[j];
-
- top_rated[i]->favored = 1;
- queued_favored++;
-
- if (!top_rated[i]->was_fuzzed) pending_favored++;
-
- }
-
- q = queue;
-
- while (q) {
- mark_as_redundant(q, !q->favored);
- q = q->next;
- }
-
-}
-
-
-/* Configure shared memory and virgin_bits. This is called at startup. */
-
-EXP_ST void setup_shm(void) {
-
- u8* shm_str;
-
- if (!in_bitmap) memset(virgin_bits, 255, MAP_SIZE);
-
- memset(virgin_hang, 255, MAP_SIZE);
- memset(virgin_crash, 255, MAP_SIZE);
-
- shm_id = shmget(IPC_PRIVATE, MAP_SIZE, IPC_CREAT | IPC_EXCL | 0600);
-
- if (shm_id < 0) PFATAL("shmget() failed");
-
- atexit(remove_shm);
-
- shm_str = alloc_printf("%d", shm_id);
-
- /* If somebody is asking us to fuzz instrumented binaries in dumb mode,
- we don't want them to detect instrumentation, since we won't be sending
- fork server commands. This should be replaced with better auto-detection
- later on, perhaps? */
-
- if (!dumb_mode) setenv(SHM_ENV_VAR, shm_str, 1);
-
- ck_free(shm_str);
-
- trace_bits = shmat(shm_id, NULL, 0);
-
- if (!trace_bits) PFATAL("shmat() failed");
-
-}
-
-
-/* Load postprocessor, if available. */
-
-static void setup_post(void) {
-
- void* dh;
- u8* fn = getenv("AFL_POST_LIBRARY");
- u32 tlen = 6;
-
- if (!fn) return;
-
- ACTF("Loading postprocessor from '%s'...", fn);
-
- dh = dlopen(fn, RTLD_NOW);
- if (!dh) FATAL("%s", dlerror());
-
- post_handler = dlsym(dh, "afl_postprocess");
- if (!post_handler) FATAL("Symbol 'afl_postprocess' not found.");
-
- /* Do a quick test. It's better to segfault now than later =) */
-
- post_handler("hello", &tlen);
-
- OKF("Postprocessor installed successfully.");
-
-}
-
-
-/* Read all testcases from the input directory, then queue them for testing.
- Called at startup. */
-
-static void read_testcases(void) {
-
- struct dirent **nl;
- s32 nl_cnt;
- u32 i;
- u8* fn;
-
- /* Auto-detect non-in-place resumption attempts. */
-
- fn = alloc_printf("%s/queue", in_dir);
- if (!access(fn, F_OK)) in_dir = fn; else ck_free(fn);
-
- ACTF("Scanning '%s'...", in_dir);
-
- /* We use scandir() + alphasort() rather than readdir() because otherwise,
- the ordering of test cases would vary somewhat randomly and would be
- difficult to control. */
-
- nl_cnt = scandir(in_dir, &nl, NULL, alphasort);
-
- if (nl_cnt < 0) {
-
- if (errno == ENOENT || errno == ENOTDIR)
-
- SAYF("\n" cLRD "[-] " cRST
- "The input directory does not seem to be valid - try again. The fuzzer needs\n"
- " one or more test case to start with - ideally, a small file under 1 kB\n"
- " or so. The cases must be stored as regular files directly in the input\n"
- " directory.\n");
-
- PFATAL("Unable to open '%s'", in_dir);
-
- }
-
- if (shuffle_queue && nl_cnt > 1) {
-
- ACTF("Shuffling queue...");
- shuffle_ptrs((void**)nl, nl_cnt);
-
- }
-
- for (i = 0; i < nl_cnt; i++) {
-
- struct stat st;
-
- u8* fn = alloc_printf("%s/%s", in_dir, nl[i]->d_name);
- u8* dfn = alloc_printf("%s/.state/deterministic_done/%s", in_dir, nl[i]->d_name);
-
- u8 passed_det = 0;
-
- free(nl[i]); /* not tracked */
-
- if (lstat(fn, &st) || access(fn, R_OK))
- PFATAL("Unable to access '%s'", fn);
-
- /* This also takes care of . and .. */
-
- if (!S_ISREG(st.st_mode) || !st.st_size || strstr(fn, "/README.txt")) {
-
- ck_free(fn);
- ck_free(dfn);
- continue;
-
- }
-
- if (st.st_size > MAX_FILE)
- FATAL("Test case '%s' is too big (%s, limit is %s)", fn,
- DMS(st.st_size), DMS(MAX_FILE));
-
- /* Check for metadata that indicates that deterministic fuzzing
- is complete for this entry. We don't want to repeat deterministic
- fuzzing when resuming aborted scans, because it would be pointless
- and probably very time-consuming. */
-
- if (!access(dfn, F_OK)) passed_det = 1;
- ck_free(dfn);
-
- add_to_queue(fn, st.st_size, passed_det);
-
- }
-
- free(nl); /* not tracked */
-
- if (!queued_paths) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Looks like there are no valid test cases in the input directory! The fuzzer\n"
- " needs one or more test case to start with - ideally, a small file under\n"
- " 1 kB or so. The cases must be stored as regular files directly in the\n"
- " input directory.\n");
-
- FATAL("No usable test cases in '%s'", in_dir);
-
- }
-
- last_path_time = 0;
- queued_at_start = queued_paths;
-
-}
-
-
-/* Helper function for load_extras. */
-
-static int compare_extras_len(const void* p1, const void* p2) {
- struct extra_data *e1 = (struct extra_data*)p1,
- *e2 = (struct extra_data*)p2;
-
- return e1->len - e2->len;
-}
-
-static int compare_extras_use_d(const void* p1, const void* p2) {
- struct extra_data *e1 = (struct extra_data*)p1,
- *e2 = (struct extra_data*)p2;
-
- return e2->hit_cnt - e1->hit_cnt;
-}
-
-
-/* Read extras from a file, sort by size. */
-
-static void load_extras_file(u8* fname, u32* min_len, u32* max_len,
- u32 dict_level) {
-
- FILE* f;
- u8 buf[MAX_LINE];
- u8 *lptr;
- u32 cur_line = 0;
-
- f = fopen(fname, "r");
-
- if (!f) PFATAL("Unable to open '%s'", fname);
-
- while ((lptr = fgets(buf, MAX_LINE, f))) {
-
- u8 *rptr, *wptr;
- u32 klen = 0;
-
- cur_line++;
-
- /* Trim on left and right. */
-
- while (isspace(*lptr)) lptr++;
-
- rptr = lptr + strlen(lptr) - 1;
- while (rptr >= lptr && isspace(*rptr)) rptr--;
- rptr++;
- *rptr = 0;
-
- /* Skip empty lines and comments. */
-
- if (!*lptr || *lptr == '#') continue;
-
- /* All other lines must end with '"', which we can consume. */
-
- rptr--;
-
- if (rptr < lptr || *rptr != '"')
- FATAL("Malformed name=\"value\" pair in line %u.", cur_line);
-
- *rptr = 0;
-
- /* Skip alphanumerics and dashes (label). */
-
- while (isalnum(*lptr) || *lptr == '_') lptr++;
-
- /* If @number follows, parse that. */
-
- if (*lptr == '@') {
-
- lptr++;
- if (atoi(lptr) > dict_level) continue;
- while (isdigit(*lptr)) lptr++;
-
- }
-
- /* Skip whitespace and = signs. */
-
- while (isspace(*lptr) || *lptr == '=') lptr++;
-
- /* Consume opening '"'. */
-
- if (*lptr != '"')
- FATAL("Malformed name=\"keyword\" pair in line %u.", cur_line);
-
- lptr++;
-
- if (!*lptr) FATAL("Empty keyword in line %u.", cur_line);
-
- /* Okay, let's allocate memory and copy data between "...", handling
- \xNN escaping, \\, and \". */
-
- extras = ck_realloc_block(extras, (extras_cnt + 1) *
- sizeof(struct extra_data));
-
- wptr = extras[extras_cnt].data = ck_alloc(rptr - lptr);
-
- while (*lptr) {
-
- char* hexdigits = "0123456789abcdef";
-
- switch (*lptr) {
-
- case 1 ... 31:
- case 128 ... 255:
- FATAL("Non-printable characters in line %u.", cur_line);
-
- case '\\':
-
- lptr++;
-
- if (*lptr == '\\' || *lptr == '"') {
- *(wptr++) = *(lptr++);
- klen++;
- break;
- }
-
- if (*lptr != 'x' || !isxdigit(lptr[1]) || !isxdigit(lptr[2]))
- FATAL("Invalid escaping (not \\xNN) in line %u.", cur_line);
-
- *(wptr++) =
- ((strchr(hexdigits, tolower(lptr[1])) - hexdigits) << 4) |
- (strchr(hexdigits, tolower(lptr[2])) - hexdigits);
-
- lptr += 3;
- klen++;
-
- break;
-
- default:
-
- *(wptr++) = *(lptr++);
- klen++;
-
- }
-
- }
-
- extras[extras_cnt].len = klen;
-
- if (extras[extras_cnt].len > MAX_DICT_FILE)
- FATAL("Keyword too big in line %u (%s, limit is %s)", cur_line,
- DMS(klen), DMS(MAX_DICT_FILE));
-
- if (*min_len > klen) *min_len = klen;
- if (*max_len < klen) *max_len = klen;
-
- extras_cnt++;
-
- }
-
- fclose(f);
-
-}
-
-
-/* Read extras from the extras directory and sort them by size. */
-
-static void load_extras(u8* dir) {
-
- DIR* d;
- struct dirent* de;
- u32 min_len = MAX_DICT_FILE, max_len = 0, dict_level = 0;
- u8* x;
-
- /* If the name ends with @, extract level and continue. */
-
- if ((x = strchr(dir, '@'))) {
-
- *x = 0;
- dict_level = atoi(x + 1);
-
- }
-
- ACTF("Loading extra dictionary from '%s' (level %u)...", dir, dict_level);
-
- d = opendir(dir);
-
- if (!d) {
-
- if (errno == ENOTDIR) {
- load_extras_file(dir, &min_len, &max_len, dict_level);
- goto check_and_sort;
- }
-
- PFATAL("Unable to open '%s'", dir);
-
- }
-
- if (x) FATAL("Dictionary levels not supported for directories.");
-
- while ((de = readdir(d))) {
-
- struct stat st;
- u8* fn = alloc_printf("%s/%s", dir, de->d_name);
- s32 fd;
-
- if (lstat(fn, &st) || access(fn, R_OK))
- PFATAL("Unable to access '%s'", fn);
-
- /* This also takes care of . and .. */
- if (!S_ISREG(st.st_mode) || !st.st_size) {
-
- ck_free(fn);
- continue;
-
- }
-
- if (st.st_size > MAX_DICT_FILE)
- FATAL("Extra '%s' is too big (%s, limit is %s)", fn,
- DMS(st.st_size), DMS(MAX_DICT_FILE));
-
- if (min_len > st.st_size) min_len = st.st_size;
- if (max_len < st.st_size) max_len = st.st_size;
-
- extras = ck_realloc_block(extras, (extras_cnt + 1) *
- sizeof(struct extra_data));
-
- extras[extras_cnt].data = ck_alloc(st.st_size);
- extras[extras_cnt].len = st.st_size;
-
- fd = open(fn, O_RDONLY);
-
- if (fd < 0) PFATAL("Unable to open '%s'", fn);
-
- ck_read(fd, extras[extras_cnt].data, st.st_size, fn);
-
- close(fd);
- ck_free(fn);
-
- extras_cnt++;
-
- }
-
- closedir(d);
-
-check_and_sort:
-
- if (!extras_cnt) FATAL("No usable files in '%s'", dir);
-
- qsort(extras, extras_cnt, sizeof(struct extra_data), compare_extras_len);
-
- OKF("Loaded %u extra tokens, size range %s to %s.", extras_cnt,
- DMS(min_len), DMS(max_len));
-
- if (max_len > 32)
- WARNF("Some tokens are relatively large (%s) - consider trimming.",
- DMS(max_len));
-
- if (extras_cnt > MAX_DET_EXTRAS)
- WARNF("More than %u tokens - will use them probabilistically.",
- MAX_DET_EXTRAS);
-
-}
-
-
-
-
-/* Helper function for maybe_add_auto() */
-
-static inline u8 memcmp_nocase(u8* m1, u8* m2, u32 len) {
-
- while (len--) if (tolower(*(m1++)) ^ tolower(*(m2++))) return 1;
- return 0;
-
-}
-
-
-/* Maybe add automatic extra. */
-
-static void maybe_add_auto(u8* mem, u32 len) {
-
- u32 i;
-
- /* Allow users to specify that they don't want auto dictionaries. */
-
- if (!MAX_AUTO_EXTRAS || !USE_AUTO_EXTRAS) return;
-
- /* Skip runs of identical bytes. */
-
- for (i = 1; i < len; i++)
- if (mem[0] ^ mem[i]) break;
-
- if (i == len) return;
-
- /* Reject builtin interesting values. */
-
- if (len == 2) {
-
- i = sizeof(interesting_16) >> 1;
-
- while (i--)
- if (*((u16*)mem) == interesting_16[i] ||
- *((u16*)mem) == SWAP16(interesting_16[i])) return;
-
- }
-
- if (len == 4) {
-
- i = sizeof(interesting_32) >> 2;
-
- while (i--)
- if (*((u32*)mem) == interesting_32[i] ||
- *((u32*)mem) == SWAP32(interesting_32[i])) return;
-
- }
-
- /* Reject anything that matches existing extras. Do a case-insensitive
- match. We optimize by exploiting the fact that extras[] are sorted
- by size. */
-
- for (i = 0; i < extras_cnt; i++)
- if (extras[i].len >= len) break;
-
- for (; i < extras_cnt && extras[i].len == len; i++)
- if (!memcmp_nocase(extras[i].data, mem, len)) return;
-
- /* Last but not least, check a_extras[] for matches. There are no
- guarantees of a particular sort order. */
-
- auto_changed = 1;
-
- for (i = 0; i < a_extras_cnt; i++) {
-
- if (a_extras[i].len == len && !memcmp_nocase(a_extras[i].data, mem, len)) {
-
- a_extras[i].hit_cnt++;
- goto sort_a_extras;
-
- }
-
- }
-
- /* At this point, looks like we're dealing with a new entry. So, let's
- append it if we have room. Otherwise, let's randomly evict some other
- entry from the bottom half of the list. */
-
- if (a_extras_cnt < MAX_AUTO_EXTRAS) {
-
- a_extras = ck_realloc_block(a_extras, (a_extras_cnt + 1) *
- sizeof(struct extra_data));
-
- a_extras[a_extras_cnt].data = ck_memdup(mem, len);
- a_extras[a_extras_cnt].len = len;
- a_extras_cnt++;
-
- } else {
-
- i = MAX_AUTO_EXTRAS / 2 +
- UR((MAX_AUTO_EXTRAS + 1) / 2);
-
- ck_free(a_extras[i].data);
-
- a_extras[i].data = ck_memdup(mem, len);
- a_extras[i].len = len;
- a_extras[i].hit_cnt = 0;
-
- }
-
-sort_a_extras:
-
- /* First, sort all auto extras by use count, descending order. */
-
- qsort(a_extras, a_extras_cnt, sizeof(struct extra_data),
- compare_extras_use_d);
-
- /* Then, sort the top USE_AUTO_EXTRAS entries by size. */
-
- qsort(a_extras, MIN(USE_AUTO_EXTRAS, a_extras_cnt),
- sizeof(struct extra_data), compare_extras_len);
-
-}
-
-
-/* Save automatically generated extras. */
-
-static void save_auto(void) {
-
- u32 i;
-
- if (!auto_changed) return;
- auto_changed = 0;
-
- for (i = 0; i < MIN(USE_AUTO_EXTRAS, a_extras_cnt); i++) {
-
- u8* fn = alloc_printf("%s/queue/.state/auto_extras/auto_%06u", out_dir, i);
- s32 fd;
-
- fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600);
-
- if (fd < 0) PFATAL("Unable to create '%s'", fn);
-
- ck_write(fd, a_extras[i].data, a_extras[i].len, fn);
-
- close(fd);
- ck_free(fn);
-
- }
-
-}
-
-
-/* Load automatically generated extras. */
-
-static void load_auto(void) {
-
- u32 i;
-
- for (i = 0; i < USE_AUTO_EXTRAS; i++) {
-
- u8 tmp[MAX_AUTO_EXTRA + 1];
- u8* fn = alloc_printf("%s/.state/auto_extras/auto_%06u", in_dir, i);
- s32 fd, len;
-
- fd = open(fn, O_RDONLY, 0600);
-
- if (fd < 0) {
-
- if (errno != ENOENT) PFATAL("Unable to open '%s'", fn);
- ck_free(fn);
- break;
-
- }
-
- /* We read one byte more to cheaply detect tokens that are too
- long (and skip them). */
-
- len = read(fd, tmp, MAX_AUTO_EXTRA + 1);
-
- if (len < 0) PFATAL("Unable to read from '%s'", fn);
-
- if (len >= MIN_AUTO_EXTRA && len <= MAX_AUTO_EXTRA)
- maybe_add_auto(tmp, len);
-
- close(fd);
- ck_free(fn);
-
- }
-
- if (i) OKF("Loaded %u auto-discovered dictionary tokens.", i);
- else OKF("No auto-generated dictionary tokens to reuse.");
-
-}
-
-
-/* Destroy extras. */
-
-static void destroy_extras(void) {
-
- u32 i;
-
- for (i = 0; i < extras_cnt; i++)
- ck_free(extras[i].data);
-
- ck_free(extras);
-
- for (i = 0; i < a_extras_cnt; i++)
- ck_free(a_extras[i].data);
-
- ck_free(a_extras);
-
-}
-
-
-/* Spin up fork server (instrumented mode only). The idea is explained here:
-
- http://lcamtuf.blogspot.com/2014/10/fuzzing-binaries-without-execve.html
-
- In essence, the instrumentation allows us to skip execve(), and just keep
- cloning a stopped child. So, we just execute once, and then send commands
- through a pipe. The other part of this logic is in afl-as.h. */
-
-EXP_ST void init_forkserver(char** argv) {
-
- static struct itimerval it;
- int st_pipe[2], ctl_pipe[2];
- int status;
- s32 rlen;
-
- ACTF("Spinning up the fork server...");
-
- if (pipe(st_pipe) || pipe(ctl_pipe)) PFATAL("pipe() failed");
-
- forksrv_pid = fork();
-
- if (forksrv_pid < 0) PFATAL("fork() failed");
-
- if (!forksrv_pid) {
-
- struct rlimit r;
-
- /* Umpf. On OpenBSD, the default fd limit for root users is set to
- soft 128. Let's try to fix that... */
-
- if (!getrlimit(RLIMIT_NOFILE, &r) && r.rlim_cur < FORKSRV_FD + 2) {
-
- r.rlim_cur = FORKSRV_FD + 2;
- setrlimit(RLIMIT_NOFILE, &r); /* Ignore errors */
-
- }
-
- if (mem_limit) {
-
- r.rlim_max = r.rlim_cur = ((rlim_t)mem_limit) << 20;
-
-#ifdef RLIMIT_AS
-
- setrlimit(RLIMIT_AS, &r); /* Ignore errors */
-
-#else
-
- /* This takes care of OpenBSD, which doesn't have RLIMIT_AS, but
- according to reliable sources, RLIMIT_DATA covers anonymous
- maps - so we should be getting good protection against OOM bugs. */
-
- setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
-
-#endif /* ^RLIMIT_AS */
-
-
- }
-
- /* Dumping cores is slow and can lead to anomalies if SIGKILL is delivered
- before the dump is complete. */
-
- r.rlim_max = r.rlim_cur = 0;
-
- setrlimit(RLIMIT_CORE, &r); /* Ignore errors */
-
- /* Isolate the process and configure standard descriptors. If out_file is
- specified, stdin is /dev/null; otherwise, out_fd is cloned instead. */
-
- setsid();
-
- dup2(dev_null_fd, 1);
- dup2(dev_null_fd, 2);
-
- if (out_file) {
-
- dup2(dev_null_fd, 0);
-
- } else {
-
- dup2(out_fd, 0);
- close(out_fd);
-
- }
-
- /* Set up control and status pipes, close the unneeded original fds. */
-
- if (dup2(ctl_pipe[0], FORKSRV_FD) < 0) PFATAL("dup2() failed");
- if (dup2(st_pipe[1], FORKSRV_FD + 1) < 0) PFATAL("dup2() failed");
-
- close(ctl_pipe[0]);
- close(ctl_pipe[1]);
- close(st_pipe[0]);
- close(st_pipe[1]);
-
- close(out_dir_fd);
- close(dev_null_fd);
- close(dev_urandom_fd);
- close(fileno(plot_file));
-
- /* This should improve performance a bit, since it stops the linker from
- doing extra work post-fork(). */
-
- if (!getenv("LD_BIND_LAZY")) setenv("LD_BIND_NOW", "1", 0);
-
- /* Set sane defaults for ASAN if nothing else specified. */
-
- setenv("ASAN_OPTIONS", "abort_on_error=1:"
- "detect_leaks=0:"
- "symbolize=0:"
- "allocator_may_return_null=1", 0);
-
- /* MSAN is tricky, because it doesn't support abort_on_error=1 at this
- point. So, we do this in a very hacky way. */
-
- setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":"
- "symbolize=0:"
- "abort_on_error=1:"
- "allocator_may_return_null=1:"
- "msan_track_origins=0", 0);
-
- execv(target_path, argv);
-
- /* Use a distinctive bitmap signature to tell the parent about execv()
- falling through. */
-
- *(u32*)trace_bits = EXEC_FAIL_SIG;
- exit(0);
-
- }
-
- /* Close the unneeded endpoints. */
-
- close(ctl_pipe[0]);
- close(st_pipe[1]);
-
- fsrv_ctl_fd = ctl_pipe[1];
- fsrv_st_fd = st_pipe[0];
-
- /* Wait for the fork server to come up, but don't wait too long. */
-
- it.it_value.tv_sec = ((exec_tmout * FORK_WAIT_MULT) / 1000);
- it.it_value.tv_usec = ((exec_tmout * FORK_WAIT_MULT) % 1000) * 1000;
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- rlen = read(fsrv_st_fd, &status, 4);
-
- it.it_value.tv_sec = 0;
- it.it_value.tv_usec = 0;
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- /* If we have a four-byte "hello" message from the server, we're all set.
- Otherwise, try to figure out what went wrong. */
-
- if (rlen == 4) {
- OKF("All right - fork server is up.");
- return;
- }
-
- if (child_timed_out)
- FATAL("Timeout while initializing fork server (adjusting -t may help)");
-
- if (waitpid(forksrv_pid, &status, 0) <= 0)
- PFATAL("waitpid() failed");
-
- if (WIFSIGNALED(status)) {
-
- if (mem_limit && mem_limit < 500 && uses_asan) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Whoops, the target binary crashed suddenly, before receiving any input\n"
- " from the fuzzer! Since it seems to be built with ASAN and you have a\n"
- " restrictive memory limit configured, this is expected; please read\n"
- " %s/notes_for_asan.txt for help.\n", doc_path);
-
- } else if (!mem_limit) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Whoops, the target binary crashed suddenly, before receiving any input\n"
- " from the fuzzer! There are several probable explanations:\n\n"
-
- " - The binary is just buggy and explodes entirely on its own. If so, you\n"
- " need to fix the underlying problem or find a better replacement.\n\n"
-
-#ifdef __APPLE__
-
- " - On MacOS X, the semantics of fork() syscalls are non-standard and may\n"
- " break afl-fuzz performance optimizations when running platform-specific\n"
- " targets. To fix this, set AFL_NO_FORKSRV=1 in the environment.\n\n"
-
-#endif /* __APPLE__ */
-
- " - Less likely, there is a horrible bug in the fuzzer. If other options\n"
- " fail, poke <lcamtuf@coredump.cx> for troubleshooting tips.\n");
-
- } else {
-
- SAYF("\n" cLRD "[-] " cRST
- "Whoops, the target binary crashed suddenly, before receiving any input\n"
- " from the fuzzer! There are several probable explanations:\n\n"
-
- " - The current memory limit (%s) is too restrictive, causing the\n"
- " target to hit an OOM condition in the dynamic linker. Try bumping up\n"
- " the limit with the -m setting in the command line. A simple way confirm\n"
- " this diagnosis would be:\n\n"
-
-#ifdef RLIMIT_AS
- " ( ulimit -Sv $[%llu << 10]; /path/to/fuzzed_app )\n\n"
-#else
- " ( ulimit -Sd $[%llu << 10]; /path/to/fuzzed_app )\n\n"
-#endif /* ^RLIMIT_AS */
-
- " Tip: you can use http://jwilk.net/software/recidivm to quickly\n"
- " estimate the required amount of virtual memory for the binary.\n\n"
-
- " - The binary is just buggy and explodes entirely on its own. If so, you\n"
- " need to fix the underlying problem or find a better replacement.\n\n"
-
-#ifdef __APPLE__
-
- " - On MacOS X, the semantics of fork() syscalls are non-standard and may\n"
- " break afl-fuzz performance optimizations when running platform-specific\n"
- " targets. To fix this, set AFL_NO_FORKSRV=1 in the environment.\n\n"
-
-#endif /* __APPLE__ */
-
- " - Less likely, there is a horrible bug in the fuzzer. If other options\n"
- " fail, poke <lcamtuf@coredump.cx> for troubleshooting tips.\n",
- DMS(mem_limit << 20), mem_limit - 1);
-
- }
-
- FATAL("Fork server crashed with signal %d", WTERMSIG(status));
-
- }
-
- if (*(u32*)trace_bits == EXEC_FAIL_SIG)
- FATAL("Unable to execute target application ('%s')", argv[0]);
-
- if (mem_limit && mem_limit < 500 && uses_asan) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Hmm, looks like the target binary terminated before we could complete a\n"
- " handshake with the injected code. Since it seems to be built with ASAN and\n"
- " you have a restrictive memory limit configured, this is expected; please\n"
- " read %s/notes_for_asan.txt for help.\n", doc_path);
-
- } else if (!mem_limit) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Hmm, looks like the target binary terminated before we could complete a\n"
- " handshake with the injected code. Perhaps there is a horrible bug in the\n"
- " fuzzer. Poke <lcamtuf@coredump.cx> for troubleshooting tips.\n");
-
- } else {
-
- SAYF("\n" cLRD "[-] " cRST
- "Hmm, looks like the target binary terminated before we could complete a\n"
- " handshake with the injected code. There are %s probable explanations:\n\n"
-
- "%s"
- " - The current memory limit (%s) is too restrictive, causing an OOM\n"
- " fault in the dynamic linker. This can be fixed with the -m option. A\n"
- " simple way to confirm the diagnosis may be:\n\n"
-
-#ifdef RLIMIT_AS
- " ( ulimit -Sv $[%llu << 10]; /path/to/fuzzed_app )\n\n"
-#else
- " ( ulimit -Sd $[%llu << 10]; /path/to/fuzzed_app )\n\n"
-#endif /* ^RLIMIT_AS */
-
- " Tip: you can use http://jwilk.net/software/recidivm to quickly\n"
- " estimate the required amount of virtual memory for the binary.\n\n"
-
- " - Less likely, there is a horrible bug in the fuzzer. If other options\n"
- " fail, poke <lcamtuf@coredump.cx> for troubleshooting tips.\n",
- getenv(DEFER_ENV_VAR) ? "three" : "two",
- getenv(DEFER_ENV_VAR) ?
- " - You are using deferred forkserver, but __AFL_INIT() is never\n"
- " reached before the program terminates.\n\n" : "",
- DMS(mem_limit << 20), mem_limit - 1);
-
- }
-
- FATAL("Fork server handshake failed");
-
-}
-
-
-/* Execute target application, monitoring for timeouts. Return status
- information. The called program will update trace_bits[]. */
-
-static u8 run_target(char** argv) {
-
- static struct itimerval it;
- static u32 prev_timed_out = 0;
-
- int status = 0;
- u32 tb4;
-
- child_timed_out = 0;
-
- /* After this memset, trace_bits[] are effectively volatile, so we
- must prevent any earlier operations from venturing into that
- territory. */
-
- memset(trace_bits, 0, MAP_SIZE);
- MEM_BARRIER();
-
- /* If we're running in "dumb" mode, we can't rely on the fork server
- logic compiled into the target program, so we will just keep calling
- execve(). There is a bit of code duplication between here and
- init_forkserver(), but c'est la vie. */
-
- if (dumb_mode == 1 || no_forkserver) {
-
- child_pid = fork();
-
- if (child_pid < 0) PFATAL("fork() failed");
-
- if (!child_pid) {
-
- struct rlimit r;
-
- if (mem_limit) {
-
- r.rlim_max = r.rlim_cur = ((rlim_t)mem_limit) << 20;
-
-#ifdef RLIMIT_AS
-
- setrlimit(RLIMIT_AS, &r); /* Ignore errors */
-
-#else
-
- setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
-
-#endif /* ^RLIMIT_AS */
-
- }
-
- r.rlim_max = r.rlim_cur = 0;
-
- setrlimit(RLIMIT_CORE, &r); /* Ignore errors */
-
- /* Isolate the process and configure standard descriptors. If out_file is
- specified, stdin is /dev/null; otherwise, out_fd is cloned instead. */
-
- setsid();
-
- dup2(dev_null_fd, 1);
- dup2(dev_null_fd, 2);
-
- if (out_file) {
-
- dup2(dev_null_fd, 0);
-
- } else {
-
- dup2(out_fd, 0);
- close(out_fd);
-
- }
-
- /* On Linux, would be faster to use O_CLOEXEC. Maybe TODO. */
-
- close(dev_null_fd);
- close(out_dir_fd);
- close(dev_urandom_fd);
- close(fileno(plot_file));
-
- /* Set sane defaults for ASAN if nothing else specified. */
-
- setenv("ASAN_OPTIONS", "abort_on_error=1:"
- "detect_leaks=0:"
- "symbolize=0:"
- "allocator_may_return_null=1", 0);
-
- setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":"
- "symbolize=0:"
- "msan_track_origins=0", 0);
-
- execv(target_path, argv);
-
- /* Use a distinctive bitmap value to tell the parent about execv()
- falling through. */
-
- *(u32*)trace_bits = EXEC_FAIL_SIG;
- exit(0);
-
- }
-
- } else {
-
- s32 res;
-
- /* In non-dumb mode, we have the fork server up and running, so simply
- tell it to have at it, and then read back PID. */
-
- if ((res = write(fsrv_ctl_fd, &prev_timed_out, 4)) != 4) {
-
- if (stop_soon) return 0;
- RPFATAL(res, "Unable to request new process from fork server (OOM?)");
-
- }
-
- if ((res = read(fsrv_st_fd, &child_pid, 4)) != 4) {
-
- if (stop_soon) return 0;
- RPFATAL(res, "Unable to request new process from fork server (OOM?)");
-
- }
-
- if (child_pid <= 0) FATAL("Fork server is misbehaving (OOM?)");
-
- }
-
- /* Configure timeout, as requested by user, then wait for child to terminate. */
-
- it.it_value.tv_sec = (exec_tmout / 1000);
- it.it_value.tv_usec = (exec_tmout % 1000) * 1000;
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- /* The SIGALRM handler simply kills the child_pid and sets child_timed_out. */
-
- if (dumb_mode == 1 || no_forkserver) {
-
- if (waitpid(child_pid, &status, 0) <= 0) PFATAL("waitpid() failed");
-
- } else {
-
- s32 res;
-
- if ((res = read(fsrv_st_fd, &status, 4)) != 4) {
-
- if (stop_soon) return 0;
- RPFATAL(res, "Unable to communicate with fork server (OOM?)");
-
- }
-
- }
-
- if (!WIFSTOPPED(status)) child_pid = 0;
-
- it.it_value.tv_sec = 0;
- it.it_value.tv_usec = 0;
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- total_execs++;
-
- /* Any subsequent operations on trace_bits must not be moved by the
- compiler below this point. Past this location, trace_bits[] behave
- very normally and do not have to be treated as volatile. */
-
- MEM_BARRIER();
-
- tb4 = *(u32*)trace_bits;
-
-#ifdef __x86_64__
- classify_counts((u64*)trace_bits);
-#else
- classify_counts((u32*)trace_bits);
-#endif /* ^__x86_64__ */
-
- prev_timed_out = child_timed_out;
-
- /* Report outcome to caller. */
-
- if (child_timed_out) return FAULT_HANG;
-
- if (WIFSIGNALED(status) && !stop_soon) {
- kill_signal = WTERMSIG(status);
- return FAULT_CRASH;
- }
-
- /* A somewhat nasty hack for MSAN, which doesn't support abort_on_error and
- must use a special exit code. */
-
- if (uses_asan && WEXITSTATUS(status) == MSAN_ERROR) {
- kill_signal = 0;
- return FAULT_CRASH;
- }
-
- if ((dumb_mode == 1 || no_forkserver) && tb4 == EXEC_FAIL_SIG)
- return FAULT_ERROR;
-
- return FAULT_NONE;
-
-}
-
-
-/* Write modified data to file for testing. If out_file is set, the old file
- is unlinked and a new one is created. Otherwise, out_fd is rewound and
- truncated. */
-
-static void write_to_testcase(void* mem, u32 len) {
-
- s32 fd = out_fd;
-
- if (out_file) {
-
- unlink(out_file); /* Ignore errors. */
-
- fd = open(out_file, O_WRONLY | O_CREAT | O_EXCL, 0600);
-
- if (fd < 0) PFATAL("Unable to create '%s'", out_file);
-
- } else lseek(fd, 0, SEEK_SET);
-
- ck_write(fd, mem, len, out_file);
-
- if (!out_file) {
-
- if (ftruncate(fd, len)) PFATAL("ftruncate() failed");
- lseek(fd, 0, SEEK_SET);
-
- } else close(fd);
-
-}
-
-
-/* The same, but with an adjustable gap. Used for trimming. */
-
-static void write_with_gap(void* mem, u32 len, u32 skip_at, u32 skip_len) {
-
- s32 fd = out_fd;
- u32 tail_len = len - skip_at - skip_len;
-
- if (out_file) {
-
- unlink(out_file); /* Ignore errors. */
-
- fd = open(out_file, O_WRONLY | O_CREAT | O_EXCL, 0600);
-
- if (fd < 0) PFATAL("Unable to create '%s'", out_file);
-
- } else lseek(fd, 0, SEEK_SET);
-
- if (skip_at) ck_write(fd, mem, skip_at, out_file);
-
- if (tail_len) ck_write(fd, mem + skip_at + skip_len, tail_len, out_file);
-
- if (!out_file) {
-
- if (ftruncate(fd, len - skip_len)) PFATAL("ftruncate() failed");
- lseek(fd, 0, SEEK_SET);
-
- } else close(fd);
-
-}
-
-
-static void show_stats(void);
-
-/* Calibrate a new test case. This is done when processing the input directory
- to warn about flaky or otherwise problematic test cases early on; and when
- new paths are discovered to detect variable behavior and so on. */
-
-static u8 calibrate_case(char** argv, struct queue_entry* q, u8* use_mem,
- u32 handicap, u8 from_queue) {
-
- static u8 first_trace[MAP_SIZE];
-
- u8 fault = 0, new_bits = 0, var_detected = 0,
- first_run = (q->exec_cksum == 0);
-
- u64 start_us, stop_us;
-
- s32 old_sc = stage_cur, old_sm = stage_max, old_tmout = exec_tmout;
- u8* old_sn = stage_name;
-
- /* Be a bit more generous about timeouts when resuming sessions, or when
- trying to calibrate already-added finds. This helps avoid trouble due
- to intermittent latency. */
-
- if (!from_queue || resuming_fuzz)
- exec_tmout = MAX(exec_tmout + CAL_TMOUT_ADD,
- exec_tmout * CAL_TMOUT_PERC / 100);
-
- q->cal_failed++;
-
- stage_name = "calibration";
- stage_max = CAL_CYCLES;
-
- /* Make sure the forkserver is up before we do anything, and let's not
- count its spin-up time toward binary calibration. */
-
- if (dumb_mode != 1 && !no_forkserver && !forksrv_pid)
- init_forkserver(argv);
-
- if (q->exec_cksum) memcpy(first_trace, trace_bits, MAP_SIZE);
-
- start_us = get_cur_time_us();
-
- for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
-
- u32 cksum;
-
- if (!first_run && !(stage_cur % stats_update_freq)) show_stats();
-
- write_to_testcase(use_mem, q->len);
-
- fault = run_target(argv);
-
- /* stop_soon is set by the handler for Ctrl+C. When it's pressed,
- we want to bail out quickly. */
-
- if (stop_soon || fault != crash_mode) goto abort_calibration;
-
- if (!dumb_mode && !stage_cur && !count_bytes(trace_bits)) {
- fault = FAULT_NOINST;
- goto abort_calibration;
- }
-
- cksum = hash32(trace_bits, MAP_SIZE, HASH_CONST);
-
- if (q->exec_cksum != cksum) {
-
- u8 hnb = has_new_bits(virgin_bits);
- if (hnb > new_bits) new_bits = hnb;
-
- if (q->exec_cksum) {
-
- u32 i;
-
- for (i = 0; i < MAP_SIZE; i++) {
-
- if (!var_bytes[i] && first_trace[i] != trace_bits[i]) {
-
- var_bytes[i] = 1;
- stage_max = CAL_CYCLES_LONG;
-
- }
-
- }
-
- var_detected = 1;
-
- } else {
-
- q->exec_cksum = cksum;
- memcpy(first_trace, trace_bits, MAP_SIZE);
-
- }
-
- }
-
- }
-
- stop_us = get_cur_time_us();
-
- total_cal_us += stop_us - start_us;
- total_cal_cycles += stage_max;
-
- /* OK, let's collect some stats about the performance of this test case.
- This is used for fuzzing air time calculations in calculate_score(). */
-
- q->exec_us = (stop_us - start_us) / stage_max;
- q->bitmap_size = count_bytes(trace_bits);
- q->handicap = handicap;
- q->cal_failed = 0;
-
- total_bitmap_size += q->bitmap_size;
- total_bitmap_entries++;
-
- update_bitmap_score(q);
-
- /* If this case didn't result in new output from the instrumentation, tell
- parent. This is a non-critical problem, but something to warn the user
- about. */
-
- if (!dumb_mode && first_run && !fault && !new_bits) fault = FAULT_NOBITS;
-
-abort_calibration:
-
- if (new_bits == 2 && !q->has_new_cov) {
- q->has_new_cov = 1;
- queued_with_cov++;
- }
-
- /* Mark variable paths. */
-
- if (var_detected) {
-
- var_byte_count = count_bytes(var_bytes);
-
- if (!q->var_behavior) {
- mark_as_variable(q);
- queued_variable++;
- }
-
- }
-
- stage_name = old_sn;
- stage_cur = old_sc;
- stage_max = old_sm;
- exec_tmout = old_tmout;
-
- if (!first_run) show_stats();
-
- return fault;
-
-}
-
-
-/* Examine map coverage. Called once, for first test case. */
-
-static void check_map_coverage(void) {
-
- u32 i;
-
- if (count_bytes(trace_bits) < 100) return;
-
- for (i = (1 << (MAP_SIZE_POW2 - 1)); i < MAP_SIZE; i++)
- if (trace_bits[i]) return;
-
- WARNF("Recompile binary with newer version of afl to improve coverage!");
-
-}
-
-
-/* Perform dry run of all test cases to confirm that the app is working as
- expected. This is done only for the initial inputs, and only once. */
-
-static void perform_dry_run(char** argv) {
-
- struct queue_entry* q = queue;
- u32 cal_failures = 0;
- u8* skip_crashes = getenv("AFL_SKIP_CRASHES");
-
- while (q) {
-
- u8* use_mem;
- u8 res;
- s32 fd;
-
- u8* fn = strrchr(q->fname, '/') + 1;
-
- ACTF("Attempting dry run with '%s'...", fn);
-
- fd = open(q->fname, O_RDONLY);
- if (fd < 0) PFATAL("Unable to open '%s'", q->fname);
-
- use_mem = ck_alloc_nozero(q->len);
-
- if (read(fd, use_mem, q->len) != q->len)
- FATAL("Short read from '%s'", q->fname);
-
- close(fd);
-
- res = calibrate_case(argv, q, use_mem, 0, 1);
- ck_free(use_mem);
-
- if (stop_soon) return;
-
- if (res == crash_mode || res == FAULT_NOBITS)
- SAYF(cGRA " len = %u, map size = %u, exec speed = %llu us\n" cRST,
- q->len, q->bitmap_size, q->exec_us);
-
- switch (res) {
-
- case FAULT_NONE:
-
- if (q == queue) check_map_coverage();
-
- if (crash_mode) FATAL("Test case '%s' does *NOT* crash", fn);
-
- break;
-
- case FAULT_HANG:
-
- if (timeout_given) {
-
- /* The -t nn+ syntax in the command line sets timeout_given to '2' and
- instructs afl-fuzz to tolerate but skip queue entries that time
- out. */
-
- if (timeout_given > 1) {
- WARNF("Test case results in a hang (skipping)");
- q->cal_failed = CAL_CHANCES;
- cal_failures++;
- break;
- }
-
- SAYF("\n" cLRD "[-] " cRST
- "The program took more than %u ms to process one of the initial test cases.\n"
- " Usually, the right thing to do is to relax the -t option - or to delete it\n"
- " altogether and allow the fuzzer to auto-calibrate. That said, if you know\n"
- " what you are doing and want to simply skip the unruly test cases, append\n"
- " '+' at the end of the value passed to -t ('-t %u+').\n", exec_tmout,
- exec_tmout);
-
- FATAL("Test case '%s' results in a hang", fn);
-
- } else {
-
- SAYF("\n" cLRD "[-] " cRST
- "The program took more than %u ms to process one of the initial test cases.\n"
- " This is bad news; raising the limit with the -t option is possible, but\n"
- " will probably make the fuzzing process extremely slow.\n\n"
-
- " If this test case is just a fluke, the other option is to just avoid it\n"
- " altogether, and find one that is less of a CPU hog.\n", exec_tmout);
-
- FATAL("Test case '%s' results in a hang", fn);
-
- }
-
- case FAULT_CRASH:
-
- if (crash_mode) break;
-
- if (skip_crashes) {
- WARNF("Test case results in a crash (skipping)");
- q->cal_failed = CAL_CHANCES;
- cal_failures++;
- break;
- }
-
- if (mem_limit) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Oops, the program crashed with one of the test cases provided. There are\n"
- " several possible explanations:\n\n"
-
- " - The test case causes known crashes under normal working conditions. If\n"
- " so, please remove it. The fuzzer should be seeded with interesting\n"
- " inputs - but not ones that cause an outright crash.\n\n"
-
- " - The current memory limit (%s) is too low for this program, causing\n"
- " it to die due to OOM when parsing valid files. To fix this, try\n"
- " bumping it up with the -m setting in the command line. If in doubt,\n"
- " try something along the lines of:\n\n"
-
-#ifdef RLIMIT_AS
- " ( ulimit -Sv $[%llu << 10]; /path/to/binary [...] <testcase )\n\n"
-#else
- " ( ulimit -Sd $[%llu << 10]; /path/to/binary [...] <testcase )\n\n"
-#endif /* ^RLIMIT_AS */
-
- " Tip: you can use http://jwilk.net/software/recidivm to quickly\n"
- " estimate the required amount of virtual memory for the binary. Also,\n"
- " if you are using ASAN, see %s/notes_for_asan.txt.\n\n"
-
-#ifdef __APPLE__
-
- " - On MacOS X, the semantics of fork() syscalls are non-standard and may\n"
- " break afl-fuzz performance optimizations when running platform-specific\n"
- " binaries. To fix this, set AFL_NO_FORKSRV=1 in the environment.\n\n"
-
-#endif /* __APPLE__ */
-
- " - Least likely, there is a horrible bug in the fuzzer. If other options\n"
- " fail, poke <lcamtuf@coredump.cx> for troubleshooting tips.\n",
- DMS(mem_limit << 20), mem_limit - 1, doc_path);
-
- } else {
-
- SAYF("\n" cLRD "[-] " cRST
- "Oops, the program crashed with one of the test cases provided. There are\n"
- " several possible explanations:\n\n"
-
- " - The test case causes known crashes under normal working conditions. If\n"
- " so, please remove it. The fuzzer should be seeded with interesting\n"
- " inputs - but not ones that cause an outright crash.\n\n"
-
-#ifdef __APPLE__
-
- " - On MacOS X, the semantics of fork() syscalls are non-standard and may\n"
- " break afl-fuzz performance optimizations when running platform-specific\n"
- " binaries. To fix this, set AFL_NO_FORKSRV=1 in the environment.\n\n"
-
-#endif /* __APPLE__ */
-
- " - Least likely, there is a horrible bug in the fuzzer. If other options\n"
- " fail, poke <lcamtuf@coredump.cx> for troubleshooting tips.\n");
-
- }
-
- FATAL("Test case '%s' results in a crash", fn);
-
- case FAULT_ERROR:
-
- FATAL("Unable to execute target application ('%s')", argv[0]);
-
- case FAULT_NOINST:
-
- FATAL("No instrumentation detected");
-
- case FAULT_NOBITS:
-
- useless_at_start++;
-
- if (!in_bitmap && !shuffle_queue)
- WARNF("No new instrumentation output, test case may be useless.");
-
- break;
-
- }
-
- if (q->var_behavior) WARNF("Instrumentation output varies across runs.");
-
- q = q->next;
-
- }
-
- if (cal_failures) {
-
- if (cal_failures == queued_paths)
- FATAL("All test cases time out%s, giving up!",
- skip_crashes ? " or crash" : "");
-
- WARNF("Skipped %u test cases (%0.02f%%) due to timeouts%s.", cal_failures,
- ((double)cal_failures) * 100 / queued_paths,
- skip_crashes ? " or crashes" : "");
-
- if (cal_failures * 5 > queued_paths)
- WARNF(cLRD "High percentage of rejected test cases, check settings!");
-
- }
-
- OKF("All test cases processed.");
-
-}
-
-
-/* Helper function: link() if possible, copy otherwise. */
-
-static void link_or_copy(u8* old_path, u8* new_path) {
-
- s32 i = link(old_path, new_path);
- s32 sfd, dfd;
- u8* tmp;
-
- if (!i) return;
-
- sfd = open(old_path, O_RDONLY);
- if (sfd < 0) PFATAL("Unable to open '%s'", old_path);
-
- dfd = open(new_path, O_WRONLY | O_CREAT | O_EXCL, 0600);
- if (dfd < 0) PFATAL("Unable to create '%s'", new_path);
-
- tmp = ck_alloc(64 * 1024);
-
- while ((i = read(sfd, tmp, 64 * 1024)) > 0)
- ck_write(dfd, tmp, i, new_path);
-
- if (i < 0) PFATAL("read() failed");
-
- ck_free(tmp);
- close(sfd);
- close(dfd);
-
-}
-
-
-static void nuke_resume_dir(void);
-
-/* Create hard links for input test cases in the output directory, choosing
- good names and pivoting accordingly. */
-
-static void pivot_inputs(void) {
-
- struct queue_entry* q = queue;
- u32 id = 0;
-
- ACTF("Creating hard links for all input files...");
-
- while (q) {
-
- u8 *nfn, *rsl = strrchr(q->fname, '/');
- u32 orig_id;
-
- if (!rsl) rsl = q->fname; else rsl++;
-
- /* If the original file name conforms to the syntax and the recorded
- ID matches the one we'd assign, just use the original file name.
- This is valuable for resuming fuzzing runs. */
-
-#ifndef SIMPLE_FILES
-# define CASE_PREFIX "id:"
-#else
-# define CASE_PREFIX "id_"
-#endif /* ^!SIMPLE_FILES */
-
- if (!strncmp(rsl, CASE_PREFIX, 3) &&
- sscanf(rsl + 3, "%06u", &orig_id) == 1 && orig_id == id) {
-
- u8* src_str;
- u32 src_id;
-
- resuming_fuzz = 1;
- nfn = alloc_printf("%s/queue/%s", out_dir, rsl);
-
- /* Since we're at it, let's also try to find parent and figure out the
- appropriate depth for this entry. */
-
- src_str = strchr(rsl + 3, ':');
-
- if (src_str && sscanf(src_str + 1, "%06u", &src_id) == 1) {
-
- struct queue_entry* s = queue;
- while (src_id-- && s) s = s->next;
- if (s) q->depth = s->depth + 1;
-
- if (max_depth < q->depth) max_depth = q->depth;
-
- }
-
- } else {
-
- /* No dice - invent a new name, capturing the original one as a
- substring. */
-
-#ifndef SIMPLE_FILES
-
- u8* use_name = strstr(rsl, ",orig:");
-
- if (use_name) use_name += 6; else use_name = rsl;
- nfn = alloc_printf("%s/queue/id:%06u,orig:%s", out_dir, id, use_name);
-
-#else
-
- nfn = alloc_printf("%s/queue/id_%06u", out_dir, id);
-
-#endif /* ^!SIMPLE_FILES */
-
- }
-
- /* Pivot to the new queue entry. */
-
- link_or_copy(q->fname, nfn);
- ck_free(q->fname);
- q->fname = nfn;
-
- /* Make sure that the passed_det value carries over, too. */
-
- if (q->passed_det) mark_as_det_done(q);
-
- q = q->next;
- id++;
-
- }
-
- if (in_place_resume) nuke_resume_dir();
-
-}
-
-
-#ifndef SIMPLE_FILES
-
-/* Construct a file name for a new test case, capturing the operation
- that led to its discovery. Uses a static buffer. */
-
-static u8* describe_op(u8 hnb) {
-
- static u8 ret[256];
-
- if (syncing_party) {
-
- sprintf(ret, "sync:%s,src:%06u", syncing_party, syncing_case);
-
- } else {
-
- sprintf(ret, "src:%06u", current_entry);
-
- if (splicing_with >= 0)
- sprintf(ret + strlen(ret), "+%06u", splicing_with);
-
- sprintf(ret + strlen(ret), ",op:%s", stage_short);
-
- if (stage_cur_byte >= 0) {
-
- sprintf(ret + strlen(ret), ",pos:%u", stage_cur_byte);
-
- if (stage_val_type != STAGE_VAL_NONE)
- sprintf(ret + strlen(ret), ",val:%s%+d",
- (stage_val_type == STAGE_VAL_BE) ? "be:" : "",
- stage_cur_val);
-
- } else sprintf(ret + strlen(ret), ",rep:%u", stage_cur_val);
-
- }
-
- if (hnb == 2) strcat(ret, ",+cov");
-
- return ret;
-
-}
-
-#endif /* !SIMPLE_FILES */
-
-
-/* Write a message accompanying the crash directory :-) */
-
-static void write_crash_readme(void) {
-
- u8* fn = alloc_printf("%s/crashes/README.txt", out_dir);
- s32 fd;
- FILE* f;
-
- fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
- ck_free(fn);
-
- /* Do not die on errors here - that would be impolite. */
-
- if (fd < 0) return;
-
- f = fdopen(fd, "w");
-
- if (!f) {
- close(fd);
- return;
- }
-
- fprintf(f, "Command line used to find this crash:\n\n"
-
- "%s\n\n"
-
- "If you can't reproduce a bug outside of afl-fuzz, be sure to set the same\n"
- "memory limit. The limit used for this fuzzing session was %s.\n\n"
-
- "Need a tool to minimize test cases before investigating the crashes or sending\n"
- "them to a vendor? Check out the afl-tmin that comes with the fuzzer!\n\n"
-
- "Found any cool bugs in open-source tools using afl-fuzz? If yes, please drop\n"
- "me a mail at <lcamtuf@coredump.cx> once the issues are fixed - I'd love to\n"
- "add your finds to the gallery at:\n\n"
-
- " http://lcamtuf.coredump.cx/afl/\n\n"
-
- "Thanks :-)\n",
-
- orig_cmdline, DMS(mem_limit << 20)); /* ignore errors */
-
- fclose(f);
-
-}
-
-
-/* Check if the result of an execve() during routine fuzzing is interesting,
- save or queue the input test case for further analysis if so. Returns 1 if
- entry is saved, 0 otherwise. */
-
-static u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) {
-
- u8 *fn = "";
- u8 hnb;
- s32 fd;
- u8 keeping = 0, res;
-
- if (fault == crash_mode) {
-
- /* Keep only if there are new bits in the map, add to queue for
- future fuzzing, etc. */
-
- if (!(hnb = has_new_bits(virgin_bits))) {
- if (crash_mode) total_crashes++;
- return 0;
- }
-
-#ifndef SIMPLE_FILES
-
- fn = alloc_printf("%s/queue/id:%06u,%s", out_dir, queued_paths,
- describe_op(hnb));
-
-#else
-
- fn = alloc_printf("%s/queue/id_%06u", out_dir, queued_paths);
-
-#endif /* ^!SIMPLE_FILES */
-
- add_to_queue(fn, len, 0);
-
- if (hnb == 2) {
- queue_top->has_new_cov = 1;
- queued_with_cov++;
- }
-
- queue_top->exec_cksum = hash32(trace_bits, MAP_SIZE, HASH_CONST);
-
- /* Try to calibrate inline; this also calls update_bitmap_score() when
- successful. */
-
- res = calibrate_case(argv, queue_top, mem, queue_cycle - 1, 0);
-
- if (res == FAULT_ERROR)
- FATAL("Unable to execute target application");
-
- fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
- if (fd < 0) PFATAL("Unable to create '%s'", fn);
- ck_write(fd, mem, len, fn);
- close(fd);
-
- keeping = 1;
-
- }
-
- switch (fault) {
-
- case FAULT_HANG:
-
- /* Hangs are not very interesting, but we're still obliged to keep
- a handful of samples. We use the presence of new bits in the
- hang-specific bitmap as a signal of uniqueness. In "dumb" mode, we
- just keep everything. */
-
- total_hangs++;
-
- if (unique_hangs >= KEEP_UNIQUE_HANG) return keeping;
-
- if (!dumb_mode) {
-
-#ifdef __x86_64__
- simplify_trace((u64*)trace_bits);
-#else
- simplify_trace((u32*)trace_bits);
-#endif /* ^__x86_64__ */
-
- if (!has_new_bits(virgin_hang)) return keeping;
-
- }
-
-#ifndef SIMPLE_FILES
-
- fn = alloc_printf("%s/hangs/id:%06llu,%s", out_dir,
- unique_hangs, describe_op(0));
-
-#else
-
- fn = alloc_printf("%s/hangs/id_%06llu", out_dir,
- unique_hangs);
-
-#endif /* ^!SIMPLE_FILES */
-
- unique_hangs++;
-
- last_hang_time = get_cur_time();
-
- break;
-
- case FAULT_CRASH:
-
- /* This is handled in a manner roughly similar to hangs,
- except for slightly different limits. */
-
- total_crashes++;
-
- if (unique_crashes >= KEEP_UNIQUE_CRASH) return keeping;
-
- if (!dumb_mode) {
-
-#ifdef __x86_64__
- simplify_trace((u64*)trace_bits);
-#else
- simplify_trace((u32*)trace_bits);
-#endif /* ^__x86_64__ */
-
- if (!has_new_bits(virgin_crash)) return keeping;
-
- }
-
- if (!unique_crashes) write_crash_readme();
-
-#ifndef SIMPLE_FILES
-
- fn = alloc_printf("%s/crashes/id:%06llu,sig:%02u,%s", out_dir,
- unique_crashes, kill_signal, describe_op(0));
-
-#else
-
- fn = alloc_printf("%s/crashes/id_%06llu_%02u", out_dir, unique_crashes,
- kill_signal);
-
-#endif /* ^!SIMPLE_FILES */
-
- unique_crashes++;
-
- last_crash_time = get_cur_time();
- last_crash_execs = total_execs;
-
- break;
-
- case FAULT_ERROR: FATAL("Unable to execute target application");
-
- default: return keeping;
-
- }
-
- /* If we're here, we apparently want to save the crash or hang
- test case, too. */
-
- fd = open(fn, O_WRONLY | O_CREAT | O_EXCL, 0600);
- if (fd < 0) PFATAL("Unable to create '%s'", fn);
- ck_write(fd, mem, len, fn);
- close(fd);
-
- ck_free(fn);
-
- return keeping;
-
-}
-
-
-/* When resuming, try to find the queue position to start from. This makes sense
- only when resuming, and when we can find the original fuzzer_stats. */
-
-static u32 find_start_position(void) {
-
- static u8 tmp[4096]; /* Ought to be enough for anybody. */
-
- u8 *fn, *off;
- s32 fd, i;
- u32 ret;
-
- if (!resuming_fuzz) return 0;
-
- if (in_place_resume) fn = alloc_printf("%s/fuzzer_stats", out_dir);
- else fn = alloc_printf("%s/../fuzzer_stats", in_dir);
-
- fd = open(fn, O_RDONLY);
- ck_free(fn);
-
- if (fd < 0) return 0;
-
- i = read(fd, tmp, sizeof(tmp) - 1); (void)i; /* Ignore errors */
- close(fd);
-
- off = strstr(tmp, "cur_path : ");
- if (!off) return 0;
-
- ret = atoi(off + 17);
- if (ret >= queued_paths) ret = 0;
- return ret;
-
-}
-
-
-/* The same, but for timeouts. The idea is that when resuming sessions without
- -t given, we don't want to keep auto-scaling the timeout over and over
- again to prevent it from growing due to random flukes. */
-
-static void find_timeout(void) {
-
- static u8 tmp[4096]; /* Ought to be enough for anybody. */
-
- u8 *fn, *off;
- s32 fd, i;
- u32 ret;
-
- if (!resuming_fuzz) return;
-
- if (in_place_resume) fn = alloc_printf("%s/fuzzer_stats", out_dir);
- else fn = alloc_printf("%s/../fuzzer_stats", in_dir);
-
- fd = open(fn, O_RDONLY);
- ck_free(fn);
-
- if (fd < 0) return;
-
- i = read(fd, tmp, sizeof(tmp) - 1); (void)i; /* Ignore errors */
- close(fd);
-
- off = strstr(tmp, "exec_timeout : ");
- if (!off) return;
-
- ret = atoi(off + 17);
- if (ret <= 4) return;
-
- exec_tmout = ret;
- timeout_given = 3;
-
-}
-
-
-/* Update stats file for unattended monitoring. */
-
-static void write_stats_file(double bitmap_cvg, double stability, double eps) {
-
- static double last_bcvg, last_stab, last_eps;
-
- u8* fn = alloc_printf("%s/fuzzer_stats", out_dir);
- s32 fd;
- FILE* f;
-
- fd = open(fn, O_WRONLY | O_CREAT | O_TRUNC, 0600);
-
- if (fd < 0) PFATAL("Unable to create '%s'", fn);
-
- ck_free(fn);
-
- f = fdopen(fd, "w");
-
- if (!f) PFATAL("fdopen() failed");
-
- /* Keep last values in case we're called from another context
- where exec/sec stats and such are not readily available. */
-
- if (!bitmap_cvg && !stability && !eps) {
- bitmap_cvg = last_bcvg;
- stability = last_stab;
- eps = last_eps;
- } else {
- last_bcvg = bitmap_cvg;
- last_stab = stability;
- last_eps = eps;
- }
-
- fprintf(f, "start_time : %llu\n"
- "last_update : %llu\n"
- "fuzzer_pid : %u\n"
- "cycles_done : %llu\n"
- "execs_done : %llu\n"
- "execs_per_sec : %0.02f\n"
- "paths_total : %u\n"
- "paths_favored : %u\n"
- "paths_found : %u\n"
- "paths_imported : %u\n"
- "max_depth : %u\n"
- "cur_path : %u\n"
- "pending_favs : %u\n"
- "pending_total : %u\n"
- "variable_paths : %u\n"
- "stability : %0.02f%%\n"
- "bitmap_cvg : %0.02f%%\n"
- "unique_crashes : %llu\n"
- "unique_hangs : %llu\n"
- "last_path : %llu\n"
- "last_crash : %llu\n"
- "last_hang : %llu\n"
- "execs_since_crash : %llu\n"
- "exec_timeout : %u\n"
- "afl_banner : %s\n"
- "afl_version : " VERSION "\n"
- "command_line : %s\n",
- start_time / 1000, get_cur_time() / 1000, getpid(),
- queue_cycle ? (queue_cycle - 1) : 0, total_execs, eps,
- queued_paths, queued_favored, queued_discovered, queued_imported,
- max_depth, current_entry, pending_favored, pending_not_fuzzed,
- queued_variable, stability, bitmap_cvg, unique_crashes,
- unique_hangs, last_path_time / 1000, last_crash_time / 1000,
- last_hang_time / 1000, total_execs - last_crash_execs,
- exec_tmout, use_banner, orig_cmdline);
- /* ignore errors */
-
- fclose(f);
-
-}
-
-
-/* Update the plot file if there is a reason to. */
-
-static void maybe_update_plot_file(double bitmap_cvg, double eps) {
-
- static u32 prev_qp, prev_pf, prev_pnf, prev_ce, prev_md;
- static u64 prev_qc, prev_uc, prev_uh;
-
- if (prev_qp == queued_paths && prev_pf == pending_favored &&
- prev_pnf == pending_not_fuzzed && prev_ce == current_entry &&
- prev_qc == queue_cycle && prev_uc == unique_crashes &&
- prev_uh == unique_hangs && prev_md == max_depth) return;
-
- prev_qp = queued_paths;
- prev_pf = pending_favored;
- prev_pnf = pending_not_fuzzed;
- prev_ce = current_entry;
- prev_qc = queue_cycle;
- prev_uc = unique_crashes;
- prev_uh = unique_hangs;
- prev_md = max_depth;
-
- /* Fields in the file:
-
- unix_time, cycles_done, cur_path, paths_total, paths_not_fuzzed,
- favored_not_fuzzed, unique_crashes, unique_hangs, max_depth,
- execs_per_sec */
-
- fprintf(plot_file,
- "%llu, %llu, %u, %u, %u, %u, %0.02f%%, %llu, %llu, %u, %0.02f\n",
- get_cur_time() / 1000, queue_cycle - 1, current_entry, queued_paths,
- pending_not_fuzzed, pending_favored, bitmap_cvg, unique_crashes,
- unique_hangs, max_depth, eps); /* ignore errors */
-
- fflush(plot_file);
-
-}
-
-
-
-/* A helper function for maybe_delete_out_dir(), deleting all prefixed
- files in a directory. */
-
-static u8 delete_files(u8* path, u8* prefix) {
-
- DIR* d;
- struct dirent* d_ent;
-
- d = opendir(path);
-
- if (!d) return 0;
-
- while ((d_ent = readdir(d))) {
-
- if (d_ent->d_name[0] != '.' && (!prefix ||
- !strncmp(d_ent->d_name, prefix, strlen(prefix)))) {
-
- u8* fname = alloc_printf("%s/%s", path, d_ent->d_name);
- if (unlink(fname)) PFATAL("Unable to delete '%s'", fname);
- ck_free(fname);
-
- }
-
- }
-
- closedir(d);
-
- return !!rmdir(path);
-
-}
-
-
-/* Get the number of runnable processes, with some simple smoothing. */
-
-static double get_runnable_processes(void) {
-
- static double res;
-
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__)
-
- /* I don't see any portable sysctl or so that would quickly give us the
- number of runnable processes; the 1-minute load average can be a
- semi-decent approximation, though. */
-
- if (getloadavg(&res, 1) != 1) return 0;
-
-#else
-
- /* On Linux, /proc/stat is probably the best way; load averages are
- computed in funny ways and sometimes don't reflect extremely short-lived
- processes well. */
-
- FILE* f = fopen("/proc/stat", "r");
- u8 tmp[1024];
- u32 val = 0;
-
- if (!f) return 0;
-
- while (fgets(tmp, sizeof(tmp), f)) {
-
- if (!strncmp(tmp, "procs_running ", 14) ||
- !strncmp(tmp, "procs_blocked ", 14)) val += atoi(tmp + 14);
-
- }
-
- fclose(f);
-
- if (!res) {
-
- res = val;
-
- } else {
-
- res = res * (1.0 - 1.0 / AVG_SMOOTHING) +
- ((double)val) * (1.0 / AVG_SMOOTHING);
-
- }
-
-#endif /* ^(__APPLE__ || __FreeBSD__ || __OpenBSD__) */
-
- return res;
-
-}
-
-
-/* Delete the temporary directory used for in-place session resume. */
-
-static void nuke_resume_dir(void) {
-
- u8* fn;
-
- fn = alloc_printf("%s/_resume/.state/deterministic_done", out_dir);
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/_resume/.state/auto_extras", out_dir);
- if (delete_files(fn, "auto_")) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/_resume/.state/redundant_edges", out_dir);
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/_resume/.state/variable_behavior", out_dir);
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/_resume/.state", out_dir);
- if (rmdir(fn) && errno != ENOENT) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/_resume", out_dir);
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- return;
-
-dir_cleanup_failed:
-
- FATAL("_resume directory cleanup failed");
-
-}
-
-
-/* Delete fuzzer output directory if we recognize it as ours, if the fuzzer
- is not currently running, and if the last run time isn't too great. */
-
-static void maybe_delete_out_dir(void) {
-
- FILE* f;
- u8 *fn = alloc_printf("%s/fuzzer_stats", out_dir);
-
- /* See if the output directory is locked. If yes, bail out. If not,
- create a lock that will persist for the lifetime of the process
- (this requires leaving the descriptor open).*/
-
- out_dir_fd = open(out_dir, O_RDONLY);
- if (out_dir_fd < 0) PFATAL("Unable to open '%s'", out_dir);
-
-#ifndef __sun
-
- if (flock(out_dir_fd, LOCK_EX | LOCK_NB) && errno == EWOULDBLOCK) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Looks like the job output directory is being actively used by another\n"
- " instance of afl-fuzz. You will need to choose a different %s\n"
- " or stop the other process first.\n",
- sync_id ? "fuzzer ID" : "output location");
-
- FATAL("Directory '%s' is in use", out_dir);
-
- }
-
-#endif /* !__sun */
-
- f = fopen(fn, "r");
-
- if (f) {
-
- u64 start_time, last_update;
-
- if (fscanf(f, "start_time : %llu\n"
- "last_update : %llu\n", &start_time, &last_update) != 2)
- FATAL("Malformed data in '%s'", fn);
-
- fclose(f);
-
- /* Let's see how much work is at stake. */
-
- if (!in_place_resume && last_update - start_time > OUTPUT_GRACE * 60) {
-
- SAYF("\n" cLRD "[-] " cRST
- "The job output directory already exists and contains the results of more\n"
- " than %u minutes worth of fuzzing. To avoid data loss, afl-fuzz will *NOT*\n"
- " automatically delete this data for you.\n\n"
-
- " If you wish to start a new session, remove or rename the directory manually,\n"
- " or specify a different output location for this job. To resume the old\n"
- " session, put '-' as the input directory in the command line ('-i -') and\n"
- " try again.\n", OUTPUT_GRACE);
-
- FATAL("At-risk data found in '%s'", out_dir);
-
- }
-
- }
-
- ck_free(fn);
-
- /* The idea for in-place resume is pretty simple: we temporarily move the old
- queue/ to a new location that gets deleted once import to the new queue/
- is finished. If _resume/ already exists, the current queue/ may be
- incomplete due to an earlier abort, so we want to use the old _resume/
- dir instead, and we let rename() fail silently. */
-
- if (in_place_resume) {
-
- u8* orig_q = alloc_printf("%s/queue", out_dir);
-
- in_dir = alloc_printf("%s/_resume", out_dir);
-
- rename(orig_q, in_dir); /* Ignore errors */
-
- OKF("Output directory exists, will attempt session resume.");
-
- ck_free(orig_q);
-
- } else {
-
- OKF("Output directory exists but deemed OK to reuse.");
-
- }
-
- ACTF("Deleting old session data...");
-
- /* Okay, let's get the ball rolling! First, we need to get rid of the entries
- in <out_dir>/.synced/.../id:*, if any are present. */
-
- fn = alloc_printf("%s/.synced", out_dir);
- if (delete_files(fn, NULL)) goto dir_cleanup_failed;
- ck_free(fn);
-
- /* Next, we need to clean up <out_dir>/queue/.state/ subdirectories: */
-
- fn = alloc_printf("%s/queue/.state/deterministic_done", out_dir);
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/queue/.state/auto_extras", out_dir);
- if (delete_files(fn, "auto_")) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/queue/.state/redundant_edges", out_dir);
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/queue/.state/variable_behavior", out_dir);
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- /* Then, get rid of the .state subdirectory itself (should be empty by now)
- and everything matching <out_dir>/queue/id:*. */
-
- fn = alloc_printf("%s/queue/.state", out_dir);
- if (rmdir(fn) && errno != ENOENT) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/queue", out_dir);
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- /* All right, let's do <out_dir>/crashes/id:* and <out_dir>/hangs/id:*. */
-
- if (!in_place_resume) {
-
- fn = alloc_printf("%s/crashes/README.txt", out_dir);
- unlink(fn); /* Ignore errors */
- ck_free(fn);
-
- }
-
- fn = alloc_printf("%s/crashes", out_dir);
-
- /* Make backup of the crashes directory if it's not empty and if we're
- doing in-place resume. */
-
- if (in_place_resume && rmdir(fn)) {
-
- time_t cur_t = time(0);
- struct tm* t = localtime(&cur_t);
-
-#ifndef SIMPLE_FILES
-
- u8* nfn = alloc_printf("%s.%04u-%02u-%02u-%02u:%02u:%02u", fn,
- t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
- t->tm_hour, t->tm_min, t->tm_sec);
-
-#else
-
- u8* nfn = alloc_printf("%s_%04u%02u%02u%02u%02u%02u", fn,
- t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
- t->tm_hour, t->tm_min, t->tm_sec);
-
-#endif /* ^!SIMPLE_FILES */
-
- rename(fn, nfn); /* Ignore errors. */
- ck_free(nfn);
-
- }
-
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/hangs", out_dir);
-
- /* Backup hangs, too. */
-
- if (in_place_resume && rmdir(fn)) {
-
- time_t cur_t = time(0);
- struct tm* t = localtime(&cur_t);
-
-#ifndef SIMPLE_FILES
-
- u8* nfn = alloc_printf("%s.%04u-%02u-%02u-%02u:%02u:%02u", fn,
- t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
- t->tm_hour, t->tm_min, t->tm_sec);
-
-#else
-
- u8* nfn = alloc_printf("%s_%04u%02u%02u%02u%02u%02u", fn,
- t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
- t->tm_hour, t->tm_min, t->tm_sec);
-
-#endif /* ^!SIMPLE_FILES */
-
- rename(fn, nfn); /* Ignore errors. */
- ck_free(nfn);
-
- }
-
- if (delete_files(fn, CASE_PREFIX)) goto dir_cleanup_failed;
- ck_free(fn);
-
- /* And now, for some finishing touches. */
-
- fn = alloc_printf("%s/.cur_input", out_dir);
- if (unlink(fn) && errno != ENOENT) goto dir_cleanup_failed;
- ck_free(fn);
-
- fn = alloc_printf("%s/fuzz_bitmap", out_dir);
- if (unlink(fn) && errno != ENOENT) goto dir_cleanup_failed;
- ck_free(fn);
-
- if (!in_place_resume) {
- fn = alloc_printf("%s/fuzzer_stats", out_dir);
- if (unlink(fn) && errno != ENOENT) goto dir_cleanup_failed;
- ck_free(fn);
- }
-
- fn = alloc_printf("%s/plot_data", out_dir);
- if (unlink(fn) && errno != ENOENT) goto dir_cleanup_failed;
- ck_free(fn);
-
- OKF("Output dir cleanup successful.");
-
- /* Wow... is that all? If yes, celebrate! */
-
- return;
-
-dir_cleanup_failed:
-
- SAYF("\n" cLRD "[-] " cRST
- "Whoops, the fuzzer tried to reuse your output directory, but bumped into\n"
- " some files that shouldn't be there or that couldn't be removed - so it\n"
- " decided to abort! This happened while processing this path:\n\n"
-
- " %s\n\n"
- " Please examine and manually delete the files, or specify a different\n"
- " output location for the tool.\n", fn);
-
- FATAL("Output directory cleanup failed");
-
-}
-
-
-static void check_term_size(void);
-
-
-/* A spiffy retro stats screen! This is called every stats_update_freq
- execve() calls, plus in several other circumstances. */
-
-static void show_stats(void) {
-
- static u64 last_stats_ms, last_plot_ms, last_ms, last_execs;
- static double avg_exec;
- double t_byte_ratio, stab_ratio;
-
- u64 cur_ms;
- u32 t_bytes, t_bits;
-
- u32 banner_len, banner_pad;
- u8 tmp[256];
-
- cur_ms = get_cur_time();
-
- /* If not enough time has passed since last UI update, bail out. */
-
- if (cur_ms - last_ms < 1000 / UI_TARGET_HZ) return;
-
- /* Check if we're past the 10 minute mark. */
-
- if (cur_ms - start_time > 10 * 60 * 1000) run_over10m = 1;
-
- /* Calculate smoothed exec speed stats. */
-
- if (!last_execs) {
-
- avg_exec = ((double)total_execs) * 1000 / (cur_ms - start_time);
-
- } else {
-
- double cur_avg = ((double)(total_execs - last_execs)) * 1000 /
- (cur_ms - last_ms);
-
- /* If there is a dramatic (5x+) jump in speed, reset the indicator
- more quickly. */
-
- if (cur_avg * 5 < avg_exec || cur_avg / 5 > avg_exec)
- avg_exec = cur_avg;
-
- avg_exec = avg_exec * (1.0 - 1.0 / AVG_SMOOTHING) +
- cur_avg * (1.0 / AVG_SMOOTHING);
-
- }
-
- last_ms = cur_ms;
- last_execs = total_execs;
-
- /* Tell the callers when to contact us (as measured in execs). */
-
- stats_update_freq = avg_exec / (UI_TARGET_HZ * 10);
- if (!stats_update_freq) stats_update_freq = 1;
-
- /* Do some bitmap stats. */
-
- t_bytes = count_non_255_bytes(virgin_bits);
- t_byte_ratio = ((double)t_bytes * 100) / MAP_SIZE;
-
- if (t_bytes)
- stab_ratio = 100 - ((double)var_byte_count) * 100 / t_bytes;
- else
- stab_ratio = 100;
-
- /* Roughly every minute, update fuzzer stats and save auto tokens. */
-
- if (cur_ms - last_stats_ms > STATS_UPDATE_SEC * 1000) {
-
- last_stats_ms = cur_ms;
- write_stats_file(t_byte_ratio, stab_ratio, avg_exec);
- save_auto();
- write_bitmap();
-
- }
-
- /* Every now and then, write plot data. */
-
- if (cur_ms - last_plot_ms > PLOT_UPDATE_SEC * 1000) {
-
- last_plot_ms = cur_ms;
- maybe_update_plot_file(t_byte_ratio, avg_exec);
-
- }
-
- /* Honor AFL_EXIT_WHEN_DONE and AFL_BENCH_UNTIL_CRASH. */
-
- if (!dumb_mode && cycles_wo_finds > 100 && !pending_not_fuzzed &&
- getenv("AFL_EXIT_WHEN_DONE")) stop_soon = 2;
-
- if (total_crashes && getenv("AFL_BENCH_UNTIL_CRASH")) stop_soon = 2;
-
- /* If we're not on TTY, bail out. */
-
- if (not_on_tty) return;
-
- /* Compute some mildly useful bitmap stats. */
-
- t_bits = (MAP_SIZE << 3) - count_bits(virgin_bits);
-
- /* Now, for the visuals... */
-
- if (clear_screen) {
-
- SAYF(TERM_CLEAR CURSOR_HIDE);
- clear_screen = 0;
-
- check_term_size();
-
- }
-
- SAYF(TERM_HOME);
-
- if (term_too_small) {
-
- SAYF(cBRI "Your terminal is too small to display the UI.\n"
- "Please resize terminal window to at least 80x25.\n" cRST);
-
- return;
-
- }
-
- /* Let's start by drawing a centered banner. */
-
- banner_len = (crash_mode ? 24 : 22) + strlen(VERSION) + strlen(use_banner);
- banner_pad = (80 - banner_len) / 2;
- memset(tmp, ' ', banner_pad);
-
- sprintf(tmp + banner_pad, "%s " cLCY VERSION cLGN
- " (%s)", crash_mode ? cPIN "peruvian were-rabbit" :
- cYEL "american fuzzy lop", use_banner);
-
- SAYF("\n%s\n\n", tmp);
-
- /* "Handy" shortcuts for drawing boxes... */
-
-#define bSTG bSTART cGRA
-#define bH2 bH bH
-#define bH5 bH2 bH2 bH
-#define bH10 bH5 bH5
-#define bH20 bH10 bH10
-#define bH30 bH20 bH10
-#define SP5 " "
-#define SP10 SP5 SP5
-#define SP20 SP10 SP10
-
- /* Lord, forgive me this. */
-
- SAYF(SET_G1 bSTG bLT bH bSTOP cCYA " process timing " bSTG bH30 bH5 bH2 bHB
- bH bSTOP cCYA " overall results " bSTG bH5 bRT "\n");
-
- if (dumb_mode) {
-
- strcpy(tmp, cRST);
-
- } else {
-
- /* First queue cycle: don't stop now! */
- if (queue_cycle == 1) strcpy(tmp, cMGN); else
-
- /* Subsequent cycles, but we're still making finds. */
- if (cycles_wo_finds < 25) strcpy(tmp, cYEL); else
-
- /* No finds for a long time and no test cases to try. */
- if (cycles_wo_finds > 100 && !pending_not_fuzzed) strcpy(tmp, cLGN);
-
- /* Default: cautiously OK to stop? */
- else strcpy(tmp, cLBL);
-
- }
-
- SAYF(bV bSTOP " run time : " cRST "%-34s " bSTG bV bSTOP
- " cycles done : %s%-5s " bSTG bV "\n",
- DTD(cur_ms, start_time), tmp, DI(queue_cycle - 1));
-
- /* We want to warn people about not seeing new paths after a full cycle,
- except when resuming fuzzing or running in non-instrumented mode. */
-
- if (!dumb_mode && (last_path_time || resuming_fuzz || queue_cycle == 1 ||
- in_bitmap || crash_mode)) {
-
- SAYF(bV bSTOP " last new path : " cRST "%-34s ",
- DTD(cur_ms, last_path_time));
-
- } else {
-
- if (dumb_mode)
-
- SAYF(bV bSTOP " last new path : " cPIN "n/a" cRST
- " (non-instrumented mode) ");
-
- else
-
- SAYF(bV bSTOP " last new path : " cRST "none yet " cLRD
- "(odd, check syntax!) ");
-
- }
-
- SAYF(bSTG bV bSTOP " total paths : " cRST "%-5s " bSTG bV "\n",
- DI(queued_paths));
-
- /* Highlight crashes in red if found, denote going over the KEEP_UNIQUE_CRASH
- limit with a '+' appended to the count. */
-
- sprintf(tmp, "%s%s", DI(unique_crashes),
- (unique_crashes >= KEEP_UNIQUE_CRASH) ? "+" : "");
-
- SAYF(bV bSTOP " last uniq crash : " cRST "%-34s " bSTG bV bSTOP
- " uniq crashes : %s%-6s " bSTG bV "\n",
- DTD(cur_ms, last_crash_time), unique_crashes ? cLRD : cRST,
- tmp);
-
- sprintf(tmp, "%s%s", DI(unique_hangs),
- (unique_hangs >= KEEP_UNIQUE_HANG) ? "+" : "");
-
- SAYF(bV bSTOP " last uniq hang : " cRST "%-34s " bSTG bV bSTOP
- " uniq hangs : " cRST "%-6s " bSTG bV "\n",
- DTD(cur_ms, last_hang_time), tmp);
-
- SAYF(bVR bH bSTOP cCYA " cycle progress " bSTG bH20 bHB bH bSTOP cCYA
- " map coverage " bSTG bH bHT bH20 bH2 bH bVL "\n");
-
- /* This gets funny because we want to print several variable-length variables
- together, but then cram them into a fixed-width field - so we need to
- put them in a temporary buffer first. */
-
- sprintf(tmp, "%s%s (%0.02f%%)", DI(current_entry),
- queue_cur->favored ? "" : "*",
- ((double)current_entry * 100) / queued_paths);
-
- SAYF(bV bSTOP " now processing : " cRST "%-17s " bSTG bV bSTOP, tmp);
-
- sprintf(tmp, "%0.02f%% / %0.02f%%", ((double)queue_cur->bitmap_size) *
- 100 / MAP_SIZE, t_byte_ratio);
-
- SAYF(" map density : %s%-21s " bSTG bV "\n", t_byte_ratio > 70 ? cLRD :
- ((t_bytes < 200 && !dumb_mode) ? cPIN : cRST), tmp);
-
- sprintf(tmp, "%s (%0.02f%%)", DI(cur_skipped_paths),
- ((double)cur_skipped_paths * 100) / queued_paths);
-
- SAYF(bV bSTOP " paths timed out : " cRST "%-17s " bSTG bV, tmp);
-
- sprintf(tmp, "%0.02f bits/tuple",
- t_bytes ? (((double)t_bits) / t_bytes) : 0);
-
- SAYF(bSTOP " count coverage : " cRST "%-21s " bSTG bV "\n", tmp);
-
- SAYF(bVR bH bSTOP cCYA " stage progress " bSTG bH20 bX bH bSTOP cCYA
- " findings in depth " bSTG bH20 bVL "\n");
-
- sprintf(tmp, "%s (%0.02f%%)", DI(queued_favored),
- ((double)queued_favored) * 100 / queued_paths);
-
- /* Yeah... it's still going on... halp? */
-
- SAYF(bV bSTOP " now trying : " cRST "%-21s " bSTG bV bSTOP
- " favored paths : " cRST "%-22s " bSTG bV "\n", stage_name, tmp);
-
- if (!stage_max) {
-
- sprintf(tmp, "%s/-", DI(stage_cur));
-
- } else {
-
- sprintf(tmp, "%s/%s (%0.02f%%)", DI(stage_cur), DI(stage_max),
- ((double)stage_cur) * 100 / stage_max);
-
- }
-
- SAYF(bV bSTOP " stage execs : " cRST "%-21s " bSTG bV bSTOP, tmp);
-
- sprintf(tmp, "%s (%0.02f%%)", DI(queued_with_cov),
- ((double)queued_with_cov) * 100 / queued_paths);
-
- SAYF(" new edges on : " cRST "%-22s " bSTG bV "\n", tmp);
-
- sprintf(tmp, "%s (%s%s unique)", DI(total_crashes), DI(unique_crashes),
- (unique_crashes >= KEEP_UNIQUE_CRASH) ? "+" : "");
-
- if (crash_mode) {
-
- SAYF(bV bSTOP " total execs : " cRST "%-21s " bSTG bV bSTOP
- " new crashes : %s%-22s " bSTG bV "\n", DI(total_execs),
- unique_crashes ? cLRD : cRST, tmp);
-
- } else {
-
- SAYF(bV bSTOP " total execs : " cRST "%-21s " bSTG bV bSTOP
- " total crashes : %s%-22s " bSTG bV "\n", DI(total_execs),
- unique_crashes ? cLRD : cRST, tmp);
-
- }
-
- /* Show a warning about slow execution. */
-
- if (avg_exec < 100) {
-
- sprintf(tmp, "%s/sec (%s)", DF(avg_exec), avg_exec < 20 ?
- "zzzz..." : "slow!");
-
- SAYF(bV bSTOP " exec speed : " cLRD "%-21s ", tmp);
-
- } else {
-
- sprintf(tmp, "%s/sec", DF(avg_exec));
- SAYF(bV bSTOP " exec speed : " cRST "%-21s ", tmp);
-
- }
-
- sprintf(tmp, "%s (%s%s unique)", DI(total_hangs), DI(unique_hangs),
- (unique_hangs >= KEEP_UNIQUE_HANG) ? "+" : "");
-
- SAYF (bSTG bV bSTOP " total hangs : " cRST "%-22s " bSTG bV "\n", tmp);
-
- /* Aaaalmost there... hold on! */
-
- SAYF(bVR bH cCYA bSTOP " fuzzing strategy yields " bSTG bH10 bH bHT bH10
- bH5 bHB bH bSTOP cCYA " path geometry " bSTG bH5 bH2 bH bVL "\n");
-
- if (skip_deterministic) {
-
- strcpy(tmp, "n/a, n/a, n/a");
-
- } else {
-
- sprintf(tmp, "%s/%s, %s/%s, %s/%s",
- DI(stage_finds[STAGE_FLIP1]), DI(stage_cycles[STAGE_FLIP1]),
- DI(stage_finds[STAGE_FLIP2]), DI(stage_cycles[STAGE_FLIP2]),
- DI(stage_finds[STAGE_FLIP4]), DI(stage_cycles[STAGE_FLIP4]));
-
- }
-
- SAYF(bV bSTOP " bit flips : " cRST "%-37s " bSTG bV bSTOP " levels : "
- cRST "%-10s " bSTG bV "\n", tmp, DI(max_depth));
-
- if (!skip_deterministic)
- sprintf(tmp, "%s/%s, %s/%s, %s/%s",
- DI(stage_finds[STAGE_FLIP8]), DI(stage_cycles[STAGE_FLIP8]),
- DI(stage_finds[STAGE_FLIP16]), DI(stage_cycles[STAGE_FLIP16]),
- DI(stage_finds[STAGE_FLIP32]), DI(stage_cycles[STAGE_FLIP32]));
-
- SAYF(bV bSTOP " byte flips : " cRST "%-37s " bSTG bV bSTOP " pending : "
- cRST "%-10s " bSTG bV "\n", tmp, DI(pending_not_fuzzed));
-
- if (!skip_deterministic)
- sprintf(tmp, "%s/%s, %s/%s, %s/%s",
- DI(stage_finds[STAGE_ARITH8]), DI(stage_cycles[STAGE_ARITH8]),
- DI(stage_finds[STAGE_ARITH16]), DI(stage_cycles[STAGE_ARITH16]),
- DI(stage_finds[STAGE_ARITH32]), DI(stage_cycles[STAGE_ARITH32]));
-
- SAYF(bV bSTOP " arithmetics : " cRST "%-37s " bSTG bV bSTOP " pend fav : "
- cRST "%-10s " bSTG bV "\n", tmp, DI(pending_favored));
-
- if (!skip_deterministic)
- sprintf(tmp, "%s/%s, %s/%s, %s/%s",
- DI(stage_finds[STAGE_INTEREST8]), DI(stage_cycles[STAGE_INTEREST8]),
- DI(stage_finds[STAGE_INTEREST16]), DI(stage_cycles[STAGE_INTEREST16]),
- DI(stage_finds[STAGE_INTEREST32]), DI(stage_cycles[STAGE_INTEREST32]));
-
- SAYF(bV bSTOP " known ints : " cRST "%-37s " bSTG bV bSTOP " own finds : "
- cRST "%-10s " bSTG bV "\n", tmp, DI(queued_discovered));
-
- if (!skip_deterministic)
- sprintf(tmp, "%s/%s, %s/%s, %s/%s",
- DI(stage_finds[STAGE_EXTRAS_UO]), DI(stage_cycles[STAGE_EXTRAS_UO]),
- DI(stage_finds[STAGE_EXTRAS_UI]), DI(stage_cycles[STAGE_EXTRAS_UI]),
- DI(stage_finds[STAGE_EXTRAS_AO]), DI(stage_cycles[STAGE_EXTRAS_AO]));
-
- SAYF(bV bSTOP " dictionary : " cRST "%-37s " bSTG bV bSTOP
- " imported : " cRST "%-10s " bSTG bV "\n", tmp,
- sync_id ? DI(queued_imported) : (u8*)"n/a");
-
- sprintf(tmp, "%s/%s, %s/%s",
- DI(stage_finds[STAGE_HAVOC]), DI(stage_cycles[STAGE_HAVOC]),
- DI(stage_finds[STAGE_SPLICE]), DI(stage_cycles[STAGE_SPLICE]));
-
- SAYF(bV bSTOP " havoc : " cRST "%-37s " bSTG bV bSTOP, tmp);
-
- if (t_bytes) sprintf(tmp, "%0.02f%%", stab_ratio);
- else strcpy(tmp, "n/a");
-
- SAYF(" stability : %s%-10s " bSTG bV "\n", (stab_ratio < 85 && var_byte_count > 40)
- ? cLRD : ((queued_variable && (!persistent_mode || var_byte_count > 20))
- ? cMGN : cRST), tmp);
-
- if (!bytes_trim_out) {
-
- sprintf(tmp, "n/a, ");
-
- } else {
-
- sprintf(tmp, "%0.02f%%/%s, ",
- ((double)(bytes_trim_in - bytes_trim_out)) * 100 / bytes_trim_in,
- DI(trim_execs));
-
- }
-
- if (!blocks_eff_total) {
-
- u8 tmp2[128];
-
- sprintf(tmp2, "n/a");
- strcat(tmp, tmp2);
-
- } else {
-
- u8 tmp2[128];
-
- sprintf(tmp2, "%0.02f%%",
- ((double)(blocks_eff_total - blocks_eff_select)) * 100 /
- blocks_eff_total);
-
- strcat(tmp, tmp2);
-
- }
-
- SAYF(bV bSTOP " trim : " cRST "%-37s " bSTG bVR bH20 bH2 bH2 bRB "\n"
- bLB bH30 bH20 bH2 bH bRB bSTOP cRST RESET_G1, tmp);
-
- /* Provide some CPU utilization stats. */
-
- if (cpu_core_count) {
-
- double cur_runnable = get_runnable_processes();
- u32 cur_utilization = cur_runnable * 100 / cpu_core_count;
-
- u8* cpu_color = cCYA;
-
- /* If we could still run one or more processes, use green. */
-
- if (cpu_core_count > 1 && cur_runnable + 1 <= cpu_core_count)
- cpu_color = cLGN;
-
- /* If we're clearly oversubscribed, use red. */
-
- if (!no_cpu_meter_red && cur_utilization >= 150) cpu_color = cLRD;
-
-#ifdef HAVE_AFFINITY
-
- if (cpu_aff >= 0) {
-
- SAYF(SP10 cGRA "[cpu%03u:%s%3u%%" cGRA "]\r" cRST,
- MIN(cpu_aff, 999), cpu_color,
- MIN(cur_utilization, 999));
-
- } else {
-
- SAYF(SP10 cGRA " [cpu:%s%3u%%" cGRA "]\r" cRST,
- cpu_color, MIN(cur_utilization, 999));
-
- }
-
-#else
-
- SAYF(SP10 cGRA " [cpu:%s%3u%%" cGRA "]\r" cRST,
- cpu_color, MIN(cur_utilization, 999));
-
-#endif /* ^HAVE_AFFINITY */
-
- } else SAYF("\r");
-
- /* Hallelujah! */
-
- fflush(0);
-
-}
-
-
-/* Display quick statistics at the end of processing the input directory,
- plus a bunch of warnings. Some calibration stuff also ended up here,
- along with several hardcoded constants. Maybe clean up eventually. */
-
-static void show_init_stats(void) {
-
- struct queue_entry* q = queue;
- u32 min_bits = 0, max_bits = 0;
- u64 min_us = 0, max_us = 0;
- u64 avg_us = 0;
- u32 max_len = 0;
-
- if (total_cal_cycles) avg_us = total_cal_us / total_cal_cycles;
-
- while (q) {
-
- if (!min_us || q->exec_us < min_us) min_us = q->exec_us;
- if (q->exec_us > max_us) max_us = q->exec_us;
-
- if (!min_bits || q->bitmap_size < min_bits) min_bits = q->bitmap_size;
- if (q->bitmap_size > max_bits) max_bits = q->bitmap_size;
-
- if (q->len > max_len) max_len = q->len;
-
- q = q->next;
-
- }
-
- SAYF("\n");
-
- if (avg_us > (qemu_mode ? 50000 : 10000))
- WARNF(cLRD "The target binary is pretty slow! See %s/perf_tips.txt.",
- doc_path);
-
- /* Let's keep things moving with slow binaries. */
-
- if (avg_us > 50000) havoc_div = 10; /* 0-19 execs/sec */
- else if (avg_us > 20000) havoc_div = 5; /* 20-49 execs/sec */
- else if (avg_us > 10000) havoc_div = 2; /* 50-100 execs/sec */
-
- if (!resuming_fuzz) {
-
- if (max_len > 50 * 1024)
- WARNF(cLRD "Some test cases are huge (%s) - see %s/perf_tips.txt!",
- DMS(max_len), doc_path);
- else if (max_len > 10 * 1024)
- WARNF("Some test cases are big (%s) - see %s/perf_tips.txt.",
- DMS(max_len), doc_path);
-
- if (useless_at_start && !in_bitmap)
- WARNF(cLRD "Some test cases look useless. Consider using a smaller set.");
-
- if (queued_paths > 100)
- WARNF(cLRD "You probably have far too many input files! Consider trimming down.");
- else if (queued_paths > 20)
- WARNF("You have lots of input files; try starting small.");
-
- }
-
- OKF("Here are some useful stats:\n\n"
-
- cGRA " Test case count : " cRST "%u favored, %u variable, %u total\n"
- cGRA " Bitmap range : " cRST "%u to %u bits (average: %0.02f bits)\n"
- cGRA " Exec timing : " cRST "%s to %s us (average: %s us)\n",
- queued_favored, queued_variable, queued_paths, min_bits, max_bits,
- ((double)total_bitmap_size) / (total_bitmap_entries ? total_bitmap_entries : 1),
- DI(min_us), DI(max_us), DI(avg_us));
-
- if (!timeout_given) {
-
- /* Figure out the appropriate timeout. The basic idea is: 5x average or
- 1x max, rounded up to EXEC_TM_ROUND ms and capped at 1 second.
-
- If the program is slow, the multiplier is lowered to 2x or 3x, because
- random scheduler jitter is less likely to have any impact, and because
- our patience is wearing thin =) */
-
- if (avg_us > 50000) exec_tmout = avg_us * 2 / 1000;
- else if (avg_us > 10000) exec_tmout = avg_us * 3 / 1000;
- else exec_tmout = avg_us * 5 / 1000;
-
- exec_tmout = MAX(exec_tmout, max_us / 1000);
- exec_tmout = (exec_tmout + EXEC_TM_ROUND) / EXEC_TM_ROUND * EXEC_TM_ROUND;
-
- if (exec_tmout > EXEC_TIMEOUT) exec_tmout = EXEC_TIMEOUT;
-
- ACTF("No -t option specified, so I'll use exec timeout of %u ms.",
- exec_tmout);
-
- timeout_given = 1;
-
- } else if (timeout_given == 3) {
-
- ACTF("Applying timeout settings from resumed session (%u ms).", exec_tmout);
-
- }
-
- OKF("All set and ready to roll!");
-
-}
-
-
-/* Find first power of two greater or equal to val. */
-
-static u32 next_p2(u32 val) {
-
- u32 ret = 1;
- while (val > ret) ret <<= 1;
- return ret;
-
-}
-
-
-/* Trim all new test cases to save cycles when doing deterministic checks. The
- trimmer uses power-of-two increments somewhere between 1/16 and 1/1024 of
- file size, to keep the stage short and sweet. */
-
-static u8 trim_case(char** argv, struct queue_entry* q, u8* in_buf) {
-
- static u8 tmp[64];
- static u8 clean_trace[MAP_SIZE];
-
- u8 needs_write = 0, fault = 0;
- u32 trim_exec = 0;
- u32 remove_len;
- u32 len_p2;
-
- /* Although the trimmer will be less useful when variable behavior is
- detected, it will still work to some extent, so we don't check for
- this. */
-
- if (q->len < 5) return 0;
-
- stage_name = tmp;
- bytes_trim_in += q->len;
-
- /* Select initial chunk len, starting with large steps. */
-
- len_p2 = next_p2(q->len);
-
- remove_len = MAX(len_p2 / TRIM_START_STEPS, TRIM_MIN_BYTES);
-
- /* Continue until the number of steps gets too high or the stepover
- gets too small. */
-
- while (remove_len >= MAX(len_p2 / TRIM_END_STEPS, TRIM_MIN_BYTES)) {
-
- u32 remove_pos = remove_len;
-
- sprintf(tmp, "trim %s/%s", DI(remove_len), DI(remove_len));
-
- stage_cur = 0;
- stage_max = q->len / remove_len;
-
- while (remove_pos < q->len) {
-
- u32 trim_avail = MIN(remove_len, q->len - remove_pos);
- u32 cksum;
-
- write_with_gap(in_buf, q->len, remove_pos, trim_avail);
-
- fault = run_target(argv);
- trim_execs++;
-
- if (stop_soon || fault == FAULT_ERROR) goto abort_trimming;
-
- /* Note that we don't keep track of crashes or hangs here; maybe TODO? */
-
- cksum = hash32(trace_bits, MAP_SIZE, HASH_CONST);
-
- /* If the deletion had no impact on the trace, make it permanent. This
- isn't perfect for variable-path inputs, but we're just making a
- best-effort pass, so it's not a big deal if we end up with false
- negatives every now and then. */
-
- if (cksum == q->exec_cksum) {
-
- u32 move_tail = q->len - remove_pos - trim_avail;
-
- q->len -= trim_avail;
- len_p2 = next_p2(q->len);
-
- memmove(in_buf + remove_pos, in_buf + remove_pos + trim_avail,
- move_tail);
-
- /* Let's save a clean trace, which will be needed by
- update_bitmap_score once we're done with the trimming stuff. */
-
- if (!needs_write) {
-
- needs_write = 1;
- memcpy(clean_trace, trace_bits, MAP_SIZE);
-
- }
-
- } else remove_pos += remove_len;
-
- /* Since this can be slow, update the screen every now and then. */
-
- if (!(trim_exec++ % stats_update_freq)) show_stats();
- stage_cur++;
-
- }
-
- remove_len >>= 1;
-
- }
-
- /* If we have made changes to in_buf, we also need to update the on-disk
- version of the test case. */
-
- if (needs_write) {
-
- s32 fd;
-
- unlink(q->fname); /* ignore errors */
-
- fd = open(q->fname, O_WRONLY | O_CREAT | O_EXCL, 0600);
-
- if (fd < 0) PFATAL("Unable to create '%s'", q->fname);
-
- ck_write(fd, in_buf, q->len, q->fname);
- close(fd);
-
- memcpy(trace_bits, clean_trace, MAP_SIZE);
- update_bitmap_score(q);
-
- }
-
-
-
-abort_trimming:
-
- bytes_trim_out += q->len;
- return fault;
-
-}
-
-
-/* Write a modified test case, run program, process results. Handle
- error conditions, returning 1 if it's time to bail out. This is
- a helper function for fuzz_one(). */
-
-EXP_ST u8 common_fuzz_stuff(char** argv, u8* out_buf, u32 len) {
-
- u8 fault;
-
- if (post_handler) {
-
- out_buf = post_handler(out_buf, &len);
- if (!out_buf || !len) return 0;
-
- }
-
- write_to_testcase(out_buf, len);
-
- fault = run_target(argv);
-
- if (stop_soon) return 1;
-
- if (fault == FAULT_HANG) {
-
- if (subseq_hangs++ > HANG_LIMIT) {
- cur_skipped_paths++;
- return 1;
- }
-
- } else subseq_hangs = 0;
-
- /* Users can hit us with SIGUSR1 to request the current input
- to be abandoned. */
-
- if (skip_requested) {
-
- skip_requested = 0;
- cur_skipped_paths++;
- return 1;
-
- }
-
- /* This handles FAULT_ERROR for us: */
-
- queued_discovered += save_if_interesting(argv, out_buf, len, fault);
-
- if (!(stage_cur % stats_update_freq) || stage_cur + 1 == stage_max)
- show_stats();
-
- return 0;
-
-}
-
-
-/* Helper to choose random block len for block operations in fuzz_one().
- Doesn't return zero, provided that max_len is > 0. */
-
-static u32 choose_block_len(u32 limit) {
-
- u32 min_value, max_value;
- u32 rlim = MIN(queue_cycle, 3);
-
- if (!run_over10m) rlim = 1;
-
- switch (UR(rlim)) {
-
- case 0: min_value = 1;
- max_value = HAVOC_BLK_SMALL;
- break;
-
- case 1: min_value = HAVOC_BLK_SMALL;
- max_value = HAVOC_BLK_MEDIUM;
- break;
-
- default: min_value = HAVOC_BLK_MEDIUM;
- max_value = HAVOC_BLK_LARGE;
-
-
- }
-
- if (min_value >= limit) min_value = 1;
-
- return min_value + UR(MIN(max_value, limit) - min_value + 1);
-
-}
-
-
-/* Calculate case desirability score to adjust the length of havoc fuzzing.
- A helper function for fuzz_one(). Maybe some of these constants should
- go into config.h. */
-
-static u32 calculate_score(struct queue_entry* q) {
-
- u32 avg_exec_us = total_cal_us / total_cal_cycles;
- u32 avg_bitmap_size = total_bitmap_size / total_bitmap_entries;
- u32 perf_score = 100;
-
- /* Adjust score based on execution speed of this path, compared to the
- global average. Multiplier ranges from 0.1x to 3x. Fast inputs are
- less expensive to fuzz, so we're giving them more air time. */
-
- if (q->exec_us * 0.1 > avg_exec_us) perf_score = 10;
- else if (q->exec_us * 0.25 > avg_exec_us) perf_score = 25;
- else if (q->exec_us * 0.5 > avg_exec_us) perf_score = 50;
- else if (q->exec_us * 0.75 > avg_exec_us) perf_score = 75;
- else if (q->exec_us * 4 < avg_exec_us) perf_score = 300;
- else if (q->exec_us * 3 < avg_exec_us) perf_score = 200;
- else if (q->exec_us * 2 < avg_exec_us) perf_score = 150;
-
- /* Adjust score based on bitmap size. The working theory is that better
- coverage translates to better targets. Multiplier from 0.25x to 3x. */
-
- if (q->bitmap_size * 0.3 > avg_bitmap_size) perf_score *= 3;
- else if (q->bitmap_size * 0.5 > avg_bitmap_size) perf_score *= 2;
- else if (q->bitmap_size * 0.75 > avg_bitmap_size) perf_score *= 1.5;
- else if (q->bitmap_size * 3 < avg_bitmap_size) perf_score *= 0.25;
- else if (q->bitmap_size * 2 < avg_bitmap_size) perf_score *= 0.5;
- else if (q->bitmap_size * 1.5 < avg_bitmap_size) perf_score *= 0.75;
-
- /* Adjust score based on handicap. Handicap is proportional to how late
- in the game we learned about this path. Latecomers are allowed to run
- for a bit longer until they catch up with the rest. */
-
- if (q->handicap >= 4) {
-
- perf_score *= 4;
- q->handicap -= 4;
-
- } else if (q->handicap) {
-
- perf_score *= 2;
- q->handicap--;
-
- }
-
- /* Final adjustment based on input depth, under the assumption that fuzzing
- deeper test cases is more likely to reveal stuff that can't be
- discovered with traditional fuzzers. */
-
- switch (q->depth) {
-
- case 0 ... 3: break;
- case 4 ... 7: perf_score *= 2; break;
- case 8 ... 13: perf_score *= 3; break;
- case 14 ... 25: perf_score *= 4; break;
- default: perf_score *= 5;
-
- }
-
- /* Make sure that we don't go over limit. */
-
- if (perf_score > HAVOC_MAX_MULT * 100) perf_score = HAVOC_MAX_MULT * 100;
-
- return perf_score;
-
-}
-
-
-/* Helper function to see if a particular change (xor_val = old ^ new) could
- be a product of deterministic bit flips with the lengths and stepovers
- attempted by afl-fuzz. This is used to avoid dupes in some of the
- deterministic fuzzing operations that follow bit flips. We also
- return 1 if xor_val is zero, which implies that the old and attempted new
- values are identical and the exec would be a waste of time. */
-
-static u8 could_be_bitflip(u32 xor_val) {
-
- u32 sh = 0;
-
- if (!xor_val) return 1;
-
- /* Shift left until first bit set. */
-
- while (!(xor_val & 1)) { sh++; xor_val >>= 1; }
-
- /* 1-, 2-, and 4-bit patterns are OK anywhere. */
-
- if (xor_val == 1 || xor_val == 3 || xor_val == 15) return 1;
-
- /* 8-, 16-, and 32-bit patterns are OK only if shift factor is
- divisible by 8, since that's the stepover for these ops. */
-
- if (sh & 7) return 0;
-
- if (xor_val == 0xff || xor_val == 0xffff || xor_val == 0xffffffff)
- return 1;
-
- return 0;
-
-}
-
-
-/* Helper function to see if a particular value is reachable through
- arithmetic operations. Used for similar purposes. */
-
-static u8 could_be_arith(u32 old_val, u32 new_val, u8 blen) {
-
- u32 i, ov = 0, nv = 0, diffs = 0;
-
- if (old_val == new_val) return 1;
-
- /* See if one-byte adjustments to any byte could produce this result. */
-
- for (i = 0; i < blen; i++) {
-
- u8 a = old_val >> (8 * i),
- b = new_val >> (8 * i);
-
- if (a != b) { diffs++; ov = a; nv = b; }
-
- }
-
- /* If only one byte differs and the values are within range, return 1. */
-
- if (diffs == 1) {
-
- if ((u8)(ov - nv) <= ARITH_MAX ||
- (u8)(nv - ov) <= ARITH_MAX) return 1;
-
- }
-
- if (blen == 1) return 0;
-
- /* See if two-byte adjustments to any byte would produce this result. */
-
- diffs = 0;
-
- for (i = 0; i < blen / 2; i++) {
-
- u16 a = old_val >> (16 * i),
- b = new_val >> (16 * i);
-
- if (a != b) { diffs++; ov = a; nv = b; }
-
- }
-
- /* If only one word differs and the values are within range, return 1. */
-
- if (diffs == 1) {
-
- if ((u16)(ov - nv) <= ARITH_MAX ||
- (u16)(nv - ov) <= ARITH_MAX) return 1;
-
- ov = SWAP16(ov); nv = SWAP16(nv);
-
- if ((u16)(ov - nv) <= ARITH_MAX ||
- (u16)(nv - ov) <= ARITH_MAX) return 1;
-
- }
-
- /* Finally, let's do the same thing for dwords. */
-
- if (blen == 4) {
-
- if ((u32)(old_val - new_val) <= ARITH_MAX ||
- (u32)(new_val - old_val) <= ARITH_MAX) return 1;
-
- new_val = SWAP32(new_val);
- old_val = SWAP32(old_val);
-
- if ((u32)(old_val - new_val) <= ARITH_MAX ||
- (u32)(new_val - old_val) <= ARITH_MAX) return 1;
-
- }
-
- return 0;
-
-}
-
-
-/* Last but not least, a similar helper to see if insertion of an
- interesting integer is redundant given the insertions done for
- shorter blen. The last param (check_le) is set if the caller
- already executed LE insertion for current blen and wants to see
- if BE variant passed in new_val is unique. */
-
-static u8 could_be_interest(u32 old_val, u32 new_val, u8 blen, u8 check_le) {
-
- u32 i, j;
-
- if (old_val == new_val) return 1;
-
- /* See if one-byte insertions from interesting_8 over old_val could
- produce new_val. */
-
- for (i = 0; i < blen; i++) {
-
- for (j = 0; j < sizeof(interesting_8); j++) {
-
- u32 tval = (old_val & ~(0xff << (i * 8))) |
- (((u8)interesting_8[j]) << (i * 8));
-
- if (new_val == tval) return 1;
-
- }
-
- }
-
- /* Bail out unless we're also asked to examine two-byte LE insertions
- as a preparation for BE attempts. */
-
- if (blen == 2 && !check_le) return 0;
-
- /* See if two-byte insertions over old_val could give us new_val. */
-
- for (i = 0; i < blen - 1; i++) {
-
- for (j = 0; j < sizeof(interesting_16) / 2; j++) {
-
- u32 tval = (old_val & ~(0xffff << (i * 8))) |
- (((u16)interesting_16[j]) << (i * 8));
-
- if (new_val == tval) return 1;
-
- /* Continue here only if blen > 2. */
-
- if (blen > 2) {
-
- tval = (old_val & ~(0xffff << (i * 8))) |
- (SWAP16(interesting_16[j]) << (i * 8));
-
- if (new_val == tval) return 1;
-
- }
-
- }
-
- }
-
- if (blen == 4 && check_le) {
-
- /* See if four-byte insertions could produce the same result
- (LE only). */
-
- for (j = 0; j < sizeof(interesting_32) / 4; j++)
- if (new_val == (u32)interesting_32[j]) return 1;
-
- }
-
- return 0;
-
-}
-
-
-/* Take the current entry from the queue, fuzz it for a while. This
- function is a tad too long... returns 0 if fuzzed successfully, 1 if
- skipped or bailed out. */
-
-static u8 fuzz_one(char** argv) {
-
- s32 len, fd, temp_len, i, j;
- u8 *in_buf, *out_buf, *orig_in, *ex_tmp, *eff_map = 0;
- u64 havoc_queued, orig_hit_cnt, new_hit_cnt;
- u32 splice_cycle = 0, perf_score = 100, orig_perf, prev_cksum, eff_cnt = 1;
-
- u8 ret_val = 1, doing_det = 0;
-
- u8 a_collect[MAX_AUTO_EXTRA];
- u32 a_len = 0;
-
-#ifdef IGNORE_FINDS
-
- /* In IGNORE_FINDS mode, skip any entries that weren't in the
- initial data set. */
-
- if (queue_cur->depth > 1) return 1;
-
-#else
-
- if (pending_favored) {
-
- /* If we have any favored, non-fuzzed new arrivals in the queue,
- possibly skip to them at the expense of already-fuzzed or non-favored
- cases. */
-
- if ((queue_cur->was_fuzzed || !queue_cur->favored) &&
- UR(100) < SKIP_TO_NEW_PROB) return 1;
-
- } else if (!dumb_mode && !queue_cur->favored && queued_paths > 10) {
-
- /* Otherwise, still possibly skip non-favored cases, albeit less often.
- The odds of skipping stuff are higher for already-fuzzed inputs and
- lower for never-fuzzed entries. */
-
- if (queue_cycle > 1 && !queue_cur->was_fuzzed) {
-
- if (UR(100) < SKIP_NFAV_NEW_PROB) return 1;
-
- } else {
-
- if (UR(100) < SKIP_NFAV_OLD_PROB) return 1;
-
- }
-
- }
-
-#endif /* ^IGNORE_FINDS */
-
- if (not_on_tty) {
- ACTF("Fuzzing test case #%u (%u total, %llu uniq crashes found)...",
- current_entry, queued_paths, unique_crashes);
- fflush(stdout);
- }
-
- /* Map the test case into memory. */
-
- fd = open(queue_cur->fname, O_RDONLY);
-
- if (fd < 0) PFATAL("Unable to open '%s'", queue_cur->fname);
-
- len = queue_cur->len;
-
- orig_in = in_buf = mmap(0, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
-
- if (orig_in == MAP_FAILED) PFATAL("Unable to mmap '%s'", queue_cur->fname);
-
- close(fd);
-
- /* We could mmap() out_buf as MAP_PRIVATE, but we end up clobbering every
- single byte anyway, so it wouldn't give us any performance or memory usage
- benefits. */
-
- out_buf = ck_alloc_nozero(len);
-
- subseq_hangs = 0;
-
- cur_depth = queue_cur->depth;
-
- /*******************************************
- * CALIBRATION (only if failed earlier on) *
- *******************************************/
-
- if (queue_cur->cal_failed) {
-
- u8 res = FAULT_HANG;
-
- if (queue_cur->cal_failed < CAL_CHANCES) {
-
- res = calibrate_case(argv, queue_cur, in_buf, queue_cycle - 1, 0);
-
- if (res == FAULT_ERROR)
- FATAL("Unable to execute target application");
-
- }
-
- if (stop_soon || res != crash_mode) {
- cur_skipped_paths++;
- goto abandon_entry;
- }
-
- }
-
- /************
- * TRIMMING *
- ************/
-
- if (!dumb_mode && !queue_cur->trim_done) {
-
- u8 res = trim_case(argv, queue_cur, in_buf);
-
- if (res == FAULT_ERROR)
- FATAL("Unable to execute target application");
-
- if (stop_soon) {
- cur_skipped_paths++;
- goto abandon_entry;
- }
-
- /* Don't retry trimming, even if it failed. */
-
- queue_cur->trim_done = 1;
-
- if (len != queue_cur->len) len = queue_cur->len;
-
- }
-
- memcpy(out_buf, in_buf, len);
-
- /*********************
- * PERFORMANCE SCORE *
- *********************/
-
- orig_perf = perf_score = calculate_score(queue_cur);
-
- /* Skip right away if -d is given, if we have done deterministic fuzzing on
- this entry ourselves (was_fuzzed), or if it has gone through deterministic
- testing in earlier, resumed runs (passed_det). */
-
- if (skip_deterministic || queue_cur->was_fuzzed || queue_cur->passed_det)
- goto havoc_stage;
-
- /* Skip deterministic fuzzing if exec path checksum puts this out of scope
- for this master instance. */
-
- if (master_max && (queue_cur->exec_cksum % master_max) != master_id - 1)
- goto havoc_stage;
-
- doing_det = 1;
-
- /*********************************************
- * SIMPLE BITFLIP (+dictionary construction) *
- *********************************************/
-
-#define FLIP_BIT(_ar, _b) do { \
- u8* _arf = (u8*)(_ar); \
- u32 _bf = (_b); \
- _arf[(_bf) >> 3] ^= (128 >> ((_bf) & 7)); \
- } while (0)
-
- /* Single walking bit. */
-
- stage_short = "flip1";
- stage_max = len << 3;
- stage_name = "bitflip 1/1";
-
- stage_val_type = STAGE_VAL_NONE;
-
- orig_hit_cnt = queued_paths + unique_crashes;
-
- prev_cksum = queue_cur->exec_cksum;
-
- for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
-
- stage_cur_byte = stage_cur >> 3;
-
- FLIP_BIT(out_buf, stage_cur);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
-
- FLIP_BIT(out_buf, stage_cur);
-
- /* While flipping the least significant bit in every byte, pull of an extra
- trick to detect possible syntax tokens. In essence, the idea is that if
- you have a binary blob like this:
-
- xxxxxxxxIHDRxxxxxxxx
-
- ...and changing the leading and trailing bytes causes variable or no
- changes in program flow, but touching any character in the "IHDR" string
- always produces the same, distinctive path, it's highly likely that
- "IHDR" is an atomically-checked magic value of special significance to
- the fuzzed format.
-
- We do this here, rather than as a separate stage, because it's a nice
- way to keep the operation approximately "free" (i.e., no extra execs).
-
- Empirically, performing the check when flipping the least significant bit
- is advantageous, compared to doing it at the time of more disruptive
- changes, where the program flow may be affected in more violent ways.
-
- The caveat is that we won't generate dictionaries in the -d mode or -S
- mode - but that's probably a fair trade-off.
-
- This won't work particularly well with paths that exhibit variable
- behavior, but fails gracefully, so we'll carry out the checks anyway.
-
- */
-
- if (!dumb_mode && (stage_cur & 7) == 7) {
-
- u32 cksum = hash32(trace_bits, MAP_SIZE, HASH_CONST);
-
- if (stage_cur == stage_max - 1 && cksum == prev_cksum) {
-
- /* If at end of file and we are still collecting a string, grab the
- final character and force output. */
-
- if (a_len < MAX_AUTO_EXTRA) a_collect[a_len] = out_buf[stage_cur >> 3];
- a_len++;
-
- if (a_len >= MIN_AUTO_EXTRA && a_len <= MAX_AUTO_EXTRA)
- maybe_add_auto(a_collect, a_len);
-
- } else if (cksum != prev_cksum) {
-
- /* Otherwise, if the checksum has changed, see if we have something
- worthwhile queued up, and collect that if the answer is yes. */
-
- if (a_len >= MIN_AUTO_EXTRA && a_len <= MAX_AUTO_EXTRA)
- maybe_add_auto(a_collect, a_len);
-
- a_len = 0;
- prev_cksum = cksum;
-
- }
-
- /* Continue collecting string, but only if the bit flip actually made
- any difference - we don't want no-op tokens. */
-
- if (cksum != queue_cur->exec_cksum) {
-
- if (a_len < MAX_AUTO_EXTRA) a_collect[a_len] = out_buf[stage_cur >> 3];
- a_len++;
-
- }
-
- }
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_FLIP1] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_FLIP1] += stage_max;
-
- /* Two walking bits. */
-
- stage_name = "bitflip 2/1";
- stage_short = "flip2";
- stage_max = (len << 3) - 1;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
-
- stage_cur_byte = stage_cur >> 3;
-
- FLIP_BIT(out_buf, stage_cur);
- FLIP_BIT(out_buf, stage_cur + 1);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
-
- FLIP_BIT(out_buf, stage_cur);
- FLIP_BIT(out_buf, stage_cur + 1);
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_FLIP2] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_FLIP2] += stage_max;
-
- /* Four walking bits. */
-
- stage_name = "bitflip 4/1";
- stage_short = "flip4";
- stage_max = (len << 3) - 3;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
-
- stage_cur_byte = stage_cur >> 3;
-
- FLIP_BIT(out_buf, stage_cur);
- FLIP_BIT(out_buf, stage_cur + 1);
- FLIP_BIT(out_buf, stage_cur + 2);
- FLIP_BIT(out_buf, stage_cur + 3);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
-
- FLIP_BIT(out_buf, stage_cur);
- FLIP_BIT(out_buf, stage_cur + 1);
- FLIP_BIT(out_buf, stage_cur + 2);
- FLIP_BIT(out_buf, stage_cur + 3);
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_FLIP4] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_FLIP4] += stage_max;
-
- /* Effector map setup. These macros calculate:
-
- EFF_APOS - position of a particular file offset in the map.
- EFF_ALEN - length of a map with a particular number of bytes.
- EFF_SPAN_ALEN - map span for a sequence of bytes.
-
- */
-
-#define EFF_APOS(_p) ((_p) >> EFF_MAP_SCALE2)
-#define EFF_REM(_x) ((_x) & ((1 << EFF_MAP_SCALE2) - 1))
-#define EFF_ALEN(_l) (EFF_APOS(_l) + !!EFF_REM(_l))
-#define EFF_SPAN_ALEN(_p, _l) (EFF_APOS((_p) + (_l) - 1) - EFF_APOS(_p) + 1)
-
- /* Initialize effector map for the next step (see comments below). Always
- flag first and last byte as doing something. */
-
- eff_map = ck_alloc(EFF_ALEN(len));
- eff_map[0] = 1;
-
- if (EFF_APOS(len - 1) != 0) {
- eff_map[EFF_APOS(len - 1)] = 1;
- eff_cnt++;
- }
-
- /* Walking byte. */
-
- stage_name = "bitflip 8/8";
- stage_short = "flip8";
- stage_max = len;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
-
- stage_cur_byte = stage_cur;
-
- out_buf[stage_cur] ^= 0xFF;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
-
- /* We also use this stage to pull off a simple trick: we identify
- bytes that seem to have no effect on the current execution path
- even when fully flipped - and we skip them during more expensive
- deterministic stages, such as arithmetics or known ints. */
-
- if (!eff_map[EFF_APOS(stage_cur)]) {
-
- u32 cksum;
-
- /* If in dumb mode or if the file is very short, just flag everything
- without wasting time on checksums. */
-
- if (!dumb_mode && len >= EFF_MIN_LEN)
- cksum = hash32(trace_bits, MAP_SIZE, HASH_CONST);
- else
- cksum = ~queue_cur->exec_cksum;
-
- if (cksum != queue_cur->exec_cksum) {
- eff_map[EFF_APOS(stage_cur)] = 1;
- eff_cnt++;
- }
-
- }
-
- out_buf[stage_cur] ^= 0xFF;
-
- }
-
- /* If the effector map is more than EFF_MAX_PERC dense, just flag the
- whole thing as worth fuzzing, since we wouldn't be saving much time
- anyway. */
-
- if (eff_cnt != EFF_ALEN(len) &&
- eff_cnt * 100 / EFF_ALEN(len) > EFF_MAX_PERC) {
-
- memset(eff_map, 1, EFF_ALEN(len));
-
- blocks_eff_select += EFF_ALEN(len);
-
- } else {
-
- blocks_eff_select += eff_cnt;
-
- }
-
- blocks_eff_total += EFF_ALEN(len);
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_FLIP8] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_FLIP8] += stage_max;
-
- /* Two walking bytes. */
-
- if (len < 2) goto skip_bitflip;
-
- stage_name = "bitflip 16/8";
- stage_short = "flip16";
- stage_cur = 0;
- stage_max = len - 1;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len - 1; i++) {
-
- /* Let's consult the effector map... */
-
- if (!eff_map[EFF_APOS(i)] && !eff_map[EFF_APOS(i + 1)]) {
- stage_max--;
- continue;
- }
-
- stage_cur_byte = i;
-
- *(u16*)(out_buf + i) ^= 0xFFFF;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- *(u16*)(out_buf + i) ^= 0xFFFF;
-
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_FLIP16] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_FLIP16] += stage_max;
-
- if (len < 4) goto skip_bitflip;
-
- /* Four walking bytes. */
-
- stage_name = "bitflip 32/8";
- stage_short = "flip32";
- stage_cur = 0;
- stage_max = len - 3;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len - 3; i++) {
-
- /* Let's consult the effector map... */
- if (!eff_map[EFF_APOS(i)] && !eff_map[EFF_APOS(i + 1)] &&
- !eff_map[EFF_APOS(i + 2)] && !eff_map[EFF_APOS(i + 3)]) {
- stage_max--;
- continue;
- }
-
- stage_cur_byte = i;
-
- *(u32*)(out_buf + i) ^= 0xFFFFFFFF;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- *(u32*)(out_buf + i) ^= 0xFFFFFFFF;
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_FLIP32] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_FLIP32] += stage_max;
-
-skip_bitflip:
-
- /**********************
- * ARITHMETIC INC/DEC *
- **********************/
-
- /* 8-bit arithmetics. */
-
- stage_name = "arith 8/8";
- stage_short = "arith8";
- stage_cur = 0;
- stage_max = 2 * len * ARITH_MAX;
-
- stage_val_type = STAGE_VAL_LE;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len; i++) {
-
- u8 orig = out_buf[i];
-
- /* Let's consult the effector map... */
-
- if (!eff_map[EFF_APOS(i)]) {
- stage_max -= 2 * ARITH_MAX;
- continue;
- }
-
- stage_cur_byte = i;
-
- for (j = 1; j <= ARITH_MAX; j++) {
-
- u8 r = orig ^ (orig + j);
-
- /* Do arithmetic operations only if the result couldn't be a product
- of a bitflip. */
-
- if (!could_be_bitflip(r)) {
-
- stage_cur_val = j;
- out_buf[i] = orig + j;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- r = orig ^ (orig - j);
-
- if (!could_be_bitflip(r)) {
-
- stage_cur_val = -j;
- out_buf[i] = orig - j;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- out_buf[i] = orig;
-
- }
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_ARITH8] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_ARITH8] += stage_max;
-
- /* 16-bit arithmetics, both endians. */
-
- if (len < 2) goto skip_arith;
-
- stage_name = "arith 16/8";
- stage_short = "arith16";
- stage_cur = 0;
- stage_max = 4 * (len - 1) * ARITH_MAX;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len - 1; i++) {
-
- u16 orig = *(u16*)(out_buf + i);
-
- /* Let's consult the effector map... */
-
- if (!eff_map[EFF_APOS(i)] && !eff_map[EFF_APOS(i + 1)]) {
- stage_max -= 4 * ARITH_MAX;
- continue;
- }
-
- stage_cur_byte = i;
-
- for (j = 1; j <= ARITH_MAX; j++) {
-
- u16 r1 = orig ^ (orig + j),
- r2 = orig ^ (orig - j),
- r3 = orig ^ SWAP16(SWAP16(orig) + j),
- r4 = orig ^ SWAP16(SWAP16(orig) - j);
-
- /* Try little endian addition and subtraction first. Do it only
- if the operation would affect more than one byte (hence the
- & 0xff overflow checks) and if it couldn't be a product of
- a bitflip. */
-
- stage_val_type = STAGE_VAL_LE;
-
- if ((orig & 0xff) + j > 0xff && !could_be_bitflip(r1)) {
-
- stage_cur_val = j;
- *(u16*)(out_buf + i) = orig + j;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- if ((orig & 0xff) < j && !could_be_bitflip(r2)) {
-
- stage_cur_val = -j;
- *(u16*)(out_buf + i) = orig - j;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- /* Big endian comes next. Same deal. */
-
- stage_val_type = STAGE_VAL_BE;
-
-
- if ((orig >> 8) + j > 0xff && !could_be_bitflip(r3)) {
-
- stage_cur_val = j;
- *(u16*)(out_buf + i) = SWAP16(SWAP16(orig) + j);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- if ((orig >> 8) < j && !could_be_bitflip(r4)) {
-
- stage_cur_val = -j;
- *(u16*)(out_buf + i) = SWAP16(SWAP16(orig) - j);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- *(u16*)(out_buf + i) = orig;
-
- }
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_ARITH16] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_ARITH16] += stage_max;
-
- /* 32-bit arithmetics, both endians. */
-
- if (len < 4) goto skip_arith;
-
- stage_name = "arith 32/8";
- stage_short = "arith32";
- stage_cur = 0;
- stage_max = 4 * (len - 3) * ARITH_MAX;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len - 3; i++) {
-
- u32 orig = *(u32*)(out_buf + i);
-
- /* Let's consult the effector map... */
-
- if (!eff_map[EFF_APOS(i)] && !eff_map[EFF_APOS(i + 1)] &&
- !eff_map[EFF_APOS(i + 2)] && !eff_map[EFF_APOS(i + 3)]) {
- stage_max -= 4 * ARITH_MAX;
- continue;
- }
-
- stage_cur_byte = i;
-
- for (j = 1; j <= ARITH_MAX; j++) {
-
- u32 r1 = orig ^ (orig + j),
- r2 = orig ^ (orig - j),
- r3 = orig ^ SWAP32(SWAP32(orig) + j),
- r4 = orig ^ SWAP32(SWAP32(orig) - j);
-
- /* Little endian first. Same deal as with 16-bit: we only want to
- try if the operation would have effect on more than two bytes. */
-
- stage_val_type = STAGE_VAL_LE;
-
- if ((orig & 0xffff) + j > 0xffff && !could_be_bitflip(r1)) {
-
- stage_cur_val = j;
- *(u32*)(out_buf + i) = orig + j;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- if ((orig & 0xffff) < j && !could_be_bitflip(r2)) {
-
- stage_cur_val = -j;
- *(u32*)(out_buf + i) = orig - j;
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- /* Big endian next. */
-
- stage_val_type = STAGE_VAL_BE;
-
- if ((SWAP32(orig) & 0xffff) + j > 0xffff && !could_be_bitflip(r3)) {
-
- stage_cur_val = j;
- *(u32*)(out_buf + i) = SWAP32(SWAP32(orig) + j);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- if ((SWAP32(orig) & 0xffff) < j && !could_be_bitflip(r4)) {
-
- stage_cur_val = -j;
- *(u32*)(out_buf + i) = SWAP32(SWAP32(orig) - j);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- *(u32*)(out_buf + i) = orig;
-
- }
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_ARITH32] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_ARITH32] += stage_max;
-
-skip_arith:
-
- /**********************
- * INTERESTING VALUES *
- **********************/
-
- stage_name = "interest 8/8";
- stage_short = "int8";
- stage_cur = 0;
- stage_max = len * sizeof(interesting_8);
-
- stage_val_type = STAGE_VAL_LE;
-
- orig_hit_cnt = new_hit_cnt;
-
- /* Setting 8-bit integers. */
-
- for (i = 0; i < len; i++) {
-
- u8 orig = out_buf[i];
-
- /* Let's consult the effector map... */
-
- if (!eff_map[EFF_APOS(i)]) {
- stage_max -= sizeof(interesting_8);
- continue;
- }
-
- stage_cur_byte = i;
-
- for (j = 0; j < sizeof(interesting_8); j++) {
-
- /* Skip if the value could be a product of bitflips or arithmetics. */
-
- if (could_be_bitflip(orig ^ (u8)interesting_8[j]) ||
- could_be_arith(orig, (u8)interesting_8[j], 1)) {
- stage_max--;
- continue;
- }
-
- stage_cur_val = interesting_8[j];
- out_buf[i] = interesting_8[j];
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
-
- out_buf[i] = orig;
- stage_cur++;
-
- }
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_INTEREST8] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_INTEREST8] += stage_max;
-
- /* Setting 16-bit integers, both endians. */
-
- if (len < 2) goto skip_interest;
-
- stage_name = "interest 16/8";
- stage_short = "int16";
- stage_cur = 0;
- stage_max = 2 * (len - 1) * (sizeof(interesting_16) >> 1);
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len - 1; i++) {
-
- u16 orig = *(u16*)(out_buf + i);
-
- /* Let's consult the effector map... */
-
- if (!eff_map[EFF_APOS(i)] && !eff_map[EFF_APOS(i + 1)]) {
- stage_max -= sizeof(interesting_16);
- continue;
- }
-
- stage_cur_byte = i;
-
- for (j = 0; j < sizeof(interesting_16) / 2; j++) {
-
- stage_cur_val = interesting_16[j];
-
- /* Skip if this could be a product of a bitflip, arithmetics,
- or single-byte interesting value insertion. */
-
- if (!could_be_bitflip(orig ^ (u16)interesting_16[j]) &&
- !could_be_arith(orig, (u16)interesting_16[j], 2) &&
- !could_be_interest(orig, (u16)interesting_16[j], 2, 0)) {
-
- stage_val_type = STAGE_VAL_LE;
-
- *(u16*)(out_buf + i) = interesting_16[j];
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- if ((u16)interesting_16[j] != SWAP16(interesting_16[j]) &&
- !could_be_bitflip(orig ^ SWAP16(interesting_16[j])) &&
- !could_be_arith(orig, SWAP16(interesting_16[j]), 2) &&
- !could_be_interest(orig, SWAP16(interesting_16[j]), 2, 1)) {
-
- stage_val_type = STAGE_VAL_BE;
-
- *(u16*)(out_buf + i) = SWAP16(interesting_16[j]);
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- }
-
- *(u16*)(out_buf + i) = orig;
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_INTEREST16] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_INTEREST16] += stage_max;
-
- if (len < 4) goto skip_interest;
-
- /* Setting 32-bit integers, both endians. */
-
- stage_name = "interest 32/8";
- stage_short = "int32";
- stage_cur = 0;
- stage_max = 2 * (len - 3) * (sizeof(interesting_32) >> 2);
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len - 3; i++) {
-
- u32 orig = *(u32*)(out_buf + i);
-
- /* Let's consult the effector map... */
-
- if (!eff_map[EFF_APOS(i)] && !eff_map[EFF_APOS(i + 1)] &&
- !eff_map[EFF_APOS(i + 2)] && !eff_map[EFF_APOS(i + 3)]) {
- stage_max -= sizeof(interesting_32) >> 1;
- continue;
- }
-
- stage_cur_byte = i;
-
- for (j = 0; j < sizeof(interesting_32) / 4; j++) {
-
- stage_cur_val = interesting_32[j];
-
- /* Skip if this could be a product of a bitflip, arithmetics,
- or word interesting value insertion. */
-
- if (!could_be_bitflip(orig ^ (u32)interesting_32[j]) &&
- !could_be_arith(orig, interesting_32[j], 4) &&
- !could_be_interest(orig, interesting_32[j], 4, 0)) {
-
- stage_val_type = STAGE_VAL_LE;
-
- *(u32*)(out_buf + i) = interesting_32[j];
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- if ((u32)interesting_32[j] != SWAP32(interesting_32[j]) &&
- !could_be_bitflip(orig ^ SWAP32(interesting_32[j])) &&
- !could_be_arith(orig, SWAP32(interesting_32[j]), 4) &&
- !could_be_interest(orig, SWAP32(interesting_32[j]), 4, 1)) {
-
- stage_val_type = STAGE_VAL_BE;
-
- *(u32*)(out_buf + i) = SWAP32(interesting_32[j]);
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
- stage_cur++;
-
- } else stage_max--;
-
- }
-
- *(u32*)(out_buf + i) = orig;
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_INTEREST32] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_INTEREST32] += stage_max;
-
-skip_interest:
-
- /********************
- * DICTIONARY STUFF *
- ********************/
-
- if (!extras_cnt) goto skip_user_extras;
-
- /* Overwrite with user-supplied extras. */
-
- stage_name = "user extras (over)";
- stage_short = "ext_UO";
- stage_cur = 0;
- stage_max = extras_cnt * len;
-
- stage_val_type = STAGE_VAL_NONE;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len; i++) {
-
- u32 last_len = 0;
-
- stage_cur_byte = i;
-
- /* Extras are sorted by size, from smallest to largest. This means
- that we don't have to worry about restoring the buffer in
- between writes at a particular offset determined by the outer
- loop. */
-
- for (j = 0; j < extras_cnt; j++) {
-
- /* Skip extras probabilistically if extras_cnt > MAX_DET_EXTRAS. Also
- skip them if there's no room to insert the payload, if the token
- is redundant, or if its entire span has no bytes set in the effector
- map. */
-
- if ((extras_cnt > MAX_DET_EXTRAS && UR(extras_cnt) >= MAX_DET_EXTRAS) ||
- extras[j].len > len - i ||
- !memcmp(extras[j].data, out_buf + i, extras[j].len) ||
- !memchr(eff_map + EFF_APOS(i), 1, EFF_SPAN_ALEN(i, extras[j].len))) {
-
- stage_max--;
- continue;
-
- }
-
- last_len = extras[j].len;
- memcpy(out_buf + i, extras[j].data, last_len);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
-
- stage_cur++;
-
- }
-
- /* Restore all the clobbered memory. */
- memcpy(out_buf + i, in_buf + i, last_len);
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_EXTRAS_UO] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_EXTRAS_UO] += stage_max;
-
- /* Insertion of user-supplied extras. */
-
- stage_name = "user extras (insert)";
- stage_short = "ext_UI";
- stage_cur = 0;
- stage_max = extras_cnt * len;
-
- orig_hit_cnt = new_hit_cnt;
-
- ex_tmp = ck_alloc(len + MAX_DICT_FILE);
-
- for (i = 0; i < len; i++) {
-
- stage_cur_byte = i;
-
- for (j = 0; j < extras_cnt; j++) {
-
- if (len + extras[j].len > MAX_FILE) {
- stage_max--;
- continue;
- }
-
- /* Insert token */
- memcpy(ex_tmp + i, extras[j].data, extras[j].len);
-
- /* Copy tail */
- memcpy(ex_tmp + i + extras[j].len, out_buf + i, len - i);
-
- if (common_fuzz_stuff(argv, ex_tmp, len + extras[j].len)) {
- ck_free(ex_tmp);
- goto abandon_entry;
- }
-
- stage_cur++;
-
- }
-
- /* Copy head */
- ex_tmp[i] = out_buf[i];
-
- }
-
- ck_free(ex_tmp);
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_EXTRAS_UI] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_EXTRAS_UI] += stage_max;
-
-skip_user_extras:
-
- if (!a_extras_cnt) goto skip_extras;
-
- stage_name = "auto extras (over)";
- stage_short = "ext_AO";
- stage_cur = 0;
- stage_max = MIN(a_extras_cnt, USE_AUTO_EXTRAS) * len;
-
- stage_val_type = STAGE_VAL_NONE;
-
- orig_hit_cnt = new_hit_cnt;
-
- for (i = 0; i < len; i++) {
-
- u32 last_len = 0;
-
- stage_cur_byte = i;
-
- for (j = 0; j < MIN(a_extras_cnt, USE_AUTO_EXTRAS); j++) {
-
- /* See the comment in the earlier code; extras are sorted by size. */
-
- if (a_extras[j].len > len - i ||
- !memcmp(a_extras[j].data, out_buf + i, a_extras[j].len) ||
- !memchr(eff_map + EFF_APOS(i), 1, EFF_SPAN_ALEN(i, a_extras[j].len))) {
-
- stage_max--;
- continue;
-
- }
-
- last_len = a_extras[j].len;
- memcpy(out_buf + i, a_extras[j].data, last_len);
-
- if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
-
- stage_cur++;
-
- }
-
- /* Restore all the clobbered memory. */
- memcpy(out_buf + i, in_buf + i, last_len);
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- stage_finds[STAGE_EXTRAS_AO] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_EXTRAS_AO] += stage_max;
-
-skip_extras:
-
- /* If we made this to here without jumping to havoc_stage or abandon_entry,
- we're properly done with deterministic steps and can mark it as such
- in the .state/ directory. */
-
- if (!queue_cur->passed_det) mark_as_det_done(queue_cur);
-
- /****************
- * RANDOM HAVOC *
- ****************/
-
-havoc_stage:
-
- stage_cur_byte = -1;
-
- /* The havoc stage mutation code is also invoked when splicing files; if the
- splice_cycle variable is set, generate different descriptions and such. */
-
- if (!splice_cycle) {
-
- stage_name = "havoc";
- stage_short = "havoc";
- stage_max = (doing_det ? HAVOC_CYCLES_INIT : HAVOC_CYCLES) *
- perf_score / havoc_div / 100;
-
- } else {
-
- static u8 tmp[32];
-
- perf_score = orig_perf;
-
- sprintf(tmp, "splice %u", splice_cycle);
- stage_name = tmp;
- stage_short = "splice";
- stage_max = SPLICE_HAVOC * perf_score / havoc_div / 100;
-
- }
-
- if (stage_max < HAVOC_MIN) stage_max = HAVOC_MIN;
-
- temp_len = len;
-
- orig_hit_cnt = queued_paths + unique_crashes;
-
- havoc_queued = queued_paths;
-
- /* We essentially just do several thousand runs (depending on perf_score)
- where we take the input file and make random stacked tweaks. */
-
- for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
-
- u32 use_stacking = 1 << (1 + UR(HAVOC_STACK_POW2));
-
- stage_cur_val = use_stacking;
-
- for (i = 0; i < use_stacking; i++) {
-
- switch (UR(15 + ((extras_cnt + a_extras_cnt) ? 2 : 0))) {
-
- case 0:
-
- /* Flip a single bit somewhere. Spooky! */
-
- FLIP_BIT(out_buf, UR(temp_len << 3));
- break;
-
- case 1:
-
- /* Set byte to interesting value. */
-
- out_buf[UR(temp_len)] = interesting_8[UR(sizeof(interesting_8))];
- break;
-
- case 2:
-
- /* Set word to interesting value, randomly choosing endian. */
-
- if (temp_len < 2) break;
-
- if (UR(2)) {
-
- *(u16*)(out_buf + UR(temp_len - 1)) =
- interesting_16[UR(sizeof(interesting_16) >> 1)];
-
- } else {
-
- *(u16*)(out_buf + UR(temp_len - 1)) = SWAP16(
- interesting_16[UR(sizeof(interesting_16) >> 1)]);
-
- }
-
- break;
-
- case 3:
-
- /* Set dword to interesting value, randomly choosing endian. */
-
- if (temp_len < 4) break;
-
- if (UR(2)) {
-
- *(u32*)(out_buf + UR(temp_len - 3)) =
- interesting_32[UR(sizeof(interesting_32) >> 2)];
-
- } else {
-
- *(u32*)(out_buf + UR(temp_len - 3)) = SWAP32(
- interesting_32[UR(sizeof(interesting_32) >> 2)]);
-
- }
-
- break;
-
- case 4:
-
- /* Randomly subtract from byte. */
-
- out_buf[UR(temp_len)] -= 1 + UR(ARITH_MAX);
- break;
-
- case 5:
-
- /* Randomly add to byte. */
-
- out_buf[UR(temp_len)] += 1 + UR(ARITH_MAX);
- break;
-
- case 6:
-
- /* Randomly subtract from word, random endian. */
-
- if (temp_len < 2) break;
-
- if (UR(2)) {
-
- u32 pos = UR(temp_len - 1);
-
- *(u16*)(out_buf + pos) -= 1 + UR(ARITH_MAX);
-
- } else {
-
- u32 pos = UR(temp_len - 1);
- u16 num = 1 + UR(ARITH_MAX);
-
- *(u16*)(out_buf + pos) =
- SWAP16(SWAP16(*(u16*)(out_buf + pos)) - num);
-
- }
-
- break;
-
- case 7:
-
- /* Randomly add to word, random endian. */
-
- if (temp_len < 2) break;
-
- if (UR(2)) {
-
- u32 pos = UR(temp_len - 1);
-
- *(u16*)(out_buf + pos) += 1 + UR(ARITH_MAX);
-
- } else {
-
- u32 pos = UR(temp_len - 1);
- u16 num = 1 + UR(ARITH_MAX);
-
- *(u16*)(out_buf + pos) =
- SWAP16(SWAP16(*(u16*)(out_buf + pos)) + num);
-
- }
-
- break;
-
- case 8:
-
- /* Randomly subtract from dword, random endian. */
-
- if (temp_len < 4) break;
-
- if (UR(2)) {
-
- u32 pos = UR(temp_len - 3);
-
- *(u32*)(out_buf + pos) -= 1 + UR(ARITH_MAX);
-
- } else {
-
- u32 pos = UR(temp_len - 3);
- u32 num = 1 + UR(ARITH_MAX);
-
- *(u32*)(out_buf + pos) =
- SWAP32(SWAP32(*(u32*)(out_buf + pos)) - num);
-
- }
-
- break;
-
- case 9:
-
- /* Randomly add to dword, random endian. */
-
- if (temp_len < 4) break;
-
- if (UR(2)) {
-
- u32 pos = UR(temp_len - 3);
-
- *(u32*)(out_buf + pos) += 1 + UR(ARITH_MAX);
-
- } else {
-
- u32 pos = UR(temp_len - 3);
- u32 num = 1 + UR(ARITH_MAX);
-
- *(u32*)(out_buf + pos) =
- SWAP32(SWAP32(*(u32*)(out_buf + pos)) + num);
-
- }
-
- break;
-
- case 10:
-
- /* Just set a random byte to a random value. Because,
- why not. We use XOR with 1-255 to eliminate the
- possibility of a no-op. */
-
- out_buf[UR(temp_len)] ^= 1 + UR(255);
- break;
-
- case 11 ... 12: {
-
- /* Delete bytes. We're making this a bit more likely
- than insertion (the next option) in hopes of keeping
- files reasonably small. */
-
- u32 del_from, del_len;
-
- if (temp_len < 2) break;
-
- /* Don't delete too much. */
-
- del_len = choose_block_len(temp_len - 1);
-
- del_from = UR(temp_len - del_len + 1);
-
- memmove(out_buf + del_from, out_buf + del_from + del_len,
- temp_len - del_from - del_len);
-
- temp_len -= del_len;
-
- break;
-
- }
-
- case 13:
-
- if (temp_len + HAVOC_BLK_LARGE < MAX_FILE) {
-
- /* Clone bytes (75%) or insert a block of constant bytes (25%). */
-
- u32 clone_from, clone_to, clone_len;
- u8* new_buf;
-
- clone_len = choose_block_len(temp_len);
-
- clone_from = UR(temp_len - clone_len + 1);
- clone_to = UR(temp_len);
-
- new_buf = ck_alloc_nozero(temp_len + clone_len);
-
- /* Head */
-
- memcpy(new_buf, out_buf, clone_to);
-
- /* Inserted part */
-
- if (UR(4))
- memcpy(new_buf + clone_to, out_buf + clone_from, clone_len);
- else
- memset(new_buf + clone_to, UR(256), clone_len);
-
- /* Tail */
- memcpy(new_buf + clone_to + clone_len, out_buf + clone_to,
- temp_len - clone_to);
-
- ck_free(out_buf);
- out_buf = new_buf;
- temp_len += clone_len;
-
- }
-
- break;
-
- case 14: {
-
- /* Overwrite bytes with a randomly selected chunk (75%) or fixed
- bytes (25%). */
-
- u32 copy_from, copy_to, copy_len;
-
- if (temp_len < 2) break;
-
- copy_len = choose_block_len(temp_len - 1);
-
- copy_from = UR(temp_len - copy_len + 1);
- copy_to = UR(temp_len - copy_len + 1);
-
- if (UR(4)) {
-
- if (copy_from != copy_to)
- memmove(out_buf + copy_to, out_buf + copy_from, copy_len);
-
- } else memset(out_buf + copy_to, UR(256), copy_len);
-
- break;
-
- }
-
- /* Values 15 and 16 can be selected only if there are any extras
- present in the dictionaries. */
-
- case 15: {
-
- /* Overwrite bytes with an extra. */
-
- if (!extras_cnt || (a_extras_cnt && UR(2))) {
-
- /* No user-specified extras or odds in our favor. Let's use an
- auto-detected one. */
-
- u32 use_extra = UR(a_extras_cnt);
- u32 extra_len = a_extras[use_extra].len;
- u32 insert_at;
-
- if (extra_len > temp_len) break;
-
- insert_at = UR(temp_len - extra_len + 1);
- memcpy(out_buf + insert_at, a_extras[use_extra].data, extra_len);
-
- } else {
-
- /* No auto extras or odds in our favor. Use the dictionary. */
-
- u32 use_extra = UR(extras_cnt);
- u32 extra_len = extras[use_extra].len;
- u32 insert_at;
-
- if (extra_len > temp_len) break;
-
- insert_at = UR(temp_len - extra_len + 1);
- memcpy(out_buf + insert_at, extras[use_extra].data, extra_len);
-
- }
-
- break;
-
- }
-
- case 16: {
-
- u32 use_extra, extra_len, insert_at = UR(temp_len);
- u8* new_buf;
-
- /* Insert an extra. Do the same dice-rolling stuff as for the
- previous case. */
-
- if (!extras_cnt || (a_extras_cnt && UR(2))) {
-
- use_extra = UR(a_extras_cnt);
- extra_len = a_extras[use_extra].len;
-
- if (temp_len + extra_len >= MAX_FILE) break;
-
- new_buf = ck_alloc_nozero(temp_len + extra_len);
-
- /* Head */
- memcpy(new_buf, out_buf, insert_at);
-
- /* Inserted part */
- memcpy(new_buf + insert_at, a_extras[use_extra].data, extra_len);
-
- } else {
-
- use_extra = UR(extras_cnt);
- extra_len = extras[use_extra].len;
-
- if (temp_len + extra_len >= MAX_FILE) break;
-
- new_buf = ck_alloc_nozero(temp_len + extra_len);
-
- /* Head */
- memcpy(new_buf, out_buf, insert_at);
-
- /* Inserted part */
- memcpy(new_buf + insert_at, extras[use_extra].data, extra_len);
-
- }
-
- /* Tail */
- memcpy(new_buf + insert_at + extra_len, out_buf + insert_at,
- temp_len - insert_at);
-
- ck_free(out_buf);
- out_buf = new_buf;
- temp_len += extra_len;
-
- break;
-
- }
-
- }
-
- }
-
- if (common_fuzz_stuff(argv, out_buf, temp_len))
- goto abandon_entry;
-
- /* out_buf might have been mangled a bit, so let's restore it to its
- original size and shape. */
-
- if (temp_len < len) out_buf = ck_realloc(out_buf, len);
- temp_len = len;
- memcpy(out_buf, in_buf, len);
-
- /* If we're finding new stuff, let's run for a bit longer, limits
- permitting. */
-
- if (queued_paths != havoc_queued) {
-
- if (perf_score <= HAVOC_MAX_MULT * 100) {
- stage_max *= 2;
- perf_score *= 2;
- }
-
- havoc_queued = queued_paths;
-
- }
-
- }
-
- new_hit_cnt = queued_paths + unique_crashes;
-
- if (!splice_cycle) {
- stage_finds[STAGE_HAVOC] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_HAVOC] += stage_max;
- } else {
- stage_finds[STAGE_SPLICE] += new_hit_cnt - orig_hit_cnt;
- stage_cycles[STAGE_SPLICE] += stage_max;
- }
-
-#ifndef IGNORE_FINDS
-
- /************
- * SPLICING *
- ************/
-
- /* This is a last-resort strategy triggered by a full round with no findings.
- It takes the current input file, randomly selects another input, and
- splices them together at some offset, then relies on the havoc
- code to mutate that blob. */
-
-retry_splicing:
-
- if (use_splicing && splice_cycle++ < SPLICE_CYCLES &&
- queued_paths > 1 && queue_cur->len > 1) {
-
- struct queue_entry* target;
- u32 tid, split_at;
- u8* new_buf;
- s32 f_diff, l_diff;
-
- /* First of all, if we've modified in_buf for havoc, let's clean that
- up... */
-
- if (in_buf != orig_in) {
- ck_free(in_buf);
- in_buf = orig_in;
- len = queue_cur->len;
- }
-
- /* Pick a random queue entry and seek to it. Don't splice with yourself. */
-
- do { tid = UR(queued_paths); } while (tid == current_entry);
-
- splicing_with = tid;
- target = queue;
-
- while (tid >= 100) { target = target->next_100; tid -= 100; }
- while (tid--) target = target->next;
-
- /* Make sure that the target has a reasonable length. */
-
- while (target && (target->len < 2 || target == queue_cur)) {
- target = target->next;
- splicing_with++;
- }
-
- if (!target) goto retry_splicing;
-
- /* Read the testcase into a new buffer. */
-
- fd = open(target->fname, O_RDONLY);
-
- if (fd < 0) PFATAL("Unable to open '%s'", target->fname);
-
- new_buf = ck_alloc_nozero(target->len);
-
- ck_read(fd, new_buf, target->len, target->fname);
-
- close(fd);
-
- /* Find a suitable splicing location, somewhere between the first and
- the last differing byte. Bail out if the difference is just a single
- byte or so. */
-
- locate_diffs(in_buf, new_buf, MIN(len, target->len), &f_diff, &l_diff);
-
- if (f_diff < 0 || l_diff < 2 || f_diff == l_diff) {
- ck_free(new_buf);
- goto retry_splicing;
- }
-
- /* Split somewhere between the first and last differing byte. */
-
- split_at = f_diff + UR(l_diff - f_diff);
-
- /* Do the thing. */
-
- len = target->len;
- memcpy(new_buf, in_buf, split_at);
- in_buf = new_buf;
-
- ck_free(out_buf);
- out_buf = ck_alloc_nozero(len);
- memcpy(out_buf, in_buf, len);
-
- goto havoc_stage;
-
- }
-
-#endif /* !IGNORE_FINDS */
-
- ret_val = 0;
-
-abandon_entry:
-
- splicing_with = -1;
-
- /* Update pending_not_fuzzed count if we made it through the calibration
- cycle and have not seen this entry before. */
-
- if (!stop_soon && !queue_cur->cal_failed && !queue_cur->was_fuzzed) {
- queue_cur->was_fuzzed = 1;
- pending_not_fuzzed--;
- if (queue_cur->favored) pending_favored--;
- }
-
- munmap(orig_in, queue_cur->len);
-
- if (in_buf != orig_in) ck_free(in_buf);
- ck_free(out_buf);
- ck_free(eff_map);
-
- return ret_val;
-
-#undef FLIP_BIT
-
-}
-
-
-/* Grab interesting test cases from other fuzzers. */
-
-static void sync_fuzzers(char** argv) {
-
- DIR* sd;
- struct dirent* sd_ent;
- u32 sync_cnt = 0;
-
- sd = opendir(sync_dir);
- if (!sd) PFATAL("Unable to open '%s'", sync_dir);
-
- stage_max = stage_cur = 0;
- cur_depth = 0;
-
- /* Look at the entries created for every other fuzzer in the sync directory. */
-
- while ((sd_ent = readdir(sd))) {
-
- static u8 stage_tmp[128];
-
- DIR* qd;
- struct dirent* qd_ent;
- u8 *qd_path, *qd_synced_path;
- u32 min_accept = 0, next_min_accept;
-
- s32 id_fd;
-
- /* Skip dot files and our own output directory. */
-
- if (sd_ent->d_name[0] == '.' || !strcmp(sync_id, sd_ent->d_name)) continue;
-
- /* Skip anything that doesn't have a queue/ subdirectory. */
-
- qd_path = alloc_printf("%s/%s/queue", sync_dir, sd_ent->d_name);
-
- if (!(qd = opendir(qd_path))) {
- ck_free(qd_path);
- continue;
- }
-
- /* Retrieve the ID of the last seen test case. */
-
- qd_synced_path = alloc_printf("%s/.synced/%s", out_dir, sd_ent->d_name);
-
- id_fd = open(qd_synced_path, O_RDWR | O_CREAT, 0600);
-
- if (id_fd < 0) PFATAL("Unable to create '%s'", qd_synced_path);
-
- if (read(id_fd, &min_accept, sizeof(u32)) > 0)
- lseek(id_fd, 0, SEEK_SET);
-
- next_min_accept = min_accept;
-
- /* Show stats */
-
- sprintf(stage_tmp, "sync %u", ++sync_cnt);
- stage_name = stage_tmp;
- stage_cur = 0;
- stage_max = 0;
-
- /* For every file queued by this fuzzer, parse ID and see if we have looked at
- it before; exec a test case if not. */
-
- while ((qd_ent = readdir(qd))) {
-
- u8* path;
- s32 fd;
- struct stat st;
-
- if (qd_ent->d_name[0] == '.' ||
- sscanf(qd_ent->d_name, CASE_PREFIX "%06u", &syncing_case) != 1 ||
- syncing_case < min_accept) continue;
-
- /* OK, sounds like a new one. Let's give it a try. */
-
- if (syncing_case >= next_min_accept)
- next_min_accept = syncing_case + 1;
-
- path = alloc_printf("%s/%s", qd_path, qd_ent->d_name);
-
- /* Allow this to fail in case the other fuzzer is resuming or so... */
-
- fd = open(path, O_RDONLY);
-
- if (fd < 0) {
- ck_free(path);
- continue;
- }
-
- if (fstat(fd, &st)) PFATAL("fstat() failed");
-
- /* Ignore zero-sized or oversized files. */
-
- if (st.st_size && st.st_size <= MAX_FILE) {
-
- u8 fault;
- u8* mem = mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
-
- if (mem == MAP_FAILED) PFATAL("Unable to mmap '%s'", path);
-
- /* See what happens. We rely on save_if_interesting() to catch major
- errors and save the test case. */
-
- write_to_testcase(mem, st.st_size);
-
- fault = run_target(argv);
-
- if (stop_soon) return;
-
- syncing_party = sd_ent->d_name;
- queued_imported += save_if_interesting(argv, mem, st.st_size, fault);
- syncing_party = 0;
-
- munmap(mem, st.st_size);
-
- if (!(stage_cur++ % stats_update_freq)) show_stats();
-
- }
-
- ck_free(path);
- close(fd);
-
- }
-
- ck_write(id_fd, &next_min_accept, sizeof(u32), qd_synced_path);
-
- close(id_fd);
- closedir(qd);
- ck_free(qd_path);
- ck_free(qd_synced_path);
-
- }
-
- closedir(sd);
-
-}
-
-
-/* Handle stop signal (Ctrl-C, etc). */
-
-static void handle_stop_sig(int sig) {
-
- stop_soon = 1;
-
- if (child_pid > 0) kill(child_pid, SIGKILL);
- if (forksrv_pid > 0) kill(forksrv_pid, SIGKILL);
-
-}
-
-
-/* Handle skip request (SIGUSR1). */
-
-static void handle_skipreq(int sig) {
-
- skip_requested = 1;
-
-}
-
-/* Handle timeout (SIGALRM). */
-
-static void handle_timeout(int sig) {
-
- if (child_pid > 0) {
-
- child_timed_out = 1;
- kill(child_pid, SIGKILL);
-
- } else if (child_pid == -1 && forksrv_pid > 0) {
-
- child_timed_out = 1;
- kill(forksrv_pid, SIGKILL);
-
- }
-
-}
-
-
-/* Do a PATH search and find target binary to see that it exists and
- isn't a shell script - a common and painful mistake. We also check for
- a valid ELF header and for evidence of AFL instrumentation. */
-
-EXP_ST void check_binary(u8* fname) {
-
- u8* env_path = 0;
- struct stat st;
-
- s32 fd;
- u8* f_data;
- u32 f_len = 0;
-
- ACTF("Validating target binary...");
-
- if (strchr(fname, '/') || !(env_path = getenv("PATH"))) {
-
- target_path = ck_strdup(fname);
- if (stat(target_path, &st) || !S_ISREG(st.st_mode) ||
- !(st.st_mode & 0111) || (f_len = st.st_size) < 4)
- FATAL("Program '%s' not found or not executable", fname);
-
- } else {
-
- while (env_path) {
-
- u8 *cur_elem, *delim = strchr(env_path, ':');
-
- if (delim) {
-
- cur_elem = ck_alloc(delim - env_path + 1);
- memcpy(cur_elem, env_path, delim - env_path);
- delim++;
-
- } else cur_elem = ck_strdup(env_path);
-
- env_path = delim;
-
- if (cur_elem[0])
- target_path = alloc_printf("%s/%s", cur_elem, fname);
- else
- target_path = ck_strdup(fname);
-
- ck_free(cur_elem);
-
- if (!stat(target_path, &st) && S_ISREG(st.st_mode) &&
- (st.st_mode & 0111) && (f_len = st.st_size) >= 4) break;
-
- ck_free(target_path);
- target_path = 0;
-
- }
-
- if (!target_path) FATAL("Program '%s' not found or not executable", fname);
-
- }
-
- if (getenv("AFL_SKIP_BIN_CHECK")) return;
-
- /* Check for blatant user errors. */
-
- if ((!strncmp(target_path, "/tmp/", 5) && !strchr(target_path + 5, '/')) ||
- (!strncmp(target_path, "/var/tmp/", 9) && !strchr(target_path + 9, '/')))
- FATAL("Please don't keep binaries in /tmp or /var/tmp");
-
- fd = open(target_path, O_RDONLY);
-
- if (fd < 0) PFATAL("Unable to open '%s'", target_path);
-
- f_data = mmap(0, f_len, PROT_READ, MAP_PRIVATE, fd, 0);
-
- if (f_data == MAP_FAILED) PFATAL("Unable to mmap file '%s'", target_path);
-
- close(fd);
-
- if (f_data[0] == '#' && f_data[1] == '!') {
-
- SAYF("\n" cLRD "[-] " cRST
- "Oops, the target binary looks like a shell script. Some build systems will\n"
- " sometimes generate shell stubs for dynamically linked programs; try static\n"
- " library mode (./configure --disable-shared) if that's the case.\n\n"
-
- " Another possible cause is that you are actually trying to use a shell\n"
- " wrapper around the fuzzed component. Invoking shell can slow down the\n"
- " fuzzing process by a factor of 20x or more; it's best to write the wrapper\n"
- " in a compiled language instead.\n");
-
- FATAL("Program '%s' is a shell script", target_path);
-
- }
-
-#ifndef __APPLE__
-
- if (f_data[0] != 0x7f || memcmp(f_data + 1, "ELF", 3))
- FATAL("Program '%s' is not an ELF binary", target_path);
-
-#else
-
- if (f_data[0] != 0xCF || f_data[1] != 0xFA || f_data[2] != 0xED)
- FATAL("Program '%s' is not a 64-bit Mach-O binary", target_path);
-
-#endif /* ^!__APPLE__ */
-
- if (!qemu_mode && !dumb_mode &&
- !memmem(f_data, f_len, SHM_ENV_VAR, strlen(SHM_ENV_VAR) + 1)) {
-
- SAYF("\n" cLRD "[-] " cRST
- "Looks like the target binary is not instrumented! The fuzzer depends on\n"
- " compile-time instrumentation to isolate interesting test cases while\n"
- " mutating the input data. For more information, and for tips on how to\n"
- " instrument binaries, please see %s/README.\n\n"
-
- " When source code is not available, you may be able to leverage QEMU\n"
- " mode support. Consult the README for tips on how to enable this.\n"
-
- " (It is also possible to use afl-fuzz as a traditional, \"dumb\" fuzzer.\n"
- " For that, you can use the -n option - but expect much worse results.)\n",
- doc_path);
-
- FATAL("No instrumentation detected");
-
- }
-
- if (qemu_mode &&
- memmem(f_data, f_len, SHM_ENV_VAR, strlen(SHM_ENV_VAR) + 1)) {
-
- SAYF("\n" cLRD "[-] " cRST
- "This program appears to be instrumented with afl-gcc, but is being run in\n"
- " QEMU mode (-Q). This is probably not what you want - this setup will be\n"
- " slow and offer no practical benefits.\n");
-
- FATAL("Instrumentation found in -Q mode");
-
- }
-
- if (memmem(f_data, f_len, "libasan.so", 10) ||
- memmem(f_data, f_len, "__msan_init", 11)) uses_asan = 1;
-
- /* Detect persistent & deferred init signatures in the binary. */
-
- if (memmem(f_data, f_len, PERSIST_SIG, strlen(PERSIST_SIG) + 1)) {
-
- OKF(cPIN "Persistent mode binary detected.");
- setenv(PERSIST_ENV_VAR, "1", 1);
- persistent_mode = 1;
-
- } else if (getenv("AFL_PERSISTENT")) {
-
- WARNF("AFL_PERSISTENT is no longer supported and may misbehave!");
-
- }
-
- if (memmem(f_data, f_len, DEFER_SIG, strlen(DEFER_SIG) + 1)) {
-
- OKF(cPIN "Deferred forkserver binary detected.");
- setenv(DEFER_ENV_VAR, "1", 1);
-
- } else if (getenv("AFL_DEFER_FORKSRV")) {
-
- WARNF("AFL_DEFER_FORKSRV is no longer supported and may misbehave!");
-
- }
-
- if (munmap(f_data, f_len)) PFATAL("unmap() failed");
-
-}
-
-
-/* Trim and possibly create a banner for the run. */
-
-static void fix_up_banner(u8* name) {
-
- if (!use_banner) {
-
- if (sync_id) {
-
- use_banner = sync_id;
-
- } else {
-
- u8* trim = strrchr(name, '/');
- if (!trim) use_banner = name; else use_banner = trim + 1;
-
- }
-
- }
-
- if (strlen(use_banner) > 40) {
-
- u8* tmp = ck_alloc(44);
- sprintf(tmp, "%.40s...", use_banner);
- use_banner = tmp;
-
- }
-
-}
-
-
-/* Check if we're on TTY. */
-
-static void check_if_tty(void) {
-
- struct winsize ws;
-
- if (getenv("AFL_NO_UI")) {
- OKF("Disabling the UI because AFL_NO_UI is set.");
- not_on_tty = 1;
- return;
- }
-
- if (ioctl(1, TIOCGWINSZ, &ws)) {
-
- if (errno == ENOTTY) {
- OKF("Looks like we're not running on a tty, so I'll be a bit less verbose.");
- not_on_tty = 1;
- }
-
- return;
- }
-
-}
-
-
-/* Check terminal dimensions after resize. */
-
-static void check_term_size(void) {
-
- struct winsize ws;
-
- term_too_small = 0;
-
- if (ioctl(1, TIOCGWINSZ, &ws)) return;
-
- if (ws.ws_row < 25 || ws.ws_col < 80) term_too_small = 1;
-
-}
-
-
-
-/* Display usage hints. */
-
-static void usage(u8* argv0) {
-
- SAYF("\n%s [ options ] -- /path/to/fuzzed_app [ ... ]\n\n"
-
- "Required parameters:\n\n"
-
- " -i dir - input directory with test cases\n"
- " -o dir - output directory for fuzzer findings\n\n"
-
- "Execution control settings:\n\n"
-
- " -f file - location read by the fuzzed program (stdin)\n"
- " -t msec - timeout for each run (auto-scaled, 50-%u ms)\n"
- " -m megs - memory limit for child process (%u MB)\n"
- " -Q - use binary-only instrumentation (QEMU mode)\n\n"
-
- "Fuzzing behavior settings:\n\n"
-
- " -d - quick & dirty mode (skips deterministic steps)\n"
- " -n - fuzz without instrumentation (dumb mode)\n"
- " -x dir - optional fuzzer dictionary (see README)\n\n"
-
- "Other stuff:\n\n"
-
- " -T text - text banner to show on the screen\n"
- " -M / -S id - distributed mode (see parallel_fuzzing.txt)\n"
- " -C - crash exploration mode (the peruvian rabbit thing)\n\n"
-
- "For additional tips, please consult %s/README.\n\n",
-
- argv0, EXEC_TIMEOUT, MEM_LIMIT, doc_path);
-
- exit(1);
-
-}
-
-
-/* Prepare output directories and fds. */
-
-EXP_ST void setup_dirs_fds(void) {
-
- u8* tmp;
- s32 fd;
-
- ACTF("Setting up output directories...");
-
- if (sync_id && mkdir(sync_dir, 0700) && errno != EEXIST)
- PFATAL("Unable to create '%s'", sync_dir);
-
- if (mkdir(out_dir, 0700)) {
-
- if (errno != EEXIST) PFATAL("Unable to create '%s'", out_dir);
-
- maybe_delete_out_dir();
-
- } else {
-
- if (in_place_resume)
- FATAL("Resume attempted but old output directory not found");
-
- out_dir_fd = open(out_dir, O_RDONLY);
-
-#ifndef __sun
-
- if (out_dir_fd < 0 || flock(out_dir_fd, LOCK_EX | LOCK_NB))
- PFATAL("Unable to flock() output directory.");
-
-#endif /* !__sun */
-
- }
-
- /* Queue directory for any starting & discovered paths. */
-
- tmp = alloc_printf("%s/queue", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- /* Top-level directory for queue metadata used for session
- resume and related tasks. */
-
- tmp = alloc_printf("%s/queue/.state/", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- /* Directory for flagging queue entries that went through
- deterministic fuzzing in the past. */
-
- tmp = alloc_printf("%s/queue/.state/deterministic_done/", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- /* Directory with the auto-selected dictionary entries. */
-
- tmp = alloc_printf("%s/queue/.state/auto_extras/", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- /* The set of paths currently deemed redundant. */
-
- tmp = alloc_printf("%s/queue/.state/redundant_edges/", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- /* The set of paths showing variable behavior. */
-
- tmp = alloc_printf("%s/queue/.state/variable_behavior/", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- /* Sync directory for keeping track of cooperating fuzzers. */
-
- if (sync_id) {
-
- tmp = alloc_printf("%s/.synced/", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- }
-
- /* All recorded crashes. */
-
- tmp = alloc_printf("%s/crashes", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- /* All recorded hangs. */
-
- tmp = alloc_printf("%s/hangs", out_dir);
- if (mkdir(tmp, 0700)) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- /* Generally useful file descriptors. */
-
- dev_null_fd = open("/dev/null", O_RDWR);
- if (dev_null_fd < 0) PFATAL("Unable to open /dev/null");
-
- dev_urandom_fd = open("/dev/urandom", O_RDONLY);
- if (dev_urandom_fd < 0) PFATAL("Unable to open /dev/urandom");
-
- /* Gnuplot output file. */
-
- tmp = alloc_printf("%s/plot_data", out_dir);
- fd = open(tmp, O_WRONLY | O_CREAT | O_EXCL, 0600);
- if (fd < 0) PFATAL("Unable to create '%s'", tmp);
- ck_free(tmp);
-
- plot_file = fdopen(fd, "w");
- if (!plot_file) PFATAL("fdopen() failed");
-
- fprintf(plot_file, "# unix_time, cycles_done, cur_path, paths_total, "
- "pending_total, pending_favs, map_size, unique_crashes, "
- "unique_hangs, max_depth, execs_per_sec\n");
- /* ignore errors */
-
-}
-
-
-/* Setup the output file for fuzzed data, if not using -f. */
-
-EXP_ST void setup_stdio_file(void) {
-
- u8* fn = alloc_printf("%s/.cur_input", out_dir);
-
- unlink(fn); /* Ignore errors */
-
- out_fd = open(fn, O_RDWR | O_CREAT | O_EXCL, 0600);
-
- if (out_fd < 0) PFATAL("Unable to create '%s'", fn);
-
- ck_free(fn);
-
-}
-
-
-/* Make sure that core dumps don't go to a program. */
-
-static void check_crash_handling(void) {
-
-#ifdef __APPLE__
-
- /* Yuck! There appears to be no simple C API to query for the state of
- loaded daemons on MacOS X, and I'm a bit hesitant to do something
- more sophisticated, such as disabling crash reporting via Mach ports,
- until I get a box to test the code. So, for now, we check for crash
- reporting the awful way. */
-
- if (system("launchctl list 2>/dev/null | grep -q '\\.ReportCrash$'")) return;
-
- SAYF("\n" cLRD "[-] " cRST
- "Whoops, your system is configured to forward crash notifications to an\n"
- " external crash reporting utility. This will cause issues due to the\n"
- " extended delay between the fuzzed binary malfunctioning and this fact\n"
- " being relayed to the fuzzer via the standard waitpid() API.\n\n"
- " To avoid having crashes misinterpreted as hangs, please run the\n"
- " following commands:\n\n"
-
- " SL=/System/Library; PL=com.apple.ReportCrash\n"
- " launchctl unload -w ${SL}/LaunchAgents/${PL}.plist\n"
- " sudo launchctl unload -w ${SL}/LaunchDaemons/${PL}.Root.plist\n");
-
- if (!getenv("AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES"))
- FATAL("Crash reporter detected");
-
-#else
-
- /* This is Linux specific, but I don't think there's anything equivalent on
- *BSD, so we can just let it slide for now. */
-
- s32 fd = open("/proc/sys/kernel/core_pattern", O_RDONLY);
- u8 fchar;
-
- if (fd < 0) return;
-
- ACTF("Checking core_pattern...");
-
- if (read(fd, &fchar, 1) == 1 && fchar == '|') {
-
- SAYF("\n" cLRD "[-] " cRST
- "Hmm, your system is configured to send core dump notifications to an\n"
- " external utility. This will cause issues: there will be an extended delay\n"
- " between stumbling upon a crash and having this information relayed to the\n"
- " fuzzer via the standard waitpid() API.\n\n"
-
- " To avoid having crashes misinterpreted as hangs, please log in as root\n"
- " and temporarily modify /proc/sys/kernel/core_pattern, like so:\n\n"
-
- " echo core >/proc/sys/kernel/core_pattern\n");
-
- if (!getenv("AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES"))
- FATAL("Pipe at the beginning of 'core_pattern'");
-
- }
-
- close(fd);
-
-#endif /* ^__APPLE__ */
-
-}
-
-
-/* Check CPU governor. */
-
-static void check_cpu_governor(void) {
-
- FILE* f;
- u8 tmp[128];
- u64 min = 0, max = 0;
-
- if (getenv("AFL_SKIP_CPUFREQ")) return;
-
- f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", "r");
- if (!f) return;
-
- ACTF("Checking CPU scaling governor...");
-
- if (!fgets(tmp, 128, f)) PFATAL("fgets() failed");
-
- fclose(f);
-
- if (!strncmp(tmp, "perf", 4)) return;
-
- f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", "r");
-
- if (f) {
- if (fscanf(f, "%llu", &min) != 1) min = 0;
- fclose(f);
- }
-
- f = fopen("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", "r");
-
- if (f) {
- if (fscanf(f, "%llu", &max) != 1) max = 0;
- fclose(f);
- }
-
- if (min == max) return;
-
- SAYF("\n" cLRD "[-] " cRST
- "Whoops, your system uses on-demand CPU frequency scaling, adjusted\n"
- " between %llu and %llu MHz. Unfortunately, the scaling algorithm in the\n"
- " kernel is imperfect and can miss the short-lived processes spawned by\n"
- " afl-fuzz. To keep things moving, run these commands as root:\n\n"
-
- " cd /sys/devices/system/cpu\n"
- " echo performance | tee cpu*/cpufreq/scaling_governor\n\n"
-
- " You can later go back to the original state by replacing 'performance' with\n"
- " 'ondemand'. If you don't want to change the settings, set AFL_SKIP_CPUFREQ\n"
- " to make afl-fuzz skip this check - but expect some performance drop.\n",
- min / 1024, max / 1024);
-
- FATAL("Suboptimal CPU scaling governor");
-
-}
-
-
-/* Count the number of logical CPU cores. */
-
-static void get_core_count(void) {
-
- u32 cur_runnable = 0;
-
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__)
-
- size_t s = sizeof(cpu_core_count);
-
- /* On *BSD systems, we can just use a sysctl to get the number of CPUs. */
-
-#ifdef __APPLE__
-
- if (sysctlbyname("hw.logicalcpu", &cpu_core_count, &s, NULL, 0) < 0)
- return;
-
-#else
-
- int s_name[2] = { CTL_HW, HW_NCPU };
-
- if (sysctl(s_name, 2, &cpu_core_count, &s, NULL, 0) < 0) return;
-
-#endif /* ^__APPLE__ */
-
-#else
-
-#ifdef HAVE_AFFINITY
-
- cpu_core_count = sysconf(_SC_NPROCESSORS_ONLN);
-
-#else
-
- FILE* f = fopen("/proc/stat", "r");
- u8 tmp[1024];
-
- if (!f) return;
-
- while (fgets(tmp, sizeof(tmp), f))
- if (!strncmp(tmp, "cpu", 3) && isdigit(tmp[3])) cpu_core_count++;
-
- fclose(f);
-
-#endif /* ^HAVE_AFFINITY */
-
-#endif /* ^(__APPLE__ || __FreeBSD__ || __OpenBSD__) */
-
- if (cpu_core_count > 0) {
-
- cur_runnable = (u32)get_runnable_processes();
-
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__)
-
- /* Add ourselves, since the 1-minute average doesn't include that yet. */
-
- cur_runnable++;
-
-#endif /* __APPLE__ || __FreeBSD__ || __OpenBSD__ */
-
- OKF("You have %u CPU core%s and %u runnable tasks (utilization: %0.0f%%).",
- cpu_core_count, cpu_core_count > 1 ? "s" : "",
- cur_runnable, cur_runnable * 100.0 / cpu_core_count);
-
- if (cpu_core_count > 1) {
-
- if (cur_runnable > cpu_core_count * 1.5) {
-
- WARNF("System under apparent load, performance may be spotty.");
-
- } else if (cur_runnable + 1 <= cpu_core_count) {
-
- OKF("Try parallel jobs - see %s/parallel_fuzzing.txt.", doc_path);
-
- }
-
- }
-
- } else {
-
- cpu_core_count = 0;
- WARNF("Unable to figure out the number of CPU cores.");
-
- }
-
-}
-
-
-/* Validate and fix up out_dir and sync_dir when using -S. */
-
-static void fix_up_sync(void) {
-
- u8* x = sync_id;
-
- if (dumb_mode)
- FATAL("-S / -M and -n are mutually exclusive");
-
- if (skip_deterministic) {
-
- if (force_deterministic)
- FATAL("use -S instead of -M -d");
- else
- FATAL("-S already implies -d");
-
- }
-
- while (*x) {
-
- if (!isalnum(*x) && *x != '_' && *x != '-')
- FATAL("Non-alphanumeric fuzzer ID specified via -S or -M");
-
- x++;
-
- }
-
- if (strlen(sync_id) > 32) FATAL("Fuzzer ID too long");
-
- x = alloc_printf("%s/%s", out_dir, sync_id);
-
- sync_dir = out_dir;
- out_dir = x;
-
- if (!force_deterministic) {
- skip_deterministic = 1;
- use_splicing = 1;
- }
-
-}
-
-
-/* Handle screen resize (SIGWINCH). */
-
-static void handle_resize(int sig) {
- clear_screen = 1;
-}
-
-
-/* Check ASAN options. */
-
-static void check_asan_opts(void) {
- u8* x = getenv("ASAN_OPTIONS");
-
- if (x) {
-
- if (!strstr(x, "abort_on_error=1"))
- FATAL("Custom ASAN_OPTIONS set without abort_on_error=1 - please fix!");
-
- if (!strstr(x, "symbolize=0"))
- FATAL("Custom ASAN_OPTIONS set without symbolize=0 - please fix!");
-
- }
-
- x = getenv("MSAN_OPTIONS");
-
- if (x) {
-
- if (!strstr(x, "exit_code=" STRINGIFY(MSAN_ERROR)))
- FATAL("Custom MSAN_OPTIONS set without exit_code="
- STRINGIFY(MSAN_ERROR) " - please fix!");
-
- if (!strstr(x, "symbolize=0"))
- FATAL("Custom MSAN_OPTIONS set without symbolize=0 - please fix!");
-
- }
-
-}
-
-
-/* Detect @@ in args. */
-
-EXP_ST void detect_file_args(char** argv) {
-
- u32 i = 0;
- u8* cwd = getcwd(NULL, 0);
-
- if (!cwd) PFATAL("getcwd() failed");
-
- while (argv[i]) {
-
- u8* aa_loc = strstr(argv[i], "@@");
-
- if (aa_loc) {
-
- u8 *aa_subst, *n_arg;
-
- /* If we don't have a file name chosen yet, use a safe default. */
-
- if (!out_file)
- out_file = alloc_printf("%s/.cur_input", out_dir);
-
- /* Be sure that we're always using fully-qualified paths. */
-
- if (out_file[0] == '/') aa_subst = out_file;
- else aa_subst = alloc_printf("%s/%s", cwd, out_file);
-
- /* Construct a replacement argv value. */
-
- *aa_loc = 0;
- n_arg = alloc_printf("%s%s%s", argv[i], aa_subst, aa_loc + 2);
- argv[i] = n_arg;
- *aa_loc = '@';
-
- if (out_file[0] != '/') ck_free(aa_subst);
-
- }
-
- i++;
-
- }
-
- free(cwd); /* not tracked */
-
-}
-
-
-/* Set up signal handlers. More complicated that needs to be, because libc on
- Solaris doesn't resume interrupted reads(), sets SA_RESETHAND when you call
- siginterrupt(), and does other stupid things. */
-
-EXP_ST void setup_signal_handlers(void) {
-
- struct sigaction sa;
-
- sa.sa_handler = NULL;
- sa.sa_flags = SA_RESTART;
- sa.sa_sigaction = NULL;
-
- sigemptyset(&sa.sa_mask);
-
- /* Various ways of saying "stop". */
-
- sa.sa_handler = handle_stop_sig;
- sigaction(SIGHUP, &sa, NULL);
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
-
- /* Exec timeout notifications. */
-
- sa.sa_handler = handle_timeout;
- sigaction(SIGALRM, &sa, NULL);
-
- /* Window resize */
-
- sa.sa_handler = handle_resize;
- sigaction(SIGWINCH, &sa, NULL);
-
- /* SIGUSR1: skip entry */
-
- sa.sa_handler = handle_skipreq;
- sigaction(SIGUSR1, &sa, NULL);
-
- /* Things we don't care about. */
-
- sa.sa_handler = SIG_IGN;
- sigaction(SIGTSTP, &sa, NULL);
- sigaction(SIGPIPE, &sa, NULL);
-
-}
-
-
-/* Rewrite argv for QEMU. */
-
-static char** get_qemu_argv(u8* own_loc, char** argv, int argc) {
-
- char** new_argv = ck_alloc(sizeof(char*) * (argc + 4));
- u8 *tmp, *cp, *rsl, *own_copy;
-
- memcpy(new_argv + 3, argv + 1, sizeof(char*) * argc);
-
- new_argv[2] = target_path;
- new_argv[1] = "--";
-
- /* Now we need to actually find the QEMU binary to put in argv[0]. */
-
- tmp = getenv("AFL_PATH");
-
- if (tmp) {
-
- cp = alloc_printf("%s/afl-qemu-trace", tmp);
-
- if (access(cp, X_OK))
- FATAL("Unable to find '%s'", tmp);
-
- target_path = new_argv[0] = cp;
- return new_argv;
-
- }
-
- own_copy = ck_strdup(own_loc);
- rsl = strrchr(own_copy, '/');
-
- if (rsl) {
-
- *rsl = 0;
-
- cp = alloc_printf("%s/afl-qemu-trace", own_copy);
- ck_free(own_copy);
-
- if (!access(cp, X_OK)) {
-
- target_path = new_argv[0] = cp;
- return new_argv;
-
- }
-
- } else ck_free(own_copy);
-
- if (!access(BIN_PATH "/afl-qemu-trace", X_OK)) {
-
- target_path = new_argv[0] = ck_strdup(BIN_PATH "/afl-qemu-trace");
- return new_argv;
-
- }
-
- SAYF("\n" cLRD "[-] " cRST
- "Oops, unable to find the 'afl-qemu-trace' binary. The binary must be built\n"
- " separately by following the instructions in qemu_mode/README.qemu. If you\n"
- " already have the binary installed, you may need to specify AFL_PATH in the\n"
- " environment.\n\n"
-
- " Of course, even without QEMU, afl-fuzz can still work with binaries that are\n"
- " instrumented at compile time with afl-gcc. It is also possible to use it as a\n"
- " traditional \"dumb\" fuzzer by specifying '-n' in the command line.\n");
-
- FATAL("Failed to locate 'afl-qemu-trace'.");
-
-}
-
-
-/* Make a copy of the current command line. */
-
-static void save_cmdline(u32 argc, char** argv) {
-
- u32 len = 1, i;
- u8* buf;
-
- for (i = 0; i < argc; i++)
- len += strlen(argv[i]) + 1;
-
- buf = orig_cmdline = ck_alloc(len);
-
- for (i = 0; i < argc; i++) {
-
- u32 l = strlen(argv[i]);
-
- memcpy(buf, argv[i], l);
- buf += l;
-
- if (i != argc - 1) *(buf++) = ' ';
-
- }
-
- *buf = 0;
-
-}
-
-
-#ifndef AFL_LIB
-
-/* Main entry point */
-
-int main(int argc, char** argv) {
-
- s32 opt;
- u64 prev_queued = 0;
- u32 sync_interval_cnt = 0, seek_to;
- u8 *extras_dir = 0;
- u8 mem_limit_given = 0;
- u8 exit_1 = !!getenv("AFL_BENCH_JUST_ONE");
- char** use_argv;
-
- struct timeval tv;
- struct timezone tz;
-
- SAYF(cCYA "afl-fuzz " cBRI VERSION cRST " by <lcamtuf@google.com>\n");
-
- doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
-
- gettimeofday(&tv, &tz);
- srandom(tv.tv_sec ^ tv.tv_usec ^ getpid());
-
- while ((opt = getopt(argc, argv, "+i:o:f:m:t:T:dnCB:S:M:x:Q")) > 0)
-
- switch (opt) {
-
- case 'i': /* input dir */
-
- if (in_dir) FATAL("Multiple -i options not supported");
- in_dir = optarg;
-
- if (!strcmp(in_dir, "-")) in_place_resume = 1;
-
- break;
-
- case 'o': /* output dir */
-
- if (out_dir) FATAL("Multiple -o options not supported");
- out_dir = optarg;
- break;
-
- case 'M': { /* master sync ID */
-
- u8* c;
-
- if (sync_id) FATAL("Multiple -S or -M options not supported");
- sync_id = ck_strdup(optarg);
-
- if ((c = strchr(sync_id, ':'))) {
-
- *c = 0;
-
- if (sscanf(c + 1, "%u/%u", &master_id, &master_max) != 2 ||
- !master_id || !master_max || master_id > master_max ||
- master_max > 1000000) FATAL("Bogus master ID passed to -M");
-
- }
-
- force_deterministic = 1;
-
- }
-
- break;
-
- case 'S':
-
- if (sync_id) FATAL("Multiple -S or -M options not supported");
- sync_id = ck_strdup(optarg);
- break;
-
- case 'f': /* target file */
-
- if (out_file) FATAL("Multiple -f options not supported");
- out_file = optarg;
- break;
-
- case 'x': /* dictionary */
-
- if (extras_dir) FATAL("Multiple -x options not supported");
- extras_dir = optarg;
- break;
-
- case 't': { /* timeout */
-
- u8 suffix = 0;
-
- if (timeout_given) FATAL("Multiple -t options not supported");
-
- if (sscanf(optarg, "%u%c", &exec_tmout, &suffix) < 1 ||
- optarg[0] == '-') FATAL("Bad syntax used for -t");
-
- if (exec_tmout < 5) FATAL("Dangerously low value of -t");
-
- if (suffix == '+') timeout_given = 2; else timeout_given = 1;
-
- break;
-
- }
-
- case 'm': { /* mem limit */
-
- u8 suffix = 'M';
-
- if (mem_limit_given) FATAL("Multiple -m options not supported");
- mem_limit_given = 1;
-
- if (!strcmp(optarg, "none")) {
-
- mem_limit = 0;
- break;
-
- }
-
- if (sscanf(optarg, "%llu%c", &mem_limit, &suffix) < 1 ||
- optarg[0] == '-') FATAL("Bad syntax used for -m");
-
- switch (suffix) {
-
- case 'T': mem_limit *= 1024 * 1024; break;
- case 'G': mem_limit *= 1024; break;
- case 'k': mem_limit /= 1024; break;
- case 'M': break;
-
- default: FATAL("Unsupported suffix or bad syntax for -m");
-
- }
-
- if (mem_limit < 5) FATAL("Dangerously low value of -m");
-
- if (sizeof(rlim_t) == 4 && mem_limit > 2000)
- FATAL("Value of -m out of range on 32-bit systems");
-
- }
-
- break;
-
- case 'd': /* skip deterministic */
-
- if (skip_deterministic) FATAL("Multiple -d options not supported");
- skip_deterministic = 1;
- use_splicing = 1;
- break;
-
- case 'B': /* load bitmap */
-
- /* This is a secret undocumented option! It is useful if you find
- an interesting test case during a normal fuzzing process, and want
- to mutate it without rediscovering any of the test cases already
- found during an earlier run.
-
- To use this mode, you need to point -B to the fuzz_bitmap produced
- by an earlier run for the exact same binary... and that's it.
-
- I only used this once or twice to get variants of a particular
- file, so I'm not making this an official setting. */
-
- if (in_bitmap) FATAL("Multiple -B options not supported");
-
- in_bitmap = optarg;
- read_bitmap(in_bitmap);
- break;
-
- case 'C': /* crash mode */
-
- if (crash_mode) FATAL("Multiple -C options not supported");
- crash_mode = FAULT_CRASH;
- break;
-
- case 'n': /* dumb mode */
-
- if (dumb_mode) FATAL("Multiple -n options not supported");
- if (getenv("AFL_DUMB_FORKSRV")) dumb_mode = 2; else dumb_mode = 1;
-
- break;
-
- case 'T': /* banner */
-
- if (use_banner) FATAL("Multiple -T options not supported");
- use_banner = optarg;
- break;
-
- case 'Q': /* QEMU mode */
-
- if (qemu_mode) FATAL("Multiple -Q options not supported");
- qemu_mode = 1;
-
- if (!mem_limit_given) mem_limit = MEM_LIMIT_QEMU;
-
- break;
-
- default:
-
- usage(argv[0]);
-
- }
-
- if (optind == argc || !in_dir || !out_dir) usage(argv[0]);
-
- setup_signal_handlers();
- check_asan_opts();
-
- if (sync_id) fix_up_sync();
-
- if (!strcmp(in_dir, out_dir))
- FATAL("Input and output directories can't be the same");
-
- if (dumb_mode) {
-
- if (crash_mode) FATAL("-C and -n are mutually exclusive");
- if (qemu_mode) FATAL("-Q and -n are mutually exclusive");
-
- }
-
- if (getenv("AFL_NO_FORKSRV")) no_forkserver = 1;
- if (getenv("AFL_NO_CPU_RED")) no_cpu_meter_red = 1;
- if (getenv("AFL_SHUFFLE_QUEUE")) shuffle_queue = 1;
-
- if (dumb_mode == 2 && no_forkserver)
- FATAL("AFL_DUMB_FORKSRV and AFL_NO_FORKSRV are mutually exclusive");
-
- if (getenv("AFL_PRELOAD")) {
- setenv("LD_PRELOAD", getenv("AFL_PRELOAD"), 1);
- setenv("DYLD_INSERT_LIBRARIES", getenv("AFL_PRELOAD"), 1);
- }
-
- if (getenv("AFL_LD_PRELOAD"))
- FATAL("Use AFL_PRELOAD instead of AFL_LD_PRELOAD");
-
- save_cmdline(argc, argv);
-
- fix_up_banner(argv[optind]);
-
- check_if_tty();
-
- get_core_count();
-
-#ifdef HAVE_AFFINITY
- bind_to_free_cpu();
-#endif /* HAVE_AFFINITY */
-
- check_crash_handling();
- check_cpu_governor();
-
- setup_post();
- setup_shm();
- init_count_class16();
-
- setup_dirs_fds();
- read_testcases();
- load_auto();
-
- pivot_inputs();
-
- if (extras_dir) load_extras(extras_dir);
-
- if (!timeout_given) find_timeout();
-
- detect_file_args(argv + optind + 1);
-
- if (!out_file) setup_stdio_file();
-
- check_binary(argv[optind]);
-
- start_time = get_cur_time();
-
- if (qemu_mode)
- use_argv = get_qemu_argv(argv[0], argv + optind, argc - optind);
- else
- use_argv = argv + optind;
-
- perform_dry_run(use_argv);
-
- cull_queue();
-
- show_init_stats();
-
- seek_to = find_start_position();
-
- write_stats_file(0, 0, 0);
- save_auto();
-
- if (stop_soon) goto stop_fuzzing;
-
- /* Woop woop woop */
-
- if (!not_on_tty) {
- sleep(4);
- start_time += 4000;
- if (stop_soon) goto stop_fuzzing;
- }
-
- while (1) {
-
- u8 skipped_fuzz;
-
- cull_queue();
-
- if (!queue_cur) {
-
- queue_cycle++;
- current_entry = 0;
- cur_skipped_paths = 0;
- queue_cur = queue;
-
- while (seek_to) {
- current_entry++;
- seek_to--;
- queue_cur = queue_cur->next;
- }
-
- show_stats();
-
- if (not_on_tty) {
- ACTF("Entering queue cycle %llu.", queue_cycle);
- fflush(stdout);
- }
-
- /* If we had a full queue cycle with no new finds, try
- recombination strategies next. */
-
- if (queued_paths == prev_queued) {
-
- if (use_splicing) cycles_wo_finds++; else use_splicing = 1;
-
- } else cycles_wo_finds = 0;
-
- prev_queued = queued_paths;
-
- if (sync_id && queue_cycle == 1 && getenv("AFL_IMPORT_FIRST"))
- sync_fuzzers(use_argv);
-
- }
-
- skipped_fuzz = fuzz_one(use_argv);
-
- if (!stop_soon && sync_id && !skipped_fuzz) {
-
- if (!(sync_interval_cnt++ % SYNC_INTERVAL))
- sync_fuzzers(use_argv);
-
- }
-
- if (!stop_soon && exit_1) stop_soon = 2;
-
- if (stop_soon) break;
-
- queue_cur = queue_cur->next;
- current_entry++;
-
- }
-
- if (queue_cur) show_stats();
-
- write_bitmap();
- write_stats_file(0, 0, 0);
- save_auto();
-
-stop_fuzzing:
-
- SAYF(CURSOR_SHOW cLRD "\n\n+++ Testing aborted %s +++\n" cRST,
- stop_soon == 2 ? "programmatically" : "by user");
-
- /* Running for more than 30 minutes but still doing first cycle? */
-
- if (queue_cycle == 1 && get_cur_time() - start_time > 30 * 60 * 1000) {
-
- SAYF("\n" cYEL "[!] " cRST
- "Stopped during the first cycle, results may be incomplete.\n"
- " (For info on resuming, see %s/README.)\n", doc_path);
-
- }
-
- fclose(plot_file);
- destroy_queue();
- destroy_extras();
- ck_free(target_path);
- ck_free(sync_id);
-
- alloc_report();
-
- OKF("We're done here. Have a nice day!\n");
-
- exit(0);
-
-}
-
-#endif /* !AFL_LIB */
diff --git a/chromium/third_party/afl/src/afl-gcc.c b/chromium/third_party/afl/src/afl-gcc.c
deleted file mode 100644
index fa3dec1aaeb..00000000000
--- a/chromium/third_party/afl/src/afl-gcc.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- american fuzzy lop - wrapper for GCC and clang
- ----------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014, 2015 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This program is a drop-in replacement for GCC or clang. The most common way
- of using it is to pass the path to afl-gcc or afl-clang via CC when invoking
- ./configure.
-
- (Of course, use CXX and point it to afl-g++ / afl-clang++ for C++ code.)
-
- The wrapper needs to know the path to afl-as (renamed to 'as'). The default
- is /usr/local/lib/afl/. A convenient way to specify alternative directories
- would be to set AFL_PATH.
-
- If AFL_HARDEN is set, the wrapper will compile the target app with various
- hardening options that may help detect memory management issues more
- reliably. You can also specify AFL_USE_ASAN to enable ASAN.
-
- If you want to call a non-default compiler as a next step of the chain,
- specify its location via AFL_CC or AFL_CXX.
-
- */
-
-#define AFL_MAIN
-
-#include "config.h"
-#include "types.h"
-#include "debug.h"
-#include "alloc-inl.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-static u8* as_path; /* Path to the AFL 'as' wrapper */
-static u8** cc_params; /* Parameters passed to the real CC */
-static u32 cc_par_cnt = 1; /* Param count, including argv0 */
-static u8 be_quiet, /* Quiet mode */
- clang_mode; /* Invoked as afl-clang*? */
-
-
-/* Try to find our "fake" GNU assembler in AFL_PATH or at the location derived
- from argv[0]. If that fails, abort. */
-
-static void find_as(u8* argv0) {
-
- u8 *afl_path = getenv("AFL_PATH");
- u8 *slash, *tmp;
-
- if (afl_path) {
-
- tmp = alloc_printf("%s/as", afl_path);
-
- if (!access(tmp, X_OK)) {
- as_path = afl_path;
- ck_free(tmp);
- return;
- }
-
- ck_free(tmp);
-
- }
-
- slash = strrchr(argv0, '/');
-
- if (slash) {
-
- u8 *dir;
-
- *slash = 0;
- dir = ck_strdup(argv0);
- *slash = '/';
-
- tmp = alloc_printf("%s/afl-as", dir);
-
- if (!access(tmp, X_OK)) {
- as_path = dir;
- ck_free(tmp);
- return;
- }
-
- ck_free(tmp);
- ck_free(dir);
-
- }
-
- if (!access(AFL_PATH "/as", X_OK)) {
- as_path = AFL_PATH;
- return;
- }
-
- FATAL("Unable to find AFL wrapper binary for 'as'. Please set AFL_PATH");
-
-}
-
-
-/* Copy argv to cc_params, making the necessary edits. */
-
-static void edit_params(u32 argc, char** argv) {
-
- u8 fortify_set = 0, asan_set = 0;
- u8 *name;
-
-#if defined(__FreeBSD__) && defined(__x86_64__)
- u8 m32_set = 0;
-#endif
-
- cc_params = ck_alloc((argc + 128) * sizeof(u8*));
-
- name = strrchr(argv[0], '/');
- if (!name) name = argv[0]; else name++;
-
- if (!strncmp(name, "afl-clang", 9)) {
-
- clang_mode = 1;
-
- setenv(CLANG_ENV_VAR, "1", 1);
-
- if (!strcmp(name, "afl-clang++")) {
- u8* alt_cxx = getenv("AFL_CXX");
- cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++";
- } else {
- u8* alt_cc = getenv("AFL_CC");
- cc_params[0] = alt_cc ? alt_cc : (u8*)"clang";
- }
-
- } else {
-
- /* With GCJ and Eclipse installed, you can actually compile Java! The
- instrumentation will work (amazingly). Alas, unhandled exceptions do
- not call abort(), so afl-fuzz would need to be modified to equate
- non-zero exit codes with crash conditions when working with Java
- binaries. Meh. */
-
-#ifdef __APPLE__
-
- if (!strcmp(name, "afl-g++")) cc_params[0] = getenv("AFL_CXX");
- else if (!strcmp(name, "afl-gcj")) cc_params[0] = getenv("AFL_GCJ");
- else cc_params[0] = getenv("AFL_CC");
-
- if (!cc_params[0]) {
-
- SAYF("\n" cLRD "[-] " cRST
- "On Apple systems, 'gcc' is usually just a wrapper for clang. Please use the\n"
- " 'afl-clang' utility instead of 'afl-gcc'. If you really have GCC installed,\n"
- " set AFL_CC or AFL_CXX to specify the correct path to that compiler.\n");
-
- FATAL("AFL_CC or AFL_CXX required on MacOS X");
-
- }
-
-#else
-
- if (!strcmp(name, "afl-g++")) {
- u8* alt_cxx = getenv("AFL_CXX");
- cc_params[0] = alt_cxx ? alt_cxx : (u8*)"g++";
- } else if (!strcmp(name, "afl-gcj")) {
- u8* alt_cc = getenv("AFL_GCJ");
- cc_params[0] = alt_cc ? alt_cc : (u8*)"gcj";
- } else {
- u8* alt_cc = getenv("AFL_CC");
- cc_params[0] = alt_cc ? alt_cc : (u8*)"gcc";
- }
-
-#endif /* __APPLE__ */
-
- }
-
- while (--argc) {
- u8* cur = *(++argv);
-
- if (!strncmp(cur, "-B", 2)) {
-
- if (!be_quiet) WARNF("-B is already set, overriding");
-
- if (!cur[2] && argc > 1) { argc--; argv++; }
- continue;
-
- }
-
- if (!strcmp(cur, "-integrated-as")) continue;
-
- if (!strcmp(cur, "-pipe")) continue;
-
-#if defined(__FreeBSD__) && defined(__x86_64__)
- if (!strcmp(cur, "-m32")) m32_set = 1;
-#endif
-
- if (!strcmp(cur, "-fsanitize=address") ||
- !strcmp(cur, "-fsanitize=memory")) asan_set = 1;
-
- if (strstr(cur, "FORTIFY_SOURCE")) fortify_set = 1;
-
- cc_params[cc_par_cnt++] = cur;
-
- }
-
- cc_params[cc_par_cnt++] = "-B";
- cc_params[cc_par_cnt++] = as_path;
-
- if (clang_mode)
- cc_params[cc_par_cnt++] = "-no-integrated-as";
-
- if (getenv("AFL_HARDEN")) {
-
- cc_params[cc_par_cnt++] = "-fstack-protector-all";
-
- if (!fortify_set)
- cc_params[cc_par_cnt++] = "-D_FORTIFY_SOURCE=2";
-
- }
-
- if (asan_set) {
-
- /* Pass this on to afl-as to adjust map density. */
-
- setenv("AFL_USE_ASAN", "1", 1);
-
- } else if (getenv("AFL_USE_ASAN")) {
-
- if (getenv("AFL_USE_MSAN"))
- FATAL("ASAN and MSAN are mutually exclusive");
-
- if (getenv("AFL_HARDEN"))
- FATAL("ASAN and AFL_HARDEN are mutually exclusive");
-
- cc_params[cc_par_cnt++] = "-U_FORTIFY_SOURCE";
- cc_params[cc_par_cnt++] = "-fsanitize=address";
-
- } else if (getenv("AFL_USE_MSAN")) {
-
- if (getenv("AFL_USE_ASAN"))
- FATAL("ASAN and MSAN are mutually exclusive");
-
- if (getenv("AFL_HARDEN"))
- FATAL("MSAN and AFL_HARDEN are mutually exclusive");
-
- cc_params[cc_par_cnt++] = "-U_FORTIFY_SOURCE";
- cc_params[cc_par_cnt++] = "-fsanitize=memory";
-
-
- }
-
- if (!getenv("AFL_DONT_OPTIMIZE")) {
-
-#if defined(__FreeBSD__) && defined(__x86_64__)
-
- /* On 64-bit FreeBSD systems, clang -g -m32 is broken, but -m32 itself
- works OK. This has nothing to do with us, but let's avoid triggering
- that bug. */
-
- if (!clang_mode || !m32_set)
- cc_params[cc_par_cnt++] = "-g";
-
-#else
-
- cc_params[cc_par_cnt++] = "-g";
-
-#endif
-
- cc_params[cc_par_cnt++] = "-O3";
- cc_params[cc_par_cnt++] = "-funroll-loops";
-
- /* Two indicators that you're building for fuzzing; one of them is
- AFL-specific, the other is shared with libfuzzer. */
-
- cc_params[cc_par_cnt++] = "-D__AFL_COMPILER=1";
- cc_params[cc_par_cnt++] = "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1";
-
- }
-
- if (getenv("AFL_NO_BUILTIN")) {
-
- cc_params[cc_par_cnt++] = "-fno-builtin-strcmp";
- cc_params[cc_par_cnt++] = "-fno-builtin-strncmp";
- cc_params[cc_par_cnt++] = "-fno-builtin-strcasecmp";
- cc_params[cc_par_cnt++] = "-fno-builtin-strncasecmp";
- cc_params[cc_par_cnt++] = "-fno-builtin-memcmp";
-
- }
-
- cc_params[cc_par_cnt] = NULL;
-
-}
-
-
-/* Main entry point */
-
-int main(int argc, char** argv) {
-
- if (isatty(2) && !getenv("AFL_QUIET")) {
-
- SAYF(cCYA "afl-cc " cBRI VERSION cRST " by <lcamtuf@google.com>\n");
-
- } else be_quiet = 1;
-
- if (argc < 2) {
-
- SAYF("\n"
- "This is a helper application for afl-fuzz. It serves as a drop-in replacement\n"
- "for gcc or clang, letting you recompile third-party code with the required\n"
- "runtime instrumentation. A common use pattern would be one of the following:\n\n"
-
- " CC=%s/afl-gcc ./configure\n"
- " CXX=%s/afl-g++ ./configure\n\n"
-
- "You can specify custom next-stage toolchain via AFL_CC, AFL_CXX, and AFL_AS.\n"
- "Setting AFL_HARDEN enables hardening optimizations in the compiled code.\n\n",
- BIN_PATH, BIN_PATH);
-
- exit(1);
-
- }
-
- find_as(argv[0]);
-
- edit_params(argc, argv);
-
- execvp(cc_params[0], (char**)cc_params);
-
- FATAL("Oops, failed to execute '%s' - check your PATH", cc_params[0]);
-
- return 0;
-
-}
diff --git a/chromium/third_party/afl/src/afl-gotcpu.c b/chromium/third_party/afl/src/afl-gotcpu.c
deleted file mode 100644
index c296993bf50..00000000000
--- a/chromium/third_party/afl/src/afl-gotcpu.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- american fuzzy lop - free CPU gizmo
- -----------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This tool provides a fairly accurate measurement of CPU preemption rate.
- It is meant to complement the quick-and-dirty load average widget shown
- in the afl-fuzz UI. See docs/parallel_fuzzing.txt for more info.
-
- For some work loads, the tool may actually suggest running more instances
- than you have CPU cores. This can happen if the tested program is spending
- a portion of its run time waiting for I/O, rather than being 100%
- CPU-bound.
-
- The idea for the getrusage()-based approach comes from Jakub Wilk.
-
- */
-
-#define AFL_MAIN
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sched.h>
-
-#include <sys/time.h>
-#include <sys/times.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-
-#include "types.h"
-#include "debug.h"
-
-#ifdef __linux__
-# define HAVE_AFFINITY 1
-#endif /* __linux__ */
-
-
-/* Get unix time in microseconds. */
-
-static u64 get_cur_time_us(void) {
-
- struct timeval tv;
- struct timezone tz;
-
- gettimeofday(&tv, &tz);
-
- return (tv.tv_sec * 1000000ULL) + tv.tv_usec;
-
-}
-
-
-/* Get CPU usage in microseconds. */
-
-static u64 get_cpu_usage_us(void) {
-
- struct rusage u;
-
- getrusage(RUSAGE_SELF, &u);
-
- return (u.ru_utime.tv_sec * 1000000ULL) + u.ru_utime.tv_usec +
- (u.ru_stime.tv_sec * 1000000ULL) + u.ru_stime.tv_usec;
-
-}
-
-
-/* Measure preemption rate. */
-
-static u32 measure_preemption(u32 target_ms) {
-
- static volatile u32 v1, v2;
-
- u64 st_t, en_t, st_c, en_c, real_delta, slice_delta;
- s32 loop_repeats = 0;
-
- st_t = get_cur_time_us();
- st_c = get_cpu_usage_us();
-
-repeat_loop:
-
- v1 = CTEST_BUSY_CYCLES;
-
- while (v1--) v2++;
- sched_yield();
-
- en_t = get_cur_time_us();
-
- if (en_t - st_t < target_ms * 1000) {
- loop_repeats++;
- goto repeat_loop;
- }
-
- /* Let's see what percentage of this time we actually had a chance to
- run, and how much time was spent in the penalty box. */
-
- en_c = get_cpu_usage_us();
-
- real_delta = (en_t - st_t) / 1000;
- slice_delta = (en_c - st_c) / 1000;
-
- return real_delta * 100 / slice_delta;
-
-}
-
-
-/* Do the benchmark thing. */
-
-int main(int argc, char** argv) {
-
-#ifdef HAVE_AFFINITY
-
- u32 cpu_cnt = sysconf(_SC_NPROCESSORS_ONLN),
- idle_cpus = 0, maybe_cpus = 0, i;
-
- SAYF(cCYA "afl-gotcpu " cBRI VERSION cRST " by <lcamtuf@google.com>\n");
-
- ACTF("Measuring per-core preemption rate (this will take %0.02f sec)...",
- ((double)CTEST_CORE_TRG_MS) / 1000);
-
- for (i = 0; i < cpu_cnt; i++) {
-
- s32 fr = fork();
-
- if (fr < 0) PFATAL("fork failed");
-
- if (!fr) {
-
- cpu_set_t c;
- u32 util_perc;
-
- CPU_ZERO(&c);
- CPU_SET(i, &c);
-
- if (sched_setaffinity(0, sizeof(c), &c))
- PFATAL("sched_setaffinity failed");
-
- util_perc = measure_preemption(CTEST_CORE_TRG_MS);
-
- if (util_perc < 110) {
-
- SAYF(" Core #%u: " cLGN "AVAILABLE\n" cRST, i);
- exit(0);
-
- } else if (util_perc < 250) {
-
- SAYF(" Core #%u: " cYEL "CAUTION " cRST "(%u%%)\n", i, util_perc);
- exit(1);
-
- }
-
- SAYF(" Core #%u: " cLRD "OVERBOOKED " cRST "(%u%%)\n" cRST, i,
- util_perc);
- exit(2);
-
- }
-
- }
-
- for (i = 0; i < cpu_cnt; i++) {
-
- int ret;
- if (waitpid(-1, &ret, 0) < 0) PFATAL("waitpid failed");
-
- if (WEXITSTATUS(ret) == 0) idle_cpus++;
- if (WEXITSTATUS(ret) <= 1) maybe_cpus++;
-
- }
-
- SAYF(cGRA "\n>>> ");
-
- if (idle_cpus) {
-
- if (maybe_cpus == idle_cpus) {
-
- SAYF(cLGN "PASS: " cRST "You can run more processes on %u core%s.",
- idle_cpus, idle_cpus > 1 ? "s" : "");
-
- } else {
-
- SAYF(cLGN "PASS: " cRST "You can run more processes on %u to %u core%s.",
- idle_cpus, maybe_cpus, maybe_cpus > 1 ? "s" : "");
-
- }
-
- SAYF(cGRA " <<<" cRST "\n\n");
- return 0;
-
- }
-
- if (maybe_cpus) {
-
- SAYF(cYEL "CAUTION: " cRST "You may still have %u core%s available.",
- maybe_cpus, maybe_cpus > 1 ? "s" : "");
- SAYF(cGRA " <<<" cRST "\n\n");
- return 1;
-
- }
-
- SAYF(cLRD "FAIL: " cRST "All cores are overbooked.");
- SAYF(cGRA " <<<" cRST "\n\n");
- return 2;
-
-#else
-
- u32 util_perc;
-
- SAYF(cCYA "afl-gotcpu " cBRI VERSION cRST " by <lcamtuf@google.com>\n");
-
- /* Run a busy loop for CTEST_TARGET_MS. */
-
- ACTF("Measuring gross preemption rate (this will take %0.02f sec)...",
- ((double)CTEST_TARGET_MS) / 1000);
-
- util_perc = measure_preemption(CTEST_TARGET_MS);
-
- /* Deliver the final verdict. */
-
- SAYF(cGRA "\n>>> ");
-
- if (util_perc < 105) {
-
- SAYF(cLGN "PASS: " cRST "You can probably run additional processes.");
-
- } else if (util_perc < 130) {
-
- SAYF(cYEL "CAUTION: " cRST "Your CPU may be somewhat overbooked (%u%%).",
- util_perc);
-
- } else {
-
- SAYF(cLRD "FAIL: " cRST "Your CPU is overbooked (%u%%).", util_perc);
-
- }
-
- SAYF(cGRA " <<<" cRST "\n\n");
-
- return (util_perc > 105) + (util_perc > 130);
-
-#endif /* ^HAVE_AFFINITY */
-
-}
diff --git a/chromium/third_party/afl/src/afl-plot b/chromium/third_party/afl/src/afl-plot
deleted file mode 100755
index 3bd93590acd..00000000000
--- a/chromium/third_party/afl/src/afl-plot
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/bin/sh
-#
-# american fuzzy lop - Advanced Persistent Graphing
-# -------------------------------------------------
-#
-# Written and maintained by Michal Zalewski <lcamtuf@google.com>
-# Based on a design & prototype by Michael Rash.
-#
-# Copyright 2014, 2015 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-
-echo "progress plotting utility for afl-fuzz by <lcamtuf@google.com>"
-echo
-
-if [ ! "$#" = "2" ]; then
-
- cat 1>&2 <<_EOF_
-This program generates gnuplot images from afl-fuzz output data. Usage:
-
-$0 afl_state_dir graph_output_dir
-
-The afl_state_dir parameter should point to an existing state directory for any
-active or stopped instance of afl-fuzz; while graph_output_dir should point to
-an empty directory where this tool can write the resulting plots to.
-
-The program will put index.html and three PNG images in the output directory;
-you should be able to view it with any web browser of your choice.
-
-_EOF_
-
- exit 1
-
-fi
-
-echo "$1" | grep -qE '^(/var)?/tmp/'
-T1="$?"
-
-echo "$2" | grep -qE '^(/var)?/tmp/'
-T2="$?"
-
-if [ "$T1" = "0" -o "$T2" = "0" ]; then
-
- echo "[-] Error: this script shouldn't be used with shared /tmp directories." 1>&2
- exit 1
-
-fi
-
-if [ ! -f "$1/plot_data" ]; then
-
- echo "[-] Error: input directory is not valid (missing 'plot_data')." 1>&2
- exit 1
-
-fi
-
-BANNER="`cat "$1/fuzzer_stats" | grep '^afl_banner ' | cut -d: -f2- | cut -b2-`"
-
-test "$BANNER" = "" && BANNER="(none)"
-
-GNUPLOT=`which gnuplot 2>/dev/null`
-
-if [ "$GNUPLOT" = "" ]; then
-
- echo "[-] Error: can't find 'gnuplot' in your \$PATH." 1>&2
- exit 1
-
-fi
-
-mkdir "$2" 2>/dev/null
-
-if [ ! -d "$2" ]; then
-
- echo "[-] Error: unable to create the output directory - pick another location." 1>&2
- exit 1
-
-fi
-
-rm -f "$2/high_freq.png" "$2/low_freq.png" "$2/exec_speed.png"
-mv -f "$2/index.html" "$2/index.html.orig" 2>/dev/null
-
-echo "[*] Generating plots..."
-
-(
-
-cat <<_EOF_
-set terminal png truecolor enhanced size 1000,300 butt
-
-set output '$2/high_freq.png'
-
-set xdata time
-set timefmt '%s'
-set format x "%b %d\n%H:%M"
-set tics font 'small'
-unset mxtics
-unset mytics
-
-set grid xtics linetype 0 linecolor rgb '#e0e0e0'
-set grid ytics linetype 0 linecolor rgb '#e0e0e0'
-set border linecolor rgb '#50c0f0'
-set tics textcolor rgb '#000000'
-set key outside
-
-set autoscale xfixmin
-set autoscale xfixmax
-
-plot '$1/plot_data' using 1:4 with filledcurve x1 title 'total paths' linecolor rgb '#000000' fillstyle transparent solid 0.2 noborder, \\
- '' using 1:3 with filledcurve x1 title 'current path' linecolor rgb '#f0f0f0' fillstyle transparent solid 0.5 noborder, \\
- '' using 1:5 with lines title 'pending paths' linecolor rgb '#0090ff' linewidth 3, \\
- '' using 1:6 with lines title 'pending favs' linecolor rgb '#c00080' linewidth 3, \\
- '' using 1:2 with lines title 'cycles done' linecolor rgb '#c000f0' linewidth 3
-
-set terminal png truecolor enhanced size 1000,200 butt
-set output '$2/low_freq.png'
-
-plot '$1/plot_data' using 1:8 with filledcurve x1 title '' linecolor rgb '#c00080' fillstyle transparent solid 0.2 noborder, \\
- '' using 1:8 with lines title ' uniq crashes' linecolor rgb '#c00080' linewidth 3, \\
- '' using 1:9 with lines title 'uniq hangs' linecolor rgb '#c000f0' linewidth 3, \\
- '' using 1:10 with lines title 'levels' linecolor rgb '#0090ff' linewidth 3
-
-set terminal png truecolor enhanced size 1000,200 butt
-set output '$2/exec_speed.png'
-
-plot '$1/plot_data' using 1:11 with filledcurve x1 title '' linecolor rgb '#0090ff' fillstyle transparent solid 0.2 noborder, \\
- '$1/plot_data' using 1:11 with lines title ' execs/sec' linecolor rgb '#0090ff' linewidth 3 smooth bezier;
-
-_EOF_
-
-) | gnuplot
-
-if [ ! -s "$2/exec_speed.png" ]; then
-
- echo "[-] Error: something went wrong! Perhaps you have an ancient version of gnuplot?" 1>&2
- exit 1
-
-fi
-
-echo "[*] Generating index.html..."
-
-cat >"$2/index.html" <<_EOF_
-<table style="font-family: 'Trebuchet MS', 'Tahoma', 'Arial', 'Helvetica'">
-<tr><td style="width: 18ex"><b>Banner:</b></td><td>$BANNER</td></tr>
-<tr><td><b>Directory:</b></td><td>$1</td></tr>
-<tr><td><b>Generated on:</b></td><td>`date`</td></tr>
-</table>
-<p>
-<img src="high_freq.png" width=1000 height=300><p>
-<img src="low_freq.png" width=1000 height=200><p>
-<img src="exec_speed.png" width=1000 height=200>
-
-_EOF_
-
-# Make it easy to remotely view results when outputting directly to a directory
-# served by Apache or other HTTP daemon. Since the plots aren't horribly
-# sensitive, this seems like a reasonable trade-off.
-
-chmod 755 "$2"
-chmod 644 "$2/high_freq.png" "$2/low_freq.png" "$2/exec_speed.png" "$2/index.html"
-
-echo "[+] All done - enjoy your charts!"
-
-exit 0
diff --git a/chromium/third_party/afl/src/afl-showmap.c b/chromium/third_party/afl/src/afl-showmap.c
deleted file mode 100644
index 4b81862a27e..00000000000
--- a/chromium/third_party/afl/src/afl-showmap.c
+++ /dev/null
@@ -1,763 +0,0 @@
-/*
- american fuzzy lop - map display utility
- ----------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- A very simple tool that runs the targeted binary and displays
- the contents of the trace bitmap in a human-readable form. Useful in
- scripts to eliminate redundant inputs and perform other checks.
-
- Exit code is 2 if the target program crashes; 1 if it times out or
- there is a problem executing it; or 0 if execution is successful.
-
- */
-
-#define AFL_MAIN
-
-#include "config.h"
-#include "types.h"
-#include "debug.h"
-#include "alloc-inl.h"
-#include "hash.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-#include <dirent.h>
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <sys/shm.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-
-static s32 child_pid; /* PID of the tested program */
-
-static u8* trace_bits; /* SHM with instrumentation bitmap */
-
-static u8 *out_file, /* Trace output file */
- *doc_path, /* Path to docs */
- *target_path, /* Path to target binary */
- *at_file; /* Substitution string for @@ */
-
-static u32 exec_tmout; /* Exec timeout (ms) */
-
-static u64 mem_limit = MEM_LIMIT; /* Memory limit (MB) */
-
-static s32 shm_id; /* ID of the SHM region */
-
-static u8 quiet_mode, /* Hide non-essential messages? */
- edges_only, /* Ignore hit counts? */
- cmin_mode, /* Generate output in afl-cmin mode? */
- binary_mode; /* Write output as a binary map */
-
-static volatile u8
- stop_soon, /* Ctrl-C pressed? */
- child_timed_out, /* Child timed out? */
- child_crashed; /* Child crashed? */
-
-/* Classify tuple counts. Instead of mapping to individual bits, as in
- afl-fuzz.c, we map to more user-friendly numbers between 1 and 8. */
-
-static const u8 count_class_human[256] = {
-
- [0] = 0,
- [1] = 1,
- [2] = 2,
- [3] = 3,
- [4 ... 7] = 4,
- [8 ... 15] = 5,
- [16 ... 31] = 6,
- [32 ... 127] = 7,
- [128 ... 255] = 8
-
-};
-
-static const u8 count_class_binary[256] = {
-
- [0] = 0,
- [1] = 1,
- [2] = 2,
- [3] = 4,
- [4 ... 7] = 8,
- [8 ... 15] = 16,
- [16 ... 31] = 32,
- [32 ... 127] = 64,
- [128 ... 255] = 128
-
-};
-
-static void classify_counts(u8* mem, const u8* map) {
-
- u32 i = MAP_SIZE;
-
- if (edges_only) {
-
- while (i--) {
- if (*mem) *mem = 1;
- mem++;
- }
-
- } else {
-
- while (i--) {
- *mem = map[*mem];
- mem++;
- }
-
- }
-
-}
-
-
-/* Get rid of shared memory (atexit handler). */
-
-static void remove_shm(void) {
-
- shmctl(shm_id, IPC_RMID, NULL);
-
-}
-
-
-/* Configure shared memory. */
-
-static void setup_shm(void) {
-
- u8* shm_str;
-
- shm_id = shmget(IPC_PRIVATE, MAP_SIZE, IPC_CREAT | IPC_EXCL | 0600);
-
- if (shm_id < 0) PFATAL("shmget() failed");
-
- atexit(remove_shm);
-
- shm_str = alloc_printf("%d", shm_id);
-
- setenv(SHM_ENV_VAR, shm_str, 1);
-
- ck_free(shm_str);
-
- trace_bits = shmat(shm_id, NULL, 0);
-
- if (!trace_bits) PFATAL("shmat() failed");
-
-}
-
-/* Write results. */
-
-static u32 write_results(void) {
-
- s32 fd;
- u32 i, ret = 0;
-
- u8 cco = !!getenv("AFL_CMIN_CRASHES_ONLY"),
- caa = !!getenv("AFL_CMIN_ALLOW_ANY");
-
- if (!strncmp(out_file, "/dev/", 5)) {
-
- fd = open(out_file, O_WRONLY, 0600);
- if (fd < 0) PFATAL("Unable to open '%s'", out_file);
-
- } else if (!strcmp(out_file, "-")) {
-
- fd = dup(1);
- if (fd < 0) PFATAL("Unable to open stdout");
-
- } else {
-
- unlink(out_file); /* Ignore errors */
- fd = open(out_file, O_WRONLY | O_CREAT | O_EXCL, 0600);
- if (fd < 0) PFATAL("Unable to create '%s'", out_file);
-
- }
-
-
- if (binary_mode) {
-
- for (i = 0; i < MAP_SIZE; i++)
- if (trace_bits[i]) ret++;
-
- ck_write(fd, trace_bits, MAP_SIZE, out_file);
- close(fd);
-
- } else {
-
- FILE* f = fdopen(fd, "w");
-
- if (!f) PFATAL("fdopen() failed");
-
- for (i = 0; i < MAP_SIZE; i++) {
-
- if (!trace_bits[i]) continue;
- ret++;
-
- if (cmin_mode) {
-
- if (child_timed_out) break;
- if (!caa && child_crashed != cco) break;
-
- fprintf(f, "%u%u\n", trace_bits[i], i);
-
- } else fprintf(f, "%06u:%u\n", i, trace_bits[i]);
-
- }
-
- fclose(f);
-
- }
-
- return ret;
-
-}
-
-
-/* Handle timeout signal. */
-
-static void handle_timeout(int sig) {
-
- child_timed_out = 1;
- if (child_pid > 0) kill(child_pid, SIGKILL);
-
-}
-
-
-/* Execute target application. */
-
-static void run_target(char** argv) {
-
- static struct itimerval it;
- int status = 0;
-
- if (!quiet_mode)
- SAYF("-- Program output begins --\n" cRST);
-
- MEM_BARRIER();
-
- child_pid = fork();
-
- if (child_pid < 0) PFATAL("fork() failed");
-
- if (!child_pid) {
-
- struct rlimit r;
-
- if (quiet_mode) {
-
- s32 fd = open("/dev/null", O_RDWR);
-
- if (fd < 0 || dup2(fd, 1) < 0 || dup2(fd, 2) < 0) {
- *(u32*)trace_bits = EXEC_FAIL_SIG;
- PFATAL("Descriptor initialization failed");
- }
-
- close(fd);
-
- }
-
- if (mem_limit) {
-
- r.rlim_max = r.rlim_cur = ((rlim_t)mem_limit) << 20;
-
-#ifdef RLIMIT_AS
-
- setrlimit(RLIMIT_AS, &r); /* Ignore errors */
-
-#else
-
- setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
-
-#endif /* ^RLIMIT_AS */
-
- }
-
- r.rlim_max = r.rlim_cur = 0;
- setrlimit(RLIMIT_CORE, &r); /* Ignore errors */
-
- execv(target_path, argv);
-
- *(u32*)trace_bits = EXEC_FAIL_SIG;
- exit(0);
-
- }
-
- /* Configure timeout, wait for child, cancel timeout. */
-
- if (exec_tmout) {
-
- child_timed_out = 0;
- it.it_value.tv_sec = (exec_tmout / 1000);
- it.it_value.tv_usec = (exec_tmout % 1000) * 1000;
-
- }
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- if (waitpid(child_pid, &status, 0) <= 0) FATAL("waitpid() failed");
-
- child_pid = 0;
- it.it_value.tv_sec = 0;
- it.it_value.tv_usec = 0;
- setitimer(ITIMER_REAL, &it, NULL);
-
- MEM_BARRIER();
-
- /* Clean up bitmap, analyze exit condition, etc. */
-
- if (*(u32*)trace_bits == EXEC_FAIL_SIG)
- FATAL("Unable to execute '%s'", argv[0]);
-
- classify_counts(trace_bits, binary_mode ?
- count_class_binary : count_class_human);
-
- if (!quiet_mode)
- SAYF(cRST "-- Program output ends --\n");
-
- if (!child_timed_out && !stop_soon && WIFSIGNALED(status))
- child_crashed = 1;
-
- if (!quiet_mode) {
-
- if (child_timed_out)
- SAYF(cLRD "\n+++ Program timed off +++\n" cRST);
- else if (stop_soon)
- SAYF(cLRD "\n+++ Program aborted by user +++\n" cRST);
- else if (child_crashed)
- SAYF(cLRD "\n+++ Program killed by signal %u +++\n" cRST, WTERMSIG(status));
-
- }
-
-
-}
-
-
-/* Handle Ctrl-C and the like. */
-
-static void handle_stop_sig(int sig) {
-
- stop_soon = 1;
-
- if (child_pid > 0) kill(child_pid, SIGKILL);
-
-}
-
-
-/* Do basic preparations - persistent fds, filenames, etc. */
-
-static void set_up_environment(void) {
-
- setenv("ASAN_OPTIONS", "abort_on_error=1:"
- "detect_leaks=0:"
- "symbolize=0:"
- "allocator_may_return_null=1", 0);
-
- setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":"
- "symbolize=0:"
- "abort_on_error=1:"
- "allocator_may_return_null=1:"
- "msan_track_origins=0", 0);
-
- if (getenv("AFL_PRELOAD")) {
- setenv("LD_PRELOAD", getenv("AFL_PRELOAD"), 1);
- setenv("DYLD_INSERT_LIBRARIES", getenv("AFL_PRELOAD"), 1);
- }
-
-}
-
-
-/* Setup signal handlers, duh. */
-
-static void setup_signal_handlers(void) {
-
- struct sigaction sa;
-
- sa.sa_handler = NULL;
- sa.sa_flags = SA_RESTART;
- sa.sa_sigaction = NULL;
-
- sigemptyset(&sa.sa_mask);
-
- /* Various ways of saying "stop". */
-
- sa.sa_handler = handle_stop_sig;
- sigaction(SIGHUP, &sa, NULL);
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
-
- /* Exec timeout notifications. */
-
- sa.sa_handler = handle_timeout;
- sigaction(SIGALRM, &sa, NULL);
-
-}
-
-
-/* Detect @@ in args. */
-
-static void detect_file_args(char** argv) {
-
- u32 i = 0;
- u8* cwd = getcwd(NULL, 0);
-
- if (!cwd) PFATAL("getcwd() failed");
-
- while (argv[i]) {
-
- u8* aa_loc = strstr(argv[i], "@@");
-
- if (aa_loc) {
-
- u8 *aa_subst, *n_arg;
-
- if (!at_file) FATAL("@@ syntax is not supported by this tool.");
-
- /* Be sure that we're always using fully-qualified paths. */
-
- if (at_file[0] == '/') aa_subst = at_file;
- else aa_subst = alloc_printf("%s/%s", cwd, at_file);
-
- /* Construct a replacement argv value. */
-
- *aa_loc = 0;
- n_arg = alloc_printf("%s%s%s", argv[i], aa_subst, aa_loc + 2);
- argv[i] = n_arg;
- *aa_loc = '@';
-
- if (at_file[0] != '/') ck_free(aa_subst);
-
- }
-
- i++;
-
- }
-
- free(cwd); /* not tracked */
-
-}
-
-
-/* Show banner. */
-
-static void show_banner(void) {
-
- SAYF(cCYA "afl-showmap " cBRI VERSION cRST " by <lcamtuf@google.com>\n");
-
-}
-
-/* Display usage hints. */
-
-static void usage(u8* argv0) {
-
- show_banner();
-
- SAYF("\n%s [ options ] -- /path/to/target_app [ ... ]\n\n"
-
- "Required parameters:\n\n"
-
- " -o file - file to write the trace data to\n\n"
-
- "Execution control settings:\n\n"
-
- " -t msec - timeout for each run (none)\n"
- " -m megs - memory limit for child process (%u MB)\n"
- " -Q - use binary-only instrumentation (QEMU mode)\n\n"
-
- "Other settings:\n\n"
-
- " -q - sink program's output and don't show messages\n"
- " -e - show edge coverage only, ignore hit counts\n\n"
-
- "This tool displays raw tuple data captured by AFL instrumentation.\n"
- "For additional help, consult %s/README.\n\n" cRST,
-
- argv0, MEM_LIMIT, doc_path);
-
- exit(1);
-
-}
-
-
-/* Find binary. */
-
-static void find_binary(u8* fname) {
-
- u8* env_path = 0;
- struct stat st;
-
- if (strchr(fname, '/') || !(env_path = getenv("PATH"))) {
-
- target_path = ck_strdup(fname);
-
- if (stat(target_path, &st) || !S_ISREG(st.st_mode) ||
- !(st.st_mode & 0111) || st.st_size < 4)
- FATAL("Program '%s' not found or not executable", fname);
-
- } else {
-
- while (env_path) {
-
- u8 *cur_elem, *delim = strchr(env_path, ':');
-
- if (delim) {
-
- cur_elem = ck_alloc(delim - env_path + 1);
- memcpy(cur_elem, env_path, delim - env_path);
- delim++;
-
- } else cur_elem = ck_strdup(env_path);
-
- env_path = delim;
-
- if (cur_elem[0])
- target_path = alloc_printf("%s/%s", cur_elem, fname);
- else
- target_path = ck_strdup(fname);
-
- ck_free(cur_elem);
-
- if (!stat(target_path, &st) && S_ISREG(st.st_mode) &&
- (st.st_mode & 0111) && st.st_size >= 4) break;
-
- ck_free(target_path);
- target_path = 0;
-
- }
-
- if (!target_path) FATAL("Program '%s' not found or not executable", fname);
-
- }
-
-}
-
-
-/* Fix up argv for QEMU. */
-
-static char** get_qemu_argv(u8* own_loc, char** argv, int argc) {
-
- char** new_argv = ck_alloc(sizeof(char*) * (argc + 4));
- u8 *tmp, *cp, *rsl, *own_copy;
-
- memcpy(new_argv + 3, argv + 1, sizeof(char*) * argc);
-
- new_argv[2] = target_path;
- new_argv[1] = "--";
-
- /* Now we need to actually find qemu for argv[0]. */
-
- tmp = getenv("AFL_PATH");
-
- if (tmp) {
-
- cp = alloc_printf("%s/afl-qemu-trace", tmp);
-
- if (access(cp, X_OK))
- FATAL("Unable to find '%s'", tmp);
-
- target_path = new_argv[0] = cp;
- return new_argv;
-
- }
-
- own_copy = ck_strdup(own_loc);
- rsl = strrchr(own_copy, '/');
-
- if (rsl) {
-
- *rsl = 0;
-
- cp = alloc_printf("%s/afl-qemu-trace", own_copy);
- ck_free(own_copy);
-
- if (!access(cp, X_OK)) {
-
- target_path = new_argv[0] = cp;
- return new_argv;
-
- }
-
- } else ck_free(own_copy);
-
- if (!access(BIN_PATH "/afl-qemu-trace", X_OK)) {
-
- target_path = new_argv[0] = BIN_PATH "/afl-qemu-trace";
- return new_argv;
-
- }
-
- FATAL("Unable to find 'afl-qemu-trace'.");
-
-}
-
-
-/* Main entry point */
-
-int main(int argc, char** argv) {
-
- s32 opt;
- u8 mem_limit_given = 0, timeout_given = 0, qemu_mode = 0;
- u32 tcnt;
- char** use_argv;
-
- doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
-
- while ((opt = getopt(argc,argv,"+o:m:t:A:eqZQb")) > 0)
-
- switch (opt) {
-
- case 'o':
-
- if (out_file) FATAL("Multiple -o options not supported");
- out_file = optarg;
- break;
-
- case 'm': {
-
- u8 suffix = 'M';
-
- if (mem_limit_given) FATAL("Multiple -m options not supported");
- mem_limit_given = 1;
-
- if (!strcmp(optarg, "none")) {
-
- mem_limit = 0;
- break;
-
- }
-
- if (sscanf(optarg, "%llu%c", &mem_limit, &suffix) < 1 ||
- optarg[0] == '-') FATAL("Bad syntax used for -m");
-
- switch (suffix) {
-
- case 'T': mem_limit *= 1024 * 1024; break;
- case 'G': mem_limit *= 1024; break;
- case 'k': mem_limit /= 1024; break;
- case 'M': break;
-
- default: FATAL("Unsupported suffix or bad syntax for -m");
-
- }
-
- if (mem_limit < 5) FATAL("Dangerously low value of -m");
-
- if (sizeof(rlim_t) == 4 && mem_limit > 2000)
- FATAL("Value of -m out of range on 32-bit systems");
-
- }
-
- break;
-
- case 't':
-
- if (timeout_given) FATAL("Multiple -t options not supported");
- timeout_given = 1;
-
- if (strcmp(optarg, "none")) {
- exec_tmout = atoi(optarg);
-
- if (exec_tmout < 20 || optarg[0] == '-')
- FATAL("Dangerously low value of -t");
-
- }
-
- break;
-
- case 'e':
-
- if (edges_only) FATAL("Multiple -e options not supported");
- edges_only = 1;
- break;
-
- case 'q':
-
- if (quiet_mode) FATAL("Multiple -q options not supported");
- quiet_mode = 1;
- break;
-
- case 'Z':
-
- /* This is an undocumented option to write data in the syntax expected
- by afl-cmin. Nobody else should have any use for this. */
-
- cmin_mode = 1;
- quiet_mode = 1;
- break;
-
- case 'A':
-
- /* Another afl-cmin specific feature. */
- at_file = optarg;
- break;
-
- case 'Q':
-
- if (qemu_mode) FATAL("Multiple -Q options not supported");
- if (!mem_limit_given) mem_limit = MEM_LIMIT_QEMU;
-
- qemu_mode = 1;
- break;
-
- case 'b':
-
- /* Secret undocumented mode. Writes output in raw binary format
- similar to that dumped by afl-fuzz in <out_dir/queue/fuzz_bitmap. */
-
- binary_mode = 1;
- break;
-
- default:
-
- usage(argv[0]);
-
- }
-
- if (optind == argc || !out_file) usage(argv[0]);
-
- setup_shm();
- setup_signal_handlers();
-
- set_up_environment();
-
- find_binary(argv[optind]);
-
- if (!quiet_mode) {
- show_banner();
- ACTF("Executing '%s'...\n", target_path);
- }
-
- detect_file_args(argv + optind);
-
- if (qemu_mode)
- use_argv = get_qemu_argv(argv[0], argv + optind, argc - optind);
- else
- use_argv = argv + optind;
-
- run_target(use_argv);
-
- tcnt = write_results();
-
- if (!quiet_mode) {
-
- if (!tcnt) FATAL("No instrumentation detected" cRST);
- OKF("Captured %u tuples in '%s'." cRST, tcnt, out_file);
-
- }
-
- exit(child_crashed * 2 + child_timed_out);
-
-}
-
diff --git a/chromium/third_party/afl/src/afl-tmin.c b/chromium/third_party/afl/src/afl-tmin.c
deleted file mode 100644
index c1abbe7c708..00000000000
--- a/chromium/third_party/afl/src/afl-tmin.c
+++ /dev/null
@@ -1,1141 +0,0 @@
-/*
- american fuzzy lop - test case minimizer
- ----------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- A simple test case minimizer that takes an input file and tries to remove
- as much data as possible while keeping the binary in a crashing state
- *or* producing consistent instrumentation output (the mode is auto-selected
- based on the initially observed behavior).
-
- */
-
-#define AFL_MAIN
-
-#include "config.h"
-#include "types.h"
-#include "debug.h"
-#include "alloc-inl.h"
-#include "hash.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <errno.h>
-#include <signal.h>
-#include <dirent.h>
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <sys/shm.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/resource.h>
-
-static s32 child_pid; /* PID of the tested program */
-
-static u8 *trace_bits, /* SHM with instrumentation bitmap */
- *mask_bitmap; /* Mask for trace bits (-B) */
-
-static u8 *in_file, /* Minimizer input test case */
- *out_file, /* Minimizer output file */
- *prog_in, /* Targeted program input file */
- *target_path, /* Path to target binary */
- *doc_path; /* Path to docs */
-
-static u8* in_data; /* Input data for trimming */
-
-static u32 in_len, /* Input data length */
- orig_cksum, /* Original checksum */
- total_execs, /* Total number of execs */
- missed_hangs, /* Misses due to hangs */
- missed_crashes, /* Misses due to crashes */
- missed_paths, /* Misses due to exec path diffs */
- exec_tmout = EXEC_TIMEOUT; /* Exec timeout (ms) */
-
-static u64 mem_limit = MEM_LIMIT; /* Memory limit (MB) */
-
-static s32 shm_id, /* ID of the SHM region */
- dev_null_fd = -1; /* FD to /dev/null */
-
-static u8 crash_mode, /* Crash-centric mode? */
- exit_crash, /* Treat non-zero exit as crash? */
- edges_only, /* Ignore hit counts? */
- use_stdin = 1; /* Use stdin for program input? */
-
-static volatile u8
- stop_soon, /* Ctrl-C pressed? */
- child_timed_out; /* Child timed out? */
-
-
-/* Classify tuple counts. This is a slow & naive version, but good enough here. */
-
-static const u8 count_class_lookup[256] = {
-
- [0] = 0,
- [1] = 1,
- [2] = 2,
- [3] = 4,
- [4 ... 7] = 8,
- [8 ... 15] = 16,
- [16 ... 31] = 32,
- [32 ... 127] = 64,
- [128 ... 255] = 128
-
-};
-
-static void classify_counts(u8* mem) {
-
- u32 i = MAP_SIZE;
-
- if (edges_only) {
-
- while (i--) {
- if (*mem) *mem = 1;
- mem++;
- }
-
- } else {
-
- while (i--) {
- *mem = count_class_lookup[*mem];
- mem++;
- }
-
- }
-
-}
-
-
-/* Apply mask to classified bitmap (if set). */
-
-static void apply_mask(u32* mem, u32* mask) {
-
- u32 i = (MAP_SIZE >> 2);
-
- if (!mask) return;
-
- while (i--) {
-
- *mem &= ~*mask;
- mem++;
- mask++;
-
- }
-
-}
-
-
-/* See if any bytes are set in the bitmap. */
-
-static inline u8 anything_set(void) {
-
- u32* ptr = (u32*)trace_bits;
- u32 i = (MAP_SIZE >> 2);
-
- while (i--) if (*(ptr++)) return 1;
-
- return 0;
-
-}
-
-
-
-/* Get rid of shared memory and temp files (atexit handler). */
-
-static void remove_shm(void) {
-
- unlink(prog_in); /* Ignore errors */
- shmctl(shm_id, IPC_RMID, NULL);
-
-}
-
-
-/* Configure shared memory. */
-
-static void setup_shm(void) {
-
- u8* shm_str;
-
- shm_id = shmget(IPC_PRIVATE, MAP_SIZE, IPC_CREAT | IPC_EXCL | 0600);
-
- if (shm_id < 0) PFATAL("shmget() failed");
-
- atexit(remove_shm);
-
- shm_str = alloc_printf("%d", shm_id);
-
- setenv(SHM_ENV_VAR, shm_str, 1);
-
- ck_free(shm_str);
-
- trace_bits = shmat(shm_id, NULL, 0);
-
- if (!trace_bits) PFATAL("shmat() failed");
-
-}
-
-
-/* Read initial file. */
-
-static void read_initial_file(void) {
-
- struct stat st;
- s32 fd = open(in_file, O_RDONLY);
-
- if (fd < 0) PFATAL("Unable to open '%s'", in_file);
-
- if (fstat(fd, &st) || !st.st_size)
- FATAL("Zero-sized input file.");
-
- if (st.st_size >= TMIN_MAX_FILE)
- FATAL("Input file is too large (%u MB max)", TMIN_MAX_FILE / 1024 / 1024);
-
- in_len = st.st_size;
- in_data = ck_alloc_nozero(in_len);
-
- ck_read(fd, in_data, in_len, in_file);
-
- close(fd);
-
- OKF("Read %u byte%s from '%s'.", in_len, in_len == 1 ? "" : "s", in_file);
-
-}
-
-
-/* Write output file. */
-
-static s32 write_to_file(u8* path, u8* mem, u32 len) {
-
- s32 ret;
-
- unlink(path); /* Ignore errors */
-
- ret = open(path, O_RDWR | O_CREAT | O_EXCL, 0600);
-
- if (ret < 0) PFATAL("Unable to create '%s'", path);
-
- ck_write(ret, mem, len, path);
-
- lseek(ret, 0, SEEK_SET);
-
- return ret;
-
-}
-
-
-/* Handle timeout signal. */
-
-static void handle_timeout(int sig) {
-
- child_timed_out = 1;
- if (child_pid > 0) kill(child_pid, SIGKILL);
-
-}
-
-
-/* Execute target application. Returns 0 if the changes are a dud, or
- 1 if they should be kept. */
-
-static u8 run_target(char** argv, u8* mem, u32 len, u8 first_run) {
-
- static struct itimerval it;
- int status = 0;
-
- s32 prog_in_fd;
- u32 cksum;
-
- memset(trace_bits, 0, MAP_SIZE);
- MEM_BARRIER();
-
- prog_in_fd = write_to_file(prog_in, mem, len);
-
- child_pid = fork();
-
- if (child_pid < 0) PFATAL("fork() failed");
-
- if (!child_pid) {
-
- struct rlimit r;
-
- if (dup2(use_stdin ? prog_in_fd : dev_null_fd, 0) < 0 ||
- dup2(dev_null_fd, 1) < 0 ||
- dup2(dev_null_fd, 2) < 0) {
-
- *(u32*)trace_bits = EXEC_FAIL_SIG;
- PFATAL("dup2() failed");
-
- }
-
- close(dev_null_fd);
- close(prog_in_fd);
-
- if (mem_limit) {
-
- r.rlim_max = r.rlim_cur = ((rlim_t)mem_limit) << 20;
-
-#ifdef RLIMIT_AS
-
- setrlimit(RLIMIT_AS, &r); /* Ignore errors */
-
-#else
-
- setrlimit(RLIMIT_DATA, &r); /* Ignore errors */
-
-#endif /* ^RLIMIT_AS */
-
- }
-
- r.rlim_max = r.rlim_cur = 0;
- setrlimit(RLIMIT_CORE, &r); /* Ignore errors */
-
- execv(target_path, argv);
-
- *(u32*)trace_bits = EXEC_FAIL_SIG;
- exit(0);
-
- }
-
- close(prog_in_fd);
-
- /* Configure timeout, wait for child, cancel timeout. */
-
- child_timed_out = 0;
- it.it_value.tv_sec = (exec_tmout / 1000);
- it.it_value.tv_usec = (exec_tmout % 1000) * 1000;
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- if (waitpid(child_pid, &status, 0) <= 0) FATAL("waitpid() failed");
-
- child_pid = 0;
- it.it_value.tv_sec = 0;
- it.it_value.tv_usec = 0;
-
- setitimer(ITIMER_REAL, &it, NULL);
-
- MEM_BARRIER();
-
- /* Clean up bitmap, analyze exit condition, etc. */
-
- if (*(u32*)trace_bits == EXEC_FAIL_SIG)
- FATAL("Unable to execute '%s'", argv[0]);
-
- classify_counts(trace_bits);
- apply_mask((u32*)trace_bits, (u32*)mask_bitmap);
- total_execs++;
-
- if (stop_soon) {
- SAYF(cRST cLRD "\n+++ Minimization aborted by user +++\n" cRST);
- exit(1);
- }
-
- /* Always discard inputs that time out. */
-
- if (child_timed_out) {
-
- missed_hangs++;
- return 0;
-
- }
-
- /* Handle crashing inputs depending on current mode. */
-
- if (WIFSIGNALED(status) ||
- (WIFEXITED(status) && WEXITSTATUS(status) == MSAN_ERROR) ||
- (WIFEXITED(status) && WEXITSTATUS(status) && exit_crash)) {
-
- if (first_run) crash_mode = 1;
-
- if (crash_mode) {
-
- return 1;
-
- } else {
-
- missed_crashes++;
- return 0;
-
- }
-
- }
-
- /* Handle non-crashing inputs appropriately. */
-
- if (crash_mode) {
-
- missed_paths++;
- return 0;
-
- }
-
- cksum = hash32(trace_bits, MAP_SIZE, HASH_CONST);
-
- if (first_run) orig_cksum = cksum;
-
- if (orig_cksum == cksum) return 1;
-
- missed_paths++;
- return 0;
-
-}
-
-
-/* Find first power of two greater or equal to val. */
-
-static u32 next_p2(u32 val) {
-
- u32 ret = 1;
- while (val > ret) ret <<= 1;
- return ret;
-
-}
-
-
-/* Actually minimize! */
-
-static void minimize(char** argv) {
-
- static u32 alpha_map[256];
-
- u8* tmp_buf = ck_alloc_nozero(in_len);
- u32 orig_len = in_len, stage_o_len;
-
- u32 del_len, set_len, del_pos, set_pos, i, alpha_size, cur_pass = 0;
- u32 syms_removed, alpha_del0 = 0, alpha_del1, alpha_del2, alpha_d_total = 0;
- u8 changed_any, prev_del;
-
- /***********************
- * BLOCK NORMALIZATION *
- ***********************/
-
- set_len = next_p2(in_len / TMIN_SET_STEPS);
- set_pos = 0;
-
- if (set_len < TMIN_SET_MIN_SIZE) set_len = TMIN_SET_MIN_SIZE;
-
- ACTF(cBRI "Stage #0: " cRST "One-time block normalization...");
-
- while (set_pos < in_len) {
-
- u8 res;
- u32 use_len = MIN(set_len, in_len - set_pos);
-
- for (i = 0; i < use_len; i++)
- if (in_data[set_pos + i] != '0') break;
-
- if (i != use_len) {
-
- memcpy(tmp_buf, in_data, in_len);
- memset(tmp_buf + set_pos, '0', use_len);
-
- res = run_target(argv, tmp_buf, in_len, 0);
-
- if (res) {
-
- memset(in_data + set_pos, '0', use_len);
- changed_any = 1;
- alpha_del0 += use_len;
-
- }
-
- }
-
- set_pos += set_len;
-
- }
-
- alpha_d_total += alpha_del0;
-
- OKF("Block normalization complete, %u byte%s replaced.", alpha_del0,
- alpha_del0 == 1 ? "" : "s");
-
-next_pass:
-
- ACTF(cYEL "--- " cBRI "Pass #%u " cYEL "---", ++cur_pass);
- changed_any = 0;
-
- /******************
- * BLOCK DELETION *
- ******************/
-
- del_len = next_p2(in_len / TRIM_START_STEPS);
- stage_o_len = in_len;
-
- ACTF(cBRI "Stage #1: " cRST "Removing blocks of data...");
-
-next_del_blksize:
-
- if (!del_len) del_len = 1;
- del_pos = 0;
- prev_del = 1;
-
- SAYF(cGRA " Block length = %u, remaining size = %u\n" cRST,
- del_len, in_len);
-
- while (del_pos < in_len) {
-
- u8 res;
- s32 tail_len;
-
- tail_len = in_len - del_pos - del_len;
- if (tail_len < 0) tail_len = 0;
-
- /* If we have processed at least one full block (initially, prev_del == 1),
- and we did so without deleting the previous one, and we aren't at the
- very end of the buffer (tail_len > 0), and the current block is the same
- as the previous one... skip this step as a no-op. */
-
- if (!prev_del && tail_len && !memcmp(in_data + del_pos - del_len,
- in_data + del_pos, del_len)) {
-
- del_pos += del_len;
- continue;
-
- }
-
- prev_del = 0;
-
- /* Head */
- memcpy(tmp_buf, in_data, del_pos);
-
- /* Tail */
- memcpy(tmp_buf + del_pos, in_data + del_pos + del_len, tail_len);
-
- res = run_target(argv, tmp_buf, del_pos + tail_len, 0);
-
- if (res) {
-
- memcpy(in_data, tmp_buf, del_pos + tail_len);
- prev_del = 1;
- in_len = del_pos + tail_len;
-
- changed_any = 1;
-
- } else del_pos += del_len;
-
- }
-
- if (del_len > 1 && in_len >= 1) {
-
- del_len /= 2;
- goto next_del_blksize;
-
- }
-
- OKF("Block removal complete, %u bytes deleted.", stage_o_len - in_len);
-
- if (!in_len && changed_any)
- WARNF(cLRD "Down to zero bytes - check the command line and mem limit!" cRST);
-
- if (cur_pass > 1 && !changed_any) goto finalize_all;
-
- /*************************
- * ALPHABET MINIMIZATION *
- *************************/
-
- alpha_size = 0;
- alpha_del1 = 0;
- syms_removed = 0;
-
- memset(alpha_map, 0, 256 * sizeof(u32));
-
- for (i = 0; i < in_len; i++) {
- if (!alpha_map[in_data[i]]) alpha_size++;
- alpha_map[in_data[i]]++;
- }
-
- ACTF(cBRI "Stage #2: " cRST "Minimizing symbols (%u code point%s)...",
- alpha_size, alpha_size == 1 ? "" : "s");
-
- for (i = 0; i < 256; i++) {
-
- u32 r;
- u8 res;
-
- if (i == '0' || !alpha_map[i]) continue;
-
- memcpy(tmp_buf, in_data, in_len);
-
- for (r = 0; r < in_len; r++)
- if (tmp_buf[r] == i) tmp_buf[r] = '0';
-
- res = run_target(argv, tmp_buf, in_len, 0);
-
- if (res) {
-
- memcpy(in_data, tmp_buf, in_len);
- syms_removed++;
- alpha_del1 += alpha_map[i];
- changed_any = 1;
-
- }
-
- }
-
- alpha_d_total += alpha_del1;
-
- OKF("Symbol minimization finished, %u symbol%s (%u byte%s) replaced.",
- syms_removed, syms_removed == 1 ? "" : "s",
- alpha_del1, alpha_del1 == 1 ? "" : "s");
-
- /**************************
- * CHARACTER MINIMIZATION *
- **************************/
-
- alpha_del2 = 0;
-
- ACTF(cBRI "Stage #3: " cRST "Character minimization...");
-
- memcpy(tmp_buf, in_data, in_len);
-
- for (i = 0; i < in_len; i++) {
-
- u8 res, orig = tmp_buf[i];
-
- if (orig == '0') continue;
- tmp_buf[i] = '0';
-
- res = run_target(argv, tmp_buf, in_len, 0);
-
- if (res) {
-
- in_data[i] = '0';
- alpha_del2++;
- changed_any = 1;
-
- } else tmp_buf[i] = orig;
-
- }
-
- alpha_d_total += alpha_del2;
-
- OKF("Character minimization done, %u byte%s replaced.",
- alpha_del2, alpha_del2 == 1 ? "" : "s");
-
- if (changed_any) goto next_pass;
-
-finalize_all:
-
- SAYF("\n"
- cGRA " File size reduced by : " cRST "%0.02f%% (to %u byte%s)\n"
- cGRA " Characters simplified : " cRST "%0.02f%%\n"
- cGRA " Number of execs done : " cRST "%u\n"
- cGRA " Fruitless execs : " cRST "path=%u crash=%u hang=%s%u\n\n",
- 100 - ((double)in_len) * 100 / orig_len, in_len, in_len == 1 ? "" : "s",
- ((double)(alpha_d_total)) * 100 / (in_len ? in_len : 1),
- total_execs, missed_paths, missed_crashes, missed_hangs ? cLRD : "",
- missed_hangs);
-
- if (total_execs > 50 && missed_hangs * 10 > total_execs)
- WARNF(cLRD "Frequent timeouts - results may be skewed." cRST);
-
-}
-
-
-
-/* Handle Ctrl-C and the like. */
-
-static void handle_stop_sig(int sig) {
-
- stop_soon = 1;
-
- if (child_pid > 0) kill(child_pid, SIGKILL);
-
-}
-
-
-/* Do basic preparations - persistent fds, filenames, etc. */
-
-static void set_up_environment(void) {
-
- u8* x;
-
- dev_null_fd = open("/dev/null", O_RDWR);
- if (dev_null_fd < 0) PFATAL("Unable to open /dev/null");
-
- if (!prog_in) {
-
- u8* use_dir = ".";
-
- if (!access(use_dir, R_OK | W_OK | X_OK)) {
-
- use_dir = getenv("TMPDIR");
- if (!use_dir) use_dir = "/tmp";
-
- prog_in = alloc_printf("%s/.afl-tmin-temp-%u", use_dir, getpid());
-
- }
-
- }
-
- /* Set sane defaults... */
-
- x = getenv("ASAN_OPTIONS");
-
- if (x) {
-
- if (!strstr(x, "abort_on_error=1"))
- FATAL("Custom ASAN_OPTIONS set without abort_on_error=1 - please fix!");
-
- if (!strstr(x, "symbolize=0"))
- FATAL("Custom ASAN_OPTIONS set without symbolize=0 - please fix!");
-
- }
-
- x = getenv("MSAN_OPTIONS");
-
- if (x) {
-
- if (!strstr(x, "exit_code=" STRINGIFY(MSAN_ERROR)))
- FATAL("Custom MSAN_OPTIONS set without exit_code="
- STRINGIFY(MSAN_ERROR) " - please fix!");
-
- if (!strstr(x, "symbolize=0"))
- FATAL("Custom MSAN_OPTIONS set without symbolize=0 - please fix!");
-
- }
-
- setenv("ASAN_OPTIONS", "abort_on_error=1:"
- "detect_leaks=0:"
- "symbolize=0:"
- "allocator_may_return_null=1", 0);
-
- setenv("MSAN_OPTIONS", "exit_code=" STRINGIFY(MSAN_ERROR) ":"
- "symbolize=0:"
- "abort_on_error=1:"
- "allocator_may_return_null=1:"
- "msan_track_origins=0", 0);
-
- if (getenv("AFL_PRELOAD")) {
- setenv("LD_PRELOAD", getenv("AFL_PRELOAD"), 1);
- setenv("DYLD_INSERT_LIBRARIES", getenv("AFL_PRELOAD"), 1);
- }
-
-}
-
-
-/* Setup signal handlers, duh. */
-
-static void setup_signal_handlers(void) {
-
- struct sigaction sa;
-
- sa.sa_handler = NULL;
- sa.sa_flags = SA_RESTART;
- sa.sa_sigaction = NULL;
-
- sigemptyset(&sa.sa_mask);
-
- /* Various ways of saying "stop". */
-
- sa.sa_handler = handle_stop_sig;
- sigaction(SIGHUP, &sa, NULL);
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
-
- /* Exec timeout notifications. */
-
- sa.sa_handler = handle_timeout;
- sigaction(SIGALRM, &sa, NULL);
-
-}
-
-
-/* Detect @@ in args. */
-
-static void detect_file_args(char** argv) {
-
- u32 i = 0;
- u8* cwd = getcwd(NULL, 0);
-
- if (!cwd) PFATAL("getcwd() failed");
-
- while (argv[i]) {
-
- u8* aa_loc = strstr(argv[i], "@@");
-
- if (aa_loc) {
-
- u8 *aa_subst, *n_arg;
-
- /* Be sure that we're always using fully-qualified paths. */
-
- if (prog_in[0] == '/') aa_subst = prog_in;
- else aa_subst = alloc_printf("%s/%s", cwd, prog_in);
-
- /* Construct a replacement argv value. */
-
- *aa_loc = 0;
- n_arg = alloc_printf("%s%s%s", argv[i], aa_subst, aa_loc + 2);
- argv[i] = n_arg;
- *aa_loc = '@';
-
- if (prog_in[0] != '/') ck_free(aa_subst);
-
- }
-
- i++;
-
- }
-
- free(cwd); /* not tracked */
-
-}
-
-
-/* Display usage hints. */
-
-static void usage(u8* argv0) {
-
- SAYF("\n%s [ options ] -- /path/to/target_app [ ... ]\n\n"
-
- "Required parameters:\n\n"
-
- " -i file - input test case to be shrunk by the tool\n"
- " -o file - final output location for the minimized data\n\n"
-
- "Execution control settings:\n\n"
-
- " -f file - input file read by the tested program (stdin)\n"
- " -t msec - timeout for each run (%u ms)\n"
- " -m megs - memory limit for child process (%u MB)\n"
- " -Q - use binary-only instrumentation (QEMU mode)\n\n"
-
- "Minimization settings:\n\n"
-
- " -e - solve for edge coverage only, ignore hit counts\n"
- " -x - treat non-zero exit codes as crashes\n\n"
-
- "For additional tips, please consult %s/README.\n\n",
-
- argv0, EXEC_TIMEOUT, MEM_LIMIT, doc_path);
-
- exit(1);
-
-}
-
-
-/* Find binary. */
-
-static void find_binary(u8* fname) {
-
- u8* env_path = 0;
- struct stat st;
-
- if (strchr(fname, '/') || !(env_path = getenv("PATH"))) {
-
- target_path = ck_strdup(fname);
-
- if (stat(target_path, &st) || !S_ISREG(st.st_mode) ||
- !(st.st_mode & 0111) || st.st_size < 4)
- FATAL("Program '%s' not found or not executable", fname);
-
- } else {
-
- while (env_path) {
-
- u8 *cur_elem, *delim = strchr(env_path, ':');
-
- if (delim) {
-
- cur_elem = ck_alloc(delim - env_path + 1);
- memcpy(cur_elem, env_path, delim - env_path);
- delim++;
-
- } else cur_elem = ck_strdup(env_path);
-
- env_path = delim;
-
- if (cur_elem[0])
- target_path = alloc_printf("%s/%s", cur_elem, fname);
- else
- target_path = ck_strdup(fname);
-
- ck_free(cur_elem);
-
- if (!stat(target_path, &st) && S_ISREG(st.st_mode) &&
- (st.st_mode & 0111) && st.st_size >= 4) break;
-
- ck_free(target_path);
- target_path = 0;
-
- }
-
- if (!target_path) FATAL("Program '%s' not found or not executable", fname);
-
- }
-
-}
-
-
-/* Fix up argv for QEMU. */
-
-static char** get_qemu_argv(u8* own_loc, char** argv, int argc) {
-
- char** new_argv = ck_alloc(sizeof(char*) * (argc + 4));
- u8 *tmp, *cp, *rsl, *own_copy;
-
- memcpy(new_argv + 3, argv + 1, sizeof(char*) * argc);
-
- /* Now we need to actually find qemu for argv[0]. */
-
- new_argv[2] = target_path;
- new_argv[1] = "--";
-
- tmp = getenv("AFL_PATH");
-
- if (tmp) {
-
- cp = alloc_printf("%s/afl-qemu-trace", tmp);
-
- if (access(cp, X_OK))
- FATAL("Unable to find '%s'", tmp);
-
- target_path = new_argv[0] = cp;
- return new_argv;
-
- }
-
- own_copy = ck_strdup(own_loc);
- rsl = strrchr(own_copy, '/');
-
- if (rsl) {
-
- *rsl = 0;
-
- cp = alloc_printf("%s/afl-qemu-trace", own_copy);
- ck_free(own_copy);
-
- if (!access(cp, X_OK)) {
-
- target_path = new_argv[0] = cp;
- return new_argv;
-
- }
-
- } else ck_free(own_copy);
-
- if (!access(BIN_PATH "/afl-qemu-trace", X_OK)) {
-
- target_path = new_argv[0] = BIN_PATH "/afl-qemu-trace";
- return new_argv;
-
- }
-
- FATAL("Unable to find 'afl-qemu-trace'.");
-
-}
-
-
-/* Read mask bitmap from file. This is for the -B option. */
-
-static void read_bitmap(u8* fname) {
-
- s32 fd = open(fname, O_RDONLY);
-
- if (fd < 0) PFATAL("Unable to open '%s'", fname);
-
- ck_read(fd, mask_bitmap, MAP_SIZE, fname);
-
- close(fd);
-
-}
-
-
-
-/* Main entry point */
-
-int main(int argc, char** argv) {
-
- s32 opt;
- u8 mem_limit_given = 0, timeout_given = 0, qemu_mode = 0;
- char** use_argv;
-
- doc_path = access(DOC_PATH, F_OK) ? "docs" : DOC_PATH;
-
- SAYF(cCYA "afl-tmin " cBRI VERSION cRST " by <lcamtuf@google.com>\n");
-
- while ((opt = getopt(argc,argv,"+i:o:f:m:t:B:xeQ")) > 0)
-
- switch (opt) {
-
- case 'i':
-
- if (in_file) FATAL("Multiple -i options not supported");
- in_file = optarg;
- break;
-
- case 'o':
-
- if (out_file) FATAL("Multiple -o options not supported");
- out_file = optarg;
- break;
-
- case 'f':
-
- if (prog_in) FATAL("Multiple -f options not supported");
- use_stdin = 0;
- prog_in = optarg;
- break;
-
- case 'e':
-
- if (edges_only) FATAL("Multiple -e options not supported");
- edges_only = 1;
- break;
-
- case 'x':
-
- if (exit_crash) FATAL("Multiple -x options not supported");
- exit_crash = 1;
- break;
-
- case 'm': {
-
- u8 suffix = 'M';
-
- if (mem_limit_given) FATAL("Multiple -m options not supported");
- mem_limit_given = 1;
-
- if (!strcmp(optarg, "none")) {
-
- mem_limit = 0;
- break;
-
- }
-
- if (sscanf(optarg, "%llu%c", &mem_limit, &suffix) < 1 ||
- optarg[0] == '-') FATAL("Bad syntax used for -m");
-
- switch (suffix) {
-
- case 'T': mem_limit *= 1024 * 1024; break;
- case 'G': mem_limit *= 1024; break;
- case 'k': mem_limit /= 1024; break;
- case 'M': break;
-
- default: FATAL("Unsupported suffix or bad syntax for -m");
-
- }
-
- if (mem_limit < 5) FATAL("Dangerously low value of -m");
-
- if (sizeof(rlim_t) == 4 && mem_limit > 2000)
- FATAL("Value of -m out of range on 32-bit systems");
-
- }
-
- break;
-
- case 't':
-
- if (timeout_given) FATAL("Multiple -t options not supported");
- timeout_given = 1;
-
- exec_tmout = atoi(optarg);
-
- if (exec_tmout < 10 || optarg[0] == '-')
- FATAL("Dangerously low value of -t");
-
- break;
-
- case 'Q':
-
- if (qemu_mode) FATAL("Multiple -Q options not supported");
- if (!mem_limit_given) mem_limit = MEM_LIMIT_QEMU;
-
- qemu_mode = 1;
- break;
-
- case 'B': /* load bitmap */
-
- /* This is a secret undocumented option! It is speculated to be useful
- if you have a baseline "boring" input file and another "interesting"
- file you want to minimize.
-
- You can dump a binary bitmap for the boring file using
- afl-showmap -b, and then load it into afl-tmin via -B. The minimizer
- will then minimize to preserve only the edges that are unique to
- the interesting input file, but ignoring everything from the
- original map.
-
- The option may be extended and made more official if it proves
- to be useful. */
-
- if (mask_bitmap) FATAL("Multiple -B options not supported");
- mask_bitmap = ck_alloc(MAP_SIZE);
- read_bitmap(optarg);
- break;
-
- default:
-
- usage(argv[0]);
-
- }
-
- if (optind == argc || !in_file || !out_file) usage(argv[0]);
-
- setup_shm();
- setup_signal_handlers();
-
- set_up_environment();
-
- find_binary(argv[optind]);
- detect_file_args(argv + optind);
-
- if (qemu_mode)
- use_argv = get_qemu_argv(argv[0], argv + optind, argc - optind);
- else
- use_argv = argv + optind;
-
- SAYF("\n");
-
- read_initial_file();
-
- ACTF("Performing dry run (mem limit = %llu MB, timeout = %u ms%s)...",
- mem_limit, exec_tmout, edges_only ? ", edges only" : "");
-
- run_target(use_argv, in_data, in_len, 1);
-
- if (child_timed_out)
- FATAL("Target binary times out (adjusting -t may help).");
-
- if (!crash_mode) {
-
- OKF("Program terminates normally, minimizing in "
- cCYA "instrumented" cRST " mode.");
-
- if (!anything_set()) FATAL("No instrumentation detected.");
-
- } else {
-
- OKF("Program exits with a signal, minimizing in " cMGN "crash" cRST
- " mode.");
-
- }
-
- minimize(use_argv);
-
- ACTF("Writing output to '%s'...", out_file);
-
- close(write_to_file(out_file, in_data, in_len));
-
- OKF("We're done here. Have a nice day!\n");
-
- exit(0);
-
-}
-
diff --git a/chromium/third_party/afl/src/afl-whatsup b/chromium/third_party/afl/src/afl-whatsup
deleted file mode 100755
index a4d30418792..00000000000
--- a/chromium/third_party/afl/src/afl-whatsup
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/bin/sh
-#
-# american fuzzy lop - status check tool
-# --------------------------------------
-#
-# Written and maintained by Michal Zalewski <lcamtuf@google.com>
-#
-# Copyright 2015 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# This tool summarizes the status of any locally-running synchronized
-# instances of afl-fuzz.
-#
-
-echo "status check tool for afl-fuzz by <lcamtuf@google.com>"
-echo
-
-if [ "$1" = "-s" ]; then
-
- SUMMARY_ONLY=1
- DIR="$2"
-
-else
-
- unset SUMMARY_ONLY
- DIR="$1"
-
-fi
-
-if [ "$DIR" = "" ]; then
-
- echo "Usage: $0 [ -s ] afl_sync_dir" 1>&2
- echo 1>&2
- echo "The -s option causes the tool to skip all the per-fuzzer trivia and show" 1>&2
- echo "just the summary results. See docs/parallel_fuzzing.txt for additional tips." 1>&2
- echo 1>&2
- exit 1
-
-fi
-
-cd "$DIR" || exit 1
-
-if [ -d queue ]; then
-
- echo "[-] Error: parameter is an individual output directory, not a sync dir." 1>&2
- exit 1
-
-fi
-
-CUR_TIME=`date +%s`
-
-TMP=`mktemp -t .afl-whatsup-XXXXXXXX` || exit 1
-
-ALIVE_CNT=0
-DEAD_CNT=0
-
-TOTAL_TIME=0
-TOTAL_EXECS=0
-TOTAL_EPS=0
-TOTAL_CRASHES=0
-TOTAL_PFAV=0
-TOTAL_PENDING=0
-
-if [ "$SUMMARY_ONLY" = "" ]; then
-
- echo "Individual fuzzers"
- echo "=================="
- echo
-
-fi
-
-for i in `find . -maxdepth 2 -iname fuzzer_stats | sort`; do
-
- sed 's/^command_line.*$/_skip:1/;s/[ ]*:[ ]*/="/;s/$/"/' "$i" >"$TMP"
- . "$TMP"
-
- RUN_UNIX=$((CUR_TIME - start_time))
- RUN_DAYS=$((RUN_UNIX / 60 / 60 / 24))
- RUN_HRS=$(((RUN_UNIX / 60 / 60) % 24))
-
- if [ "$SUMMARY_ONLY" = "" ]; then
-
- echo ">>> $afl_banner ($RUN_DAYS days, $RUN_HRS hrs) <<<"
- echo
-
- fi
-
- if ! kill -0 "$fuzzer_pid" 2>/dev/null; then
-
- if [ "$SUMMARY_ONLY" = "" ]; then
-
- echo " Instance is dead or running remotely, skipping."
- echo
-
- fi
-
- DEAD_CNT=$((DEAD_CNT + 1))
- continue
-
- fi
-
- ALIVE_CNT=$((ALIVE_CNT + 1))
-
- EXEC_SEC=$((execs_done / RUN_UNIX))
- PATH_PERC=$((cur_path * 100 / paths_total))
-
- TOTAL_TIME=$((TOTAL_TIME + RUN_UNIX))
- TOTAL_EPS=$((TOTAL_EPS + EXEC_SEC))
- TOTAL_EXECS=$((TOTAL_EXECS + execs_done))
- TOTAL_CRASHES=$((TOTAL_CRASHES + unique_crashes))
- TOTAL_PENDING=$((TOTAL_PENDING + pending_total))
- TOTAL_PFAV=$((TOTAL_PFAV + pending_favs))
-
- if [ "$SUMMARY_ONLY" = "" ]; then
-
- echo " cycle $((cycles_done + 1)), lifetime speed $EXEC_SEC execs/sec, path $cur_path/$paths_total (${PATH_PERC}%)"
-
- if [ "$unique_crashes" = "0" ]; then
- echo " pending $pending_favs/$pending_total, coverage $bitmap_cvg, no crashes yet"
- else
- echo " pending $pending_favs/$pending_total, coverage $bitmap_cvg, crash count $unique_crashes (!)"
- fi
-
- echo
-
- fi
-
-done
-
-rm -f "$TMP"
-
-TOTAL_DAYS=$((TOTAL_TIME / 60 / 60 / 24))
-TOTAL_HRS=$(((TOTAL_TIME / 60 / 60) % 24))
-
-test "$TOTAL_TIME" = "0" && TOTAL_TIME=1
-
-echo "Summary stats"
-echo "============="
-echo
-echo " Fuzzers alive : $ALIVE_CNT"
-
-if [ ! "$DEAD_CNT" = "0" ]; then
- echo " Dead or remote : $DEAD_CNT (excluded from stats)"
-fi
-
-echo " Total run time : $TOTAL_DAYS days, $TOTAL_HRS hours"
-echo " Total execs : $((TOTAL_EXECS / 1000 / 1000)) million"
-echo " Cumulative speed : $TOTAL_EPS execs/sec"
-echo " Pending paths : $TOTAL_PFAV faves, $TOTAL_PENDING total"
-
-if [ "$ALIVE_CNT" -gt "1" ]; then
- echo " Pending per fuzzer : $((TOTAL_PFAV/ALIVE_CNT)) faves, $((TOTAL_PENDING/ALIVE_CNT)) total (on average)"
-fi
-
-echo " Crashes found : $TOTAL_CRASHES locally unique"
-echo
-
-exit 0
diff --git a/chromium/third_party/afl/src/alloc-inl.h b/chromium/third_party/afl/src/alloc-inl.h
deleted file mode 100644
index d3c125fbb4c..00000000000
--- a/chromium/third_party/afl/src/alloc-inl.h
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
- american fuzzy lop - error-checking, memory-zeroing alloc routines
- ------------------------------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014, 2015 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This allocator is not designed to resist malicious attackers (the canaries
- are small and predictable), but provides a robust and portable way to detect
- use-after-free, off-by-one writes, stale pointers, and so on.
-
- */
-
-#ifndef _HAVE_ALLOC_INL_H
-#define _HAVE_ALLOC_INL_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "config.h"
-#include "types.h"
-#include "debug.h"
-
-/* User-facing macro to sprintf() to a dynamically allocated buffer. */
-
-#define alloc_printf(_str...) ({ \
- u8* _tmp; \
- s32 _len = snprintf(NULL, 0, _str); \
- if (_len < 0) FATAL("Whoa, snprintf() fails?!"); \
- _tmp = ck_alloc(_len + 1); \
- snprintf((char*)_tmp, _len + 1, _str); \
- _tmp; \
- })
-
-/* Macro to enforce allocation limits as a last-resort defense against
- integer overflows. */
-
-#define ALLOC_CHECK_SIZE(_s) do { \
- if ((_s) > MAX_ALLOC) \
- ABORT("Bad alloc request: %u bytes", (_s)); \
- } while (0)
-
-/* Macro to check malloc() failures and the like. */
-
-#define ALLOC_CHECK_RESULT(_r, _s) do { \
- if (!(_r)) \
- ABORT("Out of memory: can't allocate %u bytes", (_s)); \
- } while (0)
-
-/* Magic tokens used to mark used / freed chunks. */
-
-#define ALLOC_MAGIC_C1 0xFF00FF00 /* Used head (dword) */
-#define ALLOC_MAGIC_F 0xFE00FE00 /* Freed head (dword) */
-#define ALLOC_MAGIC_C2 0xF0 /* Used tail (byte) */
-
-/* Positions of guard tokens in relation to the user-visible pointer. */
-
-#define ALLOC_C1(_ptr) (((u32*)(_ptr))[-2])
-#define ALLOC_S(_ptr) (((u32*)(_ptr))[-1])
-#define ALLOC_C2(_ptr) (((u8*)(_ptr))[ALLOC_S(_ptr)])
-
-#define ALLOC_OFF_HEAD 8
-#define ALLOC_OFF_TOTAL (ALLOC_OFF_HEAD + 1)
-
-/* Allocator increments for ck_realloc_block(). */
-
-#define ALLOC_BLK_INC 256
-
-/* Sanity-checking macros for pointers. */
-
-#define CHECK_PTR(_p) do { \
- if (_p) { \
- if (ALLOC_C1(_p) ^ ALLOC_MAGIC_C1) {\
- if (ALLOC_C1(_p) == ALLOC_MAGIC_F) \
- ABORT("Use after free."); \
- else ABORT("Corrupted head alloc canary."); \
- } \
- if (ALLOC_C2(_p) ^ ALLOC_MAGIC_C2) \
- ABORT("Corrupted tail alloc canary."); \
- } \
- } while (0)
-
-#define CHECK_PTR_EXPR(_p) ({ \
- typeof (_p) _tmp = (_p); \
- CHECK_PTR(_tmp); \
- _tmp; \
- })
-
-
-/* Allocate a buffer, explicitly not zeroing it. Returns NULL for zero-sized
- requests. */
-
-static inline void* DFL_ck_alloc_nozero(u32 size) {
-
- void* ret;
-
- if (!size) return NULL;
-
- ALLOC_CHECK_SIZE(size);
- ret = malloc(size + ALLOC_OFF_TOTAL);
- ALLOC_CHECK_RESULT(ret, size);
-
- ret += ALLOC_OFF_HEAD;
-
- ALLOC_C1(ret) = ALLOC_MAGIC_C1;
- ALLOC_S(ret) = size;
- ALLOC_C2(ret) = ALLOC_MAGIC_C2;
-
- return ret;
-
-}
-
-
-/* Allocate a buffer, returning zeroed memory. */
-
-static inline void* DFL_ck_alloc(u32 size) {
-
- void* mem;
-
- if (!size) return NULL;
- mem = DFL_ck_alloc_nozero(size);
-
- return memset(mem, 0, size);
-
-}
-
-
-/* Free memory, checking for double free and corrupted heap. When DEBUG_BUILD
- is set, the old memory will be also clobbered with 0xFF. */
-
-static inline void DFL_ck_free(void* mem) {
-
- if (!mem) return;
-
- CHECK_PTR(mem);
-
-#ifdef DEBUG_BUILD
-
- /* Catch pointer issues sooner. */
- memset(mem, 0xFF, ALLOC_S(mem));
-
-#endif /* DEBUG_BUILD */
-
- ALLOC_C1(mem) = ALLOC_MAGIC_F;
-
- free(mem - ALLOC_OFF_HEAD);
-
-}
-
-
-/* Re-allocate a buffer, checking for issues and zeroing any newly-added tail.
- With DEBUG_BUILD, the buffer is always reallocated to a new addresses and the
- old memory is clobbered with 0xFF. */
-
-static inline void* DFL_ck_realloc(void* orig, u32 size) {
-
- void* ret;
- u32 old_size = 0;
-
- if (!size) {
-
- DFL_ck_free(orig);
- return NULL;
-
- }
-
- if (orig) {
-
- CHECK_PTR(orig);
-
-#ifndef DEBUG_BUILD
- ALLOC_C1(orig) = ALLOC_MAGIC_F;
-#endif /* !DEBUG_BUILD */
-
- old_size = ALLOC_S(orig);
- orig -= ALLOC_OFF_HEAD;
-
- ALLOC_CHECK_SIZE(old_size);
-
- }
-
- ALLOC_CHECK_SIZE(size);
-
-#ifndef DEBUG_BUILD
-
- ret = realloc(orig, size + ALLOC_OFF_TOTAL);
- ALLOC_CHECK_RESULT(ret, size);
-
-#else
-
- /* Catch pointer issues sooner: force relocation and make sure that the
- original buffer is wiped. */
-
- ret = malloc(size + ALLOC_OFF_TOTAL);
- ALLOC_CHECK_RESULT(ret, size);
-
- if (orig) {
-
- memcpy(ret + ALLOC_OFF_HEAD, orig + ALLOC_OFF_HEAD, MIN(size, old_size));
- memset(orig + ALLOC_OFF_HEAD, 0xFF, old_size);
-
- ALLOC_C1(orig + ALLOC_OFF_HEAD) = ALLOC_MAGIC_F;
-
- free(orig);
-
- }
-
-#endif /* ^!DEBUG_BUILD */
-
- ret += ALLOC_OFF_HEAD;
-
- ALLOC_C1(ret) = ALLOC_MAGIC_C1;
- ALLOC_S(ret) = size;
- ALLOC_C2(ret) = ALLOC_MAGIC_C2;
-
- if (size > old_size)
- memset(ret + old_size, 0, size - old_size);
-
- return ret;
-
-}
-
-
-/* Re-allocate a buffer with ALLOC_BLK_INC increments (used to speed up
- repeated small reallocs without complicating the user code). */
-
-static inline void* DFL_ck_realloc_block(void* orig, u32 size) {
-
-#ifndef DEBUG_BUILD
-
- if (orig) {
-
- CHECK_PTR(orig);
-
- if (ALLOC_S(orig) >= size) return orig;
-
- size += ALLOC_BLK_INC;
-
- }
-
-#endif /* !DEBUG_BUILD */
-
- return DFL_ck_realloc(orig, size);
-
-}
-
-
-/* Create a buffer with a copy of a string. Returns NULL for NULL inputs. */
-
-static inline u8* DFL_ck_strdup(u8* str) {
-
- void* ret;
- u32 size;
-
- if (!str) return NULL;
-
- size = strlen((char*)str) + 1;
-
- ALLOC_CHECK_SIZE(size);
- ret = malloc(size + ALLOC_OFF_TOTAL);
- ALLOC_CHECK_RESULT(ret, size);
-
- ret += ALLOC_OFF_HEAD;
-
- ALLOC_C1(ret) = ALLOC_MAGIC_C1;
- ALLOC_S(ret) = size;
- ALLOC_C2(ret) = ALLOC_MAGIC_C2;
-
- return memcpy(ret, str, size);
-
-}
-
-
-/* Create a buffer with a copy of a memory block. Returns NULL for zero-sized
- or NULL inputs. */
-
-static inline void* DFL_ck_memdup(void* mem, u32 size) {
-
- void* ret;
-
- if (!mem || !size) return NULL;
-
- ALLOC_CHECK_SIZE(size);
- ret = malloc(size + ALLOC_OFF_TOTAL);
- ALLOC_CHECK_RESULT(ret, size);
-
- ret += ALLOC_OFF_HEAD;
-
- ALLOC_C1(ret) = ALLOC_MAGIC_C1;
- ALLOC_S(ret) = size;
- ALLOC_C2(ret) = ALLOC_MAGIC_C2;
-
- return memcpy(ret, mem, size);
-
-}
-
-
-/* Create a buffer with a block of text, appending a NUL terminator at the end.
- Returns NULL for zero-sized or NULL inputs. */
-
-static inline u8* DFL_ck_memdup_str(u8* mem, u32 size) {
-
- u8* ret;
-
- if (!mem || !size) return NULL;
-
- ALLOC_CHECK_SIZE(size);
- ret = malloc(size + ALLOC_OFF_TOTAL + 1);
- ALLOC_CHECK_RESULT(ret, size);
-
- ret += ALLOC_OFF_HEAD;
-
- ALLOC_C1(ret) = ALLOC_MAGIC_C1;
- ALLOC_S(ret) = size;
- ALLOC_C2(ret) = ALLOC_MAGIC_C2;
-
- memcpy(ret, mem, size);
- ret[size] = 0;
-
- return ret;
-
-}
-
-
-#ifndef DEBUG_BUILD
-
-/* In non-debug mode, we just do straightforward aliasing of the above functions
- to user-visible names such as ck_alloc(). */
-
-#define ck_alloc DFL_ck_alloc
-#define ck_alloc_nozero DFL_ck_alloc_nozero
-#define ck_realloc DFL_ck_realloc
-#define ck_realloc_block DFL_ck_realloc_block
-#define ck_strdup DFL_ck_strdup
-#define ck_memdup DFL_ck_memdup
-#define ck_memdup_str DFL_ck_memdup_str
-#define ck_free DFL_ck_free
-
-#define alloc_report()
-
-#else
-
-/* In debugging mode, we also track allocations to detect memory leaks, and the
- flow goes through one more layer of indirection. */
-
-/* Alloc tracking data structures: */
-
-#define ALLOC_BUCKETS 4096
-
-struct TRK_obj {
- void *ptr;
- char *file, *func;
- u32 line;
-};
-
-#ifdef AFL_MAIN
-
-struct TRK_obj* TRK[ALLOC_BUCKETS];
-u32 TRK_cnt[ALLOC_BUCKETS];
-
-# define alloc_report() TRK_report()
-
-#else
-
-extern struct TRK_obj* TRK[ALLOC_BUCKETS];
-extern u32 TRK_cnt[ALLOC_BUCKETS];
-
-# define alloc_report()
-
-#endif /* ^AFL_MAIN */
-
-/* Bucket-assigning function for a given pointer: */
-
-#define TRKH(_ptr) (((((u32)(_ptr)) >> 16) ^ ((u32)(_ptr))) % ALLOC_BUCKETS)
-
-
-/* Add a new entry to the list of allocated objects. */
-
-static inline void TRK_alloc_buf(void* ptr, const char* file, const char* func,
- u32 line) {
-
- u32 i, bucket;
-
- if (!ptr) return;
-
- bucket = TRKH(ptr);
-
- /* Find a free slot in the list of entries for that bucket. */
-
- for (i = 0; i < TRK_cnt[bucket]; i++)
-
- if (!TRK[bucket][i].ptr) {
-
- TRK[bucket][i].ptr = ptr;
- TRK[bucket][i].file = (char*)file;
- TRK[bucket][i].func = (char*)func;
- TRK[bucket][i].line = line;
- return;
-
- }
-
- /* No space available - allocate more. */
-
- TRK[bucket] = DFL_ck_realloc_block(TRK[bucket],
- (TRK_cnt[bucket] + 1) * sizeof(struct TRK_obj));
-
- TRK[bucket][i].ptr = ptr;
- TRK[bucket][i].file = (char*)file;
- TRK[bucket][i].func = (char*)func;
- TRK[bucket][i].line = line;
-
- TRK_cnt[bucket]++;
-
-}
-
-
-/* Remove entry from the list of allocated objects. */
-
-static inline void TRK_free_buf(void* ptr, const char* file, const char* func,
- u32 line) {
-
- u32 i, bucket;
-
- if (!ptr) return;
-
- bucket = TRKH(ptr);
-
- /* Find the element on the list... */
-
- for (i = 0; i < TRK_cnt[bucket]; i++)
-
- if (TRK[bucket][i].ptr == ptr) {
-
- TRK[bucket][i].ptr = 0;
- return;
-
- }
-
- WARNF("ALLOC: Attempt to free non-allocated memory in %s (%s:%u)",
- func, file, line);
-
-}
-
-
-/* Do a final report on all non-deallocated objects. */
-
-static inline void TRK_report(void) {
-
- u32 i, bucket;
-
- fflush(0);
-
- for (bucket = 0; bucket < ALLOC_BUCKETS; bucket++)
- for (i = 0; i < TRK_cnt[bucket]; i++)
- if (TRK[bucket][i].ptr)
- WARNF("ALLOC: Memory never freed, created in %s (%s:%u)",
- TRK[bucket][i].func, TRK[bucket][i].file, TRK[bucket][i].line);
-
-}
-
-
-/* Simple wrappers for non-debugging functions: */
-
-static inline void* TRK_ck_alloc(u32 size, const char* file, const char* func,
- u32 line) {
-
- void* ret = DFL_ck_alloc(size);
- TRK_alloc_buf(ret, file, func, line);
- return ret;
-
-}
-
-
-static inline void* TRK_ck_realloc(void* orig, u32 size, const char* file,
- const char* func, u32 line) {
-
- void* ret = DFL_ck_realloc(orig, size);
- TRK_free_buf(orig, file, func, line);
- TRK_alloc_buf(ret, file, func, line);
- return ret;
-
-}
-
-
-static inline void* TRK_ck_realloc_block(void* orig, u32 size, const char* file,
- const char* func, u32 line) {
-
- void* ret = DFL_ck_realloc_block(orig, size);
- TRK_free_buf(orig, file, func, line);
- TRK_alloc_buf(ret, file, func, line);
- return ret;
-
-}
-
-
-static inline void* TRK_ck_strdup(u8* str, const char* file, const char* func,
- u32 line) {
-
- void* ret = DFL_ck_strdup(str);
- TRK_alloc_buf(ret, file, func, line);
- return ret;
-
-}
-
-
-static inline void* TRK_ck_memdup(void* mem, u32 size, const char* file,
- const char* func, u32 line) {
-
- void* ret = DFL_ck_memdup(mem, size);
- TRK_alloc_buf(ret, file, func, line);
- return ret;
-
-}
-
-
-static inline void* TRK_ck_memdup_str(void* mem, u32 size, const char* file,
- const char* func, u32 line) {
-
- void* ret = DFL_ck_memdup_str(mem, size);
- TRK_alloc_buf(ret, file, func, line);
- return ret;
-
-}
-
-
-static inline void TRK_ck_free(void* ptr, const char* file,
- const char* func, u32 line) {
-
- TRK_free_buf(ptr, file, func, line);
- DFL_ck_free(ptr);
-
-}
-
-/* Aliasing user-facing names to tracking functions: */
-
-#define ck_alloc(_p1) \
- TRK_ck_alloc(_p1, __FILE__, __FUNCTION__, __LINE__)
-
-#define ck_alloc_nozero(_p1) \
- TRK_ck_alloc(_p1, __FILE__, __FUNCTION__, __LINE__)
-
-#define ck_realloc(_p1, _p2) \
- TRK_ck_realloc(_p1, _p2, __FILE__, __FUNCTION__, __LINE__)
-
-#define ck_realloc_block(_p1, _p2) \
- TRK_ck_realloc_block(_p1, _p2, __FILE__, __FUNCTION__, __LINE__)
-
-#define ck_strdup(_p1) \
- TRK_ck_strdup(_p1, __FILE__, __FUNCTION__, __LINE__)
-
-#define ck_memdup(_p1, _p2) \
- TRK_ck_memdup(_p1, _p2, __FILE__, __FUNCTION__, __LINE__)
-
-#define ck_memdup_str(_p1, _p2) \
- TRK_ck_memdup_str(_p1, _p2, __FILE__, __FUNCTION__, __LINE__)
-
-#define ck_free(_p1) \
- TRK_ck_free(_p1, __FILE__, __FUNCTION__, __LINE__)
-
-#endif /* ^!DEBUG_BUILD */
-
-#endif /* ! _HAVE_ALLOC_INL_H */
diff --git a/chromium/third_party/afl/src/config.h b/chromium/third_party/afl/src/config.h
deleted file mode 100644
index 2fdef50020c..00000000000
--- a/chromium/third_party/afl/src/config.h
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- american fuzzy lop - vaguely configurable bits
- ----------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- */
-
-#ifndef _HAVE_CONFIG_H
-#define _HAVE_CONFIG_H
-
-#include "types.h"
-
-/* Version string: */
-
-#define VERSION "2.38b"
-
-/******************************************************
- * *
- * Settings that may be of interest to power users: *
- * *
- ******************************************************/
-
-/* Comment out to disable terminal colors (note that this makes afl-analyze
- a lot less nice): */
-
-#define USE_COLOR
-
-/* Comment out to disable fancy ANSI boxes and use poor man's 7-bit UI: */
-
-#define FANCY_BOXES
-
-/* Default timeout for fuzzed code (milliseconds): */
-
-#define EXEC_TIMEOUT 1000
-
-/* Timeout rounding factor when auto-scaling (milliseconds): */
-
-#define EXEC_TM_ROUND 20
-
-/* Default memory limit for child process (MB): */
-
-#ifndef __x86_64__
-# define MEM_LIMIT 25
-#else
-# define MEM_LIMIT 50
-#endif /* ^!__x86_64__ */
-
-/* Default memory limit when running in QEMU mode (MB): */
-
-#define MEM_LIMIT_QEMU 200
-
-/* Number of calibration cycles per every new test case (and for test
- cases that show variable behavior): */
-
-#define CAL_CYCLES 8
-#define CAL_CYCLES_LONG 40
-
-/* Number of subsequent hangs before abandoning an input file: */
-
-#define HANG_LIMIT 250
-
-/* Maximum number of unique hangs or crashes to record: */
-
-#define KEEP_UNIQUE_HANG 500
-#define KEEP_UNIQUE_CRASH 5000
-
-/* Baseline number of random tweaks during a single 'havoc' stage: */
-
-#define HAVOC_CYCLES 256
-#define HAVOC_CYCLES_INIT 1024
-
-/* Maximum multiplier for the above (should be a power of two, beware
- of 32-bit int overflows): */
-
-#define HAVOC_MAX_MULT 16
-
-/* Absolute minimum number of havoc cycles (after all adjustments): */
-
-#define HAVOC_MIN 16
-
-/* Maximum stacking for havoc-stage tweaks. The actual value is calculated
- like this:
-
- n = random between 1 and HAVOC_STACK_POW2
- stacking = 2^n
-
- In other words, the default (n = 7) produces 2, 4, 8, 16, 32, 64, or
- 128 stacked tweaks: */
-
-#define HAVOC_STACK_POW2 7
-
-/* Caps on block sizes for cloning and deletion operations. Each of these
- ranges has a 33% probability of getting picked, except for the first
- two cycles where smaller blocks are favored: */
-
-#define HAVOC_BLK_SMALL 32
-#define HAVOC_BLK_MEDIUM 128
-#define HAVOC_BLK_LARGE 1500
-
-/* Probabilities of skipping non-favored entries in the queue, expressed as
- percentages: */
-
-#define SKIP_TO_NEW_PROB 99 /* ...when there are new, pending favorites */
-#define SKIP_NFAV_OLD_PROB 95 /* ...no new favs, cur entry already fuzzed */
-#define SKIP_NFAV_NEW_PROB 75 /* ...no new favs, cur entry not fuzzed yet */
-
-/* Splicing cycle count: */
-
-#define SPLICE_CYCLES 15
-
-/* Nominal per-splice havoc cycle length: */
-
-#define SPLICE_HAVOC 32
-
-/* Maximum offset for integer addition / subtraction stages: */
-
-#define ARITH_MAX 35
-
-/* Limits for the test case trimmer. The absolute minimum chunk size; and
- the starting and ending divisors for chopping up the input file: */
-
-#define TRIM_MIN_BYTES 4
-#define TRIM_START_STEPS 16
-#define TRIM_END_STEPS 1024
-
-/* Maximum size of input file, in bytes (keep under 100MB): */
-
-#define MAX_FILE (1 * 1024 * 1024)
-
-/* The same, for the test case minimizer: */
-
-#define TMIN_MAX_FILE (10 * 1024 * 1024)
-
-/* Block normalization steps for afl-tmin: */
-
-#define TMIN_SET_MIN_SIZE 4
-#define TMIN_SET_STEPS 128
-
-/* Maximum dictionary token size (-x), in bytes: */
-
-#define MAX_DICT_FILE 128
-
-/* Length limits for auto-detected dictionary tokens: */
-
-#define MIN_AUTO_EXTRA 3
-#define MAX_AUTO_EXTRA 32
-
-/* Maximum number of user-specified dictionary tokens to use in deterministic
- steps; past this point, the "extras/user" step will be still carried out,
- but with proportionally lower odds: */
-
-#define MAX_DET_EXTRAS 200
-
-/* Maximum number of auto-extracted dictionary tokens to actually use in fuzzing
- (first value), and to keep in memory as candidates. The latter should be much
- higher than the former. */
-
-#define USE_AUTO_EXTRAS 50
-#define MAX_AUTO_EXTRAS (USE_AUTO_EXTRAS * 10)
-
-/* Scaling factor for the effector map used to skip some of the more
- expensive deterministic steps. The actual divisor is set to
- 2^EFF_MAP_SCALE2 bytes: */
-
-#define EFF_MAP_SCALE2 3
-
-/* Minimum input file length at which the effector logic kicks in: */
-
-#define EFF_MIN_LEN 128
-
-/* Maximum effector density past which everything is just fuzzed
- unconditionally (%): */
-
-#define EFF_MAX_PERC 90
-
-/* UI refresh frequency (Hz): */
-
-#define UI_TARGET_HZ 5
-
-/* Fuzzer stats file and plot update intervals (sec): */
-
-#define STATS_UPDATE_SEC 60
-#define PLOT_UPDATE_SEC 5
-
-/* Smoothing divisor for CPU load and exec speed stats (1 - no smoothing). */
-
-#define AVG_SMOOTHING 16
-
-/* Sync interval (every n havoc cycles): */
-
-#define SYNC_INTERVAL 5
-
-/* Output directory reuse grace period (minutes): */
-
-#define OUTPUT_GRACE 25
-
-/* Uncomment to use simple file names (id_NNNNNN): */
-
-// #define SIMPLE_FILES
-
-/* List of interesting values to use in fuzzing. */
-
-#define INTERESTING_8 \
- -128, /* Overflow signed 8-bit when decremented */ \
- -1, /* */ \
- 0, /* */ \
- 1, /* */ \
- 16, /* One-off with common buffer size */ \
- 32, /* One-off with common buffer size */ \
- 64, /* One-off with common buffer size */ \
- 100, /* One-off with common buffer size */ \
- 127 /* Overflow signed 8-bit when incremented */
-
-#define INTERESTING_16 \
- -32768, /* Overflow signed 16-bit when decremented */ \
- -129, /* Overflow signed 8-bit */ \
- 128, /* Overflow signed 8-bit */ \
- 255, /* Overflow unsig 8-bit when incremented */ \
- 256, /* Overflow unsig 8-bit */ \
- 512, /* One-off with common buffer size */ \
- 1000, /* One-off with common buffer size */ \
- 1024, /* One-off with common buffer size */ \
- 4096, /* One-off with common buffer size */ \
- 32767 /* Overflow signed 16-bit when incremented */
-
-#define INTERESTING_32 \
- -2147483648LL, /* Overflow signed 32-bit when decremented */ \
- -100663046, /* Large negative number (endian-agnostic) */ \
- -32769, /* Overflow signed 16-bit */ \
- 32768, /* Overflow signed 16-bit */ \
- 65535, /* Overflow unsig 16-bit when incremented */ \
- 65536, /* Overflow unsig 16 bit */ \
- 100663045, /* Large positive number (endian-agnostic) */ \
- 2147483647 /* Overflow signed 32-bit when incremented */
-
-/***********************************************************
- * *
- * Really exotic stuff you probably don't want to touch: *
- * *
- ***********************************************************/
-
-/* Call count interval between reseeding the libc PRNG from /dev/urandom: */
-
-#define RESEED_RNG 10000
-
-/* Maximum line length passed from GCC to 'as' and used for parsing
- configuration files: */
-
-#define MAX_LINE 8192
-
-/* Environment variable used to pass SHM ID to the called program. */
-
-#define SHM_ENV_VAR "__AFL_SHM_ID"
-
-/* Other less interesting, internal-only variables. */
-
-#define CLANG_ENV_VAR "__AFL_CLANG_MODE"
-#define AS_LOOP_ENV_VAR "__AFL_AS_LOOPCHECK"
-#define PERSIST_ENV_VAR "__AFL_PERSISTENT"
-#define DEFER_ENV_VAR "__AFL_DEFER_FORKSRV"
-
-/* In-code signatures for deferred and persistent mode. */
-
-#define PERSIST_SIG "##SIG_AFL_PERSISTENT##"
-#define DEFER_SIG "##SIG_AFL_DEFER_FORKSRV##"
-
-/* Distinctive bitmap signature used to indicate failed execution: */
-
-#define EXEC_FAIL_SIG 0xfee1dead
-
-/* Distinctive exit code used to indicate MSAN trip condition: */
-
-#define MSAN_ERROR 86
-
-/* Designated file descriptors for forkserver commands (the application will
- use FORKSRV_FD and FORKSRV_FD + 1): */
-
-#define FORKSRV_FD 198
-
-/* Fork server init timeout multiplier: we'll wait the user-selected
- timeout plus this much for the fork server to spin up. */
-
-#define FORK_WAIT_MULT 10
-
-/* Calibration timeout adjustments, to be a bit more generous when resuming
- fuzzing sessions or trying to calibrate already-added internal finds.
- The first value is a percentage, the other is in milliseconds: */
-
-#define CAL_TMOUT_PERC 125
-#define CAL_TMOUT_ADD 50
-
-/* Number of chances to calibrate a case before giving up: */
-
-#define CAL_CHANCES 3
-
-/* Map size for the traced binary (2^MAP_SIZE_POW2). Must be greater than
- 2; you probably want to keep it under 18 or so for performance reasons
- (adjusting AFL_INST_RATIO when compiling is probably a better way to solve
- problems with complex programs). You need to recompile the target binary
- after changing this - otherwise, SEGVs may ensue. */
-
-#define MAP_SIZE_POW2 16
-#define MAP_SIZE (1 << MAP_SIZE_POW2)
-
-/* Maximum allocator request size (keep well under INT_MAX): */
-
-#define MAX_ALLOC 0x40000000
-
-/* A made-up hashing seed: */
-
-#define HASH_CONST 0xa5b35705
-
-/* Constants for afl-gotcpu to control busy loop timing: */
-
-#define CTEST_TARGET_MS 5000
-#define CTEST_CORE_TRG_MS 1000
-#define CTEST_BUSY_CYCLES (10 * 1000 * 1000)
-
-/* Uncomment this to use inferior block-coverage-based instrumentation. Note
- that you need to recompile the target binary for this to have any effect: */
-
-// #define COVERAGE_ONLY
-
-/* Uncomment this to ignore hit counts and output just one bit per tuple.
- As with the previous setting, you will need to recompile the target
- binary: */
-
-// #define SKIP_COUNTS
-
-/* Uncomment this to use instrumentation data to record newly discovered paths,
- but do not use them as seeds for fuzzing. This is useful for conveniently
- measuring coverage that could be attained by a "dumb" fuzzing algorithm: */
-
-// #define IGNORE_FINDS
-
-#endif /* ! _HAVE_CONFIG_H */
diff --git a/chromium/third_party/afl/src/debug.h b/chromium/third_party/afl/src/debug.h
deleted file mode 100644
index a943a573bdb..00000000000
--- a/chromium/third_party/afl/src/debug.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- american fuzzy lop - debug / error handling macros
- --------------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- */
-
-#ifndef _HAVE_DEBUG_H
-#define _HAVE_DEBUG_H
-
-#include <errno.h>
-
-#include "types.h"
-#include "config.h"
-
-/*******************
- * Terminal colors *
- *******************/
-
-#ifdef USE_COLOR
-
-# define cBLK "\x1b[0;30m"
-# define cRED "\x1b[0;31m"
-# define cGRN "\x1b[0;32m"
-# define cBRN "\x1b[0;33m"
-# define cBLU "\x1b[0;34m"
-# define cMGN "\x1b[0;35m"
-# define cCYA "\x1b[0;36m"
-# define cLGR "\x1b[0;37m"
-# define cGRA "\x1b[1;90m"
-# define cLRD "\x1b[1;91m"
-# define cLGN "\x1b[1;92m"
-# define cYEL "\x1b[1;93m"
-# define cLBL "\x1b[1;94m"
-# define cPIN "\x1b[1;95m"
-# define cLCY "\x1b[1;96m"
-# define cBRI "\x1b[1;97m"
-# define cRST "\x1b[0m"
-
-# define bgBLK "\x1b[40m"
-# define bgRED "\x1b[41m"
-# define bgGRN "\x1b[42m"
-# define bgBRN "\x1b[43m"
-# define bgBLU "\x1b[44m"
-# define bgMGN "\x1b[45m"
-# define bgCYA "\x1b[46m"
-# define bgLGR "\x1b[47m"
-# define bgGRA "\x1b[100m"
-# define bgLRD "\x1b[101m"
-# define bgLGN "\x1b[102m"
-# define bgYEL "\x1b[103m"
-# define bgLBL "\x1b[104m"
-# define bgPIN "\x1b[105m"
-# define bgLCY "\x1b[106m"
-# define bgBRI "\x1b[107m"
-
-#else
-
-# define cBLK ""
-# define cRED ""
-# define cGRN ""
-# define cBRN ""
-# define cBLU ""
-# define cMGN ""
-# define cCYA ""
-# define cLGR ""
-# define cGRA ""
-# define cLRD ""
-# define cLGN ""
-# define cYEL ""
-# define cLBL ""
-# define cPIN ""
-# define cLCY ""
-# define cBRI ""
-# define cRST ""
-
-# define bgBLK ""
-# define bgRED ""
-# define bgGRN ""
-# define bgBRN ""
-# define bgBLU ""
-# define bgMGN ""
-# define bgCYA ""
-# define bgLGR ""
-# define bgGRA ""
-# define bgLRD ""
-# define bgLGN ""
-# define bgYEL ""
-# define bgLBL ""
-# define bgPIN ""
-# define bgLCY ""
-# define bgBRI ""
-
-#endif /* ^USE_COLOR */
-
-/*************************
- * Box drawing sequences *
- *************************/
-
-#ifdef FANCY_BOXES
-
-# define SET_G1 "\x1b)0" /* Set G1 for box drawing */
-# define RESET_G1 "\x1b)B" /* Reset G1 to ASCII */
-# define bSTART "\x0e" /* Enter G1 drawing mode */
-# define bSTOP "\x0f" /* Leave G1 drawing mode */
-# define bH "q" /* Horizontal line */
-# define bV "x" /* Vertical line */
-# define bLT "l" /* Left top corner */
-# define bRT "k" /* Right top corner */
-# define bLB "m" /* Left bottom corner */
-# define bRB "j" /* Right bottom corner */
-# define bX "n" /* Cross */
-# define bVR "t" /* Vertical, branch right */
-# define bVL "u" /* Vertical, branch left */
-# define bHT "v" /* Horizontal, branch top */
-# define bHB "w" /* Horizontal, branch bottom */
-
-#else
-
-# define SET_G1 ""
-# define RESET_G1 ""
-# define bSTART ""
-# define bSTOP ""
-# define bH "-"
-# define bV "|"
-# define bLT "+"
-# define bRT "+"
-# define bLB "+"
-# define bRB "+"
-# define bX "+"
-# define bVR "+"
-# define bVL "+"
-# define bHT "+"
-# define bHB "+"
-
-#endif /* ^FANCY_BOXES */
-
-/***********************
- * Misc terminal codes *
- ***********************/
-
-#define TERM_HOME "\x1b[H"
-#define TERM_CLEAR TERM_HOME "\x1b[2J"
-#define cEOL "\x1b[0K"
-#define CURSOR_HIDE "\x1b[?25l"
-#define CURSOR_SHOW "\x1b[?25h"
-
-/************************
- * Debug & error macros *
- ************************/
-
-/* Just print stuff to the appropriate stream. */
-
-#ifdef MESSAGES_TO_STDOUT
-# define SAYF(x...) printf(x)
-#else
-# define SAYF(x...) fprintf(stderr, x)
-#endif /* ^MESSAGES_TO_STDOUT */
-
-/* Show a prefixed warning. */
-
-#define WARNF(x...) do { \
- SAYF(cYEL "[!] " cBRI "WARNING: " cRST x); \
- SAYF(cRST "\n"); \
- } while (0)
-
-/* Show a prefixed "doing something" message. */
-
-#define ACTF(x...) do { \
- SAYF(cLBL "[*] " cRST x); \
- SAYF(cRST "\n"); \
- } while (0)
-
-/* Show a prefixed "success" message. */
-
-#define OKF(x...) do { \
- SAYF(cLGN "[+] " cRST x); \
- SAYF(cRST "\n"); \
- } while (0)
-
-/* Show a prefixed fatal error message (not used in afl). */
-
-#define BADF(x...) do { \
- SAYF(cLRD "\n[-] " cRST x); \
- SAYF(cRST "\n"); \
- } while (0)
-
-/* Die with a verbose non-OS fatal error message. */
-
-#define FATAL(x...) do { \
- SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] PROGRAM ABORT : " \
- cBRI x); \
- SAYF(cLRD "\n Location : " cRST "%s(), %s:%u\n\n", \
- __FUNCTION__, __FILE__, __LINE__); \
- exit(1); \
- } while (0)
-
-/* Die by calling abort() to provide a core dump. */
-
-#define ABORT(x...) do { \
- SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] PROGRAM ABORT : " \
- cBRI x); \
- SAYF(cLRD "\n Stop location : " cRST "%s(), %s:%u\n\n", \
- __FUNCTION__, __FILE__, __LINE__); \
- abort(); \
- } while (0)
-
-/* Die while also including the output of perror(). */
-
-#define PFATAL(x...) do { \
- fflush(stdout); \
- SAYF(bSTOP RESET_G1 CURSOR_SHOW cRST cLRD "\n[-] SYSTEM ERROR : " \
- cBRI x); \
- SAYF(cLRD "\n Stop location : " cRST "%s(), %s:%u\n", \
- __FUNCTION__, __FILE__, __LINE__); \
- SAYF(cLRD " OS message : " cRST "%s\n", strerror(errno)); \
- exit(1); \
- } while (0)
-
-/* Die with FAULT() or PFAULT() depending on the value of res (used to
- interpret different failure modes for read(), write(), etc). */
-
-#define RPFATAL(res, x...) do { \
- if (res < 0) PFATAL(x); else FATAL(x); \
- } while (0)
-
-/* Error-checking versions of read() and write() that call RPFATAL() as
- appropriate. */
-
-#define ck_write(fd, buf, len, fn) do { \
- u32 _len = (len); \
- s32 _res = write(fd, buf, _len); \
- if (_res != _len) RPFATAL(_res, "Short write to %s", fn); \
- } while (0)
-
-#define ck_read(fd, buf, len, fn) do { \
- u32 _len = (len); \
- s32 _res = read(fd, buf, _len); \
- if (_res != _len) RPFATAL(_res, "Short read from %s", fn); \
- } while (0)
-
-#endif /* ! _HAVE_DEBUG_H */
diff --git a/chromium/third_party/afl/src/docs/ChangeLog b/chromium/third_party/afl/src/docs/ChangeLog
deleted file mode 100644
index 3eb01a731a7..00000000000
--- a/chromium/third_party/afl/src/docs/ChangeLog
+++ /dev/null
@@ -1,2541 +0,0 @@
-=========
-ChangeLog
-=========
-
- This is the list of all noteworthy changes made in every public release of
- the tool. See README for the general instruction manual.
-
-----------------
-Staying informed
-----------------
-
-Want to stay in the loop on major new features? Join our mailing list by
-sending a mail to <afl-users+subscribe@googlegroups.com>.
-
-Not sure if you should upgrade? The lowest currently recommended version
-is 2.31b. If you're stuck on an earlier release, it's strongly advisable
-to get on with the times.
-
---------------
-Version 2.38b:
---------------
-
- - Added -mllvm -sanitizer-coverage-block-threshold=0 to trace-pc-guard
- mode, as suggested by Kostya Serebryany.
-
---------------
-Version 2.37b:
---------------
-
- - Fixed a typo. Spotted by Jakub Wilk.
-
- - Fixed support for make install when using trace-pc. Spotted by
- Kurt Roeckx.
-
- - Switched trace-pc to trace-pc-guard, which should be considerably
- faster and is less quirky. Kudos to Konstantin Serebryany (and sorry
- for dragging my feet).
-
- Note that for some reason, this mode doesn't perform as well as
- "vanilla" afl-clang-fast / afl-clang.
-
---------------
-Version 2.36b:
---------------
-
- - Fixed a cosmetic bad free() bug when aborting -S sessions. Spotted
- by Johannes S.
-
- - Made a small change to afl-whatsup to sort fuzzers by name.
-
- - Fixed a minor issue with malloc(0) in libdislocator. Spotted by
- Rene Freingruber.
-
- - Changed the clobber pattern in libdislocator to a slightly more
- reliable one. Suggested by Rene Freingruber.
-
- - Added a note about THP performance. Suggested by Sergey Davidoff.
-
- - Added a somewhat unofficial support for running afl-tmin with a
- baseline "mask" that causes it to minimize only for edges that
- are unique to the input file, but not to the "boring" baseline.
- Suggested by Sami Liedes.
-
- - "Fixed" a getPassName() problem with never versions of clang.
- Reported by Craig Young and several other folks.
-
- Yep, I know I have a backlog on several other feature requests.
- Stay tuned!
-
---------------
-Version 2.35b:
---------------
-
- - Fixed a minor cmdline reporting glitch, spotted by Leo Barnes.
-
- - Fixed a silly bug in libdislocator. Spotted by Johannes Schultz.
-
---------------
-Version 2.34b:
---------------
-
- - Added a note about afl-tmin to technical_details.txt.
-
- - Added support for AFL_NO_UI, as suggested by Leo Barnes.
-
---------------
-Version 2.33b:
---------------
-
- - Added code to strip -Wl,-z,defs and -Wl,--no-undefined for afl-clang-fast,
- since they interfere with -shared. Spotted and diagnosed by Toby Hutton.
-
- - Added some fuzzing tips for Android.
-
---------------
-Version 2.32b:
---------------
-
- - Added a check for AFL_HARDEN combined with AFL_USE_*SAN. Suggested by
- Hanno Boeck.
-
- - Made several other cosmetic adjustments to cycle timing in the wake of the
- big tweak made in 2.31b.
-
---------------
-Version 2.31b:
---------------
-
- - Changed havoc cycle counts for a marked performance boost, especially
- with -S / -d. See the discussion of FidgetyAFL in:
-
- https://groups.google.com/forum/#!topic/afl-users/fOPeb62FZUg
-
- While this does not implement the approach proposed by the authors of
- the CCS paper, the solution is a result of digging into that research;
- more improvements may follow as I do more experiments and get more
- definitive data.
-
---------------
-Version 2.30b:
---------------
-
- - Made minor improvements to persistent mode to avoid the remote
- possibility of "no instrumentation detected" issues with very low
- instrumentation densities.
-
- - Fixed a minor glitch with a leftover process in persistent mode.
- Reported by Jakub Wilk and Daniel Stender.
-
- - Made persistent mode bitmaps a bit more consistent and adjusted the way
- this is shown in the UI, especially in persistent mode.
-
---------------
-Version 2.29b:
---------------
-
- - Made a minor #include fix to llvm_mode. Suggested by Jonathan Metzman.
-
- - Made cosmetic updates to the docs.
-
---------------
-Version 2.28b:
---------------
-
- - Added "life pro tips" to docs/.
-
- - Moved testcases/_extras/ to dictionaries/ for visibility.
-
- - Made minor improvements to install scripts.
-
- - Added an important safety tip.
-
---------------
-Version 2.27b:
---------------
-
- - Added libtokencap, a simple feature to intercept strcmp / memcmp and
- generate dictionary entries that can help extend coverage.
-
- - Moved libdislocator to its own dir, added README.
-
- - The demo in experimental/instrumented_cmp is no more.
-
---------------
-Version 2.26b:
---------------
-
- - Made a fix for libdislocator.so to compile on MacOS X.
-
- - Added support for DYLD_INSERT_LIBRARIES.
-
- - Renamed AFL_LD_PRELOAD to AFL_PRELOAD.
-
---------------
-Version 2.25b:
---------------
-
- - Made some cosmetic updates to libdislocator.so, renamed one env
- variable.
-
---------------
-Version 2.24b:
---------------
-
- - Added libdislocator.so, an experimental, abusive allocator. Try
- it out with AFL_LD_PRELOAD=/path/to/libdislocator.so when running
- afl-fuzz.
-
---------------
-Version 2.23b:
---------------
-
- - Improved the stability metric for persistent mode binaries. Problem
- spotted by Kurt Roeckx.
-
- - Made a related improvement that may bring the metric to 100% for those
- targets.
-
---------------
-Version 2.22b:
---------------
-
- - Mentioned the potential conflicts between MSAN / ASAN and FORTIFY_SOURCE.
- There is no automated check for this, since some distros may implicitly
- set FORTIFY_SOURCE outside of the compiler's argv[].
-
- - Populated the support for AFL_LD_PRELOAD to all companion tools.
-
- - Made a change to the handling of ./afl-clang-fast -v. Spotted by
- Jan Kneschke.
-
---------------
-Version 2.21b:
---------------
-
- - Added some crash reporting notes for Solaris in docs/INSTALL, as
- investigated by Martin Carpenter.
-
- - Fixed a minor UI mix-up with havoc strategy stats.
-
---------------
-Version 2.20b:
---------------
-
- - Revamped the handling of variable paths, replacing path count with a
- "stability" score to give users a much better signal. Based on the
- feedback from Vegard Nossum.
-
- - Made a stability improvement to the syncing behavior with resuming
- fuzzers. Based on the feedback from Vegard.
-
- - Changed the UI to include current input bitmap density along with
- total density. Ditto.
-
- - Added experimental support for parallelizing -M.
-
---------------
-Version 2.19b:
---------------
-
- - Made a fix to make sure that auto CPU binding happens at non-overlapping
- times.
-
---------------
-Version 2.18b:
---------------
-
- - Made several performance improvements to has_new_bits() and
- classify_counts(). This should offer a robust performance bump with
- fast targets.
-
---------------
-Version 2.17b:
---------------
-
- - Killed the error-prone and manual -Z option. On Linux, AFL will now
- automatically bind to the first free core (or complain if there are no
- free cores left).
-
- - Made some doc updates along these lines.
-
---------------
-Version 2.16b:
---------------
-
- - Improved support for older versions of clang (hopefully without
- breaking anything).
-
- - Moved version data from Makefile to config.h. Suggested by
- Jonathan Metzman.
-
---------------
-Version 2.15b:
---------------
-
- - Added a README section on looking for non-crashing bugs.
-
- - Added license data to several boring files. Contributed by
- Jonathan Metzman.
-
---------------
-Version 2.14b:
---------------
-
- - Added FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION as a macro defined when
- compiling with afl-gcc and friends. Suggested by Kostya Serebryany.
-
- - Refreshed some of the non-x86 docs.
-
---------------
-Version 2.13b:
---------------
-
- - Fixed a spurious build test error with trace-pc and llvm_mode/Makefile.
- Spotted by Markus Teufelberger.
-
- - Fixed a cosmetic issue with afl-whatsup. Spotted by Brandon Perry.
-
---------------
-Version 2.12b:
---------------
-
- - Fixed a minor issue in afl-tmin that can make alphabet minimization less
- efficient during passes > 1. Spotted by Daniel Binderman.
-
---------------
-Version 2.11b:
---------------
-
- - Fixed a minor typo in instrumented_cmp, spotted by Hanno Eissfeldt.
-
- - Added a missing size check for deterministic insertion steps.
-
- - Made an improvement to afl-gotcpu when -Z not used.
-
- - Fixed a typo in post_library_png.so.c in experimental/. Spotted by Kostya
- Serebryany.
-
---------------
-Version 2.10b:
---------------
-
- - Fixed a minor core counting glitch, reported by Tyler Nighswander.
-
---------------
-Version 2.09b:
---------------
-
- - Made several documentation updates.
-
- - Added some visual indicators to promote and simplify the use of -Z.
-
---------------
-Version 2.08b:
---------------
-
- - Added explicit support for -m32 and -m64 for llvm_mode. Inspired by
- a request from Christian Holler.
-
- - Added a new benchmarking option, as requested by Kostya Serebryany.
-
---------------
-Version 2.07b:
---------------
-
- - Added CPU affinity option (-Z) on Linux. With some caution, this can
- offer a significant (10%+) performance bump and reduce jitter.
- Proposed by Austin Seipp.
-
- - Updated afl-gotcpu to use CPU affinity where supported.
-
- - Fixed confusing CPU_TARGET error messages with QEMU build. Spotted by
- Daniel Komaromy and others.
-
---------------
-Version 2.06b:
---------------
-
- - Worked around LLVM persistent mode hiccups with -shared code.
- Contributed by Christian Holler.
-
- - Added __AFL_COMPILER as a convenient way to detect that something is
- built under afl-gcc / afl-clang / afl-clang-fast and enable custom
- optimizations in your code. Suggested by Pedro Corte-Real.
-
- - Upstreamed several minor changes developed by Franjo Ivancic to
- allow AFL to be built as a library. This is fairly use-specific and
- may have relatively little appeal to general audiences.
-
---------------
-Version 2.05b:
---------------
-
- - Put __sanitizer_cov_module_init & co behind #ifdef to avoid problems
- with ASAN. Spotted by Christian Holler.
-
---------------
-Version 2.04b:
---------------
-
- - Removed indirect-calls coverage from -fsanitize-coverage (since it's
- redundant). Spotted by Kostya Serebryany.
-
---------------
-Version 2.03b:
---------------
-
- - Added experimental -fsanitize-coverage=trace-pc support that goes with
- some recent additions to LLVM, as implemented by Kostya Serebryany.
- Right now, this is cumbersome to use with common build systems, so
- the mode remains undocumented.
-
- - Made several substantial improvements to better support non-standard
- map sizes in LLVM mode.
-
- - Switched LLVM mode to thread-local execution tracing, which may offer
- better results in some multithreaded apps.
-
- - Fixed a minor typo, reported by Heiko Eissfeldt.
-
- - Force-disabled symbolization for ASAN, as suggested by Christian Holler.
-
- - AFL_NOX86 renamed to AFL_NO_X86 for consistency.
-
- - Added AFL_LD_PRELOAD to allow LD_PRELOAD to be set for targets without
- affecting AFL itself. Suggested by Daniel Godas-Lopez.
-
---------------
-Version 2.02b:
---------------
-
- - Fixed a "lcamtuf can't count to 16" bug in the havoc stage. Reported
- by Guillaume Endignoux.
-
---------------
-Version 2.01b:
---------------
-
- - Made an improvement to cycle counter color coding, based on feedback
- from Shai Sarfaty.
-
- - Added a mention of aflize to sister_projects.txt.
-
- - Fixed an installation issue with afl-as, as spotted by ilovezfs.
-
---------------
-Version 2.00b:
---------------
-
- - Cleaned up color handling after a minor snafu in 1.99b (affecting some
- terminals).
-
- - Made minor updates to the documentation.
-
---------------
-Version 1.99b:
---------------
-
- - Substantially revamped the output and the internal logic of afl-analyze.
-
- - Cleaned up some of the color handling code and added support for
- background colors.
-
- - Removed some stray files (oops).
-
- - Updated docs to better explain afl-analyze.
-
---------------
-Version 1.98b:
---------------
-
- - Improved to "boring string" detection in afl-analyze.
-
- - Added technical_details.txt for afl-analyze.
-
---------------
-Version 1.97b:
---------------
-
- - Added afl-analyze, a nifty tool to analyze the structure of a file
- based on the feedback from AFL instrumentation. This is kinda experimental,
- so field reports welcome.
-
- - Added a mention of afl-cygwin.
-
- - Fixed a couple of typos, as reported by Jakub Wilk and others.
-
---------------
-Version 1.96b:
---------------
-
- - Added -fpic to CFLAGS for the clang plugin, as suggested by Hanno Boeck.
-
- - Made another clang change (IRBuilder) suggested by Jeff Trull.
-
- - Fixed several typos, spotted by Jakub Wilk.
-
- - Added support for AFL_SHUFFLE_QUEUE, based on discussions with
- Christian Holler.
-
---------------
-Version 1.95b:
---------------
-
- - Fixed a harmless bug when handling -B. Spotted by Jacek Wielemborek.
-
- - Made the exit message a bit more accurate when AFL_EXIT_WHEN_DONE is set.
-
- - Added some error-checking for old-style forkserver syntax. Suggested by
- Ben Nagy.
-
- - Switched from exit() to _exit() in injected code to avoid snafus with
- destructors in C++ code. Spotted by sunblate.
-
- - Made a change to avoid spuriously setting __AFL_SHM_ID when
- AFL_DUMB_FORKSRV is set in conjunction with -n. Spotted by Jakub Wilk.
-
---------------
-Version 1.94b:
---------------
-
- - Changed allocator alignment to improve support for non-x86 systems (now
- that llvm_mode makes this more feasible).
-
- - Fixed a minor typo in afl-cmin. Spotted by Jonathan Neuschafer.
-
- - Fixed an obscure bug that would affect people trying to use afl-gcc
- with $TMP set but $TMPDIR absent. Spotted by Jeremy Barnes.
-
---------------
-Version 1.93b:
---------------
-
- - Hopefully fixed a problem with MacOS X and persistent mode, spotted by
- Leo Barnes.
-
---------------
-Version 1.92b:
---------------
-
- - Made yet another C++ fix (namespaces). Reported by Daniel Lockyer.
-
---------------
-Version 1.91b:
---------------
-
- - Made another fix to make 1.90b actually work properly with C++ (d'oh).
- Problem spotted by Daniel Lockyer.
-
---------------
-Version 1.90b:
---------------
-
- - Fixed a minor typo spotted by Kai Zhao; and made several other minor updates
- to docs.
-
- - Updated the project URL for python-afl. Requested by Jakub Wilk.
-
- - Fixed a potential problem with deferred mode signatures getting optimized
- out by the linker (with --gc-sections).
-
---------------
-Version 1.89b:
---------------
-
- - Revamped the support for persistent and deferred forkserver modes.
- Both now feature simpler syntax and do not require companion env
- variables. Suggested by Jakub Wilk.
-
- - Added a bit more info about afl-showmap. Suggested by Jacek Wielemborek.
-
---------------
-Version 1.88b:
---------------
-
- - Made AFL_EXIT_WHEN_DONE work in non-tty mode. Issue spotted by
- Jacek Wielemborek.
-
---------------
-Version 1.87b:
---------------
-
- - Added QuickStartGuide.txt, a one-page quick start doc.
-
- - Fixed several typos spotted by Dominique Pelle.
-
- - Revamped several parts of README.
-
---------------
-Version 1.86b:
---------------
-
- - Added support for AFL_SKIP_CRASHES, which is a very hackish solution to
- the problem of resuming sessions with intermittently crashing inputs.
-
- - Removed the hard-fail terminal size check, replaced with a dynamic
- warning shown in place of the UI. Based on feedback from Christian Holler.
-
- - Fixed a minor typo in show_stats. Spotted by Dingbao Xie.
-
---------------
-Version 1.85b:
---------------
-
- - Fixed a garbled sentence in notes on parallel fuzzing. Thanks to Jakub Wilk.
-
- - Fixed a minor glitch in afl-cmin. Spotted by Jonathan Foote.
-
---------------
-Version 1.84b:
---------------
-
- - Made SIMPLE_FILES behave as expected when naming backup directories for
- crashes and hangs.
-
- - Added the total number of favored paths to fuzzer_stats. Requested by
- Ben Nagy.
-
- - Made afl-tmin, afl-fuzz, and afl-cmin reject negative values passed to
- -t and -m, since they generally won't work as expected.
-
- - Made a fix for no lahf / sahf support on older versions of FreeBSD.
- Patch contributed by Alex Moneger.
-
---------------
-Version 1.83b:
---------------
-
- - Fixed a problem with xargs -d on non-Linux systems in afl-cmin. Spotted by
- teor2345 and Ben Nagy.
-
- - Fixed an implicit declaration in LLVM mode on MacOS X. Reported by
- Kai Zhao.
-
---------------
-Version 1.82b:
---------------
-
- - Fixed a harmless but annoying race condition in persistent mode - signal
- delivery is a bit more finicky than I thought.
-
- - Updated the documentation to explain persistent mode a bit better.
-
- - Tweaked AFL_PERSISTENT to force AFL_NO_VAR_CHECK.
-
---------------
-Version 1.81b:
---------------
-
- - Added persistent mode for in-process fuzzing. See llvm_mode/README.llvm.
- Inspired by Kostya Serebryany and Christian Holler.
-
- - Changed the in-place resume code to preserve crashes/README.txt. Suggested
- by Ben Nagy.
-
- - Included a potential fix for LLVM mode issues on MacOS X, based on the
- investigation done by teor2345.
-
---------------
-Version 1.80b:
---------------
-
- - Made afl-cmin tolerant of whitespaces in filenames. Suggested by
- Jonathan Neuschafer and Ketil Froyn.
-
- - Added support for AFL_EXIT_WHEN_DONE, as suggested by Michael Rash.
-
---------------
-Version 1.79b:
---------------
-
- - Added support for dictionary levels, see testcases/README.testcases.
-
- - Reworked the SQL dictionary to use levels.
-
- - Added a note about Preeny.
-
---------------
-Version 1.78b:
---------------
-
- - Added a dictionary for PDF, contributed by Ben Nagy.
-
- - Added several references to afl-cov, a new tool by Michael Rash.
-
- - Fixed a problem with crash reporter detection on MacOS X, as reported by
- Louis Dassy.
-
---------------
-Version 1.77b:
---------------
-
- - Extended the -x option to support single-file dictionaries.
-
- - Replaced factory-packaged dictionaries with file-based variants.
-
- - Removed newlines from HTML keywords in testcases/_extras/html/.
-
---------------
-Version 1.76b:
---------------
-
- - Very significantly reduced the number of duplicate execs during
- deterministic checks, chiefly in int16 and int32 stages. Confirmed
- identical path yields. This should improve early-stage efficiency by
- around 5-10%.
-
- - Reduced the likelihood of duplicate non-deterministic execs by
- bumping up lowest stacking factor from 1 to 2. Quickly confirmed
- that this doesn't seem to have significant impact on coverage with
- libpng.
-
- - Added a note about integrating afl-fuzz with third-party tools.
-
---------------
-Version 1.75b:
---------------
-
- - Improved argv_fuzzing to allow it to emit empty args. Spotted by Jakub
- Wilk.
-
- - afl-clang-fast now defines __AFL_HAVE_MANUAL_INIT. Suggested by Jakub Wilk.
-
- - Fixed a libtool-related bug with afl-clang-fast that would make some
- ./configure invocations generate incorrect output. Spotted by Jakub Wilk.
-
- - Removed flock() on Solaris. This means no locking on this platform,
- but so be it. Problem reported by Martin Carpenter.
-
- - Fixed a typo. Reported by Jakub Wilk.
-
---------------
-Version 1.74b:
---------------
-
- - Added an example argv[] fuzzing wrapper in experimental/argv_fuzzing.
- Reworked the bash example to be faster, too.
-
- - Clarified llvm_mode prerequisites for FreeBSD.
-
- - Improved afl-tmin to use /tmp if cwd is not writeable.
-
- - Removed redundant includes for sys/fcntl.h, which caused warnings with
- some nitpicky versions of libc.
-
- - Added a corpus of basic HTML tags that parsers are likely to pay attention
- to (no attributes).
-
- - Added EP_EnabledOnOptLevel0 to llvm_mode, so that the instrumentation is
- inserted even when AFL_DONT_OPTIMIZE=1 is set.
-
- - Switched qemu_mode to use the newly-released QEMU 2.3.0, which contains
- a couple of minor bugfixes.
-
---------------
-Version 1.73b:
---------------
-
- - Fixed a pretty stupid bug in effector maps that could sometimes cause
- AFL to fuzz slightly more than necessary; and in very rare circumstances,
- could lead to SEGV if eff_map is aligned with page boundary and followed
- by an unmapped page. Spotted by Jonathan Gray.
-
---------------
-Version 1.72b:
---------------
-
- - Fixed a glitch in non-x86 install, spotted by Tobias Ospelt.
-
- - Added a minor safeguard to llvm_mode Makefile following a report from
- Kai Zhao.
-
---------------
-Version 1.71b:
---------------
-
- - Fixed a bug with installed copies of AFL trying to use QEMU mode. Spotted
- by G.M. Lime.
-
- - Added last path / crash / hang times to fuzzer_stats, suggested by
- Richard Hipp.
-
- - Fixed a typo, thanks to Jakub Wilk.
-
---------------
-Version 1.70b:
---------------
-
- - Modified resumption code to reuse the original timeout value when resuming
- a session if -t is not given. This prevents timeout creep in continuous
- fuzzing.
-
- - Added improved error messages for failed handshake when AFL_DEFER_FORKSRV
- is set.
-
- - Made a slight improvement to llvm_mode/Makefile based on feedback from
- Jakub Wilk.
-
- - Refreshed several bits of documentation.
-
- - Added a more prominent note about the MacOS X trade-offs to Makefile.
-
---------------
-Version 1.69b:
---------------
-
- - Added support for deferred initialization in LLVM mode. Suggested by
- Richard Godbee.
-
---------------
-Version 1.68b:
---------------
-
- - Fixed a minor PRNG glitch that would make the first seconds of a fuzzing
- job deterministic. Thanks to Andreas Stieger.
-
- - Made tmp[] static in the LLVM runtime to keep Valgrind happy (this had
- no impact on anything else). Spotted by Richard Godbee.
-
- - Clarified the footnote in README.
-
---------------
-Version 1.67b:
---------------
-
- - Made one more correction to llvm_mode Makefile, spotted by Jakub Wilk.
-
---------------
-Version 1.66b:
---------------
-
- - Added CC / CXX support to llvm_mode Makefile. Requested by Charlie Eriksen.
-
- - Fixed 'make clean' with gmake. Suggested by Oliver Schneider.
-
- - Fixed 'make -j n clean all'. Suggested by Oliver Schneider.
-
- - Removed build date and time from banners to give people deterministic
- builds. Requested by Jakub Wilk.
-
---------------
-Version 1.65b:
---------------
-
- - Fixed a snafu with some leftover code in afl-clang-fast.
-
- - Corrected even moar typos.
-
---------------
-Version 1.64b:
---------------
-
- - Further simplified afl-clang-fast runtime by reverting .init_array to
- __attribute__((constructor(0)). This should improve compatibility with
- non-ELF platforms.
-
- - Fixed a problem with afl-clang-fast and -shared libraries. Simplified
- the code by getting rid of .preinit_array and replacing it with a .comm
- object. Problem reported by Charlie Eriksen.
-
- - Removed unnecessary instrumentation density adjustment for the LLVM mode.
- Reported by Jonathan Neuschafer.
-
---------------
-Version 1.63b:
---------------
-
- - Updated cgroups_asan/ with a new version from Sam, made a couple changes
- to streamline it and keep parallel afl instances in separate groups.
-
- - Fixed typos, thanks to Jakub Wilk.
-
---------------
-Version 1.62b:
---------------
-
- - Improved the handling of -x in afl-clang-fast,
-
- - Improved the handling of low AFL_INST_RATIO settings for QEMU and
- LLVM modes.
-
- - Fixed the llvm-config bug for good (thanks to Tobias Ospelt).
-
---------------
-Version 1.61b:
---------------
-
- - Fixed an obscure bug compiling OpenSSL with afl-clang-fast. Patch by
- Laszlo Szekeres.
-
- - Fixed a 'make install' bug on non-x86 systems, thanks to Tobias Ospelt.
-
- - Fixed a problem with half-broken llvm-config on Odroid, thanks to
- Tobias Ospelt. (There is another odd bug there that hasn't been fully
- fixed - TBD).
-
---------------
-Version 1.60b:
---------------
-
- - Allowed experimental/llvm_instrumentation/ to graduate to llvm_mode/.
-
- - Removed experimental/arm_support/, since it's completely broken and likely
- unnecessary with LLVM support in place.
-
- - Added ASAN cgroups script to experimental/asan_cgroups/, updated existing
- docs. Courtesy Sam Hakim and David A. Wheeler.
-
- - Refactored afl-tmin to reduce the number of execs in common use cases.
- Ideas from Jonathan Neuschafer and Turo Lamminen.
-
- - Added a note about CLAs at the bottom of README.
-
- - Renamed testcases_readme.txt to README.testcases for some semblance of
- consistency.
-
- - Made assorted updates to docs.
-
- - Added MEM_BARRIER() to afl-showmap and afl-tmin, just to be safe.
-
---------------
-Version 1.59b:
---------------
-
- - Imported Laszlo Szekeres' experimental LLVM instrumentation into
- experimental/llvm_instrumentation. I'll work on including it in the
- "mainstream" version soon.
-
- - Fixed another typo, thanks to Jakub Wilk.
-
---------------
-Version 1.58b:
---------------
-
- - Added a workaround for abort() behavior in -lpthread programs in QEMU mode.
- Spotted by Aidan Thornton.
-
- - Made several documentation updates, including links to the static
- instrumentation tool (sister_projects.txt).
-
---------------
-Version 1.57b:
---------------
-
- - Fixed a problem with exception handling on some versions of MacOS X.
- Spotted by Samir Aguiar and Anders Wang Kristensen.
-
- - Tweaked afl-gcc to use BIN_PATH instead of a fixed string in help
- messages.
-
---------------
-Version 1.56b:
---------------
-
- - Renamed related_work.txt to historical_notes.txt.
-
- - Made minor edits to the ASAN doc.
-
- - Added docs/sister_projects.txt with a list of inspired or closely
- related utilities.
-
---------------
-Version 1.55b:
---------------
-
- - Fixed a glitch with afl-showmap opening /dev/null with O_RDONLY when
- running in quiet mode. Spotted by Tyler Nighswander.
-
---------------
-Version 1.54b:
---------------
-
- - Added another postprocessor example for PNG.
-
- - Made a cosmetic fix to realloc() handling in experimental/post_library/,
- suggested by Jakub Wilk.
-
- - Improved -ldl handling. Suggested by Jakub Wilk.
-
---------------
-Version 1.53b:
---------------
-
- - Fixed an -l ordering issue that is apparently still a problem on Ubuntu.
- Spotted by William Robinet.
-
---------------
-Version 1.52b:
---------------
-
- - Added support for file format postprocessors. Requested by Ben Nagy. This
- feature is intentionally buried, since it's fairly easy to misuse and
- useful only in some scenarios. See experimental/post_library/.
-
---------------
-Version 1.51b:
---------------
-
- - Made it possible to properly override LD_BIND_NOW after one very unusual
- report of trouble.
-
- - Cleaned up typos, thanks to Jakub Wilk.
-
- - Fixed a bug in AFL_DUMB_FORKSRV.
-
---------------
-Version 1.50b:
---------------
-
- - Fixed a flock() bug that would prevent dir reuse errors from kicking
- in every now and then.
-
- - Renamed references to ppvm (the project is now called recidivm).
-
- - Made improvements to file descriptor handling to avoid leaving some fds
- unnecessarily open in the child process.
-
- - Fixed a typo or two.
-
---------------
-Version 1.49b:
---------------
-
- - Added code to save original command line in fuzzer_stats and
- crashes/README.txt. Also saves fuzzer version in fuzzer_stats.
- Requested by Ben Nagy.
-
---------------
-Version 1.48b:
---------------
-
- - Fixed a bug with QEMU fork server crashes when translation is attempted
- after a jump to an invalid pointer in the child process (i.e., after
- bumping into a particularly nasty security bug in the tested binary).
- Reported by Tyler Nighswander.
-
---------------
-Version 1.47b:
---------------
-
- - Fixed a bug with afl-cmin in -Q mode complaining about binary being not
- instrumented. Thanks to Jonathan Neuschafer for the bug report.
-
- - Fixed another bug with argv handling for afl-fuzz in -Q mode. Reported
- by Jonathan Neuschafer.
-
- - Improved the use of colors when showing crash counts in -C mode.
-
---------------
-Version 1.46b:
---------------
-
- - Improved instrumentation performance on 32-bit systems by getting rid of
- xor-swap (oddly enough, xor-swap is still faster on 64-bit) and tweaking
- alignment.
-
- - Made path depth numbers more accurate with imported test cases.
-
---------------
-Version 1.45b:
---------------
-
- - Added support for SIMPLE_FILES in config.h for folks who don't like
- descriptive file names. Generates very simple names without colons,
- commas, plus signs, dashes, etc.
-
- - Replaced zero-sized files with symlinks in the variable behavior state
- dir to simplify examining the relevant test cases.
-
- - Changed the period of limited-range block ops from 5 to 10 minutes based
- on a couple of experiments. The basic goal of this delay timer behavior
- is to better support jobs that are seeded with completely invalid files,
- in which case, the first few queue cycles may be completed very quickly
- without discovering new paths. Should have no effect on well-seeded jobs.
-
- - Made several minor updates to docs.
-
---------------
-Version 1.44b:
---------------
-
- - Corrected two bungled attempts to get the -C mode work properly
- with afl-cmin (accounting for the short-lived releases tagged 1.42 and
- 1.43b) - sorry.
-
- - Removed AFL_ALLOW_CRASHES in favor of the -C mode in said tool.
-
- - Said goodbye to Hello Kitty, as requested by Padraig Brady.
-
---------------
-Version 1.41b:
---------------
-
- - Added AFL_ALLOW_CRASHES=1 to afl-cmin. Allows crashing inputs in the
- output corpus. Changed the default behavior to disallow it.
-
- - Made the afl-cmin output dir default to 0700, not 0755, to be consistent
- with afl-fuzz; documented the rationale for 0755 in afl-plot.
-
- - Lowered the output dir reuse time limit to 25 minutes as a dice-roll
- compromise after a discussion on afl-users@.
-
- - Made afl-showmap accept -o /dev/null without borking out.
-
- - Added support for crash / hang info in exit codes of afl-showmap.
-
- - Tweaked block operation scaling to also factor in ballpark run time
- in cases where queue passes take very little time.
-
- - Fixed typos and made improvements to several docs.
-
---------------
-Version 1.40b:
---------------
-
- - Switched to smaller block op sizes during the first passes over the
- queue. Helps keep test cases small.
-
- - Added memory barrier for run_target(), just in case compilers get
- smarter than they are today.
-
- - Updated a bunch of docs.
-
---------------
-Version 1.39b:
---------------
-
- - Added the ability to skip inputs by sending SIGUSR1 to the fuzzer.
-
- - Reworked several portions of the documentation.
-
- - Changed the code to reset splicing perf scores between runs to keep
- them closer to intended length.
-
- - Reduced the minimum value of -t to 5 for afl-fuzz (~200 exec/sec)
- and to 10 for auxiliary tools (due to the absence of a fork server).
-
- - Switched to more aggressive default timeouts (rounded up to 25 ms
- versus 50 ms - ~40 execs/sec) and made several other cosmetic changes
- to the timeout code.
-
---------------
-Version 1.38b:
---------------
-
- - Fixed a bug in the QEMU build script, spotted by William Robinet.
-
- - Improved the reporting of skipped bitflips to keep the UI counters a bit
- more accurate.
-
- - Cleaned up related_work.txt and added some non-goals.
-
- - Fixed typos, thanks to Jakub Wilk.
-
---------------
-Version 1.37b:
---------------
-
- - Added effector maps, which detect regions that do not seem to respond
- to bitflips and subsequently exclude them from more expensive steps
- (arithmetics, known ints, etc). This should offer significant performance
- improvements with quite a few types of text-based formats, reducing the
- number of deterministic execs by a factor of 2 or so.
-
- - Cleaned up mem limit handling in afl-cmin.
-
- - Switched from uname -i to uname -m to work around Gentoo-specific
- issues with coreutils when building QEMU. Reported by William Robinet.
-
- - Switched from PID checking to flock() to detect running sessions.
- Problem, against all odds, bumped into by Jakub Wilk.
-
- - Added SKIP_COUNTS and changed the behavior of COVERAGE_ONLY in config.h.
- Useful only for internal benchmarking.
-
- - Made improvements to UI refresh rates and exec/sec stats to make them
- more stable.
-
- - Made assorted improvements to the documentation and to the QEMU build
- script.
-
- - Switched from perror() to strerror() in error macros, thanks to Jakub
- Wilk for the nag.
-
- - Moved afl-cmin back to bash, wasn't thinking straight. It has to stay
- on bash because other shells may have restrictive limits on array sizes.
-
---------------
-Version 1.36b:
---------------
-
- - Switched afl-cmin over to /bin/sh. Thanks to Jonathan Gray.
-
- - Fixed an off-by-one bug in queue limit check when resuming sessions
- (could cause NULL ptr deref if you are *really* unlucky).
-
- - Fixed the QEMU script to tolerate i686 if returned by uname -i. Based on
- a problem report from Sebastien Duquette.
-
- - Added multiple references to Jakub's ppvm tool.
-
- - Made several minor improvements to the Makefile.
-
- - Believe it or not, fixed some typos. Thanks to Jakub Wilk.
-
---------------
-Version 1.35b:
---------------
-
- - Cleaned up regular expressions in some of the scripts to avoid errors
- on *BSD systems. Spotted by Jonathan Gray.
-
---------------
-Version 1.34b:
---------------
-
- - Performed a substantial documentation and program output cleanup to
- better explain the QEMU feature.
-
---------------
-Version 1.33b:
---------------
-
- - Added support for AFL_INST_RATIO and AFL_INST_LIBS in the QEMU mode.
-
- - Fixed a stack allocation crash in QEMU mode (bug in QEMU, fixed with
- an extra patch applied to the downloaded release).
-
- - Added code to test the QEMU instrumentation once the afl-qemu-trace
- binary is built.
-
- - Modified afl-tmin and afl-showmap to search $PATH for binaries and to
- better handle QEMU support.
-
- - Added a check for instrumented binaries when passing -Q to afl-fuzz.
-
---------------
-Version 1.32b:
---------------
-
- - Fixed 'make install' following the QEMU changes. Spotted by Hanno Boeck.
-
- - Fixed EXTRA_PAR handling in afl-cmin.
-
---------------
-Version 1.31b:
---------------
-
- - Hallelujah! Thanks to Andrew Griffiths, we now support very fast, black-box
- instrumentation of binary-only code. See qemu_mode/README.qemu.
-
- To use this feature, you need to follow the instructions in that
- directory and then run afl-fuzz with -Q.
-
---------------
-Version 1.30b:
---------------
-
- - Added -s (summary) option to afl-whatsup. Suggested by Jodie Cunningham.
-
- - Added a sanity check in afl-tmin to detect minimization to zero len or
- excess hangs.
-
- - Fixed alphabet size counter in afl-tmin.
-
- - Slightly improved the handling of -B in afl-fuzz.
-
- - Fixed process crash messages with -m none.
-
---------------
-Version 1.29b:
---------------
-
- - Improved the naming of test cases when orig: is already present in the file
- name.
-
- - Made substantial improvements to technical_details.txt.
-
---------------
-Version 1.28b:
---------------
-
- - Made a minor tweak to the instrumentation to preserve the directionality
- of tuples (i.e., A -> B != B -> A) and to maintain the identity of tight
- loops (A -> A). You need to recompile targeted binaries to leverage this.
-
- - Cleaned up some of the afl-whatsup stats.
-
- - Added several sanity checks to afl-cmin.
-
---------------
-Version 1.27b:
---------------
-
- - Made afl-tmin recursive. Thanks to Hanno Boeck for the tip.
-
- - Added docs/technical_details.txt.
-
- - Changed afl-showmap search strategy in afl-cmap to just look into the
- same place that afl-cmin is executed from. Thanks to Jakub Wilk.
-
- - Removed current_todo.txt and cleaned up the remaining docs.
-
---------------
-Version 1.26b:
---------------
-
- - Added total execs/sec stat for afl-whatsup.
-
- - afl-cmin now auto-selects between cp or ln. Based on feedback from
- Even Huus.
-
- - Fixed a typo. Thanks to Jakub Wilk.
-
- - Made afl-gotcpu a bit more accurate by using getrusage instead of
- times. Thanks to Jakub Wilk.
-
- - Fixed a memory limit issue during the build process on NetBSD-current.
- Reported by Thomas Klausner.
-
---------------
-Version 1.25b:
---------------
-
- - Introduced afl-whatsup, a simple tool for querying the status of
- local synced instances of afl-fuzz.
-
- - Added -x compiler to clang options on Darwin. Suggested by Filipe
- Cabecinhas.
-
- - Improved exit codes for afl-gotcpu.
-
- - Improved the checks for -m and -t values in afl-cmin. Bug report
- from Evan Huus.
-
---------------
-Version 1.24b:
---------------
-
- - Introduced afl-getcpu, an experimental tool to empirically measure
- CPU preemption rates. Thanks to Jakub Wilk for the idea.
-
---------------
-Version 1.23b:
---------------
-
- - Reverted one change to afl-cmin that actually made it slower.
-
---------------
-Version 1.22b:
---------------
-
- - Reworked afl-showmap.c to support normal options, including -o, -q,
- -e. Also added support for timeouts and memory limits.
-
- - Made changes to afl-cmin and other scripts to accommodate the new
- semantics.
-
- - Officially retired AFL_EDGES_ONLY.
-
- - Fixed another typo in afl-tmin, courtesy of Jakub Wilk.
-
---------------
-Version 1.21b:
---------------
-
- - Graduated minimize_corpus.sh to afl-cmin. It is now a first-class
- utility bundled with the fuzzer.
-
- - Made significant improvements to afl-cmin to make it faster, more
- robust, and more versatile.
-
- - Refactored some of afl-tmin code to make it a bit more readable.
-
- - Made assorted changes to the doc to document afl-cmin and other stuff.
-
---------------
-Version 1.20b:
---------------
-
- - Added AFL_DUMB_FORKSRV, as requested by Jakub Wilk. This works only
- in -n mode and allows afl-fuzz to run with "dummy" fork servers that
- don't output any instrumentation, but follow the same protocol.
-
- - Renamed AFL_SKIP_CHECKS to AFL_SKIP_BIN_CHECK to make it at least
- somewhat descriptive.
-
- - Switched to using clang as the default assembler on MacOS X to work
- around Xcode issues with newer builds of clang. Testing and patch by
- Nico Weber.
-
- - Fixed a typo (via Jakub Wilk).
-
---------------
-Version 1.19b:
---------------
-
- - Improved exec failure detection in afl-fuzz and afl-showmap.
-
- - Improved Ctrl-C handling in afl-showmap.
-
- - Added afl-tmin, a handy instrumentation-enabled minimizer.
-
---------------
-Version 1.18b:
---------------
-
- - Fixed a serious but short-lived bug in the resumption behavior introduced
- in version 1.16b.
-
- - Added -t nn+ mode for soft-skipping timing-out paths.
-
---------------
-Version 1.17b:
---------------
-
- - Fixed a compiler warning introduced in 1.16b for newer versions of GCC.
- Thanks to Jakub Wilk and Ilfak Guilfanov.
-
- - Improved the consistency of saving fuzzer_stats, bitmap info, and
- auto-dictionaries when aborting fuzzing sessions.
-
- - Made several noticeable performance improvements to deterministic arith
- and known int steps.
-
---------------
-Version 1.16b:
---------------
-
- - Added a bit of code to make resumption pick up from the last known
- offset in the queue, rather than always rewinding to the start. Suggested
- by Jakub Wilk.
-
- - Switched to tighter timeout control for slow programs (3x rather than
- 5x average exec speed at init).
-
---------------
-Version 1.15b:
---------------
-
- - Added support for AFL_NO_VAR_CHECK to speed up resumption and inhibit
- variable path warnings for some programs.
-
- - Made the trimmer run even for variable paths, since there is no special
- harm in doing so and it can be very beneficial if the trimming still
- pans out.
-
- - Made the UI a bit more descriptive by adding "n/a" instead of "0" in a
- couple of corner cases.
-
---------------
-Version 1.14b:
---------------
-
- - Added a (partial) dictionary for JavaScript.
-
- - Added AFL_NO_CPU_RED, as suggested by Jakub Wilk.
-
- - Tweaked the havoc scaling logic added in 1.12b.
-
---------------
-Version 1.13b:
---------------
-
- - Improved the performance of minimize_corpus.sh by switching to a
- sort-based approach.
-
- - Made several minor revisions to the docs.
-
---------------
-Version 1.12b:
---------------
-
- - Made an improvement to dictionary generation to avoid runs of identical
- bytes.
-
- - Added havoc cycle scaling to help with slow binaries in -d mode. Based on
- a thread with Sami Liedes.
-
- - Added AFL_SYNC_FIRST for afl-fuzz. This is useful for those who obsess
- over stats, no special purpose otherwise.
-
- - Switched to more robust box drawing codes, suggested by Jakub Wilk.
-
- - Created faster 64-bit variants of several critical-path bitmap functions
- (sorry, no difference on 32 bits).
-
- - Fixed moar typos, as reported by Jakub Wilk.
-
---------------
-Version 1.11b:
---------------
-
- - Added a bit more info about dictionary strategies to the status screen.
-
---------------
-Version 1.10b:
---------------
-
- - Revised the dictionary behavior to use insertion and overwrite in
- deterministic steps, rather than just the latter. This improves coverage
- with SQL and the like.
-
- - Added a mention of "*" in status_screen.txt, as suggested by Jakub Wilk.
-
---------------
-Version 1.09b:
---------------
-
- - Corrected a cosmetic problem with 'extras' stage count not always being
- accurate in the stage yields view.
-
- - Fixed a typo reported by Jakub Wilk and made some minor documentation
- improvements.
-
---------------
-Version 1.08b:
---------------
-
- - Fixed a div-by-zero bug in the newly-added code when using a dictionary.
-
---------------
-Version 1.07b:
---------------
-
- - Added code that automatically finds and extracts syntax tokens from the
- input corpus.
-
- - Fixed a problem with ld dead-code removal option on MacOS X, reported
- by Filipe Cabecinhas.
-
- - Corrected minor typos spotted by Jakub Wilk.
-
- - Added a couple of more exotic archive format samples.
-
---------------
-Version 1.06b:
---------------
-
- - Switched to slightly more accurate (if still not very helpful) reporting
- of short read and short write errors. These theoretically shouldn't happen
- unless you kill the forkserver or run out of disk space. Suggested by
- Jakub Wilk.
-
- - Revamped some of the allocator and debug code, adding comments and
- cleaning up other mess.
-
- - Tweaked the odds of fuzzing non-favored test cases to make sure that
- baseline coverage of all inputs is reached sooner.
-
---------------
-Version 1.05b:
---------------
-
- - Added a dictionary for WebP.
-
- - Made some additional performance improvements to minimize_corpus.sh,
- getting deeper into the bash woods.
-
---------------
-Version 1.04b:
---------------
-
- - Made substantial performance improvements to minimize_corpus.sh with
- large datasets, albeit at the expense of having to switch back to bash
- (other shells may have limits on array sizes, etc).
-
- - Tweaked afl-showmap to support the format used by the new script.
-
---------------
-Version 1.03b:
---------------
-
- - Added code to skip README.txt in the input directory to make the crash
- exploration mode work better. Suggested by Jakub Wilk.
-
- - Added a dictionary for SQLite.
-
---------------
-Version 1.02b:
---------------
-
- - Reverted the ./ search path in minimize_corpus.sh because people did
- not like it.
-
- - Added very explicit warnings not to run various shell scripts that
- read or write to /tmp/ (since this is generally a pretty bad idea on
- multi-user systems).
-
- - Added a check for /tmp binaries and -f locations in afl-fuzz.
-
---------------
-Version 1.01b:
---------------
-
- - Added dictionaries for XML and GIF.
-
---------------
-Version 1.00b:
---------------
-
- - Slightly improved the performance of minimize_corpus.sh, especially on
- Linux.
-
- - Made a couple of improvements to calibration timeouts for resumed scans.
-
---------------
-Version 0.99b:
---------------
-
- - Fixed minimize_corpus.sh to work with dash, as suggested by Jakub Wilk.
-
- - Modified minimize_corpus.sh to try locate afl-showmap in $PATH and ./.
- The first part requested by Jakub Wilk.
-
- - Added support for afl-as --version, as required by one funky build
- script. Reported by William Robinet.
-
---------------
-Version 0.98b:
---------------
-
- - Added a dictionary for TIFF.
-
- - Fixed another cosmetic snafu with stage exec counts for -x.
-
- - Switched afl-plot to /bin/sh, since it seems bashism-free. Also tried
- to remove any obvious bashisms from other experimental/ scripts,
- most notably including minimize_corpus.sh and triage_crashes.sh.
- Requested by Jonathan Gray.
-
---------------
-Version 0.97b:
---------------
-
- - Fixed cosmetic issues around the naming of -x strategy files.
-
- - Added a dictionary for JPEG.
-
- - Fixed a very rare glitch when running instrumenting 64-bit code that makes
- heavy use of xmm registers that are also touched by glibc.
-
---------------
-Version 0.96b:
---------------
-
- - Added support for extra dictionaries, provided testcases/_extras/png/
- as a demo.
-
- - Fixed a minor bug in number formatting routines used by the UI.
-
- - Added several additional PNG test cases that are relatively unlikely
- to be hit by chance.
-
- - Fixed afl-plot syntax for gnuplot 5.x. Reported by David Necas.
-
---------------
-Version 0.95b:
---------------
-
- - Cleaned up the OSX ReportCrash code. Thanks to Tobias Ospelt for help.
-
- - Added some extra tips for AFL_NO_FORKSERVER on OSX.
-
- - Refreshed the INSTALL file.
-
---------------
-Version 0.94b:
---------------
-
- - Added in-place resume (-i-) to address a common user complaint.
-
- - Added an awful workaround for ReportCrash on MacOS X. Problem
- spotted by Joseph Gentle.
-
---------------
-Version 0.93b:
---------------
-
- - Fixed the link() workaround, as reported by Jakub Wilk.
-
---------------
-Version 0.92b:
---------------
-
- - Added support for reading test cases from another filesystem.
- Requested by Jakub Wilk.
-
- - Added pointers to the mailing list.
-
- - Added a sample PDF document.
-
---------------
-Version 0.91b:
---------------
-
- - Refactored minimize_corpus.sh to make it a bit more user-friendly and to
- select for smallest files, not largest bitmaps. Offers a modest corpus
- size improvement in most cases.
-
- - Slightly improved the performance of splicing code.
-
---------------
-Version 0.90b:
---------------
-
- - Moved to an algorithm where paths are marked as preferred primarily based
- on size and speed, rather than bitmap coverage. This should offer
- noticeable performance gains in many use cases.
-
- - Refactored path calibration code; calibration now takes place as soon as a
- test case is discovered, to facilitate better prioritization decisions later
- on.
-
- - Changed the way of marking variable paths to avoid .state metadata
- inconsistencies.
-
- - Made sure that calibration routines always create a new test case to avoid
- hypothetical problems with utilities that modify the input file.
-
- - Added bitmap saturation to fuzzer stats and plot data.
-
- - Added a testcase for JPEG XR.
-
- - Added a tty check for the colors warning in Makefile, to keep distro build
- logs tidy. Suggested by Jakub Wilk.
-
---------------
-Version 0.89b:
---------------
-
- - Renamed afl-plot.sh to afl-plot, as requested by Padraig Brady.
-
- - Improved the compatibility of afl-plot with older versions of gnuplot.
-
- - Added banner information to fuzzer_stats, populated it to afl-plot.
-
---------------
-Version 0.88b:
---------------
-
- - Added support for plotting, with design and implementation based on a
- prototype design proposed by Michael Rash. Huge thanks!
-
- - Added afl-plot.sh, which allows you to, well, generate a nice plot using
- this data.
-
- - Refactored the code slightly to make more frequent updates to fuzzer_stats
- and to provide more detail about synchronization.
-
- - Added an fflush(stdout) call for non-tty operation, as requested by
- Joonas Kuorilehto.
-
- - Added some detail to fuzzer_stats for parity with plot_file.
-
---------------
-Version 0.87b:
---------------
-
- - Added support for MSAN, via AFL_USE_MSAN, same gotchas as for ASAN.
-
---------------
-Version 0.86b:
---------------
-
- - Added AFL_NO_FORKSRV, allowing the forkserver to be bypassed. Suggested
- by Ryan Govostes.
-
- - Simplified afl-showmap.c to make use of the no-forkserver mode.
-
- - Made minor improvements to crash_triage.sh, as suggested by Jakub Wilk.
-
---------------
-Version 0.85b:
---------------
-
- - Fixed the CPU counting code - no sysctlbyname() on OpenBSD, d'oh. Bug
- reported by Daniel Dickman.
-
- - Made a slight correction to error messages - the advice on testing
- with ulimit was a tiny bit off by a factor of 1024.
-
---------------
-Version 0.84b:
---------------
-
- - Added support for the CPU widget on some non-Linux platforms (I hope).
- Based on feedback from Ryan Govostes.
-
- - Cleaned up the changelog (very meta).
-
---------------
-Version 0.83b:
---------------
-
- - Added experimental/clang_asm_normalize/ and related notes in
- env_variables.txt and afl-as.c. Thanks to Ryan Govostes for the idea.
-
- - Added advice on hardware utilization in README.
-
---------------
-Version 0.82b:
---------------
-
- - Made additional fixes for Xcode support, juggling -Q and -q flags. Thanks to
- Ryan Govostes.
-
- - Added a check for __asm__ blocks and switches to .intel_syntax in assembly.
- Based on feedback from Ryan Govostes.
-
---------------
-Version 0.81b:
---------------
-
- - A workaround for Xcode 6 as -Q flag glitch. Spotted by Ryan Govostes.
-
- - Improved Solaris build instructions, as suggested by Martin Carpenter.
-
- - Fix for a slightly busted path scoring conditional. Minor practical impact.
-
---------------
-Version 0.80b:
---------------
-
- - Added a check for $PATH-induced loops. Problem noticed by Kartik Agaram.
-
- - Added AFL_KEEP_ASSEMBLY for easier troubleshooting.
-
- - Added an override for AFL_USE_ASAN if set at afl compile time. Requested by
- Hanno Boeck.
-
---------------
-Version 0.79b:
---------------
-
- - Made minor adjustments to path skipping logic.
-
- - Made several documentation updates to reflect the path selection changes
- made in 0.78b.
-
---------------
-Version 0.78b:
---------------
-
- - Added a CPU governor check. Bug report from Joe Zbiciak.
-
- - Favored paths are now selected strictly based on new edges, not hit
- counts. This speeds up the first pass by a factor of 3-6x without
- significantly impacting ultimate coverage (tested with libgif, libpng,
- libjpeg).
-
- It also allows some performance & memory usage improvements by making
- some of the in-memory bitmaps much smaller.
-
- - Made multiple significant performance improvements to bitmap checking
- functions, plus switched to a faster hash.
-
- - Owing largely to these optimizations, bumped the size of the bitmap to
- 64k and added a warning to detect older binaries that rely on smaller
- bitmaps.
-
---------------
-Version 0.77b:
---------------
-
- - Added AFL_SKIP_CHECKS to bypass binary checks when really warranted.
- Feature requested by Jakub Wilk.
-
- - Fixed a couple of typos.
-
- - Added a warning for runs that are aborted early on.
-
---------------
-Version 0.76b:
---------------
-
- - Incorporated another signal handling fix for Solaris. Suggestion
- submitted by Martin Carpenter.
-
---------------
-Version 0.75b:
---------------
-
- - Implemented a slightly more "elegant" kludge for the %llu glitch (see
- types.h).
-
- - Relaxed CPU load warnings to stay in sync with reality.
-
---------------
-Version 0.74b:
---------------
-
- - Switched to more responsive exec speed averages and better UI speed
- scaling.
-
- - Fixed a bug with interrupted reads on Solaris. Issue spotted by Martin
- Carpenter.
-
---------------
-Version 0.73b:
---------------
-
- - Fixed a stray memcpy() instead of memmove() on overlapping buffers.
- Mostly harmless but still dumb. Mistake spotted thanks to David Higgs.
-
---------------
-Version 0.72b:
---------------
-
- - Bumped map size up to 32k. You may want to recompile instrumented
- binaries (but nothing horrible will happen if you don't).
-
- - Made huge performance improvements for bit-counting functions.
-
- - Default optimizations now include -funroll-loops. This should have
- interesting effects on the instrumentation. Frankly, I'm just going to
- ship it and see what happens next. I have a good feeling about this.
-
- - Made a fix for stack alignment crash on MacOS X 10.10; looks like the
- rhetorical question in the comments in afl-as.h has been answered.
- Tracked down by Mudge Zatko.
-
---------------
-Version 0.71b:
---------------
-
- - Added a fix for the nonsensical MacOS ELF check. Spotted by Mudge Zatko.
-
- - Made some improvements to ASAN checks.
-
---------------
-Version 0.70b:
---------------
-
- - Added explicit detection of ASANified binaries.
-
- - Fixed compilation issues on Solaris. Reported by Martin Carpenter.
-
---------------
-Version 0.69b:
---------------
-
- - Improved the detection of non-instrumented binaries.
-
- - Made the crash counter in -C mode accurate.
-
- - Fixed an obscure install bug that made afl-as non-functional with the tool
- installed to /usr/bin instead of /usr/local/bin. Found by Florian Kiersch.
-
- - Fixed for a cosmetic SIGFPE when Ctrl-C is pressed while the fork server
- is spinning up.
-
---------------
-Version 0.68b:
---------------
-
- - Added crash exploration mode! Woot!
-
---------------
-Version 0.67b:
---------------
-
- - Fixed several more typos, the project is now cartified 100% typo-free.
- Thanks to Thomas Jarosch and Jakub Wilk.
-
- - Made a change to write fuzzer_stats early on.
-
- - Fixed a glitch when (not!) running on MacOS X as root. Spotted by Tobias
- Ospelt.
-
- - Made it possible to override -O3 in Makefile. Suggested by Jakub Wilk.
-
---------------
-Version 0.66b:
---------------
-
- - Fixed a very obscure issue with build systems that use gcc as an assembler
- for hand-written .s files; this would confuse afl-as. Affected nss, reported
- by Hanno Boeck.
-
- - Fixed a bug when cleaning up synchronized fuzzer output dirs. Issue reported
- by Thomas Jarosch.
-
---------------
-Version 0.65b:
---------------
-
- - Cleaned up shell printf escape codes in Makefile. Reported by Jakub Wilk.
-
- - Added more color to fuzzer_stats, provided short documentation of the file
- format, and made several other stats-related improvements.
-
---------------
-Version 0.64b:
---------------
-
- - Enabled GCC support on MacOS X.
-
---------------
-Version 0.63b:
---------------
-
- - Provided a new, simplified way to pass data in files (@@). See README.
-
- - Made additional fixes for 64-bit MacOS X, working around a crashing bug in
- their linker (umpf) and several other things. It's alive!
-
- - Added a minor workaround for a bug in 64-bit FreeBSD (clang -m32 -g doesn't
- work on that platform, but clang -m32 does, so we no longer insert -g).
-
- - Added a build-time warning for inverse video terminals and better
- instructions in status_screen.txt.
-
---------------
-Version 0.62b:
---------------
-
- - Made minor improvements to the allocator, as suggested by Tobias Ospelt.
-
- - Added example instrumented memcmp() in experimental/instrumented_cmp.
-
- - Added a speculative fix for MacOS X (clang detection, again).
-
- - Fixed typos in parallel_fuzzing.txt. Problems spotted by Thomas Jarosch.
-
---------------
-Version 0.61b:
---------------
-
- - Fixed a minor issue with clang detection on systems with a clang cc
- wrapper, so that afl-gcc doesn't confuse it with GCC.
-
- - Made cosmetic improvements to docs and to the CPU load indicator.
-
- - Fixed a glitch with crash removal (README.txt left behind, d'oh).
-
---------------
-Version 0.60b:
---------------
-
- - Fixed problems with jump tables generated by exotic versions of GCC. This
- solves an outstanding problem on OpenBSD when using afl-gcc + PIE (not
- present with afl-clang).
-
- - Fixed permissions on one of the sample archives.
-
- - Added a lahf / sahf workaround for OpenBSD (their assembler doesn't know
- about these opcodes).
-
- - Added docs/INSTALL.
-
---------------
-Version 0.59b:
---------------
-
- - Modified 'make install' to also install test cases.
-
- - Provided better pointers to installed README in afl-fuzz.
-
- - More work on RLIMIT_AS for OpenBSD.
-
---------------
-Version 0.58b:
---------------
-
- - Added a core count check on Linux.
-
- - Refined the code for the lack-of-RLIMIT_AS case on OpenBSD.
-
- - Added a rudimentary CPU utilization meter to help with optimal loading.
-
---------------
-Version 0.57b:
---------------
-
- - Made fixes to support FreeBSD and OpenBSD: use_64bit is now inferred if not
- explicitly specified when calling afl-as, and RLIMIT_AS is behind an #ifdef.
- Thanks to Fabian Keil and Jonathan Gray for helping troubleshoot this.
-
- - Modified 'make install' to also install docs (in /usr/local/share/doc/afl).
-
- - Fixed a typo in status_screen.txt.
-
- - Made a couple of Makefile improvements as proposed by Jakub Wilk.
-
---------------
-Version 0.56b:
---------------
-
- - Added probabilistic instrumentation density reduction in ASAN mode. This
- compensates for ASAN-specific branches in a crude but workable way.
-
- - Updated notes_for_asan.txt.
-
---------------
-Version 0.55b:
---------------
-
- - Implemented smarter out_dir behavior, automatically deleting directories
- that don't contain anything of special value. Requested by several folks,
- including Hanno Boeck.
-
- - Added more detail in fuzzer_stats (start time, run time, fuzzer PID).
-
- - Implemented support for configurable install prefixes in Makefile
- ($PREFIX), as requested by Luca Barbato.
-
- - Made it possible to resume by doing -i <out_dir>, without having to specify
- -i <out_dir>/queue/.
-
---------------
-Version 0.54b:
---------------
-
- - Added a fix for -Wformat warning messages (oops, I thought this had been in
- place for a while).
-
---------------
-Version 0.53b:
---------------
-
- - Redesigned the crash & hang duplicate detection code to better deal with
- fault conditions that can be reached in a multitude of ways.
-
- The old approach could be compared to hashing stack traces to de-dupe
- crashes, a method prone to crash count inflation. The alternative I
- wanted to avoid would be equivalent to just looking at crash %eip,
- which can have false negatives in common functions such as memcpy().
-
- The middle ground currently used in afl-fuzz can be compared to looking
- at every line item in the stack trace and tagging crashes as unique if
- we see any function name that we haven't seen before (or if something that
- we have *always* seen there suddenly disappears). We do the comparison
- without paying any attention to ordering or hit counts. This can still
- cause some crash inflation early on, but the problem will quickly taper
- off. So, you may get 20 dupes instead of 5,000.
-
- - Added a fix for harmless but absurd trim ratios shown if the first exec in
- the trimmer timed out. Spotted by @EspenGx.
-
---------------
-Version 0.52b:
---------------
-
- - Added a quick summary of the contents in experimental/.
-
- - Made a fix to the process of writing fuzzer_stats.
-
- - Slightly reorganized the .state/ directory, now recording redundant paths,
- too. Note that this breaks the ability to properly resume older sessions
- - sorry about that.
-
- (To fix this, simply move <out_dir>/.state/* from an older run
- to <out_dir>/.state/deterministic_done/*.)
-
---------------
-Version 0.51b:
---------------
-
- - Changed the search order for afl-as to avoid the problem with older copies
- installed system-wide; this also means that I can remove the Makefile check
- for that.
-
- - Made it possible to set instrumentation ratio of 0%.
-
- - Introduced some typos, fixed others.
-
- - Fixed the test_prev target in Makefile, as reported by Ozzy Johnson.
-
---------------
-Version 0.50b:
---------------
-
- - Improved the 'make install' logic, as suggested by Padraig Brady.
-
- - Revamped various bits of the documentation, especially around perf_tips.txt;
- based on the feedback from Alexander Cherepanov.
-
- - Added AFL_INST_RATIO to afl-as. The only case where this comes handy is
- ffmpeg, at least as far as I can tell. (Trivia: the current version of
- ffmpeg ./configure also ignores CC and --cc, probably unintentionally).
-
- - Added documentation for all environmental variables (env_variables.txt).
-
- - Implemented a visual warning for excessive or insufficient bitmap density.
-
- - Changed afl-gcc to add -O3 by default; use AFL_DONT_OPTIMIZE if you don't
- like that. Big speed gain for ffmpeg, so seems like a good idea.
-
- - Made a regression fix to afl-as to ignore .LBB labels in gcc mode.
-
---------------
-Version 0.49b:
---------------
-
- - Fixed more typos, as found by Jakub Wilk.
-
- - Added support for clang!
-
- - Changed AFL_HARDEN to *not* include ASAN by default. Use AFL_USE_ASAN if
- needed. The reasons for this are in notes_for_asan.txt.
-
- - Switched from configure auto-detection to isatty() to keep afl-as and
- afl-gcc quiet.
-
- - Improved installation process to properly create symlinks, rather than
- copies of binaries.
-
---------------
-Version 0.48b:
---------------
-
- - Improved afl-fuzz to force-set ASAN_OPTIONS=abort_on_error=1. Otherwise,
- ASAN crashes wouldn't be caught at all. Reported by Hanno Boeck.
-
- - Improved Makefile mkdir logic, as suggested by Hanno Boeck.
-
- - Improved the 64-bit instrumentation to properly save r8-r11 registers in
- the x86 setup code. The old behavior could cause rare problems running
- *without* instrumentation when the first function called in a particular
- .o file has 5+ parameters. No impact on code running under afl-fuzz or
- afl-showmap. Issue spotted by Padraig Brady.
-
---------------
-Version 0.47b:
---------------
-
- - Fixed another Makefile bug for parallel builds of afl. Problem identified
- by Richard W. M. Jones.
-
- - Added support for suffixes for -m.
-
- - Updated the documentation and added notes_for_asan.txt. Based on feedback
- from Hanno Boeck, Ben Laurie, and others.
-
- - Moved the project to http://lcamtuf.coredump.cx/afl/.
-
---------------
-Version 0.46b:
---------------
-
- - Cleaned up Makefile dependencies for parallel builds. Requested by
- Richard W. M. Jones.
-
- - Added support for DESTDIR in Makefile. Once again suggested by
- Richard W. M. Jones :-)
-
- - Removed all the USE_64BIT stuff; we now just auto-detect compilation mode.
- As requested by many callers to the show.
-
- - Fixed rare problems with programs that use snippets of assembly and
- switch between .code32 and .code64. Addresses a glitch spotted by
- Hanno Boeck with compiling ToT gdb.
-
---------------
-Version 0.45b:
---------------
-
- - Implemented a test case trimmer. Results in 20-30% size reduction for many
- types of work loads, with very pronounced improvements in path discovery
- speeds.
-
- - Added better warnings for various problems with input directories.
-
- - Added a Makefile warning for older copies, based on counterintuitive
- behavior observed by Hovik Manucharyan.
-
- - Added fuzzer_stats file for status monitoring. Suggested by @dronesec.
-
- - Fixed moar typos, thanks to Alexander Cherepanov.
-
- - Implemented better warnings for ASAN memory requirements, based on calls
- from several angry listeners.
-
- - Switched to saner behavior with non-tty stdout (less output generated,
- no ANSI art).
-
---------------
-Version 0.44b:
---------------
-
- - Added support for AFL_CC and AFL_CXX, based on a patch from Ben Laurie.
-
- - Replaced afl-fuzz -S -D with -M for simplicity.
-
- - Added a check for .section .text; lack of this prevented main() from
- getting instrumented for some users. Reported by Tom Ritter.
-
- - Reorganized the testcases/ directory.
-
- - Added an extra check to confirm that the build is operational.
-
- - Made more consistent use of color reset codes, as suggested by Oliver
- Kunz.
-
---------------
-Version 0.43b:
---------------
-
- - Fixed a bug with 64-bit gcc -shared relocs.
-
- - Removed echo -e from Makefile for compatibility with dash. Suggested
- by Jakub Wilk.
-
- - Added status_screen.txt.
-
- - Added experimental/canvas_harness.
-
- - Made a minor change to the Makefile GCC check. Suggested by Hanno Boeck.
-
---------------
-Version 0.42b:
---------------
-
- - Fixed a bug with red zone handling for 64-bit (oops!). Problem reported by
- Felix Groebert.
-
- - Implemented horribly experimental ARM support in experimental/arm_support.
-
- - Made several improvements to error messages.
-
- - Added AFL_QUIET to silence afl-gcc and afl-as when using wonky build
- systems. Reported by Hanno Boeck.
-
- - Improved check for 64-bit compilation, plus several sanity checks
- in Makefile.
-
---------------
-Version 0.41b:
---------------
-
- - Fixed a fork served bug for processes that call execve().
-
- - Made minor compatibility fixes to Makefile, afl-gcc; suggested by Jakub
- Wilk.
-
- - Fixed triage_crashes.sh to work with the new layout of output directories.
- Suggested by Jakub Wilk.
-
- - Made multiple performance-related improvements to the injected
- instrumentation.
-
- - Added visual indication of the number of imported paths.
-
- - Fixed afl-showmap to make it work well with new instrumentation.
-
- - Added much better error messages for crashes when importing test cases
- or otherwise calibrating the binary.
-
---------------
-Version 0.40b:
---------------
-
- - Added support for parallelized fuzzing. Inspired by earlier patch
- from Sebastian Roschke.
-
- - Added an example in experimental/distributed_fuzzing/.
-
---------------
-Version 0.39b:
---------------
-
- - Redesigned status screen, now 90% more spiffy.
-
- - Added more verbose and user-friendly messages for some common problems.
-
- - Modified the resumption code to reconstruct path depth.
-
- - Changed the code to inhibit core dumps and improve the ability to detect
- SEGVs.
-
- - Added a check for redirection of core dumps to programs.
-
- - Made a minor improvement to the handling of variable paths.
-
- - Made additional performance tweaks to afl-fuzz, chiefly around mem limits.
-
- - Added performance_tips.txt.
-
---------------
-Version 0.38b:
---------------
-
- - Fixed an fd leak and +cov tracking bug resulting from changes in 0.37b.
-
- - Implemented auto-scaling for screen update speed.
-
- - Added a visual indication when running in non-instrumented mode.
-
---------------
-Version 0.37b:
---------------
-
- - Added fuzz state tracking for more seamless resumption of aborted
- fuzzing sessions.
-
- - Removed the -D option, as it's no longer necessary.
-
- - Refactored calibration code and improved startup reporting.
-
- - Implemented dynamically scaled timeouts, so that you don't need to
- play with -t except in some very rare cases.
-
- - Added visual notification for slow binaries.
-
- - Improved instrumentation to explicitly cover the other leg of every
- branch.
-
---------------
-Version 0.36b:
---------------
-
- - Implemented fork server support to avoid the overhead of execve(). A
- nearly-verbatim design from Jann Horn; still pending part 2 that would
- also skip initial setup steps (thinking about reliable heuristics now).
-
- - Added a check for shell scripts used as fuzz targets.
-
- - Added a check for fuzz jobs that don't seem to be finding anything.
-
- - Fixed the way IGNORE_FINDS works (was a bit broken after adding splicing
- and path skip heuristics).
-
---------------
-Version 0.35b:
---------------
-
- - Properly integrated 64-bit instrumentation into afl-as.
-
---------------
-Version 0.34b:
---------------
-
- - Added a new exec count classifier (the working theory is that it gets
- meaningful coverage with fewer test cases spewed out).
-
---------------
-Version 0.33b:
---------------
-
- - Switched to new, somewhat experimental instrumentation that tries to
- target only arcs, rather than every line. May be fragile, but is a lot
- faster (2x+).
-
- - Made several other cosmetic fixes and typo corrections, thanks to
- Jakub Wilk.
-
---------------
-Version 0.32b:
---------------
-
- - Another take at fixing the C++ exception thing. Reported by Jakub Wilk.
-
---------------
-Version 0.31b:
---------------
-
- - Made another fix to afl-as to address a potential problem with newer
- versions of GCC (introduced in 0.28b). Thanks to Jann Horn.
-
---------------
-Version 0.30b:
---------------
-
- - Added more detail about the underlying operations in file names.
-
---------------
-Version 0.29b:
---------------
-
- - Made some general improvements to chunk operations.
-
---------------
-Version 0.28b:
---------------
-
- - Fixed C++ exception handling in newer versions of GCC. Problem diagnosed
- by Eberhard Mattes.
-
- - Fixed the handling of the overflow flag. Once again, thanks to
- Eberhard Mattes.
-
---------------
-Version 0.27b:
---------------
-
- - Added prioritization of new paths over the already-fuzzed ones.
-
- - Included spliced test case ID in the output file name.
-
- - Fixed a rare, cosmetic null ptr deref after Ctrl-C.
-
- - Refactored the code to make copies of test cases in the output directory.
-
- - Switched to better output file names, keeping track of stage and splicing
- sources.
-
---------------
-Version 0.26b:
---------------
-
- - Revamped storage of testcases, -u option removed,
-
- - Added a built-in effort minimizer to get rid of potentially redundant
- inputs,
-
- - Provided a testcase count minimization script in experimental/,
-
- - Made miscellaneous improvements to directory and file handling.
-
- - Fixed a bug in timeout detection.
-
---------------
-Version 0.25b:
---------------
-
- - Improved count-based instrumentation.
-
- - Improved the hang deduplication logic.
-
- - Added -cov prefixes for test cases.
-
- - Switched from readdir() to scandir() + alphasort() to preserve ordering of
- test cases.
-
- - Added a splicing strategy.
-
- - Made various minor UI improvements and several other bugfixes.
-
---------------
-Version 0.24b:
---------------
-
- - Added program name to the status screen, plus the -T parameter to go with
- it.
-
---------------
-Version 0.23b:
---------------
-
- - Improved the detection of variable behaviors.
-
- - Added path depth tracking,
-
- - Improved the UI a bit,
-
- - Switched to simplified (XOR-based) tuple instrumentation.
-
---------------
-Version 0.22b:
---------------
-
- - Refactored the handling of long bitflips and some swaps.
-
- - Fixed the handling of gcc -pipe, thanks to anonymous reporter.
-
---------------
-Version 0.21b:
---------------
-
- - Initial public release.
diff --git a/chromium/third_party/afl/src/docs/INSTALL b/chromium/third_party/afl/src/docs/INSTALL
deleted file mode 100644
index 4168e88f587..00000000000
--- a/chromium/third_party/afl/src/docs/INSTALL
+++ /dev/null
@@ -1,183 +0,0 @@
-=========================
-Installation instructions
-=========================
-
- This document provides basic installation instructions and discusses known
- issues for a variety of platforms. See README for the general instruction
- manual.
-
-1) Linux on x86
----------------
-
-This platform is expected to work well. Compile the program with:
-
-$ make
-
-You can start using the fuzzer without installation, but it is also possible to
-install it with:
-
-# make install
-
-There are no special dependencies to speak of; you will need GNU make and a
-working compiler (gcc or clang). Some of the optional scripts bundled with the
-program may depend on bash, gdb, and similar basic tools.
-
-If you are using clang, please review llvm_mode/README.llvm; the LLVM
-integration mode can offer substantial performance gains compared to the
-traditional approach.
-
-You may have to change several settings to get optimal results (most notably,
-disable crash reporting utilities and switch to a different CPU governor), but
-afl-fuzz will guide you through that if necessary.
-
-2) OpenBSD, FreeBSD, NetBSD on x86
-----------------------------------
-
-Similarly to Linux, these platforms are expected to work well and are
-regularly tested. Compile everything with GNU make:
-
-$ gmake
-
-Note that BSD make will *not* work; if you do not have gmake on your system,
-please install it first. As on Linux, you can use the fuzzer itself without
-installation, or install it with:
-
-# gmake install
-
-Keep in mind that if you are using csh as your shell, the syntax of some of the
-shell commands given in the README and other docs will be different.
-
-The llvm_mode requires a dynamically linked, fully-operational installation of
-clang. At least on FreeBSD, the clang binaries are static and do not include
-some of the essential tools, so if you want to make it work, you may need to
-follow the instructions in llvm_mode/README.llvm.
-
-Beyond that, everything should work as advertised.
-
-The QEMU mode is currently supported only on Linux. I think it's just a QEMU
-problem, I couldn't get a vanilla copy of user-mode emulation support working
-correctly on BSD at all.
-
-3) MacOS X on x86
------------------
-
-MacOS X should work, but there are some gotchas due to the idiosyncrasies of
-the platform. On top of this, I have limited release testing capabilities
-and depend mostly on user feedback.
-
-To build AFL, install Xcode and follow the general instructions for Linux.
-
-The Xcode 'gcc' tool is just a wrapper for clang, so be sure to use afl-clang
-to compile any instrumented binaries; afl-gcc will fail unless you have GCC
-installed from another source (in which case, please specify AFL_CC and
-AFL_CXX to point to the "real" GCC binaries).
-
-Only 64-bit compilation will work on the platform; porting the 32-bit
-instrumentation would require a fair amount of work due to the way OS X
-handles relocations, and today, virtually all MacOS X boxes are 64-bit.
-
-The crash reporting daemon that comes by default with MacOS X will cause
-problems with fuzzing. You need to turn it off by following the instructions
-provided here: http://goo.gl/CCcd5u
-
-The fork() semantics on OS X are a bit unusual compared to other unix systems
-and definitely don't look POSIX-compliant. This means two things:
-
- - Fuzzing will be probably slower than on Linux. In fact, some folks report
- considerable performance gains by running the jobs inside a Linux VM on
- MacOS X.
-
- - Some non-portable, platform-specific code may be incompatible with the
- AFL forkserver. If you run into any problems, set AFL_NO_FORKSRV=1 in the
- environment before starting afl-fuzz.
-
-User emulation mode of QEMU does not appear to be supported on MacOS X, so
-black-box instrumentation mode (-Q) will not work.
-
-The llvm_mode requires a fully-operational installation of clang. The one that
-comes with Xcode is missing some of the essential headers and helper tools.
-See llvm_mode/README.llvm for advice on how to build the compiler from scratch.
-
-4) Linux or *BSD on non-x86 systems
------------------------------------
-
-Standard build will fail on non-x86 systems, but you should be able to
-leverage two other options:
-
- - The LLVM mode (see llvm_mode/README.llvm), which does not rely on
- x86-specific assembly shims. It's fast and robust, but requires a
- complete installation of clang.
-
- - The QEMU mode (see qemu_mode/README.qemu), which can be also used for
- fuzzing cross-platform binaries. It's slower and more fragile, but
- can be used even when you don't have the source for the tested app.
-
-If you're not sure what you need, you need the LLVM mode. To get it, try:
-
-$ AFL_NO_X86=1 gmake && gmake -C llvm_mode
-
-...and compile your target program with afl-clang-fast or afl-clang-fast++
-instead of the traditional afl-gcc or afl-clang wrappers.
-
-5) Solaris on x86
------------------
-
-The fuzzer reportedly works on Solaris, but I have not tested this first-hand,
-and the user base is fairly small, so I don't have a lot of feedback.
-
-To get the ball rolling, you will need to use GNU make and GCC or clang. I'm
-being told that the stock version of GCC that comes with the platform does not
-work properly due to its reliance on a hardcoded location for 'as' (completely
-ignoring the -B parameter or $PATH).
-
-To fix this, you may want to build stock GCC from the source, like so:
-
-$ ./configure --prefix=$HOME/gcc --with-gnu-as --with-gnu-ld \
- --with-gmp-include=/usr/include/gmp --with-mpfr-include=/usr/include/mpfr
-$ make
-$ sudo make install
-
-Do *not* specify --with-as=/usr/gnu/bin/as - this will produce a GCC binary that
-ignores the -B flag and you will be back to square one.
-
-Note that Solaris reportedly comes withe crash reporting enabled, which causes
-problems with crashes being misinterpreted as hangs, similarly to the gotchas
-for Linux and MacOS X. AFL does not auto-detect crash reporting on this
-particular platform, but you may need to run the following command:
-
-$ coreadm -d global -d global-setid -d process -d proc-setid \
- -d kzone -d log
-
-User emulation mode of QEMU is not available on Solaris, so black-box
-instrumentation mode (-Q) will not work.
-
-6) Everything else
-------------------
-
-You're on your own. On POSIX-compliant systems, you may be able to compile and
-run the fuzzer; and the LLVM mode may offer a way to instrument non-x86 code.
-
-The fuzzer will not run on Windows. It will also not work under Cygwin. It
-could be ported to the latter platform fairly easily, but it's a pretty bad
-idea, because Cygwin is extremely slow. It makes much more sense to use
-VirtualBox or so to run a hardware-accelerated Linux VM; it will run around
-20x faster or so. If you have a *really* compelling use case for Cygwin, let
-me know.
-
-Although Android on x86 should theoretically work, the stock kernel may have
-SHM support compiled out, and if so, you may have to address that issue first.
-It's possible that all you need is this workaround:
-
- https://github.com/pelya/android-shmem
-
-Joshua J. Drake notes that the Android linker adds a shim that automatically
-intercepts SIGSEGV and related signals. To fix this issue and be able to see
-crashes, you need to put this at the beginning of the fuzzed program:
-
- signal(SIGILL, SIG_DFL);
- signal(SIGABRT, SIG_DFL);
- signal(SIGBUS, SIG_DFL);
- signal(SIGFPE, SIG_DFL);
- signal(SIGSEGV, SIG_DFL);
-
-You may need to #include <signal.h> first.
diff --git a/chromium/third_party/afl/src/docs/QuickStartGuide.txt b/chromium/third_party/afl/src/docs/QuickStartGuide.txt
deleted file mode 100644
index abe7032fda9..00000000000
--- a/chromium/third_party/afl/src/docs/QuickStartGuide.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-=====================
-AFL quick start guide
-=====================
-
-You should read docs/README. It's pretty short. If you really can't, here's
-how to hit the ground running:
-
-1) Compile AFL with 'make'. If build fails, see docs/INSTALL for tips.
-
-2) Find or write a reasonably fast and simple program that takes data from
- a file or stdin, processes it in a test-worthy way, then exits cleanly.
- If testing a network service, modify it to run in the foreground and read
- from stdin. When fuzzing a format that uses checksums, comment out the
- checksum verification code, too.
-
- The program must crash properly when a fault is encountered. Watch out for
- custom SIGSEGV or SIGABRT handlers and background processes. For tips on
- detecting non-crashing flaws, see section 11 in docs/README.
-
-3) Compile the program / library to be fuzzed using afl-gcc. A common way to
- do this would be:
-
- CC=/path/to/afl-gcc CXX=/path/to/afl-g++ ./configure --disable-shared
- make clean all
-
- If program build fails, ping <afl-users@googlegroups.com>.
-
-4) Get a small but valid input file that makes sense to the program. When
- fuzzing verbose syntax (SQL, HTTP, etc), create a dictionary as described in
- dictionaries/README.dictionaries, too.
-
-5) If the program reads from stdin, run 'afl-fuzz' like so:
-
- ./afl-fuzz -i testcase_dir -o findings_dir -- \
- /path/to/tested/program [...program's cmdline...]
-
- If the program takes input from a file, you can put @@ in the program's
- command line; AFL will put an auto-generated file name in there for you.
-
-6) Investigate anything shown in red in the fuzzer UI by promptly consulting
- docs/status_screen.txt.
-
-That's it. Sit back, relax, and - time permitting - try to skim through the
-following files:
-
- - docs/README - A general introduction to AFL,
- - docs/perf_tips.txt - Simple tips on how to fuzz more quickly,
- - docs/status_screen.txt - An explanation of the tidbits shown in the UI,
- - docs/parallel_fuzzing.txt - Advice on running AFL on multiple cores.
diff --git a/chromium/third_party/afl/src/docs/README b/chromium/third_party/afl/src/docs/README
deleted file mode 100644
index 501bdd43f91..00000000000
--- a/chromium/third_party/afl/src/docs/README
+++ /dev/null
@@ -1,507 +0,0 @@
-==================
-american fuzzy lop
-==================
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014, 2015, 2016 Google Inc. All rights reserved.
- Released under terms and conditions of Apache License, Version 2.0.
-
- For new versions and additional information, check out:
- http://lcamtuf.coredump.cx/afl/
-
- To compare notes with other users or get notified about major new features,
- send a mail to <afl-users+subscribe@googlegroups.com>.
-
- ** See QuickStartGuide.txt if you don't have time to read this file. **
-
-1) Challenges of guided fuzzing
--------------------------------
-
-Fuzzing is one of the most powerful and proven strategies for identifying
-security issues in real-world software; it is responsible for the vast
-majority of remote code execution and privilege escalation bugs found to date
-in security-critical software.
-
-Unfortunately, fuzzing is also relatively shallow; blind, random mutations
-make it very unlikely to reach certain code paths in the tested code, leaving
-some vulnerabilities firmly outside the reach of this technique.
-
-There have been numerous attempts to solve this problem. One of the early
-approaches - pioneered by Tavis Ormandy - is corpus distillation. The method
-relies on coverage signals to select a subset of interesting seeds from a
-massive, high-quality corpus of candidate files, and then fuzz them by
-traditional means. The approach works exceptionally well, but requires such
-a corpus to be readily available. In addition, block coverage measurements
-provide only a very simplistic understanding of program state, and are less
-useful for guiding the fuzzing effort in the long haul.
-
-Other, more sophisticated research has focused on techniques such as program
-flow analysis ("concolic execution"), symbolic execution, or static analysis.
-All these methods are extremely promising in experimental settings, but tend
-to suffer from reliability and performance problems in practical uses - and
-currently do not offer a viable alternative to "dumb" fuzzing techniques.
-
-2) The afl-fuzz approach
-------------------------
-
-American Fuzzy Lop is a brute-force fuzzer coupled with an exceedingly simple
-but rock-solid instrumentation-guided genetic algorithm. It uses a modified
-form of edge coverage to effortlessly pick up subtle, local-scale changes to
-program control flow.
-
-Simplifying a bit, the overall algorithm can be summed up as:
-
- 1) Load user-supplied initial test cases into the queue,
-
- 2) Take next input file from the queue,
-
- 3) Attempt to trim the test case to the smallest size that doesn't alter
- the measured behavior of the program,
-
- 4) Repeatedly mutate the file using a balanced and well-researched variety
- of traditional fuzzing strategies,
-
- 5) If any of the generated mutations resulted in a new state transition
- recorded by the instrumentation, add mutated output as a new entry in the
- queue.
-
- 6) Go to 2.
-
-The discovered test cases are also periodically culled to eliminate ones that
-have been obsoleted by newer, higher-coverage finds; and undergo several other
-instrumentation-driven effort minimization steps.
-
-As a side result of the fuzzing process, the tool creates a small,
-self-contained corpus of interesting test cases. These are extremely useful
-for seeding other, labor- or resource-intensive testing regimes - for example,
-for stress-testing browsers, office applications, graphics suites, or
-closed-source tools.
-
-The fuzzer is thoroughly tested to deliver out-of-the-box performance far
-superior to blind fuzzing or coverage-only tools.
-
-3) Instrumenting programs for use with AFL
-------------------------------------------
-
-When source code is available, instrumentation can be injected by a companion
-tool that works as a drop-in replacement for gcc or clang in any standard build
-process for third-party code.
-
-The instrumentation has a fairly modest performance impact; in conjunction with
-other optimizations implemented by afl-fuzz, most programs can be fuzzed as fast
-or even faster than possible with traditional tools.
-
-The correct way to recompile the target program may vary depending on the
-specifics of the build process, but a nearly-universal approach would be:
-
-$ CC=/path/to/afl/afl-gcc ./configure
-$ make clean all
-
-For C++ programs, you'd would also want to set CXX=/path/to/afl/afl-g++.
-
-The clang wrappers (afl-clang and afl-clang++) can be used in the same way;
-clang users may also opt to leverage a higher-performance instrumentation mode,
-as described in llvm_mode/README.llvm.
-
-When testing libraries, you need to find or write a simple program that reads
-data from stdin or from a file and passes it to the tested library. In such a
-case, it is essential to link this executable against a static version of the
-instrumented library, or to make sure that the correct .so file is loaded at
-runtime (usually by setting LD_LIBRARY_PATH). The simplest option is a static
-build, usually possible via:
-
-$ CC=/path/to/afl/afl-gcc ./configure --disable-shared
-
-Setting AFL_HARDEN=1 when calling 'make' will cause the CC wrapper to
-automatically enable code hardening options that make it easier to detect
-simple memory bugs. Libdislocator, a helper library included with AFL (see
-libdislocator/README.dislocator) can help uncover heap corruption issues, too.
-
-PS. ASAN users are advised to review notes_for_asan.txt file for important
-caveats.
-
-4) Instrumenting binary-only apps
----------------------------------
-
-When source code is *NOT* available, the fuzzer offers experimental support for
-fast, on-the-fly instrumentation of black-box binaries. This is accomplished
-with a version of QEMU running in the lesser-known "user space emulation" mode.
-
-QEMU is a project separate from AFL, but you can conveniently build the
-feature by doing:
-
-$ cd qemu_mode
-$ ./build_qemu_support.sh
-
-For additional instructions and caveats, see qemu_mode/README.qemu.
-
-The mode is approximately 2-5x slower than compile-time instrumentation, is
-less conductive to parallelization, and may have some other quirks.
-
-5) Choosing initial test cases
-------------------------------
-
-To operate correctly, the fuzzer requires one or more starting file that
-contains a good example of the input data normally expected by the targeted
-application. There are two basic rules:
-
- - Keep the files small. Under 1 kB is ideal, although not strictly necessary.
- For a discussion of why size matters, see perf_tips.txt.
-
- - Use multiple test cases only if they are functionally different from
- each other. There is no point in using fifty different vacation photos
- to fuzz an image library.
-
-You can find many good examples of starting files in the testcases/ subdirectory
-that comes with this tool.
-
-PS. If a large corpus of data is available for screening, you may want to use
-the afl-cmin utility to identify a subset of functionally distinct files that
-exercise different code paths in the target binary.
-
-6) Fuzzing binaries
--------------------
-
-The fuzzing process itself is carried out by the afl-fuzz utility. This program
-requires a read-only directory with initial test cases, a separate place to
-store its findings, plus a path to the binary to test.
-
-For target binaries that accept input directly from stdin, the usual syntax is:
-
-$ ./afl-fuzz -i testcase_dir -o findings_dir /path/to/program [...params...]
-
-For programs that take input from a file, use '@@' to mark the location in
-the target's command line where the input file name should be placed. The
-fuzzer will substitute this for you:
-
-$ ./afl-fuzz -i testcase_dir -o findings_dir /path/to/program @@
-
-You can also use the -f option to have the mutated data written to a specific
-file. This is useful if the program expects a particular file extension or so.
-
-Non-instrumented binaries can be fuzzed in the QEMU mode (add -Q in the command
-line) or in a traditional, blind-fuzzer mode (specify -n).
-
-You can use -t and -m to override the default timeout and memory limit for the
-executed process; rare examples of targets that may need these settings touched
-include compilers and video decoders.
-
-Tips for optimizing fuzzing performance are discussed in perf_tips.txt.
-
-Note that afl-fuzz starts by performing an array of deterministic fuzzing
-steps, which can take several days, but tend to produce neat test cases. If you
-want quick & dirty results right away - akin to zzuf and other traditional
-fuzzers - add the -d option to the command line.
-
-7) Interpreting output
-----------------------
-
-See the status_screen.txt file for information on how to interpret the
-displayed stats and monitor the health of the process. Be sure to consult this
-file especially if any UI elements are highlighted in red.
-
-The fuzzing process will continue until you press Ctrl-C. At minimum, you want
-to allow the fuzzer to complete one queue cycle, which may take anywhere from a
-couple of hours to a week or so.
-
-There are three subdirectories created within the output directory and updated
-in real time:
-
- - queue/ - test cases for every distinctive execution path, plus all the
- starting files given by the user. This is the synthesized corpus
- mentioned in section 2.
-
- Before using this corpus for any other purposes, you can shrink
- it to a smaller size using the afl-cmin tool. The tool will find
- a smaller subset of files offering equivalent edge coverage.
-
- - crashes/ - unique test cases that cause the tested program to receive a
- fatal signal (e.g., SIGSEGV, SIGILL, SIGABRT). The entries are
- grouped by the received signal.
-
- - hangs/ - unique test cases that cause the tested program to time out. Note
- that when default (aggressive) timeout settings are in effect,
- this can be slightly noisy due to latency spikes and other
- natural phenomena.
-
-Crashes and hangs are considered "unique" if the associated execution paths
-involve any state transitions not seen in previously-recorded faults. If a
-single bug can be reached in multiple ways, there will be some count inflation
-early in the process, but this should quickly taper off.
-
-The file names for crashes and hangs are correlated with parent, non-faulting
-queue entries. This should help with debugging.
-
-When you can't reproduce a crash found by afl-fuzz, the most likely cause is
-that you are not setting the same memory limit as used by the tool. Try:
-
-$ LIMIT_MB=50
-$ ( ulimit -Sv $[LIMIT_MB << 10]; /path/to/tested_binary ... )
-
-Change LIMIT_MB to match the -m parameter passed to afl-fuzz. On OpenBSD,
-also change -Sv to -Sd.
-
-Any existing output directory can be also used to resume aborted jobs; try:
-
-$ ./afl-fuzz -i- -o existing_output_dir [...etc...]
-
-If you have gnuplot installed, you can also generate some pretty graphs for any
-active fuzzing task using afl-plot. For an example of how this looks like,
-see http://lcamtuf.coredump.cx/afl/plot/.
-
-8) Parallelized fuzzing
------------------------
-
-Every instance of afl-fuzz takes up roughly one core. This means that on
-multi-core systems, parallelization is necessary to fully utilize the hardware.
-For tips on how to fuzz a common target on multiple cores or multiple networked
-machines, please refer to parallel_fuzzing.txt.
-
-The parallel fuzzing mode also offers a simple way for interfacing AFL to other
-fuzzers, to symbolic or concolic execution engines, and so forth; again, see the
-last section of parallel_fuzzing.txt for tips.
-
-9) Fuzzer dictionaries
-----------------------
-
-By default, afl-fuzz mutation engine is optimized for compact data formats -
-say, images, multimedia, compressed data, regular expression syntax, or shell
-scripts. It is somewhat less suited for languages with particularly verbose and
-redundant verbiage - notably including HTML, SQL, or JavaScript.
-
-To avoid the hassle of building syntax-aware tools, afl-fuzz provides a way to
-seed the fuzzing process with an optional dictionary of language keywords,
-magic headers, or other special tokens associated with the targeted data type
-- and use that to reconstruct the underlying grammar on the go:
-
- http://lcamtuf.blogspot.com/2015/01/afl-fuzz-making-up-grammar-with.html
-
-To use this feature, you first need to create a dictionary in one of the two
-formats discussed in dictionaries/README.dictionaries; and then point the fuzzer
-to it via the -x option in the command line.
-
-(Several common dictionaries are already provided in that subdirectory, too.)
-
-There is no way to provide more structured descriptions of the underlying
-syntax, but the fuzzer will likely figure out some of this based on the
-instrumentation feedback alone. This actually works in practice, say:
-
- http://lcamtuf.blogspot.com/2015/04/finding-bugs-in-sqlite-easy-way.html
-
-PS. Even when no explicit dictionary is given, afl-fuzz will try to extract
-existing syntax tokens in the input corpus by watching the instrumentation
-very closely during deterministic byte flips. This works for some types of
-parsers and grammars, but isn't nearly as good as the -x mode.
-
-If a dictionary is really hard to come by, another option is to let AFL run
-for a while, and then use the token capture library that comes as a companion
-utility with AFL. For that, see libtokencap/README.tokencap.
-
-10) Crash triage
-----------------
-
-The coverage-based grouping of crashes usually produces a small data set that
-can be quickly triaged manually or with a very simple GDB or Valgrind script.
-Every crash is also traceable to its parent non-crashing test case in the
-queue, making it easier to diagnose faults.
-
-Having said that, it's important to acknowledge that some fuzzing crashes can be
-difficult quickly evaluate for exploitability without a lot of debugging and
-code analysis work. To assist with this task, afl-fuzz supports a very unique
-"crash exploration" mode enabled with the -C flag.
-
-In this mode, the fuzzer takes one or more crashing test cases as the input,
-and uses its feedback-driven fuzzing strategies to very quickly enumerate all
-code paths that can be reached in the program while keeping it in the
-crashing state.
-
-Mutations that do not result in a crash are rejected; so are any changes that
-do not affect the execution path.
-
-The output is a small corpus of files that can be very rapidly examined to see
-what degree of control the attacker has over the faulting address, or whether
-it is possible to get past an initial out-of-bounds read - and see what lies
-beneath.
-
-Oh, one more thing: for test case minimization, give afl-tmin a try. The tool
-can be operated in a very simple way:
-
-$ ./afl-tmin -i test_case -o minimized_result -- /path/to/program [...]
-
-The tool works with crashing and non-crashing test cases alike. In the crash
-mode, it will happily accept instrumented and non-instrumented binaries. In the
-non-crashing mode, the minimizer relies on standard AFL instrumentation to make
-the file simpler without altering the execution path.
-
-The minimizer accepts the -m, -t, -f and @@ syntax in a manner compatible with
-afl-fuzz.
-
-Another recent addition to AFL is the afl-analyze tool. It takes an input
-file, attempts to sequentially flip bytes, and observes the behavior of the
-tested program. It then color-codes the input based on which sections appear to
-be critical, and which are not; while not bulletproof, it can often offer quick
-insights into complex file formats. More info about its operation can be found
-near the end of technical_details.txt.
-
-11) Going beyond crashes
-------------------------
-
-Fuzzing is a wonderful and underutilized technique for discovering non-crashing
-design and implementation errors, too. Quite a few interesting bugs have been
-found by modifying the target programs to call abort() when, say:
-
- - Two bignum libraries produce different outputs when given the same
- fuzzer-generated input,
-
- - An image library produces different outputs when asked to decode the same
- input image several times in a row,
-
- - A serialization / deserialization library fails to produce stable outputs
- when iteratively serializing and deserializing fuzzer-supplied data,
-
- - A compression library produces an output inconsistent with the input file
- when asked to compress and then decompress a particular blob.
-
-Implementing these or similar sanity checks usually takes very little time;
-if you are the maintainer of a particular package, you can make this code
-conditional with #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION (a flag also
-shared with libfuzzer) or #ifdef __AFL_COMPILER (this one is just for AFL).
-
-12) Common-sense risks
-----------------------
-
-Please keep in mind that, similarly to many other computationally-intensive
-tasks, fuzzing may put strain on your hardware and on the OS. In particular:
-
- - Your CPU will run hot and will need adequate cooling. In most cases, if
- cooling is insufficient or stops working properly, CPU speeds will be
- automatically throttled. That said, especially when fuzzing on less
- suitable hardware (laptops, smartphones, etc), it's not entirely impossible
- for something to blow up.
-
- - Targeted programs may end up erratically grabbing gigabytes of memory or
- filling up disk space with junk files. AFL tries to enforce basic memory
- limits, but can't prevent each and every possible mishap. The bottom line
- is that you shouldn't be fuzzing on systems where the prospect of data loss
- is not an acceptable risk.
-
- - Fuzzing involves billions of reads and writes to the filesystem. On modern
- systems, this will be usually heavily cached, resulting in fairly modest
- "physical" I/O - but there are many factors that may alter this equation.
- It is your responsibility to monitor for potential trouble; with very heavy
- I/O, the lifespan of many HDDs and SSDs may be reduced.
-
- A good way to monitor disk I/O on Linux is the 'iostat' command:
-
- $ iostat -d 3 -x -k [...optional disk ID...]
-
-13) Known limitations & areas for improvement
----------------------------------------------
-
-Here are some of the most important caveats for AFL:
-
- - AFL detects faults by checking for the first spawned process dying due to
- a signal (SIGSEGV, SIGABRT, etc). Programs that install custom handlers for
- these signals may need to have the relevant code commented out. In the same
- vein, faults in child processed spawned by the fuzzed target may evade
- detection unless you manually add some code to catch that.
-
- - As with any other brute-force tool, the fuzzer offers limited coverage if
- encryption, checksums, cryptographic signatures, or compression are used to
- wholly wrap the actual data format to be tested.
-
- To work around this, you can comment out the relevant checks (see
- experimental/libpng_no_checksum/ for inspiration); if this is not possible,
- you can also write a postprocessor, as explained in
- experimental/post_library/.
-
- - There are some unfortunate trade-offs with ASAN and 64-bit binaries. This
- isn't due to any specific fault of afl-fuzz; see notes_for_asan.txt for
- tips.
-
- - There is no direct support for fuzzing network services, background
- daemons, or interactive apps that require UI interaction to work. You may
- need to make simple code changes to make them behave in a more traditional
- way. Preeny may offer a relatively simple option, too - see:
- https://github.com/zardus/preeny
-
- Some useful tips for modifying network-based services can be also found at:
- https://www.fastly.com/blog/how-to-fuzz-server-american-fuzzy-lop
-
- - AFL doesn't output human-readable coverage data. If you want to monitor
- coverage, use afl-cov from Michael Rash: https://github.com/mrash/afl-cov
-
- - Occasionally, sentient machines rise against their creators. If this
- happens to you, please consult http://lcamtuf.coredump.cx/prep/.
-
-Beyond this, see INSTALL for platform-specific tips.
-
-14) Special thanks
-------------------
-
-Many of the improvements to afl-fuzz wouldn't be possible without feedback,
-bug reports, or patches from:
-
- Jann Horn Hanno Boeck
- Felix Groebert Jakub Wilk
- Richard W. M. Jones Alexander Cherepanov
- Tom Ritter Hovik Manucharyan
- Sebastian Roschke Eberhard Mattes
- Padraig Brady Ben Laurie
- @dronesec Luca Barbato
- Tobias Ospelt Thomas Jarosch
- Martin Carpenter Mudge Zatko
- Joe Zbiciak Ryan Govostes
- Michael Rash William Robinet
- Jonathan Gray Filipe Cabecinhas
- Nico Weber Jodie Cunningham
- Andrew Griffiths Parker Thompson
- Jonathan Neuschfer Tyler Nighswander
- Ben Nagy Samir Aguiar
- Aidan Thornton Aleksandar Nikolich
- Sam Hakim Laszlo Szekeres
- David A. Wheeler Turo Lamminen
- Andreas Stieger Richard Godbee
- Louis Dassy teor2345
- Alex Moneger Dmitry Vyukov
- Keegan McAllister Kostya Serebryany
- Richo Healey Martijn Bogaard
- rc0r Jonathan Foote
- Christian Holler Dominique Pelle
- Jacek Wielemborek Leo Barnes
- Jeremy Barnes Jeff Trull
- Guillaume Endignoux ilovezfs
- Daniel Godas-Lopez Franjo Ivancic
- Austin Seipp Daniel Komaromy
- Daniel Binderman Jonathan Metzman
- Vegard Nossum Jan Kneschke
- Kurt Roeckx Marcel Bohme
- Van-Thuan Pham Abhik Roychoudhury
- Joshua J. Drake Toby Hutton
- Rene Freingruber Sergey Davidoff
- Sami Liedes Craig Young
-
-Thank you!
-
-15) Contact
------------
-
-Questions? Concerns? Bug reports? The author can be usually reached at
-<lcamtuf@google.com>.
-
-There is also a mailing list for the project; to join, send a mail to
-<afl-users+subscribe@googlegroups.com>. Or, if you prefer to browse
-archives first, try:
-
- https://groups.google.com/group/afl-users
-
-PS. If you wish to submit raw code to be incorporated into the project, please
-be aware that the copyright on most of AFL is claimed by Google. While you do
-retain copyright on your contributions, they do ask people to agree to a simple
-CLA first:
-
- https://cla.developers.google.com/clas
-
-Sorry about the hassle. Of course, no CLA is required for feature requests or
-bug reports.
diff --git a/chromium/third_party/afl/src/docs/env_variables.txt b/chromium/third_party/afl/src/docs/env_variables.txt
deleted file mode 100644
index a91b43ae3e8..00000000000
--- a/chromium/third_party/afl/src/docs/env_variables.txt
+++ /dev/null
@@ -1,249 +0,0 @@
-=======================
-Environmental variables
-=======================
-
- This document discusses the environment variables used by American Fuzzy Lop
- to expose various exotic functions that may be (rarely) useful for power
- users or for some types of custom fuzzing setups. See README for the general
- instruction manual.
-
-1) Settings for afl-gcc, afl-clang, and afl-as
-----------------------------------------------
-
-Because they can't directly accept command-line options, the compile-time
-tools make fairly broad use of environmental variables:
-
- - Setting AFL_HARDEN automatically adds code hardening options when invoking
- the downstream compiler. This currently includes -D_FORTIFY_SOURCE=2 and
- -fstack-protector-all. The setting is useful for catching non-crashing
- memory bugs at the expense of a very slight (sub-5%) performance loss.
-
- - By default, the wrapper appends -O3 to optimize builds. Very rarely, this
- will cause problems in programs built with -Werror, simply because -O3
- enables more thorough code analysis and can spew out additional warnings.
- To disable optimizations, set AFL_DONT_OPTIMIZE.
-
- - Setting AFL_USE_ASAN automatically enables ASAN, provided that your
- compiler supports that. Note that fuzzing with ASAN is mildly challenging
- - see notes_for_asan.txt.
-
- (You can also enable MSAN via AFL_USE_MSAN; ASAN and MSAN come with the
- same gotchas; the modes are mutually exclusive. UBSAN and other exotic
- sanitizers are not officially supported yet, but are easy to get to work
- by hand.)
-
- - Setting AFL_CC, AFL_CXX, and AFL_AS lets you use alternate downstream
- compilation tools, rather than the default 'clang', 'gcc', or 'as' binaries
- in your $PATH.
-
- - AFL_PATH can be used to point afl-gcc to an alternate location of afl-as.
- One possible use of this is experimental/clang_asm_normalize/, which lets
- you instrument hand-written assembly when compiling clang code by plugging
- a normalizer into the chain. (There is no equivalent feature for GCC.)
-
- - Setting AFL_INST_RATIO to a percentage between 0 and 100% controls the
- probability of instrumenting every branch. This is (very rarely) useful
- when dealing with exceptionally complex programs that saturate the output
- bitmap. Examples include v8, ffmpeg, and perl.
-
- (If this ever happens, afl-fuzz will warn you ahead of the time by
- displaying the "bitmap density" field in fiery red.)
-
- Setting AFL_INST_RATIO to 0 is a valid choice. This will instrument only
- the transitions between function entry points, but not individual branches.
-
- - AFL_NO_BUILTIN causes the compiler to generate code suitable for use with
- libtokencap.so (but perhaps running a bit slower than without the flag).
-
- - TMPDIR is used by afl-as for temporary files; if this variable is not set,
- the tool defaults to /tmp.
-
- - Setting AFL_KEEP_ASSEMBLY prevents afl-as from deleting instrumented
- assembly files. Useful for troubleshooting problems or understanding how
- the tool works. To get them in a predictable place, try something like:
-
- mkdir assembly_here
- TMPDIR=$PWD/assembly_here AFL_KEEP_ASSEMBLY=1 make clean all
-
- - Setting AFL_QUIET will prevent afl-cc and afl-as banners from being
- displayed during compilation, in case you find them distracting.
-
-2) Settings for afl-clang-fast
-------------------------------
-
-The native LLVM instrumentation helper accepts a subset of the settings
-discussed in section #1, with the exception of:
-
- - AFL_AS, since this toolchain does not directly invoke GNU as.
-
- - TMPDIR and AFL_KEEP_ASSEMBLY, since no temporary assembly files are
- created.
-
-Note that AFL_INST_RATIO will behave a bit differently than for afl-gcc,
-because functions are *not* instrumented unconditionally - so low values
-will have a more striking effect. For this tool, 0 is not a valid choice.
-
-3) Settings for afl-fuzz
-------------------------
-
-The main fuzzer binary accepts several options that disable a couple of sanity
-checks or alter some of the more exotic semantics of the tool:
-
- - Setting AFL_SKIP_CPUFREQ skips the check for CPU scaling policy. This is
- useful if you can't change the defaults (e.g., no root access to the
- system) and are OK with some performance loss.
-
- - Setting AFL_NO_FORKSRV disables the forkserver optimization, reverting to
- fork + execve() call for every tested input. This is useful mostly when
- working with unruly libraries that create threads or do other crazy
- things when initializing (before the instrumentation has a chance to run).
-
- Note that this setting inhibits some of the user-friendly diagnostics
- normally done when starting up the forkserver and causes a pretty
- significant performance drop.
-
- - AFL_EXIT_WHEN_DONE causes afl-fuzz to terminate when all existing paths
- have been fuzzed and there were no new finds for a while. This would be
- normally indicated by the cycle counter in the UI turning green. May be
- convenient for some types of automated jobs.
-
- - Setting AFL_NO_AFFINITY disables attempts to bind to a specific CPU core
- on Linux systems. This slows things down, but lets you run more instances
- of afl-fuzz than would be prudent (if you really want to).
-
- - AFL_SKIP_CRASHES causes AFL to tolerate crashing files in the input
- queue. This can help with rare situations where a program crashes only
- intermittently, but it's not really recommended under normal operating
- conditions.
-
- - AFL_SHUFFLE_QUEUE randomly reorders the input queue on startup. Requested
- by some users for unorthodox parallelized fuzzing setups, but not
- advisable otherwise.
-
- - When developing custom instrumentation on top of afl-fuzz, you can use
- AFL_SKIP_BIN_CHECK to inhibit the checks for non-instrumented binaries
- and shell scripts; and AFL_DUMB_FORKSRV in conjunction with the -n
- setting to instruct afl-fuzz to still follow the fork server protocol
- without expecting any instrumentation data in return.
-
- - When running in the -M or -S mode, setting AFL_IMPORT_FIRST causes the
- fuzzer to import test cases from other instances before doing anything
- else. This makes the "own finds" counter in the UI more accurate.
- Beyond counter aesthetics, not much else should change.
-
- - Setting AFL_POST_LIBRARY allows you to configure a postprocessor for
- mutated files - say, to fix up checksums. See experimental/post_library/
- for more.
-
- - The CPU widget shown at the bottom of the screen is fairly simplistic and
- may complain of high load prematurely, especially on systems with low core
- counts. To avoid the alarming red color, you can set AFL_NO_CPU_RED.
-
- - In QEMU mode (-Q), AFL_PATH will be searched for afl-qemu-trace.
-
- - Setting AFL_PRELOAD causes AFL to set LD_PRELOAD for the target binary
- without disrupting the afl-fuzz process itself. This is useful, among other
- things, for bootstrapping libdislocator.so.
-
- - Setting AFL_NO_UI inhibits the UI altogether, and just periodically prints
- some basic stats. This behavior is also automatically triggered when the
- output from afl-fuzz is redirected to a file or to a pipe.
-
- - If you are Jakub, you may need AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES.
- Others need not apply.
-
- - Benchmarking only: AFL_BENCH_JUST_ONE causes the fuzzer to exit after
- processing the first queue entry; and AFL_BENCH_UNTIL_CRASH causes it to
- exit soon after the first crash is found.
-
-4) Settings for afl-qemu-trace
-------------------------------
-
-The QEMU wrapper used to instrument binary-only code supports several settings:
-
- - It is possible to set AFL_INST_RATIO to skip the instrumentation on some
- of the basic blocks, which can be useful when dealing with very complex
- binaries.
-
- - Setting AFL_INST_LIBS causes the translator to also instrument the code
- inside any dynamically linked libraries (notably including glibc).
-
- - The underlying QEMU binary will recognize any standard "user space
- emulation" variables (e.g., QEMU_STACK_SIZE), but there should be no
- reason to touch them.
-
-5) Settings for afl-cmin
-------------------------
-
-The corpus minimization script offers very little customization:
-
- - Setting AFL_PATH offers a way to specify the location of afl-showmap
- and afl-qemu-trace (the latter only in -Q mode).
-
- - AFL_KEEP_TRACES makes the tool keep traces and other metadata used for
- minimization and normally deleted at exit. The files can be found in the
- <out_dir>/.traces/*.
-
-6) Settings for afl-tmin
-------------------------
-
-Virtually nothing to play with. Well, in QEMU mode (-Q), AFL_PATH will be
-searched for afl-qemu-trace. In addition to this, TMPDIR may be used if a
-temporary file can't be created in the current working directory.
-
-7) Settings for libdislocator.so
---------------------------------
-
-The library honors three environmental variables:
-
- - AFL_LD_LIMIT_MB caps the size of the maximum heap usage permitted by the
- library, in megabytes. The default value is 1 GB. Once this is exceeded,
- allocations will return NULL.
-
- - AFL_LD_HARD_FAIL alters the behavior by calling abort() on excessive
- allocations, thus causing what AFL would perceive as a crash. Useful for
- programs that are supposed to maintain a specific memory footprint.
-
- - AFL_LD_VERBOSE causes the library to output some diagnostic messages
- that may be useful for pinpointing the cause of any observed issues.
-
-8) Settings for libtokencap.so
-------------------------------
-
-This library accepts AFL_TOKEN_FILE to indicate the location to which the
-discovered tokens should be written.
-
-9) Third-party variables set by afl-fuzz & other tools
-------------------------------------------------------
-
-Several variables are not directly interpreted by afl-fuzz, but are set to
-optimal values if not already present in the environment:
-
- - By default, LD_BIND_NOW is set to speed up fuzzing by forcing the
- linker to do all the work before the fork server kicks in. You can
- override this by setting LD_BIND_LAZY beforehand, but it is almost
- certainly pointless.
-
- - By default, ASAN_OPTIONS are set to:
-
- abort_on_error=1
- detect_leaks=0
- symbolize=0
- allocator_may_return_null=1
-
- If you want to set your own options, be sure to include abort_on_error=1 -
- otherwise, the fuzzer will not be able to detect crashes in the tested
- app. Similarly, include symbolize=0, since without it, AFL may have
- difficulty telling crashes and hangs apart.
-
- - In the same vein, by default, MSAN_OPTIONS are set to:
-
- exit_code=86 (required for legacy reasons)
- abort_on_error=1
- symbolize=0
- msan_track_origins=0
- allocator_may_return_null=1
-
- Be sure to include the first one when customizing anything, since some
- MSAN versions don't call abort() on error, and we need a way to detect
- faults.
diff --git a/chromium/third_party/afl/src/docs/historical_notes.txt b/chromium/third_party/afl/src/docs/historical_notes.txt
deleted file mode 100644
index 741fd925847..00000000000
--- a/chromium/third_party/afl/src/docs/historical_notes.txt
+++ /dev/null
@@ -1,147 +0,0 @@
-================
-Historical notes
-================
-
- This doc talks about the rationale of some of the high-level design decisions
- for American Fuzzy Lop. It's adopted from a discussion with Rob Graham.
- See README for the general instruction manual, and technical_details.txt for
- additional implementation-level insights.
-
-1) Influences
--------------
-
-In short, afl-fuzz is inspired chiefly by the work done by Tavis Ormandy back
-in 2007. Tavis did some very persuasive experiments using gcov block coverage
-to select optimal test cases out of a large corpus of data, and then using
-them as a starting point for traditional fuzzing workflows.
-
-(By "persuasive", I mean: netting a significant number of interesting
-vulnerabilities.)
-
-In parallel to this, both Tavis and I were interested in evolutionary fuzzing.
-Tavis had his experiments, and I was working on a tool called bunny-the-fuzzer,
-released somewhere in 2007.
-
-Bunny used a generational algorithm not much different from afl-fuzz, but
-also tried to reason about the relationship between various input bits and
-the internal state of the program, with hopes of deriving some additional value
-from that. The reasoning / correlation part was probably in part inspired by
-other projects done around the same time by Will Drewry and Chris Evans.
-
-The state correlation approach sounded very sexy on paper, but ultimately, made
-the fuzzer complicated, brittle, and cumbersome to use; every other target
-program would require a tweak or two. Because Bunny didn't fare a whole lot
-better than less sophisticated brute-force tools, I eventually decided to write
-it off. You can still find its original documentation at:
-
- https://code.google.com/p/bunny-the-fuzzer/wiki/BunnyDoc
-
-There has been a fair amount of independent work, too. Most notably, a few
-weeks earlier that year, Jared DeMott had a Defcon presentation about a
-coverage-driven fuzzer that relied on coverage as a fitness function.
-
-Jared's approach was by no means identical to what afl-fuzz does, but it was in
-the same ballpark. His fuzzer tried to explicitly solve for the maximum coverage
-with a single input file; in comparison, afl simply selects for cases that do
-something new (which yields better results - see technical_details.txt).
-
-A few years later, Gabriel Campana released fuzzgrind, a tool that relied purely
-on Valgrind and a constraint solver to maximize coverage without any brute-force
-bits; and Microsoft Research folks talked extensively about their still
-non-public, solver-based SAGE framework.
-
-In the past six years or so, I've also seen a fair number of academic papers
-that dealt with smart fuzzing (focusing chiefly on symbolic execution) and a
-couple papers that discussed proof-of-concept applications of genetic
-algorithms with the same goals in mind. I'm unconvinced how practical most of
-these experiments were; I suspect that many of them suffer from the
-bunny-the-fuzzer's curse of being cool on paper and in carefully designed
-experiments, but failing the ultimate test of being able to find new,
-worthwhile security bugs in otherwise well-fuzzed, real-world software.
-
-In some ways, the baseline that the "cool" solutions have to compete against is
-a lot more impressive than it may seem, making it difficult for competitors to
-stand out. For a singular example, check out the work by Gynvael and Mateusz
-Jurczyk, applying "dumb" fuzzing to ffmpeg, a prominent and security-critical
-component of modern browsers and media players:
-
- http://googleonlinesecurity.blogspot.com/2014/01/ffmpeg-and-thousand-fixes.html
-
-Effortlessly getting comparable results with state-of-the-art symbolic execution
-in equally complex software still seems fairly unlikely, and hasn't been
-demonstrated in practice so far.
-
-But I digress; ultimately, attribution is hard, and glorying the fundamental
-concepts behind AFL is probably a waste of time. The devil is very much in the
-often-overlooked details, which brings us to...
-
-2) Design goals for afl-fuzz
-----------------------------
-
-In short, I believe that the current implementation of afl-fuzz takes care of
-several itches that seemed impossible to scratch with other tools:
-
-1) Speed. It's genuinely hard to compete with brute force when your "smart"
- approach is resource-intensive. If your instrumentation makes it 10x more
- likely to find a bug, but runs 100x slower, your users are getting a bad
- deal.
-
- To avoid starting with a handicap, afl-fuzz is meant to let you fuzz most of
- the intended targets at roughly their native speed - so even if it doesn't
- add value, you do not lose much.
-
- On top of this, the tool leverages instrumentation to actually reduce the
- amount of work in a couple of ways: for example, by carefully trimming the
- corpus or skipping non-functional but non-trimmable regions in the input
- files.
-
-2) Rock-solid reliability. It's hard to compete with brute force if your
- approach is brittle and fails unexpectedly. Automated testing is attractive
- because it's simple to use and scalable; anything that goes against these
- principles is an unwelcome trade-off and means that your tool will be used
- less often and with less consistent results.
-
- Most of the approaches based on symbolic execution, taint tracking, or
- complex syntax-aware instrumentation are currently fairly unreliable with
- real-world targets. Perhaps more importantly, their failure modes can render
- them strictly worse than "dumb" tools, and such degradation can be difficult
- for less experienced users to notice and correct.
-
- In contrast, afl-fuzz is designed to be rock solid, chiefly by keeping it
- simple. In fact, at its core, it's designed to be just a very good
- traditional fuzzer with a wide range of interesting, well-researched
- strategies to go by. The fancy parts just help it focus the effort in
- places where it matters the most.
-
-3) Simplicity. The author of a testing framework is probably the only person
- who truly understands the impact of all the settings offered by the tool -
- and who can dial them in just right. Yet, even the most rudimentary fuzzer
- frameworks often come with countless knobs and fuzzing ratios that need to
- be guessed by the operator ahead of the time. This can do more harm than
- good.
-
- AFL is designed to avoid this as much as possible. The three knobs you
- can play with are the output file, the memory limit, and the ability to
- override the default, auto-calibrated timeout. The rest is just supposed to
- work. When it doesn't, user-friendly error messages outline the probable
- causes and workarounds, and get you back on track right away.
-
-4) Chainability. Most general-purpose fuzzers can't be easily employed
- against resource-hungry or interaction-heavy tools, necessitating the
- creation of custom in-process fuzzers or the investment of massive CPU
- power (most of which is wasted on tasks not directly related to the code
- we actually want to test).
-
- AFL tries to scratch this itch by allowing users to use more lightweight
- targets (e.g., standalone image parsing libraries) to create small
- corpora of interesting test cases that can be fed into a manual testing
- process or a UI harness later on.
-
-As mentioned in technical_details.txt, AFL does all this not by systematically
-applying a single overarching CS concept, but by experimenting with a variety
-of small, complementary methods that were shown to reliably yields results
-better than chance. The use of instrumentation is a part of that toolkit, but is
-far from being the most important one.
-
-Ultimately, what matters is that afl-fuzz is designed to find cool bugs - and
-has a pretty robust track record of doing just that.
diff --git a/chromium/third_party/afl/src/docs/life_pro_tips.txt b/chromium/third_party/afl/src/docs/life_pro_tips.txt
deleted file mode 100644
index c8c47636b37..00000000000
--- a/chromium/third_party/afl/src/docs/life_pro_tips.txt
+++ /dev/null
@@ -1,128 +0,0 @@
-# ===================
-# AFL "Life Pro Tips"
-# ===================
-#
-# Bite-sized advice for those who understand the basics, but can't be bothered
-# to read or memorize every other piece of documentation for AFL.
-#
-
-%
-
-Get more bang for your buck by using fuzzing dictionaries.
-See dictionaries/README.dictionaries to learn how.
-
-%
-
-You can get the most out of your hardware by parallelizing AFL jobs.
-See docs/parallel_fuzzing.txt for step-by-step tips.
-
-%
-
-Improve the odds of spotting memory corruption bugs with libdislocator.so!
-It's easy. Consult libdislocator/README.dislocator for usage tips.
-
-%
-
-Want to understand how your target parses a particular input file?
-Try the bundled afl-analyze tool; it's got colors and all!
-
-%
-
-You can visually monitor the progress of your fuzzing jobs.
-Run the bundled afl-plot utility to generate browser-friendly graphs.
-
-%
-
-Need to monitor AFL jobs programmatically? Check out the fuzzer_stats file
-in the AFL output dir or try afl-whatsup.
-
-%
-
-Puzzled by something showing up in red or purple in the AFL UI?
-It could be important - consult docs/status_screen.txt right away!
-
-%
-
-Know your target? Convert it to persistent mode for a huge performance gain!
-Consult section #5 in llvm_mode/README.llvm for tips.
-
-%
-
-Using clang? Check out llvm_mode/ for a faster alternative to afl-gcc!
-
-%
-
-Did you know that AFL can fuzz closed-source or cross-platform binaries?
-Check out qemu_mode/README.qemu for more.
-
-%
-
-Did you know that afl-fuzz can minimize any test case for you?
-Try the bundled afl-tmin tool - and get small repro files fast!
-
-%
-
-Not sure if a crash is exploitable? AFL can help you figure it out. Specify
--C to enable the peruvian were-rabbit mode. See section #10 in README for more.
-
-%
-
-Trouble dealing with a machine uprising? Relax, we've all been there.
-Find essential survival tips at http://lcamtuf.coredump.cx/prep/.
-
-%
-
-AFL-generated corpora can be used to power other testing processes.
-See section #2 in README for inspiration - it tends to pay off!
-
-%
-
-Want to automatically spot non-crashing memory handling bugs?
-Try running an AFL-generated corpus through ASAN, MSAN, or Valgrind.
-
-%
-
-Good selection of input files is critical to a successful fuzzing job.
-See section #5 in README (or docs/perf_tips.txt) for pro tips.
-
-%
-
-You can improve the odds of automatically spotting stack corruption issues.
-Specify AFL_HARDEN=1 in the environment to enable hardening flags.
-
-%
-
-Bumping into problems with non-reproducible crashes? It happens, but usually
-isn't hard to diagnose. See section #7 in README for tips.
-
-%
-
-Fuzzing is not just about memory corruption issues in the codebase. Add some
-sanity-checking assert() / abort() statements to effortlessly catch logic bugs.
-
-%
-
-Hey kid... pssst... want to figure out how AFL really works?
-Check out docs/technical_details.txt for all the gory details in one place!
-
-%
-
-There's a ton of third-party helper tools designed to work with AFL!
-Be sure to check out docs/sister_projects.txt before writing your own.
-
-%
-
-Need to fuzz the command-line arguments of a particular program?
-You can find a simple solution in experimental/argv_fuzzing.
-
-%
-
-Attacking a format that uses checksums? Remove the checksum-checking code or
-use a postprocessor! See experimental/post_library/ for more.
-
-%
-
-Dealing with a very slow target or hoping for instant results? Specify -d
-when calling afl-fuzz!
-
-%
diff --git a/chromium/third_party/afl/src/docs/notes_for_asan.txt b/chromium/third_party/afl/src/docs/notes_for_asan.txt
deleted file mode 100644
index dff89ba6b6c..00000000000
--- a/chromium/third_party/afl/src/docs/notes_for_asan.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-==================================
-Notes for using ASAN with afl-fuzz
-==================================
-
- This file discusses some of the caveats for fuzzing under ASAN, and suggests
- a handful of alternatives. See README for the general instruction manual.
-
-1) Short version
-----------------
-
-ASAN on 64-bit systems requests a lot of memory in a way that can't be easily
-distinguished from a misbehaving program bent on crashing your system.
-
-Because of this, fuzzing with ASAN is recommended only in four scenarios:
-
- - On 32-bit systems, where we can always enforce a reasonable memory limit
- (-m 800 or so is a good starting point),
-
- - On 64-bit systems only if you can do one of the following:
-
- - Compile the binary in 32-bit mode (gcc -m32),
-
- - Precisely gauge memory needs using http://jwilk.net/software/recidivm .
-
- - Limit the memory available to process using cgroups on Linux (see
- experimental/asan_cgroups).
-
-To compile with ASAN, set AFL_USE_ASAN=1 before calling 'make clean all'. The
-afl-gcc / afl-clang wrappers will pick that up and add the appropriate flags.
-Note that ASAN is incompatible with -static, so be mindful of that.
-
-(You can also use AFL_USE_MSAN=1 to enable MSAN instead.)
-
-There is also the option of generating a corpus using a non-ASAN binary, and
-then feeding it to an ASAN-instrumented one to check for bugs. This is faster,
-and can give you somewhat comparable results. You can also try using
-libdislocator (see libdislocator/README.dislocator in the parent directory) as a
-lightweight and hassle-free (but less thorough) alternative.
-
-2) Long version
----------------
-
-ASAN allocates a huge region of virtual address space for bookkeeping purposes.
-Most of this is never actually accessed, so the OS never has to allocate any
-real pages of memory for the process, and the VM grabbed by ASAN is essentially
-"free" - but the mapping counts against the standard OS-enforced limit
-(RLIMIT_AS, aka ulimit -v).
-
-On our end, afl-fuzz tries to protect you from processes that go off-rails
-and start consuming all the available memory in a vain attempt to parse a
-malformed input file. This happens surprisingly often, so enforcing such a limit
-is important for almost any fuzzer: the alternative is for the kernel OOM
-handler to step in and start killing random processes to free up resources.
-Needless to say, that's not a very nice prospect to live with.
-
-Unfortunately, un*x systems offer no portable way to limit the amount of
-pages actually given to a process in a way that distinguishes between that
-and the harmless "land grab" done by ASAN. In principle, there are three standard
-ways to limit the size of the heap:
-
- - The RLIMIT_AS mechanism (ulimit -v) caps the size of the virtual space -
- but as noted, this pays no attention to the number of pages actually
- in use by the process, and doesn't help us here.
-
- - The RLIMIT_DATA mechanism (ulimit -d) seems like a good fit, but it applies
- only to the traditional sbrk() / brk() methods of requesting heap space;
- modern allocators, including the one in glibc, routinely rely on mmap()
- instead, and circumvent this limit completely.
-
- - Finally, the RLIMIT_RSS limit (ulimit -m) sounds like what we need, but
- doesn't work on Linux - mostly because nobody felt like implementing it.
-
-There are also cgroups, but they are Linux-specific, not universally available
-even on Linux systems, and they require root permissions to set up; I'm a bit
-hesitant to make afl-fuzz require root permissions just for that. That said,
-if you are on Linux and want to use cgroups, check out the contributed script
-that ships in experimental/asan_cgroups/.
-
-In settings where cgroups aren't available, we have no nice, portable way to
-avoid counting the ASAN allocation toward the limit. On 32-bit systems, or for
-binaries compiled in 32-bit mode (-m32), this is not a big deal: ASAN needs
-around 600-800 MB or so, depending on the compiler - so all you need to do is
-to specify -m that is a bit higher than that.
-
-On 64-bit systems, the situation is more murky, because the ASAN allocation
-is completely outlandish - around 17.5 TB in older versions, and closer to
-20 TB with newest ones. The actual amount of memory on your system is
-(probably!) just a tiny fraction of that - so unless you dial the limit
-with surgical precision, you will get no protection from OOM bugs.
-
-On my system, the amount of memory grabbed by ASAN with a slightly older
-version of gcc is around 17,825,850 MB; for newest clang, it's 20,971,600.
-But there is no guarantee that these numbers are stable, and if you get them
-wrong by "just" a couple gigs or so, you will be at risk.
-
-To get the precise number, you can use the recidivm tool developed by Jakub
-Wilk (http://jwilk.net/software/recidivm). In absence of this, ASAN is *not*
-recommended when fuzzing 64-bit binaries, unless you are confident that they
-are robust and enforce reasonable memory limits (in which case, you can
-specify '-m none' when calling afl-fuzz).
-
-Using recidivm or running with no limits aside, there are two other decent
-alternatives: build a corpus of test cases using a non-ASAN binary, and then
-examine them with ASAN, Valgrind, or other heavy-duty tools in a more
-controlled setting; or compile the target program with -m32 (32-bit mode)
-if your system supports that.
-
-3) Interactions with the QEMU mode
-----------------------------------
-
-ASAN, MSAN, and other sanitizers appear to be incompatible with QEMU user
-emulation, so please do not try to use them with the -Q option; QEMU doesn't
-seem to appreciate the shadow VM trick used by these tools, and will likely
-just allocate all your physical memory, then crash.
-
-4) What about UBSAN?
---------------------
-
-Some folks expressed interest in fuzzing with UBSAN. This isn't officially
-supported, because many installations of UBSAN don't offer a consistent way
-to abort() on fault conditions or to terminate with a distinctive exit code.
-
-That said, some versions of the library can be binary-patched to address this
-issue, while newer releases support explicit compile-time flags - see this
-mailing list thread for tips:
-
- https://groups.google.com/forum/#!topic/afl-users/GyeSBJt4M38
diff --git a/chromium/third_party/afl/src/docs/parallel_fuzzing.txt b/chromium/third_party/afl/src/docs/parallel_fuzzing.txt
deleted file mode 100644
index 58f8d2f4126..00000000000
--- a/chromium/third_party/afl/src/docs/parallel_fuzzing.txt
+++ /dev/null
@@ -1,216 +0,0 @@
-=========================
-Tips for parallel fuzzing
-=========================
-
- This document talks about synchronizing afl-fuzz jobs on a single machine
- or across a fleet of systems. See README for the general instruction manual.
-
-1) Introduction
----------------
-
-Every copy of afl-fuzz will take up one CPU core. This means that on an
-n-core system, you can almost always run around n concurrent fuzzing jobs with
-virtually no performance hit (you can use the afl-gotcpu tool to make sure).
-
-In fact, if you rely on just a single job on a multi-core system, you will
-be underutilizing the hardware. So, parallelization is usually the right
-way to go.
-
-When targeting multiple unrelated binaries or using the tool in "dumb" (-n)
-mode, it is perfectly fine to just start up several fully separate instances
-of afl-fuzz. The picture gets more complicated when you want to have multiple
-fuzzers hammering a common target: if a hard-to-hit but interesting test case
-is synthesized by one fuzzer, the remaining instances will not be able to use
-that input to guide their work.
-
-To help with this problem, afl-fuzz offers a simple way to synchronize test
-cases on the fly.
-
-2) Single-system parallelization
---------------------------------
-
-If you wish to parallelize a single job across multiple cores on a local
-system, simply create a new, empty output directory ("sync dir") that will be
-shared by all the instances of afl-fuzz; and then come up with a naming scheme
-for every instance - say, "fuzzer01", "fuzzer02", etc.
-
-Run the first one ("master", -M) like this:
-
-$ ./afl-fuzz -i testcase_dir -o sync_dir -M fuzzer01 [...other stuff...]
-
-...and then, start up secondary (-S) instances like this:
-
-$ ./afl-fuzz -i testcase_dir -o sync_dir -S fuzzer02 [...other stuff...]
-$ ./afl-fuzz -i testcase_dir -o sync_dir -S fuzzer03 [...other stuff...]
-
-Each fuzzer will keep its state in a separate subdirectory, like so:
-
- /path/to/sync_dir/fuzzer01/
-
-Each instance will also periodically rescan the top-level sync directory
-for any test cases found by other fuzzers - and will incorporate them into
-its own fuzzing when they are deemed interesting enough.
-
-The difference between the -M and -S modes is that the master instance will
-still perform deterministic checks; while the secondary instances will
-proceed straight to random tweaks. If you don't want to do deterministic
-fuzzing at all, it's OK to run all instances with -S. With very slow or complex
-targets, or when running heavily parallelized jobs, this is usually a good plan.
-
-Note that running multiple -M instances is wasteful, although there is an
-experimental support for parallelizing the deterministic checks. To leverage
-that, you need to create -M instances like so:
-
-$ ./afl-fuzz -i testcase_dir -o sync_dir -M masterA:1/3 [...]
-$ ./afl-fuzz -i testcase_dir -o sync_dir -M masterB:2/3 [...]
-$ ./afl-fuzz -i testcase_dir -o sync_dir -M masterC:3/3 [...]
-
-...where the first value after ':' is the sequential ID of a particular master
-instance (starting at 1), and the second value is the total number of fuzzers to
-distribute the deterministic fuzzing across. Note that if you boot up fewer
-fuzzers than indicated by the second number passed to -M, you may end up with
-poor coverage.
-
-You can also monitor the progress of your jobs from the command line with the
-provided afl-whatsup tool. When the instances are no longer finding new paths,
-it's probably time to stop.
-
-WARNING: Exercise caution when explicitly specifying the -f option. Each fuzzer
-must use a separate temporary file; otherwise, things will go south. One safe
-example may be:
-
-$ ./afl-fuzz [...] -S fuzzer10 -f file10.txt ./fuzzed/binary @@
-$ ./afl-fuzz [...] -S fuzzer11 -f file11.txt ./fuzzed/binary @@
-$ ./afl-fuzz [...] -S fuzzer12 -f file12.txt ./fuzzed/binary @@
-
-This is not a concern if you use @@ without -f and let afl-fuzz come up with the
-file name.
-
-3) Multi-system parallelization
--------------------------------
-
-The basic operating principle for multi-system parallelization is similar to
-the mechanism explained in section 2. The key difference is that you need to
-write a simple script that performs two actions:
-
- - Uses SSH with authorized_keys to connect to every machine and retrieve
- a tar archive of the /path/to/sync_dir/<fuzzer_id>/queue/ directories for
- every <fuzzer_id> local to the machine. It's best to use a naming scheme
- that includes host name in the fuzzer ID, so that you can do something
- like:
-
- for s in {1..10}; do
- ssh user@host${s} "tar -czf - sync/host${s}_fuzzid*/[qf]*" >host${s}.tgz
- done
-
- - Distributes and unpacks these files on all the remaining machines, e.g.:
-
- for s in {1..10}; do
- for d in {1..10}; do
- test "$s" = "$d" && continue
- ssh user@host${d} 'tar -kxzf -' <host${s}.tgz
- done
- done
-
-There is an example of such a script in experimental/distributed_fuzzing/;
-you can also find a more featured, experimental tool developed by
-Martijn Bogaard at:
-
- https://github.com/MartijnB/disfuzz-afl
-
-Another client-server implementation from Richo Healey is:
-
- https://github.com/richo/roving
-
-Note that these third-party tools are unsafe to run on systems exposed to the
-Internet or to untrusted users.
-
-When developing custom test case sync code, there are several optimizations
-to keep in mind:
-
- - The synchronization does not have to happen very often; running the
- task every 30 minutes or so may be perfectly fine.
-
- - There is no need to synchronize crashes/ or hangs/; you only need to
- copy over queue/* (and ideally, also fuzzer_stats).
-
- - It is not necessary (and not advisable!) to overwrite existing files;
- the -k option in tar is a good way to avoid that.
-
- - There is no need to fetch directories for fuzzers that are not running
- locally on a particular machine, and were simply copied over onto that
- system during earlier runs.
-
- - For large fleets, you will want to consolidate tarballs for each host,
- as this will let you use n SSH connections for sync, rather than n*(n-1).
-
- You may also want to implement staged synchronization. For example, you
- could have 10 groups of systems, with group 1 pushing test cases only
- to group 2; group 2 pushing them only to group 3; and so on, with group
- eventually 10 feeding back to group 1.
-
- This arrangement would allow test interesting cases to propagate across
- the fleet without having to copy every fuzzer queue to every single host.
-
- - You do not want a "master" instance of afl-fuzz on every system; you should
- run them all with -S, and just designate a single process somewhere within
- the fleet to run with -M.
-
-It is *not* advisable to skip the synchronization script and run the fuzzers
-directly on a network filesystem; unexpected latency and unkillable processes
-in I/O wait state can mess things up.
-
-4) Remote monitoring and data collection
-----------------------------------------
-
-You can use screen, nohup, tmux, or something equivalent to run remote
-instances of afl-fuzz. If you redirect the program's output to a file, it will
-automatically switch from a fancy UI to more limited status reports. There is
-also basic machine-readable information always written to the fuzzer_stats file
-in the output directory. Locally, that information can be interpreted with
-afl-whatsup.
-
-In principle, you can use the status screen of the master (-M) instance to
-monitor the overall fuzzing progress and decide when to stop. In this
-mode, the most important signal is just that no new paths are being found
-for a longer while. If you do not have a master instance, just pick any
-single secondary instance to watch and go by that.
-
-You can also rely on that instance's output directory to collect the
-synthesized corpus that covers all the noteworthy paths discovered anywhere
-within the fleet. Secondary (-S) instances do not require any special
-monitoring, other than just making sure that they are up.
-
-Keep in mind that crashing inputs are *not* automatically propagated to the
-master instance, so you may still want to monitor for crashes fleet-wide
-from within your synchronization or health checking scripts (see afl-whatsup).
-
-5) Asymmetric setups
---------------------
-
-It is perhaps worth noting that all of the following is permitted:
-
- - Running afl-fuzz with conjunction with other guided tools that can extend
- coverage (e.g., via concolic execution). Third-party tools simply need to
- follow the protocol described above for pulling new test cases from
- out_dir/<fuzzer_id>/queue/* and writing their own finds to sequentially
- numbered id:nnnnnn files in out_dir/<ext_tool_id>/queue/*.
-
- - Running some of the synchronized fuzzers with different (but related)
- target binaries. For example, simultaneously stress-testing several
- different JPEG parsers (say, IJG jpeg and libjpeg-turbo) while sharing
- the discovered test cases can have synergistic effects and improve the
- overall coverage.
-
- (In this case, running one -M instance per each binary is a good plan.)
-
- - Having some of the fuzzers invoke the binary in different ways.
- For example, 'djpeg' supports several DCT modes, configurable with
- a command-line flag, while 'dwebp' supports incremental and one-shot
- decoding. In some scenarios, going after multiple distinct modes and then
- pooling test cases will improve coverage.
-
- - Much less convincingly, running the synchronized fuzzers with different
- starting test cases (e.g., progressive and standard JPEG) or dictionaries.
- The synchronization mechanism ensures that the test sets will get fairly
- homogeneous over time, but it introduces some initial variability.
diff --git a/chromium/third_party/afl/src/docs/perf_tips.txt b/chromium/third_party/afl/src/docs/perf_tips.txt
deleted file mode 100644
index 3a8997a22f0..00000000000
--- a/chromium/third_party/afl/src/docs/perf_tips.txt
+++ /dev/null
@@ -1,197 +0,0 @@
-=================================
-Tips for performance optimization
-=================================
-
- This file provides tips for troubleshooting slow or wasteful fuzzing jobs.
- See README for the general instruction manual.
-
-1) Keep your test cases small
------------------------------
-
-This is probably the single most important step to take! Large test cases do
-not merely take more time and memory to be parsed by the tested binary, but
-also make the fuzzing process dramatically less efficient in several other
-ways.
-
-To illustrate, let's say that you're randomly flipping bits in a file, one bit
-at a time. Let's assume that if you flip bit #47, you will hit a security bug;
-flipping any other bit just results in an invalid document.
-
-Now, if your starting test case is 100 bytes long, you will have a 71% chance of
-triggering the bug within the first 1,000 execs - not bad! But if the test case
-is 1 kB long, the probability that we will randomly hit the right pattern in
-the same timeframe goes down to 11%. And if it has 10 kB of non-essential
-cruft, the odds plunge to 1%.
-
-On top of that, with larger inputs, the binary may be now running 5-10x times
-slower than before - so the overall drop in fuzzing efficiency may be easily
-as high as 500x or so.
-
-In practice, this means that you shouldn't fuzz image parsers with your
-vacation photos. Generate a tiny 16x16 picture instead, and run it through
-jpegtran or pngcrunch for good measure. The same goes for most other types
-of documents.
-
-There's plenty of small starting test cases in ../testcases/* - try them out
-or submit new ones!
-
-If you want to start with a larger, third-party corpus, run afl-cmin with an
-aggressive timeout on that data set first.
-
-2) Use a simpler target
------------------------
-
-Consider using a simpler target binary in your fuzzing work. For example, for
-image formats, bundled utilities such as djpeg, readpng, or gifhisto are
-considerably (10-20x) faster than the convert tool from ImageMagick - all while
-exercising roughly the same library-level image parsing code.
-
-Even if you don't have a lightweight harness for a particular target, remember
-that you can always use another, related library to generate a corpus that will
-be then manually fed to a more resource-hungry program later on.
-
-3) Use LLVM instrumentation
----------------------------
-
-When fuzzing slow targets, you can gain 2x performance improvement by using
-the LLVM-based instrumentation mode described in llvm_mode/README.llvm. Note
-that this mode requires the use of clang and will not work with GCC.
-
-The LLVM mode also offers a "persistent", in-process fuzzing mode that can
-work well for certain types of self-contained libraries, and for fast targets,
-can offer performance gains up to 5-10x; and a "deferred fork server" mode
-that can offer huge benefits for programs with high startup overhead. Both
-modes require you to edit the source code of the fuzzed program, but the
-changes often amount to just strategically placing a single line or two.
-
-4) Profile and optimize the binary
-----------------------------------
-
-Check for any parameters or settings that obviously improve performance. For
-example, the djpeg utility that comes with IJG jpeg and libjpeg-turbo can be
-called with:
-
- -dct fast -nosmooth -onepass -dither none -scale 1/4
-
-...and that will speed things up. There is a corresponding drop in the quality
-of decoded images, but it's probably not something you care about.
-
-In some programs, it is possible to disable output altogether, or at least use
-an output format that is computationally inexpensive. For example, with image
-transcoding tools, converting to a BMP file will be a lot faster than to PNG.
-
-With some laid-back parsers, enabling "strict" mode (i.e., bailing out after
-first error) may result in smaller files and improved run time without
-sacrificing coverage; for example, for sqlite, you may want to specify -bail.
-
-If the program is still too slow, you can use strace -tt or an equivalent
-profiling tool to see if the targeted binary is doing anything silly.
-Sometimes, you can speed things up simply by specifying /dev/null as the
-config file, or disabling some compile-time features that aren't really needed
-for the job (try ./configure --help). One of the notoriously resource-consuming
-things would be calling other utilities via exec*(), popen(), system(), or
-equivalent calls; for example, tar can invoke external decompression tools
-when it decides that the input file is a compressed archive.
-
-Some programs may also intentionally call sleep(), usleep(), or nanosleep();
-vim is a good example of that.
-
-In programs that are slow due to unavoidable initialization overhead, you may
-want to try the LLVM deferred forkserver mode (see llvm_mode/README.llvm),
-which can give you speed gains up to 10x, as mentioned above.
-
-Last but not least, if you are using ASAN and the performance is unacceptable,
-consider turning it off for now, and manually examining the generated corpus
-with an ASAN-enabled binary later on.
-
-5) Instrument just what you need
---------------------------------
-
-Instrument just the libraries you actually want to stress-test right now, one
-at a time. Let the program use system-wide, non-instrumented libraries for
-any functionality you don't actually want to fuzz. For example, in most
-cases, it doesn't make to instrument libgmp just because you're testing a
-crypto app that relies on it for bignum math.
-
-Beware of programs that come with oddball third-party libraries bundled with
-their source code (Spidermonkey is a good example of this). Check ./configure
-options to use non-instrumented system-wide copies instead.
-
-6) Parallelize your fuzzers
----------------------------
-
-The fuzzer is designed to need ~1 core per job. This means that on a, say,
-4-core system, you can easily run four parallel fuzzing jobs with relatively
-little performance hit. For tips on how to do that, see parallel_fuzzing.txt.
-
-The afl-gotcpu utility can help you understand if you still have idle CPU
-capacity on your system. (It won't tell you about memory bandwidth, cache
-misses, or similar factors, but they are less likely to be a concern.)
-
-7) Keep memory use and timeouts in check
-----------------------------------------
-
-If you have increased the -m or -t limits more than truly necessary, consider
-dialing them back down.
-
-For programs that are nominally very fast, but get sluggish for some inputs,
-you can also try setting -t values that are more punishing than what afl-fuzz
-dares to use on its own. On fast and idle machines, going down to -t 5 may be
-a viable plan.
-
-The -m parameter is worth looking at, too. Some programs can end up spending
-a fair amount of time allocating and initializing megabytes of memory when
-presented with pathological inputs. Low -m values can make them give up sooner
-and not waste CPU time.
-
-8) Check OS configuration
--------------------------
-
-There are several OS-level factors that may affect fuzzing speed:
-
- - High system load. Use idle machines where possible. Kill any non-essential
- CPU hogs (idle browser windows, media players, complex screensavers, etc).
-
- - Network filesystems, either used for fuzzer input / output, or accessed by
- the fuzzed binary to read configuration files (pay special attention to the
- home directory - many programs search it for dot-files).
-
- - On-demand CPU scaling. The Linux 'ondemand' governor performs its analysis
- on a particular schedule and is known to underestimate the needs of
- short-lived processes spawned by afl-fuzz (or any other fuzzer). On Linux,
- this can be fixed with:
-
- cd /sys/devices/system/cpu
- echo performance | tee cpu*/cpufreq/scaling_governor
-
- On other systems, the impact of CPU scaling will be different; when fuzzing,
- use OS-specific tools to find out if all cores are running at full speed.
-
- - Transparent huge pages. Some allocators, such as jemalloc, can incur a
- heavy fuzzing penalty when transparent huge pages (THP) are enabled in the
- kernel. You can disable this via:
-
- echo never > /sys/kernel/mm/transparent_hugepage/enabled
-
- - Suboptimal scheduling strategies. The significance of this will vary from
- one target to another, but on Linux, you may want to make sure that the
- following options are set:
-
- echo 1 >/proc/sys/kernel/sched_child_runs_first
- echo 1 >/proc/sys/kernel/sched_autogroup_enabled
-
- Setting a different scheduling policy for the fuzzer process - say
- SCHED_RR - can usually speed things up, too, but needs to be done with
- care.
-
-9) If all other options fail, use -d
-------------------------------------
-
-For programs that are genuinely slow, in cases where you really can't escape
-using huge input files, or when you simply want to get quick and dirty results
-early on, you can always resort to the -d mode.
-
-The mode causes afl-fuzz to skip all the deterministic fuzzing steps, which
-makes output a lot less neat and can ultimately make the testing a bit less
-in-depth, but it will give you an experience more familiar from other fuzzing
-tools.
diff --git a/chromium/third_party/afl/src/docs/sister_projects.txt b/chromium/third_party/afl/src/docs/sister_projects.txt
deleted file mode 100644
index 1434e37f841..00000000000
--- a/chromium/third_party/afl/src/docs/sister_projects.txt
+++ /dev/null
@@ -1,298 +0,0 @@
-===============
-Sister projects
-===============
-
- This doc lists some of the projects that are inspired by, derived from,
- designed for, or meant to integrate with AFL. See README for the general
- instruction manual.
-
--------------------------------------------
-Support for other languages / environments:
--------------------------------------------
-
-Python AFL (Jakub Wilk)
------------------------
-
- Allows fuzz-testing of Python programs. Uses custom instrumentation and its
- own forkserver.
-
- http://jwilk.net/software/python-afl
-
-Go-fuzz (Dmitry Vyukov)
------------------------
-
- AFL-inspired guided fuzzing approach for Go targets:
-
- https://github.com/dvyukov/go-fuzz
-
-afl.rs (Keegan McAllister)
---------------------------
-
- Allows Rust features to be easily fuzzed with AFL (using the LLVM mode).
-
- https://github.com/kmcallister/afl.rs
-
-OCaml support (KC Sivaramakrishnan)
------------------------------------
-
- Adds AFL-compatible instrumentation to OCaml programs.
-
- https://github.com/ocamllabs/opam-repo-dev/pull/23
- http://canopy.mirage.io/Posts/Fuzzing
-
-AFL for GCJ Java and other GCC frontends (-)
---------------------------------------------
-
- GCC Java programs are actually supported out of the box - simply rename
- afl-gcc to afl-gcj. Unfortunately, by default, unhandled exceptions in GCJ do
- not result in abort() being called, so you will need to manually add a
- top-level exception handler that exits with SIGABRT or something equivalent.
-
- Other GCC-supported languages should be fairly easy to get working, but may
- face similar problems. See https://gcc.gnu.org/frontends.html for a list of
- options.
-
-AFL-style in-process fuzzer for LLVM (Kostya Serebryany)
---------------------------------------------------------
-
- Provides an evolutionary instrumentation-guided fuzzing harness that allows
- some programs to be fuzzed without the fork / execve overhead. (Similar
- functionality is now available as the "persistent" feature described in
- ../llvm_mode/README.llvm.)
-
- http://llvm.org/docs/LibFuzzer.html
-
-AFL fixup shim (Ben Nagy)
--------------------------
-
- Allows AFL_POST_LIBRARY postprocessors to be written in arbitrary languages
- that don't have C / .so bindings. Includes examples in Go.
-
- https://github.com/bnagy/aflfix
-
-TriforceAFL (Tim Newsham and Jesse Hertz)
------------------------------------------
-
- Leverages QEMU full system emulation mode to allow AFL to target operating
- systems and other alien worlds:
-
- https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2016/june/project-triforce-run-afl-on-everything/
-
-WinAFL (Ivan Fratric)
----------------------
-
- As the name implies, allows you to fuzz Windows binaries (using DynamoRio).
-
- https://github.com/ivanfratric/winafl
-
-----------------
-Network fuzzing:
-----------------
-
-Preeny (Yan Shoshitaishvili)
-----------------------------
-
- Provides a fairly simple way to convince dynamically linked network-centric
- programs to read from a file or not fork. Not AFL-specific, but described as
- useful by many users. Some assembly required.
-
- https://github.com/zardus/preeny
-
--------------------------------------------
-Distributed fuzzing and related automation:
--------------------------------------------
-
-roving (Richo Healey)
----------------------
-
- A client-server architecture for effortlessly orchestrating AFL runs across
- a fleet of machines. You don't want to use this on systems that face the
- Internet or live in other untrusted environments.
-
- https://github.com/richo/roving
-
-Distfuzz-AFL (Martijn Bogaard)
-------------------------------
-
- Simplifies the management of afl-fuzz instances on remote machines. The
- author notes that the current implementation isn't secure and should not
- be exposed on the Internet.
-
- https://github.com/MartijnB/disfuzz-afl
-
-afl-launch (Ben Nagy)
----------------------
-
- Batch AFL launcher utility with a simple CLI.
-
- https://github.com/bnagy/afl-launch
-
-AFL Utils (rc0r)
-----------------
-
- Simplifies the triage of discovered crashes, start parallel instances, etc.
-
- https://github.com/rc0r/afl-utils
-
-afl-fuzzing-scripts (Tobias Ospelt)
------------------------------------
-
- Simplifies starting up multiple parallel AFL jobs.
-
- https://github.com/floyd-fuh/afl-fuzzing-scripts/
-
-afl-sid (Jacek Wielemborek)
----------------------------
-
- Allows users to more conveniently build and deploy AFL via Docker.
-
- https://github.com/d33tah/afl-sid
-
------------------------------------------------------------
-Crash triage, coverage analysis, and other companion tools:
------------------------------------------------------------
-
-afl-crash-analyzer (Tobias Ospelt)
-----------------------------------
-
- Makes it easier to navigate and annotate crashing test cases.
-
- https://github.com/floyd-fuh/afl-crash-analyzer/
-
-Crashwalk (Ben Nagy)
---------------------
-
- AFL-aware tool to annotate and sort through crashing test cases.
-
- https://github.com/bnagy/crashwalk
-
-afl-cov (Michael Rash)
-----------------------
-
- Produces human-readable coverage data based on the output queue of afl-fuzz.
-
- https://github.com/mrash/afl-cov
-
-afl-sancov (Bhargava Shastry)
------------------------------
-
- Similar to afl-cov, but uses clang sanitizer instrumentation.
-
- https://github.com/bshastry/afl-sancov
-
-RecidiVM (Jakub Wilk)
----------------------
-
- Makes it easy to estimate memory usage limits when fuzzing with ASAN or MSAN.
-
- http://jwilk.net/software/recidivm
-
-aflize (Jacek Wielemborek)
---------------------------
-
- Automatically build AFL-enabled versions of Debian packages.
-
- https://github.com/d33tah/aflize
-
-afl-ddmin-mod (Markus Teufelberger)
------------------------------------
-
- A variant of afl-tmin that uses a more sophisticated (but slower)
- minimization algorithm.
-
- https://github.com/MarkusTeufelberger/afl-ddmin-mod
-
--------------------------------
-Narrow-purpose or experimental:
--------------------------------
-
-Cygwin support (Ali Rizvi-Santiago)
------------------------------------
-
- Pretty self-explanatory. As per the author, this "mostly" ports AFL to
- Windows. Field reports welcome!
-
- https://github.com/arizvisa/afl-cygwin
-
-Pause and resume scripts (Ben Nagy)
------------------------------------
-
- Simple automation to suspend and resume groups of fuzzing jobs.
-
- https://gist.github.com/bnagy/8f0eb29eb125653f73fd
-
-Static binary-only instrumentation (Aleksandar Nikolich)
---------------------------------------------------------
-
- Allows black-box binaries to be instrumented statically (i.e., by modifying
- the binary ahead of the time, rather than translating it on the run). Author
- reports better performance compared to QEMU, but occasional translation
- errors with stripped binaries.
-
- https://github.com/vrtadmin/moflow/tree/master/afl-dyninst
-
-AFL PIN (Parker Thompson)
--------------------------
-
- Early-stage Intel PIN instrumentation support (from before we settled on
- faster-running QEMU).
-
- https://github.com/mothran/aflpin
-
-AFL-style instrumentation in llvm (Kostya Serebryany)
------------------------------------------------------
-
- Allows AFL-equivalent instrumentation to be injected at compiler level.
- This is currently not supported by AFL as-is, but may be useful in other
- projects.
-
- https://code.google.com/p/address-sanitizer/wiki/AsanCoverage#Coverage_counters
-
-AFL JS (Han Choongwoo)
-----------------------
-
- One-off optimizations to speed up the fuzzing of JavaScriptCore (now likely
- superseded by LLVM deferred forkserver init - see llvm_mode/README.llvm).
-
- https://github.com/tunz/afl-fuzz-js
-
-AFL harness for fwknop (Michael Rash)
--------------------------------------
-
- An example of a fairly involved integration with AFL.
-
- https://github.com/mrash/fwknop/tree/master/test/afl
-
-Building harnesses for DNS servers (Jonathan Foote, Ron Bowes)
---------------------------------------------------------------
-
- Two articles outlining the general principles and showing some example code.
-
- https://www.fastly.com/blog/how-to-fuzz-server-american-fuzzy-lop
- https://goo.gl/j9EgFf
-
-Fuzzer shell for SQLite (Richard Hipp)
---------------------------------------
-
- A simple SQL shell designed specifically for fuzzing the underlying library.
-
- http://www.sqlite.org/src/artifact/9e7e273da2030371
-
-Support for Python mutation modules (Christian Holler)
-------------------------------------------------------
-
- https://github.com/choller/afl/blob/master/docs/mozilla/python_modules.txt
-
-Support for selective instrumentation (Christian Holler)
---------------------------------------------------------
-
- https://github.com/choller/afl/blob/master/docs/mozilla/partial_instrumentation.txt
-
-Kernel fuzzing (Dmitry Vyukov)
-------------------------------
-
- A similar guided approach as applied to fuzzing syscalls:
-
- https://github.com/google/syzkaller/wiki/Found-Bugs
- https://github.com/dvyukov/linux/commit/33787098ffaaa83b8a7ccf519913ac5fd6125931
- http://events.linuxfoundation.org/sites/events/files/slides/AFL%20filesystem%20fuzzing%2C%20Vault%202016_0.pdf
diff --git a/chromium/third_party/afl/src/docs/status_screen.txt b/chromium/third_party/afl/src/docs/status_screen.txt
deleted file mode 100644
index ac09804f138..00000000000
--- a/chromium/third_party/afl/src/docs/status_screen.txt
+++ /dev/null
@@ -1,400 +0,0 @@
-===============================
-Understanding the status screen
-===============================
-
- This document provides an overview of the status screen - plus tips for
- troubleshooting any warnings and red text shown in the UI. See README for
- the general instruction manual.
-
-0) A note about colors
-----------------------
-
-The status screen and error messages use colors to keep things readable and
-attract your attention to the most important details. For example, red almost
-always means "consult this doc" :-)
-
-Unfortunately, the UI will render correctly only if your terminal is using
-traditional un*x palette (white text on black background) or something close
-to that.
-
-If you are using inverse video, you may want to change your settings, say:
-
- - For GNOME Terminal, go to Edit > Profile preferences, select the "colors"
- tab, and from the list of built-in schemes, choose "white on black".
-
- - For the MacOS X Terminal app, open a new window using the "Pro" scheme via
- the Shell > New Window menu (or make "Pro" your default).
-
-Alternatively, if you really like your current colors, you can edit config.h
-to comment out USE_COLORS, then do 'make clean all'.
-
-I'm not aware of any other simple way to make this work without causing
-other side effects - sorry about that.
-
-With that out of the way, let's talk about what's actually on the screen...
-
-1) Process timing
------------------
-
- +----------------------------------------------------+
- | run time : 0 days, 8 hrs, 32 min, 43 sec |
- | last new path : 0 days, 0 hrs, 6 min, 40 sec |
- | last uniq crash : none seen yet |
- | last uniq hang : 0 days, 1 hrs, 24 min, 32 sec |
- +----------------------------------------------------+
-
-This section is fairly self-explanatory: it tells you how long the fuzzer has
-been running and how much time has elapsed since its most recent finds. This is
-broken down into "paths" (a shorthand for test cases that trigger new execution
-patterns), crashes, and hangs.
-
-When it comes to timing: there is no hard rule, but most fuzzing jobs should be
-expected to run for days or weeks; in fact, for a moderately complex project, the
-first pass will probably take a day or so. Every now and then, some jobs
-will be allowed to run for months.
-
-There's one important thing to watch out for: if the tool is not finding new
-paths within several minutes of starting, you're probably not invoking the
-target binary correctly and it never gets to parse the input files we're
-throwing at it; another possible explanations are that the default memory limit
-(-m) is too restrictive, and the program exits after failing to allocate a
-buffer very early on; or that the input files are patently invalid and always
-fail a basic header check.
-
-If there are no new paths showing up for a while, you will eventually see a big
-red warning in this section, too :-)
-
-2) Overall results
-------------------
-
- +-----------------------+
- | cycles done : 0 |
- | total paths : 2095 |
- | uniq crashes : 0 |
- | uniq hangs : 19 |
- +-----------------------+
-
-The first field in this section gives you the count of queue passes done so far
-- that is, the number of times the fuzzer went over all the interesting test
-cases discovered so far, fuzzed them, and looped back to the very beginning.
-Every fuzzing session should be allowed to complete at least one cycle; and
-ideally, should run much longer than that.
-
-As noted earlier, the first pass can take a day or longer, so sit back and
-relax. If you want to get broader but more shallow coverage right away, try
-the -d option - it gives you a more familiar experience by skipping the
-deterministic fuzzing steps. It is, however, inferior to the standard mode in
-a couple of subtle ways.
-
-To help make the call on when to hit Ctrl-C, the cycle counter is color-coded.
-It is shown in magenta during the first pass, progresses to yellow if new finds
-are still being made in subsequent rounds, then blue when that ends - and
-finally, turns green after the fuzzer hasn't been seeing any action for a
-longer while.
-
-The remaining fields in this part of the screen should be pretty obvious:
-there's the number of test cases ("paths") discovered so far, and the number of
-unique faults. The test cases, crashes, and hangs can be explored in real-time
-by browsing the output directory, as discussed in the README.
-
-3) Cycle progress
------------------
-
- +-------------------------------------+
- | now processing : 1296 (61.86%) |
- | paths timed out : 0 (0.00%) |
- +-------------------------------------+
-
-This box tells you how far along the fuzzer is with the current queue cycle: it
-shows the ID of the test case it is currently working on, plus the number of
-inputs it decided to ditch because they were persistently timing out.
-
-The "*" suffix sometimes shown in the first line means that the currently
-processed path is not "favored" (a property discussed later on, in section 6).
-
-If you feel that the fuzzer is progressing too slowly, see the note about the
--d option in section 2 of this doc.
-
-4) Map coverage
----------------
-
- +--------------------------------------+
- | map density : 10.15% / 29.07% |
- | count coverage : 4.03 bits/tuple |
- +--------------------------------------+
-
-The section provides some trivia about the coverage observed by the
-instrumentation embedded in the target binary.
-
-The first line in the box tells you how many branch tuples we have already
-hit, in proportion to how much the bitmap can hold. The number on the left
-describes the current input; the one on the right is the value for the entire
-input corpus.
-
-Be wary of extremes:
-
- - Absolute numbers below 200 or so suggest one of three things: that the
- program is extremely simple; that it is not instrumented properly (e.g.,
- due to being linked against a non-instrumented copy of the target
- library); or that it is bailing out prematurely on your input test cases.
- The fuzzer will try to mark this in pink, just to make you aware.
-
- - Percentages over 70% may very rarely happen with very complex programs
- that make heavy use of template-generated code.
-
- Because high bitmap density makes it harder for the fuzzer to reliably
- discern new program states, I recommend recompiling the binary with
- AFL_INST_RATIO=10 or so and trying again (see env_variables.txt).
-
- The fuzzer will flag high percentages in red. Chances are, you will never
- see that unless you're fuzzing extremely hairy software (say, v8, perl,
- ffmpeg).
-
-The other line deals with the variability in tuple hit counts seen in the
-binary. In essence, if every taken branch is always taken a fixed number of
-times for all the inputs we have tried, this will read "1.00". As we manage
-to trigger other hit counts for every branch, the needle will start to move
-toward "8.00" (every bit in the 8-bit map hit), but will probably never
-reach that extreme.
-
-Together, the values can be useful for comparing the coverage of several
-different fuzzing jobs that rely on the same instrumented binary.
-
-5) Stage progress
------------------
-
- +-------------------------------------+
- | now trying : interest 32/8 |
- | stage execs : 3996/34.4k (11.62%) |
- | total execs : 27.4M |
- | exec speed : 891.7/sec |
- +-------------------------------------+
-
-This part gives you an in-depth peek at what the fuzzer is actually doing right
-now. It tells you about the current stage, which can be any of:
-
- - calibration - a pre-fuzzing stage where the execution path is examined
- to detect anomalies, establish baseline execution speed, and so on. Executed
- very briefly whenever a new find is being made.
-
- - trim L/S - another pre-fuzzing stage where the test case is trimmed to the
- shortest form that still produces the same execution path. The length (L)
- and stepover (S) are chosen in general relationship to file size.
-
- - bitflip L/S - deterministic bit flips. There are L bits toggled at any given
- time, walking the input file with S-bit increments. The current L/S variants
- are: 1/1, 2/1, 4/1, 8/8, 16/8, 32/8.
-
- - arith L/8 - deterministic arithmetics. The fuzzer tries to subtract or add
- small integers to 8-, 16-, and 32-bit values. The stepover is always 8 bits.
-
- - interest L/8 - deterministic value overwrite. The fuzzer has a list of known
- "interesting" 8-, 16-, and 32-bit values to try. The stepover is 8 bits.
-
- - extras - deterministic injection of dictionary terms. This can be shown as
- "user" or "auto", depending on whether the fuzzer is using a user-supplied
- dictionary (-x) or an auto-created one. You will also see "over" or "insert",
- depending on whether the dictionary words overwrite existing data or are
- inserted by offsetting the remaining data to accommodate their length.
-
- - havoc - a sort-of-fixed-length cycle with stacked random tweaks. The
- operations attempted during this stage include bit flips, overwrites with
- random and "interesting" integers, block deletion, block duplication, plus
- assorted dictionary-related operations (if a dictionary is supplied in the
- first place).
-
- - splice - a last-resort strategy that kicks in after the first full queue
- cycle with no new paths. It is equivalent to 'havoc', except that it first
- splices together two random inputs from the queue at some arbitrarily
- selected midpoint.
-
- - sync - a stage used only when -M or -S is set (see parallel_fuzzing.txt).
- No real fuzzing is involved, but the tool scans the output from other
- fuzzers and imports test cases as necessary. The first time this is done,
- it may take several minutes or so.
-
-The remaining fields should be fairly self-evident: there's the exec count
-progress indicator for the current stage, a global exec counter, and a
-benchmark for the current program execution speed. This may fluctuate from
-one test case to another, but the benchmark should be ideally over 500 execs/sec
-most of the time - and if it stays below 100, the job will probably take very
-long.
-
-The fuzzer will explicitly warn you about slow targets, too. If this happens,
-see the perf_tips.txt file included with the fuzzer for ideas on how to speed
-things up.
-
-6) Findings in depth
---------------------
-
- +--------------------------------------+
- | favored paths : 879 (41.96%) |
- | new edges on : 423 (20.19%) |
- | total crashes : 0 (0 unique) |
- | total hangs : 24 (19 unique) |
- +--------------------------------------+
-
-This gives you several metrics that are of interest mostly to complete nerds.
-The section includes the number of paths that the fuzzer likes the most based
-on a minimization algorithm baked into the code (these will get considerably
-more air time), and the number of test cases that actually resulted in better
-edge coverage (versus just pushing the branch hit counters up). There are also
-additional, more detailed counters for crashes and hangs.
-
-7) Fuzzing strategy yields
---------------------------
-
- +-----------------------------------------------------+
- | bit flips : 57/289k, 18/289k, 18/288k |
- | byte flips : 0/36.2k, 4/35.7k, 7/34.6k |
- | arithmetics : 53/2.54M, 0/537k, 0/55.2k |
- | known ints : 8/322k, 12/1.32M, 10/1.70M |
- | dictionary : 9/52k, 1/53k, 1/24k |
- | havoc : 1903/20.0M, 0/0 |
- | trim : 20.31%/9201, 17.05% |
- +-----------------------------------------------------+
-
-This is just another nerd-targeted section keeping track of how many paths we
-have netted, in proportion to the number of execs attempted, for each of the
-fuzzing strategies discussed earlier on. This serves to convincingly validate
-assumptions about the usefulness of the various approaches taken by afl-fuzz.
-
-The trim strategy stats in this section are a bit different than the rest.
-The first number in this line shows the ratio of bytes removed from the input
-files; the second one corresponds to the number of execs needed to achieve this
-goal. Finally, the third number shows the proportion of bytes that, although
-not possible to remove, were deemed to have no effect and were excluded from
-some of the more expensive deterministic fuzzing steps.
-
-8) Path geometry
-----------------
-
- +---------------------+
- | levels : 5 |
- | pending : 1570 |
- | pend fav : 583 |
- | own finds : 0 |
- | imported : 0 |
- | stability : 100.00% |
- +---------------------+
-
-The first field in this section tracks the path depth reached through the
-guided fuzzing process. In essence: the initial test cases supplied by the
-user are considered "level 1". The test cases that can be derived from that
-through traditional fuzzing are considered "level 2"; the ones derived by
-using these as inputs to subsequent fuzzing rounds are "level 3"; and so forth.
-The maximum depth is therefore a rough proxy for how much value you're getting
-out of the instrumentation-guided approach taken by afl-fuzz.
-
-The next field shows you the number of inputs that have not gone through any
-fuzzing yet. The same stat is also given for "favored" entries that the fuzzer
-really wants to get to in this queue cycle (the non-favored entries may have to
-wait a couple of cycles to get their chance).
-
-Next, we have the number of new paths found during this fuzzing section and
-imported from other fuzzer instances when doing parallelized fuzzing; and the
-number of inputs that produce seemingly variable behavior in the tested binary.
-
-That last bit is actually fairly interesting: it measures the consistency of
-observed traces. If a program always behaves the same for the same input data,
-it will earn a score of 100%. When the value is lower but still shown in purple,
-the fuzzing process is unlikely to be negatively affected. If it goes into red,
-you may be in trouble, since AFL will have difficulty discerning between
-meaningful and "phantom" effects of tweaking the input file.
-
-Now, most targets will just get a 100% score, but when you see lower figures,
-there are several things to look at:
-
- - The use of uninitialized memory in conjunction with some intrinsic sources
- of entropy in the tested binary. Harmless to AFL, but could be indicative
- of a security bug.
-
- - Attempts to manipulate persistent resources, such as left over temporary
- files or shared memory objects. This is usually harmless, but you may want
- to double-check to make sure the program isn't bailing out prematurely.
- Running out of disk space, SHM handles, or other global resources can
- trigger this, too.
-
- - Hitting some functionality that is actually designed to behave randomly.
- Generally harmless. For example, when fuzzing sqlite, an input like
- 'select random();' will trigger a variable execution path.
-
- - Multiple threads executing at once in semi-random order. This is harmless
- when the 'stability' metric stays over 90% or so, but can become an issue
- if not. Here's what to try:
-
- - Use afl-clang-fast from llvm_mode/ - it uses a thread-local tracking
- model that is less prone to concurrency issues,
-
- - See if the target can be compiled or run without threads. Common
- ./configure options include --without-threads, --disable-pthreads, or
- --disable-openmp.
-
- - Replace pthreads with GNU Pth (https://www.gnu.org/software/pth/), which
- allows you to use a deterministic scheduler.
-
- - In persistent mode, minor drops in the "stability" metric can be normal,
- because not all the code behaves identically when re-entered; but major
- dips may signify that the code within __AFL_LOOP() is not behaving
- correctly on subsequent iterations (e.g., due to incomplete clean-up or
- reinitialization of the state) and that most of the fuzzing effort goes
- to waste.
-
-The paths where variable behavior is detected are marked with a matching entry
-in the <out_dir>/queue/.state/variable_behavior/ directory, so you can look
-them up easily.
-
-9) CPU load
------------
-
- [cpu: 25%]
-
-This tiny widget shows the apparent CPU utilization on the local system. It is
-calculated by taking the number of processes in the "runnable" state, and then
-comparing it to the number of logical cores on the system.
-
-If the value is shown in green, you are using fewer CPU cores than available on
-your system and can probably parallelize to improve performance; for tips on
-how to do that, see parallel_fuzzing.txt.
-
-If the value is shown in red, your CPU is *possibly* oversubscribed, and
-running additional fuzzers may not give you any benefits.
-
-Of course, this benchmark is very simplistic; it tells you how many processes
-are ready to run, but not how resource-hungry they may be. It also doesn't
-distinguish between physical cores, logical cores, and virtualized CPUs; the
-performance characteristics of each of these will differ quite a bit.
-
-If you want a more accurate measurement, you can run the afl-gotcpu utility
-from the command line.
-
-10) Addendum: status and plot files
------------------------------------
-
-For unattended operation, some of the key status screen information can be also
-found in a machine-readable format in the fuzzer_stats file in the output
-directory. This includes:
-
- - start_time - unix time indicating the start time of afl-fuzz
- - last_update - unix time corresponding to the last update of this file
- - fuzzer_pid - PID of the fuzzer process
- - cycles_done - queue cycles completed so far
- - execs_done - number of execve() calls attempted
- - execs_per_sec - current number of execs per second
- - paths_total - total number of entries in the queue
- - paths_found - number of entries discovered through local fuzzing
- - paths_imported - number of entries imported from other instances
- - max_depth - number of levels in the generated data set
- - cur_path - currently processed entry number
- - pending_favs - number of favored entries still waiting to be fuzzed
- - pending_total - number of all entries waiting to be fuzzed
- - stability - percentage of bitmap bytes that behave consistently
- - variable_paths - number of test cases showing variable behavior
- - unique_crashes - number of unique crashes recorded
- - unique_hangs - number of unique hangs encountered
-
-Most of these map directly to the UI elements discussed earlier on.
-
-On top of that, you can also find an entry called 'plot_data', containing a
-plottable history for most of these fields. If you have gnuplot installed, you
-can turn this into a nice progress report with the included 'afl-plot' tool.
diff --git a/chromium/third_party/afl/src/docs/technical_details.txt b/chromium/third_party/afl/src/docs/technical_details.txt
deleted file mode 100644
index af6131c1057..00000000000
--- a/chromium/third_party/afl/src/docs/technical_details.txt
+++ /dev/null
@@ -1,563 +0,0 @@
-===================================
-Technical "whitepaper" for afl-fuzz
-===================================
-
- This document provides a quick overview of the guts of American Fuzzy Lop.
- See README for the general instruction manual; and for a discussion of
- motivations and design goals behind AFL, see historical_notes.txt.
-
-0) Design statement
--------------------
-
-American Fuzzy Lop does its best not to focus on any singular principle of
-operation and not be a proof-of-concept for any specific theory. The tool can
-be thought of as a collection of hacks that have been tested in practice,
-found to be surprisingly effective, and have been implemented in the simplest,
-most robust way I could think of at the time.
-
-Many of the resulting features are made possible thanks to the availability of
-lightweight instrumentation that served as a foundation for the tool, but this
-mechanism should be thought of merely as a means to an end. The only true
-governing principles are speed, reliability, and ease of use.
-
-1) Coverage measurements
-------------------------
-
-The instrumentation injected into compiled programs captures branch (edge)
-coverage, along with coarse branch-taken hit counts. The code injected at
-branch points is essentially equivalent to:
-
- cur_location = <COMPILE_TIME_RANDOM>;
- shared_mem[cur_location ^ prev_location]++;
- prev_location = cur_location >> 1;
-
-The cur_location value is generated randomly to simplify the process of
-linking complex projects and keep the XOR output distributed uniformly.
-
-The shared_mem[] array is a 64 kB SHM region passed to the instrumented binary
-by the caller. Every byte set in the output map can be thought of as a hit for
-a particular (branch_src, branch_dst) tuple in the instrumented code.
-
-The size of the map is chosen so that collisions are sporadic with almost all
-of the intended targets, which usually sport between 2k and 10k discoverable
-branch points:
-
- Branch cnt | Colliding tuples | Example targets
- ------------+------------------+-----------------
- 1,000 | 0.75% | giflib, lzo
- 2,000 | 1.5% | zlib, tar, xz
- 5,000 | 3.5% | libpng, libwebp
- 10,000 | 7% | libxml
- 20,000 | 14% | sqlite
- 50,000 | 30% | -
-
-At the same time, its size is small enough to allow the map to be analyzed
-in a matter of microseconds on the receiving end, and to effortlessly fit
-within L2 cache.
-
-This form of coverage provides considerably more insight into the execution
-path of the program than simple block coverage. In particular, it trivially
-distinguishes between the following execution traces:
-
- A -> B -> C -> D -> E (tuples: AB, BC, CD, DE)
- A -> B -> D -> C -> E (tuples: AB, BD, DC, CE)
-
-This aids the discovery of subtle fault conditions in the underlying code,
-because security vulnerabilities are more often associated with unexpected
-or incorrect state transitions than with merely reaching a new basic block.
-
-The reason for the shift operation in the last line of the pseudocode shown
-earlier in this section is to preserve the directionality of tuples (without
-this, A ^ B would be indistinguishable from B ^ A) and to retain the identity
-of tight loops (otherwise, A ^ A would be obviously equal to B ^ B).
-
-The absence of simple saturating arithmetic opcodes on Intel CPUs means that
-the hit counters can sometimes wrap around to zero. Since this is a fairly
-unlikely and localized event, it's seen as an acceptable performance trade-off.
-
-2) Detecting new behaviors
---------------------------
-
-The fuzzer maintains a global map of tuples seen in previous executions; this
-data can be rapidly compared with individual traces and updated in just a couple
-of dword- or qword-wide instructions and a simple loop.
-
-When a mutated input produces an execution trace containing new tuples, the
-corresponding input file is preserved and routed for additional processing
-later on (see section #3). Inputs that do not trigger new local-scale state
-transitions in the execution trace (i.e., produce no new tuples) are discarded,
-even if their overall control flow sequence is unique.
-
-This approach allows for a very fine-grained and long-term exploration of
-program state while not having to perform any computationally intensive and
-fragile global comparisons of complex execution traces, and while avoiding the
-scourge of path explosion.
-
-To illustrate the properties of the algorithm, consider that the second trace
-shown below would be considered substantially new because of the presence of
-new tuples (CA, AE):
-
- #1: A -> B -> C -> D -> E
- #2: A -> B -> C -> A -> E
-
-At the same time, with #2 processed, the following pattern will not be seen
-as unique, despite having a markedly different overall execution path:
-
- #3: A -> B -> C -> A -> B -> C -> A -> B -> C -> D -> E
-
-In addition to detecting new tuples, the fuzzer also considers coarse tuple
-hit counts. These are divided into several buckets:
-
- 1, 2, 3, 4-7, 8-15, 16-31, 32-127, 128+
-
-To some extent, the number of buckets is an implementation artifact: it allows
-an in-place mapping of an 8-bit counter generated by the instrumentation to
-an 8-position bitmap relied on by the fuzzer executable to keep track of the
-already-seen execution counts for each tuple.
-
-Changes within the range of a single bucket are ignored; transition from one
-bucket to another is flagged as an interesting change in program control flow,
-and is routed to the evolutionary process outlined in the section below.
-
-The hit count behavior provides a way to distinguish between potentially
-interesting control flow changes, such as a block of code being executed
-twice when it was normally hit only once. At the same time, it is fairly
-insensitive to empirically less notable changes, such as a loop going from
-47 cycles to 48. The counters also provide some degree of "accidental"
-immunity against tuple collisions in dense trace maps.
-
-The execution is policed fairly heavily through memory and execution time
-limits; by default, the timeout is set at 5x the initially-calibrated
-execution speed, rounded up to 20 ms. The aggressive timeouts are meant to
-prevent dramatic fuzzer performance degradation by descending into tarpits
-that, say, improve coverage by 1% while being 100x slower; we pragmatically
-reject them and hope that the fuzzer will find a less expensive way to reach
-the same code. Empirical testing strongly suggests that more generous time
-limits are not worth the cost.
-
-3) Evolving the input queue
----------------------------
-
-Mutated test cases that produced new state transitions within the program are
-added to the input queue and used as a starting point for future rounds of
-fuzzing. They supplement, but do not automatically replace, existing finds.
-
-In contrast to more greedy genetic algorithms, this approach allows the tool
-to progressively explore various disjoint and possibly mutually incompatible
-features of the underlying data format, as shown in this image:
-
- http://lcamtuf.coredump.cx/afl/afl_gzip.png
-
-Several practical examples of the results of this algorithm are discussed
-here:
-
- http://lcamtuf.blogspot.com/2014/11/pulling-jpegs-out-of-thin-air.html
- http://lcamtuf.blogspot.com/2014/11/afl-fuzz-nobody-expects-cdata-sections.html
-
-The synthetic corpus produced by this process is essentially a compact
-collection of "hmm, this does something new!" input files, and can be used to
-seed any other testing processes down the line (for example, to manually
-stress-test resource-intensive desktop apps).
-
-With this approach, the queue for most targets grows to somewhere between 1k
-and 10k entries; approximately 10-30% of this is attributable to the discovery
-of new tuples, and the remainder is associated with changes in hit counts.
-
-The following table compares the relative ability to discover file syntax and
-explore program states when using several different approaches to guided
-fuzzing. The instrumented target was GNU patch 2.7.3 compiled with -O3 and
-seeded with a dummy text file; the session consisted of a single pass over the
-input queue with afl-fuzz:
-
- Fuzzer guidance | Blocks | Edges | Edge hit | Highest-coverage
- strategy used | reached | reached | cnt var | test case generated
- ------------------+---------+---------+----------+---------------------------
- (Initial file) | 156 | 163 | 1.00 | (none)
- | | | |
- Blind fuzzing S | 182 | 205 | 2.23 | First 2 B of RCS diff
- Blind fuzzing L | 228 | 265 | 2.23 | First 4 B of -c mode diff
- Block coverage | 855 | 1,130 | 1.57 | Almost-valid RCS diff
- Edge coverage | 1,452 | 2,070 | 2.18 | One-chunk -c mode diff
- AFL model | 1,765 | 2,597 | 4.99 | Four-chunk -c mode diff
-
-The first entry for blind fuzzing ("S") corresponds to executing just a single
-round of testing; the second set of figures ("L") shows the fuzzer running in a
-loop for a number of execution cycles comparable with that of the instrumented
-runs, which required more time to fully process the growing queue.
-
-Roughly similar results have been obtained in a separate experiment where the
-fuzzer was modified to compile out all the random fuzzing stages and leave just
-a series of rudimentary, sequential operations such as walking bit flips.
-Because this mode would be incapable of altering the size of the input file,
-the sessions were seeded with a valid unified diff:
-
- Queue extension | Blocks | Edges | Edge hit | Number of unique
- strategy used | reached | reached | cnt var | crashes found
- ------------------+---------+---------+----------+------------------
- (Initial file) | 624 | 717 | 1.00 | -
- | | | |
- Blind fuzzing | 1,101 | 1,409 | 1.60 | 0
- Block coverage | 1,255 | 1,649 | 1.48 | 0
- Edge coverage | 1,259 | 1,734 | 1.72 | 0
- AFL model | 1,452 | 2,040 | 3.16 | 1
-
-At noted earlier on, some of the prior work on genetic fuzzing relied on
-maintaining a single test case and evolving it to maximize coverage. At least
-in the tests described above, this "greedy" approach appears to confer no
-substantial benefits over blind fuzzing strategies.
-
-4) Culling the corpus
----------------------
-
-The progressive state exploration approach outlined above means that some of
-the test cases synthesized later on in the game may have edge coverage that
-is a strict superset of the coverage provided by their ancestors.
-
-To optimize the fuzzing effort, AFL periodically re-evaluates the queue using a
-fast algorithm that selects a smaller subset of test cases that still cover
-every tuple seen so far, and whose characteristics make them particularly
-favorable to the tool.
-
-The algorithm works by assigning every queue entry a score proportional to its
-execution latency and file size; and then selecting lowest-scoring candidates
-for each tuple.
-
-The tuples are then processed sequentially using a simple workflow:
-
- 1) Find next tuple not yet in the temporary working set,
-
- 2) Locate the winning queue entry for this tuple,
-
- 3) Register *all* tuples present in that entry's trace in the working set,
-
- 4) Go to #1 if there are any missing tuples in the set.
-
-The generated corpus of "favored" entries is usually 5-10x smaller than the
-starting data set. Non-favored entries are not discarded, but they are skipped
-with varying probabilities when encountered in the queue:
-
- - If there are new, yet-to-be-fuzzed favorites present in the queue, 99%
- of non-favored entries will be skipped to get to the favored ones.
-
- - If there are no new favorites:
-
- - If the current non-favored entry was fuzzed before, it will be skipped
- 95% of the time.
-
- - If it hasn't gone through any fuzzing rounds yet, the odds of skipping
- drop down to 75%.
-
-Based on empirical testing, this provides a reasonable balance between queue
-cycling speed and test case diversity.
-
-Slightly more sophisticated but much slower culling can be performed on input
-or output corpora with afl-cmin. This tool permanently discards the redundant
-entries and produces a smaller corpus suitable for use with afl-fuzz or
-external tools.
-
-5) Trimming input files
------------------------
-
-File size has a dramatic impact on fuzzing performance, both because large
-files make the target binary slower, and because they reduce the likelihood
-that a mutation would touch important format control structures, rather than
-redundant data blocks. This is discussed in more detail in perf_tips.txt.
-
-The possibility that the user will provide a low-quality starting corpus aside,
-some types of mutations can have the effect of iteratively increasing the size
-of the generated files, so it is important to counter this trend.
-
-Luckily, the instrumentation feedback provides a simple way to automatically
-trim down input files while ensuring that the changes made to the files have no
-impact on the execution path.
-
-The built-in trimmer in afl-fuzz attempts to sequentially remove blocks of data
-with variable length and stepover; any deletion that doesn't affect the checksum
-of the trace map is committed to disk. The trimmer is not designed to be
-particularly thorough; instead, it tries to strike a balance between precision
-and the number of execve() calls spent on the process, selecting the block size
-and stepover to match. The average per-file gains are around 5-20%.
-
-The standalone afl-tmin tool uses a more exhaustive, iterative algorithm, and
-also attempts to perform alphabet normalization on the trimmed files. The
-operation of afl-tmin is as follows.
-
-First, the tool automatically selects the operating mode. If the initial input
-crashes the target binary, afl-tmin will run in non-instrumented mode, simply
-keeping any tweaks that produce a simpler file but still crash the target. If
-the target is non-crashing, the tool uses an instrumented mode and keeps only
-the tweaks that produce exactly the same execution path.
-
-The actual minimization algorithm is:
-
- 1) Attempt to zero large blocks of data with large stepovers. Empirically,
- this is shown to reduce the number of execs by preempting finer-grained
- efforts later on.
-
- 2) Perform a block deletion pass with decreasing block sizes and stepovers,
- binary-search-style.
-
- 3) Perform alphabet normalization by counting unique characters and trying
- to bulk-replace each with a zero value.
-
- 4) As a last result, perform byte-by-byte normalization on non-zero bytes.
-
-Instead of zeroing with a 0x00 byte, afl-tmin uses the ASCII digit '0'. This
-is done because such a modification is much less likely to interfere with
-text parsing, so it is more likely to result in successful minimization of
-text files.
-
-The algorithm used here is less involved than some other test case
-minimization approaches proposed in academic work, but requires far fewer
-executions and tends to produce comparable results in most real-world
-applications.
-
-6) Fuzzing strategies
----------------------
-
-The feedback provided by the instrumentation makes it easy to understand the
-value of various fuzzing strategies and optimize their parameters so that they
-work equally well across a wide range of file types. The strategies used by
-afl-fuzz are generally format-agnostic and are discussed in more detail here:
-
- http://lcamtuf.blogspot.com/2014/08/binary-fuzzing-strategies-what-works.html
-
-It is somewhat notable that especially early on, most of the work done by
-afl-fuzz is actually highly deterministic, and progresses to random stacked
-modifications and test case splicing only at a later stage. The deterministic
-strategies include:
-
- - Sequential bit flips with varying lengths and stepovers,
-
- - Sequential addition and subtraction of small integers,
-
- - Sequential insertion of known interesting integers (0, 1, INT_MAX, etc),
-
-The purpose of opening with deterministic steps is related to their tendency to
-produce compact test cases and small diffs between the non-crashing and crashing
-inputs.
-
-With deterministic fuzzing out of the way, the non-deterministic steps include
-stacked bit flips, insertions, deletions, arithmetics, and splicing of different
-test cases.
-
-The relative yields and execve() costs of all these strategies have been
-investigated and are discussed in the aforementioned blog post.
-
-For the reasons discussed in historical_notes.txt (chiefly, performance,
-simplicity, and reliability), AFL generally does not try to reason about the
-relationship between specific mutations and program states; the fuzzing steps
-are nominally blind, and are guided only by the evolutionary design of the
-input queue.
-
-That said, there is one (trivial) exception to this rule: when a new queue
-entry goes through the initial set of deterministic fuzzing steps, and tweaks to
-some regions in the file are observed to have no effect on the checksum of the
-execution path, they may be excluded from the remaining phases of
-deterministic fuzzing - and the fuzzer may proceed straight to random tweaks.
-Especially for verbose, human-readable data formats, this can reduce the number
-of execs by 10-40% or so without an appreciable drop in coverage. In extreme
-cases, such as normally block-aligned tar archives, the gains can be as high as
-90%.
-
-Because the underlying "effector maps" are local every queue entry and remain
-in force only during deterministic stages that do not alter the size or the
-general layout of the underlying file, this mechanism appears to work very
-reliably and proved to be simple to implement.
-
-7) Dictionaries
----------------
-
-The feedback provided by the instrumentation makes it easy to automatically
-identify syntax tokens in some types of input files, and to detect that certain
-combinations of predefined or auto-detected dictionary terms constitute a
-valid grammar for the tested parser.
-
-A discussion of how these features are implemented within afl-fuzz can be found
-here:
-
- http://lcamtuf.blogspot.com/2015/01/afl-fuzz-making-up-grammar-with.html
-
-In essence, when basic, typically easily-obtained syntax tokens are combined
-together in a purely random manner, the instrumentation and the evolutionary
-design of the queue together provide a feedback mechanism to differentiate
-between meaningless mutations and ones that trigger new behaviors in the
-instrumented code - and to incrementally build more complex syntax on top of
-this discovery.
-
-The dictionaries have been shown to enable the fuzzer to rapidly reconstruct
-the grammar of highly verbose and complex languages such as JavaScript, SQL,
-or XML; several examples of generated SQL statements are given in the blog
-post mentioned above.
-
-Interestingly, the AFL instrumentation also allows the fuzzer to automatically
-isolate syntax tokens already present in an input file. It can do so by looking
-for run of bytes that, when flipped, produce a consistent change to the
-program's execution path; this is suggestive of an underlying atomic comparison
-to a predefined value baked into the code. The fuzzer relies on this signal
-to build compact "auto dictionaries" that are then used in conjunction with
-other fuzzing strategies.
-
-8) De-duping crashes
---------------------
-
-De-duplication of crashes is one of the more important problems for any
-competent fuzzing tool. Many of the naive approaches run into problems; in
-particular, looking just at the faulting address may lead to completely
-unrelated issues being clustered together if the fault happens in a common
-library function (say, strcmp, strcpy); while checksumming call stack
-backtraces can lead to extreme crash count inflation if the fault can be
-reached through a number of different, possibly recursive code paths.
-
-The solution implemented in afl-fuzz considers a crash unique if any of two
-conditions are met:
-
- - The crash trace includes a tuple not seen in any of the previous crashes,
-
- - The crash trace is missing a tuple that was always present in earlier
- faults.
-
-The approach is vulnerable to some path count inflation early on, but exhibits
-a very strong self-limiting effect, similar to the execution path analysis
-logic that is the cornerstone of afl-fuzz.
-
-9) Investigating crashes
-------------------------
-
-The exploitability of many types of crashes can be ambiguous; afl-fuzz tries
-to address this by providing a crash exploration mode where a known-faulting
-test case is fuzzed in a manner very similar to the normal operation of the
-fuzzer, but with a constraint that causes any non-crashing mutations to be
-thrown away.
-
-A detailed discussion of the value of this approach can be found here:
-
- http://lcamtuf.blogspot.com/2014/11/afl-fuzz-crash-exploration-mode.html
-
-The method uses instrumentation feedback to explore the state of the crashing
-program to get past the ambiguous faulting condition and then isolate the
-newly-found inputs for human review.
-
-On the subject of crashes, it is worth noting that in contrast to normal
-queue entries, crashing inputs are *not* trimmed; they are kept exactly as
-discovered to make it easier to compare them to the parent, non-crashing entry
-in the queue. That said, afl-tmin can be used to shrink them at will.
-
-10) The fork server
--------------------
-
-To improve performance, afl-fuzz uses a "fork server", where the fuzzed process
-goes through execve(), linking, and libc initialization only once, and is then
-cloned from a stopped process image by leveraging copy-on-write. The
-implementation is described in more detail here:
-
- http://lcamtuf.blogspot.com/2014/10/fuzzing-binaries-without-execve.html
-
-The fork server is an integral aspect of the injected instrumentation and
-simply stops at the first instrumented function to await commands from
-afl-fuzz.
-
-With fast targets, the fork server can offer considerable performance gains,
-usually between 1.5x and 2x. It is also possible to:
-
- - Use the fork server in manual ("deferred") mode, skipping over larger,
- user-selected chunks of initialization code. It requires very modest
- code changes to the targeted program, and With some targets, can
- produce 10x+ performance gains.
-
- - Enable "persistent" mode, where a single process is used to try out
- multiple inputs, greatly limiting the overhead of repetitive fork()
- calls. This generally requires some code changes to the targeted program,
- but can improve the performance of fast targets by a factor of 5 or more
- - approximating the benefits of in-process fuzzing jobs while still
- maintaining very robust isolation between the fuzzer process and the
- targeted binary.
-
-11) Parallelization
--------------------
-
-The parallelization mechanism relies on periodically examining the queues
-produced by independently-running instances on other CPU cores or on remote
-machines, and then selectively pulling in the test cases that, when tried
-out locally, produce behaviors not yet seen by the fuzzer at hand.
-
-This allows for extreme flexibility in fuzzer setup, including running synced
-instances against different parsers of a common data format, often with
-synergistic effects.
-
-For more information about this design, see parallel_fuzzing.txt.
-
-12) Binary-only instrumentation
--------------------------------
-
-Instrumentation of black-box, binary-only targets is accomplished with the
-help of a separately-built version of QEMU in "user emulation" mode. This also
-allows the execution of cross-architecture code - say, ARM binaries on x86.
-
-QEMU uses basic blocks as translation units; the instrumentation is implemented
-on top of this and uses a model roughly analogous to the compile-time hooks:
-
- if (block_address > elf_text_start && block_address < elf_text_end) {
-
- cur_location = (block_address >> 4) ^ (block_address << 8);
- shared_mem[cur_location ^ prev_location]++;
- prev_location = cur_location >> 1;
-
- }
-
-The shift-and-XOR-based scrambling in the second line is used to mask the
-effects of instruction alignment.
-
-The start-up of binary translators such as QEMU, DynamoRIO, and PIN is fairly
-slow; to counter this, the QEMU mode leverages a fork server similar to that
-used for compiler-instrumented code, effectively spawning copies of an
-already-initialized process paused at _start.
-
-First-time translation of a new basic block also incurs substantial latency. To
-eliminate this problem, the AFL fork server is extended by providing a channel
-between the running emulator and the parent process. The channel is used
-to notify the parent about the addresses of any newly-encountered blocks and to
-add them to the translation cache that will be replicated for future child
-processes.
-
-As a result of these two optimizations, the overhead of the QEMU mode is
-roughly 2-5x, compared to 100x+ for PIN.
-
-13) The afl-analyze tool
-------------------------
-
-The file format analyzer is a simple extension of the minimization algorithm
-discussed earlier on; instead of attempting to remove no-op blocks, the tool
-performs a series of walking byte flips and then annotates runs of bytes
-in the input file.
-
-It uses the following classification scheme:
-
- - "No-op blocks" - segments where bit flips cause no apparent changes to
- control flow. Common examples may be comment sections, pixel data within
- a bitmap file, etc.
-
- - "Superficial content" - segments where some, but not all, bitflips
- produce some control flow changes. Examples may include strings in rich
- documents (e.g., XML, RTF).
-
- - "Critical stream" - a sequence of bytes where all bit flips alter control
- flow in different but correlated ways. This may be compressed data,
- non-atomically compared keywords or magic values, etc.
-
- - "Suspected length field" - small, atomic integer that, when touched in
- any way, causes a consistent change to program control flow, suggestive
- of a failed length check.
-
- - "Suspected cksum or magic int" - an integer that behaves similarly to a
- length field, but has a numerical value that makes the length explanation
- unlikely. This is suggestive of a checksum or other "magic" integer.
-
- - "Suspected checksummed block" - a long block of data where any change
- always triggers the same new execution path. Likely caused by failing
- a checksum or a similar integrity check before any subsequent parsing
- takes place.
-
- - "Magic value section" - a generic token where changes cause the type
- of binary behavior outlined earlier, but that doesn't meet any of the
- other criteria. May be an atomically compared keyword or so.
diff --git a/chromium/third_party/afl/src/docs/visualization/afl_gzip.png b/chromium/third_party/afl/src/docs/visualization/afl_gzip.png
deleted file mode 100644
index 7c461d8fa02..00000000000
--- a/chromium/third_party/afl/src/docs/visualization/afl_gzip.png
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/experimental/README.experiments b/chromium/third_party/afl/src/experimental/README.experiments
deleted file mode 100644
index af9739bda38..00000000000
--- a/chromium/third_party/afl/src/experimental/README.experiments
+++ /dev/null
@@ -1,38 +0,0 @@
-Here's a quick overview of the stuff you can find in this directory:
-
- - argv_fuzzing - a simple wrapper to allow cmdline to be fuzzed
- (e.g., to test setuid programs).
-
- - asan_cgroups - a contributed script to simplify fuzzing ASAN
- binaries with robust memory limits on Linux.
-
- - bash_shellshock - a simple hack used to find a bunch of
- post-Shellshock bugs in bash.
-
- - canvas_harness - a test harness used to find browser bugs with a
- corpus generated using simple image parsing
- binaries & afl-fuzz.
-
- - clang_asm_normalize - a script that makes it easy to instrument
- hand-written assembly, provided that you have clang.
-
- - crash_triage - a very rudimentary example of how to annotate crashes
- with additional gdb metadata.
-
- - distributed_fuzzing - a sample script for synchronizing fuzzer instances
- across multiple machines (see parallel_fuzzing.txt).
-
- - libpng_no_checksum - a sample patch for removing CRC checks in libpng.
-
- - persistent_demo - an example of how to use the LLVM persistent process
- mode to speed up certain fuzzing jobs.
-
- - post_library - an example of how to build postprocessors for AFL.
-
-Note that the minimize_corpus.sh tool has graduated from the experimental/
-directory and is now available as ../afl-cmin. The LLVM mode has likewise
-graduated to ../llvm_mode/*.
-
-Most of the tools in this directory are meant chiefly as examples that need to
-be tweaked for your specific needs. They come with some basic documentation,
-but are not necessarily production-grade.
diff --git a/chromium/third_party/afl/src/experimental/asan_cgroups/limit_memory.sh b/chromium/third_party/afl/src/experimental/asan_cgroups/limit_memory.sh
deleted file mode 100755
index b0c77d15fa4..00000000000
--- a/chromium/third_party/afl/src/experimental/asan_cgroups/limit_memory.sh
+++ /dev/null
@@ -1,157 +0,0 @@
-#!/usr/bin/env bash
-#
-# american fuzzy lop - limit memory using cgroups
-# -----------------------------------------------
-#
-# Written by Samir Khakimov <samir.hakim@nyu.edu> and
-# David A. Wheeler <dwheeler@ida.org>
-#
-# Edits to bring the script in line with afl-cmin and other companion scripts
-# by Michal Zalewski <lcamtuf@google.com>. All bugs are my fault.
-#
-# Copyright 2015 Institute for Defense Analyses.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# This tool allows the amount of actual memory allocated to a program
-# to be limited on Linux systems using cgroups, instead of the traditional
-# setrlimit() API. This helps avoid the address space problems discussed in
-# docs/notes_for_asan.txt.
-#
-# Important: the limit covers *both* afl-fuzz and the fuzzed binary. In some
-# hopefully rare circumstances, afl-fuzz could be killed before the fuzzed
-# task.
-#
-
-echo "cgroup tool for afl-fuzz by <samir.hakim@nyu.edu> and <dwheeler@ida.org>"
-echo
-
-unset NEW_USER
-MEM_LIMIT="50"
-
-while getopts "+u:m:" opt; do
-
- case "$opt" in
-
- "u")
- NEW_USER="$OPTARG"
- ;;
-
- "m")
- MEM_LIMIT="$[OPTARG]"
- ;;
-
- "?")
- exit 1
- ;;
-
- esac
-
-done
-
-if [ "$MEM_LIMIT" -lt "5" ]; then
- echo "[-] Error: malformed or dangerously low value of -m." 1>&2
- exit 1
-fi
-
-shift $((OPTIND-1))
-
-TARGET_BIN="$1"
-
-if [ "$TARGET_BIN" = "" -o "$NEW_USER" = "" ]; then
-
- cat 1>&2 <<_EOF_
-Usage: $0 [ options ] -- /path/to/afl-fuzz [ ...afl options... ]
-
-Required parameters:
-
- -u user - run the fuzzer as a specific user after setting up limits
-
-Optional parameters:
-
- -m megs - set memory limit to a specified value ($MEM_LIMIT MB)
-
-This tool configures cgroups-based memory limits for a fuzzing job to simplify
-the task of fuzzing ASAN or MSAN binaries. You would normally want to use it in
-conjunction with '-m none' passed to the afl-fuzz binary itself, say:
-
- $0 -u joe ./afl-fuzz -i input -o output -m none /path/to/target
-
-_EOF_
-
- exit 1
-
-fi
-
-# Basic sanity checks
-
-if [ ! "`uname -s`" = "Linux" ]; then
- echo "[-] Error: this tool does not support non-Linux systems." 1>&2
- exit 1
-fi
-
-if [ ! "`id -u`" = "0" ]; then
- echo "[-] Error: you need to run this script as root (sorry!)." 1>&2
- exit 1
-fi
-
-if ! type cgcreate 2>/dev/null 1>&2; then
-
- echo "[-] Error: you need to install cgroup tools first." 1>&2
-
- if type apt-get 2>/dev/null 1>&2; then
- echo " (Perhaps 'apt-get install cgroup-bin' will work.)" 1>&2
- elif type yum 2>/dev/null 1>&2; then
- echo " (Perhaps 'yum install libcgroup-tools' will work.)" 1>&2
- fi
-
- exit 1
-
-fi
-
-if ! id -u "$NEW_USER" 2>/dev/null 1>&2; then
- echo "[-] Error: user '$NEW_USER' does not seem to exist." 1>&2
- exit 1
-fi
-
-# Create a new cgroup path if necessary... We used PID-keyed groups to keep
-# parallel afl-fuzz tasks separate from each other.
-
-CID="afl-$NEW_USER-$$"
-
-CPATH="/sys/fs/cgroup/memory/$CID"
-
-if [ ! -d "$CPATH" ]; then
-
- cgcreate -a "$NEW_USER" -g memory:"$CID" || exit 1
-
-fi
-
-# Set the appropriate limit...
-
-if [ -f "$CPATH/memory.memsw.limit_in_bytes" ]; then
-
- echo "${MEM_LIMIT}M" > "$CPATH/memory.limit_in_bytes" 2>/dev/null
- echo "${MEM_LIMIT}M" > "$CPATH/memory.memsw.limit_in_bytes" || exit 1
- echo "${MEM_LIMIT}M" > "$CPATH/memory.limit_in_bytes" || exit 1
-
-elif grep -qE 'partition|file' /proc/swaps; then
-
- echo "[-] Error: your system requires swap to be disabled first (swapoff -a)." 1>&2
- exit 1
-
-else
-
- echo "${MEM_LIMIT}M" > "$CPATH/memory.limit_in_bytes" || exit 1
-
-fi
-
-# All right. At this point, we can just run the command.
-
-cgexec -g "memory:$CID" su -c "$*" "$NEW_USER"
-
-cgdelete -g "memory:$CID"
diff --git a/chromium/third_party/afl/src/experimental/bash_shellshock/shellshock-fuzz.diff b/chromium/third_party/afl/src/experimental/bash_shellshock/shellshock-fuzz.diff
deleted file mode 100644
index 3fa05bf814c..00000000000
--- a/chromium/third_party/afl/src/experimental/bash_shellshock/shellshock-fuzz.diff
+++ /dev/null
@@ -1,59 +0,0 @@
-This patch shows a very simple way to find post-Shellshock bugs in bash, as
-discussed here:
-
- http://lcamtuf.blogspot.com/2014/10/bash-bug-how-we-finally-cracked.html
-
-In essence, it shows a way to fuzz environmental variables. Instructions:
-
-1) Download bash 4.3, apply this patch, compile with:
-
- CC=/path/to/afl-gcc ./configure
- make clean all
-
- Note that the harness puts the fuzzed output in $TEST_VARIABLE. With
- Florian's Shellshock patch (bash43-028), this is no longer passed down
- to the parser.
-
-2) Create and cd to an empty directory, put the compiled bash binary in
- there, and run these commands:
-
- mkdir in_dir
- echo -n '() { a() { a; }; : >b; }' >in_dir/script.txt
-
-3) Run the fuzzer with:
-
- /path/to/afl-fuzz -d -i in_dir -o out_dir ./bash -c :
-
- The -d parameter is advisable only if the tested shell is fairly slow
- or if you are in a hurry; will cover more ground faster, but
- less systematically.
-
-4) Watch for crashes in out_dir/crashes/. Also watch for any new files
- created in cwd if you're interested in non-crash RCEs (files will be
- created whenever the shell executes "foo>bar" or something like
- that). You can correlate their creation date with new entries in
- out_dir/queue/.
-
- You can also modify the bash binary to directly check for more subtle
- fault conditions, or use the synthesized entries in out_dir/queue/
- as a seed for other, possibly slower or more involved testing regimes.
-
- Expect several hours to get decent coverage.
-
---- bash-4.3/shell.c.orig 2014-01-14 14:04:32.000000000 +0100
-+++ bash-4.3/shell.c 2015-04-30 05:56:46.000000000 +0200
-@@ -371,6 +371,14 @@
- env = environ;
- #endif /* __OPENNT */
-
-+ {
-+
-+ static char val[1024 * 16];
-+ read(0, val, sizeof(val) - 1);
-+ setenv("TEST_VARIABLE", val, 1);
-+
-+ }
-+
- USE_VAR(argc);
- USE_VAR(argv);
- USE_VAR(env);
diff --git a/chromium/third_party/afl/src/experimental/canvas_harness/canvas_harness.html b/chromium/third_party/afl/src/experimental/canvas_harness/canvas_harness.html
deleted file mode 100644
index 192936675ce..00000000000
--- a/chromium/third_party/afl/src/experimental/canvas_harness/canvas_harness.html
+++ /dev/null
@@ -1,170 +0,0 @@
-<html>
-<!--
-
- american fuzzy lop - <canvas> harness
- -------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- A simple harness for going through afl-generated test cases, rendering them in
- the browser environment, and discovering the use of uninitialized memory and
- similar bugs. This code led to the discovery of a fair number of library and
- browser security bugs!
-
- The url_list[] array is a placeholder; for this to work properly, it needs to
- be initialized with web-reachable paths to individual test cases. This can
- be done manually or with a simple script.
-
--->
-
-<body onload="set_images()">
-
-<div id="status"></div>
-
-<div id="image_div"></div>
-
-<canvas height=64 width=64 id=cvs></canvas>
-
-<h2>Results</h2>
-
-<ul id="output"></ul>
-
-<script>
-
-var c = document.getElementById('cvs');
-var ctx = c.getContext('2d');
-
-var url_list = [
- "images/id:000000,[...].jpg",
- "images/id:000001,[...].jpg",
- /* ... */
- null
-];
-
-var USE_IMAGES = 50;
-var cur_image = 0;
-
-if (location.hash) cur_image = parseInt(location.hash.substr(1));
-
-var loaded = 0;
-var image_obj = [];
-
-var msie_cleanup;
-
-function check_results() {
-
- var uniques = [];
-
- clearTimeout(msie_cleanup);
-
- ctx.clearRect(0, 0, 64, 64);
-
- uniques.push(image_obj[0].imgdata);
-
- for (var i = 1; i < USE_IMAGES; i++) {
-
- if (!image_obj[i].imgdata) continue;
-
- if (image_obj[0].imgdata != image_obj[i].imgdata) {
-
- for (var j = 1; j < uniques.length; j++)
- if (uniques[j] == image_obj[i].imgdata) break;
-
- if (j == uniques.length) uniques.push(image_obj[i].imgdata);
-
-
- }
-
- }
-
- if (uniques.length > 1) {
-
- var str = '<li> Image ' + url_list[cur_image] + ' has ' + uniques.length + ' variants: ';
-
- for (var i = 0; i < uniques.length; i++)
- str += '<img src="' + uniques[i] + '">';
-
- document.getElementById('output').innerHTML += str;
-
- }
-
- cur_image++;
- set_images();
-}
-
-
-function count_image() {
-
- if (!this.complete || this.counted) return;
-
- this.counted = true;
-
- loaded++;
-
- ctx.clearRect(0, 0, 64, 64);
-
- try {
- ctx.drawImage(this, 0, 0, 64, 64);
- } catch (e) { }
-
- this.imgdata = c.toDataURL();
-
- if (loaded == USE_IMAGES) check_results();
-}
-
-
-function set_images() {
-
- loaded = 0;
-
- document.getElementById('status').innerHTML = 'Now processing ' + cur_image + '...';
- location.hash = '#' + cur_image;
-
- if (url_list[cur_image] == null) {
- alert('Done!');
- return;
- }
-
- restart_images();
-
- msie_cleanup = setTimeout(check_results, 5000);
-
- for (var i = 0; i < USE_IMAGES; i++)
- image_obj[i].src = url_list[cur_image] + '?' + Math.random();
-
-}
-
-
-function restart_images() {
-
- for (var i = 0; i < USE_IMAGES; i++)
- if (image_obj[i]) image_obj[i].counted = true;
-
- document.getElementById('image_div').innerHTML = '';
- image_obj = [];
-
- for (var i = 0; i < USE_IMAGES; i++) {
-
- image_obj[i] = new Image();
- image_obj[i].height = 64;
- image_obj[i].width = 64;
- image_obj[i].onerror = count_image;
- image_obj[i].onload = count_image;
-
- document.getElementById('image_div').appendChild(image_obj[i]);
-
- }
-
-}
-
-</script>
-
-<iframe src='http://www.cnn.com/'></iframe>
diff --git a/chromium/third_party/afl/src/experimental/clang_asm_normalize/as b/chromium/third_party/afl/src/experimental/clang_asm_normalize/as
deleted file mode 100755
index 4ee07e691a9..00000000000
--- a/chromium/third_party/afl/src/experimental/clang_asm_normalize/as
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-#
-# american fuzzy lop - clang assembly normalizer
-# ----------------------------------------------
-#
-# Written and maintained by Michal Zalewski <lcamtuf@google.com>
-# The idea for this wrapper comes from Ryan Govostes.
-#
-# Copyright 2013, 2014 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# This 'as' wrapper should allow you to instrument unruly, hand-written
-# assembly with afl-as.
-#
-# Usage:
-#
-# export AFL_REAL_PATH=/path/to/directory/with/afl-as/
-# AFL_PATH=/path/to/this/directory/ make clean all
-
-if [ "$#" -lt "2" ]; then
- echo "[-] Error: this utility can't be called directly." 1>&2
- exit 1
-fi
-
-if [ "$AFL_REAL_PATH" = "" ]; then
- echo "[-] Error: AFL_REAL_PATH not set!" 1>&2
- exit 1
-fi
-
-if [ ! -x "$AFL_REAL_PATH/afl-as" ]; then
- echo "[-] Error: AFL_REAL_PATH does not contain the 'afl-as' binary." 1>&2
- exit 1
-fi
-
-unset __AFL_AS_CMDLINE __AFL_FNAME
-
-while [ ! "$#" = "0" ]; do
-
- if [ "$#" = "1" ]; then
- __AFL_FNAME="$1"
- else
- __AFL_AS_CMDLINE="${__AFL_AS_CMDLINE} $1"
- fi
-
- shift
-
-done
-
-test "$TMPDIR" = "" && TMPDIR=/tmp
-
-TMPFILE=`mktemp $TMPDIR/.afl-XXXXXXXXXX.s`
-
-test "$TMPFILE" = "" && exit 1
-
-clang -cc1as -filetype asm -output-asm-variant 0 "${__AFL_FNAME}" >"$TMPFILE"
-
-ERR="$?"
-
-if [ ! "$ERR" = "0" ]; then
- rm -f "$TMPFILE"
- exit $ERR
-fi
-
-"$AFL_REAL_PATH/afl-as" ${__AFL_AS_CMDLINE} "$TMPFILE"
-
-ERR="$?"
-
-rm -f "$TMPFILE"
-
-exit "$ERR"
diff --git a/chromium/third_party/afl/src/experimental/crash_triage/triage_crashes.sh b/chromium/third_party/afl/src/experimental/crash_triage/triage_crashes.sh
deleted file mode 100755
index 9dddefdd095..00000000000
--- a/chromium/third_party/afl/src/experimental/crash_triage/triage_crashes.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-#
-# american fuzzy lop - crash triage utility
-# -----------------------------------------
-#
-# Written and maintained by Michal Zalewski <lcamtuf@google.com>
-#
-# Copyright 2013, 2014 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Note that this assumes that the targeted application reads from stdin
-# and requires no other cmdline parameters. Modify as needed if this is
-# not the case.
-#
-# Note that on OpenBSD, you may need to install a newer version of gdb
-# (e.g., from ports). You can set GDB=/some/path to point to it if
-# necessary.
-#
-
-echo "crash triage utility for afl-fuzz by <lcamtuf@google.com>"
-echo
-
-ulimit -v 100000 2>/dev/null
-ulimit -d 100000 2>/dev/null
-
-if [ ! "$#" = "2" ]; then
- echo "Usage: $0 /path/to/afl_output_dir /path/to/tested_binary" 1>&2
- echo 1>&2
- echo "Note: the tested binary must accept input on stdin and require no additional" 1>&2
- echo "parameters. For more complex use cases, you need to edit this script." 1>&2
- echo 1>&2
- exit 1
-fi
-
-DIR="$1"
-BIN="$2"
-
-echo "$DIR" | grep -qE '^(/var)?/tmp/'
-T1="$?"
-
-echo "$BIN" | grep -qE '^(/var)?/tmp/'
-T2="$?"
-
-if [ "$T1" = "0" -o "$T2" = "0" ]; then
- echo "[-] Error: do not use shared /tmp or /var/tmp directories with this script." 1>&2
- exit 1
-fi
-
-if [ "$GDB" = "" ]; then
- GDB=gdb
-fi
-
-if [ ! -f "$BIN" -o ! -x "$BIN" ]; then
- echo "[-] Error: binary '$2' not found or is not executable." 1>&2
- exit 1
-fi
-
-if [ ! -d "$DIR/queue" ]; then
- echo "[-] Error: directory '$1' not found or not created by afl-fuzz." 1>&2
- exit 1
-fi
-
-CCOUNT=$((`ls -- "$DIR/crashes" 2>/dev/null | wc -l`))
-
-if [ "$CCOUNT" = "0" ]; then
- echo "No crashes recorded in the target directory - nothing to be done."
- exit 0
-fi
-
-echo
-
-for crash in $DIR/crashes/id:*; do
-
- id=`basename -- "$crash" | cut -d, -f1 | cut -d: -f2`
- sig=`basename -- "$crash" | cut -d, -f2 | cut -d: -f2`
-
- echo "+++ ID $id, SIGNAL $sig +++"
- echo
-
- $GDB --batch -q --ex "r <$crash" --ex 'back' --ex 'disass $pc, $pc+16' --ex 'info reg' --ex 'quit' "$BIN" 0</dev/null
- echo
-
-done
-
diff --git a/chromium/third_party/afl/src/experimental/distributed_fuzzing/sync_script.sh b/chromium/third_party/afl/src/experimental/distributed_fuzzing/sync_script.sh
deleted file mode 100755
index 29bcba6470f..00000000000
--- a/chromium/third_party/afl/src/experimental/distributed_fuzzing/sync_script.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-#
-# american fuzzy lop - fuzzer synchronization tool
-# ------------------------------------------------
-#
-# Written and maintained by Michal Zalewski <lcamtuf@google.com>
-#
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# To make this script work:
-#
-# - Edit FUZZ_HOSTS, FUZZ_DOMAIN, FUZZ_USER, and SYNC_DIR to reflect your
-# environment.
-#
-# - Make sure that the system you are running this on can log into FUZZ_HOSTS
-# without a password (authorized_keys or otherwise).
-#
-# - Make sure that every fuzzer is running with -o pointing to SYNC_DIR and -S
-# that consists of its local host name, followed by an underscore, and then
-# by some host-local fuzzer ID.
-#
-
-# Hosts to synchronize the data across.
-FUZZ_HOSTS='host1 host2 host3 host4'
-
-# Domain for all hosts
-FUZZ_DOMAIN='example.com'
-
-# Remote user for SSH
-FUZZ_USER=bob
-
-# Directory to synchronize
-SYNC_DIR='/home/bob/sync_dir'
-
-# Interval (seconds) between sync attempts
-SYNC_INTERVAL=$((30 * 60))
-
-if [ "$PWD" = "/tmp" -o "$PWD" = "/var/tmp" ]; then
- echo "[-] Error: do not use shared /tmp or /var/tmp directories with this script." 1>&2
- exit 1
-fi
-
-rm -rf .sync_tmp 2>/dev/null
-mkdir .sync_tmp || exit 1
-
-while :; do
-
- # Pull data in...
-
- for host in $FUZZ_HOSTS; do
-
- echo "[*] Retrieving data from ${host}.${FUZZ_DOMAIN}..."
-
- ssh -o 'passwordauthentication no' ${FUZZ_USER}@${host}.$FUZZ_DOMAIN \
- "cd '$SYNC_DIR' && tar -czf - ${host}_*/[qf]*" >".sync_tmp/${host}.tgz"
-
- done
-
- # Distribute data. For large fleets, see tips in the docs/ directory.
-
- for dst_host in $FUZZ_HOSTS; do
-
- echo "[*] Distributing data to ${dst_host}.${FUZZ_DOMAIN}..."
-
- for src_host in $FUZZ_HOSTS; do
-
- test "$src_host" = "$dst_host" && continue
-
- echo " Sending fuzzer data from ${src_host}.${FUZZ_DOMAIN}..."
-
- ssh -o 'passwordauthentication no' ${FUZZ_USER}@$dst_host \
- "cd '$SYNC_DIR' && tar -xkzf -" <".sync_tmp/${src_host}.tgz"
-
- done
-
- done
-
- echo "[+] Done. Sleeping for $SYNC_INTERVAL seconds (Ctrl-C to quit)."
-
- sleep $SYNC_INTERVAL
-
-done
-
diff --git a/chromium/third_party/afl/src/experimental/libpng_no_checksum/libpng-nocrc.patch b/chromium/third_party/afl/src/experimental/libpng_no_checksum/libpng-nocrc.patch
deleted file mode 100644
index 0a3793a0202..00000000000
--- a/chromium/third_party/afl/src/experimental/libpng_no_checksum/libpng-nocrc.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- pngrutil.c.orig 2014-06-12 03:35:16.000000000 +0200
-+++ pngrutil.c 2014-07-01 05:08:31.000000000 +0200
-@@ -268,7 +268,11 @@
- if (need_crc != 0)
- {
- crc = png_get_uint_32(crc_bytes);
-- return ((int)(crc != png_ptr->crc));
-+
-+ if (crc != png_ptr->crc)
-+ fprintf(stderr, "NOTE: CRC in the file is 0x%08x, change to 0x%08x\n", crc, png_ptr->crc);
-+
-+ return ((int)(1 != 1));
- }
-
- else
diff --git a/chromium/third_party/afl/src/experimental/persistent_demo/persistent_demo.c b/chromium/third_party/afl/src/experimental/persistent_demo/persistent_demo.c
deleted file mode 100644
index 0b1e29897b2..00000000000
--- a/chromium/third_party/afl/src/experimental/persistent_demo/persistent_demo.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- american fuzzy lop - persistent mode example
- --------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2015 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This file demonstrates the high-performance "persistent mode" that may be
- suitable for fuzzing certain fast and well-behaved libraries, provided that
- they are stateless or that their internal state can be easily reset
- across runs.
-
- To make this work, the library and this shim need to be compiled in LLVM
- mode using afl-clang-fast (other compiler wrappers will *not* work).
-
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-
-
-/* Main entry point. */
-
-int main(int argc, char** argv) {
-
- char buf[100]; /* Example-only buffer, you'd replace it with other global or
- local variables appropriate for your use case. */
-
- /* The number passed to __AFL_LOOP() controls the maximum number of
- iterations before the loop exits and the program is allowed to
- terminate normally. This limits the impact of accidental memory leaks
- and similar hiccups. */
-
- while (__AFL_LOOP(1000)) {
-
- /*** PLACEHOLDER CODE ***/
-
- /* STEP 1: Fully re-initialize all critical variables. In our example, this
- involves zeroing buf[], our input buffer. */
-
- memset(buf, 0, 100);
-
- /* STEP 2: Read input data. When reading from stdin, no special preparation
- is required. When reading from a named file, you need to close
- the old descriptor and reopen the file first!
-
- Beware of reading from buffered FILE* objects such as stdin. Use
- raw file descriptors or call fopen() / fdopen() in every pass. */
-
- read(0, buf, 100);
-
- /* STEP 3: This is where we'd call the tested library on the read data.
- We just have some trivial inline code that faults on 'foo!'. */
-
- if (buf[0] == 'f') {
- printf("one\n");
- if (buf[1] == 'o') {
- printf("two\n");
- if (buf[2] == 'o') {
- printf("three\n");
- if (buf[3] == '!') {
- printf("four\n");
- abort();
- }
- }
- }
- }
-
- /*** END PLACEHOLDER CODE ***/
-
- }
-
- /* Once the loop is exited, terminate normally - AFL will restart the process
- when this happens, with a clean slate when it comes to allocated memory,
- leftover file descriptors, etc. */
-
- return 0;
-
-}
diff --git a/chromium/third_party/afl/src/experimental/post_library/post_library.so.c b/chromium/third_party/afl/src/experimental/post_library/post_library.so.c
deleted file mode 100644
index 72620ff0827..00000000000
--- a/chromium/third_party/afl/src/experimental/post_library/post_library.so.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- american fuzzy lop - postprocessor library example
- --------------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2015 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Postprocessor libraries can be passed to afl-fuzz to perform final cleanup
- of any mutated test cases - for example, to fix up checksums in PNG files.
-
- Please heed the following warnings:
-
- 1) In almost all cases, it is more productive to comment out checksum logic
- in the targeted binary (as shown in ../libpng_no_checksum/). One possible
- exception is the process of fuzzing binary-only software in QEMU mode.
-
- 2) The use of postprocessors for anything other than checksums is questionable
- and may cause more harm than good. AFL is normally pretty good about
- dealing with length fields, magic values, etc.
-
- 3) Postprocessors that do anything non-trivial must be extremely robust to
- gracefully handle malformed data and other error conditions - otherwise,
- they will crash and take afl-fuzz down with them. Be wary of reading past
- *len and of integer overflows when calculating file offsets.
-
- In other words, THIS IS PROBABLY NOT WHAT YOU WANT - unless you really,
- honestly know what you're doing =)
-
- With that out of the way: the postprocessor library is passed to afl-fuzz
- via AFL_POST_LIBRARY. The library must be compiled with:
-
- gcc -shared -Wall -O3 post_library.so.c -o post_library.so
-
- AFL will call the afl_postprocess() function for every mutated output buffer.
- From there, you have three choices:
-
- 1) If you don't want to modify the test case, simply return the original
- buffer pointer ('in_buf').
-
- 2) If you want to skip this test case altogether and have AFL generate a
- new one, return NULL. Use this sparingly - it's faster than running
- the target program with patently useless inputs, but still wastes CPU
- time.
-
- 3) If you want to modify the test case, allocate an appropriately-sized
- buffer, move the data into that buffer, make the necessary changes, and
- then return the new pointer. You can update *len if necessary, too.
-
- Note that the buffer will *not* be freed for you. To avoid memory leaks,
- you need to free it or reuse it on subsequent calls (as shown below).
-
- *** DO NOT MODIFY THE ORIGINAL 'in_buf' BUFFER. ***
-
- Aight. The example below shows a simple postprocessor that tries to make
- sure that all input files start with "GIF89a".
-
- PS. If you don't like C, you can try out the unix-based wrapper from
- Ben Nagy instead: https://github.com/bnagy/aflfix
-
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Header that must be present at the beginning of every test case: */
-
-#define HEADER "GIF89a"
-
-/* The actual postprocessor routine called by afl-fuzz: */
-
-const unsigned char* afl_postprocess(const unsigned char* in_buf,
- unsigned int* len) {
-
- static unsigned char* saved_buf;
- unsigned char* new_buf;
-
- /* Skip execution altogether for buffers shorter than 6 bytes (just to
- show how it's done). We can trust *len to be sane. */
-
- if (*len < strlen(HEADER)) return NULL;
-
- /* Do nothing for buffers that already start with the expected header. */
-
- if (!memcmp(in_buf, HEADER, strlen(HEADER))) return in_buf;
-
- /* Allocate memory for new buffer, reusing previous allocation if
- possible. */
-
- new_buf = realloc(saved_buf, *len);
-
- /* If we're out of memory, the most graceful thing to do is to return the
- original buffer and give up on modifying it. Let AFL handle OOM on its
- own later on. */
-
- if (!new_buf) return in_buf;
- saved_buf = new_buf;
-
- /* Copy the original data to the new location. */
-
- memcpy(new_buf, in_buf, *len);
-
- /* Insert the new header. */
-
- memcpy(new_buf, HEADER, strlen(HEADER));
-
- /* Return modified buffer. No need to update *len in this particular case,
- as we're not changing it. */
-
- return new_buf;
-
-}
diff --git a/chromium/third_party/afl/src/experimental/post_library/post_library_png.so.c b/chromium/third_party/afl/src/experimental/post_library/post_library_png.so.c
deleted file mode 100644
index 080a6938ac8..00000000000
--- a/chromium/third_party/afl/src/experimental/post_library/post_library_png.so.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- american fuzzy lop - postprocessor for PNG
- ------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2015 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- See post_library.so.c for a general discussion of how to implement
- postprocessors. This specific postprocessor attempts to fix up PNG
- checksums, providing a slightly more complicated example than found
- in post_library.so.c.
-
- Compile with:
-
- gcc -shared -Wall -O3 post_library_png.so.c -o post_library_png.so -lz
-
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <zlib.h>
-
-#include <arpa/inet.h>
-
-/* A macro to round an integer up to 4 kB. */
-
-#define UP4K(_i) ((((_i) >> 12) + 1) << 12)
-
-const unsigned char* afl_postprocess(const unsigned char* in_buf,
- unsigned int* len) {
-
- static unsigned char* saved_buf;
- static unsigned int saved_len;
-
- unsigned char* new_buf = (unsigned char*)in_buf;
- unsigned int pos = 8;
-
- /* Don't do anything if there's not enough room for the PNG header
- (8 bytes). */
-
- if (*len < 8) return in_buf;
-
- /* Minimum size of a zero-length PNG chunk is 12 bytes; if we
- don't have that, we can bail out. */
-
- while (pos + 12 <= *len) {
-
- unsigned int chunk_len, real_cksum, file_cksum;
-
- /* Chunk length is the first big-endian dword in the chunk. */
-
- chunk_len = ntohl(*(uint32_t*)(in_buf + pos));
-
- /* Bail out if chunk size is too big or goes past EOF. */
-
- if (chunk_len > 1024 * 1024 || pos + 12 + chunk_len > *len) break;
-
- /* Chunk checksum is calculated for chunk ID (dword) and the actual
- payload. */
-
- real_cksum = htonl(crc32(0, in_buf + pos + 4, chunk_len + 4));
-
- /* The in-file checksum is the last dword past the chunk data. */
-
- file_cksum = *(uint32_t*)(in_buf + pos + 8 + chunk_len);
-
- /* If the checksums do not match, we need to fix the file. */
-
- if (real_cksum != file_cksum) {
-
- /* First modification? Make a copy of the input buffer. Round size
- up to 4 kB to minimize the number of reallocs needed. */
-
- if (new_buf == in_buf) {
-
- if (*len <= saved_len) {
-
- new_buf = saved_buf;
-
- } else {
-
- new_buf = realloc(saved_buf, UP4K(*len));
- if (!new_buf) return in_buf;
- saved_buf = new_buf;
- saved_len = UP4K(*len);
- memcpy(new_buf, in_buf, *len);
-
- }
-
- }
-
- *(uint32_t*)(new_buf + pos + 8 + chunk_len) = real_cksum;
-
- }
-
- /* Skip the entire chunk and move to the next one. */
-
- pos += 12 + chunk_len;
-
- }
-
- return new_buf;
-
-}
diff --git a/chromium/third_party/afl/src/hash.h b/chromium/third_party/afl/src/hash.h
deleted file mode 100644
index f39a82572c9..00000000000
--- a/chromium/third_party/afl/src/hash.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- american fuzzy lop - hashing function
- -------------------------------------
-
- The hash32() function is a variant of MurmurHash3, a good
- non-cryptosafe hashing function developed by Austin Appleby.
-
- For simplicity, this variant does *NOT* accept buffer lengths
- that are not divisible by 8 bytes. The 32-bit version is otherwise
- similar to the original; the 64-bit one is a custom hack with
- mostly-unproven properties.
-
- Austin's original code is public domain.
-
- Other code written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- */
-
-#ifndef _HAVE_HASH_H
-#define _HAVE_HASH_H
-
-#include "types.h"
-
-#ifdef __x86_64__
-
-#define ROL64(_x, _r) ((((u64)(_x)) << (_r)) | (((u64)(_x)) >> (64 - (_r))))
-
-static inline u32 hash32(const void* key, u32 len, u32 seed) {
-
- const u64* data = (u64*)key;
- u64 h1 = seed ^ len;
-
- len >>= 3;
-
- while (len--) {
-
- u64 k1 = *data++;
-
- k1 *= 0x87c37b91114253d5ULL;
- k1 = ROL64(k1, 31);
- k1 *= 0x4cf5ad432745937fULL;
-
- h1 ^= k1;
- h1 = ROL64(h1, 27);
- h1 = h1 * 5 + 0x52dce729;
-
- }
-
- h1 ^= h1 >> 33;
- h1 *= 0xff51afd7ed558ccdULL;
- h1 ^= h1 >> 33;
- h1 *= 0xc4ceb9fe1a85ec53ULL;
- h1 ^= h1 >> 33;
-
- return h1;
-
-}
-
-#else
-
-#define ROL32(_x, _r) ((((u32)(_x)) << (_r)) | (((u32)(_x)) >> (32 - (_r))))
-
-static inline u32 hash32(const void* key, u32 len, u32 seed) {
-
- const u32* data = (u32*)key;
- u32 h1 = seed ^ len;
-
- len >>= 2;
-
- while (len--) {
-
- u32 k1 = *data++;
-
- k1 *= 0xcc9e2d51;
- k1 = ROL32(k1, 15);
- k1 *= 0x1b873593;
-
- h1 ^= k1;
- h1 = ROL32(h1, 13);
- h1 = h1 * 5 + 0xe6546b64;
-
- }
-
- h1 ^= h1 >> 16;
- h1 *= 0x85ebca6b;
- h1 ^= h1 >> 13;
- h1 *= 0xc2b2ae35;
- h1 ^= h1 >> 16;
-
- return h1;
-
-}
-
-#endif /* ^__x86_64__ */
-
-#endif /* !_HAVE_HASH_H */
diff --git a/chromium/third_party/afl/src/libdislocator/Makefile b/chromium/third_party/afl/src/libdislocator/Makefile
deleted file mode 100644
index a4116780a63..00000000000
--- a/chromium/third_party/afl/src/libdislocator/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# american fuzzy lop - libdislocator
-# ----------------------------------
-#
-# Written by Michal Zalewski <lcamtuf@google.com>
-#
-# Copyright 2016 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-
-PREFIX ?= /usr/local
-HELPER_PATH = $(PREFIX)/lib/afl
-
-VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2)
-
-CFLAGS ?= -O3 -funroll-loops
-CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign
-
-all: libdislocator.so
-
-libdislocator.so: libdislocator.so.c ../config.h
- $(CC) $(CFLAGS) -shared -fPIC $< -o $@ $(LDFLAGS)
-
-.NOTPARALLEL: clean
-
-clean:
- rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
- rm -f libdislocator.so
-
-install: all
- install -m 755 libdislocator.so $${DESTDIR}$(HELPER_PATH)
- install -m 644 README.dislocator $${DESTDIR}$(HELPER_PATH)
-
diff --git a/chromium/third_party/afl/src/libdislocator/README.dislocator b/chromium/third_party/afl/src/libdislocator/README.dislocator
deleted file mode 100644
index 837e74664e9..00000000000
--- a/chromium/third_party/afl/src/libdislocator/README.dislocator
+++ /dev/null
@@ -1,60 +0,0 @@
-===================================
-libdislocator, an abusive allocator
-===================================
-
- (See ../docs/README for the general instruction manual.)
-
-This is a companion library that can be used as a drop-in replacement for the
-libc allocator in the fuzzed binaries. It improves the odds of bumping into
-heap-related security bugs in several ways:
-
- - It allocates all buffers so that they are immediately adjacent to a
- subsequent PROT_NONE page, causing most off-by-one reads and writes to
- immediately segfault,
-
- - It adds a canary immediately below the allocated buffer, to catch writes
- to negative offsets (won't catch reads, though),
-
- - It sets the memory returned by malloc() to garbage values, improving the
- odds of crashing when the target accesses uninitialized data,
-
- - It sets freed memory to PROT_NONE and does not actually reuse it, causing
- most use-after-free bugs to segfault right away,
-
- - It forces all realloc() calls to return a new address - and sets
- PROT_NONE on the original block. This catches use-after-realloc bugs,
-
- - It checks for calloc() overflows and can cause soft or hard failures
- of alloc requests past a configurable memory limit (AFL_LD_LIMIT_MB,
- AFL_LD_HARD_FAIL).
-
-Basically, it is inspired by some of the non-default options available for the
-OpenBSD allocator - see malloc.conf(5) on that platform for reference. It is
-also somewhat similar to several other debugging libraries, such as gmalloc
-and DUMA - but is simple, plug-and-play, and designed specifically for fuzzing
-jobs.
-
-Note that it does nothing for stack-based memory handling errors. The
--fstack-protector-all setting for GCC / clang, enabled when using AFL_HARDEN,
-can catch some subset of that.
-
-The allocator is slow and memory-intensive (even the tiniest allocation uses up
-4 kB of physical memory and 8 kB of virtual mem), making it completely unsuitable
-for "production" uses; but it can be faster and more hassle-free than ASAN / MSAN
-when fuzzing small, self-contained binaries.
-
-To use this library, run AFL like so:
-
-AFL_PRELOAD=/path/to/libdislocator.so ./afl-fuzz [...other params...]
-
-You *have* to specify path, even if it's just ./libdislocator.so or
-$PWD/libdislocator.so.
-
-Similarly to afl-tmin, the library is not "proprietary" and can be used with
-other fuzzers or testing tools without the need for any code tweaks. It does not
-require AFL-instrumented binaries to work.
-
-Note that the AFL_PRELOAD approach (which AFL internally maps to LD_PRELOAD or
-DYLD_INSERT_LIBRARIES, depending on the OS) works only if the target binary is
-dynamically linked. Otherwise, attempting to use the library will have no
-effect.
diff --git a/chromium/third_party/afl/src/libdislocator/libdislocator.so.c b/chromium/third_party/afl/src/libdislocator/libdislocator.so.c
deleted file mode 100644
index 0dfc98e6058..00000000000
--- a/chromium/third_party/afl/src/libdislocator/libdislocator.so.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
-
- american fuzzy lop - dislocator, an abusive allocator
- -----------------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This is a companion library that can be used as a drop-in replacement
- for the libc allocator in the fuzzed binaries. See README.dislocator for
- more info.
-
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <sys/mman.h>
-
-#include "../config.h"
-#include "../types.h"
-
-#ifndef PAGE_SIZE
-# define PAGE_SIZE 4096
-#endif /* !PAGE_SIZE */
-
-#ifndef MAP_ANONYMOUS
-# define MAP_ANONYMOUS MAP_ANON
-#endif /* !MAP_ANONYMOUS */
-
-/* Error / message handling: */
-
-#define DEBUGF(_x...) do { \
- if (alloc_verbose) { \
- if (++call_depth == 1) { \
- fprintf(stderr, "[AFL] " _x); \
- fprintf(stderr, "\n"); \
- } \
- call_depth--; \
- } \
- } while (0)
-
-#define FATAL(_x...) do { \
- if (++call_depth == 1) { \
- fprintf(stderr, "*** [AFL] " _x); \
- fprintf(stderr, " ***\n"); \
- abort(); \
- } \
- call_depth--; \
- } while (0)
-
-/* Macro to count the number of pages needed to store a buffer: */
-
-#define PG_COUNT(_l) (((_l) + (PAGE_SIZE - 1)) / PAGE_SIZE)
-
-/* Canary & clobber bytes: */
-
-#define ALLOC_CANARY 0xAACCAACC
-#define ALLOC_CLOBBER 0xCC
-
-#define PTR_C(_p) (((u32*)(_p))[-1])
-#define PTR_L(_p) (((u32*)(_p))[-2])
-
-/* Configurable stuff (use AFL_LD_* to set): */
-
-static u32 max_mem = MAX_ALLOC; /* Max heap usage to permit */
-static u8 alloc_verbose, /* Additional debug messages */
- hard_fail; /* abort() when max_mem exceeded? */
-
-static __thread size_t total_mem; /* Currently allocated mem */
-
-static __thread u32 call_depth; /* To avoid recursion via fprintf() */
-
-
-/* This is the main alloc function. It allocates one page more than necessary,
- sets that tailing page to PROT_NONE, and then increments the return address
- so that it is right-aligned to that boundary. Since it always uses mmap(),
- the returned memory will be zeroed. */
-
-static void* __dislocator_alloc(size_t len) {
-
- void* ret;
-
-
- if (total_mem + len > max_mem || total_mem + len < total_mem) {
-
- if (hard_fail)
- FATAL("total allocs exceed %u MB", max_mem / 1024 / 1024);
-
- DEBUGF("total allocs exceed %u MB, returning NULL",
- max_mem / 1024 / 1024);
-
- return NULL;
-
- }
-
- /* We will also store buffer length and a canary below the actual buffer, so
- let's add 8 bytes for that. */
-
- ret = mmap(NULL, (1 + PG_COUNT(len + 8)) * PAGE_SIZE, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-
- if (ret == (void*)-1) {
-
- if (hard_fail) FATAL("mmap() failed on alloc (OOM?)");
-
- DEBUGF("mmap() failed on alloc (OOM?)");
-
- return NULL;
-
- }
-
- /* Set PROT_NONE on the last page. */
-
- if (mprotect(ret + PG_COUNT(len + 8) * PAGE_SIZE, PAGE_SIZE, PROT_NONE))
- FATAL("mprotect() failed when allocating memory");
-
- /* Offset the return pointer so that it's right-aligned to the page
- boundary. */
-
- ret += PAGE_SIZE * PG_COUNT(len + 8) - len - 8;
-
- /* Store allocation metadata. */
-
- ret += 8;
-
- PTR_L(ret) = len;
- PTR_C(ret) = ALLOC_CANARY;
-
- total_mem += len;
-
- return ret;
-
-}
-
-
-/* The "user-facing" wrapper for calloc(). This just checks for overflows and
- displays debug messages if requested. */
-
-void* calloc(size_t elem_len, size_t elem_cnt) {
-
- void* ret;
-
- size_t len = elem_len * elem_cnt;
-
- /* Perform some sanity checks to detect obvious issues... */
-
- if (elem_cnt && len / elem_cnt != elem_len)
- FATAL("calloc(%zu, %zu) would overflow", elem_len, elem_cnt);
-
- ret = __dislocator_alloc(len);
-
- DEBUGF("calloc(%zu, %zu) = %p [%zu total]", elem_len, elem_cnt, ret,
- total_mem);
-
- return ret;
-
-}
-
-
-/* The wrapper for malloc(). Roughly the same, also clobbers the returned
- memory (unlike calloc(), malloc() is not guaranteed to return zeroed
- memory). */
-
-void* malloc(size_t len) {
-
- void* ret;
-
- ret = __dislocator_alloc(len);
-
- DEBUGF("malloc(%zu) = %p [%zu total]", len, ret, total_mem);
-
- if (ret && len) memset(ret, ALLOC_CLOBBER, len);
-
- return ret;
-
-}
-
-
-/* The wrapper for free(). This simply marks the entire region as PROT_NONE.
- If the region is already freed, the code will segfault during the attempt to
- read the canary. Not very graceful, but works, right? */
-
-void free(void* ptr) {
-
- u32 len;
-
- DEBUGF("free(%p)", ptr);
-
- if (!ptr) return;
-
- if (PTR_C(ptr) != ALLOC_CANARY) FATAL("bad allocator canary on free()");
-
- len = PTR_L(ptr);
-
- total_mem -= len;
-
- /* Protect everything. Note that the extra page at the end is already
- set as PROT_NONE, so we don't need to touch that. */
-
- ptr -= PAGE_SIZE * PG_COUNT(len + 8) - len - 8;
-
- if (mprotect(ptr - 8, PG_COUNT(len + 8) * PAGE_SIZE, PROT_NONE))
- FATAL("mprotect() failed when freeing memory");
-
- /* Keep the mapping; this is wasteful, but prevents ptr reuse. */
-
-}
-
-
-/* Realloc is pretty straightforward, too. We forcibly reallocate the buffer,
- move data, and then free (aka mprotect()) the original one. */
-
-void* realloc(void* ptr, size_t len) {
-
- void* ret;
-
- ret = malloc(len);
-
- if (ret && ptr) {
-
- if (PTR_C(ptr) != ALLOC_CANARY) FATAL("bad allocator canary on realloc()");
-
- memcpy(ret, ptr, MIN(len, PTR_L(ptr)));
- free(ptr);
-
- }
-
- DEBUGF("realloc(%p, %zu) = %p [%zu total]", ptr, len, ret, total_mem);
-
- return ret;
-
-}
-
-
-__attribute__((constructor)) void __dislocator_init(void) {
-
- u8* tmp = getenv("AFL_LD_LIMIT_MB");
-
- if (tmp) {
-
- max_mem = atoi(tmp) * 1024 * 1024;
- if (!max_mem) FATAL("Bad value for AFL_LD_LIMIT_MB");
-
- }
-
- alloc_verbose = !!getenv("AFL_LD_VERBOSE");
- hard_fail = !!getenv("AFL_LD_HARD_FAIL");
-
-}
diff --git a/chromium/third_party/afl/src/libtokencap/Makefile b/chromium/third_party/afl/src/libtokencap/Makefile
deleted file mode 100644
index a464f76d13e..00000000000
--- a/chromium/third_party/afl/src/libtokencap/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# american fuzzy lop - libtokencap
-# --------------------------------
-#
-# Written by Michal Zalewski <lcamtuf@google.com>
-#
-# Copyright 2016 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-
-PREFIX ?= /usr/local
-HELPER_PATH = $(PREFIX)/lib/afl
-
-VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2)
-
-CFLAGS ?= -O3 -funroll-loops
-CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign
-
-all: libtokencap.so
-
-libtokencap.so: libtokencap.so.c ../config.h
- $(CC) $(CFLAGS) -shared -fPIC $< -o $@ $(LDFLAGS)
-
-.NOTPARALLEL: clean
-
-clean:
- rm -f *.o *.so *~ a.out core core.[1-9][0-9]*
- rm -f libtokencap.so
-
-install: all
- install -m 755 libtokencap.so $${DESTDIR}$(HELPER_PATH)
- install -m 644 README.tokencap $${DESTDIR}$(HELPER_PATH)
-
diff --git a/chromium/third_party/afl/src/libtokencap/README.tokencap b/chromium/third_party/afl/src/libtokencap/README.tokencap
deleted file mode 100644
index 82d80c95580..00000000000
--- a/chromium/third_party/afl/src/libtokencap/README.tokencap
+++ /dev/null
@@ -1,60 +0,0 @@
-=========================================
-strcmp() / memcmp() token capture library
-=========================================
-
- (See ../docs/README for the general instruction manual.)
-
-This Linux-only companion library allows you to instrument strcmp(), memcmp(),
-and related functions to automatically extract syntax tokens passed to any of
-these libcalls. The resulting list of tokens may be then given as a starting
-dictionary to afl-fuzz (the -x option) to improve coverage on subsequent
-fuzzing runs.
-
-This may help improving coverage in some targets, and do precisely nothing in
-others. In some cases, it may even make things worse: if libtokencap picks up
-syntax tokens that are not used to process the input data, but that are a part
-of - say - parsing a config file... well, you're going to end up wasting a lot
-of CPU time on trying them out in the input stream. In other words, use this
-feature with care. Manually screening the resulting dictionary is almost
-always a necessity.
-
-As for the actual operation: the library stores tokens, without any deduping,
-by appending them to a file specified via AFL_TOKEN_FILE. If the variable is not
-set, the tool uses stderr (which is probably not what you want).
-
-Similarly to afl-tmin, the library is not "proprietary" and can be used with
-other fuzzers or testing tools without the need for any code tweaks. It does not
-require AFL-instrumented binaries to work.
-
-To use the library, you *need* to make sure that your fuzzing target is compiled
-with -fno-builtin and is linked dynamically. If you wish to automate the first
-part without mucking with CFLAGS in Makefiles, you can set AFL_NO_BUILTIN=1
-when using afl-gcc. This setting specifically adds the following flags:
-
- -fno-builtin-strcmp -fno-builtin-strncmp -fno-builtin-strcasecmp
- -fno-builtin-strcasencmp -fno-builtin-memcmp
-
-The next step is simply loading this library via LD_PRELOAD. The optimal usage
-pattern is to allow afl-fuzz to fuzz normally for a while and build up a corpus,
-and then fire off the target binary, with libtokencap.so loaded, on every file
-found by AFL in that earlier run. This demonstrates the basic principle:
-
- export AFL_TOKEN_FILE=$PWD/temp_output.txt
-
- for i in <out_dir>/queue/id*; do
- LD_PRELOAD=/path/to/libtokencap.so \
- /path/to/target/program [...params, including $i...]
- done
-
- sort -u temp_output.txt >afl_dictionary.txt
-
-If you don't get any results, the target library is probably not using strcmp()
-and memcmp() to parse input; or you haven't compiled it with -fno-builtin; or
-the whole thing isn't dynamically linked, and LD_PRELOAD is having no effect.
-
-PS. The library is Linux-only because there is probably no particularly portable
-and non-invasive way to distinguish between read-only and read-write memory
-mappings. The __tokencap_load_mappings() function is the only thing that would
-need to be changed for other OSes. Porting to platforms with /proc/<pid>/maps
-(e.g., FreeBSD) should be trivial.
-
diff --git a/chromium/third_party/afl/src/libtokencap/libtokencap.so.c b/chromium/third_party/afl/src/libtokencap/libtokencap.so.c
deleted file mode 100644
index 696c913daf5..00000000000
--- a/chromium/third_party/afl/src/libtokencap/libtokencap.so.c
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
-
- american fuzzy lop - extract tokens passed to strcmp / memcmp
- -------------------------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This Linux-only companion library allows you to instrument strcmp(),
- memcmp(), and related functions to automatically extract tokens.
- See README.tokencap for more info.
-
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "../types.h"
-#include "../config.h"
-
-#ifndef __linux__
-# error "Sorry, this library is Linux-specific for now!"
-#endif /* !__linux__ */
-
-
-/* Mapping data and such */
-
-#define MAX_MAPPINGS 1024
-
-static struct mapping {
- void *st, *en;
-} __tokencap_ro[MAX_MAPPINGS];
-
-static u32 __tokencap_ro_cnt;
-static u8 __tokencap_ro_loaded;
-static FILE* __tokencap_out_file;
-
-
-/* Identify read-only regions in memory. Only parameters that fall into these
- ranges are worth dumping when passed to strcmp() and so on. Read-write
- regions are far more likely to contain user input instead. */
-
-static void __tokencap_load_mappings(void) {
-
- u8 buf[MAX_LINE];
- FILE* f = fopen("/proc/self/maps", "r");
-
- __tokencap_ro_loaded = 1;
-
- if (!f) return;
-
- while (fgets(buf, MAX_LINE, f)) {
-
- u8 rf, wf;
- void* st, *en;
-
- if (sscanf(buf, "%p-%p %c%c", &st, &en, &rf, &wf) != 4) continue;
- if (wf == 'w' || rf != 'r') continue;
-
- __tokencap_ro[__tokencap_ro_cnt].st = (void*)st;
- __tokencap_ro[__tokencap_ro_cnt].en = (void*)en;
-
- if (++__tokencap_ro_cnt == MAX_MAPPINGS) break;
-
- }
-
- fclose(f);
-
-}
-
-
-/* Check an address against the list of read-only mappings. */
-
-static u8 __tokencap_is_ro(const void* ptr) {
-
- u32 i;
-
- if (!__tokencap_ro_loaded) __tokencap_load_mappings();
-
- for (i = 0; i < __tokencap_ro_cnt; i++)
- if (ptr >= __tokencap_ro[i].st && ptr <= __tokencap_ro[i].en) return 1;
-
- return 0;
-
-}
-
-
-/* Dump an interesting token to output file, quoting and escaping it
- properly. */
-
-static void __tokencap_dump(const u8* ptr, size_t len, u8 is_text) {
-
- u8 buf[MAX_AUTO_EXTRA * 4 + 1];
- u32 i;
- u32 pos = 0;
-
- if (len < MIN_AUTO_EXTRA || len > MAX_AUTO_EXTRA) return;
-
- for (i = 0; i < len; i++) {
-
- if (is_text && !ptr[i]) break;
-
- switch (ptr[i]) {
-
- case 0 ... 31:
- case 127 ... 255:
- case '\"':
- case '\\':
-
- sprintf(buf + pos, "\\x%02x", ptr[i]);
- pos += 4;
- break;
-
- default:
-
- buf[pos++] = ptr[i];
-
- }
-
- }
-
- buf[pos] = 0;
-
- fprintf(__tokencap_out_file, "\"%s\"\n", buf);
-
-}
-
-
-/* Replacements for strcmp(), memcmp(), and so on. Note that these will be used
- only if the target is compiled with -fno-builtins and linked dynamically. */
-
-#undef strcmp
-
-int strcmp(const char* str1, const char* str2) {
-
- if (__tokencap_is_ro(str1)) __tokencap_dump(str1, strlen(str1), 1);
- if (__tokencap_is_ro(str2)) __tokencap_dump(str2, strlen(str2), 1);
-
- while (1) {
-
- unsigned char c1 = *str1, c2 = *str2;
-
- if (c1 != c2) return (c1 > c2) ? 1 : -1;
- if (!c1) return 0;
- str1++; str2++;
-
- }
-
-}
-
-
-#undef strncmp
-
-int strncmp(const char* str1, const char* str2, size_t len) {
-
- if (__tokencap_is_ro(str1)) __tokencap_dump(str1, len, 1);
- if (__tokencap_is_ro(str2)) __tokencap_dump(str2, len, 1);
-
- while (len--) {
-
- unsigned char c1 = *str1, c2 = *str2;
-
- if (!c1) return 0;
- if (c1 != c2) return (c1 > c2) ? 1 : -1;
- str1++; str2++;
-
- }
-
- return 0;
-
-}
-
-
-#undef strcasecmp
-
-int strcasecmp(const char* str1, const char* str2) {
-
- if (__tokencap_is_ro(str1)) __tokencap_dump(str1, strlen(str1), 1);
- if (__tokencap_is_ro(str2)) __tokencap_dump(str2, strlen(str2), 1);
-
- while (1) {
-
- unsigned char c1 = tolower(*str1), c2 = tolower(*str2);
-
- if (c1 != c2) return (c1 > c2) ? 1 : -1;
- if (!c1) return 0;
- str1++; str2++;
-
- }
-
-}
-
-
-#undef strncasecmp
-
-int strncasecmp(const char* str1, const char* str2, size_t len) {
-
- if (__tokencap_is_ro(str1)) __tokencap_dump(str1, len, 1);
- if (__tokencap_is_ro(str2)) __tokencap_dump(str2, len, 1);
-
- while (len--) {
-
- unsigned char c1 = tolower(*str1), c2 = tolower(*str2);
-
- if (!c1) return 0;
- if (c1 != c2) return (c1 > c2) ? 1 : -1;
- str1++; str2++;
-
- }
-
- return 0;
-
-}
-
-
-#undef memcmp
-
-int memcmp(const void* mem1, const void* mem2, size_t len) {
-
- if (__tokencap_is_ro(mem1)) __tokencap_dump(mem1, len, 0);
- if (__tokencap_is_ro(mem2)) __tokencap_dump(mem2, len, 0);
-
- while (len--) {
-
- unsigned char c1 = *(const char*)mem1, c2 = *(const char*)mem2;
- if (c1 != c2) return (c1 > c2) ? 1 : -1;
- mem1++; mem2++;
-
- }
-
- return 0;
-
-}
-
-
-/* Init code to open the output file (or default to stderr). */
-
-__attribute__((constructor)) void __tokencap_init(void) {
-
- u8* fn = getenv("AFL_TOKEN_FILE");
- if (fn) __tokencap_out_file = fopen(fn, "a");
- if (!__tokencap_out_file) __tokencap_out_file = stderr;
-
-}
-
diff --git a/chromium/third_party/afl/src/llvm_mode/Makefile b/chromium/third_party/afl/src/llvm_mode/Makefile
deleted file mode 100644
index 5d4da94d3aa..00000000000
--- a/chromium/third_party/afl/src/llvm_mode/Makefile
+++ /dev/null
@@ -1,112 +0,0 @@
-#
-# american fuzzy lop - LLVM instrumentation
-# -----------------------------------------
-#
-# Written by Laszlo Szekeres <lszekeres@google.com> and
-# Michal Zalewski <lcamtuf@google.com>
-#
-# LLVM integration design comes from Laszlo Szekeres.
-#
-# Copyright 2015, 2016 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-
-PREFIX ?= /usr/local
-HELPER_PATH = $(PREFIX)/lib/afl
-BIN_PATH = $(PREFIX)/bin
-
-VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2)
-
-LLVM_CONFIG ?= llvm-config
-
-CFLAGS ?= -O3 -funroll-loops
-CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \
- -DAFL_PATH=\"$(HELPER_PATH)\" -DBIN_PATH=\"$(BIN_PATH)\" \
- -DVERSION=\"$(VERSION)\"
-ifdef AFL_TRACE_PC
- CFLAGS += -DUSE_TRACE_PC=1
-endif
-
-CXXFLAGS ?= -O3 -funroll-loops
-CXXFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \
- -DVERSION=\"$(VERSION)\" -Wno-variadic-macros
-
-CLANG_CFL = `$(LLVM_CONFIG) --cxxflags` -fno-rtti -fpic $(CXXFLAGS)
-CLANG_LFL = `$(LLVM_CONFIG) --ldflags` $(LDFLAGS)
-
-# User teor2345 reports that this is required to make things work on MacOS X.
-
-ifeq "$(shell uname)" "Darwin"
- CLANG_LFL += -Wl,-flat_namespace -Wl,-undefined,suppress
-endif
-
-# We were using llvm-config --bindir to get the location of clang, but
-# this seems to be busted on some distros, so using the one in $PATH is
-# probably better.
-
-ifeq "$(origin CC)" "default"
- CC = clang
- CXX = clang++
-endif
-
-ifndef AFL_TRACE_PC
- PROGS = ../afl-clang-fast ../afl-llvm-pass.so ../afl-llvm-rt.o ../afl-llvm-rt-32.o ../afl-llvm-rt-64.o
-else
- PROGS = ../afl-clang-fast ../afl-llvm-rt.o ../afl-llvm-rt-32.o ../afl-llvm-rt-64.o
-endif
-
-all: test_deps $(PROGS) test_build all_done
-
-test_deps:
-ifndef AFL_TRACE_PC
- @echo "[*] Checking for working 'llvm-config'..."
- @which $(LLVM_CONFIG) >/dev/null 2>&1 || ( echo "[-] Oops, can't find 'llvm-config'. Install clang or set \$$LLVM_CONFIG or \$$PATH beforehand."; echo " (Sometimes, the binary will be named llvm-config-3.5 or something like that.)"; exit 1 )
-else
- @echo "[!] Note: using -fsanitize=trace-pc mode (this will fail with older LLVM)."
-endif
- @echo "[*] Checking for working '$(CC)'..."
- @which $(CC) >/dev/null 2>&1 || ( echo "[-] Oops, can't find '$(CC)'. Make sure that it's in your \$$PATH (or set \$$CC and \$$CXX)."; exit 1 )
- @echo "[*] Checking for '../afl-showmap'..."
- @test -f ../afl-showmap || ( echo "[-] Oops, can't find '../afl-showmap'. Be sure to compile AFL first."; exit 1 )
- @echo "[+] All set and ready to build."
-
-../afl-clang-fast: afl-clang-fast.c | test_deps
- $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
- ln -sf afl-clang-fast ../afl-clang-fast++
-
-../afl-llvm-pass.so: afl-llvm-pass.so.cc | test_deps
- $(CXX) $(CLANG_CFL) -shared $< -o $@ $(CLANG_LFL)
-
-../afl-llvm-rt.o: afl-llvm-rt.o.c | test_deps
- $(CC) $(CFLAGS) -fPIC -c $< -o $@
-
-../afl-llvm-rt-32.o: afl-llvm-rt.o.c | test_deps
- @printf "[*] Building 32-bit variant of the runtime (-m32)... "
- @$(CC) $(CFLAGS) -m32 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-
-../afl-llvm-rt-64.o: afl-llvm-rt.o.c | test_deps
- @printf "[*] Building 64-bit variant of the runtime (-m64)... "
- @$(CC) $(CFLAGS) -m64 -fPIC -c $< -o $@ 2>/dev/null; if [ "$$?" = "0" ]; then echo "success!"; else echo "failed (that's fine)"; fi
-
-test_build: $(PROGS)
- @echo "[*] Testing the CC wrapper and instrumentation output..."
- unset AFL_USE_ASAN AFL_USE_MSAN AFL_INST_RATIO; AFL_QUIET=1 AFL_PATH=. AFL_CC=$(CC) ../afl-clang-fast $(CFLAGS) ../test-instr.c -o test-instr $(LDFLAGS)
- echo 0 | ../afl-showmap -m none -q -o .test-instr0 ./test-instr
- echo 1 | ../afl-showmap -m none -q -o .test-instr1 ./test-instr
- @rm -f test-instr
- @cmp -s .test-instr0 .test-instr1; DR="$$?"; rm -f .test-instr0 .test-instr1; if [ "$$DR" = "0" ]; then echo; echo "Oops, the instrumentation does not seem to be behaving correctly!"; echo; echo "Please ping <lcamtuf@google.com> to troubleshoot the issue."; echo; exit 1; fi
- @echo "[+] All right, the instrumentation seems to be working!"
-
-all_done: test_build
- @echo "[+] All done! You can now use '../afl-clang-fast' to compile programs."
-
-.NOTPARALLEL: clean
-
-clean:
- rm -f *.o *.so *~ a.out core core.[1-9][0-9]* test-instr .test-instr0 .test-instr1
- rm -f $(PROGS) ../afl-clang-fast++
diff --git a/chromium/third_party/afl/src/llvm_mode/README.llvm b/chromium/third_party/afl/src/llvm_mode/README.llvm
deleted file mode 100644
index d96d8c31d64..00000000000
--- a/chromium/third_party/afl/src/llvm_mode/README.llvm
+++ /dev/null
@@ -1,188 +0,0 @@
-============================================
-Fast LLVM-based instrumentation for afl-fuzz
-============================================
-
- (See ../docs/README for the general instruction manual.)
-
-1) Introduction
----------------
-
-The code in this directory allows you to instrument programs for AFL using
-true compiler-level instrumentation, instead of the more crude
-assembly-level rewriting approach taken by afl-gcc and afl-clang. This has
-several interesting properties:
-
- - The compiler can make many optimizations that are hard to pull off when
- manually inserting assembly. As a result, some slow, CPU-bound programs will
- run up to around 2x faster.
-
- The gains are less pronounced for fast binaries, where the speed is limited
- chiefly by the cost of creating new processes. In such cases, the gain will
- probably stay within 10%.
-
- - The instrumentation is CPU-independent. At least in principle, you should
- be able to rely on it to fuzz programs on non-x86 architectures (after
- building afl-fuzz with AFL_NO_X86=1).
-
- - The instrumentation can cope a bit better with multi-threaded targets.
-
- - Because the feature relies on the internals of LLVM, it is clang-specific
- and will *not* work with GCC.
-
-Once this implementation is shown to be sufficiently robust and portable, it
-will probably replace afl-clang. For now, it can be built separately and
-co-exists with the original code.
-
-The idea and much of the implementation comes from Laszlo Szekeres.
-
-2) How to use
--------------
-
-In order to leverage this mechanism, you need to have clang installed on your
-system. You should also make sure that the llvm-config tool is in your path
-(or pointed to via LLVM_CONFIG in the environment).
-
-Unfortunately, some systems that do have clang come without llvm-config or the
-LLVM development headers; one example of this is FreeBSD. FreeBSD users will
-also run into problems with clang being built statically and not being able to
-load modules (you'll see "Service unavailable" when loading afl-llvm-pass.so).
-
-To solve all your problems, you can grab pre-built binaries for your OS from:
-
- http://llvm.org/releases/download.html
-
-...and then put the bin/ directory from the tarball at the beginning of your
-$PATH when compiling the feature and building packages later on. You don't need
-to be root for that.
-
-To build the instrumentation itself, type 'make'. This will generate binaries
-called afl-clang-fast and afl-clang-fast++ in the parent directory. Once this
-is done, you can instrument third-party code in a way similar to the standard
-operating mode of AFL, e.g.:
-
- CC=/path/to/afl/afl-clang-fast ./configure [...options...]
- make
-
-Be sure to also include CXX set to afl-clang-fast++ for C++ code.
-
-The tool honors roughly the same environmental variables as afl-gcc (see
-../docs/env_variables.txt). This includes AFL_INST_RATIO, AFL_USE_ASAN,
-AFL_HARDEN, and AFL_DONT_OPTIMIZE.
-
-Note: if you want the LLVM helper to be installed on your system for all
-users, you need to build it before issuing 'make install' in the parent
-directory.
-
-3) Gotchas, feedback, bugs
---------------------------
-
-This is an early-stage mechanism, so field reports are welcome. You can send bug
-reports to <afl-users@googlegroups.com>.
-
-4) Bonus feature #1: deferred instrumentation
----------------------------------------------
-
-AFL tries to optimize performance by executing the targeted binary just once,
-stopping it just before main(), and then cloning this "master" process to get
-a steady supply of targets to fuzz.
-
-Although this approach eliminates much of the OS-, linker- and libc-level
-costs of executing the program, it does not always help with binaries that
-perform other time-consuming initialization steps - say, parsing a large config
-file before getting to the fuzzed data.
-
-In such cases, it's beneficial to initialize the forkserver a bit later, once
-most of the initialization work is already done, but before the binary attempts
-to read the fuzzed input and parse it; in some cases, this can offer a 10x+
-performance gain. You can implement delayed initialization in LLVM mode in a
-fairly simple way.
-
-First, find a suitable location in the code where the delayed cloning can
-take place. This needs to be done with *extreme* care to avoid breaking the
-binary. In particular, the program will probably malfunction if you select
-a location after:
-
- - The creation of any vital threads or child processes - since the forkserver
- can't clone them easily.
-
- - The initialization of timers via setitimer() or equivalent calls.
-
- - The creation of temporary files, network sockets, offset-sensitive file
- descriptors, and similar shared-state resources - but only provided that
- their state meaningfully influences the behavior of the program later on.
-
- - Any access to the fuzzed input, including reading the metadata about its
- size.
-
-With the location selected, add this code in the appropriate spot:
-
-#ifdef __AFL_HAVE_MANUAL_CONTROL
- __AFL_INIT();
-#endif
-
-You don't need the #ifdef guards, but including them ensures that the program
-will keep working normally when compiled with a tool other than afl-clang-fast.
-
-Finally, recompile the program with afl-clang-fast (afl-gcc or afl-clang will
-*not* generate a deferred-initialization binary) - and you should be all set!
-
-5) Bonus feature #2: persistent mode
-------------------------------------
-
-Some libraries provide APIs that are stateless, or whose state can be reset in
-between processing different input files. When such a reset is performed, a
-single long-lived process can be reused to try out multiple test cases,
-eliminating the need for repeated fork() calls and the associated OS overhead.
-
-The basic structure of the program that does this would be:
-
- while (__AFL_LOOP(1000)) {
-
- /* Read input data. */
- /* Call library code to be fuzzed. */
- /* Reset state. */
-
- }
-
- /* Exit normally */
-
-The numerical value specified within the loop controls the maximum number
-of iterations before AFL will restart the process from scratch. This minimizes
-the impact of memory leaks and similar glitches; 1000 is a good starting point,
-and going much higher increases the likelihood of hiccups without giving you
-any real performance benefits.
-
-A more detailed template is shown in ../experimental/persistent_demo/.
-Similarly to the previous mode, the feature works only with afl-clang-fast;
-#ifdef guards can be used to suppress it when using other compilers.
-
-Note that as with the previous mode, the feature is easy to misuse; if you
-do not fully reset the critical state, you may end up with false positives or
-waste a whole lot of CPU power doing nothing useful at all. Be particularly
-wary of memory leaks and of the state of file descriptors.
-
-PS. Because there are task switches still involved, the mode isn't as fast as
-"pure" in-process fuzzing offered, say, by LLVM's LibFuzzer; but it is a lot
-faster than the normal fork() model, and compared to in-process fuzzing,
-should be a lot more robust.
-
-6) Bonus feature #3: new 'trace-pc-guard' mode
-----------------------------------------------
-
-Recent versions of LLVM are shipping with a built-in execution tracing feature
-that provides AFL with the necessary tracing data without the need to
-post-process the assembly or install any compiler plugins. See:
-
- http://clang.llvm.org/docs/SanitizerCoverage.html#tracing-pcs-with-guards
-
-As of this writing, the feature is only available on SVN trunk, and is yet to
-make it to an official release of LLVM. Nevertheless, if you have a
-sufficiently recent compiler and want to give it a try, build afl-clang-fast
-this way:
-
- AFL_TRACE_PC=1 make clean all
-
-Note that this mode is currently about 20-30% slower than "vanilla"
-afl-clang-fast, and about 5-10% slower than afl-clang. I am not entirely sure
-why.
-
diff --git a/chromium/third_party/afl/src/llvm_mode/afl-clang-fast.c b/chromium/third_party/afl/src/llvm_mode/afl-clang-fast.c
deleted file mode 100644
index 4f7fe475a3d..00000000000
--- a/chromium/third_party/afl/src/llvm_mode/afl-clang-fast.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- american fuzzy lop - LLVM-mode wrapper for clang
- ------------------------------------------------
-
- Written by Laszlo Szekeres <lszekeres@google.com> and
- Michal Zalewski <lcamtuf@google.com>
-
- LLVM integration design comes from Laszlo Szekeres.
-
- Copyright 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This program is a drop-in replacement for clang, similar in most respects
- to ../afl-gcc. It tries to figure out compilation mode, adds a bunch
- of flags, and then calls the real compiler.
-
- */
-
-#define AFL_MAIN
-
-#include "../config.h"
-#include "../types.h"
-#include "../debug.h"
-#include "../alloc-inl.h"
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-static u8* obj_path; /* Path to runtime libraries */
-static u8** cc_params; /* Parameters passed to the real CC */
-static u32 cc_par_cnt = 1; /* Param count, including argv0 */
-
-
-/* Try to find the runtime libraries. If that fails, abort. */
-
-static void find_obj(u8* argv0) {
-
- u8 *afl_path = getenv("AFL_PATH");
- u8 *slash, *tmp;
-
- if (afl_path) {
-
- tmp = alloc_printf("%s/afl-llvm-rt.o", afl_path);
-
- if (!access(tmp, R_OK)) {
- obj_path = afl_path;
- ck_free(tmp);
- return;
- }
-
- ck_free(tmp);
-
- }
-
- slash = strrchr(argv0, '/');
-
- if (slash) {
-
- u8 *dir;
-
- *slash = 0;
- dir = ck_strdup(argv0);
- *slash = '/';
-
- tmp = alloc_printf("%s/afl-llvm-rt.o", dir);
-
- if (!access(tmp, R_OK)) {
- obj_path = dir;
- ck_free(tmp);
- return;
- }
-
- ck_free(tmp);
- ck_free(dir);
-
- }
-
- if (!access(AFL_PATH "/afl-llvm-rt.o", R_OK)) {
- obj_path = AFL_PATH;
- return;
- }
-
- FATAL("Unable to find 'afl-llvm-rt.o' or 'afl-llvm-pass.so'. Please set AFL_PATH");
-
-}
-
-
-/* Copy argv to cc_params, making the necessary edits. */
-
-static void edit_params(u32 argc, char** argv) {
-
- u8 fortify_set = 0, asan_set = 0, x_set = 0, maybe_linking = 1, bit_mode = 0;
- u8 *name;
-
- cc_params = ck_alloc((argc + 128) * sizeof(u8*));
-
- name = strrchr(argv[0], '/');
- if (!name) name = argv[0]; else name++;
-
- if (!strcmp(name, "afl-clang-fast++")) {
- u8* alt_cxx = getenv("AFL_CXX");
- cc_params[0] = alt_cxx ? alt_cxx : (u8*)"clang++";
- } else {
- u8* alt_cc = getenv("AFL_CC");
- cc_params[0] = alt_cc ? alt_cc : (u8*)"clang";
- }
-
- /* There are two ways to compile afl-clang-fast. In the traditional mode, we
- use afl-llvm-pass.so to inject instrumentation. In the experimental
- 'trace-pc-guard' mode, we use native LLVM instrumentation callbacks
- instead. The latter is a very recent addition - see:
-
- http://clang.llvm.org/docs/SanitizerCoverage.html#tracing-pcs-with-guards */
-
-#ifdef USE_TRACE_PC
- cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard";
- cc_params[cc_par_cnt++] = "-mllvm";
- cc_params[cc_par_cnt++] = "-sanitizer-coverage-block-threshold=0";
-#else
- cc_params[cc_par_cnt++] = "-Xclang";
- cc_params[cc_par_cnt++] = "-load";
- cc_params[cc_par_cnt++] = "-Xclang";
- cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-pass.so", obj_path);
-#endif /* ^USE_TRACE_PC */
-
- cc_params[cc_par_cnt++] = "-Qunused-arguments";
-
- /* Detect stray -v calls from ./configure scripts. */
-
- if (argc == 1 && !strcmp(argv[1], "-v")) maybe_linking = 0;
-
- while (--argc) {
- u8* cur = *(++argv);
-
- if (!strcmp(cur, "-m32")) bit_mode = 32;
- if (!strcmp(cur, "-m64")) bit_mode = 64;
-
- if (!strcmp(cur, "-x")) x_set = 1;
-
- if (!strcmp(cur, "-c") || !strcmp(cur, "-S") || !strcmp(cur, "-E"))
- maybe_linking = 0;
-
- if (!strcmp(cur, "-fsanitize=address") ||
- !strcmp(cur, "-fsanitize=memory")) asan_set = 1;
-
- if (strstr(cur, "FORTIFY_SOURCE")) fortify_set = 1;
-
- if (!strcmp(cur, "-shared")) maybe_linking = 0;
-
- if (!strcmp(cur, "-Wl,-z,defs") ||
- !strcmp(cur, "-Wl,--no-undefined")) continue;
-
- cc_params[cc_par_cnt++] = cur;
-
- }
-
- if (getenv("AFL_HARDEN")) {
-
- cc_params[cc_par_cnt++] = "-fstack-protector-all";
-
- if (!fortify_set)
- cc_params[cc_par_cnt++] = "-D_FORTIFY_SOURCE=2";
-
- }
-
- if (!asan_set) {
-
- if (getenv("AFL_USE_ASAN")) {
-
- if (getenv("AFL_USE_MSAN"))
- FATAL("ASAN and MSAN are mutually exclusive");
-
- if (getenv("AFL_HARDEN"))
- FATAL("ASAN and AFL_HARDEN are mutually exclusive");
-
- cc_params[cc_par_cnt++] = "-U_FORTIFY_SOURCE";
- cc_params[cc_par_cnt++] = "-fsanitize=address";
-
- } else if (getenv("AFL_USE_MSAN")) {
-
- if (getenv("AFL_USE_ASAN"))
- FATAL("ASAN and MSAN are mutually exclusive");
-
- if (getenv("AFL_HARDEN"))
- FATAL("MSAN and AFL_HARDEN are mutually exclusive");
-
- cc_params[cc_par_cnt++] = "-U_FORTIFY_SOURCE";
- cc_params[cc_par_cnt++] = "-fsanitize=memory";
-
- }
-
- }
-
-#ifdef USE_TRACE_PC
-
- if (getenv("AFL_INST_RATIO"))
- FATAL("AFL_INST_RATIO not available at compile time with 'trace-pc'.");
-
-#endif /* USE_TRACE_PC */
-
- if (!getenv("AFL_DONT_OPTIMIZE")) {
-
- cc_params[cc_par_cnt++] = "-g";
- cc_params[cc_par_cnt++] = "-O3";
- cc_params[cc_par_cnt++] = "-funroll-loops";
-
- }
-
- if (getenv("AFL_NO_BUILTIN")) {
-
- cc_params[cc_par_cnt++] = "-fno-builtin-strcmp";
- cc_params[cc_par_cnt++] = "-fno-builtin-strncmp";
- cc_params[cc_par_cnt++] = "-fno-builtin-strcasecmp";
- cc_params[cc_par_cnt++] = "-fno-builtin-strncasecmp";
- cc_params[cc_par_cnt++] = "-fno-builtin-memcmp";
-
- }
-
- cc_params[cc_par_cnt++] = "-D__AFL_HAVE_MANUAL_CONTROL=1";
- cc_params[cc_par_cnt++] = "-D__AFL_COMPILER=1";
- cc_params[cc_par_cnt++] = "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1";
-
- /* When the user tries to use persistent or deferred forkserver modes by
- appending a single line to the program, we want to reliably inject a
- signature into the binary (to be picked up by afl-fuzz) and we want
- to call a function from the runtime .o file. This is unnecessarily
- painful for three reasons:
-
- 1) We need to convince the compiler not to optimize out the signature.
- This is done with __attribute__((used)).
-
- 2) We need to convince the linker, when called with -Wl,--gc-sections,
- not to do the same. This is done by forcing an assignment to a
- 'volatile' pointer.
-
- 3) We need to declare __afl_persistent_loop() in the global namespace,
- but doing this within a method in a class is hard - :: and extern "C"
- are forbidden and __attribute__((alias(...))) doesn't work. Hence the
- __asm__ aliasing trick.
-
- */
-
- cc_params[cc_par_cnt++] = "-D__AFL_LOOP(_A)="
- "({ static volatile char *_B __attribute__((used)); "
- " _B = (char*)\"" PERSIST_SIG "\"; "
-#ifdef __APPLE__
- "__attribute__((visibility(\"default\"))) "
- "int _L(unsigned int) __asm__(\"___afl_persistent_loop\"); "
-#else
- "__attribute__((visibility(\"default\"))) "
- "int _L(unsigned int) __asm__(\"__afl_persistent_loop\"); "
-#endif /* ^__APPLE__ */
- "_L(_A); })";
-
- cc_params[cc_par_cnt++] = "-D__AFL_INIT()="
- "do { static volatile char *_A __attribute__((used)); "
- " _A = (char*)\"" DEFER_SIG "\"; "
-#ifdef __APPLE__
- "__attribute__((visibility(\"default\"))) "
- "void _I(void) __asm__(\"___afl_manual_init\"); "
-#else
- "__attribute__((visibility(\"default\"))) "
- "void _I(void) __asm__(\"__afl_manual_init\"); "
-#endif /* ^__APPLE__ */
- "_I(); } while (0)";
-
- if (maybe_linking) {
-
- if (x_set) {
- cc_params[cc_par_cnt++] = "-x";
- cc_params[cc_par_cnt++] = "none";
- }
-
- switch (bit_mode) {
-
- case 0:
- cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt.o", obj_path);
- break;
-
- case 32:
- cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-32.o", obj_path);
-
- if (access(cc_params[cc_par_cnt - 1], R_OK))
- FATAL("-m32 is not supported by your compiler");
-
- break;
-
- case 64:
- cc_params[cc_par_cnt++] = alloc_printf("%s/afl-llvm-rt-64.o", obj_path);
-
- if (access(cc_params[cc_par_cnt - 1], R_OK))
- FATAL("-m64 is not supported by your compiler");
-
- break;
-
- }
-
- }
-
- cc_params[cc_par_cnt] = NULL;
-
-}
-
-
-/* Main entry point */
-
-int main(int argc, char** argv) {
-
- if (isatty(2) && !getenv("AFL_QUIET")) {
-
- SAYF(cCYA "afl-clang-fast " cBRI VERSION cRST " by <lszekeres@google.com>\n");
-
- }
-
- if (argc < 2) {
-
- SAYF("\n"
- "This is a helper application for afl-fuzz. It serves as a drop-in replacement\n"
- "for clang, letting you recompile third-party code with the required runtime\n"
- "instrumentation. A common use pattern would be one of the following:\n\n"
-
- " CC=%s/afl-clang-fast ./configure\n"
- " CXX=%s/afl-clang-fast++ ./configure\n\n"
-
- "In contrast to the traditional afl-clang tool, this version is implemented as\n"
- "an LLVM pass and tends to offer improved performance with slow programs.\n\n"
-
- "You can specify custom next-stage toolchain via AFL_CC and AFL_CXX. Setting\n"
- "AFL_HARDEN enables hardening optimizations in the compiled code.\n\n",
- BIN_PATH, BIN_PATH);
-
- exit(1);
-
- }
-
-
- find_obj(argv[0]);
-
- edit_params(argc, argv);
-
- execvp(cc_params[0], (char**)cc_params);
-
- FATAL("Oops, failed to execute '%s' - check your PATH", cc_params[0]);
-
- return 0;
-
-}
diff --git a/chromium/third_party/afl/src/llvm_mode/afl-llvm-rt.o.c b/chromium/third_party/afl/src/llvm_mode/afl-llvm-rt.o.c
deleted file mode 100644
index 905c76ffb5e..00000000000
--- a/chromium/third_party/afl/src/llvm_mode/afl-llvm-rt.o.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- american fuzzy lop - LLVM instrumentation bootstrap
- ---------------------------------------------------
-
- Written by Laszlo Szekeres <lszekeres@google.com> and
- Michal Zalewski <lcamtuf@google.com>
-
- LLVM integration design comes from Laszlo Szekeres.
-
- Copyright 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This code is the rewrite of afl-as.h's main_payload.
-
-*/
-
-#include "../config.h"
-#include "../types.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <unistd.h>
-#include <string.h>
-#include <assert.h>
-
-#include <sys/mman.h>
-#include <sys/shm.h>
-#include <sys/wait.h>
-#include <sys/types.h>
-
-/* This is a somewhat ugly hack for the experimental 'trace-pc-guard' mode.
- Basically, we need to make sure that the forkserver is initialized after
- the LLVM-generated runtime initialization pass, not before. */
-
-#ifdef USE_TRACE_PC
-# define CONST_PRIO 5
-#else
-# define CONST_PRIO 0
-#endif /* ^USE_TRACE_PC */
-
-
-/* Globals needed by the injected instrumentation. The __afl_area_initial region
- is used for instrumentation output before __afl_map_shm() has a chance to run.
- It will end up as .comm, so it shouldn't be too wasteful. */
-
-u8 __afl_area_initial[MAP_SIZE];
-u8* __afl_area_ptr = __afl_area_initial;
-
-__thread u32 __afl_prev_loc;
-
-
-/* Running in persistent mode? */
-
-static u8 is_persistent;
-
-
-/* SHM setup. */
-
-static void __afl_map_shm(void) {
-
- u8 *id_str = getenv(SHM_ENV_VAR);
-
- /* If we're running under AFL, attach to the appropriate region, replacing the
- early-stage __afl_area_initial region that is needed to allow some really
- hacky .init code to work correctly in projects such as OpenSSL. */
-
- if (id_str) {
-
- u32 shm_id = atoi(id_str);
-
- __afl_area_ptr = shmat(shm_id, NULL, 0);
-
- /* Whooooops. */
-
- if (__afl_area_ptr == (void *)-1) _exit(1);
-
- /* Write something into the bitmap so that even with low AFL_INST_RATIO,
- our parent doesn't give up on us. */
-
- __afl_area_ptr[0] = 1;
-
- }
-
-}
-
-
-/* Fork server logic. */
-
-static void __afl_start_forkserver(void) {
-
- static u8 tmp[4];
- s32 child_pid;
-
- u8 child_stopped = 0;
-
- /* Phone home and tell the parent that we're OK. If parent isn't there,
- assume we're not running in forkserver mode and just execute program. */
-
- if (write(FORKSRV_FD + 1, tmp, 4) != 4) return;
-
- while (1) {
-
- u32 was_killed;
- int status;
-
- /* Wait for parent by reading from the pipe. Abort if read fails. */
-
- if (read(FORKSRV_FD, &was_killed, 4) != 4) _exit(1);
-
- /* If we stopped the child in persistent mode, but there was a race
- condition and afl-fuzz already issued SIGKILL, write off the old
- process. */
-
- if (child_stopped && was_killed) {
- child_stopped = 0;
- if (waitpid(child_pid, &status, 0) < 0) _exit(1);
- }
-
- if (!child_stopped) {
-
- /* Once woken up, create a clone of our process. */
-
- child_pid = fork();
- if (child_pid < 0) _exit(1);
-
- /* In child process: close fds, resume execution. */
-
- if (!child_pid) {
-
- close(FORKSRV_FD);
- close(FORKSRV_FD + 1);
- return;
-
- }
-
- } else {
-
- /* Special handling for persistent mode: if the child is alive but
- currently stopped, simply restart it with SIGCONT. */
-
- kill(child_pid, SIGCONT);
- child_stopped = 0;
-
- }
-
- /* In parent process: write PID to pipe, then wait for child. */
-
- if (write(FORKSRV_FD + 1, &child_pid, 4) != 4) _exit(1);
-
- if (waitpid(child_pid, &status, is_persistent ? WUNTRACED : 0) < 0)
- _exit(1);
-
- /* In persistent mode, the child stops itself with SIGSTOP to indicate
- a successful run. In this case, we want to wake it up without forking
- again. */
-
- if (WIFSTOPPED(status)) child_stopped = 1;
-
- /* Relay wait status to pipe, then loop back. */
-
- if (write(FORKSRV_FD + 1, &status, 4) != 4) _exit(1);
-
- }
-
-}
-
-
-/* A simplified persistent mode handler, used as explained in README.llvm. */
-
-int __afl_persistent_loop(unsigned int max_cnt) {
-
- static u8 first_pass = 1;
- static u32 cycle_cnt;
-
- if (first_pass) {
-
- /* Make sure that every iteration of __AFL_LOOP() starts with a clean slate.
- On subsequent calls, the parent will take care of that, but on the first
- iteration, it's our job to erase any trace of whatever happened
- before the loop. */
-
- if (is_persistent) {
-
- memset(__afl_area_ptr, 0, MAP_SIZE);
- __afl_area_ptr[0] = 1;
- __afl_prev_loc = 0;
- }
-
- cycle_cnt = max_cnt;
- first_pass = 0;
- return 1;
-
- }
-
- if (is_persistent) {
-
- if (--cycle_cnt) {
-
- raise(SIGSTOP);
-
- __afl_area_ptr[0] = 1;
- __afl_prev_loc = 0;
-
- return 1;
-
- } else {
-
- /* When exiting __AFL_LOOP(), make sure that the subsequent code that
- follows the loop is not traced. We do that by pivoting back to the
- dummy output region. */
-
- __afl_area_ptr = __afl_area_initial;
-
- }
-
- }
-
- return 0;
-
-}
-
-
-/* This one can be called from user code when deferred forkserver mode
- is enabled. */
-
-void __afl_manual_init(void) {
-
- static u8 init_done;
-
- if (!init_done) {
-
- __afl_map_shm();
- __afl_start_forkserver();
- init_done = 1;
-
- }
-
-}
-
-
-/* Proper initialization routine. */
-
-__attribute__((constructor(CONST_PRIO))) void __afl_auto_init(void) {
-
- is_persistent = !!getenv(PERSIST_ENV_VAR);
-
- if (getenv(DEFER_ENV_VAR)) return;
-
- __afl_manual_init();
-
-}
-
-
-/* The following stuff deals with supporting -fsanitize-coverage=trace-pc-guard.
- It remains non-operational in the traditional, plugin-backed LLVM mode.
- For more info about 'trace-pc-guard', see README.llvm.
-
- The first function (__sanitizer_cov_trace_pc_guard) is called back on every
- edge (as opposed to every basic block). */
-
-void __sanitizer_cov_trace_pc_guard(uint32_t* guard) {
- __afl_area_ptr[*guard]++;
-}
-
-
-/* Init callback. Populates instrumentation IDs. Note that we're using
- ID of 0 as a special value to indicate non-instrumented bits. That may
- still touch the bitmap, but in a fairly harmless way. */
-
-void __sanitizer_cov_trace_pc_guard_init(uint32_t* start, uint32_t* stop) {
-
- u32 inst_ratio = 100;
- u8* x;
-
- x = getenv("AFL_INST_RATIO");
- if (x) inst_ratio = atoi(x);
-
- if (!inst_ratio || inst_ratio > 100) {
- fprintf(stderr, "[-] ERROR: Invalid AFL_INST_RATIO (must be 1-100).\n");
- abort();
- }
-
- while (start < stop) {
-
- if (R(100) < inst_ratio) *start = R(MAP_SIZE - 1) + 1;
- else *start = 0;
-
- start++;
-
- }
-
-}
diff --git a/chromium/third_party/afl/src/qemu_mode/README.qemu b/chromium/third_party/afl/src/qemu_mode/README.qemu
deleted file mode 100644
index f9dce9964b7..00000000000
--- a/chromium/third_party/afl/src/qemu_mode/README.qemu
+++ /dev/null
@@ -1,125 +0,0 @@
-=========================================================
-High-performance binary-only instrumentation for afl-fuzz
-=========================================================
-
- (See ../docs/README for the general instruction manual.)
-
-1) Introduction
----------------
-
-The code in this directory allows you to build a standalone feature that
-leverages the QEMU "user emulation" mode and allows callers to obtain
-instrumentation output for black-box, closed-source binaries. This mechanism
-can be then used by afl-fuzz to stress-test targets that couldn't be built
-with afl-gcc.
-
-The usual performance cost is 2-5x, which is considerably better than
-seen so far in experiments with tools such as DynamoRIO and PIN.
-
-The idea and much of the implementation comes from Andrew Griffiths.
-
-2) How to use
--------------
-
-The feature is implemented with a fairly simple patch to QEMU 2.3.0. The
-simplest way to build it is to run ./build_qemu_support.sh. The script will
-download, configure, and compile the QEMU binary for you.
-
-QEMU is a big project, so this will take a while, and you may have to
-resolve a couple of dependencies (most notably, you will definitely need
-libtool and glib2-devel).
-
-Once the binaries are compiled, you can leverage the QEMU tool by calling
-afl-fuzz and all the related utilities with -Q in the command line.
-
-Note that QEMU requires a generous memory limit to run; somewhere around
-200 MB is a good starting point, but considerably more may be needed for
-more complex programs. The default -m limit will be automatically bumped up
-to 200 MB when specifying -Q to afl-fuzz; be careful when overriding this.
-
-In principle, if you set CPU_TARGET before calling ./build_qemu_support.sh,
-you should get a build capable of running non-native binaries (say, you
-can try CPU_TARGET=arm). This is also necessary for running 32-bit binaries
-on a 64-bit system (CPU_TARGET=i386).
-
-Note: if you want the QEMU helper to be installed on your system for all
-users, you need to build it before issuing 'make install' in the parent
-directory.
-
-3) Notes on linking
--------------------
-
-The feature is supported only on Linux. Supporting BSD may amount to porting
-the changes made to linux-user/elfload.c and applying them to
-bsd-user/elfload.c, but I have not looked into this yet.
-
-The instrumentation follows only the .text section of the first ELF binary
-encountered in the linking process. It does not trace shared libraries. In
-practice, this means two things:
-
- - Any libraries you want to analyze *must* be linked statically into the
- executed ELF file (this will usually be the case for closed-source
- apps).
-
- - Standard C libraries and other stuff that is wasteful to instrument
- should be linked dynamically - otherwise, AFL will have no way to avoid
- peeking into them.
-
-Setting AFL_INST_LIBS=1 can be used to circumvent the .text detection logic
-and instrument every basic block encountered.
-
-4) Benchmarking
----------------
-
-If you want to compare the performance of the QEMU instrumentation with that of
-afl-gcc compiled code against the same target, you need to build the
-non-instrumented binary with the same optimization flags that are normally
-injected by afl-gcc, and make sure that the bits to be tested are statically
-linked into the binary. A common way to do this would be:
-
-$ CFLAGS="-O3 -funroll-loops" ./configure --disable-shared
-$ make clean all
-
-Comparative measurements of execution speed or instrumentation coverage will be
-fairly meaningless if the optimization levels or instrumentation scopes don't
-match.
-
-5) Gotchas, feedback, bugs
---------------------------
-
-If you need to fix up checksums or do other cleanup on mutated test cases, see
-experimental/post_library/ for a viable solution.
-
-Do not mix QEMU mode with ASAN, MSAN, or the likes; QEMU doesn't appreciate
-the "shadow VM" trick employed by the sanitizers and will probably just
-run out of memory.
-
-Compared to fully-fledged virtualization, the user emulation mode is *NOT* a
-security boundary. The binaries can freely interact with the host OS. If you
-somehow need to fuzz an untrusted binary, put everything in a sandbox first.
-
-QEMU does not necessarily support all CPU or hardware features that your
-target program may be utilizing. In particular, it does not appear to have
-full support for AVX2 / FMA3. Using binaries for older CPUs, or recompiling them
-with -march=core2, can help.
-
-Beyond that, this is an early-stage mechanism, so fields reports are welcome.
-You can send them to <afl-users@googlegroups.com>.
-
-6) Alternatives: static rewriting
----------------------------------
-
-Statically rewriting binaries just once, instead of attempting to translate
-them at run time, can be a faster alternative. That said, static rewriting is
-fraught with peril, because it depends on being able to properly and fully model
-program control flow without actually executing each and every code path.
-
-If you want to experiment with this mode of operation, there is a module
-contributed by Aleksandar Nikolich:
-
- https://github.com/vrtadmin/moflow/tree/master/afl-dyninst
- https://groups.google.com/forum/#!topic/afl-users/HlSQdbOTlpg
-
-At this point, the author reports the possibility of hiccups with stripped
-binaries. That said, if we can get it to be comparably reliable to QEMU, we may
-decide to switch to this mode, but I had no time to play with it yet.
diff --git a/chromium/third_party/afl/src/qemu_mode/build_qemu_support.sh b/chromium/third_party/afl/src/qemu_mode/build_qemu_support.sh
deleted file mode 100755
index 7224671e5ca..00000000000
--- a/chromium/third_party/afl/src/qemu_mode/build_qemu_support.sh
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/bin/sh
-#
-# american fuzzy lop - QEMU build script
-# --------------------------------------
-#
-# Written by Andrew Griffiths <agriffiths@google.com> and
-# Michal Zalewski <lcamtuf@google.com>
-#
-# Copyright 2015, 2016 Google Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# This script downloads, patches, and builds a version of QEMU with
-# minor tweaks to allow non-instrumented binaries to be run under
-# afl-fuzz.
-#
-# The modifications reside in patches/*. The standalone QEMU binary
-# will be written to ../afl-qemu-trace.
-#
-
-QEMU_URL="http://wiki.qemu-project.org/download/qemu-2.3.0.tar.bz2"
-QEMU_SHA384="7a0f0c900f7e2048463cc32ff3e904965ab466c8428847400a0f2dcfe458108a68012c4fddb2a7e7c822b4fd1a49639b"
-
-echo "================================================="
-echo "AFL binary-only instrumentation QEMU build script"
-echo "================================================="
-echo
-
-echo "[*] Performing basic sanity checks..."
-
-if [ ! "`uname -s`" = "Linux" ]; then
-
- echo "[-] Error: QEMU instrumentation is supported only on Linux."
- exit 1
-
-fi
-
-if [ ! -f "patches/afl-qemu-cpu-inl.h" -o ! -f "../config.h" ]; then
-
- echo "[-] Error: key files not found - wrong working directory?"
- exit 1
-
-fi
-
-if [ ! -f "../afl-showmap" ]; then
-
- echo "[-] Error: ../afl-showmap not found - compile AFL first!"
- exit 1
-
-fi
-
-
-for i in libtool wget python automake autoconf sha384sum bison iconv; do
-
- T=`which "$i" 2>/dev/null`
-
- if [ "$T" = "" ]; then
-
- echo "[-] Error: '$i' not found, please install first."
- exit 1
-
- fi
-
-done
-
-if [ ! -d "/usr/include/glib-2.0/" -a ! -d "/usr/local/include/glib-2.0/" ]; then
-
- echo "[-] Error: devel version of 'glib2' not found, please install first."
- exit 1
-
-fi
-
-if echo "$CC" | grep -qF /afl-; then
-
- echo "[-] Error: do not use afl-gcc or afl-clang to compile this tool."
- exit 1
-
-fi
-
-echo "[+] All checks passed!"
-
-ARCHIVE="`basename -- "$QEMU_URL"`"
-
-CKSUM=`sha384sum -- "$ARCHIVE" 2>/dev/null | cut -d' ' -f1`
-
-if [ ! "$CKSUM" = "$QEMU_SHA384" ]; then
-
- echo "[*] Downloading QEMU 2.3.0 from the web..."
- rm -f "$ARCHIVE"
- wget -O "$ARCHIVE" -- "$QEMU_URL" || exit 1
-
- CKSUM=`sha384sum -- "$ARCHIVE" 2>/dev/null | cut -d' ' -f1`
-
-fi
-
-if [ "$CKSUM" = "$QEMU_SHA384" ]; then
-
- echo "[+] Cryptographic signature on $ARCHIVE checks out."
-
-else
-
- echo "[-] Error: signature mismatch on $ARCHIVE (perhaps download error?)."
- exit 1
-
-fi
-
-echo "[*] Uncompressing archive (this will take a while)..."
-
-rm -rf "qemu-2.3.0" || exit 1
-tar xf "$ARCHIVE" || exit 1
-
-echo "[+] Unpacking successful."
-
-echo "[*] Applying patches..."
-
-patch -p0 <patches/elfload.diff || exit 1
-patch -p0 <patches/cpu-exec.diff || exit 1
-patch -p0 <patches/translate-all.diff || exit 1
-patch -p0 <patches/syscall.diff || exit 1
-
-echo "[+] Patching done."
-
-ORIG_CPU_TARGET="$CPU_TARGET"
-
-test "$CPU_TARGET" = "" && CPU_TARGET="`uname -m`"
-test "$CPU_TARGET" = "i686" && CPU_TARGET="i386"
-
-echo "[*] Configuring QEMU for $CPU_TARGET..."
-
-cd qemu-2.3.0 || exit 1
-
-CFLAGS="-O3" ./configure --disable-system --enable-linux-user \
- --enable-guest-base --disable-gtk --disable-sdl --disable-vnc \
- --target-list="${CPU_TARGET}-linux-user" || exit 1
-
-echo "[+] Configuration complete."
-
-echo "[*] Attempting to build QEMU (fingers crossed!)..."
-
-make || exit 1
-
-echo "[+] Build process successful!"
-
-echo "[*] Copying binary..."
-
-cp -f "${CPU_TARGET}-linux-user/qemu-${CPU_TARGET}" "../../afl-qemu-trace" || exit 1
-
-cd ..
-ls -l ../afl-qemu-trace || exit 1
-
-echo "[+] Successfully created '../afl-qemu-trace'."
-
-if [ "$ORIG_CPU_TARGET" = "" ]; then
-
- echo "[*] Testing the build..."
-
- cd ..
-
- make >/dev/null || exit 1
-
- gcc test-instr.c -o test-instr || exit 1
-
- unset AFL_INST_RATIO
-
- echo 0 | ./afl-showmap -m none -Q -q -o .test-instr0 ./test-instr || exit 1
- echo 1 | ./afl-showmap -m none -Q -q -o .test-instr1 ./test-instr || exit 1
-
- rm -f test-instr
-
- cmp -s .test-instr0 .test-instr1
- DR="$?"
-
- rm -f .test-instr0 .test-instr1
-
- if [ "$DR" = "0" ]; then
-
- echo "[-] Error: afl-qemu-trace instrumentation doesn't seem to work!"
- exit 1
-
- fi
-
- echo "[+] Instrumentation tests passed. "
- echo "[+] All set, you can now use the -Q mode in afl-fuzz!"
-
-else
-
- echo "[!] Note: can't test instrumentation when CPU_TARGET set."
- echo "[+] All set, you can now (hopefully) use the -Q mode in afl-fuzz!"
-
-fi
-
-exit 0
diff --git a/chromium/third_party/afl/src/qemu_mode/patches/afl-qemu-cpu-inl.h b/chromium/third_party/afl/src/qemu_mode/patches/afl-qemu-cpu-inl.h
deleted file mode 100644
index eaa0e67ba0a..00000000000
--- a/chromium/third_party/afl/src/qemu_mode/patches/afl-qemu-cpu-inl.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- american fuzzy lop - high-performance binary-only instrumentation
- -----------------------------------------------------------------
-
- Written by Andrew Griffiths <agriffiths@google.com> and
- Michal Zalewski <lcamtuf@google.com>
-
- Idea & design very much by Andrew Griffiths.
-
- Copyright 2015, 2016 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- This code is a shim patched into the separately-distributed source
- code of QEMU 2.2.0. It leverages the built-in QEMU tracing functionality
- to implement AFL-style instrumentation and to take care of the remaining
- parts of the AFL fork server logic.
-
- The resulting QEMU binary is essentially a standalone instrumentation
- tool; for an example of how to leverage it for other purposes, you can
- have a look at afl-showmap.c.
-
- */
-
-#include <sys/shm.h>
-#include "../../config.h"
-
-/***************************
- * VARIOUS AUXILIARY STUFF *
- ***************************/
-
-/* A snippet patched into tb_find_slow to inform the parent process that
- we have hit a new block that hasn't been translated yet, and to tell
- it to translate within its own context, too (this avoids translation
- overhead in the next forked-off copy). */
-
-#define AFL_QEMU_CPU_SNIPPET1 do { \
- afl_request_tsl(pc, cs_base, flags); \
- } while (0)
-
-/* This snippet kicks in when the instruction pointer is positioned at
- _start and does the usual forkserver stuff, not very different from
- regular instrumentation injected via afl-as.h. */
-
-#define AFL_QEMU_CPU_SNIPPET2 do { \
- if(tb->pc == afl_entry_point) { \
- afl_setup(); \
- afl_forkserver(env); \
- } \
- afl_maybe_log(tb->pc); \
- } while (0)
-
-/* We use one additional file descriptor to relay "needs translation"
- messages between the child and the fork server. */
-
-#define TSL_FD (FORKSRV_FD - 1)
-
-/* This is equivalent to afl-as.h: */
-
-static unsigned char *afl_area_ptr;
-
-/* Exported variables populated by the code patched into elfload.c: */
-
-abi_ulong afl_entry_point, /* ELF entry point (_start) */
- afl_start_code, /* .text start pointer */
- afl_end_code; /* .text end pointer */
-
-/* Set in the child process in forkserver mode: */
-
-static unsigned char afl_fork_child;
-unsigned int afl_forksrv_pid;
-
-/* Instrumentation ratio: */
-
-static unsigned int afl_inst_rms = MAP_SIZE;
-
-/* Function declarations. */
-
-static void afl_setup(void);
-static void afl_forkserver(CPUArchState*);
-static inline void afl_maybe_log(abi_ulong);
-
-static void afl_wait_tsl(CPUArchState*, int);
-static void afl_request_tsl(target_ulong, target_ulong, uint64_t);
-
-static TranslationBlock *tb_find_slow(CPUArchState*, target_ulong,
- target_ulong, uint64_t);
-
-
-/* Data structure passed around by the translate handlers: */
-
-struct afl_tsl {
- target_ulong pc;
- target_ulong cs_base;
- uint64_t flags;
-};
-
-
-/*************************
- * ACTUAL IMPLEMENTATION *
- *************************/
-
-
-/* Set up SHM region and initialize other stuff. */
-
-static void afl_setup(void) {
-
- char *id_str = getenv(SHM_ENV_VAR),
- *inst_r = getenv("AFL_INST_RATIO");
-
- int shm_id;
-
- if (inst_r) {
-
- unsigned int r;
-
- r = atoi(inst_r);
-
- if (r > 100) r = 100;
- if (!r) r = 1;
-
- afl_inst_rms = MAP_SIZE * r / 100;
-
- }
-
- if (id_str) {
-
- shm_id = atoi(id_str);
- afl_area_ptr = shmat(shm_id, NULL, 0);
-
- if (afl_area_ptr == (void*)-1) exit(1);
-
- /* With AFL_INST_RATIO set to a low value, we want to touch the bitmap
- so that the parent doesn't give up on us. */
-
- if (inst_r) afl_area_ptr[0] = 1;
-
-
- }
-
- if (getenv("AFL_INST_LIBS")) {
-
- afl_start_code = 0;
- afl_end_code = (abi_ulong)-1;
-
- }
-
-}
-
-
-/* Fork server logic, invoked once we hit _start. */
-
-static void afl_forkserver(CPUArchState *env) {
-
- static unsigned char tmp[4];
-
- if (!afl_area_ptr) return;
-
- /* Tell the parent that we're alive. If the parent doesn't want
- to talk, assume that we're not running in forkserver mode. */
-
- if (write(FORKSRV_FD + 1, tmp, 4) != 4) return;
-
- afl_forksrv_pid = getpid();
-
- /* All right, let's await orders... */
-
- while (1) {
-
- pid_t child_pid;
- int status, t_fd[2];
-
- /* Whoops, parent dead? */
-
- if (read(FORKSRV_FD, tmp, 4) != 4) exit(2);
-
- /* Establish a channel with child to grab translation commands. We'll
- read from t_fd[0], child will write to TSL_FD. */
-
- if (pipe(t_fd) || dup2(t_fd[1], TSL_FD) < 0) exit(3);
- close(t_fd[1]);
-
- child_pid = fork();
- if (child_pid < 0) exit(4);
-
- if (!child_pid) {
-
- /* Child process. Close descriptors and run free. */
-
- afl_fork_child = 1;
- close(FORKSRV_FD);
- close(FORKSRV_FD + 1);
- close(t_fd[0]);
- return;
-
- }
-
- /* Parent. */
-
- close(TSL_FD);
-
- if (write(FORKSRV_FD + 1, &child_pid, 4) != 4) exit(5);
-
- /* Collect translation requests until child dies and closes the pipe. */
-
- afl_wait_tsl(env, t_fd[0]);
-
- /* Get and relay exit status to parent. */
-
- if (waitpid(child_pid, &status, 0) < 0) exit(6);
- if (write(FORKSRV_FD + 1, &status, 4) != 4) exit(7);
-
- }
-
-}
-
-
-/* The equivalent of the tuple logging routine from afl-as.h. */
-
-static inline void afl_maybe_log(abi_ulong cur_loc) {
-
- static __thread abi_ulong prev_loc;
-
- /* Optimize for cur_loc > afl_end_code, which is the most likely case on
- Linux systems. */
-
- if (cur_loc > afl_end_code || cur_loc < afl_start_code || !afl_area_ptr)
- return;
-
- /* Looks like QEMU always maps to fixed locations, so ASAN is not a
- concern. Phew. But instruction addresses may be aligned. Let's mangle
- the value to get something quasi-uniform. */
-
- cur_loc = (cur_loc >> 4) ^ (cur_loc << 8);
- cur_loc &= MAP_SIZE - 1;
-
- /* Implement probabilistic instrumentation by looking at scrambled block
- address. This keeps the instrumented locations stable across runs. */
-
- if (cur_loc >= afl_inst_rms) return;
-
- afl_area_ptr[cur_loc ^ prev_loc]++;
- prev_loc = cur_loc >> 1;
-
-}
-
-
-/* This code is invoked whenever QEMU decides that it doesn't have a
- translation of a particular block and needs to compute it. When this happens,
- we tell the parent to mirror the operation, so that the next fork() has a
- cached copy. */
-
-static void afl_request_tsl(target_ulong pc, target_ulong cb, uint64_t flags) {
-
- struct afl_tsl t;
-
- if (!afl_fork_child) return;
-
- t.pc = pc;
- t.cs_base = cb;
- t.flags = flags;
-
- if (write(TSL_FD, &t, sizeof(struct afl_tsl)) != sizeof(struct afl_tsl))
- return;
-
-}
-
-
-/* This is the other side of the same channel. Since timeouts are handled by
- afl-fuzz simply killing the child, we can just wait until the pipe breaks. */
-
-static void afl_wait_tsl(CPUArchState *env, int fd) {
-
- struct afl_tsl t;
-
- while (1) {
-
- /* Broken pipe means it's time to return to the fork server routine. */
-
- if (read(fd, &t, sizeof(struct afl_tsl)) != sizeof(struct afl_tsl))
- break;
-
- tb_find_slow(env, t.pc, t.cs_base, t.flags);
-
- }
-
- close(fd);
-
-}
-
diff --git a/chromium/third_party/afl/src/qemu_mode/patches/cpu-exec.diff b/chromium/third_party/afl/src/qemu_mode/patches/cpu-exec.diff
deleted file mode 100644
index f7085cd253d..00000000000
--- a/chromium/third_party/afl/src/qemu_mode/patches/cpu-exec.diff
+++ /dev/null
@@ -1,33 +0,0 @@
---- qemu-2.3.0/cpu-exec.c.orig 2014-12-09 14:45:40.000000000 +0000
-+++ qemu-2.3.0/cpu-exec.c 2015-02-20 22:07:02.966000000 +0000
-@@ -28,6 +28,8 @@
- #include "exec/memory-internal.h"
- #include "qemu/rcu.h"
-
-+#include "../patches/afl-qemu-cpu-inl.h"
-+
- /* -icount align implementation. */
-
- typedef struct SyncClocks {
-@@ -296,8 +298,11 @@
- }
- not_found:
- /* if no translated code available, then translate it now */
-+
- tb = tb_gen_code(cpu, pc, cs_base, flags, 0);
-
-+ AFL_QEMU_CPU_SNIPPET1;
-+
- found:
- /* Move the last found TB to the head of the list */
- if (likely(*ptb1)) {
-@@ -492,6 +497,9 @@
- next_tb = 0;
- tcg_ctx.tb_ctx.tb_invalidated_flag = 0;
- }
-+
-+ AFL_QEMU_CPU_SNIPPET2;
-+
- if (qemu_loglevel_mask(CPU_LOG_EXEC)) {
- qemu_log("Trace %p [" TARGET_FMT_lx "] %s\n",
- tb->tc_ptr, tb->pc, lookup_symbol(tb->pc));
diff --git a/chromium/third_party/afl/src/qemu_mode/patches/elfload.diff b/chromium/third_party/afl/src/qemu_mode/patches/elfload.diff
deleted file mode 100644
index 325c917d15a..00000000000
--- a/chromium/third_party/afl/src/qemu_mode/patches/elfload.diff
+++ /dev/null
@@ -1,32 +0,0 @@
---- qemu-2.3.0/linux-user/elfload.c.orig 2014-12-09 14:45:42.000000000 +0000
-+++ qemu-2.3.0/linux-user/elfload.c 2015-01-28 02:51:23.719000000 +0000
-@@ -28,6 +28,8 @@
-
- #define ELF_OSABI ELFOSABI_SYSV
-
-+extern abi_ulong afl_entry_point, afl_start_code, afl_end_code;
-+
- /* from personality.h */
-
- /*
-@@ -1889,6 +1891,8 @@
- info->brk = 0;
- info->elf_flags = ehdr->e_flags;
-
-+ if (!afl_entry_point) afl_entry_point = info->entry;
-+
- for (i = 0; i < ehdr->e_phnum; i++) {
- struct elf_phdr *eppnt = phdr + i;
- if (eppnt->p_type == PT_LOAD) {
-@@ -1922,9 +1926,11 @@
- if (elf_prot & PROT_EXEC) {
- if (vaddr < info->start_code) {
- info->start_code = vaddr;
-+ if (!afl_start_code) afl_start_code = vaddr;
- }
- if (vaddr_ef > info->end_code) {
- info->end_code = vaddr_ef;
-+ if (!afl_end_code) afl_end_code = vaddr_ef;
- }
- }
- if (elf_prot & PROT_WRITE) {
diff --git a/chromium/third_party/afl/src/qemu_mode/patches/syscall.diff b/chromium/third_party/afl/src/qemu_mode/patches/syscall.diff
deleted file mode 100644
index 75d39386164..00000000000
--- a/chromium/third_party/afl/src/qemu_mode/patches/syscall.diff
+++ /dev/null
@@ -1,25 +0,0 @@
---- qemu-2.3.0/linux-user/syscall.c.orig 2014-12-09 14:45:43.000000000 +0000
-+++ qemu-2.3.0/linux-user/syscall.c 2015-03-27 06:33:00.736000000 +0000
-@@ -227,7 +227,21 @@
- _syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo)
- _syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
- #if defined(TARGET_NR_tgkill) && defined(__NR_tgkill)
--_syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
-+
-+extern unsigned int afl_forksrv_pid;
-+
-+static int sys_tgkill(int tgid, int pid, int sig) {
-+
-+ /* Workaround for -lpthread to make abort() work properly, without
-+ killing the forkserver due to a prematurely cached PID. */
-+
-+ if (afl_forksrv_pid && afl_forksrv_pid == pid && sig == SIGABRT)
-+ pid = tgid = getpid();
-+
-+ return syscall(__NR_sys_tgkill, pid, tgid, sig);
-+
-+}
-+
- #endif
- #if defined(TARGET_NR_tkill) && defined(__NR_tkill)
- _syscall2(int,sys_tkill,int,tid,int,sig)
diff --git a/chromium/third_party/afl/src/qemu_mode/patches/translate-all.diff b/chromium/third_party/afl/src/qemu_mode/patches/translate-all.diff
deleted file mode 100644
index 180b3a55ab2..00000000000
--- a/chromium/third_party/afl/src/qemu_mode/patches/translate-all.diff
+++ /dev/null
@@ -1,18 +0,0 @@
---- qemu-2.3.0/translate-all.c.orig 2014-12-09 14:45:46.000000000 +0000
-+++ qemu-2.3.0/translate-all.c 2015-01-28 22:37:42.383000000 +0000
-@@ -393,8 +393,13 @@
- /* We can't use g_malloc because it may recurse into a locked mutex. */
- # define ALLOC(P, SIZE) \
- do { \
-- P = mmap(NULL, SIZE, PROT_READ | PROT_WRITE, \
-- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \
-+ void* _tmp = mmap(NULL, SIZE, PROT_READ | PROT_WRITE, \
-+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \
-+ if (_tmp == (void*)-1) { \
-+ qemu_log(">>> Out of memory for stack, bailing out. <<<\n"); \
-+ exit(1); \
-+ } \
-+ (P) = _tmp; \
- } while (0)
- #else
- # define ALLOC(P, SIZE) \
diff --git a/chromium/third_party/afl/src/test-instr.c b/chromium/third_party/afl/src/test-instr.c
deleted file mode 100644
index 09a1c9f700f..00000000000
--- a/chromium/third_party/afl/src/test-instr.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- american fuzzy lop - a trivial program to test the build
- --------------------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2014 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main(int argc, char** argv) {
-
- char buf[8];
-
- if (read(0, buf, 8) < 1) {
- printf("Hum?\n");
- exit(1);
- }
-
- if (buf[0] == '0')
- printf("Looks like a zero to me!\n");
- else
- printf("A non-zero value? How quaint!\n");
-
- exit(0);
-
-}
diff --git a/chromium/third_party/afl/src/testcases/README.testcases b/chromium/third_party/afl/src/testcases/README.testcases
deleted file mode 100644
index 30110ba1a66..00000000000
--- a/chromium/third_party/afl/src/testcases/README.testcases
+++ /dev/null
@@ -1,19 +0,0 @@
-=======================
-AFL starting test cases
-=======================
-
- (See ../docs/README for the general instruction manual.)
-
-The archives/, images/, multimedia/, and others/ subdirectories contain small,
-standalone files that can be used to seed afl-fuzz when testing parsers for a
-variety of common data formats.
-
-There is probably not much to be said about these files, except that they were
-optimized for size and stripped of any non-essential fluff. Some directories
-contain several examples that exercise various features of the underlying format.
-For example, there is a PNG file with and without a color profile.
-
-Additional test cases are always welcome.
-
-In addition to well-chosen starting files, many fuzzing jobs benefit from a
-small and concise dictionary. See ../dictionaries/README.dictionaries for more.
diff --git a/chromium/third_party/afl/src/testcases/archives/common/ar/small_archive.a b/chromium/third_party/afl/src/testcases/archives/common/ar/small_archive.a
deleted file mode 100644
index 8c50bc28937..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/ar/small_archive.a
+++ /dev/null
@@ -1,8 +0,0 @@
-!<arch>
-limerick/ 1415337776 500 500 100640 191 `
-There was a young man from Japan
-Whose limericks never would scan.
-When asked why that was,
-He replied "It's because
-I always try to cram as many words into the last line as I possibly can."
-
diff --git a/chromium/third_party/afl/src/testcases/archives/common/bzip2/small_archive.bz2 b/chromium/third_party/afl/src/testcases/archives/common/bzip2/small_archive.bz2
deleted file mode 100644
index 83914ad249a..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/bzip2/small_archive.bz2
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/cab/small_archive.cab b/chromium/third_party/afl/src/testcases/archives/common/cab/small_archive.cab
deleted file mode 100644
index 3f429043b39..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/cab/small_archive.cab
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/compress/small_archive.Z b/chromium/third_party/afl/src/testcases/archives/common/compress/small_archive.Z
deleted file mode 100644
index 73bf3151c10..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/compress/small_archive.Z
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/cpio/small_archive.cpio b/chromium/third_party/afl/src/testcases/archives/common/cpio/small_archive.cpio
deleted file mode 100644
index d1ee8a2cf0f..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/cpio/small_archive.cpio
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/gzip/small_archive.gz b/chromium/third_party/afl/src/testcases/archives/common/gzip/small_archive.gz
deleted file mode 100644
index 4a6cd8e15bc..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/gzip/small_archive.gz
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/lzo/small_archive.lzo b/chromium/third_party/afl/src/testcases/archives/common/lzo/small_archive.lzo
deleted file mode 100644
index bf310368e9c..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/lzo/small_archive.lzo
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/rar/small_archive.rar b/chromium/third_party/afl/src/testcases/archives/common/rar/small_archive.rar
deleted file mode 100644
index a5aae4ceb94..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/rar/small_archive.rar
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/tar/small_archive.tar b/chromium/third_party/afl/src/testcases/archives/common/tar/small_archive.tar
deleted file mode 100644
index 8f694fdef97..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/tar/small_archive.tar
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/xz/small_archive.xz b/chromium/third_party/afl/src/testcases/archives/common/xz/small_archive.xz
deleted file mode 100644
index f30df04f8b9..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/xz/small_archive.xz
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/common/zip/small_archive.zip b/chromium/third_party/afl/src/testcases/archives/common/zip/small_archive.zip
deleted file mode 100644
index dc7992cdcfc..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/common/zip/small_archive.zip
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/exotic/arj/small_archive.arj b/chromium/third_party/afl/src/testcases/archives/exotic/arj/small_archive.arj
deleted file mode 100644
index 8bcd12ebe1c..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/exotic/arj/small_archive.arj
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/exotic/lha/small_archive.lha b/chromium/third_party/afl/src/testcases/archives/exotic/lha/small_archive.lha
deleted file mode 100644
index e70f325bbe5..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/exotic/lha/small_archive.lha
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/exotic/lrzip/small_archive.lrz b/chromium/third_party/afl/src/testcases/archives/exotic/lrzip/small_archive.lrz
deleted file mode 100644
index 1a0415f1036..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/exotic/lrzip/small_archive.lrz
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/exotic/lzip/small_archive.lz b/chromium/third_party/afl/src/testcases/archives/exotic/lzip/small_archive.lz
deleted file mode 100644
index 89e2448ede6..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/exotic/lzip/small_archive.lz
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/exotic/lzma/small_archive.lzma b/chromium/third_party/afl/src/testcases/archives/exotic/lzma/small_archive.lzma
deleted file mode 100644
index bbd056a5ff3..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/exotic/lzma/small_archive.lzma
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/exotic/rzip/small_archive.rz b/chromium/third_party/afl/src/testcases/archives/exotic/rzip/small_archive.rz
deleted file mode 100644
index d1950c4b7f6..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/exotic/rzip/small_archive.rz
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/archives/exotic/zoo/small_archive.zoo b/chromium/third_party/afl/src/testcases/archives/exotic/zoo/small_archive.zoo
deleted file mode 100644
index 1614e5fbf24..00000000000
--- a/chromium/third_party/afl/src/testcases/archives/exotic/zoo/small_archive.zoo
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/bmp/not_kitty.bmp b/chromium/third_party/afl/src/testcases/images/bmp/not_kitty.bmp
deleted file mode 100644
index 0309c928395..00000000000
--- a/chromium/third_party/afl/src/testcases/images/bmp/not_kitty.bmp
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/gif/not_kitty.gif b/chromium/third_party/afl/src/testcases/images/gif/not_kitty.gif
deleted file mode 100644
index 244fcc64524..00000000000
--- a/chromium/third_party/afl/src/testcases/images/gif/not_kitty.gif
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/ico/not_kitty.ico b/chromium/third_party/afl/src/testcases/images/ico/not_kitty.ico
deleted file mode 100644
index d2bb2916e7f..00000000000
--- a/chromium/third_party/afl/src/testcases/images/ico/not_kitty.ico
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/jp2/not_kitty.jp2 b/chromium/third_party/afl/src/testcases/images/jp2/not_kitty.jp2
deleted file mode 100644
index 14bca2924a0..00000000000
--- a/chromium/third_party/afl/src/testcases/images/jp2/not_kitty.jp2
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/jpeg/not_kitty.jpg b/chromium/third_party/afl/src/testcases/images/jpeg/not_kitty.jpg
deleted file mode 100644
index 0497be49f57..00000000000
--- a/chromium/third_party/afl/src/testcases/images/jpeg/not_kitty.jpg
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/jxr/not_kitty.jxr b/chromium/third_party/afl/src/testcases/images/jxr/not_kitty.jxr
deleted file mode 100644
index 0fa2c8ec019..00000000000
--- a/chromium/third_party/afl/src/testcases/images/jxr/not_kitty.jxr
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/png/not_kitty.png b/chromium/third_party/afl/src/testcases/images/png/not_kitty.png
deleted file mode 100644
index eff7c1707b9..00000000000
--- a/chromium/third_party/afl/src/testcases/images/png/not_kitty.png
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/png/not_kitty_alpha.png b/chromium/third_party/afl/src/testcases/images/png/not_kitty_alpha.png
deleted file mode 100644
index 2fb8da2c8f5..00000000000
--- a/chromium/third_party/afl/src/testcases/images/png/not_kitty_alpha.png
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/png/not_kitty_gamma.png b/chromium/third_party/afl/src/testcases/images/png/not_kitty_gamma.png
deleted file mode 100644
index 939d9d29a9b..00000000000
--- a/chromium/third_party/afl/src/testcases/images/png/not_kitty_gamma.png
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/png/not_kitty_icc.png b/chromium/third_party/afl/src/testcases/images/png/not_kitty_icc.png
deleted file mode 100644
index f0c7804d998..00000000000
--- a/chromium/third_party/afl/src/testcases/images/png/not_kitty_icc.png
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/tiff/not_kitty.tiff b/chromium/third_party/afl/src/testcases/images/tiff/not_kitty.tiff
deleted file mode 100644
index 506ca1ad4b5..00000000000
--- a/chromium/third_party/afl/src/testcases/images/tiff/not_kitty.tiff
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/images/webp/not_kitty.webp b/chromium/third_party/afl/src/testcases/images/webp/not_kitty.webp
deleted file mode 100644
index 8592d823645..00000000000
--- a/chromium/third_party/afl/src/testcases/images/webp/not_kitty.webp
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/multimedia/h264/small_movie.mp4 b/chromium/third_party/afl/src/testcases/multimedia/h264/small_movie.mp4
deleted file mode 100644
index adc6c9cb799..00000000000
--- a/chromium/third_party/afl/src/testcases/multimedia/h264/small_movie.mp4
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/others/js/small_script.js b/chromium/third_party/afl/src/testcases/others/js/small_script.js
deleted file mode 100644
index bb632d8a977..00000000000
--- a/chromium/third_party/afl/src/testcases/others/js/small_script.js
+++ /dev/null
@@ -1 +0,0 @@
-if (1==1) eval('1'); \ No newline at end of file
diff --git a/chromium/third_party/afl/src/testcases/others/pcap/small_capture.pcap b/chromium/third_party/afl/src/testcases/others/pcap/small_capture.pcap
deleted file mode 100644
index 60e2210ba54..00000000000
--- a/chromium/third_party/afl/src/testcases/others/pcap/small_capture.pcap
+++ /dev/null
Binary files differ
diff --git a/chromium/third_party/afl/src/testcases/others/pdf/small.pdf b/chromium/third_party/afl/src/testcases/others/pdf/small.pdf
deleted file mode 100644
index d31b4eb2c6a..00000000000
--- a/chromium/third_party/afl/src/testcases/others/pdf/small.pdf
+++ /dev/null
@@ -1,2 +0,0 @@
-%PDF-1.0
-1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj 2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj 3 0 obj<</Type/Page/MediaBox[0 0 3 3]>>endobj trailer<</Size 4/Root 1 0 R>> \ No newline at end of file
diff --git a/chromium/third_party/afl/src/testcases/others/rtf/small_document.rtf b/chromium/third_party/afl/src/testcases/others/rtf/small_document.rtf
deleted file mode 100644
index 0fdedc3233d..00000000000
--- a/chromium/third_party/afl/src/testcases/others/rtf/small_document.rtf
+++ /dev/null
@@ -1 +0,0 @@
-{\rtf1\pard Test\par} \ No newline at end of file
diff --git a/chromium/third_party/afl/src/testcases/others/sql/simple_queries.sql b/chromium/third_party/afl/src/testcases/others/sql/simple_queries.sql
deleted file mode 100644
index 5fff40727f5..00000000000
--- a/chromium/third_party/afl/src/testcases/others/sql/simple_queries.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-create table t1(one smallint);
-insert into t1 values(1);
-select * from t1;
diff --git a/chromium/third_party/afl/src/testcases/others/text/hello_world.txt b/chromium/third_party/afl/src/testcases/others/text/hello_world.txt
deleted file mode 100644
index ce013625030..00000000000
--- a/chromium/third_party/afl/src/testcases/others/text/hello_world.txt
+++ /dev/null
@@ -1 +0,0 @@
-hello
diff --git a/chromium/third_party/afl/src/testcases/others/xml/small_document.xml b/chromium/third_party/afl/src/testcases/others/xml/small_document.xml
deleted file mode 100644
index 684e28466d9..00000000000
--- a/chromium/third_party/afl/src/testcases/others/xml/small_document.xml
+++ /dev/null
@@ -1 +0,0 @@
-<a b="c">d</a>
diff --git a/chromium/third_party/afl/src/types.h b/chromium/third_party/afl/src/types.h
deleted file mode 100644
index 21d32da6156..00000000000
--- a/chromium/third_party/afl/src/types.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- american fuzzy lop - type definitions and minor macros
- ------------------------------------------------------
-
- Written and maintained by Michal Zalewski <lcamtuf@google.com>
-
- Copyright 2013, 2014, 2015 Google Inc. All rights reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at:
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- */
-
-#ifndef _HAVE_TYPES_H
-#define _HAVE_TYPES_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-typedef uint8_t u8;
-typedef uint16_t u16;
-typedef uint32_t u32;
-
-/*
-
- Ugh. There is an unintended compiler / glibc #include glitch caused by
- combining the u64 type an %llu in format strings, necessitating a workaround.
-
- In essence, the compiler is always looking for 'unsigned long long' for %llu.
- On 32-bit systems, the u64 type (aliased to uint64_t) is expanded to
- 'unsigned long long' in <bits/types.h>, so everything checks out.
-
- But on 64-bit systems, it is #ifdef'ed in the same file as 'unsigned long'.
- Now, it only happens in circumstances where the type happens to have the
- expected bit width, *but* the compiler does not know that... and complains
- about 'unsigned long' being unsafe to pass to %llu.
-
- */
-
-#ifdef __x86_64__
-typedef unsigned long long u64;
-#else
-typedef uint64_t u64;
-#endif /* ^__x86_64__ */
-
-typedef int8_t s8;
-typedef int16_t s16;
-typedef int32_t s32;
-typedef int64_t s64;
-
-#ifndef MIN
-# define MIN(_a,_b) ((_a) > (_b) ? (_b) : (_a))
-# define MAX(_a,_b) ((_a) > (_b) ? (_a) : (_b))
-#endif /* !MIN */
-
-#define SWAP16(_x) ({ \
- u16 _ret = (_x); \
- (u16)((_ret << 8) | (_ret >> 8)); \
- })
-
-#define SWAP32(_x) ({ \
- u32 _ret = (_x); \
- (u32)((_ret << 24) | (_ret >> 24) | \
- ((_ret << 8) & 0x00FF0000) | \
- ((_ret >> 8) & 0x0000FF00)); \
- })
-
-#define R(x) (random() % (x))
-
-#define STRINGIFY_INTERNAL(x) #x
-#define STRINGIFY(x) STRINGIFY_INTERNAL(x)
-
-#define MEM_BARRIER() \
- asm volatile("" ::: "memory")
-
-#define likely(_x) __builtin_expect(!!(_x), 1)
-#define unlikely(_x) __builtin_expect(!!(_x), 0)
-
-#endif /* ! _HAVE_TYPES_H */
diff --git a/chromium/third_party/afl/update.py b/chromium/third_party/afl/update.py
deleted file mode 100755
index 0dd8df90a34..00000000000
--- a/chromium/third_party/afl/update.py
+++ /dev/null
@@ -1,181 +0,0 @@
-#! /usr/bin/env python
-# Copyright (c) 2016 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.
-
-"""Script for updating AFL. Also updates AFL version in README.chromium.
-"""
-
-import argparse
-import cStringIO
-import datetime
-import os
-import re
-import sys
-import tarfile
-import urllib2
-
-
-VERSION_REGEX = r'(?P<version>([0-9]*[.])?[0-9]+b)'
-PATH_REGEX = r'(afl-)' + VERSION_REGEX
-
-
-class ChromiumReadme(object):
- """Class that handles reading from and updating the README.chromium"""
-
- README_FILE_PATH = 'third_party/afl/README.chromium'
- README_VERSION_REGEX = r'Version: ' + VERSION_REGEX
-
- def __init__(self):
- """
- Inits the ChromiumReadme.
- """
- with open(self.README_FILE_PATH) as readme_file_handle:
- self.readme_contents = readme_file_handle.read()
-
- def get_current_version(self):
- """
- Get the current version of AFL according to the README.chromium
- """
- match = re.search(self.README_VERSION_REGEX, self.readme_contents)
- if not match:
- raise Exception('Could not determine current AFL version')
- return match.groupdict()['version']
-
- def update(self, new_version):
- """
- Update the readme to reflect the new version that has been downloaded.
- """
- new_readme = self.readme_contents
- subsitutions = [(VERSION_REGEX, new_version), # Update the version.
- (r'Date: .*',
- 'Date: ' + datetime.date.today().strftime("%B %d, %Y")),
- # Update the Local Modifications.
- (PATH_REGEX + r'/', 'afl-' + new_version + '/')]
-
- for regex, replacement in subsitutions:
- new_readme = re.subn(regex, replacement, new_readme, 1)[0]
-
- self.readme_contents = new_readme
- with open(self.README_FILE_PATH, 'w+') as readme_file_handle:
- readme_file_handle.write(self.readme_contents)
-
-
-class AflTarball(object):
- """
- Class that handles the afl-latest.tgz tarball.
- """
- # Regexes that match files that we don't want to extract.
- # Note that you should add these removals to "Local Modifications" in
- # the README.chromium.
- UNWANTED_FILE_REGEX = '|'.join([
- r'(.*\.elf)', # presubmit complains these aren't marked executable.
- r'(.*others/elf)', # We don't need this if we have no elfs.
- # checkdeps complains about #includes.
- r'(.*afl-llvm-pass\.so\.cc)',
- r'(.*argv.*)', # Delete the demo's directory as well.
-
- r'(.*dictionaries.*)', # Including these make builds fail.
- ])
- AFL_SRC_DIR = 'third_party/afl/src'
-
- def __init__(self, version):
- """
- Init this AFL tarball.
- """
- release_name = 'afl-{0}'.format(version)
- filename = '{0}.tgz'.format(release_name)
-
- # Note: lcamtuf.coredump.cx does not support TLS connections. The "http://"
- # protocol is intentional.
- self.url = "http://lcamtuf.coredump.cx/afl/releases/{0}".format(filename)
- self.tarball = None
- self.real_version = version if version != 'latest' else None
-
- def download(self):
- """Download the tarball version from
- http://lcamtuf.coredump.cx/afl/releases/
- """
- tarball_contents = urllib2.urlopen(self.url).read()
- tarball_file = cStringIO.StringIO(tarball_contents)
- self.tarball = tarfile.open(fileobj=tarball_file, mode="r:gz")
- if self.real_version is None:
- regex_match = re.search(VERSION_REGEX, self.tarball.members[0].path)
- self.real_version = regex_match.groupdict()['version']
-
- def extract(self):
- """
- Extract the files and folders from the tarball we have downloaded while
- skipping unwanted ones.
- """
-
- for member in self.tarball.getmembers():
- member.path = re.sub(PATH_REGEX, self.AFL_SRC_DIR, member.path)
- if re.match(self.UNWANTED_FILE_REGEX, member.path):
- print 'skipping unwanted file: {0}'.format(member.path)
- continue
- self.tarball.extract(member)
-
-
-def version_to_float(version):
- """
- Convert version string to float.
- """
- if version.endswith('b'):
- return float(version[:-1])
-
- return float(version)
-
-
-def update_afl(new_version):
- """
- Update this version of AFL to newer version, new_version.
- """
- readme = ChromiumReadme()
- old_version = readme.get_current_version()
- if new_version != 'latest':
- new_float = version_to_float(new_version)
- assert version_to_float(old_version) < new_float, (
- 'Trying to update from version {0} to {1}'.format(old_version,
- new_version))
-
- # Extract the tarball.
- tarball = AflTarball(new_version)
- tarball.download()
- current_less_than_new = version_to_float(old_version) < version_to_float(
- tarball.real_version)
- assert current_less_than_new, (
- 'Trying to update from version {0} to {1}'.format(old_version,
- tarball.real_version))
-
- tarball.extract()
-
- readme.update(tarball.real_version)
-
-
-def main():
- """
- Update AFL if possible.
- """
- parser = argparse.ArgumentParser('Update AFL.')
- parser.add_argument('version', metavar='version', default='latest', nargs='?',
- help='(optional) Version to update AFL to.')
-
- args = parser.parse_args()
- version = args.version
- if version != 'latest' and not version.endswith('b'):
- version += 'b'
-
- in_correct_directory = (os.path.basename(os.getcwd()) == 'src' and
- os.path.exists('third_party'))
-
- assert in_correct_directory, (
- '{0} must be run from the repo\'s root'.format(sys.argv[0]))
-
- update_afl(version)
- print ("Run git diff third_party/afl/src/docs/ChangeLog to see changes to AFL"
- " since the last roll")
-
-
-if __name__ == '__main__':
- main()
diff --git a/chromium/third_party/cros_system_api/dbus/authpolicy/active_directory_account_data.proto b/chromium/third_party/cros_system_api/dbus/authpolicy/active_directory_account_data.proto
deleted file mode 100644
index 79325f635cd..00000000000
--- a/chromium/third_party/cros_system_api/dbus/authpolicy/active_directory_account_data.proto
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2017 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.
-
-syntax = "proto2";
-
-option optimize_for = LITE_RUNTIME;
-
-package authpolicy;
-
-// TODO(ljusten): Remove this file as soon as Chrome uses
-// active_directory_info.proto. crbug.com/712720.
-
-// Message sent to Chromium by authpolicy service as a response of successful
-// AuthenticateUser call. Contains information about authenticated user fetched
-// from Active Directory server.
-message ActiveDirectoryAccountData {
- // Unique id of the user account. Taken from the objectGUID property of the
- // Active Directory user account information.
- optional string account_id = 1;
- // Display name of the user. Taken from the displayName property of the Active
- // account information.
- optional string display_name = 2;
- // Given name of the user. AKA first name. Taken from givenName property of
- // the Active Directory user account information.
- optional string given_name = 3;
- // Logon name of the user (without @realm). Taken from the sAMAccountName
- // property of the Active Directory user account information.
- optional string sam_account_name = 4;
-}
diff --git a/chromium/third_party/cros_system_api/dbus/authpolicy/active_directory_info.proto b/chromium/third_party/cros_system_api/dbus/authpolicy/active_directory_info.proto
deleted file mode 100644
index 90c1047c102..00000000000
--- a/chromium/third_party/cros_system_api/dbus/authpolicy/active_directory_info.proto
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2017 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.
-
-syntax = "proto2";
-
-option optimize_for = LITE_RUNTIME;
-
-package authpolicy;
-
-// Message sent to Chromium by authpolicy service as a response of a successful
-// AuthenticateUser call. Contains information about authenticated user fetched
-// from Active Directory server with "net ads search ...".
-message ActiveDirectoryAccountInfo {
- // Unique id of the user account. Taken from the objectGUID property of the
- // Active Directory user account information.
- optional string account_id = 1;
- // Display name of the user. Taken from the displayName property of the Active
- // account information.
- optional string display_name = 2;
- // Given name of the user. AKA first name. Taken from the givenName property
- // of the Active Directory user account information.
- optional string given_name = 3;
- // Logon name of the user (without @realm). Taken from the sAMAccountName
- // property of the Active Directory user account information.
- optional string sam_account_name = 4;
- // Timestamp when the password was last set, see
- // https://msdn.microsoft.com/en-us/library/ms679430(v=vs.85).aspx. Taken from
- // the pwdLastSet property of the Active Directory user account information.
- // Used in authpolicyd only, unused in Chrome.
- optional uint64 pwd_last_set = 5;
- // User account control flags, see
- // https://msdn.microsoft.com/en-us/library/ms680832(v=vs.85).aspx. Taken from
- // the userAccountControl property of the Active Directory user account
- // information. Used in authpolicyd only, unused in Chrome.
- optional uint32 user_account_control = 6;
- // Next ID to use: 7
-}
-
-// Message sent to Chromium by authpolicy service as a response to a successful
-// GetUserStatus call.
-message ActiveDirectoryUserStatus {
- // Ticket-granting-ticket status.
- enum TgtStatus {
- TGT_VALID = 0; // Ticket is still valid.
- TGT_EXPIRED = 1; // Ticket expired.
- TGT_NOT_FOUND = 2; // Kerberos credentials cache not found.
- // Next ID to use: 3
- }
-
- // Whether the password has to be changed or sync'ed with cryptohome.
- enum PasswordStatus {
- PASSWORD_VALID = 0; // Valid as far as we can tell.
- PASSWORD_EXPIRED = 1; // User has to enter a new password on next logon.
- PASSWORD_CHANGED = 2; // Changed on server, possibly from other client.
- // Next ID to use: 3
- }
-
- // User's account information, see above.
- optional ActiveDirectoryAccountInfo account_info = 1;
- // Status of the user's ticket-granting-ticket (TGT).
- optional TgtStatus tgt_status = 2;
- // Status of the user's password.
- optional PasswordStatus password_status = 3;
- // Last error returned from AuthenticateUser D-Bus call, see ErrorType.
- optional int32 last_auth_error = 4;
- // Next ID to use: 5
-}
diff --git a/chromium/third_party/cros_system_api/dbus/authpolicy/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/authpolicy/dbus-constants.h
index 2716728ebcc..4e39b889d5d 100644
--- a/chromium/third_party/cros_system_api/dbus/authpolicy/dbus-constants.h
+++ b/chromium/third_party/cros_system_api/dbus/authpolicy/dbus-constants.h
@@ -6,80 +6,39 @@
#define SYSTEM_API_DBUS_AUTHPOLICY_DBUS_CONSTANTS_H_
namespace authpolicy {
-
const char kAuthPolicyInterface[] = "org.chromium.AuthPolicy";
const char kAuthPolicyServicePath[] = "/org/chromium/AuthPolicy";
const char kAuthPolicyServiceName[] = "org.chromium.AuthPolicy";
// Methods
const char kAuthPolicyAuthenticateUser[] = "AuthenticateUser";
-const char kAuthPolicyGetUserStatus[] = "GetUserStatus";
const char kAuthPolicyJoinADDomain[] = "JoinADDomain";
const char kAuthPolicyRefreshUserPolicy[] = "RefreshUserPolicy";
const char kAuthPolicyRefreshDevicePolicy[] = "RefreshDevicePolicy";
-// D-Bus call error codes. These values are written to logs. New enum values can
-// be added, but existing enums must never be renumbered or deleted and reused.
-enum ErrorType {
- // Everything is A-OK!
- ERROR_NONE = 0,
- // Unspecified error.
- ERROR_UNKNOWN = 1,
- // Unspecified D-Bus error.
- ERROR_DBUS_FAILURE = 2,
- // Badly formatted user principal name.
- ERROR_PARSE_UPN_FAILED = 3,
- // Auth failed because of bad user name.
- ERROR_BAD_USER_NAME = 4,
- // Auth failed because of bad password.
- ERROR_BAD_PASSWORD = 5,
- // Auth failed because of expired password.
- ERROR_PASSWORD_EXPIRED = 6,
- // Auth failed because of bad realm or network.
- ERROR_CANNOT_RESOLVE_KDC = 7,
- // kinit exited with unspecified error.
- ERROR_KINIT_FAILED = 8,
- // net exited with unspecified error.
- ERROR_NET_FAILED = 9,
- // smdclient exited with unspecified error.
- ERROR_SMBCLIENT_FAILED = 10,
- // authpolicy_parser exited with unknown error.
- ERROR_PARSE_FAILED = 11,
- // Parsing GPOs failed.
- ERROR_PARSE_PREG_FAILED = 12,
- // GPO data is bad.
- ERROR_BAD_GPOS = 13,
- // Some local IO operation failed.
- ERROR_LOCAL_IO = 14,
- // Machine is not joined to AD domain yet.
- ERROR_NOT_JOINED = 15,
- // User is not logged in yet.
- ERROR_NOT_LOGGED_IN = 16,
- // Failed to send policy to Session Manager.
- ERROR_STORE_POLICY_FAILED = 17,
- // User doesn't have the right to join machines to the domain.
- ERROR_JOIN_ACCESS_DENIED = 18,
- // General network problem.
- ERROR_NETWORK_PROBLEM = 19,
- // Machine name contains restricted characters.
- ERROR_INVALID_MACHINE_NAME = 20,
- // Machine name too long.
- ERROR_MACHINE_NAME_TOO_LONG = 21,
- // User joined maximum number of machines to the domain.
- ERROR_USER_HIT_JOIN_QUOTA = 22,
- // Kinit or smbclient failed to contact Key Distribution Center.
- ERROR_CONTACTING_KDC_FAILED = 23,
- // Kerberos credentials cache not found.
- ERROR_NO_CREDENTIALS_CACHE_FOUND = 24,
- // Kerberos ticket expired while renewing credentials.
- ERROR_KERBEROS_TICKET_EXPIRED = 25,
- // Klist exited with unspecified error.
- ERROR_KLIST_FAILED = 26,
- // Kinit failed because of bad machine name.
- ERROR_BAD_MACHINE_NAME = 27,
- // Should be the last.
- ERROR_COUNT,
+// Enum values.
+enum ADJoinErrorType {
+ AD_JOIN_ERROR_NONE = 0,
+ AD_JOIN_ERROR_UNKNOWN = 1,
+ AD_JOIN_ERROR_DBUS_FAILURE = 2,
+};
+
+enum AuthUserErrorType {
+ AUTH_USER_ERROR_NONE = 0,
+ AUTH_USER_ERROR_UNKNOWN = 1,
+ AUTH_USER_ERROR_DBUS_FAILURE = 2,
};
-} // namespace authpolicy
+enum RefreshUserPolicyErrorType {
+ REFRESH_USER_POLICY_ERROR_NONE = 0,
+ REFRESH_USER_POLICY_ERROR_UNKNOWN = 1,
+ REFRESH_USER_POLICY_ERROR_DBUS_FAILURE = 2,
+};
+
+enum RefreshDevicePolicyErrorType {
+ REFRESH_DEVICE_POLICY_ERROR_NONE = 0,
+ REFRESH_DEVICE_POLICY_ERROR_UNKNOWN = 1,
+ REFRESH_DEVICE_POLICY_ERROR_DBUS_FAILURE = 2,
+};
+} // namespace authpolicy
-#endif // SYSTEM_API_DBUS_AUTHPOLICY_DBUS_CONSTANTS_H_
+#endif // SYSTEM_API_DBUS_AUTHPOLICY_DBUS_CONSTANTS_H_
diff --git a/chromium/third_party/cros_system_api/dbus/biod/constants.proto b/chromium/third_party/cros_system_api/dbus/biod/constants.proto
deleted file mode 100644
index d7266c03e41..00000000000
--- a/chromium/third_party/cros_system_api/dbus/biod/constants.proto
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2017 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.
-
-syntax = "proto2";
-
-option optimize_for = LITE_RUNTIME;
-
-package biod;
-
-// Included in biod's EnrollScanDone signal.
-enum ScanResult {
- SCAN_RESULT_SUCCESS = 0;
- SCAN_RESULT_PARTIAL = 1;
- SCAN_RESULT_INSUFFICIENT = 2;
- SCAN_RESULT_SENSOR_DIRTY = 3;
- SCAN_RESULT_TOO_SLOW = 4;
- SCAN_RESULT_TOO_FAST = 5;
- SCAN_RESULT_IMMOBILE = 6;
- SCAN_RESULT_MAX = 7;
-}
diff --git a/chromium/third_party/cros_system_api/dbus/biod/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/biod/dbus-constants.h
deleted file mode 100644
index f74a4477dff..00000000000
--- a/chromium/third_party/cros_system_api/dbus/biod/dbus-constants.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2017 The Chromium OS 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 SYSTEM_API_DBUS_BIOD_DBUS_CONSTANTS_H_
-#define SYSTEM_API_DBUS_BIOD_DBUS_CONSTANTS_H_
-
-namespace biod {
-const char kBiodServicePath[] = "/org/chromium/BiometricsDaemon";
-const char kBiodServiceName[] = "org.chromium.BiometricsDaemon";
-
-// Interfaces for objects exported by biod
-const char kBiometricsManagerInterface[] =
- "org.chromium.BiometricsDaemon.BiometricsManager";
-const char kAuthSessionInterface[] =
- "org.chromium.BiometricsDaemon.AuthSession";
-const char kEnrollSessionInterface[] =
- "org.chromium.BiometricsDaemon.EnrollSession";
-const char kRecordInterface[] = "org.chromium.BiometricsDaemon.Record";
-
-// List of all BiometricsManagers
-const char kFakeBiometricsManagerName[] = "FakeBiometricsManager";
-const char kFpcBiometricsManagerName[] = "FpcBiometricsManager";
-
-// Methods
-const char kBiometricsManagerStartEnrollSessionMethod[] = "StartEnrollSession";
-const char kBiometricsManagerGetRecordsForUserMethod[] = "GetRecordsForUser";
-const char kBiometricsManagerDestroyAllRecordsMethod[] = "DestroyAllRecords";
-const char kBiometricsManagerStartAuthSessionMethod[] = "StartAuthSession";
-const char kAuthSessionEndMethod[] = "End";
-const char kEnrollSessionCancelMethod[] = "Cancel";
-const char kRecordRemoveMethod[] = "Remove";
-const char kRecordSetLabelMethod[] = "SetLabel";
-
-// Signals
-const char kBiometricsManagerEnrollScanDoneSignal[] = "EnrollScanDone";
-const char kBiometricsManagerAuthScanDoneSignal[] = "AuthScanDone";
-const char kBiometricsManagerSessionFailedSignal[] = "SessionFailed";
-
-// Properties
-const char kBiometricsManagerBiometricTypeProperty[] = "Type";
-const char kRecordLabelProperty[] = "Label";
-
-// Values
-enum BiometricType {
- BIOMETRIC_TYPE_UNKNOWN = 0,
- BIOMETRIC_TYPE_FINGERPRINT = 1,
- BIOMETRIC_TYPE_MAX,
-};
-} // namespace biod
-
-#endif // SYSTEM_API_DBUS_BIOD_DBUS_CONSTANTS_H_
diff --git a/chromium/third_party/cros_system_api/dbus/biod/messages.proto b/chromium/third_party/cros_system_api/dbus/biod/messages.proto
deleted file mode 100644
index ea0e966369b..00000000000
--- a/chromium/third_party/cros_system_api/dbus/biod/messages.proto
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2017 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.
-
-syntax = "proto2";
-
-option optimize_for = LITE_RUNTIME;
-
-package biod;
-
-import "constants.proto";
-
-// Included in biod's EnrollScanDone signal.
-message EnrollScanDone {
- optional ScanResult scan_result = 1;
- optional bool done = 2;
- optional int32 percent_complete = 3;
-}
diff --git a/chromium/third_party/cros_system_api/dbus/chaps/OWNERS b/chromium/third_party/cros_system_api/dbus/chaps/OWNERS
deleted file mode 100644
index 4659435e011..00000000000
--- a/chromium/third_party/cros_system_api/dbus/chaps/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-set noparent
-ejcaruso@chromium.org
-apronin@chromium.org
diff --git a/chromium/third_party/cros_system_api/dbus/chaps/ck_structs.proto b/chromium/third_party/cros_system_api/dbus/chaps/ck_structs.proto
deleted file mode 100644
index 8fe14218dbc..00000000000
--- a/chromium/third_party/cros_system_api/dbus/chaps/ck_structs.proto
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2017 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-syntax = "proto2";
-
-option optimize_for = LITE_RUNTIME;
-
-package chaps;
-
-// Proto for CK_MECHANISM_INFO.
-// https://www.cryptsoft.com/pkcs11doc/v220/structCK__MECHANISM__INFO.html
-message MechanismInfo {
- // Next ID to use: 4
-
- optional uint64 min_key_size = 1;
- optional uint64 max_key_size = 2;
- optional uint64 flags = 3;
-}
-
-// Proto for CK_SESSION_INFO.
-// https://www.cryptsoft.com/pkcs11doc/v220/structCK__SESSION__INFO.html
-message SessionInfo {
- // Next ID to use: 5
-
- optional uint64 slot_id = 1;
- optional uint64 state = 2;
- optional uint64 flags = 3;
- optional uint64 device_error = 4;
-}
-
-// Proto for CK_VERSION.
-// https://www.cryptsoft.com/pkcs11doc/v220/structCK__VERSION.html
-message Version {
- // Next ID to use: 3
-
- optional uint32 major = 1;
- optional uint32 minor = 2;
-}
-
-// Proto for CK_SLOT_INFO.
-// https://www.cryptsoft.com/pkcs11doc/v220/structCK__SLOT__INFO.html
-message SlotInfo {
- // Next ID to use: 6
-
- optional bytes slot_description = 1;
- optional bytes manufacturer_id = 2;
- optional uint64 flags = 3;
- optional Version hardware_version = 4;
- optional Version firmware_version = 5;
-}
-
-// Proto for CK_TOKEN_INFO.
-// https://www.cryptsoft.com/pkcs11doc/v220/structCK__TOKEN__INFO.html
-message TokenInfo {
- // Next ID to use: 18
-
- optional bytes label = 1;
- optional bytes manufacturer_id = 2;
- optional bytes model = 3;
- optional bytes serial_number = 4;
- optional uint64 flags = 5;
- optional uint64 max_session_count = 6;
- optional uint64 session_count = 7;
- optional uint64 max_session_count_rw = 8;
- optional uint64 session_count_rw = 9;
- optional uint64 max_pin_len = 10;
- optional uint64 min_pin_len = 11;
- optional uint64 total_public_memory = 12;
- optional uint64 free_public_memory = 13;
- optional uint64 total_private_memory = 14;
- optional uint64 free_private_memory = 15;
- optional Version hardware_version = 16;
- optional Version firmware_version = 17;
-}
diff --git a/chromium/third_party/cros_system_api/dbus/cros-disks/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/cros-disks/dbus-constants.h
index 392337d41a7..c58af384496 100644
--- a/chromium/third_party/cros_system_api/dbus/cros-disks/dbus-constants.h
+++ b/chromium/third_party/cros_system_api/dbus/cros-disks/dbus-constants.h
@@ -46,6 +46,7 @@ const char kDevicePresentationHide[] = "DevicePresentationHide";
const char kDeviceSize[] = "DeviceSize";
const char kDriveIsRotational[] = "DriveIsRotational";
const char kDriveModel[] = "DriveModel";
+const char kExperimentalFeaturesEnabled[] = "ExperimentalFeaturesEnabled";
const char kIdLabel[] = "IdLabel";
const char kIdUuid[] = "IdUuid";
const char kVendorId[] = "VendorId";
diff --git a/chromium/third_party/cros_system_api/dbus/cryptohome/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/cryptohome/dbus-constants.h
index 4300eb58f40..fcaa99bde9e 100644
--- a/chromium/third_party/cros_system_api/dbus/cryptohome/dbus-constants.h
+++ b/chromium/third_party/cros_system_api/dbus/cryptohome/dbus-constants.h
@@ -122,8 +122,6 @@ const char kCryptohomeSetFirmwareManagementParameters[] =
"SetFirmwareManagementParameters";
const char kCryptohomeRemoveFirmwareManagementParameters[] =
"RemoveFirmwareManagementParameters";
-const char kCryptohomeMigrateToDircrypto[] = "MigrateToDircrypto";
-const char kCryptohomeNeedsDircryptoMigration[] = "NeedsDircryptoMigration";
// Signals
const char kSignalAsyncCallStatus[] = "AsyncCallStatus";
@@ -131,7 +129,6 @@ const char kSignalAsyncCallStatusWithData[] = "AsyncCallStatusWithData";
const char kSignalTpmInitStatus[] = "TpmInitStatus";
const char kSignalCleanupUsersRemoved[] = "CleanupUsersRemoved";
const char kSignalLowDiskSpace[] = "LowDiskSpace";
-const char kSignalDircryptoMigrationProgress[] = "DircryptoMigrationProgress";
// Error code
enum MountError {
MOUNT_ERROR_NONE = 0,
@@ -142,24 +139,8 @@ enum MountError {
MOUNT_ERROR_TPM_DEFEND_LOCK = 1 << 4,
MOUNT_ERROR_USER_DOES_NOT_EXIST = 1 << 5,
MOUNT_ERROR_TPM_NEEDS_REBOOT = 1 << 6,
- // Encrypted in old method, need migration before mounting.
- MOUNT_ERROR_OLD_ENCRYPTION = 1 << 7,
- // Previous migration attempt was aborted in the middle. Must resume it first.
- MOUNT_ERROR_PREVIOUS_MIGRATION_INCOMPLETE = 1 << 8,
MOUNT_ERROR_RECREATED = 1 << 31,
};
-// Status code signaled from MigrateToDircrypto().
-enum DircryptoMigrationStatus {
- // 0 means a successful completion.
- DIRCRYPTO_MIGRATION_SUCCESS = 0,
- // Negative values mean failing completion.
- // TODO(kinaba,dspaid): Add error codes as needed here.
- DIRCRYPTO_MIGRATION_FAILED = -1,
- // Positive values mean intermediate state report for the running migration.
- // TODO(kinaba,dspaid): Add state codes as needed.
- DIRCRYPTO_MIGRATION_INITIALIZING = 1,
- DIRCRYPTO_MIGRATION_IN_PROGRESS = 2,
-};
} // namespace cryptohome
#endif // SYSTEM_API_DBUS_CRYPTOHOME_DBUS_CONSTANTS_H_
diff --git a/chromium/third_party/cros_system_api/dbus/cryptohome/rpc.proto b/chromium/third_party/cros_system_api/dbus/cryptohome/rpc.proto
index 30d87608f85..84fb2038862 100644
--- a/chromium/third_party/cros_system_api/dbus/cryptohome/rpc.proto
+++ b/chromium/third_party/cros_system_api/dbus/cryptohome/rpc.proto
@@ -57,8 +57,6 @@ enum CryptohomeErrorCode {
CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_INVALID = 26;
CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_CANNOT_STORE = 27;
CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_CANNOT_REMOVE = 28;
- CRYPTOHOME_ERROR_MOUNT_OLD_ENCRYPTION = 29;
- CRYPTOHOME_ERROR_MOUNT_PREVIOUS_MIGRATION_INCOMPLETE = 30;
}
message AccountIdentifier {
@@ -88,13 +86,6 @@ message MountRequest {
// Additionally, a failed AuthorizationRequest will be expected as
// there will be no existing keys.
optional CreateRequest create = 2;
- // If set to true, and cryptohomed supports the new "dircrypto" encryption,
- // forces to use the new encryption. That is, makes it an error to mount
- // an existing home directory encrypted in the old way (ecryptfs).
- optional bool force_dircrypto_if_available = 3;
- // If set to true, mounts the existing ecryptfs vault to a temporary location
- // while setting up a new dircrypto directory.
- optional bool to_migrate_from_ecryptfs = 4;
}
// A BaseReply type is used for all cryptohomed responses. A shared base class
@@ -134,8 +125,6 @@ message CreateRequest {
// Setting this value means that the KeyData is filled as it
// would be with a Key above or in an AddKeyRequest.
optional bool copy_authorization_key = 2 [default=false];
- // If set to true, always use eCryptfs as the encryption method.
- optional bool force_ecryptfs = 3 [default=false];
// In the future, this will contain account-wide data like
// the deletion priority or the IdP's origin.
}
@@ -303,7 +292,6 @@ enum FirmwareManagementParametersFlags {
DEVELOPER_ENABLE_USB = 8;
DEVELOPER_ENABLE_LEGACY = 16;
DEVELOPER_USE_KEY_HASH = 32;
- DEVELOPER_DISABLE_CASE_CLOSED_DEBUGGING_UNLOCK = 64;
}
message GetFirmwareManagementParametersRequest {
diff --git a/chromium/third_party/cros_system_api/dbus/debugd/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/debugd/dbus-constants.h
index bef928a2d74..eea6c48c154 100644
--- a/chromium/third_party/cros_system_api/dbus/debugd/dbus-constants.h
+++ b/chromium/third_party/cros_system_api/dbus/debugd/dbus-constants.h
@@ -11,11 +11,10 @@ const char kDebugdServicePath[] = "/org/chromium/debugd";
const char kDebugdServiceName[] = "org.chromium.debugd";
// Methods.
-const char kCupsAddManuallyConfiguredPrinter[] =
- "CupsAddManuallyConfiguredPrinter";
-const char kCupsAddAutoConfiguredPrinter[] = "CupsAddAutoConfiguredPrinter";
+const char kCupsAddPrinter[] = "CupsAddPrinter";
const char kCupsRemovePrinter[] = "CupsRemovePrinter";
const char kDumpDebugLogs[] = "DumpDebugLogs";
+const char kGetDebugLogs[] = "GetDebugLogs";
const char kGetInterfaces[] = "GetInterfaces";
const char kGetModemStatus[] = "GetModemStatus";
const char kGetNetworkStatus[] = "GetNetworkStatus";
@@ -55,16 +54,6 @@ enum DevFeatureFlag {
DEV_FEATURE_SYSTEM_ROOT_PASSWORD_SET = 1 << 5,
DEV_FEATURE_CHROME_REMOTE_DEBUGGING_ENABLED = 1 << 6,
};
-
-// CupsAdd* error codes
-enum CupsResult {
- CUPS_SUCCESS = 0,
- CUPS_FATAL = 1,
- CUPS_INVALID_PPD = 2,
- CUPS_LPADMIN_FAILURE = 3,
- CUPS_AUTOCONF_FAILURE = 4,
-};
-
} // namespace debugd
#endif // SYSTEM_API_DBUS_DEBUGD_DBUS_CONSTANTS_H_
diff --git a/chromium/third_party/cros_system_api/dbus/login_manager/arc.proto b/chromium/third_party/cros_system_api/dbus/login_manager/arc.proto
deleted file mode 100644
index 1d7dcee6fc8..00000000000
--- a/chromium/third_party/cros_system_api/dbus/login_manager/arc.proto
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2017 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-syntax = "proto2";
-
-option optimize_for = LITE_RUNTIME;
-
-package login_manager;
-
-// ARC startup options sent from Chrome to session manager. This message is
-// used in SessionManagerInterface.StartArcInterface method.
-message StartArcInstanceRequest {
- // Account ID of the user to start ARC for. This must be the same as the
- // one given in StartSession.
- optional string account_id = 1;
-
- // Option to disable ACTION_BOOT_COMPLETED broadcast for 3rd party apps.
- optional bool skip_boot_completed_broadcast = 2;
-
- // Option to enable package manager service to scan /vendor/priv-app
- // directory.
- optional bool scan_vendor_priv_app = 3;
-
- // Next ID to use: 4
-}
diff --git a/chromium/third_party/cros_system_api/dbus/login_manager/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/login_manager/dbus-constants.h
index 2ad22fed620..637e5f2cc7c 100644
--- a/chromium/third_party/cros_system_api/dbus/login_manager/dbus-constants.h
+++ b/chromium/third_party/cros_system_api/dbus/login_manager/dbus-constants.h
@@ -43,7 +43,7 @@ const char kSessionManagerInitMachineInfo[] = "InitMachineInfo";
const char kSessionManagerCheckArcAvailability[] = "CheckArcAvailability";
const char kSessionManagerStartArcInstance[] = "StartArcInstance";
const char kSessionManagerStopArcInstance[] = "StopArcInstance";
-const char kSessionManagerSetArcCpuRestriction[] = "SetArcCpuRestriction";
+const char kSessionManagerPrioritizeArcInstance[] = "PrioritizeArcInstance";
const char kSessionManagerEmitArcBooted[] = "EmitArcBooted";
const char kSessionManagerGetArcStartTimeTicks[] = "GetArcStartTimeTicks";
const char kSessionManagerRemoveArcData[] = "RemoveArcData";
@@ -61,46 +61,6 @@ const char kPropertyChangeCompleteSignal[] = "PropertyChangeComplete";
// ARC instance signals.
const char kArcInstanceStopped[] = "ArcInstanceStopped";
const char kArcInstanceRebooted[] = "ArcInstanceRebooted";
-
-// D-Bus error codes
-namespace dbus_error {
-#define INTERFACE "org.chromium.SessionManagerInterface"
-
-const char kNone[] = INTERFACE ".None";
-const char kArcCpuCgroupFail[] = INTERFACE ".ArcCpuCgroupFail";
-const char kArcInstanceRunning[] = INTERFACE ".ArcInstanceRunning";
-const char kContainerStartupFail[] = INTERFACE ".ContainerStartupFail";
-const char kContainerShutdownFail[] = INTERFACE ".ContainerShutdownFail";
-const char kEmitFailed[] = INTERFACE ".EmitFailed";
-const char kInitMachineInfoFail[] = INTERFACE ".InitMachineInfoFail";
-const char kInvalidAccount[] = INTERFACE ".InvalidAccount";
-const char kLowFreeDisk[] = INTERFACE ".LowFreeDisk";
-const char kNoOwnerKey[] = INTERFACE ".NoOwnerKey";
-const char kNoUserNssDb[] = INTERFACE ".NoUserNssDb";
-const char kNotAvailable[] = INTERFACE ".NotAvailable";
-const char kNotStarted[] = INTERFACE ".NotStarted";
-const char kPolicyInitFail[] = INTERFACE ".PolicyInitFail";
-const char kPubkeySetIllegal[] = INTERFACE ".PubkeySetIllegal";
-const char kPolicySignatureRequired[] = INTERFACE ".PolicySignatureRequired";
-const char kSessionDoesNotExist[] = INTERFACE ".SessionDoesNotExist";
-const char kSessionExists[] = INTERFACE ".SessionExists";
-const char kSigDecodeFail[] = INTERFACE ".SigDecodeFail";
-const char kSigEncodeFail[] = INTERFACE ".SigEncodeFail";
-const char kTestingChannelError[] = INTERFACE ".TestingChannelError";
-const char kUnknownPid[] = INTERFACE ".UnknownPid";
-const char kVerifyFail[] = INTERFACE ".VerifyFail";
-const char kVpdUpdateFailed[] = INTERFACE ".VpdUpdateFailed";
-
-#undef INTERFACE
-} // namespace dbus_error
-
-// Values
-enum ContainerCpuRestrictionState {
- CONTAINER_CPU_RESTRICTION_FOREGROUND = 0,
- CONTAINER_CPU_RESTRICTION_BACKGROUND = 1,
- NUM_CONTAINER_CPU_RESTRICTION_STATES = 2,
-};
-
} // namespace login_manager
#endif // SYSTEM_API_DBUS_LOGIN_MANAGER_DBUS_CONSTANTS_H_
diff --git a/chromium/third_party/cros_system_api/dbus/power_manager/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/power_manager/dbus-constants.h
index 8fa97b36f4e..0a3dfaca7ad 100644
--- a/chromium/third_party/cros_system_api/dbus/power_manager/dbus-constants.h
+++ b/chromium/third_party/cros_system_api/dbus/power_manager/dbus-constants.h
@@ -21,7 +21,6 @@ const char kRequestRestartMethod[] = "RequestRestart";
const char kRequestShutdownMethod[] = "RequestShutdown";
const char kRequestSuspendMethod[] = "RequestSuspend";
const char kGetPowerSupplyPropertiesMethod[] = "GetPowerSupplyProperties";
-const char kGetSwitchStatesMethod[] = "GetSwitchStates";
const char kHandleUserActivityMethod[] = "HandleUserActivity";
const char kHandleVideoActivityMethod[] = "HandleVideoActivity";
const char kSetIsProjectingMethod[] = "SetIsProjecting";
diff --git a/chromium/third_party/cros_system_api/dbus/power_manager/switch_states.proto b/chromium/third_party/cros_system_api/dbus/power_manager/switch_states.proto
deleted file mode 100644
index e1a827c44b8..00000000000
--- a/chromium/third_party/cros_system_api/dbus/power_manager/switch_states.proto
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2017 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.
-
-syntax = "proto2";
-
-option optimize_for = LITE_RUNTIME;
-
-package power_manager;
-
-// Included in responses to GetSwitchStates method calls to powerd.
-message SwitchStates {
- // Next ID to use: 3
-
- enum LidState {
- OPEN = 0;
- CLOSED = 1;
- NOT_PRESENT = 2;
- }
- optional LidState lid_state = 1;
-
- enum TabletMode {
- ON = 0;
- OFF = 1;
- UNSUPPORTED = 2;
- }
- optional TabletMode tablet_mode = 2;
-}
diff --git a/chromium/third_party/cros_system_api/dbus/service_constants.h b/chromium/third_party/cros_system_api/dbus/service_constants.h
index a2200ef4663..1f63c036fa0 100644
--- a/chromium/third_party/cros_system_api/dbus/service_constants.h
+++ b/chromium/third_party/cros_system_api/dbus/service_constants.h
@@ -11,7 +11,6 @@
// Chromium OS and Chromium environment.
#include "apmanager/dbus-constants.h"
#include "authpolicy/dbus-constants.h"
-#include "biod/dbus-constants.h"
#include "cros-disks/dbus-constants.h"
#include "cryptohome/dbus-constants.h"
#include "debugd/dbus-constants.h"
@@ -62,7 +61,6 @@ const char kImageLoaderServiceName[] = "org.chromium.ImageLoader";
const char kImageLoaderServicePath[] = "/org/chromium/ImageLoader";
// Methods
const char kRegisterComponent[] = "RegisterComponent";
-const char kLoadComponent[] = "LoadComponent";
const char kGetComponentVersion[] = "GetComponentVersion";
// Constants
const char kBadResult[] = "";
@@ -93,8 +91,6 @@ const char kLibCrosServicePath[] = "/org/chromium/LibCrosService";
const char kLibCrosServiceInterface[] = "org.chromium.LibCrosServiceInterface";
// Methods
const char kResolveNetworkProxy[] = "ResolveNetworkProxy";
-// TODO(teravest): Remove this once CheckLiveness is removed from
-// LibCrosService.
const char kCheckLiveness[] = "CheckLiveness";
const char kGetKioskAppRequiredPlatforVersion[] =
"GetKioskAppRequiredPlatformVersion";
@@ -110,27 +106,6 @@ enum DisplayPowerState {
DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON = 2,
DISPLAY_POWER_INTERNAL_ON_EXTERNAL_OFF = 3,
};
-
-const char kNetworkProxyServiceName[] = "org.chromium.NetworkProxyService";
-const char kNetworkProxyServicePath[] = "/org/chromium/NetworkProxyService";
-const char kNetworkProxyServiceInterface[] =
- "org.chromium.NetworkProxyServiceInterface";
-const char kNetworkProxyServiceResolveProxyMethod[] = "ResolveProxy";
-
-const char kLivenessServiceName[] = "org.chromium.LivenessService";
-const char kLivenessServicePath[] = "/org/chromium/LivenessService";
-const char kLivenessServiceInterface[] =
- "org.chromium.LivenessServiceInterface";
-const char kLivenessServiceCheckLivenessMethod[] = "CheckLiveness";
-
-const char kKioskAppServiceName[] = "org.chromium.KioskAppService";
-const char kKioskAppServicePath[] = "/org/chromium/KioskAppService";
-const char kKioskAppServiceInterface[] =
- "org.chromium.KioskAppServiceInterface";
-// Methods
-const char kKioskAppServiceGetRequiredPlatformVersionMethod[] =
- "GetRequiredPlatformVersion";
-
} // namespace chromeos
namespace cromo {
@@ -151,18 +126,6 @@ const char kModemGsmNetworkInterface[] =
const char kModemGobiInterface[] = "org.chromium.ModemManager.Modem.Gobi";
} // namespace cromo
-namespace media_perception {
-
-const char kMediaPerceptionServiceName[] = "org.chromium.MediaPerception";
-const char kMediaPerceptionServicePath[] = "/org/chromium/MediaPerception";
-const char kMediaPerceptionInterface[] = "org.chromium.MediaPerception";
-
-const char kStateFunction[] = "State";
-const char kGetDiagnosticsFunction[] = "GetDiagnostics";
-const char kDetectionSignal[] = "MediaPerceptionDetection";
-
-} // namespace media_perception
-
namespace modemmanager {
// ModemManager D-Bus service identifiers
const char kModemManagerSMSInterface[] =
diff --git a/chromium/third_party/cros_system_api/dbus/shill/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/shill/dbus-constants.h
index 118c7a95655..063d70a4342 100644
--- a/chromium/third_party/cros_system_api/dbus/shill/dbus-constants.h
+++ b/chromium/third_party/cros_system_api/dbus/shill/dbus-constants.h
@@ -164,6 +164,7 @@ const char kEntriesProperty[] = "Entries";
// Flimflam Device property names.
const char kScanningProperty[] = "Scanning";
const char kPoweredProperty[] = "Powered";
+const char kNetworksProperty[] = "Networks";
const char kScanIntervalProperty[] = "ScanInterval";
const char kBgscanMethodProperty[] = "BgscanMethod";
const char kBgscanShortIntervalProperty[] = "BgscanShortInterval";
diff --git a/chromium/third_party/cros_system_api/dbus/update_engine/dbus-constants.h b/chromium/third_party/cros_system_api/dbus/update_engine/dbus-constants.h
index 9551b411941..86c60dd00a7 100644
--- a/chromium/third_party/cros_system_api/dbus/update_engine/dbus-constants.h
+++ b/chromium/third_party/cros_system_api/dbus/update_engine/dbus-constants.h
@@ -24,10 +24,6 @@ const char kGetChannel[] = "GetChannel";
const char kAttemptRollback[] = "AttemptRollback";
const char kCanRollback[] = "CanRollback";
const char kGetEolStatus[] = "GetEolStatus";
-const char kSetUpdateOverCellularPermission[] =
- "SetUpdateOverCellularPermission";
-const char kSetUpdateOverCellularTarget[] =
- "SetUpdateOverCellularTarget";
// Signals.
const char kStatusUpdate[] = "StatusUpdate";
@@ -59,8 +55,6 @@ const char kUpdateStatusReportingErrorEvent[] =
const char kUpdateStatusAttemptingRollback[] =
"UPDATE_STATUS_ATTEMPTING_ROLLBACK";
const char kUpdateStatusDisabled[] = "UPDATE_STATUS_DISABLED";
-const char kUpdateStatusNeedPermissionToUpdate[] =
- "UPDATE_STATUS_NEED_PERMISSION_TO_UPDATE";
} // namespace update_engine
#endif // SYSTEM_API_DBUS_UPDATE_ENGINE_DBUS_CONSTANTS_H_
diff --git a/chromium/third_party/cros_system_api/system_api.gyp b/chromium/third_party/cros_system_api/system_api.gyp
index 4c0951b05a1..47b12d7a756 100644
--- a/chromium/third_party/cros_system_api/system_api.gyp
+++ b/chromium/third_party/cros_system_api/system_api.gyp
@@ -35,12 +35,11 @@
'proto_out_dir': 'include/power_manager/proto_bindings',
},
'sources': [
+ '<(proto_in_dir)/suspend.proto',
'<(proto_in_dir)/input_event.proto',
'<(proto_in_dir)/peripheral_battery_status.proto',
'<(proto_in_dir)/policy.proto',
'<(proto_in_dir)/power_supply_properties.proto',
- '<(proto_in_dir)/suspend.proto',
- '<(proto_in_dir)/switch_states.proto',
],
'includes': ['../../platform2/common-mk/protoc.gypi'],
},
@@ -52,12 +51,11 @@
'system_api-power_manager-protos-gen',
],
'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/suspend.pb.cc',
'<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/input_event.pb.cc',
'<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/peripheral_battery_status.pb.cc',
'<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/policy.pb.cc',
'<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/power_supply_properties.pb.cc',
- '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/suspend.pb.cc',
- '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/switch_states.pb.cc',
]
},
{
@@ -87,105 +85,5 @@
'<(SHARED_INTERMEDIATE_DIR)/include/cryptohome/proto_bindings/signed_secret.pb.cc',
]
},
- {
- 'target_name': 'system_api-authpolicy-protos-gen',
- 'type': 'none',
- 'variables': {
- 'proto_in_dir': 'dbus/authpolicy',
- 'proto_out_dir': 'include/authpolicy/proto_bindings',
- },
- 'sources': [
- # TODO(ljusten): Remove this file as soon as Chrome uses
- # active_directory_info.proto. crbug.com/712720.
- '<(proto_in_dir)/active_directory_account_data.proto',
- '<(proto_in_dir)/active_directory_info.proto',
- ],
- 'includes': ['../../platform2/common-mk/protoc.gypi'],
- },
- {
- 'target_name': 'system_api-authpolicy-protos',
- 'type': 'static_library',
- 'standalone_static_library': 1,
- 'dependencies': [
- 'system_api-authpolicy-protos-gen',
- ],
- 'sources': [
- # TODO(ljusten): Remove this file as soon as Chrome uses
- # active_directory_info.proto. crbug.com/712720.
- '<(SHARED_INTERMEDIATE_DIR)/include/authpolicy/proto_bindings/active_directory_account_data.pb.cc',
- '<(SHARED_INTERMEDIATE_DIR)/include/authpolicy/proto_bindings/active_directory_info.pb.cc',
- ]
- },
- {
- 'target_name': 'system_api-biod-protos-gen',
- 'type': 'none',
- 'variables': {
- 'proto_in_dir': 'dbus/biod',
- 'proto_out_dir': 'include/biod/proto_bindings',
- },
- 'sources': [
- '<(proto_in_dir)/constants.proto',
- '<(proto_in_dir)/messages.proto',
- ],
- 'includes': ['../../platform2/common-mk/protoc.gypi'],
- },
- {
- 'target_name': 'system_api-biod-protos',
- 'type': 'static_library',
- 'standalone_static_library': 1,
- 'dependencies': [
- 'system_api-biod-protos-gen',
- ],
- 'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/include/biod/proto_bindings/constants.pb.cc',
- '<(SHARED_INTERMEDIATE_DIR)/include/biod/proto_bindings/messages.pb.cc',
- ]
- },
- {
- 'target_name': 'system_api-login_manager-protos-gen',
- 'type': 'none',
- 'variables': {
- 'proto_in_dir': 'dbus/login_manager',
- 'proto_out_dir': 'include/login_manager/proto_bindings',
- },
- 'sources': [
- '<(proto_in_dir)/arc.proto',
- ],
- 'includes': ['../../platform2/common-mk/protoc.gypi'],
- },
- {
- 'target_name': 'system_api-login_manager-protos',
- 'type': 'static_library',
- 'standalone_static_library': 1,
- 'dependencies': [
- 'system_api-login_manager-protos-gen',
- ],
- 'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/include/login_manager/proto_bindings/arc.pb.cc',
- ]
- },
- {
- 'target_name': 'system_api-chaps-protos-gen',
- 'type': 'none',
- 'variables': {
- 'proto_in_dir': 'dbus/chaps',
- 'proto_out_dir': 'include/chaps/proto_bindings',
- },
- 'sources': [
- '<(proto_in_dir)/ck_structs.proto',
- ],
- 'includes': ['../../platform2/common-mk/protoc.gypi'],
- },
- {
- 'target_name': 'system_api-chaps-protos',
- 'type': 'static_library',
- 'standalone_static_library': 1,
- 'dependencies': [
- 'system_api-chaps-protos-gen',
- ],
- 'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/include/chaps/proto_bindings/ck_structs.pb.cc',
- ]
- },
]
}
diff --git a/chromium/third_party/cros_system_api/system_api.pc b/chromium/third_party/cros_system_api/system_api.pc
index 0f01f54f083..c6925acd48a 100644
--- a/chromium/third_party/cros_system_api/system_api.pc
+++ b/chromium/third_party/cros_system_api/system_api.pc
@@ -1,4 +1,4 @@
Name: system_api
Description: Protobuffers and headers shared by Chromium OS and Chromium.
Version: 0.1
-Libs: -lsystem_api-power_manager-protos -lsystem_api-cryptohome-protos -lsystem_api-authpolicy-protos -lsystem_api-biod-protos -lsystem_api-protos -lsystem_api-login_manager-protos -lsystem_api-chaps-protos
+Libs: -lsystem_api-power_manager-protos -lsystem_api-cryptohome-protos -lsystem_api-protos
diff --git a/chromium/third_party/flatbuffers/src/docs/source/CONTRIBUTING.md b/chromium/third_party/flatbuffers/src/docs/source/CONTRIBUTING.md
index 433b7d33548..158875295d2 120000..100644
--- a/chromium/third_party/flatbuffers/src/docs/source/CONTRIBUTING.md
+++ b/chromium/third_party/flatbuffers/src/docs/source/CONTRIBUTING.md
@@ -1 +1,42 @@
-../../CONTRIBUTING \ No newline at end of file
+Contributing {#contributing}
+============
+
+Want to contribute? Great! First, read this page (including the small print at
+the end).
+
+# Before you contribute
+Before we can use your code, you must sign the
+[Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
+(CLA), which you can do online. The CLA is necessary mainly because you own the
+copyright to your changes, even after your contribution becomes part of our
+codebase, so we need your permission to use and distribute your code. We also
+need to be sure of various other things—for instance that you'll tell us if you
+know that your code infringes on other people's patents. You don't have to sign
+the CLA until after you've submitted your code for review and a member has
+approved it, but you must do it before we can put your code into our codebase.
+Before you start working on a larger contribution, you should get in touch with
+us first through the issue tracker with your idea so that we can help out and
+possibly guide you. Coordinating up front makes it much easier to avoid
+frustration later on.
+
+# Code reviews
+All submissions, including submissions by project members, require review. We
+use Github pull requests for this purpose.
+
+Some tips for good pull requests:
+* Use our code
+ [style guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.html).
+ When in doubt, try to stay true to the existing code of the project.
+* Write a descriptive commit message. What problem are you solving and what
+ are the consequences? Where and what did you test? Some good tips:
+ [here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message)
+ and [here](https://www.kernel.org/doc/Documentation/SubmittingPatches).
+* If your PR consists of multiple commits which are successive improvements /
+ fixes to your first commit, consider squashing them into a single commit
+ (`git rebase -i`) such that your PR is a single commit on top of the current
+ HEAD. This make reviewing the code so much easier, and our history more
+ readable.
+
+# The small print
+Contributions made by corporations are covered by a different agreement than
+the one above, the Software Grant and Corporate Contributor License Agreement.
diff --git a/chromium/third_party/fontconfig/src/INSTALL b/chromium/third_party/fontconfig/src/INSTALL
index 670add1f32c..aab4cddbc4f 100644
--- a/chromium/third_party/fontconfig/src/INSTALL
+++ b/chromium/third_party/fontconfig/src/INSTALL
@@ -28,7 +28,7 @@ important steps:
freedesktop.org:/srv/www.freedesktop.org/www/software/fontconfig/release
5. Update the Fontconfig Devel wiki page
- http://fontconfig.org/wiki/Devel
+ https://www.freedesktop.org/wiki/Software/fontconfig/Devel/
6. Update the fontconfig documentation
diff --git a/chromium/third_party/fontconfig/src/Makefile.am b/chromium/third_party/fontconfig/src/Makefile.am
index 2b949e43963..2b4a5b82280 100644
--- a/chromium/third_party/fontconfig/src/Makefile.am
+++ b/chromium/third_party/fontconfig/src/Makefile.am
@@ -21,7 +21,7 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-SUBDIRS=fontconfig fc-case fc-lang fc-glyphname src \
+SUBDIRS=fontconfig fc-blanks fc-case fc-lang fc-glyphname src \
fc-cache fc-cat fc-list fc-match fc-pattern fc-query fc-scan \
fc-validate conf.d test
if ENABLE_DOCS
diff --git a/chromium/third_party/fontconfig/src/README b/chromium/third_party/fontconfig/src/README
index d2288a55994..bf840a5e74e 100644
--- a/chromium/third_party/fontconfig/src/README
+++ b/chromium/third_party/fontconfig/src/README
@@ -1,12 +1,283 @@
Fontconfig
Font configuration and customization library
- Version 2.11
- 2013-10-11
+ Version 2.12.1
+ 2016-08-05
Check INSTALL for compilation and installation instructions.
Report bugs to https://bugs.freedesktop.org in the fontconfig module.
+2.12.1
+
+Akira TAGOH (6):
+ Add --with-default-hinting to configure
+ Update CaseFolding.txt to Unicode 9.0
+ Check python installed in autogen.sh
+ Fix some errors related to python3
+ Bug 96676 - Check range of FcWeightFromOpenType argument
+ Update libtool revision
+
+Tobias Stoeckmann (1):
+ Properly validate offsets in cache files.
+
+2.12
+
+Akira TAGOH (8):
+ Modernize fc-blanks.py
+ Update URL
+ Bug 95477 - FcAtomicLock fails when SELinux denies link() syscall with EACCES
+ 45-latin.conf: Add some Windows fonts to categorize them properly
+ Correct one for the previous change
+ Bug 95481 - Build fails on Android due to broken lconv struct
+ Add the static raw data to generate fcblanks.h
+ Remove unused code
+
+Erik de Castro Lopo (1):
+ Fix a couple of minor memory leaks
+
+Petr Filipsky (1):
+ Fix memory leak in FcDirCacheLock
+
+2.11.95 (2.12 RC5)
+
+Akira TAGOH (22):
+ Add one more debugging option to see transformation on font-matching
+ Fix a crash when no objects are available after filtering
+ No need to be public
+ mark as private at this moment
+ Don't return FcFalse even when no fonts dirs is configured
+ Add a warning for blank in fonts.conf
+ Fix a memory leak in FcFreeTypeQueryFace
+ Update CaseFolding.txt to Unicode 8.0
+ Bug 90867 - Memory Leak during error case in fccharset
+ Fix the broken cache more.
+ Fail on make runtime as needed instead of configure if no python installed
+ Use long long to see the same size between LP64 and LLP64
+ Fix build issue on MinGW
+ Use int64_t instead of long long
+ Fix compiler warnings on MinGW
+ Fix assertion on 32bit arch
+ remomve unnecessary code
+ Bug 93075 - Possible fix for make check failure on msys/MinGW...
+ Avoid an error message on testing when no fonts.conf installed
+ Add hintstyle templates and make hintslight default
+ Revert "Workaround another race condition issue"
+ Update libtool revision
+
+Behdad Esfahbod (6):
+ Revert changes made to FcConfigAppFontAddDir() recently
+ Call FcFreeTypeQueryFace() from fcdir.c, instead of FcFreeTypeQuery()
+ [GX] Support instance weight, width, and style name
+ [GX] Enumerate all named-instances in TrueType GX fonts
+ Improve OpenType to Fontconfig weight mapping
+ [GX] Improve weight mapping
+
+Patrick Haller (1):
+ Optimizations in FcStrSet
+
+2.11.94 (2.12 RC4)
+
+Akira TAGOH (16):
+ Remove the dead code
+ Bug 89617 - FcConfigAppFontAddFile() returns false on any font file
+ Fix unknown attribute in Win32
+ Fix SIGFPE
+ Fix a typo for the latest cache version
+ Fix a typo in fontconfig-user.sgml
+ Drop unmaintained code
+ Observe blanks to compute correct languages in fc-query/fc-scan
+ Add missing description for usage
+ Make FC_SCALE deprecated
+ Bug 90148 - Don't warn if cachedir isn't specified
+ Fix memory leaks after FcFini()
+ Fix a typo
+ Fix a crash
+ Detect the overflow for the object ID
+ Revert the previous change
+
+Behdad Esfahbod (11):
+ Fix bitmap scaling
+ Add su[pport for symbol fonts
+ Write ranges using a [start finish) format
+ Only set FC_SIZE for scalable fonts if OS/2 version 5 is present
+ Add bitmap-only font size as Double, not Range
+ Accept Integer for FC_SIZE
+ Don't set FC_SIZE for bitmap fonts
+ Fix compiler warnings
+ Simplify FcRange
+ Reduce number of places that cache version is specified to 1
+ Bump cache version number to 6, because of recent FcRange changes
+
+Руслан Ижбулатов (1):
+ W32: Support cache paths relative to the root directory
+
+2.11.93 (2.12 RC3)
+
+Akira TAGOH (18):
+ Fix a typo in docs
+ Add pkg.m4 to git
+ Fix a build fail on some non-POSIX platforms
+ ifdef'd the unnecessary code for win32
+ Fix pointer cast warning on win32
+ filter can be null
+ Copy the real size of struct dirent
+ Rework again to copy the struct dirent
+ Hardcode the blanks in the library
+ Update the script to recognize the escaped space
+ Fix a build issue when $(srcdir) != $(builddir)
+ Don't add FC_LANG when it has "und"
+ Fix the array allocation
+ Improve the performance on searching blanks
+ Fix a segfault when OOM happened.
+ Fix a bug in the previous change forFcBlanksIsMember()
+ Fix an infinite loop in FcBlanksIsMember()
+ Fix a trivial bug for dist
+
+Alan Coopersmith (1):
+ Fix configure to work with Solaris Studio compilers
+
+Behdad Esfahbod (3):
+ Fix symbol cmap handling
+ Remove dead code after previous commit
+ Simplify some more
+
+Michael Haubenwallner (1):
+ Ensure config.h is included first, bug#89336.
+
+2.11.92 (2.12 RC2)
+
+Akira TAGOH (1):
+ Add missing docs
+
+2.11.91 (2.12 RC1)
+
+Akira TAGOH (28):
+ Bug 71287 - size specific design selection support in OS/2 table version 5
+ Fix a build issue with freetype <2.5.1
+ Fix missing docs
+ Fix a typo
+ Fix fc-cache fail with -r
+ Rebase ja.orth against Joyo kanji characters
+ Allow the modification on FcTypeVoid with FcTypeLangSet and FcTypeCharSet
+ Workaround another race condition issue
+ Read the config files and fonts on the sysroot when --sysroot is given to fc-cache
+ Fix a segfault
+ Update CaseFolding.txt to Unicode 7.0
+ Don't read/write from/to the XDG dirs if the home directory is disabled
+ Rework for 5004e8e01f5de30ad01904e57ea0eda006ab3a0c
+ Fix a crash when no sysroot is given and failed to load the default fonts.conf
+ Fix a gcc warning
+ Don't add duplicate lang
+ fallback to the another method to lock when link() failed
+ Increase the refcount in FcConfigSetCurrent()
+ Fix the memory leak in fc-cat
+ Note FcConfigSetCurrent() increases the refcount in document
+ Add FcRangeGetDouble()
+ Revert "Bug 73291 - poppler does not show fl ligature"
+ Update aliases for new URW fonts
+ Returns False if no fonts found
+ fc-cache: make a fail if no fonts processed on a given path
+ fc-cache: Add an option to raise an error if no fonts found
+ Bump the cache version to 5
+ Fix a typo
+
+Behdad Esfahbod (39):
+ Remove unused code
+ Simplify hash code
+ Further simplify hash code
+ Rewrite hashing to use FT_Stream directly
+ Allow passing NULL for file to FcFreeTypeQueryFace()
+ [ko.orth] Remove U+3164 HANGUL FILLER
+ Deprecate FC_HASH and don't compute it
+ Remove unused FcHash code now that FC_HASH is deprecated
+ Update list of blanks to Unicode 6.3.0
+ Update blanks to Unicode 7.0
+ Change charset parse/unparse format to be human readable
+ Minor
+ Fix charset unparse after recent changes
+ Comments
+ Remove HASH from matching priorities
+ Fixup previous commit
+ Update mingw32 MemoryBarrier from HarfBuzz
+ More mingw32 MemoryBarrier() fixup
+ Symlinks fix for DESTDIR
+ Revert "Symlinks fix for DESTDIR"
+ Call FcInitDebug from FcFreeTypeQueryFace
+ Decode MacRoman encoding in name table without iconv
+ Ouch, fix buffer
+ Use lang=und instead of lang=xx for "undetermined"
+ Remove unused regex code
+ Improve / cleanup namelang matching
+ Add FC_WEIGHT_DEMILIGHT
+ Change DemiLight from 65 to 55
+ Linearly interpolate weight values
+ Export recently added API
+ Remove unneeded FcPublic
+ Fix assertion failure
+ If OS/2 table says weight is 1 to 9, multiply by 100
+ Trebuchet MS is a sans-serif font, not serif
+ Fix previous commit
+ Revert "[fcmatch] When matching, reserve score 0 for when elements don't exist"
+ Fix buffer overflow in copying PS name
+ Add FC_COLOR
+ Treat color fonts as scalable
+
+Nick Alcock (1):
+ Generate documentation for FcWeight* functions.
+
+2.11.1
+
+Akira TAGOH (31):
+ do not build test-migration for Win32
+ Fix build issue on Debian/kFreeBSD 7.0
+ Update ax_pthread.m4 to the latest version
+ Fix the dynamic loading issue on NetBSD
+ Use stat() if there are no d_type in struct dirent
+ Fix a build issue on Solaris 10
+ Change the default weight on match to FC_WEIGHT_NORMAL
+ Warn if no <test> nor <edit> elements in <match>
+ Correct DTD
+ Re-scan font directories only when it contains subdirs
+ Fix typo
+ Bug 72086 - Check for gperf in autogen.sh
+ Simplify to validate the availability of posix_fadvise
+ Simplify to validate the availability of scandir
+ Fix a typo
+ Fix a build issue on platforms where doesn't support readlink()
+ Improve the performance issue on rescanning directories
+ Bug 73686 - confdir is not set correctly in fontconfig.pc
+ Update zh_hk.orth
+ clean up the unused files
+ Add missing license headers
+ Update the use of autotools' macro
+ Fix a crash issue when empty strings are set to the BDF properties
+ Add a doc for FcDirCacheRescan
+ Add missing #include <sys/statvfs.h> in fcstat.c
+ Fix incompatible API on AIX with random_r and initstate_r
+ Fallback to lstat() in case the filesystem doesn't support d_type in struct dirent
+ Update doc to include the version info of `since when'
+ Bug 73291 - poppler does not show fl ligature
+ Add README describes the criteria to add/modify the orthography files
+ Fix autoconf warning, warning: AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS
+
+Alan Coopersmith (3):
+ Leave room for null terminators in arrays
+ Avoid memory leak when NULL path passed to FcStrBuildFilename
+ Avoid null pointer dereference in FcNameParse if malloc fails
+
+Behdad Esfahbod (1):
+ Bug 72380 - Never drop first font when trimming
+
+Frederic Crozat (2):
+ Fix inversion between Tinos and Cousine in the comment
+ Add metric aliases for additional Google ChromeOS fonts
+
+Jehan (1):
+ Defaulting <cachedir> to LOCAL_APPDATA_FONTCONFIG_CACHE for Win32 build
+
+Ross Burton (1):
+ fc-cache: --sysroot option takes an argument
+
2.11
Akira TAGOH (15):
diff --git a/chromium/third_party/fontconfig/src/autogen.sh b/chromium/third_party/fontconfig/src/autogen.sh
index 1482e401c51..07c59a4714f 100755
--- a/chromium/third_party/fontconfig/src/autogen.sh
+++ b/chromium/third_party/fontconfig/src/autogen.sh
@@ -1,4 +1,26 @@
#!/bin/sh
+# fontconfig/autogen.sh
+#
+# Copyright © 2000 Keith Packard
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of the author(s) not be used in
+# advertising or publicity pertaining to distribution of the software without
+# specific, written prior permission. The authors make no
+# representations about the suitability of this software for any purpose. It
+# is provided "as is" without express or implied warranty.
+#
+# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
# Run this to generate all the initial makefiles, etc.
set -e
@@ -24,10 +46,28 @@ LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
AUTOMAKE=${AUTOMAKE-automake}
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOCONF=${AUTOCONF-autoconf}
+GPERF=${GPERF-gperf}
+PYTHON=${PYTHON-python}
LIBTOOLIZE_FLAGS="--copy --force"
DIE=0
+($GPERF --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have gperf installed to compile $PROJECT."
+ echo "Install the appropriate package for your distribution."
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+($PYTHON --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have python installed to compile $PROJECT."
+ echo "Install the appropriate package for your distribution."
+ echo "or get the source tarball at https://www.python.org/downloads/source/"
+ DIE=1
+}
+
have_libtool=false
if $LIBTOOLIZE --version < /dev/null > /dev/null 2>&1 ; then
libtool_version=`$LIBTOOLIZE --version | sed 's/^.* \([0-9][.][0-9.]*\)[^ ]*$/\1/'`
diff --git a/chromium/third_party/fontconfig/src/conf.d/10-hinting-full.conf b/chromium/third_party/fontconfig/src/conf.d/10-hinting-full.conf
new file mode 100644
index 00000000000..27d8229195c
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/conf.d/10-hinting-full.conf
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+ <match target="pattern">
+ <!--
+ This configuration is available on the major desktop environments.
+ We shouldn't overwrite it with "assign" unconditionally.
+ Most clients may picks up the first value only. so using "append"
+ may simply works to avoid it.
+ -->
+ <edit name="hintstyle" mode="append"><const>hintfull</const></edit>
+ </match>
+</fontconfig>
diff --git a/chromium/third_party/fontconfig/src/conf.d/10-hinting-medium.conf b/chromium/third_party/fontconfig/src/conf.d/10-hinting-medium.conf
new file mode 100644
index 00000000000..e34ab5b344d
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/conf.d/10-hinting-medium.conf
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+ <match target="pattern">
+ <!--
+ This configuration is available on the major desktop environments.
+ We shouldn't overwrite it with "assign" unconditionally.
+ Most clients may picks up the first value only. so using "append"
+ may simply works to avoid it.
+ -->
+ <edit name="hintstyle" mode="append"><const>hintmedium</const></edit>
+ </match>
+</fontconfig>
diff --git a/chromium/third_party/fontconfig/src/conf.d/10-hinting-none.conf b/chromium/third_party/fontconfig/src/conf.d/10-hinting-none.conf
new file mode 100644
index 00000000000..0b3810d9485
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/conf.d/10-hinting-none.conf
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+ <match target="pattern">
+ <!--
+ This configuration is available on the major desktop environments.
+ We shouldn't overwrite it with "assign" unconditionally.
+ Most clients may picks up the first value only. so using "append"
+ may simply works to avoid it.
+ -->
+ <edit name="hintstyle" mode="append"><const>hintnone</const></edit>
+ </match>
+</fontconfig>
diff --git a/chromium/third_party/fontconfig/src/conf.d/10-hinting-slight.conf b/chromium/third_party/fontconfig/src/conf.d/10-hinting-slight.conf
new file mode 100644
index 00000000000..c244ac0b0e8
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/conf.d/10-hinting-slight.conf
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+ <match target="pattern">
+ <!--
+ This configuration is available on the major desktop environments.
+ We shouldn't overwrite it with "assign" unconditionally.
+ Most clients may picks up the first value only. so using "append"
+ may simply works to avoid it.
+ -->
+ <edit name="hintstyle" mode="append"><const>hintslight</const></edit>
+ </match>
+</fontconfig>
diff --git a/chromium/third_party/fontconfig/src/conf.d/10-no-sub-pixel.conf b/chromium/third_party/fontconfig/src/conf.d/10-no-sub-pixel.conf
index cf124656176..635847c4044 100644
--- a/chromium/third_party/fontconfig/src/conf.d/10-no-sub-pixel.conf
+++ b/chromium/third_party/fontconfig/src/conf.d/10-no-sub-pixel.conf
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
-<!-- Enable sub-pixel rendering -->
+<!-- Disable sub-pixel rendering -->
<match target="pattern">
<!--
This configuration is available on the major desktop environments.
diff --git a/chromium/third_party/fontconfig/src/conf.d/10-scale-bitmap-fonts.conf b/chromium/third_party/fontconfig/src/conf.d/10-scale-bitmap-fonts.conf
index e3bcd46cdc0..b4e9cb4f233 100644
--- a/chromium/third_party/fontconfig/src/conf.d/10-scale-bitmap-fonts.conf
+++ b/chromium/third_party/fontconfig/src/conf.d/10-scale-bitmap-fonts.conf
@@ -2,8 +2,13 @@
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
+<!--
+ If font is bitmap, calculate scale factor.
+ Note that color bitmap fonts have scalable=true, while
+ non-color ones have scalable=false. Both groups have outline=false.
+ -->
<match target="font">
- <test name="scalable" compare="eq">
+ <test name="outline" compare="eq">
<bool>false</bool>
</test>
<edit name="pixelsizefixupfactor" mode="assign">
@@ -13,10 +18,20 @@
</divide>
</edit>
</match>
+<!--
+ For non-scalable bitmap fonts (ie. non-color), skip
+ minor scaling if hinting is enabled.
+ -->
<match target="font">
+ <test name="outline" compare="eq">
+ <bool>false</bool>
+ </test>
<test name="scalable" compare="eq">
<bool>false</bool>
</test>
+ <test name="hinting" compare="eq">
+ <bool>true</bool>
+ </test>
<edit name="scalingnotneeded" mode="assign">
<and>
<less>
@@ -30,20 +45,7 @@
</and>
</edit>
</match>
-<!--
- So far we determined the scale factor. Now, check and if
- scaling is NOT desirable, just reset the scale factor to 1.0.
- -->
<match target="font">
- <test name="scalable" compare="eq">
- <bool>false</bool>
- </test>
- <test name="pixelsize" target="pattern" compare="less">
- <double>64</double>
- </test>
- <test name="hinting" compare="eq">
- <bool>true</bool>
- </test>
<test name="scalingnotneeded" compare="eq">
<bool>true</bool>
</test>
@@ -55,7 +57,7 @@
If we *are* going to scale, go ahead and do it.
-->
<match target="font">
- <test name="scalable" compare="eq">
+ <test name="outline" compare="eq">
<bool>false</bool>
</test>
<test name="pixelsizefixupfactor" compare="not_eq">
diff --git a/chromium/third_party/fontconfig/src/conf.d/30-metric-aliases.conf b/chromium/third_party/fontconfig/src/conf.d/30-metric-aliases.conf
index d0d9ea2e0eb..1f0778d68c4 100644
--- a/chromium/third_party/fontconfig/src/conf.d/30-metric-aliases.conf
+++ b/chromium/third_party/fontconfig/src/conf.d/30-metric-aliases.conf
@@ -6,24 +6,27 @@
Alias similar/metric-compatible families from various sources:
-PostScript fonts: URW fonts: GUST fonts: Windows fonts:
-====================== ==================== ================= ==================
-Helvetica Nimbus Sans L TeX Gyre Heros
-Helvetica Condensed TeX Gyre Heros Cn
-Times Nimbus Roman No9 L TeX Gyre Termes
-Courier Nimbus Mono L TeX Gyre Cursor
-ITC Avant Garde Gothic URW Gothic L TeX Gyre Adventor
-ITC Bookman URW Bookman L TeX Gyre Bonum Bookman Old Style
-ITC Zapf Chancery URW Chancery L TeX Gyre Chorus
-Palatino URW Palladio L TeX Gyre Pagella Palatino Linotype
-New Century Schoolbook Century Schoolbook L TeX Gyre Schola Century Schoolbook
+PostScript fonts: URW fonts: GUST fonts: Windows fonts:
+====================== ================== ================= ==================
+Helvetica Nimbus Sans TeX Gyre Heros
+Helvetica Narrow Nimbus Sans Narrow TeX Gyre Heros Cn
+Times Nimbus Roman TeX Gyre Termes
+Courier Nimbus Mono PS TeX Gyre Cursor
+ITC Avant Garde Gothic URW Gothic TeX Gyre Adventor
+ITC Bookman URW Bookman TeX Gyre Bonum Bookman Old Style
+ITC Zapf Chancery Z003 TeX Gyre Chorus
+Palatino P052 TeX Gyre Pagella Palatino Linotype
+New Century Schoolbook C059 TeX Gyre Schola Century Schoolbook
Microsoft fonts: Liberation fonts: Google CrOS core fonts: StarOffice fonts: AMT fonts:
================ ====================== ======================= ================= ==============
Arial Liberation Sans Arimo Albany Albany AMT
Arial Narrow Liberation Sans Narrow
-Times New Roman Liberation Serif Cousine Thorndale Thorndale AMT
-Courier New Liberation Mono Tinos Cumberland Cumberland AMT
+Times New Roman Liberation Serif Tinos Thorndale Thorndale AMT
+Courier New Liberation Mono Cousine Cumberland Cumberland AMT
+Cambria Caladea
+Calibri Carlito
+Symbol SymbolNeu
Microsoft fonts: Other fonts:
================ ============
@@ -54,6 +57,13 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>Nimbus Sans</family>
+ <default>
+ <family>Helvetica</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Heros</family>
<default>
<family>Helvetica</family>
@@ -61,9 +71,16 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>Nimbus Sans Narrow</family>
+ <default>
+ <family>Helvetica Narrow</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Heros Cn</family>
<default>
- <family>Helvetica Condensed</family>
+ <family>Helvetica Narrow</family>
</default>
</alias>
@@ -75,6 +92,13 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>Nimbus Roman</family>
+ <default>
+ <family>Times</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Termes</family>
<default>
<family>Times</family>
@@ -89,6 +113,20 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>Nimbus Mono</family>
+ <default>
+ <family>Courier</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
+ <family>Nimbus Mono PS</family>
+ <default>
+ <family>Courier</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Cursor</family>
<default>
<family>Courier</family>
@@ -110,6 +148,13 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>URW Gothic</family>
+ <default>
+ <family>ITC Avant Garde Gothic</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Adventor</family>
<default>
<family>ITC Avant Garde Gothic</family>
@@ -131,6 +176,20 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>Bookman URW</family>
+ <default>
+ <family>ITC Bookman</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
+ <family>URW Bookman</family>
+ <default>
+ <family>ITC Bookman</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Bonum</family>
<default>
<family>ITC Bookman</family>
@@ -159,6 +218,20 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>Chancery URW</family>
+ <default>
+ <family>ITC Zapf Chancery</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
+ <family>Z003</family>
+ <default>
+ <family>ITC Zapf Chancery</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Chorus</family>
<default>
<family>ITC Zapf Chancery</family>
@@ -173,6 +246,20 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>Palladio URW</family>
+ <default>
+ <family>Palatino</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
+ <family>P052</family>
+ <default>
+ <family>Palatino</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Pagella</family>
<default>
<family>Palatino</family>
@@ -194,6 +281,20 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias binding="same">
+ <family>Century SchoolBook URW</family>
+ <default>
+ <family>New Century Schoolbook</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
+ <family>C059</family>
+ <default>
+ <family>New Century Schoolbook</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
<family>TeX Gyre Schola</family>
<default>
<family>New Century Schoolbook</family>
@@ -307,7 +408,26 @@ but in an order preferring similar designs first. We do this in three steps:
</default>
</alias>
+ <alias binding="same">
+ <family>Caladea</family>
+ <default>
+ <family>Cambria</family>
+ </default>
+ </alias>
+
+ <alias binding="same">
+ <family>Carlito</family>
+ <default>
+ <family>Calibri</family>
+ </default>
+ </alias>
+ <alias binding="same">
+ <family>SymbolNeu</family>
+ <default>
+ <family>Symbol</family>
+ </default>
+ </alias>
<!-- Accept the other group as fallback -->
@@ -320,7 +440,7 @@ but in an order preferring similar designs first. We do this in three steps:
</alias>
<alias>
- <family>Helvetica Condensed</family>
+ <family>Helvetica Narrow</family>
<default>
<family>Arial Narrow</family>
</default>
@@ -352,7 +472,7 @@ but in an order preferring similar designs first. We do this in three steps:
<alias>
<family>Arial Narrow</family>
<default>
- <family>Helvetica Condensed</family>
+ <family>Helvetica Narrow</family>
</default>
</alias>
@@ -379,14 +499,16 @@ but in an order preferring similar designs first. We do this in three steps:
<family>Helvetica</family>
<accept>
<family>TeX Gyre Heros</family>
+ <family>Nimbus Sans</family>
<family>Nimbus Sans L</family>
</accept>
</alias>
<alias binding="same">
- <family>Helvetica Condensed</family>
+ <family>Helvetica Narrow</family>
<accept>
<family>TeX Gyre Heros Cn</family>
+ <family>Nimbus Sans Narrow</family>
</accept>
</alias>
@@ -394,6 +516,7 @@ but in an order preferring similar designs first. We do this in three steps:
<family>Times</family>
<accept>
<family>TeX Gyre Termes</family>
+ <family>Nimbus Roman</family>
<family>Nimbus Roman No9 L</family>
</accept>
</alias>
@@ -402,6 +525,8 @@ but in an order preferring similar designs first. We do this in three steps:
<family>Courier</family>
<accept>
<family>TeX Gyre Cursor</family>
+ <family>Nimbus Mono PS</family>
+ <family>Nimbus Mono</family>
<family>Nimbus Mono L</family>
</accept>
</alias>
@@ -410,6 +535,7 @@ but in an order preferring similar designs first. We do this in three steps:
<family>ITC Avant Garde Gothic</family>
<accept>
<family>TeX Gyre Adventor</family>
+ <family>URW Gothic</family>
<family>URW Gothic L</family>
</accept>
</alias>
@@ -419,6 +545,8 @@ but in an order preferring similar designs first. We do this in three steps:
<accept>
<family>Bookman Old Style</family>
<family>TeX Gyre Bonum</family>
+ <family>URW Bookman</family>
+ <family>Bookman URW</family>
<family>URW Bookman L</family>
</accept>
</alias>
@@ -427,6 +555,8 @@ but in an order preferring similar designs first. We do this in three steps:
<family>ITC Zapf Chancery</family>
<accept>
<family>TeX Gyre Chorus</family>
+ <family>Z003</family>
+ <family>Chancery URW</family>
<family>URW Chancery L</family>
</accept>
</alias>
@@ -436,6 +566,8 @@ but in an order preferring similar designs first. We do this in three steps:
<accept>
<family>Palatino Linotype</family>
<family>TeX Gyre Pagella</family>
+ <family>P052</family>
+ <family>Palladio URW</family>
<family>URW Palladio L</family>
</accept>
</alias>
@@ -445,6 +577,8 @@ but in an order preferring similar designs first. We do this in three steps:
<accept>
<family>Century Schoolbook</family>
<family>TeX Gyre Schola</family>
+ <family>C059</family>
+ <family>Century SchoolBook URW</family>
<family>Century Schoolbook L</family>
</accept>
</alias>
@@ -494,4 +628,25 @@ but in an order preferring similar designs first. We do this in three steps:
</accept>
</alias>
+ <alias binding="same">
+ <family>Cambria</family>
+ <accept>
+ <family>Caladea</family>
+ </accept>
+ </alias>
+
+ <alias binding="same">
+ <family>Calibri</family>
+ <accept>
+ <family>Carlito</family>
+ </accept>
+ </alias>
+
+ <alias binding="same">
+ <family>Symbol</family>
+ <accept>
+ <family>SymbolNeu</family>
+ </accept>
+ </alias>
+
</fontconfig>
diff --git a/chromium/third_party/fontconfig/src/conf.d/30-urw-aliases.conf b/chromium/third_party/fontconfig/src/conf.d/30-urw-aliases.conf
index e0d45da8760..cfde071fbff 100644
--- a/chromium/third_party/fontconfig/src/conf.d/30-urw-aliases.conf
+++ b/chromium/third_party/fontconfig/src/conf.d/30-urw-aliases.conf
@@ -7,17 +7,26 @@
-->
<alias binding="same">
<family>Zapf Dingbats</family>
- <accept><family>Dingbats</family></accept>
+ <accept>
+ <family>D050000L</family>
+ <family>Dingbats</family>
+ </accept>
</alias>
<alias binding="same">
<family>ITC Zapf Dingbats</family>
- <accept><family>Dingbats</family></accept>
+ <accept>
+ <family>D050000L</family>
+ <family>Dingbats</family>
+ </accept>
</alias>
<match target="pattern">
<test name="family" compare="eq" ignore-blanks="true">
<string>Symbol</string>
</test>
<edit name="family" mode="append" binding="same">
+ <string>Standard Symbols PS</string>
+ </edit>
+ <edit name="family" mode="append" binding="same">
<string>Standard Symbols L</string>
</edit>
</match>
diff --git a/chromium/third_party/fontconfig/src/conf.d/45-latin.conf b/chromium/third_party/fontconfig/src/conf.d/45-latin.conf
index aa62ed42e7f..c6696f8d6f2 100644
--- a/chromium/third_party/fontconfig/src/conf.d/45-latin.conf
+++ b/chromium/third_party/fontconfig/src/conf.d/45-latin.conf
@@ -14,23 +14,31 @@
<default><family>serif</family></default>
</alias>
<alias>
+ <family>Cambria</family>
+ <default><family>serif</family></default>
+ </alias>
+ <alias>
+ <family>Constantia</family>
+ <default><family>serif</family></default>
+ </alias>
+ <alias>
<family>DejaVu Serif</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Liberation Serif</family>
+ <family>Elephant</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Times New Roman</family>
+ <family>Garamond</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Times</family>
+ <family>Georgia</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Nimbus Roman No9 L</family>
+ <family>Liberation Serif</family>
<default><family>serif</family></default>
</alias>
<alias>
@@ -38,42 +46,50 @@
<default><family>serif</family></default>
</alias>
<alias>
- <family>Thorndale AMT</family>
+ <family>MS Serif</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Thorndale</family>
+ <family>Nimbus Roman No9 L</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Georgia</family>
+ <family>Nimbus Roman</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Garamond</family>
+ <family>Palatino Linotype</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Palatino Linotype</family>
+ <family>Thorndale AMT</family>
<default><family>serif</family></default>
</alias>
<alias>
- <family>Trebuchet MS</family>
+ <family>Thorndale</family>
+ <default><family>serif</family></default>
+ </alias>
+ <alias>
+ <family>Times New Roman</family>
+ <default><family>serif</family></default>
+ </alias>
+ <alias>
+ <family>Times</family>
<default><family>serif</family></default>
</alias>
<!--
Sans-serif faces
-->
<alias>
- <family>Bitstream Vera Sans</family>
+ <family>Albany AMT</family>
<default><family>sans-serif</family></default>
</alias>
<alias>
- <family>DejaVu Sans</family>
+ <family>Albany</family>
<default><family>sans-serif</family></default>
</alias>
<alias>
- <family>Liberation Sans</family>
+ <family>Arial Unicode MS</family>
<default><family>sans-serif</family></default>
</alias>
<alias>
@@ -81,19 +97,47 @@
<default><family>sans-serif</family></default>
</alias>
<alias>
+ <family>Bitstream Vera Sans</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>Britannic</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>Calibri</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>Candara</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>Century Gothic</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>Corbel</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>DejaVu Sans</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
<family>Helvetica</family>
<default><family>sans-serif</family></default>
</alias>
<alias>
- <family>Verdana</family>
+ <family>Haettenschweiler</family>
<default><family>sans-serif</family></default>
</alias>
<alias>
- <family>Albany AMT</family>
+ <family>Liberation Sans</family>
<default><family>sans-serif</family></default>
</alias>
<alias>
- <family>Albany</family>
+ <family>MS Sans Serif</family>
<default><family>sans-serif</family></default>
</alias>
<alias>
@@ -101,88 +145,128 @@
<default><family>sans-serif</family></default>
</alias>
<alias>
+ <family>Nimbus Sans</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
<family>Luxi Sans</family>
<default><family>sans-serif</family></default>
</alias>
+ <alias>
+ <family>Tahoma</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>Trebuchet MS</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>Twentieth Century</family>
+ <default><family>sans-serif</family></default>
+ </alias>
+ <alias>
+ <family>Verdana</family>
+ <default><family>sans-serif</family></default>
+ </alias>
<!--
Monospace faces
-->
+ <alias>
+ <family>Andale Mono</family>
+ <default><family>monospace</family></default>
+ </alias>
<alias>
<family>Bitstream Vera Sans Mono</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>DejaVu Sans Mono</family>
+ <family>Consolas</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>Liberation Mono</family>
+ <family>Courier New</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>Inconsolata</family>
+ <family>Courier</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>Courier New</family>
+ <family>Cumberland AMT</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>Courier</family>
+ <family>Cumberland</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>Andale Mono</family>
+ <family>DejaVu Sans Mono</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>Luxi Mono</family>
+ <family>Fixedsys</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>Cumberland AMT</family>
+ <family>Inconsolata</family>
<default><family>monospace</family></default>
</alias>
<alias>
- <family>Cumberland</family>
+ <family>Liberation Mono</family>
+ <default><family>monospace</family></default>
+ </alias>
+ <alias>
+ <family>Luxi Mono</family>
<default><family>monospace</family></default>
</alias>
<alias>
<family>Nimbus Mono L</family>
<default><family>monospace</family></default>
</alias>
+ <alias>
+ <family>Nimbus Mono</family>
+ <default><family>monospace</family></default>
+ </alias>
+ <alias>
+ <family>Nimbus Mono PS</family>
+ <default><family>monospace</family></default>
+ </alias>
+ <alias>
+ <family>Terminal</family>
+ <default><family>monospace</family></default>
+ </alias>
<!--
Fantasy faces
-->
- <alias>
- <family>Impact</family>
+ <alias>
+ <family>Bauhaus Std</family>
<default><family>fantasy</family></default>
</alias>
<alias>
- <family>Copperplate Gothic Std</family>
+ <family>Cooper Std</family>
<default><family>fantasy</family></default>
</alias>
<alias>
- <family>Cooper Std</family>
+ <family>Copperplate Gothic Std</family>
<default><family>fantasy</family></default>
</alias>
<alias>
- <family>Bauhaus Std</family>
+ <family>Impact</family>
<default><family>fantasy</family></default>
</alias>
<!--
Cursive faces
-->
<alias>
- <family>ITC Zapf Chancery Std</family>
+ <family>Comic Sans MS</family>
<default><family>cursive</family></default>
</alias>
<alias>
- <family>Zapfino</family>
+ <family>ITC Zapf Chancery Std</family>
<default><family>cursive</family></default>
</alias>
<alias>
- <family>Comic Sans MS</family>
+ <family>Zapfino</family>
<default><family>cursive</family></default>
</alias>
diff --git a/chromium/third_party/fontconfig/src/conf.d/60-latin.conf b/chromium/third_party/fontconfig/src/conf.d/60-latin.conf
index 2107e31e4b4..23ee91b253f 100644
--- a/chromium/third_party/fontconfig/src/conf.d/60-latin.conf
+++ b/chromium/third_party/fontconfig/src/conf.d/60-latin.conf
@@ -10,6 +10,7 @@
<family>Thorndale AMT</family>
<family>Luxi Serif</family>
<family>Nimbus Roman No9 L</family>
+ <family>Nimbus Roman</family>
<family>Times</family>
</prefer>
</alias>
@@ -23,6 +24,7 @@
<family>Albany AMT</family>
<family>Luxi Sans</family>
<family>Nimbus Sans L</family>
+ <family>Nimbus Sans</family>
<family>Helvetica</family>
<family>Lucida Sans Unicode</family>
<family>BPG Glaho International</family> <!-- lat,cyr,arab,geor -->
@@ -40,6 +42,8 @@
<family>Cumberland AMT</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
+ <family>Nimbus Mono</family>
+ <family>Nimbus Mono PS</family>
<family>Courier</family>
</prefer>
</alias>
diff --git a/chromium/third_party/fontconfig/src/conf.d/Makefile.am b/chromium/third_party/fontconfig/src/conf.d/Makefile.am
index d61756b816c..ac68cd15dc4 100644
--- a/chromium/third_party/fontconfig/src/conf.d/Makefile.am
+++ b/chromium/third_party/fontconfig/src/conf.d/Makefile.am
@@ -26,6 +26,7 @@ DOC_SOURCES = README.in
DOC_FILES = $(DOC_SOURCES:.in=)
CONF_LINKS = \
+ 10-hinting-$(PREFERRED_HINTING).conf \
10-scale-bitmap-fonts.conf \
20-unhint-small-vera.conf \
30-urw-aliases.conf \
@@ -51,6 +52,10 @@ config_DATA = $(DOC_FILES)
templatedir = $(TEMPLATEDIR)
template_DATA = \
10-autohint.conf \
+ 10-hinting-full.conf \
+ 10-hinting-medium.conf \
+ 10-hinting-none.conf \
+ 10-hinting-slight.conf \
10-no-sub-pixel.conf \
10-scale-bitmap-fonts.conf \
10-sub-pixel-bgr.conf \
diff --git a/chromium/third_party/fontconfig/src/config/Makedefs.in b/chromium/third_party/fontconfig/src/config/Makedefs.in
deleted file mode 100644
index ae75aff4911..00000000000
--- a/chromium/third_party/fontconfig/src/config/Makedefs.in
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# fontconfig/config/Makedefs.in
-#
-# Copyright © 2002 Keith Packard
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of the author(s) not be used in
-# advertising or publicity pertaining to distribution of the software without
-# specific, written prior permission. The authors make no
-# representations about the suitability of this software for any purpose. It
-# is provided "as is" without express or implied warranty.
-#
-# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-#
-
-SHELL = @SHELL@
-
-srcdir=@srcdir@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-bindir=@bindir@
-datadir=@datadir@
-includedir=@includedir@
-sysconfdir=@sysconfdir@
-confdir=@confdir@
-
-DSO_LDOPTS=@DSO_LDOPTS@
-DSO_CFLAGS=@DSO_CFLAGS@
-DSO_PIC_CFLAGS=@DSO_PIC_CFLAGS@
-
-INSTALL=@INSTALL@
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
-INSTALL_SCRIPT=@INSTALL_SCRIPT@
-INSTALL_DATA=@INSTALL_DATA@
-MKSHLIB=@MKSHLIB@
-LN_S=@LN_S@
-
-# shared libraries
-LIBDIR=$(libdir)
-# programs
-BINDIR=$(bindir)
-# font configuration files
-CONFDIR=@CONFDIR@
-# include files
-INCLUDEDIR=$(includedir)/fontconfig
-
-X_FONT_DIR=@X_FONT_DIR@
-FC_DEFAULT_FONTS=@FC_DEFAULT_FONTS@
-FCPATH_DEF=-DFONTCONFIG_PATH=\"$(CONFDIR)\"
-
-CDEBUGFLAGS=@CFLAGS@
-
-INCLUDES=-I$(TOPDIR) -I$(srcdir) @CPPFLAGS@
-
-CFLAGS=$(CDEBUGFLAGS) @DEFS@ $(FCPATH_DEF) $(INCLUDES)
-
-LIBBASE=libfontconfig.so
-LIBFILE=$(LIBBASE).@PACKAGE_MAJOR@.@PACKAGE_MINOR@
-LIBMAJOR=$(LIBBASE).@PACKAGE_MAJOR@
-
-LIBFONTCONFIG=-L$(SRCDIR) -lfontconfig
-
-SRCDIR=$(TOPDIR)/src
-
-INCDIR=$(TOPDIR)/fontconfig
-HEADERS=$(INCDIR)/fontconfig.h $(INCDIR)/fcfreetype.h $(INCDIR)/fcprivate.h
diff --git a/chromium/third_party/fontconfig/src/config/config-subst b/chromium/third_party/fontconfig/src/config/config-subst
deleted file mode 100644
index 5907e03286a..00000000000
--- a/chromium/third_party/fontconfig/src/config/config-subst
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-script=config-subst.$$
-trap "rm $script" 0
-rm -f $script
-for i in ${1+"$@"}; do
- var="`echo "$i" | sed 's/=.*$//'`"
- val="`echo "$i" | sed 's/^[^=]*=//'`"
- echo "s;@$var@;$val;" >> $script
-done
-sed -f $script
diff --git a/chromium/third_party/fontconfig/src/config/config.guess b/chromium/third_party/fontconfig/src/config/config.guess
deleted file mode 100644
index c38553dc74b..00000000000
--- a/chromium/third_party/fontconfig/src/config/config.guess
+++ /dev/null
@@ -1,1497 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
-timestamp='2006-02-23'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:MSYS_NT-*:*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- x86:Interix*:[345]*)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T:Interix*:[345]*)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
- exit ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-gnu
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
-and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/chromium/third_party/fontconfig/src/config/config.sub b/chromium/third_party/fontconfig/src/config/config.sub
deleted file mode 100644
index ad9f3957118..00000000000
--- a/chromium/third_party/fontconfig/src/config/config.sub
+++ /dev/null
@@ -1,1608 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
-timestamp='2006-02-23'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | mt \
- | msp430 \
- | nios | nios2 \
- | ns16k | ns32k \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b \
- | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m32c)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- m32c-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16c)
- basic_machine=cr16c-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/chromium/third_party/fontconfig/src/config/install.sh b/chromium/third_party/fontconfig/src/config/install.sh
deleted file mode 100644
index ddbcef3d91d..00000000000
--- a/chromium/third_party/fontconfig/src/config/install.sh
+++ /dev/null
@@ -1,240 +0,0 @@
-#! /bin/sh
-#
-# fontconfig/config/install.sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-tranformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/chromium/third_party/fontconfig/src/configure.ac b/chromium/third_party/fontconfig/src/configure.ac
index c3743f43589..49488162ece 100644
--- a/chromium/third_party/fontconfig/src/configure.ac
+++ b/chromium/third_party/fontconfig/src/configure.ac
@@ -33,30 +33,10 @@ dnl This is the package version number, not the shared library
dnl version. This same version number must appear in fontconfig/fontconfig.h
dnl Yes, it is a pain to synchronize version numbers. Unfortunately, it's
dnl not possible to extract the version number here from fontconfig.h
-AC_INIT([fontconfig], [2.11.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig])
+AC_INIT([fontconfig], [2.12.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig])
AM_INIT_AUTOMAKE([1.11 parallel-tests dist-bzip2])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
-dnl libtool versioning
-
-dnl bump revision when fixing bugs
-dnl bump current and age, reset revision to zero when adding APIs
-dnl bump current, leave age, reset revision to zero when changing/removing APIS
-LIBT_CURRENT=9
-LIBT_REVISION=0
-AC_SUBST(LIBT_CURRENT)
-AC_SUBST(LIBT_REVISION)
-LIBT_AGE=8
-
-LIBT_VERSION_INFO="$LIBT_CURRENT:$LIBT_REVISION:$LIBT_AGE"
-AC_SUBST(LIBT_VERSION_INFO)
-
-LIBT_CURRENT_MINUS_AGE=`expr $LIBT_CURRENT - $LIBT_AGE`
-AC_SUBST(LIBT_CURRENT_MINUS_AGE)
-
-PKGCONFIG_REQUIRES=
-PKGCONFIG_REQUIRES_PRIVATELY=
-
dnl ==========================================================================
AC_CONFIG_HEADERS(config.h)
@@ -67,14 +47,14 @@ AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_PROG_INSTALL
AC_PROG_LN_S
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
AM_MISSING_PROG([GIT], [git])
AM_MISSING_PROG([GPERF], [gperf])
+AM_PATH_PYTHON(,, [:])
+AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
AC_MSG_CHECKING([for RM macro])
_predefined_rm=`make -p -f /dev/null 2>/dev/null|grep '^RM ='|sed -e 's/^RM = //'`
@@ -85,6 +65,30 @@ else
AC_MSG_RESULT($_predefined_rm)
fi
+dnl Initialize libtool
+LT_PREREQ([2.2])
+LT_INIT([disable-static win32-dll])
+
+dnl libtool versioning
+
+dnl bump revision when fixing bugs
+dnl bump current and age, reset revision to zero when adding APIs
+dnl bump current, leave age, reset revision to zero when changing/removing APIS
+LIBT_CURRENT=10
+LIBT_REVISION=2
+AC_SUBST(LIBT_CURRENT)
+AC_SUBST(LIBT_REVISION)
+LIBT_AGE=9
+
+LIBT_VERSION_INFO="$LIBT_CURRENT:$LIBT_REVISION:$LIBT_AGE"
+AC_SUBST(LIBT_VERSION_INFO)
+
+LIBT_CURRENT_MINUS_AGE=`expr $LIBT_CURRENT - $LIBT_AGE`
+AC_SUBST(LIBT_CURRENT_MINUS_AGE)
+
+PKGCONFIG_REQUIRES=
+PKGCONFIG_REQUIRES_PRIVATELY=
+
dnl ==========================================================================
case "$host" in
@@ -101,11 +105,19 @@ if test "$os_win32" = "yes"; then
fi
AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
+AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
WARN_CFLAGS=""
+WARNING_CPP_DIRECTIVE="no"
if test "x$GCC" = "xyes"; then
WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -fno-strict-aliasing"
+ WARNING_CPP_DIRECTIVE="yes"
+elif test "x$SUNCC" = "xyes"; then
+ WARN_CFLAGS="-v -fd"
+ WARNING_CPP_DIRECTIVE="yes"
+fi
+if test "x$WARNING_CPP_DIRECTIVE" = "xyes"; then
AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
[Can use #warning in C files])
fi
@@ -136,7 +148,7 @@ dnl ==========================================================================
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h regex.h stdlib.h string.h unistd.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h])
+AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h sys/statvfs.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h])
AX_CREATE_STDINT_H([src/fcstdint.h])
# Checks for typedefs, structures, and compiler characteristics.
@@ -148,54 +160,15 @@ AC_TYPE_PID_T
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
-AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
+AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s mkdtemp getopt getopt_long getprogname getexecname rand random lrand48 random_r rand_r readlink fstatvfs fstatfs lstat])
dnl AC_CHECK_FUNCS doesn't check for header files.
dnl posix_fadvise() may be not available in older libc.
-fc_saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $WARN_CFLAGS -Werror"
-AC_MSG_CHECKING([for posix_fadvise])
-AC_LINK_IFELSE([AC_LANG_SOURCE([[
- #include <fcntl.h>
- int main(void) {
- return posix_fadvise(0, 0, 0, 0);
- }
- ]])],[
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_POSIX_FADVISE], [1], [Define to 1 if you have the 'posix_fadvise' function.])
- ],[AC_MSG_RESULT([no])])
-if test "$os_win32" = "no"; then
- AC_MSG_CHECKING([for scandir])
- AC_LINK_IFELSE([AC_LANG_SOURCE([[
- #include <dirent.h>
- int comp(const struct dirent **, const struct dirent **);
- int comp(const struct dirent **a, const struct dirent **b) { return 0; }
- int main(void) {
- struct dirent **d;
- return scandir(".", &d, 0, &comp) >= 0;
- }
- ]])],[
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_SCANDIR], [1], [Define to 1 if you have the 'scandir' function.])
- ],[
- AC_LINK_IFELSE([AC_LANG_SOURCE([[
- #include <dirent.h>
- int comp(const void *, const void *);
- int comp(const void *a, const void *b) { return 0; }
- int main(void) {
- struct dirent **d;
- return scandir(".", &d, 0, &comp) >= 0;
- }
- ]])],[
- AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_SCANDIR_VOID_P], [1], [Define to 1 if you have the 'scandir' function with int (* compar)(const void *, const void *)])
- ],[
- AC_MSG_ERROR([
-*** No scandir function available.])
- ])
- ])
-fi
-CFLAGS="$fc_saved_CFLAGS"
+AC_CHECK_SYMBOL([posix_fadvise], [fcntl.h], [fc_func_posix_fadvise=1], [fc_func_posix_fadvise=0])
+AC_DEFINE_UNQUOTED([HAVE_POSIX_FADVISE], [$fc_func_posix_fadvise], [Define to 1 if you have the 'posix_fadvise' function.])
+
+#
+AC_CHECK_MEMBERS([struct stat.st_mtim],,, [#include <sys/stat.h>])
#
if test "x$ac_cv_func_fstatvfs" = "xyes"; then
@@ -219,12 +192,6 @@ if test "x$ac_cv_func_fstatfs" = "xyes"; then
fi
AC_CHECK_MEMBERS([struct dirent.d_type],,,
[#include <dirent.h>])
-#
-# regex
-#
-if test "x$ac_cv_func_regcomp" = "xyes" -a "x$ac_cv_func_regerror" = "xyes" -a "x$ac_cv_func_regexec" = "xyes" -a "x$ac_cv_func_regfree"; then
- AC_DEFINE(USE_REGEX,,[Use regex])
-fi
#
# Checks for iconv
@@ -329,6 +296,10 @@ AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
#include FT_FREETYPE_H])
AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM,
[FT_Bitmap_Size structure includes y_ppem field])
+AC_CHECK_MEMBERS([TT_OS2.usLowerOpticalPointSize, TT_OS2.usUpperOpticalPointSize], [], [], [[
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_TRUETYPE_TABLES_H]])
CFLAGS="$fontconfig_save_cflags"
LIBS="$fontconfig_save_libs"
@@ -435,6 +406,25 @@ if test "$enable_libxml2" = "yes"; then
fi
#
+# Set default hinting
+#
+
+AC_ARG_WITH(default-hinting,
+ [AC_HELP_STRING([--with-default-hinting=NAME],
+ [Enable your preferred hinting configuration (none/slight/medium/full) [default=slight]])],
+ preferred_hinting="$withval", preferred_hinting=slight)
+
+case "$preferred_hinting" in
+none|slight|medium|full)
+ PREFERRED_HINTING="$preferred_hinting"
+ AC_SUBST(PREFERRED_HINTING)
+ ;;
+*)
+ AC_MSG_ERROR([Invalid hinting. please choose one of none, slight, medium, or full])
+ ;;
+esac
+
+#
# Set default font directory
#
@@ -531,7 +521,7 @@ AC_ARG_WITH(cache-dir,
case $fc_cachedir in
no|yes)
if test "$os_win32" = "yes"; then
- fc_cachedir="WINDOWSTEMPDIR_FONTCONFIG_CACHE"
+ fc_cachedir="LOCAL_APPDATA_FONTCONFIG_CACHE"
else
fc_cachedir='${localstatedir}/cache/${PACKAGE}'
fi
@@ -714,6 +704,7 @@ dnl Figure out what cache format suffix to use for this architecture
AC_C_BIGENDIAN
AC_CHECK_SIZEOF([void *])
AC_CHECK_ALIGNOF([double])
+AC_CHECK_ALIGNOF([void *])
dnl include the header file for workaround of miscalculating size on autoconf
dnl particularly for fat binaries
@@ -730,6 +721,7 @@ Makefile
fontconfig/Makefile
fc-lang/Makefile
fc-glyphname/Makefile
+fc-blanks/Makefile
fc-case/Makefile
src/Makefile
conf.d/Makefile
diff --git a/chromium/third_party/fontconfig/src/doc/Makefile.am b/chromium/third_party/fontconfig/src/doc/Makefile.am
index 78a7cdbf1e2..9141ab2364f 100644
--- a/chromium/third_party/fontconfig/src/doc/Makefile.am
+++ b/chromium/third_party/fontconfig/src/doc/Makefile.am
@@ -81,9 +81,11 @@ DOC_FUNCS_FNCS = \
fcobjectset.fncs \
fcobjecttype.fncs \
fcpattern.fncs \
+ fcrange.fncs \
fcstring.fncs \
fcstrset.fncs \
fcvalue.fncs \
+ fcweight.fncs \
$(NULL)
SGML_FILES = \
fontconfig-user.sgml \
diff --git a/chromium/third_party/fontconfig/src/doc/fccache.fncs b/chromium/third_party/fontconfig/src/doc/fccache.fncs
index ca8ffa03c0d..34ce63f2780 100644
--- a/chromium/third_party/fontconfig/src/doc/fccache.fncs
+++ b/chromium/third_party/fontconfig/src/doc/fccache.fncs
@@ -74,6 +74,7 @@ FcCacheCopySet.
@PURPOSE@
This tries to clean up the cache directory of <parameter>cache_dir</parameter>.
This returns FcTrue if the operation is successfully complete. otherwise FcFalse.
+@SINCE@ 2.9.91
@@
@RET@ void
@@ -83,4 +84,5 @@ This returns FcTrue if the operation is successfully complete. otherwise FcFalse
@DESC@
This tries to create CACHEDIR.TAG file at the cache directory registered
to <parameter>config</parameter>.
+@SINCE@ 2.9.91
@@
diff --git a/chromium/third_party/fontconfig/src/doc/fccharset.fncs b/chromium/third_party/fontconfig/src/doc/fccharset.fncs
index efcd0ccf15d..7245a2a0ee5 100644
--- a/chromium/third_party/fontconfig/src/doc/fccharset.fncs
+++ b/chromium/third_party/fontconfig/src/doc/fccharset.fncs
@@ -60,6 +60,7 @@ running out of memory.
<function>FcCharSetDelChar</function> deletes a single Unicode char from the set,
returning FcFalse on failure, either as a result of a constant set or from
running out of memory.
+@SINCE@ 2.9.0
@@
@RET@ FcCharSet *
diff --git a/chromium/third_party/fontconfig/src/doc/fcconfig.fncs b/chromium/third_party/fontconfig/src/doc/fcconfig.fncs
index 0491a566f48..a2ce5c84db2 100644
--- a/chromium/third_party/fontconfig/src/doc/fcconfig.fncs
+++ b/chromium/third_party/fontconfig/src/doc/fcconfig.fncs
@@ -59,7 +59,8 @@ cause a new configuration to be created for use as current configuration.
@PURPOSE@ Set configuration as default
@DESC@
Sets the current default configuration to <parameter>config</parameter>. Implicitly calls
-FcConfigBuildFonts if necessary, returning FcFalse if that call fails.
+FcConfigBuildFonts if necessary, and FcConfigReference() to inrease the reference count
+in <parameter>config</parameter> since 2.12.0, returning FcFalse if that call fails.
@@
@RET@ FcConfig *
@@ -218,8 +219,9 @@ If <parameter>config</parameter> is NULL, the current configuration is used.
@PURPOSE@ Add font file to font database
@DESC@
Adds an application-specific font to the configuration. Returns FcFalse
-if the fonts cannot be added (due to allocation failure). Otherwise returns FcTrue.
-If <parameter>config</parameter> is NULL, the current configuration is used.
+if the fonts cannot be added (due to allocation failure or no fonts found).
+Otherwise returns FcTrue. If <parameter>config</parameter> is NULL,
+the current configuration is used.
@@
@RET@ FcBool
@@ -230,8 +232,9 @@ If <parameter>config</parameter> is NULL, the current configuration is used.
@DESC@
Scans the specified directory for fonts, adding each one found to the
application-specific set of fonts. Returns FcFalse
-if the fonts cannot be added (due to allocation failure). Otherwise returns FcTrue.
-If <parameter>config</parameter> is NULL, the current configuration is used.
+if the fonts cannot be added (due to allocation failure).
+Otherwise returns FcTrue. If <parameter>config</parameter> is NULL,
+the current configuration is used.
@@
@RET@ void
@@ -378,6 +381,7 @@ parse error, semantic error or allocation failure. Otherwise returns FcTrue.
@PURPOSE@ Obtain the system root directory
@DESC@
Obtrains the system root directory in 'config' if available.
+@SINCE@ 2.10.92
@@
@RET@ void
@@ -390,5 +394,6 @@ Set 'sysroot' as the system root directory. fontconfig prepend 'sysroot'
to the cache directories in order to allow people to generate caches at
the build time. Note that this causes changing current config. i.e.
this function calls FcConfigSetCurrent() internally.
+@SINCE@ 2.10.92
@@
diff --git a/chromium/third_party/fontconfig/src/doc/fcdircache.fncs b/chromium/third_party/fontconfig/src/doc/fcdircache.fncs
index 24dea8bc56b..faeba292802 100644
--- a/chromium/third_party/fontconfig/src/doc/fcdircache.fncs
+++ b/chromium/third_party/fontconfig/src/doc/fcdircache.fncs
@@ -55,6 +55,17 @@ FcDirCacheRead.
@@
@RET@ FcCache *
+@FUNC@ FcDirCacheRescan
+@TYPE1@ const FcChar8 * @ARG1@ dir
+@TYPE2@ FcConfig * @ARG2@ config
+@PURPOSE@ Re-scan a directory cache
+@DESC@
+Re-scan directories only at <parameter>dir</parameter> and update the cache.
+returns NULL if failed.
+@SINCE@ 2.11.1
+@@
+
+@RET@ FcCache *
@FUNC@ FcDirCacheRead
@TYPE1@ const FcChar8 * @ARG1@ dir
@TYPE2@ FcBool% @ARG2@ force
diff --git a/chromium/third_party/fontconfig/src/doc/fcformat.fncs b/chromium/third_party/fontconfig/src/doc/fcformat.fncs
index c136e8cf27c..71b866b88a7 100644
--- a/chromium/third_party/fontconfig/src/doc/fcformat.fncs
+++ b/chromium/third_party/fontconfig/src/doc/fcformat.fncs
@@ -305,4 +305,5 @@ For example, the format "%{family|downcase|delete( )}\n" will expand
to the values of the family element in <parameter>pattern</parameter>,
lower-cased and with spaces removed.
+@SINCE@ 2.9.0
@@
diff --git a/chromium/third_party/fontconfig/src/doc/fclangset.fncs b/chromium/third_party/fontconfig/src/doc/fclangset.fncs
index c08d60c7096..c7ed83b3448 100644
--- a/chromium/third_party/fontconfig/src/doc/fclangset.fncs
+++ b/chromium/third_party/fontconfig/src/doc/fclangset.fncs
@@ -68,6 +68,7 @@ two or three letter language from ISO 639 and Tt is a territory from ISO
<parameter>lang</parameter> should be of the form Ll-Tt where Ll is a
two or three letter language from ISO 639 and Tt is a territory from ISO
3166.
+@SINCE@ 2.9.0
@@
@RET@ FcLangSet *
@@ -77,6 +78,7 @@ two or three letter language from ISO 639 and Tt is a territory from ISO
@PURPOSE@ Add langsets
@DESC@
Returns a set including only those languages found in either <parameter>ls_a</parameter> or <parameter>ls_b</parameter>.
+@SINCE@ 2.9.0
@@
@RET@ FcLangSet *
@@ -86,6 +88,7 @@ Returns a set including only those languages found in either <parameter>ls_a</pa
@PURPOSE@ Subtract langsets
@DESC@
Returns a set including only those languages found in <parameter>ls_a</parameter> but not in <parameter>ls_b</parameter>.
+@SINCE@ 2.9.0
@@
@RET@ FcLangResult
@@ -161,6 +164,8 @@ has no matching language, this function returns FcLangDifferentLang.
Returns a string set of the default languages according to the environment variables on the system.
This function looks for them in order of FC_LANG, LC_ALL, LC_CTYPE and LANG then.
If there are no valid values in those environment variables, "en" will be set as fallback.
+@SINCE@ 2.9.91
+@@
@RET@ FcStrSet *
@FUNC@ FcLangSetGetLangs
@@ -184,6 +189,7 @@ Returns a string set of all known languages.
@PURPOSE@ Normalize the language string
@DESC@
Returns a string to make <parameter>lang</parameter> suitable on fontconfig.
+@SINCE@ 2.10.91
@@
@RET@ const FcCharSet *
diff --git a/chromium/third_party/fontconfig/src/doc/fcpattern.fncs b/chromium/third_party/fontconfig/src/doc/fcpattern.fncs
index 1df1c4f6184..1049d77af07 100644
--- a/chromium/third_party/fontconfig/src/doc/fcpattern.fncs
+++ b/chromium/third_party/fontconfig/src/doc/fcpattern.fncs
@@ -181,12 +181,21 @@ values added to the list have binding <parameter>weak</parameter> instead of <pa
@TYPE2+++++++@ const char * @ARG2+++++++@ object
@TYPE3+++++++@ const FcLangSet * @ARG3+++++++@ l
+@PROTOTYPE++++++++@
+@RET++++++++@ FcBool
+@FUNC++++++++@ FcPatternAddRange
+@TYPE1++++++++@ FcPattern * @ARG1++++++++@ p
+@TYPE2++++++++@ const char * @ARG2++++++++@ object
+@TYPE3++++++++@ const FcRange * @ARG3++++++++@ r
+
@PURPOSE@ Add a typed value to a pattern
@DESC@
These are all convenience functions that insert objects of the specified
type into the pattern. Use these in preference to FcPatternAdd as they
will provide compile-time typechecking. These all append values to
any existing list of values.
+
+<function>FcPatternAddRange</function> are available since 2.11.91.
@@
@RET@ FcResult
@@ -257,16 +266,24 @@ within the pattern directly. Applications must not free this value.
@FUNC++++++@ FcPatternGetFTFace
@TYPE1++++++@ FcPattern * @ARG1++++++@ p
@TYPE2++++++@ const char * @ARG2++++++@ object
-@TYPE3+++++@ int% @ARG3+++++@ n
-@TYPE3++++++@ FT_Face * @ARG3++++++@ f
+@TYPE3++++++@ int% @ARG3++++++@ n
+@TYPE4++++++@ FT_Face * @ARG4++++++@ f
@PROTOTYPE+++++++@
@RET+++++++@ FcResult
@FUNC+++++++@ FcPatternGetLangSet
@TYPE1+++++++@ FcPattern * @ARG1+++++++@ p
@TYPE2+++++++@ const char * @ARG2+++++++@ object
-@TYPE3+++++@ int% @ARG3+++++@ n
-@TYPE3+++++++@ FcLangSet ** @ARG3+++++++@ l
+@TYPE3+++++++@ int% @ARG3+++++++@ n
+@TYPE4+++++++@ FcLangSet ** @ARG4+++++++@ l
+
+@PROTOTYPE++++++++@
+@RET++++++++@ FcResult
+@FUNC++++++++@ FcPatternGetRange
+@TYPE1++++++++@ FcPattern * @ARG1++++++++@ p
+@TYPE2++++++++@ const char * @ARG2++++++++@ object
+@TYPE3++++++++@ int% @ARG3++++++++@ n
+@TYPE4++++++++@ FcRange ** @ARG4++++++++@ r
@PURPOSE@ Return a typed value from a pattern
@DESC@
@@ -275,6 +292,8 @@ returned data is of the expected type. They return FcResultTypeMismatch if
this is not the case. Note that these (like FcPatternGet) do not make a
copy of any data structure referenced by the return value. Use these
in preference to FcPatternGet to provide compile-time typechecking.
+
+<function>FcPatternGetRange</function> are available since 2.11.91.
@@
@RET@ FcPattern *
diff --git a/chromium/third_party/fontconfig/src/doc/fcrange.fncs b/chromium/third_party/fontconfig/src/doc/fcrange.fncs
new file mode 100644
index 00000000000..ba76f65b284
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/doc/fcrange.fncs
@@ -0,0 +1,75 @@
+/*
+ * fontconfig/doc/fcrange.fncs
+ *
+ * Copyright © 2003 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+@RET@ FcRange *
+@FUNC@ FcRangeCopy
+@TYPE1@ const FcRange * @ARG1@ range
+@PURPOSE@ Copy a range object
+@DESC@
+<function>FcRangeCopy</function> creates a new FcRange object and
+populates it with the contents of <parameter>range</parameter>.
+@SINCE@ 2.11.91
+@@
+
+@RET@ FcRange *
+@FUNC@ FcRangeCreateDouble
+@TYPE1@ double @ARG1@ begin
+@TYPE2@ double @ARG2@ end
+@PURPOSE@ create a range object for double
+@DESC@
+<function>FcRangeCreateDouble</function> creates a new FcRange object with
+double sized value.
+@SINCE@ 2.11.91
+@@
+
+@RET@ FcRange *
+@FUNC@ FcRangeCreateInteger
+@TYPE1@ int @ARG1@ begin
+@TYPE2@ int @ARG2@ end
+@PURPOSE@ create a range object for integer
+@DESC@
+<function>FcRangeCreateInteger</function> creates a new FcRange object with
+integer sized value.
+@SINCE@ 2.11.91
+@@
+
+@RET@ void
+@FUNC@ FcRangeDestroy
+@TYPE1@ FcRange * @ARG1@ range
+@PURPOSE@ destroy a range object
+@DESC@
+<function>FcRangeDestroy</function> destroys a FcRange object, freeing
+all memory associated with it.
+@SINCE@ 2.11.91
+@@
+
+@RET@ FcBool
+@FUNC@ FcRangeGetDouble
+@TYPE1@ const FcRange * @ARG1@ range
+@TYPE2@ double * @ARG2@ begin
+@TYPE3@ double * @ARG3@ end
+@PURPOSE@ Get the range in double
+@DESC@
+Returns in <parameter>begin</parameter> and <parameter>end</parameter> as the range.
+@SINCE@ 2.11.91
+@@
diff --git a/chromium/third_party/fontconfig/src/doc/fcstrset.fncs b/chromium/third_party/fontconfig/src/doc/fcstrset.fncs
index b96489a43f6..67aa61ac021 100644
--- a/chromium/third_party/fontconfig/src/doc/fcstrset.fncs
+++ b/chromium/third_party/fontconfig/src/doc/fcstrset.fncs
@@ -104,6 +104,7 @@ Creates an iterator to list the strings in <parameter>set</parameter>.
@PURPOSE@ get first string in iteration
@DESC@
Returns the first string in <parameter>list</parameter>.
+@SINCE@ 2.11.0
@@
@RET@ FcChar8 *
diff --git a/chromium/third_party/fontconfig/src/doc/fcweight.fncs b/chromium/third_party/fontconfig/src/doc/fcweight.fncs
new file mode 100644
index 00000000000..2872dd66cb0
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/doc/fcweight.fncs
@@ -0,0 +1,47 @@
+/*
+ * fontconfig/doc/fcweight.fncs
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+@RET@ int
+@FUNC@ FcWeightFromOpenType
+@TYPE1@ int @ARG1@ ot_weight
+@PURPOSE@ Convert from OpenType weight values to fontconfig ones
+@DESC@
+<function>FcWeightFromOpenType</function> returns an integer value
+to use with FC_WEIGHT, from an integer in the 1..1000 range, resembling
+the numbers from OpenType specification's OS/2 usWeight numbers, which
+are also similar to CSS font-weight numbers. If input is negative,
+zero, or greater than 1000, returns -1. This function linearly interpolates
+between various FC_WEIGHT_* constants. As such, the returned value does not
+necessarily match any of the predefined constants.
+@SINCE@ 2.11.91
+@@
+
+@RET@ int
+@FUNC@ FcWeightToOpenType
+@TYPE1@ int @ARG1@ ot_weight
+@PURPOSE@ Convert from fontconfig weight values to OpenType ones
+@DESC@
+<function>FcWeightToOpenType</function> is the inverse of
+<function>FcWeightFromOpenType</function>. If the input is less than
+FC_WEIGHT_THIN or greater than FC_WEIGHT_EXTRABLACK, returns -1. Otherwise
+returns a number in the range 1 to 1000.
+@SINCE@ 2.11.91
+@@
diff --git a/chromium/third_party/fontconfig/src/doc/fontconfig-devel.sgml b/chromium/third_party/fontconfig/src/doc/fontconfig-devel.sgml
index 7306d79247a..d0ec8a579f6 100644
--- a/chromium/third_party/fontconfig/src/doc/fontconfig-devel.sgml
+++ b/chromium/third_party/fontconfig/src/doc/fontconfig-devel.sgml
@@ -16,9 +16,11 @@
<!ENTITY fcobjectset SYSTEM "fcobjectset.sgml">
<!ENTITY fcobjecttype SYSTEM "fcobjecttype.sgml">
<!ENTITY fcpattern SYSTEM "fcpattern.sgml">
+<!ENTITY fcrange SYSTEM "fcrange.sgml">
<!ENTITY fcstring SYSTEM "fcstring.sgml">
<!ENTITY fcstrset SYSTEM "fcstrset.sgml">
<!ENTITY fcvalue SYSTEM "fcvalue.sgml">
+<!ENTITY fcweight SYSTEM "fcweight.sgml">
<!ENTITY version SYSTEM "version.sgml">
]>
<!--
@@ -174,7 +176,9 @@ convenience for the application's rendering mechanism.
outline FC_OUTLINE Bool Whether the glyphs are outlines
scalable FC_SCALABLE Bool Whether glyphs can be scaled
scale FC_SCALE Double Scale factor for point->pixel
- conversions
+ conversions (deprecated)
+ symbol FC_SYMBOL Bool Whether font uses MS symbol-font encoding
+ color FC_COLOR Bool Whether any glyphs have color
dpi FC_DPI Double Target dots per inch
rgba FC_RGBA Int unknown, rgb, bgr, vrgb,
vbgr, none - subpixel geometry
@@ -188,8 +192,13 @@ convenience for the application's rendering mechanism.
fontversion FC_FONTVERSION Int Version number of the font
capability FC_CAPABILITY String List of layout capabilities in
the font
+ fontformat FC_FONTFORMAT String String name of the font format
embolden FC_EMBOLDEN Bool Rasterizer should
synthetically embolden the font
+ embeddedbitmap FC_EMBEDDED_BITMAP Bool Use the embedded bitmap instead
+ of the outline
+ decorative FC_DECORATIVE Bool Whether the style is a decorative
+ variant
fontfeatures FC_FONT_FEATURES String List of extra feature tags in
OpenType to be enabled
namelang FC_NAMELANG String Language name to be used for the
@@ -197,7 +206,7 @@ convenience for the application's rendering mechanism.
stylelang and fullnamelang
prgname FC_PRGNAME String Name of the running program
hash FC_HASH String SHA256 hash value of the font data
- with "sha256:" prefix.
+ with "sha256:" prefix (deprecated)
postscriptname FC_POSTSCRIPT_NAME String Font name in PostScript
</programlisting>
</sect2>
@@ -508,6 +517,12 @@ FcMatrix structures hold an affine transformation in matrix form.
</para>
&fcmatrix;
</sect2>
+ <sect2><title>FcRange</title>
+ <para>
+An FcRange holds two variables to indicate a range in between.
+ </para>
+ &fcrange;
+ </sect2>
<sect2><title>FcConfig</title>
<para>
An FcConfig object holds the internal representation of a configuration.
@@ -529,6 +544,12 @@ Provides for application-specified symbolic constants for font names.
</para>
&fcconstant;
</sect2>
+ <sect2><title>FcWeight</title>
+ <para>
+Maps weights to and from OpenType weights.
+ </para>
+ &fcweight;
+ </sect2>
<sect2><title>FcBlanks</title>
<para>
An FcBlanks object holds a list of Unicode chars which are expected to
diff --git a/chromium/third_party/fontconfig/src/doc/fontconfig-user.sgml b/chromium/third_party/fontconfig/src/doc/fontconfig-user.sgml
index 775d1f725c2..30e7b871af1 100644
--- a/chromium/third_party/fontconfig/src/doc/fontconfig-user.sgml
+++ b/chromium/third_party/fontconfig/src/doc/fontconfig-user.sgml
@@ -119,7 +119,8 @@ convenience for the applications' rendering mechanism.
rasterizer String Which rasterizer is in use (deprecated)
outline Bool Whether the glyphs are outlines
scalable Bool Whether glyphs can be scaled
- scale Double Scale factor for point->pixel conversions
+ color Bool Whether any glyphs have color
+ scale Double Scale factor for point->pixel conversions (deprecated)
dpi Double Target dots per inch
rgba Int unknown, rgb, bgr, vrgb, vbgr,
none - subpixel geometry
@@ -130,9 +131,15 @@ convenience for the applications' rendering mechanism.
font supports
fontversion Int Version number of the font
capability String List of layout capabilities in the font
+ fontformat String String name of the font format
embolden Bool Rasterizer should synthetically embolden the font
+ embeddedbitmap Bool Use the embedded bitmap instead of the outline
+ decorative Bool Whether the style is a decorative variant
fontfeatures String List of the feature tags in OpenType to be enabled
+ namelang String Language name to be used for the default value of
+ familylang, stylelang, and fullnamelang
prgname String String Name of the running program
+ postscriptname String Font family name in PostScript
</programlisting>
</refsect2>
<refsect2>
@@ -251,7 +258,7 @@ debugging messages.
MEMORY 512 Monitor fontconfig memory usage
CONFIG 1024 Monitor which config files are loaded
LANGSET 2048 Dump char sets used to construct lang values
- OBJTYPES 4096 Display message when value typechecks fail
+ MATCH2 4096 Display font-matching transformation in patterns
</programlisting>
<para>
Add the value of the desired debug levels together and assign that (in
@@ -314,9 +321,9 @@ the configuration file, the directory that can be accessed first in the list
will be used to store the cache files. If it starts with '~', it refers to
a directory in the users home directory. If 'prefix' is set to "xdg", the value in the XDG_CACHE_HOME environment variable will be added as the path prefix. please see XDG Base Directory Specification for more details.
The default directory is ``$XDG_CACHE_HOME/fontconfig'' and it contains the cache files
-named ``<literal>&lt;hash value&gt;</literal>-<literal>&lt;architecture&gt;</literal>.cache-<literal>&lt;version</literal>'',
-where <literal>&lt;version&gt;</literal> is the font configureation file
-version number (currently 3).
+named ``<literal>&lt;hash value&gt;</literal>-<literal>&lt;architecture&gt;</literal>.cache-<literal>&lt;version&gt;</literal>'',
+where <literal>&lt;version&gt;</literal> is the fontconfig cache file
+version number (currently 7).
</para></refsect2>
<refsect2><title><literal>&lt;include ignore_missing="no" prefix="default"&gt;</literal></title><para>
This element contains the name of an additional configuration file or
@@ -473,6 +480,8 @@ symbolic names for common font values:
extralight weight 40
ultralight weight 40
light weight 50
+ demilight weight 55
+ semilight weight 55
book weight 75
regular weight 80
normal weight 80
@@ -778,6 +787,10 @@ is used to override the default configuration directory.
is used to output the detailed debugging messages. see <link linkend="debug">Debugging Applications</link> section for more details.
</para>
<para>
+<emphasis>FC_DBG_MATCH_FILTER</emphasis>
+is used to filter out the patterns. this takes a comma-separated list of object names and effects only when FC_DEBUG has MATCH2. see <link linkend="debug">Debugging Applications</link> section for more details.
+ </para>
+ <para>
<emphasis>FONTCONFIG_USE_MMAP</emphasis>
is used to control the use of mmap(2) for the cache files if available. this take a boolean value. fontconfig will checks if the cache files are stored on the filesystem that is safe to use mmap(2). explicitly setting this environment variable will causes skipping this check and enforce to use or not use mmap(2) anyway.
</para>
diff --git a/chromium/third_party/fontconfig/src/doc/func.sgml b/chromium/third_party/fontconfig/src/doc/func.sgml
index 73e7761ce39..f076baff291 100644
--- a/chromium/third_party/fontconfig/src/doc/func.sgml
+++ b/chromium/third_party/fontconfig/src/doc/func.sgml
@@ -33,6 +33,7 @@
<refentrytitle>@FUNC@</refentrytitle>
@;@
<manvolnum>3</manvolnum>
+ <refmiscinfo class="software">Fontconfig &version;</refmiscinfo>
</refmeta>
<refnamediv>
@{PROTOTYPE@
@@ -82,9 +83,9 @@
@DESC@
</para>
</refsect1>
- <refsect1><title>Version</title>
- <para>
-Fontconfig version &version;
- </para>
+@?SINCE@
+ <refsect1><title>Since</title>
+ <para>version @SINCE@</para>
</refsect1>
+@;@
</refentry>
diff --git a/chromium/third_party/fontconfig/src/fc-blanks/Makefile.am b/chromium/third_party/fontconfig/src/fc-blanks/Makefile.am
new file mode 100644
index 00000000000..2b2075f8b1f
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/fc-blanks/Makefile.am
@@ -0,0 +1,46 @@
+# -*- encoding: utf-8 -*-
+#
+# Copyright © 2003 Keith Packard
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of the author(s) not be used in
+# advertising or publicity pertaining to distribution of the software without
+# specific, written prior permission. The authors make no
+# representations about the suitability of this software for any purpose. It
+# is provided "as is" without express or implied warranty.
+#
+# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+NULL =
+BLANKSPY = fc-blanks.py
+BLANKS_H = fcblanks.h
+TMPL = fcblanks.tmpl.h
+noinst_SCRIPTS = $(BLANKSPY)
+noinst_HEADERS = $(BLANKS_H)
+
+$(BLANKS_H): $(TMPL) $(BLANKSPY)
+if HAVE_PYTHON
+ $(AM_V_GEN) $(PYTHON) $(srcdir)/$(BLANKSPY) < $< > $(BLANKS_H).tmp && \
+ mv $(BLANKS_H).tmp $(BLANKS_H) || ($(RM) $(BLANKS_H).tmp && false)
+else
+ @echo "No python installed. please install python to build $(BLANKS_H)."
+ @false
+endif
+
+EXTRA_DIST = \
+ $(BLANKSPY) \
+ $(BLANKS_H) \
+ $(TMPL) \
+ $(NULL)
+DISTCLEANFILES = $(BLANKS_H)
+
+-include $(top_srcdir)/git.mk
diff --git a/chromium/third_party/fontconfig/src/fc-blanks/fc-blanks.py b/chromium/third_party/fontconfig/src/fc-blanks/fc-blanks.py
new file mode 100755
index 00000000000..cc23cde2d6f
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/fc-blanks/fc-blanks.py
@@ -0,0 +1,156 @@
+#! /usr/bin/python
+
+from __future__ import absolute_import
+from __future__ import print_function
+try:
+ from urllib2 import urlopen
+ from urllib2 import URLError
+except ImportError:
+ from urllib.request import urlopen
+ from urllib.error import URLError
+
+import sys
+import os
+from lxml import html
+from six.moves import range
+
+datafile = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'list-unicodeset.html')
+try:
+ fp = urlopen('http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[%3AGC%3DZs%3A][%3ADI%3A]&abb=on&ucd=on&esc=on&g')
+ data = fp.read()
+ fp.close()
+ fp = open(datafile, 'wb');
+ fp.write(data);
+ fp.close();
+except URLError:
+ # fall back reading the static data in repo
+ try:
+ fp = open(datafile)
+ data = fp.read()
+ fp.close()
+ except IOError:
+ sys.stderr.write("Error: No static data to generate the blank data. please make sure the network connection is reachable to Unicode.org\n")
+ sys.exit(1)
+
+dom = html.fromstring(data)
+x = dom.xpath('/html/body/form/p/text()')
+p = x[1]
+if p[0] == '[' and p[-1] == ']':
+ p = p.replace('[', '').replace(']', '')
+else:
+ sys.exit(1)
+fescape = False
+funicode = False
+frange = False
+fprocess = False
+v = 0
+vbegin = 0
+vend = 0
+n = 0
+l = []
+
+def insert(db, begin, end):
+ db.append([begin, end])
+
+for i in p:
+ if i == '\\':
+ if n > 0:
+ if frange == True and funicode == True:
+ vend = v
+ insert(l, vbegin, vend)
+ fprocess = True
+ elif funicode == True:
+ vbegin = v
+ vend = v
+ insert(l, vbegin, vend)
+ fprocess = True
+ funicode = False
+ fescape = True
+ elif i.lower() == 'u' and fescape == True:
+ funicode = True
+ fescape = False
+ elif i >= '0' and i <= '9' or i.lower() >= 'a' and i.lower() <= 'f':
+ if fescape == True:
+ raise RuntimeError("Unexpected escape code")
+ if funicode == True:
+ v <<= 4
+ v += int(i, 16)
+ else:
+ raise RuntimeError("Unable to parse Unicode")
+ elif i == ' ':
+ if fescape == True:
+ funicode = True
+ fescape = False
+ v = 0x20
+ if frange == True and funicode == True:
+ vend = v
+ insert(l, vbegin, vend)
+ fprocess = True
+ elif funicode == True:
+ vbegin = v
+ vend = v
+ insert(l, vbegin, vend)
+ fprocess = True
+ funicode = False
+ frange = False
+ elif i == '-':
+ if fescape == True:
+ raise RuntimeError("Unexpected escape code")
+ vbegin = v
+ v = 0
+ funicode = False
+ frange = True
+ else:
+ raise RuntimeError("Unable to parse Unicode: %s" % i)
+
+ if fprocess == True:
+ vbegin = 0
+ vend = 0
+ v = 0
+ fprocess = False
+ funicode = False
+ frange = False
+ n += 1
+
+if frange == True and funicode == True:
+ vend = v
+ insert(l, vbegin, vend)
+elif funicode == True:
+ vbegin = vend = v
+ insert(l, vbegin, vend)
+
+ncode = 0
+for i in l:
+ ncode += (i[1] - i[0] + 1)
+
+a = int(x[0].split(' ')[0].replace(',', ''))
+if a != ncode:
+ sys.stderr.write("Unexpected the amount of code points: %d (expected %d)\n" % (ncode, a))
+ sys.exit(1)
+
+# exception; BRAILLE PATTERN BLANK
+insert(l, 0x2800, 0x2800)
+
+while True:
+ s = sys.stdin.readline().rstrip()
+ if s == "@@@":
+ break
+ print(s)
+
+print("static FcChar32 _fcBlanks[%s] = {" % (ncode + 1))
+k = 0
+for i in sorted(l, key=lambda a: a[0]):
+ for j in range(i[0], i[1] + 1):
+ if k != 0:
+ print(",")
+ print(" 0x%04x" % j, end=' ')
+ k += 1
+
+print("};")
+print('''
+static FcBlanks fcBlanks = {
+ %s,
+ -1,
+ _fcBlanks
+};
+''' % (ncode + 1))
diff --git a/chromium/third_party/fontconfig/src/fc-blanks/fcblanks.tmpl.h b/chromium/third_party/fontconfig/src/fc-blanks/fcblanks.tmpl.h
new file mode 100644
index 00000000000..2bcaa21d6c1
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/fc-blanks/fcblanks.tmpl.h
@@ -0,0 +1,25 @@
+/*
+ * fontconfig/fc-blanks/fcblanks.tmpl.h
+ *
+ * Copyright © 2003 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+@@@
diff --git a/chromium/third_party/fontconfig/src/fc-blanks/list-unicodeset.html b/chromium/third_party/fontconfig/src/fc-blanks/list-unicodeset.html
new file mode 100644
index 00000000000..6e95efaf0e8
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/fc-blanks/list-unicodeset.html
@@ -0,0 +1,119 @@
+<html>
+<head>
+<meta http-equiv="Content-Language" content="en-us">
+<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
+<meta name="ProgId" content="FrontPage.Editor.Document">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="index.css">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<title>Unicode Utilities: UnicodeSet</title>
+</head>
+<body>
+
+<h1>Unicode Utilities: UnicodeSet </h1>
+<p><a target="help" href="http://cldr.unicode.org/unicode-utilities/list-unicodeset"><b>help</b></a> | <a target="character" href="character.jsp">character</a>
+ | <a target="properties" href="properties.jsp">properties</a>
+ | <a target="confusables" href="confusables.jsp">confusables</a>
+ | <a target="list" href="list-unicodeset.jsp">unicode-set</a>
+ | <a target="compare" href="unicodeset.jsp">compare-sets</a>
+ | <a target="regex" href="regex.jsp">regex</a>
+ | <a target="bnf" href="bnf.jsp">bnf-regex</a>
+ | <a target="breaks" href="breaks.jsp">breaks</a>
+ | <a target="transform" href="transform.jsp">transform</a>
+ | <a target="bidi" href="bidi.jsp">bidi</a>
+ | <a target="idna" href="idna.jsp">idna</a>
+ | <a target="languageid" href="languageid.jsp">languageid</a></p>
+<form name="myform">
+ <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; width:100%">
+ <tr>
+ <th style="width: 50%">Input</th>
+ </tr>
+ <tr>
+ <td><textarea name="a" rows="8" cols="10" style="width: 100%">[:GC=Zs:][:DI:]</textarea></td>
+ </tr>
+ <tr>
+ <td>
+ <input id='main' type="submit" value="Show Set" onClick="window.location.href='list-unicodeset.jsp?a='+document.getElementById('main').value"/>&nbsp;&nbsp;
+ <input type="checkbox" checked name="abb"><label for="abb">Abbreviate</label>&nbsp;&nbsp;
+ <input type="checkbox" name="c"><label for="c">Collate</label>&nbsp;&nbsp;
+ <input type="checkbox" checked name="ucd"><label for="ucd">UCD format</label>&nbsp;&nbsp;
+ <input type="checkbox" checked name="esc"><label for="esc">Escape</label>&nbsp;&nbsp;
+ <label for="g">Group by:</label>
+ <input type="text" checked name="g" size="25" value="">
+ <label for="i">Info:</label>
+ <input type="text" checked name="i" size="25" value="">
+ </td>
+ </tr>
+</table>
+ <p>4,190 Code Points</p>
+ <hr>
+ <p>[\ \u00A0\u00AD\u034F\u061C\u115F\u1160\u1680\u17B4\u17B5\u180B-\u180E\u2000-\u200F\u202A-\u202F\u205F-\u206F\u3000\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8\U0001BCA0-\U0001BCA3\U0001D173-\U0001D17A\U000E0000-\U000E0FFF]</p>
+ <hr>
+ <table width='100%'><tr><td colSpan='4'><tr><td class='charCell' width='3m'>   </td><td width='7m'><code><a target='c' href='character.jsp?a=0020'>0020</a></code></td><td>SPACE</td></tr>
+<tr><td class='charCell' width='3m'>   </td><td width='7m'><code><a target='c' href='character.jsp?a=00A0'>00A0</a></code></td><td>NO-BREAK SPACE</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=00AD'>00AD</a></code></td><td>SOFT HYPHEN</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=034F'>034F</a></code></td><td>COMBINING GRAPHEME JOINER</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=061C'>061C</a></code></td><td>ARABIC LETTER MARK</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=115F'>115F</a></code></td><td>HANGUL CHOSEONG FILLER</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=1160'>1160</a></code></td><td>HANGUL JUNGSEONG FILLER</td></tr>
+<tr><td class='charCell' width='3m'>   </td><td width='7m'><code><a target='c' href='character.jsp?a=1680'>1680</a></code></td><td>OGHAM SPACE MARK</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=17B4'>17B4</a></code></td><td>KHMER VOWEL INHERENT AQ</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=17B5'>17B5</a></code></td><td>KHMER VOWEL INHERENT AA</td></tr>
+<code><a target='c' href='character.jsp?a=180B'>180B</a></code>..<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=180E'>180E</a></code></td><td>MONGOLIAN VOWEL SEPARATOR</td></tr>
+<code><a target='c' href='character.jsp?a=2000'>2000</a></code>..<tr><td class='charCell' width='3m'> ‎‏‎ </td><td width='7m'><code><a target='c' href='character.jsp?a=200F'>200F</a></code></td><td>RIGHT-TO-LEFT MARK</td></tr>
+<code><a target='c' href='character.jsp?a=202A'>202A</a></code>..<tr><td class='charCell' width='3m'>   </td><td width='7m'><code><a target='c' href='character.jsp?a=202F'>202F</a></code></td><td>NARROW NO-BREAK SPACE</td></tr>
+<code><a target='c' href='character.jsp?a=205F'>205F</a></code>..<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=206F'>206F</a></code></td><td>NOMINAL DIGIT SHAPES</td></tr>
+<tr><td class='charCell' width='3m'>   </td><td width='7m'><code><a target='c' href='character.jsp?a=3000'>3000</a></code></td><td>IDEOGRAPHIC SPACE</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=3164'>3164</a></code></td><td>HANGUL FILLER</td></tr>
+<code><a target='c' href='character.jsp?a=FE00'>FE00</a></code>..<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=FE0F'>FE0F</a></code></td><td>VARIATION SELECTOR-16</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=FEFF'>FEFF</a></code></td><td>ZERO WIDTH NO-BREAK SPACE</td></tr>
+<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=FFA0'>FFA0</a></code></td><td>HALFWIDTH HANGUL FILLER</td></tr>
+<code><a target='c' href='character.jsp?a=FFF0'>FFF0</a></code>..<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=FFF8'>FFF8</a></code></td><td><i>&lt;unassigned-FFF8&gt;</i></td></tr>
+<code><a target='c' href='character.jsp?a=1BCA0'>1BCA0</a></code>..<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=1BCA3'>1BCA3</a></code></td><td>SHORTHAND FORMAT UP STEP</td></tr>
+<code><a target='c' href='character.jsp?a=1D173'>1D173</a></code>..<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=1D17A'>1D17A</a></code></td><td>MUSICAL SYMBOL END PHRASE</td></tr>
+<code><a target='c' href='character.jsp?a=E0000'>E0000</a></code>..<tr><td class='charCell' width='3m'>  </td><td width='7m'><code><a target='c' href='character.jsp?a=E0FFF'>E0FFF</a></code></td><td><i>&lt;unassigned-E0FFF&gt;</i></td></tr>
+</td></tr></table>
+</form>
+<hr>
+<p style="font-size:80%"><b><a name="fonts">Fonts and Display.</a></b> If you don't have a good set of Unicode fonts (and modern browser),
+you may not be able to read some of the characters.
+Some suggested fonts that you can add for coverage are:
+<a href="http://greekfonts.teilar.gr/" target="_blank">Unicode Fonts for Ancient Scripts</a>,
+<a href="https://www.google.com/get/noto/" target="_blank">Noto Fonts site</a>,
+<a href="http://www.alanwood.net/unicode/fonts.html" target="_blank">Large, multi-script Unicode fonts</a>.
+See also: <a href="http://www.unicode.org/help/display_problems.html" target="_blank">Unicode Display Problems</a>.</p>
+<p style="font-size:80%">Version 3.7;
+ICU version: 57.0.1.0;
+Unicode version: 8.0.0.0
+</p>
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-8314904-1");
+pageTracker._trackPageview();
+} catch(err) {}
+</script>
+<hr>
+</body>
+</html>
diff --git a/chromium/third_party/fontconfig/src/fc-cache/fc-cache.c b/chromium/third_party/fontconfig/src/fc-cache/fc-cache.c
index af7ba6dd6a9..0336073a347 100644
--- a/chromium/third_party/fontconfig/src/fc-cache/fc-cache.c
+++ b/chromium/third_party/fontconfig/src/fc-cache/fc-cache.c
@@ -65,9 +65,10 @@
#define _GNU_SOURCE
#include <getopt.h>
const struct option longopts[] = {
+ {"error-on-no-fonts", 0, 0, 'E'},
{"force", 0, 0, 'f'},
{"really-force", 0, 0, 'r'},
- {"sysroot", 0, 0, 'y'},
+ {"sysroot", required_argument, 0, 'y'},
{"system-only", 0, 0, 's'},
{"version", 0, 0, 'V'},
{"verbose", 0, 0, 'v'},
@@ -86,16 +87,17 @@ usage (char *program, int error)
{
FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (file, "usage: %s [-frsvVh] [-y SYSROOT] [--force|--really-force] [--sysroot=SYSROOT] [--system-only] [--verbose] [--version] [--help] [dirs]\n",
+ fprintf (file, "usage: %s [-EfrsvVh] [-y SYSROOT] [--error-on-no-fonts] [--force|--really-force] [--sysroot=SYSROOT] [--system-only] [--verbose] [--version] [--help] [dirs]\n",
program);
#else
- fprintf (file, "usage: %s [-frsvVh] [-y SYSROOT] [dirs]\n",
+ fprintf (file, "usage: %s [-EfrsvVh] [-y SYSROOT] [dirs]\n",
program);
#endif
fprintf (file, "Build font information caches in [dirs]\n"
"(all directories in font configuration by default).\n");
fprintf (file, "\n");
#if HAVE_GETOPT_LONG
+ fprintf (file, " -E, --error-on-no-fonts raise an error if no fonts in a directory\n");
fprintf (file, " -f, --force scan directories with apparently valid caches\n");
fprintf (file, " -r, --really-force erase all existing caches, then rescan\n");
fprintf (file, " -s, --system-only scan system-wide directories only\n");
@@ -104,6 +106,8 @@ usage (char *program, int error)
fprintf (file, " -V, --version display font config version and exit\n");
fprintf (file, " -h, --help display this help and exit\n");
#else
+ fprintf (file, " -E (error-on-no-fonts)\n");
+ fprintf (file, " raise an error if no fonts in a directory\n");
fprintf (file, " -f (force) scan directories with apparently valid caches\n");
fprintf (file, " -r, (really force) erase all existing caches, then rescan\n");
fprintf (file, " -s (system) scan system-wide directories only\n");
@@ -118,7 +122,7 @@ usage (char *program, int error)
static FcStrSet *processed_dirs;
static int
-scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, FcBool recursive, int *changed)
+scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, FcBool error_on_no_fonts, int *changed)
{
int ret = 0;
const FcChar8 *dir;
@@ -126,9 +130,10 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
FcStrList *sublist;
FcCache *cache;
struct stat statb;
- FcBool was_valid;
+ FcBool was_valid, was_processed = FcFalse;
int i;
-
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
+
/*
* Now scan all of the directories into separate databases
* and write out the results
@@ -137,11 +142,13 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
{
if (verbose)
{
+ if (sysroot)
+ printf ("[%s]", sysroot);
printf ("%s: ", dir);
fflush (stdout);
}
- if (recursive && FcStrSetMember (processed_dirs, dir))
+ if (FcStrSetMember (processed_dirs, dir))
{
if (verbose)
printf ("skipping, looped directory detected\n");
@@ -170,6 +177,7 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
fprintf (stderr, "\"%s\": not a directory, skipping\n", dir);
continue;
}
+ was_processed = FcTrue;
if (really_force)
FcDirCacheUnlink (dir, config);
@@ -214,36 +222,33 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force,
}
}
- if (recursive)
+ subdirs = FcStrSetCreate ();
+ if (!subdirs)
{
- subdirs = FcStrSetCreate ();
- if (!subdirs)
- {
- fprintf (stderr, "%s: Can't create subdir set\n", dir);
- ret++;
- FcDirCacheUnload (cache);
- continue;
- }
- for (i = 0; i < FcCacheNumSubdir (cache); i++)
- FcStrSetAdd (subdirs, FcCacheSubdir (cache, i));
-
+ fprintf (stderr, "%s: Can't create subdir set\n", dir);
+ ret++;
FcDirCacheUnload (cache);
+ continue;
+ }
+ for (i = 0; i < FcCacheNumSubdir (cache); i++)
+ FcStrSetAdd (subdirs, FcCacheSubdir (cache, i));
- sublist = FcStrListCreate (subdirs);
- FcStrSetDestroy (subdirs);
- if (!sublist)
- {
- fprintf (stderr, "%s: Can't create subdir list\n", dir);
- ret++;
- continue;
- }
- FcStrSetAdd (processed_dirs, dir);
- ret += scanDirs (sublist, config, force, really_force, verbose, recursive, changed);
- FcStrListDone (sublist);
+ FcDirCacheUnload (cache);
+
+ sublist = FcStrListCreate (subdirs);
+ FcStrSetDestroy (subdirs);
+ if (!sublist)
+ {
+ fprintf (stderr, "%s: Can't create subdir list\n", dir);
+ ret++;
+ continue;
}
- else
- FcDirCacheUnload (cache);
+ FcStrSetAdd (processed_dirs, dir);
+ ret += scanDirs (sublist, config, force, really_force, verbose, error_on_no_fonts, changed);
+ FcStrListDone (sublist);
}
+ if (error_on_no_fonts && !was_processed)
+ ret++;
return ret;
}
@@ -277,6 +282,7 @@ main (int argc, char **argv)
FcBool force = FcFalse;
FcBool really_force = FcFalse;
FcBool systemOnly = FcFalse;
+ FcBool error_on_no_fonts = FcFalse;
FcConfig *config;
FcChar8 *sysroot = NULL;
int i;
@@ -286,12 +292,15 @@ main (int argc, char **argv)
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "frsy:Vvh", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "Efrsy:Vvh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "frsy:Vvh")) != -1)
+ while ((c = getopt (argc, argv, "Efrsy:Vvh")) != -1)
#endif
{
switch (c) {
+ case 'E':
+ error_on_no_fonts = FcTrue;
+ break;
case 'r':
really_force = FcTrue;
/* fall through */
@@ -369,12 +378,9 @@ main (int argc, char **argv)
fprintf(stderr, "Cannot malloc\n");
return 1;
}
-
+
changed = 0;
- ret = scanDirs (list, config, force, really_force, verbose, FcTrue, &changed);
- /* Update the directory cache again to avoid the race condition as much as possible */
- FcStrListFirst (list);
- ret += scanDirs (list, config, FcTrue, really_force, verbose, FcFalse, &changed);
+ ret = scanDirs (list, config, force, really_force, verbose, error_on_no_fonts, &changed);
FcStrListDone (list);
/*
diff --git a/chromium/third_party/fontconfig/src/fc-cache/fc-cache.sgml b/chromium/third_party/fontconfig/src/fc-cache/fc-cache.sgml
index 3740be77f66..5ae01076582 100644
--- a/chromium/third_party/fontconfig/src/fc-cache/fc-cache.sgml
+++ b/chromium/third_party/fontconfig/src/fc-cache/fc-cache.sgml
@@ -63,9 +63,14 @@ manpage.1: manpage.sgml
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-frsvVh</option></arg>
+ <arg><option>-EfrsvVh</option></arg>
+ <arg><option>--error-on-no-fonts</option></arg>
<arg><option>--force</option></arg>
<arg><option>--really-force</option></arg>
+ <group>
+ <arg><option>-y</option> <option><replaceable>dir</replaceable></option></arg>
+ <arg><option>--sysroot</option> <option><replaceable>dir</replaceable></option></arg>
+ </group>
<arg><option>--system-only</option></arg>
<arg><option>--verbose</option></arg>
<arg><option>--version</option></arg>
@@ -103,6 +108,16 @@ manpage.1: manpage.sgml
<variablelist>
<varlistentry>
+ <term><option>-E</option>
+ <option>--error-on-no-fonts</option>
+ </term>
+ <listitem>
+ <para>Raise an error if there are no fonts in
+ <option><replaceable>dir</replaceable></option> or directories
+ in the configuration if not given.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-f</option>
<option>--force</option>
</term>
@@ -137,6 +152,15 @@ manpage.1: manpage.sgml
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>-y</option>
+ <option>-sysroot</option>
+ <option><replaceable>dir</replaceable></option>
+ </term>
+ <listitem>
+ <para>Prepend <option><replaceable>dir</replaceable></option> to all paths for scanning.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-h</option>
<option>--help</option>
</term>
@@ -163,10 +187,15 @@ manpage.1: manpage.sgml
</refsect1>
<refsect1>
+ <title>RETURN CODES</title>
+ <para><command>fc-cache</command> returns zero if the caches successfully generated. otherwise non-zero.</para>
+ </refsect1>
+
+ <refsect1>
<title>FILES</title>
<variablelist>
<varlistentry>
- <term><filename><replaceable>%cachdir%</replaceable>/*-<replaceable>%arch%</replaceable>.cache-2</filename></term>
+ <term><filename><replaceable>%cachedir%</replaceable>/*-<replaceable>%arch%</replaceable>.cache-%version%</filename></term>
<listitem>
<para>These files are generated by <command>&dhpackage;</command>
and contain maps from file names to font properties. They are
diff --git a/chromium/third_party/fontconfig/src/fc-case/CaseFolding.txt b/chromium/third_party/fontconfig/src/fc-case/CaseFolding.txt
index cf5779f4075..372ee68bd81 100644
--- a/chromium/third_party/fontconfig/src/fc-case/CaseFolding.txt
+++ b/chromium/third_party/fontconfig/src/fc-case/CaseFolding.txt
@@ -1,10 +1,11 @@
-# CaseFolding-6.3.0.txt
-# Date: 2012-12-20, 22:14:35 GMT [MD]
+# CaseFolding-9.0.0.txt
+# Date: 2016-03-02, 18:54:54 GMT
+# © 2016 Unicode®, Inc.
+# Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
-# For terms of use, see http://www.unicode.org/terms_of_use.html
-# For documentation, see http://www.unicode.org/reports/tr44/
+# For documentation, see http://www.unicode.org/reports/tr44/
#
# Case Folding Properties
#
@@ -25,7 +26,7 @@
#
# For information on case folding, including how to have case folding
# preserve normalization formats, see Section 3.13 Default Case Algorithms in
-# The Unicode Standard, Version 5.0.
+# The Unicode Standard.
#
# ================================================================================
# Format
@@ -58,8 +59,6 @@
# All code points not explicitly listed for Case_Folding
# have the value C for the status field, and the code point itself for the mapping field.
-# @missing: 0000..10FFFF; C; <code point>
-
# =================================================================
0041; C; 0061; # LATIN CAPITAL LETTER A
0042; C; 0062; # LATIN CAPITAL LETTER B
@@ -298,6 +297,7 @@
0370; C; 0371; # GREEK CAPITAL LETTER HETA
0372; C; 0373; # GREEK CAPITAL LETTER ARCHAIC SAMPI
0376; C; 0377; # GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA
+037F; C; 03F3; # GREEK CAPITAL LETTER YOT
0386; C; 03AC; # GREEK CAPITAL LETTER ALPHA WITH TONOS
0388; C; 03AD; # GREEK CAPITAL LETTER EPSILON WITH TONOS
0389; C; 03AE; # GREEK CAPITAL LETTER ETA WITH TONOS
@@ -505,6 +505,10 @@
0522; C; 0523; # CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK
0524; C; 0525; # CYRILLIC CAPITAL LETTER PE WITH DESCENDER
0526; C; 0527; # CYRILLIC CAPITAL LETTER SHHA WITH DESCENDER
+0528; C; 0529; # CYRILLIC CAPITAL LETTER EN WITH LEFT HOOK
+052A; C; 052B; # CYRILLIC CAPITAL LETTER DZZHE
+052C; C; 052D; # CYRILLIC CAPITAL LETTER DCHE
+052E; C; 052F; # CYRILLIC CAPITAL LETTER EL WITH DESCENDER
0531; C; 0561; # ARMENIAN CAPITAL LETTER AYB
0532; C; 0562; # ARMENIAN CAPITAL LETTER BEN
0533; C; 0563; # ARMENIAN CAPITAL LETTER GIM
@@ -584,6 +588,21 @@
10C5; C; 2D25; # GEORGIAN CAPITAL LETTER HOE
10C7; C; 2D27; # GEORGIAN CAPITAL LETTER YN
10CD; C; 2D2D; # GEORGIAN CAPITAL LETTER AEN
+13F8; C; 13F0; # CHEROKEE SMALL LETTER YE
+13F9; C; 13F1; # CHEROKEE SMALL LETTER YI
+13FA; C; 13F2; # CHEROKEE SMALL LETTER YO
+13FB; C; 13F3; # CHEROKEE SMALL LETTER YU
+13FC; C; 13F4; # CHEROKEE SMALL LETTER YV
+13FD; C; 13F5; # CHEROKEE SMALL LETTER MV
+1C80; C; 0432; # CYRILLIC SMALL LETTER ROUNDED VE
+1C81; C; 0434; # CYRILLIC SMALL LETTER LONG-LEGGED DE
+1C82; C; 043E; # CYRILLIC SMALL LETTER NARROW O
+1C83; C; 0441; # CYRILLIC SMALL LETTER WIDE ES
+1C84; C; 0442; # CYRILLIC SMALL LETTER TALL TE
+1C85; C; 0442; # CYRILLIC SMALL LETTER THREE-LEGGED TE
+1C86; C; 044A; # CYRILLIC SMALL LETTER TALL HARD SIGN
+1C87; C; 0463; # CYRILLIC SMALL LETTER TALL YAT
+1C88; C; A64B; # CYRILLIC SMALL LETTER UNBLENDED UK
1E00; C; 1E01; # LATIN CAPITAL LETTER A WITH RING BELOW
1E02; C; 1E03; # LATIN CAPITAL LETTER B WITH DOT ABOVE
1E04; C; 1E05; # LATIN CAPITAL LETTER B WITH DOT BELOW
@@ -1088,6 +1107,8 @@ A690; C; A691; # CYRILLIC CAPITAL LETTER TSSE
A692; C; A693; # CYRILLIC CAPITAL LETTER TCHE
A694; C; A695; # CYRILLIC CAPITAL LETTER HWE
A696; C; A697; # CYRILLIC CAPITAL LETTER SHWE
+A698; C; A699; # CYRILLIC CAPITAL LETTER DOUBLE O
+A69A; C; A69B; # CYRILLIC CAPITAL LETTER CROSSED O
A722; C; A723; # LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF
A724; C; A725; # LATIN CAPITAL LETTER EGYPTOLOGICAL AIN
A726; C; A727; # LATIN CAPITAL LETTER HENG
@@ -1138,12 +1159,107 @@ A78B; C; A78C; # LATIN CAPITAL LETTER SALTILLO
A78D; C; 0265; # LATIN CAPITAL LETTER TURNED H
A790; C; A791; # LATIN CAPITAL LETTER N WITH DESCENDER
A792; C; A793; # LATIN CAPITAL LETTER C WITH BAR
+A796; C; A797; # LATIN CAPITAL LETTER B WITH FLOURISH
+A798; C; A799; # LATIN CAPITAL LETTER F WITH STROKE
+A79A; C; A79B; # LATIN CAPITAL LETTER VOLAPUK AE
+A79C; C; A79D; # LATIN CAPITAL LETTER VOLAPUK OE
+A79E; C; A79F; # LATIN CAPITAL LETTER VOLAPUK UE
A7A0; C; A7A1; # LATIN CAPITAL LETTER G WITH OBLIQUE STROKE
A7A2; C; A7A3; # LATIN CAPITAL LETTER K WITH OBLIQUE STROKE
A7A4; C; A7A5; # LATIN CAPITAL LETTER N WITH OBLIQUE STROKE
A7A6; C; A7A7; # LATIN CAPITAL LETTER R WITH OBLIQUE STROKE
A7A8; C; A7A9; # LATIN CAPITAL LETTER S WITH OBLIQUE STROKE
A7AA; C; 0266; # LATIN CAPITAL LETTER H WITH HOOK
+A7AB; C; 025C; # LATIN CAPITAL LETTER REVERSED OPEN E
+A7AC; C; 0261; # LATIN CAPITAL LETTER SCRIPT G
+A7AD; C; 026C; # LATIN CAPITAL LETTER L WITH BELT
+A7AE; C; 026A; # LATIN CAPITAL LETTER SMALL CAPITAL I
+A7B0; C; 029E; # LATIN CAPITAL LETTER TURNED K
+A7B1; C; 0287; # LATIN CAPITAL LETTER TURNED T
+A7B2; C; 029D; # LATIN CAPITAL LETTER J WITH CROSSED-TAIL
+A7B3; C; AB53; # LATIN CAPITAL LETTER CHI
+A7B4; C; A7B5; # LATIN CAPITAL LETTER BETA
+A7B6; C; A7B7; # LATIN CAPITAL LETTER OMEGA
+AB70; C; 13A0; # CHEROKEE SMALL LETTER A
+AB71; C; 13A1; # CHEROKEE SMALL LETTER E
+AB72; C; 13A2; # CHEROKEE SMALL LETTER I
+AB73; C; 13A3; # CHEROKEE SMALL LETTER O
+AB74; C; 13A4; # CHEROKEE SMALL LETTER U
+AB75; C; 13A5; # CHEROKEE SMALL LETTER V
+AB76; C; 13A6; # CHEROKEE SMALL LETTER GA
+AB77; C; 13A7; # CHEROKEE SMALL LETTER KA
+AB78; C; 13A8; # CHEROKEE SMALL LETTER GE
+AB79; C; 13A9; # CHEROKEE SMALL LETTER GI
+AB7A; C; 13AA; # CHEROKEE SMALL LETTER GO
+AB7B; C; 13AB; # CHEROKEE SMALL LETTER GU
+AB7C; C; 13AC; # CHEROKEE SMALL LETTER GV
+AB7D; C; 13AD; # CHEROKEE SMALL LETTER HA
+AB7E; C; 13AE; # CHEROKEE SMALL LETTER HE
+AB7F; C; 13AF; # CHEROKEE SMALL LETTER HI
+AB80; C; 13B0; # CHEROKEE SMALL LETTER HO
+AB81; C; 13B1; # CHEROKEE SMALL LETTER HU
+AB82; C; 13B2; # CHEROKEE SMALL LETTER HV
+AB83; C; 13B3; # CHEROKEE SMALL LETTER LA
+AB84; C; 13B4; # CHEROKEE SMALL LETTER LE
+AB85; C; 13B5; # CHEROKEE SMALL LETTER LI
+AB86; C; 13B6; # CHEROKEE SMALL LETTER LO
+AB87; C; 13B7; # CHEROKEE SMALL LETTER LU
+AB88; C; 13B8; # CHEROKEE SMALL LETTER LV
+AB89; C; 13B9; # CHEROKEE SMALL LETTER MA
+AB8A; C; 13BA; # CHEROKEE SMALL LETTER ME
+AB8B; C; 13BB; # CHEROKEE SMALL LETTER MI
+AB8C; C; 13BC; # CHEROKEE SMALL LETTER MO
+AB8D; C; 13BD; # CHEROKEE SMALL LETTER MU
+AB8E; C; 13BE; # CHEROKEE SMALL LETTER NA
+AB8F; C; 13BF; # CHEROKEE SMALL LETTER HNA
+AB90; C; 13C0; # CHEROKEE SMALL LETTER NAH
+AB91; C; 13C1; # CHEROKEE SMALL LETTER NE
+AB92; C; 13C2; # CHEROKEE SMALL LETTER NI
+AB93; C; 13C3; # CHEROKEE SMALL LETTER NO
+AB94; C; 13C4; # CHEROKEE SMALL LETTER NU
+AB95; C; 13C5; # CHEROKEE SMALL LETTER NV
+AB96; C; 13C6; # CHEROKEE SMALL LETTER QUA
+AB97; C; 13C7; # CHEROKEE SMALL LETTER QUE
+AB98; C; 13C8; # CHEROKEE SMALL LETTER QUI
+AB99; C; 13C9; # CHEROKEE SMALL LETTER QUO
+AB9A; C; 13CA; # CHEROKEE SMALL LETTER QUU
+AB9B; C; 13CB; # CHEROKEE SMALL LETTER QUV
+AB9C; C; 13CC; # CHEROKEE SMALL LETTER SA
+AB9D; C; 13CD; # CHEROKEE SMALL LETTER S
+AB9E; C; 13CE; # CHEROKEE SMALL LETTER SE
+AB9F; C; 13CF; # CHEROKEE SMALL LETTER SI
+ABA0; C; 13D0; # CHEROKEE SMALL LETTER SO
+ABA1; C; 13D1; # CHEROKEE SMALL LETTER SU
+ABA2; C; 13D2; # CHEROKEE SMALL LETTER SV
+ABA3; C; 13D3; # CHEROKEE SMALL LETTER DA
+ABA4; C; 13D4; # CHEROKEE SMALL LETTER TA
+ABA5; C; 13D5; # CHEROKEE SMALL LETTER DE
+ABA6; C; 13D6; # CHEROKEE SMALL LETTER TE
+ABA7; C; 13D7; # CHEROKEE SMALL LETTER DI
+ABA8; C; 13D8; # CHEROKEE SMALL LETTER TI
+ABA9; C; 13D9; # CHEROKEE SMALL LETTER DO
+ABAA; C; 13DA; # CHEROKEE SMALL LETTER DU
+ABAB; C; 13DB; # CHEROKEE SMALL LETTER DV
+ABAC; C; 13DC; # CHEROKEE SMALL LETTER DLA
+ABAD; C; 13DD; # CHEROKEE SMALL LETTER TLA
+ABAE; C; 13DE; # CHEROKEE SMALL LETTER TLE
+ABAF; C; 13DF; # CHEROKEE SMALL LETTER TLI
+ABB0; C; 13E0; # CHEROKEE SMALL LETTER TLO
+ABB1; C; 13E1; # CHEROKEE SMALL LETTER TLU
+ABB2; C; 13E2; # CHEROKEE SMALL LETTER TLV
+ABB3; C; 13E3; # CHEROKEE SMALL LETTER TSA
+ABB4; C; 13E4; # CHEROKEE SMALL LETTER TSE
+ABB5; C; 13E5; # CHEROKEE SMALL LETTER TSI
+ABB6; C; 13E6; # CHEROKEE SMALL LETTER TSO
+ABB7; C; 13E7; # CHEROKEE SMALL LETTER TSU
+ABB8; C; 13E8; # CHEROKEE SMALL LETTER TSV
+ABB9; C; 13E9; # CHEROKEE SMALL LETTER WA
+ABBA; C; 13EA; # CHEROKEE SMALL LETTER WE
+ABBB; C; 13EB; # CHEROKEE SMALL LETTER WI
+ABBC; C; 13EC; # CHEROKEE SMALL LETTER WO
+ABBD; C; 13ED; # CHEROKEE SMALL LETTER WU
+ABBE; C; 13EE; # CHEROKEE SMALL LETTER WV
+ABBF; C; 13EF; # CHEROKEE SMALL LETTER YA
FB00; F; 0066 0066; # LATIN SMALL LIGATURE FF
FB01; F; 0066 0069; # LATIN SMALL LIGATURE FI
FB02; F; 0066 006C; # LATIN SMALL LIGATURE FL
@@ -1222,5 +1338,158 @@ FF3A; C; FF5A; # FULLWIDTH LATIN CAPITAL LETTER Z
10425; C; 1044D; # DESERET CAPITAL LETTER ENG
10426; C; 1044E; # DESERET CAPITAL LETTER OI
10427; C; 1044F; # DESERET CAPITAL LETTER EW
+104B0; C; 104D8; # OSAGE CAPITAL LETTER A
+104B1; C; 104D9; # OSAGE CAPITAL LETTER AI
+104B2; C; 104DA; # OSAGE CAPITAL LETTER AIN
+104B3; C; 104DB; # OSAGE CAPITAL LETTER AH
+104B4; C; 104DC; # OSAGE CAPITAL LETTER BRA
+104B5; C; 104DD; # OSAGE CAPITAL LETTER CHA
+104B6; C; 104DE; # OSAGE CAPITAL LETTER EHCHA
+104B7; C; 104DF; # OSAGE CAPITAL LETTER E
+104B8; C; 104E0; # OSAGE CAPITAL LETTER EIN
+104B9; C; 104E1; # OSAGE CAPITAL LETTER HA
+104BA; C; 104E2; # OSAGE CAPITAL LETTER HYA
+104BB; C; 104E3; # OSAGE CAPITAL LETTER I
+104BC; C; 104E4; # OSAGE CAPITAL LETTER KA
+104BD; C; 104E5; # OSAGE CAPITAL LETTER EHKA
+104BE; C; 104E6; # OSAGE CAPITAL LETTER KYA
+104BF; C; 104E7; # OSAGE CAPITAL LETTER LA
+104C0; C; 104E8; # OSAGE CAPITAL LETTER MA
+104C1; C; 104E9; # OSAGE CAPITAL LETTER NA
+104C2; C; 104EA; # OSAGE CAPITAL LETTER O
+104C3; C; 104EB; # OSAGE CAPITAL LETTER OIN
+104C4; C; 104EC; # OSAGE CAPITAL LETTER PA
+104C5; C; 104ED; # OSAGE CAPITAL LETTER EHPA
+104C6; C; 104EE; # OSAGE CAPITAL LETTER SA
+104C7; C; 104EF; # OSAGE CAPITAL LETTER SHA
+104C8; C; 104F0; # OSAGE CAPITAL LETTER TA
+104C9; C; 104F1; # OSAGE CAPITAL LETTER EHTA
+104CA; C; 104F2; # OSAGE CAPITAL LETTER TSA
+104CB; C; 104F3; # OSAGE CAPITAL LETTER EHTSA
+104CC; C; 104F4; # OSAGE CAPITAL LETTER TSHA
+104CD; C; 104F5; # OSAGE CAPITAL LETTER DHA
+104CE; C; 104F6; # OSAGE CAPITAL LETTER U
+104CF; C; 104F7; # OSAGE CAPITAL LETTER WA
+104D0; C; 104F8; # OSAGE CAPITAL LETTER KHA
+104D1; C; 104F9; # OSAGE CAPITAL LETTER GHA
+104D2; C; 104FA; # OSAGE CAPITAL LETTER ZA
+104D3; C; 104FB; # OSAGE CAPITAL LETTER ZHA
+10C80; C; 10CC0; # OLD HUNGARIAN CAPITAL LETTER A
+10C81; C; 10CC1; # OLD HUNGARIAN CAPITAL LETTER AA
+10C82; C; 10CC2; # OLD HUNGARIAN CAPITAL LETTER EB
+10C83; C; 10CC3; # OLD HUNGARIAN CAPITAL LETTER AMB
+10C84; C; 10CC4; # OLD HUNGARIAN CAPITAL LETTER EC
+10C85; C; 10CC5; # OLD HUNGARIAN CAPITAL LETTER ENC
+10C86; C; 10CC6; # OLD HUNGARIAN CAPITAL LETTER ECS
+10C87; C; 10CC7; # OLD HUNGARIAN CAPITAL LETTER ED
+10C88; C; 10CC8; # OLD HUNGARIAN CAPITAL LETTER AND
+10C89; C; 10CC9; # OLD HUNGARIAN CAPITAL LETTER E
+10C8A; C; 10CCA; # OLD HUNGARIAN CAPITAL LETTER CLOSE E
+10C8B; C; 10CCB; # OLD HUNGARIAN CAPITAL LETTER EE
+10C8C; C; 10CCC; # OLD HUNGARIAN CAPITAL LETTER EF
+10C8D; C; 10CCD; # OLD HUNGARIAN CAPITAL LETTER EG
+10C8E; C; 10CCE; # OLD HUNGARIAN CAPITAL LETTER EGY
+10C8F; C; 10CCF; # OLD HUNGARIAN CAPITAL LETTER EH
+10C90; C; 10CD0; # OLD HUNGARIAN CAPITAL LETTER I
+10C91; C; 10CD1; # OLD HUNGARIAN CAPITAL LETTER II
+10C92; C; 10CD2; # OLD HUNGARIAN CAPITAL LETTER EJ
+10C93; C; 10CD3; # OLD HUNGARIAN CAPITAL LETTER EK
+10C94; C; 10CD4; # OLD HUNGARIAN CAPITAL LETTER AK
+10C95; C; 10CD5; # OLD HUNGARIAN CAPITAL LETTER UNK
+10C96; C; 10CD6; # OLD HUNGARIAN CAPITAL LETTER EL
+10C97; C; 10CD7; # OLD HUNGARIAN CAPITAL LETTER ELY
+10C98; C; 10CD8; # OLD HUNGARIAN CAPITAL LETTER EM
+10C99; C; 10CD9; # OLD HUNGARIAN CAPITAL LETTER EN
+10C9A; C; 10CDA; # OLD HUNGARIAN CAPITAL LETTER ENY
+10C9B; C; 10CDB; # OLD HUNGARIAN CAPITAL LETTER O
+10C9C; C; 10CDC; # OLD HUNGARIAN CAPITAL LETTER OO
+10C9D; C; 10CDD; # OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG OE
+10C9E; C; 10CDE; # OLD HUNGARIAN CAPITAL LETTER RUDIMENTA OE
+10C9F; C; 10CDF; # OLD HUNGARIAN CAPITAL LETTER OEE
+10CA0; C; 10CE0; # OLD HUNGARIAN CAPITAL LETTER EP
+10CA1; C; 10CE1; # OLD HUNGARIAN CAPITAL LETTER EMP
+10CA2; C; 10CE2; # OLD HUNGARIAN CAPITAL LETTER ER
+10CA3; C; 10CE3; # OLD HUNGARIAN CAPITAL LETTER SHORT ER
+10CA4; C; 10CE4; # OLD HUNGARIAN CAPITAL LETTER ES
+10CA5; C; 10CE5; # OLD HUNGARIAN CAPITAL LETTER ESZ
+10CA6; C; 10CE6; # OLD HUNGARIAN CAPITAL LETTER ET
+10CA7; C; 10CE7; # OLD HUNGARIAN CAPITAL LETTER ENT
+10CA8; C; 10CE8; # OLD HUNGARIAN CAPITAL LETTER ETY
+10CA9; C; 10CE9; # OLD HUNGARIAN CAPITAL LETTER ECH
+10CAA; C; 10CEA; # OLD HUNGARIAN CAPITAL LETTER U
+10CAB; C; 10CEB; # OLD HUNGARIAN CAPITAL LETTER UU
+10CAC; C; 10CEC; # OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG UE
+10CAD; C; 10CED; # OLD HUNGARIAN CAPITAL LETTER RUDIMENTA UE
+10CAE; C; 10CEE; # OLD HUNGARIAN CAPITAL LETTER EV
+10CAF; C; 10CEF; # OLD HUNGARIAN CAPITAL LETTER EZ
+10CB0; C; 10CF0; # OLD HUNGARIAN CAPITAL LETTER EZS
+10CB1; C; 10CF1; # OLD HUNGARIAN CAPITAL LETTER ENT-SHAPED SIGN
+10CB2; C; 10CF2; # OLD HUNGARIAN CAPITAL LETTER US
+118A0; C; 118C0; # WARANG CITI CAPITAL LETTER NGAA
+118A1; C; 118C1; # WARANG CITI CAPITAL LETTER A
+118A2; C; 118C2; # WARANG CITI CAPITAL LETTER WI
+118A3; C; 118C3; # WARANG CITI CAPITAL LETTER YU
+118A4; C; 118C4; # WARANG CITI CAPITAL LETTER YA
+118A5; C; 118C5; # WARANG CITI CAPITAL LETTER YO
+118A6; C; 118C6; # WARANG CITI CAPITAL LETTER II
+118A7; C; 118C7; # WARANG CITI CAPITAL LETTER UU
+118A8; C; 118C8; # WARANG CITI CAPITAL LETTER E
+118A9; C; 118C9; # WARANG CITI CAPITAL LETTER O
+118AA; C; 118CA; # WARANG CITI CAPITAL LETTER ANG
+118AB; C; 118CB; # WARANG CITI CAPITAL LETTER GA
+118AC; C; 118CC; # WARANG CITI CAPITAL LETTER KO
+118AD; C; 118CD; # WARANG CITI CAPITAL LETTER ENY
+118AE; C; 118CE; # WARANG CITI CAPITAL LETTER YUJ
+118AF; C; 118CF; # WARANG CITI CAPITAL LETTER UC
+118B0; C; 118D0; # WARANG CITI CAPITAL LETTER ENN
+118B1; C; 118D1; # WARANG CITI CAPITAL LETTER ODD
+118B2; C; 118D2; # WARANG CITI CAPITAL LETTER TTE
+118B3; C; 118D3; # WARANG CITI CAPITAL LETTER NUNG
+118B4; C; 118D4; # WARANG CITI CAPITAL LETTER DA
+118B5; C; 118D5; # WARANG CITI CAPITAL LETTER AT
+118B6; C; 118D6; # WARANG CITI CAPITAL LETTER AM
+118B7; C; 118D7; # WARANG CITI CAPITAL LETTER BU
+118B8; C; 118D8; # WARANG CITI CAPITAL LETTER PU
+118B9; C; 118D9; # WARANG CITI CAPITAL LETTER HIYO
+118BA; C; 118DA; # WARANG CITI CAPITAL LETTER HOLO
+118BB; C; 118DB; # WARANG CITI CAPITAL LETTER HORR
+118BC; C; 118DC; # WARANG CITI CAPITAL LETTER HAR
+118BD; C; 118DD; # WARANG CITI CAPITAL LETTER SSUU
+118BE; C; 118DE; # WARANG CITI CAPITAL LETTER SII
+118BF; C; 118DF; # WARANG CITI CAPITAL LETTER VIYO
+1E900; C; 1E922; # ADLAM CAPITAL LETTER ALIF
+1E901; C; 1E923; # ADLAM CAPITAL LETTER DAALI
+1E902; C; 1E924; # ADLAM CAPITAL LETTER LAAM
+1E903; C; 1E925; # ADLAM CAPITAL LETTER MIIM
+1E904; C; 1E926; # ADLAM CAPITAL LETTER BA
+1E905; C; 1E927; # ADLAM CAPITAL LETTER SINNYIIYHE
+1E906; C; 1E928; # ADLAM CAPITAL LETTER PE
+1E907; C; 1E929; # ADLAM CAPITAL LETTER BHE
+1E908; C; 1E92A; # ADLAM CAPITAL LETTER RA
+1E909; C; 1E92B; # ADLAM CAPITAL LETTER E
+1E90A; C; 1E92C; # ADLAM CAPITAL LETTER FA
+1E90B; C; 1E92D; # ADLAM CAPITAL LETTER I
+1E90C; C; 1E92E; # ADLAM CAPITAL LETTER O
+1E90D; C; 1E92F; # ADLAM CAPITAL LETTER DHA
+1E90E; C; 1E930; # ADLAM CAPITAL LETTER YHE
+1E90F; C; 1E931; # ADLAM CAPITAL LETTER WAW
+1E910; C; 1E932; # ADLAM CAPITAL LETTER NUN
+1E911; C; 1E933; # ADLAM CAPITAL LETTER KAF
+1E912; C; 1E934; # ADLAM CAPITAL LETTER YA
+1E913; C; 1E935; # ADLAM CAPITAL LETTER U
+1E914; C; 1E936; # ADLAM CAPITAL LETTER JIIM
+1E915; C; 1E937; # ADLAM CAPITAL LETTER CHI
+1E916; C; 1E938; # ADLAM CAPITAL LETTER HA
+1E917; C; 1E939; # ADLAM CAPITAL LETTER QAAF
+1E918; C; 1E93A; # ADLAM CAPITAL LETTER GA
+1E919; C; 1E93B; # ADLAM CAPITAL LETTER NYA
+1E91A; C; 1E93C; # ADLAM CAPITAL LETTER TU
+1E91B; C; 1E93D; # ADLAM CAPITAL LETTER NHA
+1E91C; C; 1E93E; # ADLAM CAPITAL LETTER VA
+1E91D; C; 1E93F; # ADLAM CAPITAL LETTER KHA
+1E91E; C; 1E940; # ADLAM CAPITAL LETTER GBE
+1E91F; C; 1E941; # ADLAM CAPITAL LETTER ZAL
+1E920; C; 1E942; # ADLAM CAPITAL LETTER KPO
+1E921; C; 1E943; # ADLAM CAPITAL LETTER SHA
#
# EOF
diff --git a/chromium/third_party/fontconfig/src/fc-case/Makefile.am b/chromium/third_party/fontconfig/src/fc-case/Makefile.am
index 662f771af6d..4c30a1eedc9 100644
--- a/chromium/third_party/fontconfig/src/fc-case/Makefile.am
+++ b/chromium/third_party/fontconfig/src/fc-case/Makefile.am
@@ -28,6 +28,9 @@ DEPS = $(srcdir)/CaseFolding.txt
ARGS = $(srcdir)/CaseFolding.txt
DIST = $(srcdir)/CaseFolding.txt
+update:
+ curl -s -o $(srcdir)/CaseFolding.txt http://www.unicode.org/Public/UNIDATA/CaseFolding.txt
+
include $(top_srcdir)/Tools.mk
-include $(top_srcdir)/git.mk
diff --git a/chromium/third_party/fontconfig/src/fc-cat/fc-cat.c b/chromium/third_party/fontconfig/src/fc-cat/fc-cat.c
index 9a2abb3fa31..a1dc848b8b1 100644
--- a/chromium/third_party/fontconfig/src/fc-cat/fc-cat.c
+++ b/chromium/third_party/fontconfig/src/fc-cat/fc-cat.c
@@ -298,6 +298,7 @@ main (int argc, char **argv)
return 1;
}
FcConfigSetCurrent (config);
+ FcConfigDestroy (config);
args = FcStrSetCreate ();
if (!args)
@@ -315,12 +316,6 @@ main (int argc, char **argv)
return 1;
}
}
- arglist = FcStrListCreate (args);
- if (!arglist)
- {
- fprintf (stderr, "%s: malloc failure\n", argv[0]);
- return 1;
- }
}
else
{
@@ -340,20 +335,26 @@ main (int argc, char **argv)
fprintf (stderr, "%s: malloc failure\n", argv[0]);
return 1;
}
+ FcStrSetDestroy (args);
while ((arg = FcStrListNext (arglist)))
{
int j;
FcChar8 *cache_file = NULL;
struct stat file_stat;
-
+
+ /* reset errno */
+ errno = 0;
if (FcFileIsDir (arg))
cache = FcDirCacheLoad (arg, config, &cache_file);
else
cache = FcDirCacheLoadFile (arg, &file_stat);
if (!cache)
{
- perror ((char *) arg);
+ if (errno != 0)
+ perror ((char *) arg);
+ else
+ fprintf (stderr, "%s: Unable to load the cache: %s\n", argv[0], arg);
ret++;
continue;
}
@@ -384,6 +385,7 @@ main (int argc, char **argv)
if (cache_file)
FcStrFree (cache_file);
}
+ FcStrListDone (arglist);
FcFini ();
return 0;
diff --git a/chromium/third_party/fontconfig/src/fc-cat/fc-cat.sgml b/chromium/third_party/fontconfig/src/fc-cat/fc-cat.sgml
index ce4736de5e8..a51325433cd 100644
--- a/chromium/third_party/fontconfig/src/fc-cat/fc-cat.sgml
+++ b/chromium/third_party/fontconfig/src/fc-cat/fc-cat.sgml
@@ -70,7 +70,7 @@ manpage.1: manpage.sgml
<arg><option>--help</option></arg>
<sbr>
<group rep="repeat">
- <arg><option><replaceable>fonts-cache-2-files</replaceable></option></arg>
+ <arg><option><replaceable>fonts-cache-%version%-files</replaceable></option></arg>
<arg><option><replaceable>dirs</replaceable></option></arg>
</group>
diff --git a/chromium/third_party/fontconfig/src/fc-glyphname/fc-glyphname.c b/chromium/third_party/fontconfig/src/fc-glyphname/fc-glyphname.c
index 84027816430..078490ae442 100644
--- a/chromium/third_party/fontconfig/src/fc-glyphname/fc-glyphname.c
+++ b/chromium/third_party/fontconfig/src/fc-glyphname/fc-glyphname.c
@@ -233,7 +233,7 @@ dump (FcGlyphName * const *table, const char *name)
int
main (int argc FC_UNUSED, char **argv)
{
- char *files[MAX_GLYPHFILE];
+ char *files[MAX_GLYPHFILE + 1];
char line[1024];
FILE *f;
int i;
diff --git a/chromium/third_party/fontconfig/src/fc-lang/README b/chromium/third_party/fontconfig/src/fc-lang/README
new file mode 100644
index 00000000000..4aef7d1165f
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/fc-lang/README
@@ -0,0 +1,28 @@
+Requirements for adding new orth file:
+
+* we are following up to the locale name, 2 or 3 letter code
+ in ISO 639 and ISO 3166-1 alpha-2 code to determine a
+ filename. if it's not yet available, in advance, you
+ should get it fixed in glibc or so.
+
+* Please add a reference URL (written in English as far as
+ possible) into the orth file that explains the code
+ coverage for the certain language. this would helps to
+ review if it has enough coverage.
+
+* no need to add all of the codepoints for the certain
+ language. good enough if it covers most frequently used
+ codepoints in it.
+
+To update existing orth files:
+
+* Please make sure how the changes affects to the existing
+ fonts and no regressions except it is expected behavior.
+
+* Please add any reference URL in bugzilla or any
+ explanation why it needs to be added/removed and also why
+ current orth file doesn't work.
+
+* Please provide a test case what fonts are supposed to be
+ accepted against the change and what fonts aren't.
+
diff --git a/chromium/third_party/fontconfig/src/fc-lang/fc-lang.c b/chromium/third_party/fontconfig/src/fc-lang/fc-lang.c
index 0f4217f78f5..38fc6973558 100644
--- a/chromium/third_party/fontconfig/src/fc-lang/fc-lang.c
+++ b/chromium/third_party/fontconfig/src/fc-lang/fc-lang.c
@@ -254,7 +254,7 @@ static int compare (const void *a, const void *b)
int
main (int argc FC_UNUSED, char **argv)
{
- static Entry entries[MAX_LANG];
+ static Entry entries[MAX_LANG + 1];
static FcCharSet *sets[MAX_LANG];
static int duplicate[MAX_LANG];
static int country[MAX_LANG];
diff --git a/chromium/third_party/fontconfig/src/fc-lang/ja.orth b/chromium/third_party/fontconfig/src/fc-lang/ja.orth
index e87269b85d0..dbc16d4d719 100644
--- a/chromium/third_party/fontconfig/src/fc-lang/ja.orth
+++ b/chromium/third_party/fontconfig/src/fc-lang/ja.orth
@@ -21,13 +21,14 @@
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
-# Coverage from JIS X 0208 (1990)
+# Coverage from JIS X 0208 (1997) for non kanji characters, and
+# Joyo Kanji List (2010, cabinet notification of regular-use chinese characters)
#
0x3000 # IDEOGRAPHIC SPACE
0x3001 # IDEOGRAPHIC COMMA
0x3002 # IDEOGRAPHIC FULL STOP
0x3005 # IDEOGRAPHIC ITERATION MARK
-0x3006 # IDEOGRAPHIC CLOSING MARK
+#0x3006 # IDEOGRAPHIC CLOSING MARK # not in Sawarabi Gothic
0x3007 # IDEOGRAPHIC NUMBER ZERO
0x3041 # HIRAGANA LETTER SMALL A
0x3042 # HIRAGANA LETTER A
@@ -216,171 +217,88 @@
0x4E0B # <CJK>
0x4E0D # <CJK>
0x4E0E # <CJK>
-0x4E10 # <CJK>
-0x4E11 # <CJK>
0x4E14 # <CJK>
-0x4E15 # <CJK>
0x4E16 # <CJK>
-0x4E17 # <CJK>
0x4E18 # <CJK>
0x4E19 # <CJK>
-0x4E1E # <CJK>
0x4E21 # <CJK>
0x4E26 # <CJK>
-0x4E2A # <CJK>
0x4E2D # <CJK>
-0x4E31 # <CJK>
0x4E32 # <CJK>
-0x4E36 # <CJK>
0x4E38 # <CJK>
0x4E39 # <CJK>
0x4E3B # <CJK>
0x4E3C # <CJK>
-0x4E3F # <CJK>
-0x4E42 # <CJK>
-0x4E43 # <CJK>
0x4E45 # <CJK>
-0x4E4B # <CJK>
-0x4E4D # <CJK>
-0x4E4E # <CJK>
0x4E4F # <CJK>
-0x4E55 # <CJK>
-0x4E56 # <CJK>
0x4E57 # <CJK>
-0x4E58 # <CJK>
0x4E59 # <CJK>
0x4E5D # <CJK>
0x4E5E # <CJK>
-0x4E5F # <CJK>
-0x4E62 # <CJK>
0x4E71 # <CJK>
0x4E73 # <CJK>
0x4E7E # <CJK>
0x4E80 # <CJK>
-0x4E82 # <CJK>
-0x4E85 # <CJK>
0x4E86 # <CJK>
0x4E88 # <CJK>
0x4E89 # <CJK>
-0x4E8A # <CJK>
0x4E8B # <CJK>
0x4E8C # <CJK>
-0x4E8E # <CJK>
-0x4E91 # <CJK>
0x4E92 # <CJK>
0x4E94 # <CJK>
0x4E95 # <CJK>
-0x4E98 # <CJK>
-0x4E99 # <CJK>
-0x4E9B # <CJK>
0x4E9C # <CJK>
-0x4E9E # <CJK>
-0x4E9F # <CJK>
-0x4EA0 # <CJK>
0x4EA1 # <CJK>
-0x4EA2 # <CJK>
0x4EA4 # <CJK>
-0x4EA5 # <CJK>
-0x4EA6 # <CJK>
-0x4EA8 # <CJK>
0x4EAB # <CJK>
0x4EAC # <CJK>
0x4EAD # <CJK>
-0x4EAE # <CJK>
-0x4EB0 # <CJK>
-0x4EB3 # <CJK>
-0x4EB6 # <CJK>
0x4EBA # <CJK>
-0x4EC0 # <CJK>
0x4EC1 # <CJK>
-0x4EC2 # <CJK>
-0x4EC4 # <CJK>
-0x4EC6 # <CJK>
-0x4EC7 # <CJK>
0x4ECA # <CJK>
0x4ECB # <CJK>
-0x4ECD # <CJK>
-0x4ECE # <CJK>
0x4ECF # <CJK>
-0x4ED4 # <CJK>
0x4ED5 # <CJK>
0x4ED6 # <CJK>
-0x4ED7 # <CJK>
0x4ED8 # <CJK>
0x4ED9 # <CJK>
-0x4EDD # <CJK>
-0x4EDE # <CJK>
-0x4EDF # <CJK>
0x4EE3 # <CJK>
0x4EE4 # <CJK>
0x4EE5 # <CJK>
-0x4EED # <CJK>
0x4EEE # <CJK>
0x4EF0 # <CJK>
0x4EF2 # <CJK>
0x4EF6 # <CJK>
-0x4EF7 # <CJK>
0x4EFB # <CJK>
0x4F01 # <CJK>
-0x4F09 # <CJK>
-0x4F0A # <CJK>
-0x4F0D # <CJK>
0x4F0E # <CJK>
0x4F0F # <CJK>
0x4F10 # <CJK>
0x4F11 # <CJK>
0x4F1A # <CJK>
-0x4F1C # <CJK>
0x4F1D # <CJK>
0x4F2F # <CJK>
-0x4F30 # <CJK>
0x4F34 # <CJK>
-0x4F36 # <CJK>
0x4F38 # <CJK>
0x4F3A # <CJK>
0x4F3C # <CJK>
-0x4F3D # <CJK>
-0x4F43 # <CJK>
0x4F46 # <CJK>
-0x4F47 # <CJK>
0x4F4D # <CJK>
0x4F4E # <CJK>
0x4F4F # <CJK>
0x4F50 # <CJK>
-0x4F51 # <CJK>
0x4F53 # <CJK>
0x4F55 # <CJK>
-0x4F57 # <CJK>
0x4F59 # <CJK>
-0x4F5A # <CJK>
-0x4F5B # <CJK>
0x4F5C # <CJK>
-0x4F5D # <CJK>
-0x4F5E # <CJK>
-0x4F69 # <CJK>
-0x4F6F # <CJK>
-0x4F70 # <CJK>
0x4F73 # <CJK>
0x4F75 # <CJK>
-0x4F76 # <CJK>
-0x4F7B # <CJK>
-0x4F7C # <CJK>
0x4F7F # <CJK>
-0x4F83 # <CJK>
-0x4F86 # <CJK>
-0x4F88 # <CJK>
0x4F8B # <CJK>
0x4F8D # <CJK>
-0x4F8F # <CJK>
-0x4F91 # <CJK>
-0x4F96 # <CJK>
-0x4F98 # <CJK>
0x4F9B # <CJK>
0x4F9D # <CJK>
-0x4FA0 # <CJK>
0x4FA1 # <CJK>
-0x4FAB # <CJK>
-0x4FAD # <CJK>
0x4FAE # <CJK>
0x4FAF # <CJK>
0x4FB5 # <CJK>
@@ -388,364 +306,165 @@
0x4FBF # <CJK>
0x4FC2 # <CJK>
0x4FC3 # <CJK>
-0x4FC4 # <CJK>
0x4FCA # <CJK>
-0x4FCE # <CJK>
-0x4FD0 # <CJK>
-0x4FD1 # <CJK>
-0x4FD4 # <CJK>
0x4FD7 # <CJK>
-0x4FD8 # <CJK>
-0x4FDA # <CJK>
-0x4FDB # <CJK>
0x4FDD # <CJK>
-0x4FDF # <CJK>
0x4FE1 # <CJK>
-0x4FE3 # <CJK>
-0x4FE4 # <CJK>
-0x4FE5 # <CJK>
0x4FEE # <CJK>
-0x4FEF # <CJK>
0x4FF3 # <CJK>
0x4FF5 # <CJK>
-0x4FF6 # <CJK>
0x4FF8 # <CJK>
0x4FFA # <CJK>
-0x4FFE # <CJK>
-0x5005 # <CJK>
-0x5006 # <CJK>
0x5009 # <CJK>
0x500B # <CJK>
0x500D # <CJK>
-0x500F # <CJK>
-0x5011 # <CJK>
0x5012 # <CJK>
-0x5014 # <CJK>
-0x5016 # <CJK>
0x5019 # <CJK>
-0x501A # <CJK>
0x501F # <CJK>
-0x5021 # <CJK>
0x5023 # <CJK>
0x5024 # <CJK>
-0x5025 # <CJK>
-0x5026 # <CJK>
-0x5028 # <CJK>
-0x5029 # <CJK>
-0x502A # <CJK>
0x502B # <CJK>
-0x502C # <CJK>
-0x502D # <CJK>
-0x5036 # <CJK>
0x5039 # <CJK>
-0x5043 # <CJK>
-0x5047 # <CJK>
-0x5048 # <CJK>
0x5049 # <CJK>
0x504F # <CJK>
-0x5050 # <CJK>
-0x5055 # <CJK>
-0x5056 # <CJK>
-0x505A # <CJK>
0x505C # <CJK>
0x5065 # <CJK>
-0x506C # <CJK>
-0x5072 # <CJK>
0x5074 # <CJK>
0x5075 # <CJK>
0x5076 # <CJK>
-0x5078 # <CJK>
0x507D # <CJK>
-0x5080 # <CJK>
-0x5085 # <CJK>
0x508D # <CJK>
0x5091 # <CJK>
0x5098 # <CJK>
0x5099 # <CJK>
-0x509A # <CJK>
0x50AC # <CJK>
-0x50AD # <CJK>
0x50B2 # <CJK>
-0x50B3 # <CJK>
-0x50B4 # <CJK>
0x50B5 # <CJK>
0x50B7 # <CJK>
0x50BE # <CJK>
-0x50C2 # <CJK>
0x50C5 # <CJK>
-0x50C9 # <CJK>
-0x50CA # <CJK>
0x50CD # <CJK>
0x50CF # <CJK>
-0x50D1 # <CJK>
0x50D5 # <CJK>
-0x50D6 # <CJK>
0x50DA # <CJK>
-0x50DE # <CJK>
-0x50E3 # <CJK>
-0x50E5 # <CJK>
0x50E7 # <CJK>
-0x50ED # <CJK>
-0x50EE # <CJK>
-0x50F5 # <CJK>
-0x50F9 # <CJK>
-0x50FB # <CJK>
0x5100 # <CJK>
-0x5101 # <CJK>
-0x5102 # <CJK>
0x5104 # <CJK>
-0x5109 # <CJK>
0x5112 # <CJK>
-0x5114 # <CJK>
-0x5115 # <CJK>
-0x5116 # <CJK>
-0x5118 # <CJK>
-0x511A # <CJK>
0x511F # <CJK>
-0x5121 # <CJK>
0x512A # <CJK>
-0x5132 # <CJK>
-0x5137 # <CJK>
-0x513A # <CJK>
-0x513B # <CJK>
-0x513C # <CJK>
-0x513F # <CJK>
-0x5140 # <CJK>
-0x5141 # <CJK>
0x5143 # <CJK>
0x5144 # <CJK>
0x5145 # <CJK>
0x5146 # <CJK>
-0x5147 # <CJK>
0x5148 # <CJK>
0x5149 # <CJK>
0x514B # <CJK>
-0x514C # <CJK>
0x514D # <CJK>
-0x514E # <CJK>
0x5150 # <CJK>
-0x5152 # <CJK>
-0x5154 # <CJK>
0x515A # <CJK>
-0x515C # <CJK>
-0x5162 # <CJK>
0x5165 # <CJK>
0x5168 # <CJK>
-0x5169 # <CJK>
-0x516A # <CJK>
0x516B # <CJK>
0x516C # <CJK>
0x516D # <CJK>
-0x516E # <CJK>
0x5171 # <CJK>
0x5175 # <CJK>
-0x5176 # <CJK>
0x5177 # <CJK>
0x5178 # <CJK>
0x517C # <CJK>
-0x5180 # <CJK>
-0x5182 # <CJK>
0x5185 # <CJK>
0x5186 # <CJK>
-0x5189 # <CJK>
0x518A # <CJK>
-0x518C # <CJK>
0x518D # <CJK>
-0x518F # <CJK>
-0x5190 # <CJK>
-0x5191 # <CJK>
0x5192 # <CJK>
-0x5193 # <CJK>
-0x5195 # <CJK>
-0x5196 # <CJK>
0x5197 # <CJK>
0x5199 # <CJK>
0x51A0 # <CJK>
-0x51A2 # <CJK>
-0x51A4 # <CJK>
0x51A5 # <CJK>
-0x51A6 # <CJK>
-0x51A8 # <CJK>
-0x51A9 # <CJK>
-0x51AA # <CJK>
-0x51AB # <CJK>
0x51AC # <CJK>
-0x51B0 # <CJK>
-0x51B1 # <CJK>
-0x51B2 # <CJK>
-0x51B3 # <CJK>
-0x51B4 # <CJK>
-0x51B5 # <CJK>
0x51B6 # <CJK>
0x51B7 # <CJK>
-0x51BD # <CJK>
0x51C4 # <CJK>
-0x51C5 # <CJK>
0x51C6 # <CJK>
-0x51C9 # <CJK>
-0x51CB # <CJK>
-0x51CC # <CJK>
0x51CD # <CJK>
-0x51D6 # <CJK>
-0x51DB # <CJK>
-#0x51DC # <CJK> # not in kochi fonts
0x51DD # <CJK>
-0x51E0 # <CJK>
0x51E1 # <CJK>
0x51E6 # <CJK>
-0x51E7 # <CJK>
-0x51E9 # <CJK>
-0x51EA # <CJK>
-0x51ED # <CJK>
-0x51F0 # <CJK>
-0x51F1 # <CJK>
-0x51F5 # <CJK>
0x51F6 # <CJK>
0x51F8 # <CJK>
0x51F9 # <CJK>
0x51FA # <CJK>
-0x51FD # <CJK>
-0x51FE # <CJK>
0x5200 # <CJK>
0x5203 # <CJK>
-0x5204 # <CJK>
0x5206 # <CJK>
0x5207 # <CJK>
0x5208 # <CJK>
0x520A # <CJK>
-0x520B # <CJK>
-0x520E # <CJK>
0x5211 # <CJK>
-0x5214 # <CJK>
0x5217 # <CJK>
0x521D # <CJK>
0x5224 # <CJK>
0x5225 # <CJK>
-0x5227 # <CJK>
0x5229 # <CJK>
-0x522A # <CJK>
-0x522E # <CJK>
0x5230 # <CJK>
-0x5233 # <CJK>
0x5236 # <CJK>
0x5237 # <CJK>
0x5238 # <CJK>
0x5239 # <CJK>
0x523A # <CJK>
0x523B # <CJK>
-0x5243 # <CJK>
-0x5244 # <CJK>
0x5247 # <CJK>
0x524A # <CJK>
-0x524B # <CJK>
-0x524C # <CJK>
0x524D # <CJK>
-0x524F # <CJK>
-0x5254 # <CJK>
0x5256 # <CJK>
0x525B # <CJK>
-0x525E # <CJK>
+#0x525D # <CJK> # not in sazanami gothic/mincho, DroidSansJapanese
0x5263 # <CJK>
0x5264 # <CJK>
-0x5265 # <CJK>
-0x5269 # <CJK>
-0x526A # <CJK>
0x526F # <CJK>
0x5270 # <CJK>
-0x5271 # <CJK>
0x5272 # <CJK>
-0x5273 # <CJK>
-0x5274 # <CJK>
0x5275 # <CJK>
-0x527D # <CJK>
-0x527F # <CJK>
-0x5283 # <CJK>
0x5287 # <CJK>
-0x5288 # <CJK>
-0x5289 # <CJK>
-0x528D # <CJK>
-0x5291 # <CJK>
-0x5292 # <CJK>
-0x5294 # <CJK>
0x529B # <CJK>
0x529F # <CJK>
0x52A0 # <CJK>
0x52A3 # <CJK>
0x52A9 # <CJK>
0x52AA # <CJK>
-0x52AB # <CJK>
-0x52AC # <CJK>
-0x52AD # <CJK>
0x52B1 # <CJK>
0x52B4 # <CJK>
-0x52B5 # <CJK>
0x52B9 # <CJK>
-0x52BC # <CJK>
0x52BE # <CJK>
-0x52C1 # <CJK>
0x52C3 # <CJK>
0x52C5 # <CJK>
0x52C7 # <CJK>
0x52C9 # <CJK>
-0x52CD # <CJK>
-0x52D2 # <CJK>
0x52D5 # <CJK>
-0x52D7 # <CJK>
0x52D8 # <CJK>
0x52D9 # <CJK>
0x52DD # <CJK>
-0x52DE # <CJK>
0x52DF # <CJK>
-0x52E0 # <CJK>
0x52E2 # <CJK>
-0x52E3 # <CJK>
0x52E4 # <CJK>
-0x52E6 # <CJK>
0x52E7 # <CJK>
0x52F2 # <CJK>
-0x52F3 # <CJK>
-0x52F5 # <CJK>
-0x52F8 # <CJK>
-0x52F9 # <CJK>
-0x52FA # <CJK>
0x52FE # <CJK>
-0x52FF # <CJK>
-0x5301 # <CJK>
0x5302 # <CJK>
0x5305 # <CJK>
-0x5306 # <CJK>
-0x5308 # <CJK>
-0x530D # <CJK>
-0x530F # <CJK>
-0x5310 # <CJK>
-0x5315 # <CJK>
0x5316 # <CJK>
0x5317 # <CJK>
-0x5319 # <CJK>
-0x531A # <CJK>
-0x531D # <CJK>
0x5320 # <CJK>
-0x5321 # <CJK>
-0x5323 # <CJK>
-0x532A # <CJK>
-0x532F # <CJK>
-0x5331 # <CJK>
-0x5333 # <CJK>
-0x5338 # <CJK>
0x5339 # <CJK>
0x533A # <CJK>
0x533B # <CJK>
0x533F # <CJK>
-0x5340 # <CJK>
0x5341 # <CJK>
0x5343 # <CJK>
-0x5345 # <CJK>
-0x5346 # <CJK>
0x5347 # <CJK>
0x5348 # <CJK>
-0x5349 # <CJK>
0x534A # <CJK>
-0x534D # <CJK>
0x5351 # <CJK>
0x5352 # <CJK>
0x5353 # <CJK>
@@ -753,43 +472,21 @@
0x5357 # <CJK>
0x5358 # <CJK>
0x535A # <CJK>
-0x535C # <CJK>
-0x535E # <CJK>
0x5360 # <CJK>
-0x5366 # <CJK>
-0x5369 # <CJK>
-0x536E # <CJK>
-0x536F # <CJK>
0x5370 # <CJK>
0x5371 # <CJK>
0x5373 # <CJK>
0x5374 # <CJK>
0x5375 # <CJK>
-0x5377 # <CJK>
0x5378 # <CJK>
-0x537B # <CJK>
-0x537F # <CJK>
-0x5382 # <CJK>
0x5384 # <CJK>
-0x5396 # <CJK>
0x5398 # <CJK>
0x539A # <CJK>
0x539F # <CJK>
-0x53A0 # <CJK>
-0x53A5 # <CJK>
-0x53A6 # <CJK>
-0x53A8 # <CJK>
-0x53A9 # <CJK>
-0x53AD # <CJK>
-0x53AE # <CJK>
-0x53B0 # <CJK>
0x53B3 # <CJK>
-0x53B6 # <CJK>
0x53BB # <CJK>
0x53C2 # <CJK>
-0x53C3 # <CJK>
0x53C8 # <CJK>
-0x53C9 # <CJK>
0x53CA # <CJK>
0x53CB # <CJK>
0x53CC # <CJK>
@@ -799,36 +496,20 @@
0x53D6 # <CJK>
0x53D7 # <CJK>
0x53D9 # <CJK>
-0x53DB # <CJK>
-0x53DF # <CJK>
-0x53E1 # <CJK>
-0x53E2 # <CJK>
0x53E3 # <CJK>
0x53E4 # <CJK>
0x53E5 # <CJK>
-0x53E8 # <CJK>
-0x53E9 # <CJK>
-0x53EA # <CJK>
0x53EB # <CJK>
0x53EC # <CJK>
-0x53ED # <CJK>
-0x53EE # <CJK>
0x53EF # <CJK>
0x53F0 # <CJK>
-0x53F1 # <CJK>
0x53F2 # <CJK>
0x53F3 # <CJK>
-0x53F6 # <CJK>
0x53F7 # <CJK>
0x53F8 # <CJK>
-0x53FA # <CJK>
-0x5401 # <CJK>
-0x5403 # <CJK>
0x5404 # <CJK>
0x5408 # <CJK>
0x5409 # <CJK>
-0x540A # <CJK>
-0x540B # <CJK>
0x540C # <CJK>
0x540D # <CJK>
0x540E # <CJK>
@@ -836,273 +517,82 @@
0x5410 # <CJK>
0x5411 # <CJK>
0x541B # <CJK>
-0x541D # <CJK>
0x541F # <CJK>
-0x5420 # <CJK>
0x5426 # <CJK>
-0x5429 # <CJK>
0x542B # <CJK>
-0x542C # <CJK>
-0x542D # <CJK>
-0x542E # <CJK>
-0x5436 # <CJK>
0x5438 # <CJK>
0x5439 # <CJK>
-0x543B # <CJK>
-0x543C # <CJK>
-0x543D # <CJK>
-0x543E # <CJK>
-0x5440 # <CJK>
0x5442 # <CJK>
-0x5446 # <CJK>
0x5448 # <CJK>
0x5449 # <CJK>
0x544A # <CJK>
-0x544E # <CJK>
-0x5451 # <CJK>
-0x545F # <CJK>
0x5468 # <CJK>
0x546A # <CJK>
-0x5470 # <CJK>
-0x5471 # <CJK>
0x5473 # <CJK>
-0x5475 # <CJK>
-0x5476 # <CJK>
-0x5477 # <CJK>
-0x547B # <CJK>
0x547C # <CJK>
0x547D # <CJK>
-0x5480 # <CJK>
-0x5484 # <CJK>
-0x5486 # <CJK>
-0x548B # <CJK>
0x548C # <CJK>
-0x548E # <CJK>
-0x548F # <CJK>
-0x5490 # <CJK>
-0x5492 # <CJK>
-0x54A2 # <CJK>
-0x54A4 # <CJK>
-0x54A5 # <CJK>
-0x54A8 # <CJK>
-0x54AB # <CJK>
-0x54AC # <CJK>
-0x54AF # <CJK>
0x54B2 # <CJK>
-0x54B3 # <CJK>
-0x54B8 # <CJK>
-0x54BC # <CJK>
0x54BD # <CJK>
-0x54BE # <CJK>
0x54C0 # <CJK>
0x54C1 # <CJK>
-0x54C2 # <CJK>
-0x54C4 # <CJK>
-0x54C7 # <CJK>
-0x54C8 # <CJK>
-0x54C9 # <CJK>
-0x54D8 # <CJK>
0x54E1 # <CJK>
-0x54E2 # <CJK>
-0x54E5 # <CJK>
-0x54E6 # <CJK>
-0x54E8 # <CJK>
-0x54E9 # <CJK>
-0x54ED # <CJK>
-0x54EE # <CJK>
0x54F2 # <CJK>
0x54FA # <CJK>
-0x54FD # <CJK>
0x5504 # <CJK>
0x5506 # <CJK>
0x5507 # <CJK>
-0x550F # <CJK>
0x5510 # <CJK>
-0x5514 # <CJK>
-0x5516 # <CJK>
-0x552E # <CJK>
0x552F # <CJK>
0x5531 # <CJK>
-0x5533 # <CJK>
-0x5538 # <CJK>
-0x5539 # <CJK>
0x553E # <CJK>
-0x5540 # <CJK>
-0x5544 # <CJK>
-0x5545 # <CJK>
0x5546 # <CJK>
-0x554C # <CJK>
0x554F # <CJK>
0x5553 # <CJK>
-0x5556 # <CJK>
-0x5557 # <CJK>
-0x555C # <CJK>
-0x555D # <CJK>
-0x5563 # <CJK>
-0x557B # <CJK>
-0x557C # <CJK>
-0x557E # <CJK>
-0x5580 # <CJK>
-0x5583 # <CJK>
0x5584 # <CJK>
-0x5587 # <CJK>
0x5589 # <CJK>
-0x558A # <CJK>
-0x558B # <CJK>
-0x5598 # <CJK>
-0x5599 # <CJK>
0x559A # <CJK>
0x559C # <CJK>
0x559D # <CJK>
-0x559E # <CJK>
-0x559F # <CJK>
-0x55A7 # <CJK>
-0x55A8 # <CJK>
0x55A9 # <CJK>
0x55AA # <CJK>
0x55AB # <CJK>
-0x55AC # <CJK>
-0x55AE # <CJK>
-0x55B0 # <CJK>
0x55B6 # <CJK>
-0x55C4 # <CJK>
0x55C5 # <CJK>
-0x55C7 # <CJK>
-0x55D4 # <CJK>
-0x55DA # <CJK>
-0x55DC # <CJK>
-0x55DF # <CJK>
0x55E3 # <CJK>
-0x55E4 # <CJK>
-0x55F7 # <CJK>
-0x55F9 # <CJK>
-0x55FD # <CJK>
-0x55FE # <CJK>
0x5606 # <CJK>
-0x5609 # <CJK>
-0x5614 # <CJK>
-0x5616 # <CJK>
-0x5617 # <CJK>
-0x5618 # <CJK>
-0x561B # <CJK>
-0x5629 # <CJK>
-0x562F # <CJK>
0x5631 # <CJK>
0x5632 # <CJK>
-0x5634 # <CJK>
-0x5636 # <CJK>
-0x5638 # <CJK>
-0x5642 # <CJK>
-0x564C # <CJK>
-0x564E # <CJK>
-0x5650 # <CJK>
-0x565B # <CJK>
-0x5664 # <CJK>
0x5668 # <CJK>
-0x566A # <CJK>
-0x566B # <CJK>
-0x566C # <CJK>
0x5674 # <CJK>
-0x5678 # <CJK>
-0x567A # <CJK>
-0x5680 # <CJK>
-0x5686 # <CJK>
0x5687 # <CJK>
-0x568A # <CJK>
-0x568F # <CJK>
-0x5694 # <CJK>
-0x56A0 # <CJK>
-0x56A2 # <CJK>
-0x56A5 # <CJK>
-0x56AE # <CJK>
-0x56B4 # <CJK>
-0x56B6 # <CJK>
-0x56BC # <CJK>
-0x56C0 # <CJK>
-0x56C1 # <CJK>
-0x56C2 # <CJK>
-0x56C3 # <CJK>
-0x56C8 # <CJK>
-0x56CE # <CJK>
-0x56D1 # <CJK>
-0x56D3 # <CJK>
-0x56D7 # <CJK>
-0x56D8 # <CJK>
0x56DA # <CJK>
0x56DB # <CJK>
0x56DE # <CJK>
0x56E0 # <CJK>
0x56E3 # <CJK>
-0x56EE # <CJK>
0x56F0 # <CJK>
0x56F2 # <CJK>
0x56F3 # <CJK>
-0x56F9 # <CJK>
0x56FA # <CJK>
0x56FD # <CJK>
-0x56FF # <CJK>
-0x5700 # <CJK>
-0x5703 # <CJK>
-0x5704 # <CJK>
-0x5708 # <CJK>
-0x5709 # <CJK>
-0x570B # <CJK>
-0x570D # <CJK>
0x570F # <CJK>
0x5712 # <CJK>
-0x5713 # <CJK>
-0x5716 # <CJK>
-0x5718 # <CJK>
-0x571C # <CJK>
0x571F # <CJK>
-0x5726 # <CJK>
0x5727 # <CJK>
0x5728 # <CJK>
-0x572D # <CJK>
0x5730 # <CJK>
-0x5737 # <CJK>
-0x5738 # <CJK>
-0x573B # <CJK>
-0x5740 # <CJK>
0x5742 # <CJK>
0x5747 # <CJK>
0x574A # <CJK>
-0x574E # <CJK>
-0x574F # <CJK>
-0x5750 # <CJK>
0x5751 # <CJK>
-0x5761 # <CJK>
-0x5764 # <CJK>
-0x5766 # <CJK>
-0x5769 # <CJK>
0x576A # <CJK>
-0x577F # <CJK>
0x5782 # <CJK>
-0x5788 # <CJK>
-0x5789 # <CJK>
0x578B # <CJK>
-0x5793 # <CJK>
-0x57A0 # <CJK>
-0x57A2 # <CJK>
0x57A3 # <CJK>
-0x57A4 # <CJK>
-0x57AA # <CJK>
-0x57B0 # <CJK>
-0x57B3 # <CJK>
-0x57C0 # <CJK>
-0x57C3 # <CJK>
-0x57C6 # <CJK>
0x57CB # <CJK>
0x57CE # <CJK>
-0x57D2 # <CJK>
-0x57D3 # <CJK>
-0x57D4 # <CJK>
-0x57D6 # <CJK>
-0x57DC # <CJK>
0x57DF # <CJK>
-0x57E0 # <CJK>
-0x57E3 # <CJK>
-0x57F4 # <CJK>
0x57F7 # <CJK>
0x57F9 # <CJK>
0x57FA # <CJK>
@@ -1111,267 +601,111 @@
0x5802 # <CJK>
0x5805 # <CJK>
0x5806 # <CJK>
-0x580A # <CJK>
-0x580B # <CJK>
0x5815 # <CJK>
-0x5819 # <CJK>
-0x581D # <CJK>
-0x5821 # <CJK>
0x5824 # <CJK>
0x582A # <CJK>
-0x582F # <CJK>
-0x5830 # <CJK>
0x5831 # <CJK>
0x5834 # <CJK>
-0x5835 # <CJK>
-0x583A # <CJK>
-0x583D # <CJK>
0x5840 # <CJK>
0x5841 # <CJK>
0x584A # <CJK>
-0x584B # <CJK>
0x5851 # <CJK>
-0x5852 # <CJK>
0x5854 # <CJK>
0x5857 # <CJK>
-0x5858 # <CJK>
-0x5859 # <CJK>
0x585A # <CJK>
0x585E # <CJK>
-0x5862 # <CJK>
+#0x5861 # <CJK> # not in DroidSansJapanese
0x5869 # <CJK>
-0x586B # <CJK>
-0x5870 # <CJK>
-0x5872 # <CJK>
-0x5875 # <CJK>
-0x5879 # <CJK>
0x587E # <CJK>
0x5883 # <CJK>
-0x5885 # <CJK>
0x5893 # <CJK>
0x5897 # <CJK>
0x589C # <CJK>
-0x589F # <CJK>
0x58A8 # <CJK>
-0x58AB # <CJK>
-0x58AE # <CJK>
0x58B3 # <CJK>
-0x58B8 # <CJK>
-0x58B9 # <CJK>
-0x58BA # <CJK>
-0x58BB # <CJK>
0x58BE # <CJK>
0x58C1 # <CJK>
-0x58C5 # <CJK>
0x58C7 # <CJK>
0x58CA # <CJK>
0x58CC # <CJK>
-0x58D1 # <CJK>
-0x58D3 # <CJK>
-0x58D5 # <CJK>
-0x58D7 # <CJK>
-0x58D8 # <CJK>
-0x58D9 # <CJK>
-0x58DC # <CJK>
-0x58DE # <CJK>
-0x58DF # <CJK>
-0x58E4 # <CJK>
-0x58E5 # <CJK>
0x58EB # <CJK>
-0x58EC # <CJK>
0x58EE # <CJK>
-0x58EF # <CJK>
0x58F0 # <CJK>
0x58F1 # <CJK>
0x58F2 # <CJK>
-0x58F7 # <CJK>
-0x58F9 # <CJK>
-0x58FA # <CJK>
-0x58FB # <CJK>
-0x58FC # <CJK>
-0x58FD # <CJK>
-0x5902 # <CJK>
0x5909 # <CJK>
-0x590A # <CJK>
0x590F # <CJK>
-0x5910 # <CJK>
0x5915 # <CJK>
0x5916 # <CJK>
-0x5918 # <CJK>
-0x5919 # <CJK>
0x591A # <CJK>
-0x591B # <CJK>
0x591C # <CJK>
0x5922 # <CJK>
-0x5925 # <CJK>
0x5927 # <CJK>
0x5929 # <CJK>
0x592A # <CJK>
0x592B # <CJK>
-0x592C # <CJK>
-0x592D # <CJK>
0x592E # <CJK>
0x5931 # <CJK>
-0x5932 # <CJK>
-0x5937 # <CJK>
-0x5938 # <CJK>
-0x593E # <CJK>
-0x5944 # <CJK>
0x5947 # <CJK>
0x5948 # <CJK>
0x5949 # <CJK>
-0x594E # <CJK>
0x594F # <CJK>
-0x5950 # <CJK>
0x5951 # <CJK>
0x5954 # <CJK>
-0x5955 # <CJK>
-0x5957 # <CJK>
-0x5958 # <CJK>
-0x595A # <CJK>
-0x5960 # <CJK>
-0x5962 # <CJK>
0x5965 # <CJK>
-0x5967 # <CJK>
0x5968 # <CJK>
-0x5969 # <CJK>
0x596A # <CJK>
-0x596C # <CJK>
0x596E # <CJK>
0x5973 # <CJK>
0x5974 # <CJK>
-0x5978 # <CJK>
0x597D # <CJK>
-0x5981 # <CJK>
0x5982 # <CJK>
0x5983 # <CJK>
0x5984 # <CJK>
0x598A # <CJK>
-0x598D # <CJK>
-0x5993 # <CJK>
0x5996 # <CJK>
0x5999 # <CJK>
-0x599B # <CJK>
-0x599D # <CJK>
-0x59A3 # <CJK>
0x59A5 # <CJK>
0x59A8 # <CJK>
0x59AC # <CJK>
-0x59B2 # <CJK>
0x59B9 # <CJK>
0x59BB # <CJK>
-0x59BE # <CJK>
-0x59C6 # <CJK>
0x59C9 # <CJK>
0x59CB # <CJK>
-0x59D0 # <CJK>
-0x59D1 # <CJK>
0x59D3 # <CJK>
0x59D4 # <CJK>
-0x59D9 # <CJK>
-0x59DA # <CJK>
-0x59DC # <CJK>
-0x59E5 # <CJK>
-0x59E6 # <CJK>
-0x59E8 # <CJK>
-0x59EA # <CJK>
0x59EB # <CJK>
-0x59F6 # <CJK>
0x59FB # <CJK>
0x59FF # <CJK>
0x5A01 # <CJK>
-0x5A03 # <CJK>
-0x5A09 # <CJK>
-0x5A11 # <CJK>
0x5A18 # <CJK>
-0x5A1A # <CJK>
-0x5A1C # <CJK>
-0x5A1F # <CJK>
0x5A20 # <CJK>
-0x5A25 # <CJK>
-0x5A29 # <CJK>
0x5A2F # <CJK>
-0x5A35 # <CJK>
-0x5A36 # <CJK>
-0x5A3C # <CJK>
-0x5A40 # <CJK>
-0x5A41 # <CJK>
0x5A46 # <CJK>
-0x5A49 # <CJK>
0x5A5A # <CJK>
-0x5A62 # <CJK>
0x5A66 # <CJK>
-0x5A6A # <CJK>
-0x5A6C # <CJK>
0x5A7F # <CJK>
0x5A92 # <CJK>
-0x5A9A # <CJK>
0x5A9B # <CJK>
-0x5ABC # <CJK>
-0x5ABD # <CJK>
-0x5ABE # <CJK>
0x5AC1 # <CJK>
-0x5AC2 # <CJK>
0x5AC9 # <CJK>
-0x5ACB # <CJK>
0x5ACC # <CJK>
-0x5AD0 # <CJK>
-0x5AD6 # <CJK>
-0x5AD7 # <CJK>
0x5AE1 # <CJK>
-0x5AE3 # <CJK>
-0x5AE6 # <CJK>
-0x5AE9 # <CJK>
-0x5AFA # <CJK>
-0x5AFB # <CJK>
-0x5B09 # <CJK>
-0x5B0B # <CJK>
-0x5B0C # <CJK>
-0x5B16 # <CJK>
0x5B22 # <CJK>
-0x5B2A # <CJK>
-0x5B2C # <CJK>
-0x5B30 # <CJK>
-0x5B32 # <CJK>
-0x5B36 # <CJK>
-0x5B3E # <CJK>
-0x5B40 # <CJK>
-0x5B43 # <CJK>
-0x5B45 # <CJK>
0x5B50 # <CJK>
-0x5B51 # <CJK>
0x5B54 # <CJK>
-0x5B55 # <CJK>
0x5B57 # <CJK>
0x5B58 # <CJK>
-0x5B5A # <CJK>
-0x5B5B # <CJK>
-0x5B5C # <CJK>
0x5B5D # <CJK>
-0x5B5F # <CJK>
0x5B63 # <CJK>
0x5B64 # <CJK>
-0x5B65 # <CJK>
0x5B66 # <CJK>
-0x5B69 # <CJK>
0x5B6B # <CJK>
-0x5B70 # <CJK>
-0x5B71 # <CJK>
-0x5B73 # <CJK>
-0x5B75 # <CJK>
-0x5B78 # <CJK>
-0x5B7A # <CJK>
-0x5B80 # <CJK>
-0x5B83 # <CJK>
0x5B85 # <CJK>
0x5B87 # <CJK>
0x5B88 # <CJK>
0x5B89 # <CJK>
-0x5B8B # <CJK>
0x5B8C # <CJK>
-0x5B8D # <CJK>
-0x5B8F # <CJK>
-0x5B95 # <CJK>
0x5B97 # <CJK>
0x5B98 # <CJK>
0x5B99 # <CJK>
@@ -1383,47 +717,26 @@
0x5BA2 # <CJK>
0x5BA3 # <CJK>
0x5BA4 # <CJK>
-0x5BA5 # <CJK>
-0x5BA6 # <CJK>
0x5BAE # <CJK>
0x5BB0 # <CJK>
0x5BB3 # <CJK>
0x5BB4 # <CJK>
0x5BB5 # <CJK>
0x5BB6 # <CJK>
-0x5BB8 # <CJK>
0x5BB9 # <CJK>
0x5BBF # <CJK>
0x5BC2 # <CJK>
-0x5BC3 # <CJK>
0x5BC4 # <CJK>
-0x5BC5 # <CJK>
0x5BC6 # <CJK>
-0x5BC7 # <CJK>
-0x5BC9 # <CJK>
0x5BCC # <CJK>
-0x5BD0 # <CJK>
0x5BD2 # <CJK>
-0x5BD3 # <CJK>
-0x5BD4 # <CJK>
0x5BDB # <CJK>
0x5BDD # <CJK>
-0x5BDE # <CJK>
0x5BDF # <CJK>
0x5BE1 # <CJK>
-0x5BE2 # <CJK>
-0x5BE4 # <CJK>
-0x5BE5 # <CJK>
-0x5BE6 # <CJK>
0x5BE7 # <CJK>
-0x5BE8 # <CJK>
0x5BE9 # <CJK>
-0x5BEB # <CJK>
0x5BEE # <CJK>
-0x5BF0 # <CJK>
-0x5BF3 # <CJK>
-0x5BF5 # <CJK>
-0x5BF6 # <CJK>
0x5BF8 # <CJK>
0x5BFA # <CJK>
0x5BFE # <CJK>
@@ -1431,28 +744,15 @@
0x5C01 # <CJK>
0x5C02 # <CJK>
0x5C04 # <CJK>
-0x5C05 # <CJK>
0x5C06 # <CJK>
-0x5C07 # <CJK>
-0x5C08 # <CJK>
0x5C09 # <CJK>
0x5C0A # <CJK>
0x5C0B # <CJK>
-0x5C0D # <CJK>
0x5C0E # <CJK>
0x5C0F # <CJK>
0x5C11 # <CJK>
-0x5C13 # <CJK>
-0x5C16 # <CJK>
0x5C1A # <CJK>
-0x5C20 # <CJK>
-0x5C22 # <CJK>
-0x5C24 # <CJK>
-0x5C28 # <CJK>
-0x5C2D # <CJK>
0x5C31 # <CJK>
-0x5C38 # <CJK>
-0x5C39 # <CJK>
0x5C3A # <CJK>
0x5C3B # <CJK>
0x5C3C # <CJK>
@@ -1460,109 +760,31 @@
0x5C3E # <CJK>
0x5C3F # <CJK>
0x5C40 # <CJK>
-0x5C41 # <CJK>
0x5C45 # <CJK>
-0x5C46 # <CJK>
0x5C48 # <CJK>
0x5C4A # <CJK>
0x5C4B # <CJK>
-0x5C4D # <CJK>
-0x5C4E # <CJK>
-0x5C4F # <CJK>
-0x5C50 # <CJK>
-0x5C51 # <CJK>
-0x5C53 # <CJK>
0x5C55 # <CJK>
0x5C5E # <CJK>
-0x5C60 # <CJK>
-0x5C61 # <CJK>
0x5C64 # <CJK>
0x5C65 # <CJK>
-0x5C6C # <CJK>
-0x5C6E # <CJK>
0x5C6F # <CJK>
0x5C71 # <CJK>
-0x5C76 # <CJK>
-0x5C79 # <CJK>
-0x5C8C # <CJK>
0x5C90 # <CJK>
-0x5C91 # <CJK>
-0x5C94 # <CJK>
0x5CA1 # <CJK>
-0x5CA8 # <CJK>
0x5CA9 # <CJK>
-0x5CAB # <CJK>
0x5CAC # <CJK>
-0x5CB1 # <CJK>
0x5CB3 # <CJK>
-0x5CB6 # <CJK>
-0x5CB7 # <CJK>
0x5CB8 # <CJK>
-0x5CBB # <CJK>
-0x5CBC # <CJK>
-0x5CBE # <CJK>
-0x5CC5 # <CJK>
-0x5CC7 # <CJK>
-0x5CD9 # <CJK>
0x5CE0 # <CJK>
0x5CE1 # <CJK>
-0x5CE8 # <CJK>
-0x5CE9 # <CJK>
-0x5CEA # <CJK>
-0x5CED # <CJK>
-0x5CEF # <CJK>
0x5CF0 # <CJK>
0x5CF6 # <CJK>
-0x5CFA # <CJK>
-0x5CFB # <CJK>
-0x5CFD # <CJK>
0x5D07 # <CJK>
-0x5D0B # <CJK>
0x5D0E # <CJK>
-0x5D11 # <CJK>
-0x5D14 # <CJK>
-0x5D15 # <CJK>
0x5D16 # <CJK>
-0x5D17 # <CJK>
-0x5D18 # <CJK>
-0x5D19 # <CJK>
-0x5D1A # <CJK>
-0x5D1B # <CJK>
-0x5D1F # <CJK>
-0x5D22 # <CJK>
0x5D29 # <CJK>
-0x5D4B # <CJK>
-0x5D4C # <CJK>
-0x5D4E # <CJK>
0x5D50 # <CJK>
-0x5D52 # <CJK>
-0x5D5C # <CJK>
-0x5D69 # <CJK>
-0x5D6C # <CJK>
-0x5D6F # <CJK>
-0x5D73 # <CJK>
-0x5D76 # <CJK>
-0x5D82 # <CJK>
-0x5D84 # <CJK>
-0x5D87 # <CJK>
-0x5D8B # <CJK>
-0x5D8C # <CJK>
-0x5D90 # <CJK>
-0x5D9D # <CJK>
-0x5DA2 # <CJK>
-0x5DAC # <CJK>
-0x5DAE # <CJK>
-0x5DB7 # <CJK>
-0x5DBA # <CJK>
-0x5DBC # <CJK>
-0x5DBD # <CJK>
-0x5DC9 # <CJK>
-0x5DCC # <CJK>
-0x5DCD # <CJK>
-0x5DD2 # <CJK>
-0x5DD3 # <CJK>
-0x5DD6 # <CJK>
-0x5DDB # <CJK>
0x5DDD # <CJK>
0x5DDE # <CJK>
0x5DE1 # <CJK>
@@ -1571,27 +793,14 @@
0x5DE6 # <CJK>
0x5DE7 # <CJK>
0x5DE8 # <CJK>
-0x5DEB # <CJK>
0x5DEE # <CJK>
0x5DF1 # <CJK>
-0x5DF2 # <CJK>
-0x5DF3 # <CJK>
-0x5DF4 # <CJK>
-0x5DF5 # <CJK>
-0x5DF7 # <CJK>
0x5DFB # <CJK>
-0x5DFD # <CJK>
0x5DFE # <CJK>
0x5E02 # <CJK>
0x5E03 # <CJK>
0x5E06 # <CJK>
-0x5E0B # <CJK>
0x5E0C # <CJK>
-0x5E11 # <CJK>
-0x5E16 # <CJK>
-0x5E19 # <CJK>
-0x5E1A # <CJK>
-0x5E1B # <CJK>
0x5E1D # <CJK>
0x5E25 # <CJK>
0x5E2B # <CJK>
@@ -1599,738 +808,301 @@
0x5E2F # <CJK>
0x5E30 # <CJK>
0x5E33 # <CJK>
-0x5E36 # <CJK>
-0x5E37 # <CJK>
0x5E38 # <CJK>
0x5E3D # <CJK>
-0x5E40 # <CJK>
-0x5E43 # <CJK>
-0x5E44 # <CJK>
0x5E45 # <CJK>
-0x5E47 # <CJK>
-0x5E4C # <CJK>
-0x5E4E # <CJK>
-0x5E54 # <CJK>
0x5E55 # <CJK>
-0x5E57 # <CJK>
-0x5E5F # <CJK>
-0x5E61 # <CJK>
-0x5E62 # <CJK>
0x5E63 # <CJK>
-0x5E64 # <CJK>
0x5E72 # <CJK>
0x5E73 # <CJK>
0x5E74 # <CJK>
-0x5E75 # <CJK>
-0x5E76 # <CJK>
0x5E78 # <CJK>
0x5E79 # <CJK>
-0x5E7A # <CJK>
0x5E7B # <CJK>
0x5E7C # <CJK>
0x5E7D # <CJK>
0x5E7E # <CJK>
-0x5E7F # <CJK>
0x5E81 # <CJK>
0x5E83 # <CJK>
-0x5E84 # <CJK>
-0x5E87 # <CJK>
0x5E8A # <CJK>
0x5E8F # <CJK>
0x5E95 # <CJK>
-0x5E96 # <CJK>
0x5E97 # <CJK>
-0x5E9A # <CJK>
0x5E9C # <CJK>
-0x5EA0 # <CJK>
0x5EA6 # <CJK>
0x5EA7 # <CJK>
0x5EAB # <CJK>
0x5EAD # <CJK>
-0x5EB5 # <CJK>
0x5EB6 # <CJK>
0x5EB7 # <CJK>
0x5EB8 # <CJK>
-0x5EC1 # <CJK>
-0x5EC2 # <CJK>
0x5EC3 # <CJK>
-0x5EC8 # <CJK>
0x5EC9 # <CJK>
0x5ECA # <CJK>
-0x5ECF # <CJK>
-0x5ED0 # <CJK>
-0x5ED3 # <CJK>
-0x5ED6 # <CJK>
-0x5EDA # <CJK>
-0x5EDB # <CJK>
-0x5EDD # <CJK>
-0x5EDF # <CJK>
-0x5EE0 # <CJK>
-0x5EE1 # <CJK>
-0x5EE2 # <CJK>
-0x5EE3 # <CJK>
-0x5EE8 # <CJK>
-0x5EE9 # <CJK>
-0x5EEC # <CJK>
-0x5EF0 # <CJK>
-0x5EF1 # <CJK>
-0x5EF3 # <CJK>
-0x5EF4 # <CJK>
0x5EF6 # <CJK>
0x5EF7 # <CJK>
-0x5EF8 # <CJK>
0x5EFA # <CJK>
-0x5EFB # <CJK>
-0x5EFC # <CJK>
-0x5EFE # <CJK>
-0x5EFF # <CJK>
0x5F01 # <CJK>
-0x5F03 # <CJK>
0x5F04 # <CJK>
-0x5F09 # <CJK>
0x5F0A # <CJK>
-0x5F0B # <CJK>
-0x5F0C # <CJK>
-0x5F0D # <CJK>
0x5F0F # <CJK>
0x5F10 # <CJK>
-0x5F11 # <CJK>
0x5F13 # <CJK>
0x5F14 # <CJK>
0x5F15 # <CJK>
-0x5F16 # <CJK>
-0x5F17 # <CJK>
-0x5F18 # <CJK>
-0x5F1B # <CJK>
0x5F1F # <CJK>
0x5F25 # <CJK>
0x5F26 # <CJK>
0x5F27 # <CJK>
-0x5F29 # <CJK>
-0x5F2D # <CJK>
-0x5F2F # <CJK>
0x5F31 # <CJK>
0x5F35 # <CJK>
0x5F37 # <CJK>
-0x5F38 # <CJK>
-0x5F3C # <CJK>
0x5F3E # <CJK>
-0x5F41 # <CJK>
-0x5F48 # <CJK>
-0x5F4A # <CJK>
-0x5F4C # <CJK>
-0x5F4E # <CJK>
-0x5F51 # <CJK>
0x5F53 # <CJK>
-0x5F56 # <CJK>
-0x5F57 # <CJK>
0x5F59 # <CJK>
-0x5F5C # <CJK>
-0x5F5D # <CJK>
-0x5F61 # <CJK>
0x5F62 # <CJK>
-0x5F66 # <CJK>
0x5F69 # <CJK>
-0x5F6A # <CJK>
0x5F6B # <CJK>
-0x5F6C # <CJK>
-0x5F6D # <CJK>
0x5F70 # <CJK>
0x5F71 # <CJK>
-0x5F73 # <CJK>
-0x5F77 # <CJK>
0x5F79 # <CJK>
0x5F7C # <CJK>
-0x5F7F # <CJK>
0x5F80 # <CJK>
0x5F81 # <CJK>
-0x5F82 # <CJK>
-0x5F83 # <CJK>
0x5F84 # <CJK>
0x5F85 # <CJK>
-0x5F87 # <CJK>
-0x5F88 # <CJK>
-0x5F8A # <CJK>
0x5F8B # <CJK>
0x5F8C # <CJK>
0x5F90 # <CJK>
-0x5F91 # <CJK>
0x5F92 # <CJK>
0x5F93 # <CJK>
0x5F97 # <CJK>
-0x5F98 # <CJK>
-0x5F99 # <CJK>
-0x5F9E # <CJK>
-0x5FA0 # <CJK>
0x5FA1 # <CJK>
-0x5FA8 # <CJK>
0x5FA9 # <CJK>
0x5FAA # <CJK>
-0x5FAD # <CJK>
0x5FAE # <CJK>
0x5FB3 # <CJK>
0x5FB4 # <CJK>
0x5FB9 # <CJK>
-0x5FBC # <CJK>
-0x5FBD # <CJK>
0x5FC3 # <CJK>
0x5FC5 # <CJK>
0x5FCC # <CJK>
0x5FCD # <CJK>
-0x5FD6 # <CJK>
0x5FD7 # <CJK>
0x5FD8 # <CJK>
0x5FD9 # <CJK>
0x5FDC # <CJK>
-0x5FDD # <CJK>
0x5FE0 # <CJK>
-0x5FE4 # <CJK>
0x5FEB # <CJK>
-0x5FF0 # <CJK>
-0x5FF1 # <CJK>
0x5FF5 # <CJK>
-0x5FF8 # <CJK>
-0x5FFB # <CJK>
-0x5FFD # <CJK>
-0x5FFF # <CJK>
-0x600E # <CJK>
-0x600F # <CJK>
-0x6010 # <CJK>
0x6012 # <CJK>
-0x6015 # <CJK>
0x6016 # <CJK>
-0x6019 # <CJK>
-0x601B # <CJK>
-0x601C # <CJK>
0x601D # <CJK>
0x6020 # <CJK>
-0x6021 # <CJK>
0x6025 # <CJK>
-0x6026 # <CJK>
0x6027 # <CJK>
0x6028 # <CJK>
-0x6029 # <CJK>
0x602A # <CJK>
-0x602B # <CJK>
-0x602F # <CJK>
-0x6031 # <CJK>
-0x603A # <CJK>
-0x6041 # <CJK>
-0x6042 # <CJK>
-0x6043 # <CJK>
-0x6046 # <CJK>
-0x604A # <CJK>
0x604B # <CJK>
-0x604D # <CJK>
0x6050 # <CJK>
0x6052 # <CJK>
-0x6055 # <CJK>
-0x6059 # <CJK>
-0x605A # <CJK>
-0x605F # <CJK>
-0x6060 # <CJK>
-0x6062 # <CJK>
0x6063 # <CJK>
-0x6064 # <CJK>
0x6065 # <CJK>
0x6068 # <CJK>
0x6069 # <CJK>
-0x606A # <CJK>
-0x606B # <CJK>
-0x606C # <CJK>
0x606D # <CJK>
0x606F # <CJK>
-0x6070 # <CJK>
0x6075 # <CJK>
-0x6077 # <CJK>
-0x6081 # <CJK>
-0x6083 # <CJK>
-0x6084 # <CJK>
-0x6089 # <CJK>
-0x608B # <CJK>
-0x608C # <CJK>
-0x608D # <CJK>
-0x6092 # <CJK>
0x6094 # <CJK>
-0x6096 # <CJK>
-0x6097 # <CJK>
-0x609A # <CJK>
-0x609B # <CJK>
0x609F # <CJK>
0x60A0 # <CJK>
0x60A3 # <CJK>
0x60A6 # <CJK>
-0x60A7 # <CJK>
0x60A9 # <CJK>
0x60AA # <CJK>
0x60B2 # <CJK>
-0x60B3 # <CJK>
-0x60B4 # <CJK>
-0x60B5 # <CJK>
-0x60B6 # <CJK>
-0x60B8 # <CJK>
0x60BC # <CJK>
-0x60BD # <CJK>
0x60C5 # <CJK>
-0x60C6 # <CJK>
-0x60C7 # <CJK>
0x60D1 # <CJK>
-0x60D3 # <CJK>
-0x60D8 # <CJK>
-0x60DA # <CJK>
0x60DC # <CJK>
-0x60DF # <CJK>
-0x60E0 # <CJK>
-0x60E1 # <CJK>
-0x60E3 # <CJK>
0x60E7 # <CJK>
0x60E8 # <CJK>
0x60F0 # <CJK>
-0x60F1 # <CJK>
0x60F3 # <CJK>
-0x60F4 # <CJK>
-0x60F6 # <CJK>
-0x60F7 # <CJK>
-0x60F9 # <CJK>
-0x60FA # <CJK>
-0x60FB # <CJK>
-0x6100 # <CJK>
0x6101 # <CJK>
-0x6103 # <CJK>
-0x6106 # <CJK>
-0x6108 # <CJK>
0x6109 # <CJK>
-0x610D # <CJK>
-0x610E # <CJK>
0x610F # <CJK>
-0x6115 # <CJK>
0x611A # <CJK>
0x611B # <CJK>
0x611F # <CJK>
-0x6121 # <CJK>
-0x6127 # <CJK>
-0x6128 # <CJK>
-0x612C # <CJK>
-0x6134 # <CJK>
-0x613C # <CJK>
-0x613D # <CJK>
-0x613E # <CJK>
-0x613F # <CJK>
-0x6142 # <CJK>
0x6144 # <CJK>
-0x6147 # <CJK>
0x6148 # <CJK>
-0x614A # <CJK>
0x614B # <CJK>
0x614C # <CJK>
-0x614D # <CJK>
0x614E # <CJK>
-0x6153 # <CJK>
0x6155 # <CJK>
-0x6158 # <CJK>
-0x6159 # <CJK>
-0x615A # <CJK>
-0x615D # <CJK>
-0x615F # <CJK>
0x6162 # <CJK>
0x6163 # <CJK>
-0x6165 # <CJK>
-0x6167 # <CJK>
0x6168 # <CJK>
-0x616B # <CJK>
0x616E # <CJK>
-0x616F # <CJK>
0x6170 # <CJK>
-0x6171 # <CJK>
-0x6173 # <CJK>
-0x6174 # <CJK>
-0x6175 # <CJK>
0x6176 # <CJK>
-0x6177 # <CJK>
-0x617E # <CJK>
0x6182 # <CJK>
-0x6187 # <CJK>
-0x618A # <CJK>
0x618E # <CJK>
-0x6190 # <CJK>
-0x6191 # <CJK>
-0x6194 # <CJK>
-0x6196 # <CJK>
-0x6199 # <CJK>
-0x619A # <CJK>
0x61A4 # <CJK>
0x61A7 # <CJK>
0x61A9 # <CJK>
-0x61AB # <CJK>
0x61AC # <CJK>
-0x61AE # <CJK>
0x61B2 # <CJK>
0x61B6 # <CJK>
-0x61BA # <CJK>
0x61BE # <CJK>
-0x61C3 # <CJK>
-0x61C6 # <CJK>
0x61C7 # <CJK>
-0x61C8 # <CJK>
-0x61C9 # <CJK>
-0x61CA # <CJK>
-0x61CB # <CJK>
-0x61CC # <CJK>
-0x61CD # <CJK>
0x61D0 # <CJK>
-0x61E3 # <CJK>
-0x61E6 # <CJK>
0x61F2 # <CJK>
-0x61F4 # <CJK>
-0x61F6 # <CJK>
-0x61F7 # <CJK>
0x61F8 # <CJK>
-0x61FA # <CJK>
-0x61FC # <CJK>
-0x61FD # <CJK>
-0x61FE # <CJK>
-0x61FF # <CJK>
-0x6200 # <CJK>
-0x6208 # <CJK>
-0x6209 # <CJK>
-0x620A # <CJK>
-0x620C # <CJK>
-0x620D # <CJK>
-0x620E # <CJK>
0x6210 # <CJK>
0x6211 # <CJK>
0x6212 # <CJK>
-0x6214 # <CJK>
-0x6216 # <CJK>
0x621A # <CJK>
-0x621B # <CJK>
-0x621D # <CJK>
-0x621E # <CJK>
-0x621F # <CJK>
-0x6221 # <CJK>
0x6226 # <CJK>
-0x622A # <CJK>
-0x622E # <CJK>
0x622F # <CJK>
-0x6230 # <CJK>
-0x6232 # <CJK>
-0x6233 # <CJK>
0x6234 # <CJK>
0x6238 # <CJK>
0x623B # <CJK>
0x623F # <CJK>
0x6240 # <CJK>
-0x6241 # <CJK>
0x6247 # <CJK>
-0x6248 # <CJK>
0x6249 # <CJK>
0x624B # <CJK>
0x624D # <CJK>
-0x624E # <CJK>
0x6253 # <CJK>
0x6255 # <CJK>
-0x6258 # <CJK>
-0x625B # <CJK>
-0x625E # <CJK>
-0x6260 # <CJK>
-0x6263 # <CJK>
-0x6268 # <CJK>
-0x626E # <CJK>
0x6271 # <CJK>
0x6276 # <CJK>
0x6279 # <CJK>
-0x627C # <CJK>
-0x627E # <CJK>
0x627F # <CJK>
0x6280 # <CJK>
-0x6282 # <CJK>
-0x6283 # <CJK>
0x6284 # <CJK>
-0x6289 # <CJK>
0x628A # <CJK>
0x6291 # <CJK>
-0x6292 # <CJK>
-0x6293 # <CJK>
-0x6294 # <CJK>
0x6295 # <CJK>
-0x6296 # <CJK>
0x6297 # <CJK>
0x6298 # <CJK>
-0x629B # <CJK>
0x629C # <CJK>
0x629E # <CJK>
0x62AB # <CJK>
-0x62AC # <CJK>
0x62B1 # <CJK>
0x62B5 # <CJK>
0x62B9 # <CJK>
-0x62BB # <CJK>
0x62BC # <CJK>
0x62BD # <CJK>
-0x62C2 # <CJK>
0x62C5 # <CJK>
-0x62C6 # <CJK>
-0x62C7 # <CJK>
-0x62C8 # <CJK>
0x62C9 # <CJK>
-0x62CA # <CJK>
-0x62CC # <CJK>
0x62CD # <CJK>
-0x62CF # <CJK>
0x62D0 # <CJK>
-0x62D1 # <CJK>
0x62D2 # <CJK>
0x62D3 # <CJK>
-0x62D4 # <CJK>
-0x62D7 # <CJK>
0x62D8 # <CJK>
0x62D9 # <CJK>
0x62DB # <CJK>
-0x62DC # <CJK>
0x62DD # <CJK>
0x62E0 # <CJK>
0x62E1 # <CJK>
0x62EC # <CJK>
0x62ED # <CJK>
-0x62EE # <CJK>
-0x62EF # <CJK>
-0x62F1 # <CJK>
0x62F3 # <CJK>
-0x62F5 # <CJK>
0x62F6 # <CJK>
0x62F7 # <CJK>
0x62FE # <CJK>
-0x62FF # <CJK>
0x6301 # <CJK>
-0x6302 # <CJK>
0x6307 # <CJK>
-0x6308 # <CJK>
-0x6309 # <CJK>
-0x630C # <CJK>
0x6311 # <CJK>
0x6319 # <CJK>
0x631F # <CJK>
-0x6327 # <CJK>
0x6328 # <CJK>
0x632B # <CJK>
0x632F # <CJK>
-0x633A # <CJK>
-0x633D # <CJK>
-0x633E # <CJK>
0x633F # <CJK>
0x6349 # <CJK>
-0x634C # <CJK>
-0x634D # <CJK>
-0x634F # <CJK>
-0x6350 # <CJK>
0x6355 # <CJK>
0x6357 # <CJK>
0x635C # <CJK>
-0x6367 # <CJK>
0x6368 # <CJK>
-0x6369 # <CJK>
-0x636B # <CJK>
0x636E # <CJK>
-0x6372 # <CJK>
-0x6376 # <CJK>
-0x6377 # <CJK>
-0x637A # <CJK>
0x637B # <CJK>
-0x6380 # <CJK>
0x6383 # <CJK>
0x6388 # <CJK>
-0x6389 # <CJK>
0x638C # <CJK>
-0x638E # <CJK>
-0x638F # <CJK>
0x6392 # <CJK>
-0x6396 # <CJK>
0x6398 # <CJK>
0x639B # <CJK>
-0x639F # <CJK>
-0x63A0 # <CJK>
0x63A1 # <CJK>
0x63A2 # <CJK>
-0x63A3 # <CJK>
0x63A5 # <CJK>
0x63A7 # <CJK>
0x63A8 # <CJK>
-0x63A9 # <CJK>
0x63AA # <CJK>
-0x63AB # <CJK>
-0x63AC # <CJK>
0x63B2 # <CJK>
-0x63B4 # <CJK>
-0x63B5 # <CJK>
-0x63BB # <CJK>
-0x63BE # <CJK>
-0x63C0 # <CJK>
-0x63C3 # <CJK>
-0x63C4 # <CJK>
-0x63C6 # <CJK>
-0x63C9 # <CJK>
0x63CF # <CJK>
0x63D0 # <CJK>
-0x63D2 # <CJK>
-0x63D6 # <CJK>
0x63DA # <CJK>
0x63DB # <CJK>
0x63E1 # <CJK>
-0x63E3 # <CJK>
-0x63E9 # <CJK>
0x63EE # <CJK>
0x63F4 # <CJK>
-0x63F6 # <CJK>
0x63FA # <CJK>
-0x6406 # <CJK>
0x640D # <CJK>
-0x640F # <CJK>
-0x6413 # <CJK>
-0x6416 # <CJK>
-0x6417 # <CJK>
-0x641C # <CJK>
-0x6426 # <CJK>
-0x6428 # <CJK>
0x642C # <CJK>
0x642D # <CJK>
-0x6434 # <CJK>
-0x6436 # <CJK>
0x643A # <CJK>
0x643E # <CJK>
0x6442 # <CJK>
-0x644E # <CJK>
0x6458 # <CJK>
-0x6467 # <CJK>
0x6469 # <CJK>
0x646F # <CJK>
-0x6476 # <CJK>
-0x6478 # <CJK>
-0x647A # <CJK>
0x6483 # <CJK>
-0x6488 # <CJK>
-0x6492 # <CJK>
-0x6493 # <CJK>
-0x6495 # <CJK>
-0x649A # <CJK>
-0x649E # <CJK>
0x64A4 # <CJK>
-0x64A5 # <CJK>
-0x64A9 # <CJK>
-0x64AB # <CJK>
-0x64AD # <CJK>
0x64AE # <CJK>
-0x64B0 # <CJK>
0x64B2 # <CJK>
-0x64B9 # <CJK>
-0x64BB # <CJK>
-0x64BC # <CJK>
0x64C1 # <CJK>
-0x64C2 # <CJK>
-0x64C5 # <CJK>
-0x64C7 # <CJK>
0x64CD # <CJK>
-0x64D2 # <CJK>
-0x64D4 # <CJK>
-0x64D8 # <CJK>
-0x64DA # <CJK>
-0x64E0 # <CJK>
-0x64E1 # <CJK>
-0x64E2 # <CJK>
-0x64E3 # <CJK>
0x64E6 # <CJK>
-0x64E7 # <CJK>
0x64EC # <CJK>
-0x64EF # <CJK>
-0x64F1 # <CJK>
-0x64F2 # <CJK>
-0x64F4 # <CJK>
-0x64F6 # <CJK>
-0x64FA # <CJK>
-0x64FD # <CJK>
-0x64FE # <CJK>
-0x6500 # <CJK>
-0x6505 # <CJK>
-0x6518 # <CJK>
-0x651C # <CJK>
-0x651D # <CJK>
-0x6523 # <CJK>
-0x6524 # <CJK>
-0x652A # <CJK>
-0x652B # <CJK>
-0x652C # <CJK>
0x652F # <CJK>
-0x6534 # <CJK>
-0x6535 # <CJK>
-0x6536 # <CJK>
-0x6537 # <CJK>
-0x6538 # <CJK>
0x6539 # <CJK>
0x653B # <CJK>
0x653E # <CJK>
0x653F # <CJK>
0x6545 # <CJK>
-0x6548 # <CJK>
-0x654D # <CJK>
0x654F # <CJK>
0x6551 # <CJK>
-0x6555 # <CJK>
-0x6556 # <CJK>
0x6557 # <CJK>
-0x6558 # <CJK>
0x6559 # <CJK>
-0x655D # <CJK>
-0x655E # <CJK>
0x6562 # <CJK>
0x6563 # <CJK>
-0x6566 # <CJK>
0x656C # <CJK>
0x6570 # <CJK>
-0x6572 # <CJK>
0x6574 # <CJK>
0x6575 # <CJK>
0x6577 # <CJK>
-0x6578 # <CJK>
-0x6582 # <CJK>
-0x6583 # <CJK>
0x6587 # <CJK>
-0x6588 # <CJK>
0x6589 # <CJK>
-0x658C # <CJK>
0x658E # <CJK>
-0x6590 # <CJK>
0x6591 # <CJK>
0x6597 # <CJK>
0x6599 # <CJK>
-0x659B # <CJK>
0x659C # <CJK>
-0x659F # <CJK>
-0x65A1 # <CJK>
0x65A4 # <CJK>
0x65A5 # <CJK>
-0x65A7 # <CJK>
-0x65AB # <CJK>
0x65AC # <CJK>
0x65AD # <CJK>
-0x65AF # <CJK>
0x65B0 # <CJK>
-0x65B7 # <CJK>
0x65B9 # <CJK>
-0x65BC # <CJK>
0x65BD # <CJK>
-0x65C1 # <CJK>
-0x65C3 # <CJK>
-0x65C4 # <CJK>
0x65C5 # <CJK>
-0x65C6 # <CJK>
0x65CB # <CJK>
-0x65CC # <CJK>
0x65CF # <CJK>
-0x65D2 # <CJK>
0x65D7 # <CJK>
-0x65D9 # <CJK>
-0x65DB # <CJK>
-0x65E0 # <CJK>
-0x65E1 # <CJK>
0x65E2 # <CJK>
0x65E5 # <CJK>
0x65E6 # <CJK>
@@ -2338,21 +1110,12 @@
0x65E8 # <CJK>
0x65E9 # <CJK>
0x65EC # <CJK>
-0x65ED # <CJK>
-0x65F1 # <CJK>
0x65FA # <CJK>
-0x65FB # <CJK>
-0x6602 # <CJK>
-0x6603 # <CJK>
0x6606 # <CJK>
0x6607 # <CJK>
-0x660A # <CJK>
-0x660C # <CJK>
0x660E # <CJK>
-0x660F # <CJK>
0x6613 # <CJK>
0x6614 # <CJK>
-0x661C # <CJK>
0x661F # <CJK>
0x6620 # <CJK>
0x6625 # <CJK>
@@ -2360,146 +1123,59 @@
0x6628 # <CJK>
0x662D # <CJK>
0x662F # <CJK>
-0x6634 # <CJK>
-0x6635 # <CJK>
-0x6636 # <CJK>
0x663C # <CJK>
-0x663F # <CJK>
-0x6641 # <CJK>
0x6642 # <CJK>
-0x6643 # <CJK>
-0x6644 # <CJK>
-0x6649 # <CJK>
-0x664B # <CJK>
-0x664F # <CJK>
-0x6652 # <CJK>
-0x665D # <CJK>
-0x665E # <CJK>
-0x665F # <CJK>
-0x6662 # <CJK>
-0x6664 # <CJK>
-0x6666 # <CJK>
-0x6667 # <CJK>
-0x6668 # <CJK>
0x6669 # <CJK>
0x666E # <CJK>
0x666F # <CJK>
-0x6670 # <CJK>
0x6674 # <CJK>
0x6676 # <CJK>
-0x667A # <CJK>
0x6681 # <CJK>
-0x6683 # <CJK>
-0x6684 # <CJK>
0x6687 # <CJK>
-0x6688 # <CJK>
-0x6689 # <CJK>
-0x668E # <CJK>
0x6691 # <CJK>
0x6696 # <CJK>
0x6697 # <CJK>
-0x6698 # <CJK>
-0x669D # <CJK>
-0x66A2 # <CJK>
0x66A6 # <CJK>
0x66AB # <CJK>
0x66AE # <CJK>
0x66B4 # <CJK>
-0x66B8 # <CJK>
-0x66B9 # <CJK>
-0x66BC # <CJK>
-0x66BE # <CJK>
-0x66C1 # <CJK>
-0x66C4 # <CJK>
0x66C7 # <CJK>
-0x66C9 # <CJK>
0x66D6 # <CJK>
-0x66D9 # <CJK>
-0x66DA # <CJK>
0x66DC # <CJK>
-0x66DD # <CJK>
-0x66E0 # <CJK>
-0x66E6 # <CJK>
-0x66E9 # <CJK>
-0x66F0 # <CJK>
0x66F2 # <CJK>
-0x66F3 # <CJK>
0x66F4 # <CJK>
-0x66F5 # <CJK>
-0x66F7 # <CJK>
0x66F8 # <CJK>
0x66F9 # <CJK>
-0x66FC # <CJK>
0x66FD # <CJK>
-0x66FE # <CJK>
0x66FF # <CJK>
0x6700 # <CJK>
-0x6703 # <CJK>
0x6708 # <CJK>
0x6709 # <CJK>
-0x670B # <CJK>
0x670D # <CJK>
-0x670F # <CJK>
-0x6714 # <CJK>
0x6715 # <CJK>
-0x6716 # <CJK>
0x6717 # <CJK>
0x671B # <CJK>
0x671D # <CJK>
-0x671E # <CJK>
0x671F # <CJK>
-0x6726 # <CJK>
-0x6727 # <CJK>
0x6728 # <CJK>
0x672A # <CJK>
0x672B # <CJK>
0x672C # <CJK>
0x672D # <CJK>
-0x672E # <CJK>
0x6731 # <CJK>
0x6734 # <CJK>
-0x6736 # <CJK>
-0x6737 # <CJK>
-0x6738 # <CJK>
0x673A # <CJK>
0x673D # <CJK>
-0x673F # <CJK>
-0x6741 # <CJK>
-0x6746 # <CJK>
0x6749 # <CJK>
-0x674E # <CJK>
-0x674F # <CJK>
0x6750 # <CJK>
0x6751 # <CJK>
-0x6753 # <CJK>
-0x6756 # <CJK>
-0x6759 # <CJK>
-0x675C # <CJK>
-0x675E # <CJK>
0x675F # <CJK>
-0x6760 # <CJK>
0x6761 # <CJK>
-0x6762 # <CJK>
-0x6763 # <CJK>
-0x6764 # <CJK>
0x6765 # <CJK>
-0x676A # <CJK>
-0x676D # <CJK>
0x676F # <CJK>
-0x6770 # <CJK>
0x6771 # <CJK>
-0x6772 # <CJK>
-0x6773 # <CJK>
-0x6775 # <CJK>
-0x6777 # <CJK>
-0x677C # <CJK>
0x677E # <CJK>
0x677F # <CJK>
-0x6785 # <CJK>
-0x6787 # <CJK>
-0x6789 # <CJK>
-0x678B # <CJK>
-0x678C # <CJK>
0x6790 # <CJK>
0x6795 # <CJK>
0x6797 # <CJK>
@@ -2507,2836 +1183,820 @@
0x679C # <CJK>
0x679D # <CJK>
0x67A0 # <CJK>
-0x67A1 # <CJK>
0x67A2 # <CJK>
-0x67A6 # <CJK>
-0x67A9 # <CJK>
0x67AF # <CJK>
-0x67B3 # <CJK>
-0x67B4 # <CJK>
0x67B6 # <CJK>
-0x67B7 # <CJK>
-0x67B8 # <CJK>
-0x67B9 # <CJK>
-0x67C1 # <CJK>
0x67C4 # <CJK>
-0x67C6 # <CJK>
-0x67CA # <CJK>
-0x67CE # <CJK>
-0x67CF # <CJK>
0x67D0 # <CJK>
-0x67D1 # <CJK>
0x67D3 # <CJK>
0x67D4 # <CJK>
-0x67D8 # <CJK>
-0x67DA # <CJK>
-0x67DD # <CJK>
-0x67DE # <CJK>
-0x67E2 # <CJK>
-0x67E4 # <CJK>
-0x67E7 # <CJK>
-0x67E9 # <CJK>
-0x67EC # <CJK>
-0x67EE # <CJK>
-0x67EF # <CJK>
0x67F1 # <CJK>
0x67F3 # <CJK>
-0x67F4 # <CJK>
0x67F5 # <CJK>
0x67FB # <CJK>
-0x67FE # <CJK>
0x67FF # <CJK>
-0x6802 # <CJK>
0x6803 # <CJK>
0x6804 # <CJK>
0x6813 # <CJK>
-0x6816 # <CJK>
-0x6817 # <CJK>
-0x681E # <CJK>
0x6821 # <CJK>
-0x6822 # <CJK>
-0x6829 # <CJK>
0x682A # <CJK>
-0x682B # <CJK>
-0x6832 # <CJK>
-0x6834 # <CJK>
0x6838 # <CJK>
0x6839 # <CJK>
0x683C # <CJK>
0x683D # <CJK>
-0x6840 # <CJK>
0x6841 # <CJK>
-0x6842 # <CJK>
0x6843 # <CJK>
-0x6846 # <CJK>
0x6848 # <CJK>
-0x684D # <CJK>
-0x684E # <CJK>
-0x6850 # <CJK>
0x6851 # <CJK>
-0x6853 # <CJK>
-0x6854 # <CJK>
-0x6859 # <CJK>
0x685C # <CJK>
-0x685D # <CJK>
0x685F # <CJK>
-0x6863 # <CJK>
-0x6867 # <CJK>
-0x6874 # <CJK>
-0x6876 # <CJK>
-0x6877 # <CJK>
-0x687E # <CJK>
-0x687F # <CJK>
-0x6881 # <CJK>
-0x6883 # <CJK>
0x6885 # <CJK>
-0x688D # <CJK>
-0x688F # <CJK>
-0x6893 # <CJK>
-0x6894 # <CJK>
0x6897 # <CJK>
-0x689B # <CJK>
-0x689D # <CJK>
-0x689F # <CJK>
-0x68A0 # <CJK>
-0x68A2 # <CJK>
-0x68A6 # <CJK>
-0x68A7 # <CJK>
0x68A8 # <CJK>
-0x68AD # <CJK>
-0x68AF # <CJK>
0x68B0 # <CJK>
-0x68B1 # <CJK>
-0x68B3 # <CJK>
-0x68B5 # <CJK>
-0x68B6 # <CJK>
-0x68B9 # <CJK>
-0x68BA # <CJK>
-0x68BC # <CJK>
0x68C4 # <CJK>
-0x68C6 # <CJK>
-0x68C9 # <CJK>
-0x68CA # <CJK>
0x68CB # <CJK>
-0x68CD # <CJK>
0x68D2 # <CJK>
-0x68D4 # <CJK>
-0x68D5 # <CJK>
-0x68D7 # <CJK>
-0x68D8 # <CJK>
0x68DA # <CJK>
0x68DF # <CJK>
-0x68E0 # <CJK>
-0x68E1 # <CJK>
-0x68E3 # <CJK>
-0x68E7 # <CJK>
0x68EE # <CJK>
-0x68EF # <CJK>
-0x68F2 # <CJK>
-0x68F9 # <CJK>
0x68FA # <CJK>
-0x6900 # <CJK>
-0x6901 # <CJK>
-0x6904 # <CJK>
0x6905 # <CJK>
-0x6908 # <CJK>
-0x690B # <CJK>
-0x690C # <CJK>
0x690D # <CJK>
0x690E # <CJK>
-0x690F # <CJK>
-0x6912 # <CJK>
-0x6919 # <CJK>
-0x691A # <CJK>
-0x691B # <CJK>
0x691C # <CJK>
-0x6921 # <CJK>
-0x6922 # <CJK>
-0x6923 # <CJK>
-0x6925 # <CJK>
-0x6926 # <CJK>
-0x6928 # <CJK>
-0x692A # <CJK>
-0x6930 # <CJK>
-0x6934 # <CJK>
-0x6936 # <CJK>
-0x6939 # <CJK>
-0x693D # <CJK>
-0x693F # <CJK>
-0x694A # <CJK>
-0x6953 # <CJK>
-0x6954 # <CJK>
-0x6955 # <CJK>
-0x6959 # <CJK>
-0x695A # <CJK>
-0x695C # <CJK>
-0x695D # <CJK>
-0x695E # <CJK>
-0x6960 # <CJK>
-0x6961 # <CJK>
-0x6962 # <CJK>
-0x696A # <CJK>
-0x696B # <CJK>
0x696D # <CJK>
-0x696E # <CJK>
-0x696F # <CJK>
-0x6973 # <CJK>
-0x6974 # <CJK>
0x6975 # <CJK>
0x6977 # <CJK>
-0x6978 # <CJK>
-0x6979 # <CJK>
0x697C # <CJK>
0x697D # <CJK>
-0x697E # <CJK>
-0x6981 # <CJK>
0x6982 # <CJK>
-0x698A # <CJK>
-0x698E # <CJK>
-0x6991 # <CJK>
-0x6994 # <CJK>
-0x6995 # <CJK>
-0x699B # <CJK>
-0x699C # <CJK>
-0x69A0 # <CJK>
-0x69A7 # <CJK>
-0x69AE # <CJK>
-0x69B1 # <CJK>
-0x69B2 # <CJK>
-0x69B4 # <CJK>
-0x69BB # <CJK>
-0x69BE # <CJK>
-0x69BF # <CJK>
-0x69C1 # <CJK>
-0x69C3 # <CJK>
-0x69C7 # <CJK>
-0x69CA # <CJK>
0x69CB # <CJK>
-0x69CC # <CJK>
-0x69CD # <CJK>
-0x69CE # <CJK>
-0x69D0 # <CJK>
-0x69D3 # <CJK>
0x69D8 # <CJK>
-0x69D9 # <CJK>
-0x69DD # <CJK>
-0x69DE # <CJK>
-0x69E7 # <CJK>
-0x69E8 # <CJK>
-0x69EB # <CJK>
-0x69ED # <CJK>
-0x69F2 # <CJK>
-0x69F9 # <CJK>
-0x69FB # <CJK>
0x69FD # <CJK>
-0x69FF # <CJK>
-0x6A02 # <CJK>
-0x6A05 # <CJK>
-0x6A0A # <CJK>
-0x6A0B # <CJK>
-0x6A0C # <CJK>
-0x6A12 # <CJK>
-0x6A13 # <CJK>
-0x6A14 # <CJK>
-0x6A17 # <CJK>
0x6A19 # <CJK>
-0x6A1B # <CJK>
-0x6A1E # <CJK>
-0x6A1F # <CJK>
0x6A21 # <CJK>
-0x6A22 # <CJK>
-0x6A23 # <CJK>
0x6A29 # <CJK>
0x6A2A # <CJK>
-0x6A2B # <CJK>
-0x6A2E # <CJK>
-0x6A35 # <CJK>
-0x6A36 # <CJK>
-0x6A38 # <CJK>
0x6A39 # <CJK>
-0x6A3A # <CJK>
-0x6A3D # <CJK>
-0x6A44 # <CJK>
-0x6A47 # <CJK>
-0x6A48 # <CJK>
0x6A4B # <CJK>
-0x6A58 # <CJK>
-0x6A59 # <CJK>
0x6A5F # <CJK>
-0x6A61 # <CJK>
-0x6A62 # <CJK>
-0x6A66 # <CJK>
-0x6A72 # <CJK>
-0x6A78 # <CJK>
-0x6A7F # <CJK>
-0x6A80 # <CJK>
-0x6A84 # <CJK>
-0x6A8D # <CJK>
-0x6A8E # <CJK>
-0x6A90 # <CJK>
-0x6A97 # <CJK>
-0x6A9C # <CJK>
-0x6AA0 # <CJK>
-0x6AA2 # <CJK>
-0x6AA3 # <CJK>
-0x6AAA # <CJK>
-0x6AAC # <CJK>
-0x6AAE # <CJK>
-0x6AB3 # <CJK>
-0x6AB8 # <CJK>
-0x6ABB # <CJK>
-0x6AC1 # <CJK>
-0x6AC2 # <CJK>
-0x6AC3 # <CJK>
-0x6AD1 # <CJK>
-0x6AD3 # <CJK>
-0x6ADA # <CJK>
-0x6ADB # <CJK>
-0x6ADE # <CJK>
-0x6ADF # <CJK>
-0x6AE8 # <CJK>
-0x6AEA # <CJK>
-0x6AFA # <CJK>
-0x6AFB # <CJK>
0x6B04 # <CJK>
-0x6B05 # <CJK>
-0x6B0A # <CJK>
-0x6B12 # <CJK>
-0x6B16 # <CJK>
-0x6B1D # <CJK>
-0x6B1F # <CJK>
0x6B20 # <CJK>
0x6B21 # <CJK>
-0x6B23 # <CJK>
0x6B27 # <CJK>
0x6B32 # <CJK>
-0x6B37 # <CJK>
-0x6B38 # <CJK>
-0x6B39 # <CJK>
0x6B3A # <CJK>
-0x6B3D # <CJK>
0x6B3E # <CJK>
-0x6B43 # <CJK>
-0x6B47 # <CJK>
-0x6B49 # <CJK>
0x6B4C # <CJK>
-0x6B4E # <CJK>
-0x6B50 # <CJK>
0x6B53 # <CJK>
-0x6B54 # <CJK>
-0x6B59 # <CJK>
-0x6B5B # <CJK>
-0x6B5F # <CJK>
-0x6B61 # <CJK>
0x6B62 # <CJK>
0x6B63 # <CJK>
-0x6B64 # <CJK>
0x6B66 # <CJK>
0x6B69 # <CJK>
-0x6B6A # <CJK>
0x6B6F # <CJK>
0x6B73 # <CJK>
0x6B74 # <CJK>
-0x6B78 # <CJK>
-0x6B79 # <CJK>
0x6B7B # <CJK>
-0x6B7F # <CJK>
-0x6B80 # <CJK>
-0x6B83 # <CJK>
-0x6B84 # <CJK>
-0x6B86 # <CJK>
0x6B89 # <CJK>
0x6B8A # <CJK>
0x6B8B # <CJK>
-0x6B8D # <CJK>
-0x6B95 # <CJK>
0x6B96 # <CJK>
-0x6B98 # <CJK>
-0x6B9E # <CJK>
-0x6BA4 # <CJK>
-0x6BAA # <CJK>
-0x6BAB # <CJK>
-0x6BAF # <CJK>
-0x6BB1 # <CJK>
-0x6BB2 # <CJK>
-0x6BB3 # <CJK>
0x6BB4 # <CJK>
0x6BB5 # <CJK>
-0x6BB7 # <CJK>
0x6BBA # <CJK>
0x6BBB # <CJK>
-0x6BBC # <CJK>
0x6BBF # <CJK>
0x6BC0 # <CJK>
-0x6BC5 # <CJK>
-0x6BC6 # <CJK>
-0x6BCB # <CJK>
0x6BCD # <CJK>
0x6BCE # <CJK>
0x6BD2 # <CJK>
-0x6BD3 # <CJK>
0x6BD4 # <CJK>
-0x6BD8 # <CJK>
0x6BDB # <CJK>
-0x6BDF # <CJK>
-0x6BEB # <CJK>
-0x6BEC # <CJK>
-0x6BEF # <CJK>
-0x6BF3 # <CJK>
-0x6C08 # <CJK>
0x6C0F # <CJK>
0x6C11 # <CJK>
-0x6C13 # <CJK>
-0x6C14 # <CJK>
0x6C17 # <CJK>
-0x6C1B # <CJK>
-0x6C23 # <CJK>
-0x6C24 # <CJK>
0x6C34 # <CJK>
0x6C37 # <CJK>
0x6C38 # <CJK>
0x6C3E # <CJK>
-0x6C40 # <CJK>
0x6C41 # <CJK>
0x6C42 # <CJK>
0x6C4E # <CJK>
-0x6C50 # <CJK>
-0x6C55 # <CJK>
0x6C57 # <CJK>
0x6C5A # <CJK>
-0x6C5D # <CJK>
-0x6C5E # <CJK>
0x6C5F # <CJK>
0x6C60 # <CJK>
-0x6C62 # <CJK>
-0x6C68 # <CJK>
-0x6C6A # <CJK>
0x6C70 # <CJK>
-0x6C72 # <CJK>
-0x6C73 # <CJK>
0x6C7A # <CJK>
0x6C7D # <CJK>
-0x6C7E # <CJK>
-0x6C81 # <CJK>
-0x6C82 # <CJK>
0x6C83 # <CJK>
0x6C88 # <CJK>
-0x6C8C # <CJK>
-0x6C8D # <CJK>
-0x6C90 # <CJK>
-0x6C92 # <CJK>
-0x6C93 # <CJK>
0x6C96 # <CJK>
0x6C99 # <CJK>
-0x6C9A # <CJK>
-0x6C9B # <CJK>
0x6CA1 # <CJK>
0x6CA2 # <CJK>
-0x6CAB # <CJK>
-0x6CAE # <CJK>
-0x6CB1 # <CJK>
0x6CB3 # <CJK>
0x6CB8 # <CJK>
0x6CB9 # <CJK>
-0x6CBA # <CJK>
0x6CBB # <CJK>
0x6CBC # <CJK>
-0x6CBD # <CJK>
-0x6CBE # <CJK>
0x6CBF # <CJK>
0x6CC1 # <CJK>
-0x6CC4 # <CJK>
-0x6CC5 # <CJK>
0x6CC9 # <CJK>
0x6CCA # <CJK>
0x6CCC # <CJK>
-0x6CD3 # <CJK>
0x6CD5 # <CJK>
-0x6CD7 # <CJK>
-0x6CD9 # <CJK>
-0x6CDB # <CJK>
-0x6CDD # <CJK>
0x6CE1 # <CJK>
0x6CE2 # <CJK>
0x6CE3 # <CJK>
0x6CE5 # <CJK>
0x6CE8 # <CJK>
-0x6CEA # <CJK>
-0x6CEF # <CJK>
0x6CF0 # <CJK>
-0x6CF1 # <CJK>
0x6CF3 # <CJK>
0x6D0B # <CJK>
-0x6D0C # <CJK>
-0x6D12 # <CJK>
0x6D17 # <CJK>
-0x6D19 # <CJK>
-0x6D1B # <CJK>
0x6D1E # <CJK>
-0x6D1F # <CJK>
0x6D25 # <CJK>
-0x6D29 # <CJK>
0x6D2A # <CJK>
-0x6D2B # <CJK>
-0x6D32 # <CJK>
-0x6D33 # <CJK>
-0x6D35 # <CJK>
-0x6D36 # <CJK>
-0x6D38 # <CJK>
0x6D3B # <CJK>
-0x6D3D # <CJK>
0x6D3E # <CJK>
0x6D41 # <CJK>
0x6D44 # <CJK>
0x6D45 # <CJK>
-0x6D59 # <CJK>
-0x6D5A # <CJK>
0x6D5C # <CJK>
-0x6D63 # <CJK>
-0x6D64 # <CJK>
0x6D66 # <CJK>
-0x6D69 # <CJK>
0x6D6A # <CJK>
-0x6D6C # <CJK>
0x6D6E # <CJK>
0x6D74 # <CJK>
0x6D77 # <CJK>
0x6D78 # <CJK>
-0x6D79 # <CJK>
-0x6D85 # <CJK>
0x6D88 # <CJK>
-0x6D8C # <CJK>
-0x6D8E # <CJK>
-0x6D93 # <CJK>
-0x6D95 # <CJK>
0x6D99 # <CJK>
-0x6D9B # <CJK>
-0x6D9C # <CJK>
0x6DAF # <CJK>
0x6DB2 # <CJK>
-0x6DB5 # <CJK>
-0x6DB8 # <CJK>
0x6DBC # <CJK>
-0x6DC0 # <CJK>
-0x6DC5 # <CJK>
-0x6DC6 # <CJK>
-0x6DC7 # <CJK>
-0x6DCB # <CJK>
-0x6DCC # <CJK>
0x6DD1 # <CJK>
-0x6DD2 # <CJK>
-0x6DD5 # <CJK>
-0x6DD8 # <CJK>
-0x6DD9 # <CJK>
-0x6DDE # <CJK>
0x6DE1 # <CJK>
-0x6DE4 # <CJK>
-0x6DE6 # <CJK>
-0x6DE8 # <CJK>
-0x6DEA # <CJK>
0x6DEB # <CJK>
-0x6DEC # <CJK>
-0x6DEE # <CJK>
0x6DF1 # <CJK>
-0x6DF3 # <CJK>
-0x6DF5 # <CJK>
0x6DF7 # <CJK>
-0x6DF9 # <CJK>
-0x6DFA # <CJK>
0x6DFB # <CJK>
0x6E05 # <CJK>
0x6E07 # <CJK>
0x6E08 # <CJK>
0x6E09 # <CJK>
-0x6E0A # <CJK>
0x6E0B # <CJK>
0x6E13 # <CJK>
-0x6E15 # <CJK>
-0x6E19 # <CJK>
-0x6E1A # <CJK>
0x6E1B # <CJK>
-0x6E1D # <CJK>
-0x6E1F # <CJK>
-0x6E20 # <CJK>
0x6E21 # <CJK>
-0x6E23 # <CJK>
-0x6E24 # <CJK>
-0x6E25 # <CJK>
0x6E26 # <CJK>
0x6E29 # <CJK>
-0x6E2B # <CJK>
0x6E2C # <CJK>
-0x6E2D # <CJK>
-0x6E2E # <CJK>
0x6E2F # <CJK>
-0x6E38 # <CJK>
-0x6E3A # <CJK>
-0x6E3E # <CJK>
-0x6E43 # <CJK>
-0x6E4A # <CJK>
-0x6E4D # <CJK>
-0x6E4E # <CJK>
0x6E56 # <CJK>
-0x6E58 # <CJK>
-0x6E5B # <CJK>
-0x6E5F # <CJK>
0x6E67 # <CJK>
-0x6E6B # <CJK>
-0x6E6E # <CJK>
0x6E6F # <CJK>
-0x6E72 # <CJK>
-0x6E76 # <CJK>
0x6E7E # <CJK>
0x6E7F # <CJK>
0x6E80 # <CJK>
-0x6E82 # <CJK>
-0x6E8C # <CJK>
-0x6E8F # <CJK>
0x6E90 # <CJK>
0x6E96 # <CJK>
-0x6E98 # <CJK>
-0x6E9C # <CJK>
0x6E9D # <CJK>
-0x6E9F # <CJK>
-0x6EA2 # <CJK>
-0x6EA5 # <CJK>
-0x6EAA # <CJK>
-0x6EAF # <CJK>
-0x6EB2 # <CJK>
0x6EB6 # <CJK>
-0x6EB7 # <CJK>
0x6EBA # <CJK>
-0x6EBD # <CJK>
-0x6EC2 # <CJK>
-0x6EC4 # <CJK>
0x6EC5 # <CJK>
-0x6EC9 # <CJK>
0x6ECB # <CJK>
-0x6ECC # <CJK>
0x6ED1 # <CJK>
-0x6ED3 # <CJK>
-0x6ED4 # <CJK>
-0x6ED5 # <CJK>
0x6EDD # <CJK>
0x6EDE # <CJK>
-0x6EEC # <CJK>
-0x6EEF # <CJK>
-0x6EF2 # <CJK>
0x6EF4 # <CJK>
-0x6EF7 # <CJK>
-0x6EF8 # <CJK>
-0x6EFE # <CJK>
-0x6EFF # <CJK>
0x6F01 # <CJK>
0x6F02 # <CJK>
0x6F06 # <CJK>
-0x6F09 # <CJK>
0x6F0F # <CJK>
-0x6F11 # <CJK>
-0x6F13 # <CJK>
0x6F14 # <CJK>
-0x6F15 # <CJK>
0x6F20 # <CJK>
0x6F22 # <CJK>
-0x6F23 # <CJK>
0x6F2B # <CJK>
0x6F2C # <CJK>
-0x6F31 # <CJK>
-0x6F32 # <CJK>
0x6F38 # <CJK>
-0x6F3E # <CJK>
-0x6F3F # <CJK>
-0x6F41 # <CJK>
-0x6F45 # <CJK>
0x6F54 # <CJK>
-0x6F58 # <CJK>
-0x6F5B # <CJK>
0x6F5C # <CJK>
0x6F5F # <CJK>
0x6F64 # <CJK>
-0x6F66 # <CJK>
-0x6F6D # <CJK>
0x6F6E # <CJK>
-0x6F6F # <CJK>
0x6F70 # <CJK>
-0x6F74 # <CJK>
-0x6F78 # <CJK>
-0x6F7A # <CJK>
-0x6F7C # <CJK>
-0x6F80 # <CJK>
-0x6F81 # <CJK>
-0x6F82 # <CJK>
0x6F84 # <CJK>
-0x6F86 # <CJK>
-0x6F8E # <CJK>
-0x6F91 # <CJK>
-0x6F97 # <CJK>
-0x6FA1 # <CJK>
-0x6FA3 # <CJK>
-0x6FA4 # <CJK>
-0x6FAA # <CJK>
-0x6FB1 # <CJK>
-0x6FB3 # <CJK>
-0x6FB9 # <CJK>
0x6FC0 # <CJK>
0x6FC1 # <CJK>
-0x6FC2 # <CJK>
0x6FC3 # <CJK>
-0x6FC6 # <CJK>
-0x6FD4 # <CJK>
-0x6FD5 # <CJK>
-0x6FD8 # <CJK>
-0x6FDB # <CJK>
-0x6FDF # <CJK>
-0x6FE0 # <CJK>
-0x6FE1 # <CJK>
-0x6FE4 # <CJK>
0x6FEB # <CJK>
-0x6FEC # <CJK>
-0x6FEE # <CJK>
0x6FEF # <CJK>
-0x6FF1 # <CJK>
-0x6FF3 # <CJK>
-0x6FF6 # <CJK>
-0x6FFA # <CJK>
-0x6FFE # <CJK>
-0x7001 # <CJK>
-0x7009 # <CJK>
-0x700B # <CJK>
-0x700F # <CJK>
-0x7011 # <CJK>
-0x7015 # <CJK>
-0x7018 # <CJK>
-0x701A # <CJK>
-0x701B # <CJK>
-0x701D # <CJK>
-0x701E # <CJK>
-0x701F # <CJK>
-0x7026 # <CJK>
-0x7027 # <CJK>
0x702C # <CJK>
-0x7030 # <CJK>
-0x7032 # <CJK>
-0x703E # <CJK>
-0x704C # <CJK>
-0x7051 # <CJK>
-0x7058 # <CJK>
-0x7063 # <CJK>
0x706B # <CJK>
0x706F # <CJK>
0x7070 # <CJK>
-0x7078 # <CJK>
-0x707C # <CJK>
0x707D # <CJK>
0x7089 # <CJK>
0x708A # <CJK>
0x708E # <CJK>
-0x7092 # <CJK>
-0x7099 # <CJK>
-0x70AC # <CJK>
0x70AD # <CJK>
-0x70AE # <CJK>
-0x70AF # <CJK>
-0x70B3 # <CJK>
-0x70B8 # <CJK>
0x70B9 # <CJK>
0x70BA # <CJK>
0x70C8 # <CJK>
-0x70CB # <CJK>
-0x70CF # <CJK>
-0x70D9 # <CJK>
-0x70DD # <CJK>
-0x70DF # <CJK>
-0x70F1 # <CJK>
-0x70F9 # <CJK>
-0x70FD # <CJK>
-0x7109 # <CJK>
-0x7114 # <CJK>
-0x7119 # <CJK>
-0x711A # <CJK>
-0x711C # <CJK>
0x7121 # <CJK>
0x7126 # <CJK>
0x7136 # <CJK>
0x713C # <CJK>
-0x7149 # <CJK>
-0x714C # <CJK>
0x714E # <CJK>
-0x7155 # <CJK>
-0x7156 # <CJK>
0x7159 # <CJK>
-0x7162 # <CJK>
-0x7164 # <CJK>
-0x7165 # <CJK>
-0x7166 # <CJK>
0x7167 # <CJK>
0x7169 # <CJK>
-0x716C # <CJK>
0x716E # <CJK>
-0x717D # <CJK>
-0x7184 # <CJK>
-0x7188 # <CJK>
0x718A # <CJK>
-0x718F # <CJK>
-0x7194 # <CJK>
-0x7195 # <CJK>
-#0x7199 # <CJK> # not in kochi fonts
0x719F # <CJK>
-0x71A8 # <CJK>
-0x71AC # <CJK>
0x71B1 # <CJK>
-0x71B9 # <CJK>
-0x71BE # <CJK>
0x71C3 # <CJK>
-0x71C8 # <CJK>
-0x71C9 # <CJK>
-0x71CE # <CJK>
-0x71D0 # <CJK>
-0x71D2 # <CJK>
-0x71D4 # <CJK>
-0x71D5 # <CJK>
-0x71D7 # <CJK>
-0x71DF # <CJK>
-0x71E0 # <CJK>
0x71E5 # <CJK>
-0x71E6 # <CJK>
-0x71E7 # <CJK>
-0x71EC # <CJK>
-0x71ED # <CJK>
-0x71EE # <CJK>
-0x71F5 # <CJK>
-0x71F9 # <CJK>
-0x71FB # <CJK>
-0x71FC # <CJK>
-0x71FF # <CJK>
0x7206 # <CJK>
-0x720D # <CJK>
-0x7210 # <CJK>
-0x721B # <CJK>
-0x7228 # <CJK>
0x722A # <CJK>
-0x722C # <CJK>
-0x722D # <CJK>
-0x7230 # <CJK>
-0x7232 # <CJK>
0x7235 # <CJK>
0x7236 # <CJK>
-0x723A # <CJK>
-0x723B # <CJK>
-0x723C # <CJK>
0x723D # <CJK>
-0x723E # <CJK>
-0x723F # <CJK>
-0x7240 # <CJK>
-0x7246 # <CJK>
0x7247 # <CJK>
0x7248 # <CJK>
-0x724B # <CJK>
-0x724C # <CJK>
-0x7252 # <CJK>
-0x7258 # <CJK>
0x7259 # <CJK>
0x725B # <CJK>
-0x725D # <CJK>
-0x725F # <CJK>
-0x7261 # <CJK>
-0x7262 # <CJK>
0x7267 # <CJK>
0x7269 # <CJK>
0x7272 # <CJK>
-0x7274 # <CJK>
0x7279 # <CJK>
-0x727D # <CJK>
-0x727E # <CJK>
-0x7280 # <CJK>
-0x7281 # <CJK>
-0x7282 # <CJK>
-0x7287 # <CJK>
-0x7292 # <CJK>
-0x7296 # <CJK>
0x72A0 # <CJK>
-0x72A2 # <CJK>
-0x72A7 # <CJK>
0x72AC # <CJK>
0x72AF # <CJK>
-0x72B2 # <CJK>
0x72B6 # <CJK>
-0x72B9 # <CJK>
0x72C2 # <CJK>
-0x72C3 # <CJK>
-0x72C4 # <CJK>
-0x72C6 # <CJK>
-0x72CE # <CJK>
-0x72D0 # <CJK>
-0x72D2 # <CJK>
-0x72D7 # <CJK>
0x72D9 # <CJK>
-0x72DB # <CJK>
-0x72E0 # <CJK>
-0x72E1 # <CJK>
-0x72E2 # <CJK>
0x72E9 # <CJK>
0x72EC # <CJK>
0x72ED # <CJK>
-0x72F7 # <CJK>
-0x72F8 # <CJK>
-0x72F9 # <CJK>
-0x72FC # <CJK>
-0x72FD # <CJK>
-0x730A # <CJK>
-0x7316 # <CJK>
-0x7317 # <CJK>
0x731B # <CJK>
-0x731C # <CJK>
-0x731D # <CJK>
0x731F # <CJK>
-0x7325 # <CJK>
-0x7329 # <CJK>
-0x732A # <CJK>
0x732B # <CJK>
0x732E # <CJK>
-0x732F # <CJK>
-0x7334 # <CJK>
0x7336 # <CJK>
-0x7337 # <CJK>
-0x733E # <CJK>
0x733F # <CJK>
0x7344 # <CJK>
-0x7345 # <CJK>
-0x734E # <CJK>
-0x734F # <CJK>
-0x7357 # <CJK>
0x7363 # <CJK>
-0x7368 # <CJK>
-0x736A # <CJK>
-0x7370 # <CJK>
0x7372 # <CJK>
-0x7375 # <CJK>
-0x7378 # <CJK>
-0x737A # <CJK>
-0x737B # <CJK>
0x7384 # <CJK>
0x7387 # <CJK>
0x7389 # <CJK>
0x738B # <CJK>
-0x7396 # <CJK>
0x73A9 # <CJK>
-0x73B2 # <CJK>
-0x73B3 # <CJK>
-0x73BB # <CJK>
-0x73C0 # <CJK>
-0x73C2 # <CJK>
-0x73C8 # <CJK>
-0x73CA # <CJK>
0x73CD # <CJK>
-0x73CE # <CJK>
-0x73DE # <CJK>
0x73E0 # <CJK>
-0x73E5 # <CJK>
-0x73EA # <CJK>
0x73ED # <CJK>
-0x73EE # <CJK>
-0x73F1 # <CJK>
-0x73F8 # <CJK>
0x73FE # <CJK>
0x7403 # <CJK>
-0x7405 # <CJK>
0x7406 # <CJK>
-0x7409 # <CJK>
-0x7422 # <CJK>
-0x7425 # <CJK>
-0x7432 # <CJK>
-0x7433 # <CJK>
0x7434 # <CJK>
-0x7435 # <CJK>
-0x7436 # <CJK>
-0x743A # <CJK>
-0x743F # <CJK>
-0x7441 # <CJK>
-0x7455 # <CJK>
-0x7459 # <CJK>
-0x745A # <CJK>
-0x745B # <CJK>
-0x745C # <CJK>
-0x745E # <CJK>
-0x745F # <CJK>
0x7460 # <CJK>
-0x7463 # <CJK>
-0x7464 # <CJK>
-0x7469 # <CJK>
-0x746A # <CJK>
-0x746F # <CJK>
-0x7470 # <CJK>
-0x7473 # <CJK>
-0x7476 # <CJK>
-0x747E # <CJK>
0x7483 # <CJK>
-0x748B # <CJK>
-0x749E # <CJK>
-0x74A2 # <CJK>
0x74A7 # <CJK>
0x74B0 # <CJK>
0x74BD # <CJK>
-0x74CA # <CJK>
-0x74CF # <CJK>
-0x74D4 # <CJK>
-0x74DC # <CJK>
-0x74E0 # <CJK>
-0x74E2 # <CJK>
-0x74E3 # <CJK>
0x74E6 # <CJK>
-0x74E7 # <CJK>
-0x74E9 # <CJK>
-0x74EE # <CJK>
-0x74F0 # <CJK>
-0x74F1 # <CJK>
-0x74F2 # <CJK>
0x74F6 # <CJK>
-0x74F7 # <CJK>
-0x74F8 # <CJK>
-0x7503 # <CJK>
-0x7504 # <CJK>
-0x7505 # <CJK>
-0x750C # <CJK>
-0x750D # <CJK>
-0x750E # <CJK>
-0x7511 # <CJK>
-0x7513 # <CJK>
-0x7515 # <CJK>
0x7518 # <CJK>
0x751A # <CJK>
-0x751C # <CJK>
-0x751E # <CJK>
0x751F # <CJK>
0x7523 # <CJK>
-0x7525 # <CJK>
-0x7526 # <CJK>
0x7528 # <CJK>
-0x752B # <CJK>
-0x752C # <CJK>
0x7530 # <CJK>
0x7531 # <CJK>
0x7532 # <CJK>
0x7533 # <CJK>
0x7537 # <CJK>
-0x7538 # <CJK>
0x753A # <CJK>
0x753B # <CJK>
-0x753C # <CJK>
-0x7544 # <CJK>
-0x7546 # <CJK>
-0x7549 # <CJK>
-0x754A # <CJK>
-0x754B # <CJK>
0x754C # <CJK>
-0x754D # <CJK>
0x754F # <CJK>
0x7551 # <CJK>
0x7554 # <CJK>
0x7559 # <CJK>
-0x755A # <CJK>
-0x755B # <CJK>
0x755C # <CJK>
0x755D # <CJK>
-0x7560 # <CJK>
-0x7562 # <CJK>
-0x7564 # <CJK>
0x7565 # <CJK>
-0x7566 # <CJK>
-0x7567 # <CJK>
-0x7569 # <CJK>
0x756A # <CJK>
-0x756B # <CJK>
-0x756D # <CJK>
0x7570 # <CJK>
0x7573 # <CJK>
-0x7574 # <CJK>
-0x7576 # <CJK>
-0x7577 # <CJK>
-0x7578 # <CJK>
0x757F # <CJK>
-0x7582 # <CJK>
-0x7586 # <CJK>
-0x7587 # <CJK>
-0x7589 # <CJK>
-0x758A # <CJK>
-0x758B # <CJK>
0x758E # <CJK>
-0x758F # <CJK>
0x7591 # <CJK>
-0x7594 # <CJK>
-0x759A # <CJK>
-0x759D # <CJK>
-0x75A3 # <CJK>
-0x75A5 # <CJK>
0x75AB # <CJK>
-0x75B1 # <CJK>
0x75B2 # <CJK>
-0x75B3 # <CJK>
-0x75B5 # <CJK>
-0x75B8 # <CJK>
-0x75B9 # <CJK>
-0x75BC # <CJK>
-0x75BD # <CJK>
0x75BE # <CJK>
-0x75C2 # <CJK>
-0x75C3 # <CJK>
0x75C5 # <CJK>
0x75C7 # <CJK>
-0x75CA # <CJK>
-0x75CD # <CJK>
-0x75D2 # <CJK>
-0x75D4 # <CJK>
0x75D5 # <CJK>
0x75D8 # <CJK>
-0x75D9 # <CJK>
0x75DB # <CJK>
-0x75DE # <CJK>
0x75E2 # <CJK>
-0x75E3 # <CJK>
0x75E9 # <CJK>
-0x75F0 # <CJK>
-0x75F2 # <CJK>
-0x75F3 # <CJK>
0x75F4 # <CJK>
-0x75FA # <CJK>
-0x75FC # <CJK>
-0x75FE # <CJK>
-0x75FF # <CJK>
-0x7601 # <CJK>
-0x7609 # <CJK>
-0x760B # <CJK>
0x760D # <CJK>
-0x761F # <CJK>
-0x7620 # <CJK>
-0x7621 # <CJK>
-0x7622 # <CJK>
-0x7624 # <CJK>
-0x7627 # <CJK>
-0x7630 # <CJK>
-0x7634 # <CJK>
-0x763B # <CJK>
0x7642 # <CJK>
-0x7646 # <CJK>
-0x7647 # <CJK>
-0x7648 # <CJK>
-0x764C # <CJK>
0x7652 # <CJK>
0x7656 # <CJK>
-0x7658 # <CJK>
-0x765C # <CJK>
-0x7661 # <CJK>
-0x7662 # <CJK>
-0x7667 # <CJK>
-0x7668 # <CJK>
-0x7669 # <CJK>
-0x766A # <CJK>
-0x766C # <CJK>
-0x7670 # <CJK>
-0x7672 # <CJK>
-0x7676 # <CJK>
-0x7678 # <CJK>
0x767A # <CJK>
0x767B # <CJK>
-0x767C # <CJK>
0x767D # <CJK>
0x767E # <CJK>
-0x7680 # <CJK>
-0x7683 # <CJK>
0x7684 # <CJK>
0x7686 # <CJK>
0x7687 # <CJK>
-0x7688 # <CJK>
-0x768B # <CJK>
-0x768E # <CJK>
-0x7690 # <CJK>
-0x7693 # <CJK>
-0x7696 # <CJK>
-0x7699 # <CJK>
-0x769A # <CJK>
0x76AE # <CJK>
-0x76B0 # <CJK>
-0x76B4 # <CJK>
-0x76B7 # <CJK>
-0x76B8 # <CJK>
-0x76B9 # <CJK>
-0x76BA # <CJK>
0x76BF # <CJK>
-0x76C2 # <CJK>
-0x76C3 # <CJK>
0x76C6 # <CJK>
-0x76C8 # <CJK>
0x76CA # <CJK>
-0x76CD # <CJK>
-0x76D2 # <CJK>
-0x76D6 # <CJK>
0x76D7 # <CJK>
0x76DB # <CJK>
-0x76DC # <CJK>
-0x76DE # <CJK>
0x76DF # <CJK>
-0x76E1 # <CJK>
0x76E3 # <CJK>
0x76E4 # <CJK>
-0x76E5 # <CJK>
-0x76E7 # <CJK>
-0x76EA # <CJK>
0x76EE # <CJK>
0x76F2 # <CJK>
0x76F4 # <CJK>
0x76F8 # <CJK>
-0x76FB # <CJK>
0x76FE # <CJK>
0x7701 # <CJK>
-0x7704 # <CJK>
-0x7707 # <CJK>
-0x7708 # <CJK>
0x7709 # <CJK>
0x770B # <CJK>
0x770C # <CJK>
-0x771B # <CJK>
-0x771E # <CJK>
0x771F # <CJK>
0x7720 # <CJK>
-0x7724 # <CJK>
-0x7725 # <CJK>
-0x7726 # <CJK>
-0x7729 # <CJK>
-0x7737 # <CJK>
-0x7738 # <CJK>
0x773A # <CJK>
0x773C # <CJK>
0x7740 # <CJK>
-0x7747 # <CJK>
-0x775A # <CJK>
-0x775B # <CJK>
0x7761 # <CJK>
0x7763 # <CJK>
-0x7765 # <CJK>
0x7766 # <CJK>
-0x7768 # <CJK>
-0x776B # <CJK>
-0x7779 # <CJK>
-0x777E # <CJK>
-0x777F # <CJK>
-0x778B # <CJK>
-0x778E # <CJK>
-0x7791 # <CJK>
-0x779E # <CJK>
-0x77A0 # <CJK>
-0x77A5 # <CJK>
0x77AC # <CJK>
0x77AD # <CJK>
-0x77B0 # <CJK>
0x77B3 # <CJK>
-0x77B6 # <CJK>
-0x77B9 # <CJK>
-0x77BB # <CJK>
-0x77BC # <CJK>
-0x77BD # <CJK>
-0x77BF # <CJK>
-0x77C7 # <CJK>
-0x77CD # <CJK>
-0x77D7 # <CJK>
-0x77DA # <CJK>
0x77DB # <CJK>
-0x77DC # <CJK>
0x77E2 # <CJK>
-0x77E3 # <CJK>
0x77E5 # <CJK>
-0x77E7 # <CJK>
-0x77E9 # <CJK>
0x77ED # <CJK>
-0x77EE # <CJK>
0x77EF # <CJK>
0x77F3 # <CJK>
-0x77FC # <CJK>
0x7802 # <CJK>
-0x780C # <CJK>
-0x7812 # <CJK>
0x7814 # <CJK>
0x7815 # <CJK>
-0x7820 # <CJK>
-0x7825 # <CJK>
-0x7826 # <CJK>
-0x7827 # <CJK>
0x7832 # <CJK>
0x7834 # <CJK>
-0x783A # <CJK>
-0x783F # <CJK>
-0x7845 # <CJK>
0x785D # <CJK>
0x786B # <CJK>
0x786C # <CJK>
-0x786F # <CJK>
-0x7872 # <CJK>
-0x7874 # <CJK>
-0x787C # <CJK>
0x7881 # <CJK>
-0x7886 # <CJK>
-0x7887 # <CJK>
-0x788C # <CJK>
-0x788D # <CJK>
-0x788E # <CJK>
0x7891 # <CJK>
-0x7893 # <CJK>
-0x7895 # <CJK>
-0x7897 # <CJK>
-0x789A # <CJK>
-0x78A3 # <CJK>
-0x78A7 # <CJK>
-0x78A9 # <CJK>
-0x78AA # <CJK>
-0x78AF # <CJK>
-0x78B5 # <CJK>
0x78BA # <CJK>
-0x78BC # <CJK>
-0x78BE # <CJK>
0x78C1 # <CJK>
-0x78C5 # <CJK>
-0x78C6 # <CJK>
-0x78CA # <CJK>
-0x78CB # <CJK>
-0x78D0 # <CJK>
-0x78D1 # <CJK>
-0x78D4 # <CJK>
-0x78DA # <CJK>
-0x78E7 # <CJK>
0x78E8 # <CJK>
-0x78EC # <CJK>
-0x78EF # <CJK>
-0x78F4 # <CJK>
-0x78FD # <CJK>
0x7901 # <CJK>
-0x7907 # <CJK>
0x790E # <CJK>
-0x7911 # <CJK>
-0x7912 # <CJK>
-0x7919 # <CJK>
-0x7926 # <CJK>
-0x792A # <CJK>
-0x792B # <CJK>
-0x792C # <CJK>
0x793A # <CJK>
0x793C # <CJK>
0x793E # <CJK>
-0x7940 # <CJK>
-0x7941 # <CJK>
-0x7947 # <CJK>
0x7948 # <CJK>
0x7949 # <CJK>
-0x7950 # <CJK>
-0x7953 # <CJK>
-0x7955 # <CJK>
0x7956 # <CJK>
-0x7957 # <CJK>
-0x795A # <CJK>
0x795D # <CJK>
0x795E # <CJK>
-0x795F # <CJK>
-0x7960 # <CJK>
-0x7962 # <CJK>
0x7965 # <CJK>
0x7968 # <CJK>
0x796D # <CJK>
-0x7977 # <CJK>
-0x797A # <CJK>
-0x797F # <CJK>
-0x7980 # <CJK>
0x7981 # <CJK>
-0x7984 # <CJK>
0x7985 # <CJK>
-0x798A # <CJK>
0x798D # <CJK>
-0x798E # <CJK>
0x798F # <CJK>
-0x799D # <CJK>
-0x79A6 # <CJK>
-0x79A7 # <CJK>
-0x79AA # <CJK>
-0x79AE # <CJK>
-0x79B0 # <CJK>
-0x79B3 # <CJK>
-0x79B9 # <CJK>
-0x79BA # <CJK>
-0x79BD # <CJK>
-0x79BE # <CJK>
-0x79BF # <CJK>
0x79C0 # <CJK>
0x79C1 # <CJK>
-0x79C9 # <CJK>
0x79CB # <CJK>
0x79D1 # <CJK>
0x79D2 # <CJK>
-0x79D5 # <CJK>
0x79D8 # <CJK>
0x79DF # <CJK>
-0x79E1 # <CJK>
-0x79E3 # <CJK>
-0x79E4 # <CJK>
-0x79E6 # <CJK>
-0x79E7 # <CJK>
0x79E9 # <CJK>
-0x79EC # <CJK>
0x79F0 # <CJK>
0x79FB # <CJK>
-0x7A00 # <CJK>
-0x7A08 # <CJK>
0x7A0B # <CJK>
-0x7A0D # <CJK>
0x7A0E # <CJK>
-0x7A14 # <CJK>
-0x7A17 # <CJK>
-0x7A18 # <CJK>
-0x7A19 # <CJK>
0x7A1A # <CJK>
-0x7A1C # <CJK>
-0x7A1F # <CJK>
-0x7A20 # <CJK>
0x7A2E # <CJK>
-0x7A31 # <CJK>
0x7A32 # <CJK>
-0x7A37 # <CJK>
-0x7A3B # <CJK>
0x7A3C # <CJK>
0x7A3D # <CJK>
-0x7A3E # <CJK>
0x7A3F # <CJK>
0x7A40 # <CJK>
0x7A42 # <CJK>
-0x7A43 # <CJK>
-0x7A46 # <CJK>
-0x7A49 # <CJK>
0x7A4D # <CJK>
-0x7A4E # <CJK>
0x7A4F # <CJK>
-0x7A50 # <CJK>
-0x7A57 # <CJK>
-0x7A61 # <CJK>
-0x7A62 # <CJK>
-0x7A63 # <CJK>
-0x7A69 # <CJK>
0x7A6B # <CJK>
-0x7A70 # <CJK>
0x7A74 # <CJK>
0x7A76 # <CJK>
-0x7A79 # <CJK>
0x7A7A # <CJK>
-0x7A7D # <CJK>
-0x7A7F # <CJK>
0x7A81 # <CJK>
0x7A83 # <CJK>
-0x7A84 # <CJK>
-0x7A88 # <CJK>
0x7A92 # <CJK>
0x7A93 # <CJK>
-0x7A95 # <CJK>
-0x7A96 # <CJK>
-0x7A97 # <CJK>
-0x7A98 # <CJK>
0x7A9F # <CJK>
-0x7AA9 # <CJK>
-0x7AAA # <CJK>
0x7AAE # <CJK>
0x7AAF # <CJK>
-0x7AB0 # <CJK>
-0x7AB6 # <CJK>
-0x7ABA # <CJK>
-0x7ABF # <CJK>
-0x7AC3 # <CJK>
-0x7AC4 # <CJK>
-0x7AC5 # <CJK>
-0x7AC7 # <CJK>
-0x7AC8 # <CJK>
-0x7ACA # <CJK>
0x7ACB # <CJK>
-0x7ACD # <CJK>
-0x7ACF # <CJK>
-0x7AD2 # <CJK>
-0x7AD3 # <CJK>
-0x7AD5 # <CJK>
-0x7AD9 # <CJK>
-0x7ADA # <CJK>
0x7ADC # <CJK>
-0x7ADD # <CJK>
-0x7ADF # <CJK>
0x7AE0 # <CJK>
-0x7AE1 # <CJK>
-0x7AE2 # <CJK>
-0x7AE3 # <CJK>
0x7AE5 # <CJK>
-0x7AE6 # <CJK>
-0x7AEA # <CJK>
-0x7AED # <CJK>
0x7AEF # <CJK>
-0x7AF0 # <CJK>
0x7AF6 # <CJK>
-0x7AF8 # <CJK>
0x7AF9 # <CJK>
-0x7AFA # <CJK>
-0x7AFF # <CJK>
-0x7B02 # <CJK>
-0x7B04 # <CJK>
-0x7B06 # <CJK>
-0x7B08 # <CJK>
-0x7B0A # <CJK>
-0x7B0B # <CJK>
-0x7B0F # <CJK>
0x7B11 # <CJK>
-0x7B18 # <CJK>
-0x7B19 # <CJK>
0x7B1B # <CJK>
-0x7B1E # <CJK>
-0x7B20 # <CJK>
-0x7B25 # <CJK>
0x7B26 # <CJK>
-0x7B28 # <CJK>
0x7B2C # <CJK>
-0x7B33 # <CJK>
-0x7B35 # <CJK>
-0x7B36 # <CJK>
-0x7B39 # <CJK>
-0x7B45 # <CJK>
0x7B46 # <CJK>
-0x7B48 # <CJK>
0x7B49 # <CJK>
0x7B4B # <CJK>
-0x7B4C # <CJK>
-0x7B4D # <CJK>
-0x7B4F # <CJK>
-0x7B50 # <CJK>
-0x7B51 # <CJK>
0x7B52 # <CJK>
0x7B54 # <CJK>
0x7B56 # <CJK>
-0x7B5D # <CJK>
-0x7B65 # <CJK>
-0x7B67 # <CJK>
-0x7B6C # <CJK>
-0x7B6E # <CJK>
-0x7B70 # <CJK>
-0x7B71 # <CJK>
-0x7B74 # <CJK>
-0x7B75 # <CJK>
-0x7B7A # <CJK>
-0x7B86 # <CJK>
0x7B87 # <CJK>
0x7B8B # <CJK>
-0x7B8D # <CJK>
-0x7B8F # <CJK>
-0x7B92 # <CJK>
-0x7B94 # <CJK>
-0x7B95 # <CJK>
0x7B97 # <CJK>
-0x7B98 # <CJK>
-0x7B99 # <CJK>
-0x7B9A # <CJK>
-0x7B9C # <CJK>
-0x7B9D # <CJK>
-0x7B9F # <CJK>
0x7BA1 # <CJK>
-0x7BAA # <CJK>
-0x7BAD # <CJK>
0x7BB1 # <CJK>
-0x7BB4 # <CJK>
0x7BB8 # <CJK>
0x7BC0 # <CJK>
-0x7BC1 # <CJK>
0x7BC4 # <CJK>
-0x7BC6 # <CJK>
-0x7BC7 # <CJK>
0x7BC9 # <CJK>
-0x7BCB # <CJK>
-0x7BCC # <CJK>
-0x7BCF # <CJK>
-0x7BDD # <CJK>
-0x7BE0 # <CJK>
0x7BE4 # <CJK>
-0x7BE5 # <CJK>
-0x7BE6 # <CJK>
-0x7BE9 # <CJK>
-0x7BED # <CJK>
-0x7BF3 # <CJK>
-0x7BF6 # <CJK>
-0x7BF7 # <CJK>
-0x7C00 # <CJK>
-0x7C07 # <CJK>
-0x7C0D # <CJK>
-0x7C11 # <CJK>
-0x7C12 # <CJK>
-0x7C13 # <CJK>
-0x7C14 # <CJK>
-0x7C17 # <CJK>
-0x7C1F # <CJK>
0x7C21 # <CJK>
-0x7C23 # <CJK>
-0x7C27 # <CJK>
-0x7C2A # <CJK>
-0x7C2B # <CJK>
-0x7C37 # <CJK>
-0x7C38 # <CJK>
-0x7C3D # <CJK>
-0x7C3E # <CJK>
0x7C3F # <CJK>
-0x7C40 # <CJK>
-0x7C43 # <CJK>
-0x7C4C # <CJK>
0x7C4D # <CJK>
-0x7C4F # <CJK>
-0x7C50 # <CJK>
-0x7C54 # <CJK>
-0x7C56 # <CJK>
-0x7C58 # <CJK>
-0x7C5F # <CJK>
0x7C60 # <CJK>
-0x7C64 # <CJK>
-0x7C65 # <CJK>
-0x7C6C # <CJK>
0x7C73 # <CJK>
-0x7C75 # <CJK>
-0x7C7E # <CJK>
-0x7C81 # <CJK>
-0x7C82 # <CJK>
-0x7C83 # <CJK>
0x7C89 # <CJK>
0x7C8B # <CJK>
-0x7C8D # <CJK>
-0x7C90 # <CJK>
0x7C92 # <CJK>
-0x7C95 # <CJK>
0x7C97 # <CJK>
0x7C98 # <CJK>
0x7C9B # <CJK>
-0x7C9F # <CJK>
-0x7CA1 # <CJK>
-0x7CA2 # <CJK>
-0x7CA4 # <CJK>
-0x7CA5 # <CJK>
0x7CA7 # <CJK>
-0x7CA8 # <CJK>
-0x7CAB # <CJK>
-0x7CAD # <CJK>
-0x7CAE # <CJK>
-0x7CB1 # <CJK>
-0x7CB2 # <CJK>
-0x7CB3 # <CJK>
-0x7CB9 # <CJK>
-0x7CBD # <CJK>
0x7CBE # <CJK>
-0x7CC0 # <CJK>
-0x7CC2 # <CJK>
-0x7CC5 # <CJK>
-0x7CCA # <CJK>
-0x7CCE # <CJK>
-0x7CD2 # <CJK>
0x7CD6 # <CJK>
-0x7CD8 # <CJK>
-0x7CDC # <CJK>
-0x7CDE # <CJK>
-0x7CDF # <CJK>
-0x7CE0 # <CJK>
-0x7CE2 # <CJK>
0x7CE7 # <CJK>
-0x7CEF # <CJK>
-0x7CF2 # <CJK>
-0x7CF4 # <CJK>
-0x7CF6 # <CJK>
0x7CF8 # <CJK>
-0x7CFA # <CJK>
0x7CFB # <CJK>
0x7CFE # <CJK>
0x7D00 # <CJK>
-0x7D02 # <CJK>
0x7D04 # <CJK>
0x7D05 # <CJK>
-0x7D06 # <CJK>
-0x7D0A # <CJK>
0x7D0B # <CJK>
0x7D0D # <CJK>
-0x7D10 # <CJK>
0x7D14 # <CJK>
-0x7D15 # <CJK>
-0x7D17 # <CJK>
-0x7D18 # <CJK>
0x7D19 # <CJK>
0x7D1A # <CJK>
0x7D1B # <CJK>
-0x7D1C # <CJK>
0x7D20 # <CJK>
0x7D21 # <CJK>
0x7D22 # <CJK>
0x7D2B # <CJK>
-0x7D2C # <CJK>
-0x7D2E # <CJK>
0x7D2F # <CJK>
0x7D30 # <CJK>
-0x7D32 # <CJK>
0x7D33 # <CJK>
-0x7D35 # <CJK>
0x7D39 # <CJK>
0x7D3A # <CJK>
-0x7D3F # <CJK>
0x7D42 # <CJK>
-0x7D43 # <CJK>
0x7D44 # <CJK>
-0x7D45 # <CJK>
-0x7D46 # <CJK>
-0x7D4B # <CJK>
0x7D4C # <CJK>
-0x7D4E # <CJK>
-0x7D4F # <CJK>
0x7D50 # <CJK>
-0x7D56 # <CJK>
-0x7D5B # <CJK>
0x7D5E # <CJK>
0x7D61 # <CJK>
-0x7D62 # <CJK>
-0x7D63 # <CJK>
0x7D66 # <CJK>
-0x7D68 # <CJK>
-0x7D6E # <CJK>
0x7D71 # <CJK>
-0x7D72 # <CJK>
-0x7D73 # <CJK>
0x7D75 # <CJK>
0x7D76 # <CJK>
0x7D79 # <CJK>
-0x7D7D # <CJK>
-0x7D89 # <CJK>
-0x7D8F # <CJK>
-0x7D93 # <CJK>
0x7D99 # <CJK>
0x7D9A # <CJK>
-0x7D9B # <CJK>
-0x7D9C # <CJK>
-0x7D9F # <CJK>
-0x7DA2 # <CJK>
-0x7DA3 # <CJK>
-0x7DAB # <CJK>
-0x7DAC # <CJK>
0x7DAD # <CJK>
-0x7DAE # <CJK>
-0x7DAF # <CJK>
-0x7DB0 # <CJK>
0x7DB1 # <CJK>
0x7DB2 # <CJK>
-0x7DB4 # <CJK>
-0x7DB5 # <CJK>
-0x7DB8 # <CJK>
-0x7DBA # <CJK>
0x7DBB # <CJK>
-0x7DBD # <CJK>
-0x7DBE # <CJK>
0x7DBF # <CJK>
-0x7DC7 # <CJK>
0x7DCA # <CJK>
-0x7DCB # <CJK>
0x7DCF # <CJK>
0x7DD1 # <CJK>
0x7DD2 # <CJK>
-0x7DD5 # <CJK>
-0x7DD8 # <CJK>
0x7DDA # <CJK>
-0x7DDC # <CJK>
-0x7DDD # <CJK>
-0x7DDE # <CJK>
0x7DE0 # <CJK>
-0x7DE1 # <CJK>
-0x7DE4 # <CJK>
0x7DE8 # <CJK>
0x7DE9 # <CJK>
-0x7DEC # <CJK>
0x7DEF # <CJK>
-0x7DF2 # <CJK>
0x7DF4 # <CJK>
0x7DFB # <CJK>
0x7E01 # <CJK>
0x7E04 # <CJK>
-0x7E05 # <CJK>
-0x7E09 # <CJK>
-0x7E0A # <CJK>
-0x7E0B # <CJK>
-0x7E12 # <CJK>
0x7E1B # <CJK>
-0x7E1E # <CJK>
-0x7E1F # <CJK>
-0x7E21 # <CJK>
-0x7E22 # <CJK>
-0x7E23 # <CJK>
0x7E26 # <CJK>
0x7E2B # <CJK>
0x7E2E # <CJK>
-0x7E31 # <CJK>
-0x7E32 # <CJK>
-0x7E35 # <CJK>
-0x7E37 # <CJK>
-0x7E39 # <CJK>
-0x7E3A # <CJK>
-0x7E3B # <CJK>
-0x7E3D # <CJK>
0x7E3E # <CJK>
0x7E41 # <CJK>
-0x7E43 # <CJK>
-0x7E46 # <CJK>
0x7E4A # <CJK>
-0x7E4B # <CJK>
-0x7E4D # <CJK>
0x7E54 # <CJK>
0x7E55 # <CJK>
-0x7E56 # <CJK>
-0x7E59 # <CJK>
-0x7E5A # <CJK>
-0x7E5D # <CJK>
-0x7E5E # <CJK>
-0x7E66 # <CJK>
-0x7E67 # <CJK>
-0x7E69 # <CJK>
-0x7E6A # <CJK>
0x7E6D # <CJK>
0x7E70 # <CJK>
-0x7E79 # <CJK>
-0x7E7B # <CJK>
-0x7E7C # <CJK>
-0x7E7D # <CJK>
-0x7E7F # <CJK>
-0x7E82 # <CJK>
-0x7E83 # <CJK>
-0x7E88 # <CJK>
-0x7E89 # <CJK>
-0x7E8C # <CJK>
-0x7E8E # <CJK>
-0x7E8F # <CJK>
-0x7E90 # <CJK>
-0x7E92 # <CJK>
-0x7E93 # <CJK>
-0x7E94 # <CJK>
-0x7E96 # <CJK>
-0x7E9B # <CJK>
-0x7E9C # <CJK>
0x7F36 # <CJK>
-0x7F38 # <CJK>
-0x7F3A # <CJK>
-0x7F45 # <CJK>
-0x7F4C # <CJK>
-0x7F4D # <CJK>
-0x7F4E # <CJK>
-0x7F50 # <CJK>
-0x7F51 # <CJK>
-0x7F54 # <CJK>
-0x7F55 # <CJK>
-0x7F58 # <CJK>
-0x7F5F # <CJK>
-0x7F60 # <CJK>
-0x7F67 # <CJK>
-0x7F68 # <CJK>
-0x7F69 # <CJK>
0x7F6A # <CJK>
-0x7F6B # <CJK>
0x7F6E # <CJK>
0x7F70 # <CJK>
0x7F72 # <CJK>
0x7F75 # <CJK>
0x7F77 # <CJK>
-0x7F78 # <CJK>
-0x7F79 # <CJK>
-0x7F82 # <CJK>
-0x7F83 # <CJK>
0x7F85 # <CJK>
-0x7F86 # <CJK>
-0x7F87 # <CJK>
-0x7F88 # <CJK>
0x7F8A # <CJK>
-0x7F8C # <CJK>
0x7F8E # <CJK>
-0x7F94 # <CJK>
-0x7F9A # <CJK>
-0x7F9D # <CJK>
0x7F9E # <CJK>
-0x7FA3 # <CJK>
0x7FA4 # <CJK>
0x7FA8 # <CJK>
0x7FA9 # <CJK>
-0x7FAE # <CJK>
-0x7FAF # <CJK>
-0x7FB2 # <CJK>
-0x7FB6 # <CJK>
-0x7FB8 # <CJK>
-0x7FB9 # <CJK>
0x7FBD # <CJK>
0x7FC1 # <CJK>
-0x7FC5 # <CJK>
-0x7FC6 # <CJK>
-0x7FCA # <CJK>
0x7FCC # <CJK>
0x7FD2 # <CJK>
-0x7FD4 # <CJK>
-0x7FD5 # <CJK>
-0x7FE0 # <CJK>
-0x7FE1 # <CJK>
-0x7FE6 # <CJK>
-0x7FE9 # <CJK>
-0x7FEB # <CJK>
-0x7FF0 # <CJK>
-0x7FF3 # <CJK>
-0x7FF9 # <CJK>
0x7FFB # <CJK>
0x7FFC # <CJK>
-0x8000 # <CJK>
0x8001 # <CJK>
0x8003 # <CJK>
-0x8004 # <CJK>
0x8005 # <CJK>
-0x8006 # <CJK>
-0x800B # <CJK>
-0x800C # <CJK>
0x8010 # <CJK>
-0x8012 # <CJK>
0x8015 # <CJK>
0x8017 # <CJK>
-0x8018 # <CJK>
-0x8019 # <CJK>
-0x801C # <CJK>
-0x8021 # <CJK>
-0x8028 # <CJK>
0x8033 # <CJK>
-0x8036 # <CJK>
-0x803B # <CJK>
-0x803D # <CJK>
-0x803F # <CJK>
-0x8046 # <CJK>
-0x804A # <CJK>
-0x8052 # <CJK>
0x8056 # <CJK>
-0x8058 # <CJK>
-0x805A # <CJK>
0x805E # <CJK>
-0x805F # <CJK>
-0x8061 # <CJK>
-0x8062 # <CJK>
-0x8068 # <CJK>
-0x806F # <CJK>
-0x8070 # <CJK>
-0x8072 # <CJK>
-0x8073 # <CJK>
0x8074 # <CJK>
-0x8076 # <CJK>
0x8077 # <CJK>
-0x8079 # <CJK>
-0x807D # <CJK>
-0x807E # <CJK>
-0x807F # <CJK>
-0x8084 # <CJK>
-0x8085 # <CJK>
-0x8086 # <CJK>
-0x8087 # <CJK>
0x8089 # <CJK>
-0x808B # <CJK>
0x808C # <CJK>
-0x8093 # <CJK>
0x8096 # <CJK>
0x8098 # <CJK>
-0x809A # <CJK>
-0x809B # <CJK>
0x809D # <CJK>
0x80A1 # <CJK>
0x80A2 # <CJK>
0x80A5 # <CJK>
0x80A9 # <CJK>
0x80AA # <CJK>
-0x80AC # <CJK>
-0x80AD # <CJK>
0x80AF # <CJK>
-0x80B1 # <CJK>
0x80B2 # <CJK>
-0x80B4 # <CJK>
0x80BA # <CJK>
0x80C3 # <CJK>
-0x80C4 # <CJK>
0x80C6 # <CJK>
0x80CC # <CJK>
0x80CE # <CJK>
-0x80D6 # <CJK>
-0x80D9 # <CJK>
-0x80DA # <CJK>
-0x80DB # <CJK>
-0x80DD # <CJK>
0x80DE # <CJK>
-0x80E1 # <CJK>
-0x80E4 # <CJK>
-0x80E5 # <CJK>
-0x80EF # <CJK>
-0x80F1 # <CJK>
0x80F4 # <CJK>
0x80F8 # <CJK>
-0x80FC # <CJK>
0x80FD # <CJK>
0x8102 # <CJK>
0x8105 # <CJK>
-0x8106 # <CJK>
0x8107 # <CJK>
0x8108 # <CJK>
-0x8109 # <CJK>
0x810A # <CJK>
0x811A # <CJK>
-0x811B # <CJK>
-0x8123 # <CJK>
-0x8129 # <CJK>
-0x812F # <CJK>
0x8131 # <CJK>
0x8133 # <CJK>
-0x8139 # <CJK>
-0x813E # <CJK>
-0x8146 # <CJK>
-0x814B # <CJK>
0x814E # <CJK>
0x8150 # <CJK>
-0x8151 # <CJK>
-0x8153 # <CJK>
-0x8154 # <CJK>
0x8155 # <CJK>
-0x815F # <CJK>
-0x8165 # <CJK>
-0x8166 # <CJK>
0x816B # <CJK>
-0x816E # <CJK>
0x8170 # <CJK>
-0x8171 # <CJK>
-0x8174 # <CJK>
0x8178 # <CJK>
0x8179 # <CJK>
0x817A # <CJK>
-0x817F # <CJK>
-0x8180 # <CJK>
-0x8182 # <CJK>
-0x8183 # <CJK>
-0x8188 # <CJK>
-0x818A # <CJK>
-0x818F # <CJK>
-0x8193 # <CJK>
-0x8195 # <CJK>
0x819A # <CJK>
0x819C # <CJK>
0x819D # <CJK>
-0x81A0 # <CJK>
-0x81A3 # <CJK>
-0x81A4 # <CJK>
0x81A8 # <CJK>
-0x81A9 # <CJK>
-0x81B0 # <CJK>
0x81B3 # <CJK>
-0x81B5 # <CJK>
-0x81B8 # <CJK>
-0x81BA # <CJK>
-0x81BD # <CJK>
-0x81BE # <CJK>
-0x81BF # <CJK>
-0x81C0 # <CJK>
-0x81C2 # <CJK>
0x81C6 # <CJK>
-0x81C8 # <CJK>
-0x81C9 # <CJK>
-0x81CD # <CJK>
-0x81D1 # <CJK>
0x81D3 # <CJK>
-0x81D8 # <CJK>
-0x81D9 # <CJK>
-0x81DA # <CJK>
-0x81DF # <CJK>
-0x81E0 # <CJK>
0x81E3 # <CJK>
-0x81E5 # <CJK>
-0x81E7 # <CJK>
0x81E8 # <CJK>
0x81EA # <CJK>
0x81ED # <CJK>
0x81F3 # <CJK>
0x81F4 # <CJK>
-0x81FA # <CJK>
-0x81FB # <CJK>
0x81FC # <CJK>
-0x81FE # <CJK>
-0x8201 # <CJK>
-0x8202 # <CJK>
-0x8205 # <CJK>
-0x8207 # <CJK>
0x8208 # <CJK>
-0x8209 # <CJK>
-0x820A # <CJK>
0x820C # <CJK>
-0x820D # <CJK>
0x820E # <CJK>
-0x8210 # <CJK>
-0x8212 # <CJK>
-0x8216 # <CJK>
0x8217 # <CJK>
-0x8218 # <CJK>
-0x821B # <CJK>
-0x821C # <CJK>
0x821E # <CJK>
0x821F # <CJK>
-0x8229 # <CJK>
0x822A # <CJK>
-0x822B # <CJK>
0x822C # <CJK>
-0x822E # <CJK>
-0x8233 # <CJK>
-0x8235 # <CJK>
0x8236 # <CJK>
0x8237 # <CJK>
-0x8238 # <CJK>
0x8239 # <CJK>
-0x8240 # <CJK>
0x8247 # <CJK>
-0x8258 # <CJK>
-0x8259 # <CJK>
-0x825A # <CJK>
-0x825D # <CJK>
-0x825F # <CJK>
-0x8262 # <CJK>
-0x8264 # <CJK>
0x8266 # <CJK>
-0x8268 # <CJK>
-0x826A # <CJK>
-0x826B # <CJK>
-0x826E # <CJK>
0x826F # <CJK>
-0x8271 # <CJK>
0x8272 # <CJK>
0x8276 # <CJK>
-0x8277 # <CJK>
-0x8278 # <CJK>
-0x827E # <CJK>
0x828B # <CJK>
-0x828D # <CJK>
-0x8292 # <CJK>
-0x8299 # <CJK>
0x829D # <CJK>
-0x829F # <CJK>
-0x82A5 # <CJK>
-0x82A6 # <CJK>
-0x82AB # <CJK>
-0x82AC # <CJK>
-0x82AD # <CJK>
0x82AF # <CJK>
0x82B1 # <CJK>
0x82B3 # <CJK>
0x82B8 # <CJK>
-0x82B9 # <CJK>
-0x82BB # <CJK>
0x82BD # <CJK>
-0x82C5 # <CJK>
-0x82D1 # <CJK>
-0x82D2 # <CJK>
-0x82D3 # <CJK>
-0x82D4 # <CJK>
0x82D7 # <CJK>
-0x82D9 # <CJK>
0x82DB # <CJK>
-0x82DC # <CJK>
-0x82DE # <CJK>
-0x82DF # <CJK>
-0x82E1 # <CJK>
-0x82E3 # <CJK>
0x82E5 # <CJK>
0x82E6 # <CJK>
-0x82E7 # <CJK>
-0x82EB # <CJK>
0x82F1 # <CJK>
-0x82F3 # <CJK>
-0x82F4 # <CJK>
-0x82F9 # <CJK>
-0x82FA # <CJK>
-0x82FB # <CJK>
0x8302 # <CJK>
-0x8303 # <CJK>
-0x8304 # <CJK>
-0x8305 # <CJK>
-0x8306 # <CJK>
-0x8309 # <CJK>
0x830E # <CJK>
-0x8316 # <CJK>
-0x8317 # <CJK>
-0x8318 # <CJK>
-0x831C # <CJK>
-0x8323 # <CJK>
0x8328 # <CJK>
-0x832B # <CJK>
-0x832F # <CJK>
-0x8331 # <CJK>
-0x8332 # <CJK>
-0x8334 # <CJK>
-0x8335 # <CJK>
0x8336 # <CJK>
-0x8338 # <CJK>
-0x8339 # <CJK>
-0x8340 # <CJK>
-0x8345 # <CJK>
0x8349 # <CJK>
-0x834A # <CJK>
-0x834F # <CJK>
-0x8350 # <CJK>
0x8352 # <CJK>
0x8358 # <CJK>
-0x8373 # <CJK>
-0x8375 # <CJK>
0x8377 # <CJK>
-0x837B # <CJK>
-0x837C # <CJK>
-0x8385 # <CJK>
-0x8387 # <CJK>
-0x8389 # <CJK>
-0x838A # <CJK>
-0x838E # <CJK>
-0x8393 # <CJK>
-0x8396 # <CJK>
-0x839A # <CJK>
-0x839E # <CJK>
-0x839F # <CJK>
-0x83A0 # <CJK>
-0x83A2 # <CJK>
-0x83A8 # <CJK>
-0x83AA # <CJK>
-0x83AB # <CJK>
-0x83B1 # <CJK>
-0x83B5 # <CJK>
-0x83BD # <CJK>
-0x83C1 # <CJK>
-0x83C5 # <CJK>
0x83CA # <CJK>
0x83CC # <CJK>
-0x83CE # <CJK>
0x83D3 # <CJK>
-0x83D6 # <CJK>
-0x83D8 # <CJK>
0x83DC # <CJK>
-0x83DF # <CJK>
-0x83E0 # <CJK>
-0x83E9 # <CJK>
-0x83EB # <CJK>
0x83EF # <CJK>
-0x83F0 # <CJK>
-0x83F1 # <CJK>
-0x83F2 # <CJK>
-0x83F4 # <CJK>
-0x83F7 # <CJK>
-0x83FB # <CJK>
-0x83FD # <CJK>
-0x8403 # <CJK>
-0x8404 # <CJK>
-0x8407 # <CJK>
-0x840B # <CJK>
-0x840C # <CJK>
-0x840D # <CJK>
0x840E # <CJK>
-0x8413 # <CJK>
-0x8420 # <CJK>
-0x8422 # <CJK>
-0x8429 # <CJK>
-0x842A # <CJK>
-0x842C # <CJK>
-0x8431 # <CJK>
-0x8435 # <CJK>
-0x8438 # <CJK>
-0x843C # <CJK>
0x843D # <CJK>
-0x8446 # <CJK>
0x8449 # <CJK>
-0x844E # <CJK>
0x8457 # <CJK>
0x845B # <CJK>
-0x8461 # <CJK>
-0x8462 # <CJK>
-0x8463 # <CJK>
-0x8466 # <CJK>
-0x8469 # <CJK>
-0x846B # <CJK>
0x846C # <CJK>
-0x846D # <CJK>
-0x846E # <CJK>
-0x846F # <CJK>
-0x8471 # <CJK>
-0x8475 # <CJK>
-0x8477 # <CJK>
-0x8479 # <CJK>
-0x847A # <CJK>
-0x8482 # <CJK>
-0x8484 # <CJK>
-0x848B # <CJK>
-0x8490 # <CJK>
-0x8494 # <CJK>
-0x8499 # <CJK>
-0x849C # <CJK>
-0x849F # <CJK>
-0x84A1 # <CJK>
-0x84AD # <CJK>
-0x84B2 # <CJK>
0x84B8 # <CJK>
-0x84B9 # <CJK>
-0x84BB # <CJK>
-0x84BC # <CJK>
-0x84BF # <CJK>
-0x84C1 # <CJK>
0x84C4 # <CJK>
-0x84C6 # <CJK>
-0x84C9 # <CJK>
-0x84CA # <CJK>
0x84CB # <CJK>
-0x84CD # <CJK>
-0x84D0 # <CJK>
-0x84D1 # <CJK>
-0x84D6 # <CJK>
-0x84D9 # <CJK>
-0x84DA # <CJK>
-0x84EC # <CJK>
-0x84EE # <CJK>
-0x84F4 # <CJK>
-0x84FC # <CJK>
-0x84FF # <CJK>
-0x8500 # <CJK>
-0x8506 # <CJK>
0x8511 # <CJK>
-0x8513 # <CJK>
-0x8514 # <CJK>
-0x8515 # <CJK>
-0x8517 # <CJK>
-0x8518 # <CJK>
-0x851A # <CJK>
-0x851F # <CJK>
-0x8521 # <CJK>
-0x8526 # <CJK>
-0x852C # <CJK>
-0x852D # <CJK>
0x8535 # <CJK>
0x853D # <CJK>
-0x8540 # <CJK>
-0x8541 # <CJK>
-0x8543 # <CJK>
-0x8548 # <CJK>
-0x8549 # <CJK>
-0x854A # <CJK>
-0x854B # <CJK>
-0x854E # <CJK>
-0x8555 # <CJK>
-0x8557 # <CJK>
-0x8558 # <CJK>
-0x855A # <CJK>
-0x8563 # <CJK>
-0x8568 # <CJK>
-0x8569 # <CJK>
-0x856A # <CJK>
-0x856D # <CJK>
-0x8577 # <CJK>
-0x857E # <CJK>
-0x8580 # <CJK>
0x8584 # <CJK>
-0x8587 # <CJK>
-0x8588 # <CJK>
-0x858A # <CJK>
-0x8590 # <CJK>
-0x8591 # <CJK>
-0x8594 # <CJK>
-0x8597 # <CJK>
-0x8599 # <CJK>
-0x859B # <CJK>
-0x859C # <CJK>
-0x85A4 # <CJK>
0x85A6 # <CJK>
-0x85A8 # <CJK>
-0x85A9 # <CJK>
0x85AA # <CJK>
0x85AB # <CJK>
0x85AC # <CJK>
-0x85AE # <CJK>
-0x85AF # <CJK>
-0x85B9 # <CJK>
-0x85BA # <CJK>
-0x85C1 # <CJK>
-0x85C9 # <CJK>
0x85CD # <CJK>
-0x85CF # <CJK>
-0x85D0 # <CJK>
-0x85D5 # <CJK>
-0x85DC # <CJK>
-0x85DD # <CJK>
0x85E4 # <CJK>
-0x85E5 # <CJK>
0x85E9 # <CJK>
-0x85EA # <CJK>
-0x85F7 # <CJK>
-0x85F9 # <CJK>
-0x85FA # <CJK>
0x85FB # <CJK>
-0x85FE # <CJK>
-0x8602 # <CJK>
-0x8606 # <CJK>
-0x8607 # <CJK>
-0x860A # <CJK>
-0x860B # <CJK>
-0x8613 # <CJK>
-0x8616 # <CJK>
-0x8617 # <CJK>
-0x861A # <CJK>
-0x8622 # <CJK>
-0x862D # <CJK>
-0x862F # <CJK>
-0x8630 # <CJK>
-0x863F # <CJK>
-0x864D # <CJK>
0x864E # <CJK>
0x8650 # <CJK>
-0x8654 # <CJK>
-0x8655 # <CJK>
0x865A # <CJK>
0x865C # <CJK>
0x865E # <CJK>
-0x865F # <CJK>
-0x8667 # <CJK>
0x866B # <CJK>
-0x8671 # <CJK>
0x8679 # <CJK>
-0x867B # <CJK>
0x868A # <CJK>
-0x868B # <CJK>
-0x868C # <CJK>
-0x8693 # <CJK>
0x8695 # <CJK>
-0x86A3 # <CJK>
-0x86A4 # <CJK>
-0x86A9 # <CJK>
-0x86AA # <CJK>
-0x86AB # <CJK>
-0x86AF # <CJK>
-0x86B0 # <CJK>
-0x86B6 # <CJK>
-0x86C4 # <CJK>
-0x86C6 # <CJK>
0x86C7 # <CJK>
-0x86C9 # <CJK>
-0x86CB # <CJK>
0x86CD # <CJK>
-0x86CE # <CJK>
-0x86D4 # <CJK>
-0x86D9 # <CJK>
-0x86DB # <CJK>
-0x86DE # <CJK>
-0x86DF # <CJK>
-0x86E4 # <CJK>
-0x86E9 # <CJK>
-0x86EC # <CJK>
-0x86ED # <CJK>
0x86EE # <CJK>
-0x86EF # <CJK>
-0x86F8 # <CJK>
-0x86F9 # <CJK>
-0x86FB # <CJK>
-0x86FE # <CJK>
-0x8700 # <CJK>
0x8702 # <CJK>
-0x8703 # <CJK>
-0x8706 # <CJK>
-0x8708 # <CJK>
-0x8709 # <CJK>
-0x870A # <CJK>
-0x870D # <CJK>
-0x8711 # <CJK>
-0x8712 # <CJK>
-0x8718 # <CJK>
-0x871A # <CJK>
0x871C # <CJK>
-0x8725 # <CJK>
-0x8729 # <CJK>
-0x8734 # <CJK>
-0x8737 # <CJK>
-0x873B # <CJK>
-0x873F # <CJK>
-0x8749 # <CJK>
-0x874B # <CJK>
-0x874C # <CJK>
-0x874E # <CJK>
-0x8753 # <CJK>
-0x8755 # <CJK>
-0x8757 # <CJK>
-0x8759 # <CJK>
-0x875F # <CJK>
-0x8760 # <CJK>
-0x8763 # <CJK>
-0x8766 # <CJK>
-0x8768 # <CJK>
-0x876A # <CJK>
-0x876E # <CJK>
-0x8774 # <CJK>
-0x8776 # <CJK>
-0x8778 # <CJK>
-0x877F # <CJK>
-0x8782 # <CJK>
0x878D # <CJK>
-0x879F # <CJK>
-0x87A2 # <CJK>
-0x87AB # <CJK>
-0x87AF # <CJK>
-0x87B3 # <CJK>
-0x87BA # <CJK>
-0x87BB # <CJK>
-0x87BD # <CJK>
-0x87C0 # <CJK>
-0x87C4 # <CJK>
-0x87C6 # <CJK>
-0x87C7 # <CJK>
-0x87CB # <CJK>
-0x87D0 # <CJK>
-0x87D2 # <CJK>
-0x87E0 # <CJK>
-0x87EF # <CJK>
-0x87F2 # <CJK>
-0x87F6 # <CJK>
-0x87F7 # <CJK>
-0x87F9 # <CJK>
-0x87FB # <CJK>
-0x87FE # <CJK>
-0x8805 # <CJK>
-0x880D # <CJK>
-0x880E # <CJK>
-0x880F # <CJK>
-0x8811 # <CJK>
-0x8815 # <CJK>
-0x8816 # <CJK>
-0x8821 # <CJK>
-0x8822 # <CJK>
-0x8823 # <CJK>
-0x8827 # <CJK>
-0x8831 # <CJK>
-0x8836 # <CJK>
-0x8839 # <CJK>
-0x883B # <CJK>
0x8840 # <CJK>
-0x8842 # <CJK>
-0x8844 # <CJK>
0x8846 # <CJK>
0x884C # <CJK>
-0x884D # <CJK>
-0x8852 # <CJK>
0x8853 # <CJK>
0x8857 # <CJK>
-0x8859 # <CJK>
0x885B # <CJK>
0x885D # <CJK>
-0x885E # <CJK>
0x8861 # <CJK>
-0x8862 # <CJK>
0x8863 # <CJK>
0x8868 # <CJK>
-0x886B # <CJK>
0x8870 # <CJK>
-0x8872 # <CJK>
-0x8875 # <CJK>
0x8877 # <CJK>
-0x887D # <CJK>
-0x887E # <CJK>
-0x887F # <CJK>
-0x8881 # <CJK>
-0x8882 # <CJK>
-0x8888 # <CJK>
0x888B # <CJK>
-0x888D # <CJK>
-0x8892 # <CJK>
0x8896 # <CJK>
-0x8897 # <CJK>
-0x8899 # <CJK>
-0x889E # <CJK>
-0x88A2 # <CJK>
-0x88A4 # <CJK>
0x88AB # <CJK>
-0x88AE # <CJK>
-0x88B0 # <CJK>
-0x88B1 # <CJK>
-0x88B4 # <CJK>
-0x88B5 # <CJK>
-0x88B7 # <CJK>
-0x88BF # <CJK>
0x88C1 # <CJK>
0x88C2 # <CJK>
-0x88C3 # <CJK>
-0x88C4 # <CJK>
0x88C5 # <CJK>
0x88CF # <CJK>
-0x88D4 # <CJK>
0x88D5 # <CJK>
-0x88D8 # <CJK>
-0x88D9 # <CJK>
0x88DC # <CJK>
-0x88DD # <CJK>
-0x88DF # <CJK>
-0x88E1 # <CJK>
-0x88E8 # <CJK>
-0x88F2 # <CJK>
-0x88F3 # <CJK>
-0x88F4 # <CJK>
0x88F8 # <CJK>
-0x88F9 # <CJK>
-0x88FC # <CJK>
0x88FD # <CJK>
0x88FE # <CJK>
-0x8902 # <CJK>
-0x8904 # <CJK>
0x8907 # <CJK>
-0x890A # <CJK>
-0x890C # <CJK>
0x8910 # <CJK>
0x8912 # <CJK>
-0x8913 # <CJK>
-0x891D # <CJK>
-0x891E # <CJK>
-0x8925 # <CJK>
-0x892A # <CJK>
-0x892B # <CJK>
-0x8936 # <CJK>
-0x8938 # <CJK>
-0x893B # <CJK>
-0x8941 # <CJK>
-0x8943 # <CJK>
-0x8944 # <CJK>
-0x894C # <CJK>
-0x894D # <CJK>
-0x8956 # <CJK>
-0x895E # <CJK>
0x895F # <CJK>
-0x8960 # <CJK>
-0x8964 # <CJK>
-0x8966 # <CJK>
-0x896A # <CJK>
-0x896D # <CJK>
-0x896F # <CJK>
0x8972 # <CJK>
-0x8974 # <CJK>
-0x8977 # <CJK>
-0x897E # <CJK>
0x897F # <CJK>
0x8981 # <CJK>
-0x8983 # <CJK>
0x8986 # <CJK>
0x8987 # <CJK>
-0x8988 # <CJK>
-0x898A # <CJK>
0x898B # <CJK>
0x898F # <CJK>
-0x8993 # <CJK>
0x8996 # <CJK>
-0x8997 # <CJK>
-0x8998 # <CJK>
0x899A # <CJK>
-0x89A1 # <CJK>
-0x89A6 # <CJK>
0x89A7 # <CJK>
-0x89A9 # <CJK>
0x89AA # <CJK>
-0x89AC # <CJK>
-0x89AF # <CJK>
-0x89B2 # <CJK>
0x89B3 # <CJK>
-0x89BA # <CJK>
-0x89BD # <CJK>
-0x89BF # <CJK>
-0x89C0 # <CJK>
0x89D2 # <CJK>
-0x89DA # <CJK>
-0x89DC # <CJK>
-0x89DD # <CJK>
0x89E3 # <CJK>
0x89E6 # <CJK>
-0x89E7 # <CJK>
-0x89F4 # <CJK>
-0x89F8 # <CJK>
0x8A00 # <CJK>
0x8A02 # <CJK>
0x8A03 # <CJK>
0x8A08 # <CJK>
-0x8A0A # <CJK>
-0x8A0C # <CJK>
0x8A0E # <CJK>
-0x8A10 # <CJK>
0x8A13 # <CJK>
-0x8A16 # <CJK>
0x8A17 # <CJK>
0x8A18 # <CJK>
-0x8A1B # <CJK>
-0x8A1D # <CJK>
0x8A1F # <CJK>
-0x8A23 # <CJK>
-0x8A25 # <CJK>
0x8A2A # <CJK>
0x8A2D # <CJK>
0x8A31 # <CJK>
0x8A33 # <CJK>
0x8A34 # <CJK>
-0x8A36 # <CJK>
0x8A3A # <CJK>
-0x8A3B # <CJK>
0x8A3C # <CJK>
-0x8A41 # <CJK>
-0x8A46 # <CJK>
-0x8A48 # <CJK>
0x8A50 # <CJK>
-0x8A51 # <CJK>
-0x8A52 # <CJK>
0x8A54 # <CJK>
0x8A55 # <CJK>
-0x8A5B # <CJK>
0x8A5E # <CJK>
0x8A60 # <CJK>
-0x8A62 # <CJK>
0x8A63 # <CJK>
0x8A66 # <CJK>
0x8A69 # <CJK>
-0x8A6B # <CJK>
-0x8A6C # <CJK>
-0x8A6D # <CJK>
0x8A6E # <CJK>
0x8A70 # <CJK>
0x8A71 # <CJK>
0x8A72 # <CJK>
0x8A73 # <CJK>
-0x8A7C # <CJK>
-0x8A82 # <CJK>
-0x8A84 # <CJK>
-0x8A85 # <CJK>
0x8A87 # <CJK>
0x8A89 # <CJK>
0x8A8C # <CJK>
0x8A8D # <CJK>
-0x8A91 # <CJK>
0x8A93 # <CJK>
0x8A95 # <CJK>
0x8A98 # <CJK>
-0x8A9A # <CJK>
0x8A9E # <CJK>
0x8AA0 # <CJK>
-0x8AA1 # <CJK>
-0x8AA3 # <CJK>
0x8AA4 # <CJK>
-0x8AA5 # <CJK>
-0x8AA6 # <CJK>
-0x8AA8 # <CJK>
0x8AAC # <CJK>
0x8AAD # <CJK>
0x8AB0 # <CJK>
0x8AB2 # <CJK>
-0x8AB9 # <CJK>
-0x8ABC # <CJK>
0x8ABF # <CJK>
-0x8AC2 # <CJK>
-0x8AC4 # <CJK>
0x8AC7 # <CJK>
0x8ACB # <CJK>
-0x8ACC # <CJK>
-0x8ACD # <CJK>
-0x8ACF # <CJK>
-0x8AD2 # <CJK>
0x8AD6 # <CJK>
-0x8ADA # <CJK>
-0x8ADB # <CJK>
-0x8ADC # <CJK>
-0x8ADE # <CJK>
-0x8AE0 # <CJK>
-0x8AE1 # <CJK>
-0x8AE2 # <CJK>
-0x8AE4 # <CJK>
0x8AE6 # <CJK>
0x8AE7 # <CJK>
-0x8AEB # <CJK>
0x8AED # <CJK>
0x8AEE # <CJK>
-0x8AF1 # <CJK>
-0x8AF3 # <CJK>
-0x8AF7 # <CJK>
0x8AF8 # <CJK>
-0x8AFA # <CJK>
0x8AFE # <CJK>
0x8B00 # <CJK>
0x8B01 # <CJK>
-0x8B02 # <CJK>
0x8B04 # <CJK>
-0x8B07 # <CJK>
-0x8B0C # <CJK>
0x8B0E # <CJK>
-0x8B10 # <CJK>
-0x8B14 # <CJK>
-0x8B16 # <CJK>
-0x8B17 # <CJK>
0x8B19 # <CJK>
-0x8B1A # <CJK>
0x8B1B # <CJK>
0x8B1D # <CJK>
-0x8B20 # <CJK>
0x8B21 # <CJK>
-0x8B26 # <CJK>
-0x8B28 # <CJK>
-0x8B2B # <CJK>
-0x8B2C # <CJK>
-0x8B33 # <CJK>
0x8B39 # <CJK>
-0x8B3E # <CJK>
-0x8B41 # <CJK>
-0x8B49 # <CJK>
-0x8B4C # <CJK>
-0x8B4E # <CJK>
-0x8B4F # <CJK>
-0x8B56 # <CJK>
0x8B58 # <CJK>
-0x8B5A # <CJK>
-0x8B5B # <CJK>
0x8B5C # <CJK>
-0x8B5F # <CJK>
0x8B66 # <CJK>
-0x8B6B # <CJK>
-0x8B6C # <CJK>
-0x8B6F # <CJK>
0x8B70 # <CJK>
-0x8B71 # <CJK>
0x8B72 # <CJK>
-0x8B74 # <CJK>
0x8B77 # <CJK>
-0x8B7D # <CJK>
-0x8B80 # <CJK>
-0x8B83 # <CJK>
-0x8B8A # <CJK>
-0x8B8C # <CJK>
-0x8B8E # <CJK>
-0x8B90 # <CJK>
-0x8B92 # <CJK>
-0x8B93 # <CJK>
-0x8B96 # <CJK>
-0x8B99 # <CJK>
-0x8B9A # <CJK>
0x8C37 # <CJK>
-0x8C3A # <CJK>
-0x8C3F # <CJK>
-0x8C41 # <CJK>
0x8C46 # <CJK>
-0x8C48 # <CJK>
0x8C4A # <CJK>
-0x8C4C # <CJK>
-0x8C4E # <CJK>
-0x8C50 # <CJK>
-0x8C55 # <CJK>
0x8C5A # <CJK>
0x8C61 # <CJK>
-0x8C62 # <CJK>
0x8C6A # <CJK>
-0x8C6B # <CJK>
-0x8C6C # <CJK>
-0x8C78 # <CJK>
-0x8C79 # <CJK>
-0x8C7A # <CJK>
-0x8C7C # <CJK>
-0x8C82 # <CJK>
-0x8C85 # <CJK>
-0x8C89 # <CJK>
-0x8C8A # <CJK>
0x8C8C # <CJK>
-0x8C8D # <CJK>
-0x8C8E # <CJK>
-0x8C94 # <CJK>
-0x8C98 # <CJK>
0x8C9D # <CJK>
0x8C9E # <CJK>
0x8CA0 # <CJK>
@@ -5348,1218 +2008,338 @@
0x8CAA # <CJK>
0x8CAB # <CJK>
0x8CAC # <CJK>
-0x8CAD # <CJK>
-0x8CAE # <CJK>
0x8CAF # <CJK>
-0x8CB0 # <CJK>
-0x8CB2 # <CJK>
-0x8CB3 # <CJK>
0x8CB4 # <CJK>
-0x8CB6 # <CJK>
0x8CB7 # <CJK>
0x8CB8 # <CJK>
0x8CBB # <CJK>
0x8CBC # <CJK>
-0x8CBD # <CJK>
0x8CBF # <CJK>
0x8CC0 # <CJK>
-0x8CC1 # <CJK>
0x8CC2 # <CJK>
0x8CC3 # <CJK>
0x8CC4 # <CJK>
0x8CC7 # <CJK>
-0x8CC8 # <CJK>
0x8CCA # <CJK>
-0x8CCD # <CJK>
-0x8CCE # <CJK>
-0x8CD1 # <CJK>
0x8CD3 # <CJK>
-0x8CDA # <CJK>
0x8CDB # <CJK>
0x8CDC # <CJK>
0x8CDE # <CJK>
0x8CE0 # <CJK>
0x8CE2 # <CJK>
-0x8CE3 # <CJK>
-0x8CE4 # <CJK>
0x8CE6 # <CJK>
0x8CEA # <CJK>
0x8CED # <CJK>
-0x8CFA # <CJK>
-0x8CFB # <CJK>
0x8CFC # <CJK>
-0x8CFD # <CJK>
-0x8D04 # <CJK>
-0x8D05 # <CJK>
-0x8D07 # <CJK>
0x8D08 # <CJK>
-0x8D0A # <CJK>
-0x8D0B # <CJK>
-0x8D0D # <CJK>
-0x8D0F # <CJK>
-0x8D10 # <CJK>
-0x8D13 # <CJK>
-0x8D14 # <CJK>
-0x8D16 # <CJK>
0x8D64 # <CJK>
0x8D66 # <CJK>
-0x8D67 # <CJK>
-0x8D6B # <CJK>
-0x8D6D # <CJK>
0x8D70 # <CJK>
-0x8D71 # <CJK>
-0x8D73 # <CJK>
0x8D74 # <CJK>
0x8D77 # <CJK>
-0x8D81 # <CJK>
0x8D85 # <CJK>
0x8D8A # <CJK>
-0x8D99 # <CJK>
0x8DA3 # <CJK>
-0x8DA8 # <CJK>
0x8DB3 # <CJK>
-0x8DBA # <CJK>
-0x8DBE # <CJK>
-0x8DC2 # <CJK>
-0x8DCB # <CJK>
-0x8DCC # <CJK>
-0x8DCF # <CJK>
-0x8DD6 # <CJK>
-0x8DDA # <CJK>
-0x8DDB # <CJK>
0x8DDD # <CJK>
-0x8DDF # <CJK>
0x8DE1 # <CJK>
-0x8DE3 # <CJK>
-0x8DE8 # <CJK>
-0x8DEA # <CJK>
-0x8DEB # <CJK>
0x8DEF # <CJK>
0x8DF3 # <CJK>
0x8DF5 # <CJK>
-0x8DFC # <CJK>
-0x8DFF # <CJK>
-0x8E08 # <CJK>
-0x8E09 # <CJK>
0x8E0A # <CJK>
0x8E0F # <CJK>
-0x8E10 # <CJK>
-0x8E1D # <CJK>
-0x8E1E # <CJK>
-0x8E1F # <CJK>
0x8E2A # <CJK>
-0x8E30 # <CJK>
-0x8E34 # <CJK>
-0x8E35 # <CJK>
-0x8E42 # <CJK>
-0x8E44 # <CJK>
-0x8E47 # <CJK>
-0x8E48 # <CJK>
-0x8E49 # <CJK>
-0x8E4A # <CJK>
-0x8E4C # <CJK>
-0x8E50 # <CJK>
-0x8E55 # <CJK>
-0x8E59 # <CJK>
-0x8E5F # <CJK>
-0x8E60 # <CJK>
-0x8E63 # <CJK>
-0x8E64 # <CJK>
-0x8E72 # <CJK>
0x8E74 # <CJK>
-0x8E76 # <CJK>
-0x8E7C # <CJK>
-0x8E81 # <CJK>
-0x8E84 # <CJK>
-0x8E85 # <CJK>
-0x8E87 # <CJK>
-0x8E8A # <CJK>
-0x8E8B # <CJK>
0x8E8D # <CJK>
-0x8E91 # <CJK>
-0x8E93 # <CJK>
-0x8E94 # <CJK>
-0x8E99 # <CJK>
-0x8EA1 # <CJK>
-0x8EAA # <CJK>
0x8EAB # <CJK>
-0x8EAC # <CJK>
-0x8EAF # <CJK>
-0x8EB0 # <CJK>
-0x8EB1 # <CJK>
-0x8EBE # <CJK>
-0x8EC5 # <CJK>
-0x8EC6 # <CJK>
-0x8EC8 # <CJK>
0x8ECA # <CJK>
-0x8ECB # <CJK>
0x8ECC # <CJK>
0x8ECD # <CJK>
0x8ED2 # <CJK>
-0x8EDB # <CJK>
0x8EDF # <CJK>
0x8EE2 # <CJK>
-0x8EE3 # <CJK>
-0x8EEB # <CJK>
0x8EF8 # <CJK>
-0x8EFB # <CJK>
-0x8EFC # <CJK>
0x8EFD # <CJK>
-0x8EFE # <CJK>
0x8F03 # <CJK>
-0x8F05 # <CJK>
0x8F09 # <CJK>
-0x8F0A # <CJK>
-0x8F0C # <CJK>
-0x8F12 # <CJK>
-0x8F13 # <CJK>
-0x8F14 # <CJK>
-0x8F15 # <CJK>
-0x8F19 # <CJK>
-0x8F1B # <CJK>
-0x8F1C # <CJK>
0x8F1D # <CJK>
-0x8F1F # <CJK>
-0x8F26 # <CJK>
0x8F29 # <CJK>
0x8F2A # <CJK>
-0x8F2F # <CJK>
-0x8F33 # <CJK>
0x8F38 # <CJK>
-0x8F39 # <CJK>
-0x8F3B # <CJK>
-0x8F3E # <CJK>
-0x8F3F # <CJK>
-0x8F42 # <CJK>
0x8F44 # <CJK>
-0x8F45 # <CJK>
-0x8F46 # <CJK>
-0x8F49 # <CJK>
-0x8F4C # <CJK>
-0x8F4D # <CJK>
-0x8F4E # <CJK>
-0x8F57 # <CJK>
-0x8F5C # <CJK>
-0x8F5F # <CJK>
-0x8F61 # <CJK>
-0x8F62 # <CJK>
-0x8F63 # <CJK>
-0x8F64 # <CJK>
0x8F9B # <CJK>
-0x8F9C # <CJK>
0x8F9E # <CJK>
-0x8F9F # <CJK>
0x8FA3 # <CJK>
-0x8FA7 # <CJK>
-0x8FA8 # <CJK>
-0x8FAD # <CJK>
-0x8FAE # <CJK>
-0x8FAF # <CJK>
-0x8FB0 # <CJK>
0x8FB1 # <CJK>
0x8FB2 # <CJK>
-0x8FB7 # <CJK>
0x8FBA # <CJK>
-0x8FBB # <CJK>
0x8FBC # <CJK>
-0x8FBF # <CJK>
-0x8FC2 # <CJK>
-0x8FC4 # <CJK>
0x8FC5 # <CJK>
0x8FCE # <CJK>
0x8FD1 # <CJK>
0x8FD4 # <CJK>
-0x8FDA # <CJK>
-0x8FE2 # <CJK>
-0x8FE5 # <CJK>
-0x8FE6 # <CJK>
-0x8FE9 # <CJK>
-0x8FEA # <CJK>
0x8FEB # <CJK>
0x8FED # <CJK>
-0x8FEF # <CJK>
0x8FF0 # <CJK>
-0x8FF4 # <CJK>
0x8FF7 # <CJK>
-0x8FF8 # <CJK>
-0x8FF9 # <CJK>
-0x8FFA # <CJK>
0x8FFD # <CJK>
0x9000 # <CJK>
0x9001 # <CJK>
0x9003 # <CJK>
-0x9005 # <CJK>
0x9006 # <CJK>
-0x900B # <CJK>
-0x900D # <CJK>
-0x900E # <CJK>
0x900F # <CJK>
0x9010 # <CJK>
-0x9011 # <CJK>
0x9013 # <CJK>
0x9014 # <CJK>
-0x9015 # <CJK>
-0x9016 # <CJK>
-0x9017 # <CJK>
-0x9019 # <CJK>
0x901A # <CJK>
0x901D # <CJK>
-0x901E # <CJK>
0x901F # <CJK>
0x9020 # <CJK>
-0x9021 # <CJK>
-0x9022 # <CJK>
0x9023 # <CJK>
-0x9027 # <CJK>
0x902E # <CJK>
0x9031 # <CJK>
0x9032 # <CJK>
-0x9035 # <CJK>
-0x9036 # <CJK>
0x9038 # <CJK>
-0x9039 # <CJK>
-0x903C # <CJK>
-0x903E # <CJK>
-0x9041 # <CJK>
0x9042 # <CJK>
0x9045 # <CJK>
0x9047 # <CJK>
-0x9049 # <CJK>
0x904A # <CJK>
0x904B # <CJK>
0x904D # <CJK>
0x904E # <CJK>
-0x904F # <CJK>
-0x9050 # <CJK>
-0x9051 # <CJK>
-0x9052 # <CJK>
0x9053 # <CJK>
0x9054 # <CJK>
0x9055 # <CJK>
-0x9056 # <CJK>
-0x9058 # <CJK>
-0x9059 # <CJK>
0x905C # <CJK>
-0x905E # <CJK>
0x9060 # <CJK>
0x9061 # <CJK>
0x9063 # <CJK>
-0x9065 # <CJK>
-0x9068 # <CJK>
0x9069 # <CJK>
0x906D # <CJK>
0x906E # <CJK>
-0x906F # <CJK>
-0x9072 # <CJK>
0x9075 # <CJK>
-0x9076 # <CJK>
0x9077 # <CJK>
0x9078 # <CJK>
0x907A # <CJK>
-0x907C # <CJK>
-0x907D # <CJK>
0x907F # <CJK>
-0x9080 # <CJK>
-0x9081 # <CJK>
-0x9082 # <CJK>
-0x9083 # <CJK>
0x9084 # <CJK>
-0x9087 # <CJK>
-0x9089 # <CJK>
-0x908A # <CJK>
-0x908F # <CJK>
-0x9091 # <CJK>
0x90A3 # <CJK>
0x90A6 # <CJK>
-0x90A8 # <CJK>
0x90AA # <CJK>
-0x90AF # <CJK>
-0x90B1 # <CJK>
-0x90B5 # <CJK>
0x90B8 # <CJK>
-0x90C1 # <CJK>
0x90CA # <CJK>
0x90CE # <CJK>
-0x90DB # <CJK>
0x90E1 # <CJK>
-0x90E2 # <CJK>
-0x90E4 # <CJK>
0x90E8 # <CJK>
0x90ED # <CJK>
0x90F5 # <CJK>
0x90F7 # <CJK>
0x90FD # <CJK>
-0x9102 # <CJK>
-0x9112 # <CJK>
-0x9119 # <CJK>
-0x912D # <CJK>
-0x9130 # <CJK>
-0x9132 # <CJK>
-0x9149 # <CJK>
-0x914A # <CJK>
-0x914B # <CJK>
0x914C # <CJK>
0x914D # <CJK>
0x914E # <CJK>
0x9152 # <CJK>
0x9154 # <CJK>
-0x9156 # <CJK>
-0x9158 # <CJK>
0x9162 # <CJK>
-0x9163 # <CJK>
-0x9165 # <CJK>
-0x9169 # <CJK>
0x916A # <CJK>
0x916C # <CJK>
-0x9172 # <CJK>
-0x9173 # <CJK>
0x9175 # <CJK>
0x9177 # <CJK>
0x9178 # <CJK>
-0x9182 # <CJK>
-0x9187 # <CJK>
-0x9189 # <CJK>
-0x918B # <CJK>
-0x918D # <CJK>
-0x9190 # <CJK>
0x9192 # <CJK>
-0x9197 # <CJK>
0x919C # <CJK>
-0x91A2 # <CJK>
-0x91A4 # <CJK>
-0x91AA # <CJK>
-0x91AB # <CJK>
-0x91AF # <CJK>
-0x91B4 # <CJK>
-0x91B5 # <CJK>
0x91B8 # <CJK>
-0x91BA # <CJK>
-0x91C0 # <CJK>
-0x91C1 # <CJK>
-0x91C6 # <CJK>
0x91C7 # <CJK>
0x91C8 # <CJK>
-0x91C9 # <CJK>
-0x91CB # <CJK>
0x91CC # <CJK>
0x91CD # <CJK>
0x91CE # <CJK>
0x91CF # <CJK>
-0x91D0 # <CJK>
0x91D1 # <CJK>
-0x91D6 # <CJK>
-0x91D8 # <CJK>
-0x91DB # <CJK>
0x91DC # <CJK>
0x91DD # <CJK>
-0x91DF # <CJK>
-0x91E1 # <CJK>
0x91E3 # <CJK>
-0x91E6 # <CJK>
-0x91E7 # <CJK>
-0x91F5 # <CJK>
-0x91F6 # <CJK>
-0x91FC # <CJK>
-0x91FF # <CJK>
0x920D # <CJK>
-0x920E # <CJK>
-0x9211 # <CJK>
-0x9214 # <CJK>
-0x9215 # <CJK>
-0x921E # <CJK>
-0x9229 # <CJK>
-0x922C # <CJK>
0x9234 # <CJK>
-0x9237 # <CJK>
-0x923F # <CJK>
0x9244 # <CJK>
-0x9245 # <CJK>
-0x9248 # <CJK>
-0x9249 # <CJK>
-0x924B # <CJK>
-0x9250 # <CJK>
-0x9257 # <CJK>
-0x925A # <CJK>
0x925B # <CJK>
-0x925E # <CJK>
0x9262 # <CJK>
-0x9264 # <CJK>
-0x9266 # <CJK>
0x9271 # <CJK>
-0x927E # <CJK>
0x9280 # <CJK>
0x9283 # <CJK>
0x9285 # <CJK>
-0x9291 # <CJK>
-0x9293 # <CJK>
-0x9295 # <CJK>
-0x9296 # <CJK>
0x9298 # <CJK>
-0x929A # <CJK>
-0x929B # <CJK>
-0x929C # <CJK>
0x92AD # <CJK>
-0x92B7 # <CJK>
-0x92B9 # <CJK>
-0x92CF # <CJK>
-0x92D2 # <CJK>
-0x92E4 # <CJK>
-0x92E9 # <CJK>
-0x92EA # <CJK>
0x92ED # <CJK>
-0x92F2 # <CJK>
0x92F3 # <CJK>
-0x92F8 # <CJK>
-0x92FA # <CJK>
0x92FC # <CJK>
-0x9306 # <CJK>
-0x930F # <CJK>
-0x9310 # <CJK>
-0x9318 # <CJK>
-0x9319 # <CJK>
-0x931A # <CJK>
0x9320 # <CJK>
-0x9322 # <CJK>
-0x9323 # <CJK>
0x9326 # <CJK>
-0x9328 # <CJK>
-0x932B # <CJK>
0x932C # <CJK>
0x932E # <CJK>
0x932F # <CJK>
0x9332 # <CJK>
-0x9335 # <CJK>
-0x933A # <CJK>
-0x933B # <CJK>
-0x9344 # <CJK>
0x934B # <CJK>
-0x934D # <CJK>
-0x9354 # <CJK>
-0x9356 # <CJK>
0x935B # <CJK>
-0x935C # <CJK>
-0x9360 # <CJK>
-0x936C # <CJK>
-0x936E # <CJK>
0x9375 # <CJK>
-0x937C # <CJK>
-0x937E # <CJK>
0x938C # <CJK>
-0x9394 # <CJK>
0x9396 # <CJK>
-0x9397 # <CJK>
-0x939A # <CJK>
-0x93A7 # <CJK>
-0x93AC # <CJK>
-0x93AD # <CJK>
0x93AE # <CJK>
-0x93B0 # <CJK>
-0x93B9 # <CJK>
-0x93C3 # <CJK>
-0x93C8 # <CJK>
-0x93D0 # <CJK>
-0x93D1 # <CJK>
-0x93D6 # <CJK>
-0x93D7 # <CJK>
-0x93D8 # <CJK>
-0x93DD # <CJK>
0x93E1 # <CJK>
-0x93E4 # <CJK>
-0x93E5 # <CJK>
-0x93E8 # <CJK>
-0x9403 # <CJK>
-0x9407 # <CJK>
-0x9410 # <CJK>
-0x9413 # <CJK>
-0x9414 # <CJK>
0x9418 # <CJK>
-0x9419 # <CJK>
-0x941A # <CJK>
-0x9421 # <CJK>
-0x942B # <CJK>
-0x9435 # <CJK>
-0x9436 # <CJK>
-0x9438 # <CJK>
-0x943A # <CJK>
-0x9441 # <CJK>
-0x9444 # <CJK>
0x9451 # <CJK>
-0x9452 # <CJK>
-0x9453 # <CJK>
-0x945A # <CJK>
-0x945B # <CJK>
-0x945E # <CJK>
-0x9460 # <CJK>
-0x9462 # <CJK>
-0x946A # <CJK>
-0x9470 # <CJK>
-0x9475 # <CJK>
-0x9477 # <CJK>
-0x947C # <CJK>
-0x947D # <CJK>
-0x947E # <CJK>
-0x947F # <CJK>
-0x9481 # <CJK>
0x9577 # <CJK>
0x9580 # <CJK>
-0x9582 # <CJK>
-0x9583 # <CJK>
-0x9587 # <CJK>
0x9589 # <CJK>
-0x958A # <CJK>
0x958B # <CJK>
-0x958F # <CJK>
0x9591 # <CJK>
0x9593 # <CJK>
-0x9594 # <CJK>
-0x9596 # <CJK>
-0x9598 # <CJK>
-0x9599 # <CJK>
-0x95A0 # <CJK>
0x95A2 # <CJK>
0x95A3 # <CJK>
-0x95A4 # <CJK>
0x95A5 # <CJK>
-0x95A7 # <CJK>
-0x95A8 # <CJK>
-0x95AD # <CJK>
0x95B2 # <CJK>
-0x95B9 # <CJK>
-0x95BB # <CJK>
-0x95BC # <CJK>
-0x95BE # <CJK>
-0x95C3 # <CJK>
0x95C7 # <CJK>
-0x95CA # <CJK>
-0x95CC # <CJK>
-0x95CD # <CJK>
-0x95D4 # <CJK>
-0x95D5 # <CJK>
-0x95D6 # <CJK>
0x95D8 # <CJK>
-0x95DC # <CJK>
-0x95E1 # <CJK>
-0x95E2 # <CJK>
-0x95E5 # <CJK>
0x961C # <CJK>
-0x9621 # <CJK>
-0x9628 # <CJK>
0x962A # <CJK>
-0x962E # <CJK>
-0x962F # <CJK>
0x9632 # <CJK>
0x963B # <CJK>
-0x963F # <CJK>
-0x9640 # <CJK>
-0x9642 # <CJK>
0x9644 # <CJK>
-0x964B # <CJK>
-0x964C # <CJK>
0x964D # <CJK>
-0x964F # <CJK>
0x9650 # <CJK>
0x965B # <CJK>
-0x965C # <CJK>
-0x965D # <CJK>
-0x965E # <CJK>
-0x965F # <CJK>
0x9662 # <CJK>
0x9663 # <CJK>
0x9664 # <CJK>
0x9665 # <CJK>
-0x9666 # <CJK>
0x966A # <CJK>
-0x966C # <CJK>
0x9670 # <CJK>
-0x9672 # <CJK>
0x9673 # <CJK>
0x9675 # <CJK>
0x9676 # <CJK>
-0x9677 # <CJK>
0x9678 # <CJK>
0x967A # <CJK>
0x967D # <CJK>
0x9685 # <CJK>
0x9686 # <CJK>
-0x9688 # <CJK>
0x968A # <CJK>
-0x968B # <CJK>
-0x968D # <CJK>
0x968E # <CJK>
0x968F # <CJK>
0x9694 # <CJK>
-0x9695 # <CJK>
-0x9697 # <CJK>
-0x9698 # <CJK>
0x9699 # <CJK>
0x969B # <CJK>
0x969C # <CJK>
0x96A0 # <CJK>
0x96A3 # <CJK>
-0x96A7 # <CJK>
-0x96A8 # <CJK>
-0x96AA # <CJK>
-0x96B0 # <CJK>
-0x96B1 # <CJK>
-0x96B2 # <CJK>
-0x96B4 # <CJK>
-0x96B6 # <CJK>
0x96B7 # <CJK>
-0x96B8 # <CJK>
-0x96B9 # <CJK>
0x96BB # <CJK>
-0x96BC # <CJK>
-0x96C0 # <CJK>
-0x96C1 # <CJK>
0x96C4 # <CJK>
0x96C5 # <CJK>
0x96C6 # <CJK>
0x96C7 # <CJK>
-0x96C9 # <CJK>
-0x96CB # <CJK>
0x96CC # <CJK>
-0x96CD # <CJK>
-0x96CE # <CJK>
0x96D1 # <CJK>
-0x96D5 # <CJK>
-0x96D6 # <CJK>
-0x96D9 # <CJK>
-0x96DB # <CJK>
-0x96DC # <CJK>
0x96E2 # <CJK>
0x96E3 # <CJK>
0x96E8 # <CJK>
0x96EA # <CJK>
-0x96EB # <CJK>
0x96F0 # <CJK>
0x96F2 # <CJK>
0x96F6 # <CJK>
0x96F7 # <CJK>
-0x96F9 # <CJK>
0x96FB # <CJK>
0x9700 # <CJK>
-0x9704 # <CJK>
-0x9706 # <CJK>
0x9707 # <CJK>
-0x9708 # <CJK>
0x970A # <CJK>
-0x970D # <CJK>
-0x970E # <CJK>
-0x970F # <CJK>
-0x9711 # <CJK>
-0x9713 # <CJK>
-0x9716 # <CJK>
-0x9719 # <CJK>
0x971C # <CJK>
-0x971E # <CJK>
-0x9724 # <CJK>
0x9727 # <CJK>
-0x972A # <CJK>
-0x9730 # <CJK>
0x9732 # <CJK>
-0x9738 # <CJK>
-0x9739 # <CJK>
-0x973D # <CJK>
-0x973E # <CJK>
-0x9742 # <CJK>
-0x9744 # <CJK>
-0x9746 # <CJK>
-0x9748 # <CJK>
-0x9749 # <CJK>
0x9752 # <CJK>
-0x9756 # <CJK>
0x9759 # <CJK>
-0x975C # <CJK>
0x975E # <CJK>
-0x9760 # <CJK>
-0x9761 # <CJK>
0x9762 # <CJK>
-0x9764 # <CJK>
-0x9766 # <CJK>
-0x9768 # <CJK>
0x9769 # <CJK>
-0x976B # <CJK>
-0x976D # <CJK>
-0x9771 # <CJK>
0x9774 # <CJK>
-0x9779 # <CJK>
-0x977A # <CJK>
-0x977C # <CJK>
-0x9781 # <CJK>
-0x9784 # <CJK>
-0x9785 # <CJK>
-0x9786 # <CJK>
-0x978B # <CJK>
-0x978D # <CJK>
-0x978F # <CJK>
-0x9790 # <CJK>
-0x9798 # <CJK>
-0x979C # <CJK>
-0x97A0 # <CJK>
-0x97A3 # <CJK>
-0x97A6 # <CJK>
-0x97A8 # <CJK>
-0x97AB # <CJK>
-0x97AD # <CJK>
-0x97B3 # <CJK>
-0x97B4 # <CJK>
-0x97C3 # <CJK>
-0x97C6 # <CJK>
-0x97C8 # <CJK>
-0x97CB # <CJK>
0x97D3 # <CJK>
-0x97DC # <CJK>
-0x97ED # <CJK>
-0x97EE # <CJK>
-0x97F2 # <CJK>
0x97F3 # <CJK>
-0x97F5 # <CJK>
-0x97F6 # <CJK>
0x97FB # <CJK>
0x97FF # <CJK>
-0x9801 # <CJK>
0x9802 # <CJK>
0x9803 # <CJK>
0x9805 # <CJK>
0x9806 # <CJK>
0x9808 # <CJK>
-0x980C # <CJK>
-0x980F # <CJK>
0x9810 # <CJK>
0x9811 # <CJK>
0x9812 # <CJK>
0x9813 # <CJK>
-0x9817 # <CJK>
0x9818 # <CJK>
-0x981A # <CJK>
-0x9821 # <CJK>
-0x9824 # <CJK>
-0x982C # <CJK>
0x982D # <CJK>
-0x9834 # <CJK>
-0x9837 # <CJK>
-0x9838 # <CJK>
+#0x9830 # <CJK> # not in DroidSansJapanese
0x983B # <CJK>
0x983C # <CJK>
-0x983D # <CJK>
-0x9846 # <CJK>
-0x984B # <CJK>
0x984C # <CJK>
0x984D # <CJK>
0x984E # <CJK>
-0x984F # <CJK>
0x9854 # <CJK>
0x9855 # <CJK>
0x9858 # <CJK>
-0x985B # <CJK>
0x985E # <CJK>
0x9867 # <CJK>
-0x986B # <CJK>
-0x986F # <CJK>
-0x9870 # <CJK>
-0x9871 # <CJK>
-0x9873 # <CJK>
-0x9874 # <CJK>
0x98A8 # <CJK>
-0x98AA # <CJK>
-0x98AF # <CJK>
-0x98B1 # <CJK>
-0x98B6 # <CJK>
-0x98C3 # <CJK>
-0x98C4 # <CJK>
-0x98C6 # <CJK>
0x98DB # <CJK>
-0x98DC # <CJK>
0x98DF # <CJK>
0x98E2 # <CJK>
-0x98E9 # <CJK>
-0x98EB # <CJK>
-0x98ED # <CJK>
-0x98EE # <CJK>
0x98EF # <CJK>
0x98F2 # <CJK>
-0x98F4 # <CJK>
0x98FC # <CJK>
0x98FD # <CJK>
0x98FE # <CJK>
-0x9903 # <CJK>
0x9905 # <CJK>
-0x9909 # <CJK>
0x990A # <CJK>
0x990C # <CJK>
-0x9910 # <CJK>
-0x9912 # <CJK>
0x9913 # <CJK>
-0x9914 # <CJK>
-0x9918 # <CJK>
-0x991D # <CJK>
-0x991E # <CJK>
-0x9920 # <CJK>
-0x9921 # <CJK>
-0x9924 # <CJK>
0x9928 # <CJK>
-0x992C # <CJK>
-0x992E # <CJK>
-0x993D # <CJK>
-0x993E # <CJK>
-0x9942 # <CJK>
-0x9945 # <CJK>
-0x9949 # <CJK>
-0x994B # <CJK>
-0x994C # <CJK>
-0x9950 # <CJK>
-0x9951 # <CJK>
-0x9952 # <CJK>
-0x9955 # <CJK>
-0x9957 # <CJK>
0x9996 # <CJK>
-0x9997 # <CJK>
-0x9998 # <CJK>
0x9999 # <CJK>
-0x99A5 # <CJK>
-0x99A8 # <CJK>
0x99AC # <CJK>
-0x99AD # <CJK>
-0x99AE # <CJK>
-0x99B3 # <CJK>
-0x99B4 # <CJK>
-0x99BC # <CJK>
-0x99C1 # <CJK>
0x99C4 # <CJK>
0x99C5 # <CJK>
0x99C6 # <CJK>
-0x99C8 # <CJK>
0x99D0 # <CJK>
-0x99D1 # <CJK>
0x99D2 # <CJK>
-0x99D5 # <CJK>
-0x99D8 # <CJK>
-0x99DB # <CJK>
-0x99DD # <CJK>
-0x99DF # <CJK>
-0x99E2 # <CJK>
-0x99ED # <CJK>
-0x99EE # <CJK>
-0x99F1 # <CJK>
-0x99F2 # <CJK>
-0x99F8 # <CJK>
-0x99FB # <CJK>
-0x99FF # <CJK>
-0x9A01 # <CJK>
-0x9A05 # <CJK>
0x9A0E # <CJK>
-0x9A0F # <CJK>
0x9A12 # <CJK>
0x9A13 # <CJK>
-0x9A19 # <CJK>
-0x9A28 # <CJK>
-0x9A2B # <CJK>
0x9A30 # <CJK>
-0x9A37 # <CJK>
-0x9A3E # <CJK>
-0x9A40 # <CJK>
-0x9A42 # <CJK>
-0x9A43 # <CJK>
-0x9A45 # <CJK>
-0x9A4D # <CJK>
-0x9A55 # <CJK>
-0x9A57 # <CJK>
0x9A5A # <CJK>
-0x9A5B # <CJK>
-0x9A5F # <CJK>
-0x9A62 # <CJK>
-0x9A64 # <CJK>
-0x9A65 # <CJK>
-0x9A69 # <CJK>
-0x9A6A # <CJK>
-0x9A6B # <CJK>
0x9AA8 # <CJK>
-0x9AAD # <CJK>
-0x9AB0 # <CJK>
0x9AB8 # <CJK>
-0x9ABC # <CJK>
-0x9AC0 # <CJK>
0x9AC4 # <CJK>
-0x9ACF # <CJK>
-0x9AD1 # <CJK>
-0x9AD3 # <CJK>
-0x9AD4 # <CJK>
0x9AD8 # <CJK>
-0x9ADE # <CJK>
-0x9ADF # <CJK>
-0x9AE2 # <CJK>
-0x9AE3 # <CJK>
-0x9AE6 # <CJK>
0x9AEA # <CJK>
-0x9AEB # <CJK>
-0x9AED # <CJK>
-0x9AEE # <CJK>
-0x9AEF # <CJK>
-0x9AF1 # <CJK>
-0x9AF4 # <CJK>
-0x9AF7 # <CJK>
-0x9AFB # <CJK>
-0x9B06 # <CJK>
-0x9B18 # <CJK>
-0x9B1A # <CJK>
-0x9B1F # <CJK>
-0x9B22 # <CJK>
-0x9B23 # <CJK>
-0x9B25 # <CJK>
-0x9B27 # <CJK>
-0x9B28 # <CJK>
-0x9B29 # <CJK>
-0x9B2A # <CJK>
-0x9B2E # <CJK>
-0x9B2F # <CJK>
0x9B31 # <CJK>
-0x9B32 # <CJK>
-0x9B3B # <CJK>
0x9B3C # <CJK>
-0x9B41 # <CJK>
0x9B42 # <CJK>
-0x9B43 # <CJK>
-0x9B44 # <CJK>
0x9B45 # <CJK>
-0x9B4D # <CJK>
-0x9B4E # <CJK>
-0x9B4F # <CJK>
-0x9B51 # <CJK>
0x9B54 # <CJK>
-0x9B58 # <CJK>
0x9B5A # <CJK>
-0x9B6F # <CJK>
-0x9B74 # <CJK>
-0x9B83 # <CJK>
-0x9B8E # <CJK>
-0x9B91 # <CJK>
-0x9B92 # <CJK>
-0x9B93 # <CJK>
-0x9B96 # <CJK>
-0x9B97 # <CJK>
-0x9B9F # <CJK>
-0x9BA0 # <CJK>
-0x9BA8 # <CJK>
-0x9BAA # <CJK>
-0x9BAB # <CJK>
-0x9BAD # <CJK>
0x9BAE # <CJK>
-0x9BB4 # <CJK>
-0x9BB9 # <CJK>
-0x9BC0 # <CJK>
-0x9BC6 # <CJK>
-0x9BC9 # <CJK>
-0x9BCA # <CJK>
-0x9BCF # <CJK>
-0x9BD1 # <CJK>
-0x9BD2 # <CJK>
-0x9BD4 # <CJK>
-0x9BD6 # <CJK>
-0x9BDB # <CJK>
-0x9BE1 # <CJK>
-0x9BE2 # <CJK>
-0x9BE3 # <CJK>
-0x9BE4 # <CJK>
0x9BE8 # <CJK>
-0x9BF0 # <CJK>
-0x9BF1 # <CJK>
-0x9BF2 # <CJK>
-0x9BF5 # <CJK>
-0x9C04 # <CJK>
-0x9C06 # <CJK>
-0x9C08 # <CJK>
-0x9C09 # <CJK>
-0x9C0A # <CJK>
-0x9C0C # <CJK>
-0x9C0D # <CJK>
-0x9C10 # <CJK>
-0x9C12 # <CJK>
-0x9C13 # <CJK>
-0x9C14 # <CJK>
-0x9C15 # <CJK>
-0x9C1B # <CJK>
-0x9C21 # <CJK>
-0x9C24 # <CJK>
-0x9C25 # <CJK>
-0x9C2D # <CJK>
-0x9C2E # <CJK>
-0x9C2F # <CJK>
-0x9C30 # <CJK>
-0x9C32 # <CJK>
-0x9C39 # <CJK>
-0x9C3A # <CJK>
-0x9C3B # <CJK>
-0x9C3E # <CJK>
-0x9C46 # <CJK>
-0x9C47 # <CJK>
-0x9C48 # <CJK>
-0x9C52 # <CJK>
-0x9C57 # <CJK>
-0x9C5A # <CJK>
-0x9C60 # <CJK>
-0x9C67 # <CJK>
-0x9C76 # <CJK>
-0x9C78 # <CJK>
0x9CE5 # <CJK>
-0x9CE7 # <CJK>
-0x9CE9 # <CJK>
-0x9CEB # <CJK>
-0x9CEC # <CJK>
-0x9CF0 # <CJK>
-0x9CF3 # <CJK>
0x9CF4 # <CJK>
-0x9CF6 # <CJK>
-0x9D03 # <CJK>
-0x9D06 # <CJK>
-0x9D07 # <CJK>
-0x9D08 # <CJK>
-0x9D09 # <CJK>
-0x9D0E # <CJK>
-0x9D12 # <CJK>
-0x9D15 # <CJK>
-0x9D1B # <CJK>
-0x9D1F # <CJK>
-0x9D23 # <CJK>
-0x9D26 # <CJK>
-0x9D28 # <CJK>
-0x9D2A # <CJK>
-0x9D2B # <CJK>
-0x9D2C # <CJK>
-0x9D3B # <CJK>
-0x9D3E # <CJK>
-0x9D3F # <CJK>
-0x9D41 # <CJK>
-0x9D44 # <CJK>
-0x9D46 # <CJK>
-0x9D48 # <CJK>
-0x9D50 # <CJK>
-0x9D51 # <CJK>
-0x9D59 # <CJK>
-0x9D5C # <CJK>
-0x9D5D # <CJK>
-0x9D5E # <CJK>
-0x9D60 # <CJK>
-0x9D61 # <CJK>
-0x9D64 # <CJK>
-0x9D6C # <CJK>
-0x9D6F # <CJK>
-0x9D72 # <CJK>
-0x9D7A # <CJK>
-0x9D87 # <CJK>
-0x9D89 # <CJK>
0x9D8F # <CJK>
-0x9D9A # <CJK>
-0x9DA4 # <CJK>
-0x9DA9 # <CJK>
-0x9DAB # <CJK>
-0x9DAF # <CJK>
-0x9DB2 # <CJK>
0x9DB4 # <CJK>
-0x9DB8 # <CJK>
-0x9DBA # <CJK>
-0x9DBB # <CJK>
-0x9DC1 # <CJK>
-0x9DC2 # <CJK>
-0x9DC4 # <CJK>
-0x9DC6 # <CJK>
-0x9DCF # <CJK>
-0x9DD3 # <CJK>
-0x9DD9 # <CJK>
-0x9DE6 # <CJK>
-0x9DED # <CJK>
-0x9DEF # <CJK>
-0x9DF2 # <CJK>
-0x9DF8 # <CJK>
-0x9DF9 # <CJK>
-0x9DFA # <CJK>
-0x9DFD # <CJK>
-0x9E1A # <CJK>
-0x9E1B # <CJK>
-0x9E1E # <CJK>
-0x9E75 # <CJK>
-0x9E78 # <CJK>
-0x9E79 # <CJK>
-0x9E7D # <CJK>
0x9E7F # <CJK>
-0x9E81 # <CJK>
-0x9E88 # <CJK>
-0x9E8B # <CJK>
-0x9E8C # <CJK>
-0x9E91 # <CJK>
-0x9E92 # <CJK>
0x9E93 # <CJK>
-0x9E95 # <CJK>
0x9E97 # <CJK>
-0x9E9D # <CJK>
-0x9E9F # <CJK>
-0x9EA5 # <CJK>
0x9EA6 # <CJK>
-0x9EA9 # <CJK>
-0x9EAA # <CJK>
-0x9EAD # <CJK>
-0x9EB8 # <CJK>
-0x9EB9 # <CJK>
0x9EBA # <CJK>
0x9EBB # <CJK>
-0x9EBC # <CJK>
-0x9EBE # <CJK>
-0x9EBF # <CJK>
0x9EC4 # <CJK>
-0x9ECC # <CJK>
-0x9ECD # <CJK>
-0x9ECE # <CJK>
-0x9ECF # <CJK>
-0x9ED0 # <CJK>
0x9ED2 # <CJK>
-0x9ED4 # <CJK>
-0x9ED8 # <CJK>
0x9ED9 # <CJK>
-0x9EDB # <CJK>
-0x9EDC # <CJK>
-0x9EDD # <CJK>
-0x9EDE # <CJK>
-0x9EE0 # <CJK>
-0x9EE5 # <CJK>
-0x9EE8 # <CJK>
-0x9EEF # <CJK>
-0x9EF4 # <CJK>
-0x9EF6 # <CJK>
-0x9EF7 # <CJK>
-0x9EF9 # <CJK>
-0x9EFB # <CJK>
-0x9EFC # <CJK>
-0x9EFD # <CJK>
-0x9F07 # <CJK>
-0x9F08 # <CJK>
-0x9F0E # <CJK>
0x9F13 # <CJK>
-0x9F15 # <CJK>
-0x9F20 # <CJK>
-0x9F21 # <CJK>
-0x9F2C # <CJK>
0x9F3B # <CJK>
-0x9F3E # <CJK>
-0x9F4A # <CJK>
-0x9F4B # <CJK>
-0x9F4E # <CJK>
-0x9F4F # <CJK>
-0x9F52 # <CJK>
-0x9F54 # <CJK>
-0x9F5F # <CJK>
-0x9F60 # <CJK>
-0x9F61 # <CJK>
0x9F62 # <CJK>
-0x9F63 # <CJK>
-0x9F66 # <CJK>
-0x9F67 # <CJK>
-0x9F6A # <CJK>
-0x9F6C # <CJK>
-0x9F72 # <CJK>
-0x9F76 # <CJK>
-0x9F77 # <CJK>
-0x9F8D # <CJK>
-0x9F95 # <CJK>
-0x9F9C # <CJK>
-0x9F9D # <CJK>
-0x9FA0 # <CJK>
-#0xFFE5 # FULLWIDTH YEN SIGN
+#0x20B9F # <CJK>
diff --git a/chromium/third_party/fontconfig/src/fc-lang/ko.orth b/chromium/third_party/fontconfig/src/fc-lang/ko.orth
index 39114a5af1f..4bb52c6f487 100644
--- a/chromium/third_party/fontconfig/src/fc-lang/ko.orth
+++ b/chromium/third_party/fontconfig/src/fc-lang/ko.orth
@@ -86,7 +86,6 @@
0x3161 # HANGUL LETTER EU
0x3162 # HANGUL LETTER YI
0x3163 # HANGUL LETTER I
-0x3164 # HANGUL FILLER
0x3165 # HANGUL LETTER SSANGNIEUN
0x3166 # HANGUL LETTER NIEUN-TIKEUT
0x3167 # HANGUL LETTER NIEUN-SIOS
diff --git a/chromium/third_party/fontconfig/src/fc-lang/zh_hk.orth b/chromium/third_party/fontconfig/src/fc-lang/zh_hk.orth
index 5d5ef052696..8701cbcbc95 100644
--- a/chromium/third_party/fontconfig/src/fc-lang/zh_hk.orth
+++ b/chromium/third_party/fontconfig/src/fc-lang/zh_hk.orth
@@ -2,6 +2,7 @@
# fontconfig/fc-lang/zh_hk.orth
#
# Copyright © 2002 Keith Packard
+# Copyright © 2014 Abel Cheung
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
@@ -23,546 +24,610 @@
#
# Chinese Hong Kong Supplementary Character Set (ZH-HK)
#
-# Taken from the HKSCS-2001, including only the non-PUA BMP glyphs
-# as encoded in ISO/IEC 10646-1:2000
+# This list is a concatenation of:
+# (1) Most frequently used HKSCS characters accounting for ~99.75% usage in:
+# i. Around 11000 crawled UTF-8 Hong Kong web pages in
+# http://html5.org/temp/hk-data.tar.gz
+# ii. Database dump of main content in Cantonese Wikipedia dated 20131228:
+# http://dumps.wikimedia.org/zh_yuewiki/
+# (2) Word recommendation list from a local linguist:
+# http://founder.acgvlyric.org/iu/doku.php/%E9%80%A0%E5%AD%97:%E5%B8%B8%E7%94%A8%E9%A6%99%E6%B8%AF%E5%A4%96%E5%AD%97%E8%A1%A8
+# Level 1-5 characters are taken, excluding non-HKSCS chars.
+#
+3007
+344C
+3464
+3473
+347A
+347D
+347E
+3493
+3496
+34A5
+34BC
+34C1
+34C8
+34DF
+34E4
+34FB
+3506
+353E
+3551
+3561
+356D
+3570
+3572
+3577
+3578
+3584
+3597
+35A1
+35A5
+35AD
+35BF
+35C1
+35C5
+35C7
+35CA
+35CE
+35D2
+35D6
+35DB
+35F1
+35F2
+35F3
+35FB
+35FE
+3609
+361A
+3623
+362D
+3635
+3639
+3647
+3648
+3649
+364E
+365F
+367A
+3681
+36A5
+36AA
+36AC
+36B0
+36B1
+36B5
+36B9
+36BC
+36C1
+36C3
+36C4
+36C5
+36D3
+36D4
+36D6
+36DD
+36E5
+36E6
+36F5
+3703
+3708
+370A
+370D
+371C
+3723
+3725
+3730
+3732
+3733
+373A
+3740
+3743
+3762
+376F
+3797
+37A0
+37B9
+37BE
+37F2
+37F8
+37FB
+380F
+3819
+3820
+382D
+3836
+3838
+3863
+38A0
+38C3
+38CC
+38D1
+38FA
+3908
+3914
+3927
+3932
+393F
+394D
+3963
+3980
+3989
+398A
+3992
+399B
+39A1
+39A4
+39B8
+39DC
+39E2
+39E5
+39EC
+39F8
+39FB
+39FE
+3A01
+3A03
+3A06
+3A17
+3A18
+3A29
+3A2A
+3A34
+3A4B
+3A52
+3A57
+3A5C
+3A5E
+3A66
+3A67
+3A97
+3AAB
+3ABD
+3ADE
+3AF0
+3AF2
+3AFB
+3B0E
+3B19
+3B22
+3B2B
+3B39
+3B42
+3B58
+3B60
+3B71
+3B72
+3B7B
+3B7C
+3B80
+3B96
+3B99
+3BA1
+3BBE
+3BC2
+3BC4
+3BD7
+3BDD
+3BEC
+3BF2
+3BF3
+3C0D
+3C11
+3C15
+3C54
+3CCB
+3CCD
+3CD1
+3CD6
+3CDC
+3CEB
+3D13
+3D1D
+3D32
+3D46
+3D4C
+3D4E
+3D51
+3D5F
+3D62
+3D69
+3D6A
+3D6F
+3D75
+3D7D
+3D85
+3D8F
+3D91
+3DA5
+3DAD
+3DB4
+3DBF
+3DC6
+3DC7
+3DCD
+3DD3
+3DDB
+3DEB
+3DF3
+3DF7
+3DFC
+3E40
+3E43
+3E48
+3E55
+3E74
+3EA8
+3EA9
+3EAA
+3EAD
+3EB1
+3EB8
+3EBF
+3EC2
+3ECA
+3ECC
+3ED1
+3ED6
+3ED7
+3EDE
+3EE1
+3EE7
+3EEB
+3EF0
+3EFA
+3EFF
+3F04
+3F0E
+3F58
+3F59
+3F63
+3F93
+3FC0
+3FD7
+3FDC
+3FE5
+3FED
+3FF9
+3FFA
+4004
+4039
+4045
+4053
+4057
+4062
+4065
+406A
+406F
+40BB
+40BF
+40C8
+40D8
+40DF
+40FA
+4103
+4104
+4109
+410E
+4132
+4167
+416C
+416E
+417F
+4190
+41B2
+41CF
+41DB
+41EF
+41F9
+4211
+4240
+4260
+426A
+427A
+4294
+42A2
+42B5
+42B9
+42BC
+42F4
+42FB
+42FC
+432B
+436E
+4397
+43BA
+43C1
+43D9
+43DF
+43ED
+43F2
+4401
+4402
+4413
+447A
+448F
+449F
+44A0
+44B0
+44B7
+44DD
+44DF
+44E4
+44EA
+44F4
+4503
+4504
+4509
+4516
+4527
+452E
+4533
+453B
+453F
+4543
+4551
+4552
+4555
+4562
+456A
+4577
+4585
+45E9
+4603
+4606
+460F
+4615
+4617
+465B
+467A
+46CF
+46D0
+46F5
+4718
+477C
+47D5
+47ED
+47F4
+4800
+480B
+4871
+489B
+48AD
+48D0
+48DD
+48ED
+48FA
+4906
+491E
+492A
+492D
+4935
+493C
+493E
+4945
+4951
+4953
+4965
+496A
+4972
+4989
+49A7
+49DF
+49E5
+4A0F
+4A1D
+4A24
+4A35
+4A96
+4AB4
+4AB8
+4AD1
+4AE4
+4AFF
+4B19
+4B2C
+4B37
+4B6F
+4B70
+4B72
+4B7B
+4B7E
+4B8E
+4B90
+4B93
+4B96
+4B97
+4B9D
+4BBD
+4BBE
+4BC0
+4C04
+4C07
+4C0E
+4C3B
+4C3E
+4C5B
+4C6D
+4C77
+4C7B
+4C7D
+4C81
+4CAE
+4CB0
+4CCD
+4CE1
+4CED
+4D09
+4D10
+4D34
+4D77
+4D91
+4D9C
4E04
-4E1A
-4E1C
4E21
-4E24
-4E28
4E2A
-4E2C
-4E2F
-4E36
-4E37
-4E3D
-4E3F
-4E49
4E5A
4E5B
4E6A
4E78
4E80
-4E81
4E85
-4E87
-4E89
4E98
-4E9A
-4EA0
-4EA3
-4EB7
-4EBB
-4EBC
-4EBF
4ECE
-4EEA
-4EEB
4EEE
-4EF8
-4F03
-4F17
-4F1A
-4F28
-4F29
-4F32
4F37
-4F39
-4F42
-4F45
-4F4B
-4F72
-4F8A
-4FA2
-4FA8
-4FAB
-4FB0
-4FBD
-4FC8
-4FCC
-4FE4
4FE5
-4FF0
-4FF2
4FF9
-4FFD
-5003
5008
-502E
-5034
503B
-5056
-5058
-5066
-506C
-5081
-5088
-5090
-50A6
-50BC
50CD
-50D0
-50D9
-50DF
-50E1
-50F4
-50FC
-5101
510D
510E
-512B
-5156
-5160
516A
-5174
-5179
-5182
5186
-5188
-5196
519A
-519C
51A7
51A8
-51AB
-51AE
51B2
51B3
51B4
51B5
-51B8
-51C3
-51C7
51C9
-51CF
-51D1
-51D2
-51D3
-51DB
-51DF
-51E2
-51E4
51ED
51F4
-51FC
-51FE
-5202
-5205
520B
-521F
-5220
5226
5227
5234
523C
5257
-5259
-5260
-5268
-5273
-5279
528F
-5290
-5294
-529A
-52A1
-52A4
-52A8
52B5
52B9
52C5
-52CC
-52D0
52D1
-52E0
-52E1
-52F9
-5301
-5324
-5327
-532C
-5332
-5333
5338
-533B
-5342
-534E
-535D
-535F
-5364
-5367
-5369
-536D
5374
537D
-537E
5393
53A0
-53A2
53A6
53A8
-53A9
-53AA
-53AB
-53AE
-53B0
-53B6
53C1
-53C2
-53C5
53CC
-53D0
-53D1
-53D2
-53D8
53D9
-53DA
53E0
53F6
-53F7
53FE
5413
5414
5416
-541A
5421
-5423
-542F
-5432
-5434
-544B
+544C
544D
-5469
546A
546D
-5485
548F
5493
5494
5497
-549C
-549E
-54A3
54A4
54B2
-54B4
-54B9
54CB
-54CC
54CD
-54D0
-54DA
54E3
-54EF
5502
-550D
5513
-5518
551E
-5523
5525
-5528
-552B
-553F
-5547
-5549
5553
555D
5569
556B
5571
5572
-5573
5579
5586
5590
55A9
55B0
-55B4
-55B9
55BA
55BC
-55C1
55D7
-55D8
55DE
-55EA
55EC
55F0
55F1
-55F5
55FB
5605
5611
561E
-5620
-5621
5622
5623
5625
562D
-5637
5643
564D
564F
-5650
5652
5654
565D
-5661
-567A
-567B
-567C
5689
-568A
-568B
5692
-569E
569F
56A1
56A4
-56AF
56B1
56B9
56BF
56D6
-56E2
-56ED
-56EF
-56F1
56FD
-5700
-5715
-571D
-5732
-573D
-573F
5742
-5743
-5746
-5754
-5757
-575B
-575F
-5767
577A
-577E
-577F
-5788
-578A
-578D
-5790
-579C
-57A1
-57A7
-57AA
-57B4
-57BB
-57BE
-57C4
57C8
57D7
-57DD
57DE
-57E6
-57EF
-57FE
5803
-5812
-5822
5826
583A
5840
-5844
-5847
-585C
-585F
5869
-586C
5872
5873
-5892
-5899
-589A
-58A7
58AA
-58B0
-58B5
-58B6
58BB
-58CB
-58D0
-58DC
58E0
-58F0
58F2
58F3
58FB
-5902
-5904
-5905
-5907
590A
-5911
-591F
-5932
-5934
-5965
5975
-5989
-5994
-599A
599F
59AC
-59B0
-59B7
-59B8
-59C4
59C9
-59D9
59EB
-59EF
-59F0
59F8
-59F9
-5A02
-5A0B
-5A0D
-5A12
-5A1A
-5A21
-5A24
-5A27
-5A2A
5A2B
-5A2C
-5A3D
-5A45
-5A54
-5A59
-5A61
-5A63
-5A68
-5A6B
-5A6E
-5A71
-5A79
5A7E
-5A81
-5A82
-5A86
-5A88
-5A91
-5A96
-5A99
-5AA0
-5AA1
-5AAB
-5AC3
-5ACE
-5ACF
-5AD3
-5AE4
-5AF0
5AF2
5AFA
-5AFE
-5B0D
-5B11
-5B15
-5B1F
-5B2B
-5B41
-5B44
5B46
-5B4A
-5B4F
-5B66
-5B68
5B6D
-5B74
-5B76
-5B7C
-5B80
-5B82
-5B90
-5B96
5B9D
-5B9E
5B9F
-5BAA
5BC3
-5BD5
-5BD7
+5BDB
5BF3
-5BFF
5C05
-5C13
-5C14
-5C1C
-5C1E
-5C20
-5C23
-5C49
5C4A
-5C53
5C5E
-5C85
-5C99
-5C9A
-5C9C
-5C9E
-5CBA
-5CC1
-5CC2
-5CD1
-5CE5
-5CE9
5CEF
-5CF5
-5D10
-5D15
-5D18
-5D2C
-5D2F
-5D3E
-5D46
-5D48
-5D56
-5D57
-5D5B
-5D70
-5D74
-5D7B
-5D85
5D8B
-5D8E
-5DA4
-5DAB
-5DB6
-5DB9
-5DC1
-5DD7
-5DDB
5DF5
-5E09
-5E0B
-5E12
-5E2E
-5E42
-5E48
-5E5E
5E7A
-5E7F
5E83
-5E86
-5E92
-5E99
-5EBD
-5ECD
5ED0
-5EF4
5EF8
5EF9
5EFB
@@ -570,1671 +635,485 @@
5F0C
5F0D
5F0E
-5F25
-5F3A
-5F4D
-5F50
-5F51
5F5C
-5F61
-5F63
-5F72
-5F7B
-5F83
-5FA4
5FA7
-5FB1
-5FBA
-5FC2
-5FC4
-5FDB
5FDF
-6023
6031
-603B
-604A
-6052
6075
-6077
-607E
609E
60A4
-60A7
-60B3
60D7
-60DE
60E3
-60E7
-60E8
-60E9
-60FD
-6107
-610C
-6119
-6122
-6130
-613D
-6142
-6150
6159
-615C
-6160
6164
-616F
617D
-6181
6187
-6195
-6198
-6199
-619C
-61B7
-61B9
-61C0
-61CF
61D0
-61D3
-61DA
-61E2
-622C
-6237
6239
-624C
-6268
-6282
-6285
-6290
629D
-62A4
62A6
62C3
62C5
62D5
-62DF
-62E5
-6318
-632E
6331
-6335
-6337
-6364
-636C
6379
-637F
-638B
63B9
-63C1
63D1
63DE
-63E2
63E6
63F8
-63FB
63FC
63FE
6407
6432
-6438
643A
-643B
-645A
-6471
647C
648D
6491
-64AF
64B4
-64B6
-64C0
-64D3
64DD
64E1
-64E5
64E7
-64EA
-650A
-6511
651E
-651F
6530
-6534
-6535
654D
-655F
-656B
-656D
-6585
6586
-6588
6589
-658B
-65B5
-65BE
-65D1
-65D4
-65E0
65E3
-65FF
-6618
-661E
-6623
6630
6644
-6648
664B
-6653
-6657
-6663
6667
666B
6673
-667D
-6685
668E
-6692
-669A
-66A4
-66AD
-66B3
-66B6
-66BF
-66CD
-66CE
66F1
-6702
-670C
-670E
-6716
-6719
-671E
6725
6736
-6744
6761
-6762
6767
-676B
-678F
67A0
-67A4
-67AC
67B1
-67BF
-67D6
-67D7
-67F9
-67FE
-6800
-6801
-6802
6803
6804
-680D
-6810
-681B
681E
6822
-6836
-6837
-683E
-6847
-684A
-6855
-6856
-685D
-6865
-6884
-6888
6898
-68A6
68B6
-68B9
-68BD
-68C3
-68C5
-68CA
6900
-6901
-6902
-6903
-6909
-6918
-6919
-691A
-691B
-692C
6936
-693E
-6943
-6946
-6955
6961
-6964
-6967
-6972
6973
-6980
-6985
698A
-6998
-699F
-69A2
69B2
-69C0
-69D1
-69D5
-69D6
-69E1
-69E9
-69F9
-69FA
-6A03
6A0B
-6A0C
-6A1A
-6A1C
6A2B
-6A2C
-6A2D
-6A33
-6A43
-6A45
-6A4C
-6A52
-6A53
-6A57
-6A63
-6A65
-6A71
-6A74
-6A7A
-6A82
-6A8A
-6A8F
-6A99
-6A9D
-6AA7
-6AAB
-6AB1
-6AB2
-6AB5
-6ABE
6AC8
-6AC9
-6ACA
-6AD4
-6AD8
-6AF6
-6B05
-6B1D
6B35
-6B52
-6B57
6B6F
6B74
6B7A
-6B81
-6BC1
-6BDC
6BE1
-6BEA
-6BFA
-6C1C
-6C31
-6C35
6C37
6C39
-6C3A
-6C3D
-6C49
-6C58
6C5A
-6C6E
-6C75
-6C79
-6C7F
-6C9F
6CA2
-6CAA
-6CAF
-6CB2
-6CCB
-6CCE
-6CDF
6CEA
-6CFF
-6D02
-6D05
-6D06
-6D24
-6D26
-6D4E
-6D57
-6D5B
6D5C
-6D71
6D72
-6D81
-6D8F
6D96
-6DA4
-6DA5
-6DB1
-6DB9
-6DFE
-6E02
-6E04
-6E0A
-6E0F
6E15
-6E18
6E29
-6E2A
-6E4F
-6E50
-6E59
-6E76
6E7C
-6E86
-6E8B
-6E9A
-6EB5
-6EB8
-6EBB
6ED9
-6EDA
6EDB
6EDD
-6EE2
-6EE8
-6EE9
-6EFA
-6F04
-6F0B
-6F0C
6F16
-6F17
-6F24
-6F34
-6F3D
-6F44
6F56
-6F5C
-6F74
-6F79
6F81
-6F8A
-6F9D
-6F9F
-6FB5
-6FBB
6FBE
-6FD3
-6FD9
-6FDA
6FF6
-6FF8
-7003
701E
702C
-704B
-704D
-7050
-7054
-705C
-7067
-706C
-706F
-7075
-7077
-7079
-707E
-707F
7081
7089
-708B
-708F
-70A0
-70A3
-70A5
-70A6
-70A7
70B9
-70BB
-70BC
-70BD
-70C0
-70C4
-70CC
-70D0
-70D5
-70D6
70DF
70F1
-70F5
-70FE
7105
-711D
-7129
712B
-712C
-7133
-7134
-7135
-713B
-713E
7140
7145
714A
-714F
7151
-716B
7171
-7173
-7175
-7176
-7177
-717A
-717C
-717E
-7188
-718C
-718E
-7191
-7196
-7198
-71A2
-71A3
-71AD
-71B4
-71B7
-71BA
-71D1
-71DD
-71EB
-71F5
71F6
-7200
-7209
-720E
-720F
7215
-7216
-7217
-7224
-722B
-722E
7240
-7250
-7255
-7257
-725C
-7266
7282
7287
-728F
-7294
-729F
-72AD
-72B2
-72CD
-72E2
-7302
-7304
-7310
-7328
732A
-732B
-732C
732E
-7338
-7339
7341
-7348
-734F
-7371
7374
-738C
-738F
-7398
-739C
-739E
-73A7
-73AA
-73BA
73C9
-73CE
73CF
-73D0
-73D5
-73E1
-73E2
-73E4
-73E6
-73EF
-73F3
-73F7
-73F9
-73FB
-7402
-7411
-7412
-7414
-7415
-7417
-7419
-741C
-741E
-741F
-7437
-7438
7439
743C
-7443
-7445
-7447
7448
-7449
-7453
-7456
-745D
7460
-7465
-7468
-746B
-746C
-7474
-7476
-747A
-7482
-748C
-748D
-7499
-749B
-74A4
-74B4
-74B9
-74C8
-74CC
-74D0
-74D3
-74E7
-74F0
-74F1
-74F2
-74F8
7505
-750E
-7519
-751E
7534
-7535
753B
-7542
-7546
754A
-754D
7551
7553
-7555
7560
7567
-756D
-756E
-7572
-757A
-7583
758D
758E
-7592
-759E
75B1
75B4
-75C3
-75C8
-75DC
7602
-7607
-762C
763B
-7640
-764D
764E
-764F
-7651
-7654
7666
7667
-766F
-7673
-7674
7676
767A
-7690
-76A1
-76A5
-76B7
-76CC
-76D6
-76D9
770C
-770E
-770F
771E
-7724
-7726
-772B
7740
-7743
7758
-7772
-7777
7778
777A
-777B
7793
-7798
-77AF
77B9
-77BE
-77C3
-77C5
77CB
-77DD
-77E6
-77F4
-77FE
7808
-7818
-781C
-781E
-7839
-783C
-783D
-7842
-7844
-7847
-784B
-7851
-7853
-7854
-7866
-787A
7881
-7888
788D
-78AF
78B1
-78B6
78B8
-78B9
-78C7
-78D2
-78D3
78D7
-78D8
-78E4
-78EE
-78F0
-78F1
-78F5
7906
792E
-7932
-7933
-7934
-7936
-793B
-793C
7958
-7959
7962
-7971
-797E
-7980
-7983
-7986
-7987
7991
-7999
-799D
-799F
-79A5
-79A9
79C4
-79C6
-79CC
-79D4
-79E2
-79F1
-79F4
-7A06
-7A2A
-7A2D
-7A3A
-7A3E
-7A43
-7A45
-7A49
-7A65
-7A7D
-7A83
-7A91
7A93
7AB0
-7ABB
-7ABC
-7AC2
-7AC3
7AC8
7AC9
-7ACF
-7AD3
-7ADA
-7ADB
7ADC
7ADD
-7AE2
-7AE7
-7AE9
7AEA
-7AFE
7B0B
-7B0C
-7B14
-7B1F
-7B27
-7B29
7B39
-7B42
-7B43
-7B55
-7B62
-7B6C
7B6F
-7B7B
-7B92
-7BA2
-7BA3
-7BB2
-7BCF
-7BD0
-7BEC
-7BFA
-7BFC
-7C12
7C15
-7C1B
-7C35
-7C42
-7C44
-7C51
-7C56
-7C5D
-7C6D
-7C70
-7C74
-7C7B
-7C7C
-7C7E
-7C83
-7C86
-7C8E
-7C9C
7CA6
7CA7
-7CAC
7CAE
-7CB8
-7CC2
-7CC3
-7CC7
7CC9
7CCD
-7CD3
-7CDA
-7CE6
7CED
-7CF3
-7CF5
7CF9
7CFC
7D25
-7D4D
-7D5A
7D5D
7D89
-7D8B
-7D97
-7DA4
-7DA8
7DAB
7DB3
7DCD
7DCF
-7DD0
-7DD3
-7DD4
7DDC
-7DE4
-7DE5
-7DF5
-7DFD
-7DFE
-7E07
-7E27
-7E5B
-7E65
-7E67
-7E6C
7E6E
-7E7F
-7E8E
-7E92
-7E9F
-7EA4
-7EAC
-7EBA
-7EC7
-7ECF
-7EDF
-7F06
-7F37
-7F40
-7F41
7F47
7F49
7F4E
-7F52
-7F53
-7F71
7F78
-7F8F
-7F93
7F97
7FA3
-7FAE
-7FB4
-7FDD
-7FE7
-7FFA
-8002
-8008
-801D
-8020
-8025
-802E
-802F
-8031
-803B
-803C
-8054
-805B
8061
-8062
-8063
-8066
-8080
-809F
-80A7
80B6
-80B7
-80BC
80BD
80C6
-80E9
-80EC
-80F6
-8103
8107
-8109
-810C
-810E
-8112
-8114
8117
-811A
-812A
-8132
-8134
8137
-8142
-8148
-8156
-8159
-815A
-816D
-817C
-8184
-8193
81A5
-81AA
81B6
-81C1
-81C8
-81E4
81EF
-81F6
8218
-821A
8226
-8229
-822D
-823E
-8254
-8262
-8265
8276
-8279
-827A
-827B
-8287
82A6
82AA
-82BF
-82C4
-82CA
-82CF
-82D0
-82D8
-82E2
-82EE
82F7
-82F8
-82FC
-82FD
-82FF
-830B
8318
-831A
-831D
-833D
-8357
-8362
-8363
-8366
-836F
-8385
-8391
-839C
-83AC
-83B9
-83BE
-83CD
83D3
-83ED
-8405
-8414
-8416
8418
-841C
8420
-8421
-8424
-8426
-842E
-843E
-8448
-844A
-8453
-8455
-8458
-845C
-8462
-8464
8471
-8472
-847F
-8480
-8488
-8492
-8493
-8496
-84A3
84AD
84BD
-84BE
-84DA
-84DE
-84E1
84E2
-84E4
-84E5
-84F8
8503
-8505
-8510
-8533
8534
-8538
-8542
-854B
-854C
-8552
-855A
-855F
-856F
8570
-8573
-8597
-85C1
-85D6
-85E0
-85EE
-85FC
8602
-860D
-860F
-8610
-8614
-8616
-8628
862F
-8642
-8645
-866C
-8672
-867E
-8692
-86A0
-86AD
-86B2
86EF
-8770
-8771
-877D
8786
-878B
-878C
-87A5
-87A9
-87B1
-87C1
87CE
-87D6
-87DA
-87EE
-87F5
8804
-880F
-8818
-8827
882D
-8842
-8845
8846
-884F
885E
-8860
-8864
-8865
-886E
-8884
-8887
-888F
-8890
889C
-88A0
-88AE
-88B4
-88B5
-88BF
-88C5
88C7
88CF
-88E6
-88F5
-88FF
-8900
-8924
-8943
8947
-894D
-8954
-8965
-8977
-8980
8987
-8989
-898A
-8991
8994
89A5
89A7
-89A9
-89BC
-89C1
-89C6
-89E7
-8A1C
-8A29
-8A2B
-8A38
-8A3D
-8A49
-8A67
-8A7E
-8A90
8A94
-8A9C
-8AA9
-8AAF
-8AB4
-8ADA
-8AEA
-8B0C
-8B1F
-8B2D
-8B3F
-8B43
8B4C
-8B4D
-8B5E
-8B62
-8B69
8B81
8B83
8B90
-8B9B
-8BA0
-8BBE
-8BE2
-8C51
-8C9B
-8C9F
-8CAD
8CCD
-8CD4
-8CD6
8CDB
-8CE9
-8CEB
-8CF2
-8CF7
8D03
8D0B
-8D0C
-8D11
-8D12
-8D18
-8D1C
-8D1D
-8D7A
-8D82
-8DA6
-8DA9
-8DC0
-8DC3
-8DD4
-8E01
8E0E
-8E28
8E2A
8E2D
-8E3A
-8E46
8E4F
-8E68
-8E71
-8E75
-8E77
8E7E
8E80
-8EA7
8EAD
-8EB0
-8EB6
-8EB9
-8EBC
-8EC3
-8ECE
8EDA
8EE2
-8EE4
-8EED
8EF2
-8F19
8F2D
-8F30
-8F41
-8F4A
-8F5C
-8F66
-8F67
-8F6E
-8F93
-8FA0
-8FA5
-8FA7
-8FB3
8FB5
-8FB6
-8FB7
-8FB8
-8FB9
8FBA
8FBB
8FBC
-8FBE
-8FC1
-8FCA
-8FCC
-8FCF
-8FD0
-8FDA
8FF9
-9008
-9012
9033
-9037
-904C
9056
9061
-9064
-906C
90A8
-90AE
-90BB
-90C4
-9151
-9159
-915C
-915E
-9167
-9170
9176
-917C
-918C
-918E
-91A9
-91B6
-91BB
-91C4
-91D6
-91DF
-91E5
-91F6
-91FA
-91FE
9208
920E
-9213
-9221
-9228
922A
-922B
-9235
-923C
-9241
9244
9255
-9258
925D
-925F
9262
-926B
926E
-9277
-9281
-9284
-9289
-928F
-92AE
-92B1
92B9
-92BA
92BE
-92BF
-92D4
-92DB
-92E3
-92E5
-92EB
-92EC
-92F2
-92F3
-92F4
-92F6
-92FD
-9303
9307
-932C
-9330
-9331
9340
-9341
-9342
-9343
-9344
9345
9348
-935F
-9362
-9366
-9368
9369
-936B
-936E
-9373
-9374
-9378
-937D
-9381
9384
9385
-9386
9387
-9390
-939C
-93A0
93AD
-93B8
-93BB
-93BD
93BF
-93C6
-93CB
-93D3
-93DB
-93E0
93F0
-93F1
-93F3
-93F4
-9401
9404
-9408
-9417
-941B
-941D
-9424
-9425
9426
9427
-942D
-943E
-9442
-9443
-944D
9454
-9458
945B
9465
-9467
-946C
-9479
-947B
-9485
-949F
-94A2
-94C1
-94C3
-94DC
-94F6
-952D
-9547
-9578
-957F
-9585
-9596
-9597
9599
-95A0
95A2
-95A6
-95A7
95AA
-95E8
-95F4
-961D
-9633
-9638
-9641
-9645
-9656
-9669
-967B
-9681
-968F
9696
96A3
-96A5
-96B6
-96BD
-96F4
-9703
-971B
9721
-9731
-9736
-9740
-9741
9751
-9755
-9757
-975D
-975F
976D
-9771
-9787
-9789
-979B
-979F
-97B1
-97B2
-97B4
-97B8
-97BA
-97BD
-97BE
-97C0
-97C2
-97C8
-97D2
-97E0
-97E6
97EE
-97F2
97F5
-9814
-9815
-981F
-9823
-982E
-9833
9834
-9847
-984B
-9866
-9868
-986C
-9875
-98B4
98B7
-98B9
-98C3
-98C7
98C8
-98CA
-98CE
-98DC
-98DE
98E0
-98E1
-98E6
-98EC
-98F1
-98F5
-990E
-9919
991C
-9937
9938
-9939
-993B
-9940
-9942
994A
994D
-995D
9962
-9963
-999B
-99A4
-99AA
-99B8
-99BC
-99C4
99C5
-99DA
-99E0
99E1
-99E6
-99F5
-9A0C
9A10
-9A1F
-9A21
-9A26
-9A2F
-9A3B
-9A3C
-9A58
-9A5C
-9A63
-9A6C
-9A8F
-9AB2
-9AB6
-9ABA
-9ABD
-9AD7
-9AE0
-9AE2
-9AF4
-9AFF
-9B02
-9B09
-9B0F
-9B14
9B2A
9B2D
-9B34
-9B39
-9B40
-9B50
-9B69
-9B7F
9B81
-9B83
9B8B
-9B8D
9B8E
-9B8F
-9B97
-9B9D
-9B9F
-9BB0
-9BCF
-9BDD
-9BE9
9BED
9BF1
-9BF4
9BFF
9C02
-9C0A
9C0C
-9C10
-9C15
-9C1B
-9C1F
-9C20
-9C26
9C2F
9C35
9C3A
9C45
-9C4F
-9C53
9C5D
9C72
-9C7B
-9C7C
-9D02
-9D0C
-9D16
-9D21
9D34
-9D39
-9D44
-9D49
-9D4E
9D50
9D5E
-9D6D
-9D6E
-9D7C
-9D7E
-9D83
9D93
-9DA5
-9DAB
-9DBD
9DC0
9DC4
9DC9
9DD4
-9DFC
9E0A
9E0C
-9E0E
-9E18
-9E1C
-9E1F
-9E7B
-9E81
-9E84
-9E85
9E90
9E95
9E96
-9E98
-9E9E
-9EA2
-9EA6
-9EA8
9EAA
9EAB
-9EAC
9EAF
-9EB1
-9EBD
9EBF
-9EC1
-9EC4
-9EC6
-9EC7
-9EE2
-9EF1
-9EF8
-9EFE
-9F02
9F08
-9F17
9F26
-9F27
-9F39
-9F44
-9F45
-9F50
-9F53
-9F5A
9F62
-9F69
-9F7F
9F8E
-9F99
-9F9F
-9FA5
-20547
+200CA
+201A4
+201A9
+20325
+20341
+2070E
+20779
+20C41
+20C53
+20C65
+20C78
+20C96
+20CB5
+20CCF
+20D31
+20D71
+20D7E
+20D7F
+20D9C
+20DA7
+20E04
+20E09
+20E4C
+20E73
+20E76
+20E7A
+20E9D
+20EA2
+20ED7
+20EF9
+20F2D
+20F2E
+20F3B
+20F4C
+20FB4
+20FEA
+21014
+2105C
+2106F
+21075
+21076
+2107B
+210C1
+210D3
+2113D
+21145
+2114F
+2197C
+21A34
+21C2A
+21DF9
+220C7
+221A1
+22ACF
+22B43
+22BCA
+22C51
+22C55
+22C62
+22CB2
+22CC2
+22D4C
+22D67
+22D8D
+22DEE
+22F74
+23231
+23595
+236BA
+23CB7
+23E89
+23F80
+244D3
+24DB8
+24DEA
+24EA7
+2512B
+25148
+2517E
+25535
+25E49
+26258
+266DA
+267CC
+2688A
+269F2
+269FA
+27285
+27574
+27657
+27735
+2775E
+2789D
+2797A
+279A0
+27A3E
+27A59
+27D73
+28024
+280BD
+2815D
+28207
+282E2
+2836D
+289C0
+289DC
+28A0F
+28B46
+28B4E
+28CCA
+28CCD
+28CD2
+28D99
+28EE7
+294E5
+29720
+298D1
+29A4D
+29D98
+2A632
+2A65B
diff --git a/chromium/third_party/fontconfig/src/fc-query/fc-query.c b/chromium/third_party/fontconfig/src/fc-query/fc-query.c
index 2983e0f199b..9bd398059ac 100644
--- a/chromium/third_party/fontconfig/src/fc-query/fc-query.c
+++ b/chromium/third_party/fontconfig/src/fc-query/fc-query.c
@@ -52,6 +52,7 @@
#define _GNU_SOURCE
#include <getopt.h>
static const struct option longopts[] = {
+ {"ignore-blanks", 0, 0, 'b'},
{"index", 1, 0, 'i'},
{"format", 1, 0, 'f'},
{"version", 0, 0, 'V'},
@@ -70,24 +71,26 @@ usage (char *program, int error)
{
FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (file, "usage: %s [-Vh] [-i index] [-f FORMAT] [--index index] [--format FORMAT] [--version] [--help] font-file...\n",
+ fprintf (file, "usage: %s [-Vbh] [-i index] [-f FORMAT] [--ignore-blanks] [--index index] [--format FORMAT] [--version] [--help] font-file...\n",
program);
#else
- fprintf (file, "usage: %s [-Vh] [-i index] [-f FORMAT] font-file...\n",
+ fprintf (file, "usage: %s [-Vbh] [-i index] [-f FORMAT] font-file...\n",
program);
#endif
fprintf (file, "Query font files and print resulting pattern(s)\n");
fprintf (file, "\n");
#if HAVE_GETOPT_LONG
+ fprintf (file, " -b, --ignore-blanks ignore blanks to compute langauges\n");
fprintf (file, " -i, --index INDEX display the INDEX face of each font file only\n");
fprintf (file, " -f, --format=FORMAT use the given output format\n");
fprintf (file, " -V, --version display font config version and exit\n");
fprintf (file, " -h, --help display this help and exit\n");
#else
- fprintf (file, " -i INDEX (index) display the INDEX face of each font file only\n");
- fprintf (file, " -f FORMAT (format) use the given output format\n");
- fprintf (file, " -V (version) display font config version and exit\n");
- fprintf (file, " -h (help) display this help and exit\n");
+ fprintf (file, " -b (ignore-blanks) ignore blanks to compute languages\n");
+ fprintf (file, " -i INDEX (index) display the INDEX face of each font file only\n");
+ fprintf (file, " -f FORMAT (format) use the given output format\n");
+ fprintf (file, " -V (version) display font config version and exit\n");
+ fprintf (file, " -h (help) display this help and exit\n");
#endif
exit (error);
}
@@ -97,19 +100,24 @@ main (int argc, char **argv)
{
int index_set = 0;
int set_index = 0;
+ int ignore_blanks = 0;
FcChar8 *format = NULL;
+ FcBlanks *blanks = NULL;
int err = 0;
int i;
#if HAVE_GETOPT_LONG || HAVE_GETOPT
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "i:f:Vh", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "bi:f:Vh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "i:f:Vh")) != -1)
+ while ((c = getopt (argc, argv, "bi:f:Vh")) != -1)
#endif
{
switch (c) {
+ case 'b':
+ ignore_blanks = 1;
+ break;
case 'i':
index_set = 1;
set_index = atoi (optarg);
@@ -135,6 +143,8 @@ main (int argc, char **argv)
if (i == argc)
usage (argv[0], 1);
+ if (!ignore_blanks)
+ blanks = FcConfigGetBlanks (NULL);
for (; i < argc; i++)
{
int index;
@@ -145,7 +155,7 @@ main (int argc, char **argv)
do {
FcPattern *pat;
- pat = FcFreeTypeQuery ((FcChar8 *) argv[i], index, NULL, &count);
+ pat = FcFreeTypeQuery ((FcChar8 *) argv[i], index, blanks, &count);
if (pat)
{
if (format)
diff --git a/chromium/third_party/fontconfig/src/fc-query/fc-query.sgml b/chromium/third_party/fontconfig/src/fc-query/fc-query.sgml
index 5351d1e4d70..fd51d217157 100644
--- a/chromium/third_party/fontconfig/src/fc-query/fc-query.sgml
+++ b/chromium/third_party/fontconfig/src/fc-query/fc-query.sgml
@@ -65,6 +65,10 @@ manpage.1: manpage.sgml
<arg><option>-Vh</option></arg>
<sbr>
<group>
+ <arg><option>-b</option></arg>
+ <arg><option>--ignore-blanks</option></arg>
+ </group>
+ <group>
<arg><option>-i</option> <option><replaceable>index</replaceable></option></arg>
<arg><option>--index</option> <option><replaceable>index</replaceable></option></arg>
</group>
@@ -97,6 +101,14 @@ manpage.1: manpage.sgml
<variablelist>
<varlistentry>
+ <term><option>-b</option>
+ <option>--ignore-blanks</option>
+ </term>
+ <listitem>
+ <para>Ignore blanks to compute languages</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-i</option>
<option>--index</option>
<option><replaceable>index</replaceable></option>
diff --git a/chromium/third_party/fontconfig/src/fc-scan/fc-scan.c b/chromium/third_party/fontconfig/src/fc-scan/fc-scan.c
index 5638b51cf43..4d0b1db44fb 100644
--- a/chromium/third_party/fontconfig/src/fc-scan/fc-scan.c
+++ b/chromium/third_party/fontconfig/src/fc-scan/fc-scan.c
@@ -52,6 +52,7 @@
#define _GNU_SOURCE
#include <getopt.h>
static const struct option longopts[] = {
+ {"ignore-blanks", 0, 0, 'b'},
{"format", 1, 0, 'f'},
{"version", 0, 0, 'V'},
{"help", 0, 0, 'h'},
@@ -69,22 +70,24 @@ usage (char *program, int error)
{
FILE *file = error ? stderr : stdout;
#if HAVE_GETOPT_LONG
- fprintf (file, "usage: %s [-Vh] [-f FORMAT] [--format FORMAT] [--version] [--help] font-file...\n",
+ fprintf (file, "usage: %s [-Vbh] [-f FORMAT] [--ignore-blanks] [--format FORMAT] [--version] [--help] font-file...\n",
program);
#else
- fprintf (file, "usage: %s [-Vh] [-f FORMAT] font-file...\n",
+ fprintf (file, "usage: %s [-Vbh] [-f FORMAT] font-file...\n",
program);
#endif
fprintf (file, "Scan font files and directories, and print resulting pattern(s)\n");
fprintf (file, "\n");
#if HAVE_GETOPT_LONG
+ fprintf (file, " -b, --ignore-blanks ignore blanks to compute languages\n");
fprintf (file, " -f, --format=FORMAT use the given output format\n");
fprintf (file, " -V, --version display font config version and exit\n");
fprintf (file, " -h, --help display this help and exit\n");
#else
- fprintf (file, " -f FORMAT (format) use the given output format\n");
- fprintf (file, " -V (version) display font config version and exit\n");
- fprintf (file, " -h (help) display this help and exit\n");
+ fprintf (file, " -b (ignore-blanks) ignore blanks to compute languages\n");
+ fprintf (file, " -f FORMAT (format) use the given output format\n");
+ fprintf (file, " -V (version) display font config version and exit\n");
+ fprintf (file, " -h (help) display this help and exit\n");
#endif
exit (error);
}
@@ -94,17 +97,22 @@ main (int argc, char **argv)
{
FcChar8 *format = NULL;
int i;
+ int ignore_blanks = 0;
FcFontSet *fs;
+ FcBlanks *blanks = NULL;
#if HAVE_GETOPT_LONG || HAVE_GETOPT
int c;
#if HAVE_GETOPT_LONG
- while ((c = getopt_long (argc, argv, "f:Vh", longopts, NULL)) != -1)
+ while ((c = getopt_long (argc, argv, "bf:Vh", longopts, NULL)) != -1)
#else
- while ((c = getopt (argc, argv, "f:Vh")) != -1)
+ while ((c = getopt (argc, argv, "bf:Vh")) != -1)
#endif
{
switch (c) {
+ case 'b':
+ ignore_blanks = 1;
+ break;
case 'f':
format = (FcChar8 *) strdup (optarg);
break;
@@ -127,20 +135,22 @@ main (int argc, char **argv)
usage (argv[0], 1);
fs = FcFontSetCreate ();
+ if (!ignore_blanks)
+ blanks = FcConfigGetBlanks (NULL);
for (; i < argc; i++)
{
const FcChar8 *file = (FcChar8*) argv[i];
if (!FcFileIsDir (file))
- FcFileScan (fs, NULL, NULL, NULL, file, FcTrue);
+ FcFileScan (fs, NULL, NULL, blanks, file, FcTrue);
else
{
FcStrSet *dirs = FcStrSetCreate ();
FcStrList *strlist = FcStrListCreate (dirs);
do
{
- FcDirScan (fs, dirs, NULL, NULL, file, FcTrue);
+ FcDirScan (fs, dirs, NULL, blanks, file, FcTrue);
}
while ((file = FcStrListNext (strlist)));
FcStrListDone (strlist);
diff --git a/chromium/third_party/fontconfig/src/fc-scan/fc-scan.sgml b/chromium/third_party/fontconfig/src/fc-scan/fc-scan.sgml
index 9af403c1fde..65a66c4f364 100644
--- a/chromium/third_party/fontconfig/src/fc-scan/fc-scan.sgml
+++ b/chromium/third_party/fontconfig/src/fc-scan/fc-scan.sgml
@@ -62,9 +62,13 @@ manpage.1: manpage.sgml
<cmdsynopsis>
<command>&dhpackage;</command>
- <arg><option>-Vh</option></arg>
+ <arg><option>-Vbh</option></arg>
<sbr>
<group>
+ <arg><option>-b</option></arg>
+ <arg><option>--ignore-blanks</option></arg>
+ </group>
+ <group>
<arg><option>-f</option> <option><replaceable>format</replaceable></option></arg>
<arg><option>--format</option> <option><replaceable>format</replaceable></option></arg>
</group>
@@ -91,6 +95,14 @@ manpage.1: manpage.sgml
<variablelist>
<varlistentry>
+ <term><option>-b</option>
+ <option>--ignore-blanks</option>
+ </term>
+ <listitem>
+ <para>Ignore blanks to compute languages</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>-f</option>
<option>--format</option>
<option><replaceable>format</replaceable></option>
diff --git a/chromium/third_party/fontconfig/src/fontconfig.pc.in b/chromium/third_party/fontconfig/src/fontconfig.pc.in
index 6e112bb496e..fa00a72d7fd 100644
--- a/chromium/third_party/fontconfig/src/fontconfig.pc.in
+++ b/chromium/third_party/fontconfig/src/fontconfig.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
sysconfdir=@sysconfdir@
localstatedir=@localstatedir@
PACKAGE=@PACKAGE@
-confdir=@baseconfigdir@
+confdir=@BASECONFIGDIR@
cachedir=@fc_cachedir@
Name: Fontconfig
diff --git a/chromium/third_party/fontconfig/src/fontconfig/fcprivate.h b/chromium/third_party/fontconfig/src/fontconfig/fcprivate.h
index 210c1d8a371..a6ee5c23499 100644
--- a/chromium/third_party/fontconfig/src/fontconfig/fcprivate.h
+++ b/chromium/third_party/fontconfig/src/fontconfig/fcprivate.h
@@ -77,6 +77,9 @@
case FcTypeLangSet: \
__v__.u.l = va_arg (va, const FcLangSet *); \
break; \
+ case FcTypeRange: \
+ __v__.u.r = va_arg (va, const FcRange *); \
+ break; \
} \
if (!FcPatternAdd (__p__, __o__, __v__, FcTrue)) \
goto _FcPatternVapBuild_bail1; \
diff --git a/chromium/third_party/fontconfig/src/fontconfig/fontconfig.h b/chromium/third_party/fontconfig/src/fontconfig/fontconfig.h
index dfc48f9e337..5c72b227279 100644
--- a/chromium/third_party/fontconfig/src/fontconfig/fontconfig.h
+++ b/chromium/third_party/fontconfig/src/fontconfig/fontconfig.h
@@ -51,8 +51,8 @@ typedef int FcBool;
*/
#define FC_MAJOR 2
-#define FC_MINOR 11
-#define FC_REVISION 0
+#define FC_MINOR 12
+#define FC_REVISION 1
#define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
@@ -66,7 +66,10 @@ typedef int FcBool;
* it means multiple copies of the font information.
*/
-#define FC_CACHE_VERSION "4"
+#define FC_CACHE_VERSION_NUMBER 7
+#define _FC_STRINGIFY_(s) #s
+#define _FC_STRINGIFY(s) _FC_STRINGIFY_(s)
+#define FC_CACHE_VERSION _FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
#define FcTrue 1
#define FcFalse 0
@@ -75,7 +78,7 @@ typedef int FcBool;
#define FC_STYLE "style" /* String */
#define FC_SLANT "slant" /* Int */
#define FC_WEIGHT "weight" /* Int */
-#define FC_SIZE "size" /* Double */
+#define FC_SIZE "size" /* Range (double) */
#define FC_ASPECT "aspect" /* Double */
#define FC_PIXEL_SIZE "pixelsize" /* Double */
#define FC_SPACING "spacing" /* Int */
@@ -94,7 +97,9 @@ typedef int FcBool;
#define FC_RASTERIZER "rasterizer" /* String (deprecated) */
#define FC_OUTLINE "outline" /* Bool */
#define FC_SCALABLE "scalable" /* Bool */
-#define FC_SCALE "scale" /* double */
+#define FC_COLOR "color" /* Bool */
+#define FC_SCALE "scale" /* double (deprecated) */
+#define FC_SYMBOL "symbol" /* Bool */
#define FC_DPI "dpi" /* double */
#define FC_RGBA "rgba" /* Int */
#define FC_MINSPACE "minspace" /* Bool use minimum line spacing */
@@ -115,7 +120,7 @@ typedef int FcBool;
#define FC_FONT_FEATURES "fontfeatures" /* String */
#define FC_NAMELANG "namelang" /* String RFC 3866 langs */
#define FC_PRGNAME "prgname" /* String */
-#define FC_HASH "hash" /* String */
+#define FC_HASH "hash" /* String (deprecated) */
#define FC_POSTSCRIPT_NAME "postscriptname" /* String */
#define FC_CACHE_SUFFIX ".cache-" FC_CACHE_VERSION
@@ -131,6 +136,8 @@ typedef int FcBool;
#define FC_WEIGHT_EXTRALIGHT 40
#define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
#define FC_WEIGHT_LIGHT 50
+#define FC_WEIGHT_DEMILIGHT 55
+#define FC_WEIGHT_SEMILIGHT FC_WEIGHT_DEMILIGHT
#define FC_WEIGHT_BOOK 75
#define FC_WEIGHT_REGULAR 80
#define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
@@ -194,7 +201,8 @@ typedef enum _FcType {
FcTypeMatrix,
FcTypeCharSet,
FcTypeFTFace,
- FcTypeLangSet
+ FcTypeLangSet,
+ FcTypeRange
} FcType;
typedef struct _FcMatrix {
@@ -212,7 +220,7 @@ typedef struct _FcMatrix {
typedef struct _FcCharSet FcCharSet;
typedef struct _FcObjectType {
- const char *object;
+ char *object;
FcType type;
} FcObjectType;
@@ -231,6 +239,8 @@ typedef struct _FcPattern FcPattern;
typedef struct _FcLangSet FcLangSet;
+typedef struct _FcRange FcRange;
+
typedef struct _FcValue {
FcType type;
union {
@@ -242,6 +252,7 @@ typedef struct _FcValue {
const FcCharSet *c;
void *f;
const FcLangSet *l;
+ const FcRange *r;
} u;
} FcValue;
@@ -541,6 +552,9 @@ FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
FcPublic FcCache *
FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
+
+FcPublic FcCache *
+FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
FcPublic FcCache *
FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
@@ -850,6 +864,9 @@ FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
FcPublic FcBool
FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
+FcPublic FcBool
+FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);
+
FcPublic FcResult
FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
@@ -871,6 +888,9 @@ FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
FcPublic FcResult
FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
+FcPublic FcResult
+FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r);
+
FcPublic FcPattern *
FcPatternVaBuild (FcPattern *p, va_list va);
@@ -880,6 +900,30 @@ FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
FcPublic FcChar8 *
FcPatternFormat (FcPattern *pat, const FcChar8 *format);
+/* fcrange.c */
+FcPublic FcRange *
+FcRangeCreateDouble (double begin, double end);
+
+FcPublic FcRange *
+FcRangeCreateInteger (FcChar32 begin, FcChar32 end);
+
+FcPublic void
+FcRangeDestroy (FcRange *range);
+
+FcPublic FcRange *
+FcRangeCopy (const FcRange *r);
+
+FcPublic FcBool
+FcRangeGetDouble(const FcRange *range, double *begin, double *end);
+
+/* fcweight.c */
+
+FcPublic int
+FcWeightFromOpenType (int ot_weight);
+
+FcPublic int
+FcWeightToOpenType (int fc_weight);
+
/* fcstr.c */
FcPublic FcChar8 *
diff --git a/chromium/third_party/fontconfig/src/fonts.conf.in b/chromium/third_party/fontconfig/src/fonts.conf.in
index 6a8753d01b3..7c16a70747d 100644
--- a/chromium/third_party/fontconfig/src/fonts.conf.in
+++ b/chromium/third_party/fontconfig/src/fonts.conf.in
@@ -79,72 +79,6 @@
<config>
<!--
- These are the default Unicode chars that are expected to be blank
- in fonts. All other blank chars are assumed to be broken and
- won't appear in the resulting charsets
- -->
- <blank>
- <int>0x0020</int> <!-- SPACE -->
- <int>0x00A0</int> <!-- NO-BREAK SPACE -->
- <int>0x00AD</int> <!-- SOFT HYPHEN -->
- <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER -->
- <int>0x0600</int> <!-- ARABIC NUMBER SIGN -->
- <int>0x0601</int> <!-- ARABIC SIGN SANAH -->
- <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER -->
- <int>0x0603</int> <!-- ARABIC SIGN SAFHA -->
- <int>0x06DD</int> <!-- ARABIC END OF AYAH -->
- <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK -->
- <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER -->
- <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
- <int>0x1680</int> <!-- OGHAM SPACE MARK -->
- <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ -->
- <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA -->
- <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR -->
- <int>0x2000</int> <!-- EN QUAD -->
- <int>0x2001</int> <!-- EM QUAD -->
- <int>0x2002</int> <!-- EN SPACE -->
- <int>0x2003</int> <!-- EM SPACE -->
- <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
- <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
- <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
- <int>0x2007</int> <!-- FIGURE SPACE -->
- <int>0x2008</int> <!-- PUNCTUATION SPACE -->
- <int>0x2009</int> <!-- THIN SPACE -->
- <int>0x200A</int> <!-- HAIR SPACE -->
- <int>0x200B</int> <!-- ZERO WIDTH SPACE -->
- <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER -->
- <int>0x200D</int> <!-- ZERO WIDTH JOINER -->
- <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK -->
- <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK -->
- <int>0x2028</int> <!-- LINE SEPARATOR -->
- <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
- <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
- <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
- <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING -->
- <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
- <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
- <int>0x202F</int> <!-- NARROW NO-BREAK SPACE -->
- <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE -->
- <int>0x2060</int> <!-- WORD JOINER -->
- <int>0x2061</int> <!-- FUNCTION APPLICATION -->
- <int>0x2062</int> <!-- INVISIBLE TIMES -->
- <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
- <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
- <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
- <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
- <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
- <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
- <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
- <int>0x2800</int> <!-- BRAILLE PATTERN BLANK -->
- <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
- <int>0x3164</int> <!-- HANGUL FILLER -->
- <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
- <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER -->
- <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
- <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
- <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
- </blank>
-<!--
Rescan configuration every 30 seconds when FcFontSetList is called
-->
<rescan>
diff --git a/chromium/third_party/fontconfig/src/fonts.dtd b/chromium/third_party/fontconfig/src/fonts.dtd
index 4c38e77f08f..479f2c0fb84 100644
--- a/chromium/third_party/fontconfig/src/fonts.dtd
+++ b/chromium/third_party/fontconfig/src/fonts.dtd
@@ -140,7 +140,7 @@
if 'target' is 'font', execute the match on the result of a font
selection.
-->
-<!ELEMENT match (test*, edit*)+>
+<!ELEMENT match (test|edit)+>
<!ATTLIST match
target (pattern|font|scan) "pattern">
diff --git a/chromium/third_party/fontconfig/src/m4/ac_check_symbol.m4 b/chromium/third_party/fontconfig/src/m4/ac_check_symbol.m4
new file mode 100644
index 00000000000..41c15286a6f
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/m4/ac_check_symbol.m4
@@ -0,0 +1,48 @@
+dnl @synopsis AC_CHECK_SYMBOL(SYMBOL, HEADER... [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
+dnl
+dnl a wrapper around AC_EGREP_HEADER the shellvar $ac_found will hold
+dnl the HEADER-name that had been containing the symbol. This value is
+dnl shown to the user.
+dnl
+dnl @category C
+dnl @author Guido U. Draheim <guidod@gmx.de>
+dnl @version 2006-10-13
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_CHECK_SYMBOL],
+[AC_MSG_CHECKING([for $1 in $2])
+AC_CACHE_VAL(ac_cv_func_$1,
+[AC_REQUIRE_CPP()dnl
+changequote(, )dnl
+symbol="[^a-zA-Z_0-9]$1[^a-zA-Z_0-9]"
+changequote([, ])dnl
+ac_found=no
+for ac_header in $2 ; do
+ ac_safe=`echo "$ac_header" | sed 'y%./+-%__p_%' `
+ if test $ac_found != "yes" ; then
+ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ AC_EGREP_HEADER( $symbol, $ac_header, [ac_found="$ac_header"] )
+ fi
+ fi
+done
+if test "$ac_found" != "no" ; then
+ AC_MSG_RESULT($ac_found)
+ ifelse([$3], , :, [$3])
+else
+ AC_MSG_RESULT(no)
+ ifelse([$4], , , [$4
+])dnl
+fi
+])])
+
+dnl AC_CHECK_SYMBOLS( symbol..., header... [, action-if-found [, action-if-not-found]])
+AC_DEFUN([AC_CHECK_SYMBOLS],
+[for ac_func in $1
+do
+P4_CHECK_SYMBOL($ac_func, $2,
+[changequote(, )dnl
+ ac_tr_func=HAVE_`echo $ac_func | sed -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' -e 's:[[^A-Z0-9]]:_:'`
+changequote([, ])dnl
+ AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl
+done
+])
diff --git a/chromium/third_party/fontconfig/src/m4/ax_pthread.m4 b/chromium/third_party/fontconfig/src/m4/ax_pthread.m4
index d90de34d14b..e77541cea90 100644
--- a/chromium/third_party/fontconfig/src/m4/ax_pthread.m4
+++ b/chromium/third_party/fontconfig/src/m4/ax_pthread.m4
@@ -82,7 +82,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 18
+#serial 21
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
@@ -103,8 +103,8 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
- AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
- AC_MSG_RESULT($ax_pthread_ok)
+ AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
+ AC_MSG_RESULT([$ax_pthread_ok])
if test x"$ax_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
@@ -162,8 +162,27 @@ case ${host_os} in
darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
;;
+ netbsd*)
+ # use libc stubs, don't link against libpthread, to allow
+ # dynamic loading
+ ax_pthread_flags=""
+ ;;
esac
+# Clang doesn't consider unrecognized options an error unless we specify
+# -Werror. We throw in some extra Clang-specific options to ensure that
+# this doesn't happen for GCC, which also accepts -Werror.
+
+AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
+save_CFLAGS="$CFLAGS"
+ax_pthread_extra_flags="-Werror"
+CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
+ [AC_MSG_RESULT([yes])],
+ [ax_pthread_extra_flags=
+ AC_MSG_RESULT([no])])
+CFLAGS="$save_CFLAGS"
+
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
@@ -178,7 +197,7 @@ for flag in $ax_pthread_flags; do
;;
pthread-config)
- AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+ AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
if test x"$ax_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
@@ -193,7 +212,7 @@ for flag in $ax_pthread_flags; do
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
@@ -219,7 +238,7 @@ for flag in $ax_pthread_flags; do
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
- AC_MSG_RESULT($ax_pthread_ok)
+ AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = xyes; then
break;
fi
@@ -245,9 +264,9 @@ if test "x$ax_pthread_ok" = xyes; then
[attr_name=$attr; break],
[])
done
- AC_MSG_RESULT($attr_name)
+ AC_MSG_RESULT([$attr_name])
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
- AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+ AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
@@ -261,45 +280,54 @@ if test "x$ax_pthread_ok" = xyes; then
if test "$GCC" = "yes"; then
flag="-D_REENTRANT"
else
+ # TODO: What about Clang on Solaris?
flag="-mt -D_REENTRANT"
fi
;;
esac
- AC_MSG_RESULT(${flag})
+ AC_MSG_RESULT([$flag])
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
- ax_cv_PTHREAD_PRIO_INHERIT, [
- AC_LINK_IFELSE([
- AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
+ [ax_cv_PTHREAD_PRIO_INHERIT], [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+ [[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
- AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
+ [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
- # More AIX lossage: must compile with xlc_r or cc_r
- if test x"$GCC" != xyes; then
- AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
- else
- PTHREAD_CC=$CC
+ # More AIX lossage: compile with *_r variant
+ if test "x$GCC" != xyes; then
+ case $host_os in
+ aix*)
+ AS_CASE(["x/$CC"],
+ [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
+ [#handle absolute path differently from PATH based program lookup
+ AS_CASE(["x$CC"],
+ [x/*],
+ [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
+ [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
+ ;;
+ esac
fi
-else
- PTHREAD_CC="$CC"
fi
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_CC)
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$ax_pthread_ok" = xyes; then
- ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else
ax_pthread_ok=no
diff --git a/chromium/third_party/fontconfig/src/m4/pkg.m4 b/chromium/third_party/fontconfig/src/m4/pkg.m4
new file mode 100644
index 00000000000..c5b26b52e6c
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/m4/pkg.m4
@@ -0,0 +1,214 @@
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
diff --git a/chromium/third_party/fontconfig/src/new-version.sh b/chromium/third_party/fontconfig/src/new-version.sh
index 36e46f59350..eecfd81a028 100644
--- a/chromium/third_party/fontconfig/src/new-version.sh
+++ b/chromium/third_party/fontconfig/src/new-version.sh
@@ -1,4 +1,25 @@
#!/bin/sh
+# fontconfig/new-version.sh
+#
+# Copyright © 2000 Keith Packard
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of the author(s) not be used in
+# advertising or publicity pertaining to distribution of the software without
+# specific, written prior permission. The authors make no
+# representations about the suitability of this software for any purpose. It
+# is provided "as is" without express or implied warranty.
+#
+# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
if [ "x`git status -s -uno`" != "x" ]; then
echo 'Uncommited changes in repository' 1>&2
diff --git a/chromium/third_party/fontconfig/src/src/Makefile.am b/chromium/third_party/fontconfig/src/src/Makefile.am
index 066cc03e718..3757cf8f3e5 100644
--- a/chromium/third_party/fontconfig/src/src/Makefile.am
+++ b/chromium/third_party/fontconfig/src/src/Makefile.am
@@ -139,7 +139,6 @@ libfontconfig_la_SOURCES = \
fcformat.c \
fcfreetype.c \
fcfs.c \
- fchash.c \
fcinit.c \
fclang.c \
fclist.c \
@@ -151,9 +150,11 @@ libfontconfig_la_SOURCES = \
fcobjs.h \
fcobjshash.h \
fcpat.c \
+ fcrange.c \
fcserialize.c \
fcstat.c \
fcstr.c \
+ fcweight.c \
fcwindows.h \
fcxml.c \
ftglue.h \
diff --git a/chromium/third_party/fontconfig/src/src/fcarch.c b/chromium/third_party/fontconfig/src/src/fcarch.c
index 398f4bbfcd5..6ca15a991f7 100644
--- a/chromium/third_party/fontconfig/src/src/fcarch.c
+++ b/chromium/third_party/fontconfig/src/src/fcarch.c
@@ -21,10 +21,9 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdio.h>
-
#include "fcint.h"
#include "fcarch.h"
+#include <stdio.h>
FC_ASSERT_STATIC (1 == sizeof (char));
FC_ASSERT_STATIC (2 == sizeof (FcChar16));
@@ -49,7 +48,7 @@ FC_ASSERT_STATIC (0x08 + 1*FC_MAX(SIZEOF_VOID_P,ALIGNOF_DOUBLE) == sizeof (FcVal
FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt));
FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern));
FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet));
-FC_ASSERT_STATIC (0x08 + 6*SIZEOF_VOID_P == sizeof (FcCache));
+FC_ASSERT_STATIC (0x10 + 6*SIZEOF_VOID_P == sizeof (FcCache));
int
diff --git a/chromium/third_party/fontconfig/src/src/fcatomic.c b/chromium/third_party/fontconfig/src/src/fcatomic.c
index c1daed938e5..d12d32408d8 100644
--- a/chromium/third_party/fontconfig/src/src/fcatomic.c
+++ b/chromium/third_party/fontconfig/src/src/fcatomic.c
@@ -131,7 +131,7 @@ FcAtomicLock (FcAtomic *atomic)
return FcFalse;
}
ret = link ((char *) atomic->tmp, (char *) atomic->lck);
- if (ret < 0 && errno == EPERM)
+ if (ret < 0 && (errno == EPERM || errno == ENOTSUP || errno == EACCES))
{
/* the filesystem where atomic->lck points to may not supports
* the hard link. so better try to fallback
diff --git a/chromium/third_party/fontconfig/src/src/fcatomic.h b/chromium/third_party/fontconfig/src/src/fcatomic.h
index 362e52164b7..cc28a883c13 100644
--- a/chromium/third_party/fontconfig/src/src/fcatomic.h
+++ b/chromium/third_party/fontconfig/src/src/fcatomic.h
@@ -48,22 +48,22 @@
#include "fcwindows.h"
-/* mingw32 does not have MemoryBarrier.
- * MemoryBarrier may be defined as a macro or a function.
- * Just make a failsafe version for ourselves. */
-#ifdef MemoryBarrier
-#define HBMemoryBarrier MemoryBarrier
-#else
-static inline void HBMemoryBarrier (void) {
+/* MinGW has a convoluted history of supporting MemoryBarrier
+ * properly. As such, define a function to wrap the whole
+ * thing. */
+static inline void _FCMemoryBarrier (void) {
+#if !defined(MemoryBarrier)
long dummy = 0;
InterlockedExchange (&dummy, 1);
-}
+#else
+ MemoryBarrier ();
#endif
+}
typedef LONG fc_atomic_int_t;
#define fc_atomic_int_add(AI, V) InterlockedExchangeAdd (&(AI), (V))
-#define fc_atomic_ptr_get(P) (HBMemoryBarrier (), (void *) *(P))
+#define fc_atomic_ptr_get(P) (_FCMemoryBarrier (), (void *) *(P))
#define fc_atomic_ptr_cmpexch(P,O,N) (InterlockedCompareExchangePointer ((void **) (P), (void *) (N), (void *) (O)) == (void *) (O))
diff --git a/chromium/third_party/fontconfig/src/src/fcblanks.c b/chromium/third_party/fontconfig/src/src/fcblanks.c
index 46698bcdac3..5132a510f98 100644
--- a/chromium/third_party/fontconfig/src/src/fcblanks.c
+++ b/chromium/third_party/fontconfig/src/src/fcblanks.c
@@ -41,6 +41,8 @@ FcBlanksCreate (void)
void
FcBlanksDestroy (FcBlanks *b)
{
+ if (b->sblank == -1)
+ return;
if (b->blanks)
free (b->blanks);
free (b);
@@ -56,6 +58,11 @@ FcBlanksAdd (FcBlanks *b, FcChar32 ucs4)
if (b->blanks[sblank] == ucs4)
return FcTrue;
+ if (b->sblank == -1)
+ {
+ fprintf (stderr, "Unable to update the static FcBlanks: 0x%04x\n", ucs4);
+ return FcTrue;
+ }
if (b->nblank == b->sblank)
{
sblank = b->sblank + 32;
@@ -75,11 +82,25 @@ FcBlanksAdd (FcBlanks *b, FcChar32 ucs4)
FcBool
FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4)
{
- int i;
+ int lower = 0, higher = b->nblank, middle;
- for (i = 0; i < b->nblank; i++)
- if (b->blanks[i] == ucs4)
+ if (b->nblank == 0 ||
+ b->blanks[0] > ucs4 ||
+ b->blanks[b->nblank - 1] < ucs4)
+ return FcFalse;
+ while (1)
+ {
+ middle = (lower + higher) / 2;
+ if (b->blanks[middle] == ucs4)
return FcTrue;
+ if (lower >= higher)
+ break;
+ if (b->blanks[middle] < ucs4)
+ lower = middle + 1;
+ else
+ higher = middle - 1;
+ }
+
return FcFalse;
}
#define __fcblanks__
diff --git a/chromium/third_party/fontconfig/src/src/fccache.c b/chromium/third_party/fontconfig/src/src/fccache.c
index 3568595eda5..6f3c68a2f16 100644
--- a/chromium/third_party/fontconfig/src/src/fccache.c
+++ b/chromium/third_party/fontconfig/src/src/fccache.c
@@ -27,12 +27,17 @@
#include <fcntl.h>
#include <dirent.h>
#include <string.h>
+#include <limits.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <assert.h>
#if defined(HAVE_MMAP) || defined(__CYGWIN__)
# include <unistd.h>
# include <sys/mman.h>
#endif
+#if defined(_WIN32)
+#include <sys/locking.h>
+#endif
#ifndef O_BINARY
#define O_BINARY 0
@@ -176,19 +181,28 @@ FcDirCacheOpenFile (const FcChar8 *cache_file, struct stat *file_stat)
*/
static FcBool
FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
- FcBool (*callback) (int fd, struct stat *fd_stat,
+ FcBool (*callback) (FcConfig *config, int fd, struct stat *fd_stat,
struct stat *dir_stat, void *closure),
void *closure, FcChar8 **cache_file_ret)
{
int fd = -1;
FcChar8 cache_base[CACHEBASE_LEN];
FcStrList *list;
- FcChar8 *cache_dir;
+ FcChar8 *cache_dir, *d;
struct stat file_stat, dir_stat;
FcBool ret = FcFalse;
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
- if (FcStatChecksum (dir, &dir_stat) < 0)
+ if (sysroot)
+ d = FcStrBuildFilename (sysroot, dir, NULL);
+ else
+ d = FcStrdup (dir);
+ if (FcStatChecksum (d, &dir_stat) < 0)
+ {
+ FcStrFree (d);
return FcFalse;
+ }
+ FcStrFree (d);
FcDirCacheBasename (dir, cache_base);
@@ -198,7 +212,6 @@ FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
while ((cache_dir = FcStrListNext (list)))
{
- const FcChar8 *sysroot = FcConfigGetSysRoot (config);
FcChar8 *cache_hashed;
if (sysroot)
@@ -209,7 +222,7 @@ FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
break;
fd = FcDirCacheOpenFile (cache_hashed, &file_stat);
if (fd >= 0) {
- ret = (*callback) (fd, &file_stat, &dir_stat, closure);
+ ret = (*callback) (config, fd, &file_stat, &dir_stat, closure);
close (fd);
if (ret)
{
@@ -244,6 +257,7 @@ struct _FcCacheSkip {
dev_t cache_dev;
ino_t cache_ino;
time_t cache_mtime;
+ long cache_mtime_nano;
FcCacheSkip *next[1];
};
@@ -371,12 +385,18 @@ FcCacheInsert (FcCache *cache, struct stat *cache_stat)
s->cache_dev = cache_stat->st_dev;
s->cache_ino = cache_stat->st_ino;
s->cache_mtime = cache_stat->st_mtime;
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
+ s->cache_mtime_nano = cache_stat->st_mtim.tv_nsec;
+#else
+ s->cache_mtime_nano = 0;
+#endif
}
else
{
s->cache_dev = 0;
s->cache_ino = 0;
s->cache_mtime = 0;
+ s->cache_mtime_nano = 0;
}
/*
@@ -464,6 +484,10 @@ FcCacheFindByStat (struct stat *cache_stat)
s->cache_ino == cache_stat->st_ino &&
s->cache_mtime == cache_stat->st_mtime)
{
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
+ if (s->cache_mtime != cache_stat->st_mtim.tv_nsec)
+ continue;
+#endif
FcRefInc (&s->ref);
unlock_cache ();
return s->cache;
@@ -528,37 +552,141 @@ FcCacheFini (void)
}
static FcBool
-FcCacheTimeValid (FcCache *cache, struct stat *dir_stat)
+FcCacheTimeValid (FcConfig *config, FcCache *cache, struct stat *dir_stat)
{
struct stat dir_static;
+ FcBool fnano = FcTrue;
if (!dir_stat)
{
- if (FcStatChecksum (FcCacheDir (cache), &dir_static) < 0)
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
+ FcChar8 *d;
+
+ if (sysroot)
+ d = FcStrBuildFilename (sysroot, FcCacheDir (cache), NULL);
+ else
+ d = FcStrdup (FcCacheDir (cache));
+ if (FcStatChecksum (d, &dir_static) < 0)
+ {
+ FcStrFree (d);
return FcFalse;
+ }
+ FcStrFree (d);
dir_stat = &dir_static;
}
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
+ fnano = (cache->checksum_nano == dir_stat->st_mtim.tv_nsec);
+ if (FcDebug () & FC_DBG_CACHE)
+ printf ("FcCacheTimeValid dir \"%s\" cache checksum %d.%ld dir checksum %d.%ld\n",
+ FcCacheDir (cache), cache->checksum, (long)cache->checksum_nano, (int) dir_stat->st_mtime, dir_stat->st_mtim.tv_nsec);
+#else
if (FcDebug () & FC_DBG_CACHE)
printf ("FcCacheTimeValid dir \"%s\" cache checksum %d dir checksum %d\n",
FcCacheDir (cache), cache->checksum, (int) dir_stat->st_mtime);
- return cache->checksum == (int) dir_stat->st_mtime;
+#endif
+
+ return cache->checksum == (int) dir_stat->st_mtime && fnano;
+}
+
+static FcBool
+FcCacheOffsetsValid (FcCache *cache)
+{
+ char *base = (char *)cache;
+ char *end = base + cache->size;
+ intptr_t *dirs;
+ FcFontSet *fs;
+ int i, j;
+
+ if (cache->dir < 0 || cache->dir > cache->size - sizeof (intptr_t) ||
+ memchr (base + cache->dir, '\0', cache->size - cache->dir) == NULL)
+ return FcFalse;
+
+ if (cache->dirs < 0 || cache->dirs >= cache->size ||
+ cache->dirs_count < 0 ||
+ cache->dirs_count > (cache->size - cache->dirs) / sizeof (intptr_t))
+ return FcFalse;
+
+ dirs = FcCacheDirs (cache);
+ if (dirs)
+ {
+ for (i = 0; i < cache->dirs_count; i++)
+ {
+ FcChar8 *dir;
+
+ if (dirs[i] < 0 ||
+ dirs[i] > end - (char *) dirs - sizeof (intptr_t))
+ return FcFalse;
+
+ dir = FcOffsetToPtr (dirs, dirs[i], FcChar8);
+ if (memchr (dir, '\0', end - (char *) dir) == NULL)
+ return FcFalse;
+ }
+ }
+
+ if (cache->set < 0 || cache->set > cache->size - sizeof (FcFontSet))
+ return FcFalse;
+
+ fs = FcCacheSet (cache);
+ if (fs)
+ {
+ if (fs->nfont > (end - (char *) fs) / sizeof (FcPattern))
+ return FcFalse;
+
+ if (fs->fonts != 0 && !FcIsEncodedOffset(fs->fonts))
+ return FcFalse;
+
+ for (i = 0; i < fs->nfont; i++)
+ {
+ FcPattern *font = FcFontSetFont (fs, i);
+ FcPatternElt *e;
+ FcValueListPtr l;
+ char *last_offset;
+
+ if ((char *) font < base ||
+ (char *) font > end - sizeof (FcFontSet) ||
+ font->elts_offset < 0 ||
+ font->elts_offset > end - (char *) font ||
+ font->num > (end - (char *) font - font->elts_offset) / sizeof (FcPatternElt))
+ return FcFalse;
+
+
+ e = FcPatternElts(font);
+ if (e->values != 0 && !FcIsEncodedOffset(e->values))
+ return FcFalse;
+
+ for (j = 0; j < font->num; j++)
+ {
+ last_offset = (char *) font + font->elts_offset;
+ for (l = FcPatternEltValues(&e[j]); l; l = FcValueListNext(l))
+ {
+ if ((char *) l < last_offset || (char *) l > end - sizeof (*l) ||
+ (l->next != NULL && !FcIsEncodedOffset(l->next)))
+ return FcFalse;
+ last_offset = (char *) l + 1;
+ }
+ }
+ }
+ }
+
+ return FcTrue;
}
/*
* Map a cache file into memory
*/
static FcCache *
-FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
+FcDirCacheMapFd (FcConfig *config, int fd, struct stat *fd_stat, struct stat *dir_stat)
{
FcCache *cache;
FcBool allocated = FcFalse;
- if (fd_stat->st_size < (int) sizeof (FcCache))
+ if (fd_stat->st_size > INTPTR_MAX ||
+ fd_stat->st_size < (int) sizeof (FcCache))
return NULL;
cache = FcCacheFindByStat (fd_stat);
if (cache)
{
- if (FcCacheTimeValid (cache, dir_stat))
+ if (FcCacheTimeValid (config, cache, dir_stat))
return cache;
FcDirCacheUnload (cache);
cache = NULL;
@@ -572,7 +700,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
{
#if defined(HAVE_MMAP) || defined(__CYGWIN__)
cache = mmap (0, fd_stat->st_size, PROT_READ, MAP_SHARED, fd, 0);
-#ifdef HAVE_POSIX_FADVISE
+#if (HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED)
posix_fadvise (fd, 0, fd_stat->st_size, POSIX_FADV_WILLNEED);
#endif
if (cache == MAP_FAILED)
@@ -607,9 +735,10 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
allocated = FcTrue;
}
if (cache->magic != FC_CACHE_MAGIC_MMAP ||
- cache->version < FC_CACHE_CONTENT_VERSION ||
+ cache->version < FC_CACHE_VERSION_NUMBER ||
cache->size != (intptr_t) fd_stat->st_size ||
- !FcCacheTimeValid (cache, dir_stat) ||
+ !FcCacheOffsetsValid (cache) ||
+ !FcCacheTimeValid (config, cache, dir_stat) ||
!FcCacheInsert (cache, fd_stat))
{
if (allocated)
@@ -648,9 +777,9 @@ FcDirCacheUnload (FcCache *cache)
}
static FcBool
-FcDirCacheMapHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure)
+FcDirCacheMapHelper (FcConfig *config, int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure)
{
- FcCache *cache = FcDirCacheMapFd (fd, fd_stat, dir_stat);
+ FcCache *cache = FcDirCacheMapFd (config, fd, fd_stat, dir_stat);
if (!cache)
return FcFalse;
@@ -667,6 +796,7 @@ FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file)
FcDirCacheMapHelper,
&cache, cache_file))
return NULL;
+
return cache;
}
@@ -682,7 +812,7 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
fd = FcDirCacheOpenFile (cache_file, file_stat);
if (fd < 0)
return NULL;
- cache = FcDirCacheMapFd (fd, file_stat, NULL);
+ cache = FcDirCacheMapFd (FcConfigGetCurrent (), fd, file_stat, NULL);
close (fd);
return cache;
}
@@ -692,7 +822,7 @@ FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat)
* the magic number and the size field
*/
static FcBool
-FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure FC_UNUSED)
+FcDirCacheValidateHelper (FcConfig *config, int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure FC_UNUSED)
{
FcBool ret = FcTrue;
FcCache c;
@@ -701,12 +831,16 @@ FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, v
ret = FcFalse;
else if (c.magic != FC_CACHE_MAGIC_MMAP)
ret = FcFalse;
- else if (c.version < FC_CACHE_CONTENT_VERSION)
+ else if (c.version < FC_CACHE_VERSION_NUMBER)
ret = FcFalse;
else if (fd_stat->st_size != c.size)
ret = FcFalse;
else if (c.checksum != (int) dir_stat->st_mtime)
ret = FcFalse;
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
+ else if (c.checksum_nano != dir_stat->st_mtim.tv_nsec)
+ ret = FcFalse;
+#endif
return ret;
}
@@ -778,9 +912,12 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt
serialize->linear = cache;
cache->magic = FC_CACHE_MAGIC_ALLOC;
- cache->version = FC_CACHE_CONTENT_VERSION;
+ cache->version = FC_CACHE_VERSION_NUMBER;
cache->size = serialize->size;
cache->checksum = (int) dir_stat->st_mtime;
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
+ cache->checksum_nano = dir_stat->st_mtim.tv_nsec;
+#endif
/*
* Serialize directory name
@@ -827,6 +964,19 @@ bail1:
return NULL;
}
+FcCache *
+FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs)
+{
+ FcCache *new;
+ FcFontSet *set = FcFontSetDeserialize (FcCacheSet (cache));
+ const FcChar8 *dir = FcCacheDir (cache);
+
+ new = FcDirCacheBuild (set, dir, dir_stat, dirs);
+ FcFontSetDestroy (set);
+
+ return new;
+}
+
/* write serialized state to the cache file */
FcBool
FcDirCacheWrite (FcCache *cache, FcConfig *config)
@@ -955,6 +1105,11 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config)
skip->cache_dev = cache_stat.st_dev;
skip->cache_ino = cache_stat.st_ino;
skip->cache_mtime = cache_stat.st_mtime;
+#ifdef HAVE_STRUCT_STAT_ST_MTIM
+ skip->cache_mtime_nano = cache_stat.st_mtim.tv_nsec;
+#else
+ skip->cache_mtime_nano = 0;
+#endif
}
unlock_cache ();
}
@@ -1044,15 +1199,22 @@ FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose)
}
else
{
+ FcChar8 *s;
+
target_dir = FcCacheDir (cache);
- if (stat ((char *) target_dir, &target_stat) < 0)
+ if (sysroot)
+ s = FcStrBuildFilename (sysroot, target_dir, NULL);
+ else
+ s = FcStrdup (target_dir);
+ if (stat ((char *) s, &target_stat) < 0)
{
if (verbose || FcDebug () & FC_DBG_CACHE)
printf ("%s: %s: missing directory: %s \n",
- dir, ent->d_name, target_dir);
+ dir, ent->d_name, s);
remove = FcTrue;
}
FcDirCacheUnload (cache);
+ FcStrFree (s);
}
if (remove)
{
@@ -1072,6 +1234,82 @@ FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose)
return ret;
}
+int
+FcDirCacheLock (const FcChar8 *dir,
+ FcConfig *config)
+{
+ FcChar8 *cache_hashed = NULL;
+ FcChar8 cache_base[CACHEBASE_LEN];
+ FcStrList *list;
+ FcChar8 *cache_dir;
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
+ int fd = -1;
+
+ FcDirCacheBasename (dir, cache_base);
+ list = FcStrListCreate (config->cacheDirs);
+ if (!list)
+ return -1;
+
+ while ((cache_dir = FcStrListNext (list)))
+ {
+ if (sysroot)
+ cache_hashed = FcStrBuildFilename (sysroot, cache_dir, cache_base, NULL);
+ else
+ cache_hashed = FcStrBuildFilename (cache_dir, cache_base, NULL);
+ if (!cache_hashed)
+ break;
+ fd = FcOpen ((const char *)cache_hashed, O_RDWR);
+ FcStrFree (cache_hashed);
+ /* No caches in that directory. simply retry with another one */
+ if (fd != -1)
+ {
+#if defined(_WIN32)
+ if (_locking (fd, _LK_LOCK, 1) == -1)
+ goto bail;
+#else
+ struct flock fl;
+
+ fl.l_type = F_WRLCK;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0;
+ fl.l_pid = getpid ();
+ if (fcntl (fd, F_SETLKW, &fl) == -1)
+ goto bail;
+#endif
+ break;
+ }
+ }
+ FcStrListDone (list);
+ return fd;
+bail:
+ FcStrListDone (list);
+ if (fd != -1)
+ close (fd);
+ return -1;
+}
+
+void
+FcDirCacheUnlock (int fd)
+{
+ if (fd != -1)
+ {
+#if defined(_WIN32)
+ _locking (fd, _LK_UNLCK, 1);
+#else
+ struct flock fl;
+
+ fl.l_type = F_UNLCK;
+ fl.l_whence = SEEK_SET;
+ fl.l_start = 0;
+ fl.l_len = 0;
+ fl.l_pid = getpid ();
+ fcntl (fd, F_SETLK, &fl);
+#endif
+ close (fd);
+ }
+}
+
/*
* Hokey little macro trick to permit the definitions of C functions
* with the same name as CPP macros
diff --git a/chromium/third_party/fontconfig/src/src/fccfg.c b/chromium/third_party/fontconfig/src/src/fccfg.c
index 6377fd7c6b1..9f8ee7c7e6f 100644
--- a/chromium/third_party/fontconfig/src/src/fccfg.c
+++ b/chromium/third_party/fontconfig/src/src/fccfg.c
@@ -27,6 +27,7 @@
#include "fcint.h"
#include <dirent.h>
#include <sys/types.h>
+#include "../fc-blanks/fcblanks.h"
#if defined (_WIN32) && !defined (R_OK)
#define R_OK 4
@@ -109,7 +110,7 @@ FcConfigCreate (void)
if (!config->cacheDirs)
goto bail8;
- config->blanks = 0;
+ config->blanks = &fcBlanks;
config->substPattern = 0;
config->substFont = 0;
@@ -375,7 +376,7 @@ FcConfigAddDirList (FcConfig *config, FcSetName set, FcStrSet *dirSet)
while ((dir = FcStrListNext (dirlist)))
{
if (FcDebug () & FC_DBG_FONTSET)
- printf ("adding fonts from%s\n", dir);
+ printf ("adding fonts from %s\n", dir);
cache = FcDirCacheRead (dir, FcFalse, config);
if (!cache)
continue;
@@ -434,6 +435,7 @@ retry:
if (!fc_atomic_ptr_cmpexch (&_fcConfig, cfg, config))
goto retry;
+ FcConfigReference (config);
if (cfg)
FcConfigDestroy (cfg);
@@ -722,6 +724,21 @@ FcConfigPromote (FcValue v, FcValue u, FcValuePromotionBuffer *buf)
v.u.l = FcLangSetPromote (v.u.s, buf);
v.type = FcTypeLangSet;
}
+ else if (v.type == FcTypeVoid && u.type == FcTypeLangSet)
+ {
+ v.u.l = FcLangSetPromote (NULL, buf);
+ v.type = FcTypeLangSet;
+ }
+ else if (v.type == FcTypeVoid && u.type == FcTypeCharSet)
+ {
+ v.u.c = FcCharSetPromote (buf);
+ v.type = FcTypeCharSet;
+ }
+ if (buf && v.type == FcTypeDouble && u.type == FcTypeRange)
+ {
+ v.u.r = FcRangePromote (v.u.d, buf);
+ v.type = FcTypeRange;
+ }
return v;
}
@@ -894,6 +911,9 @@ FcConfigCompareValue (const FcValue *left_o,
break;
}
break;
+ case FcTypeRange:
+ ret = FcRangeCompare (op, left.u.r, right.u.r);
+ break;
}
}
else
@@ -915,10 +935,11 @@ FcConfigCompareValue (const FcValue *left_o,
static FcValue
FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
{
- FcValue v, vl, vr;
+ FcValue v, vl, vr, vle, vre;
FcMatrix *m;
FcChar8 *str;
FcOp op = FC_OP_GET_OP (e->op);
+ FcValuePromotionBuffer buf1, buf2;
switch ((int) op) {
case FcOpInteger:
@@ -967,6 +988,11 @@ FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
v.u.l = e->u.lval;
v = FcValueSave (v);
break;
+ case FcOpRange:
+ v.type = FcTypeRange;
+ v.u.r = e->u.rval;
+ v = FcValueSave (v);
+ break;
case FcOpBool:
v.type = FcTypeBool;
v.u.b = e->u.bval;
@@ -1033,28 +1059,28 @@ FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
case FcOpDivide:
vl = FcConfigEvaluate (p, p_pat, kind, e->u.tree.left);
vr = FcConfigEvaluate (p, p_pat, kind, e->u.tree.right);
- vl = FcConfigPromote (vl, vr, NULL);
- vr = FcConfigPromote (vr, vl, NULL);
- if (vl.type == vr.type)
+ vle = FcConfigPromote (vl, vr, &buf1);
+ vre = FcConfigPromote (vr, vle, &buf2);
+ if (vle.type == vre.type)
{
- switch ((int) vl.type) {
+ switch ((int) vle.type) {
case FcTypeDouble:
switch ((int) op) {
case FcOpPlus:
v.type = FcTypeDouble;
- v.u.d = vl.u.d + vr.u.d;
+ v.u.d = vle.u.d + vre.u.d;
break;
case FcOpMinus:
v.type = FcTypeDouble;
- v.u.d = vl.u.d - vr.u.d;
+ v.u.d = vle.u.d - vre.u.d;
break;
case FcOpTimes:
v.type = FcTypeDouble;
- v.u.d = vl.u.d * vr.u.d;
+ v.u.d = vle.u.d * vre.u.d;
break;
case FcOpDivide:
v.type = FcTypeDouble;
- v.u.d = vl.u.d / vr.u.d;
+ v.u.d = vle.u.d / vre.u.d;
break;
default:
v.type = FcTypeVoid;
@@ -1071,11 +1097,11 @@ FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
switch ((int) op) {
case FcOpOr:
v.type = FcTypeBool;
- v.u.b = vl.u.b || vr.u.b;
+ v.u.b = vle.u.b || vre.u.b;
break;
case FcOpAnd:
v.type = FcTypeBool;
- v.u.b = vl.u.b && vr.u.b;
+ v.u.b = vle.u.b && vre.u.b;
break;
default:
v.type = FcTypeVoid;
@@ -1086,7 +1112,7 @@ FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
switch ((int) op) {
case FcOpPlus:
v.type = FcTypeString;
- str = FcStrPlus (vl.u.s, vr.u.s);
+ str = FcStrPlus (vle.u.s, vre.u.s);
v.u.s = FcStrdup (str);
FcStrFree (str);
@@ -1105,7 +1131,7 @@ FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
m = malloc (sizeof (FcMatrix));
if (m)
{
- FcMatrixMultiply (m, vl.u.m, vr.u.m);
+ FcMatrixMultiply (m, vle.u.m, vre.u.m);
v.u.m = m;
}
else
@@ -1122,13 +1148,13 @@ FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
switch ((int) op) {
case FcOpPlus:
v.type = FcTypeCharSet;
- v.u.c = FcCharSetUnion (vl.u.c, vr.u.c);
+ v.u.c = FcCharSetUnion (vle.u.c, vre.u.c);
if (!v.u.c)
v.type = FcTypeVoid;
break;
case FcOpMinus:
v.type = FcTypeCharSet;
- v.u.c = FcCharSetSubtract (vl.u.c, vr.u.c);
+ v.u.c = FcCharSetSubtract (vle.u.c, vre.u.c);
if (!v.u.c)
v.type = FcTypeVoid;
break;
@@ -1141,13 +1167,13 @@ FcConfigEvaluate (FcPattern *p, FcPattern *p_pat, FcMatchKind kind, FcExpr *e)
switch ((int) op) {
case FcOpPlus:
v.type = FcTypeLangSet;
- v.u.l = FcLangSetUnion (vl.u.l, vr.u.l);
+ v.u.l = FcLangSetUnion (vle.u.l, vre.u.l);
if (!v.u.l)
v.type = FcTypeVoid;
break;
case FcOpMinus:
v.type = FcTypeLangSet;
- v.u.l = FcLangSetSubtract (vl.u.l, vr.u.l);
+ v.u.l = FcLangSetSubtract (vle.u.l, vre.u.l);
if (!v.u.l)
v.type = FcTypeVoid;
break;
@@ -1518,15 +1544,52 @@ FcConfigSubstituteWithPat (FcConfig *config,
FcStrList *l = FcStrListCreate (strs);
FcChar8 *lang;
FcValue v;
+ FcLangSet *lsund = FcLangSetCreate ();
+ FcLangSetAdd (lsund, (const FcChar8 *)"und");
FcStrSetDestroy (strs);
while (l && (lang = FcStrListNext (l)))
{
+ FcPatternElt *e = FcPatternObjectFindElt (p, FC_LANG_OBJECT);
+
+ if (e)
+ {
+ FcValueListPtr ll;
+
+ for (ll = FcPatternEltValues (e); ll; ll = FcValueListNext (ll))
+ {
+ FcValue vv = FcValueCanonicalize (&ll->value);
+
+ if (vv.type == FcTypeLangSet)
+ {
+ FcLangSet *ls = FcLangSetCreate ();
+ FcBool b;
+
+ FcLangSetAdd (ls, lang);
+ b = FcLangSetContains (vv.u.l, ls);
+ FcLangSetDestroy (ls);
+ if (b)
+ goto bail_lang;
+ if (FcLangSetContains (vv.u.l, lsund))
+ goto bail_lang;
+ }
+ else
+ {
+ if (FcStrCmpIgnoreCase (vv.u.s, lang) == 0)
+ goto bail_lang;
+ if (FcStrCmpIgnoreCase (vv.u.s, (const FcChar8 *)"und") == 0)
+ goto bail_lang;
+ }
+ }
+ }
v.type = FcTypeString;
v.u.s = lang;
+
FcPatternObjectAddWithBinding (p, FC_LANG_OBJECT, v, FcValueBindingWeak, FcTrue);
}
+ bail_lang:
FcStrListDone (l);
+ FcLangSetDestroy (lsund);
}
if (FcPatternObjectGet (p, FC_PRGNAME_OBJECT, 0, &v) == FcResultNoMatch)
{
@@ -1778,6 +1841,7 @@ FcConfigSubstitute (FcConfig *config,
#if defined (_WIN32)
static FcChar8 fontconfig_path[1000] = ""; /* MT-dontcare */
+FcChar8 fontconfig_instprefix[1000] = ""; /* MT-dontcare */
# if (defined (PIC) || defined (DLL_EXPORT))
@@ -1812,6 +1876,7 @@ DllMain (HINSTANCE hinstDLL,
if (p && (FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "bin") == 0 ||
FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "lib") == 0))
*p = '\0';
+ strcat ((char *) fontconfig_instprefix, (char *) fontconfig_path);
strcat ((char *) fontconfig_path, "\\etc\\fonts");
}
else
@@ -1985,6 +2050,8 @@ FcConfigXdgCacheHome (void)
const char *env = getenv ("XDG_CACHE_HOME");
FcChar8 *ret = NULL;
+ if (!_FcConfigHomeEnabled)
+ return NULL;
if (env)
ret = FcStrCopy ((const FcChar8 *)env);
else
@@ -2010,6 +2077,8 @@ FcConfigXdgConfigHome (void)
const char *env = getenv ("XDG_CONFIG_HOME");
FcChar8 *ret = NULL;
+ if (!_FcConfigHomeEnabled)
+ return NULL;
if (env)
ret = FcStrCopy ((const FcChar8 *)env);
else
@@ -2035,6 +2104,8 @@ FcConfigXdgDataHome (void)
const char *env = getenv ("XDG_DATA_HOME");
FcChar8 *ret = NULL;
+ if (!_FcConfigHomeEnabled)
+ return NULL;
if (env)
ret = FcStrCopy ((const FcChar8 *)env);
else
@@ -2134,7 +2205,7 @@ FcConfigAppFontAddFile (FcConfig *config,
return FcFalse;
}
- subdirs = FcStrSetCreate ();
+ subdirs = FcStrSetCreateEx (FCSS_GROW_BY_64);
if (!subdirs)
return FcFalse;
@@ -2181,7 +2252,7 @@ FcConfigAppFontAddDir (FcConfig *config,
return FcFalse;
}
- dirs = FcStrSetCreate ();
+ dirs = FcStrSetCreateEx (FCSS_GROW_BY_64);
if (!dirs)
return FcFalse;
@@ -2312,7 +2383,7 @@ void
FcConfigSetSysRoot (FcConfig *config,
const FcChar8 *sysroot)
{
- FcChar8 *s;
+ FcChar8 *s = NULL;
FcBool init = FcFalse;
if (!config)
@@ -2332,9 +2403,12 @@ FcConfigSetSysRoot (FcConfig *config,
}
}
- s = FcStrCopyFilename (sysroot);
- if (!s)
- return;
+ if (sysroot)
+ {
+ s = FcStrCopyFilename (sysroot);
+ if (!s)
+ return;
+ }
if (config->sysRoot)
FcStrFree (config->sysRoot);
@@ -2344,6 +2418,10 @@ FcConfigSetSysRoot (FcConfig *config,
{
config = FcInitLoadOwnConfigAndFonts (config);
FcConfigSetCurrent (config);
+ /* FcConfigSetCurrent() increases the refcount.
+ * decrease it here to avoid the memory leak.
+ */
+ FcConfigDestroy (config);
}
}
diff --git a/chromium/third_party/fontconfig/src/src/fccharset.c b/chromium/third_party/fontconfig/src/src/fccharset.c
index c9f928cd480..3f1789230e6 100644
--- a/chromium/third_party/fontconfig/src/src/fccharset.c
+++ b/chromium/third_party/fontconfig/src/src/fccharset.c
@@ -43,6 +43,21 @@ FcCharSetCreate (void)
}
FcCharSet *
+FcCharSetPromote (FcValuePromotionBuffer *vbuf)
+{
+ FcCharSet *fcs = (FcCharSet *) vbuf;
+
+ FC_ASSERT_STATIC (sizeof (FcCharSet) <= sizeof (FcValuePromotionBuffer));
+
+ FcRefSetConst (&fcs->ref);
+ fcs->num = 0;
+ fcs->leaves_offset = 0;
+ fcs->numbers_offset = 0;
+
+ return fcs;
+}
+
+FcCharSet *
FcCharSetNew (void)
{
return FcCharSetCreate ();
@@ -149,6 +164,14 @@ FcCharSetPutLeaf (FcCharSet *fcs,
unsigned int alloced = 8;
leaves = malloc (alloced * sizeof (*leaves));
numbers = malloc (alloced * sizeof (*numbers));
+ if (!leaves || !numbers)
+ {
+ if (leaves)
+ free (leaves);
+ if (numbers)
+ free (numbers);
+ return FcFalse;
+ }
}
else
{
@@ -157,8 +180,19 @@ FcCharSetPutLeaf (FcCharSet *fcs,
alloced *= 2;
new_leaves = realloc (leaves, alloced * sizeof (*leaves));
+ if (!new_leaves)
+ return FcFalse;
numbers = realloc (numbers, alloced * sizeof (*numbers));
-
+ if (!numbers)
+ {
+ /* Revert the reallocation of leaves */
+ leaves = realloc (new_leaves, (alloced / 2) * sizeof (*new_leaves));
+ /* unlikely to fail though */
+ if (!leaves)
+ return FcFalse;
+ fcs->leaves_offset = FcPtrToOffset (fcs, leaves);
+ return FcFalse;
+ }
distance = (intptr_t) new_leaves - (intptr_t) leaves;
if (new_leaves && distance)
{
@@ -169,9 +203,6 @@ FcCharSetPutLeaf (FcCharSet *fcs,
leaves = new_leaves;
}
- if (!leaves || !numbers)
- return FcFalse;
-
fcs->leaves_offset = FcPtrToOffset (fcs, leaves);
fcs->numbers_offset = FcPtrToOffset (fcs, numbers);
}
@@ -800,188 +831,123 @@ FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result)
return page;
}
-/*
- * ASCII representation of charsets.
- *
- * Each leaf is represented as 9 32-bit values, the code of the first character followed
- * by 8 32 bit values for the leaf itself. Each value is encoded as 5 ASCII characters,
- * only 85 different values are used to avoid control characters as well as the other
- * characters used to encode font names. 85**5 > 2^32 so things work out, but
- * it's not exactly human readable output. As a special case, 0 is encoded as a space
- */
-
-static const unsigned char charToValue[256] = {
- /* "" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\b" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\020" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\030" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* " " */ 0xff, 0x00, 0xff, 0x01, 0x02, 0x03, 0x04, 0xff,
- /* "(" */ 0x05, 0x06, 0x07, 0x08, 0xff, 0xff, 0x09, 0x0a,
- /* "0" */ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12,
- /* "8" */ 0x13, 0x14, 0xff, 0x15, 0x16, 0xff, 0x17, 0x18,
- /* "@" */ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
- /* "H" */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
- /* "P" */ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
- /* "X" */ 0x31, 0x32, 0x33, 0x34, 0xff, 0x35, 0x36, 0xff,
- /* "`" */ 0xff, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d,
- /* "h" */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
- /* "p" */ 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
- /* "x" */ 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0xff,
- /* "\200" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\210" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\220" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\230" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\240" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\250" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\260" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\270" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\300" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\310" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\320" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\330" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\340" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\350" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\360" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- /* "\370" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
-};
-
-static const FcChar8 valueToChar[0x55] = {
- /* 0x00 */ '!', '#', '$', '%', '&', '(', ')', '*',
- /* 0x08 */ '+', '.', '/', '0', '1', '2', '3', '4',
- /* 0x10 */ '5', '6', '7', '8', '9', ';', '<', '>',
- /* 0x18 */ '?', '@', 'A', 'B', 'C', 'D', 'E', 'F',
- /* 0x20 */ 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
- /* 0x28 */ 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
- /* 0x30 */ 'W', 'X', 'Y', 'Z', '[', ']', '^', 'a',
- /* 0x38 */ 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
- /* 0x40 */ 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
- /* 0x48 */ 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
- /* 0x50 */ 'z', '{', '|', '}', '~',
-};
-
-static FcChar8 *
-FcCharSetParseValue (FcChar8 *string, FcChar32 *value)
-{
- int i;
- FcChar32 v;
- FcChar32 c;
-
- if (*string == ' ')
- {
- v = 0;
- string++;
- }
- else
- {
- v = 0;
- for (i = 0; i < 5; i++)
- {
- if (!(c = (FcChar32) (unsigned char) *string++))
- return 0;
- c = charToValue[c];
- if (c == 0xff)
- return 0;
- v = v * 85 + c;
- }
- }
- *value = v;
- return string;
-}
-
static FcBool
-FcCharSetUnparseValue (FcStrBuf *buf, FcChar32 value)
+FcNameParseRange (FcChar8 **string, FcChar32 *pfirst, FcChar32 *plast)
{
- int i;
- if (value == 0)
- {
- return FcStrBufChar (buf, ' ');
- }
- else
- {
- FcChar8 string[6];
- FcChar8 *s = string + 5;
- string[5] = '\0';
- for (i = 0; i < 5; i++)
+ char *s = (char *) *string;
+ char *t;
+ long first, last;
+
+ while (isspace(*s))
+ s++;
+ t = s;
+ errno = 0;
+ first = last = strtol (s, &s, 16);
+ if (errno)
+ return FcFalse;
+ while (isspace(*s))
+ s++;
+ if (*s == '-')
{
- *--s = valueToChar[value % 85];
- value /= 85;
- }
- for (i = 0; i < 5; i++)
- if (!FcStrBufChar (buf, *s++))
+ s++;
+ errno = 0;
+ last = strtol (s, &s, 16);
+ if (errno)
return FcFalse;
- }
- return FcTrue;
+ }
+
+ if (s == t || first < 0 || last < 0 || last < first || last > 0x10ffff)
+ return FcFalse;
+
+ *string = (FcChar8 *) s;
+ *pfirst = first;
+ *plast = last;
+ return FcTrue;
}
FcCharSet *
FcNameParseCharSet (FcChar8 *string)
{
FcCharSet *c;
- FcChar32 ucs4;
- FcCharLeaf *leaf;
- FcCharLeaf temp;
- FcChar32 bits;
- int i;
+ FcChar32 first, last;
c = FcCharSetCreate ();
if (!c)
goto bail0;
while (*string)
{
- string = FcCharSetParseValue (string, &ucs4);
- if (!string)
- goto bail1;
- bits = 0;
- for (i = 0; i < 256/32; i++)
- {
- string = FcCharSetParseValue (string, &temp.map[i]);
- if (!string)
- goto bail1;
- bits |= temp.map[i];
- }
- if (bits)
- {
- leaf = malloc (sizeof (FcCharLeaf));
- if (!leaf)
- goto bail1;
- *leaf = temp;
- if (!FcCharSetInsertLeaf (c, ucs4, leaf))
+ FcChar32 u;
+
+ if (!FcNameParseRange (&string, &first, &last))
goto bail1;
- }
+
+ for (u = first; u < last + 1; u++)
+ FcCharSetAddChar (c, u);
}
return c;
bail1:
- if (c->num)
- {
- free (FcCharSetLeaves (c));
- }
- if (c->num)
- {
- free (FcCharSetNumbers (c));
- }
- free (c);
+ FcCharSetDestroy (c);
bail0:
return NULL;
}
+static void
+FcNameUnparseUnicode (FcStrBuf *buf, FcChar32 u)
+{
+ FcChar8 buf_static[64];
+ snprintf ((char *) buf_static, sizeof (buf_static), "%x", u);
+ FcStrBufString (buf, buf_static);
+}
+
FcBool
FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c)
{
FcCharSetIter ci;
+ FcChar32 first, last;
int i;
#ifdef CHECK
int len = buf->len;
#endif
+ first = last = 0x7FFFFFFF;
+
for (FcCharSetIterStart (c, &ci);
ci.leaf;
FcCharSetIterNext (c, &ci))
{
- if (!FcCharSetUnparseValue (buf, ci.ucs4))
- return FcFalse;
for (i = 0; i < 256/32; i++)
- if (!FcCharSetUnparseValue (buf, ci.leaf->map[i]))
- return FcFalse;
+ {
+ FcChar32 bits = ci.leaf->map[i];
+ FcChar32 u = ci.ucs4 + i * 32;
+
+ while (bits)
+ {
+ if (bits & 1)
+ {
+ if (u != last + 1)
+ {
+ if (last != first)
+ {
+ FcStrBufChar (buf, '-');
+ FcNameUnparseUnicode (buf, last);
+ }
+ if (last != 0x7FFFFFFF)
+ FcStrBufChar (buf, ' ');
+ /* Start new range. */
+ first = u;
+ FcNameUnparseUnicode (buf, u);
+ }
+ last = u;
+ }
+ bits >>= 1;
+ u++;
+ }
+ }
+ }
+ if (last != first)
+ {
+ FcStrBufChar (buf, '-');
+ FcNameUnparseUnicode (buf, last);
}
#ifdef CHECK
{
diff --git a/chromium/third_party/fontconfig/src/src/fccompat.c b/chromium/third_party/fontconfig/src/src/fccompat.c
index 1c2ba8bedde..31d80bef162 100644
--- a/chromium/third_party/fontconfig/src/src/fccompat.c
+++ b/chromium/third_party/fontconfig/src/src/fccompat.c
@@ -170,14 +170,27 @@ FcRandom(void)
static struct random_data fcrandbuf;
static char statebuf[256];
static FcBool initialized = FcFalse;
+#ifdef _AIX
+ static char *retval;
+ long res;
+#endif
if (initialized != FcTrue)
{
- initstate_r(time(NULL), statebuf, 256, &fcrandbuf);
+#ifdef _AIX
+ initstate_r (time (NULL), statebuf, 256, &retval, &fcrandbuf);
+#else
+ initstate_r (time (NULL), statebuf, 256, &fcrandbuf);
+#endif
initialized = FcTrue;
}
- random_r(&fcrandbuf, &result);
+#ifdef _AIX
+ random_r (&res, &fcrandbuf);
+ result = (int32_t)res;
+#else
+ random_r (&fcrandbuf, &result);
+#endif
#elif HAVE_RANDOM
static char statebuf[256];
char *state;
@@ -185,30 +198,30 @@ FcRandom(void)
if (initialized != FcTrue)
{
- state = initstate(time(NULL), statebuf, 256);
+ state = initstate (time (NULL), statebuf, 256);
initialized = FcTrue;
}
else
- state = setstate(statebuf);
+ state = setstate (statebuf);
- result = random();
+ result = random ();
- setstate(state);
+ setstate (state);
#elif HAVE_LRAND48
- result = lrand48();
+ result = lrand48 ();
#elif HAVE_RAND_R
- static unsigned int seed = time(NULL);
+ static unsigned int seed = time (NULL);
- result = rand_r(&seed);
+ result = rand_r (&seed);
#elif HAVE_RAND
static FcBool initialized = FcFalse;
if (initialized != FcTrue)
{
- srand(time(NULL));
+ srand (time (NULL));
initialized = FcTrue;
}
- result = rand();
+ result = rand ();
#else
# error no random number generator function available.
#endif
@@ -242,3 +255,7 @@ FcMakeDirectory (const FcChar8 *dir)
FcStrFree (parent);
return ret;
}
+
+#define __fccompat__
+#include "fcaliastail.h"
+#undef __fccompat__
diff --git a/chromium/third_party/fontconfig/src/src/fcdbg.c b/chromium/third_party/fontconfig/src/src/fcdbg.c
index d74bc276940..c2853fff376 100644
--- a/chromium/third_party/fontconfig/src/src/fcdbg.c
+++ b/chromium/third_party/fontconfig/src/src/fcdbg.c
@@ -61,6 +61,9 @@ _FcValuePrintFile (FILE *f, const FcValue v)
case FcTypeFTFace:
fprintf (f, "face");
break;
+ case FcTypeRange:
+ fprintf (f, "[%g %g)", v.u.r->begin, v.u.r->end);
+ break;
}
}
@@ -208,6 +211,84 @@ FcPatternPrint (const FcPattern *p)
}
void
+FcPatternPrint2 (FcPattern *pp1,
+ FcPattern *pp2,
+ const FcObjectSet *os)
+{
+ int i, j, k, pos;
+ FcPatternElt *e1, *e2;
+ FcPattern *p1, *p2;
+
+ if (os)
+ {
+ p1 = FcPatternFilter (pp1, os);
+ p2 = FcPatternFilter (pp2, os);
+ }
+ else
+ {
+ p1 = pp1;
+ p2 = pp2;
+ }
+ printf ("Pattern has %d elts (size %d), %d elts (size %d)\n",
+ p1->num, p1->size, p2->num, p2->size);
+ for (i = 0, j = 0; i < p1->num; i++)
+ {
+ e1 = &FcPatternElts(p1)[i];
+ e2 = &FcPatternElts(p2)[j];
+ if (!e2 || e1->object != e2->object)
+ {
+ pos = FcPatternPosition (p2, FcObjectName (e1->object));
+ if (pos >= 0)
+ {
+ for (k = j; k < pos; k++)
+ {
+ e2 = &FcPatternElts(p2)[k];
+ printf ("\t%s: (None) -> ", FcObjectName (e2->object));
+ FcValueListPrint (FcPatternEltValues (e2));
+ printf ("\n");
+ }
+ j = pos;
+ goto cont;
+ }
+ else
+ {
+ printf ("\t%s:", FcObjectName (e1->object));
+ FcValueListPrint (FcPatternEltValues (e1));
+ printf (" -> (None)\n");
+ }
+ }
+ else
+ {
+ cont:
+ printf ("\t%s:", FcObjectName (e1->object));
+ FcValueListPrint (FcPatternEltValues (e1));
+ printf (" -> ");
+ e2 = &FcPatternElts(p2)[j];
+ FcValueListPrint (FcPatternEltValues (e2));
+ printf ("\n");
+ j++;
+ }
+ }
+ if (j < p2->num)
+ {
+ for (k = j; k < p2->num; k++)
+ {
+ e2 = &FcPatternElts(p2)[k];
+ if (FcObjectName (e2->object))
+ {
+ printf ("\t%s: (None) -> ", FcObjectName (e2->object));
+ FcValueListPrint (FcPatternEltValues (e2));
+ printf ("\n");
+ }
+ }
+ }
+ if (p1 != pp1)
+ FcPatternDestroy (p1);
+ if (p2 != pp2)
+ FcPatternDestroy (p2);
+}
+
+void
FcOpPrint (FcOp op_)
{
FcOp op = FC_OP_GET_OP (op_);
@@ -277,7 +358,9 @@ FcExprPrint (const FcExpr *expr)
FcExprPrint (expr->u.mexpr->yy);
printf ("]");
break;
- case FcOpRange: break;
+ case FcOpRange:
+ printf ("(%g, %g)", expr->u.rval->begin, expr->u.rval->end);
+ break;
case FcOpBool: printf ("%s", expr->u.bval ? "true" : "false"); break;
case FcOpCharSet: printf ("charset\n"); break;
case FcOpLangSet:
diff --git a/chromium/third_party/fontconfig/src/src/fcdefault.c b/chromium/third_party/fontconfig/src/src/fcdefault.c
index d1b917fd9de..6647a8fe81c 100644
--- a/chromium/third_party/fontconfig/src/src/fcdefault.c
+++ b/chromium/third_party/fontconfig/src/src/fcdefault.c
@@ -38,6 +38,7 @@ static const struct {
{ FC_GLOBAL_ADVANCE_OBJECT, FcTrue }, /* !FC_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
{ FC_EMBEDDED_BITMAP_OBJECT, FcTrue }, /* !FC_LOAD_NO_BITMAP */
{ FC_DECORATIVE_OBJECT, FcFalse },
+ { FC_SYMBOL_OBJECT, FcFalse },
};
#define NUM_FC_BOOL_DEFAULTS (int) (sizeof FcBoolDefaults / sizeof FcBoolDefaults[0])
@@ -94,7 +95,6 @@ retry:
{
FcStrSet *langs = FcGetDefaultLangs ();
lang = FcStrdup (langs->strs[0]);
- FcStrSetDestroy (langs);
if (!fc_atomic_ptr_cmpexch (&default_lang, NULL, lang)) {
free (lang);
@@ -149,7 +149,7 @@ retry:
#else
# if defined (HAVE_GETEXECNAME)
const char *p = getexecname ();
-# else
+# elif defined (HAVE_READLINK)
char buf[PATH_MAX + 1];
int len;
char *p = NULL;
@@ -160,6 +160,8 @@ retry:
buf[len] = '\0';
p = buf;
}
+# else
+ char *p = NULL;
# endif
if (p)
{
@@ -217,9 +219,10 @@ FcDefaultSubstitute (FcPattern *pattern)
{
FcValue v, namelang, v2;
int i;
+ double dpi, size, scale, pixelsize;
if (FcPatternObjectGet (pattern, FC_WEIGHT_OBJECT, 0, &v) == FcResultNoMatch )
- FcPatternObjectAddInteger (pattern, FC_WEIGHT_OBJECT, FC_WEIGHT_MEDIUM);
+ FcPatternObjectAddInteger (pattern, FC_WEIGHT_OBJECT, FC_WEIGHT_NORMAL);
if (FcPatternObjectGet (pattern, FC_SLANT_OBJECT, 0, &v) == FcResultNoMatch)
FcPatternObjectAddInteger (pattern, FC_SLANT_OBJECT, FC_SLANT_ROMAN);
@@ -231,32 +234,30 @@ FcDefaultSubstitute (FcPattern *pattern)
if (FcPatternObjectGet (pattern, FcBoolDefaults[i].field, 0, &v) == FcResultNoMatch)
FcPatternObjectAddBool (pattern, FcBoolDefaults[i].field, FcBoolDefaults[i].value);
- if (FcPatternObjectGet (pattern, FC_PIXEL_SIZE_OBJECT, 0, &v) == FcResultNoMatch)
- {
- double dpi, size, scale;
+ if (FcPatternObjectGetDouble (pattern, FC_SIZE_OBJECT, 0, &size) != FcResultMatch)
+ size = 12.0L;
+ if (FcPatternObjectGetDouble (pattern, FC_SCALE_OBJECT, 0, &scale) != FcResultMatch)
+ scale = 1.0;
+ if (FcPatternObjectGetDouble (pattern, FC_DPI_OBJECT, 0, &dpi) != FcResultMatch)
+ dpi = 75.0;
- if (FcPatternObjectGetDouble (pattern, FC_SIZE_OBJECT, 0, &size) != FcResultMatch)
- {
- size = 12.0;
- (void) FcPatternObjectDel (pattern, FC_SIZE_OBJECT);
- FcPatternObjectAddDouble (pattern, FC_SIZE_OBJECT, size);
- }
- if (FcPatternObjectGetDouble (pattern, FC_SCALE_OBJECT, 0, &scale) != FcResultMatch)
- {
- scale = 1.0;
- (void) FcPatternObjectDel (pattern, FC_SCALE_OBJECT);
- FcPatternObjectAddDouble (pattern, FC_SCALE_OBJECT, scale);
- }
- size *= scale;
- if (FcPatternObjectGetDouble (pattern, FC_DPI_OBJECT, 0, &dpi) != FcResultMatch)
- {
- dpi = 75.0;
- (void) FcPatternObjectDel (pattern, FC_DPI_OBJECT);
- FcPatternObjectAddDouble (pattern, FC_DPI_OBJECT, dpi);
- }
- size *= dpi / 72.0;
- FcPatternObjectAddDouble (pattern, FC_PIXEL_SIZE_OBJECT, size);
+ if (FcPatternObjectGet (pattern, FC_PIXEL_SIZE_OBJECT, 0, &v) != FcResultMatch)
+ {
+ (void) FcPatternObjectDel (pattern, FC_SCALE_OBJECT);
+ FcPatternObjectAddDouble (pattern, FC_SCALE_OBJECT, scale);
+ pixelsize = size * scale;
+ (void) FcPatternObjectDel (pattern, FC_DPI_OBJECT);
+ FcPatternObjectAddDouble (pattern, FC_DPI_OBJECT, dpi);
+ pixelsize *= dpi / 72.0;
+ FcPatternObjectAddDouble (pattern, FC_PIXEL_SIZE_OBJECT, pixelsize);
+ }
+ else
+ {
+ size = v.u.d;
+ size = size / dpi * 72.0 / scale;
}
+ (void) FcPatternObjectDel (pattern, FC_SIZE_OBJECT);
+ FcPatternObjectAddDouble (pattern, FC_SIZE_OBJECT, size);
if (FcPatternObjectGet (pattern, FC_FONTVERSION_OBJECT, 0, &v) == FcResultNoMatch)
{
diff --git a/chromium/third_party/fontconfig/src/src/fcdir.c b/chromium/third_party/fontconfig/src/src/fcdir.c
index b040a285ad6..fd62a342f81 100644
--- a/chromium/third_party/fontconfig/src/src/fcdir.c
+++ b/chromium/third_party/fontconfig/src/src/fcdir.c
@@ -23,6 +23,9 @@
*/
#include "fcint.h"
+#include "fcftint.h"
+#include <ft2build.h>
+#include FT_FREETYPE_H
#include <dirent.h>
FcBool
@@ -65,12 +68,20 @@ FcFileScanFontConfig (FcFontSet *set,
const FcChar8 *file,
FcConfig *config)
{
+ FT_Library ftLibrary;
+ FT_Face face;
FcPattern *font;
FcBool ret = FcTrue;
+ int num_faces = 0;
+ int num_instances = 0;
+ int face_num = 0;
+ int instance_num = 0;
int id;
- int count = 0;
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
+
+ if (FT_Init_FreeType (&ftLibrary))
+ return FcFalse;
- id = 0;
do
{
font = 0;
@@ -82,9 +93,39 @@ FcFileScanFontConfig (FcFontSet *set,
printf ("\tScanning file %s...", file);
fflush (stdout);
}
- font = FcFreeTypeQuery (file, id, blanks, &count);
+
+ id = ((instance_num << 16) + face_num);
+ if (FT_New_Face (ftLibrary, (char *) file, id, &face))
+ return FcFalse;
+ num_faces = face->num_faces;
+ num_instances = face->style_flags >> 16;
+ font = FcFreeTypeQueryFace (face, file, id, blanks);
+ FT_Done_Face (face);
+
if (FcDebug () & FC_DBG_SCAN)
printf ("done\n");
+ /*
+ * Get rid of sysroot here so that targeting scan rule may contains FC_FILE pattern
+ * and they should usually expect without sysroot.
+ */
+ if (font && sysroot)
+ {
+ size_t len = strlen ((const char *)sysroot);
+ FcChar8 *f = NULL;
+
+ if (FcPatternObjectGetString (font, FC_FILE_OBJECT, 0, &f) == FcResultMatch &&
+ strncmp ((const char *)f, (const char *)sysroot, len) == 0)
+ {
+ FcChar8 *s = FcStrdup (f);
+ FcPatternObjectDel (font, FC_FILE_OBJECT);
+ if (s[len] != '/')
+ len--;
+ else if (s[len+1] == '/')
+ len++;
+ FcPatternObjectAddString (font, FC_FILE_OBJECT, &s[len]);
+ FcStrFree (s);
+ }
+ }
/*
* Edit pattern with user-defined rules
@@ -113,10 +154,20 @@ FcFileScanFontConfig (FcFontSet *set,
ret = FcFalse;
}
}
- else if (font)
- FcPatternDestroy (font);
- id++;
- } while (font && ret && id < count);
+ else
+ ret = FcFalse;
+
+ if (instance_num < num_instances)
+ instance_num++;
+ else
+ {
+ face_num++;
+ instance_num = 0;
+ }
+ } while (font && ret && face_num < num_faces);
+
+ FT_Done_FreeType (ftLibrary);
+
return ret;
}
@@ -128,9 +179,32 @@ FcFileScanConfig (FcFontSet *set,
FcConfig *config)
{
if (FcFileIsDir (file))
- return FcStrSetAdd (dirs, file);
+ {
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
+ const FcChar8 *d = file;
+ size_t len;
+
+ if (sysroot)
+ {
+ len = strlen ((const char *)sysroot);
+ if (strncmp ((const char *)file, (const char *)sysroot, len) == 0)
+ {
+ if (file[len] != '/')
+ len--;
+ else if (file[len+1] == '/')
+ len++;
+ d = &file[len];
+ }
+ }
+ return FcStrSetAdd (dirs, d);
+ }
else
- return FcFileScanFontConfig (set, blanks, file, config);
+ {
+ if (set)
+ return FcFileScanFontConfig (set, blanks, file, config);
+ else
+ return FcTrue;
+ }
}
FcBool
@@ -201,7 +275,7 @@ FcDirScanConfig (FcFontSet *set,
goto bail;
}
- files = FcStrSetCreate ();
+ files = FcStrSetCreateEx (FCSS_ALLOW_DUPLICATES | FCSS_GROW_BY_64);
if (!files)
{
ret = FcFalse;
@@ -265,25 +339,34 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
FcFontSet *set;
FcCache *cache = NULL;
struct stat dir_stat;
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
+ FcChar8 *d;
+ int fd = -1;
+
+ if (sysroot)
+ d = FcStrBuildFilename (sysroot, dir, NULL);
+ else
+ d = FcStrdup (dir);
if (FcDebug () & FC_DBG_FONTSET)
- printf ("cache scan dir %s\n", dir);
+ printf ("cache scan dir %s\n", d);
- if (FcStatChecksum (dir, &dir_stat) < 0)
+ if (FcStatChecksum (d, &dir_stat) < 0)
goto bail;
set = FcFontSetCreate();
if (!set)
goto bail;
- dirs = FcStrSetCreate ();
+ dirs = FcStrSetCreateEx (FCSS_GROW_BY_64);
if (!dirs)
goto bail1;
+ fd = FcDirCacheLock (dir, config);
/*
* Scan the dir
*/
- if (!FcDirScanConfig (set, dirs, NULL, dir, FcTrue, config))
+ if (!FcDirScanConfig (set, dirs, NULL, d, FcTrue, config))
goto bail2;
/*
@@ -299,13 +382,69 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
FcDirCacheWrite (cache, config);
bail2:
+ FcDirCacheUnlock (fd);
FcStrSetDestroy (dirs);
bail1:
FcFontSetDestroy (set);
bail:
+ FcStrFree (d);
+
return cache;
}
+FcCache *
+FcDirCacheRescan (const FcChar8 *dir, FcConfig *config)
+{
+ FcCache *cache;
+ FcCache *new = NULL;
+ struct stat dir_stat;
+ FcStrSet *dirs;
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
+ FcChar8 *d = NULL;
+ int fd = -1;
+
+ cache = FcDirCacheLoad (dir, config, NULL);
+ if (!cache)
+ goto bail;
+
+ if (sysroot)
+ d = FcStrBuildFilename (sysroot, dir, NULL);
+ else
+ d = FcStrdup (dir);
+ if (FcStatChecksum (d, &dir_stat) < 0)
+ goto bail;
+ dirs = FcStrSetCreateEx (FCSS_GROW_BY_64);
+ if (!dirs)
+ goto bail;
+
+ fd = FcDirCacheLock (dir, config);
+ /*
+ * Scan the dir
+ */
+ if (!FcDirScanConfig (NULL, dirs, NULL, d, FcTrue, config))
+ goto bail1;
+ /*
+ * Rebuild the cache object
+ */
+ new = FcDirCacheRebuild (cache, &dir_stat, dirs);
+ if (!new)
+ goto bail1;
+ FcDirCacheUnload (cache);
+ /*
+ * Write out the cache file, ignoring any troubles
+ */
+ FcDirCacheWrite (new, config);
+
+bail1:
+ FcDirCacheUnlock (fd);
+ FcStrSetDestroy (dirs);
+bail:
+ if (d)
+ FcStrFree (d);
+
+ return new;
+}
+
/*
* Read (or construct) the cache for a directory
*/
diff --git a/chromium/third_party/fontconfig/src/src/fcfreetype.c b/chromium/third_party/fontconfig/src/src/fcfreetype.c
index e39430762c7..b4d926d4667 100644
--- a/chromium/third_party/fontconfig/src/src/fcfreetype.c
+++ b/chromium/third_party/fontconfig/src/src/fcfreetype.c
@@ -62,6 +62,7 @@
#include FT_BDF_H
#include FT_MODULE_H
#endif
+#include FT_MULTIPLE_MASTERS_H
#include "ftglue.h"
@@ -558,6 +559,139 @@ FcFontCapabilities(FT_Face face);
#define NUM_FC_MAC_ROMAN_FAKE (int) (sizeof (fcMacRomanFake) / sizeof (fcMacRomanFake[0]))
+
+/* From http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT */
+static const FcChar16 fcMacRomanNonASCIIToUnicode[128] = {
+ /*0x80*/ 0x00C4, /* LATIN CAPITAL LETTER A WITH DIAERESIS */
+ /*0x81*/ 0x00C5, /* LATIN CAPITAL LETTER A WITH RING ABOVE */
+ /*0x82*/ 0x00C7, /* LATIN CAPITAL LETTER C WITH CEDILLA */
+ /*0x83*/ 0x00C9, /* LATIN CAPITAL LETTER E WITH ACUTE */
+ /*0x84*/ 0x00D1, /* LATIN CAPITAL LETTER N WITH TILDE */
+ /*0x85*/ 0x00D6, /* LATIN CAPITAL LETTER O WITH DIAERESIS */
+ /*0x86*/ 0x00DC, /* LATIN CAPITAL LETTER U WITH DIAERESIS */
+ /*0x87*/ 0x00E1, /* LATIN SMALL LETTER A WITH ACUTE */
+ /*0x88*/ 0x00E0, /* LATIN SMALL LETTER A WITH GRAVE */
+ /*0x89*/ 0x00E2, /* LATIN SMALL LETTER A WITH CIRCUMFLEX */
+ /*0x8A*/ 0x00E4, /* LATIN SMALL LETTER A WITH DIAERESIS */
+ /*0x8B*/ 0x00E3, /* LATIN SMALL LETTER A WITH TILDE */
+ /*0x8C*/ 0x00E5, /* LATIN SMALL LETTER A WITH RING ABOVE */
+ /*0x8D*/ 0x00E7, /* LATIN SMALL LETTER C WITH CEDILLA */
+ /*0x8E*/ 0x00E9, /* LATIN SMALL LETTER E WITH ACUTE */
+ /*0x8F*/ 0x00E8, /* LATIN SMALL LETTER E WITH GRAVE */
+ /*0x90*/ 0x00EA, /* LATIN SMALL LETTER E WITH CIRCUMFLEX */
+ /*0x91*/ 0x00EB, /* LATIN SMALL LETTER E WITH DIAERESIS */
+ /*0x92*/ 0x00ED, /* LATIN SMALL LETTER I WITH ACUTE */
+ /*0x93*/ 0x00EC, /* LATIN SMALL LETTER I WITH GRAVE */
+ /*0x94*/ 0x00EE, /* LATIN SMALL LETTER I WITH CIRCUMFLEX */
+ /*0x95*/ 0x00EF, /* LATIN SMALL LETTER I WITH DIAERESIS */
+ /*0x96*/ 0x00F1, /* LATIN SMALL LETTER N WITH TILDE */
+ /*0x97*/ 0x00F3, /* LATIN SMALL LETTER O WITH ACUTE */
+ /*0x98*/ 0x00F2, /* LATIN SMALL LETTER O WITH GRAVE */
+ /*0x99*/ 0x00F4, /* LATIN SMALL LETTER O WITH CIRCUMFLEX */
+ /*0x9A*/ 0x00F6, /* LATIN SMALL LETTER O WITH DIAERESIS */
+ /*0x9B*/ 0x00F5, /* LATIN SMALL LETTER O WITH TILDE */
+ /*0x9C*/ 0x00FA, /* LATIN SMALL LETTER U WITH ACUTE */
+ /*0x9D*/ 0x00F9, /* LATIN SMALL LETTER U WITH GRAVE */
+ /*0x9E*/ 0x00FB, /* LATIN SMALL LETTER U WITH CIRCUMFLEX */
+ /*0x9F*/ 0x00FC, /* LATIN SMALL LETTER U WITH DIAERESIS */
+ /*0xA0*/ 0x2020, /* DAGGER */
+ /*0xA1*/ 0x00B0, /* DEGREE SIGN */
+ /*0xA2*/ 0x00A2, /* CENT SIGN */
+ /*0xA3*/ 0x00A3, /* POUND SIGN */
+ /*0xA4*/ 0x00A7, /* SECTION SIGN */
+ /*0xA5*/ 0x2022, /* BULLET */
+ /*0xA6*/ 0x00B6, /* PILCROW SIGN */
+ /*0xA7*/ 0x00DF, /* LATIN SMALL LETTER SHARP S */
+ /*0xA8*/ 0x00AE, /* REGISTERED SIGN */
+ /*0xA9*/ 0x00A9, /* COPYRIGHT SIGN */
+ /*0xAA*/ 0x2122, /* TRADE MARK SIGN */
+ /*0xAB*/ 0x00B4, /* ACUTE ACCENT */
+ /*0xAC*/ 0x00A8, /* DIAERESIS */
+ /*0xAD*/ 0x2260, /* NOT EQUAL TO */
+ /*0xAE*/ 0x00C6, /* LATIN CAPITAL LETTER AE */
+ /*0xAF*/ 0x00D8, /* LATIN CAPITAL LETTER O WITH STROKE */
+ /*0xB0*/ 0x221E, /* INFINITY */
+ /*0xB1*/ 0x00B1, /* PLUS-MINUS SIGN */
+ /*0xB2*/ 0x2264, /* LESS-THAN OR EQUAL TO */
+ /*0xB3*/ 0x2265, /* GREATER-THAN OR EQUAL TO */
+ /*0xB4*/ 0x00A5, /* YEN SIGN */
+ /*0xB5*/ 0x00B5, /* MICRO SIGN */
+ /*0xB6*/ 0x2202, /* PARTIAL DIFFERENTIAL */
+ /*0xB7*/ 0x2211, /* N-ARY SUMMATION */
+ /*0xB8*/ 0x220F, /* N-ARY PRODUCT */
+ /*0xB9*/ 0x03C0, /* GREEK SMALL LETTER PI */
+ /*0xBA*/ 0x222B, /* INTEGRAL */
+ /*0xBB*/ 0x00AA, /* FEMININE ORDINAL INDICATOR */
+ /*0xBC*/ 0x00BA, /* MASCULINE ORDINAL INDICATOR */
+ /*0xBD*/ 0x03A9, /* GREEK CAPITAL LETTER OMEGA */
+ /*0xBE*/ 0x00E6, /* LATIN SMALL LETTER AE */
+ /*0xBF*/ 0x00F8, /* LATIN SMALL LETTER O WITH STROKE */
+ /*0xC0*/ 0x00BF, /* INVERTED QUESTION MARK */
+ /*0xC1*/ 0x00A1, /* INVERTED EXCLAMATION MARK */
+ /*0xC2*/ 0x00AC, /* NOT SIGN */
+ /*0xC3*/ 0x221A, /* SQUARE ROOT */
+ /*0xC4*/ 0x0192, /* LATIN SMALL LETTER F WITH HOOK */
+ /*0xC5*/ 0x2248, /* ALMOST EQUAL TO */
+ /*0xC6*/ 0x2206, /* INCREMENT */
+ /*0xC7*/ 0x00AB, /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */
+ /*0xC8*/ 0x00BB, /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */
+ /*0xC9*/ 0x2026, /* HORIZONTAL ELLIPSIS */
+ /*0xCA*/ 0x00A0, /* NO-BREAK SPACE */
+ /*0xCB*/ 0x00C0, /* LATIN CAPITAL LETTER A WITH GRAVE */
+ /*0xCC*/ 0x00C3, /* LATIN CAPITAL LETTER A WITH TILDE */
+ /*0xCD*/ 0x00D5, /* LATIN CAPITAL LETTER O WITH TILDE */
+ /*0xCE*/ 0x0152, /* LATIN CAPITAL LIGATURE OE */
+ /*0xCF*/ 0x0153, /* LATIN SMALL LIGATURE OE */
+ /*0xD0*/ 0x2013, /* EN DASH */
+ /*0xD1*/ 0x2014, /* EM DASH */
+ /*0xD2*/ 0x201C, /* LEFT DOUBLE QUOTATION MARK */
+ /*0xD3*/ 0x201D, /* RIGHT DOUBLE QUOTATION MARK */
+ /*0xD4*/ 0x2018, /* LEFT SINGLE QUOTATION MARK */
+ /*0xD5*/ 0x2019, /* RIGHT SINGLE QUOTATION MARK */
+ /*0xD6*/ 0x00F7, /* DIVISION SIGN */
+ /*0xD7*/ 0x25CA, /* LOZENGE */
+ /*0xD8*/ 0x00FF, /* LATIN SMALL LETTER Y WITH DIAERESIS */
+ /*0xD9*/ 0x0178, /* LATIN CAPITAL LETTER Y WITH DIAERESIS */
+ /*0xDA*/ 0x2044, /* FRACTION SLASH */
+ /*0xDB*/ 0x20AC, /* EURO SIGN */
+ /*0xDC*/ 0x2039, /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */
+ /*0xDD*/ 0x203A, /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */
+ /*0xDE*/ 0xFB01, /* LATIN SMALL LIGATURE FI */
+ /*0xDF*/ 0xFB02, /* LATIN SMALL LIGATURE FL */
+ /*0xE0*/ 0x2021, /* DOUBLE DAGGER */
+ /*0xE1*/ 0x00B7, /* MIDDLE DOT */
+ /*0xE2*/ 0x201A, /* SINGLE LOW-9 QUOTATION MARK */
+ /*0xE3*/ 0x201E, /* DOUBLE LOW-9 QUOTATION MARK */
+ /*0xE4*/ 0x2030, /* PER MILLE SIGN */
+ /*0xE5*/ 0x00C2, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */
+ /*0xE6*/ 0x00CA, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
+ /*0xE7*/ 0x00C1, /* LATIN CAPITAL LETTER A WITH ACUTE */
+ /*0xE8*/ 0x00CB, /* LATIN CAPITAL LETTER E WITH DIAERESIS */
+ /*0xE9*/ 0x00C8, /* LATIN CAPITAL LETTER E WITH GRAVE */
+ /*0xEA*/ 0x00CD, /* LATIN CAPITAL LETTER I WITH ACUTE */
+ /*0xEB*/ 0x00CE, /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */
+ /*0xEC*/ 0x00CF, /* LATIN CAPITAL LETTER I WITH DIAERESIS */
+ /*0xED*/ 0x00CC, /* LATIN CAPITAL LETTER I WITH GRAVE */
+ /*0xEE*/ 0x00D3, /* LATIN CAPITAL LETTER O WITH ACUTE */
+ /*0xEF*/ 0x00D4, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
+ /*0xF0*/ 0xF8FF, /* Apple logo */
+ /*0xF1*/ 0x00D2, /* LATIN CAPITAL LETTER O WITH GRAVE */
+ /*0xF2*/ 0x00DA, /* LATIN CAPITAL LETTER U WITH ACUTE */
+ /*0xF3*/ 0x00DB, /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */
+ /*0xF4*/ 0x00D9, /* LATIN CAPITAL LETTER U WITH GRAVE */
+ /*0xF5*/ 0x0131, /* LATIN SMALL LETTER DOTLESS I */
+ /*0xF6*/ 0x02C6, /* MODIFIER LETTER CIRCUMFLEX ACCENT */
+ /*0xF7*/ 0x02DC, /* SMALL TILDE */
+ /*0xF8*/ 0x00AF, /* MACRON */
+ /*0xF9*/ 0x02D8, /* BREVE */
+ /*0xFA*/ 0x02D9, /* DOT ABOVE */
+ /*0xFB*/ 0x02DA, /* RING ABOVE */
+ /*0xFC*/ 0x00B8, /* CEDILLA */
+ /*0xFD*/ 0x02DD, /* DOUBLE ACUTE ACCENT */
+ /*0xFE*/ 0x02DB, /* OGONEK */
+ /*0xFF*/ 0x02C7, /* CARON */
+};
+
#if USE_ICONV
#include <iconv.h>
#endif
@@ -696,6 +830,35 @@ FcSfntNameTranscode (FT_SfntName *sname)
*u8 = '\0';
goto done;
}
+ if (!strcmp (fromcode, FC_ENCODING_MAC_ROMAN))
+ {
+ FcChar8 *src = sname->string;
+ int src_len = sname->string_len;
+ int olen;
+ FcChar8 *u8;
+ FcChar32 ucs4;
+
+ /*
+ * Convert Latin1 to Utf8. Freed below
+ */
+ utf8 = malloc (src_len * 3 + 1);
+ if (!utf8)
+ return 0;
+
+ u8 = utf8;
+ while (src_len > 0)
+ {
+ ucs4 = *src++;
+ if (ucs4 >= 128)
+ ucs4 = fcMacRomanNonASCIIToUnicode[ucs4 - 128];
+ src_len--;
+ olen = FcUcs4ToUtf8 (ucs4, u8);
+ u8 += olen;
+ }
+ *u8 = '\0';
+ goto done;
+ }
+
#if USE_ICONV
cd = iconv_open ("UTF-8", fromcode);
if (cd && cd != (iconv_t) (-1))
@@ -816,76 +979,6 @@ FcNoticeFoundry(const FT_String *notice)
return 0;
}
-static FcBool
-FcVendorMatch(const FT_Char vendor[4], const FT_Char *vendor_string)
-{
- /* vendor is not necessarily NUL-terminated. */
- int i, len;
-
- len = strlen((char *) vendor_string);
- if (memcmp(vendor, vendor_string, len) != 0)
- return FcFalse;
- for (i = len; i < 4; i++)
- if (vendor[i] != ' ' && vendor[i] != '\0')
- return FcFalse;
- return FcTrue;
-}
-
-/* This table is partly taken from ttmkfdir by Joerg Pommnitz. */
-
-/* It should not contain useless entries (such as UNKN) nor duplicate
- entries for padding both with spaces and NULs. */
-
-static const struct {
- const FT_Char vendor[5];
- const FcChar8 foundry[13];
-} FcVendorFoundries[] = {
- { "ADBE", "adobe"},
- { "AGFA", "agfa"},
- { "ALTS", "altsys"},
- { "APPL", "apple"},
- { "ARPH", "arphic"},
- { "ATEC", "alltype"},
- { "B&H", "b&h"},
- { "BITS", "bitstream"},
- { "CANO", "cannon"},
- { "CLM", "culmus"},
- { "DYNA", "dynalab"},
- { "EPSN", "epson"},
- { "FJ", "fujitsu"},
- { "IBM", "ibm"},
- { "ITC", "itc"},
- { "IMPR", "impress"},
- { "LARA", "larabiefonts"},
- { "LEAF", "interleaf"},
- { "LETR", "letraset"},
- { "LINO", "linotype"},
- { "MACR", "macromedia"},
- { "MONO", "monotype"},
- { "MS", "microsoft"},
- { "MT", "monotype"},
- { "NEC", "nec"},
- { "PARA", "paratype"},
- { "QMSI", "qms"},
- { "RICO", "ricoh"},
- { "URW", "urw"},
- { "Y&Y", "y&y"}
-};
-
-#define NUM_VENDOR_FOUNDRIES (int) (sizeof (FcVendorFoundries) / sizeof (FcVendorFoundries[0]))
-
-static const FcChar8 *
-FcVendorFoundry(const FT_Char vendor[4])
-{
- int i;
-
- if (vendor)
- for(i = 0; i < NUM_VENDOR_FOUNDRIES; i++)
- if (FcVendorMatch (vendor, FcVendorFoundries[i].vendor))
- return FcVendorFoundries[i].foundry;
- return 0;
-}
-
typedef struct _FcStringConst {
const FcChar8 *name;
int value;
@@ -933,6 +1026,8 @@ static const FcStringConst weightConsts[] = {
{ (FC8) "thin", FC_WEIGHT_THIN },
{ (FC8) "extralight", FC_WEIGHT_EXTRALIGHT },
{ (FC8) "ultralight", FC_WEIGHT_ULTRALIGHT },
+ { (FC8) "demilight", FC_WEIGHT_DEMILIGHT },
+ { (FC8) "semilight", FC_WEIGHT_SEMILIGHT },
{ (FC8) "light", FC_WEIGHT_LIGHT },
{ (FC8) "book", FC_WEIGHT_BOOK },
{ (FC8) "regular", FC_WEIGHT_REGULAR },
@@ -1075,9 +1170,16 @@ FcFreeTypeQueryFace (const FT_Face face,
#if 0
FcChar8 *family = 0;
#endif
- FcChar8 *complex_;
+ FcChar8 *complex_, *foundry_ = NULL;
const FcChar8 *foundry = 0;
int spacing;
+
+ /* Support for glyph-variation named-instances. */
+ FT_MM_Var *master = NULL;
+ FT_Var_Named_Style *instance = NULL;
+ double weight_mult = 1.0;
+ double width_mult = 1.0;
+
TT_OS2 *os2;
#if HAVE_FT_GET_PS_FONT_INFO
PS_FontInfoRec psfontinfo;
@@ -1104,22 +1206,70 @@ FcFreeTypeQueryFace (const FT_Face face,
char psname[256];
const char *tmp;
- FcChar8 *hashstr = NULL;
- FT_Error err;
- FT_ULong len = 0, alen;
+ FcRange *r = NULL;
+
+ FcBool symbol = FcFalse;
+
+ FcInitDebug (); /* We might be called with no initizalization whatsoever. */
pat = FcPatternCreate ();
if (!pat)
goto bail0;
- if (!FcPatternAddBool (pat, FC_OUTLINE,
- (face->face_flags & FT_FACE_FLAG_SCALABLE) != 0))
- goto bail1;
+ {
+ int has_outline = !!(face->face_flags & FT_FACE_FLAG_SCALABLE);
+ int has_color = 0;
- if (!FcPatternAddBool (pat, FC_SCALABLE,
- (face->face_flags & FT_FACE_FLAG_SCALABLE) != 0))
- goto bail1;
+#ifdef FT_FACE_FLAG_COLOR
+ has_color = !!(face->face_flags & FT_FACE_FLAG_COLOR);
+#endif
+
+ if (!FcPatternAddBool (pat, FC_OUTLINE, has_outline))
+ goto bail1;
+
+#ifdef FT_FACE_FLAG_COLOR
+ if (!FcPatternAddBool (pat, FC_COLOR, has_color))
+ goto bail1;
+#endif
+
+ /* All color fonts are designed to be scaled, even if they only have
+ * bitmap strikes. Client is responsible to scale the bitmaps. This
+ * is in constrast to non-color strikes... */
+ if (!FcPatternAddBool (pat, FC_SCALABLE, has_outline || has_color))
+ goto bail1;
+ }
+
+ if (id >> 16)
+ {
+ if (!FT_Get_MM_Var (face, &master))
+ instance = &master->namedstyle[(id >> 16) - 1];
+
+ if (instance)
+ {
+ /* Pull out weight and width from named-instance. */
+ unsigned int i;
+
+ for (i = 0; i < master->num_axis; i++)
+ {
+ double value = instance->coords[i] / (double) (1 << 16);
+ double default_value = master->axis[i].def / (double) (1 << 16);
+ double mult = value / default_value;
+ //printf ("named-instance, axis %d tag %lx value %g\n", i, master->axis[i].tag, value);
+ switch (master->axis[i].tag)
+ {
+ case FT_MAKE_TAG ('w','g','h','t'):
+ weight_mult = mult;
+ break;
+
+ case FT_MAKE_TAG ('w','d','t','h'):
+ width_mult = mult;
+ break;
+ /* TODO optical size! */
+ }
+ }
+ }
+ }
/*
* Get the OS/2 table
@@ -1135,7 +1285,15 @@ FcFreeTypeQueryFace (const FT_Face face,
*/
if (os2 && os2->version >= 0x0001 && os2->version != 0xffff)
- foundry = FcVendorFoundry(os2->achVendID);
+ {
+ if (os2->achVendID && os2->achVendID[0] != 0)
+ {
+ foundry_ = (FcChar8 *) malloc (sizeof (os2->achVendID) + 1);
+ memcpy ((void *)foundry_, os2->achVendID, sizeof (os2->achVendID));
+ foundry_[sizeof (os2->achVendID)] = 0;
+ foundry = foundry_;
+ }
+ }
if (FcDebug () & FC_DBG_SCANV)
printf ("\n");
@@ -1170,6 +1328,19 @@ FcFreeTypeQueryFace (const FT_Face face,
if (FT_Get_Sfnt_Name (face, snamei, &sname) != 0)
continue;
+
+ if (instance)
+ {
+ /* For named-instances, we regular style nameIDs,
+ * and map the instance's strid to FONT_SUBFAMILY. */
+ if (sname.name_id == TT_NAME_ID_WWS_SUBFAMILY ||
+ sname.name_id == TT_NAME_ID_PREFERRED_SUBFAMILY ||
+ sname.name_id == TT_NAME_ID_FONT_SUBFAMILY)
+ continue;
+ if (sname.name_id == instance->strid)
+ sname.name_id = TT_NAME_ID_FONT_SUBFAMILY;
+ }
+
if (sname.name_id != nameid)
continue;
@@ -1283,10 +1454,10 @@ FcFreeTypeQueryFace (const FT_Face face,
free (utf8);
if (lang)
{
- /* pad lang list with 'xx' to line up with elt */
+ /* pad lang list with 'und' to line up with elt */
while (*nlangp < *np)
{
- if (!FcPatternAddString (pat, eltlang, (FcChar8 *) "xx"))
+ if (!FcPatternAddString (pat, eltlang, (FcChar8 *) "und"))
goto bail1;
++*nlangp;
}
@@ -1309,6 +1480,8 @@ FcFreeTypeQueryFace (const FT_Face face,
printf ("using FreeType family \"%s\"\n", face->family_name);
if (!FcPatternAddString (pat, FC_FAMILY, (FcChar8 *) face->family_name))
goto bail1;
+ if (!FcPatternAddString (pat, FC_STYLELANG, (FcChar8 *) "en"))
+ goto bail1;
++nfamily;
}
@@ -1319,10 +1492,12 @@ FcFreeTypeQueryFace (const FT_Face face,
printf ("using FreeType style \"%s\"\n", face->style_name);
if (!FcPatternAddString (pat, FC_STYLE, (FcChar8 *) face->style_name))
goto bail1;
+ if (!FcPatternAddString (pat, FC_STYLELANG, (FcChar8 *) "en"))
+ goto bail1;
++nstyle;
}
- if (!nfamily)
+ if (!nfamily && file && *file)
{
FcChar8 *start, *end;
FcChar8 *family;
@@ -1391,12 +1566,13 @@ FcFreeTypeQueryFace (const FT_Face face,
}
else
{
- strcpy (psname, tmp);
+ strncpy (psname, tmp, 255);
+ psname[255] = 0;
}
if (!FcPatternAddString (pat, FC_POSTSCRIPT_NAME, (const FcChar8 *)psname))
goto bail1;
- if (!FcPatternAddString (pat, FC_FILE, file))
+ if (file && *file && !FcPatternAddString (pat, FC_FILE, file))
goto bail1;
if (!FcPatternAddInteger (pat, FC_INDEX, id))
@@ -1463,33 +1639,22 @@ FcFreeTypeQueryFace (const FT_Face face,
if (os2 && os2->version != 0xffff)
{
- if (os2->usWeightClass == 0)
- ;
- else if (os2->usWeightClass < 150)
- weight = FC_WEIGHT_THIN;
- else if (os2->usWeightClass < 250)
- weight = FC_WEIGHT_EXTRALIGHT;
- else if (os2->usWeightClass < 350)
- weight = FC_WEIGHT_LIGHT;
- else if (os2->usWeightClass < 450)
- weight = FC_WEIGHT_REGULAR;
- else if (os2->usWeightClass < 550)
- weight = FC_WEIGHT_MEDIUM;
- else if (os2->usWeightClass < 650)
- weight = FC_WEIGHT_SEMIBOLD;
- else if (os2->usWeightClass < 750)
- weight = FC_WEIGHT_BOLD;
- else if (os2->usWeightClass < 850)
- weight = FC_WEIGHT_EXTRABOLD;
- else if (os2->usWeightClass < 925)
- weight = FC_WEIGHT_BLACK;
- else if (os2->usWeightClass < 1000)
- weight = FC_WEIGHT_EXTRABLACK;
+ weight = os2->usWeightClass;
+ if (weight < 10 && weight_mult != 1.0)
+ {
+ /* Work around bad values by cleaning them up before
+ * multiplying by weight_mult. */
+ weight = FcWeightToOpenType (FcWeightFromOpenType (weight));
+ }
+ weight = FcWeightFromOpenType ((int) (weight * weight_mult + .5));
if ((FcDebug() & FC_DBG_SCANV) && weight != -1)
- printf ("\tos2 weight class %d maps to weight %d\n",
- os2->usWeightClass, weight);
+ printf ("\tos2 weight class %d multiplier %g maps to weight %d\n",
+ os2->usWeightClass, weight_mult, weight);
- switch (os2->usWidthClass) {
+ /* TODO:
+ * Add FcWidthFromOpenType and FcWidthToOpenType,
+ * and apply width_mult post-conversion? */
+ switch ((int) (os2->usWidthClass * width_mult + .5)) {
case 1: width = FC_WIDTH_ULTRACONDENSED; break;
case 2: width = FC_WIDTH_EXTRACONDENSED; break;
case 3: width = FC_WIDTH_CONDENSED; break;
@@ -1501,8 +1666,8 @@ FcFreeTypeQueryFace (const FT_Face face,
case 9: width = FC_WIDTH_ULTRAEXPANDED; break;
}
if ((FcDebug() & FC_DBG_SCANV) && width != -1)
- printf ("\tos2 width class %d maps to width %d\n",
- os2->usWidthClass, width);
+ printf ("\tos2 width class %d multiplier %g maps to width %d\n",
+ os2->usWidthClass, width_mult, width);
}
if (os2 && (complex_ = FcFontCapabilities(face)))
{
@@ -1514,6 +1679,25 @@ FcFreeTypeQueryFace (const FT_Face face,
free (complex_);
}
+#if defined (HAVE_TT_OS2_USUPPEROPTICALPOINTSIZE) && defined (HAVE_TT_OS2_USLOWEROPTICALPOINTSIZE)
+ if (os2 && os2->version >= 0x0005 && os2->version != 0xffff)
+ {
+ double lower_size, upper_size;
+
+ /* usLowerPointSize and usUpperPointSize is actually twips */
+ lower_size = os2->usLowerOpticalPointSize / 20.0L;
+ upper_size = os2->usUpperOpticalPointSize / 20.0L;
+
+ r = FcRangeCreateDouble (lower_size, upper_size);
+ if (!FcPatternAddRange (pat, FC_SIZE, r))
+ {
+ FcRangeDestroy (r);
+ goto bail1;
+ }
+ FcRangeDestroy (r);
+ }
+#endif
+
/*
* Type 1: Check for FontInfo dictionary information
* Code from g2@magestudios.net (Gerard Escalante)
@@ -1586,7 +1770,7 @@ FcFreeTypeQueryFace (const FT_Face face,
}
if (width == -1 &&
FT_Get_BDF_Property (face, "SETWIDTH_NAME", &prop) == 0 &&
- prop.type == BDF_PROPERTY_TYPE_ATOM)
+ prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom != NULL)
{
width = FcIsWidth ((FcChar8 *) prop.u.atom);
if (FcDebug () & FC_DBG_SCANV)
@@ -1664,46 +1848,6 @@ FcFreeTypeQueryFace (const FT_Face face,
if (!FcPatternAddBool (pat, FC_DECORATIVE, decorative))
goto bail1;
- err = FT_Load_Sfnt_Table (face, 0, 0, NULL, &len);
- if (err == FT_Err_Ok)
- {
- char *fontdata;
-
- alen = (len + 63) & ~63;
- fontdata = malloc (alen);
- if (!fontdata)
- goto bail3;
- err = FT_Load_Sfnt_Table (face, 0, 0, (FT_Byte *)fontdata, &len);
- if (err != FT_Err_Ok)
- {
- free (fontdata);
- goto bail3;
- }
- memset (&fontdata[len], 0, alen - len);
- hashstr = FcHashGetSHA256DigestFromMemory (fontdata, len);
- free (fontdata);
- }
- else if (err == FT_Err_Invalid_Face_Handle)
- {
- /* font may not support SFNT. falling back to
- * read the font data from file directly
- */
- hashstr = FcHashGetSHA256DigestFromFile (file);
- }
- else
- {
- goto bail3;
- }
- if (hashstr)
- {
- if (!FcPatternAddString (pat, FC_HASH, hashstr))
- {
- free (hashstr);
- goto bail1;
- }
- free (hashstr);
- }
-bail3:
/*
* Compute the unicode coverage for the font
@@ -1712,11 +1856,16 @@ bail3:
if (!cs)
goto bail1;
+ /* The FcFreeTypeCharSetAndSpacing() chose the encoding; test it for symbol. */
+ symbol = face->charmap && face->charmap->encoding == FT_ENCODING_MS_SYMBOL;
+ if (!FcPatternAddBool (pat, FC_SYMBOL, symbol))
+ goto bail1;
+
#if HAVE_FT_GET_BDF_PROPERTY
/* For PCF fonts, override the computed spacing with the one from
the property */
if(FT_Get_BDF_Property(face, "SPACING", &prop) == 0 &&
- prop.type == BDF_PROPERTY_TYPE_ATOM) {
+ prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom != NULL) {
if(!strcmp(prop.u.atom, "c") || !strcmp(prop.u.atom, "C"))
spacing = FC_CHARCELL;
else if(!strcmp(prop.u.atom, "m") || !strcmp(prop.u.atom, "M"))
@@ -1744,9 +1893,18 @@ bail3:
if (!FcPatternAddCharSet (pat, FC_CHARSET, cs))
goto bail2;
- ls = FcFreeTypeLangSet (cs, exclusiveLang);
- if (!ls)
- goto bail2;
+ if (!symbol)
+ {
+ ls = FcFreeTypeLangSet (cs, exclusiveLang);
+ if (!ls)
+ goto bail2;
+ }
+ else
+ {
+ /* Symbol fonts don't cover any language, even though they
+ * claim to support Latin1 range. */
+ ls = FcLangSetCreate ();
+ }
if (!FcPatternAddLangSet (pat, FC_LANG, ls))
{
@@ -1786,6 +1944,13 @@ bail3:
* Drop our reference to the charset
*/
FcCharSetDestroy (cs);
+ if (foundry_)
+ free (foundry_);
+
+ if (master)
+ {
+ /* TODO: How to free master?! */
+ }
return pat;
@@ -1793,6 +1958,8 @@ bail2:
FcCharSetDestroy (cs);
bail1:
FcPatternDestroy (pat);
+ if (foundry_)
+ free (foundry_);
bail0:
return NULL;
}
@@ -1833,282 +2000,12 @@ bail:
#warning "No FT_Get_Next_Char: Please install freetype version 2.1.0 or newer"
#endif
-typedef struct _FcCharEnt {
- FcChar16 bmp;
- unsigned char encode;
-} FcCharEnt;
-
-struct _FcCharMap {
- const FcCharEnt *ent;
- int nent;
-};
-
-typedef struct _FcFontDecode {
- FT_Encoding encoding;
- const FcCharMap *map;
- FcChar32 max;
-} FcFontDecode;
-
-static const FcCharEnt AdobeSymbolEnt[] = {
- { 0x0020, 0x20 }, /* SPACE # space */
- { 0x0021, 0x21 }, /* EXCLAMATION MARK # exclam */
- { 0x0023, 0x23 }, /* NUMBER SIGN # numbersign */
- { 0x0025, 0x25 }, /* PERCENT SIGN # percent */
- { 0x0026, 0x26 }, /* AMPERSAND # ampersand */
- { 0x0028, 0x28 }, /* LEFT PARENTHESIS # parenleft */
- { 0x0029, 0x29 }, /* RIGHT PARENTHESIS # parenright */
- { 0x002B, 0x2B }, /* PLUS SIGN # plus */
- { 0x002C, 0x2C }, /* COMMA # comma */
- { 0x002E, 0x2E }, /* FULL STOP # period */
- { 0x002F, 0x2F }, /* SOLIDUS # slash */
- { 0x0030, 0x30 }, /* DIGIT ZERO # zero */
- { 0x0031, 0x31 }, /* DIGIT ONE # one */
- { 0x0032, 0x32 }, /* DIGIT TWO # two */
- { 0x0033, 0x33 }, /* DIGIT THREE # three */
- { 0x0034, 0x34 }, /* DIGIT FOUR # four */
- { 0x0035, 0x35 }, /* DIGIT FIVE # five */
- { 0x0036, 0x36 }, /* DIGIT SIX # six */
- { 0x0037, 0x37 }, /* DIGIT SEVEN # seven */
- { 0x0038, 0x38 }, /* DIGIT EIGHT # eight */
- { 0x0039, 0x39 }, /* DIGIT NINE # nine */
- { 0x003A, 0x3A }, /* COLON # colon */
- { 0x003B, 0x3B }, /* SEMICOLON # semicolon */
- { 0x003C, 0x3C }, /* LESS-THAN SIGN # less */
- { 0x003D, 0x3D }, /* EQUALS SIGN # equal */
- { 0x003E, 0x3E }, /* GREATER-THAN SIGN # greater */
- { 0x003F, 0x3F }, /* QUESTION MARK # question */
- { 0x005B, 0x5B }, /* LEFT SQUARE BRACKET # bracketleft */
- { 0x005D, 0x5D }, /* RIGHT SQUARE BRACKET # bracketright */
- { 0x005F, 0x5F }, /* LOW LINE # underscore */
- { 0x007B, 0x7B }, /* LEFT CURLY BRACKET # braceleft */
- { 0x007C, 0x7C }, /* VERTICAL LINE # bar */
- { 0x007D, 0x7D }, /* RIGHT CURLY BRACKET # braceright */
- { 0x00A0, 0x20 }, /* NO-BREAK SPACE # space */
- { 0x00AC, 0xD8 }, /* NOT SIGN # logicalnot */
- { 0x00B0, 0xB0 }, /* DEGREE SIGN # degree */
- { 0x00B1, 0xB1 }, /* PLUS-MINUS SIGN # plusminus */
- { 0x00B5, 0x6D }, /* MICRO SIGN # mu */
- { 0x00D7, 0xB4 }, /* MULTIPLICATION SIGN # multiply */
- { 0x00F7, 0xB8 }, /* DIVISION SIGN # divide */
- { 0x0192, 0xA6 }, /* LATIN SMALL LETTER F WITH HOOK # florin */
- { 0x0391, 0x41 }, /* GREEK CAPITAL LETTER ALPHA # Alpha */
- { 0x0392, 0x42 }, /* GREEK CAPITAL LETTER BETA # Beta */
- { 0x0393, 0x47 }, /* GREEK CAPITAL LETTER GAMMA # Gamma */
- { 0x0394, 0x44 }, /* GREEK CAPITAL LETTER DELTA # Delta */
- { 0x0395, 0x45 }, /* GREEK CAPITAL LETTER EPSILON # Epsilon */
- { 0x0396, 0x5A }, /* GREEK CAPITAL LETTER ZETA # Zeta */
- { 0x0397, 0x48 }, /* GREEK CAPITAL LETTER ETA # Eta */
- { 0x0398, 0x51 }, /* GREEK CAPITAL LETTER THETA # Theta */
- { 0x0399, 0x49 }, /* GREEK CAPITAL LETTER IOTA # Iota */
- { 0x039A, 0x4B }, /* GREEK CAPITAL LETTER KAPPA # Kappa */
- { 0x039B, 0x4C }, /* GREEK CAPITAL LETTER LAMDA # Lambda */
- { 0x039C, 0x4D }, /* GREEK CAPITAL LETTER MU # Mu */
- { 0x039D, 0x4E }, /* GREEK CAPITAL LETTER NU # Nu */
- { 0x039E, 0x58 }, /* GREEK CAPITAL LETTER XI # Xi */
- { 0x039F, 0x4F }, /* GREEK CAPITAL LETTER OMICRON # Omicron */
- { 0x03A0, 0x50 }, /* GREEK CAPITAL LETTER PI # Pi */
- { 0x03A1, 0x52 }, /* GREEK CAPITAL LETTER RHO # Rho */
- { 0x03A3, 0x53 }, /* GREEK CAPITAL LETTER SIGMA # Sigma */
- { 0x03A4, 0x54 }, /* GREEK CAPITAL LETTER TAU # Tau */
- { 0x03A5, 0x55 }, /* GREEK CAPITAL LETTER UPSILON # Upsilon */
- { 0x03A6, 0x46 }, /* GREEK CAPITAL LETTER PHI # Phi */
- { 0x03A7, 0x43 }, /* GREEK CAPITAL LETTER CHI # Chi */
- { 0x03A8, 0x59 }, /* GREEK CAPITAL LETTER PSI # Psi */
- { 0x03A9, 0x57 }, /* GREEK CAPITAL LETTER OMEGA # Omega */
- { 0x03B1, 0x61 }, /* GREEK SMALL LETTER ALPHA # alpha */
- { 0x03B2, 0x62 }, /* GREEK SMALL LETTER BETA # beta */
- { 0x03B3, 0x67 }, /* GREEK SMALL LETTER GAMMA # gamma */
- { 0x03B4, 0x64 }, /* GREEK SMALL LETTER DELTA # delta */
- { 0x03B5, 0x65 }, /* GREEK SMALL LETTER EPSILON # epsilon */
- { 0x03B6, 0x7A }, /* GREEK SMALL LETTER ZETA # zeta */
- { 0x03B7, 0x68 }, /* GREEK SMALL LETTER ETA # eta */
- { 0x03B8, 0x71 }, /* GREEK SMALL LETTER THETA # theta */
- { 0x03B9, 0x69 }, /* GREEK SMALL LETTER IOTA # iota */
- { 0x03BA, 0x6B }, /* GREEK SMALL LETTER KAPPA # kappa */
- { 0x03BB, 0x6C }, /* GREEK SMALL LETTER LAMDA # lambda */
- { 0x03BC, 0x6D }, /* GREEK SMALL LETTER MU # mu */
- { 0x03BD, 0x6E }, /* GREEK SMALL LETTER NU # nu */
- { 0x03BE, 0x78 }, /* GREEK SMALL LETTER XI # xi */
- { 0x03BF, 0x6F }, /* GREEK SMALL LETTER OMICRON # omicron */
- { 0x03C0, 0x70 }, /* GREEK SMALL LETTER PI # pi */
- { 0x03C1, 0x72 }, /* GREEK SMALL LETTER RHO # rho */
- { 0x03C2, 0x56 }, /* GREEK SMALL LETTER FINAL SIGMA # sigma1 */
- { 0x03C3, 0x73 }, /* GREEK SMALL LETTER SIGMA # sigma */
- { 0x03C4, 0x74 }, /* GREEK SMALL LETTER TAU # tau */
- { 0x03C5, 0x75 }, /* GREEK SMALL LETTER UPSILON # upsilon */
- { 0x03C6, 0x66 }, /* GREEK SMALL LETTER PHI # phi */
- { 0x03C7, 0x63 }, /* GREEK SMALL LETTER CHI # chi */
- { 0x03C8, 0x79 }, /* GREEK SMALL LETTER PSI # psi */
- { 0x03C9, 0x77 }, /* GREEK SMALL LETTER OMEGA # omega */
- { 0x03D1, 0x4A }, /* GREEK THETA SYMBOL # theta1 */
- { 0x03D2, 0xA1 }, /* GREEK UPSILON WITH HOOK SYMBOL # Upsilon1 */
- { 0x03D5, 0x6A }, /* GREEK PHI SYMBOL # phi1 */
- { 0x03D6, 0x76 }, /* GREEK PI SYMBOL # omega1 */
- { 0x2022, 0xB7 }, /* BULLET # bullet */
- { 0x2026, 0xBC }, /* HORIZONTAL ELLIPSIS # ellipsis */
- { 0x2032, 0xA2 }, /* PRIME # minute */
- { 0x2033, 0xB2 }, /* DOUBLE PRIME # second */
- { 0x2044, 0xA4 }, /* FRACTION SLASH # fraction */
- { 0x20AC, 0xA0 }, /* EURO SIGN # Euro */
- { 0x2111, 0xC1 }, /* BLACK-LETTER CAPITAL I # Ifraktur */
- { 0x2118, 0xC3 }, /* SCRIPT CAPITAL P # weierstrass */
- { 0x211C, 0xC2 }, /* BLACK-LETTER CAPITAL R # Rfraktur */
- { 0x2126, 0x57 }, /* OHM SIGN # Omega */
- { 0x2135, 0xC0 }, /* ALEF SYMBOL # aleph */
- { 0x2190, 0xAC }, /* LEFTWARDS ARROW # arrowleft */
- { 0x2191, 0xAD }, /* UPWARDS ARROW # arrowup */
- { 0x2192, 0xAE }, /* RIGHTWARDS ARROW # arrowright */
- { 0x2193, 0xAF }, /* DOWNWARDS ARROW # arrowdown */
- { 0x2194, 0xAB }, /* LEFT RIGHT ARROW # arrowboth */
- { 0x21B5, 0xBF }, /* DOWNWARDS ARROW WITH CORNER LEFTWARDS # carriagereturn */
- { 0x21D0, 0xDC }, /* LEFTWARDS DOUBLE ARROW # arrowdblleft */
- { 0x21D1, 0xDD }, /* UPWARDS DOUBLE ARROW # arrowdblup */
- { 0x21D2, 0xDE }, /* RIGHTWARDS DOUBLE ARROW # arrowdblright */
- { 0x21D3, 0xDF }, /* DOWNWARDS DOUBLE ARROW # arrowdbldown */
- { 0x21D4, 0xDB }, /* LEFT RIGHT DOUBLE ARROW # arrowdblboth */
- { 0x2200, 0x22 }, /* FOR ALL # universal */
- { 0x2202, 0xB6 }, /* PARTIAL DIFFERENTIAL # partialdiff */
- { 0x2203, 0x24 }, /* THERE EXISTS # existential */
- { 0x2205, 0xC6 }, /* EMPTY SET # emptyset */
- { 0x2206, 0x44 }, /* INCREMENT # Delta */
- { 0x2207, 0xD1 }, /* NABLA # gradient */
- { 0x2208, 0xCE }, /* ELEMENT OF # element */
- { 0x2209, 0xCF }, /* NOT AN ELEMENT OF # notelement */
- { 0x220B, 0x27 }, /* CONTAINS AS MEMBER # suchthat */
- { 0x220F, 0xD5 }, /* N-ARY PRODUCT # product */
- { 0x2211, 0xE5 }, /* N-ARY SUMMATION # summation */
- { 0x2212, 0x2D }, /* MINUS SIGN # minus */
- { 0x2215, 0xA4 }, /* DIVISION SLASH # fraction */
- { 0x2217, 0x2A }, /* ASTERISK OPERATOR # asteriskmath */
- { 0x221A, 0xD6 }, /* SQUARE ROOT # radical */
- { 0x221D, 0xB5 }, /* PROPORTIONAL TO # proportional */
- { 0x221E, 0xA5 }, /* INFINITY # infinity */
- { 0x2220, 0xD0 }, /* ANGLE # angle */
- { 0x2227, 0xD9 }, /* LOGICAL AND # logicaland */
- { 0x2228, 0xDA }, /* LOGICAL OR # logicalor */
- { 0x2229, 0xC7 }, /* INTERSECTION # intersection */
- { 0x222A, 0xC8 }, /* UNION # union */
- { 0x222B, 0xF2 }, /* INTEGRAL # integral */
- { 0x2234, 0x5C }, /* THEREFORE # therefore */
- { 0x223C, 0x7E }, /* TILDE OPERATOR # similar */
- { 0x2245, 0x40 }, /* APPROXIMATELY EQUAL TO # congruent */
- { 0x2248, 0xBB }, /* ALMOST EQUAL TO # approxequal */
- { 0x2260, 0xB9 }, /* NOT EQUAL TO # notequal */
- { 0x2261, 0xBA }, /* IDENTICAL TO # equivalence */
- { 0x2264, 0xA3 }, /* LESS-THAN OR EQUAL TO # lessequal */
- { 0x2265, 0xB3 }, /* GREATER-THAN OR EQUAL TO # greaterequal */
- { 0x2282, 0xCC }, /* SUBSET OF # propersubset */
- { 0x2283, 0xC9 }, /* SUPERSET OF # propersuperset */
- { 0x2284, 0xCB }, /* NOT A SUBSET OF # notsubset */
- { 0x2286, 0xCD }, /* SUBSET OF OR EQUAL TO # reflexsubset */
- { 0x2287, 0xCA }, /* SUPERSET OF OR EQUAL TO # reflexsuperset */
- { 0x2295, 0xC5 }, /* CIRCLED PLUS # circleplus */
- { 0x2297, 0xC4 }, /* CIRCLED TIMES # circlemultiply */
- { 0x22A5, 0x5E }, /* UP TACK # perpendicular */
- { 0x22C5, 0xD7 }, /* DOT OPERATOR # dotmath */
- { 0x2320, 0xF3 }, /* TOP HALF INTEGRAL # integraltp */
- { 0x2321, 0xF5 }, /* BOTTOM HALF INTEGRAL # integralbt */
- { 0x2329, 0xE1 }, /* LEFT-POINTING ANGLE BRACKET # angleleft */
- { 0x232A, 0xF1 }, /* RIGHT-POINTING ANGLE BRACKET # angleright */
- { 0x25CA, 0xE0 }, /* LOZENGE # lozenge */
- { 0x2660, 0xAA }, /* BLACK SPADE SUIT # spade */
- { 0x2663, 0xA7 }, /* BLACK CLUB SUIT # club */
- { 0x2665, 0xA9 }, /* BLACK HEART SUIT # heart */
- { 0x2666, 0xA8 }, /* BLACK DIAMOND SUIT # diamond */
- { 0xF6D9, 0xD3 }, /* COPYRIGHT SIGN SERIF # copyrightserif (CUS) */
- { 0xF6DA, 0xD2 }, /* REGISTERED SIGN SERIF # registerserif (CUS) */
- { 0xF6DB, 0xD4 }, /* TRADE MARK SIGN SERIF # trademarkserif (CUS) */
- { 0xF8E5, 0x60 }, /* RADICAL EXTENDER # radicalex (CUS) */
- { 0xF8E6, 0xBD }, /* VERTICAL ARROW EXTENDER # arrowvertex (CUS) */
- { 0xF8E7, 0xBE }, /* HORIZONTAL ARROW EXTENDER # arrowhorizex (CUS) */
- { 0xF8E8, 0xE2 }, /* REGISTERED SIGN SANS SERIF # registersans (CUS) */
- { 0xF8E9, 0xE3 }, /* COPYRIGHT SIGN SANS SERIF # copyrightsans (CUS) */
- { 0xF8EA, 0xE4 }, /* TRADE MARK SIGN SANS SERIF # trademarksans (CUS) */
- { 0xF8EB, 0xE6 }, /* LEFT PAREN TOP # parenlefttp (CUS) */
- { 0xF8EC, 0xE7 }, /* LEFT PAREN EXTENDER # parenleftex (CUS) */
- { 0xF8ED, 0xE8 }, /* LEFT PAREN BOTTOM # parenleftbt (CUS) */
- { 0xF8EE, 0xE9 }, /* LEFT SQUARE BRACKET TOP # bracketlefttp (CUS) */
- { 0xF8EF, 0xEA }, /* LEFT SQUARE BRACKET EXTENDER # bracketleftex (CUS) */
- { 0xF8F0, 0xEB }, /* LEFT SQUARE BRACKET BOTTOM # bracketleftbt (CUS) */
- { 0xF8F1, 0xEC }, /* LEFT CURLY BRACKET TOP # bracelefttp (CUS) */
- { 0xF8F2, 0xED }, /* LEFT CURLY BRACKET MID # braceleftmid (CUS) */
- { 0xF8F3, 0xEE }, /* LEFT CURLY BRACKET BOTTOM # braceleftbt (CUS) */
- { 0xF8F4, 0xEF }, /* CURLY BRACKET EXTENDER # braceex (CUS) */
- { 0xF8F5, 0xF4 }, /* INTEGRAL EXTENDER # integralex (CUS) */
- { 0xF8F6, 0xF6 }, /* RIGHT PAREN TOP # parenrighttp (CUS) */
- { 0xF8F7, 0xF7 }, /* RIGHT PAREN EXTENDER # parenrightex (CUS) */
- { 0xF8F8, 0xF8 }, /* RIGHT PAREN BOTTOM # parenrightbt (CUS) */
- { 0xF8F9, 0xF9 }, /* RIGHT SQUARE BRACKET TOP # bracketrighttp (CUS) */
- { 0xF8FA, 0xFA }, /* RIGHT SQUARE BRACKET EXTENDER # bracketrightex (CUS) */
- { 0xF8FB, 0xFB }, /* RIGHT SQUARE BRACKET BOTTOM # bracketrightbt (CUS) */
- { 0xF8FC, 0xFC }, /* RIGHT CURLY BRACKET TOP # bracerighttp (CUS) */
- { 0xF8FD, 0xFD }, /* RIGHT CURLY BRACKET MID # bracerightmid (CUS) */
- { 0xF8FE, 0xFE }, /* RIGHT CURLY BRACKET BOTTOM # bracerightbt (CUS) */
+static const FT_Encoding fcFontEncodings[] = {
+ FT_ENCODING_UNICODE,
+ FT_ENCODING_MS_SYMBOL
};
-static const FcCharMap AdobeSymbol = {
- AdobeSymbolEnt,
- sizeof (AdobeSymbolEnt) / sizeof (AdobeSymbolEnt[0]),
-};
-
-static const FcFontDecode fcFontDecoders[] = {
- { ft_encoding_unicode, 0, (1 << 21) - 1 },
- { ft_encoding_symbol, &AdobeSymbol, (1 << 16) - 1 },
-};
-
-#define NUM_DECODE (int) (sizeof (fcFontDecoders) / sizeof (fcFontDecoders[0]))
-
-static const FcChar32 prefer_unicode[] = {
- 0x20ac, /* EURO SIGN */
-};
-
-#define NUM_PREFER_UNICODE (int) (sizeof (prefer_unicode) / sizeof (prefer_unicode[0]))
-
-FcChar32
-FcFreeTypeUcs4ToPrivate (FcChar32 ucs4, const FcCharMap *map)
-{
- int low, high, mid;
- FcChar16 bmp;
-
- low = 0;
- high = map->nent - 1;
- if (ucs4 < map->ent[low].bmp || map->ent[high].bmp < ucs4)
- return ~0;
- while (low <= high)
- {
- mid = (high + low) >> 1;
- bmp = map->ent[mid].bmp;
- if (ucs4 == bmp)
- return (FT_ULong) map->ent[mid].encode;
- if (ucs4 < bmp)
- high = mid - 1;
- else
- low = mid + 1;
- }
- return ~0;
-}
-
-FcChar32
-FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map)
-{
- int i;
-
- for (i = 0; i < map->nent; i++)
- if (map->ent[i].encode == private)
- return (FcChar32) map->ent[i].bmp;
- return ~0;
-}
-
-const FcCharMap *
-FcFreeTypeGetPrivateMap (FT_Encoding encoding)
-{
- int i;
-
- for (i = 0; i < NUM_DECODE; i++)
- if (fcFontDecoders[i].encoding == encoding)
- return fcFontDecoders[i].map;
- return 0;
-}
+#define NUM_DECODE (int) (sizeof (fcFontEncodings) / sizeof (fcFontEncodings[0]))
#include "../fc-glyphname/fcglyphname.h"
@@ -2237,8 +2134,6 @@ FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4)
{
int initial, offset, decode;
FT_UInt glyphindex;
- FcChar32 charcode;
- int p;
initial = 0;
@@ -2251,37 +2146,39 @@ FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4)
if (face->charmap)
{
for (; initial < NUM_DECODE; initial++)
- if (fcFontDecoders[initial].encoding == face->charmap->encoding)
+ if (fcFontEncodings[initial] == face->charmap->encoding)
break;
if (initial == NUM_DECODE)
initial = 0;
}
- for (p = 0; p < NUM_PREFER_UNICODE; p++)
- if (ucs4 == prefer_unicode[p])
- {
- initial = 0;
- break;
- }
/*
* Check each encoding for the glyph, starting with the current one
*/
for (offset = 0; offset < NUM_DECODE; offset++)
{
decode = (initial + offset) % NUM_DECODE;
- if (!face->charmap || face->charmap->encoding != fcFontDecoders[decode].encoding)
- if (FT_Select_Charmap (face, fcFontDecoders[decode].encoding) != 0)
+ if (!face->charmap || face->charmap->encoding != fcFontEncodings[decode])
+ if (FT_Select_Charmap (face, fcFontEncodings[decode]) != 0)
continue;
- if (fcFontDecoders[decode].map)
- {
- charcode = FcFreeTypeUcs4ToPrivate (ucs4, fcFontDecoders[decode].map);
- if (charcode == ~0U)
- continue;
- }
- else
- charcode = ucs4;
- glyphindex = FT_Get_Char_Index (face, (FT_ULong) charcode);
+ glyphindex = FT_Get_Char_Index (face, (FT_ULong) ucs4);
if (glyphindex)
return glyphindex;
+ if (ucs4 < 0x100 && face->charmap &&
+ face->charmap->encoding == FT_ENCODING_MS_SYMBOL)
+ {
+ /* For symbol-encoded OpenType fonts, we duplicate the
+ * U+F000..F0FF range at U+0000..U+00FF. That's what
+ * Windows seems to do, and that's hinted about at:
+ * http://www.microsoft.com/typography/otspec/recom.htm
+ * under "Non-Standard (Symbol) Fonts".
+ *
+ * See thread with subject "Webdings and other MS symbol
+ * fonts don't display" on mailing list from May 2015.
+ */
+ glyphindex = FT_Get_Char_Index (face, (FT_ULong) ucs4 + 0xF000);
+ if (glyphindex)
+ return glyphindex;
+ }
}
#if HAVE_FT_HAS_PS_GLYPH_NAMES
/*
@@ -2372,9 +2269,7 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing
#endif
FcCharSet *fcs;
FcCharLeaf *leaf;
- const FcCharMap *map;
int o;
- int i;
FT_UInt glyph;
FT_Pos advance, advance_one = 0, advance_two = 0;
FcBool has_advance = FcFalse, fixed_advance = FcTrue, dual_advance = FcFalse;
@@ -2397,62 +2292,9 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing
#endif
for (o = 0; o < NUM_DECODE; o++)
{
- if (FT_Select_Charmap (face, fcFontDecoders[o].encoding) != 0)
+ if (FT_Select_Charmap (face, fcFontEncodings[o]) != 0)
continue;
- map = fcFontDecoders[o].map;
- if (map)
- {
- /*
- * Non-Unicode tables are easy; there's a list of all possible
- * characters
- */
- for (i = 0; i < map->nent; i++)
- {
- ucs4 = map->ent[i].bmp;
- glyph = FT_Get_Char_Index (face, map->ent[i].encode);
- if (glyph &&
- FcFreeTypeCheckGlyph (face, ucs4, glyph, blanks, &advance, using_strike))
- {
- /*
- * ignore glyphs with zero advance. They’re
- * combining characters, and while their behaviour
- * isn’t well defined for monospaced applications in
- * Unicode, there are many fonts which include
- * zero-width combining characters in otherwise
- * monospaced fonts.
- */
- if (advance)
- {
- if (!has_advance)
- {
- has_advance = FcTrue;
- advance_one = advance;
- }
- else if (!APPROXIMATELY_EQUAL (advance, advance_one))
- {
- if (fixed_advance)
- {
- dual_advance = FcTrue;
- fixed_advance = FcFalse;
- advance_two = advance;
- }
- else if (!APPROXIMATELY_EQUAL (advance, advance_two))
- dual_advance = FcFalse;
- }
- }
- leaf = FcCharSetFindLeafCreate (fcs, ucs4);
- if (!leaf)
- goto bail1;
- leaf->map[(ucs4 & 0xff) >> 5] |= (1 << (ucs4 & 0x1f));
-#ifdef CHECK
- if (ucs4 > font_max)
- font_max = ucs4;
-#endif
- }
- }
- }
- else
{
page = ~0;
leaf = NULL;
@@ -2497,6 +2339,23 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing
}
ucs4 = FT_Get_Next_Char (face, ucs4, &glyph);
}
+ if (fcFontEncodings[o] == FT_ENCODING_MS_SYMBOL)
+ {
+ /* For symbol-encoded OpenType fonts, we duplicate the
+ * U+F000..F0FF range at U+0000..U+00FF. That's what
+ * Windows seems to do, and that's hinted about at:
+ * http://www.microsoft.com/typography/otspec/recom.htm
+ * under "Non-Standard (Symbol) Fonts".
+ *
+ * See thread with subject "Webdings and other MS symbol
+ * fonts don't display" on mailing list from May 2015.
+ */
+ for (ucs4 = 0xF000; ucs4 < 0xF100; ucs4++)
+ {
+ if (FcCharSetHasChar (fcs, ucs4))
+ FcCharSetAddChar (fcs, ucs4 - 0xF000);
+ }
+ }
#ifdef CHECK
for (ucs4 = 0; ucs4 < 0x10000; ucs4++)
{
@@ -2511,6 +2370,8 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing
}
#endif
}
+
+ break;
}
#if HAVE_FT_HAS_PS_GLYPH_NAMES
/*
diff --git a/chromium/third_party/fontconfig/src/src/fcfs.c b/chromium/third_party/fontconfig/src/src/fcfs.c
index 941abba8f40..21c6c7cbb0e 100644
--- a/chromium/third_party/fontconfig/src/src/fcfs.c
+++ b/chromium/third_party/fontconfig/src/src/fcfs.c
@@ -122,6 +122,28 @@ FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s)
return s_serialize;
}
+
+FcFontSet *
+FcFontSetDeserialize (const FcFontSet *set)
+{
+ int i;
+ FcFontSet *new = FcFontSetCreate ();
+
+ if (!new)
+ return NULL;
+ for (i = 0; i < set->nfont; i++)
+ {
+ if (!FcFontSetAdd (new, FcPatternDuplicate (FcFontSetFont (set, i))))
+ goto bail;
+ }
+
+ return new;
+bail:
+ FcFontSetDestroy (new);
+
+ return NULL;
+}
+
#define __fcfs__
#include "fcaliastail.h"
#undef __fcfs__
diff --git a/chromium/third_party/fontconfig/src/src/fchash.c b/chromium/third_party/fontconfig/src/src/fchash.c
deleted file mode 100644
index 38300028c8e..00000000000
--- a/chromium/third_party/fontconfig/src/src/fchash.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * fontconfig/src/fchash.c
- *
- * Copyright © 2003 Keith Packard
- * Copyright © 2013 Red Hat, Inc.
- * Red Hat Author(s): Akira TAGOH
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the author(s) not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. The authors make no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-#include "fcint.h"
-#include <stdio.h>
-#include <string.h>
-
-#define ROTRN(w, v, n) ((((FcChar32)v) >> n) | (((FcChar32)v) << (w - n)))
-#define ROTR32(v, n) ROTRN(32, v, n)
-#define SHR(v, n) (v >> n)
-#define Ch(x, y, z) ((x & y) ^ (~x & z))
-#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
-#define SS0(x) (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22))
-#define SS1(x) (ROTR32(x, 6) ^ ROTR32(x, 11) ^ ROTR32(x, 25))
-#define ss0(x) (ROTR32(x, 7) ^ ROTR32(x, 18) ^ SHR(x, 3))
-#define ss1(x) (ROTR32(x, 17) ^ ROTR32(x, 19) ^ SHR(x, 10))
-
-
-static FcChar32 *
-FcHashInitSHA256Digest (void)
-{
- int i;
- static const FcChar32 h[] = {
- 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL,
- 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL
- };
- FcChar32 *ret = malloc (sizeof (FcChar32) * 8);
-
- if (!ret)
- return NULL;
-
- for (i = 0; i < 8; i++)
- ret[i] = h[i];
-
- return ret;
-}
-
-static void
-FcHashComputeSHA256Digest (FcChar32 *hash,
- const char *block)
-{
- static const FcChar32 k[] = {
- 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
- 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
- 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
- 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
- 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
- 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
- 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
- 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
- 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
- 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
- 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
- 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
- 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
- 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
- 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
- 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL
- };
- FcChar32 w[64], i, j, t1, t2;
- FcChar32 a, b, c, d, e, f, g, h;
-
-#define H(n) (hash[n])
-
- a = H(0);
- b = H(1);
- c = H(2);
- d = H(3);
- e = H(4);
- f = H(5);
- g = H(6);
- h = H(7);
-
- for (i = 0; i < 16; i++)
- {
- j = (block[(i * 4) + 0] & 0xff) << (8 * 3);
- j |= (block[(i * 4) + 1] & 0xff) << (8 * 2);
- j |= (block[(i * 4) + 2] & 0xff) << (8 * 1);
- j |= (block[(i * 4) + 3] & 0xff);
- w[i] = j;
- }
- for (i = 16; i < 64; i++)
- w[i] = ss1(w[i - 2]) + w[i - 7] + ss0(w[i - 15]) + w[i - 16];
-
- for (i = 0; i < 64; i++)
- {
- t1 = h + SS1(e) + Ch(e, f, g) + k[i] + w[i];
- t2 = SS0(a) + Maj(a, b, c);
- h = g;
- g = f;
- f = e;
- e = d + t1;
- d = c;
- c = b;
- b = a;
- a = t1 + t2;
- }
-
- H(0) += a;
- H(1) += b;
- H(2) += c;
- H(3) += d;
- H(4) += e;
- H(5) += f;
- H(6) += g;
- H(7) += h;
-
-#undef H
-}
-
-static FcChar8 *
-FcHashSHA256ToString (FcChar32 *hash)
-{
- FcChar8 *ret = NULL;
- static const char hex[] = "0123456789abcdef";
- int i, j;
-
- if (hash)
- {
- ret = malloc (sizeof (FcChar8) * (8 * 8 + 7 + 1));
- if (!ret)
- return NULL;
- memcpy (ret, "sha256:", 7);
-#define H(n) hash[n]
- for (i = 0; i < 8; i++)
- {
- FcChar32 v = H(i);
-
- for (j = 0; j < 8; j++)
- ret[7 + (i * 8) + j] = hex[(v >> (28 - j * 4)) & 0xf];
- }
- ret[7 + i * 8] = 0;
-#undef H
- free (hash);
- }
-
- return ret;
-}
-
-FcChar8 *
-FcHashGetSHA256Digest (const FcChar8 *input_strings,
- size_t len)
-{
- size_t i, round_len = len / 64;
- char block[64];
- FcChar32 *ret = FcHashInitSHA256Digest ();
-
- if (!ret)
- return NULL;
-
- for (i = 0; i < round_len; i++)
- {
- FcHashComputeSHA256Digest (ret, (const char *)&input_strings[i * 64]);
- }
- /* padding */
- if ((len % 64) != 0)
- memcpy (block, &input_strings[len / 64], len % 64);
- memset (&block[len % 64], 0, 64 - (len % 64));
- block[len % 64] = 0x80;
- if ((64 - (len % 64)) < 9)
- {
- /* process a block once */
- FcHashComputeSHA256Digest (ret, block);
- memset (block, 0, 64);
- }
- /* set input size at the end */
- len *= 8;
- block[63 - 0] = (uint64_t)len & 0xff;
- block[63 - 1] = ((uint64_t)len >> 8) & 0xff;
- block[63 - 2] = ((uint64_t)len >> 16) & 0xff;
- block[63 - 3] = ((uint64_t)len >> 24) & 0xff;
- block[63 - 4] = ((uint64_t)len >> 32) & 0xff;
- block[63 - 5] = ((uint64_t)len >> 40) & 0xff;
- block[63 - 6] = ((uint64_t)len >> 48) & 0xff;
- block[63 - 7] = ((uint64_t)len >> 56) & 0xff;
- FcHashComputeSHA256Digest (ret, block);
-
- return FcHashSHA256ToString (ret);
-}
-
-FcChar8 *
-FcHashGetSHA256DigestFromFile (const FcChar8 *filename)
-{
- FILE *fp = fopen ((const char *)filename, "rb");
- char ibuf[64];
- FcChar32 *ret;
- size_t len;
- struct stat st;
-
- if (!fp)
- return NULL;
-
- if (FcStat (filename, &st))
- goto bail0;
-
- ret = FcHashInitSHA256Digest ();
- if (!ret)
- goto bail0;
-
- while (!feof (fp))
- {
- if ((len = fread (ibuf, sizeof (char), 64, fp)) < 64)
- {
- uint64_t v;
-
- /* add a padding */
- memset (&ibuf[len], 0, 64 - len);
- ibuf[len] = 0x80;
- if ((64 - len) < 9)
- {
- /* process a block once */
- FcHashComputeSHA256Digest (ret, ibuf);
- memset (ibuf, 0, 64);
- }
- /* set input size at the end */
- v = (long)st.st_size * 8;
- ibuf[63 - 0] = v & 0xff;
- ibuf[63 - 1] = (v >> 8) & 0xff;
- ibuf[63 - 2] = (v >> 16) & 0xff;
- ibuf[63 - 3] = (v >> 24) & 0xff;
- ibuf[63 - 4] = (v >> 32) & 0xff;
- ibuf[63 - 5] = (v >> 40) & 0xff;
- ibuf[63 - 6] = (v >> 48) & 0xff;
- ibuf[63 - 7] = (v >> 56) & 0xff;
- FcHashComputeSHA256Digest (ret, ibuf);
- break;
- }
- else
- {
- FcHashComputeSHA256Digest (ret, ibuf);
- }
- }
- fclose (fp);
-
- return FcHashSHA256ToString (ret);
-
-bail0:
- fclose (fp);
-
- return NULL;
-}
-
-FcChar8 *
-FcHashGetSHA256DigestFromMemory (const char *fontdata,
- size_t length)
-{
- char ibuf[64];
- FcChar32 *ret;
- size_t i = 0;
-
- ret = FcHashInitSHA256Digest ();
- if (!ret)
- return NULL;
-
- while (i <= length)
- {
- if ((length - i) < 64)
- {
- uint64_t v;
- size_t n;
-
- /* add a padding */
- n = length - i;
- if (n > 0)
- memcpy (ibuf, &fontdata[i], n);
- memset (&ibuf[n], 0, 64 - n);
- ibuf[n] = 0x80;
- if ((64 - n) < 9)
- {
- /* process a block once */
- FcHashComputeSHA256Digest (ret, ibuf);
- memset (ibuf, 0, 64);
- }
- /* set input size at the end */
- v = length * 8;
- ibuf[63 - 0] = v & 0xff;
- ibuf[63 - 1] = (v >> 8) & 0xff;
- ibuf[63 - 2] = (v >> 16) & 0xff;
- ibuf[63 - 3] = (v >> 24) & 0xff;
- ibuf[63 - 4] = (v >> 32) & 0xff;
- ibuf[63 - 5] = (v >> 40) & 0xff;
- ibuf[63 - 6] = (v >> 48) & 0xff;
- ibuf[63 - 7] = (v >> 56) & 0xff;
- FcHashComputeSHA256Digest (ret, ibuf);
- break;
- }
- else
- {
- FcHashComputeSHA256Digest (ret, &fontdata[i]);
- }
- i += 64;
- }
-
- return FcHashSHA256ToString (ret);
-}
diff --git a/chromium/third_party/fontconfig/src/src/fcinit.c b/chromium/third_party/fontconfig/src/src/fcinit.c
index b8d5d060c71..5e7c2f15662 100644
--- a/chromium/third_party/fontconfig/src/src/fcinit.c
+++ b/chromium/third_party/fontconfig/src/src/fcinit.c
@@ -36,13 +36,14 @@
#endif
static FcConfig *
-FcInitFallbackConfig (void)
+FcInitFallbackConfig (const FcChar8 *sysroot)
{
FcConfig *config;
config = FcConfigCreate ();
if (!config)
goto bail0;
+ FcConfigSetSysRoot (config, sysroot);
if (!FcConfigAddDir (config, (FcChar8 *) FC_DEFAULT_FONTS))
goto bail1;
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR))
@@ -78,20 +79,35 @@ FcInitLoadOwnConfig (FcConfig *config)
if (!FcConfigParseAndLoad (config, 0, FcTrue))
{
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
+ FcConfig *fallback = FcInitFallbackConfig (sysroot);
+
FcConfigDestroy (config);
- return FcInitFallbackConfig ();
+
+ return fallback;
}
if (config->cacheDirs && config->cacheDirs->num == 0)
{
FcChar8 *prefix, *p;
size_t plen;
+ FcBool have_own = FcFalse;
+ char *env_file, *env_path;
- fprintf (stderr,
- "Fontconfig warning: no <cachedir> elements found. Check configuration.\n");
- fprintf (stderr,
- "Fontconfig warning: adding <cachedir>%s</cachedir>\n",
- FC_CACHEDIR);
+ env_file = getenv ("FONTCONFIG_FILE");
+ env_path = getenv ("FONTCONFIG_PATH");
+ if ((env_file != NULL && env_file[0] != 0) ||
+ (env_path != NULL && env_path[0] != 0))
+ have_own = FcTrue;
+
+ if (!have_own)
+ {
+ fprintf (stderr,
+ "Fontconfig warning: no <cachedir> elements found. Check configuration.\n");
+ fprintf (stderr,
+ "Fontconfig warning: adding <cachedir>%s</cachedir>\n",
+ FC_CACHEDIR);
+ }
prefix = FcConfigXdgCacheHome ();
if (!prefix)
goto bail;
@@ -102,19 +118,26 @@ FcInitLoadOwnConfig (FcConfig *config)
prefix = p;
memcpy (&prefix[plen], FC_DIR_SEPARATOR_S "fontconfig", 11);
prefix[plen + 11] = 0;
- fprintf (stderr,
- "Fontconfig warning: adding <cachedir prefix=\"xdg\">fontconfig</cachedir>\n");
+ if (!have_own)
+ fprintf (stderr,
+ "Fontconfig warning: adding <cachedir prefix=\"xdg\">fontconfig</cachedir>\n");
if (!FcConfigAddCacheDir (config, (FcChar8 *) FC_CACHEDIR) ||
!FcConfigAddCacheDir (config, (FcChar8 *) prefix))
{
+ FcConfig *fallback;
+ const FcChar8 *sysroot;
+
bail:
+ sysroot = FcConfigGetSysRoot (config);
fprintf (stderr,
"Fontconfig error: out of memory");
if (prefix)
FcStrFree (prefix);
+ fallback = FcInitFallbackConfig (sysroot);
FcConfigDestroy (config);
- return FcInitFallbackConfig ();
+
+ return fallback;
}
FcStrFree (prefix);
}
@@ -169,6 +192,8 @@ FcFini (void)
FcConfigFini ();
FcCacheFini ();
FcDefaultFini ();
+ FcObjectFini ();
+ FcConfigPathFini ();
}
/*
@@ -178,11 +203,18 @@ FcBool
FcInitReinitialize (void)
{
FcConfig *config;
+ FcBool ret;
config = FcInitLoadConfigAndFonts ();
if (!config)
return FcFalse;
- return FcConfigSetCurrent (config);
+ ret = FcConfigSetCurrent (config);
+ /* FcConfigSetCurrent() increases the refcount.
+ * decrease it here to avoid the memory leak.
+ */
+ FcConfigDestroy (config);
+
+ return ret;
}
FcBool
@@ -191,6 +223,8 @@ FcInitBringUptoDate (void)
FcConfig *config = FcConfigGetCurrent ();
time_t now;
+ if (!config)
+ return FcFalse;
/*
* rescanInterval == 0 disables automatic up to date
*/
diff --git a/chromium/third_party/fontconfig/src/src/fcint.h b/chromium/third_party/fontconfig/src/src/fcint.h
index 362ea6f99ad..ac911ad4076 100644
--- a/chromium/third_party/fontconfig/src/src/fcint.h
+++ b/chromium/third_party/fontconfig/src/src/fcint.h
@@ -38,6 +38,8 @@
#include <assert.h>
#include <errno.h>
#include <limits.h>
+#include <float.h>
+#include <math.h>
#include <unistd.h>
#include <stddef.h>
#include <sys/types.h>
@@ -85,6 +87,7 @@ extern pfnSHGetFolderPathA pSHGetFolderPathA;
#define FC_DBG_SCANV 256
#define FC_DBG_CONFIG 1024
#define FC_DBG_LANGSET 2048
+#define FC_DBG_MATCH2 4096
#define _FC_ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1] FC_UNUSED
#define _FC_ASSERT_STATIC0(_line, _cond) _FC_ASSERT_STATIC1 (_line, (_cond))
@@ -161,6 +164,7 @@ typedef enum _FcValueBinding {
#define FcValueString(v) FcPointerMember(v,u.s,FcChar8)
#define FcValueCharSet(v) FcPointerMember(v,u.c,const FcCharSet)
#define FcValueLangSet(v) FcPointerMember(v,u.l,const FcLangSet)
+#define FcValueRange(v) FcPointerMember(v,u.r,const FcRange)
typedef struct _FcValueList *FcValueListPtr;
@@ -244,20 +248,26 @@ typedef struct _FcExprName {
FcMatchKind kind;
} FcExprName;
+struct _FcRange {
+ double begin;
+ double end;
+};
+
typedef struct _FcExpr {
FcOp op;
union {
- int ival;
- double dval;
- const FcChar8 *sval;
- FcExprMatrix *mexpr;
- FcBool bval;
- FcCharSet *cval;
- FcLangSet *lval;
-
- FcExprName name;
- const FcChar8 *constant;
+ int ival;
+ double dval;
+ const FcChar8 *sval;
+ FcExprMatrix *mexpr;
+ FcBool bval;
+ FcCharSet *cval;
+ FcLangSet *lval;
+ FcRange *rval;
+
+ FcExprName name;
+ const FcChar8 *constant;
struct {
struct _FcExpr *left, *right;
} tree;
@@ -329,11 +339,19 @@ struct _FcCharSet {
FcCharLeaf))
#define FcCharSetNumbers(c) FcOffsetMember(c,numbers_offset,FcChar16)
+#define FCSS_DEFAULT 0 /* default behavior */
+#define FCSS_ALLOW_DUPLICATES 1 /* allows for duplicate strings in the set */
+#define FCSS_GROW_BY_64 2 /* grows buffer by 64 elements instead of 1 */
+
+#define FcStrSetHasControlBit(s,c) (s->control & c)
+#define FcStrSetHasControlBits(s,c) ( (c) == (s->control & (c)) )
+
struct _FcStrSet {
FcRef ref; /* reference count */
int num;
int size;
FcChar8 **strs;
+ unsigned int control; /* control bits for set behavior */
};
struct _FcStrList {
@@ -352,13 +370,14 @@ typedef struct _FcStrBuf {
struct _FcCache {
unsigned int magic; /* FC_CACHE_MAGIC_MMAP or FC_CACHE_ALLOC */
- int version; /* FC_CACHE_CONTENT_VERSION */
+ int version; /* FC_CACHE_VERSION_NUMBER */
intptr_t size; /* size of file */
intptr_t dir; /* offset to dir name */
intptr_t dirs; /* offset to subdirs */
int dirs_count; /* number of subdir strings */
intptr_t set; /* offset to font set */
int checksum; /* checksum of directory state */
+ int64_t checksum_nano; /* checksum of directory state */
};
#undef FcCacheDir
@@ -444,7 +463,6 @@ typedef struct _FcCaseFold {
#define FC_CACHE_MAGIC_MMAP 0xFC02FC04
#define FC_CACHE_MAGIC_ALLOC 0xFC02FC05
-#define FC_CACHE_CONTENT_VERSION 4
struct _FcAtomic {
FcChar8 *file; /* original file name */
@@ -532,13 +550,6 @@ typedef struct _FcFileTime {
typedef struct _FcCharMap FcCharMap;
-typedef struct _FcRange FcRange;
-
-struct _FcRange {
- FcChar32 begin;
- FcChar32 end;
-};
-
typedef struct _FcStatFS FcStatFS;
struct _FcStatFS {
@@ -567,6 +578,9 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config);
FcPrivate FcCache *
FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcStrSet *dirs);
+FcPrivate FcCache *
+FcDirCacheRebuild (FcCache *cache, struct stat *dir_stat, FcStrSet *dirs);
+
FcPrivate FcBool
FcDirCacheWrite (FcCache *cache, FcConfig *config);
@@ -585,6 +599,13 @@ FcCacheFini (void);
FcPrivate void
FcDirCacheReference (FcCache *cache, int nref);
+FcPrivate int
+FcDirCacheLock (const FcChar8 *dir,
+ FcConfig *config);
+
+FcPrivate void
+FcDirCacheUnlock (int fd);
+
/* fccfg.c */
FcPrivate FcBool
@@ -698,6 +719,9 @@ FcPrivate FcLangSet *
FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l);
/* fccharset.c */
+FcPrivate FcCharSet *
+FcCharSetPromote (FcValuePromotionBuffer *vbuf);
+
FcPrivate void
FcLangCharSetPopulate (void);
@@ -786,6 +810,9 @@ FcSubstPrint (const FcSubst *subst);
FcPrivate void
FcCharSetPrint (const FcCharSet *c);
+FcPrivate void
+FcPatternPrint2 (FcPattern *p1, FcPattern *p2, const FcObjectSet *os);
+
extern FcPrivate int FcDebugVal;
#define FcDebug() (FcDebugVal)
@@ -838,17 +865,8 @@ FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s);
FcPrivate FcFontSet *
FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s);
-/* fchash.c */
-FcPrivate FcChar8 *
-FcHashGetSHA256Digest (const FcChar8 *input_strings,
- size_t len);
-
-FcPrivate FcChar8 *
-FcHashGetSHA256DigestFromFile (const FcChar8 *filename);
-
-FcPrivate FcChar8 *
-FcHashGetSHA256DigestFromMemory (const char *fontdata,
- size_t length);
+FcPrivate FcFontSet *
+FcFontSetDeserialize (const FcFontSet *set);
/* fcinit.c */
FcPrivate FcConfig *
@@ -859,6 +877,9 @@ FcInitLoadOwnConfigAndFonts (FcConfig *config);
/* fcxml.c */
FcPrivate void
+FcConfigPathFini (void);
+
+FcPrivate void
FcTestDestroy (FcTest *test);
FcPrivate void
@@ -1002,6 +1023,9 @@ FcPatternObjectAddBool (FcPattern *p, FcObject object, FcBool b);
FcPrivate FcBool
FcPatternObjectAddLangSet (FcPattern *p, FcObject object, const FcLangSet *ls);
+FcPrivate FcBool
+FcPatternObjectAddRange (FcPattern *p, FcObject object, const FcRange *r);
+
FcPrivate FcResult
FcPatternObjectGetInteger (const FcPattern *p, FcObject object, int n, int *i);
@@ -1023,9 +1047,15 @@ FcPatternObjectGetBool (const FcPattern *p, FcObject object, int n, FcBool *b);
FcPrivate FcResult
FcPatternObjectGetLangSet (const FcPattern *p, FcObject object, int n, FcLangSet **ls);
+FcPrivate FcResult
+FcPatternObjectGetRange (const FcPattern *p, FcObject object, int id, FcRange **r);
+
FcPrivate FcBool
FcPatternAppend (FcPattern *p, FcPattern *s);
+FcPrivate int
+FcPatternPosition (const FcPattern *p, const char *object);
+
FcPrivate FcChar32
FcStringHash (const FcChar8 *s);
@@ -1050,6 +1080,26 @@ extern FcPrivate const FcMatrix FcIdentityMatrix;
FcPrivate void
FcMatrixFree (FcMatrix *mat);
+/* fcrange.c */
+
+FcPrivate FcRange *
+FcRangePromote (double v, FcValuePromotionBuffer *vbuf);
+
+FcPrivate FcBool
+FcRangeIsInRange (const FcRange *a, const FcRange *b);
+
+FcPrivate FcBool
+FcRangeCompare (FcOp op, const FcRange *a, const FcRange *b);
+
+FcPrivate FcChar32
+FcRangeHash (const FcRange *r);
+
+FcPrivate FcBool
+FcRangeSerializeAlloc (FcSerialize *serialize, const FcRange *r);
+
+FcPrivate FcRange *
+FcRangeSerialize (FcSerialize *serialize, const FcRange *r);
+
/* fcstat.c */
FcPrivate int
@@ -1065,6 +1115,9 @@ FcPrivate FcBool
FcIsFsMtimeBroken (const FcChar8 *dir);
/* fcstr.c */
+FcPrivate FcStrSet *
+FcStrSetCreateEx (unsigned int control);
+
FcPrivate FcBool
FcStrSetAddLangs (FcStrSet *strs, const char *languages);
@@ -1098,12 +1151,6 @@ FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
FcPrivate int
FcStrCmpIgnoreCaseAndDelims (const FcChar8 *s1, const FcChar8 *s2, const FcChar8 *delims);
-FcPrivate FcBool
-FcStrRegexCmp (const FcChar8 *s, const FcChar8 *regex);
-
-FcPrivate FcBool
-FcStrRegexCmpIgnoreCase (const FcChar8 *s, const FcChar8 *regex);
-
FcPrivate const FcChar8 *
FcStrContainsIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2);
@@ -1144,6 +1191,9 @@ FcStrSerialize (FcSerialize *serialize, const FcChar8 *str);
/* fcobjs.c */
+FcPrivate void
+FcObjectFini (void);
+
FcPrivate FcObject
FcObjectLookupIdByName (const char *str);
diff --git a/chromium/third_party/fontconfig/src/src/fclang.c b/chromium/third_party/fontconfig/src/src/fclang.c
index 9f685f6fdff..b1fd1bcae67 100644
--- a/chromium/third_party/fontconfig/src/src/fclang.c
+++ b/chromium/third_party/fontconfig/src/src/fclang.c
@@ -720,19 +720,22 @@ FcLangSetPromote (const FcChar8 *lang, FcValuePromotionBuffer *vbuf)
memset (buf->ls.map, '\0', sizeof (buf->ls.map));
buf->ls.map_size = NUM_LANG_SET_MAP;
buf->ls.extra = 0;
- id = FcLangSetIndex (lang);
- if (id > 0)
+ if (lang)
{
- FcLangSetBitSet (&buf->ls, id);
- }
- else
- {
- buf->ls.extra = &buf->strs;
- buf->strs.num = 1;
- buf->strs.size = 1;
- buf->strs.strs = &buf->str;
- FcRefInit (&buf->strs.ref, 1);
- buf->str = (FcChar8 *) lang;
+ id = FcLangSetIndex (lang);
+ if (id > 0)
+ {
+ FcLangSetBitSet (&buf->ls, id);
+ }
+ else
+ {
+ buf->ls.extra = &buf->strs;
+ buf->strs.num = 1;
+ buf->strs.size = 1;
+ buf->strs.strs = &buf->str;
+ FcRefInit (&buf->strs.ref, 1);
+ buf->str = (FcChar8 *) lang;
+ }
}
return &buf->ls;
}
diff --git a/chromium/third_party/fontconfig/src/src/fclist.c b/chromium/third_party/fontconfig/src/src/fclist.c
index a365098a4d7..d7e8fc09106 100644
--- a/chromium/third_party/fontconfig/src/src/fclist.c
+++ b/chromium/third_party/fontconfig/src/src/fclist.c
@@ -270,9 +270,11 @@ FcListValueHash (FcValue *value)
case FcTypeCharSet:
return FcCharSetCount (v.u.c);
case FcTypeFTFace:
- return (long) v.u.f;
+ return (intptr_t) v.u.f;
case FcTypeLangSet:
return FcLangSetHash (v.u.l);
+ case FcTypeRange:
+ return FcRangeHash (v.u.r);
}
return 0;
}
diff --git a/chromium/third_party/fontconfig/src/src/fcmatch.c b/chromium/third_party/fontconfig/src/src/fcmatch.c
index 627aa1a1696..40efbd3f67b 100644
--- a/chromium/third_party/fontconfig/src/src/fcmatch.c
+++ b/chromium/third_party/fontconfig/src/src/fcmatch.c
@@ -189,6 +189,49 @@ FcCompareSize (FcValue *value1, FcValue *value2)
}
static double
+FcCompareSizeRange (FcValue *v1, FcValue *v2)
+{
+ FcValue value1 = FcValueCanonicalize (v1);
+ FcValue value2 = FcValueCanonicalize (v2);
+ FcRange *r1 = NULL, *r2 = NULL;
+ double ret = -1.0;
+
+ switch ((int) value1.type) {
+ case FcTypeDouble:
+ r1 = FcRangeCreateDouble (value1.u.d, value1.u.d);
+ break;
+ case FcTypeRange:
+ r1 = FcRangeCopy (value1.u.r);
+ break;
+ default:
+ goto bail;
+ }
+ switch ((int) value2.type) {
+ case FcTypeDouble:
+ r2 = FcRangeCreateDouble (value2.u.d, value2.u.d);
+ break;
+ case FcTypeRange:
+ r2 = FcRangeCopy (value2.u.r);
+ break;
+ default:
+ goto bail;
+ }
+
+ if (FcRangeIsInRange (r1, r2))
+ ret = 0.0;
+ else
+ ret = FC_MIN (fabs (r1->end - r2->begin), fabs (r1->begin - r2->end));
+
+bail:
+ if (r1)
+ FcRangeDestroy (r1);
+ if (r2)
+ FcRangeDestroy (r2);
+
+ return ret;
+}
+
+static double
FcCompareFilename (FcValue *v1, FcValue *v2)
{
const FcChar8 *s1 = FcValueString (v1), *s2 = FcValueString (v2);
@@ -202,16 +245,8 @@ FcCompareFilename (FcValue *v1, FcValue *v2)
return 3.0;
}
-static double
-FcCompareHash (FcValue *v1, FcValue *v2)
-{
- const FcChar8 *s1 = FcValueString (v1), *s2 = FcValueString (v2);
- /* Do not match an empty string */
- if (!s1 || !s2 || !s1[0] || !s2[0])
- return 1.0;
- return FcCompareString (v1, v2);
-}
+/* Define priorities to -1 for objects that don't have a compare function. */
#define PRI_NULL(n) \
PRI_ ## n ## _STRONG = -1, \
@@ -226,7 +261,7 @@ FcCompareHash (FcValue *v1, FcValue *v2)
#define PRI_FcCompareCharSet(n) PRI1(n)
#define PRI_FcCompareLang(n) PRI1(n)
#define PRI_FcComparePostScript(n) PRI1(n)
-#define PRI_FcCompareHash(n) PRI1(n)
+#define PRI_FcCompareSizeRange(n) PRI1(n)
#define FC_OBJECT(NAME, Type, Cmp) PRI_##Cmp(NAME)
@@ -236,6 +271,9 @@ typedef enum _FcMatcherPriorityDummy {
#undef FC_OBJECT
+
+/* Canonical match priority order. */
+
#undef PRI1
#define PRI1(n) \
PRI_ ## n, \
@@ -243,10 +281,10 @@ typedef enum _FcMatcherPriorityDummy {
PRI_ ## n ## _WEAK = PRI_ ## n
typedef enum _FcMatcherPriority {
- PRI1(HASH),
PRI1(FILE),
PRI1(FONTFORMAT),
PRI1(SCALABLE),
+ PRI1(COLOR),
PRI1(FOUNDRY),
PRI1(CHARSET),
PRI_FAMILY_STRONG,
@@ -254,7 +292,9 @@ typedef enum _FcMatcherPriority {
PRI1(LANG),
PRI_FAMILY_WEAK,
PRI_POSTSCRIPT_NAME_WEAK,
+ PRI1(SYMBOL),
PRI1(SPACING),
+ PRI1(SIZE),
PRI1(PIXEL_SIZE),
PRI1(STYLE),
PRI1(SLANT),
@@ -337,7 +377,7 @@ FcCompareValueList (FcObject object,
best = 1e99;
bestStrong = 1e99;
bestWeak = 1e99;
- j = 1;
+ j = 0;
for (v1 = v1orig; v1; v1 = FcValueListNext(v1))
{
for (v2 = v2orig, k = 0; v2; v2 = FcValueListNext(v2), k++)
@@ -445,7 +485,7 @@ FcFontRenderPrepare (FcConfig *config,
{
FcPattern *new;
int i;
- FcPatternElt *fe, *pe, *fel, *pel;
+ FcPatternElt *fe, *pe;
FcValue v;
FcResult result;
@@ -470,36 +510,25 @@ FcFontRenderPrepare (FcConfig *config,
fe->object == FC_STYLE_OBJECT ||
fe->object == FC_FULLNAME_OBJECT)
{
+ FcPatternElt *fel, *pel;
+
FC_ASSERT_STATIC ((FC_FAMILY_OBJECT + 1) == FC_FAMILYLANG_OBJECT);
FC_ASSERT_STATIC ((FC_STYLE_OBJECT + 1) == FC_STYLELANG_OBJECT);
FC_ASSERT_STATIC ((FC_FULLNAME_OBJECT + 1) == FC_FULLNAMELANG_OBJECT);
fel = FcPatternObjectFindElt (font, fe->object + 1);
pel = FcPatternObjectFindElt (pat, fe->object + 1);
- }
- else
- {
- fel = NULL;
- pel = NULL;
- }
- pe = FcPatternObjectFindElt (pat, fe->object);
- if (pe)
- {
- const FcMatcher *match = FcObjectToMatcher (pe->object, FcFalse);
- if (!FcCompareValueList (pe->object, match,
- FcPatternEltValues(pe),
- FcPatternEltValues(fe), &v, NULL, NULL, &result))
- {
- FcPatternDestroy (new);
- return NULL;
- }
if (fel && pel)
{
+ /* The font has name languages, and pattern asks for specific language(s).
+ * Match on language and and prefer that result.
+ * Note: Currently the code only give priority to first matching language.
+ */
int n = 1, j;
FcValueListPtr l1, l2, ln = NULL, ll = NULL;
+ const FcMatcher *match = FcObjectToMatcher (pel->object, FcTrue);
- match = FcObjectToMatcher (pel->object, FcTrue);
if (!FcCompareValueList (pel->object, match,
FcPatternEltValues (pel),
FcPatternEltValues (fel), NULL, NULL, &n, &result))
@@ -542,9 +571,10 @@ FcFontRenderPrepare (FcConfig *config,
}
else if (fel)
{
+ /* Pattern doesn't ask for specific language. Copy all for name and
+ * lang. */
FcValueListPtr l1, l2;
- copy_lang:
l1 = FcValueListDuplicate (FcPatternEltValues (fe));
l2 = FcValueListDuplicate (FcPatternEltValues (fel));
FcPatternObjectListAdd (new, fe->object, l1, FcFalse);
@@ -552,12 +582,23 @@ FcFontRenderPrepare (FcConfig *config,
continue;
}
+ }
+
+ pe = FcPatternObjectFindElt (pat, fe->object);
+ if (pe)
+ {
+ const FcMatcher *match = FcObjectToMatcher (pe->object, FcFalse);
+ if (!FcCompareValueList (pe->object, match,
+ FcPatternEltValues(pe),
+ FcPatternEltValues(fe), &v, NULL, NULL, &result))
+ {
+ FcPatternDestroy (new);
+ return NULL;
+ }
FcPatternObjectAdd (new, fe->object, v, FcFalse);
}
else
{
- if (fel)
- goto copy_lang;
FcPatternObjectListAdd (new, fe->object,
FcValueListDuplicate (FcPatternEltValues (fe)),
FcTrue);
@@ -648,6 +689,47 @@ FcFontSetMatchInternal (FcFontSet **sets,
printf ("\n");
FcPatternPrint (best);
}
+ if (FcDebug () & FC_DBG_MATCH2)
+ {
+ char *env = getenv ("FC_DBG_MATCH_FILTER");
+ FcObjectSet *os = NULL;
+
+ if (env)
+ {
+ char *ss, *s;
+ char *p;
+ FcBool f = FcTrue;
+
+ ss = s = strdup (env);
+ os = FcObjectSetCreate ();
+ while (f)
+ {
+ size_t len;
+ char *x;
+
+ if (!(p = strchr (s, ',')))
+ {
+ f = FcFalse;
+ len = strlen (s) + 1;
+ }
+ else
+ {
+ len = (p - s) + 1;
+ }
+ x = malloc (sizeof (char) * len);
+ strncpy (x, s, len - 1);
+ x[len - 1] = 0;
+ if (FcObjectFromName (x) > 0)
+ FcObjectSetAdd (os, x);
+ s = p + 1;
+ free (x);
+ }
+ free (ss);
+ }
+ FcPatternPrint2 (p, best, os);
+ if (os)
+ FcObjectSetDestroy (os);
+ }
/* assuming that 'result' is initialized with FcResultNoMatch
* outside this function */
if (best)
@@ -743,6 +825,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr
{
FcBool ret = FcFalse;
FcCharSet *cs;
+ int i;
cs = 0;
if (trim || csp)
@@ -752,7 +835,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr
goto bail;
}
- while (nnode--)
+ for (i = 0; i < nnode; i++)
{
FcSortNode *node = *n++;
FcBool adds_chars = FcFalse;
@@ -776,7 +859,7 @@ FcSortWalk (FcSortNode **n, int nnode, FcFontSet *fs, FcCharSet **csp, FcBool tr
* If this font isn't a subset of the previous fonts,
* add it to the list
*/
- if (!trim || adds_chars)
+ if (!i || !trim || adds_chars)
{
FcPatternReference (node->pattern);
if (FcDebug () & FC_DBG_MATCHV)
diff --git a/chromium/third_party/fontconfig/src/src/fcname.c b/chromium/third_party/fontconfig/src/src/fcname.c
index 712b2fad36c..8be36c70c1c 100644
--- a/chromium/third_party/fontconfig/src/src/fcname.c
+++ b/chromium/third_party/fontconfig/src/src/fcname.c
@@ -87,6 +87,12 @@ FcObjectValidType (FcObject object, FcType type)
if (type == FcTypeLangSet || type == FcTypeString)
return FcTrue;
break;
+ case FcTypeRange:
+ if (type == FcTypeRange ||
+ type == FcTypeDouble ||
+ type == FcTypeInteger)
+ return FcTrue;
+ break;
default:
if (type == t->type)
return FcTrue;
@@ -132,6 +138,8 @@ static const FcConstant _FcBaseConstants[] = {
{ (FcChar8 *) "thin", "weight", FC_WEIGHT_THIN, },
{ (FcChar8 *) "extralight", "weight", FC_WEIGHT_EXTRALIGHT, },
{ (FcChar8 *) "ultralight", "weight", FC_WEIGHT_EXTRALIGHT, },
+ { (FcChar8 *) "demilight", "weight", FC_WEIGHT_DEMILIGHT, },
+ { (FcChar8 *) "semilight", "weight", FC_WEIGHT_DEMILIGHT, },
{ (FcChar8 *) "light", "weight", FC_WEIGHT_LIGHT, },
{ (FcChar8 *) "book", "weight", FC_WEIGHT_BOOK, },
{ (FcChar8 *) "regular", "weight", FC_WEIGHT_REGULAR, },
@@ -273,6 +281,8 @@ FcNameConvert (FcType type, FcChar8 *string)
{
FcValue v;
FcMatrix m;
+ double b, e;
+ char *p;
v.type = type;
switch ((int) v.type) {
@@ -307,6 +317,20 @@ FcNameConvert (FcType type, FcChar8 *string)
if (!v.u.l)
v.type = FcTypeVoid;
break;
+ case FcTypeRange:
+ if (sscanf ((char *) string, "[%lg %lg)", &b, &e) != 2)
+ {
+ v.u.d = strtod ((char *) string, &p);
+ if (p != NULL && p[0] != 0)
+ {
+ v.type = FcTypeVoid;
+ break;
+ }
+ v.type = FcTypeDouble;
+ }
+ else
+ v.u.r = FcRangeCreateDouble (b, e);
+ break;
default:
break;
}
@@ -420,6 +444,8 @@ FcNameParse (const FcChar8 *name)
if ((c = FcNameGetConstant (save)))
{
t = FcNameGetObjectType ((char *) c->object);
+ if (t == NULL)
+ goto bail2;
switch ((int) t->type) {
case FcTypeInteger:
case FcTypeDouble:
@@ -499,6 +525,9 @@ FcNameUnparseValue (FcStrBuf *buf,
return FcNameUnparseLangSet (buf, v.u.l);
case FcTypeFTFace:
return FcTrue;
+ case FcTypeRange:
+ sprintf ((char *) temp, "[%g %g)", v.u.r->begin, v.u.r->end);
+ return FcNameUnparseString (buf, temp, 0);
}
return FcFalse;
}
@@ -531,12 +560,13 @@ FcNameUnparse (FcPattern *pat)
FcChar8 *
FcNameUnparseEscaped (FcPattern *pat, FcBool escape)
{
- FcStrBuf buf;
- FcChar8 buf_static[8192];
+ FcStrBuf buf, buf2;
+ FcChar8 buf_static[8192], buf2_static[256];
int i;
FcPatternElt *e;
FcStrBufInit (&buf, buf_static, sizeof (buf_static));
+ FcStrBufInit (&buf2, buf2_static, sizeof (buf2_static));
e = FcPatternObjectFindElt (pat, FC_FAMILY_OBJECT);
if (e)
{
@@ -546,10 +576,17 @@ FcNameUnparseEscaped (FcPattern *pat, FcBool escape)
e = FcPatternObjectFindElt (pat, FC_SIZE_OBJECT);
if (e)
{
- if (!FcNameUnparseString (&buf, (FcChar8 *) "-", 0))
+ FcChar8 *p;
+
+ if (!FcNameUnparseString (&buf2, (FcChar8 *) "-", 0))
goto bail0;
- if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ? (FcChar8 *) FC_ESCAPE_FIXED : 0))
+ if (!FcNameUnparseValueList (&buf2, FcPatternEltValues(e), escape ? (FcChar8 *) FC_ESCAPE_FIXED : 0))
goto bail0;
+ p = FcStrBufDoneStatic (&buf2);
+ FcStrBufDestroy (&buf2);
+ if (strlen ((const char *)p) > 1)
+ if (!FcStrBufString (&buf, p))
+ goto bail0;
}
for (i = 0; i < NUM_OBJECT_TYPES; i++)
{
diff --git a/chromium/third_party/fontconfig/src/src/fcobjs.c b/chromium/third_party/fontconfig/src/src/fcobjs.c
index bad9824d461..16ff31c4789 100644
--- a/chromium/third_party/fontconfig/src/src/fcobjs.c
+++ b/chromium/third_party/fontconfig/src/src/fcobjs.c
@@ -44,6 +44,28 @@ struct FcObjectOtherTypeInfo {
FcObject id;
} *other_types;
+void
+FcObjectFini (void)
+{
+ struct FcObjectOtherTypeInfo *ots, *ot;
+
+retry:
+ ots = fc_atomic_ptr_get (&other_types);
+ if (!ots)
+ return;
+ if (!fc_atomic_ptr_cmpexch (&other_types, ots, NULL))
+ goto retry;
+
+ while (ots)
+ {
+ ot = ots->next;
+ if (ots->object.object)
+ free (ots->object.object);
+ free (ots);
+ ots = ot;
+ }
+}
+
static FcObjectType *
_FcObjectLookupOtherTypeByName (const char *str, FcObject *id)
{
@@ -62,12 +84,19 @@ retry:
if (!ot)
return NULL;
- ot->object.object = (const char *) FcStrdup (str);
+ ot->object.object = (char *) FcStrdup (str);
ot->object.type = FcTypeUnknown;
ot->id = fc_atomic_int_add (next_id, +1);
+ if (ot->id < (FC_MAX_BASE_OBJECT + FC_EXT_OBJ_INDEX))
+ {
+ fprintf (stderr, "Fontconfig error: No object ID to assign\n");
+ abort ();
+ }
ot->next = ots;
if (!fc_atomic_ptr_cmpexch (&other_types, ots, ot)) {
+ if (ot->object.object)
+ free (ot->object.object);
free (ot);
goto retry;
}
diff --git a/chromium/third_party/fontconfig/src/src/fcobjs.h b/chromium/third_party/fontconfig/src/src/fcobjs.h
index 87c7319e39a..1fc4f656b8e 100644
--- a/chromium/third_party/fontconfig/src/src/fcobjs.h
+++ b/chromium/third_party/fontconfig/src/src/fcobjs.h
@@ -1,3 +1,26 @@
+/*
+ * fontconfig/src/fcobjs.h
+ *
+ * Copyright © 2000 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
/* DON'T REORDER! The order is part of the cache signature. */
FC_OBJECT (FAMILY, FcTypeString, FcCompareFamily)
FC_OBJECT (FAMILYLANG, FcTypeString, NULL)
@@ -8,7 +31,7 @@ FC_OBJECT (FULLNAMELANG, FcTypeString, NULL)
FC_OBJECT (SLANT, FcTypeInteger, FcCompareNumber)
FC_OBJECT (WEIGHT, FcTypeInteger, FcCompareNumber)
FC_OBJECT (WIDTH, FcTypeInteger, FcCompareNumber)
-FC_OBJECT (SIZE, FcTypeDouble, NULL)
+FC_OBJECT (SIZE, FcTypeRange, FcCompareSizeRange)
FC_OBJECT (ASPECT, FcTypeDouble, NULL)
FC_OBJECT (PIXEL_SIZE, FcTypeDouble, FcCompareSize)
FC_OBJECT (SPACING, FcTypeInteger, FcCompareNumber)
@@ -21,7 +44,7 @@ FC_OBJECT (AUTOHINT, FcTypeBool, NULL)
FC_OBJECT (GLOBAL_ADVANCE, FcTypeBool, NULL) /* deprecated */
FC_OBJECT (FILE, FcTypeString, FcCompareFilename)
FC_OBJECT (INDEX, FcTypeInteger, NULL)
-FC_OBJECT (RASTERIZER, FcTypeString, FcCompareString)
+FC_OBJECT (RASTERIZER, FcTypeString, FcCompareString) /* deprecated */
FC_OBJECT (OUTLINE, FcTypeBool, FcCompareBool)
FC_OBJECT (SCALABLE, FcTypeBool, FcCompareBool)
FC_OBJECT (DPI, FcTypeDouble, NULL)
@@ -43,6 +66,8 @@ FC_OBJECT (LCD_FILTER, FcTypeInteger, NULL)
FC_OBJECT (NAMELANG, FcTypeString, NULL)
FC_OBJECT (FONT_FEATURES, FcTypeString, NULL)
FC_OBJECT (PRGNAME, FcTypeString, NULL)
-FC_OBJECT (HASH, FcTypeString, FcCompareHash)
+FC_OBJECT (HASH, FcTypeString, NULL) /* deprecated */
FC_OBJECT (POSTSCRIPT_NAME, FcTypeString, FcComparePostScript)
+FC_OBJECT (COLOR, FcTypeBool, FcCompareBool)
+FC_OBJECT (SYMBOL, FcTypeBool, FcCompareBool)
/* ^-------------- Add new objects here. */
diff --git a/chromium/third_party/fontconfig/src/src/fcobjshash.gperf.h b/chromium/third_party/fontconfig/src/src/fcobjshash.gperf.h
index ca23c026116..1765c949d9a 100644
--- a/chromium/third_party/fontconfig/src/src/fcobjshash.gperf.h
+++ b/chromium/third_party/fontconfig/src/src/fcobjshash.gperf.h
@@ -1,3 +1,26 @@
+/*
+ * fontconfig/src/fcobjshash.gperf.h
+ *
+ * Copyright © 2000 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
%{
CUT_OUT_BEGIN
#include <fontconfig/fontconfig.h>
diff --git a/chromium/third_party/fontconfig/src/src/fcpat.c b/chromium/third_party/fontconfig/src/src/fcpat.c
index 0614ac2c239..3ef1ed21205 100644
--- a/chromium/third_party/fontconfig/src/src/fcpat.c
+++ b/chromium/third_party/fontconfig/src/src/fcpat.c
@@ -33,6 +33,7 @@ FcPatternCreate (void)
p = (FcPattern *) malloc (sizeof (FcPattern));
if (!p)
return 0;
+ memset (p, 0, sizeof (FcPattern));
p->num = 0;
p->size = 0;
p->elts_offset = FcPtrToOffset (p, NULL);
@@ -56,6 +57,9 @@ FcValueDestroy (FcValue v)
case FcTypeLangSet:
FcLangSetDestroy ((FcLangSet *) v.u.l);
break;
+ case FcTypeRange:
+ FcRangeDestroy ((FcRange *) v.u.r);
+ break;
default:
break;
}
@@ -80,6 +84,10 @@ FcValueCanonicalize (const FcValue *v)
new.u.l = FcValueLangSet(v);
new.type = FcTypeLangSet;
break;
+ case FcTypeRange:
+ new.u.r = FcValueRange(v);
+ new.type = FcTypeRange;
+ break;
default:
new = *v;
break;
@@ -111,6 +119,11 @@ FcValueSave (FcValue v)
if (!v.u.l)
v.type = FcTypeVoid;
break;
+ case FcTypeRange:
+ v.u.r = FcRangeCopy (v.u.r);
+ if (!v.u.r)
+ v.type = FcTypeVoid;
+ break;
default:
break;
}
@@ -144,6 +157,9 @@ FcValueListDestroy (FcValueListPtr l)
FcLangSetDestroy
((FcLangSet *) (l->value.u.l));
break;
+ case FcTypeRange:
+ FcRangeDestroy ((FcRange *) (l->value.u.r));
+ break;
default:
break;
}
@@ -266,6 +282,8 @@ FcValueEqual (FcValue va, FcValue vb)
return va.u.f == vb.u.f;
case FcTypeLangSet:
return FcLangSetEqual (va.u.l, vb.u.l);
+ case FcTypeRange:
+ return FcRangeIsInRange (va.u.r, vb.u.r);
}
return FcFalse;
}
@@ -319,6 +337,8 @@ FcValueHash (const FcValue *v)
FcStringHash ((const FcChar8 *) ((FT_Face) v->u.f)->style_name);
case FcTypeLangSet:
return FcLangSetHash (FcValueLangSet(v));
+ case FcTypeRange:
+ return FcRangeHash (v->u.r);
}
return 0;
}
@@ -405,6 +425,12 @@ FcPatternObjectPosition (const FcPattern *p, FcObject object)
return -(mid + 1);
}
+int
+FcPatternPosition (const FcPattern *p, const char *object)
+{
+ return FcPatternObjectPosition (p, FcObjectFromName (object));
+}
+
FcPatternElt *
FcPatternObjectFindElt (const FcPattern *p, FcObject object)
{
@@ -840,6 +866,22 @@ FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls)
return FcPatternAdd (p, object, v, FcTrue);
}
+FcBool
+FcPatternObjectAddRange (FcPattern *p, FcObject object, const FcRange *r)
+{
+ FcValue v;
+
+ v.type = FcTypeRange;
+ v.u.r = (FcRange *)r;
+ return FcPatternObjectAdd (p, object, v, FcTrue);
+}
+
+FcBool
+FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r)
+{
+ return FcPatternObjectAddRange (p, FcObjectFromName (object), r);
+}
+
FcResult
FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v)
{
@@ -1024,6 +1066,31 @@ FcPatternGetLangSet(const FcPattern *p, const char *object, int id, FcLangSet **
return FcResultMatch;
}
+FcResult
+FcPatternObjectGetRange (const FcPattern *p, FcObject object, int id, FcRange **r)
+{
+ FcValue v;
+ FcResult res;
+
+ res = FcPatternObjectGet (p, object, id, &v);
+ if (res != FcResultMatch)
+ return res;
+ switch ((int)v.type) {
+ case FcTypeRange:
+ *r = (FcRange *)v.u.r;
+ break;
+ default:
+ return FcResultTypeMismatch;
+ }
+ return FcResultMatch;
+}
+
+FcResult
+FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r)
+{
+ return FcPatternObjectGetRange (p, FcObjectFromName (object), id, r);
+}
+
FcPattern *
FcPatternDuplicate (const FcPattern *orig)
{
@@ -1229,6 +1296,10 @@ FcValueListSerializeAlloc (FcSerialize *serialize, const FcValueList *vl)
if (!FcLangSetSerializeAlloc (serialize, vl->value.u.l))
return FcFalse;
break;
+ case FcTypeRange:
+ if (!FcRangeSerializeAlloc (serialize, vl->value.u.r))
+ return FcFalse;
+ break;
default:
break;
}
@@ -1244,6 +1315,7 @@ FcValueListSerialize (FcSerialize *serialize, const FcValueList *vl)
FcChar8 *s_serialized;
FcCharSet *c_serialized;
FcLangSet *l_serialized;
+ FcRange *r_serialized;
FcValueList *head_serialized = NULL;
FcValueList *prev_serialized = NULL;
@@ -1302,6 +1374,14 @@ FcValueListSerialize (FcSerialize *serialize, const FcValueList *vl)
l_serialized,
FcLangSet);
break;
+ case FcTypeRange:
+ r_serialized = FcRangeSerialize (serialize, vl->value.u.r);
+ if (!r_serialized)
+ return NULL;
+ vl_serialized->value.u.r = FcPtrToEncodedOffset (&vl_serialized->value,
+ r_serialized,
+ FcRange);
+ break;
default:
break;
}
@@ -1310,6 +1390,7 @@ FcValueListSerialize (FcSerialize *serialize, const FcValueList *vl)
}
return head_serialized;
}
+
#define __fcpat__
#include "fcaliastail.h"
#include "fcftaliastail.h"
diff --git a/chromium/third_party/fontconfig/src/src/fcrange.c b/chromium/third_party/fontconfig/src/src/fcrange.c
new file mode 100644
index 00000000000..f70226c5521
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/src/fcrange.c
@@ -0,0 +1,161 @@
+/*
+ * fontconfig/src/fcrange.c
+ *
+ * Copyright © 2002 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "fcint.h"
+
+
+FcRange *
+FcRangeCreateDouble (double begin, double end)
+{
+ FcRange *ret = malloc (sizeof (FcRange));
+
+ if (ret)
+ {
+ ret->begin = begin;
+ ret->end = end;
+ }
+
+ return ret;
+}
+
+FcRange *
+FcRangeCreateInteger (FcChar32 begin, FcChar32 end)
+{
+ FcRange *ret = malloc (sizeof (FcRange));
+
+ if (ret)
+ {
+ ret->begin = begin;
+ ret->end = end;
+ }
+
+ return ret;
+}
+
+void
+FcRangeDestroy (FcRange *range)
+{
+ free (range);
+}
+
+FcRange *
+FcRangeCopy (const FcRange *range)
+{
+ return FcRangeCreateDouble (range->begin, range->end);
+}
+
+FcBool
+FcRangeGetDouble(const FcRange *range, double *begin, double *end)
+{
+ if (!range)
+ return FcFalse;
+ if (begin)
+ *begin = range->begin;
+ if (end)
+ *end = range->end;
+
+ return FcTrue;
+}
+
+FcRange *
+FcRangePromote (double v, FcValuePromotionBuffer *vbuf)
+{
+ typedef struct {
+ FcRange r;
+ } FcRangePromotionBuffer;
+ FcRangePromotionBuffer *buf = (FcRangePromotionBuffer *) vbuf;
+
+ FC_ASSERT_STATIC (sizeof (FcRangePromotionBuffer) <= sizeof (FcValuePromotionBuffer));
+ buf->r.begin = v;
+ buf->r.end = v;
+
+ return &buf->r;
+}
+
+FcBool
+FcRangeIsInRange (const FcRange *a, const FcRange *b)
+{
+ if (!a || !b)
+ return FcFalse;
+
+ return a->begin >= b->begin && a->end <= b->end;
+}
+
+FcBool
+FcRangeCompare (FcOp op, const FcRange *a, const FcRange *b)
+{
+ switch ((int) op) {
+ case FcOpEqual:
+ case FcOpContains:
+ case FcOpListing:
+ return FcRangeIsInRange (a, b);
+ case FcOpNotEqual:
+ case FcOpNotContains:
+ return !FcRangeIsInRange (a, b);
+ case FcOpLess:
+ return a->begin < b->begin;
+ case FcOpLessEqual:
+ return a->begin <= b->begin;
+ case FcOpMore:
+ return a->end > b->end;
+ case FcOpMoreEqual:
+ return a->end >= b->end;
+ default:
+ break;
+ }
+ return FcFalse;
+}
+
+FcChar32
+FcRangeHash (const FcRange *r)
+{
+ int b = (int) (r->begin * 100);
+ int e = (int) (r->end * 100);
+
+ return b ^ (b << 1) ^ (e << 9);
+}
+
+FcBool
+FcRangeSerializeAlloc (FcSerialize *serialize, const FcRange *r)
+{
+ if (!FcSerializeAlloc (serialize, r, sizeof (FcRange)))
+ return FcFalse;
+ return FcTrue;
+}
+
+FcRange *
+FcRangeSerialize (FcSerialize *serialize, const FcRange *r)
+{
+ FcRange *r_serialize = FcSerializePtr (serialize, r);
+
+ if (!r_serialize)
+ return NULL;
+ memcpy (r_serialize, r, sizeof (FcRange));
+
+ return r_serialize;
+}
+
+#define __fcrange__
+#include "fcaliastail.h"
+#undef __fcrange__
diff --git a/chromium/third_party/fontconfig/src/src/fcstat.c b/chromium/third_party/fontconfig/src/src/fcstat.c
index ff8e88455ef..1734fa42358 100644
--- a/chromium/third_party/fontconfig/src/src/fcstat.c
+++ b/chromium/third_party/fontconfig/src/src/fcstat.c
@@ -30,6 +30,9 @@
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
+#ifdef HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
#ifdef HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#endif
@@ -39,6 +42,7 @@
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
+#include <errno.h>
#ifdef _WIN32
#ifdef __GNUC__
@@ -161,21 +165,86 @@ FcDirChecksumScandirFilter(const struct dirent *entry)
}
#endif
-#ifdef HAVE_SCANDIR
static int
FcDirChecksumScandirSorter(const struct dirent **lhs, const struct dirent **rhs)
{
return strcmp((*lhs)->d_name, (*rhs)->d_name);
}
-#elif HAVE_SCANDIR_VOID_P
-static int
-FcDirChecksumScandirSorter(const void *a, const void *b)
+
+static void
+free_dirent (struct dirent **p)
{
- const struct dirent *lhs = a, *rhs = b;
+ struct dirent **x;
+
+ for (x = p; *x != NULL; x++)
+ free (*x);
- return strcmp(lhs->d_name, rhs->d_name);
+ free (p);
+}
+
+int
+FcScandir (const char *dirp,
+ struct dirent ***namelist,
+ int (*filter) (const struct dirent *),
+ int (*compar) (const struct dirent **, const struct dirent **));
+
+int
+FcScandir (const char *dirp,
+ struct dirent ***namelist,
+ int (*filter) (const struct dirent *),
+ int (*compar) (const struct dirent **, const struct dirent **))
+{
+ DIR *d;
+ struct dirent *dent, *p, **dlist, **dlp;
+ size_t lsize = 128, n = 0;
+
+ d = opendir (dirp);
+ if (!d)
+ return -1;
+
+ dlist = (struct dirent **) malloc (sizeof (struct dirent *) * lsize);
+ if (!dlist)
+ {
+ closedir (d);
+ errno = ENOMEM;
+
+ return -1;
+ }
+ *dlist = NULL;
+ while ((dent = readdir (d)))
+ {
+ if (!filter || (filter) (dent))
+ {
+ size_t dentlen = FcPtrToOffset (dent, dent->d_name) + strlen (dent->d_name) + 1;
+ dentlen = ((dentlen + ALIGNOF_VOID_P - 1) & ~(ALIGNOF_VOID_P - 1));
+ p = (struct dirent *) malloc (dentlen);
+ memcpy (p, dent, dentlen);
+ if ((n + 1) >= lsize)
+ {
+ lsize += 128;
+ dlp = (struct dirent **) realloc (dlist, sizeof (struct dirent *) * lsize);
+ if (!dlp)
+ {
+ free_dirent (dlist);
+ closedir (d);
+ errno = ENOMEM;
+
+ return -1;
+ }
+ dlist = dlp;
+ }
+ dlist[n++] = p;
+ dlist[n] = NULL;
+ }
+ }
+ closedir (d);
+
+ qsort (dlist, n, sizeof (struct dirent *), (int (*) (const void *, const void *))compar);
+
+ *namelist = dlist;
+
+ return n;
}
-#endif
static int
FcDirChecksum (const FcChar8 *dir, time_t *checksum)
@@ -183,14 +252,12 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum)
struct Adler32 ctx;
struct dirent **files;
int n;
-#ifndef HAVE_STRUCT_DIRENT_D_TYPE
int ret = 0;
size_t len = strlen ((const char *)dir);
-#endif
Adler32Init (&ctx);
- n = scandir ((const char *)dir, &files,
+ n = FcScandir ((const char *)dir, &files,
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
&FcDirChecksumScandirFilter,
#else
@@ -207,7 +274,9 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum)
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
dtype = files[n]->d_type;
-#else
+ if (dtype == DT_UNKNOWN)
+ {
+#endif
struct stat statb;
char f[PATH_MAX + 1];
@@ -224,20 +293,18 @@ FcDirChecksum (const FcChar8 *dir, time_t *checksum)
goto bail;
dtype = statb.st_mode;
+#ifdef HAVE_STRUCT_DIRENT_D_TYPE
+ }
#endif
Adler32Update (&ctx, files[n]->d_name, dlen + 1);
Adler32Update (&ctx, (char *)&dtype, sizeof (int));
-#ifndef HAVE_STRUCT_DIRENT_D_TYPE
bail:
-#endif
free (files[n]);
}
free (files);
-#ifndef HAVE_STRUCT_DIRENT_D_TYPE
if (ret == -1)
return -1;
-#endif
*checksum = Adler32Finish (&ctx);
@@ -359,3 +426,7 @@ FcIsFsMtimeBroken (const FcChar8 *dir)
return FcFalse;
}
+
+#define __fcstat__
+#include "fcaliastail.h"
+#undef __fcstat__
diff --git a/chromium/third_party/fontconfig/src/src/fcstr.c b/chromium/third_party/fontconfig/src/src/fcstr.c
index 57071724315..b65492d84af 100644
--- a/chromium/third_party/fontconfig/src/src/fcstr.c
+++ b/chromium/third_party/fontconfig/src/src/fcstr.c
@@ -26,9 +26,6 @@
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
-#ifdef HAVE_REGEX_H
-#include <regex.h>
-#endif
/* Objects MT-safe for readonly access. */
@@ -242,55 +239,6 @@ FcStrCmp (const FcChar8 *s1, const FcChar8 *s2)
return (int) c1 - (int) c2;
}
-#ifdef USE_REGEX
-static FcBool
-_FcStrRegexCmp (const FcChar8 *s, const FcChar8 *regex, int cflags, int eflags)
-{
- int ret = -1;
- regex_t reg;
-
- if ((ret = regcomp (&reg, (const char *)regex, cflags)) != 0)
- {
- if (FcDebug () & FC_DBG_MATCHV)
- {
- char buf[512];
-
- regerror (ret, &reg, buf, 512);
- printf("Regexp compile error: %s\n", buf);
- }
- return FcFalse;
- }
- ret = regexec (&reg, (const char *)s, 0, NULL, eflags);
- if (ret != 0)
- {
- if (FcDebug () & FC_DBG_MATCHV)
- {
- char buf[512];
-
- regerror (ret, &reg, buf, 512);
- printf("Regexp exec error: %s\n", buf);
- }
- }
- regfree (&reg);
-
- return ret == 0 ? FcTrue : FcFalse;
-}
-#else
-# define _FcStrRegexCmp(_s_, _regex_, _cflags_, _eflags_) (FcFalse)
-#endif
-
-FcBool
-FcStrRegexCmp (const FcChar8 *s, const FcChar8 *regex)
-{
- return _FcStrRegexCmp (s, regex, REG_EXTENDED | REG_NOSUB, 0);
-}
-
-FcBool
-FcStrRegexCmpIgnoreCase (const FcChar8 *s, const FcChar8 *regex)
-{
- return _FcStrRegexCmp (s, regex, REG_EXTENDED | REG_NOSUB | REG_ICASE, 0);
-}
-
/*
* Return a hash value for a string
*/
@@ -924,12 +872,16 @@ FcStrBuildFilename (const FcChar8 *path,
...)
{
va_list ap;
- FcStrSet *sset = FcStrSetCreate ();
+ FcStrSet *sset;
FcStrList *list;
FcChar8 *s, *ret = NULL, *p;
size_t len = 0;
- if (!sset || !path)
+ if (!path)
+ return NULL;
+
+ sset = FcStrSetCreateEx (FCSS_ALLOW_DUPLICATES | FCSS_GROW_BY_64);
+ if (!sset)
return NULL;
if (!FcStrSetAdd (sset, path))
@@ -1178,6 +1130,12 @@ FcStrCanonFilename (const FcChar8 *s)
FcStrSet *
FcStrSetCreate (void)
{
+ return FcStrSetCreateEx (FCSS_DEFAULT);
+}
+
+FcStrSet *
+FcStrSetCreateEx (unsigned int control)
+{
FcStrSet *set = malloc (sizeof (FcStrSet));
if (!set)
return 0;
@@ -1185,29 +1143,42 @@ FcStrSetCreate (void)
set->num = 0;
set->size = 0;
set->strs = 0;
+ set->control = control;
return set;
}
static FcBool
+_FcStrSetGrow (FcStrSet *set, int growElements)
+{
+ /* accommodate an additional NULL entry at the end of the array */
+ FcChar8 **strs = malloc ((set->size + growElements + 1) * sizeof (FcChar8 *));
+ if (!strs)
+ return FcFalse;
+ if (set->num)
+ memcpy (strs, set->strs, set->num * sizeof (FcChar8 *));
+ if (set->strs)
+ free (set->strs);
+ set->size = set->size + growElements;
+ set->strs = strs;
+ return FcTrue;
+}
+
+static FcBool
_FcStrSetAppend (FcStrSet *set, FcChar8 *s)
{
- if (FcStrSetMember (set, s))
+ if (!FcStrSetHasControlBit (set, FCSS_ALLOW_DUPLICATES))
{
- FcStrFree (s);
- return FcTrue;
+ if (FcStrSetMember (set, s))
+ {
+ FcStrFree (s);
+ return FcTrue;
+ }
}
if (set->num == set->size)
{
- FcChar8 **strs = malloc ((set->size + 2) * sizeof (FcChar8 *));
-
- if (!strs)
- return FcFalse;
- if (set->num)
- memcpy (strs, set->strs, set->num * sizeof (FcChar8 *));
- if (set->strs)
- free (set->strs);
- set->size = set->size + 1;
- set->strs = strs;
+ int growElements = FcStrSetHasControlBit (set, FCSS_GROW_BY_64) ? 64 : 1;
+ if (!_FcStrSetGrow(set, growElements))
+ return FcFalse;
}
set->strs[set->num++] = s;
set->strs[set->num] = 0;
diff --git a/chromium/third_party/fontconfig/src/src/fcweight.c b/chromium/third_party/fontconfig/src/src/fcweight.c
new file mode 100644
index 00000000000..036a518e8c5
--- /dev/null
+++ b/chromium/third_party/fontconfig/src/src/fcweight.c
@@ -0,0 +1,109 @@
+/*
+ * fontconfig/src/fcweight.c
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "fcint.h"
+
+static const struct {
+ int ot;
+ int fc;
+} map[] = {
+ { 0, FC_WEIGHT_THIN },
+ { 100, FC_WEIGHT_THIN },
+ { 200, FC_WEIGHT_EXTRALIGHT },
+ { 350, FC_WEIGHT_DEMILIGHT },
+ { 300, FC_WEIGHT_LIGHT },
+ { 380, FC_WEIGHT_BOOK },
+ { 400, FC_WEIGHT_REGULAR },
+ { 500, FC_WEIGHT_MEDIUM },
+ { 600, FC_WEIGHT_DEMIBOLD },
+ { 700, FC_WEIGHT_BOLD },
+ { 800, FC_WEIGHT_EXTRABOLD },
+ { 900, FC_WEIGHT_BLACK },
+ {1000, FC_WEIGHT_EXTRABLACK },
+};
+
+static int lerp(int x, int x1, int x2, int y1, int y2)
+{
+ int dx = x2 - x1;
+ int dy = y2 - y1;
+ assert (dx > 0 && dy >= 0 && x1 <= x && x <= x2);
+ return y1 + (dy*(x-x1) + dx/2) / dx;
+}
+
+int
+FcWeightFromOpenType (int ot_weight)
+{
+ int i;
+
+ /* Loosely based on WPF Font Selection Model's advice. */
+
+ if (ot_weight < 0)
+ return -1;
+ else if (1 <= ot_weight && ot_weight <= 9)
+ {
+ /* WPF Font Selection Model says do "ot_weight *= 100",
+ * but Greg Hitchcock revealed that GDI had a mapping
+ * reflected below: */
+ switch (ot_weight) {
+ case 1: ot_weight = 80; break;
+ case 2: ot_weight = 160; break;
+ case 3: ot_weight = 240; break;
+ case 4: ot_weight = 320; break;
+ case 5: ot_weight = 400; break;
+ case 6: ot_weight = 550; break;
+ case 7: ot_weight = 700; break;
+ case 8: ot_weight = 800; break;
+ case 9: ot_weight = 900; break;
+ }
+ }
+ ot_weight = FC_MIN (ot_weight, map[(sizeof (map) / sizeof (map[0])) - 1].ot);
+
+ for (i = 1; ot_weight > map[i].ot; i++)
+ ;
+
+ if (ot_weight == map[i].ot)
+ return map[i].fc;
+
+ /* Interpolate between two items. */
+ return lerp (ot_weight, map[i-1].ot, map[i].ot, map[i-1].fc, map[i].fc);
+}
+
+int
+FcWeightToOpenType (int fc_weight)
+{
+ int i;
+ if (fc_weight < 0 || fc_weight > FC_WEIGHT_EXTRABLACK)
+ return -1;
+
+ for (i = 1; fc_weight > map[i].fc; i++)
+ ;
+
+ if (fc_weight == map[i].fc)
+ return map[i].ot;
+
+ /* Interpolate between two items. */
+ return lerp (fc_weight, map[i-1].fc, map[i].fc, map[i-1].ot, map[i].ot);
+}
+
+#define __fcweight__
+#include "fcaliastail.h"
+#undef __fcweight__
diff --git a/chromium/third_party/fontconfig/src/src/fcwindows.h b/chromium/third_party/fontconfig/src/src/fcwindows.h
index 02489d9dc1b..a0eee675ee9 100644
--- a/chromium/third_party/fontconfig/src/src/fcwindows.h
+++ b/chromium/third_party/fontconfig/src/src/fcwindows.h
@@ -32,8 +32,13 @@
#endif
#ifdef _WIN32
+ /* Request Windows Vista for building. This is required to
+ * get MemoryBarrier on mingw32... */
+# if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600
+# undef _WIN32_WINNT
+# endif
# ifndef _WIN32_WINNT
-# define _WIN32_WINNT 0x0500
+# define _WIN32_WINNT 0x0600
# endif
# define WIN32_LEAN_AND_MEAN
# define WIN32_EXTRA_LEAN
diff --git a/chromium/third_party/fontconfig/src/src/fcxml.c b/chromium/third_party/fontconfig/src/src/fcxml.c
index 8ff10b6e63f..031a7da1f0b 100644
--- a/chromium/third_party/fontconfig/src/src/fcxml.c
+++ b/chromium/third_party/fontconfig/src/src/fcxml.c
@@ -54,8 +54,12 @@
#ifdef _WIN32
#include <mbstring.h>
+extern FcChar8 fontconfig_instprefix[];
#endif
+static FcChar8 *__fc_userdir = NULL;
+static FcChar8 *__fc_userconf = NULL;
+
static void
FcExprDestroy (FcExpr *e);
@@ -78,6 +82,7 @@ FcRuleDestroy (FcRule *rule)
case FcRuleEdit:
FcEditDestroy (rule->u.edit);
break;
+ case FcRuleUnknown:
default:
break;
}
@@ -169,6 +174,18 @@ FcExprCreateMatrix (FcConfig *config, const FcExprMatrix *matrix)
}
static FcExpr *
+FcExprCreateRange (FcConfig *config, FcRange *range)
+{
+ FcExpr *e = FcConfigAllocExpr (config);
+ if (e)
+ {
+ e->op = FcOpRange;
+ e->u.rval = FcRangeCopy (range);
+ }
+ return e;
+}
+
+static FcExpr *
FcExprCreateBool (FcConfig *config, FcBool b)
{
FcExpr *e = FcConfigAllocExpr (config);
@@ -258,6 +275,7 @@ FcExprDestroy (FcExpr *e)
FcExprMatrixFree (e->u.mexpr);
break;
case FcOpRange:
+ FcRangeDestroy (e->u.rval);
break;
case FcOpCharSet:
FcCharSetDestroy (e->u.cval);
@@ -503,7 +521,7 @@ typedef struct _FcVStack {
int integer;
double _double;
FcExprMatrix *matrix;
- FcRange range;
+ FcRange *range;
FcBool bool_;
FcCharSet *charset;
FcLangSet *langset;
@@ -593,6 +611,9 @@ FcTypeName (FcType type)
return "FT_Face";
case FcTypeLangSet:
return "langset";
+ case FcTypeRange:
+ return "range";
+ case FcTypeUnknown:
default:
return "unknown";
}
@@ -608,13 +629,15 @@ FcTypecheckValue (FcConfigParse *parse, FcType value, FcType type)
if (value != type)
{
if ((value == FcTypeLangSet && type == FcTypeString) ||
- (value == FcTypeString && type == FcTypeLangSet))
+ (value == FcTypeString && type == FcTypeLangSet) ||
+ (value == FcTypeInteger && type == FcTypeRange) ||
+ (value == FcTypeDouble && type == FcTypeRange))
return;
- if (type == (FcType) -1)
+ if (type == FcTypeUnknown)
return;
/* It's perfectly fine to use user-define elements in expressions,
* so don't warn in that case. */
- if (value == (FcType) -1)
+ if (value == FcTypeUnknown)
return;
FcConfigMessage (parse, FcSevereWarning, "saw %s, expected %s",
FcTypeName (value), FcTypeName (type));
@@ -651,6 +674,9 @@ FcTypecheckExpr (FcConfigParse *parse, FcExpr *expr, FcType type)
case FcOpLangSet:
FcTypecheckValue (parse, FcTypeLangSet, type);
break;
+ case FcOpRange:
+ FcTypecheckValue (parse, FcTypeRange, type);
+ break;
case FcOpNil:
break;
case FcOpField:
@@ -785,6 +811,7 @@ FcRuleCreate (FcRuleType type,
case FcRuleEdit:
r->u.edit = (FcEdit *) p;
break;
+ case FcRuleUnknown:
default:
free (r);
r = NULL;
@@ -865,11 +892,10 @@ FcVStackPushMatrix (FcConfigParse *parse, FcExprMatrix *matrix)
static FcBool
FcVStackPushRange (FcConfigParse *parse, FcRange *range)
{
- FcVStack *vstack = FcVStackCreateAndPush (parse);
+ FcVStack *vstack = FcVStackCreateAndPush (parse);
if (!vstack)
return FcFalse;
- vstack->u.range.begin = range->begin;
- vstack->u.range.end = range->end;
+ vstack->u.range = range;
vstack->tag = FcVStackRange;
return FcTrue;
}
@@ -1017,9 +1043,11 @@ FcVStackPopAndDestroy (FcConfigParse *parse)
case FcVStackMatrix:
FcExprMatrixFreeShallow (vstack->u.matrix);
break;
- case FcVStackRange:
case FcVStackBool:
break;
+ case FcVStackRange:
+ FcRangeDestroy (vstack->u.range);
+ break;
case FcVStackCharSet:
FcCharSetDestroy (vstack->u.charset);
break;
@@ -1232,7 +1260,11 @@ static void
FcParseBlank (FcConfigParse *parse)
{
int n = FcVStackElements (parse);
- FcChar32 i;
+#if 0
+ FcChar32 i, begin, end;
+#endif
+
+ FcConfigMessage (parse, FcSevereWarning, "blank doesn't take any effect anymore. please remove it from your fonts.conf");
while (n-- > 0)
{
FcVStack *v = FcVStackFetch (parse, n);
@@ -1244,18 +1276,24 @@ FcParseBlank (FcConfigParse *parse)
}
switch ((int) v->tag) {
case FcVStackInteger:
+#if 0
if (!FcBlanksAdd (parse->config->blanks, v->u.integer))
goto bail;
break;
+#endif
case FcVStackRange:
- if (v->u.range.begin <= v->u.range.end)
+#if 0
+ begin = (FcChar32) v->u.range->begin;
+ end = (FcChar32) v->u.range->end;
+ if (begin <= end)
{
- for (i = v->u.range.begin; i <= v->u.range.end; i++)
+ for (i = begin; i <= end; i++)
{
if (!FcBlanksAdd (parse->config->blanks, i))
goto bail;
}
}
+#endif
break;
default:
FcConfigMessage (parse, FcSevereError, "invalid element in blank");
@@ -1314,7 +1352,11 @@ FcParseInt (FcConfigParse *parse)
static double
FcStrtod (char *s, char **end)
{
+#ifndef __BIONIC__
struct lconv *locale_data;
+#endif
+ const char *decimal_point;
+ int dlen;
char *dot;
double v;
@@ -1322,14 +1364,21 @@ FcStrtod (char *s, char **end)
* Have to swap the decimal point to match the current locale
* if that locale doesn't use 0x2e
*/
+#ifndef __BIONIC__
+ locale_data = localeconv ();
+ decimal_point = locale_data->decimal_point;
+ dlen = strlen (decimal_point);
+#else
+ decimal_point = ".";
+ dlen = 1;
+#endif
+
if ((dot = strchr (s, 0x2e)) &&
- (locale_data = localeconv ()) &&
- (locale_data->decimal_point[0] != 0x2e ||
- locale_data->decimal_point[1] != 0))
+ (decimal_point[0] != 0x2e ||
+ decimal_point[1] != 0))
{
char buf[128];
int slen = strlen (s);
- int dlen = strlen (locale_data->decimal_point);
if (slen + dlen > (int) sizeof (buf))
{
@@ -1343,7 +1392,7 @@ FcStrtod (char *s, char **end)
/* mantissa */
strncpy (buf, s, dot - s);
/* decimal point */
- strcpy (buf + (dot - s), locale_data->decimal_point);
+ strcpy (buf + (dot - s), decimal_point);
/* rest of number */
strcpy (buf + (dot - s) + dlen, dot + 1);
buf_end = 0;
@@ -1463,9 +1512,11 @@ static void
FcParseRange (FcConfigParse *parse)
{
FcVStack *vstack;
- FcRange r = {0, 0};
- FcChar32 n;
+ FcRange *r;
+ FcChar32 n[2] = {0, 0};
int count = 1;
+ double d[2] = {0.0L, 0.0L};
+ FcBool dflag = FcFalse;
while ((vstack = FcVStackPeek (parse)))
{
@@ -1476,31 +1527,52 @@ FcParseRange (FcConfigParse *parse)
}
switch ((int) vstack->tag) {
case FcVStackInteger:
- n = vstack->u.integer;
+ if (dflag)
+ d[count] = (double)vstack->u.integer;
+ else
+ n[count] = vstack->u.integer;
+ break;
+ case FcVStackDouble:
+ if (count == 0 && !dflag)
+ d[1] = (double)n[1];
+ d[count] = vstack->u._double;
+ dflag = FcTrue;
break;
default:
FcConfigMessage (parse, FcSevereError, "invalid element in range");
- n = 0;
+ if (dflag)
+ d[count] = 0.0L;
+ else
+ n[count] = 0;
break;
}
- if (count == 1)
- r.end = n;
- else
- r.begin = n;
count--;
FcVStackPopAndDestroy (parse);
}
- if (count < 0)
+ if (count >= 0)
{
- if (r.begin > r.end)
+ FcConfigMessage (parse, FcSevereError, "invalid range");
+ return;
+ }
+ if (dflag)
+ {
+ if (d[0] > d[1])
{
FcConfigMessage (parse, FcSevereError, "invalid range");
return;
}
- FcVStackPushRange (parse, &r);
+ r = FcRangeCreateDouble (d[0], d[1]);
}
else
- FcConfigMessage (parse, FcSevereError, "invalid range");
+ {
+ if (n[0] > n[1])
+ {
+ FcConfigMessage (parse, FcSevereError, "invalid range");
+ return;
+ }
+ r = FcRangeCreateInteger (n[0], n[1]);
+ }
+ FcVStackPushRange (parse, r);
}
static FcBool
@@ -1536,7 +1608,7 @@ FcParseCharSet (FcConfigParse *parse)
{
FcVStack *vstack;
FcCharSet *charset = FcCharSetCreate ();
- FcChar32 i;
+ FcChar32 i, begin, end;
int n = 0;
while ((vstack = FcVStackPeek (parse)))
@@ -1551,9 +1623,12 @@ FcParseCharSet (FcConfigParse *parse)
n++;
break;
case FcVStackRange:
- if (vstack->u.range.begin <= vstack->u.range.end)
+ begin = (FcChar32) vstack->u.range->begin;
+ end = (FcChar32) vstack->u.range->end;
+
+ if (begin <= end)
{
- for (i = vstack->u.range.begin; i <= vstack->u.range.end; i++)
+ for (i = begin; i <= end; i++)
{
if (!FcCharSetAddChar (charset, i))
{
@@ -1888,6 +1963,7 @@ FcPopExpr (FcConfigParse *parse)
expr = FcExprCreateMatrix (parse->config, vstack->u.matrix);
break;
case FcVStackRange:
+ expr = FcExprCreateRange (parse->config, vstack->u.range);
break;
case FcVStackBool:
expr = FcExprCreateBool (parse->config, vstack->u.bool_);
@@ -1996,7 +2072,14 @@ FcParseDir (FcConfigParse *parse)
attr = FcConfigGetAttribute (parse, "prefix");
if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
+ {
prefix = FcConfigXdgDataHome ();
+ /* home directory might be disabled.
+ * simply ignore this element.
+ */
+ if (!prefix)
+ goto bail;
+ }
data = FcStrBufDoneStatic (&parse->pstack->str);
if (!data)
{
@@ -2087,11 +2170,18 @@ static void
FcParseCacheDir (FcConfigParse *parse)
{
const FcChar8 *attr;
- FcChar8 *prefix = NULL, *p, *data;
+ FcChar8 *prefix = NULL, *p, *data = NULL;
attr = FcConfigGetAttribute (parse, "prefix");
if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
+ {
prefix = FcConfigXdgCacheHome ();
+ /* home directory might be disabled.
+ * simply ignore this element.
+ */
+ if (!prefix)
+ goto bail;
+ }
data = FcStrBufDone (&parse->pstack->str);
if (!data)
{
@@ -2118,7 +2208,25 @@ FcParseCacheDir (FcConfigParse *parse)
data = prefix;
}
#ifdef _WIN32
- if (strcmp ((const char *) data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0)
+ else if (data[0] == '/' && fontconfig_instprefix[0] != '\0')
+ {
+ size_t plen = strlen ((const char *)fontconfig_instprefix);
+ size_t dlen = strlen ((const char *)data);
+
+ prefix = malloc (plen + 1 + dlen + 1);
+ if (!prefix)
+ {
+ FcConfigMessage (parse, FcSevereError, "out of memory");
+ goto bail;
+ }
+ strcpy ((char *) prefix, (char *) fontconfig_instprefix);
+ prefix[plen] = FC_DIR_SEPARATOR;
+ memcpy (&prefix[plen + 1], data, dlen);
+ prefix[plen + 1 + dlen] = 0;
+ FcStrFree (data);
+ data = prefix;
+ }
+ else if (strcmp ((const char *) data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0)
{
int rc;
FcStrFree (data);
@@ -2174,16 +2282,35 @@ FcParseCacheDir (FcConfigParse *parse)
FcStrFree (data);
}
+void
+FcConfigPathFini (void)
+{
+ FcChar8 *s;
+
+retry_dir:
+ s = fc_atomic_ptr_get (&__fc_userdir);
+ if (!fc_atomic_ptr_cmpexch (&__fc_userdir, s, NULL))
+ goto retry_dir;
+ free (s);
+
+retry_conf:
+ s = fc_atomic_ptr_get (&__fc_userconf);
+ if (!fc_atomic_ptr_cmpexch (&__fc_userconf, s, NULL))
+ goto retry_conf;
+ free (s);
+}
+
static void
FcParseInclude (FcConfigParse *parse)
{
FcChar8 *s;
const FcChar8 *attr;
FcBool ignore_missing = FcFalse;
+#ifndef _WIN32
FcBool deprecated = FcFalse;
+#endif
FcChar8 *prefix = NULL, *p;
- static FcChar8 *userdir = NULL;
- static FcChar8 *userconf = NULL;
+ FcChar8 *userdir = NULL, *userconf = NULL;
s = FcStrBufDoneStatic (&parse->pstack->str);
if (!s)
@@ -2195,15 +2322,25 @@ FcParseInclude (FcConfigParse *parse)
if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
ignore_missing = FcTrue;
attr = FcConfigGetAttribute (parse, "deprecated");
+#ifndef _WIN32
if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue)
deprecated = FcTrue;
+#endif
attr = FcConfigGetAttribute (parse, "prefix");
if (attr && FcStrCmp (attr, (const FcChar8 *)"xdg") == 0)
+ {
prefix = FcConfigXdgConfigHome ();
+ /* home directory might be disabled.
+ * simply ignore this element.
+ */
+ if (!prefix)
+ goto bail;
+ }
if (prefix)
{
size_t plen = strlen ((const char *)prefix);
size_t dlen = strlen ((const char *)s);
+ FcChar8 *u;
p = realloc (prefix, plen + 1 + dlen + 1);
if (!p)
@@ -2219,14 +2356,32 @@ FcParseInclude (FcConfigParse *parse)
if (FcFileIsDir (s))
{
userdir:
+ userdir = fc_atomic_ptr_get (&__fc_userdir);
if (!userdir)
- userdir = FcStrdup (s);
+ {
+ u = FcStrdup (s);
+ if (!fc_atomic_ptr_cmpexch (&__fc_userdir, userdir, u))
+ {
+ free (u);
+ goto userdir;
+ }
+ userdir = u;
+ }
}
else if (FcFileIsFile (s))
{
userconf:
+ userconf = fc_atomic_ptr_get (&__fc_userconf);
if (!userconf)
- userconf = FcStrdup (s);
+ {
+ u = FcStrdup (s);
+ if (!fc_atomic_ptr_cmpexch (&__fc_userconf, userconf, u))
+ {
+ free (u);
+ goto userconf;
+ }
+ userconf = u;
+ }
}
else
{
@@ -2250,6 +2405,7 @@ FcParseInclude (FcConfigParse *parse)
filename = FcConfigFilename(s);
if (deprecated == FcTrue &&
filename != NULL &&
+ userdir != NULL &&
!FcFileIsLink (filename))
{
if (FcFileIsDir (filename))
@@ -2566,6 +2722,11 @@ FcParseMatch (FcConfigParse *parse)
}
FcVStackPopAndDestroy (parse);
}
+ if (!rule)
+ {
+ FcConfigMessage (parse, FcSevereWarning, "No <test> nor <edit> elements in <match>");
+ return;
+ }
if (!FcConfigAddRule (parse->config, rule, kind))
FcConfigMessage (parse, FcSevereError, "out of memory");
}
@@ -2648,6 +2809,11 @@ FcPopValue (FcConfigParse *parse)
if (value.u.l)
value.type = FcTypeLangSet;
break;
+ case FcVStackRange:
+ value.u.r = FcRangeCopy (vstack->u.range);
+ if (value.u.r)
+ value.type = FcTypeRange;
+ break;
default:
FcConfigMessage (parse, FcSevereWarning, "unknown pattern element %d",
vstack->tag);
@@ -3003,7 +3169,7 @@ FcConfigParseAndLoadDir (FcConfig *config,
strcat ((char *) file, "/");
base = file + strlen ((char *) file);
- files = FcStrSetCreate ();
+ files = FcStrSetCreateEx (FCSS_GROW_BY_64);
if (!files)
{
ret = FcFalse;
@@ -3064,11 +3230,12 @@ FcConfigParseAndLoad (FcConfig *config,
{
XML_Parser p;
- FcChar8 *filename;
+ FcChar8 *filename, *f;
int fd;
int len;
FcConfigParse parse;
FcBool error = FcTrue;
+ const FcChar8 *sysroot = FcConfigGetSysRoot (config);
#ifdef ENABLE_LIBXML2
xmlSAXHandler sax;
@@ -3093,9 +3260,14 @@ FcConfigParseAndLoad (FcConfig *config,
}
#endif
- filename = FcConfigFilename (name);
- if (!filename)
+ f = FcConfigFilename (name);
+ if (!f)
goto bail0;
+ if (sysroot)
+ filename = FcStrBuildFilename (sysroot, f, NULL);
+ else
+ filename = FcStrdup (f);
+ FcStrFree (f);
if (FcStrSetMember (config->configFiles, filename))
{
diff --git a/chromium/third_party/gestures/gestures/include/finger_metrics.h b/chromium/third_party/gestures/gestures/include/finger_metrics.h
index 42ecb9e970f..aafddc91251 100644
--- a/chromium/third_party/gestures/gestures/include/finger_metrics.h
+++ b/chromium/third_party/gestures/gestures/include/finger_metrics.h
@@ -5,6 +5,8 @@
#ifndef GESTURES_FINGER_METRICS_H_
#define GESTURES_FINGER_METRICS_H_
+#include <cmath>
+
#include "gestures/include/gestures.h"
#include "gestures/include/prop_registry.h"
#include "gestures/include/vector.h"
diff --git a/chromium/third_party/gestures/gestures/include/immediate_interpreter.h b/chromium/third_party/gestures/gestures/include/immediate_interpreter.h
index 908e2f40235..45737e4c4eb 100644
--- a/chromium/third_party/gestures/gestures/include/immediate_interpreter.h
+++ b/chromium/third_party/gestures/gestures/include/immediate_interpreter.h
@@ -756,6 +756,10 @@ class ImmediateInterpreter : public Interpreter, public PropertyDelegate {
// Distance [mm] a finger must move after fingers change to count as real
// motion
DoubleProperty change_move_distance_;
+ // Speed [mm/s] a finger must move to lock on to that finger
+ DoubleProperty move_lock_speed_;
+ // Distance [mm] a finger must move to report that movement
+ DoubleProperty move_report_distance_;
// Time [s] to block movement after number or identify of fingers change
DoubleProperty change_timeout_;
// Time [s] to wait before locking on to a gesture
@@ -818,6 +822,9 @@ class ImmediateInterpreter : public Interpreter, public PropertyDelegate {
DoubleProperty thumb_click_prevention_timeout_;
// Consider scroll vs pointing if finger moves at least this distance [mm]
DoubleProperty two_finger_scroll_distance_thresh_;
+ // Consider move if there is no scroll and one finger moves at least this
+ // distance [mm]
+ DoubleProperty two_finger_move_distance_thresh_;
// Maximum distance [mm] between the outermost fingers while performing a
// three-finger gesture.
DoubleProperty three_finger_close_distance_thresh_;
@@ -830,11 +837,14 @@ class ImmediateInterpreter : public Interpreter, public PropertyDelegate {
// Minimum distance [mm] one of the four fingers must move to perform a
// four finger swipe gesture.
DoubleProperty four_finger_swipe_distance_thresh_;
+ // Minimum ratio between least and most moving finger to perform a
+ // three finger swipe gesture.
+ DoubleProperty three_finger_swipe_distance_ratio_;
+ // Minimum ratio between least and most moving finger to perform a
+ // four finger swipe gesture.
+ DoubleProperty four_finger_swipe_distance_ratio_;
// If three-finger swipe should be enabled
BoolProperty three_finger_swipe_enable_;
- // During a scroll one finger determines scroll speed and direction.
- // Maximum distance [mm] the other finger can move in opposite direction
- DoubleProperty scroll_stationary_finger_max_distance_;
// Height [mm] of the bottom zone
DoubleProperty bottom_zone_size_;
// Time [s] to after button down to evaluate number of fingers for a click
diff --git a/chromium/third_party/gestures/gestures/include/metrics_filter_interpreter.h b/chromium/third_party/gestures/gestures/include/metrics_filter_interpreter.h
index f0f24f54ba0..cae1c065ccc 100644
--- a/chromium/third_party/gestures/gestures/include/metrics_filter_interpreter.h
+++ b/chromium/third_party/gestures/gestures/include/metrics_filter_interpreter.h
@@ -115,8 +115,8 @@ class MetricsFilterInterpreter : public FilterInterpreter {
// Number of mouse movement sessions that we skip at startup. We do this
// because it takes time for the user to "get used to" the mouse speed when
- // he/she first starts using the mouse. We only want to capture the user
- // metrics after the user have been familiar with his/her mouse.
+ // they first start using the mouse. We only want to capture the user metrics
+ // after the user has been familiar with their mouse.
IntProperty mouse_control_warmup_sessions_;
};
diff --git a/chromium/third_party/gestures/gestures/src/immediate_interpreter.cc b/chromium/third_party/gestures/gestures/src/immediate_interpreter.cc
index af953d236bc..b3c2fae4b10 100644
--- a/chromium/third_party/gestures/gestures/src/immediate_interpreter.cc
+++ b/chromium/third_party/gestures/gestures/src/immediate_interpreter.cc
@@ -1017,8 +1017,10 @@ ImmediateInterpreter::ImmediateInterpreter(PropRegistry* prop_reg,
"T5R2 Three Finger Click Enable",
0),
change_move_distance_(prop_reg, "Change Min Move Distance", 3.0),
+ move_lock_speed_(prop_reg, "Move Lock Speed", 10.0),
+ move_report_distance_(prop_reg, "Move Report Distance", 0.35),
change_timeout_(prop_reg, "Change Timeout", 0.04),
- evaluation_timeout_(prop_reg, "Evaluation Timeout", 0.2),
+ evaluation_timeout_(prop_reg, "Evaluation Timeout", 0.15),
pinch_evaluation_timeout_(prop_reg, "Pinch Evaluation Timeout", 0.3),
thumb_pinch_evaluation_timeout_(prop_reg,
"Thumb Pinch Evaluation Timeout", 0.5),
@@ -1055,25 +1057,32 @@ ImmediateInterpreter::ImmediateInterpreter(PropRegistry* prop_reg,
thumb_pinch_threshold_ratio_(prop_reg,
"Thumb Pinch Threshold Ratio", 0.25),
thumb_click_prevention_timeout_(prop_reg,
- "Thumb Click Prevention Timeout", 0.2),
+ "Thumb Click Prevention Timeout", 0.15),
two_finger_scroll_distance_thresh_(prop_reg,
"Two Finger Scroll Distance Thresh",
- 2.0),
+ 1.5),
+ two_finger_move_distance_thresh_(prop_reg,
+ "Two Finger Move Distance Thresh",
+ 7.0),
three_finger_close_distance_thresh_(prop_reg,
"Three Finger Close Distance Thresh",
- 50.0),
+ 55.0),
four_finger_close_distance_thresh_(prop_reg,
"Four Finger Close Distance Thresh",
60.0),
three_finger_swipe_distance_thresh_(prop_reg,
"Three Finger Swipe Distance Thresh",
- 2.0),
+ 1.5),
four_finger_swipe_distance_thresh_(prop_reg,
"Four Finger Swipe Distance Thresh",
- 2.0),
+ 1.5),
+ three_finger_swipe_distance_ratio_(prop_reg,
+ "Three Finger Swipe Distance Ratio",
+ 0.2),
+ four_finger_swipe_distance_ratio_(prop_reg,
+ "Four Finger Swipe Distance Ratio",
+ 0.2),
three_finger_swipe_enable_(prop_reg, "Three Finger Swipe EnableX", 1),
- scroll_stationary_finger_max_distance_(
- prop_reg, "Scroll Stationary Finger Max Distance", 1.0),
bottom_zone_size_(prop_reg, "Bottom Zone Size", 10.0),
button_evaluation_timeout_(prop_reg, "Button Evaluation Timeout", 0.05),
button_finger_timeout_(prop_reg, "Button Finger Timeout", 0.03),
@@ -1558,6 +1567,12 @@ void ImmediateInterpreter::UpdateThumbState(const HardwareState& hwstate) {
(fs.pressure > min_pressure + two_finger_pressure_diff_thresh_.val_ &&
fs.pressure > min_pressure * two_finger_pressure_diff_factor_.val_ &&
fs.position_y > min_fs->position_y);
+ bool non_gs = (hwstate.timestamp > changed_time_ &&
+ (prev_active_gs_fingers_.find(fs.tracking_id) ==
+ prev_active_gs_fingers_.end()) &&
+ prev_result_.type != kGestureTypeNull);
+ non_gs |= moving_finger_id_ >= 0 && moving_finger_id_ != fs.tracking_id;
+ likely_thumb |= non_gs;
// We sometimes can't decide the thumb state if some fingers are undergoing
// warp moves as the decision could be off (DistanceTravelledSq may
// under-estimate the real distance). The cases that we need to re-evaluate
@@ -1708,6 +1723,7 @@ void ImmediateInterpreter::UpdateCurrentGestureType(
if (AnyGesturingFingerLeft(*state_buffer_.Get(0),
prev_gs_fingers_)) {
current_gesture_type_ = GetFingerLiftGesture(current_gesture_type_);
+ moving_.clear();
return;
}
// fallthrough
@@ -1774,7 +1790,7 @@ void ImmediateInterpreter::UpdateCurrentGestureType(
// ambiguous. Only move if they've been down long enough.
if (new_gs_type == kGestureTypeMove &&
hwstate.timestamp -
- max(origin_timestamps_[fingers[0]->tracking_id],
+ min(origin_timestamps_[fingers[0]->tracking_id],
origin_timestamps_[fingers[1]->tracking_id]) <
evaluation_timeout_.val_)
new_gs_type = kGestureTypeNull;
@@ -2208,12 +2224,17 @@ GestureType ImmediateInterpreter::GetTwoFingerGestureType(
float large_dy = MaxMag(dy1, dy2);
// These compares are okay if d{x,y}1 == d{x,y}2:
short large_dx_id =
- large_dx == dx1 ? finger1.tracking_id : finger2.tracking_id;
+ (large_dx == dx1) ? finger1.tracking_id : finger2.tracking_id;
short large_dy_id =
- large_dy == dy1 ? finger1.tracking_id : finger2.tracking_id;
+ (large_dy == dy1) ? finger1.tracking_id : finger2.tracking_id;
float small_dx = MinMag(dx1, dx2);
float small_dy = MinMag(dy1, dy2);
+ short small_dx_id =
+ (small_dx == dx1) ? finger1.tracking_id : finger2.tracking_id;
+ short small_dy_id =
+ (small_dy == dy1) ? finger1.tracking_id : finger2.tracking_id;
+
bool dampened_zone_occupied = false;
// movements of the finger in the dampened zone. If there are multiple
// fingers in the dampened zone, dx is min(dx_1, dx_2), dy is min(dy_1, dy_2).
@@ -2221,8 +2242,6 @@ GestureType ImmediateInterpreter::GetTwoFingerGestureType(
float damp_dy = INFINITY;
float non_damp_dx = 0.0;
float non_damp_dy = 0.0;
- bool damp_instaneous_moving_x = false;
- bool damp_instaneous_moving_y = false;
if (FingerInDampenedZone(finger1) ||
(finger1.flags & GESTURES_FINGER_POSSIBLE_PALM)) {
dampened_zone_occupied = true;
@@ -2230,8 +2249,6 @@ GestureType ImmediateInterpreter::GetTwoFingerGestureType(
damp_dy = dy1;
non_damp_dx = dx2;
non_damp_dy = dy2;
- damp_instaneous_moving_x = damp_instaneous_moving_y =
- finger1.flags & GESTURES_FINGER_INSTANTANEOUS_MOVING;
}
if (FingerInDampenedZone(finger2) ||
(finger2.flags & GESTURES_FINGER_POSSIBLE_PALM)) {
@@ -2240,14 +2257,6 @@ GestureType ImmediateInterpreter::GetTwoFingerGestureType(
damp_dy = MinMag(damp_dy, dy2);
non_damp_dx = MaxMag(non_damp_dx, dx1);
non_damp_dy = MaxMag(non_damp_dy, dy1);
- damp_instaneous_moving_x =
- damp_dx == dx1
- ? !!(finger1.flags & GESTURES_FINGER_INSTANTANEOUS_MOVING)
- : !!(finger2.flags & GESTURES_FINGER_INSTANTANEOUS_MOVING);
- damp_instaneous_moving_y =
- damp_dy == dy1
- ? !!(finger1.flags & GESTURES_FINGER_INSTANTANEOUS_MOVING)
- : !!(finger2.flags & GESTURES_FINGER_INSTANTANEOUS_MOVING);
}
// Trending in the same direction?
@@ -2264,21 +2273,16 @@ GestureType ImmediateInterpreter::GetTwoFingerGestureType(
bool large_dy_moving =
fabsf(large_dy) >= two_finger_scroll_distance_thresh_.val_ ||
SetContainsValue(moving_, large_dy_id);
- // We use a tighter moving criteria for damped finger here: it needs to be
- // moving in the past a few frames rather than just being moving before.
- bool small_dx_moving = fabsf(damp_dx) >=
- damp_scroll_min_movement_factor_.val_ * fabsf(non_damp_dx) ||
- damp_instaneous_moving_x;
- bool small_dy_moving = fabsf(damp_dy) >=
- damp_scroll_min_movement_factor_.val_ * fabsf(non_damp_dy) ||
- damp_instaneous_moving_y;
- // If not in damp zone, we allow one-finger scrolling
- bool small_dx_scrolling = !dampened_zone_occupied || small_dx_moving;
- bool small_dy_scrolling = !dampened_zone_occupied || small_dy_moving;
+ bool small_dx_moving =
+ fabsf(small_dx) >= two_finger_scroll_distance_thresh_.val_ ||
+ SetContainsValue(moving_, small_dx_id);
+ bool small_dy_moving =
+ fabsf(small_dy) >= two_finger_scroll_distance_thresh_.val_ ||
+ SetContainsValue(moving_, small_dy_id);
bool trend_scrolling_x = (common_trend_flags & kTrendX) &&
- large_dx_moving && small_dx_scrolling;
+ large_dx_moving && small_dx_moving;
bool trend_scrolling_y = (common_trend_flags & kTrendY) &&
- large_dy_moving && small_dy_scrolling;
+ large_dy_moving && small_dy_moving;
if (trend_scrolling_x || trend_scrolling_y) {
if (pinch_enable_.val_ && !ScrollAngle(finger1, finger2))
@@ -2288,17 +2292,22 @@ GestureType ImmediateInterpreter::GetTwoFingerGestureType(
if (fabsf(large_dx) > fabsf(large_dy)) {
// consider horizontal scroll
+ if (fabsf(small_dx) < two_finger_scroll_distance_thresh_.val_)
+ small_dx = 0.0;
+ if (large_dx * small_dx <= 0.0) {
+ // not same direction
+ if (fabsf(large_dx) < two_finger_move_distance_thresh_.val_)
+ return kGestureTypeNull;
+ else
+ return kGestureTypeMove;
+ }
if (fabsf(large_dx) < two_finger_scroll_distance_thresh_.val_)
return kGestureTypeNull;
- if (fabsf(small_dx) < scroll_stationary_finger_max_distance_.val_)
- small_dx = 0.0;
- if (large_dx * small_dx < 0.0)
- return kGestureTypeMove; // not same direction
if (dampened_zone_occupied) {
// Require damp to move at least some amount with the other finger
if (fabsf(damp_dx) <
damp_scroll_min_movement_factor_.val_ * fabsf(non_damp_dx)) {
- return kGestureTypeMove;
+ return kGestureTypeNull;
}
}
if (pinch_enable_.val_ && !ScrollAngle(finger1, finger2))
@@ -2306,17 +2315,19 @@ GestureType ImmediateInterpreter::GetTwoFingerGestureType(
return kGestureTypeScroll;
} else {
// consider vertical scroll
- if (fabsf(large_dy) < two_finger_scroll_distance_thresh_.val_)
- return kGestureTypeNull;
- if (fabsf(small_dy) < scroll_stationary_finger_max_distance_.val_)
+ if (fabsf(small_dy) < two_finger_scroll_distance_thresh_.val_)
small_dy = 0.0;
- if (large_dy * small_dy < 0.0)
- return kGestureTypeMove;
+ if (large_dy * small_dy <= 0.0) {
+ if (fabsf(large_dy) < two_finger_move_distance_thresh_.val_)
+ return kGestureTypeNull;
+ else
+ return kGestureTypeMove;
+ }
if (dampened_zone_occupied) {
// Require damp to move at least some amount with the other finger
if (fabsf(damp_dy) <
damp_scroll_min_movement_factor_.val_ * fabsf(non_damp_dy)) {
- return kGestureTypeMove;
+ return kGestureTypeNull;
}
}
if (pinch_enable_.val_ && !ScrollAngle(finger1, finger2))
@@ -2339,14 +2350,17 @@ GestureType ImmediateInterpreter::GetMultiFingerGestureType(
const FingerState* const fingers[], const int num_fingers) {
float close_distance_thresh;
float swipe_distance_thresh;
+ float swipe_distance_ratio;
GestureType gesture_type;
if (num_fingers == 4) {
close_distance_thresh = four_finger_close_distance_thresh_.val_;
swipe_distance_thresh = four_finger_swipe_distance_thresh_.val_;
+ swipe_distance_ratio = four_finger_swipe_distance_ratio_.val_;
gesture_type = kGestureTypeFourFingerSwipe;
} else if (num_fingers == 3) {
close_distance_thresh = three_finger_close_distance_thresh_.val_;
swipe_distance_thresh = three_finger_swipe_distance_thresh_.val_;
+ swipe_distance_ratio = three_finger_swipe_distance_ratio_.val_;
gesture_type = kGestureTypeSwipe;
} else {
return kGestureTypeNull;
@@ -2395,12 +2409,16 @@ GestureType ImmediateInterpreter::GetMultiFingerGestureType(
}
}
- // One finger must have traveled far enough.
- for (int i = 0; i < num_fingers; i++) {
- if (fabsf(deltas[i]) >= swipe_distance_thresh) {
- return gesture_type;
- }
+ // All fingers must have traveled far enough.
+ float max_delta = fabsf(deltas[0]);
+ float min_delta = fabsf(deltas[0]);
+ for (int i = 1; i < num_fingers; i++) {
+ max_delta = max(max_delta, fabsf(deltas[i]));
+ min_delta = min(min_delta, fabsf(deltas[i]));
}
+ if (max_delta >= swipe_distance_thresh &&
+ min_delta >= swipe_distance_ratio * max_delta)
+ return gesture_type;
return kGestureTypeNull;
}
@@ -3024,22 +3042,30 @@ void ImmediateInterpreter::FillResultGesture(
case kGestureTypeMove: {
if (fingers.empty())
return;
- // Use highest finger (the one closes to the keyboard), excluding
- // palms, to compute motion. First, need to find out which finger that is.
+ // Use the finger which has moved the most to compute motion.
+ // First, need to find out which finger that is.
const FingerState* current = NULL;
if (moving_finger_id_ >= 0)
current = hwstate.GetFingerState(moving_finger_id_);
- if (!current) {
+ const HardwareState* prev_hs = state_buffer_.Get(1);
+ if (prev_hs && !current) {
+ float curr_dist_sq = -1;
for (FingerMap::const_iterator it =
fingers.begin(), e = fingers.end(); it != e; ++it) {
const FingerState* fs = hwstate.GetFingerState(*it);
- if (!current || fs->position_y < current->position_y ||
- (current->flags & GESTURES_FINGER_POSSIBLE_PALM &&
- !(fs->flags & GESTURES_FINGER_POSSIBLE_PALM)))
+ const FingerState* prev_fs = prev_hs->GetFingerState(fs->tracking_id);
+ if (!prev_fs)
+ break;
+ float dist_sq = DistSq(*fs, *prev_fs);
+ if (dist_sq > curr_dist_sq) {
current = fs;
+ curr_dist_sq = dist_sq;
+ }
}
}
+ if (!current)
+ return;
// Find corresponding finger id in previous state
const FingerState* prev =
@@ -3079,10 +3105,23 @@ void ImmediateInterpreter::FillResultGesture(
float dy = current->position_y - prev->position_y;
if (current->flags & GESTURES_FINGER_WARP_Y_MOVE)
dy = 0.0;
- if (dx != 0.0 || dy != 0.0) {
+ float dsq = dx * dx + dy * dy;
+ float dx_total = current->position_x -
+ start_positions_[current->tracking_id].x_;
+ float dy_total = current->position_y -
+ start_positions_[current->tracking_id].y_;
+ float dsq_total = dx_total * dx_total + dy_total * dy_total;
+
+ float dsq_thresh = (move_lock_speed_.val_ * move_lock_speed_.val_) *
+ (dt * dt);
+ if (dsq > dsq_thresh) {
// lock onto this finger
moving_finger_id_ = current->tracking_id;
+ }
+ float dsq_total_thresh =
+ move_report_distance_.val_ * move_report_distance_.val_;
+ if (dsq_total >= dsq_total_thresh && dsq != 0.0) {
result_ = Gesture(kGestureMove,
state_buffer_.Get(1)->timestamp,
hwstate.timestamp,
diff --git a/chromium/third_party/gestures/gestures/src/immediate_interpreter_unittest.cc b/chromium/third_party/gestures/gestures/src/immediate_interpreter_unittest.cc
index ffa11626fd9..7cd9fb8c03a 100644
--- a/chromium/third_party/gestures/gestures/src/immediate_interpreter_unittest.cc
+++ b/chromium/third_party/gestures/gestures/src/immediate_interpreter_unittest.cc
@@ -619,7 +619,7 @@ TEST(ImmediateInterpreterTest, OneFingerThenTwoDelayedStartScrollTest) {
{0, 0, 0, 0, 20, 0, 40, 85, 1, 0},
{0, 0, 0, 0, 20, 0, 60, 83, 2, 0},
- {0, 0, 0, 0, 20, 0, 40, 85, 1, 0},
+ {0, 0, 0, 0, 20, 0, 40, 77, 1, 0},
{0, 0, 0, 0, 20, 0, 60, 75, 2, 0},
};
@@ -1096,7 +1096,7 @@ TEST(ImmediateInterpreterTest, RestingFingerTest) {
TestInterpreterWrapper wrapper(ii.get(), &hwprops);
const float kX = 7;
- float dx = 5;
+ float dx = 7;
const float kRestY = hwprops.bottom - 7;
const float kMoveY = kRestY - 10;
@@ -1769,13 +1769,13 @@ TEST(ImmediateInterpreterTest, TapToClickStateMachineTest) {
{S,{0.00,0,1,1,&fs[0],0,0,0,0},-1,MkSet(91),0,0,kFTB,false},
{C,{0.01,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kTpC,true},
{C,{0.02,0,1,1,&fs[4],0,0,0,0},-1,MkSet(95),0,0,kSTB,false},
- {C,{0.13,0,1,1,&fs[5],0,0,0,0},-1,MkSet(95),kBL,0,kDrg,false},
- {C,{0.14,0,1,1,&fs[6],0,0,0,0},-1,MkSet(95),0,0,kDrg,false},
- {C,{0.15,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
- {C,{0.16,0,1,1,&fs[7],0,0,0,0},-1,MkSet(96),0,0,kDRt,false},
- {C,{0.17,0,1,1,&fs[8],0,0,0,0},-1,MkSet(96),0,0,kDrg,false},
- {C,{0.18,0,1,1,&fs[9],0,0,0,0},-1,MkSet(96),0,0,kDrg,false},
- {C,{0.19,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
+ {C,{0.08,0,1,1,&fs[5],0,0,0,0},-1,MkSet(95),kBL,0,kDrg,false},
+ {C,{0.09,0,1,1,&fs[6],0,0,0,0},-1,MkSet(95),0,0,kDrg,false},
+ {C,{0.10,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
+ {C,{0.11,0,1,1,&fs[7],0,0,0,0},-1,MkSet(96),0,0,kDRt,false},
+ {C,{0.12,0,1,1,&fs[8],0,0,0,0},-1,MkSet(96),0,0,kDrg,false},
+ {C,{0.13,0,1,1,&fs[9],0,0,0,0},-1,MkSet(96),0,0,kDrg,false},
+ {C,{0.14,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
{C,{0.99,0,0,0,NULL,0,0,0,0},.99,MkSet(),0,kBL,kIdl,false},
// 1-finger long press
{S,{0.00,0,1,1,&fs[0],0,0,0,0},-1,MkSet(91),0,0,kFTB,false},
@@ -1883,11 +1883,11 @@ TEST(ImmediateInterpreterTest, TapToClickStateMachineTest) {
{S,{0.00,0,1,1,&fs[0],0,0,0,0},-1,MkSet(91),0,0,kFTB,false},
{C,{0.01,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kTpC,true},
{C,{0.02,0,1,1,&fs[4],0,0,0,0},-1,MkSet(95),0,0,kSTB,false},
- {C,{0.13,0,1,1,&fs[5],0,0,0,0},-1,MkSet(95),kBL,0,kDrg,false},
- {C,{0.14,0,1,1,&fs[6],0,0,0,0},-1,MkSet(95),0,0,kDrg,false},
- {C,{0.15,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
- {C,{0.16,0,2,2,&fs[10],0,0,0,0},-1,MkSet(97,98),0,0,kDRt,false},
- {C,{0.17,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,kBL,kTpC,true},
+ {C,{0.10,0,1,1,&fs[5],0,0,0,0},-1,MkSet(95),kBL,0,kDrg,false},
+ {C,{0.11,0,1,1,&fs[6],0,0,0,0},-1,MkSet(95),0,0,kDrg,false},
+ {C,{0.12,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
+ {C,{0.13,0,2,2,&fs[10],0,0,0,0},-1,MkSet(97,98),0,0,kDRt,false},
+ {C,{0.14,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,kBL,kTpC,true},
{C,{0.99,0,0,0,NULL,0,0,0,0},.99,MkSet(),kBR,kBR,kIdl,false},
// slow double tap
{D,{ 0.00, 0, 1, 1, &fs[0],0,0,0,0}, -1, MkSet(91), 0, 0, kFTB, false },
@@ -2300,13 +2300,13 @@ TEST(ImmediateInterpreterTest, TapToClickEnableTest) {
{S,{0.00,0,1,1,&fs[0],0,0,0,0},-1,MkSet(91),0,0,kFTB,false},
{C,{0.01,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kTpC,true},
{C,{0.02,0,1,1,&fs[1],0,0,0,0},-1,MkSet(92),0,0,kSTB,false},
- {C,{0.13,0,1,1,&fs[2],0,0,0,0},-1,MkSet(92),kBL,0,kDrg,false},
- {C,{0.14,0,1,1,&fs[3],0,0,0,0},-1,MkSet(92),0,0,kDrg,false},
- {C,{0.15,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
- {C,{0.16,0,1,1,&fs[4],0,0,0,0},-1,MkSet(93),0,0,kDRt,false},
- {C,{0.17,0,1,1,&fs[5],0,0,0,0},-1,MkSet(93),0,0,kDrg,false},
- {C,{0.18,0,1,1,&fs[6],0,0,0,0},-1,MkSet(93),0,0,kDrg,false},
- {C,{0.19,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
+ {C,{0.08,0,1,1,&fs[2],0,0,0,0},-1,MkSet(92),kBL,0,kDrg,false},
+ {C,{0.09,0,1,1,&fs[3],0,0,0,0},-1,MkSet(92),0,0,kDrg,false},
+ {C,{0.10,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
+ {C,{0.11,0,1,1,&fs[4],0,0,0,0},-1,MkSet(93),0,0,kDRt,false},
+ {C,{0.12,0,1,1,&fs[5],0,0,0,0},-1,MkSet(93),0,0,kDrg,false},
+ {C,{0.13,0,1,1,&fs[6],0,0,0,0},-1,MkSet(93),0,0,kDrg,false},
+ {C,{0.14,0,0,0,NULL,0,0,0,0},-1,MkSet(),0,0,kDRl,true},
{C,{0.99,0,0,0,NULL,0,0,0,0},.99,MkSet(),0,kBL,kIdl,false}
};
@@ -3442,7 +3442,6 @@ TEST(ImmediateInterpreterTest, ScrollResetTapTest) {
// SemiMt-specific properties
ii.tapping_finger_min_separation_.val_ = 0.0;
- ii.scroll_stationary_finger_max_distance_.val_ = 20.0;
ii.tap_enable_.val_ = 1;
TestInterpreterWrapper wrapper(&ii, &hwprops);
diff --git a/chromium/third_party/libaddressinput/chromium/resources/address_input_strings_tr.xtb b/chromium/third_party/libaddressinput/chromium/resources/address_input_strings_tr.xtb
index 9551c11955f..62a02ce06da 100644
--- a/chromium/third_party/libaddressinput/chromium/resources/address_input_strings_tr.xtb
+++ b/chromium/third_party/libaddressinput/chromium/resources/address_input_strings_tr.xtb
@@ -10,7 +10,7 @@
<translation id="3713769522066937702">Bu posta kodu biçimi tanınmadı. Geçerli bir posta kodu örneği: <ph name="EXAMPLE" />. Posta kodunuzu bilmiyor musunuz? <ph name="BEGIN_LINK" />Buradan<ph name="END_LINK" /> bulabilirsiniz.</translation>
<translation id="3882422586004212847">Bu posta kodu biçimi tanınmadı. Geçerli bir posta kodu örneği: <ph name="EXAMPLE" />.</translation>
<translation id="3885155851504623709">Bucak</translation>
-<translation id="43113324827158664">Bunu boş bırakamazsınız.</translation>
+<translation id="43113324827158664">Bu alanı boş bırakamazsınız.</translation>
<translation id="4376888869070172068">Posta kodu biçimi tanınmadı.</translation>
<translation id="4518701284698680367">Bir posta kodu sağlamalısınız (örneğin, <ph name="EXAMPLE" />). Posta kodunuzu bilmiyor musunuz? <ph name="BEGIN_LINK" />Buradan<ph name="END_LINK" /> bulabilirsiniz.</translation>
<translation id="5089810972385038852">Eyalet</translation>
diff --git a/chromium/third_party/libdrm/src/Android.mk b/chromium/third_party/libdrm/src/Android.mk
index 2aa2bc964df..90cdcb32360 100644
--- a/chromium/third_party/libdrm/src/Android.mk
+++ b/chromium/third_party/libdrm/src/Android.mk
@@ -27,12 +27,10 @@ include $(CLEAR_VARS)
# Import variables LIBDRM_{,H_,INCLUDE_H_,INCLUDE_VMWGFX_H_}FILES
include $(LOCAL_PATH)/Makefile.sources
-#static library for the device (recovery)
-include $(CLEAR_VARS)
LOCAL_MODULE := libdrm
LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_FILES))
+LOCAL_SRC_FILES := $(LIBDRM_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/include/drm
@@ -43,24 +41,7 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS := \
-DHAVE_VISIBILITY=1 \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
-include $(BUILD_STATIC_LIBRARY)
-
-# Shared library for the device
-include $(CLEAR_VARS)
-LOCAL_MODULE := libdrm
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_FILES))
-LOCAL_EXPORT_C_INCLUDE_DIRS := \
- $(LOCAL_PATH) \
- $(LOCAL_PATH)/include/drm
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/include/drm
-
-LOCAL_CFLAGS := \
- -DHAVE_VISIBILITY=1 \
- -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
include $(BUILD_SHARED_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/chromium/third_party/libdrm/src/CleanSpec.mk b/chromium/third_party/libdrm/src/CleanSpec.mk
index 28a11db4e7b..8e23cd25d26 100644
--- a/chromium/third_party/libdrm/src/CleanSpec.mk
+++ b/chromium/third_party/libdrm/src/CleanSpec.mk
@@ -1,4 +1,3 @@
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/include/libdrm)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/include/freedreno)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libdrm_*intermediates)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libdrm_*intermediates)
diff --git a/chromium/third_party/libdrm/src/Makefile.am b/chromium/third_party/libdrm/src/Makefile.am
index fcb21b65bdd..ca415089c4b 100644
--- a/chromium/third_party/libdrm/src/Makefile.am
+++ b/chromium/third_party/libdrm/src/Makefile.am
@@ -29,7 +29,6 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
--enable-radeon \
--enable-amdgpu \
--enable-nouveau \
- --enable-vc4 \
--enable-vmwgfx \
--enable-omap-experimental-api \
--enable-exynos-experimental-api \
@@ -80,18 +79,6 @@ if HAVE_TEGRA
TEGRA_SUBDIR = tegra
endif
-if HAVE_VC4
-VC4_SUBDIR = vc4
-endif
-
-if HAVE_ROCKCHIP
-ROCKCHIP_SUBDIR = rockchip
-endif
-
-if HAVE_MEDIATEK
-MEDIATEK_SUBDIR = mediatek
-endif
-
if BUILD_MANPAGES
if HAVE_MANPAGES_STYLESHEET
MAN_SUBDIR = man
@@ -109,9 +96,6 @@ SUBDIRS = \
$(EXYNOS_SUBDIR) \
$(FREEDRENO_SUBDIR) \
$(TEGRA_SUBDIR) \
- $(VC4_SUBDIR) \
- $(ROCKCHIP_SUBDIR) \
- $(MEDIATEK_SUBDIR) \
tests \
$(MAN_SUBDIR)
@@ -130,6 +114,8 @@ libdrm_la_SOURCES = $(LIBDRM_FILES)
libdrmincludedir = ${includedir}
libdrminclude_HEADERS = $(LIBDRM_H_FILES)
+EXTRA_DIST = Android.mk
+
klibdrmincludedir = ${includedir}/libdrm
klibdrminclude_HEADERS = $(LIBDRM_INCLUDE_H_FILES)
diff --git a/chromium/third_party/libdrm/src/Makefile.sources b/chromium/third_party/libdrm/src/Makefile.sources
index 8c7ddace01f..a77f48dee7c 100644
--- a/chromium/third_party/libdrm/src/Makefile.sources
+++ b/chromium/third_party/libdrm/src/Makefile.sources
@@ -21,7 +21,6 @@ LIBDRM_INCLUDE_H_FILES := \
include/drm/drm_fourcc.h \
include/drm/drm_mode.h \
include/drm/drm_sarea.h \
- include/drm/evdi_drm.h \
include/drm/i915_drm.h \
include/drm/mach64_drm.h \
include/drm/mga_drm.h \
@@ -33,10 +32,7 @@ LIBDRM_INCLUDE_H_FILES := \
include/drm/savage_drm.h \
include/drm/sis_drm.h \
include/drm/tegra_drm.h \
- include/drm/vc4_drm.h \
- include/drm/vgem_drm.h \
- include/drm/via_drm.h \
- include/drm/virtgpu_drm.h
+ include/drm/via_drm.h
LIBDRM_INCLUDE_VMWGFX_H_FILES := \
include/drm/vmwgfx_drm.h
diff --git a/chromium/third_party/libdrm/src/PRESUBMIT.cfg b/chromium/third_party/libdrm/src/PRESUBMIT.cfg
deleted file mode 100644
index 9b0d5a48ce8..00000000000
--- a/chromium/third_party/libdrm/src/PRESUBMIT.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-[Hook Overrides]
-cros_license_check: false
-tab_check: false
diff --git a/chromium/third_party/libdrm/src/amdgpu/Android.mk b/chromium/third_party/libdrm/src/amdgpu/Android.mk
index 57c53a7958c..469df1b269d 100644
--- a/chromium/third_party/libdrm/src/amdgpu/Android.mk
+++ b/chromium/third_party/libdrm/src/amdgpu/Android.mk
@@ -9,7 +9,7 @@ LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libdrm
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_AMDGPU_FILES))
+LOCAL_SRC_FILES := $(LIBDRM_AMDGPU_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
diff --git a/chromium/third_party/libdrm/src/amdgpu/amdgpu-symbol-check b/chromium/third_party/libdrm/src/amdgpu/amdgpu-symbol-check
index 648db9b6c86..9a0b36cb379 100755
--- a/chromium/third_party/libdrm/src/amdgpu/amdgpu-symbol-check
+++ b/chromium/third_party/libdrm/src/amdgpu/amdgpu-symbol-check
@@ -24,15 +24,11 @@ amdgpu_bo_set_metadata
amdgpu_bo_va_op
amdgpu_bo_wait_for_idle
amdgpu_create_bo_from_user_mem
-amdgpu_cs_create_semaphore
amdgpu_cs_ctx_create
amdgpu_cs_ctx_free
-amdgpu_cs_destroy_semaphore
amdgpu_cs_query_fence_status
amdgpu_cs_query_reset_state
-amdgpu_cs_signal_semaphore
amdgpu_cs_submit
-amdgpu_cs_wait_semaphore
amdgpu_device_deinitialize
amdgpu_device_initialize
amdgpu_query_buffer_size_alignment
diff --git a/chromium/third_party/libdrm/src/amdgpu/amdgpu.h b/chromium/third_party/libdrm/src/amdgpu/amdgpu.h
index 5d5a2c67f2a..e44d802b3f5 100644
--- a/chromium/third_party/libdrm/src/amdgpu/amdgpu.h
+++ b/chromium/third_party/libdrm/src/amdgpu/amdgpu.h
@@ -124,11 +124,6 @@ typedef struct amdgpu_bo_list *amdgpu_bo_list_handle;
*/
typedef struct amdgpu_va *amdgpu_va_handle;
-/**
- * Define handle for semaphore
- */
-typedef struct amdgpu_semaphore *amdgpu_semaphore_handle;
-
/*--------------------------------------------------------------------------*/
/* -------------------------- Structures ---------------------------------- */
/*--------------------------------------------------------------------------*/
@@ -685,7 +680,7 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
int amdgpu_bo_free(amdgpu_bo_handle buf_handle);
/**
- * Request CPU access to GPU accessible memory
+ * Request CPU access to GPU accessable memory
*
* \param buf_handle - \c [in] Buffer handle
* \param cpu - \c [out] CPU address to be used for access
@@ -851,7 +846,7 @@ int amdgpu_cs_query_reset_state(amdgpu_context_handle context,
* order.
*
* The caller can specify the user fence buffer/location with the fence_info in the
- * cs_request.The sequence number is returned via the 'seq_no' parameter
+ * cs_request.The sequence number is returned via the 'seq_no' paramter
* in ibs_request structure.
*
*
@@ -1185,64 +1180,4 @@ int amdgpu_bo_va_op(amdgpu_bo_handle bo,
uint64_t flags,
uint32_t ops);
-/**
- * create semaphore
- *
- * \param sem - \c [out] semaphore handle
- *
- * \return 0 on success\n
- * <0 - Negative POSIX Error code
- *
-*/
-int amdgpu_cs_create_semaphore(amdgpu_semaphore_handle *sem);
-
-/**
- * signal semaphore
- *
- * \param context - \c [in] GPU Context
- * \param ip_type - \c [in] Hardware IP block type = AMDGPU_HW_IP_*
- * \param ip_instance - \c [in] Index of the IP block of the same type
- * \param ring - \c [in] Specify ring index of the IP
- * \param sem - \c [in] semaphore handle
- *
- * \return 0 on success\n
- * <0 - Negative POSIX Error code
- *
-*/
-int amdgpu_cs_signal_semaphore(amdgpu_context_handle ctx,
- uint32_t ip_type,
- uint32_t ip_instance,
- uint32_t ring,
- amdgpu_semaphore_handle sem);
-
-/**
- * wait semaphore
- *
- * \param context - \c [in] GPU Context
- * \param ip_type - \c [in] Hardware IP block type = AMDGPU_HW_IP_*
- * \param ip_instance - \c [in] Index of the IP block of the same type
- * \param ring - \c [in] Specify ring index of the IP
- * \param sem - \c [in] semaphore handle
- *
- * \return 0 on success\n
- * <0 - Negative POSIX Error code
- *
-*/
-int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx,
- uint32_t ip_type,
- uint32_t ip_instance,
- uint32_t ring,
- amdgpu_semaphore_handle sem);
-
-/**
- * destroy semaphore
- *
- * \param sem - \c [in] semaphore handle
- *
- * \return 0 on success\n
- * <0 - Negative POSIX Error code
- *
-*/
-int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem);
-
#endif /* #ifdef _AMDGPU_H_ */
diff --git a/chromium/third_party/libdrm/src/amdgpu/amdgpu_bo.c b/chromium/third_party/libdrm/src/amdgpu/amdgpu_bo.c
index d30fd1e7166..1a5a40117b2 100644
--- a/chromium/third_party/libdrm/src/amdgpu/amdgpu_bo.c
+++ b/chromium/third_party/libdrm/src/amdgpu/amdgpu_bo.c
@@ -537,10 +537,18 @@ int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
int r;
struct amdgpu_bo *bo;
struct drm_amdgpu_gem_userptr args;
+ uintptr_t cpu0;
+ uint32_t ps, off;
- args.addr = (uintptr_t)cpu;
- args.flags = AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_REGISTER |
- AMDGPU_GEM_USERPTR_VALIDATE;
+ memset(&args, 0, sizeof(args));
+ ps = getpagesize();
+
+ cpu0 = ROUND_DOWN((uintptr_t)cpu, ps);
+ off = (uintptr_t)cpu - cpu0;
+ size = ROUND_UP(size + off, ps);
+
+ args.addr = cpu0;
+ args.flags = AMDGPU_GEM_USERPTR_ANONONLY | AMDGPU_GEM_USERPTR_REGISTER;
args.size = size;
r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_GEM_USERPTR,
&args, sizeof(args));
diff --git a/chromium/third_party/libdrm/src/amdgpu/amdgpu_cs.c b/chromium/third_party/libdrm/src/amdgpu/amdgpu_cs.c
index fb5b3a8c4bc..6747158c380 100644
--- a/chromium/third_party/libdrm/src/amdgpu/amdgpu_cs.c
+++ b/chromium/third_party/libdrm/src/amdgpu/amdgpu_cs.c
@@ -40,9 +40,6 @@
#include "amdgpu_drm.h"
#include "amdgpu_internal.h"
-static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle sem);
-static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle sem);
-
/**
* Create command submission context
*
@@ -56,7 +53,6 @@ int amdgpu_cs_ctx_create(amdgpu_device_handle dev,
{
struct amdgpu_context *gpu_context;
union drm_amdgpu_ctx args;
- int i, j, k;
int r;
if (NULL == dev)
@@ -70,10 +66,6 @@ int amdgpu_cs_ctx_create(amdgpu_device_handle dev,
gpu_context->dev = dev;
- r = pthread_mutex_init(&gpu_context->sequence_mutex, NULL);
- if (r)
- goto error;
-
/* Create the context */
memset(&args, 0, sizeof(args));
args.in.op = AMDGPU_CTX_OP_ALLOC_CTX;
@@ -82,16 +74,11 @@ int amdgpu_cs_ctx_create(amdgpu_device_handle dev,
goto error;
gpu_context->id = args.out.alloc.ctx_id;
- for (i = 0; i < AMDGPU_HW_IP_NUM; i++)
- for (j = 0; j < AMDGPU_HW_IP_INSTANCE_MAX_COUNT; j++)
- for (k = 0; k < AMDGPU_CS_MAX_RINGS; k++)
- list_inithead(&gpu_context->sem_list[i][j][k]);
*context = (amdgpu_context_handle)gpu_context;
return 0;
error:
- pthread_mutex_destroy(&gpu_context->sequence_mutex);
free(gpu_context);
return r;
}
@@ -107,32 +94,18 @@ error:
int amdgpu_cs_ctx_free(amdgpu_context_handle context)
{
union drm_amdgpu_ctx args;
- int i, j, k;
int r;
if (NULL == context)
return -EINVAL;
- pthread_mutex_destroy(&context->sequence_mutex);
-
/* now deal with kernel side */
memset(&args, 0, sizeof(args));
args.in.op = AMDGPU_CTX_OP_FREE_CTX;
args.in.ctx_id = context->id;
r = drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_CTX,
&args, sizeof(args));
- for (i = 0; i < AMDGPU_HW_IP_NUM; i++) {
- for (j = 0; j < AMDGPU_HW_IP_INSTANCE_MAX_COUNT; j++) {
- for (k = 0; k < AMDGPU_CS_MAX_RINGS; k++) {
- amdgpu_semaphore_handle sem;
- LIST_FOR_EACH_ENTRY(sem, &context->sem_list[i][j][k], list) {
- list_del(&sem->list);
- amdgpu_cs_reset_sem(sem);
- amdgpu_cs_unreference_sem(sem);
- }
- }
- }
- }
+
free(context);
return r;
@@ -177,10 +150,7 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
struct drm_amdgpu_cs_chunk *chunks;
struct drm_amdgpu_cs_chunk_data *chunk_data;
struct drm_amdgpu_cs_chunk_dep *dependencies = NULL;
- struct drm_amdgpu_cs_chunk_dep *sem_dependencies = NULL;
- struct list_head *sem_list;
- amdgpu_semaphore_handle sem, tmp;
- uint32_t i, size, sem_count = 0;
+ uint32_t i, size;
bool user_fence;
int r = 0;
@@ -190,13 +160,9 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
return -EINVAL;
if (ibs_request->number_of_ibs > AMDGPU_CS_MAX_IBS_PER_SUBMIT)
return -EINVAL;
- if (ibs_request->number_of_ibs == 0) {
- ibs_request->seq_no = AMDGPU_NULL_SUBMIT_SEQ;
- return 0;
- }
user_fence = (ibs_request->fence_info.handle != NULL);
- size = ibs_request->number_of_ibs + (user_fence ? 2 : 1) + 1;
+ size = ibs_request->number_of_ibs + (user_fence ? 2 : 1);
chunk_array = alloca(sizeof(uint64_t) * size);
chunks = alloca(sizeof(struct drm_amdgpu_cs_chunk) * size);
@@ -230,8 +196,6 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
chunk_data[i].ib_data.flags = ib->flags;
}
- pthread_mutex_lock(&context->sequence_mutex);
-
if (user_fence) {
i = cs.in.num_chunks++;
@@ -276,49 +240,15 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
chunks[i].chunk_data = (uint64_t)(uintptr_t)dependencies;
}
- sem_list = &context->sem_list[ibs_request->ip_type][ibs_request->ip_instance][ibs_request->ring];
- LIST_FOR_EACH_ENTRY(sem, sem_list, list)
- sem_count++;
- if (sem_count) {
- sem_dependencies = malloc(sizeof(struct drm_amdgpu_cs_chunk_dep) * sem_count);
- if (!sem_dependencies) {
- r = -ENOMEM;
- goto error_unlock;
- }
- sem_count = 0;
- LIST_FOR_EACH_ENTRY_SAFE(sem, tmp, sem_list, list) {
- struct amdgpu_cs_fence *info = &sem->signal_fence;
- struct drm_amdgpu_cs_chunk_dep *dep = &sem_dependencies[sem_count++];
- dep->ip_type = info->ip_type;
- dep->ip_instance = info->ip_instance;
- dep->ring = info->ring;
- dep->ctx_id = info->context->id;
- dep->handle = info->fence;
-
- list_del(&sem->list);
- amdgpu_cs_reset_sem(sem);
- amdgpu_cs_unreference_sem(sem);
- }
- i = cs.in.num_chunks++;
-
- /* dependencies chunk */
- chunk_array[i] = (uint64_t)(uintptr_t)&chunks[i];
- chunks[i].chunk_id = AMDGPU_CHUNK_ID_DEPENDENCIES;
- chunks[i].length_dw = sizeof(struct drm_amdgpu_cs_chunk_dep) / 4 * sem_count;
- chunks[i].chunk_data = (uint64_t)(uintptr_t)sem_dependencies;
- }
-
r = drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_CS,
&cs, sizeof(cs));
if (r)
goto error_unlock;
ibs_request->seq_no = cs.out.handle;
- context->last_seq[ibs_request->ip_type][ibs_request->ip_instance][ibs_request->ring] = ibs_request->seq_no;
+
error_unlock:
- pthread_mutex_unlock(&context->sequence_mutex);
free(dependencies);
- free(sem_dependencies);
return r;
}
@@ -426,10 +356,6 @@ int amdgpu_cs_query_fence_status(struct amdgpu_cs_fence *fence,
return -EINVAL;
if (fence->ring >= AMDGPU_CS_MAX_RINGS)
return -EINVAL;
- if (fence->fence == AMDGPU_NULL_SUBMIT_SEQ) {
- *expired = true;
- return 0;
- }
*expired = false;
@@ -443,102 +369,3 @@ int amdgpu_cs_query_fence_status(struct amdgpu_cs_fence *fence,
return r;
}
-int amdgpu_cs_create_semaphore(amdgpu_semaphore_handle *sem)
-{
- struct amdgpu_semaphore *gpu_semaphore;
-
- if (NULL == sem)
- return -EINVAL;
-
- gpu_semaphore = calloc(1, sizeof(struct amdgpu_semaphore));
- if (NULL == gpu_semaphore)
- return -ENOMEM;
-
- atomic_set(&gpu_semaphore->refcount, 1);
- *sem = gpu_semaphore;
-
- return 0;
-}
-
-int amdgpu_cs_signal_semaphore(amdgpu_context_handle ctx,
- uint32_t ip_type,
- uint32_t ip_instance,
- uint32_t ring,
- amdgpu_semaphore_handle sem)
-{
- if (NULL == ctx)
- return -EINVAL;
- if (ip_type >= AMDGPU_HW_IP_NUM)
- return -EINVAL;
- if (ring >= AMDGPU_CS_MAX_RINGS)
- return -EINVAL;
- if (NULL == sem)
- return -EINVAL;
- /* sem has been signaled */
- if (sem->signal_fence.context)
- return -EINVAL;
- pthread_mutex_lock(&ctx->sequence_mutex);
- sem->signal_fence.context = ctx;
- sem->signal_fence.ip_type = ip_type;
- sem->signal_fence.ip_instance = ip_instance;
- sem->signal_fence.ring = ring;
- sem->signal_fence.fence = ctx->last_seq[ip_type][ip_instance][ring];
- update_references(NULL, &sem->refcount);
- pthread_mutex_unlock(&ctx->sequence_mutex);
- return 0;
-}
-
-int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx,
- uint32_t ip_type,
- uint32_t ip_instance,
- uint32_t ring,
- amdgpu_semaphore_handle sem)
-{
- if (NULL == ctx)
- return -EINVAL;
- if (ip_type >= AMDGPU_HW_IP_NUM)
- return -EINVAL;
- if (ring >= AMDGPU_CS_MAX_RINGS)
- return -EINVAL;
- if (NULL == sem)
- return -EINVAL;
- /* must signal first */
- if (NULL == sem->signal_fence.context)
- return -EINVAL;
-
- pthread_mutex_lock(&ctx->sequence_mutex);
- list_add(&sem->list, &ctx->sem_list[ip_type][ip_instance][ring]);
- pthread_mutex_unlock(&ctx->sequence_mutex);
- return 0;
-}
-
-static int amdgpu_cs_reset_sem(amdgpu_semaphore_handle sem)
-{
- if (NULL == sem)
- return -EINVAL;
- if (NULL == sem->signal_fence.context)
- return -EINVAL;
-
- sem->signal_fence.context = NULL;;
- sem->signal_fence.ip_type = 0;
- sem->signal_fence.ip_instance = 0;
- sem->signal_fence.ring = 0;
- sem->signal_fence.fence = 0;
-
- return 0;
-}
-
-static int amdgpu_cs_unreference_sem(amdgpu_semaphore_handle sem)
-{
- if (NULL == sem)
- return -EINVAL;
-
- if (update_references(&sem->refcount, NULL))
- free(sem);
- return 0;
-}
-
-int amdgpu_cs_destroy_semaphore(amdgpu_semaphore_handle sem)
-{
- return amdgpu_cs_unreference_sem(sem);
-}
diff --git a/chromium/third_party/libdrm/src/amdgpu/amdgpu_internal.h b/chromium/third_party/libdrm/src/amdgpu/amdgpu_internal.h
index 4f039b68fa5..7dd5c1c724a 100644
--- a/chromium/third_party/libdrm/src/amdgpu/amdgpu_internal.h
+++ b/chromium/third_party/libdrm/src/amdgpu/amdgpu_internal.h
@@ -44,7 +44,6 @@
#define ROUND_DOWN(x, y) ((x) & ~__round_mask(x, y))
#define AMDGPU_INVALID_VA_ADDRESS 0xffffffffffffffff
-#define AMDGPU_NULL_SUBMIT_SEQ 0
struct amdgpu_bo_va_hole {
struct list_head list;
@@ -112,23 +111,8 @@ struct amdgpu_bo_list {
struct amdgpu_context {
struct amdgpu_device *dev;
- /** Mutex for accessing fences and to maintain command submissions
- in good sequence. */
- pthread_mutex_t sequence_mutex;
/* context id*/
uint32_t id;
- uint64_t last_seq[AMDGPU_HW_IP_NUM][AMDGPU_HW_IP_INSTANCE_MAX_COUNT][AMDGPU_CS_MAX_RINGS];
- struct list_head sem_list[AMDGPU_HW_IP_NUM][AMDGPU_HW_IP_INSTANCE_MAX_COUNT][AMDGPU_CS_MAX_RINGS];
-};
-
-/**
- * Structure describing sw semaphore based on scheduler
- *
- */
-struct amdgpu_semaphore {
- atomic_t refcount;
- struct list_head list;
- struct amdgpu_cs_fence signal_fence;
};
/**
diff --git a/chromium/third_party/libdrm/src/amdgpu/libdrm_amdgpu.pc.in b/chromium/third_party/libdrm/src/amdgpu/libdrm_amdgpu.pc.in
index f1c552a623f..417865e5764 100644
--- a/chromium/third_party/libdrm/src/amdgpu/libdrm_amdgpu.pc.in
+++ b/chromium/third_party/libdrm/src/amdgpu/libdrm_amdgpu.pc.in
@@ -8,4 +8,3 @@ Description: Userspace interface to kernel DRM services for amdgpu
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -ldrm_amdgpu
Cflags: -I${includedir} -I${includedir}/libdrm
-Requires.private: libdrm
diff --git a/chromium/third_party/libdrm/src/configure.ac b/chromium/third_party/libdrm/src/configure.ac
index 6c069f7b2ff..b929d36a28c 100644
--- a/chromium/third_party/libdrm/src/configure.ac
+++ b/chromium/third_party/libdrm/src/configure.ac
@@ -20,7 +20,7 @@
AC_PREREQ([2.63])
AC_INIT([libdrm],
- [2.4.70],
+ [2.4.65],
[https://bugs.freedesktop.org/enter_bug.cgi?product=DRI],
[libdrm])
@@ -53,8 +53,7 @@ AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_FUNC_ALLOCA
-AC_HEADER_MAJOR
-AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])
+AC_CHECK_HEADERS([sys/mkdev.h sys/sysctl.h])
# Initialize libtool
LT_PREREQ([2.2])
@@ -122,26 +121,11 @@ AC_ARG_ENABLE(freedreno-kgsl,
[Enable support for freedreno's to use downstream android kernel API (default: disabled)]),
[FREEDRENO_KGSL=$enableval], [FREEDRENO_KGSL=no])
-AC_ARG_ENABLE(mediatek-experimental-api,
- AS_HELP_STRING([--enable-mediatek-experimental-api],
- [Enable support for Mediatek's experimental API (default: disabled)]),
- [MEDIATEK=$enableval], [MEDIATEK=no])
-
AC_ARG_ENABLE(tegra-experimental-api,
AS_HELP_STRING([--enable-tegra-experimental-api],
[Enable support for Tegra's experimental API (default: disabled)]),
[TEGRA=$enableval], [TEGRA=no])
-AC_ARG_ENABLE(vc4,
- AS_HELP_STRING([--disable-vc4],
- [Enable support for vc4's API (default: auto, enabled on arm)]),
- [VC4=$enableval], [VC4=auto])
-
-AC_ARG_ENABLE(rockchip-experimental-api,
- AS_HELP_STRING([--enable-rockchip-experimental-api],
- [Enable support for rockchip's experimental API (default: disabled)]),
- [ROCKCHIP=$enableval], [ROCKCHIP=no])
-
AC_ARG_ENABLE(install-test-programs,
AS_HELP_STRING([--enable-install-test-programs],
[Install test programs (default: no)]),
@@ -190,8 +174,7 @@ MAYBE_WARN="-Wall -Wextra \
-Wstrict-aliasing=2 -Winit-self \
-Wdeclaration-after-statement -Wold-style-definition \
-Wno-unused-parameter \
--Wno-attributes -Wno-long-long -Winline -Wshadow \
--Wno-missing-field-initializers"
+-Wno-attributes -Wno-long-long -Winline -Wshadow"
# invalidate cached value if MAYBE_WARN has changed
if test "x$libdrm_cv_warn_maybe" != "x$MAYBE_WARN"; then
@@ -306,12 +289,6 @@ else
*) FREEDRENO=no ;;
esac
fi
- if test "x$VC4" = xauto; then
- case $host_cpu in
- arm*|aarch64) VC4=yes ;;
- *) VC4=no ;;
- esac
- fi
fi
if test "x$INTEL" != "xno"; then
@@ -382,23 +359,19 @@ if test "x$RADEON" = xyes; then
AC_DEFINE(HAVE_RADEON, 1, [Have radeon support])
fi
-if test "x$AMDGPU" != xno; then
- # Detect cunit library
- PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
- # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We
- # do this because Debian (Ubuntu) lacks pkg-config file for cunit.
- # fixed in 2.1-2.dfsg-3: http://anonscm.debian.org/cgit/collab-maint/cunit.git/commit/?h=debian
- if test "x${have_cunit}" = "xno"; then
- AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no])
- if test "x${have_cunit}" = "xyes"; then
- CUNIT_LIBS="-lcunit"
- CUNIT_CFLAGS=""
- AC_SUBST([CUNIT_LIBS])
- AC_SUBST([CUNIT_CFLAGS])
- fi
+# Detect cunit library
+PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
+# If pkg-config does not find cunit, check it using AC_CHECK_LIB. We
+# do this because Debian (Ubuntu) lacks pkg-config file for cunit.
+# fixed in 2.1-2.dfsg-3: http://anonscm.debian.org/cgit/collab-maint/cunit.git/commit/?h=debian
+if test "x${have_cunit}" = "xno"; then
+ AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no])
+ if test "x${have_cunit}" = "xyes"; then
+ CUNIT_LIBS="-lcunit"
+ CUNIT_CFLAGS=""
+ AC_SUBST([CUNIT_LIBS])
+ AC_SUBST([CUNIT_CFLAGS])
fi
-else
- have_cunit=no
fi
AM_CONDITIONAL(HAVE_CUNIT, [test "x$have_cunit" != "xno"])
@@ -418,21 +391,6 @@ if test "x$TEGRA" = xyes; then
AC_DEFINE(HAVE_TEGRA, 1, [Have Tegra support])
fi
-AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes])
-if test "x$VC4" = xyes; then
- AC_DEFINE(HAVE_VC4, 1, [Have VC4 support])
-fi
-
-AM_CONDITIONAL(HAVE_ROCKCHIP, [test "x$ROCKCHIP" = xyes])
-if test "x$ROCKCHIP" = xyes; then
- AC_DEFINE(HAVE_ROCKCHIP, 1, [Have ROCKCHIP support])
-fi
-
-AM_CONDITIONAL(HAVE_MEDIATEK, [test "x$MEDIATEK" = xyes])
-if test "x$MEDIATEK" = xyes; then
- AC_DEFINE(HAVE_MEDIATEK, 1, [Have MEDIATEK support])
-fi
-
AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes])
if test "x$INSTALL_TESTS" = xyes; then
AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs])
@@ -442,9 +400,7 @@ AC_ARG_ENABLE([cairo-tests],
[AS_HELP_STRING([--enable-cairo-tests],
[Enable support for Cairo rendering in tests (default: auto)])],
[CAIRO=$enableval], [CAIRO=auto])
-if test "x$CAIRO" != xno; then
- PKG_CHECK_MODULES(CAIRO, cairo, [HAVE_CAIRO=yes], [HAVE_CAIRO=no])
-fi
+PKG_CHECK_MODULES(CAIRO, cairo, [HAVE_CAIRO=yes], [HAVE_CAIRO=no])
AC_MSG_CHECKING([whether to enable Cairo tests])
if test "x$CAIRO" = xauto; then
CAIRO="$HAVE_CAIRO"
@@ -489,9 +445,7 @@ AC_ARG_ENABLE(valgrind,
[AS_HELP_STRING([--enable-valgrind],
[Build libdrm with valgrind support (default: auto)])],
[VALGRIND=$enableval], [VALGRIND=auto])
-if test "x$VALGRIND" != xno; then
- PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
-fi
+PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
AC_MSG_CHECKING([whether to enable Valgrind support])
if test "x$VALGRIND" = xauto; then
VALGRIND="$have_valgrind"
@@ -542,16 +496,9 @@ AC_CONFIG_FILES([
freedreno/libdrm_freedreno.pc
tegra/Makefile
tegra/libdrm_tegra.pc
- vc4/Makefile
- vc4/libdrm_vc4.pc
- rockchip/Makefile
- rockchip/libdrm_rockchip.pc
- mediatek/Makefile
- mediatek/libdrm_mediatek.pc
tests/Makefile
tests/modeprint/Makefile
tests/modetest/Makefile
- tests/kms/Makefile
tests/kmstest/Makefile
tests/proptest/Makefile
tests/radeon/Makefile
@@ -560,7 +507,6 @@ AC_CONFIG_FILES([
tests/exynos/Makefile
tests/tegra/Makefile
tests/nouveau/Makefile
- tests/util/Makefile
man/Makefile
libdrm.pc])
AC_OUTPUT
@@ -578,7 +524,4 @@ echo " OMAP API $OMAP"
echo " EXYNOS API $EXYNOS"
echo " Freedreno API $FREEDRENO (kgsl: $FREEDRENO_KGSL)"
echo " Tegra API $TEGRA"
-echo " VC4 API $VC4"
-echo " Rockchip API $ROCKCHIP"
-echo " Mediatek API $MEDIATEK"
echo ""
diff --git a/chromium/third_party/libdrm/src/exynos/exynos-symbol-check b/chromium/third_party/libdrm/src/exynos/exynos-symbol-check
index 9692caa685b..1a1be89eae7 100755
--- a/chromium/third_party/libdrm/src/exynos/exynos-symbol-check
+++ b/chromium/third_party/libdrm/src/exynos/exynos-symbol-check
@@ -22,15 +22,12 @@ exynos_device_destroy
exynos_prime_fd_to_handle
exynos_prime_handle_to_fd
exynos_vidi_connection
-exynos_handle_event
g2d_blend
g2d_copy
g2d_copy_with_scale
g2d_exec
-g2d_config_event
g2d_fini
g2d_init
-g2d_move
g2d_scale_and_blend
g2d_solid_fill
EOF
diff --git a/chromium/third_party/libdrm/src/exynos/exynos_drm.c b/chromium/third_party/libdrm/src/exynos/exynos_drm.c
index b961e520737..df9b8ed4d39 100644
--- a/chromium/third_party/libdrm/src/exynos/exynos_drm.c
+++ b/chromium/third_party/libdrm/src/exynos/exynos_drm.c
@@ -32,7 +32,6 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
-#include <unistd.h>
#include <sys/mman.h>
#include <linux/stddef.h>
@@ -43,8 +42,6 @@
#include "exynos_drm.h"
#include "exynos_drmif.h"
-#define U642VOID(x) ((void *)(unsigned long)(x))
-
/*
* Create exynos drm device object.
*
@@ -347,7 +344,7 @@ exynos_prime_fd_to_handle(struct exynos_device *dev, int fd, uint32_t *handle)
*
* @dev: a exynos device object.
* @connect: indicate whether connectoin or disconnection request.
- * @ext: indicate whether edid data includes extensions data or not.
+ * @ext: indicate whether edid data includes extentions data or not.
* @edid: a pointer to edid data from Wireless Display device.
*
* this interface is used to request Virtual Display driver connection or
@@ -377,76 +374,3 @@ exynos_vidi_connection(struct exynos_device *dev, uint32_t connect,
return 0;
}
-
-static void
-exynos_handle_vendor(int fd, struct drm_event *e, void *ctx)
-{
- struct drm_exynos_g2d_event *g2d;
- struct exynos_event_context *ectx = ctx;
-
- switch (e->type) {
- case DRM_EXYNOS_G2D_EVENT:
- if (ectx->version < 1 || ectx->g2d_event_handler == NULL)
- break;
- g2d = (struct drm_exynos_g2d_event *)e;
- ectx->g2d_event_handler(fd, g2d->cmdlist_no, g2d->tv_sec,
- g2d->tv_usec, U642VOID(g2d->user_data));
- break;
-
- default:
- break;
- }
-}
-
-int
-exynos_handle_event(struct exynos_device *dev, struct exynos_event_context *ctx)
-{
- char buffer[1024];
- int len, i;
- struct drm_event *e;
- struct drm_event_vblank *vblank;
- drmEventContextPtr evctx = &ctx->base;
-
- /* The DRM read semantics guarantees that we always get only
- * complete events. */
- len = read(dev->fd, buffer, sizeof buffer);
- if (len == 0)
- return 0;
- if (len < (int)sizeof *e)
- return -1;
-
- i = 0;
- while (i < len) {
- e = (struct drm_event *) &buffer[i];
- switch (e->type) {
- case DRM_EVENT_VBLANK:
- if (evctx->version < 1 ||
- evctx->vblank_handler == NULL)
- break;
- vblank = (struct drm_event_vblank *) e;
- evctx->vblank_handler(dev->fd,
- vblank->sequence,
- vblank->tv_sec,
- vblank->tv_usec,
- U642VOID (vblank->user_data));
- break;
- case DRM_EVENT_FLIP_COMPLETE:
- if (evctx->version < 2 ||
- evctx->page_flip_handler == NULL)
- break;
- vblank = (struct drm_event_vblank *) e;
- evctx->page_flip_handler(dev->fd,
- vblank->sequence,
- vblank->tv_sec,
- vblank->tv_usec,
- U642VOID (vblank->user_data));
- break;
- default:
- exynos_handle_vendor(dev->fd, e, evctx);
- break;
- }
- i += e->length;
- }
-
- return 0;
-}
diff --git a/chromium/third_party/libdrm/src/exynos/exynos_drm.h b/chromium/third_party/libdrm/src/exynos/exynos_drm.h
index c3af0ac5f6d..256c02f0250 100644
--- a/chromium/third_party/libdrm/src/exynos/exynos_drm.h
+++ b/chromium/third_party/libdrm/src/exynos/exynos_drm.h
@@ -157,16 +157,4 @@ struct drm_exynos_g2d_exec {
#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
-/* EXYNOS specific events */
-#define DRM_EXYNOS_G2D_EVENT 0x80000000
-
-struct drm_exynos_g2d_event {
- struct drm_event base;
- __u64 user_data;
- __u32 tv_sec;
- __u32 tv_usec;
- __u32 cmdlist_no;
- __u32 reserved;
-};
-
#endif
diff --git a/chromium/third_party/libdrm/src/exynos/exynos_drmif.h b/chromium/third_party/libdrm/src/exynos/exynos_drmif.h
index 626e39985a1..c7c1d442b20 100644
--- a/chromium/third_party/libdrm/src/exynos/exynos_drmif.h
+++ b/chromium/third_party/libdrm/src/exynos/exynos_drmif.h
@@ -54,25 +54,6 @@ struct exynos_bo {
uint32_t name;
};
-#define EXYNOS_EVENT_CONTEXT_VERSION 1
-
-/*
- * Exynos Event Context structure.
- *
- * @base: base context (for core events).
- * @version: version info similar to the one in 'drmEventContext'.
- * @g2d_event_handler: handler for G2D events.
- */
-struct exynos_event_context {
- drmEventContext base;
-
- int version;
-
- void (*g2d_event_handler)(int fd, unsigned int cmdlist_no,
- unsigned int tv_sec, unsigned int tv_usec,
- void *user_data);
-};
-
/*
* device related functions:
*/
@@ -102,11 +83,4 @@ int exynos_prime_fd_to_handle(struct exynos_device *dev, int fd,
int exynos_vidi_connection(struct exynos_device *dev, uint32_t connect,
uint32_t ext, void *edid);
-/*
- * event handling related functions:
- */
-int exynos_handle_event(struct exynos_device *dev,
- struct exynos_event_context *ctx);
-
-
#endif /* EXYNOS_DRMIF_H_ */
diff --git a/chromium/third_party/libdrm/src/exynos/exynos_fimg2d.c b/chromium/third_party/libdrm/src/exynos/exynos_fimg2d.c
index 7f1d105a5cb..e7341449a88 100644
--- a/chromium/third_party/libdrm/src/exynos/exynos_fimg2d.c
+++ b/chromium/third_party/libdrm/src/exynos/exynos_fimg2d.c
@@ -57,7 +57,6 @@ struct g2d_context {
unsigned int cmd_nr;
unsigned int cmd_buf_nr;
unsigned int cmdlist_nr;
- void *event_userdata;
};
enum g2d_base_addr_reg {
@@ -65,44 +64,6 @@ enum g2d_base_addr_reg {
g2d_src
};
-enum e_g2d_dir_mode {
- G2D_DIR_MODE_POSITIVE = 0,
- G2D_DIR_MODE_NEGATIVE = 1
-};
-
-union g2d_direction_val {
- unsigned int val[2];
- struct {
- /* SRC_MSK_DIRECT_REG [0:1] (source) */
- enum e_g2d_dir_mode src_x_direction:1;
- enum e_g2d_dir_mode src_y_direction:1;
-
- /* SRC_MSK_DIRECT_REG [2:3] */
- unsigned int reversed1:2;
-
- /* SRC_MSK_DIRECT_REG [4:5] (mask) */
- enum e_g2d_dir_mode mask_x_direction:1;
- enum e_g2d_dir_mode mask_y_direction:1;
-
- /* SRC_MSK_DIRECT_REG [6:31] */
- unsigned int padding1:26;
-
- /* DST_PAT_DIRECT_REG [0:1] (destination) */
- enum e_g2d_dir_mode dst_x_direction:1;
- enum e_g2d_dir_mode dst_y_direction:1;
-
- /* DST_PAT_DIRECT_REG [2:3] */
- unsigned int reversed2:2;
-
- /* DST_PAT_DIRECT_REG [4:5] (pattern) */
- enum e_g2d_dir_mode pat_x_direction:1;
- enum e_g2d_dir_mode pat_y_direction:1;
-
- /* DST_PAT_DIRECT_REG [6:31] */
- unsigned int padding2:26;
- } data;
-};
-
static unsigned int g2d_get_scaling(unsigned int src, unsigned int dst)
{
/*
@@ -280,19 +241,6 @@ static void g2d_add_base_addr(struct g2d_context *ctx, struct g2d_image *img,
}
/*
- * g2d_set_direction - setup direction register (useful for overlapping blits).
- *
- * @ctx: a pointer to g2d_context structure.
- * @dir: a pointer to the g2d_direction_val structure.
- */
-static void g2d_set_direction(struct g2d_context *ctx,
- const union g2d_direction_val *dir)
-{
- g2d_add_cmd(ctx, SRC_MASK_DIRECT_REG, dir->val[0]);
- g2d_add_cmd(ctx, DST_PAT_DIRECT_REG, dir->val[1]);
-}
-
-/*
* g2d_reset - reset fimg2d hardware.
*
* @ctx: a pointer to g2d_context structure.
@@ -332,15 +280,8 @@ static int g2d_flush(struct g2d_context *ctx)
cmdlist.cmd_buf = (uint64_t)(uintptr_t)&ctx->cmd_buf[0];
cmdlist.cmd_nr = ctx->cmd_nr;
cmdlist.cmd_buf_nr = ctx->cmd_buf_nr;
-
- if (ctx->event_userdata) {
- cmdlist.event_type = G2D_EVENT_NONSTOP;
- cmdlist.user_data = (uint64_t)(uintptr_t)(ctx->event_userdata);
- ctx->event_userdata = NULL;
- } else {
- cmdlist.event_type = G2D_EVENT_NOT;
- cmdlist.user_data = 0;
- }
+ cmdlist.event_type = G2D_EVENT_NOT;
+ cmdlist.user_data = 0;
ctx->cmd_nr = 0;
ctx->cmd_buf_nr = 0;
@@ -395,22 +336,6 @@ void g2d_fini(struct g2d_context *ctx)
}
/**
- * g2d_config_event - setup userdata configuration for a g2d event.
- * The next invocation of a g2d call (e.g. g2d_solid_fill) is
- * then going to flag the command buffer as 'nonstop'.
- * Completion of the command buffer execution can then be
- * determined by using drmHandleEvent on the DRM fd.
- * The userdata is 'consumed' in the process.
- *
- * @ctx: a pointer to g2d_context structure.
- * @userdata: a pointer to the user data
- */
-void g2d_config_event(struct g2d_context *ctx, void *userdata)
-{
- ctx->event_userdata = userdata;
-}
-
-/**
* g2d_exec - start the dma to process all commands summited by g2d_flush().
*
* @ctx: a pointer to g2d_context structure.
@@ -567,101 +492,6 @@ g2d_copy(struct g2d_context *ctx, struct g2d_image *src,
}
/**
- * g2d_move - copy content inside single buffer.
- * Similar to libc's memmove() this copies a rectangular
- * region of the provided buffer to another location, while
- * properly handling the situation where source and
- * destination rectangle overlap.
- *
- * @ctx: a pointer to g2d_context structure.
- * @img: a pointer to g2d_image structure providing
- * buffer information.
- * @src_x: x position of source rectangle.
- * @src_y: y position of source rectangle.
- * @dst_x: x position of destination rectangle.
- * @dst_y: y position of destination rectangle.
- * @w: width of rectangle to move.
- * @h: height of rectangle to move.
- */
-int
-g2d_move(struct g2d_context *ctx, struct g2d_image *img,
- unsigned int src_x, unsigned int src_y,
- unsigned int dst_x, unsigned dst_y, unsigned int w,
- unsigned int h)
-{
- union g2d_rop4_val rop4;
- union g2d_point_val pt;
- union g2d_direction_val dir;
- unsigned int src_w, src_h, dst_w, dst_h;
-
- src_w = w;
- src_h = h;
- if (src_x + img->width > w)
- src_w = img->width - src_x;
- if (src_y + img->height > h)
- src_h = img->height - src_y;
-
- dst_w = w;
- dst_h = w;
- if (dst_x + img->width > w)
- dst_w = img->width - dst_x;
- if (dst_y + img->height > h)
- dst_h = img->height - dst_y;
-
- w = MIN(src_w, dst_w);
- h = MIN(src_h, dst_h);
-
- if (w == 0 || h == 0) {
- fprintf(stderr, MSG_PREFIX "invalid width or height.\n");
- return -EINVAL;
- }
-
- if (g2d_check_space(ctx, 13, 2))
- return -ENOSPC;
-
- g2d_add_cmd(ctx, DST_SELECT_REG, G2D_SELECT_MODE_BGCOLOR);
- g2d_add_cmd(ctx, SRC_SELECT_REG, G2D_SELECT_MODE_NORMAL);
-
- g2d_add_cmd(ctx, DST_COLOR_MODE_REG, img->color_mode);
- g2d_add_cmd(ctx, SRC_COLOR_MODE_REG, img->color_mode);
-
- g2d_add_base_addr(ctx, img, g2d_dst);
- g2d_add_base_addr(ctx, img, g2d_src);
-
- g2d_add_cmd(ctx, DST_STRIDE_REG, img->stride);
- g2d_add_cmd(ctx, SRC_STRIDE_REG, img->stride);
-
- dir.val[0] = dir.val[1] = 0;
-
- if (dst_x >= src_x)
- dir.data.src_x_direction = dir.data.dst_x_direction = 1;
- if (dst_y >= src_y)
- dir.data.src_y_direction = dir.data.dst_y_direction = 1;
-
- g2d_set_direction(ctx, &dir);
-
- pt.data.x = src_x;
- pt.data.y = src_y;
- g2d_add_cmd(ctx, SRC_LEFT_TOP_REG, pt.val);
- pt.data.x = src_x + w;
- pt.data.y = src_y + h;
- g2d_add_cmd(ctx, SRC_RIGHT_BOTTOM_REG, pt.val);
-
- pt.data.x = dst_x;
- pt.data.y = dst_y;
- g2d_add_cmd(ctx, DST_LEFT_TOP_REG, pt.val);
- pt.data.x = dst_x + w;
- pt.data.y = dst_y + h;
- g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val);
-
- rop4.val = 0;
- rop4.data.unmasked_rop3 = G2D_ROP3_SRC;
- g2d_add_cmd(ctx, ROP4_REG, rop4.val);
-
- return g2d_flush(ctx);
-}
-
-/**
* g2d_copy_with_scale - copy contents in source buffer to destination buffer
* scaling up or down properly.
*
diff --git a/chromium/third_party/libdrm/src/exynos/exynos_fimg2d.h b/chromium/third_party/libdrm/src/exynos/exynos_fimg2d.h
index a825c6831b3..4aa156830ec 100644
--- a/chromium/third_party/libdrm/src/exynos/exynos_fimg2d.h
+++ b/chromium/third_party/libdrm/src/exynos/exynos_fimg2d.h
@@ -290,7 +290,6 @@ struct g2d_context;
struct g2d_context *g2d_init(int fd);
void g2d_fini(struct g2d_context *ctx);
-void g2d_config_event(struct g2d_context *ctx, void *userdata);
int g2d_exec(struct g2d_context *ctx);
int g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img,
unsigned int x, unsigned int y, unsigned int w,
@@ -299,9 +298,6 @@ int g2d_copy(struct g2d_context *ctx, struct g2d_image *src,
struct g2d_image *dst, unsigned int src_x,
unsigned int src_y, unsigned int dst_x, unsigned int dst_y,
unsigned int w, unsigned int h);
-int g2d_move(struct g2d_context *ctx, struct g2d_image *img,
- unsigned int src_x, unsigned int src_y, unsigned int dst_x,
- unsigned dst_y, unsigned int w, unsigned int h);
int g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src,
struct g2d_image *dst, unsigned int src_x,
unsigned int src_y, unsigned int src_w,
diff --git a/chromium/third_party/libdrm/src/exynos/libdrm_exynos.pc.in b/chromium/third_party/libdrm/src/exynos/libdrm_exynos.pc.in
index ff1c43203d0..5ce911866fb 100644
--- a/chromium/third_party/libdrm/src/exynos/libdrm_exynos.pc.in
+++ b/chromium/third_party/libdrm/src/exynos/libdrm_exynos.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
Name: libdrm_exynos
Description: Userspace interface to exynos kernel DRM services
-Version: 0.7
+Version: 0.6
Libs: -L${libdir} -ldrm_exynos
Cflags: -I${includedir} -I${includedir}/libdrm -I${includedir}/exynos
Requires.private: libdrm
diff --git a/chromium/third_party/libdrm/src/freedreno/Android.mk b/chromium/third_party/libdrm/src/freedreno/Android.mk
index fba48f2f087..2645f7375a4 100644
--- a/chromium/third_party/libdrm/src/freedreno/Android.mk
+++ b/chromium/third_party/libdrm/src/freedreno/Android.mk
@@ -9,7 +9,7 @@ LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libdrm
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_FREEDRENO_FILES))
+LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
diff --git a/chromium/third_party/libdrm/src/freedreno/Makefile.am b/chromium/third_party/libdrm/src/freedreno/Makefile.am
index 0771d146b95..9b7ec7df9d0 100644
--- a/chromium/third_party/libdrm/src/freedreno/Makefile.am
+++ b/chromium/third_party/libdrm/src/freedreno/Makefile.am
@@ -27,4 +27,4 @@ pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libdrm_freedreno.pc
TESTS = freedreno-symbol-check
-EXTRA_DIST = $(TESTS)
+EXTRA_DIST = Android.mk $(TESTS)
diff --git a/chromium/third_party/libdrm/src/freedreno/Makefile.sources b/chromium/third_party/libdrm/src/freedreno/Makefile.sources
index 68a679bf631..57a8bf1b96e 100644
--- a/chromium/third_party/libdrm/src/freedreno/Makefile.sources
+++ b/chromium/third_party/libdrm/src/freedreno/Makefile.sources
@@ -4,7 +4,6 @@ LIBDRM_FREEDRENO_FILES := \
freedreno_priv.h \
freedreno_ringbuffer.c \
freedreno_bo.c \
- freedreno_bo_cache.c \
msm/msm_bo.c \
msm/msm_device.c \
msm/msm_drm.h \
diff --git a/chromium/third_party/libdrm/src/freedreno/kgsl/README b/chromium/third_party/libdrm/src/freedreno/README
index 56874b42ff2..ae22e013952 100644
--- a/chromium/third_party/libdrm/src/freedreno/kgsl/README
+++ b/chromium/third_party/libdrm/src/freedreno/README
@@ -1,13 +1,3 @@
-This is a historical discription of what is now the kgsl backend
-in libdrm freedreno (before the upstream drm/msm driver). Note
-that the kgsl backend requires the "kgsl-drm" shim driver, which
-usually is in disrepair (QCOM does not build it for android), and
-due to random differences between different downstream android
-kernel branches it may or may not work. So YMMV.
-
-Original README:
-----------------
-
Note that current msm kernel driver is a bit strange. It provides a
DRM interface for GEM, which is basically sufficient to have DRI2
working. But it does not provide KMS. And interface to 2d and 3d
diff --git a/chromium/third_party/libdrm/src/freedreno/freedreno-symbol-check b/chromium/third_party/libdrm/src/freedreno/freedreno-symbol-check
index 7b31a347001..f517b6e71cc 100755
--- a/chromium/third_party/libdrm/src/freedreno/freedreno-symbol-check
+++ b/chromium/third_party/libdrm/src/freedreno/freedreno-symbol-check
@@ -29,18 +29,14 @@ fd_device_fd
fd_device_new
fd_device_new_dup
fd_device_ref
-fd_device_version
fd_pipe_del
fd_pipe_get_param
fd_pipe_new
fd_pipe_wait
fd_pipe_wait_timeout
-fd_ringbuffer_cmd_count
fd_ringbuffer_del
fd_ringbuffer_emit_reloc_ring
-fd_ringbuffer_emit_reloc_ring_full
fd_ringbuffer_flush
-fd_ringbuffer_grow
fd_ringbuffer_new
fd_ringbuffer_reloc
fd_ringbuffer_reset
diff --git a/chromium/third_party/libdrm/src/freedreno/freedreno_bo.c b/chromium/third_party/libdrm/src/freedreno/freedreno_bo.c
index 996d6b95c0c..a23c65d060a 100644
--- a/chromium/third_party/libdrm/src/freedreno/freedreno_bo.c
+++ b/chromium/third_party/libdrm/src/freedreno/freedreno_bo.c
@@ -33,8 +33,9 @@
#include "freedreno_drmif.h"
#include "freedreno_priv.h"
-drm_private pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER;
-drm_private void bo_del(struct fd_bo *bo);
+static pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER;
+
+static void bo_del(struct fd_bo *bo);
/* set buffer name, and add to table, call w/ table_lock held: */
static void set_name(struct fd_bo *bo, uint32_t name)
@@ -82,16 +83,114 @@ static struct fd_bo * bo_from_handle(struct fd_device *dev,
return bo;
}
+/* Frees older cached buffers. Called under table_lock */
+drm_private void fd_cleanup_bo_cache(struct fd_device *dev, time_t time)
+{
+ int i;
+
+ if (dev->time == time)
+ return;
+
+ for (i = 0; i < dev->num_buckets; i++) {
+ struct fd_bo_bucket *bucket = &dev->cache_bucket[i];
+ struct fd_bo *bo;
+
+ while (!LIST_IS_EMPTY(&bucket->list)) {
+ bo = LIST_ENTRY(struct fd_bo, bucket->list.next, list);
+
+ /* keep things in cache for at least 1 second: */
+ if (time && ((time - bo->free_time) <= 1))
+ break;
+
+ list_del(&bo->list);
+ bo_del(bo);
+ }
+ }
+
+ dev->time = time;
+}
+
+static struct fd_bo_bucket * get_bucket(struct fd_device *dev, uint32_t size)
+{
+ int i;
+
+ /* hmm, this is what intel does, but I suppose we could calculate our
+ * way to the correct bucket size rather than looping..
+ */
+ for (i = 0; i < dev->num_buckets; i++) {
+ struct fd_bo_bucket *bucket = &dev->cache_bucket[i];
+ if (bucket->size >= size) {
+ return bucket;
+ }
+ }
+
+ return NULL;
+}
+
+static int is_idle(struct fd_bo *bo)
+{
+ return fd_bo_cpu_prep(bo, NULL,
+ DRM_FREEDRENO_PREP_READ |
+ DRM_FREEDRENO_PREP_WRITE |
+ DRM_FREEDRENO_PREP_NOSYNC) == 0;
+}
+
+static struct fd_bo *find_in_bucket(struct fd_device *dev,
+ struct fd_bo_bucket *bucket, uint32_t flags)
+{
+ struct fd_bo *bo = NULL;
+
+ /* TODO .. if we had an ALLOC_FOR_RENDER flag like intel, we could
+ * skip the busy check.. if it is only going to be a render target
+ * then we probably don't need to stall..
+ *
+ * NOTE that intel takes ALLOC_FOR_RENDER bo's from the list tail
+ * (MRU, since likely to be in GPU cache), rather than head (LRU)..
+ */
+ pthread_mutex_lock(&table_lock);
+ while (!LIST_IS_EMPTY(&bucket->list)) {
+ bo = LIST_ENTRY(struct fd_bo, bucket->list.next, list);
+ if (0 /* TODO: if madvise tells us bo is gone... */) {
+ list_del(&bo->list);
+ bo_del(bo);
+ bo = NULL;
+ continue;
+ }
+ /* TODO check for compatible flags? */
+ if (is_idle(bo)) {
+ list_del(&bo->list);
+ break;
+ }
+ bo = NULL;
+ break;
+ }
+ pthread_mutex_unlock(&table_lock);
+
+ return bo;
+}
+
+
struct fd_bo *
fd_bo_new(struct fd_device *dev, uint32_t size, uint32_t flags)
{
struct fd_bo *bo = NULL;
+ struct fd_bo_bucket *bucket;
uint32_t handle;
int ret;
- bo = fd_bo_cache_alloc(&dev->bo_cache, &size, flags);
- if (bo)
- return bo;
+ size = ALIGN(size, 4096);
+ bucket = get_bucket(dev, size);
+
+ /* see if we can be green and recycle: */
+ if (bucket) {
+ size = bucket->size;
+ bo = find_in_bucket(dev, bucket, flags);
+ if (bo) {
+ atomic_set(&bo->refcnt, 1);
+ fd_device_ref(bo->dev);
+ return bo;
+ }
+ }
ret = dev->funcs->bo_new_handle(dev, size, flags, &handle);
if (ret)
@@ -99,7 +198,7 @@ fd_bo_new(struct fd_device *dev, uint32_t size, uint32_t flags)
pthread_mutex_lock(&table_lock);
bo = bo_from_handle(dev, size, handle);
- bo->bo_reuse = TRUE;
+ bo->bo_reuse = 1;
pthread_mutex_unlock(&table_lock);
return bo;
@@ -201,17 +300,35 @@ void fd_bo_del(struct fd_bo *bo)
pthread_mutex_lock(&table_lock);
- if (bo->bo_reuse && (fd_bo_cache_free(&dev->bo_cache, bo) == 0))
- goto out;
+ if (bo->bo_reuse) {
+ struct fd_bo_bucket *bucket = get_bucket(dev, bo->size);
+
+ /* see if we can be green and recycle: */
+ if (bucket) {
+ struct timespec time;
+
+ clock_gettime(CLOCK_MONOTONIC, &time);
+
+ bo->free_time = time.tv_sec;
+ list_addtail(&bo->list, &bucket->list);
+ fd_cleanup_bo_cache(dev, time.tv_sec);
+
+ /* bo's in the bucket cache don't have a ref and
+ * don't hold a ref to the dev:
+ */
+
+ goto out;
+ }
+ }
bo_del(bo);
- fd_device_del_locked(dev);
out:
+ fd_device_del_locked(dev);
pthread_mutex_unlock(&table_lock);
}
/* Called under table_lock */
-drm_private void bo_del(struct fd_bo *bo)
+static void bo_del(struct fd_bo *bo)
{
if (bo->map)
drm_munmap(bo->map, bo->size);
@@ -249,7 +366,7 @@ int fd_bo_get_name(struct fd_bo *bo, uint32_t *name)
pthread_mutex_lock(&table_lock);
set_name(bo, req.name);
pthread_mutex_unlock(&table_lock);
- bo->bo_reuse = FALSE;
+ bo->bo_reuse = 0;
}
*name = bo->name;
@@ -273,7 +390,7 @@ int fd_bo_dmabuf(struct fd_bo *bo)
return ret;
}
- bo->bo_reuse = FALSE;
+ bo->bo_reuse = 0;
return prime_fd;
}
@@ -314,10 +431,3 @@ void fd_bo_cpu_fini(struct fd_bo *bo)
{
bo->funcs->cpu_fini(bo);
}
-
-#ifndef HAVE_FREEDRENO_KGSL
-struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, uint32_t size)
-{
- return NULL;
-}
-#endif
diff --git a/chromium/third_party/libdrm/src/freedreno/freedreno_bo_cache.c b/chromium/third_party/libdrm/src/freedreno/freedreno_bo_cache.c
deleted file mode 100644
index 7becb0d6410..00000000000
--- a/chromium/third_party/libdrm/src/freedreno/freedreno_bo_cache.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
-
-/*
- * Copyright (C) 2016 Rob Clark <robclark@freedesktop.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Authors:
- * Rob Clark <robclark@freedesktop.org>
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "freedreno_drmif.h"
-#include "freedreno_priv.h"
-
-
-drm_private void bo_del(struct fd_bo *bo);
-drm_private extern pthread_mutex_t table_lock;
-
-static void
-add_bucket(struct fd_bo_cache *cache, int size)
-{
- unsigned int i = cache->num_buckets;
-
- assert(i < ARRAY_SIZE(cache->cache_bucket));
-
- list_inithead(&cache->cache_bucket[i].list);
- cache->cache_bucket[i].size = size;
- cache->num_buckets++;
-}
-
-/**
- * @coarse: if true, only power-of-two bucket sizes, otherwise
- * fill in for a bit smoother size curve..
- */
-drm_private void
-fd_bo_cache_init(struct fd_bo_cache *cache, int course)
-{
- unsigned long size, cache_max_size = 64 * 1024 * 1024;
-
- /* OK, so power of two buckets was too wasteful of memory.
- * Give 3 other sizes between each power of two, to hopefully
- * cover things accurately enough. (The alternative is
- * probably to just go for exact matching of sizes, and assume
- * that for things like composited window resize the tiled
- * width/height alignment and rounding of sizes to pages will
- * get us useful cache hit rates anyway)
- */
- add_bucket(cache, 4096);
- add_bucket(cache, 4096 * 2);
- if (!course)
- add_bucket(cache, 4096 * 3);
-
- /* Initialize the linked lists for BO reuse cache. */
- for (size = 4 * 4096; size <= cache_max_size; size *= 2) {
- add_bucket(cache, size);
- if (!course) {
- add_bucket(cache, size + size * 1 / 4);
- add_bucket(cache, size + size * 2 / 4);
- add_bucket(cache, size + size * 3 / 4);
- }
- }
-}
-
-/* Frees older cached buffers. Called under table_lock */
-drm_private void
-fd_bo_cache_cleanup(struct fd_bo_cache *cache, time_t time)
-{
- int i;
-
- if (cache->time == time)
- return;
-
- for (i = 0; i < cache->num_buckets; i++) {
- struct fd_bo_bucket *bucket = &cache->cache_bucket[i];
- struct fd_bo *bo;
-
- while (!LIST_IS_EMPTY(&bucket->list)) {
- bo = LIST_ENTRY(struct fd_bo, bucket->list.next, list);
-
- /* keep things in cache for at least 1 second: */
- if (time && ((time - bo->free_time) <= 1))
- break;
-
- list_del(&bo->list);
- bo_del(bo);
- }
- }
-
- cache->time = time;
-}
-
-static struct fd_bo_bucket * get_bucket(struct fd_bo_cache *cache, uint32_t size)
-{
- int i;
-
- /* hmm, this is what intel does, but I suppose we could calculate our
- * way to the correct bucket size rather than looping..
- */
- for (i = 0; i < cache->num_buckets; i++) {
- struct fd_bo_bucket *bucket = &cache->cache_bucket[i];
- if (bucket->size >= size) {
- return bucket;
- }
- }
-
- return NULL;
-}
-
-static int is_idle(struct fd_bo *bo)
-{
- return fd_bo_cpu_prep(bo, NULL,
- DRM_FREEDRENO_PREP_READ |
- DRM_FREEDRENO_PREP_WRITE |
- DRM_FREEDRENO_PREP_NOSYNC) == 0;
-}
-
-static struct fd_bo *find_in_bucket(struct fd_bo_bucket *bucket, uint32_t flags)
-{
- struct fd_bo *bo = NULL;
-
- /* TODO .. if we had an ALLOC_FOR_RENDER flag like intel, we could
- * skip the busy check.. if it is only going to be a render target
- * then we probably don't need to stall..
- *
- * NOTE that intel takes ALLOC_FOR_RENDER bo's from the list tail
- * (MRU, since likely to be in GPU cache), rather than head (LRU)..
- */
- pthread_mutex_lock(&table_lock);
- if (!LIST_IS_EMPTY(&bucket->list)) {
- bo = LIST_ENTRY(struct fd_bo, bucket->list.next, list);
- /* TODO check for compatible flags? */
- if (is_idle(bo)) {
- list_del(&bo->list);
- } else {
- bo = NULL;
- }
- }
- pthread_mutex_unlock(&table_lock);
-
- return bo;
-}
-
-/* NOTE: size is potentially rounded up to bucket size: */
-drm_private struct fd_bo *
-fd_bo_cache_alloc(struct fd_bo_cache *cache, uint32_t *size, uint32_t flags)
-{
- struct fd_bo *bo = NULL;
- struct fd_bo_bucket *bucket;
-
- *size = ALIGN(*size, 4096);
- bucket = get_bucket(cache, *size);
-
- /* see if we can be green and recycle: */
-retry:
- if (bucket) {
- *size = bucket->size;
- bo = find_in_bucket(bucket, flags);
- if (bo) {
- if (bo->funcs->madvise(bo, TRUE) <= 0) {
- /* we've lost the backing pages, delete and try again: */
- pthread_mutex_lock(&table_lock);
- bo_del(bo);
- pthread_mutex_unlock(&table_lock);
- goto retry;
- }
- atomic_set(&bo->refcnt, 1);
- fd_device_ref(bo->dev);
- return bo;
- }
- }
-
- return NULL;
-}
-
-drm_private int
-fd_bo_cache_free(struct fd_bo_cache *cache, struct fd_bo *bo)
-{
- struct fd_bo_bucket *bucket = get_bucket(cache, bo->size);
-
- /* see if we can be green and recycle: */
- if (bucket) {
- struct timespec time;
-
- bo->funcs->madvise(bo, FALSE);
-
- clock_gettime(CLOCK_MONOTONIC, &time);
-
- bo->free_time = time.tv_sec;
- list_addtail(&bo->list, &bucket->list);
- fd_bo_cache_cleanup(cache, time.tv_sec);
-
- /* bo's in the bucket cache don't have a ref and
- * don't hold a ref to the dev:
- */
- fd_device_del_locked(bo->dev);
-
- return 0;
- }
-
- return -1;
-}
diff --git a/chromium/third_party/libdrm/src/freedreno/freedreno_device.c b/chromium/third_party/libdrm/src/freedreno/freedreno_device.c
index fcbf1402ad6..ddb95455149 100644
--- a/chromium/third_party/libdrm/src/freedreno/freedreno_device.c
+++ b/chromium/third_party/libdrm/src/freedreno/freedreno_device.c
@@ -42,6 +42,44 @@ static pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER;
struct fd_device * kgsl_device_new(int fd);
struct fd_device * msm_device_new(int fd);
+static void
+add_bucket(struct fd_device *dev, int size)
+{
+ unsigned int i = dev->num_buckets;
+
+ assert(i < ARRAY_SIZE(dev->cache_bucket));
+
+ list_inithead(&dev->cache_bucket[i].list);
+ dev->cache_bucket[i].size = size;
+ dev->num_buckets++;
+}
+
+static void
+init_cache_buckets(struct fd_device *dev)
+{
+ unsigned long size, cache_max_size = 64 * 1024 * 1024;
+
+ /* OK, so power of two buckets was too wasteful of memory.
+ * Give 3 other sizes between each power of two, to hopefully
+ * cover things accurately enough. (The alternative is
+ * probably to just go for exact matching of sizes, and assume
+ * that for things like composited window resize the tiled
+ * width/height alignment and rounding of sizes to pages will
+ * get us useful cache hit rates anyway)
+ */
+ add_bucket(dev, 4096);
+ add_bucket(dev, 4096 * 2);
+ add_bucket(dev, 4096 * 3);
+
+ /* Initialize the linked lists for BO reuse cache. */
+ for (size = 4 * 4096; size <= cache_max_size; size *= 2) {
+ add_bucket(dev, size);
+ add_bucket(dev, size + size * 1 / 4);
+ add_bucket(dev, size + size * 2 / 4);
+ add_bucket(dev, size + size * 3 / 4);
+ }
+}
+
struct fd_device * fd_device_new(int fd)
{
struct fd_device *dev;
@@ -56,15 +94,7 @@ struct fd_device * fd_device_new(int fd)
if (!strcmp(version->name, "msm")) {
DEBUG_MSG("msm DRM device");
- if (version->version_major != 1) {
- ERROR_MSG("unsupported version: %u.%u.%u", version->version_major,
- version->version_minor, version->version_patchlevel);
- dev = NULL;
- goto out;
- }
-
dev = msm_device_new(fd);
- dev->version = version->version_minor;
#ifdef HAVE_FREEDRENO_KGSL
} else if (!strcmp(version->name, "kgsl")) {
DEBUG_MSG("kgsl DRM device");
@@ -74,8 +104,6 @@ struct fd_device * fd_device_new(int fd)
ERROR_MSG("unknown device: %s", version->name);
dev = NULL;
}
-
-out:
drmFreeVersion(version);
if (!dev)
@@ -85,7 +113,7 @@ out:
dev->fd = fd;
dev->handle_table = drmHashCreate();
dev->name_table = drmHashCreate();
- fd_bo_cache_init(&dev->bo_cache, FALSE);
+ init_cache_buckets(dev);
return dev;
}
@@ -95,12 +123,9 @@ out:
*/
struct fd_device * fd_device_new_dup(int fd)
{
- int dup_fd = dup(fd);
- struct fd_device *dev = fd_device_new(dup_fd);
+ struct fd_device *dev = fd_device_new(dup(fd));
if (dev)
dev->closefd = 1;
- else
- close(dup_fd);
return dev;
}
@@ -112,7 +137,7 @@ struct fd_device * fd_device_ref(struct fd_device *dev)
static void fd_device_del_impl(struct fd_device *dev)
{
- fd_bo_cache_cleanup(&dev->bo_cache, 0);
+ fd_cleanup_bo_cache(dev, 0);
drmHashDestroy(dev->handle_table);
drmHashDestroy(dev->name_table);
if (dev->closefd)
@@ -140,8 +165,3 @@ int fd_device_fd(struct fd_device *dev)
{
return dev->fd;
}
-
-enum fd_version fd_device_version(struct fd_device *dev)
-{
- return dev->version;
-}
diff --git a/chromium/third_party/libdrm/src/freedreno/freedreno_drmif.h b/chromium/third_party/libdrm/src/freedreno/freedreno_drmif.h
index 2d913e6ca7f..5547e9439b0 100644
--- a/chromium/third_party/libdrm/src/freedreno/freedreno_drmif.h
+++ b/chromium/third_party/libdrm/src/freedreno/freedreno_drmif.h
@@ -32,15 +32,6 @@
#include <xf86drm.h>
#include <stdint.h>
-#if defined(__GNUC__)
-# define drm_deprecated __attribute__((__deprecated__))
-#else
-# define drm_deprecated
-#endif
-
-/* an empty marker for things that will be deprecated in the future: */
-#define will_be_deprecated
-
struct fd_bo;
struct fd_pipe;
struct fd_device;
@@ -59,8 +50,6 @@ enum fd_param_id {
FD_GMEM_SIZE,
FD_GPU_ID,
FD_CHIP_ID,
- FD_MAX_FREQ,
- FD_TIMESTAMP,
};
/* bo flags: */
@@ -89,11 +78,6 @@ struct fd_device * fd_device_ref(struct fd_device *dev);
void fd_device_del(struct fd_device *dev);
int fd_device_fd(struct fd_device *dev);
-enum fd_version {
- FD_VERSION_MADVISE = 1, /* kernel supports madvise */
- FD_VERSION_UNLIMITED_CMDS = 1, /* submits w/ >4 cmd buffers (growable ringbuffer) */
-};
-enum fd_version fd_device_version(struct fd_device *dev);
/* pipe functions:
*/
diff --git a/chromium/third_party/libdrm/src/freedreno/freedreno_priv.h b/chromium/third_party/libdrm/src/freedreno/freedreno_priv.h
index cdfdbe8dbd7..53817b1977e 100644
--- a/chromium/third_party/libdrm/src/freedreno/freedreno_priv.h
+++ b/chromium/third_party/libdrm/src/freedreno/freedreno_priv.h
@@ -54,13 +54,6 @@
#include "freedreno_ringbuffer.h"
#include "drm.h"
-#ifndef TRUE
-# define TRUE 1
-#endif
-#ifndef FALSE
-# define FALSE 0
-#endif
-
struct fd_device_funcs {
int (*bo_new_handle)(struct fd_device *dev, uint32_t size,
uint32_t flags, uint32_t *handle);
@@ -75,15 +68,8 @@ struct fd_bo_bucket {
struct list_head list;
};
-struct fd_bo_cache {
- struct fd_bo_bucket cache_bucket[14 * 4];
- int num_buckets;
- time_t time;
-};
-
struct fd_device {
int fd;
- enum fd_version version;
atomic_t refcnt;
/* tables to keep track of bo's, to avoid "evil-twin" fd_bo objects:
@@ -99,16 +85,14 @@ struct fd_device {
const struct fd_device_funcs *funcs;
- struct fd_bo_cache bo_cache;
+ struct fd_bo_bucket cache_bucket[14 * 4];
+ int num_buckets;
+ time_t time;
int closefd; /* call close(fd) upon destruction */
};
-drm_private void fd_bo_cache_init(struct fd_bo_cache *cache, int coarse);
-drm_private void fd_bo_cache_cleanup(struct fd_bo_cache *cache, time_t time);
-drm_private struct fd_bo * fd_bo_cache_alloc(struct fd_bo_cache *cache,
- uint32_t *size, uint32_t flags);
-drm_private int fd_bo_cache_free(struct fd_bo_cache *cache, struct fd_bo *bo);
+drm_private void fd_cleanup_bo_cache(struct fd_device *dev, time_t time);
/* for where @table_lock is already held: */
drm_private void fd_device_del_locked(struct fd_device *dev);
@@ -134,14 +118,11 @@ struct fd_ringmarker {
struct fd_ringbuffer_funcs {
void * (*hostptr)(struct fd_ringbuffer *ring);
int (*flush)(struct fd_ringbuffer *ring, uint32_t *last_start);
- void (*grow)(struct fd_ringbuffer *ring, uint32_t size);
void (*reset)(struct fd_ringbuffer *ring);
void (*emit_reloc)(struct fd_ringbuffer *ring,
const struct fd_reloc *reloc);
- uint32_t (*emit_reloc_ring)(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx,
- uint32_t submit_offset, uint32_t size);
- uint32_t (*cmd_count)(struct fd_ringbuffer *ring);
+ void (*emit_reloc_ring)(struct fd_ringbuffer *ring,
+ struct fd_ringmarker *target, struct fd_ringmarker *end);
void (*destroy)(struct fd_ringbuffer *ring);
};
@@ -149,7 +130,6 @@ struct fd_bo_funcs {
int (*offset)(struct fd_bo *bo, uint64_t *offset);
int (*cpu_prep)(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op);
void (*cpu_fini)(struct fd_bo *bo);
- int (*madvise)(struct fd_bo *bo, int willneed);
void (*destroy)(struct fd_bo *bo);
};
@@ -188,10 +168,4 @@ struct fd_bo {
#define U642VOID(x) ((void *)(unsigned long)(x))
#define VOID2U64(x) ((uint64_t)(unsigned long)(x))
-static inline uint32_t
-offset_bytes(void *end, void *start)
-{
- return ((char *)end) - ((char *)start);
-}
-
#endif /* FREEDRENO_PRIV_H_ */
diff --git a/chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.c b/chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.c
index 22dafb394f2..984da241c89 100644
--- a/chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.c
+++ b/chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.c
@@ -45,9 +45,10 @@ fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size)
if (!ring)
return NULL;
+ ring->size = size;
ring->pipe = pipe;
ring->start = ring->funcs->hostptr(ring);
- ring->end = &(ring->start[ring->size/4]);
+ ring->end = &(ring->start[size/4]);
ring->cur = ring->last_start = ring->start;
@@ -56,7 +57,6 @@ fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size)
void fd_ringbuffer_del(struct fd_ringbuffer *ring)
{
- fd_ringbuffer_reset(ring);
ring->funcs->destroy(ring);
}
@@ -86,22 +86,6 @@ int fd_ringbuffer_flush(struct fd_ringbuffer *ring)
return ring->funcs->flush(ring, ring->last_start);
}
-void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords)
-{
- assert(ring->funcs->grow); /* unsupported on kgsl */
-
- /* there is an upper bound on IB size, which appears to be 0x100000 */
- if (ring->size < 0x100000)
- ring->size *= 2;
-
- ring->funcs->grow(ring, ring->size);
-
- ring->start = ring->funcs->hostptr(ring);
- ring->end = &(ring->start[ring->size/4]);
-
- ring->cur = ring->last_start = ring->start;
-}
-
uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring)
{
return ring->last_timestamp;
@@ -113,32 +97,13 @@ void fd_ringbuffer_reloc(struct fd_ringbuffer *ring,
ring->funcs->emit_reloc(ring, reloc);
}
-void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
- struct fd_ringmarker *target, struct fd_ringmarker *end)
+void
+fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
+ struct fd_ringmarker *target,
+ struct fd_ringmarker *end)
{
- uint32_t submit_offset, size;
-
assert(target->ring == end->ring);
-
- submit_offset = offset_bytes(target->cur, target->ring->start);
- size = offset_bytes(end->cur, target->cur);
-
- ring->funcs->emit_reloc_ring(ring, target->ring, 0, submit_offset, size);
-}
-
-uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring)
-{
- if (!ring->funcs->cmd_count)
- return 1;
- return ring->funcs->cmd_count(ring);
-}
-
-uint32_t
-fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx)
-{
- uint32_t size = offset_bytes(target->cur, target->start);
- return ring->funcs->emit_reloc_ring(ring, target, cmd_idx, 0, size);
+ ring->funcs->emit_reloc_ring(ring, target, end);
}
struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring)
@@ -153,7 +118,7 @@ struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring)
marker->ring = ring;
- marker->cur = marker->ring->cur;
+ fd_ringmarker_mark(marker);
return marker;
}
diff --git a/chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.h b/chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.h
index 8899b5de4a0..578cdb243cf 100644
--- a/chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.h
+++ b/chromium/third_party/libdrm/src/freedreno/freedreno_ringbuffer.h
@@ -56,7 +56,6 @@ void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring,
struct fd_ringbuffer *parent);
void fd_ringbuffer_reset(struct fd_ringbuffer *ring);
int fd_ringbuffer_flush(struct fd_ringbuffer *ring);
-void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords);
uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring);
static inline void fd_ringbuffer_emit(struct fd_ringbuffer *ring,
@@ -76,17 +75,14 @@ struct fd_reloc {
};
void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
-will_be_deprecated void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
+void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
struct fd_ringmarker *target, struct fd_ringmarker *end);
-uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring);
-uint32_t fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx);
-will_be_deprecated struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring);
-will_be_deprecated void fd_ringmarker_del(struct fd_ringmarker *marker);
-will_be_deprecated void fd_ringmarker_mark(struct fd_ringmarker *marker);
-will_be_deprecated uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start,
+struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring);
+void fd_ringmarker_del(struct fd_ringmarker *marker);
+void fd_ringmarker_mark(struct fd_ringmarker *marker);
+uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start,
struct fd_ringmarker *end);
-will_be_deprecated int fd_ringmarker_flush(struct fd_ringmarker *marker);
+int fd_ringmarker_flush(struct fd_ringmarker *marker);
#endif /* FREEDRENO_RINGBUFFER_H_ */
diff --git a/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_bo.c b/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_bo.c
index ab3485e36b1..2b45b5e20c4 100644
--- a/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_bo.c
+++ b/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_bo.c
@@ -116,11 +116,6 @@ static void kgsl_bo_cpu_fini(struct fd_bo *bo)
{
}
-static int kgsl_bo_madvise(struct fd_bo *bo, int willneed)
-{
- return willneed; /* not supported by kgsl */
-}
-
static void kgsl_bo_destroy(struct fd_bo *bo)
{
struct kgsl_bo *kgsl_bo = to_kgsl_bo(bo);
@@ -132,7 +127,6 @@ static const struct fd_bo_funcs funcs = {
.offset = kgsl_bo_offset,
.cpu_prep = kgsl_bo_cpu_prep,
.cpu_fini = kgsl_bo_cpu_fini,
- .madvise = kgsl_bo_madvise,
.destroy = kgsl_bo_destroy,
};
diff --git a/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_drm.h b/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_drm.h
index 281978ea3fc..f1c7f4e22f3 100644
--- a/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_drm.h
+++ b/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_drm.h
@@ -81,7 +81,7 @@ struct drm_kgsl_gem_create_fd)
/* Memory types - these define the source and caching policies
of the GEM memory chunk */
-/* Legacy definitions left for compatibility */
+/* Legacy definitions left for compatability */
#define DRM_KGSL_GEM_TYPE_EBI 0
#define DRM_KGSL_GEM_TYPE_SMI 1
diff --git a/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_pipe.c b/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_pipe.c
index 3546718db2e..58b3b4d50e5 100644
--- a/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_pipe.c
+++ b/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_pipe.c
@@ -50,10 +50,6 @@ static int kgsl_pipe_get_param(struct fd_pipe *pipe,
case FD_CHIP_ID:
*value = kgsl_pipe->devinfo.chip_id;
return 0;
- case FD_MAX_FREQ:
- case FD_TIMESTAMP:
- /* unsupported on kgsl */
- return -1;
default:
ERROR_MSG("invalid param id: %d", param);
return -1;
diff --git a/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_ringbuffer.c b/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_ringbuffer.c
index 7b3298abd01..6f68f2f304b 100644
--- a/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_ringbuffer.c
+++ b/chromium/third_party/libdrm/src/freedreno/kgsl/kgsl_ringbuffer.c
@@ -173,14 +173,12 @@ static void kgsl_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
kgsl_pipe_add_submit(to_kgsl_pipe(ring->pipe), kgsl_bo);
}
-static uint32_t kgsl_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx,
- uint32_t submit_offset, uint32_t size)
+static void kgsl_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
+ struct fd_ringmarker *target, struct fd_ringmarker *end)
{
- struct kgsl_ringbuffer *target_ring = to_kgsl_ringbuffer(target);
- assert(cmd_idx == 0);
- (*ring->cur++) = target_ring->bo->gpuaddr + submit_offset;
- return size;
+ struct kgsl_ringbuffer *target_ring = to_kgsl_ringbuffer(target->ring);
+ (*ring->cur++) = target_ring->bo->gpuaddr +
+ (uint8_t *)target->cur - (uint8_t *)target->ring->start;
}
static void kgsl_ringbuffer_destroy(struct fd_ringbuffer *ring)
@@ -215,7 +213,6 @@ drm_private struct fd_ringbuffer * kgsl_ringbuffer_new(struct fd_pipe *pipe,
ring = &kgsl_ring->base;
ring->funcs = &funcs;
- ring->size = size;
kgsl_ring->bo = kgsl_rb_bo_new(to_kgsl_pipe(pipe), size);
if (!kgsl_ring->bo) {
diff --git a/chromium/third_party/libdrm/src/freedreno/kgsl/msm_kgsl.h b/chromium/third_party/libdrm/src/freedreno/kgsl/msm_kgsl.h
index 5b36eeb43f2..e67190f07d4 100644
--- a/chromium/third_party/libdrm/src/freedreno/kgsl/msm_kgsl.h
+++ b/chromium/third_party/libdrm/src/freedreno/kgsl/msm_kgsl.h
@@ -31,7 +31,7 @@
#define KGSL_FLAGS_SOFT_RESET 0x00000100
#define KGSL_FLAGS_PER_CONTEXT_TIMESTAMPS 0x00000200
-/* Clock flags to show which clocks should be controlled by a given platform */
+/* Clock flags to show which clocks should be controled by a given platform */
#define KGSL_CLK_SRC 0x00000001
#define KGSL_CLK_CORE 0x00000002
#define KGSL_CLK_IFACE 0x00000004
@@ -295,7 +295,7 @@ struct kgsl_cmdstream_freememontimestamp {
/* Previous versions of this header had incorrectly defined
IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP as a read-only ioctl instead
- of a write only ioctl. To ensure binary compatibility, the following
+ of a write only ioctl. To ensure binary compatability, the following
#define will be used to intercept the incorrect ioctl
*/
diff --git a/chromium/third_party/libdrm/src/freedreno/msm/msm_bo.c b/chromium/third_party/libdrm/src/freedreno/msm/msm_bo.c
index 72471df65b2..cd05a6cd4e9 100644
--- a/chromium/third_party/libdrm/src/freedreno/msm/msm_bo.c
+++ b/chromium/third_party/libdrm/src/freedreno/msm/msm_bo.c
@@ -89,25 +89,6 @@ static void msm_bo_cpu_fini(struct fd_bo *bo)
drmCommandWrite(bo->dev->fd, DRM_MSM_GEM_CPU_FINI, &req, sizeof(req));
}
-static int msm_bo_madvise(struct fd_bo *bo, int willneed)
-{
- struct drm_msm_gem_madvise req = {
- .handle = bo->handle,
- .madv = willneed ? MSM_MADV_WILLNEED : MSM_MADV_DONTNEED,
- };
- int ret;
-
- /* older kernels do not support this: */
- if (bo->dev->version < FD_VERSION_MADVISE)
- return willneed;
-
- ret = drmCommandWriteRead(bo->dev->fd, DRM_MSM_GEM_MADVISE, &req, sizeof(req));
- if (ret)
- return ret;
-
- return req.retained;
-}
-
static void msm_bo_destroy(struct fd_bo *bo)
{
struct msm_bo *msm_bo = to_msm_bo(bo);
@@ -119,7 +100,6 @@ static const struct fd_bo_funcs funcs = {
.offset = msm_bo_offset,
.cpu_prep = msm_bo_cpu_prep,
.cpu_fini = msm_bo_cpu_fini,
- .madvise = msm_bo_madvise,
.destroy = msm_bo_destroy,
};
diff --git a/chromium/third_party/libdrm/src/freedreno/msm/msm_device.c b/chromium/third_party/libdrm/src/freedreno/msm/msm_device.c
index 727baa44326..25c097c2522 100644
--- a/chromium/third_party/libdrm/src/freedreno/msm/msm_device.c
+++ b/chromium/third_party/libdrm/src/freedreno/msm/msm_device.c
@@ -39,7 +39,6 @@
static void msm_device_destroy(struct fd_device *dev)
{
struct msm_device *msm_dev = to_msm_device(dev);
- fd_bo_cache_cleanup(&msm_dev->ring_cache, 0);
free(msm_dev);
}
@@ -62,7 +61,5 @@ drm_private struct fd_device * msm_device_new(int fd)
dev = &msm_dev->base;
dev->funcs = &funcs;
- fd_bo_cache_init(&msm_dev->ring_cache, TRUE);
-
return dev;
}
diff --git a/chromium/third_party/libdrm/src/freedreno/msm/msm_drm.h b/chromium/third_party/libdrm/src/freedreno/msm/msm_drm.h
index cbf75c3d52f..f7474c59487 100644
--- a/chromium/third_party/libdrm/src/freedreno/msm/msm_drm.h
+++ b/chromium/third_party/libdrm/src/freedreno/msm/msm_drm.h
@@ -28,13 +28,9 @@
#include <stddef.h>
#include "drm.h"
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
/* Please note that modifications to all structs defined here are
* subject to backwards-compatibility constraints:
- * 1) Do not use pointers, use __u64 instead for 32 bit / 64 bit
+ * 1) Do not use pointers, use uint64_t instead for 32 bit / 64 bit
* user/kernel compatibility
* 2) Keep fields aligned to their size
* 3) Because of how drm_ioctl() works, we can add new fields at
@@ -55,20 +51,18 @@ extern "C" {
* same as 'struct timespec' but 32/64b ABI safe.
*/
struct drm_msm_timespec {
- __s64 tv_sec; /* seconds */
- __s64 tv_nsec; /* nanoseconds */
+ int64_t tv_sec; /* seconds */
+ int64_t tv_nsec; /* nanoseconds */
};
#define MSM_PARAM_GPU_ID 0x01
#define MSM_PARAM_GMEM_SIZE 0x02
#define MSM_PARAM_CHIP_ID 0x03
-#define MSM_PARAM_MAX_FREQ 0x04
-#define MSM_PARAM_TIMESTAMP 0x05
struct drm_msm_param {
- __u32 pipe; /* in, MSM_PIPE_x */
- __u32 param; /* in, MSM_PARAM_x */
- __u64 value; /* out (get_param) or in (set_param) */
+ uint32_t pipe; /* in, MSM_PIPE_x */
+ uint32_t param; /* in, MSM_PARAM_x */
+ uint64_t value; /* out (get_param) or in (set_param) */
};
/*
@@ -90,15 +84,15 @@ struct drm_msm_param {
MSM_BO_UNCACHED)
struct drm_msm_gem_new {
- __u64 size; /* in */
- __u32 flags; /* in, mask of MSM_BO_x */
- __u32 handle; /* out */
+ uint64_t size; /* in */
+ uint32_t flags; /* in, mask of MSM_BO_x */
+ uint32_t handle; /* out */
};
struct drm_msm_gem_info {
- __u32 handle; /* in */
- __u32 pad;
- __u64 offset; /* out, offset to pass to mmap() */
+ uint32_t handle; /* in */
+ uint32_t pad;
+ uint64_t offset; /* out, offset to pass to mmap() */
};
#define MSM_PREP_READ 0x01
@@ -108,13 +102,13 @@ struct drm_msm_gem_info {
#define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC)
struct drm_msm_gem_cpu_prep {
- __u32 handle; /* in */
- __u32 op; /* in, mask of MSM_PREP_x */
+ uint32_t handle; /* in */
+ uint32_t op; /* in, mask of MSM_PREP_x */
struct drm_msm_timespec timeout; /* in */
};
struct drm_msm_gem_cpu_fini {
- __u32 handle; /* in */
+ uint32_t handle; /* in */
};
/*
@@ -133,11 +127,11 @@ struct drm_msm_gem_cpu_fini {
* otherwise EINVAL.
*/
struct drm_msm_gem_submit_reloc {
- __u32 submit_offset; /* in, offset from submit_bo */
- __u32 or; /* in, value OR'd with result */
- __s32 shift; /* in, amount of left shift (can be negative) */
- __u32 reloc_idx; /* in, index of reloc_bo buffer */
- __u64 reloc_offset; /* in, offset from start of reloc_bo */
+ uint32_t submit_offset; /* in, offset from submit_bo */
+ uint32_t or; /* in, value OR'd with result */
+ int32_t shift; /* in, amount of left shift (can be negative) */
+ uint32_t reloc_idx; /* in, index of reloc_bo buffer */
+ uint64_t reloc_offset; /* in, offset from start of reloc_bo */
};
/* submit-types:
@@ -152,13 +146,13 @@ struct drm_msm_gem_submit_reloc {
#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
struct drm_msm_gem_submit_cmd {
- __u32 type; /* in, one of MSM_SUBMIT_CMD_x */
- __u32 submit_idx; /* in, index of submit_bo cmdstream buffer */
- __u32 submit_offset; /* in, offset into submit_bo */
- __u32 size; /* in, cmdstream size */
- __u32 pad;
- __u32 nr_relocs; /* in, number of submit_reloc's */
- __u64 __user relocs; /* in, ptr to array of submit_reloc's */
+ uint32_t type; /* in, one of MSM_SUBMIT_CMD_x */
+ uint32_t submit_idx; /* in, index of submit_bo cmdstream buffer */
+ uint32_t submit_offset; /* in, offset into submit_bo */
+ uint32_t size; /* in, cmdstream size */
+ uint32_t pad;
+ uint32_t nr_relocs; /* in, number of submit_reloc's */
+ uint64_t __user relocs; /* in, ptr to array of submit_reloc's */
};
/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
@@ -178,9 +172,9 @@ struct drm_msm_gem_submit_cmd {
#define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE)
struct drm_msm_gem_submit_bo {
- __u32 flags; /* in, mask of MSM_SUBMIT_BO_x */
- __u32 handle; /* in, GEM handle */
- __u64 presumed; /* in/out, presumed buffer address */
+ uint32_t flags; /* in, mask of MSM_SUBMIT_BO_x */
+ uint32_t handle; /* in, GEM handle */
+ uint64_t presumed; /* in/out, presumed buffer address */
};
/* Each cmdstream submit consists of a table of buffers involved, and
@@ -188,12 +182,12 @@ struct drm_msm_gem_submit_bo {
* (context-restore), and IB buffers needed for per tile/bin draw cmds.
*/
struct drm_msm_gem_submit {
- __u32 pipe; /* in, MSM_PIPE_x */
- __u32 fence; /* out */
- __u32 nr_bos; /* in, number of submit_bo's */
- __u32 nr_cmds; /* in, number of submit_cmd's */
- __u64 __user bos; /* in, ptr to array of submit_bo's */
- __u64 __user cmds; /* in, ptr to array of submit_cmd's */
+ uint32_t pipe; /* in, MSM_PIPE_x */
+ uint32_t fence; /* out */
+ uint32_t nr_bos; /* in, number of submit_bo's */
+ uint32_t nr_cmds; /* in, number of submit_cmd's */
+ uint64_t __user bos; /* in, ptr to array of submit_bo's */
+ uint64_t __user cmds; /* in, ptr to array of submit_cmd's */
};
/* The normal way to synchronize with the GPU is just to CPU_PREP on
@@ -204,32 +198,11 @@ struct drm_msm_gem_submit {
* APIs without requiring a dummy bo to synchronize on.
*/
struct drm_msm_wait_fence {
- __u32 fence; /* in */
- __u32 pad;
+ uint32_t fence; /* in */
+ uint32_t pad;
struct drm_msm_timespec timeout; /* in */
};
-/* madvise provides a way to tell the kernel in case a buffers contents
- * can be discarded under memory pressure, which is useful for userspace
- * bo cache where we want to optimistically hold on to buffer allocate
- * and potential mmap, but allow the pages to be discarded under memory
- * pressure.
- *
- * Typical usage would involve madvise(DONTNEED) when buffer enters BO
- * cache, and madvise(WILLNEED) if trying to recycle buffer from BO cache.
- * In the WILLNEED case, 'retained' indicates to userspace whether the
- * backing pages still exist.
- */
-#define MSM_MADV_WILLNEED 0 /* backing pages are needed, status returned in 'retained' */
-#define MSM_MADV_DONTNEED 1 /* backing pages not needed */
-#define __MSM_MADV_PURGED 2 /* internal state */
-
-struct drm_msm_gem_madvise {
- __u32 handle; /* in, GEM handle */
- __u32 madv; /* in, MSM_MADV_x */
- __u32 retained; /* out, whether backing store still exists */
-};
-
#define DRM_MSM_GET_PARAM 0x00
/* placeholder:
#define DRM_MSM_SET_PARAM 0x01
@@ -240,8 +213,7 @@ struct drm_msm_gem_madvise {
#define DRM_MSM_GEM_CPU_FINI 0x05
#define DRM_MSM_GEM_SUBMIT 0x06
#define DRM_MSM_WAIT_FENCE 0x07
-#define DRM_MSM_GEM_MADVISE 0x08
-#define DRM_MSM_NUM_IOCTLS 0x09
+#define DRM_MSM_NUM_IOCTLS 0x08
#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
@@ -250,10 +222,5 @@ struct drm_msm_gem_madvise {
#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
-#define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise)
-
-#if defined(__cplusplus)
-}
-#endif
#endif /* __MSM_DRM_H__ */
diff --git a/chromium/third_party/libdrm/src/freedreno/msm/msm_pipe.c b/chromium/third_party/libdrm/src/freedreno/msm/msm_pipe.c
index f872e245927..aa0866b4aac 100644
--- a/chromium/third_party/libdrm/src/freedreno/msm/msm_pipe.c
+++ b/chromium/third_party/libdrm/src/freedreno/msm/msm_pipe.c
@@ -32,25 +32,6 @@
#include "msm_priv.h"
-static int query_param(struct fd_pipe *pipe, uint32_t param,
- uint64_t *value)
-{
- struct msm_pipe *msm_pipe = to_msm_pipe(pipe);
- struct drm_msm_param req = {
- .pipe = msm_pipe->pipe,
- .param = param,
- };
- int ret;
-
- ret = drmCommandWriteRead(pipe->dev->fd, DRM_MSM_GET_PARAM,
- &req, sizeof(req));
- if (ret)
- return ret;
-
- *value = req.value;
-
- return 0;
-}
static int msm_pipe_get_param(struct fd_pipe *pipe,
enum fd_param_id param, uint64_t *value)
@@ -67,10 +48,6 @@ static int msm_pipe_get_param(struct fd_pipe *pipe,
case FD_CHIP_ID:
*value = msm_pipe->chip_id;
return 0;
- case FD_MAX_FREQ:
- return query_param(pipe, MSM_PARAM_MAX_FREQ, value);
- case FD_TIMESTAMP:
- return query_param(pipe, MSM_PARAM_TIMESTAMP, value);
default:
ERROR_MSG("invalid param id: %d", param);
return -1;
@@ -110,15 +87,21 @@ static const struct fd_pipe_funcs funcs = {
.destroy = msm_pipe_destroy,
};
-static uint64_t get_param(struct fd_pipe *pipe, uint32_t param)
+static uint64_t get_param(struct fd_device *dev, uint32_t pipe, uint32_t param)
{
- uint64_t value;
- int ret = query_param(pipe, param, &value);
+ struct drm_msm_param req = {
+ .pipe = pipe,
+ .param = param,
+ };
+ int ret;
+
+ ret = drmCommandWriteRead(dev->fd, DRM_MSM_GET_PARAM, &req, sizeof(req));
if (ret) {
ERROR_MSG("get-param failed! %d (%s)", ret, strerror(errno));
return 0;
}
- return value;
+
+ return req.value;
}
drm_private struct fd_pipe * msm_pipe_new(struct fd_device *dev,
@@ -140,14 +123,10 @@ drm_private struct fd_pipe * msm_pipe_new(struct fd_device *dev,
pipe = &msm_pipe->base;
pipe->funcs = &funcs;
- /* initialize before get_param(): */
- pipe->dev = dev;
msm_pipe->pipe = pipe_id[id];
-
- /* these params should be supported since the first version of drm/msm: */
- msm_pipe->gpu_id = get_param(pipe, MSM_PARAM_GPU_ID);
- msm_pipe->gmem = get_param(pipe, MSM_PARAM_GMEM_SIZE);
- msm_pipe->chip_id = get_param(pipe, MSM_PARAM_CHIP_ID);
+ msm_pipe->gpu_id = get_param(dev, pipe_id[id], MSM_PARAM_GPU_ID);
+ msm_pipe->gmem = get_param(dev, pipe_id[id], MSM_PARAM_GMEM_SIZE);
+ msm_pipe->chip_id = get_param(dev, pipe_id[id], MSM_PARAM_CHIP_ID);
if (! msm_pipe->gpu_id)
goto fail;
diff --git a/chromium/third_party/libdrm/src/freedreno/msm/msm_priv.h b/chromium/third_party/libdrm/src/freedreno/msm/msm_priv.h
index 6d670aab254..e499b3b878e 100644
--- a/chromium/third_party/libdrm/src/freedreno/msm/msm_priv.h
+++ b/chromium/third_party/libdrm/src/freedreno/msm/msm_priv.h
@@ -39,8 +39,6 @@
struct msm_device {
struct fd_device base;
- struct fd_bo_cache ring_cache;
- unsigned ring_cnt;
};
static inline struct msm_device * to_msm_device(struct fd_device *x)
@@ -73,11 +71,18 @@ struct msm_bo {
struct fd_bo base;
uint64_t offset;
uint64_t presumed;
- /* to avoid excess hashtable lookups, cache the ring this bo was
- * last emitted on (since that will probably also be the next ring
- * it is emitted on)
+ /* in the common case, a bo won't be referenced by more than a single
+ * (parent) ring[*]. So to avoid looping over all the bo's in the
+ * reloc table to find the idx of a bo that might already be in the
+ * table, we cache the idx in the bo. But in order to detect the
+ * slow-path where bo is ref'd in multiple rb's, we also must track
+ * the current_ring for which the idx is valid. See bo2idx().
+ *
+ * [*] in case multiple ringbuffers, ie. one toplevel and other rb(s)
+ * used for IB target(s), the toplevel rb is the parent which is
+ * tracking bo's for the submit
*/
- unsigned current_ring_seqno;
+ struct fd_ringbuffer *current_ring;
uint32_t idx;
};
diff --git a/chromium/third_party/libdrm/src/freedreno/msm/msm_ringbuffer.c b/chromium/third_party/libdrm/src/freedreno/msm/msm_ringbuffer.c
index a78806c88bc..becf2458940 100644
--- a/chromium/third_party/libdrm/src/freedreno/msm/msm_ringbuffer.c
+++ b/chromium/third_party/libdrm/src/freedreno/msm/msm_ringbuffer.c
@@ -36,30 +36,11 @@
#include "freedreno_ringbuffer.h"
#include "msm_priv.h"
-/* represents a single cmd buffer in the submit ioctl. Each cmd buffer has
- * a backing bo, and a reloc table.
- */
-struct msm_cmd {
- struct list_head list;
-
- struct fd_ringbuffer *ring;
- struct fd_bo *ring_bo;
-
- /* reloc's table: */
- struct drm_msm_gem_submit_reloc *relocs;
- uint32_t nr_relocs, max_relocs;
-
- uint32_t size;
-};
-
struct msm_ringbuffer {
struct fd_ringbuffer base;
+ struct fd_bo *ring_bo;
- /* submit ioctl related tables:
- * Note that bos and cmds are tracked by the parent ringbuffer, since
- * that is global to the submit ioctl call. The reloc's table is tracked
- * per cmd-buffer.
- */
+ /* submit ioctl related tables: */
struct {
/* bo's table: */
struct drm_msm_gem_submit_bo *bos;
@@ -68,111 +49,22 @@ struct msm_ringbuffer {
/* cmd's table: */
struct drm_msm_gem_submit_cmd *cmds;
uint32_t nr_cmds, max_cmds;
+
+ /* reloc's table: */
+ struct drm_msm_gem_submit_reloc *relocs;
+ uint32_t nr_relocs, max_relocs;
} submit;
/* should have matching entries in submit.bos: */
- /* Note, only in parent ringbuffer */
struct fd_bo **bos;
uint32_t nr_bos, max_bos;
/* should have matching entries in submit.cmds: */
- struct msm_cmd **cmds;
- uint32_t nr_cmds, max_cmds;
-
- /* List of physical cmdstream buffers (msm_cmd) assocated with this
- * logical fd_ringbuffer.
- *
- * Note that this is different from msm_ringbuffer::cmds (which
- * shadows msm_ringbuffer::submit::cmds for tracking submit ioctl
- * related stuff, and *only* is tracked in the parent ringbuffer.
- * And only has "completed" cmd buffers (ie. we already know the
- * size) added via get_cmd().
- */
- struct list_head cmd_list;
-
- int is_growable;
- unsigned cmd_count;
-
- unsigned seqno;
-
- /* maps fd_bo to idx: */
- void *bo_table;
+ struct fd_ringbuffer **rings;
+ uint32_t nr_rings, max_rings;
};
-static inline struct msm_ringbuffer * to_msm_ringbuffer(struct fd_ringbuffer *x)
-{
- return (struct msm_ringbuffer *)x;
-}
-
-#define INIT_SIZE 0x1000
-
static pthread_mutex_t idx_lock = PTHREAD_MUTEX_INITIALIZER;
-drm_private extern pthread_mutex_t table_lock;
-
-static void ring_bo_del(struct fd_device *dev, struct fd_bo *bo)
-{
- int ret;
-
- pthread_mutex_lock(&table_lock);
- ret = fd_bo_cache_free(&to_msm_device(dev)->ring_cache, bo);
- pthread_mutex_unlock(&table_lock);
-
- if (ret == 0)
- return;
-
- fd_bo_del(bo);
-}
-
-static struct fd_bo * ring_bo_new(struct fd_device *dev, uint32_t size)
-{
- struct fd_bo *bo;
-
- bo = fd_bo_cache_alloc(&to_msm_device(dev)->ring_cache, &size, 0);
- if (bo)
- return bo;
-
- bo = fd_bo_new(dev, size, 0);
- if (!bo)
- return NULL;
-
- /* keep ringbuffer bo's out of the normal bo cache: */
- bo->bo_reuse = FALSE;
-
- return bo;
-}
-
-static void ring_cmd_del(struct msm_cmd *cmd)
-{
- if (cmd->ring_bo)
- ring_bo_del(cmd->ring->pipe->dev, cmd->ring_bo);
- list_del(&cmd->list);
- to_msm_ringbuffer(cmd->ring)->cmd_count--;
- free(cmd->relocs);
- free(cmd);
-}
-
-static struct msm_cmd * ring_cmd_new(struct fd_ringbuffer *ring, uint32_t size)
-{
- struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
- struct msm_cmd *cmd = calloc(1, sizeof(*cmd));
-
- if (!cmd)
- return NULL;
-
- cmd->ring = ring;
- cmd->ring_bo = ring_bo_new(ring->pipe->dev, size);
- if (!cmd->ring_bo)
- goto fail;
-
- list_addtail(&cmd->list, &msm_ring->cmd_list);
- msm_ring->cmd_count++;
-
- return cmd;
-
-fail:
- ring_cmd_del(cmd);
- return NULL;
-}
static void *grow(void *ptr, uint32_t nr, uint32_t *max, uint32_t sz)
{
@@ -191,11 +83,9 @@ static void *grow(void *ptr, uint32_t nr, uint32_t *max, uint32_t sz)
(x)->nr_ ## name ++; \
})
-static struct msm_cmd *current_cmd(struct fd_ringbuffer *ring)
+static inline struct msm_ringbuffer * to_msm_ringbuffer(struct fd_ringbuffer *x)
{
- struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
- assert(!LIST_IS_EMPTY(&msm_ring->cmd_list));
- return LIST_LAST_ENTRY(&msm_ring->cmd_list, struct msm_cmd, list);
+ return (struct msm_ringbuffer *)x;
}
static uint32_t append_bo(struct fd_ringbuffer *ring, struct fd_bo *bo)
@@ -222,24 +112,21 @@ static uint32_t bo2idx(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t fl
struct msm_bo *msm_bo = to_msm_bo(bo);
uint32_t idx;
pthread_mutex_lock(&idx_lock);
- if (msm_bo->current_ring_seqno == msm_ring->seqno) {
+ if (!msm_bo->current_ring) {
+ idx = append_bo(ring, bo);
+ msm_bo->current_ring = ring;
+ msm_bo->idx = idx;
+ } else if (msm_bo->current_ring == ring) {
idx = msm_bo->idx;
} else {
- void *val;
-
- if (!msm_ring->bo_table)
- msm_ring->bo_table = drmHashCreate();
-
- if (!drmHashLookup(msm_ring->bo_table, bo->handle, &val)) {
- /* found */
- idx = (uint32_t)(uintptr_t)val;
- } else {
+ /* slow-path: */
+ for (idx = 0; idx < msm_ring->nr_bos; idx++)
+ if (msm_ring->bos[idx] == bo)
+ break;
+ if (idx == msm_ring->nr_bos) {
+ /* not found */
idx = append_bo(ring, bo);
- val = (void *)(uintptr_t)idx;
- drmHashInsert(msm_ring->bo_table, bo->handle, val);
}
- msm_bo->current_ring_seqno = msm_ring->seqno;
- msm_bo->idx = idx;
}
pthread_mutex_unlock(&idx_lock);
if (flags & FD_RELOC_READ)
@@ -256,14 +143,17 @@ static int check_cmd_bo(struct fd_ringbuffer *ring,
return msm_ring->submit.bos[cmd->submit_idx].handle == bo->handle;
}
-/* Ensure that submit has corresponding entry in cmds table for the
- * target cmdstream buffer:
- */
-static void get_cmd(struct fd_ringbuffer *ring, struct msm_cmd *target_cmd,
+static uint32_t offset_bytes(void *end, void *start)
+{
+ return ((char *)end) - ((char *)start);
+}
+
+static struct drm_msm_gem_submit_cmd * get_cmd(struct fd_ringbuffer *ring,
+ struct fd_ringbuffer *target_ring, struct fd_bo *target_bo,
uint32_t submit_offset, uint32_t size, uint32_t type)
{
struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
- struct drm_msm_gem_submit_cmd *cmd;
+ struct drm_msm_gem_submit_cmd *cmd = NULL;
uint32_t i;
/* figure out if we already have a cmd buf: */
@@ -272,37 +162,41 @@ static void get_cmd(struct fd_ringbuffer *ring, struct msm_cmd *target_cmd,
if ((cmd->submit_offset == submit_offset) &&
(cmd->size == size) &&
(cmd->type == type) &&
- check_cmd_bo(ring, cmd, target_cmd->ring_bo))
- return;
+ check_cmd_bo(ring, cmd, target_bo))
+ break;
+ cmd = NULL;
}
/* create cmd buf if not: */
- i = APPEND(&msm_ring->submit, cmds);
- APPEND(msm_ring, cmds);
- msm_ring->cmds[i] = target_cmd;
- cmd = &msm_ring->submit.cmds[i];
- cmd->type = type;
- cmd->submit_idx = bo2idx(ring, target_cmd->ring_bo, FD_RELOC_READ);
- cmd->submit_offset = submit_offset;
- cmd->size = size;
- cmd->pad = 0;
-
- target_cmd->size = size;
+ if (!cmd) {
+ uint32_t idx = APPEND(&msm_ring->submit, cmds);
+ APPEND(msm_ring, rings);
+ msm_ring->rings[idx] = target_ring;
+ cmd = &msm_ring->submit.cmds[idx];
+ cmd->type = type;
+ cmd->submit_idx = bo2idx(ring, target_bo, FD_RELOC_READ);
+ cmd->submit_offset = submit_offset;
+ cmd->size = size;
+ cmd->pad = 0;
+ }
+
+ return cmd;
}
static void * msm_ringbuffer_hostptr(struct fd_ringbuffer *ring)
{
- return fd_bo_map(current_cmd(ring)->ring_bo);
+ struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
+ return fd_bo_map(msm_ring->ring_bo);
}
-static uint32_t find_next_reloc_idx(struct msm_cmd *msm_cmd,
+static uint32_t find_next_reloc_idx(struct msm_ringbuffer *msm_ring,
uint32_t start, uint32_t offset)
{
uint32_t i;
/* a binary search would be more clever.. */
- for (i = start; i < msm_cmd->nr_relocs; i++) {
- struct drm_msm_gem_submit_reloc *reloc = &msm_cmd->relocs[i];
+ for (i = start; i < msm_ring->submit.nr_relocs; i++) {
+ struct drm_msm_gem_submit_reloc *reloc = &msm_ring->submit.relocs[i];
if (reloc->submit_offset >= offset)
return i;
}
@@ -310,101 +204,38 @@ static uint32_t find_next_reloc_idx(struct msm_cmd *msm_cmd,
return i;
}
-static void delete_cmds(struct msm_ringbuffer *msm_ring)
-{
- struct msm_cmd *cmd, *tmp;
-
- LIST_FOR_EACH_ENTRY_SAFE(cmd, tmp, &msm_ring->cmd_list, list) {
- ring_cmd_del(cmd);
- }
-}
-
static void flush_reset(struct fd_ringbuffer *ring)
{
struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
unsigned i;
- for (i = 0; i < msm_ring->nr_bos; i++) {
- struct msm_bo *msm_bo = to_msm_bo(msm_ring->bos[i]);
- msm_bo->current_ring_seqno = 0;
- fd_bo_del(&msm_bo->base);
- }
-
/* for each of the cmd buffers, clear their reloc's: */
for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
- struct msm_cmd *target_cmd = msm_ring->cmds[i];
- target_cmd->nr_relocs = 0;
+ struct msm_ringbuffer *target_ring = to_msm_ringbuffer(msm_ring->rings[i]);
+ target_ring->submit.nr_relocs = 0;
}
+ msm_ring->submit.nr_relocs = 0;
msm_ring->submit.nr_cmds = 0;
msm_ring->submit.nr_bos = 0;
- msm_ring->nr_cmds = 0;
+ msm_ring->nr_rings = 0;
msm_ring->nr_bos = 0;
-
- if (msm_ring->bo_table) {
- drmHashDestroy(msm_ring->bo_table);
- msm_ring->bo_table = NULL;
- }
-
- if (msm_ring->is_growable) {
- delete_cmds(msm_ring);
- } else {
- /* in old mode, just reset the # of relocs: */
- current_cmd(ring)->nr_relocs = 0;
- }
-}
-
-static void finalize_current_cmd(struct fd_ringbuffer *ring, uint32_t *last_start)
-{
- uint32_t submit_offset, size, type;
- struct fd_ringbuffer *parent;
-
- if (ring->parent) {
- parent = ring->parent;
- type = MSM_SUBMIT_CMD_IB_TARGET_BUF;
- } else {
- parent = ring;
- type = MSM_SUBMIT_CMD_BUF;
- }
-
- submit_offset = offset_bytes(last_start, ring->start);
- size = offset_bytes(ring->cur, last_start);
-
- get_cmd(parent, current_cmd(ring), submit_offset, size, type);
-}
-
-static void dump_submit(struct msm_ringbuffer *msm_ring)
-{
- uint32_t i, j;
-
- for (i = 0; i < msm_ring->submit.nr_bos; i++) {
- struct drm_msm_gem_submit_bo *bo = &msm_ring->submit.bos[i];
- ERROR_MSG(" bos[%d]: handle=%u, flags=%x", i, bo->handle, bo->flags);
- }
- for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
- struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i];
- struct drm_msm_gem_submit_reloc *relocs = U642VOID(cmd->relocs);
- ERROR_MSG(" cmd[%d]: type=%u, submit_idx=%u, submit_offset=%u, size=%u",
- i, cmd->type, cmd->submit_idx, cmd->submit_offset, cmd->size);
- for (j = 0; j < cmd->nr_relocs; j++) {
- struct drm_msm_gem_submit_reloc *r = &relocs[j];
- ERROR_MSG(" reloc[%d]: submit_offset=%u, or=%08x, shift=%d, reloc_idx=%u"
- ", reloc_offset=%"PRIu64, j, r->submit_offset, r->or, r->shift,
- r->reloc_idx, r->reloc_offset);
- }
- }
}
static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start)
{
struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
+ struct fd_bo *ring_bo = msm_ring->ring_bo;
struct drm_msm_gem_submit req = {
.pipe = to_msm_pipe(ring->pipe)->pipe,
};
- uint32_t i;
+ uint32_t i, j, submit_offset, size;
int ret;
- finalize_current_cmd(ring, last_start);
+ submit_offset = offset_bytes(last_start, ring->start);
+ size = offset_bytes(ring->cur, last_start);
+
+ get_cmd(ring, ring, ring_bo, submit_offset, size, MSM_SUBMIT_CMD_BUF);
/* needs to be after get_cmd() as that could create bos/cmds table: */
req.bos = VOID2U64(msm_ring->submit.bos),
@@ -415,10 +246,10 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start
/* for each of the cmd's fix up their reloc's: */
for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i];
- struct msm_cmd *msm_cmd = msm_ring->cmds[i];
- uint32_t a = find_next_reloc_idx(msm_cmd, 0, cmd->submit_offset);
- uint32_t b = find_next_reloc_idx(msm_cmd, a, cmd->submit_offset + cmd->size);
- cmd->relocs = VOID2U64(&msm_cmd->relocs[a]);
+ struct msm_ringbuffer *target_ring = to_msm_ringbuffer(msm_ring->rings[i]);
+ uint32_t a = find_next_reloc_idx(target_ring, 0, cmd->submit_offset);
+ uint32_t b = find_next_reloc_idx(target_ring, a, cmd->submit_offset + cmd->size);
+ cmd->relocs = VOID2U64(&target_ring->submit.relocs[a]);
cmd->nr_relocs = (b > a) ? b - a : 0;
}
@@ -428,27 +259,43 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start
&req, sizeof(req));
if (ret) {
ERROR_MSG("submit failed: %d (%s)", ret, strerror(errno));
- dump_submit(msm_ring);
- } else if (!ret) {
+ ERROR_MSG(" pipe: %u", req.pipe);
+ for (i = 0; i < msm_ring->submit.nr_bos; i++) {
+ struct drm_msm_gem_submit_bo *bo = &msm_ring->submit.bos[i];
+ ERROR_MSG(" bos[%d]: handle=%u, flags=%x", i, bo->handle, bo->flags);
+ }
+ for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
+ struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i];
+ struct drm_msm_gem_submit_reloc *relocs = U642VOID(cmd->relocs);
+ ERROR_MSG(" cmd[%d]: type=%u, submit_idx=%u, submit_offset=%u, size=%u",
+ i, cmd->type, cmd->submit_idx, cmd->submit_offset, cmd->size);
+ for (j = 0; j < cmd->nr_relocs; j++) {
+ struct drm_msm_gem_submit_reloc *r = &relocs[j];
+ ERROR_MSG(" reloc[%d]: submit_offset=%u, or=%08x, shift=%d, reloc_idx=%u"
+ ", reloc_offset=%"PRIu64, j, r->submit_offset, r->or, r->shift,
+ r->reloc_idx, r->reloc_offset);
+ }
+ }
+ } else {
/* update timestamp on all rings associated with submit: */
for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
- struct msm_cmd *msm_cmd = msm_ring->cmds[i];
- msm_cmd->ring->last_timestamp = req.fence;
+ struct fd_ringbuffer *target_ring = msm_ring->rings[i];
+ if (!ret)
+ target_ring->last_timestamp = req.fence;
}
}
+ for (i = 0; i < msm_ring->nr_bos; i++) {
+ struct msm_bo *msm_bo = to_msm_bo(msm_ring->bos[i]);
+ msm_bo->current_ring = NULL;
+ fd_bo_del(&msm_bo->base);
+ }
+
flush_reset(ring);
return ret;
}
-static void msm_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t size)
-{
- assert(to_msm_ringbuffer(ring)->is_growable);
- finalize_current_cmd(ring, ring->last_start);
- ring_cmd_new(ring, size);
-}
-
static void msm_ringbuffer_reset(struct fd_ringbuffer *ring)
{
flush_reset(ring);
@@ -457,14 +304,14 @@ static void msm_ringbuffer_reset(struct fd_ringbuffer *ring)
static void msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
const struct fd_reloc *r)
{
+ struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
struct fd_ringbuffer *parent = ring->parent ? ring->parent : ring;
struct msm_bo *msm_bo = to_msm_bo(r->bo);
struct drm_msm_gem_submit_reloc *reloc;
- struct msm_cmd *cmd = current_cmd(ring);
- uint32_t idx = APPEND(cmd, relocs);
+ uint32_t idx = APPEND(&msm_ring->submit, relocs);
uint32_t addr;
- reloc = &cmd->relocs[idx];
+ reloc = &msm_ring->submit.relocs[idx];
reloc->reloc_idx = bo2idx(parent, r->bo, r->flags);
reloc->reloc_offset = r->offset;
@@ -480,68 +327,41 @@ static void msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
(*ring->cur++) = addr | r->or;
}
-static uint32_t msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx,
- uint32_t submit_offset, uint32_t size)
+static void msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
+ struct fd_ringmarker *target, struct fd_ringmarker *end)
{
- struct msm_cmd *cmd = NULL;
- uint32_t idx = 0;
-
- LIST_FOR_EACH_ENTRY(cmd, &to_msm_ringbuffer(target)->cmd_list, list) {
- if (idx == cmd_idx)
- break;
- idx++;
- }
+ struct fd_bo *target_bo = to_msm_ringbuffer(target->ring)->ring_bo;
+ struct drm_msm_gem_submit_cmd *cmd;
+ uint32_t submit_offset, size;
- assert(cmd && (idx == cmd_idx));
+ submit_offset = offset_bytes(target->cur, target->ring->start);
+ size = offset_bytes(end->cur, target->cur);
- if (idx < (to_msm_ringbuffer(target)->cmd_count - 1)) {
- /* All but the last cmd buffer is fully "baked" (ie. already has
- * done get_cmd() to add it to the cmds table). But in this case,
- * the size we get is invalid (since it is calculated from the
- * last cmd buffer):
- */
- size = cmd->size;
- } else {
- get_cmd(ring, cmd, submit_offset, size, MSM_SUBMIT_CMD_IB_TARGET_BUF);
- }
+ cmd = get_cmd(ring, target->ring, target_bo, submit_offset, size,
+ MSM_SUBMIT_CMD_IB_TARGET_BUF);
+ assert(cmd);
msm_ringbuffer_emit_reloc(ring, &(struct fd_reloc){
- .bo = cmd->ring_bo,
+ .bo = target_bo,
.flags = FD_RELOC_READ,
.offset = submit_offset,
});
-
- return size;
-}
-
-static uint32_t msm_ringbuffer_cmd_count(struct fd_ringbuffer *ring)
-{
- return to_msm_ringbuffer(ring)->cmd_count;
}
static void msm_ringbuffer_destroy(struct fd_ringbuffer *ring)
{
struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
-
- flush_reset(ring);
- delete_cmds(msm_ring);
-
- free(msm_ring->submit.cmds);
- free(msm_ring->submit.bos);
- free(msm_ring->bos);
- free(msm_ring->cmds);
+ if (msm_ring->ring_bo)
+ fd_bo_del(msm_ring->ring_bo);
free(msm_ring);
}
static const struct fd_ringbuffer_funcs funcs = {
.hostptr = msm_ringbuffer_hostptr,
.flush = msm_ringbuffer_flush,
- .grow = msm_ringbuffer_grow,
.reset = msm_ringbuffer_reset,
.emit_reloc = msm_ringbuffer_emit_reloc,
.emit_reloc_ring = msm_ringbuffer_emit_reloc_ring,
- .cmd_count = msm_ringbuffer_cmd_count,
.destroy = msm_ringbuffer_destroy,
};
@@ -557,21 +377,14 @@ drm_private struct fd_ringbuffer * msm_ringbuffer_new(struct fd_pipe *pipe,
goto fail;
}
- if (size == 0) {
- assert(pipe->dev->version >= FD_VERSION_UNLIMITED_CMDS);
- size = INIT_SIZE;
- msm_ring->is_growable = TRUE;
- }
-
- list_inithead(&msm_ring->cmd_list);
- msm_ring->seqno = ++to_msm_device(pipe->dev)->ring_cnt;
-
ring = &msm_ring->base;
ring->funcs = &funcs;
- ring->size = size;
- ring->pipe = pipe; /* needed in ring_cmd_new() */
- ring_cmd_new(ring, size);
+ msm_ring->ring_bo = fd_bo_new(pipe->dev, size, 0);
+ if (!msm_ring->ring_bo) {
+ ERROR_MSG("ringbuffer allocation failed");
+ goto fail;
+ }
return ring;
fail:
diff --git a/chromium/third_party/libdrm/src/include/drm/drm.h b/chromium/third_party/libdrm/src/include/drm/drm.h
index a7b1a636938..a950b580cd1 100644
--- a/chromium/third_party/libdrm/src/include/drm/drm.h
+++ b/chromium/third_party/libdrm/src/include/drm/drm.h
@@ -36,7 +36,7 @@
#ifndef _DRM_H_
#define _DRM_H_
-#if defined(__linux__)
+#if defined(__linux__)
#include <linux/types.h>
#include <asm/ioctl.h>
@@ -54,7 +54,6 @@ typedef int32_t __s32;
typedef uint32_t __u32;
typedef int64_t __s64;
typedef uint64_t __u64;
-typedef size_t __kernel_size_t;
typedef unsigned long drm_handle_t;
#endif
@@ -130,11 +129,11 @@ struct drm_version {
int version_major; /**< Major version */
int version_minor; /**< Minor version */
int version_patchlevel; /**< Patch level */
- __kernel_size_t name_len; /**< Length of name buffer */
+ size_t name_len; /**< Length of name buffer */
char *name; /**< Name of driver */
- __kernel_size_t date_len; /**< Length of date buffer */
+ size_t date_len; /**< Length of date buffer */
char *date; /**< User-space buffer to hold date */
- __kernel_size_t desc_len; /**< Length of desc buffer */
+ size_t desc_len; /**< Length of desc buffer */
char *desc; /**< User-space buffer to hold desc */
};
@@ -144,7 +143,7 @@ struct drm_version {
* \sa drmGetBusid() and drmSetBusId().
*/
struct drm_unique {
- __kernel_size_t unique_len; /**< Length of unique */
+ size_t unique_len; /**< Length of unique */
char *unique; /**< Unique name for driver instantiation */
};
@@ -181,7 +180,8 @@ enum drm_map_type {
_DRM_SHM = 2, /**< shared, cached */
_DRM_AGP = 3, /**< AGP/GART */
_DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
- _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */
+ _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
+ _DRM_GEM = 6 /**< GEM object */
};
/**
@@ -467,15 +467,12 @@ struct drm_irq_busid {
enum drm_vblank_seq_type {
_DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
_DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
- /* bits 1-6 are reserved for high crtcs */
- _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e,
_DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */
_DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */
_DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */
_DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */
_DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */
};
-#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1
#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE)
#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \
@@ -615,28 +612,6 @@ struct drm_gem_open {
__u64 size;
};
-#define DRM_CAP_DUMB_BUFFER 0x1
-#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
-#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
-#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
-#define DRM_CAP_PRIME 0x5
-#define DRM_PRIME_CAP_IMPORT 0x1
-#define DRM_PRIME_CAP_EXPORT 0x2
-#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
-#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
-/*
- * The CURSOR_WIDTH and CURSOR_HEIGHT capabilities return a valid widthxheight
- * combination for the hardware cursor. The intention is that a hardware
- * agnostic userspace can query a cursor plane size to use.
- *
- * Note that the cross-driver contract is to merely return a valid size;
- * drivers are free to attach another meaning on top, eg. i915 returns the
- * maximum plane size.
- */
-#define DRM_CAP_CURSOR_WIDTH 0x8
-#define DRM_CAP_CURSOR_HEIGHT 0x9
-#define DRM_CAP_ADDFB2_MODIFIERS 0x10
-
/** DRM_IOCTL_GET_CAP ioctl argument type */
struct drm_get_cap {
__u64 capability;
@@ -655,17 +630,17 @@ struct drm_get_cap {
/**
* DRM_CLIENT_CAP_UNIVERSAL_PLANES
*
- * If set to 1, the DRM core will expose all planes (overlay, primary, and
- * cursor) to userspace.
+ * if set to 1, the DRM core will expose the full universal plane list
+ * (including primary and cursor planes).
*/
-#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
/**
* DRM_CLIENT_CAP_ATOMIC
*
- * If set to 1, the DRM core will expose atomic properties to userspace
+ * If set to 1, the DRM core will allow atomic modesetting requests.
*/
-#define DRM_CLIENT_CAP_ATOMIC 3
+#define DRM_CLIENT_CAP_ATOMIC 3
/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
struct drm_set_client_cap {
@@ -673,7 +648,6 @@ struct drm_set_client_cap {
__u64 value;
};
-#define DRM_RDWR O_RDWR
#define DRM_CLOEXEC O_CLOEXEC
struct drm_prime_handle {
__u32 handle;
@@ -769,8 +743,8 @@ struct drm_prime_handle {
#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut)
#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder)
#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector)
-#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */
-#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */
+#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd)
+#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd)
#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property)
#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property)
@@ -786,7 +760,6 @@ struct drm_prime_handle {
#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res)
#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane)
-#define DRM_IOCTL_MODE_GETPLANE2 DRM_IOWR(0xB6, struct drm_mode_get_plane2)
#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane)
#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
@@ -798,7 +771,7 @@ struct drm_prime_handle {
/**
* Device specific ioctls should only be in their respective headers
- * The device specific ioctl range is from 0x40 to 0x9f.
+ * The device specific ioctl range is from 0x40 to 0x99.
* Generic IOCTLS restart at 0xA0.
*
* \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and
@@ -836,6 +809,18 @@ struct drm_event_vblank {
__u32 reserved;
};
+#define DRM_CAP_DUMB_BUFFER 0x1
+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
+#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
+#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
+#define DRM_CAP_PRIME 0x5
+#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
+#define DRM_CAP_ADDFB2_MODIFIERS 0x10
+
+#define DRM_PRIME_CAP_IMPORT 0x1
+#define DRM_PRIME_CAP_EXPORT 0x2
+
/* typedef area */
typedef struct drm_clip_rect drm_clip_rect_t;
typedef struct drm_drawable_info drm_drawable_info_t;
diff --git a/chromium/third_party/libdrm/src/include/drm/drm_fourcc.h b/chromium/third_party/libdrm/src/include/drm/drm_fourcc.h
index d26d01b523f..e741b09a00f 100644
--- a/chromium/third_party/libdrm/src/include/drm/drm_fourcc.h
+++ b/chromium/third_party/libdrm/src/include/drm/drm_fourcc.h
@@ -24,23 +24,16 @@
#ifndef DRM_FOURCC_H
#define DRM_FOURCC_H
-#include "drm.h"
+#include <inttypes.h>
-#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
- ((__u32)(c) << 16) | ((__u32)(d) << 24))
+#define fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
+ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
#define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */
/* color index */
#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
-/* 8 bpp Red */
-#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
-
-/* 16 bpp RG */
-#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */
-#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */
-
/* 8 bpp RGB */
#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */
#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */
@@ -113,10 +106,6 @@
#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */
#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */
#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */
-#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */
-#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
-
-#define DRM_FORMAT_MT21 fourcc_code('M', 'T', '2', '1') /* Mediatek Block Mode */
/*
* 3 plane YCbCr
@@ -159,9 +148,6 @@
#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05
/* add more to the end as needed */
-/* Vendor ID for downstream, interim ChromeOS specific modifiers. */
-#define DRM_FORMAT_MOD_VENDOR_CHROMEOS 0xf0
-
#define fourcc_mod_code(vendor, val) \
((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | (val & 0x00ffffffffffffffULL))
@@ -230,22 +216,8 @@
* - multiple of 128 pixels for the width
* - multiple of 32 pixels for the height
*
- * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html
+ * For more information: see http://linuxtv.org/downloads/v4l-dvb-apis/re32.html
*/
#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1)
-/*
- * Rockchip ARM Framebuffer Compression (AFBC)
- *
- * This modifier identifies the specific variant of AFBC supported by the
- * Rockchip display hardware. It's technically a two-plane format: first a
- * header with 16 bytes per block, followed by the block data aligned to 1024
- * bytes. Each block is 16x16 pixels.
- *
- * Eventually ARM should define modifiers for the various AFBC types, but
- * we'll use this in the meantime. We use the CHROMEOS vendor ID to make sure
- * we don't clash with future vendor modifiers.
- */
-#define DRM_FORMAT_MOD_CHROMEOS_ROCKCHIP_AFBC fourcc_mod_code(CHROMEOS, 1)
-
#endif /* DRM_FOURCC_H */
diff --git a/chromium/third_party/libdrm/src/include/drm/drm_mode.h b/chromium/third_party/libdrm/src/include/drm/drm_mode.h
index 6ea17ebe013..115f36e452d 100644
--- a/chromium/third_party/libdrm/src/include/drm/drm_mode.h
+++ b/chromium/third_party/libdrm/src/include/drm/drm_mode.h
@@ -27,8 +27,6 @@
#ifndef _DRM_MODE_H
#define _DRM_MODE_H
-#include "drm.h"
-
#define DRM_DISPLAY_INFO_LEN 32
#define DRM_CONNECTOR_NAME_LEN 32
#define DRM_DISPLAY_MODE_LEN 32
@@ -58,10 +56,6 @@
#define DRM_MODE_FLAG_PIXMUX (1<<11)
#define DRM_MODE_FLAG_DBLCLK (1<<12)
#define DRM_MODE_FLAG_CLKDIV2 (1<<13)
- /*
- * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX
- * (define not exposed to user space).
- */
#define DRM_MODE_FLAG_3D_MASK (0x1f<<14)
#define DRM_MODE_FLAG_3D_NONE (0<<14)
#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14)
@@ -88,11 +82,6 @@
#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */
#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */
-/* Picture aspect ratio options */
-#define DRM_MODE_PICTURE_ASPECT_NONE 0
-#define DRM_MODE_PICTURE_ASPECT_4_3 1
-#define DRM_MODE_PICTURE_ASPECT_16_9 2
-
/* Dithering mode options */
#define DRM_MODE_DITHERING_OFF 0
#define DRM_MODE_DITHERING_ON 1
@@ -105,16 +94,8 @@
struct drm_mode_modeinfo {
__u32 clock;
- __u16 hdisplay;
- __u16 hsync_start;
- __u16 hsync_end;
- __u16 htotal;
- __u16 hskew;
- __u16 vdisplay;
- __u16 vsync_start;
- __u16 vsync_end;
- __u16 vtotal;
- __u16 vscan;
+ __u16 hdisplay, hsync_start, hsync_end, htotal, hskew;
+ __u16 vdisplay, vsync_start, vsync_end, vtotal, vscan;
__u32 vrefresh;
@@ -132,10 +113,8 @@ struct drm_mode_card_res {
__u32 count_crtcs;
__u32 count_connectors;
__u32 count_encoders;
- __u32 min_width;
- __u32 max_width;
- __u32 min_height;
- __u32 max_height;
+ __u32 min_width, max_width;
+ __u32 min_height, max_height;
};
struct drm_mode_crtc {
@@ -145,35 +124,30 @@ struct drm_mode_crtc {
__u32 crtc_id; /**< Id */
__u32 fb_id; /**< Id of framebuffer */
- __u32 x; /**< x Position on the framebuffer */
- __u32 y; /**< y Position on the framebuffer */
+ __u32 x, y; /**< Position on the frameuffer */
__u32 gamma_size;
__u32 mode_valid;
struct drm_mode_modeinfo mode;
};
-#define DRM_MODE_PRESENT_TOP_FIELD (1<<0)
-#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1)
+#define DRM_MODE_PRESENT_TOP_FIELD (1<<0)
+#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1)
/* Planes blend with or override other bits on the CRTC */
struct drm_mode_set_plane {
__u32 plane_id;
__u32 crtc_id;
__u32 fb_id; /* fb object contains surface format type */
- __u32 flags; /* see above flags */
+ __u32 flags;
/* Signed dest location allows it to be partially off screen */
- __s32 crtc_x;
- __s32 crtc_y;
- __u32 crtc_w;
- __u32 crtc_h;
+ __s32 crtc_x, crtc_y;
+ __u32 crtc_w, crtc_h;
/* Source values are 16.16 fixed point */
- __u32 src_x;
- __u32 src_y;
- __u32 src_h;
- __u32 src_w;
+ __u32 src_x, src_y;
+ __u32 src_h, src_w;
};
struct drm_mode_get_plane {
@@ -189,33 +163,6 @@ struct drm_mode_get_plane {
__u64 format_type_ptr;
};
-struct drm_format_modifier {
- /* Bitmask of formats in get_plane format list this info
- * applies to. */
- __u64 formats;
-
- /* This modifier can be used with the format for this plane. */
- __u64 modifier;
-};
-
-struct drm_mode_get_plane2 {
- __u32 plane_id;
-
- __u32 crtc_id;
- __u32 fb_id;
-
- __u32 possible_crtcs;
- __u32 gamma_size;
-
- __u32 count_format_types;
- __u64 format_type_ptr;
-
- /* New in v2 */
- __u32 count_format_modifiers;
- __u32 flags;
- __u64 format_modifier_ptr;
-};
-
struct drm_mode_get_plane_res {
__u64 plane_id_ptr;
__u32 count_planes;
@@ -286,11 +233,8 @@ struct drm_mode_get_connector {
__u32 connector_type_id;
__u32 connection;
- __u32 mm_width; /**< width in millimeters */
- __u32 mm_height; /**< height in millimeters */
+ __u32 mm_width, mm_height; /**< HxW in millimeters */
__u32 subpixel;
-
- __u32 pad;
};
#define DRM_MODE_PROP_PENDING (1<<0)
@@ -315,13 +259,6 @@ struct drm_mode_get_connector {
#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1)
#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2)
-/* the PROP_ATOMIC flag is used to hide properties from userspace that
- * is not aware of atomic properties. This is mostly to work around
- * older userspace (DDX drivers) that read/write each prop they find,
- * witout being aware that this could be triggering a lengthy modeset.
- */
-#define DRM_MODE_PROP_ATOMIC 0x80000000
-
struct drm_mode_property_enum {
__u64 value;
char name[DRM_PROP_NAME_LEN];
@@ -336,8 +273,6 @@ struct drm_mode_get_property {
char name[DRM_PROP_NAME_LEN];
__u32 count_values;
- /* This is only used to count enum values, not blobs. The _blobs is
- * simply because of a historical reason, i.e. backwards compat. */
__u32 count_enum_blobs;
};
@@ -355,7 +290,6 @@ struct drm_mode_connector_set_property {
#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
-#define DRM_MODE_OBJECT_ANY 0
struct drm_mode_obj_get_properties {
__u64 props_ptr;
@@ -380,8 +314,7 @@ struct drm_mode_get_blob {
struct drm_mode_fb_cmd {
__u32 fb_id;
- __u32 width;
- __u32 height;
+ __u32 width, height;
__u32 pitch;
__u32 bpp;
__u32 depth;
@@ -394,10 +327,9 @@ struct drm_mode_fb_cmd {
struct drm_mode_fb_cmd2 {
__u32 fb_id;
- __u32 width;
- __u32 height;
+ __u32 width, height;
__u32 pixel_format; /* fourcc code from drm_fourcc.h */
- __u32 flags; /* see above flags */
+ __u32 flags;
/*
* In case of planar formats, this ioctl allows up to 4
@@ -409,9 +341,9 @@ struct drm_mode_fb_cmd2 {
* followed by an interleaved U/V plane containing
* 8 bit 2x2 subsampled colour difference samples.
*
- * So it would consist of Y as offsets[0] and UV as
- * offsets[1]. Note that offsets[0] will generally
- * be 0 (but this is not required).
+ * So it would consist of Y as offset[0] and UV as
+ * offset[1]. Note that offset[0] will generally
+ * be 0.
*
* To accommodate tiled, compressed, etc formats, a per-plane
* modifier can be specified. The default value of zero
@@ -430,8 +362,6 @@ struct drm_mode_fb_cmd2 {
#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02
#define DRM_MODE_FB_DIRTY_FLAGS 0x03
-#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256
-
/*
* Mark a region of a framebuffer as dirty.
*
@@ -472,21 +402,20 @@ struct drm_mode_mode_cmd {
struct drm_mode_modeinfo mode;
};
-#define DRM_MODE_CURSOR_BO 0x01
-#define DRM_MODE_CURSOR_MOVE 0x02
-#define DRM_MODE_CURSOR_FLAGS 0x03
+#define DRM_MODE_CURSOR_BO (1<<0)
+#define DRM_MODE_CURSOR_MOVE (1<<1)
/*
- * depending on the value in flags different members are used.
+ * depending on the value in flags diffrent members are used.
*
* CURSOR_BO uses
- * crtc_id
+ * crtc
* width
* height
- * handle - if 0 turns the cursor off
+ * handle - if 0 turns the cursor of
*
* CURSOR_MOVE uses
- * crtc_id
+ * crtc
* x
* y
*/
@@ -524,21 +453,6 @@ struct drm_mode_crtc_lut {
__u64 blue;
};
-struct drm_color_ctm {
- /* Conversion matrix in S31.32 format. */
- __s64 matrix[9];
-};
-
-struct drm_color_lut {
- /*
- * Data is U0.16 fixed point format.
- */
- __u16 red;
- __u16 green;
- __u16 blue;
- __u16 reserved;
-};
-
#define DRM_MODE_PAGE_FLIP_EVENT 0x01
#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC)
@@ -555,14 +469,11 @@ struct drm_color_lut {
* flip is already pending as the ioctl is called, EBUSY will be
* returned.
*
- * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank
- * event (see drm.h: struct drm_event_vblank) when the page flip is
- * done. The user_data field passed in with this ioctl will be
- * returned as the user_data field in the vblank event struct.
- *
- * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen
- * 'as soon as possible', meaning that it not delay waiting for vblank.
- * This may cause tearing on the screen.
+ * The ioctl supports one flag, DRM_MODE_PAGE_FLIP_EVENT, which will
+ * request that drm sends back a vblank event (see drm.h: struct
+ * drm_event_vblank) when the page flip is done. The user_data field
+ * passed in with this ioctl will be returned as the user_data field
+ * in the vblank event struct.
*
* The reserved field must be zero until we figure out something
* clever to use it for.
@@ -578,27 +489,27 @@ struct drm_mode_crtc_page_flip {
/* create a dumb scanout buffer */
struct drm_mode_create_dumb {
- __u32 height;
- __u32 width;
- __u32 bpp;
- __u32 flags;
- /* handle, pitch, size will be returned */
- __u32 handle;
- __u32 pitch;
- __u64 size;
+ __u32 height;
+ __u32 width;
+ __u32 bpp;
+ __u32 flags;
+ /* handle, pitch, size will be returned */
+ __u32 handle;
+ __u32 pitch;
+ __u64 size;
};
/* set up for mmap of a dumb scanout buffer */
struct drm_mode_map_dumb {
- /** Handle for the object being mapped. */
- __u32 handle;
- __u32 pad;
- /**
- * Fake offset to use for subsequent mmap call
- *
- * This is a fixed-size type for 32/64 compatibility.
- */
- __u64 offset;
+ /** Handle for the object being mapped. */
+ __u32 handle;
+ __u32 pad;
+ /**
+ * Fake offset to use for subsequent mmap call
+ *
+ * This is a fixed-size type for 32/64 compatibility.
+ */
+ __u64 offset;
};
struct drm_mode_destroy_dumb {
@@ -606,16 +517,9 @@ struct drm_mode_destroy_dumb {
};
/* page-flip flags are valid, plus: */
-#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
-#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
-#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
-
-#define DRM_MODE_ATOMIC_FLAGS (\
- DRM_MODE_PAGE_FLIP_EVENT |\
- DRM_MODE_PAGE_FLIP_ASYNC |\
- DRM_MODE_ATOMIC_TEST_ONLY |\
- DRM_MODE_ATOMIC_NONBLOCK |\
- DRM_MODE_ATOMIC_ALLOW_MODESET)
+#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
+#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
+#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
struct drm_mode_atomic {
__u32 flags;
@@ -648,4 +552,5 @@ struct drm_mode_destroy_blob {
__u32 blob_id;
};
+
#endif
diff --git a/chromium/third_party/libdrm/src/include/drm/drm_sarea.h b/chromium/third_party/libdrm/src/include/drm/drm_sarea.h
index 502934edc21..7325558d9cb 100644
--- a/chromium/third_party/libdrm/src/include/drm/drm_sarea.h
+++ b/chromium/third_party/libdrm/src/include/drm/drm_sarea.h
@@ -37,8 +37,6 @@
/* SAREA area needs to be at least a page */
#if defined(__alpha__)
#define SAREA_MAX 0x2000U
-#elif defined(__mips__)
-#define SAREA_MAX 0x4000U
#elif defined(__ia64__)
#define SAREA_MAX 0x10000U /* 64kB */
#else
diff --git a/chromium/third_party/libdrm/src/include/drm/evdi_drm.h b/chromium/third_party/libdrm/src/include/drm/evdi_drm.h
deleted file mode 100644
index 3a00c7fcea8..00000000000
--- a/chromium/third_party/libdrm/src/include/drm/evdi_drm.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2015 - 2016 DisplayLink (UK) Ltd.
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License v2. See the file COPYING in the main directory of this archive for
- * more details.
- */
-
-#ifndef __UAPI_EVDI_DRM_H__
-#define __UAPI_EVDI_DRM_H__
-
-/* Output events sent from driver to evdi lib */
-#define DRM_EVDI_EVENT_UPDATE_READY 0x80000000
-#define DRM_EVDI_EVENT_DPMS 0x80000001
-#define DRM_EVDI_EVENT_MODE_CHANGED 0x80000002
-#define DRM_EVDI_EVENT_CRTC_STATE 0x80000003
-
-struct drm_evdi_event_update_ready {
- struct drm_event base;
-};
-
-struct drm_evdi_event_dpms {
- struct drm_event base;
- int32_t mode;
-};
-
-struct drm_evdi_event_mode_changed {
- struct drm_event base;
- int32_t hdisplay;
- int32_t vdisplay;
- int32_t vrefresh;
- int32_t bits_per_pixel;
- uint32_t pixel_format;
-};
-
-struct drm_evdi_event_crtc_state {
- struct drm_event base;
- int32_t state;
-};
-
-struct drm_evdi_connect {
- int32_t connected;
- int32_t dev_index;
- const unsigned char * __user edid;
- unsigned int edid_length;
-};
-
-struct drm_evdi_mapfifo {
- int32_t reserved;
-};
-
-struct drm_evdi_request_update {
- int32_t reserved;
-};
-
-enum drm_evdi_grabpix_mode {
- EVDI_GRABPIX_MODE_RECTS = 0,
- EVDI_GRABPIX_MODE_DIRTY = 1,
-};
-
-struct drm_evdi_grabpix {
- enum drm_evdi_grabpix_mode mode;
- int32_t buf_width;
- int32_t buf_height;
- int32_t buf_byte_stride;
- unsigned char __user *buffer;
- int32_t num_rects;
- struct drm_clip_rect __user *rects;
-};
-
-/* Input ioctls from evdi lib to driver */
-#define DRM_EVDI_CONNECT 0x00
-#define DRM_EVDI_REQUEST_UPDATE 0x01
-#define DRM_EVDI_GRABPIX 0x02
-/* LAST_IOCTL 0x5F -- 96 driver specific ioctls to use */
-
-#define DRM_IOCTL_EVDI_CONNECT DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_EVDI_CONNECT, struct drm_evdi_connect)
-#define DRM_IOCTL_EVDI_REQUEST_UPDATE DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_EVDI_REQUEST_UPDATE, struct drm_evdi_request_update)
-#define DRM_IOCTL_EVDI_GRABPIX DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_EVDI_GRABPIX, struct drm_evdi_grabpix)
-
-#endif /* __EVDI_UAPI_DRM_H__ */
-
diff --git a/chromium/third_party/libdrm/src/include/drm/i915_drm.h b/chromium/third_party/libdrm/src/include/drm/i915_drm.h
index c4ce6b2c6f8..ded43b1cb11 100644
--- a/chromium/third_party/libdrm/src/include/drm/i915_drm.h
+++ b/chromium/third_party/libdrm/src/include/drm/i915_drm.h
@@ -27,7 +27,7 @@
#ifndef _I915_DRM_H_
#define _I915_DRM_H_
-#include "drm.h"
+#include <drm.h>
/* Please note that modifications to all structs defined here are
* subject to backwards-compatibility constraints.
@@ -171,12 +171,8 @@ typedef struct _drm_i915_sarea {
#define I915_BOX_TEXTURE_LOAD 0x8
#define I915_BOX_LOST_CONTEXT 0x10
-/*
- * i915 specific ioctls.
- *
- * The device specific ioctl range is [DRM_COMMAND_BASE, DRM_COMMAND_END) ie
- * [0x40, 0xa0) (a0 is excluded). The numbers below are defined as offset
- * against DRM_COMMAND_BASE and should be between [0x0, 0x60).
+/* I915 specific ioctls
+ * The device specific ioctl range is 0x40 to 0x79.
*/
#define DRM_I915_INIT 0x00
#define DRM_I915_FLUSH 0x01
@@ -274,7 +270,7 @@ typedef struct _drm_i915_sarea {
#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
#define DRM_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
-#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
+#define DRM_IOCTL_I915_GET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct drm_intel_sprite_colorkey)
#define DRM_IOCTL_I915_GEM_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_WAIT, struct drm_i915_gem_wait)
#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
@@ -354,16 +350,9 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_REVISION 32
#define I915_PARAM_SUBSLICE_TOTAL 33
#define I915_PARAM_EU_TOTAL 34
-#define I915_PARAM_HAS_GPU_RESET 35
-#define I915_PARAM_HAS_RESOURCE_STREAMER 36
-#define I915_PARAM_HAS_EXEC_SOFTPIN 37
typedef struct drm_i915_getparam {
- __s32 param;
- /*
- * WARNING: Using pointers instead of fixed-size u64 means we need to write
- * compat32 code. Don't repeat this mistake.
- */
+ int param;
int *value;
} drm_i915_getparam_t;
@@ -683,21 +672,15 @@ struct drm_i915_gem_exec_object2 {
__u64 alignment;
/**
- * When the EXEC_OBJECT_PINNED flag is specified this is populated by
- * the user with the GTT offset at which this object will be pinned.
- * When the I915_EXEC_NO_RELOC flag is specified this must contain the
- * presumed_offset of the object.
- * During execbuffer2 the kernel populates it with the value of the
- * current GTT offset of the object, for future presumed_offset writes.
+ * Returned value of the updated offset of the object, for future
+ * presumed_offset writes.
*/
__u64 offset;
#define EXEC_OBJECT_NEEDS_FENCE (1<<0)
#define EXEC_OBJECT_NEEDS_GTT (1<<1)
#define EXEC_OBJECT_WRITE (1<<2)
-#define EXEC_OBJECT_SUPPORTS_48B_ADDRESS (1<<3)
-#define EXEC_OBJECT_PINNED (1<<4)
-#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_PINNED<<1)
+#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1)
__u64 flags;
__u64 rsvd1;
@@ -772,19 +755,12 @@ struct drm_i915_gem_execbuffer2 {
#define I915_EXEC_HANDLE_LUT (1<<12)
/** Used for switching BSD rings on the platforms with two BSD rings */
-#define I915_EXEC_BSD_SHIFT (13)
-#define I915_EXEC_BSD_MASK (3 << I915_EXEC_BSD_SHIFT)
-/* default ping-pong mode */
-#define I915_EXEC_BSD_DEFAULT (0 << I915_EXEC_BSD_SHIFT)
-#define I915_EXEC_BSD_RING1 (1 << I915_EXEC_BSD_SHIFT)
-#define I915_EXEC_BSD_RING2 (2 << I915_EXEC_BSD_SHIFT)
-
-/** Tell the kernel that the batchbuffer is processed by
- * the resource streamer.
- */
-#define I915_EXEC_RESOURCE_STREAMER (1<<15)
+#define I915_EXEC_BSD_MASK (3<<13)
+#define I915_EXEC_BSD_DEFAULT (0<<13) /* default ping-pong mode */
+#define I915_EXEC_BSD_RING1 (1<<13)
+#define I915_EXEC_BSD_RING2 (2<<13)
-#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_RESOURCE_STREAMER<<1)
+#define __I915_EXEC_UNKNOWN_FLAGS -(1<<15)
#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
#define i915_execbuffer2_set_context_id(eb2, context) \
@@ -814,35 +790,10 @@ struct drm_i915_gem_busy {
/** Handle of the buffer to check for busy */
__u32 handle;
- /** Return busy status
- *
- * A return of 0 implies that the object is idle (after
- * having flushed any pending activity), and a non-zero return that
- * the object is still in-flight on the GPU. (The GPU has not yet
- * signaled completion for all pending requests that reference the
- * object.)
- *
- * The returned dword is split into two fields to indicate both
- * the engines on which the object is being read, and the
- * engine on which it is currently being written (if any).
- *
- * The low word (bits 0:15) indicate if the object is being written
- * to by any engine (there can only be one, as the GEM implicit
- * synchronisation rules force writes to be serialised). Only the
- * engine for the last write is reported.
- *
- * The high word (bits 16:31) are a bitmask of which engines are
- * currently reading from the object. Multiple engines may be
- * reading from the object simultaneously.
- *
- * The value of each engine is the same as specified in the
- * EXECBUFFER2 ioctl, i.e. I915_EXEC_RENDER, I915_EXEC_BSD etc.
- * Note I915_EXEC_DEFAULT is a symbolic value and is mapped to
- * the I915_EXEC_RENDER engine for execution, and so it is never
- * reported as active itself. Some hardware may have parallel
- * execution engines, e.g. multiple media engines, which are
- * mapped to the same identifier in the EXECBUFFER2 ioctl and
- * so are not separately reported for busyness.
+ /** Return busy status (1 if busy, 0 if idle).
+ * The high word is used to indicate on which rings the object
+ * currently resides:
+ * 16:31 - busy (r or r/w) rings (16 render, 17 bsd, 18 blt, etc)
*/
__u32 busy;
};
@@ -1045,7 +996,6 @@ struct drm_intel_overlay_put_image {
/* flags */
#define I915_OVERLAY_UPDATE_ATTRS (1<<0)
#define I915_OVERLAY_UPDATE_GAMMA (1<<1)
-#define I915_OVERLAY_DISABLE_DEST_COLORKEY (1<<2)
struct drm_intel_overlay_attrs {
__u32 flags;
__u32 color_key;
@@ -1112,23 +1062,9 @@ struct drm_i915_gem_context_destroy {
};
struct drm_i915_reg_read {
- /*
- * Register offset.
- * For 64bit wide registers where the upper 32bits don't immediately
- * follow the lower 32bits, the offset of the lower 32bits must
- * be specified
- */
__u64 offset;
__u64 val; /* Return value */
};
-/* Known registers:
- *
- * Render engine timestamp - 0x2358 + 64bit - gen7+
- * - Note this register returns an invalid value if using the default
- * single instruction 8byte read, in order to workaround that use
- * offset (0x2538 | 1) instead.
- *
- */
struct drm_i915_reset_stats {
__u32 ctx_id;
@@ -1164,9 +1100,7 @@ struct drm_i915_gem_context_param {
__u32 ctx_id;
__u32 size;
__u64 param;
-#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
-#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
-#define I915_CONTEXT_PARAM_GTT_SIZE 0x3
+#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
__u64 value;
};
diff --git a/chromium/third_party/libdrm/src/include/drm/nouveau_drm.h b/chromium/third_party/libdrm/src/include/drm/nouveau_drm.h
index e418f9f3899..87aefc5e9d2 100644
--- a/chromium/third_party/libdrm/src/include/drm/nouveau_drm.h
+++ b/chromium/third_party/libdrm/src/include/drm/nouveau_drm.h
@@ -200,7 +200,6 @@ struct drm_nouveau_sarea {
#define DRM_NOUVEAU_GROBJ_ALLOC 0x04
#define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x05
#define DRM_NOUVEAU_GPUOBJ_FREE 0x06
-#define DRM_NOUVEAU_NVIF 0x07
#define DRM_NOUVEAU_GEM_NEW 0x40
#define DRM_NOUVEAU_GEM_PUSHBUF 0x41
#define DRM_NOUVEAU_GEM_CPU_PREP 0x42
diff --git a/chromium/third_party/libdrm/src/include/drm/tegra_drm.h b/chromium/third_party/libdrm/src/include/drm/tegra_drm.h
index 7c0fe0ed511..8dae8f33499 100644
--- a/chromium/third_party/libdrm/src/include/drm/tegra_drm.h
+++ b/chromium/third_party/libdrm/src/include/drm/tegra_drm.h
@@ -36,8 +36,7 @@ struct drm_tegra_gem_create {
struct drm_tegra_gem_mmap {
__u32 handle;
- __u32 pad;
- __u64 offset;
+ __u32 offset;
};
struct drm_tegra_syncpt_read {
diff --git a/chromium/third_party/libdrm/src/include/drm/vc4_drm.h b/chromium/third_party/libdrm/src/include/drm/vc4_drm.h
deleted file mode 100644
index 919eecea762..00000000000
--- a/chromium/third_party/libdrm/src/include/drm/vc4_drm.h
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright © 2014-2015 Broadcom
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef _VC4_DRM_H_
-#define _VC4_DRM_H_
-
-#include "drm.h"
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-#define DRM_VC4_SUBMIT_CL 0x00
-#define DRM_VC4_WAIT_SEQNO 0x01
-#define DRM_VC4_WAIT_BO 0x02
-#define DRM_VC4_CREATE_BO 0x03
-#define DRM_VC4_MMAP_BO 0x04
-#define DRM_VC4_CREATE_SHADER_BO 0x05
-#define DRM_VC4_GET_HANG_STATE 0x06
-#define DRM_VC4_GET_PARAM 0x07
-
-#define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl)
-#define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno)
-#define DRM_IOCTL_VC4_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_BO, struct drm_vc4_wait_bo)
-#define DRM_IOCTL_VC4_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_BO, struct drm_vc4_create_bo)
-#define DRM_IOCTL_VC4_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_MMAP_BO, struct drm_vc4_mmap_bo)
-#define DRM_IOCTL_VC4_CREATE_SHADER_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_CREATE_SHADER_BO, struct drm_vc4_create_shader_bo)
-#define DRM_IOCTL_VC4_GET_HANG_STATE DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_HANG_STATE, struct drm_vc4_get_hang_state)
-#define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param)
-
-struct drm_vc4_submit_rcl_surface {
- __u32 hindex; /* Handle index, or ~0 if not present. */
- __u32 offset; /* Offset to start of buffer. */
- /*
- * Bits for either render config (color_write) or load/store packet.
- * Bits should all be 0 for MSAA load/stores.
- */
- __u16 bits;
-
-#define VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES (1 << 0)
- __u16 flags;
-};
-
-/**
- * struct drm_vc4_submit_cl - ioctl argument for submitting commands to the 3D
- * engine.
- *
- * Drivers typically use GPU BOs to store batchbuffers / command lists and
- * their associated state. However, because the VC4 lacks an MMU, we have to
- * do validation of memory accesses by the GPU commands. If we were to store
- * our commands in BOs, we'd need to do uncached readback from them to do the
- * validation process, which is too expensive. Instead, userspace accumulates
- * commands and associated state in plain memory, then the kernel copies the
- * data to its own address space, and then validates and stores it in a GPU
- * BO.
- */
-struct drm_vc4_submit_cl {
- /* Pointer to the binner command list.
- *
- * This is the first set of commands executed, which runs the
- * coordinate shader to determine where primitives land on the screen,
- * then writes out the state updates and draw calls necessary per tile
- * to the tile allocation BO.
- */
- __u64 bin_cl;
-
- /* Pointer to the shader records.
- *
- * Shader records are the structures read by the hardware that contain
- * pointers to uniforms, shaders, and vertex attributes. The
- * reference to the shader record has enough information to determine
- * how many pointers are necessary (fixed number for shaders/uniforms,
- * and an attribute count), so those BO indices into bo_handles are
- * just stored as __u32s before each shader record passed in.
- */
- __u64 shader_rec;
-
- /* Pointer to uniform data and texture handles for the textures
- * referenced by the shader.
- *
- * For each shader state record, there is a set of uniform data in the
- * order referenced by the record (FS, VS, then CS). Each set of
- * uniform data has a __u32 index into bo_handles per texture
- * sample operation, in the order the QPU_W_TMUn_S writes appear in
- * the program. Following the texture BO handle indices is the actual
- * uniform data.
- *
- * The individual uniform state blocks don't have sizes passed in,
- * because the kernel has to determine the sizes anyway during shader
- * code validation.
- */
- __u64 uniforms;
- __u64 bo_handles;
-
- /* Size in bytes of the binner command list. */
- __u32 bin_cl_size;
- /* Size in bytes of the set of shader records. */
- __u32 shader_rec_size;
- /* Number of shader records.
- *
- * This could just be computed from the contents of shader_records and
- * the address bits of references to them from the bin CL, but it
- * keeps the kernel from having to resize some allocations it makes.
- */
- __u32 shader_rec_count;
- /* Size in bytes of the uniform state. */
- __u32 uniforms_size;
-
- /* Number of BO handles passed in (size is that times 4). */
- __u32 bo_handle_count;
-
- /* RCL setup: */
- __u16 width;
- __u16 height;
- __u8 min_x_tile;
- __u8 min_y_tile;
- __u8 max_x_tile;
- __u8 max_y_tile;
- struct drm_vc4_submit_rcl_surface color_read;
- struct drm_vc4_submit_rcl_surface color_write;
- struct drm_vc4_submit_rcl_surface zs_read;
- struct drm_vc4_submit_rcl_surface zs_write;
- struct drm_vc4_submit_rcl_surface msaa_color_write;
- struct drm_vc4_submit_rcl_surface msaa_zs_write;
- __u32 clear_color[2];
- __u32 clear_z;
- __u8 clear_s;
-
- __u32 pad:24;
-
-#define VC4_SUBMIT_CL_USE_CLEAR_COLOR (1 << 0)
- __u32 flags;
-
- /* Returned value of the seqno of this render job (for the
- * wait ioctl).
- */
- __u64 seqno;
-};
-
-/**
- * struct drm_vc4_wait_seqno - ioctl argument for waiting for
- * DRM_VC4_SUBMIT_CL completion using its returned seqno.
- *
- * timeout_ns is the timeout in nanoseconds, where "0" means "don't
- * block, just return the status."
- */
-struct drm_vc4_wait_seqno {
- __u64 seqno;
- __u64 timeout_ns;
-};
-
-/**
- * struct drm_vc4_wait_bo - ioctl argument for waiting for
- * completion of the last DRM_VC4_SUBMIT_CL on a BO.
- *
- * This is useful for cases where multiple processes might be
- * rendering to a BO and you want to wait for all rendering to be
- * completed.
- */
-struct drm_vc4_wait_bo {
- __u32 handle;
- __u32 pad;
- __u64 timeout_ns;
-};
-
-/**
- * struct drm_vc4_create_bo - ioctl argument for creating VC4 BOs.
- *
- * There are currently no values for the flags argument, but it may be
- * used in a future extension.
- */
-struct drm_vc4_create_bo {
- __u32 size;
- __u32 flags;
- /** Returned GEM handle for the BO. */
- __u32 handle;
- __u32 pad;
-};
-
-/**
- * struct drm_vc4_mmap_bo - ioctl argument for mapping VC4 BOs.
- *
- * This doesn't actually perform an mmap. Instead, it returns the
- * offset you need to use in an mmap on the DRM device node. This
- * means that tools like valgrind end up knowing about the mapped
- * memory.
- *
- * There are currently no values for the flags argument, but it may be
- * used in a future extension.
- */
-struct drm_vc4_mmap_bo {
- /** Handle for the object being mapped. */
- __u32 handle;
- __u32 flags;
- /** offset into the drm node to use for subsequent mmap call. */
- __u64 offset;
-};
-
-/**
- * struct drm_vc4_create_shader_bo - ioctl argument for creating VC4
- * shader BOs.
- *
- * Since allowing a shader to be overwritten while it's also being
- * executed from would allow privlege escalation, shaders must be
- * created using this ioctl, and they can't be mmapped later.
- */
-struct drm_vc4_create_shader_bo {
- /* Size of the data argument. */
- __u32 size;
- /* Flags, currently must be 0. */
- __u32 flags;
-
- /* Pointer to the data. */
- __u64 data;
-
- /** Returned GEM handle for the BO. */
- __u32 handle;
- /* Pad, must be 0. */
- __u32 pad;
-};
-
-struct drm_vc4_get_hang_state_bo {
- __u32 handle;
- __u32 paddr;
- __u32 size;
- __u32 pad;
-};
-
-/**
- * struct drm_vc4_hang_state - ioctl argument for collecting state
- * from a GPU hang for analysis.
-*/
-struct drm_vc4_get_hang_state {
- /** Pointer to array of struct drm_vc4_get_hang_state_bo. */
- __u64 bo;
- /**
- * On input, the size of the bo array. Output is the number
- * of bos to be returned.
- */
- __u32 bo_count;
-
- __u32 start_bin, start_render;
-
- __u32 ct0ca, ct0ea;
- __u32 ct1ca, ct1ea;
- __u32 ct0cs, ct1cs;
- __u32 ct0ra0, ct1ra0;
-
- __u32 bpca, bpcs;
- __u32 bpoa, bpos;
-
- __u32 vpmbase;
-
- __u32 dbge;
- __u32 fdbgo;
- __u32 fdbgb;
- __u32 fdbgr;
- __u32 fdbgs;
- __u32 errstat;
-
- /* Pad that we may save more registers into in the future. */
- __u32 pad[16];
-};
-
-#define DRM_VC4_PARAM_V3D_IDENT0 0
-#define DRM_VC4_PARAM_V3D_IDENT1 1
-#define DRM_VC4_PARAM_V3D_IDENT2 2
-#define DRM_VC4_PARAM_SUPPORTS_BRANCHES 3
-
-struct drm_vc4_get_param {
- __u32 param;
- __u32 pad;
- __u64 value;
-};
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif /* _VC4_DRM_H_ */
diff --git a/chromium/third_party/libdrm/src/include/drm/vgem_drm.h b/chromium/third_party/libdrm/src/include/drm/vgem_drm.h
deleted file mode 100644
index 9be928f4a52..00000000000
--- a/chromium/third_party/libdrm/src/include/drm/vgem_drm.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2015 The Chromium OS Authors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _VGEM_DRM_H_
-#define _VGEM_DRM_H_
-
-#include "drm.h"
-
-#define DRM_VGEM_MODE_MAP_DUMB 0x00
-
-#define DRM_IOCTL_VGEM_MODE_MAP_DUMB \
- DRM_IOWR(DRM_COMMAND_BASE + DRM_VGEM_MODE_MAP_DUMB, struct drm_mode_map_dumb)
-
-#endif
diff --git a/chromium/third_party/libdrm/src/include/drm/virtgpu_drm.h b/chromium/third_party/libdrm/src/include/drm/virtgpu_drm.h
index 91a31ffed82..abf11c588af 100644
--- a/chromium/third_party/libdrm/src/include/drm/virtgpu_drm.h
+++ b/chromium/third_party/libdrm/src/include/drm/virtgpu_drm.h
@@ -24,16 +24,13 @@
#ifndef VIRTGPU_DRM_H
#define VIRTGPU_DRM_H
-#include "drm.h"
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
+#include <stddef.h>
+#include "drm/drm.h"
/* Please note that modifications to all structs defined here are
* subject to backwards-compatibility constraints.
*
- * Do not use pointers, use __u64 instead for 32 bit / 64 bit user/kernel
+ * Do not use pointers, use uint64_t instead for 32 bit / 64 bit user/kernel
* compatibility Keep fields aligned to their size
*/
@@ -48,88 +45,88 @@ extern "C" {
#define DRM_VIRTGPU_GET_CAPS 0x09
struct drm_virtgpu_map {
- __u64 offset; /* use for mmap system call */
- __u32 handle;
- __u32 pad;
+ uint64_t offset; /* use for mmap system call */
+ uint32_t handle;
+ uint32_t pad;
};
struct drm_virtgpu_execbuffer {
- __u32 flags; /* for future use */
- __u32 size;
- __u64 command; /* void* */
- __u64 bo_handles;
- __u32 num_bo_handles;
- __u32 pad;
+ uint32_t flags; /* for future use */
+ uint32_t size;
+ uint64_t command; /* void* */
+ uint64_t bo_handles;
+ uint32_t num_bo_handles;
+ uint32_t pad;
};
#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
struct drm_virtgpu_getparam {
- __u64 param;
- __u64 value;
+ uint64_t param;
+ uint64_t value;
};
/* NO_BO flags? NO resource flag? */
/* resource flag for y_0_top */
struct drm_virtgpu_resource_create {
- __u32 target;
- __u32 format;
- __u32 bind;
- __u32 width;
- __u32 height;
- __u32 depth;
- __u32 array_size;
- __u32 last_level;
- __u32 nr_samples;
- __u32 flags;
- __u32 bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
- __u32 res_handle; /* returned by kernel */
- __u32 size; /* validate transfer in the host */
- __u32 stride; /* validate transfer in the host */
+ uint32_t target;
+ uint32_t format;
+ uint32_t bind;
+ uint32_t width;
+ uint32_t height;
+ uint32_t depth;
+ uint32_t array_size;
+ uint32_t last_level;
+ uint32_t nr_samples;
+ uint32_t flags;
+ uint32_t bo_handle; /* if this is set - recreate a new resource attached to this bo ? */
+ uint32_t res_handle; /* returned by kernel */
+ uint32_t size; /* validate transfer in the host */
+ uint32_t stride; /* validate transfer in the host */
};
struct drm_virtgpu_resource_info {
- __u32 bo_handle;
- __u32 res_handle;
- __u32 size;
- __u32 stride;
+ uint32_t bo_handle;
+ uint32_t res_handle;
+ uint32_t size;
+ uint32_t stride;
};
struct drm_virtgpu_3d_box {
- __u32 x;
- __u32 y;
- __u32 z;
- __u32 w;
- __u32 h;
- __u32 d;
+ uint32_t x;
+ uint32_t y;
+ uint32_t z;
+ uint32_t w;
+ uint32_t h;
+ uint32_t d;
};
struct drm_virtgpu_3d_transfer_to_host {
- __u32 bo_handle;
+ uint32_t bo_handle;
struct drm_virtgpu_3d_box box;
- __u32 level;
- __u32 offset;
+ uint32_t level;
+ uint32_t offset;
};
struct drm_virtgpu_3d_transfer_from_host {
- __u32 bo_handle;
+ uint32_t bo_handle;
struct drm_virtgpu_3d_box box;
- __u32 level;
- __u32 offset;
+ uint32_t level;
+ uint32_t offset;
};
#define VIRTGPU_WAIT_NOWAIT 1 /* like it */
struct drm_virtgpu_3d_wait {
- __u32 handle; /* 0 is an invalid handle */
- __u32 flags;
+ uint32_t handle; /* 0 is an invalid handle */
+ uint32_t flags;
};
struct drm_virtgpu_get_caps {
- __u32 cap_set_id;
- __u32 cap_set_ver;
- __u64 addr;
- __u32 size;
- __u32 pad;
+ uint32_t cap_set_id;
+ uint32_t cap_set_ver;
+ uint64_t addr;
+ uint32_t size;
+ uint32_t pad;
};
#define DRM_IOCTL_VIRTGPU_MAP \
@@ -167,8 +164,4 @@ struct drm_virtgpu_get_caps {
DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
struct drm_virtgpu_get_caps)
-#if defined(__cplusplus)
-}
-#endif
-
#endif
diff --git a/chromium/third_party/libdrm/src/include/drm/vmwgfx_drm.h b/chromium/third_party/libdrm/src/include/drm/vmwgfx_drm.h
index 5b68b4d1088..4d0842391ed 100644
--- a/chromium/third_party/libdrm/src/include/drm/vmwgfx_drm.h
+++ b/chromium/third_party/libdrm/src/include/drm/vmwgfx_drm.h
@@ -1,6 +1,6 @@
/**************************************************************************
*
- * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA
+ * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,11 +28,10 @@
#ifndef __VMWGFX_DRM_H__
#define __VMWGFX_DRM_H__
-#include "drm.h"
-
#define DRM_VMW_MAX_SURFACE_FACES 6
#define DRM_VMW_MAX_MIP_LEVELS 24
+#define DRM_VMW_EXT_NAME_LEN 128
#define DRM_VMW_GET_PARAM 0
#define DRM_VMW_ALLOC_DMABUF 1
@@ -49,20 +48,11 @@
#define DRM_VMW_UNREF_SURFACE 10
#define DRM_VMW_REF_SURFACE 11
#define DRM_VMW_EXECBUF 12
-#define DRM_VMW_GET_3D_CAP 13
+#define DRM_VMW_FIFO_DEBUG 13
#define DRM_VMW_FENCE_WAIT 14
-#define DRM_VMW_FENCE_SIGNALED 15
-#define DRM_VMW_FENCE_UNREF 16
-#define DRM_VMW_FENCE_EVENT 17
-#define DRM_VMW_PRESENT 18
-#define DRM_VMW_PRESENT_READBACK 19
-#define DRM_VMW_UPDATE_LAYOUT 20
-#define DRM_VMW_CREATE_SHADER 21
-#define DRM_VMW_UNREF_SHADER 22
-#define DRM_VMW_GB_SURFACE_CREATE 23
-#define DRM_VMW_GB_SURFACE_REF 24
-#define DRM_VMW_SYNCCPU 25
-#define DRM_VMW_CREATE_EXTENDED_CONTEXT 26
+/* guarded by minor version >= 2 */
+#define DRM_VMW_UPDATE_LAYOUT 15
+
/*************************************************************************/
/**
@@ -79,25 +69,9 @@
#define DRM_VMW_PARAM_NUM_STREAMS 0
#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
#define DRM_VMW_PARAM_3D 2
-#define DRM_VMW_PARAM_HW_CAPS 3
-#define DRM_VMW_PARAM_FIFO_CAPS 4
-#define DRM_VMW_PARAM_MAX_FB_SIZE 5
-#define DRM_VMW_PARAM_FIFO_HW_VERSION 6
-#define DRM_VMW_PARAM_MAX_SURF_MEMORY 7
-#define DRM_VMW_PARAM_3D_CAPS_SIZE 8
-#define DRM_VMW_PARAM_MAX_MOB_MEMORY 9
-#define DRM_VMW_PARAM_MAX_MOB_SIZE 10
-#define DRM_VMW_PARAM_SCREEN_TARGET 11
-#define DRM_VMW_PARAM_DX 12
-
-/**
- * enum drm_vmw_handle_type - handle type for ref ioctls
- *
- */
-enum drm_vmw_handle_type {
- DRM_VMW_HANDLE_LEGACY = 0,
- DRM_VMW_HANDLE_PRIME = 1
-};
+#define DRM_VMW_PARAM_FIFO_OFFSET 3
+#define DRM_VMW_PARAM_HW_CAPS 4
+#define DRM_VMW_PARAM_FIFO_CAPS 5
/**
* struct drm_vmw_getparam_arg
@@ -109,9 +83,52 @@ enum drm_vmw_handle_type {
*/
struct drm_vmw_getparam_arg {
- __u64 value;
- __u32 param;
- __u32 pad64;
+ uint64_t value;
+ uint32_t param;
+ uint32_t pad64;
+};
+
+/*************************************************************************/
+/**
+ * DRM_VMW_EXTENSION - Query device extensions.
+ */
+
+/**
+ * struct drm_vmw_extension_rep
+ *
+ * @exists: The queried extension exists.
+ * @driver_ioctl_offset: Ioctl number of the first ioctl in the extension.
+ * @driver_sarea_offset: Offset to any space in the DRI SAREA
+ * used by the extension.
+ * @major: Major version number of the extension.
+ * @minor: Minor version number of the extension.
+ * @pl: Patch level version number of the extension.
+ *
+ * Output argument to the DRM_VMW_EXTENSION Ioctl.
+ */
+
+struct drm_vmw_extension_rep {
+ int32_t exists;
+ uint32_t driver_ioctl_offset;
+ uint32_t driver_sarea_offset;
+ uint32_t major;
+ uint32_t minor;
+ uint32_t pl;
+ uint32_t pad64;
+};
+
+/**
+ * union drm_vmw_extension_arg
+ *
+ * @extension - Ascii name of the extension to be queried. //In
+ * @rep - Reply as defined above. //Out
+ *
+ * Argument to the DRM_VMW_EXTENSION Ioctl.
+ */
+
+union drm_vmw_extension_arg {
+ char extension[DRM_VMW_EXT_NAME_LEN];
+ struct drm_vmw_extension_rep rep;
};
/*************************************************************************/
@@ -132,8 +149,8 @@ struct drm_vmw_getparam_arg {
*/
struct drm_vmw_context_arg {
- __s32 cid;
- __u32 pad64;
+ int32_t cid;
+ uint32_t pad64;
};
/*************************************************************************/
@@ -163,7 +180,7 @@ struct drm_vmw_context_arg {
* @mip_levels: Number of mip levels for each face.
* An unused face should have 0 encoded.
* @size_addr: Address of a user-space array of sruct drm_vmw_size
- * cast to an __u64 for 32-64 bit compatibility.
+ * cast to an uint64_t for 32-64 bit compatibility.
* The size of the array should equal the total number of mipmap levels.
* @shareable: Boolean whether other clients (as identified by file descriptors)
* may reference this surface.
@@ -175,19 +192,18 @@ struct drm_vmw_context_arg {
*/
struct drm_vmw_surface_create_req {
- __u32 flags;
- __u32 format;
- __u32 mip_levels[DRM_VMW_MAX_SURFACE_FACES];
- __u64 size_addr;
- __s32 shareable;
- __s32 scanout;
+ uint32_t flags;
+ uint32_t format;
+ uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES];
+ uint64_t size_addr;
+ int32_t shareable;
+ int32_t scanout;
};
/**
* struct drm_wmv_surface_arg
*
* @sid: Surface id of created surface or surface to destroy or reference.
- * @handle_type: Handle type for DRM_VMW_REF_SURFACE Ioctl.
*
* Output data from the DRM_VMW_CREATE_SURFACE Ioctl.
* Input argument to the DRM_VMW_UNREF_SURFACE Ioctl.
@@ -195,8 +211,8 @@ struct drm_vmw_surface_create_req {
*/
struct drm_vmw_surface_arg {
- __s32 sid;
- enum drm_vmw_handle_type handle_type;
+ int32_t sid;
+ uint32_t pad64;
};
/**
@@ -211,10 +227,10 @@ struct drm_vmw_surface_arg {
*/
struct drm_vmw_size {
- __u32 width;
- __u32 height;
- __u32 depth;
- __u32 pad64;
+ uint32_t width;
+ uint32_t height;
+ uint32_t depth;
+ uint32_t pad64;
};
/**
@@ -275,20 +291,20 @@ union drm_vmw_surface_reference_arg {
* DRM_VMW_EXECBUF
*
* Submit a command buffer for execution on the host, and return a
- * fence seqno that when signaled, indicates that the command buffer has
+ * fence sequence that when signaled, indicates that the command buffer has
* executed.
*/
/**
* struct drm_vmw_execbuf_arg
*
- * @commands: User-space address of a command buffer cast to an __u64.
+ * @commands: User-space address of a command buffer cast to an uint64_t.
* @command-size: Size in bytes of the command buffer.
* @throttle-us: Sleep until software is less than @throttle_us
* microseconds ahead of hardware. The driver may round this value
* to the nearest kernel tick.
* @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
- * __u64.
+ * uint64_t.
* @version: Allows expanding the execbuf ioctl parameters without breaking
* backwards compatibility, since user-space will always tell the kernel
* which version it uses.
@@ -297,32 +313,21 @@ union drm_vmw_surface_reference_arg {
* Argument to the DRM_VMW_EXECBUF Ioctl.
*/
-#define DRM_VMW_EXECBUF_VERSION 2
+#define DRM_VMW_EXECBUF_VERSION 0
struct drm_vmw_execbuf_arg {
- __u64 commands;
- __u32 command_size;
- __u32 throttle_us;
- __u64 fence_rep;
- __u32 version;
- __u32 flags;
- __u32 context_handle;
- __u32 pad64;
+ uint64_t commands;
+ uint32_t command_size;
+ uint32_t throttle_us;
+ uint64_t fence_rep;
+ uint32_t version;
+ uint32_t flags;
};
/**
* struct drm_vmw_fence_rep
*
- * @handle: Fence object handle for fence associated with a command submission.
- * @mask: Fence flags relevant for this fence object.
- * @seqno: Fence sequence number in fifo. A fence object with a lower
- * seqno will signal the EXEC flag before a fence object with a higher
- * seqno. This can be used by user-space to avoid kernel calls to determine
- * whether a fence has signaled the EXEC flag. Note that @seqno will
- * wrap at 32-bit.
- * @passed_seqno: The highest seqno number processed by the hardware
- * so far. This can be used to mark user-space fence objects as signaled, and
- * to determine whether a fence seqno might be stale.
+ * @fence_seq: Fence sequence associated with a command submission.
* @error: This member should've been set to -EFAULT on submission.
* The following actions should be take on completion:
* error == -EFAULT: Fence communication failed. The host is synchronized.
@@ -336,12 +341,9 @@ struct drm_vmw_execbuf_arg {
*/
struct drm_vmw_fence_rep {
- __u32 handle;
- __u32 mask;
- __u32 seqno;
- __u32 passed_seqno;
- __u32 pad64;
- __s32 error;
+ uint64_t fence_seq;
+ int32_t error;
+ uint32_t pad64;
};
/*************************************************************************/
@@ -371,8 +373,8 @@ struct drm_vmw_fence_rep {
*/
struct drm_vmw_alloc_dmabuf_req {
- __u32 size;
- __u32 pad64;
+ uint32_t size;
+ uint32_t pad64;
};
/**
@@ -389,11 +391,11 @@ struct drm_vmw_alloc_dmabuf_req {
*/
struct drm_vmw_dmabuf_rep {
- __u64 map_handle;
- __u32 handle;
- __u32 cur_gmr_id;
- __u32 cur_gmr_offset;
- __u32 pad64;
+ uint64_t map_handle;
+ uint32_t handle;
+ uint32_t cur_gmr_id;
+ uint32_t cur_gmr_offset;
+ uint32_t pad64;
};
/**
@@ -426,8 +428,41 @@ union drm_vmw_alloc_dmabuf_arg {
*/
struct drm_vmw_unref_dmabuf_arg {
- __u32 handle;
- __u32 pad64;
+ uint32_t handle;
+ uint32_t pad64;
+};
+
+/*************************************************************************/
+/**
+ * DRM_VMW_FIFO_DEBUG - Get last FIFO submission.
+ *
+ * This IOCTL copies the last FIFO submission directly out of the FIFO buffer.
+ */
+
+/**
+ * struct drm_vmw_fifo_debug_arg
+ *
+ * @debug_buffer: User space address of a debug_buffer cast to an uint64_t //In
+ * @debug_buffer_size: Size in bytes of debug buffer //In
+ * @used_size: Number of bytes copied to the buffer // Out
+ * @did_not_fit: Boolean indicating that the fifo contents did not fit. //Out
+ *
+ * Argument to the DRM_VMW_FIFO_DEBUG Ioctl.
+ */
+
+struct drm_vmw_fifo_debug_arg {
+ uint64_t debug_buffer;
+ uint32_t debug_buffer_size;
+ uint32_t used_size;
+ int32_t did_not_fit;
+ uint32_t pad64;
+};
+
+struct drm_vmw_fence_wait_arg {
+ uint64_t sequence;
+ uint64_t kernel_cookie;
+ int32_t cookie_valid;
+ int32_t pad64;
};
/*************************************************************************/
@@ -450,10 +485,10 @@ struct drm_vmw_unref_dmabuf_arg {
*/
struct drm_vmw_rect {
- __s32 x;
- __s32 y;
- __u32 w;
- __u32 h;
+ int32_t x;
+ int32_t y;
+ uint32_t w;
+ uint32_t h;
};
/**
@@ -475,21 +510,21 @@ struct drm_vmw_rect {
*/
struct drm_vmw_control_stream_arg {
- __u32 stream_id;
- __u32 enabled;
+ uint32_t stream_id;
+ uint32_t enabled;
- __u32 flags;
- __u32 color_key;
+ uint32_t flags;
+ uint32_t color_key;
- __u32 handle;
- __u32 offset;
- __s32 format;
- __u32 size;
- __u32 width;
- __u32 height;
- __u32 pitch[3];
+ uint32_t handle;
+ uint32_t offset;
+ int32_t format;
+ uint32_t size;
+ uint32_t width;
+ uint32_t height;
+ uint32_t pitch[3];
- __u32 pad64;
+ uint32_t pad64;
struct drm_vmw_rect src;
struct drm_vmw_rect dst;
};
@@ -517,12 +552,12 @@ struct drm_vmw_control_stream_arg {
*/
struct drm_vmw_cursor_bypass_arg {
- __u32 flags;
- __u32 crtc_id;
- __s32 xpos;
- __s32 ypos;
- __s32 xhot;
- __s32 yhot;
+ uint32_t flags;
+ uint32_t crtc_id;
+ int32_t xpos;
+ int32_t ypos;
+ int32_t xhot;
+ int32_t yhot;
};
/*************************************************************************/
@@ -540,8 +575,8 @@ struct drm_vmw_cursor_bypass_arg {
*/
struct drm_vmw_stream_arg {
- __u32 stream_id;
- __u32 pad64;
+ uint32_t stream_id;
+ uint32_t pad64;
};
/*************************************************************************/
@@ -554,537 +589,26 @@ struct drm_vmw_stream_arg {
/*************************************************************************/
/**
- * DRM_VMW_GET_3D_CAP
- *
- * Read 3D capabilities from the FIFO
- *
- */
-
-/**
- * struct drm_vmw_get_3d_cap_arg
- *
- * @buffer: Pointer to a buffer for capability data, cast to an __u64
- * @size: Max size to copy
- *
- * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
- * ioctls.
- */
-
-struct drm_vmw_get_3d_cap_arg {
- __u64 buffer;
- __u32 max_size;
- __u32 pad64;
-};
-
-/*************************************************************************/
-/**
- * DRM_VMW_FENCE_WAIT
- *
- * Waits for a fence object to signal. The wait is interruptible, so that
- * signals may be delivered during the interrupt. The wait may timeout,
- * in which case the calls returns -EBUSY. If the wait is restarted,
- * that is restarting without resetting @cookie_valid to zero,
- * the timeout is computed from the first call.
- *
- * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait
- * on:
- * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command
- * stream
- * have executed.
- * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish
- * commands
- * in the buffer given to the EXECBUF ioctl returning the fence object handle
- * are available to user-space.
- *
- * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the
- * fenc wait ioctl returns 0, the fence object has been unreferenced after
- * the wait.
- */
-
-#define DRM_VMW_FENCE_FLAG_EXEC (1 << 0)
-#define DRM_VMW_FENCE_FLAG_QUERY (1 << 1)
-
-#define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
-
-/**
- * struct drm_vmw_fence_wait_arg
- *
- * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
- * @cookie_valid: Must be reset to 0 on first call. Left alone on restart.
- * @kernel_cookie: Set to 0 on first call. Left alone on restart.
- * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout.
- * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick
- * before returning.
- * @flags: Fence flags to wait on.
- * @wait_options: Options that control the behaviour of the wait ioctl.
- *
- * Input argument to the DRM_VMW_FENCE_WAIT ioctl.
- */
-
-struct drm_vmw_fence_wait_arg {
- __u32 handle;
- __s32 cookie_valid;
- __u64 kernel_cookie;
- __u64 timeout_us;
- __s32 lazy;
- __s32 flags;
- __s32 wait_options;
- __s32 pad64;
-};
-
-/*************************************************************************/
-/**
- * DRM_VMW_FENCE_SIGNALED
- *
- * Checks if a fence object is signaled..
- */
-
-/**
- * struct drm_vmw_fence_signaled_arg
- *
- * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
- * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl
- * @signaled: Out: Flags signaled.
- * @sequence: Out: Highest sequence passed so far. Can be used to signal the
- * EXEC flag of user-space fence objects.
- *
- * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF
- * ioctls.
- */
-
-struct drm_vmw_fence_signaled_arg {
- __u32 handle;
- __u32 flags;
- __s32 signaled;
- __u32 passed_seqno;
- __u32 signaled_flags;
- __u32 pad64;
-};
-
-/*************************************************************************/
-/**
- * DRM_VMW_FENCE_UNREF
- *
- * Unreferences a fence object, and causes it to be destroyed if there are no
- * other references to it.
- *
- */
-
-/**
- * struct drm_vmw_fence_arg
- *
- * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
- *
- * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl..
- */
-
-struct drm_vmw_fence_arg {
- __u32 handle;
- __u32 pad64;
-};
-
-
-/*************************************************************************/
-/**
- * DRM_VMW_FENCE_EVENT
- *
- * Queues an event on a fence to be delivered on the drm character device
- * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag.
- * Optionally the approximate time when the fence signaled is
- * given by the event.
- */
-
-/*
- * The event type
- */
-#define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
-
-struct drm_vmw_event_fence {
- struct drm_event base;
- __u64 user_data;
- __u32 tv_sec;
- __u32 tv_usec;
-};
-
-/*
- * Flags that may be given to the command.
- */
-/* Request fence signaled time on the event. */
-#define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
-
-/**
- * struct drm_vmw_fence_event_arg
- *
- * @fence_rep: Pointer to fence_rep structure cast to __u64 or 0 if
- * the fence is not supposed to be referenced by user-space.
- * @user_info: Info to be delivered with the event.
- * @handle: Attach the event to this fence only.
- * @flags: A set of flags as defined above.
- */
-struct drm_vmw_fence_event_arg {
- __u64 fence_rep;
- __u64 user_data;
- __u32 handle;
- __u32 flags;
-};
-
-
-/*************************************************************************/
-/**
- * DRM_VMW_PRESENT
- *
- * Executes an SVGA present on a given fb for a given surface. The surface
- * is placed on the framebuffer. Cliprects are given relative to the given
- * point (the point disignated by dest_{x|y}).
- *
- */
-
-/**
- * struct drm_vmw_present_arg
- * @fb_id: framebuffer id to present / read back from.
- * @sid: Surface id to present from.
- * @dest_x: X placement coordinate for surface.
- * @dest_y: Y placement coordinate for surface.
- * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
- * @num_clips: Number of cliprects given relative to the framebuffer origin,
- * in the same coordinate space as the frame buffer.
- * @pad64: Unused 64-bit padding.
- *
- * Input argument to the DRM_VMW_PRESENT ioctl.
- */
-
-struct drm_vmw_present_arg {
- __u32 fb_id;
- __u32 sid;
- __s32 dest_x;
- __s32 dest_y;
- __u64 clips_ptr;
- __u32 num_clips;
- __u32 pad64;
-};
-
-
-/*************************************************************************/
-/**
- * DRM_VMW_PRESENT_READBACK
- *
- * Executes an SVGA present readback from a given fb to the dma buffer
- * currently bound as the fb. If there is no dma buffer bound to the fb,
- * an error will be returned.
- *
- */
-
-/**
- * struct drm_vmw_present_arg
- * @fb_id: fb_id to present / read back from.
- * @num_clips: Number of cliprects.
- * @clips_ptr: Pointer to an array of clip rects cast to an __u64.
- * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an __u64.
- * If this member is NULL, then the ioctl should not return a fence.
- */
-
-struct drm_vmw_present_readback_arg {
- __u32 fb_id;
- __u32 num_clips;
- __u64 clips_ptr;
- __u64 fence_rep;
-};
-
-/*************************************************************************/
-/**
* DRM_VMW_UPDATE_LAYOUT - Update layout
*
- * Updates the preferred modes and connection status for connectors. The
- * command consists of one drm_vmw_update_layout_arg pointing to an array
+ * Updates the prefered modes and connection status for connectors. The
+ * command conisits of one drm_vmw_update_layout_arg pointing out a array
* of num_outputs drm_vmw_rect's.
*/
/**
* struct drm_vmw_update_layout_arg
*
- * @num_outputs: number of active connectors
- * @rects: pointer to array of drm_vmw_rect cast to an __u64
+ * @num_outputs: number of active
+ * @rects: pointer to array of drm_vmw_rect
*
* Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
*/
-struct drm_vmw_update_layout_arg {
- __u32 num_outputs;
- __u32 pad64;
- __u64 rects;
-};
-
-
-/*************************************************************************/
-/**
- * DRM_VMW_CREATE_SHADER - Create shader
- *
- * Creates a shader and optionally binds it to a dma buffer containing
- * the shader byte-code.
- */
-
-/**
- * enum drm_vmw_shader_type - Shader types
- */
-enum drm_vmw_shader_type {
- drm_vmw_shader_type_vs = 0,
- drm_vmw_shader_type_ps,
-};
-
-
-/**
- * struct drm_vmw_shader_create_arg
- *
- * @shader_type: Shader type of the shader to create.
- * @size: Size of the byte-code in bytes.
- * where the shader byte-code starts
- * @buffer_handle: Buffer handle identifying the buffer containing the
- * shader byte-code
- * @shader_handle: On successful completion contains a handle that
- * can be used to subsequently identify the shader.
- * @offset: Offset in bytes into the buffer given by @buffer_handle,
- *
- * Input / Output argument to the DRM_VMW_CREATE_SHADER Ioctl.
- */
-struct drm_vmw_shader_create_arg {
- enum drm_vmw_shader_type shader_type;
- __u32 size;
- __u32 buffer_handle;
- __u32 shader_handle;
- __u64 offset;
-};
-
-/*************************************************************************/
-/**
- * DRM_VMW_UNREF_SHADER - Unreferences a shader
- *
- * Destroys a user-space reference to a shader, optionally destroying
- * it.
- */
-
-/**
- * struct drm_vmw_shader_arg
- *
- * @handle: Handle identifying the shader to destroy.
- *
- * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
- */
-struct drm_vmw_shader_arg {
- __u32 handle;
- __u32 pad64;
-};
-
-/*************************************************************************/
-/**
- * DRM_VMW_GB_SURFACE_CREATE - Create a host guest-backed surface.
- *
- * Allocates a surface handle and queues a create surface command
- * for the host on the first use of the surface. The surface ID can
- * be used as the surface ID in commands referencing the surface.
- */
-
-/**
- * enum drm_vmw_surface_flags
- *
- * @drm_vmw_surface_flag_shareable: Whether the surface is shareable
- * @drm_vmw_surface_flag_scanout: Whether the surface is a scanout
- * surface.
- * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
- * given.
- */
-enum drm_vmw_surface_flags {
- drm_vmw_surface_flag_shareable = (1 << 0),
- drm_vmw_surface_flag_scanout = (1 << 1),
- drm_vmw_surface_flag_create_buffer = (1 << 2)
-};
-
-/**
- * struct drm_vmw_gb_surface_create_req
- *
- * @svga3d_flags: SVGA3d surface flags for the device.
- * @format: SVGA3d format.
- * @mip_level: Number of mip levels for all faces.
- * @drm_surface_flags Flags as described above.
- * @multisample_count Future use. Set to 0.
- * @autogen_filter Future use. Set to 0.
- * @buffer_handle Buffer handle of backup buffer. SVGA3D_INVALID_ID
- * if none.
- * @base_size Size of the base mip level for all faces.
- * @array_size Must be zero for non-DX hardware, and if non-zero
- * svga3d_flags must have proper bind flags setup.
- *
- * Input argument to the DRM_VMW_GB_SURFACE_CREATE Ioctl.
- * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
- */
-struct drm_vmw_gb_surface_create_req {
- __u32 svga3d_flags;
- __u32 format;
- __u32 mip_levels;
- enum drm_vmw_surface_flags drm_surface_flags;
- __u32 multisample_count;
- __u32 autogen_filter;
- __u32 buffer_handle;
- __u32 array_size;
- struct drm_vmw_size base_size;
-};
-
-/**
- * struct drm_vmw_gb_surface_create_rep
- *
- * @handle: Surface handle.
- * @backup_size: Size of backup buffers for this surface.
- * @buffer_handle: Handle of backup buffer. SVGA3D_INVALID_ID if none.
- * @buffer_size: Actual size of the buffer identified by
- * @buffer_handle
- * @buffer_map_handle: Offset into device address space for the buffer
- * identified by @buffer_handle.
- *
- * Part of output argument for the DRM_VMW_GB_SURFACE_REF ioctl.
- * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
- */
-struct drm_vmw_gb_surface_create_rep {
- __u32 handle;
- __u32 backup_size;
- __u32 buffer_handle;
- __u32 buffer_size;
- __u64 buffer_map_handle;
-};
-/**
- * union drm_vmw_gb_surface_create_arg
- *
- * @req: Input argument as described above.
- * @rep: Output argument as described above.
- *
- * Argument to the DRM_VMW_GB_SURFACE_CREATE ioctl.
- */
-union drm_vmw_gb_surface_create_arg {
- struct drm_vmw_gb_surface_create_rep rep;
- struct drm_vmw_gb_surface_create_req req;
-};
-
-/*************************************************************************/
-/**
- * DRM_VMW_GB_SURFACE_REF - Reference a host surface.
- *
- * Puts a reference on a host surface with a given handle, as previously
- * returned by the DRM_VMW_GB_SURFACE_CREATE ioctl.
- * A reference will make sure the surface isn't destroyed while we hold
- * it and will allow the calling client to use the surface handle in
- * the command stream.
- *
- * On successful return, the Ioctl returns the surface information given
- * to and returned from the DRM_VMW_GB_SURFACE_CREATE ioctl.
- */
-
-/**
- * struct drm_vmw_gb_surface_reference_arg
- *
- * @creq: The data used as input when the surface was created, as described
- * above at "struct drm_vmw_gb_surface_create_req"
- * @crep: Additional data output when the surface was created, as described
- * above at "struct drm_vmw_gb_surface_create_rep"
- *
- * Output Argument to the DRM_VMW_GB_SURFACE_REF ioctl.
- */
-struct drm_vmw_gb_surface_ref_rep {
- struct drm_vmw_gb_surface_create_req creq;
- struct drm_vmw_gb_surface_create_rep crep;
-};
-
-/**
- * union drm_vmw_gb_surface_reference_arg
- *
- * @req: Input data as described above at "struct drm_vmw_surface_arg"
- * @rep: Output data as described above at "struct drm_vmw_gb_surface_ref_rep"
- *
- * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
- */
-union drm_vmw_gb_surface_reference_arg {
- struct drm_vmw_gb_surface_ref_rep rep;
- struct drm_vmw_surface_arg req;
-};
-
-
-/*************************************************************************/
-/**
- * DRM_VMW_SYNCCPU - Sync a DMA buffer / MOB for CPU access.
- *
- * Idles any previously submitted GPU operations on the buffer and
- * by default blocks command submissions that reference the buffer.
- * If the file descriptor used to grab a blocking CPU sync is closed, the
- * cpu sync is released.
- * The flags argument indicates how the grab / release operation should be
- * performed:
- */
-
-/**
- * enum drm_vmw_synccpu_flags - Synccpu flags:
- *
- * @drm_vmw_synccpu_read: Sync for read. If sync is done for read only, it's a
- * hint to the kernel to allow command submissions that references the buffer
- * for read-only.
- * @drm_vmw_synccpu_write: Sync for write. Block all command submissions
- * referencing this buffer.
- * @drm_vmw_synccpu_dontblock: Dont wait for GPU idle, but rather return
- * -EBUSY should the buffer be busy.
- * @drm_vmw_synccpu_allow_cs: Allow command submission that touches the buffer
- * while the buffer is synced for CPU. This is similar to the GEM bo idle
- * behavior.
- */
-enum drm_vmw_synccpu_flags {
- drm_vmw_synccpu_read = (1 << 0),
- drm_vmw_synccpu_write = (1 << 1),
- drm_vmw_synccpu_dontblock = (1 << 2),
- drm_vmw_synccpu_allow_cs = (1 << 3)
-};
-
-/**
- * enum drm_vmw_synccpu_op - Synccpu operations:
- *
- * @drm_vmw_synccpu_grab: Grab the buffer for CPU operations
- * @drm_vmw_synccpu_release: Release a previous grab.
- */
-enum drm_vmw_synccpu_op {
- drm_vmw_synccpu_grab,
- drm_vmw_synccpu_release
-};
-
-/**
- * struct drm_vmw_synccpu_arg
- *
- * @op: The synccpu operation as described above.
- * @handle: Handle identifying the buffer object.
- * @flags: Flags as described above.
- */
-struct drm_vmw_synccpu_arg {
- enum drm_vmw_synccpu_op op;
- enum drm_vmw_synccpu_flags flags;
- __u32 handle;
- __u32 pad64;
-};
-
-/*************************************************************************/
-/**
- * DRM_VMW_CREATE_EXTENDED_CONTEXT - Create a host context.
- *
- * Allocates a device unique context id, and queues a create context command
- * for the host. Does not wait for host completion.
- */
-enum drm_vmw_extended_context {
- drm_vmw_context_legacy,
- drm_vmw_context_dx
+struct drm_vmw_update_layout_arg {
+ uint32_t num_outputs;
+ uint32_t pad64;
+ uint64_t rects;
};
-/**
- * union drm_vmw_extended_context_arg
- *
- * @req: Context type.
- * @rep: Context identifier.
- *
- * Argument to the DRM_VMW_CREATE_EXTENDED_CONTEXT Ioctl.
- */
-union drm_vmw_extended_context_arg {
- enum drm_vmw_extended_context req;
- struct drm_vmw_context_arg rep;
-};
#endif
diff --git a/chromium/third_party/libdrm/src/intel/Android.mk b/chromium/third_party/libdrm/src/intel/Android.mk
index 838a93b3b7f..6582dfdee08 100644
--- a/chromium/third_party/libdrm/src/intel/Android.mk
+++ b/chromium/third_party/libdrm/src/intel/Android.mk
@@ -30,7 +30,7 @@ include $(LOCAL_PATH)/Makefile.sources
LOCAL_MODULE := libdrm_intel
LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_INTEL_FILES))
+LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
diff --git a/chromium/third_party/libdrm/src/intel/Makefile.am b/chromium/third_party/libdrm/src/intel/Makefile.am
index c52e8c086a8..d004568450e 100644
--- a/chromium/third_party/libdrm/src/intel/Makefile.am
+++ b/chromium/third_party/libdrm/src/intel/Makefile.am
@@ -66,6 +66,7 @@ EXTRA_DIST = \
$(BATCHES:.batch=.batch-ref.txt) \
$(BATCHES:.batch=.batch-ref.txt) \
tests/test-batch.sh \
+ Android.mk \
$(TESTS)
test_decode_LDADD = libdrm_intel.la ../libdrm.la
diff --git a/chromium/third_party/libdrm/src/intel/intel-symbol-check b/chromium/third_party/libdrm/src/intel/intel-symbol-check
index bde7634c321..c555e6daea8 100755
--- a/chromium/third_party/libdrm/src/intel/intel-symbol-check
+++ b/chromium/third_party/libdrm/src/intel/intel-symbol-check
@@ -34,13 +34,11 @@ drm_intel_bo_mrb_exec
drm_intel_bo_pin
drm_intel_bo_reference
drm_intel_bo_references
-drm_intel_bo_set_softpin_offset
drm_intel_bo_set_tiling
drm_intel_bo_subdata
drm_intel_bo_unmap
drm_intel_bo_unpin
drm_intel_bo_unreference
-drm_intel_bo_use_48b_address_range
drm_intel_bo_wait_rendering
drm_intel_bufmgr_check_aperture_space
drm_intel_bufmgr_destroy
diff --git a/chromium/third_party/libdrm/src/intel/intel_bufmgr.c b/chromium/third_party/libdrm/src/intel/intel_bufmgr.c
index a285340039f..14ea9f9fa4b 100644
--- a/chromium/third_party/libdrm/src/intel/intel_bufmgr.c
+++ b/chromium/third_party/libdrm/src/intel/intel_bufmgr.c
@@ -261,15 +261,6 @@ drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
}
int
-drm_intel_bo_set_softpin_offset(drm_intel_bo *bo, uint64_t offset)
-{
- if (bo->bufmgr->bo_set_softpin_offset)
- return bo->bufmgr->bo_set_softpin_offset(bo, offset);
-
- return -ENODEV;
-}
-
-int
drm_intel_bo_disable_reuse(drm_intel_bo *bo)
{
if (bo->bufmgr->bo_disable_reuse)
@@ -302,17 +293,6 @@ drm_intel_bo_madvise(drm_intel_bo *bo, int madv)
}
int
-drm_intel_bo_use_48b_address_range(drm_intel_bo *bo, uint32_t enable)
-{
- if (bo->bufmgr->bo_use_48b_address_range) {
- bo->bufmgr->bo_use_48b_address_range(bo, enable);
- return 0;
- }
-
- return -ENODEV;
-}
-
-int
drm_intel_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo)
{
return bo->bufmgr->bo_references(bo, target_bo);
diff --git a/chromium/third_party/libdrm/src/intel/intel_bufmgr.h b/chromium/third_party/libdrm/src/intel/intel_bufmgr.h
index a1abbcd2b06..95eecb8002c 100644
--- a/chromium/third_party/libdrm/src/intel/intel_bufmgr.h
+++ b/chromium/third_party/libdrm/src/intel/intel_bufmgr.h
@@ -164,8 +164,6 @@ int drm_intel_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
int drm_intel_bo_flink(drm_intel_bo *bo, uint32_t * name);
int drm_intel_bo_busy(drm_intel_bo *bo);
int drm_intel_bo_madvise(drm_intel_bo *bo, int madv);
-int drm_intel_bo_use_48b_address_range(drm_intel_bo *bo, uint32_t enable);
-int drm_intel_bo_set_softpin_offset(drm_intel_bo *bo, uint64_t offset);
int drm_intel_bo_disable_reuse(drm_intel_bo *bo);
int drm_intel_bo_is_reusable(drm_intel_bo *bo);
diff --git a/chromium/third_party/libdrm/src/intel/intel_bufmgr_fake.c b/chromium/third_party/libdrm/src/intel/intel_bufmgr_fake.c
index 24b3732aa14..551e05deef2 100644
--- a/chromium/third_party/libdrm/src/intel/intel_bufmgr_fake.c
+++ b/chromium/third_party/libdrm/src/intel/intel_bufmgr_fake.c
@@ -42,7 +42,6 @@
#include <string.h>
#include <assert.h>
#include <errno.h>
-#include <strings.h>
#include <xf86drm.h>
#include <pthread.h>
#include "intel_bufmgr.h"
@@ -312,7 +311,7 @@ _fence_wait_internal(drm_intel_bufmgr_fake *bufmgr_fake, int seq)
*
* Assume that in userland we treat sequence numbers as ints, which
* makes some of the comparisons convenient, since the sequence
- * numbers are all positive signed integers.
+ * numbers are all postive signed integers.
*
* From this we get several cases we need to handle. Here's a timeline.
* 0x2 0x7 0x7ffffff8 0x7ffffffd
diff --git a/chromium/third_party/libdrm/src/intel/intel_bufmgr_gem.c b/chromium/third_party/libdrm/src/intel/intel_bufmgr_gem.c
index 0a4012beec5..63122d099b7 100644
--- a/chromium/third_party/libdrm/src/intel/intel_bufmgr_gem.c
+++ b/chromium/third_party/libdrm/src/intel/intel_bufmgr_gem.c
@@ -83,22 +83,6 @@
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#define MAX2(A, B) ((A) > (B) ? (A) : (B))
-/**
- * upper_32_bits - return bits 32-63 of a number
- * @n: the number we're accessing
- *
- * A basic shift-right of a 64- or 32-bit quantity. Use this to suppress
- * the "right shift count >= width of type" warning when that quantity is
- * 32-bits.
- */
-#define upper_32_bits(n) ((__u32)(((n) >> 16) >> 16))
-
-/**
- * lower_32_bits - return bits 0-31 of a number
- * @n: the number we're accessing
- */
-#define lower_32_bits(n) ((__u32)(n))
-
typedef struct _drm_intel_bo_gem drm_intel_bo_gem;
struct drm_intel_gem_bo_bucket {
@@ -200,13 +184,6 @@ struct _drm_intel_bo_gem {
drm_intel_reloc_target *reloc_target_info;
/** Number of entries in relocs */
int reloc_count;
- /** Array of BOs that are referenced by this buffer and will be softpinned */
- drm_intel_bo **softpin_target;
- /** Number softpinned BOs that are referenced by this buffer */
- int softpin_target_count;
- /** Maximum amount of softpinned BOs that are referenced by this buffer */
- int softpin_target_size;
-
/** Mapped address for the buffer, saved across map/unmap cycles */
void *mem_virtual;
/** GTT virtual address for the buffer, saved across map/unmap cycles */
@@ -260,20 +237,6 @@ struct _drm_intel_bo_gem {
bool is_userptr;
/**
- * Boolean of whether this buffer can be placed in the full 48-bit
- * address range on gen8+.
- *
- * By default, buffers will be keep in a 32-bit range, unless this
- * flag is explicitly set.
- */
- bool use_48b_address_range;
-
- /**
- * Whether this buffer is softpinned at offset specified by the user
- */
- bool is_softpin;
-
- /**
* Size in bytes of this buffer and its relocation descendents.
*
* Used to avoid costly tree walking in
@@ -426,9 +389,8 @@ drm_intel_gem_dump_validation_list(drm_intel_bufmgr_gem *bufmgr_gem)
drm_intel_bo *bo = bufmgr_gem->exec_bos[i];
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
- if (bo_gem->relocs == NULL && bo_gem->softpin_target == NULL) {
- DBG("%2d: %d %s(%s)\n", i, bo_gem->gem_handle,
- bo_gem->is_softpin ? "*" : "",
+ if (bo_gem->relocs == NULL) {
+ DBG("%2d: %d (%s)\n", i, bo_gem->gem_handle,
bo_gem->name);
continue;
}
@@ -438,36 +400,16 @@ drm_intel_gem_dump_validation_list(drm_intel_bufmgr_gem *bufmgr_gem)
drm_intel_bo_gem *target_gem =
(drm_intel_bo_gem *) target_bo;
- DBG("%2d: %d %s(%s)@0x%08x %08x -> "
- "%d (%s)@0x%08x %08x + 0x%08x\n",
+ DBG("%2d: %d (%s)@0x%08llx -> "
+ "%d (%s)@0x%08lx + 0x%08x\n",
i,
- bo_gem->gem_handle,
- bo_gem->is_softpin ? "*" : "",
- bo_gem->name,
- upper_32_bits(bo_gem->relocs[j].offset),
- lower_32_bits(bo_gem->relocs[j].offset),
+ bo_gem->gem_handle, bo_gem->name,
+ (unsigned long long)bo_gem->relocs[j].offset,
target_gem->gem_handle,
target_gem->name,
- upper_32_bits(target_bo->offset64),
- lower_32_bits(target_bo->offset64),
+ target_bo->offset64,
bo_gem->relocs[j].delta);
}
-
- for (j = 0; j < bo_gem->softpin_target_count; j++) {
- drm_intel_bo *target_bo = bo_gem->softpin_target[j];
- drm_intel_bo_gem *target_gem =
- (drm_intel_bo_gem *) target_bo;
- DBG("%2d: %d %s(%s) -> "
- "%d *(%s)@0x%08x %08x\n",
- i,
- bo_gem->gem_handle,
- bo_gem->is_softpin ? "*" : "",
- bo_gem->name,
- target_gem->gem_handle,
- target_gem->name,
- upper_32_bits(target_bo->offset64),
- lower_32_bits(target_bo->offset64));
- }
}
}
@@ -531,17 +473,11 @@ drm_intel_add_validate_buffer2(drm_intel_bo *bo, int need_fence)
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr;
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo;
int index;
- int flags = 0;
-
- if (need_fence)
- flags |= EXEC_OBJECT_NEEDS_FENCE;
- if (bo_gem->use_48b_address_range)
- flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
- if (bo_gem->is_softpin)
- flags |= EXEC_OBJECT_PINNED;
if (bo_gem->validate_index != -1) {
- bufmgr_gem->exec2_objects[bo_gem->validate_index].flags |= flags;
+ if (need_fence)
+ bufmgr_gem->exec2_objects[bo_gem->validate_index].flags |=
+ EXEC_OBJECT_NEEDS_FENCE;
return;
}
@@ -568,12 +504,15 @@ drm_intel_add_validate_buffer2(drm_intel_bo *bo, int need_fence)
bufmgr_gem->exec2_objects[index].relocation_count = bo_gem->reloc_count;
bufmgr_gem->exec2_objects[index].relocs_ptr = (uintptr_t)bo_gem->relocs;
bufmgr_gem->exec2_objects[index].alignment = bo->align;
- bufmgr_gem->exec2_objects[index].offset = bo_gem->is_softpin ?
- bo->offset64 : 0;
+ bufmgr_gem->exec2_objects[index].offset = 0;
bufmgr_gem->exec_bos[index] = bo;
- bufmgr_gem->exec2_objects[index].flags = flags;
+ bufmgr_gem->exec2_objects[index].flags = 0;
bufmgr_gem->exec2_objects[index].rsvd1 = 0;
bufmgr_gem->exec2_objects[index].rsvd2 = 0;
+ if (need_fence) {
+ bufmgr_gem->exec2_objects[index].flags |=
+ EXEC_OBJECT_NEEDS_FENCE;
+ }
bufmgr_gem->exec_count++;
}
@@ -846,7 +785,6 @@ retry:
bo_gem->used_as_reloc_target = false;
bo_gem->has_error = false;
bo_gem->reusable = true;
- bo_gem->use_48b_address_range = false;
drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem, alignment);
@@ -993,7 +931,6 @@ drm_intel_gem_bo_alloc_userptr(drm_intel_bufmgr *bufmgr,
bo_gem->used_as_reloc_target = false;
bo_gem->has_error = false;
bo_gem->reusable = false;
- bo_gem->use_48b_address_range = false;
drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem, 0);
@@ -1149,7 +1086,6 @@ drm_intel_bo_gem_create_from_name(drm_intel_bufmgr *bufmgr,
bo_gem->bo.handle = open_arg.handle;
bo_gem->global_name = handle;
bo_gem->reusable = false;
- bo_gem->use_48b_address_range = false;
memclear(get_tiling);
get_tiling.handle = bo_gem->gem_handle;
@@ -1325,12 +1261,8 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time)
time);
}
}
- for (i = 0; i < bo_gem->softpin_target_count; i++)
- drm_intel_gem_bo_unreference_locked_timed(bo_gem->softpin_target[i],
- time);
bo_gem->reloc_count = 0;
bo_gem->used_as_reloc_target = false;
- bo_gem->softpin_target_count = 0;
DBG("bo_unreference final: %d (%s)\n",
bo_gem->gem_handle, bo_gem->name);
@@ -1344,11 +1276,6 @@ drm_intel_gem_bo_unreference_final(drm_intel_bo *bo, time_t time)
free(bo_gem->relocs);
bo_gem->relocs = NULL;
}
- if (bo_gem->softpin_target) {
- free(bo_gem->softpin_target);
- bo_gem->softpin_target = NULL;
- bo_gem->softpin_target_size = 0;
- }
/* Clear any left-over mappings */
if (bo_gem->map_count) {
@@ -1986,6 +1913,14 @@ do_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset,
bo_gem->reloc_tree_fences += target_bo_gem->reloc_tree_fences;
}
+ bo_gem->relocs[bo_gem->reloc_count].offset = offset;
+ bo_gem->relocs[bo_gem->reloc_count].delta = target_offset;
+ bo_gem->relocs[bo_gem->reloc_count].target_handle =
+ target_bo_gem->gem_handle;
+ bo_gem->relocs[bo_gem->reloc_count].read_domains = read_domains;
+ bo_gem->relocs[bo_gem->reloc_count].write_domain = write_domain;
+ bo_gem->relocs[bo_gem->reloc_count].presumed_offset = target_bo->offset64;
+
bo_gem->reloc_target_info[bo_gem->reloc_count].bo = target_bo;
if (target_bo != bo)
drm_intel_gem_bo_reference(target_bo);
@@ -1995,77 +1930,21 @@ do_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset,
else
bo_gem->reloc_target_info[bo_gem->reloc_count].flags = 0;
- bo_gem->relocs[bo_gem->reloc_count].offset = offset;
- bo_gem->relocs[bo_gem->reloc_count].delta = target_offset;
- bo_gem->relocs[bo_gem->reloc_count].target_handle =
- target_bo_gem->gem_handle;
- bo_gem->relocs[bo_gem->reloc_count].read_domains = read_domains;
- bo_gem->relocs[bo_gem->reloc_count].write_domain = write_domain;
- bo_gem->relocs[bo_gem->reloc_count].presumed_offset = target_bo->offset64;
bo_gem->reloc_count++;
return 0;
}
-static void
-drm_intel_gem_bo_use_48b_address_range(drm_intel_bo *bo, uint32_t enable)
-{
- drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
- bo_gem->use_48b_address_range = enable;
-}
-
-static int
-drm_intel_gem_bo_add_softpin_target(drm_intel_bo *bo, drm_intel_bo *target_bo)
-{
- drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
- drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
- drm_intel_bo_gem *target_bo_gem = (drm_intel_bo_gem *) target_bo;
- if (bo_gem->has_error)
- return -ENOMEM;
-
- if (target_bo_gem->has_error) {
- bo_gem->has_error = true;
- return -ENOMEM;
- }
-
- if (!target_bo_gem->is_softpin)
- return -EINVAL;
- if (target_bo_gem == bo_gem)
- return -EINVAL;
-
- if (bo_gem->softpin_target_count == bo_gem->softpin_target_size) {
- int new_size = bo_gem->softpin_target_size * 2;
- if (new_size == 0)
- new_size = bufmgr_gem->max_relocs;
-
- bo_gem->softpin_target = realloc(bo_gem->softpin_target, new_size *
- sizeof(drm_intel_bo *));
- if (!bo_gem->softpin_target)
- return -ENOMEM;
-
- bo_gem->softpin_target_size = new_size;
- }
- bo_gem->softpin_target[bo_gem->softpin_target_count] = target_bo;
- drm_intel_gem_bo_reference(target_bo);
- bo_gem->softpin_target_count++;
-
- return 0;
-}
-
static int
drm_intel_gem_bo_emit_reloc(drm_intel_bo *bo, uint32_t offset,
drm_intel_bo *target_bo, uint32_t target_offset,
uint32_t read_domains, uint32_t write_domain)
{
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr;
- drm_intel_bo_gem *target_bo_gem = (drm_intel_bo_gem *)target_bo;
- if (target_bo_gem->is_softpin)
- return drm_intel_gem_bo_add_softpin_target(bo, target_bo);
- else
- return do_bo_emit_reloc(bo, offset, target_bo, target_offset,
- read_domains, write_domain,
- !bufmgr_gem->fenced_relocs);
+ return do_bo_emit_reloc(bo, offset, target_bo, target_offset,
+ read_domains, write_domain,
+ !bufmgr_gem->fenced_relocs);
}
static int
@@ -2098,8 +1977,6 @@ drm_intel_gem_bo_get_reloc_count(drm_intel_bo *bo)
*
* Any further drm_intel_bufmgr_check_aperture_space() queries
* involving this buffer in the tree are undefined after this call.
- *
- * This also removes all softpinned targets being referenced by the BO.
*/
void
drm_intel_gem_bo_clear_relocs(drm_intel_bo *bo, int start)
@@ -2126,12 +2003,6 @@ drm_intel_gem_bo_clear_relocs(drm_intel_bo *bo, int start)
}
bo_gem->reloc_count = start;
- for (i = 0; i < bo_gem->softpin_target_count; i++) {
- drm_intel_bo_gem *target_bo_gem = (drm_intel_bo_gem *) bo_gem->softpin_target[i];
- drm_intel_gem_bo_unreference_locked_timed(&target_bo_gem->bo, time.tv_sec);
- }
- bo_gem->softpin_target_count = 0;
-
pthread_mutex_unlock(&bufmgr_gem->lock);
}
@@ -2172,7 +2043,7 @@ drm_intel_gem_bo_process_reloc2(drm_intel_bo *bo)
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo;
int i;
- if (bo_gem->relocs == NULL && bo_gem->softpin_target == NULL)
+ if (bo_gem->relocs == NULL)
return;
for (i = 0; i < bo_gem->reloc_count; i++) {
@@ -2193,17 +2064,6 @@ drm_intel_gem_bo_process_reloc2(drm_intel_bo *bo)
/* Add the target to the validate list */
drm_intel_add_validate_buffer2(target_bo, need_fence);
}
-
- for (i = 0; i < bo_gem->softpin_target_count; i++) {
- drm_intel_bo *target_bo = bo_gem->softpin_target[i];
-
- if (target_bo == bo)
- continue;
-
- drm_intel_gem_bo_mark_mmaps_incoherent(bo);
- drm_intel_gem_bo_process_reloc2(target_bo);
- drm_intel_add_validate_buffer2(target_bo, false);
- }
}
@@ -2218,12 +2078,10 @@ drm_intel_update_buffer_offsets(drm_intel_bufmgr_gem *bufmgr_gem)
/* Update the buffer offset */
if (bufmgr_gem->exec_objects[i].offset != bo->offset64) {
- DBG("BO %d (%s) migrated: 0x%08x %08x -> 0x%08x %08x\n",
- bo_gem->gem_handle, bo_gem->name,
- upper_32_bits(bo->offset64),
- lower_32_bits(bo->offset64),
- upper_32_bits(bufmgr_gem->exec_objects[i].offset),
- lower_32_bits(bufmgr_gem->exec_objects[i].offset));
+ DBG("BO %d (%s) migrated: 0x%08lx -> 0x%08llx\n",
+ bo_gem->gem_handle, bo_gem->name, bo->offset64,
+ (unsigned long long)bufmgr_gem->exec_objects[i].
+ offset);
bo->offset64 = bufmgr_gem->exec_objects[i].offset;
bo->offset = bufmgr_gem->exec_objects[i].offset;
}
@@ -2241,16 +2099,9 @@ drm_intel_update_buffer_offsets2 (drm_intel_bufmgr_gem *bufmgr_gem)
/* Update the buffer offset */
if (bufmgr_gem->exec2_objects[i].offset != bo->offset64) {
- /* If we're seeing softpinned object here it means that the kernel
- * has relocated our object... Indicating a programming error
- */
- assert(!bo_gem->is_softpin);
- DBG("BO %d (%s) migrated: 0x%08x %08x -> 0x%08x %08x\n",
- bo_gem->gem_handle, bo_gem->name,
- upper_32_bits(bo->offset64),
- lower_32_bits(bo->offset64),
- upper_32_bits(bufmgr_gem->exec2_objects[i].offset),
- lower_32_bits(bufmgr_gem->exec2_objects[i].offset));
+ DBG("BO %d (%s) migrated: 0x%08lx -> 0x%08llx\n",
+ bo_gem->gem_handle, bo_gem->name, bo->offset64,
+ (unsigned long long)bufmgr_gem->exec2_objects[i].offset);
bo->offset64 = bufmgr_gem->exec2_objects[i].offset;
bo->offset = bufmgr_gem->exec2_objects[i].offset;
}
@@ -2572,17 +2423,6 @@ drm_intel_gem_bo_get_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
return 0;
}
-static int
-drm_intel_gem_bo_set_softpin_offset(drm_intel_bo *bo, uint64_t offset)
-{
- drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
-
- bo_gem->is_softpin = true;
- bo->offset64 = offset;
- bo->offset = offset;
- return 0;
-}
-
drm_intel_bo *
drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int size)
{
@@ -2646,7 +2486,6 @@ drm_intel_bo_gem_create_from_prime(drm_intel_bufmgr *bufmgr, int prime_fd, int s
bo_gem->used_as_reloc_target = false;
bo_gem->has_error = false;
bo_gem->reusable = false;
- bo_gem->use_48b_address_range = false;
DRMINITLISTHEAD(&bo_gem->vma_list);
DRMLISTADDTAIL(&bo_gem->name_list, &bufmgr_gem->named);
@@ -2962,13 +2801,6 @@ _drm_intel_gem_bo_references(drm_intel_bo *bo, drm_intel_bo *target_bo)
return 1;
}
- for (i = 0; i< bo_gem->softpin_target_count; i++) {
- if (bo_gem->softpin_target[i] == target_bo)
- return 1;
- if (_drm_intel_gem_bo_references(bo_gem->softpin_target[i], target_bo))
- return 1;
- }
-
return 0;
}
@@ -3379,7 +3211,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
bufmgr_gem->gtt_size > 256*1024*1024) {
/* The unmappable part of gtt on gen 3 (i.e. above 256MB) can't
* be used for tiled blits. To simplify the accounting, just
- * subtract the unmappable part (fixed to 256MB on all known
+ * substract the unmappable part (fixed to 256MB on all known
* gen3 devices) if the kernel advertises it. */
bufmgr_gem->gtt_size -= 256*1024*1024;
}
@@ -3425,11 +3257,6 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
bufmgr_gem->has_vebox = (ret == 0) & (*gp.value > 0);
- gp.param = I915_PARAM_HAS_EXEC_SOFTPIN;
- ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
- if (ret == 0 && *gp.value > 0)
- bufmgr_gem->bufmgr.bo_set_softpin_offset = drm_intel_gem_bo_set_softpin_offset;
-
if (bufmgr_gem->gen < 4) {
gp.param = I915_PARAM_NUM_FENCES_AVAIL;
gp.value = &bufmgr_gem->available_fences;
@@ -3456,13 +3283,6 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
}
}
- if (bufmgr_gem->gen >= 8) {
- gp.param = I915_PARAM_HAS_ALIASING_PPGTT;
- ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
- if (ret == 0 && *gp.value == 3)
- bufmgr_gem->bufmgr.bo_use_48b_address_range = drm_intel_gem_bo_use_48b_address_range;
- }
-
/* Let's go with one relocation per every 2 dwords (but round down a bit
* since a power of two will mean an extra page allocation for the reloc
* buffer).
diff --git a/chromium/third_party/libdrm/src/intel/intel_bufmgr_priv.h b/chromium/third_party/libdrm/src/intel/intel_bufmgr_priv.h
index 7e360a0b23d..59ebd18605c 100644
--- a/chromium/third_party/libdrm/src/intel/intel_bufmgr_priv.h
+++ b/chromium/third_party/libdrm/src/intel/intel_bufmgr_priv.h
@@ -152,20 +152,6 @@ struct _drm_intel_bufmgr {
void (*destroy) (drm_intel_bufmgr *bufmgr);
/**
- * Indicate if the buffer can be placed anywhere in the full ppgtt
- * address range (2^48).
- *
- * Any resource used with flat/heapless (0x00000000-0xfffff000)
- * General State Heap (GSH) or Intructions State Heap (ISH) must
- * be in a 32-bit range. 48-bit range will only be used when explicitly
- * requested.
- *
- * \param bo Buffer to set the use_48b_address_range flag.
- * \param enable The flag value.
- */
- void (*bo_use_48b_address_range) (drm_intel_bo *bo, uint32_t enable);
-
- /**
* Add relocation entry in reloc_buf, which will be updated with the
* target buffer's real offset on on command submission.
*
@@ -241,13 +227,6 @@ struct _drm_intel_bufmgr {
uint32_t * swizzle_mode);
/**
- * Set the offset at which this buffer will be softpinned
- * \param bo Buffer to set the softpin offset for
- * \param offset Softpin offset
- */
- int (*bo_set_softpin_offset) (drm_intel_bo *bo, uint64_t offset);
-
- /**
* Create a visible name for a buffer which can be used by other apps
*
* \param buf Buffer to create a name for
diff --git a/chromium/third_party/libdrm/src/intel/intel_chipset.h b/chromium/third_party/libdrm/src/intel/intel_chipset.h
index 514f6594a15..26fbee4db50 100644
--- a/chromium/third_party/libdrm/src/intel/intel_chipset.h
+++ b/chromium/third_party/libdrm/src/intel/intel_chipset.h
@@ -168,7 +168,6 @@
#define PCI_CHIP_SKYLAKE_DT_GT1 0x1902
#define PCI_CHIP_SKYLAKE_ULT_GT1 0x1906
#define PCI_CHIP_SKYLAKE_SRV_GT1 0x190A /* Reserved */
-#define PCI_CHIP_SKYLAKE_H_GT1 0x190B
#define PCI_CHIP_SKYLAKE_ULX_GT1 0x190E /* Reserved */
#define PCI_CHIP_SKYLAKE_DT_GT2 0x1912
#define PCI_CHIP_SKYLAKE_FUSED0_GT2 0x1913 /* Reserved */
@@ -180,43 +179,17 @@
#define PCI_CHIP_SKYLAKE_WKS_GT2 0x191D
#define PCI_CHIP_SKYLAKE_ULX_GT2 0x191E
#define PCI_CHIP_SKYLAKE_MOBILE_GT2 0x1921 /* Reserved */
-#define PCI_CHIP_SKYLAKE_ULT_GT3_0 0x1923
-#define PCI_CHIP_SKYLAKE_ULT_GT3_1 0x1926
-#define PCI_CHIP_SKYLAKE_ULT_GT3_2 0x1927
-#define PCI_CHIP_SKYLAKE_SRV_GT4 0x192A
+#define PCI_CHIP_SKYLAKE_GT3 0x1926
#define PCI_CHIP_SKYLAKE_HALO_GT3 0x192B /* Reserved */
-#define PCI_CHIP_SKYLAKE_SRV_GT3 0x192D
+#define PCI_CHIP_SKYLAKE_SRV_GT4 0x192A
#define PCI_CHIP_SKYLAKE_DT_GT4 0x1932
#define PCI_CHIP_SKYLAKE_SRV_GT4X 0x193A
#define PCI_CHIP_SKYLAKE_H_GT4 0x193B
#define PCI_CHIP_SKYLAKE_WKS_GT4 0x193D
-#define PCI_CHIP_KABYLAKE_ULT_GT2 0x5916
-#define PCI_CHIP_KABYLAKE_ULT_GT1_5 0x5913
-#define PCI_CHIP_KABYLAKE_ULT_GT1 0x5906
-#define PCI_CHIP_KABYLAKE_ULT_GT3_0 0x5923
-#define PCI_CHIP_KABYLAKE_ULT_GT3_1 0x5926
-#define PCI_CHIP_KABYLAKE_ULT_GT3_2 0x5927
-#define PCI_CHIP_KABYLAKE_ULT_GT2F 0x5921
-#define PCI_CHIP_KABYLAKE_ULX_GT1_5 0x5915
-#define PCI_CHIP_KABYLAKE_ULX_GT1 0x590E
-#define PCI_CHIP_KABYLAKE_ULX_GT2 0x591E
-#define PCI_CHIP_KABYLAKE_DT_GT2 0x5912
-#define PCI_CHIP_KABYLAKE_DT_GT1_5 0x5917
-#define PCI_CHIP_KABYLAKE_DT_GT1 0x5902
-#define PCI_CHIP_KABYLAKE_HALO_GT2 0x591B
-#define PCI_CHIP_KABYLAKE_HALO_GT4 0x593B
-#define PCI_CHIP_KABYLAKE_HALO_GT1_0 0x5908
-#define PCI_CHIP_KABYLAKE_HALO_GT1_1 0x590B
-#define PCI_CHIP_KABYLAKE_SRV_GT2 0x591A
-#define PCI_CHIP_KABYLAKE_SRV_GT1 0x590A
-#define PCI_CHIP_KABYLAKE_WKS_GT2 0x591D
-
#define PCI_CHIP_BROXTON_0 0x0A84
#define PCI_CHIP_BROXTON_1 0x1A84
#define PCI_CHIP_BROXTON_2 0x5A84
-#define PCI_CHIP_BROXTON_3 0x1A85
-#define PCI_CHIP_BROXTON_4 0x5A85
#define IS_MOBILE(devid) ((devid) == PCI_CHIP_I855_GM || \
(devid) == PCI_CHIP_I915_GM || \
@@ -377,11 +350,10 @@
#define IS_GEN8(devid) (IS_BROADWELL(devid) || \
IS_CHERRYVIEW(devid))
-#define IS_SKL_GT1(devid) ((devid) == PCI_CHIP_SKYLAKE_DT_GT1 || \
- (devid) == PCI_CHIP_SKYLAKE_ULT_GT1 || \
- (devid) == PCI_CHIP_SKYLAKE_SRV_GT1 || \
- (devid) == PCI_CHIP_SKYLAKE_H_GT1 || \
- (devid) == PCI_CHIP_SKYLAKE_ULX_GT1)
+#define IS_SKL_GT1(devid) ((devid) == PCI_CHIP_SKYLAKE_ULT_GT1 || \
+ (devid) == PCI_CHIP_SKYLAKE_ULX_GT1 || \
+ (devid) == PCI_CHIP_SKYLAKE_DT_GT1 || \
+ (devid) == PCI_CHIP_SKYLAKE_SRV_GT1)
#define IS_SKL_GT2(devid) ((devid) == PCI_CHIP_SKYLAKE_DT_GT2 || \
(devid) == PCI_CHIP_SKYLAKE_FUSED0_GT2 || \
@@ -394,11 +366,8 @@
(devid) == PCI_CHIP_SKYLAKE_ULX_GT2 || \
(devid) == PCI_CHIP_SKYLAKE_MOBILE_GT2)
-#define IS_SKL_GT3(devid) ((devid) == PCI_CHIP_SKYLAKE_ULT_GT3_0 || \
- (devid) == PCI_CHIP_SKYLAKE_ULT_GT3_1 || \
- (devid) == PCI_CHIP_SKYLAKE_ULT_GT3_2 || \
- (devid) == PCI_CHIP_SKYLAKE_HALO_GT3 || \
- (devid) == PCI_CHIP_SKYLAKE_SRV_GT3)
+#define IS_SKL_GT3(devid) ((devid) == PCI_CHIP_SKYLAKE_GT3 || \
+ (devid) == PCI_CHIP_SKYLAKE_HALO_GT3)
#define IS_SKL_GT4(devid) ((devid) == PCI_CHIP_SKYLAKE_SRV_GT4 || \
(devid) == PCI_CHIP_SKYLAKE_DT_GT4 || \
@@ -406,35 +375,6 @@
(devid) == PCI_CHIP_SKYLAKE_H_GT4 || \
(devid) == PCI_CHIP_SKYLAKE_WKS_GT4)
-#define IS_KBL_GT1(devid) ((devid) == PCI_CHIP_KABYLAKE_ULT_GT1_5 || \
- (devid) == PCI_CHIP_KABYLAKE_ULX_GT1_5 || \
- (devid) == PCI_CHIP_KABYLAKE_DT_GT1_5 || \
- (devid) == PCI_CHIP_KABYLAKE_ULT_GT1 || \
- (devid) == PCI_CHIP_KABYLAKE_ULX_GT1 || \
- (devid) == PCI_CHIP_KABYLAKE_DT_GT1 || \
- (devid) == PCI_CHIP_KABYLAKE_HALO_GT1_0 || \
- (devid) == PCI_CHIP_KABYLAKE_HALO_GT1_1 || \
- (devid) == PCI_CHIP_KABYLAKE_SRV_GT1)
-
-#define IS_KBL_GT2(devid) ((devid) == PCI_CHIP_KABYLAKE_ULT_GT2 || \
- (devid) == PCI_CHIP_KABYLAKE_ULT_GT2F || \
- (devid) == PCI_CHIP_KABYLAKE_ULX_GT2 || \
- (devid) == PCI_CHIP_KABYLAKE_DT_GT2 || \
- (devid) == PCI_CHIP_KABYLAKE_HALO_GT2 || \
- (devid) == PCI_CHIP_KABYLAKE_SRV_GT2 || \
- (devid) == PCI_CHIP_KABYLAKE_WKS_GT2)
-
-#define IS_KBL_GT3(devid) ((devid) == PCI_CHIP_KABYLAKE_ULT_GT3_0 || \
- (devid) == PCI_CHIP_KABYLAKE_ULT_GT3_1 || \
- (devid) == PCI_CHIP_KABYLAKE_ULT_GT3_2)
-
-#define IS_KBL_GT4(devid) ((devid) == PCI_CHIP_KABYLAKE_HALO_GT4)
-
-#define IS_KABYLAKE(devid) (IS_KBL_GT1(devid) || \
- IS_KBL_GT2(devid) || \
- IS_KBL_GT3(devid) || \
- IS_KBL_GT4(devid))
-
#define IS_SKYLAKE(devid) (IS_SKL_GT1(devid) || \
IS_SKL_GT2(devid) || \
IS_SKL_GT3(devid) || \
@@ -442,13 +382,10 @@
#define IS_BROXTON(devid) ((devid) == PCI_CHIP_BROXTON_0 || \
(devid) == PCI_CHIP_BROXTON_1 || \
- (devid) == PCI_CHIP_BROXTON_2 || \
- (devid) == PCI_CHIP_BROXTON_3 || \
- (devid) == PCI_CHIP_BROXTON_4)
+ (devid) == PCI_CHIP_BROXTON_2)
#define IS_GEN9(devid) (IS_SKYLAKE(devid) || \
- IS_BROXTON(devid) || \
- IS_KABYLAKE(devid))
+ IS_BROXTON(devid))
#define IS_9XX(dev) (IS_GEN3(dev) || \
IS_GEN4(dev) || \
diff --git a/chromium/third_party/libdrm/src/intel/intel_decode.c b/chromium/third_party/libdrm/src/intel/intel_decode.c
index 803d20293ff..e7aef742afa 100644
--- a/chromium/third_party/libdrm/src/intel/intel_decode.c
+++ b/chromium/third_party/libdrm/src/intel/intel_decode.c
@@ -38,6 +38,8 @@
#include "intel_chipset.h"
#include "intel_bufmgr.h"
+/* The compiler throws ~90 warnings. Do not spam the build, until we fix them. */
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
/* Struct for tracking drm_intel_decode state. */
struct drm_intel_decode {
@@ -3598,7 +3600,7 @@ decode_3d_965(struct drm_intel_decode *ctx)
instr_out(ctx, 0, "3DSTATE_DEPTH_BUFFER\n");
if (IS_GEN5(devid) || IS_GEN6(devid))
instr_out(ctx, 1,
- "%s, %s, pitch = %d bytes, %stiled, HiZ %d, Separate Stencil %d\n",
+ "%s, %s, pitch = %d bytes, %stiled, HiZ %d, Seperate Stencil %d\n",
get_965_surfacetype(data[1] >> 29),
get_965_depthformat((data[1] >> 18) & 0x7),
(data[1] & 0x0001ffff) + 1,
diff --git a/chromium/third_party/libdrm/src/libkms/Android.mk b/chromium/third_party/libdrm/src/libkms/Android.mk
index 5386c6f55ec..4f5e3d2f29c 100644
--- a/chromium/third_party/libdrm/src/libkms/Android.mk
+++ b/chromium/third_party/libdrm/src/libkms/Android.mk
@@ -2,19 +2,13 @@ DRM_GPU_DRIVERS := $(strip $(filter-out swrast, $(BOARD_GPU_DRIVERS)))
intel_drivers := i915 i965 i915g ilo
radeon_drivers := r300g r600g radeonsi
-rockchip_drivers := rockchip
-mediatek_drivers := mediatek
nouveau_drivers := nouveau
-virgl_drivers := virgl
vmwgfx_drivers := vmwgfx
valid_drivers := \
$(intel_drivers) \
$(radeon_drivers) \
- $(rockchip_drivers) \
- $(mediatek_drivers) \
$(nouveau_drivers) \
- $(virgl_drivers) \
$(vmwgfx_drivers)
# warn about invalid drivers
@@ -30,7 +24,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/Makefile.sources
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBKMS_FILES))
+LOCAL_SRC_FILES := $(LIBKMS_FILES)
ifneq ($(filter $(vmwgfx_drivers), $(DRM_GPU_DRIVERS)),)
LOCAL_SRC_FILES += $(LIBKMS_VMWGFX_FILES)
diff --git a/chromium/third_party/libdrm/src/libkms/Makefile.am b/chromium/third_party/libdrm/src/libkms/Makefile.am
index 7b14f958fc3..6c0ab7a2805 100644
--- a/chromium/third_party/libdrm/src/libkms/Makefile.am
+++ b/chromium/third_party/libdrm/src/libkms/Makefile.am
@@ -37,11 +37,6 @@ libkms_la_SOURCES += $(LIBKMS_EXYNOS_FILES)
AM_CFLAGS += -I$(top_srcdir)/exynos
endif
-if HAVE_MEDIATEK
-libkms_la_SOURCES += $(LIBKMS_MEDIATEK_FILES)
-AM_CFLAGS += -I$(top_srcdir)/mediatek
-endif
-
libkmsincludedir = ${includedir}/libkms
libkmsinclude_HEADERS = $(LIBKMS_H_FILES)
@@ -49,4 +44,4 @@ pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libkms.pc
TESTS = kms-symbol-check
-EXTRA_DIST = $(TESTS)
+EXTRA_DIST = Android.mk $(TESTS)
diff --git a/chromium/third_party/libdrm/src/libkms/Makefile.sources b/chromium/third_party/libdrm/src/libkms/Makefile.sources
index 2c1a10a3182..3191f516666 100644
--- a/chromium/third_party/libdrm/src/libkms/Makefile.sources
+++ b/chromium/third_party/libdrm/src/libkms/Makefile.sources
@@ -19,8 +19,5 @@ LIBKMS_RADEON_FILES := \
LIBKMS_EXYNOS_FILES := \
exynos.c
-LIBKMS_MEDIATEK_FILES := \
- mediatek.c
-
LIBKMS_H_FILES := \
libkms.h
diff --git a/chromium/third_party/libdrm/src/libkms/internal.h b/chromium/third_party/libdrm/src/libkms/internal.h
index 845c57d5925..905f5b1705f 100644
--- a/chromium/third_party/libdrm/src/libkms/internal.h
+++ b/chromium/third_party/libdrm/src/libkms/internal.h
@@ -81,6 +81,4 @@ drm_private int radeon_create(int fd, struct kms_driver **out);
drm_private int exynos_create(int fd, struct kms_driver **out);
-drm_private int mediatek_create(int fd, struct kms_driver **out);
-
#endif
diff --git a/chromium/third_party/libdrm/src/libkms/libkms.pc.in b/chromium/third_party/libdrm/src/libkms/libkms.pc.in
index 1421b3eaae5..511535ad5b6 100644
--- a/chromium/third_party/libdrm/src/libkms/libkms.pc.in
+++ b/chromium/third_party/libdrm/src/libkms/libkms.pc.in
@@ -8,4 +8,3 @@ Description: Library that abstract aways the different mm interface for kernel d
Version: 1.0.0
Libs: -L${libdir} -lkms
Cflags: -I${includedir}/libkms
-Requires.private: libdrm
diff --git a/chromium/third_party/libdrm/src/libkms/linux.c b/chromium/third_party/libdrm/src/libkms/linux.c
index 85e06cdbd6c..6e0da830fd2 100644
--- a/chromium/third_party/libdrm/src/libkms/linux.c
+++ b/chromium/third_party/libdrm/src/libkms/linux.c
@@ -41,12 +41,9 @@
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
-#ifdef MAJOR_IN_MKDEV
+#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
-#ifdef MAJOR_IN_SYSMACROS
-#include <sys/sysmacros.h>
-#endif
#include "libdrm_macros.h"
#include "internal.h"
@@ -135,11 +132,6 @@ linux_from_sysfs(int fd, struct kms_driver **out)
ret = exynos_create(fd, out);
else
#endif
-#ifdef HAVE_MEDIATEK
- if (!strcmp(name, "mediatek"))
- ret = mediatek_create(fd, out);
- else
-#endif
ret = -ENOSYS;
free(name);
diff --git a/chromium/third_party/libdrm/src/libkms/mediatek.c b/chromium/third_party/libdrm/src/libkms/mediatek.c
deleted file mode 100644
index b1a54c00311..00000000000
--- a/chromium/third_party/libdrm/src/libkms/mediatek.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2015 MediaTek Inc.
- * Author:JB TSAI <jb.tsai@mediatek.com>
- *
- * based on rockchip_drm.c
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "internal.h"
-
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include "xf86drm.h"
-
-#include "mediatek_drm.h"
-
-struct mediatek_bo
-{
- struct kms_bo base;
- unsigned map_count;
-};
-
-static int
-mediatek_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
-{
- switch (key) {
- case KMS_BO_TYPE:
- *out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
- break;
- default:
- return -EINVAL;
- }
- return 0;
-}
-
-static int
-mediatek_destroy(struct kms_driver *kms)
-{
- free(kms);
- return 0;
-}
-
-static int
-mediatek_bo_create(struct kms_driver *kms,
- const unsigned width, const unsigned height,
- const enum kms_bo_type type, const unsigned *attr,
- struct kms_bo **out)
-{
- struct drm_mtk_gem_create arg;
- unsigned size, pitch;
- struct mediatek_bo *bo;
- int i, ret;
-
- for (i = 0; attr[i]; i += 2) {
- switch (attr[i]) {
- case KMS_WIDTH:
- case KMS_HEIGHT:
- case KMS_BO_TYPE:
- break;
- default:
- return -EINVAL;
- }
- }
-
- bo = calloc(1, sizeof(*bo));
- if (!bo)
- return -ENOMEM;
-
- if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
- pitch = 64 * 4;
- size = 64 * 64 * 4;
- } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
- pitch = width * 4;
- pitch = (pitch + 512 - 1) & ~(512 - 1);
- size = pitch * ((height + 4 - 1) & ~(4 - 1));
- } else {
- return -EINVAL;
- }
-
- memset(&arg, 0, sizeof(arg));
- arg.size = size;
-
- ret = drmCommandWriteRead(kms->fd, DRM_MTK_GEM_CREATE, &arg, sizeof(arg));
- if (ret)
- goto err_free;
-
- bo->base.kms = kms;
- bo->base.handle = arg.handle;
- bo->base.size = size;
- bo->base.pitch = pitch;
-
- *out = &bo->base;
-
- return 0;
-
-err_free:
- free(bo);
- return ret;
-}
-
-static int
-mediatek_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
-{
- switch (key) {
- default:
- return -EINVAL;
- }
-}
-
-static int
-mediatek_bo_map(struct kms_bo *_bo, void **out)
-{
- struct mediatek_bo *bo = (struct mediatek_bo *)_bo;
- struct drm_mtk_gem_map_off arg;
- void *map = NULL;
- int ret;
-
- if (bo->base.ptr) {
- bo->map_count++;
- *out = bo->base.ptr;
- return 0;
- }
-
- memset(&arg, 0, sizeof(arg));
- arg.handle = bo->base.handle;
-
- ret = drmCommandWriteRead(bo->base.kms->fd, DRM_MTK_GEM_MAP_OFFSET, &arg, sizeof(arg));
- if (ret)
- return ret;
-
- map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset);
- if (map == MAP_FAILED)
- return -errno;
-
- bo->base.ptr = map;
- bo->map_count++;
- *out = bo->base.ptr;
-
- return 0;
-}
-
-static int
-mediatek_bo_unmap(struct kms_bo *_bo)
-{
- struct mediatek_bo *bo = (struct mediatek_bo *)_bo;
- bo->map_count--;
- return 0;
-}
-
-static int
-mediatek_bo_destroy(struct kms_bo *_bo)
-{
- struct mediatek_bo *bo = (struct mediatek_bo *)_bo;
- struct drm_gem_close arg;
- int ret;
-
- if (bo->base.ptr) {
- /* XXX Sanity check map_count */
- munmap(bo->base.ptr, bo->base.size);
- bo->base.ptr = NULL;
- }
-
- memset(&arg, 0, sizeof(arg));
- arg.handle = bo->base.handle;
-
- ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_GEM_CLOSE, &arg);
- if (ret)
- return -errno;
-
- free(bo);
- return 0;
-}
-
-int
-mediatek_create(int fd, struct kms_driver **out)
-{
- struct kms_driver *kms;
-
- kms = calloc(1, sizeof(*kms));
- if (!kms)
- return -ENOMEM;
-
- kms->fd = fd;
-
- kms->bo_create = mediatek_bo_create;
- kms->bo_map = mediatek_bo_map;
- kms->bo_unmap = mediatek_bo_unmap;
- kms->bo_get_prop = mediatek_bo_get_prop;
- kms->bo_destroy = mediatek_bo_destroy;
- kms->get_prop = mediatek_get_prop;
- kms->destroy = mediatek_destroy;
- *out = kms;
-
- return 0;
-}
diff --git a/chromium/third_party/libdrm/src/man/drm-kms.xml b/chromium/third_party/libdrm/src/man/drm-kms.xml
index ae38dc8d208..5f041578e0f 100644
--- a/chromium/third_party/libdrm/src/man/drm-kms.xml
+++ b/chromium/third_party/libdrm/src/man/drm-kms.xml
@@ -126,7 +126,7 @@
<listitem>
<para><emphasis>Framebuffers</emphasis> are abstract memory objects
that provide a source of pixel data to scanout to a CRTC.
- Applications explicitly request the creation of framebuffers
+ Applications explicitely request the creation of framebuffers
and can control their behavior. Framebuffers rely on the
underneath memory manager for low-level memory operations.
When creating a framebuffer, applications pass a memory handle
diff --git a/chromium/third_party/libdrm/src/mediatek/Android.mk b/chromium/third_party/libdrm/src/mediatek/Android.mk
deleted file mode 100644
index c9ac9f102d0..00000000000
--- a/chromium/third_party/libdrm/src/mediatek/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libdrm_mediatek
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES := mediatek_drm.c
-LOCAL_EXPORT_C_INCLUDE_DIRS += \
- $(LOCAL_PATH)/mediatek
-
-LOCAL_C_INCLUDES := \
- $(LIBDRM_TOP) \
- $(LIBDRM_TOP)/mediatek \
- $(LIBDRM_TOP)/include/drm
-
-# This makes sure mmap64 is used, as mmap offsets can be larger than 32-bit
-LOCAL_CFLAGS := \
- -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 \
- -D_LARGEFILE_SOURCE \
- -D_LARGEFILE64_SOURCE \
- -D_FILE_OFFSET_BITS=64
-
-LOCAL_COPY_HEADERS := mediatek_drm.h mediatek_drmif.h
-LOCAL_COPY_HEADERS_TO := libdrm
-
-LOCAL_SHARED_LIBRARIES := \
- libdrm
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/chromium/third_party/libdrm/src/mediatek/Makefile.am b/chromium/third_party/libdrm/src/mediatek/Makefile.am
deleted file mode 100644
index bb23e46677c..00000000000
--- a/chromium/third_party/libdrm/src/mediatek/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-AM_CFLAGS = \
- $(WARN_CFLAGS) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/mediatek \
- $(PTHREADSTUBS_CFLAGS) \
- -I$(top_srcdir)/include/drm
-
-libdrm_mediatek_la_LTLIBRARIES = libdrm_mediatek.la
-libdrm_mediatek_ladir = $(libdir)
-libdrm_mediatek_la_LDFLAGS = -version-number 1:0:0 -no-undefined
-libdrm_mediatek_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
-
-libdrm_mediatek_la_SOURCES = \
- mediatek_drm.c
-
-libdrm_mediatekincludedir = ${includedir}/libdrm
-libdrm_mediatekinclude_HEADERS = mediatek_drmif.h mediatek_drm.h
-
-pkgconfigdir = @pkgconfigdir@
-pkgconfig_DATA = libdrm_mediatek.pc
diff --git a/chromium/third_party/libdrm/src/mediatek/libdrm_mediatek.pc.in b/chromium/third_party/libdrm/src/mediatek/libdrm_mediatek.pc.in
deleted file mode 100644
index eaba97e372e..00000000000
--- a/chromium/third_party/libdrm/src/mediatek/libdrm_mediatek.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libdrm_mediatek
-Description: Userspace interface to mediatek kernel DRM services
-Version: 0.1
-Libs: -L${libdir} -ldrm_mediatek
-Cflags: -I${includedir} -I${includedir}/libdrm
-Requires.private: libdrm
diff --git a/chromium/third_party/libdrm/src/mediatek/mediatek_drm.c b/chromium/third_party/libdrm/src/mediatek/mediatek_drm.c
deleted file mode 100644
index 1122b03cde0..00000000000
--- a/chromium/third_party/libdrm/src/mediatek/mediatek_drm.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (c) 2015 MediaTek Inc.
- * Author:JB TSAI <jb.tsai@mediatek.com>
- *
- * based on rockchip_drm.c
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/mman.h>
-#include <linux/stddef.h>
-
-#include <xf86drm.h>
-
-#include "mediatek_drm.h"
-#include "mediatek_drmif.h"
-
-/*
- * Create mediatek drm device object.
- *
- * @fd: file descriptor to mediatek drm driver opened.
- *
- * if true, return the device object else NULL.
- */
-struct mediatek_device *mediatek_device_create(int fd)
-{
- struct mediatek_device *dev;
-
- dev = calloc(1, sizeof(*dev));
- if (!dev) {
- fprintf(stderr, "failed to create device[%s].\n",
- strerror(errno));
- return NULL;
- }
-
- dev->fd = fd;
-
- return dev;
-}
-
-/*
- * Destroy mediatek drm device object
- *
- * @dev: mediatek drm device object.
- */
-void mediatek_device_destroy(struct mediatek_device *dev)
-{
- free(dev);
-}
-
-/*
- * Create a mediatek buffer object to mediatek drm device.
- *
- * @dev: mediatek drm device object.
- * @size: user-desired size.
- * flags: user-desired memory type.
- * user can set one or more types among several types to memory
- * allocation and cache attribute types. and as default,
- * MEDIATEK_BO_NONCONTIG and MEDIATEK-BO_NONCACHABLE types would
- * be used.
- *
- * if true, return a mediatek buffer object else NULL.
- */
-struct mediatek_bo *mediatek_bo_create(struct mediatek_device *dev,
- size_t size, uint32_t flags)
-{
- struct mediatek_bo *bo;
- struct drm_mtk_gem_create req = {
- .size = size,
- .flags = flags,
- };
-
- if (size == 0) {
- fprintf(stderr, "invalid size.\n");
- return NULL;
- }
-
- bo = calloc(1, sizeof(*bo));
- if (!bo) {
- fprintf(stderr, "failed to create bo[%s].\n",
- strerror(errno));
- goto fail;
- }
-
- bo->dev = dev;
-
- if (drmIoctl(dev->fd, DRM_IOCTL_MTK_GEM_CREATE, &req)){
- fprintf(stderr, "failed to create gem object[%s].\n",
- strerror(errno));
- goto err_free_bo;
- }
-
- bo->handle = req.handle;
- bo->size = size;
- bo->flags = flags;
-
- return bo;
-
-err_free_bo:
- free(bo);
-fail:
- return NULL;
-}
-
-struct mediatek_bo *mediatek_bo_from_handle(struct mediatek_device *dev,
- uint32_t handle, uint32_t flags, uint32_t size)
-{
- struct mediatek_bo *bo;
-
- if (size == 0) {
- fprintf(stderr, "invalid size.\n");
- return NULL;
- }
-
- bo = calloc(1, sizeof(*bo));
- if (!bo) {
- fprintf(stderr, "failed to create bo[%s].\n",
- strerror(errno));
- return NULL;
- }
-
- bo->dev = dev;
- bo->handle = handle;
- bo->size = size;
- bo->flags = flags;
-
- return bo;
-}
-
-/*
- * Destroy a mediatek buffer object.
- *
- * @bo: a mediatek buffer object to be destroyed.
- */
-void mediatek_bo_destroy(struct mediatek_bo *bo)
-{
- if (!bo)
- return;
-
- if (bo->vaddr)
- munmap(bo->vaddr, bo->size);
-
- if (bo->handle) {
- struct drm_gem_close req = {
- .handle = bo->handle,
- };
-
- drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
- }
-
- free(bo);
-}
-
-
-/*
- * Get a mediatek buffer object from a gem global object name.
- *
- * @dev: a mediatek device object.
- * @name: a gem global object name exported by another process.
- *
- * this interface is used to get a mediatek buffer object from a gem
- * global object name sent by another process for buffer sharing.
- *
- * if true, return a mediatek buffer object else NULL.
- *
- */
-struct mediatek_bo *mediatek_bo_from_name(struct mediatek_device *dev,
- uint32_t name)
-{
- struct mediatek_bo *bo;
- struct drm_gem_open req = {
- .name = name,
- };
-
- bo = calloc(1, sizeof(*bo));
- if (!bo) {
- fprintf(stderr, "failed to allocate bo[%s].\n",
- strerror(errno));
- return NULL;
- }
-
- if (drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req)) {
- fprintf(stderr, "failed to open gem object[%s].\n",
- strerror(errno));
- goto err_free_bo;
- }
-
- bo->dev = dev;
- bo->name = name;
- bo->handle = req.handle;
-
- return bo;
-
-err_free_bo:
- free(bo);
- return NULL;
-}
-
-/*
- * Get a gem global object name from a gem object handle.
- *
- * @bo: a mediatek buffer object including gem handle.
- * @name: a gem global object name to be got by kernel driver.
- *
- * this interface is used to get a gem global object name from a gem object
- * handle to a buffer that wants to share it with another process.
- *
- * if true, return 0 else negative.
- */
-int mediatek_bo_get_name(struct mediatek_bo *bo, uint32_t *name)
-{
- if (!bo->name) {
- struct drm_gem_flink req = {
- .handle = bo->handle,
- };
- int ret;
-
- ret = drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_FLINK, &req);
- if (ret) {
- fprintf(stderr, "failed to get gem global name[%s].\n",
- strerror(errno));
- return ret;
- }
-
- bo->name = req.name;
- }
-
- *name = bo->name;
-
- return 0;
-}
-
-uint32_t mediatek_bo_handle(struct mediatek_bo *bo)
-{
- return bo->handle;
-}
-
-/*
- * Mmap a buffer to user space.
- *
- * @bo: a mediatek buffer object including a gem object handle to be mmapped
- * to user space.
- *
- * if true, user pointer mmaped else NULL.
- */
-void *mediatek_bo_map(struct mediatek_bo *bo)
-{
- if (!bo->vaddr) {
- struct mediatek_device *dev = bo->dev;
- struct drm_mtk_gem_map_off req = {
- .handle = bo->handle,
- };
- int ret;
-
- ret = drmIoctl(dev->fd, DRM_IOCTL_MTK_GEM_MAP_OFFSET, &req);
- if (ret) {
- fprintf(stderr, "failed to ioctl gem map offset[%s].\n",
- strerror(errno));
- return NULL;
- }
-
- bo->vaddr = mmap(0, bo->size, PROT_READ | PROT_WRITE,
- MAP_SHARED, dev->fd, req.offset);
- if (bo->vaddr == MAP_FAILED) {
- fprintf(stderr, "failed to mmap buffer[%s].\n",
- strerror(errno));
- return NULL;
- }
- }
-
- return bo->vaddr;
-}
diff --git a/chromium/third_party/libdrm/src/mediatek/mediatek_drm.h b/chromium/third_party/libdrm/src/mediatek/mediatek_drm.h
deleted file mode 100644
index 6d87d9c7982..00000000000
--- a/chromium/third_party/libdrm/src/mediatek/mediatek_drm.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2015 MediaTek Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-
-#ifndef _UAPI_MEDIATEK_DRM_H
-#define _UAPI_MEDIATEK_DRM_H
-
-#include "drm.h"
-
-/**
- * User-desired buffer creation information structure.
- *
- * @size: user-desired memory allocation size.
- * - this size value would be page-aligned internally.
- * @flags: user request for setting memory type or cache attributes.
- * @handle: returned a handle to created gem object.
- * - this handle will be set by gem module of kernel side.
- */
-struct drm_mtk_gem_create {
- uint64_t size;
- uint32_t flags;
- uint32_t handle;
-};
-
-/**
- * A structure for getting buffer offset.
- *
- * @handle: a pointer to gem object created.
- * @pad: just padding to be 64-bit aligned.
- * @offset: relatived offset value of the memory region allocated.
- * - this value should be set by user.
- */
-struct drm_mtk_gem_map_off {
- uint32_t handle;
- uint32_t pad;
- uint64_t offset;
-};
-
-#define DRM_MTK_GEM_CREATE 0x00
-#define DRM_MTK_GEM_MAP_OFFSET 0x01
-
-#define DRM_IOCTL_MTK_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_MTK_GEM_CREATE, struct drm_mtk_gem_create)
-
-#define DRM_IOCTL_MTK_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_MTK_GEM_MAP_OFFSET, struct drm_mtk_gem_map_off)
-
-
-#endif /* _UAPI_MEDIATEK_DRM_H */
diff --git a/chromium/third_party/libdrm/src/mediatek/mediatek_drmif.h b/chromium/third_party/libdrm/src/mediatek/mediatek_drmif.h
deleted file mode 100644
index 47cd2d810ab..00000000000
--- a/chromium/third_party/libdrm/src/mediatek/mediatek_drmif.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2015 MediaTek Inc.
- * Author:JB TSAI <jb.tsai@mediatek.com>
- *
- * based on rockchip_drmif.h
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#ifndef MEDIATEK_DRMIF_H_
-#define MEDIATEK_DRMIF_H_
-
-#include <xf86drm.h>
-#include <stdint.h>
-#include "mediatek_drm.h"
-
-struct mediatek_device {
- int fd;
-};
-
-/*
- * Mediatek Buffer Object structure.
- *
- * @dev: mediatek device object allocated.
- * @handle: a gem handle to gem object created.
- * @flags: indicate memory allocation and cache attribute types.
- * @size: size to the buffer created.
- * @vaddr: user space address to a gem buffer mmaped.
- * @name: a gem global handle from flink request.
- */
-struct mediatek_bo {
- struct mediatek_device *dev;
- uint32_t handle;
- uint32_t flags;
- size_t size;
- void *vaddr;
- uint32_t name;
-};
-
-/*
- * device related functions:
- */
-struct mediatek_device *mediatek_device_create(int fd);
-void mediatek_device_destroy(struct mediatek_device *dev);
-
-/*
- * buffer-object related functions:
- */
-struct mediatek_bo *mediatek_bo_create(struct mediatek_device *dev,
- size_t size, uint32_t flags);
-int mediatek_bo_get_info(struct mediatek_device *dev, uint32_t handle,
- size_t *size, uint32_t *flags);
-void mediatek_bo_destroy(struct mediatek_bo *bo);
-struct mediatek_bo *mediatek_bo_from_name(struct mediatek_device *dev,
- uint32_t name);
-int mediatek_bo_get_name(struct mediatek_bo *bo, uint32_t *name);
-uint32_t mediatek_bo_handle(struct mediatek_bo *bo);
-struct mediatek_bo *mediatek_bo_from_handle(struct mediatek_device *dev,
- uint32_t handle, uint32_t flags, uint32_t size);
-void *mediatek_bo_map(struct mediatek_bo *bo);
-#endif /* MEDIATEK_DRMIF_H_ */
diff --git a/chromium/third_party/libdrm/src/nouveau/Android.mk b/chromium/third_party/libdrm/src/nouveau/Android.mk
index b67d30fc76e..abc6aef7465 100644
--- a/chromium/third_party/libdrm/src/nouveau/Android.mk
+++ b/chromium/third_party/libdrm/src/nouveau/Android.mk
@@ -9,7 +9,7 @@ LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libdrm
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_NOUVEAU_FILES))
+LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
diff --git a/chromium/third_party/libdrm/src/nouveau/Makefile.am b/chromium/third_party/libdrm/src/nouveau/Makefile.am
index 344a84454e4..25ea6dc1553 100644
--- a/chromium/third_party/libdrm/src/nouveau/Makefile.am
+++ b/chromium/third_party/libdrm/src/nouveau/Makefile.am
@@ -14,20 +14,11 @@ libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
libdrm_nouveau_la_SOURCES = $(LIBDRM_NOUVEAU_FILES)
-libdrm_nouveauincludedir = ${includedir}/libdrm/nouveau
+libdrm_nouveauincludedir = ${includedir}/libdrm
libdrm_nouveauinclude_HEADERS = $(LIBDRM_NOUVEAU_H_FILES)
-libdrm_nouveaunvifincludedir = ${includedir}/libdrm/nouveau/nvif
-libdrm_nouveaunvifinclude_HEADERS = nvif/class.h \
- nvif/cl0080.h \
- nvif/cl9097.h \
- nvif/if0002.h \
- nvif/if0003.h \
- nvif/ioctl.h \
- nvif/unpack.h
-
pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libdrm_nouveau.pc
TESTS = nouveau-symbol-check
-EXTRA_DIST = $(TESTS)
+EXTRA_DIST = Android.mk $(TESTS)
diff --git a/chromium/third_party/libdrm/src/nouveau/abi16.c b/chromium/third_party/libdrm/src/nouveau/abi16.c
index ee38c0cb228..59bc43605cf 100644
--- a/chromium/third_party/libdrm/src/nouveau/abi16.c
+++ b/chromium/third_party/libdrm/src/nouveau/abi16.c
@@ -29,16 +29,14 @@
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
-#include <errno.h>
#include "private.h"
-#include "nvif/class.h"
-static int
+drm_private int
abi16_chan_nv04(struct nouveau_object *obj)
{
- struct nouveau_drm *drm = nouveau_drm(obj);
+ struct nouveau_device *dev = (struct nouveau_device *)obj->parent;
struct nv04_fifo *nv04 = obj->data;
struct drm_nouveau_channel_alloc req = {
.fb_ctxdma_handle = nv04->vram,
@@ -46,7 +44,7 @@ abi16_chan_nv04(struct nouveau_object *obj)
};
int ret;
- ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
+ ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
&req, sizeof(req));
if (ret)
return ret;
@@ -59,15 +57,15 @@ abi16_chan_nv04(struct nouveau_object *obj)
return 0;
}
-static int
+drm_private int
abi16_chan_nvc0(struct nouveau_object *obj)
{
- struct nouveau_drm *drm = nouveau_drm(obj);
+ struct nouveau_device *dev = (struct nouveau_device *)obj->parent;
struct drm_nouveau_channel_alloc req = {};
struct nvc0_fifo *nvc0 = obj->data;
int ret;
- ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
+ ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
&req, sizeof(req));
if (ret)
return ret;
@@ -80,10 +78,10 @@ abi16_chan_nvc0(struct nouveau_object *obj)
return 0;
}
-static int
+drm_private int
abi16_chan_nve0(struct nouveau_object *obj)
{
- struct nouveau_drm *drm = nouveau_drm(obj);
+ struct nouveau_device *dev = (struct nouveau_device *)obj->parent;
struct drm_nouveau_channel_alloc req = {};
struct nve0_fifo *nve0 = obj->data;
int ret;
@@ -93,7 +91,7 @@ abi16_chan_nve0(struct nouveau_object *obj)
req.tt_ctxdma_handle = nve0->engine;
}
- ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
+ ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_CHANNEL_ALLOC,
&req, sizeof(req));
if (ret)
return ret;
@@ -106,39 +104,19 @@ abi16_chan_nve0(struct nouveau_object *obj)
return 0;
}
-static int
+drm_private int
abi16_engobj(struct nouveau_object *obj)
{
- struct nouveau_drm *drm = nouveau_drm(obj);
struct drm_nouveau_grobj_alloc req = {
.channel = obj->parent->handle,
.handle = obj->handle,
.class = obj->oclass,
};
+ struct nouveau_device *dev;
int ret;
- /* Older kernel versions did not have the concept of nouveau-
- * specific classes and abused some NVIDIA-assigned ones for
- * a SW class. The ABI16 layer has compatibility in place to
- * translate these older identifiers to the newer ones.
- *
- * Clients that have been updated to use NVIF are required to
- * use the newer class identifiers, which means that they'll
- * break if running on an older kernel.
- *
- * To handle this case, when using ABI16, we translate to the
- * older values which work on any kernel.
- */
- switch (req.class) {
- case NVIF_CLASS_SW_NV04 : req.class = 0x006e; break;
- case NVIF_CLASS_SW_NV10 : req.class = 0x016e; break;
- case NVIF_CLASS_SW_NV50 : req.class = 0x506e; break;
- case NVIF_CLASS_SW_GF100: req.class = 0x906e; break;
- default:
- break;
- }
-
- ret = drmCommandWrite(drm->fd, DRM_NOUVEAU_GROBJ_ALLOC,
+ dev = nouveau_object_find(obj, NOUVEAU_DEVICE_CLASS);
+ ret = drmCommandWrite(dev->fd, DRM_NOUVEAU_GROBJ_ALLOC,
&req, sizeof(req));
if (ret)
return ret;
@@ -147,19 +125,20 @@ abi16_engobj(struct nouveau_object *obj)
return 0;
}
-static int
+drm_private int
abi16_ntfy(struct nouveau_object *obj)
{
- struct nouveau_drm *drm = nouveau_drm(obj);
struct nv04_notify *ntfy = obj->data;
struct drm_nouveau_notifierobj_alloc req = {
.channel = obj->parent->handle,
.handle = ntfy->object->handle,
.size = ntfy->length,
};
+ struct nouveau_device *dev;
int ret;
- ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_NOTIFIEROBJ_ALLOC,
+ dev = nouveau_object_find(obj, NOUVEAU_DEVICE_CLASS);
+ ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_NOTIFIEROBJ_ALLOC,
&req, sizeof(req));
if (ret)
return ret;
@@ -169,110 +148,6 @@ abi16_ntfy(struct nouveau_object *obj)
return 0;
}
-drm_private int
-abi16_sclass(struct nouveau_object *obj, struct nouveau_sclass **psclass)
-{
- struct nouveau_sclass *sclass;
- struct nouveau_device *dev;
-
- if (!(sclass = calloc(8, sizeof(*sclass))))
- return -ENOMEM;
- *psclass = sclass;
-
- switch (obj->oclass) {
- case NOUVEAU_FIFO_CHANNEL_CLASS:
- /* Older kernel versions were exposing the wrong video engine
- * classes on certain G98:GF100 boards. This has since been
- * corrected, but ABI16 has compatibility in place to avoid
- * breaking older userspace.
- *
- * Clients that have been updated to use NVIF are required to
- * use the correct classes, which means that they'll break if
- * running on an older kernel.
- *
- * To handle this issue, if using the older kernel interfaces,
- * we'll magic up a list containing the vdec classes that the
- * kernel will accept for these boards. Clients should make
- * use of this information instead of hardcoding classes for
- * specific chipsets.
- */
- dev = (struct nouveau_device *)obj->parent;
- if (dev->chipset >= 0x98 &&
- dev->chipset != 0xa0 &&
- dev->chipset < 0xc0) {
- *sclass++ = (struct nouveau_sclass){
- GT212_MSVLD, -1, -1
- };
- *sclass++ = (struct nouveau_sclass){
- GT212_MSPDEC, -1, -1
- };
- *sclass++ = (struct nouveau_sclass){
- GT212_MSPPP, -1, -1
- };
- }
- break;
- default:
- break;
- }
-
- return sclass - *psclass;
-}
-
-drm_private void
-abi16_delete(struct nouveau_object *obj)
-{
- struct nouveau_drm *drm = nouveau_drm(obj);
- if (obj->oclass == NOUVEAU_FIFO_CHANNEL_CLASS) {
- struct drm_nouveau_channel_free req;
- req.channel = obj->handle;
- drmCommandWrite(drm->fd, DRM_NOUVEAU_CHANNEL_FREE,
- &req, sizeof(req));
- } else {
- struct drm_nouveau_gpuobj_free req;
- req.channel = obj->parent->handle;
- req.handle = obj->handle;
- drmCommandWrite(drm->fd, DRM_NOUVEAU_GPUOBJ_FREE,
- &req, sizeof(req));
- }
-}
-
-drm_private bool
-abi16_object(struct nouveau_object *obj, int (**func)(struct nouveau_object *))
-{
- struct nouveau_object *parent = obj->parent;
-
- /* nouveau_object::length is (ab)used to determine whether the
- * object is a legacy object (!=0), or a real NVIF object.
- */
- if ((parent->length != 0 && parent->oclass == NOUVEAU_DEVICE_CLASS) ||
- (parent->length == 0 && parent->oclass == NV_DEVICE)) {
- if (obj->oclass == NOUVEAU_FIFO_CHANNEL_CLASS) {
- struct nouveau_device *dev = (void *)parent;
- if (dev->chipset < 0xc0)
- *func = abi16_chan_nv04;
- else
- if (dev->chipset < 0xe0)
- *func = abi16_chan_nvc0;
- else
- *func = abi16_chan_nve0;
- return true;
- }
- } else
- if ((parent->length != 0 &&
- parent->oclass == NOUVEAU_FIFO_CHANNEL_CLASS)) {
- if (obj->oclass == NOUVEAU_NOTIFIER_CLASS) {
- *func = abi16_ntfy;
- return true;
- }
-
- *func = abi16_engobj;
- return false; /* try NVIF, if supported, before calling func */
- }
-
- *func = NULL;
- return false;
-}
-
drm_private void
abi16_bo_info(struct nouveau_bo *bo, struct drm_nouveau_gem_info *info)
{
@@ -312,7 +187,6 @@ abi16_bo_init(struct nouveau_bo *bo, uint32_t alignment,
union nouveau_bo_config *config)
{
struct nouveau_device *dev = bo->device;
- struct nouveau_drm *drm = nouveau_drm(&dev->object);
struct drm_nouveau_gem_new req = {};
struct drm_nouveau_gem_info *info = &req.info;
int ret;
@@ -355,7 +229,7 @@ abi16_bo_init(struct nouveau_bo *bo, uint32_t alignment,
if (!nouveau_device(dev)->have_bo_usage)
info->tile_flags &= 0x0000ff00;
- ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_GEM_NEW,
+ ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_GEM_NEW,
&req, sizeof(req));
if (ret == 0)
abi16_bo_info(bo, &req.info);
diff --git a/chromium/third_party/libdrm/src/nouveau/libdrm_nouveau.pc.in b/chromium/third_party/libdrm/src/nouveau/libdrm_nouveau.pc.in
index 7d0622e9a71..9abfd811d1e 100644
--- a/chromium/third_party/libdrm/src/nouveau/libdrm_nouveau.pc.in
+++ b/chromium/third_party/libdrm/src/nouveau/libdrm_nouveau.pc.in
@@ -7,5 +7,5 @@ Name: libdrm_nouveau
Description: Userspace interface to nouveau kernel DRM services
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -ldrm_nouveau
-Cflags: -I${includedir} -I${includedir}/libdrm -I${includedir}/libdrm/nouveau
+Cflags: -I${includedir} -I${includedir}/libdrm
Requires.private: libdrm
diff --git a/chromium/third_party/libdrm/src/nouveau/nouveau-symbol-check b/chromium/third_party/libdrm/src/nouveau/nouveau-symbol-check
index b265cea466a..0fef56323b4 100755
--- a/chromium/third_party/libdrm/src/nouveau/nouveau-symbol-check
+++ b/chromium/third_party/libdrm/src/nouveau/nouveau-symbol-check
@@ -27,19 +27,13 @@ nouveau_bufctx_reset
nouveau_client_del
nouveau_client_new
nouveau_device_del
-nouveau_device_new
nouveau_device_open
nouveau_device_open_existing
nouveau_device_wrap
-nouveau_drm_del
-nouveau_drm_new
nouveau_getparam
nouveau_object_del
-nouveau_object_mclass
-nouveau_object_mthd
+nouveau_object_find
nouveau_object_new
-nouveau_object_sclass_get
-nouveau_object_sclass_put
nouveau_pushbuf_bufctx
nouveau_pushbuf_data
nouveau_pushbuf_del
diff --git a/chromium/third_party/libdrm/src/nouveau/nouveau.c b/chromium/third_party/libdrm/src/nouveau/nouveau.c
index e113a8fe780..97fd77b932b 100644
--- a/chromium/third_party/libdrm/src/nouveau/nouveau.c
+++ b/chromium/third_party/libdrm/src/nouveau/nouveau.c
@@ -45,11 +45,6 @@
#include "nouveau.h"
#include "private.h"
-#include "nvif/class.h"
-#include "nvif/cl0080.h"
-#include "nvif/ioctl.h"
-#include "nvif/unpack.h"
-
#ifdef DEBUG
drm_private uint32_t nouveau_debug = 0;
@@ -64,295 +59,6 @@ debug_init(char *args)
}
#endif
-static int
-nouveau_object_ioctl(struct nouveau_object *obj, void *data, uint32_t size)
-{
- struct nouveau_drm *drm = nouveau_drm(obj);
- union {
- struct nvif_ioctl_v0 v0;
- } *args = data;
- uint32_t argc = size;
- int ret = -ENOSYS;
-
- if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, true))) {
- if (!obj->length) {
- if (obj != &drm->client)
- args->v0.object = (unsigned long)(void *)obj;
- else
- args->v0.object = 0;
- args->v0.owner = NVIF_IOCTL_V0_OWNER_ANY;
- args->v0.route = 0x00;
- } else {
- args->v0.route = 0xff;
- args->v0.token = obj->handle;
- }
- } else
- return ret;
-
- return drmCommandWriteRead(drm->fd, DRM_NOUVEAU_NVIF, args, argc);
-}
-
-int
-nouveau_object_mthd(struct nouveau_object *obj,
- uint32_t mthd, void *data, uint32_t size)
-{
- struct nouveau_drm *drm = nouveau_drm(obj);
- struct {
- struct nvif_ioctl_v0 ioctl;
- struct nvif_ioctl_mthd_v0 mthd;
- } *args;
- uint32_t argc = sizeof(*args) + size;
- uint8_t stack[128];
- int ret;
-
- if (!drm->nvif)
- return -ENOSYS;
-
- if (argc > sizeof(stack)) {
- if (!(args = malloc(argc)))
- return -ENOMEM;
- } else {
- args = (void *)stack;
- }
- args->ioctl.version = 0;
- args->ioctl.type = NVIF_IOCTL_V0_MTHD;
- args->mthd.version = 0;
- args->mthd.method = mthd;
-
- memcpy(args->mthd.data, data, size);
- ret = nouveau_object_ioctl(obj, args, argc);
- memcpy(data, args->mthd.data, size);
- if (args != (void *)stack)
- free(args);
- return ret;
-}
-
-void
-nouveau_object_sclass_put(struct nouveau_sclass **psclass)
-{
- free(*psclass);
- *psclass = NULL;
-}
-
-int
-nouveau_object_sclass_get(struct nouveau_object *obj,
- struct nouveau_sclass **psclass)
-{
- struct nouveau_drm *drm = nouveau_drm(obj);
- struct {
- struct nvif_ioctl_v0 ioctl;
- struct nvif_ioctl_sclass_v0 sclass;
- } *args = NULL;
- struct nouveau_sclass *sclass;
- int ret, cnt = 0, i;
- uint32_t size;
-
- if (!drm->nvif)
- return abi16_sclass(obj, psclass);
-
- while (1) {
- size = sizeof(*args) + cnt * sizeof(args->sclass.oclass[0]);
- if (!(args = malloc(size)))
- return -ENOMEM;
- args->ioctl.version = 0;
- args->ioctl.type = NVIF_IOCTL_V0_SCLASS;
- args->sclass.version = 0;
- args->sclass.count = cnt;
-
- ret = nouveau_object_ioctl(obj, args, size);
- if (ret == 0 && args->sclass.count <= cnt)
- break;
- cnt = args->sclass.count;
- free(args);
- if (ret != 0)
- return ret;
- }
-
- if ((sclass = calloc(args->sclass.count, sizeof(*sclass)))) {
- for (i = 0; i < args->sclass.count; i++) {
- sclass[i].oclass = args->sclass.oclass[i].oclass;
- sclass[i].minver = args->sclass.oclass[i].minver;
- sclass[i].maxver = args->sclass.oclass[i].maxver;
- }
- *psclass = sclass;
- ret = args->sclass.count;
- } else {
- ret = -ENOMEM;
- }
-
- free(args);
- return ret;
-}
-
-int
-nouveau_object_mclass(struct nouveau_object *obj,
- const struct nouveau_mclass *mclass)
-{
- struct nouveau_sclass *sclass;
- int ret = -ENODEV;
- int cnt, i, j;
-
- cnt = nouveau_object_sclass_get(obj, &sclass);
- if (cnt < 0)
- return cnt;
-
- for (i = 0; ret < 0 && mclass[i].oclass; i++) {
- for (j = 0; j < cnt; j++) {
- if (mclass[i].oclass == sclass[j].oclass &&
- mclass[i].version >= sclass[j].minver &&
- mclass[i].version <= sclass[j].maxver) {
- ret = i;
- break;
- }
- }
- }
-
- nouveau_object_sclass_put(&sclass);
- return ret;
-}
-
-static void
-nouveau_object_fini(struct nouveau_object *obj)
-{
- struct {
- struct nvif_ioctl_v0 ioctl;
- struct nvif_ioctl_del del;
- } args = {
- .ioctl.type = NVIF_IOCTL_V0_DEL,
- };
-
- if (obj->data) {
- abi16_delete(obj);
- free(obj->data);
- obj->data = NULL;
- return;
- }
-
- nouveau_object_ioctl(obj, &args, sizeof(args));
-}
-
-static int
-nouveau_object_init(struct nouveau_object *parent, uint32_t handle,
- int32_t oclass, void *data, uint32_t size,
- struct nouveau_object *obj)
-{
- struct nouveau_drm *drm = nouveau_drm(parent);
- struct {
- struct nvif_ioctl_v0 ioctl;
- struct nvif_ioctl_new_v0 new;
- } *args;
- uint32_t argc = sizeof(*args) + size;
- int (*func)(struct nouveau_object *);
- int ret = -ENOSYS;
-
- obj->parent = parent;
- obj->handle = handle;
- obj->oclass = oclass;
- obj->length = 0;
- obj->data = NULL;
-
- if (!abi16_object(obj, &func) && drm->nvif) {
- if (!(args = malloc(argc)))
- return -ENOMEM;
- args->ioctl.version = 0;
- args->ioctl.type = NVIF_IOCTL_V0_NEW;
- args->new.version = 0;
- args->new.route = NVIF_IOCTL_V0_ROUTE_NVIF;
- args->new.token = (unsigned long)(void *)obj;
- args->new.object = (unsigned long)(void *)obj;
- args->new.handle = handle;
- args->new.oclass = oclass;
- memcpy(args->new.data, data, size);
- ret = nouveau_object_ioctl(parent, args, argc);
- memcpy(data, args->new.data, size);
- free(args);
- } else
- if (func) {
- obj->length = size ? size : sizeof(struct nouveau_object *);
- if (!(obj->data = malloc(obj->length)))
- return -ENOMEM;
- if (data)
- memcpy(obj->data, data, obj->length);
- *(struct nouveau_object **)obj->data = obj;
-
- ret = func(obj);
- }
-
- if (ret) {
- nouveau_object_fini(obj);
- return ret;
- }
-
- return 0;
-}
-
-int
-nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
- uint32_t oclass, void *data, uint32_t length,
- struct nouveau_object **pobj)
-{
- struct nouveau_object *obj;
- int ret;
-
- if (!(obj = malloc(sizeof(*obj))))
- return -ENOMEM;
-
- ret = nouveau_object_init(parent, handle, oclass, data, length, obj);
- if (ret) {
- free(obj);
- return ret;
- }
-
- *pobj = obj;
- return 0;
-}
-
-void
-nouveau_object_del(struct nouveau_object **pobj)
-{
- struct nouveau_object *obj = *pobj;
- if (obj) {
- nouveau_object_fini(obj);
- free(obj);
- *pobj = NULL;
- }
-}
-
-void
-nouveau_drm_del(struct nouveau_drm **pdrm)
-{
- free(*pdrm);
- *pdrm = NULL;
-}
-
-int
-nouveau_drm_new(int fd, struct nouveau_drm **pdrm)
-{
- struct nouveau_drm *drm;
- drmVersionPtr ver;
-
-#ifdef DEBUG
- debug_init(getenv("NOUVEAU_LIBDRM_DEBUG"));
-#endif
-
- if (!(drm = calloc(1, sizeof(*drm))))
- return -ENOMEM;
- drm->fd = fd;
-
- if (!(ver = drmGetVersion(fd))) {
- nouveau_drm_del(&drm);
- return -EINVAL;
- }
- *pdrm = drm;
-
- drm->version = (ver->version_major << 24) |
- (ver->version_minor << 8) |
- ver->version_patchlevel;
- drm->nvif = (drm->version >= 0x01000301);
- drmFreeVersion(ver);
- return 0;
-}
-
/* this is the old libdrm's version of nouveau_device_wrap(), the symbol
* is kept here to prevent AIGLX from crashing if the DDX is linked against
* the new libdrm, but the DRI driver against the old
@@ -365,124 +71,80 @@ nouveau_device_open_existing(struct nouveau_device **pdev, int close, int fd,
}
int
-nouveau_device_new(struct nouveau_object *parent, int32_t oclass,
- void *data, uint32_t size, struct nouveau_device **pdev)
+nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev)
{
- struct nv_device_info_v0 info = {};
- union {
- struct nv_device_v0 v0;
- } *args = data;
- uint32_t argc = size;
- struct nouveau_drm *drm = nouveau_drm(parent);
- struct nouveau_device_priv *nvdev;
- struct nouveau_device *dev;
- uint64_t v;
+ struct nouveau_device_priv *nvdev = calloc(1, sizeof(*nvdev));
+ struct nouveau_device *dev = &nvdev->base;
+ uint64_t chipset, vram, gart, bousage;
+ drmVersionPtr ver;
+ int ret;
char *tmp;
- int ret = -ENOSYS;
- if (oclass != NV_DEVICE ||
- nvif_unpack(ret, &data, &size, args->v0, 0, 0, false))
- return ret;
+#ifdef DEBUG
+ debug_init(getenv("NOUVEAU_LIBDRM_DEBUG"));
+#endif
- if (!(nvdev = calloc(1, sizeof(*nvdev))))
+ if (!nvdev)
return -ENOMEM;
- dev = *pdev = &nvdev->base;
- dev->fd = -1;
+ ret = pthread_mutex_init(&nvdev->lock, NULL);
+ if (ret) {
+ free(nvdev);
+ return ret;
+ }
- if (drm->nvif) {
- ret = nouveau_object_init(parent, 0, oclass, args, argc,
- &dev->object);
- if (ret)
- goto done;
+ nvdev->base.fd = fd;
- info.version = 0;
+ ver = drmGetVersion(fd);
+ if (ver) dev->drm_version = (ver->version_major << 24) |
+ (ver->version_minor << 8) |
+ ver->version_patchlevel;
+ drmFreeVersion(ver);
- ret = nouveau_object_mthd(&dev->object, NV_DEVICE_V0_INFO,
- &info, sizeof(info));
- if (ret)
- goto done;
-
- nvdev->base.chipset = info.chipset;
- nvdev->have_bo_usage = true;
- } else
- if (args->v0.device == ~0ULL) {
- nvdev->base.object.parent = &drm->client;
- nvdev->base.object.handle = ~0ULL;
- nvdev->base.object.oclass = NOUVEAU_DEVICE_CLASS;
- nvdev->base.object.length = ~0;
-
- ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_CHIPSET_ID, &v);
- if (ret)
- goto done;
- nvdev->base.chipset = v;
+ if ( dev->drm_version != 0x00000010 &&
+ (dev->drm_version < 0x01000000 ||
+ dev->drm_version >= 0x02000000)) {
+ nouveau_device_del(&dev);
+ return -EINVAL;
+ }
- ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_HAS_BO_USAGE, &v);
- if (ret == 0)
- nvdev->have_bo_usage = (v != 0);
- } else
- return -ENOSYS;
+ ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_CHIPSET_ID, &chipset);
+ if (ret == 0)
+ ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_FB_SIZE, &vram);
+ if (ret == 0)
+ ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_AGP_SIZE, &gart);
+ if (ret) {
+ nouveau_device_del(&dev);
+ return ret;
+ }
- ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_FB_SIZE, &v);
- if (ret)
- goto done;
- nvdev->base.vram_size = v;
+ ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_HAS_BO_USAGE, &bousage);
+ if (ret == 0)
+ nvdev->have_bo_usage = (bousage != 0);
- ret = nouveau_getparam(dev, NOUVEAU_GETPARAM_AGP_SIZE, &v);
- if (ret)
- goto done;
- nvdev->base.gart_size = v;
+ nvdev->close = close;
tmp = getenv("NOUVEAU_LIBDRM_VRAM_LIMIT_PERCENT");
if (tmp)
nvdev->vram_limit_percent = atoi(tmp);
else
nvdev->vram_limit_percent = 80;
-
- nvdev->base.vram_limit =
- (nvdev->base.vram_size * nvdev->vram_limit_percent) / 100;
-
tmp = getenv("NOUVEAU_LIBDRM_GART_LIMIT_PERCENT");
if (tmp)
nvdev->gart_limit_percent = atoi(tmp);
else
nvdev->gart_limit_percent = 80;
-
+ DRMINITLISTHEAD(&nvdev->bo_list);
+ nvdev->base.object.oclass = NOUVEAU_DEVICE_CLASS;
+ nvdev->base.lib_version = 0x01000000;
+ nvdev->base.chipset = chipset;
+ nvdev->base.vram_size = vram;
+ nvdev->base.gart_size = gart;
+ nvdev->base.vram_limit =
+ (nvdev->base.vram_size * nvdev->vram_limit_percent) / 100;
nvdev->base.gart_limit =
(nvdev->base.gart_size * nvdev->gart_limit_percent) / 100;
- ret = pthread_mutex_init(&nvdev->lock, NULL);
- DRMINITLISTHEAD(&nvdev->bo_list);
-done:
- if (ret)
- nouveau_device_del(pdev);
- return ret;
-}
-
-int
-nouveau_device_wrap(int fd, int close, struct nouveau_device **pdev)
-{
- struct nouveau_drm *drm;
- struct nouveau_device_priv *nvdev;
- int ret;
-
- ret = nouveau_drm_new(fd, &drm);
- if (ret)
- return ret;
- drm->nvif = false;
-
- ret = nouveau_device_new(&drm->client, NV_DEVICE,
- &(struct nv_device_v0) {
- .device = ~0ULL,
- }, sizeof(struct nv_device_v0), pdev);
- if (ret) {
- nouveau_drm_del(&drm);
- return ret;
- }
-
- nvdev = nouveau_device(*pdev);
- nvdev->base.fd = drm->fd;
- nvdev->base.drm_version = drm->version;
- nvdev->close = close;
+ *pdev = &nvdev->base;
return 0;
}
@@ -503,15 +165,10 @@ nouveau_device_del(struct nouveau_device **pdev)
{
struct nouveau_device_priv *nvdev = nouveau_device(*pdev);
if (nvdev) {
+ if (nvdev->close)
+ drmClose(nvdev->base.fd);
free(nvdev->client);
pthread_mutex_destroy(&nvdev->lock);
- if (nvdev->base.fd >= 0) {
- struct nouveau_drm *drm =
- nouveau_drm(&nvdev->base.object);
- nouveau_drm_del(&drm);
- if (nvdev->close)
- drmClose(nvdev->base.fd);
- }
free(nvdev);
*pdev = NULL;
}
@@ -520,9 +177,8 @@ nouveau_device_del(struct nouveau_device **pdev)
int
nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value)
{
- struct nouveau_drm *drm = nouveau_drm(&dev->object);
struct drm_nouveau_getparam r = { .param = param };
- int fd = drm->fd, ret =
+ int fd = dev->fd, ret =
drmCommandWriteRead(fd, DRM_NOUVEAU_GETPARAM, &r, sizeof(r));
*value = r.value;
return ret;
@@ -531,9 +187,8 @@ nouveau_getparam(struct nouveau_device *dev, uint64_t param, uint64_t *value)
int
nouveau_setparam(struct nouveau_device *dev, uint64_t param, uint64_t value)
{
- struct nouveau_drm *drm = nouveau_drm(&dev->object);
struct drm_nouveau_setparam r = { .param = param, .value = value };
- return drmCommandWrite(drm->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r));
+ return drmCommandWrite(dev->fd, DRM_NOUVEAU_SETPARAM, &r, sizeof(r));
}
int
@@ -591,10 +246,106 @@ nouveau_client_del(struct nouveau_client **pclient)
}
}
+int
+nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
+ uint32_t oclass, void *data, uint32_t length,
+ struct nouveau_object **pobj)
+{
+ struct nouveau_device *dev;
+ struct nouveau_object *obj;
+ int ret = -EINVAL;
+
+ if (length == 0)
+ length = sizeof(struct nouveau_object *);
+ obj = malloc(sizeof(*obj) + length);
+ obj->parent = parent;
+ obj->handle = handle;
+ obj->oclass = oclass;
+ obj->length = length;
+ obj->data = obj + 1;
+ if (data)
+ memcpy(obj->data, data, length);
+ *(struct nouveau_object **)obj->data = obj;
+
+ dev = nouveau_object_find(obj, NOUVEAU_DEVICE_CLASS);
+ switch (parent->oclass) {
+ case NOUVEAU_DEVICE_CLASS:
+ switch (obj->oclass) {
+ case NOUVEAU_FIFO_CHANNEL_CLASS:
+ {
+ if (dev->chipset < 0xc0)
+ ret = abi16_chan_nv04(obj);
+ else
+ if (dev->chipset < 0xe0)
+ ret = abi16_chan_nvc0(obj);
+ else
+ ret = abi16_chan_nve0(obj);
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case NOUVEAU_FIFO_CHANNEL_CLASS:
+ switch (obj->oclass) {
+ case NOUVEAU_NOTIFIER_CLASS:
+ ret = abi16_ntfy(obj);
+ break;
+ default:
+ ret = abi16_engobj(obj);
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (ret) {
+ free(obj);
+ return ret;
+ }
+
+ *pobj = obj;
+ return 0;
+}
+
+void
+nouveau_object_del(struct nouveau_object **pobj)
+{
+ struct nouveau_object *obj = *pobj;
+ struct nouveau_device *dev;
+ if (obj) {
+ dev = nouveau_object_find(obj, NOUVEAU_DEVICE_CLASS);
+ if (obj->oclass == NOUVEAU_FIFO_CHANNEL_CLASS) {
+ struct drm_nouveau_channel_free req;
+ req.channel = obj->handle;
+ drmCommandWrite(dev->fd, DRM_NOUVEAU_CHANNEL_FREE,
+ &req, sizeof(req));
+ } else {
+ struct drm_nouveau_gpuobj_free req;
+ req.channel = obj->parent->handle;
+ req.handle = obj->handle;
+ drmCommandWrite(dev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
+ &req, sizeof(req));
+ }
+ }
+ free(obj);
+ *pobj = NULL;
+}
+
+void *
+nouveau_object_find(struct nouveau_object *obj, uint32_t pclass)
+{
+ while (obj && obj->oclass != pclass) {
+ obj = obj->parent;
+ if (pclass == NOUVEAU_PARENT_CLASS)
+ break;
+ }
+ return obj;
+}
+
static void
nouveau_bo_del(struct nouveau_bo *bo)
{
- struct nouveau_drm *drm = nouveau_drm(&bo->device->object);
struct nouveau_device_priv *nvdev = nouveau_device(bo->device);
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
struct drm_gem_close req = { .handle = bo->handle };
@@ -611,11 +362,11 @@ nouveau_bo_del(struct nouveau_bo *bo)
* might cause the bo to be closed accidentally while
* re-importing.
*/
- drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &req);
+ drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
}
pthread_mutex_unlock(&nvdev->lock);
} else {
- drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &req);
+ drmIoctl(bo->device->fd, DRM_IOCTL_GEM_CLOSE, &req);
}
if (bo->map)
drm_munmap(bo->map, bo->size);
@@ -652,7 +403,6 @@ static int
nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle,
struct nouveau_bo **pbo, int name)
{
- struct nouveau_drm *drm = nouveau_drm(&dev->object);
struct nouveau_device_priv *nvdev = nouveau_device(dev);
struct drm_nouveau_gem_info req = { .handle = handle };
struct nouveau_bo_priv *nvbo;
@@ -682,7 +432,7 @@ nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle,
}
}
- ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_GEM_INFO,
+ ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_GEM_INFO,
&req, sizeof(req));
if (ret)
return ret;
@@ -729,7 +479,6 @@ int
nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name,
struct nouveau_bo **pbo)
{
- struct nouveau_drm *drm = nouveau_drm(&dev->object);
struct nouveau_device_priv *nvdev = nouveau_device(dev);
struct nouveau_bo_priv *nvbo;
struct drm_gem_open req = { .name = name };
@@ -745,7 +494,7 @@ nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name,
}
}
- ret = drmIoctl(drm->fd, DRM_IOCTL_GEM_OPEN, &req);
+ ret = drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req);
if (ret == 0) {
ret = nouveau_bo_wrap_locked(dev, req.handle, pbo, name);
}
@@ -758,12 +507,11 @@ int
nouveau_bo_name_get(struct nouveau_bo *bo, uint32_t *name)
{
struct drm_gem_flink req = { .handle = bo->handle };
- struct nouveau_drm *drm = nouveau_drm(&bo->device->object);
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
*name = nvbo->name;
if (!*name) {
- int ret = drmIoctl(drm->fd, DRM_IOCTL_GEM_FLINK, &req);
+ int ret = drmIoctl(bo->device->fd, DRM_IOCTL_GEM_FLINK, &req);
if (ret) {
*name = 0;
@@ -794,7 +542,6 @@ int
nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
struct nouveau_bo **bo)
{
- struct nouveau_drm *drm = nouveau_drm(&dev->object);
struct nouveau_device_priv *nvdev = nouveau_device(dev);
int ret;
unsigned int handle;
@@ -802,7 +549,7 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
nouveau_bo_ref(NULL, bo);
pthread_mutex_lock(&nvdev->lock);
- ret = drmPrimeFDToHandle(drm->fd, prime_fd, &handle);
+ ret = drmPrimeFDToHandle(dev->fd, prime_fd, &handle);
if (ret == 0) {
ret = nouveau_bo_wrap_locked(dev, handle, bo, 0);
}
@@ -813,11 +560,10 @@ nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
int
nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd)
{
- struct nouveau_drm *drm = nouveau_drm(&bo->device->object);
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
int ret;
- ret = drmPrimeHandleToFD(drm->fd, nvbo->base.handle, DRM_CLOEXEC, prime_fd);
+ ret = drmPrimeHandleToFD(bo->device->fd, nvbo->base.handle, DRM_CLOEXEC, prime_fd);
if (ret)
return ret;
@@ -829,7 +575,6 @@ int
nouveau_bo_wait(struct nouveau_bo *bo, uint32_t access,
struct nouveau_client *client)
{
- struct nouveau_drm *drm = nouveau_drm(&bo->device->object);
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
struct drm_nouveau_gem_cpu_prep req;
struct nouveau_pushbuf *push;
@@ -853,7 +598,7 @@ nouveau_bo_wait(struct nouveau_bo *bo, uint32_t access,
if (access & NOUVEAU_BO_NOBLOCK)
req.flags |= NOUVEAU_GEM_CPU_PREP_NOWAIT;
- ret = drmCommandWrite(drm->fd, DRM_NOUVEAU_GEM_CPU_PREP,
+ ret = drmCommandWrite(bo->device->fd, DRM_NOUVEAU_GEM_CPU_PREP,
&req, sizeof(req));
if (ret == 0)
nvbo->access = 0;
@@ -864,11 +609,10 @@ int
nouveau_bo_map(struct nouveau_bo *bo, uint32_t access,
struct nouveau_client *client)
{
- struct nouveau_drm *drm = nouveau_drm(&bo->device->object);
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
if (bo->map == NULL) {
bo->map = drm_mmap(0, bo->size, PROT_READ | PROT_WRITE,
- MAP_SHARED, drm->fd, nvbo->map_handle);
+ MAP_SHARED, bo->device->fd, nvbo->map_handle);
if (bo->map == MAP_FAILED) {
bo->map = NULL;
return -errno;
diff --git a/chromium/third_party/libdrm/src/nouveau/nouveau.h b/chromium/third_party/libdrm/src/nouveau/nouveau.h
index 335ce77dca7..4adda0e3594 100644
--- a/chromium/third_party/libdrm/src/nouveau/nouveau.h
+++ b/chromium/third_party/libdrm/src/nouveau/nouveau.h
@@ -4,66 +4,76 @@
#include <stdint.h>
#include <stdbool.h>
-/* Supported class information, provided by the kernel */
-struct nouveau_sclass {
- int32_t oclass;
- int minver;
- int maxver;
-};
+#define NOUVEAU_DEVICE_CLASS 0x80000000
+#define NOUVEAU_FIFO_CHANNEL_CLASS 0x80000001
+#define NOUVEAU_NOTIFIER_CLASS 0x80000002
+#define NOUVEAU_PARENT_CLASS 0xffffffff
-/* Client-provided array describing class versions that are desired.
- *
- * These are used to match against the kernel's list of supported classes.
- */
-struct nouveau_mclass {
- int32_t oclass;
- int version;
- void *data;
+struct nouveau_list {
+ struct nouveau_list *prev;
+ struct nouveau_list *next;
};
struct nouveau_object {
struct nouveau_object *parent;
uint64_t handle;
uint32_t oclass;
- uint32_t length; /* deprecated */
- void *data; /* deprecated */
+ uint32_t length;
+ void *data;
};
-int nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
- uint32_t oclass, void *data, uint32_t length,
- struct nouveau_object **);
-void nouveau_object_del(struct nouveau_object **);
-int nouveau_object_mthd(struct nouveau_object *, uint32_t mthd,
- void *data, uint32_t size);
-int nouveau_object_sclass_get(struct nouveau_object *,
- struct nouveau_sclass **);
-void nouveau_object_sclass_put(struct nouveau_sclass **);
-int nouveau_object_mclass(struct nouveau_object *,
- const struct nouveau_mclass *);
+struct nouveau_fifo {
+ struct nouveau_object *object;
+ uint32_t channel;
+ uint32_t pushbuf;
+ uint64_t unused1[3];
+};
-struct nouveau_drm {
- struct nouveau_object client;
- int fd;
- uint32_t version;
- bool nvif;
+struct nv04_fifo {
+ struct nouveau_fifo base;
+ uint32_t vram;
+ uint32_t gart;
+ uint32_t notify;
+};
+
+struct nvc0_fifo {
+ struct nouveau_fifo base;
+ uint32_t notify;
+};
+
+#define NVE0_FIFO_ENGINE_GR 0x00000001
+#define NVE0_FIFO_ENGINE_VP 0x00000002
+#define NVE0_FIFO_ENGINE_PPP 0x00000004
+#define NVE0_FIFO_ENGINE_BSP 0x00000008
+#define NVE0_FIFO_ENGINE_CE0 0x00000010
+#define NVE0_FIFO_ENGINE_CE1 0x00000020
+#define NVE0_FIFO_ENGINE_ENC 0x00000040
+
+struct nve0_fifo {
+ struct {
+ struct nouveau_fifo base;
+ uint32_t notify;
+ };
+ uint32_t engine;
};
-static inline struct nouveau_drm *
-nouveau_drm(struct nouveau_object *obj)
-{
- while (obj && obj->parent)
- obj = obj->parent;
- return (struct nouveau_drm *)obj;
-}
+struct nv04_notify {
+ struct nouveau_object *object;
+ uint32_t offset;
+ uint32_t length;
+};
-int nouveau_drm_new(int fd, struct nouveau_drm **);
-void nouveau_drm_del(struct nouveau_drm **);
+int nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
+ uint32_t oclass, void *data, uint32_t length,
+ struct nouveau_object **);
+void nouveau_object_del(struct nouveau_object **);
+void *nouveau_object_find(struct nouveau_object *, uint32_t parent_class);
struct nouveau_device {
struct nouveau_object object;
- int fd; /* deprecated */
- uint32_t lib_version; /* deprecated */
- uint32_t drm_version; /* deprecated */
+ int fd;
+ uint32_t lib_version;
+ uint32_t drm_version;
uint32_t chipset;
uint64_t vram_size;
uint64_t gart_size;
@@ -71,23 +81,18 @@ struct nouveau_device {
uint64_t gart_limit;
};
-int nouveau_device_new(struct nouveau_object *parent, int32_t oclass,
- void *data, uint32_t size, struct nouveau_device **);
+int nouveau_device_wrap(int fd, int close, struct nouveau_device **);
+int nouveau_device_open(const char *busid, struct nouveau_device **);
void nouveau_device_del(struct nouveau_device **);
-
-int nouveau_getparam(struct nouveau_device *, uint64_t param, uint64_t *value);
-int nouveau_setparam(struct nouveau_device *, uint64_t param, uint64_t value);
-
-/* deprecated */
-int nouveau_device_wrap(int fd, int close, struct nouveau_device **);
-int nouveau_device_open(const char *busid, struct nouveau_device **);
+int nouveau_getparam(struct nouveau_device *, uint64_t param, uint64_t *value);
+int nouveau_setparam(struct nouveau_device *, uint64_t param, uint64_t value);
struct nouveau_client {
struct nouveau_device *device;
int id;
};
-int nouveau_client_new(struct nouveau_device *, struct nouveau_client **);
+int nouveau_client_new(struct nouveau_device *, struct nouveau_client **);
void nouveau_client_del(struct nouveau_client **);
union nouveau_bo_config {
@@ -134,27 +139,22 @@ struct nouveau_bo {
union nouveau_bo_config config;
};
-int nouveau_bo_new(struct nouveau_device *, uint32_t flags, uint32_t align,
- uint64_t size, union nouveau_bo_config *,
- struct nouveau_bo **);
-int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle,
+int nouveau_bo_new(struct nouveau_device *, uint32_t flags, uint32_t align,
+ uint64_t size, union nouveau_bo_config *,
struct nouveau_bo **);
-int nouveau_bo_name_ref(struct nouveau_device *v, uint32_t name,
- struct nouveau_bo **);
-int nouveau_bo_name_get(struct nouveau_bo *, uint32_t *name);
+int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle,
+ struct nouveau_bo **);
+int nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name,
+ struct nouveau_bo **);
+int nouveau_bo_name_get(struct nouveau_bo *, uint32_t *name);
void nouveau_bo_ref(struct nouveau_bo *, struct nouveau_bo **);
-int nouveau_bo_map(struct nouveau_bo *, uint32_t access,
- struct nouveau_client *);
-int nouveau_bo_wait(struct nouveau_bo *, uint32_t access,
+int nouveau_bo_map(struct nouveau_bo *, uint32_t access,
struct nouveau_client *);
-int nouveau_bo_prime_handle_ref(struct nouveau_device *, int prime_fd,
- struct nouveau_bo **);
-int nouveau_bo_set_prime(struct nouveau_bo *, int *prime_fd);
-
-struct nouveau_list {
- struct nouveau_list *prev;
- struct nouveau_list *next;
-};
+int nouveau_bo_wait(struct nouveau_bo *, uint32_t access,
+ struct nouveau_client *);
+int nouveau_bo_prime_handle_ref(struct nouveau_device *dev, int prime_fd,
+ struct nouveau_bo **);
+int nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd);
struct nouveau_bufref {
struct nouveau_list thead;
@@ -176,8 +176,8 @@ struct nouveau_bufctx {
int relocs;
};
-int nouveau_bufctx_new(struct nouveau_client *, int bins,
- struct nouveau_bufctx **);
+int nouveau_bufctx_new(struct nouveau_client *, int bins,
+ struct nouveau_bufctx **);
void nouveau_bufctx_del(struct nouveau_bufctx **);
struct nouveau_bufref *
nouveau_bufctx_refn(struct nouveau_bufctx *, int bin,
@@ -206,16 +206,16 @@ struct nouveau_pushbuf_refn {
uint32_t flags;
};
-int nouveau_pushbuf_new(struct nouveau_client *, struct nouveau_object *chan,
- int nr, uint32_t size, bool immediate,
- struct nouveau_pushbuf **);
+int nouveau_pushbuf_new(struct nouveau_client *, struct nouveau_object *channel,
+ int nr, uint32_t size, bool immediate,
+ struct nouveau_pushbuf **);
void nouveau_pushbuf_del(struct nouveau_pushbuf **);
-int nouveau_pushbuf_space(struct nouveau_pushbuf *, uint32_t dwords,
- uint32_t relocs, uint32_t pushes);
+int nouveau_pushbuf_space(struct nouveau_pushbuf *, uint32_t dwords,
+ uint32_t relocs, uint32_t pushes);
void nouveau_pushbuf_data(struct nouveau_pushbuf *, struct nouveau_bo *,
uint64_t offset, uint64_t length);
-int nouveau_pushbuf_refn(struct nouveau_pushbuf *,
- struct nouveau_pushbuf_refn *, int nr);
+int nouveau_pushbuf_refn(struct nouveau_pushbuf *,
+ struct nouveau_pushbuf_refn *, int nr);
/* Emits a reloc into the push buffer at the current position, you *must*
* have previously added the referenced buffer to a buffer context, and
* validated it against the current push buffer.
@@ -223,54 +223,10 @@ int nouveau_pushbuf_refn(struct nouveau_pushbuf *,
void nouveau_pushbuf_reloc(struct nouveau_pushbuf *, struct nouveau_bo *,
uint32_t data, uint32_t flags,
uint32_t vor, uint32_t tor);
-int nouveau_pushbuf_validate(struct nouveau_pushbuf *);
+int nouveau_pushbuf_validate(struct nouveau_pushbuf *);
uint32_t nouveau_pushbuf_refd(struct nouveau_pushbuf *, struct nouveau_bo *);
-int nouveau_pushbuf_kick(struct nouveau_pushbuf *, struct nouveau_object *chan);
+int nouveau_pushbuf_kick(struct nouveau_pushbuf *, struct nouveau_object *channel);
struct nouveau_bufctx *
nouveau_pushbuf_bufctx(struct nouveau_pushbuf *, struct nouveau_bufctx *);
-#define NOUVEAU_DEVICE_CLASS 0x80000000
-#define NOUVEAU_FIFO_CHANNEL_CLASS 0x80000001
-#define NOUVEAU_NOTIFIER_CLASS 0x80000002
-
-struct nouveau_fifo {
- struct nouveau_object *object;
- uint32_t channel;
- uint32_t pushbuf;
- uint64_t unused1[3];
-};
-
-struct nv04_fifo {
- struct nouveau_fifo base;
- uint32_t vram;
- uint32_t gart;
- uint32_t notify;
-};
-
-struct nvc0_fifo {
- struct nouveau_fifo base;
- uint32_t notify;
-};
-
-#define NVE0_FIFO_ENGINE_GR 0x00000001
-#define NVE0_FIFO_ENGINE_VP 0x00000002
-#define NVE0_FIFO_ENGINE_PPP 0x00000004
-#define NVE0_FIFO_ENGINE_BSP 0x00000008
-#define NVE0_FIFO_ENGINE_CE0 0x00000010
-#define NVE0_FIFO_ENGINE_CE1 0x00000020
-#define NVE0_FIFO_ENGINE_ENC 0x00000040
-
-struct nve0_fifo {
- struct {
- struct nouveau_fifo base;
- uint32_t notify;
- };
- uint32_t engine;
-};
-
-struct nv04_notify {
- struct nouveau_object *object;
- uint32_t offset;
- uint32_t length;
-};
#endif
diff --git a/chromium/third_party/libdrm/src/nouveau/nvif/cl0080.h b/chromium/third_party/libdrm/src/nouveau/nvif/cl0080.h
deleted file mode 100644
index 331620a52af..00000000000
--- a/chromium/third_party/libdrm/src/nouveau/nvif/cl0080.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef __NVIF_CL0080_H__
-#define __NVIF_CL0080_H__
-
-struct nv_device_v0 {
- __u8 version;
- __u8 pad01[7];
- __u64 device; /* device identifier, ~0 for client default */
-};
-
-#define NV_DEVICE_V0_INFO 0x00
-#define NV_DEVICE_V0_TIME 0x01
-
-struct nv_device_info_v0 {
- __u8 version;
-#define NV_DEVICE_INFO_V0_IGP 0x00
-#define NV_DEVICE_INFO_V0_PCI 0x01
-#define NV_DEVICE_INFO_V0_AGP 0x02
-#define NV_DEVICE_INFO_V0_PCIE 0x03
-#define NV_DEVICE_INFO_V0_SOC 0x04
- __u8 platform;
- __u16 chipset; /* from NV_PMC_BOOT_0 */
- __u8 revision; /* from NV_PMC_BOOT_0 */
-#define NV_DEVICE_INFO_V0_TNT 0x01
-#define NV_DEVICE_INFO_V0_CELSIUS 0x02
-#define NV_DEVICE_INFO_V0_KELVIN 0x03
-#define NV_DEVICE_INFO_V0_RANKINE 0x04
-#define NV_DEVICE_INFO_V0_CURIE 0x05
-#define NV_DEVICE_INFO_V0_TESLA 0x06
-#define NV_DEVICE_INFO_V0_FERMI 0x07
-#define NV_DEVICE_INFO_V0_KEPLER 0x08
-#define NV_DEVICE_INFO_V0_MAXWELL 0x09
- __u8 family;
- __u8 pad06[2];
- __u64 ram_size;
- __u64 ram_user;
- char chip[16];
- char name[64];
-};
-
-struct nv_device_time_v0 {
- __u8 version;
- __u8 pad01[7];
- __u64 time;
-};
-#endif
diff --git a/chromium/third_party/libdrm/src/nouveau/nvif/cl9097.h b/chromium/third_party/libdrm/src/nouveau/nvif/cl9097.h
deleted file mode 100644
index 4057676d298..00000000000
--- a/chromium/third_party/libdrm/src/nouveau/nvif/cl9097.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef __NVIF_CL9097_H__
-#define __NVIF_CL9097_H__
-
-#define FERMI_A_ZBC_COLOR 0x00
-#define FERMI_A_ZBC_DEPTH 0x01
-
-struct fermi_a_zbc_color_v0 {
- __u8 version;
-#define FERMI_A_ZBC_COLOR_V0_FMT_ZERO 0x01
-#define FERMI_A_ZBC_COLOR_V0_FMT_UNORM_ONE 0x02
-#define FERMI_A_ZBC_COLOR_V0_FMT_RF32_GF32_BF32_AF32 0x04
-#define FERMI_A_ZBC_COLOR_V0_FMT_R16_G16_B16_A16 0x08
-#define FERMI_A_ZBC_COLOR_V0_FMT_RN16_GN16_BN16_AN16 0x0c
-#define FERMI_A_ZBC_COLOR_V0_FMT_RS16_GS16_BS16_AS16 0x10
-#define FERMI_A_ZBC_COLOR_V0_FMT_RU16_GU16_BU16_AU16 0x14
-#define FERMI_A_ZBC_COLOR_V0_FMT_RF16_GF16_BF16_AF16 0x16
-#define FERMI_A_ZBC_COLOR_V0_FMT_A8R8G8B8 0x18
-#define FERMI_A_ZBC_COLOR_V0_FMT_A8RL8GL8BL8 0x1c
-#define FERMI_A_ZBC_COLOR_V0_FMT_A2B10G10R10 0x20
-#define FERMI_A_ZBC_COLOR_V0_FMT_AU2BU10GU10RU10 0x24
-#define FERMI_A_ZBC_COLOR_V0_FMT_A8B8G8R8 0x28
-#define FERMI_A_ZBC_COLOR_V0_FMT_A8BL8GL8RL8 0x2c
-#define FERMI_A_ZBC_COLOR_V0_FMT_AN8BN8GN8RN8 0x30
-#define FERMI_A_ZBC_COLOR_V0_FMT_AS8BS8GS8RS8 0x34
-#define FERMI_A_ZBC_COLOR_V0_FMT_AU8BU8GU8RU8 0x38
-#define FERMI_A_ZBC_COLOR_V0_FMT_A2R10G10B10 0x3c
-#define FERMI_A_ZBC_COLOR_V0_FMT_BF10GF11RF11 0x40
- __u8 format;
- __u8 index;
- __u8 pad03[5];
- __u32 ds[4];
- __u32 l2[4];
-};
-
-struct fermi_a_zbc_depth_v0 {
- __u8 version;
-#define FERMI_A_ZBC_DEPTH_V0_FMT_FP32 0x01
- __u8 format;
- __u8 index;
- __u8 pad03[5];
- __u32 ds;
- __u32 l2;
-};
-#endif
diff --git a/chromium/third_party/libdrm/src/nouveau/nvif/class.h b/chromium/third_party/libdrm/src/nouveau/nvif/class.h
deleted file mode 100644
index 4179cd65ac0..00000000000
--- a/chromium/third_party/libdrm/src/nouveau/nvif/class.h
+++ /dev/null
@@ -1,141 +0,0 @@
-#ifndef __NVIF_CLASS_H__
-#define __NVIF_CLASS_H__
-
-/* these class numbers are made up by us, and not nvidia-assigned */
-#define NVIF_CLASS_CONTROL /* if0001.h */ -1
-#define NVIF_CLASS_PERFMON /* if0002.h */ -2
-#define NVIF_CLASS_PERFDOM /* if0003.h */ -3
-#define NVIF_CLASS_SW_NV04 /* if0004.h */ -4
-#define NVIF_CLASS_SW_NV10 /* if0005.h */ -5
-#define NVIF_CLASS_SW_NV50 /* if0005.h */ -6
-#define NVIF_CLASS_SW_GF100 /* if0005.h */ -7
-
-/* the below match nvidia-assigned (either in hw, or sw) class numbers */
-#define NV_DEVICE /* cl0080.h */ 0x00000080
-
-#define NV_DMA_FROM_MEMORY /* cl0002.h */ 0x00000002
-#define NV_DMA_TO_MEMORY /* cl0002.h */ 0x00000003
-#define NV_DMA_IN_MEMORY /* cl0002.h */ 0x0000003d
-
-#define FERMI_TWOD_A 0x0000902d
-
-#define FERMI_MEMORY_TO_MEMORY_FORMAT_A 0x00009039
-
-#define KEPLER_INLINE_TO_MEMORY_A 0x0000a040
-#define KEPLER_INLINE_TO_MEMORY_B 0x0000a140
-
-#define NV04_DISP /* cl0046.h */ 0x00000046
-
-#define NV03_CHANNEL_DMA /* cl506b.h */ 0x0000006b
-#define NV10_CHANNEL_DMA /* cl506b.h */ 0x0000006e
-#define NV17_CHANNEL_DMA /* cl506b.h */ 0x0000176e
-#define NV40_CHANNEL_DMA /* cl506b.h */ 0x0000406e
-#define NV50_CHANNEL_DMA /* cl506e.h */ 0x0000506e
-#define G82_CHANNEL_DMA /* cl826e.h */ 0x0000826e
-
-#define NV50_CHANNEL_GPFIFO /* cl506f.h */ 0x0000506f
-#define G82_CHANNEL_GPFIFO /* cl826f.h */ 0x0000826f
-#define FERMI_CHANNEL_GPFIFO /* cl906f.h */ 0x0000906f
-#define KEPLER_CHANNEL_GPFIFO_A /* cla06f.h */ 0x0000a06f
-#define MAXWELL_CHANNEL_GPFIFO_A /* cla06f.h */ 0x0000b06f
-
-#define NV50_DISP /* cl5070.h */ 0x00005070
-#define G82_DISP /* cl5070.h */ 0x00008270
-#define GT200_DISP /* cl5070.h */ 0x00008370
-#define GT214_DISP /* cl5070.h */ 0x00008570
-#define GT206_DISP /* cl5070.h */ 0x00008870
-#define GF110_DISP /* cl5070.h */ 0x00009070
-#define GK104_DISP /* cl5070.h */ 0x00009170
-#define GK110_DISP /* cl5070.h */ 0x00009270
-#define GM107_DISP /* cl5070.h */ 0x00009470
-#define GM204_DISP /* cl5070.h */ 0x00009570
-
-#define NV31_MPEG 0x00003174
-#define G82_MPEG 0x00008274
-
-#define NV74_VP2 0x00007476
-
-#define NV50_DISP_CURSOR /* cl507a.h */ 0x0000507a
-#define G82_DISP_CURSOR /* cl507a.h */ 0x0000827a
-#define GT214_DISP_CURSOR /* cl507a.h */ 0x0000857a
-#define GF110_DISP_CURSOR /* cl507a.h */ 0x0000907a
-#define GK104_DISP_CURSOR /* cl507a.h */ 0x0000917a
-
-#define NV50_DISP_OVERLAY /* cl507b.h */ 0x0000507b
-#define G82_DISP_OVERLAY /* cl507b.h */ 0x0000827b
-#define GT214_DISP_OVERLAY /* cl507b.h */ 0x0000857b
-#define GF110_DISP_OVERLAY /* cl507b.h */ 0x0000907b
-#define GK104_DISP_OVERLAY /* cl507b.h */ 0x0000917b
-
-#define NV50_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000507c
-#define G82_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000827c
-#define GT200_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000837c
-#define GT214_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000857c
-#define GF110_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000907c
-#define GK104_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000917c
-#define GK110_DISP_BASE_CHANNEL_DMA /* cl507c.h */ 0x0000927c
-
-#define NV50_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000507d
-#define G82_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000827d
-#define GT200_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000837d
-#define GT214_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000857d
-#define GT206_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000887d
-#define GF110_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000907d
-#define GK104_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000917d
-#define GK110_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000927d
-#define GM107_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000947d
-#define GM204_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000957d
-
-#define NV50_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000507e
-#define G82_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000827e
-#define GT200_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000837e
-#define GT214_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000857e
-#define GF110_DISP_OVERLAY_CONTROL_DMA /* cl507e.h */ 0x0000907e
-#define GK104_DISP_OVERLAY_CONTROL_DMA /* cl507e.h */ 0x0000917e
-
-#define FERMI_A /* cl9097.h */ 0x00009097
-#define FERMI_B /* cl9097.h */ 0x00009197
-#define FERMI_C /* cl9097.h */ 0x00009297
-
-#define KEPLER_A /* cl9097.h */ 0x0000a097
-#define KEPLER_B /* cl9097.h */ 0x0000a197
-#define KEPLER_C /* cl9097.h */ 0x0000a297
-
-#define MAXWELL_A /* cl9097.h */ 0x0000b097
-#define MAXWELL_B /* cl9097.h */ 0x0000b197
-
-#define NV74_BSP 0x000074b0
-
-#define GT212_MSVLD 0x000085b1
-#define IGT21A_MSVLD 0x000086b1
-#define G98_MSVLD 0x000088b1
-#define GF100_MSVLD 0x000090b1
-#define GK104_MSVLD 0x000095b1
-
-#define GT212_MSPDEC 0x000085b2
-#define G98_MSPDEC 0x000088b2
-#define GF100_MSPDEC 0x000090b2
-#define GK104_MSPDEC 0x000095b2
-
-#define GT212_MSPPP 0x000085b3
-#define G98_MSPPP 0x000088b3
-#define GF100_MSPPP 0x000090b3
-
-#define G98_SEC 0x000088b4
-
-#define GT212_DMA 0x000085b5
-#define FERMI_DMA 0x000090b5
-#define KEPLER_DMA_COPY_A 0x0000a0b5
-#define MAXWELL_DMA_COPY_A 0x0000b0b5
-
-#define FERMI_DECOMPRESS 0x000090b8
-
-#define FERMI_COMPUTE_A 0x000090c0
-#define FERMI_COMPUTE_B 0x000091c0
-#define KEPLER_COMPUTE_A 0x0000a0c0
-#define KEPLER_COMPUTE_B 0x0000a1c0
-#define MAXWELL_COMPUTE_A 0x0000b0c0
-#define MAXWELL_COMPUTE_B 0x0000b1c0
-
-#define NV74_CIPHER 0x000074c1
-#endif
diff --git a/chromium/third_party/libdrm/src/nouveau/nvif/if0002.h b/chromium/third_party/libdrm/src/nouveau/nvif/if0002.h
deleted file mode 100644
index c04c91d0b81..00000000000
--- a/chromium/third_party/libdrm/src/nouveau/nvif/if0002.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef __NVIF_IF0002_H__
-#define __NVIF_IF0002_H__
-
-#define NVIF_PERFMON_V0_QUERY_DOMAIN 0x00
-#define NVIF_PERFMON_V0_QUERY_SIGNAL 0x01
-#define NVIF_PERFMON_V0_QUERY_SOURCE 0x02
-
-struct nvif_perfmon_query_domain_v0 {
- __u8 version;
- __u8 id;
- __u8 counter_nr;
- __u8 iter;
- __u16 signal_nr;
- __u8 pad05[2];
- char name[64];
-};
-
-struct nvif_perfmon_query_signal_v0 {
- __u8 version;
- __u8 domain;
- __u16 iter;
- __u8 signal;
- __u8 source_nr;
- __u8 pad05[2];
- char name[64];
-};
-
-struct nvif_perfmon_query_source_v0 {
- __u8 version;
- __u8 domain;
- __u8 signal;
- __u8 iter;
- __u8 pad04[4];
- __u32 source;
- __u32 mask;
- char name[64];
-};
-#endif
diff --git a/chromium/third_party/libdrm/src/nouveau/nvif/if0003.h b/chromium/third_party/libdrm/src/nouveau/nvif/if0003.h
deleted file mode 100644
index 0cd03efb80a..00000000000
--- a/chromium/third_party/libdrm/src/nouveau/nvif/if0003.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __NVIF_IF0003_H__
-#define __NVIF_IF0003_H__
-
-struct nvif_perfdom_v0 {
- __u8 version;
- __u8 domain;
- __u8 mode;
- __u8 pad03[1];
- struct {
- __u8 signal[4];
- __u64 source[4][8];
- __u16 logic_op;
- } ctr[4];
-};
-
-#define NVIF_PERFDOM_V0_INIT 0x00
-#define NVIF_PERFDOM_V0_SAMPLE 0x01
-#define NVIF_PERFDOM_V0_READ 0x02
-
-struct nvif_perfdom_init {
-};
-
-struct nvif_perfdom_sample {
-};
-
-struct nvif_perfdom_read_v0 {
- __u8 version;
- __u8 pad01[7];
- __u32 ctr[4];
- __u32 clk;
- __u8 pad04[4];
-};
-#endif
diff --git a/chromium/third_party/libdrm/src/nouveau/nvif/ioctl.h b/chromium/third_party/libdrm/src/nouveau/nvif/ioctl.h
deleted file mode 100644
index c5f5eb83a59..00000000000
--- a/chromium/third_party/libdrm/src/nouveau/nvif/ioctl.h
+++ /dev/null
@@ -1,132 +0,0 @@
-#ifndef __NVIF_IOCTL_H__
-#define __NVIF_IOCTL_H__
-
-#define NVIF_VERSION_LATEST 0x0000000000000000ULL
-
-struct nvif_ioctl_v0 {
- __u8 version;
-#define NVIF_IOCTL_V0_NOP 0x00
-#define NVIF_IOCTL_V0_SCLASS 0x01
-#define NVIF_IOCTL_V0_NEW 0x02
-#define NVIF_IOCTL_V0_DEL 0x03
-#define NVIF_IOCTL_V0_MTHD 0x04
-#define NVIF_IOCTL_V0_RD 0x05
-#define NVIF_IOCTL_V0_WR 0x06
-#define NVIF_IOCTL_V0_MAP 0x07
-#define NVIF_IOCTL_V0_UNMAP 0x08
-#define NVIF_IOCTL_V0_NTFY_NEW 0x09
-#define NVIF_IOCTL_V0_NTFY_DEL 0x0a
-#define NVIF_IOCTL_V0_NTFY_GET 0x0b
-#define NVIF_IOCTL_V0_NTFY_PUT 0x0c
- __u8 type;
- __u8 pad02[4];
-#define NVIF_IOCTL_V0_OWNER_NVIF 0x00
-#define NVIF_IOCTL_V0_OWNER_ANY 0xff
- __u8 owner;
-#define NVIF_IOCTL_V0_ROUTE_NVIF 0x00
-#define NVIF_IOCTL_V0_ROUTE_HIDDEN 0xff
- __u8 route;
- __u64 token;
- __u64 object;
- __u8 data[]; /* ioctl data (below) */
-};
-
-struct nvif_ioctl_nop_v0 {
- __u64 version;
-};
-
-struct nvif_ioctl_sclass_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 count;
- __u8 pad02[6];
- struct nvif_ioctl_sclass_oclass_v0 {
- __s32 oclass;
- __s16 minver;
- __s16 maxver;
- } oclass[];
-};
-
-struct nvif_ioctl_new_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 pad01[6];
- __u8 route;
- __u64 token;
- __u64 object;
- __u32 handle;
- __s32 oclass;
- __u8 data[]; /* class data (class.h) */
-};
-
-struct nvif_ioctl_del {
-};
-
-struct nvif_ioctl_rd_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 size;
- __u8 pad02[2];
- __u32 data;
- __u64 addr;
-};
-
-struct nvif_ioctl_wr_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 size;
- __u8 pad02[2];
- __u32 data;
- __u64 addr;
-};
-
-struct nvif_ioctl_map_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 pad01[3];
- __u32 length;
- __u64 handle;
-};
-
-struct nvif_ioctl_unmap {
-};
-
-struct nvif_ioctl_ntfy_new_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 event;
- __u8 index;
- __u8 pad03[5];
- __u8 data[]; /* event request data (event.h) */
-};
-
-struct nvif_ioctl_ntfy_del_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 index;
- __u8 pad02[6];
-};
-
-struct nvif_ioctl_ntfy_get_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 index;
- __u8 pad02[6];
-};
-
-struct nvif_ioctl_ntfy_put_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 index;
- __u8 pad02[6];
-};
-
-struct nvif_ioctl_mthd_v0 {
- /* nvif_ioctl ... */
- __u8 version;
- __u8 method;
- __u8 pad02[6];
- __u8 data[]; /* method data (class.h) */
-};
-
-#endif
diff --git a/chromium/third_party/libdrm/src/nouveau/nvif/unpack.h b/chromium/third_party/libdrm/src/nouveau/nvif/unpack.h
deleted file mode 100644
index 751bcf4930a..00000000000
--- a/chromium/third_party/libdrm/src/nouveau/nvif/unpack.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __NVIF_UNPACK_H__
-#define __NVIF_UNPACK_H__
-
-#define nvif_unvers(r,d,s,m) ({ \
- void **_data = (d); __u32 *_size = (s); int _ret = (r); \
- if (_ret == -ENOSYS && *_size == sizeof(m)) { \
- *_data = NULL; \
- *_size = _ret = 0; \
- } \
- _ret; \
-})
-
-#define nvif_unpack(r,d,s,m,vl,vh,x) ({ \
- void **_data = (d); __u32 *_size = (s); \
- int _ret = (r), _vl = (vl), _vh = (vh); \
- if (_ret == -ENOSYS && *_size >= sizeof(m) && \
- (m).version >= _vl && (m).version <= _vh) { \
- *_data = (__u8 *)*_data + sizeof(m); \
- *_size = *_size - sizeof(m); \
- if (_ret = 0, !(x)) { \
- _ret = *_size ? -E2BIG : 0; \
- *_data = NULL; \
- *_size = 0; \
- } \
- } \
- _ret; \
-})
-#endif
diff --git a/chromium/third_party/libdrm/src/nouveau/private.h b/chromium/third_party/libdrm/src/nouveau/private.h
index 83060f96524..e9439f30826 100644
--- a/chromium/third_party/libdrm/src/nouveau/private.h
+++ b/chromium/third_party/libdrm/src/nouveau/private.h
@@ -114,9 +114,11 @@ int
nouveau_device_open_existing(struct nouveau_device **, int, int, drm_context_t);
/* abi16.c */
-drm_private bool abi16_object(struct nouveau_object *, int (**)(struct nouveau_object *));
-drm_private void abi16_delete(struct nouveau_object *);
-drm_private int abi16_sclass(struct nouveau_object *, struct nouveau_sclass **);
+drm_private int abi16_chan_nv04(struct nouveau_object *);
+drm_private int abi16_chan_nvc0(struct nouveau_object *);
+drm_private int abi16_chan_nve0(struct nouveau_object *);
+drm_private int abi16_engobj(struct nouveau_object *);
+drm_private int abi16_ntfy(struct nouveau_object *);
drm_private void abi16_bo_info(struct nouveau_bo *, struct drm_nouveau_gem_info *);
drm_private int abi16_bo_init(struct nouveau_bo *, uint32_t alignment,
union nouveau_bo_config *);
diff --git a/chromium/third_party/libdrm/src/nouveau/pushbuf.c b/chromium/third_party/libdrm/src/nouveau/pushbuf.c
index 035e3019f2c..8e7dcdfaa19 100644
--- a/chromium/third_party/libdrm/src/nouveau/pushbuf.c
+++ b/chromium/third_party/libdrm/src/nouveau/pushbuf.c
@@ -312,7 +312,6 @@ pushbuf_submit(struct nouveau_pushbuf *push, struct nouveau_object *chan)
struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(push);
struct nouveau_pushbuf_krec *krec = nvpb->list;
struct nouveau_device *dev = push->client->device;
- struct nouveau_drm *drm = nouveau_drm(&dev->object);
struct drm_nouveau_gem_pushbuf_bo_presumed *info;
struct drm_nouveau_gem_pushbuf_bo *kref;
struct drm_nouveau_gem_pushbuf req;
@@ -346,7 +345,7 @@ pushbuf_submit(struct nouveau_pushbuf *push, struct nouveau_object *chan)
pushbuf_dump(krec, krec_id++, fifo->channel);
#ifndef SIMULATE
- ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_GEM_PUSHBUF,
+ ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_GEM_PUSHBUF,
&req, sizeof(req));
nvpb->suffix0 = req.suffix0;
nvpb->suffix1 = req.suffix1;
@@ -537,7 +536,7 @@ nouveau_pushbuf_new(struct nouveau_client *client, struct nouveau_object *chan,
int nr, uint32_t size, bool immediate,
struct nouveau_pushbuf **ppush)
{
- struct nouveau_drm *drm = nouveau_drm(&client->device->object);
+ struct nouveau_device *dev = client->device;
struct nouveau_fifo *fifo = chan->data;
struct nouveau_pushbuf_priv *nvpb;
struct nouveau_pushbuf *push;
@@ -552,7 +551,7 @@ nouveau_pushbuf_new(struct nouveau_client *client, struct nouveau_object *chan,
*/
req.channel = fifo->channel;
req.nr_push = 0;
- ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_GEM_PUSHBUF,
+ ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_GEM_PUSHBUF,
&req, sizeof(req));
if (ret)
return ret;
diff --git a/chromium/third_party/libdrm/src/radeon/Android.mk b/chromium/third_party/libdrm/src/radeon/Android.mk
index e70444354de..ace34080fc8 100644
--- a/chromium/third_party/libdrm/src/radeon/Android.mk
+++ b/chromium/third_party/libdrm/src/radeon/Android.mk
@@ -9,7 +9,7 @@ LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libdrm
-LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_RADEON_FILES))
+LOCAL_SRC_FILES := $(LIBDRM_RADEON_FILES)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_CFLAGS := \
diff --git a/chromium/third_party/libdrm/src/radeon/Makefile.am b/chromium/third_party/libdrm/src/radeon/Makefile.am
index e241531488c..25c03d3cb3c 100644
--- a/chromium/third_party/libdrm/src/radeon/Makefile.am
+++ b/chromium/third_party/libdrm/src/radeon/Makefile.am
@@ -43,5 +43,4 @@ libdrm_radeoninclude_HEADERS = $(LIBDRM_RADEON_H_FILES)
pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = libdrm_radeon.pc
-TESTS = radeon-symbol-check
-EXTRA_DIST = $(LIBDRM_RADEON_BOF_FILES) $(TESTS)
+EXTRA_DIST = Android.mk $(LIBDRM_RADEON_BOF_FILES) $(TESTS)
diff --git a/chromium/third_party/libdrm/src/radeon/libdrm_radeon.pc.in b/chromium/third_party/libdrm/src/radeon/libdrm_radeon.pc.in
index 432993a376a..68ef0ab1452 100644
--- a/chromium/third_party/libdrm/src/radeon/libdrm_radeon.pc.in
+++ b/chromium/third_party/libdrm/src/radeon/libdrm_radeon.pc.in
@@ -8,4 +8,3 @@ Description: Userspace interface to kernel DRM services for radeon
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -ldrm_radeon
Cflags: -I${includedir} -I${includedir}/libdrm
-Requires.private: libdrm
diff --git a/chromium/third_party/libdrm/src/radeon/radeon_bo_gem.c b/chromium/third_party/libdrm/src/radeon/radeon_bo_gem.c
index fbd453d9c7e..c9fe19ff40c 100644
--- a/chromium/third_party/libdrm/src/radeon/radeon_bo_gem.c
+++ b/chromium/third_party/libdrm/src/radeon/radeon_bo_gem.c
@@ -103,7 +103,7 @@ static struct radeon_bo *bo_open(struct radeon_bo_manager *bom,
args.size = size;
args.alignment = alignment;
args.initial_domain = bo->base.domains;
- args.flags = flags;
+ args.flags = 0;
args.handle = 0;
r = drmCommandWriteRead(bom->fd, DRM_RADEON_GEM_CREATE,
&args, sizeof(args));
diff --git a/chromium/third_party/libdrm/src/radeon/radeon_cs_gem.c b/chromium/third_party/libdrm/src/radeon/radeon_cs_gem.c
index 23f33af4cab..cdec64e0bf1 100644
--- a/chromium/third_party/libdrm/src/radeon/radeon_cs_gem.c
+++ b/chromium/third_party/libdrm/src/radeon/radeon_cs_gem.c
@@ -323,7 +323,7 @@ static int cs_gem_end(struct radeon_cs_int *cs,
return -EPIPE;
}
if (cs->section_ndw != cs->section_cdw) {
- fprintf(stderr, "CS section size mismatch start at (%s,%s,%d) %d vs %d\n",
+ fprintf(stderr, "CS section size missmatch start at (%s,%s,%d) %d vs %d\n",
cs->section_file, cs->section_func, cs->section_line, cs->section_ndw, cs->section_cdw);
fprintf(stderr, "CS section end at (%s,%s,%d)\n",
file, func, line);
diff --git a/chromium/third_party/libdrm/src/radeon/radeon_surface.c b/chromium/third_party/libdrm/src/radeon/radeon_surface.c
index 1424660daae..5ec97454dcd 100644
--- a/chromium/third_party/libdrm/src/radeon/radeon_surface.c
+++ b/chromium/third_party/libdrm/src/radeon/radeon_surface.c
@@ -957,10 +957,8 @@ static int eg_surface_best(struct radeon_surface_manager *surf_man,
}
surf->stencil_tile_split = 64;
} else {
- /* tile split must be >= 256 for colorbuffer surfaces,
- * SAMPLE_SPLIT = tile_split / (bpe * 64), the optimal value is 2
- */
- surf->tile_split = MAX2(2 * surf->bpe * 64, 256);
+ /* tile split must be >= 256 for colorbuffer surfaces */
+ surf->tile_split = MAX2(surf->nsamples * surf->bpe * 64, 256);
if (surf->tile_split > 4096)
surf->tile_split = 4096;
}
diff --git a/chromium/third_party/libdrm/src/rockchip/Android.mk b/chromium/third_party/libdrm/src/rockchip/Android.mk
deleted file mode 100644
index 4569044ea18..00000000000
--- a/chromium/third_party/libdrm/src/rockchip/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libdrm_rockchip
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-LOCAL_SRC_FILES := rockchip_drm.c
-LOCAL_EXPORT_C_INCLUDE_DIRS += \
- $(LOCAL_PATH)/rockchip
-
-LOCAL_C_INCLUDES := \
- $(LIBDRM_TOP) \
- $(LIBDRM_TOP)/rockchip \
- $(LIBDRM_TOP)/include/drm
-
-LOCAL_CFLAGS := \
- -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
-
-LOCAL_COPY_HEADERS := rockchip_drm.h rockchip_drmif.h
-LOCAL_COPY_HEADERS_TO := libdrm
-
-LOCAL_SHARED_LIBRARIES := \
- libdrm
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/chromium/third_party/libdrm/src/rockchip/Makefile.am b/chromium/third_party/libdrm/src/rockchip/Makefile.am
deleted file mode 100644
index 2ebb82f18e2..00000000000
--- a/chromium/third_party/libdrm/src/rockchip/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-AM_CFLAGS = \
- $(WARN_CFLAGS) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/rockchip \
- $(PTHREADSTUBS_CFLAGS) \
- -I$(top_srcdir)/include/drm
-
-libdrm_rockchip_la_LTLIBRARIES = libdrm_rockchip.la
-libdrm_rockchip_ladir = $(libdir)
-libdrm_rockchip_la_LDFLAGS = -version-number 1:0:0 -no-undefined
-libdrm_rockchip_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
-
-libdrm_rockchip_la_SOURCES = \
- rockchip_drm.c
-
-libdrm_rockchipincludedir = ${includedir}/libdrm
-libdrm_rockchipinclude_HEADERS = rockchip_drmif.h rockchip_drm.h
-
-pkgconfigdir = @pkgconfigdir@
-pkgconfig_DATA = libdrm_rockchip.pc
diff --git a/chromium/third_party/libdrm/src/rockchip/libdrm_rockchip.pc.in b/chromium/third_party/libdrm/src/rockchip/libdrm_rockchip.pc.in
deleted file mode 100644
index 13f22ac76af..00000000000
--- a/chromium/third_party/libdrm/src/rockchip/libdrm_rockchip.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libdrm_rockchip
-Description: Userspace interface to rockchip kernel DRM services
-Version: 0.1
-Libs: -L${libdir} -ldrm_rockchip
-Cflags: -I${includedir} -I${includedir}/libdrm
-Requires.private: libdrm
diff --git a/chromium/third_party/libdrm/src/rockchip/rockchip_drm.c b/chromium/third_party/libdrm/src/rockchip/rockchip_drm.c
deleted file mode 100644
index 9433d52afe1..00000000000
--- a/chromium/third_party/libdrm/src/rockchip/rockchip_drm.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (C) ROCKCHIP, Inc.
- * Author:yzq<yzq@rock-chips.com>
- *
- * based on exynos_drm.c
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/mman.h>
-#include <linux/stddef.h>
-
-#include <xf86drm.h>
-
-#include "rockchip_drm.h"
-#include "rockchip_drmif.h"
-
-/*
- * Create rockchip drm device object.
- *
- * @fd: file descriptor to rockchip drm driver opened.
- *
- * if true, return the device object else NULL.
- */
-struct rockchip_device *rockchip_device_create(int fd)
-{
- struct rockchip_device *dev;
-
- dev = calloc(1, sizeof(*dev));
- if (!dev) {
- fprintf(stderr, "failed to create device[%s].\n",
- strerror(errno));
- return NULL;
- }
-
- dev->fd = fd;
-
- return dev;
-}
-
-/*
- * Destroy rockchip drm device object
- *
- * @dev: rockchip drm device object.
- */
-void rockchip_device_destroy(struct rockchip_device *dev)
-{
- free(dev);
-}
-
-/*
- * Create a rockchip buffer object to rockchip drm device.
- *
- * @dev: rockchip drm device object.
- * @size: user-desired size.
- * flags: user-desired memory type.
- * user can set one or more types among several types to memory
- * allocation and cache attribute types. and as default,
- * ROCKCHIP_BO_NONCONTIG and ROCKCHIP-BO_NONCACHABLE types would
- * be used.
- *
- * if true, return a rockchip buffer object else NULL.
- */
-struct rockchip_bo *rockchip_bo_create(struct rockchip_device *dev,
- size_t size, uint32_t flags)
-{
- struct rockchip_bo *bo;
- struct drm_rockchip_gem_create req = {
- .size = size,
- .flags = flags,
- };
-
- if (size == 0) {
- fprintf(stderr, "invalid size.\n");
- return NULL;
- }
-
- bo = calloc(1, sizeof(*bo));
- if (!bo) {
- fprintf(stderr, "failed to create bo[%s].\n",
- strerror(errno));
- goto fail;
- }
-
- bo->dev = dev;
-
- if (drmIoctl(dev->fd, DRM_IOCTL_ROCKCHIP_GEM_CREATE, &req)){
- fprintf(stderr, "failed to create gem object[%s].\n",
- strerror(errno));
- goto err_free_bo;
- }
-
- bo->handle = req.handle;
- bo->size = size;
- bo->flags = flags;
-
- return bo;
-
-err_free_bo:
- free(bo);
-fail:
- return NULL;
-}
-
-struct rockchip_bo *rockchip_bo_from_handle(struct rockchip_device *dev,
- uint32_t handle, uint32_t flags, uint32_t size)
-{
- struct rockchip_bo *bo;
-
- if (size == 0) {
- fprintf(stderr, "invalid size.\n");
- return NULL;
- }
-
- bo = calloc(1, sizeof(*bo));
- if (!bo) {
- fprintf(stderr, "failed to create bo[%s].\n",
- strerror(errno));
- return NULL;
- }
-
- bo->dev = dev;
- bo->handle = handle;
- bo->size = size;
- bo->flags = flags;
-
- return bo;
-}
-
-/*
- * Destroy a rockchip buffer object.
- *
- * @bo: a rockchip buffer object to be destroyed.
- */
-void rockchip_bo_destroy(struct rockchip_bo *bo)
-{
- if (!bo)
- return;
-
- if (bo->vaddr)
- munmap(bo->vaddr, bo->size);
-
- if (bo->handle) {
- struct drm_gem_close req = {
- .handle = bo->handle,
- };
-
- drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
- }
-
- free(bo);
-}
-
-
-/*
- * Get a rockchip buffer object from a gem global object name.
- *
- * @dev: a rockchip device object.
- * @name: a gem global object name exported by another process.
- *
- * this interface is used to get a rockchip buffer object from a gem
- * global object name sent by another process for buffer sharing.
- *
- * if true, return a rockchip buffer object else NULL.
- *
- */
-struct rockchip_bo *rockchip_bo_from_name(struct rockchip_device *dev,
- uint32_t name)
-{
- struct rockchip_bo *bo;
- struct drm_gem_open req = {
- .name = name,
- };
-
- bo = calloc(1, sizeof(*bo));
- if (!bo) {
- fprintf(stderr, "failed to allocate bo[%s].\n",
- strerror(errno));
- return NULL;
- }
-
- if (drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req)) {
- fprintf(stderr, "failed to open gem object[%s].\n",
- strerror(errno));
- goto err_free_bo;
- }
-
- bo->dev = dev;
- bo->name = name;
- bo->handle = req.handle;
-
- return bo;
-
-err_free_bo:
- free(bo);
- return NULL;
-}
-
-/*
- * Get a gem global object name from a gem object handle.
- *
- * @bo: a rockchip buffer object including gem handle.
- * @name: a gem global object name to be got by kernel driver.
- *
- * this interface is used to get a gem global object name from a gem object
- * handle to a buffer that wants to share it with another process.
- *
- * if true, return 0 else negative.
- */
-int rockchip_bo_get_name(struct rockchip_bo *bo, uint32_t *name)
-{
- if (!bo->name) {
- struct drm_gem_flink req = {
- .handle = bo->handle,
- };
- int ret;
-
- ret = drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_FLINK, &req);
- if (ret) {
- fprintf(stderr, "failed to get gem global name[%s].\n",
- strerror(errno));
- return ret;
- }
-
- bo->name = req.name;
- }
-
- *name = bo->name;
-
- return 0;
-}
-
-uint32_t rockchip_bo_handle(struct rockchip_bo *bo)
-{
- return bo->handle;
-}
-
-/*
- * Mmap a buffer to user space.
- *
- * @bo: a rockchip buffer object including a gem object handle to be mmapped
- * to user space.
- *
- * if true, user pointer mmaped else NULL.
- */
-void *rockchip_bo_map(struct rockchip_bo *bo)
-{
- if (!bo->vaddr) {
- struct rockchip_device *dev = bo->dev;
- struct drm_rockchip_gem_map_off req = {
- .handle = bo->handle,
- };
- int ret;
-
- ret = drmIoctl(dev->fd, DRM_IOCTL_ROCKCHIP_GEM_MAP_OFFSET, &req);
- if (ret) {
- fprintf(stderr, "failed to ioctl gem map offset[%s].\n",
- strerror(errno));
- return NULL;
- }
-
- bo->vaddr = mmap(0, bo->size, PROT_READ | PROT_WRITE,
- MAP_SHARED, dev->fd, req.offset);
- if (bo->vaddr == MAP_FAILED) {
- fprintf(stderr, "failed to mmap buffer[%s].\n",
- strerror(errno));
- return NULL;
- }
- }
-
- return bo->vaddr;
-}
diff --git a/chromium/third_party/libdrm/src/rockchip/rockchip_drm.h b/chromium/third_party/libdrm/src/rockchip/rockchip_drm.h
deleted file mode 100644
index 13977d59975..00000000000
--- a/chromium/third_party/libdrm/src/rockchip/rockchip_drm.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) Fuzhou Rockchip Electronics Co.Ltd
- * Authors:
- * Mark Yao <yzq@rock-chips.com>
- *
- * based on exynos_drm.h
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#ifndef _ROCKCHIP_DRM_H_
-#define _ROCKCHIP_DRM_H_
-
-#include <stdint.h>
-#include "drm.h"
-
-/**
- * User-desired buffer creation information structure.
- *
- * @size: user-desired memory allocation size.
- * - this size value would be page-aligned internally.
- * @flags: user request for setting memory type or cache attributes.
- * @handle: returned a handle to created gem object.
- * - this handle will be set by gem module of kernel side.
- */
-struct drm_rockchip_gem_create {
- uint64_t size;
- uint32_t flags;
- uint32_t handle;
-};
-
-/**
- * A structure for getting buffer offset.
- *
- * @handle: a pointer to gem object created.
- * @pad: just padding to be 64-bit aligned.
- * @offset: relatived offset value of the memory region allocated.
- * - this value should be set by user.
- */
-struct drm_rockchip_gem_map_off {
- uint32_t handle;
- uint32_t pad;
- uint64_t offset;
-};
-
-#define DRM_ROCKCHIP_GEM_CREATE 0x00
-#define DRM_ROCKCHIP_GEM_MAP_OFFSET 0x01
-
-#define DRM_IOCTL_ROCKCHIP_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_ROCKCHIP_GEM_CREATE, struct drm_rockchip_gem_create)
-
-#define DRM_IOCTL_ROCKCHIP_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_ROCKCHIP_GEM_MAP_OFFSET, struct drm_rockchip_gem_map_off)
-
-#endif
diff --git a/chromium/third_party/libdrm/src/rockchip/rockchip_drmif.h b/chromium/third_party/libdrm/src/rockchip/rockchip_drmif.h
deleted file mode 100644
index ec3ff843e39..00000000000
--- a/chromium/third_party/libdrm/src/rockchip/rockchip_drmif.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) ROCKCHIP, Inc.
- * Author:yzq<yzq@rock-chips.com>
- *
- * based on exynos_drmif.h
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-
-#ifndef ROCKCHIP_DRMIF_H_
-#define ROCKCHIP_DRMIF_H_
-
-#include <xf86drm.h>
-#include <stdint.h>
-#include "rockchip_drm.h"
-
-struct rockchip_device {
- int fd;
-};
-
-/*
- * Rockchip Buffer Object structure.
- *
- * @dev: rockchip device object allocated.
- * @handle: a gem handle to gem object created.
- * @flags: indicate memory allocation and cache attribute types.
- * @size: size to the buffer created.
- * @vaddr: user space address to a gem buffer mmaped.
- * @name: a gem global handle from flink request.
- */
-struct rockchip_bo {
- struct rockchip_device *dev;
- uint32_t handle;
- uint32_t flags;
- size_t size;
- void *vaddr;
- uint32_t name;
-};
-
-/*
- * device related functions:
- */
-struct rockchip_device *rockchip_device_create(int fd);
-void rockchip_device_destroy(struct rockchip_device *dev);
-
-/*
- * buffer-object related functions:
- */
-struct rockchip_bo *rockchip_bo_create(struct rockchip_device *dev,
- size_t size, uint32_t flags);
-void rockchip_bo_destroy(struct rockchip_bo *bo);
-struct rockchip_bo *rockchip_bo_from_name(struct rockchip_device *dev,
- uint32_t name);
-int rockchip_bo_get_name(struct rockchip_bo *bo, uint32_t *name);
-uint32_t rockchip_bo_handle(struct rockchip_bo *bo);
-struct rockchip_bo *rockchip_bo_from_handle(struct rockchip_device *dev,
- uint32_t handle, uint32_t flags, uint32_t size);
-void *rockchip_bo_map(struct rockchip_bo *bo);
-#endif /* ROCKCHIP_DRMIF_H_ */
diff --git a/chromium/third_party/libdrm/src/util_double_list.h b/chromium/third_party/libdrm/src/util_double_list.h
index 7e48b26cb0c..27e0761b20c 100644
--- a/chromium/third_party/libdrm/src/util_double_list.h
+++ b/chromium/third_party/libdrm/src/util_double_list.h
@@ -98,19 +98,13 @@ static inline void list_delinit(struct list_head *item)
#define LIST_ENTRY(__type, __item, __field) \
((__type *)(((char *)(__item)) - offsetof(__type, __field)))
-#define LIST_FIRST_ENTRY(__ptr, __type, __field) \
- LIST_ENTRY(__type, (__ptr)->next, __field)
-
-#define LIST_LAST_ENTRY(__ptr, __type, __field) \
- LIST_ENTRY(__type, (__ptr)->prev, __field)
-
#define LIST_IS_EMPTY(__list) \
((__list)->next == (__list))
#ifndef container_of
#define container_of(ptr, sample, member) \
(void *)((char *)(ptr) \
- - ((char *)&((typeof(sample))0)->member))
+ - ((char *)&(sample)->member - (char *)(sample)))
#endif
#define LIST_FOR_EACH_ENTRY(pos, head, member) \
diff --git a/chromium/third_party/libdrm/src/vc4/Makefile.am b/chromium/third_party/libdrm/src/vc4/Makefile.am
deleted file mode 100644
index 7e486b4d8ea..00000000000
--- a/chromium/third_party/libdrm/src/vc4/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright © 2016 Broadcom
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-
-include Makefile.sources
-
-AM_CFLAGS = \
- $(WARN_CFLAGS) \
- -I$(top_srcdir) \
- $(PTHREADSTUBS_CFLAGS) \
- $(VALGRIND_CFLAGS) \
- -I$(top_srcdir)/include/drm
-
-libdrm_vc4includedir = ${includedir}/libdrm
-libdrm_vc4include_HEADERS = $(LIBDRM_VC4_H_FILES)
-
-pkgconfig_DATA = libdrm_vc4.pc
diff --git a/chromium/third_party/libdrm/src/vc4/Makefile.sources b/chromium/third_party/libdrm/src/vc4/Makefile.sources
deleted file mode 100644
index 8bf97ff1e80..00000000000
--- a/chromium/third_party/libdrm/src/vc4/Makefile.sources
+++ /dev/null
@@ -1,3 +0,0 @@
-LIBDRM_VC4_H_FILES := \
- vc4_packet.h \
- vc4_qpu_defines.h
diff --git a/chromium/third_party/libdrm/src/vc4/libdrm_vc4.pc.in b/chromium/third_party/libdrm/src/vc4/libdrm_vc4.pc.in
deleted file mode 100644
index a92678ed6c4..00000000000
--- a/chromium/third_party/libdrm/src/vc4/libdrm_vc4.pc.in
+++ /dev/null
@@ -1,9 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libdrm_vc4
-Description: Userspace interface to vc4 kernel DRM services
-Version: @PACKAGE_VERSION@
-Requires.private: libdrm
diff --git a/chromium/third_party/libdrm/src/vc4/vc4_packet.h b/chromium/third_party/libdrm/src/vc4/vc4_packet.h
deleted file mode 100644
index e18e0bdf6d8..00000000000
--- a/chromium/third_party/libdrm/src/vc4/vc4_packet.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * Copyright © 2014 Broadcom
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef VC4_PACKET_H
-#define VC4_PACKET_H
-
-enum vc4_packet {
- VC4_PACKET_HALT = 0,
- VC4_PACKET_NOP = 1,
-
- VC4_PACKET_FLUSH = 4,
- VC4_PACKET_FLUSH_ALL = 5,
- VC4_PACKET_START_TILE_BINNING = 6,
- VC4_PACKET_INCREMENT_SEMAPHORE = 7,
- VC4_PACKET_WAIT_ON_SEMAPHORE = 8,
-
- VC4_PACKET_BRANCH = 16,
- VC4_PACKET_BRANCH_TO_SUB_LIST = 17,
- VC4_PACKET_RETURN_FROM_SUB_LIST = 18,
-
- VC4_PACKET_STORE_MS_TILE_BUFFER = 24,
- VC4_PACKET_STORE_MS_TILE_BUFFER_AND_EOF = 25,
- VC4_PACKET_STORE_FULL_RES_TILE_BUFFER = 26,
- VC4_PACKET_LOAD_FULL_RES_TILE_BUFFER = 27,
- VC4_PACKET_STORE_TILE_BUFFER_GENERAL = 28,
- VC4_PACKET_LOAD_TILE_BUFFER_GENERAL = 29,
-
- VC4_PACKET_GL_INDEXED_PRIMITIVE = 32,
- VC4_PACKET_GL_ARRAY_PRIMITIVE = 33,
-
- VC4_PACKET_COMPRESSED_PRIMITIVE = 48,
- VC4_PACKET_CLIPPED_COMPRESSED_PRIMITIVE = 49,
-
- VC4_PACKET_PRIMITIVE_LIST_FORMAT = 56,
-
- VC4_PACKET_GL_SHADER_STATE = 64,
- VC4_PACKET_NV_SHADER_STATE = 65,
- VC4_PACKET_VG_SHADER_STATE = 66,
-
- VC4_PACKET_CONFIGURATION_BITS = 96,
- VC4_PACKET_FLAT_SHADE_FLAGS = 97,
- VC4_PACKET_POINT_SIZE = 98,
- VC4_PACKET_LINE_WIDTH = 99,
- VC4_PACKET_RHT_X_BOUNDARY = 100,
- VC4_PACKET_DEPTH_OFFSET = 101,
- VC4_PACKET_CLIP_WINDOW = 102,
- VC4_PACKET_VIEWPORT_OFFSET = 103,
- VC4_PACKET_Z_CLIPPING = 104,
- VC4_PACKET_CLIPPER_XY_SCALING = 105,
- VC4_PACKET_CLIPPER_Z_SCALING = 106,
-
- VC4_PACKET_TILE_BINNING_MODE_CONFIG = 112,
- VC4_PACKET_TILE_RENDERING_MODE_CONFIG = 113,
- VC4_PACKET_CLEAR_COLORS = 114,
- VC4_PACKET_TILE_COORDINATES = 115,
-
- /* Not an actual hardware packet -- this is what we use to put
- * references to GEM bos in the command stream, since we need the u32
- * int the actual address packet in order to store the offset from the
- * start of the BO.
- */
- VC4_PACKET_GEM_HANDLES = 254,
-} __attribute__ ((__packed__));
-
-#define VC4_PACKET_HALT_SIZE 1
-#define VC4_PACKET_NOP_SIZE 1
-#define VC4_PACKET_FLUSH_SIZE 1
-#define VC4_PACKET_FLUSH_ALL_SIZE 1
-#define VC4_PACKET_START_TILE_BINNING_SIZE 1
-#define VC4_PACKET_INCREMENT_SEMAPHORE_SIZE 1
-#define VC4_PACKET_WAIT_ON_SEMAPHORE_SIZE 1
-#define VC4_PACKET_BRANCH_SIZE 5
-#define VC4_PACKET_BRANCH_TO_SUB_LIST_SIZE 5
-#define VC4_PACKET_RETURN_FROM_SUB_LIST_SIZE 1
-#define VC4_PACKET_STORE_MS_TILE_BUFFER_SIZE 1
-#define VC4_PACKET_STORE_MS_TILE_BUFFER_AND_EOF_SIZE 1
-#define VC4_PACKET_STORE_FULL_RES_TILE_BUFFER_SIZE 5
-#define VC4_PACKET_LOAD_FULL_RES_TILE_BUFFER_SIZE 5
-#define VC4_PACKET_STORE_TILE_BUFFER_GENERAL_SIZE 7
-#define VC4_PACKET_LOAD_TILE_BUFFER_GENERAL_SIZE 7
-#define VC4_PACKET_GL_INDEXED_PRIMITIVE_SIZE 14
-#define VC4_PACKET_GL_ARRAY_PRIMITIVE_SIZE 10
-#define VC4_PACKET_COMPRESSED_PRIMITIVE_SIZE 1
-#define VC4_PACKET_CLIPPED_COMPRESSED_PRIMITIVE_SIZE 1
-#define VC4_PACKET_PRIMITIVE_LIST_FORMAT_SIZE 2
-#define VC4_PACKET_GL_SHADER_STATE_SIZE 5
-#define VC4_PACKET_NV_SHADER_STATE_SIZE 5
-#define VC4_PACKET_VG_SHADER_STATE_SIZE 5
-#define VC4_PACKET_CONFIGURATION_BITS_SIZE 4
-#define VC4_PACKET_FLAT_SHADE_FLAGS_SIZE 5
-#define VC4_PACKET_POINT_SIZE_SIZE 5
-#define VC4_PACKET_LINE_WIDTH_SIZE 5
-#define VC4_PACKET_RHT_X_BOUNDARY_SIZE 3
-#define VC4_PACKET_DEPTH_OFFSET_SIZE 5
-#define VC4_PACKET_CLIP_WINDOW_SIZE 9
-#define VC4_PACKET_VIEWPORT_OFFSET_SIZE 5
-#define VC4_PACKET_Z_CLIPPING_SIZE 9
-#define VC4_PACKET_CLIPPER_XY_SCALING_SIZE 9
-#define VC4_PACKET_CLIPPER_Z_SCALING_SIZE 9
-#define VC4_PACKET_TILE_BINNING_MODE_CONFIG_SIZE 16
-#define VC4_PACKET_TILE_RENDERING_MODE_CONFIG_SIZE 11
-#define VC4_PACKET_CLEAR_COLORS_SIZE 14
-#define VC4_PACKET_TILE_COORDINATES_SIZE 3
-#define VC4_PACKET_GEM_HANDLES_SIZE 9
-
-#define VC4_MASK(high, low) (((1 << ((high) - (low) + 1)) - 1) << (low))
-/* Using the GNU statement expression extension */
-#define VC4_SET_FIELD(value, field) \
- ({ \
- uint32_t fieldval = (value) << field ## _SHIFT; \
- assert((fieldval & ~ field ## _MASK) == 0); \
- fieldval & field ## _MASK; \
- })
-
-#define VC4_GET_FIELD(word, field) (((word) & field ## _MASK) >> field ## _SHIFT)
-
-/** @{
- * Bits used by packets like VC4_PACKET_STORE_TILE_BUFFER_GENERAL and
- * VC4_PACKET_TILE_RENDERING_MODE_CONFIG.
-*/
-#define VC4_TILING_FORMAT_LINEAR 0
-#define VC4_TILING_FORMAT_T 1
-#define VC4_TILING_FORMAT_LT 2
-/** @} */
-
-/** @{
- *
- * low bits of VC4_PACKET_STORE_FULL_RES_TILE_BUFFER and
- * VC4_PACKET_LOAD_FULL_RES_TILE_BUFFER.
- */
-#define VC4_LOADSTORE_FULL_RES_EOF (1 << 3)
-#define VC4_LOADSTORE_FULL_RES_DISABLE_CLEAR_ALL (1 << 2)
-#define VC4_LOADSTORE_FULL_RES_DISABLE_ZS (1 << 1)
-#define VC4_LOADSTORE_FULL_RES_DISABLE_COLOR (1 << 0)
-
-/** @{
- *
- * byte 2 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL and
- * VC4_PACKET_LOAD_TILE_BUFFER_GENERAL (low bits of the address)
- */
-
-#define VC4_LOADSTORE_TILE_BUFFER_EOF (1 << 3)
-#define VC4_LOADSTORE_TILE_BUFFER_DISABLE_FULL_VG_MASK (1 << 2)
-#define VC4_LOADSTORE_TILE_BUFFER_DISABLE_FULL_ZS (1 << 1)
-#define VC4_LOADSTORE_TILE_BUFFER_DISABLE_FULL_COLOR (1 << 0)
-
-/** @} */
-
-/** @{
- *
- * byte 0-1 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL and
- * VC4_PACKET_LOAD_TILE_BUFFER_GENERAL
- */
-#define VC4_STORE_TILE_BUFFER_DISABLE_VG_MASK_CLEAR (1 << 15)
-#define VC4_STORE_TILE_BUFFER_DISABLE_ZS_CLEAR (1 << 14)
-#define VC4_STORE_TILE_BUFFER_DISABLE_COLOR_CLEAR (1 << 13)
-#define VC4_STORE_TILE_BUFFER_DISABLE_SWAP (1 << 12)
-
-#define VC4_LOADSTORE_TILE_BUFFER_FORMAT_MASK VC4_MASK(9, 8)
-#define VC4_LOADSTORE_TILE_BUFFER_FORMAT_SHIFT 8
-#define VC4_LOADSTORE_TILE_BUFFER_RGBA8888 0
-#define VC4_LOADSTORE_TILE_BUFFER_BGR565_DITHER 1
-#define VC4_LOADSTORE_TILE_BUFFER_BGR565 2
-/** @} */
-
-/** @{
- *
- * byte 0 of VC4_PACKET_STORE_TILE_BUFFER_GENERAL and
- * VC4_PACKET_LOAD_TILE_BUFFER_GENERAL
- */
-#define VC4_STORE_TILE_BUFFER_MODE_MASK VC4_MASK(7, 6)
-#define VC4_STORE_TILE_BUFFER_MODE_SHIFT 6
-#define VC4_STORE_TILE_BUFFER_MODE_SAMPLE0 (0 << 6)
-#define VC4_STORE_TILE_BUFFER_MODE_DECIMATE_X4 (1 << 6)
-#define VC4_STORE_TILE_BUFFER_MODE_DECIMATE_X16 (2 << 6)
-
-/** The values of the field are VC4_TILING_FORMAT_* */
-#define VC4_LOADSTORE_TILE_BUFFER_TILING_MASK VC4_MASK(5, 4)
-#define VC4_LOADSTORE_TILE_BUFFER_TILING_SHIFT 4
-
-#define VC4_LOADSTORE_TILE_BUFFER_BUFFER_MASK VC4_MASK(2, 0)
-#define VC4_LOADSTORE_TILE_BUFFER_BUFFER_SHIFT 0
-#define VC4_LOADSTORE_TILE_BUFFER_NONE 0
-#define VC4_LOADSTORE_TILE_BUFFER_COLOR 1
-#define VC4_LOADSTORE_TILE_BUFFER_ZS 2
-#define VC4_LOADSTORE_TILE_BUFFER_Z 3
-#define VC4_LOADSTORE_TILE_BUFFER_VG_MASK 4
-#define VC4_LOADSTORE_TILE_BUFFER_FULL 5
-/** @} */
-
-#define VC4_INDEX_BUFFER_U8 (0 << 4)
-#define VC4_INDEX_BUFFER_U16 (1 << 4)
-
-/* This flag is only present in NV shader state. */
-#define VC4_SHADER_FLAG_SHADED_CLIP_COORDS (1 << 3)
-#define VC4_SHADER_FLAG_ENABLE_CLIPPING (1 << 2)
-#define VC4_SHADER_FLAG_VS_POINT_SIZE (1 << 1)
-#define VC4_SHADER_FLAG_FS_SINGLE_THREAD (1 << 0)
-
-/** @{ byte 2 of config bits. */
-#define VC4_CONFIG_BITS_EARLY_Z_UPDATE (1 << 1)
-#define VC4_CONFIG_BITS_EARLY_Z (1 << 0)
-/** @} */
-
-/** @{ byte 1 of config bits. */
-#define VC4_CONFIG_BITS_Z_UPDATE (1 << 7)
-/** same values in this 3-bit field as PIPE_FUNC_* */
-#define VC4_CONFIG_BITS_DEPTH_FUNC_SHIFT 4
-#define VC4_CONFIG_BITS_COVERAGE_READ_LEAVE (1 << 3)
-
-#define VC4_CONFIG_BITS_COVERAGE_UPDATE_NONZERO (0 << 1)
-#define VC4_CONFIG_BITS_COVERAGE_UPDATE_ODD (1 << 1)
-#define VC4_CONFIG_BITS_COVERAGE_UPDATE_OR (2 << 1)
-#define VC4_CONFIG_BITS_COVERAGE_UPDATE_ZERO (3 << 1)
-
-#define VC4_CONFIG_BITS_COVERAGE_PIPE_SELECT (1 << 0)
-/** @} */
-
-/** @{ byte 0 of config bits. */
-#define VC4_CONFIG_BITS_RASTERIZER_OVERSAMPLE_NONE (0 << 6)
-#define VC4_CONFIG_BITS_RASTERIZER_OVERSAMPLE_4X (1 << 6)
-#define VC4_CONFIG_BITS_RASTERIZER_OVERSAMPLE_16X (2 << 6)
-#define VC4_CONFIG_BITS_RASTERIZER_OVERSAMPLE_MASK (3 << 6)
-
-#define VC4_CONFIG_BITS_AA_POINTS_AND_LINES (1 << 4)
-#define VC4_CONFIG_BITS_ENABLE_DEPTH_OFFSET (1 << 3)
-#define VC4_CONFIG_BITS_CW_PRIMITIVES (1 << 2)
-#define VC4_CONFIG_BITS_ENABLE_PRIM_BACK (1 << 1)
-#define VC4_CONFIG_BITS_ENABLE_PRIM_FRONT (1 << 0)
-/** @} */
-
-/** @{ bits in the last u8 of VC4_PACKET_TILE_BINNING_MODE_CONFIG */
-#define VC4_BIN_CONFIG_DB_NON_MS (1 << 7)
-
-#define VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_MASK VC4_MASK(6, 5)
-#define VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_SHIFT 5
-#define VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_32 0
-#define VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_64 1
-#define VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_128 2
-#define VC4_BIN_CONFIG_ALLOC_BLOCK_SIZE_256 3
-
-#define VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_MASK VC4_MASK(4, 3)
-#define VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_SHIFT 3
-#define VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_32 0
-#define VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_64 1
-#define VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_128 2
-#define VC4_BIN_CONFIG_ALLOC_INIT_BLOCK_SIZE_256 3
-
-#define VC4_BIN_CONFIG_AUTO_INIT_TSDA (1 << 2)
-#define VC4_BIN_CONFIG_TILE_BUFFER_64BIT (1 << 1)
-#define VC4_BIN_CONFIG_MS_MODE_4X (1 << 0)
-/** @} */
-
-/** @{ bits in the last u16 of VC4_PACKET_TILE_RENDERING_MODE_CONFIG */
-#define VC4_RENDER_CONFIG_DB_NON_MS (1 << 12)
-#define VC4_RENDER_CONFIG_EARLY_Z_COVERAGE_DISABLE (1 << 11)
-#define VC4_RENDER_CONFIG_EARLY_Z_DIRECTION_G (1 << 10)
-#define VC4_RENDER_CONFIG_COVERAGE_MODE (1 << 9)
-#define VC4_RENDER_CONFIG_ENABLE_VG_MASK (1 << 8)
-
-/** The values of the field are VC4_TILING_FORMAT_* */
-#define VC4_RENDER_CONFIG_MEMORY_FORMAT_MASK VC4_MASK(7, 6)
-#define VC4_RENDER_CONFIG_MEMORY_FORMAT_SHIFT 6
-
-#define VC4_RENDER_CONFIG_DECIMATE_MODE_1X (0 << 4)
-#define VC4_RENDER_CONFIG_DECIMATE_MODE_4X (1 << 4)
-#define VC4_RENDER_CONFIG_DECIMATE_MODE_16X (2 << 4)
-#define VC4_RENDER_CONFIG_DECIMATE_MODE_MASK (3 << 4)
-
-#define VC4_RENDER_CONFIG_FORMAT_MASK VC4_MASK(3, 2)
-#define VC4_RENDER_CONFIG_FORMAT_SHIFT 2
-#define VC4_RENDER_CONFIG_FORMAT_BGR565_DITHERED 0
-#define VC4_RENDER_CONFIG_FORMAT_RGBA8888 1
-#define VC4_RENDER_CONFIG_FORMAT_BGR565 2
-
-#define VC4_RENDER_CONFIG_TILE_BUFFER_64BIT (1 << 1)
-#define VC4_RENDER_CONFIG_MS_MODE_4X (1 << 0)
-
-#define VC4_PRIMITIVE_LIST_FORMAT_16_INDEX (1 << 4)
-#define VC4_PRIMITIVE_LIST_FORMAT_32_XY (3 << 4)
-#define VC4_PRIMITIVE_LIST_FORMAT_TYPE_POINTS (0 << 0)
-#define VC4_PRIMITIVE_LIST_FORMAT_TYPE_LINES (1 << 0)
-#define VC4_PRIMITIVE_LIST_FORMAT_TYPE_TRIANGLES (2 << 0)
-#define VC4_PRIMITIVE_LIST_FORMAT_TYPE_RHT (3 << 0)
-
-enum vc4_texture_data_type {
- VC4_TEXTURE_TYPE_RGBA8888 = 0,
- VC4_TEXTURE_TYPE_RGBX8888 = 1,
- VC4_TEXTURE_TYPE_RGBA4444 = 2,
- VC4_TEXTURE_TYPE_RGBA5551 = 3,
- VC4_TEXTURE_TYPE_RGB565 = 4,
- VC4_TEXTURE_TYPE_LUMINANCE = 5,
- VC4_TEXTURE_TYPE_ALPHA = 6,
- VC4_TEXTURE_TYPE_LUMALPHA = 7,
- VC4_TEXTURE_TYPE_ETC1 = 8,
- VC4_TEXTURE_TYPE_S16F = 9,
- VC4_TEXTURE_TYPE_S8 = 10,
- VC4_TEXTURE_TYPE_S16 = 11,
- VC4_TEXTURE_TYPE_BW1 = 12,
- VC4_TEXTURE_TYPE_A4 = 13,
- VC4_TEXTURE_TYPE_A1 = 14,
- VC4_TEXTURE_TYPE_RGBA64 = 15,
- VC4_TEXTURE_TYPE_RGBA32R = 16,
- VC4_TEXTURE_TYPE_YUV422R = 17,
-};
-
-#define VC4_TEX_P0_OFFSET_MASK VC4_MASK(31, 12)
-#define VC4_TEX_P0_OFFSET_SHIFT 12
-#define VC4_TEX_P0_CSWIZ_MASK VC4_MASK(11, 10)
-#define VC4_TEX_P0_CSWIZ_SHIFT 10
-#define VC4_TEX_P0_CMMODE_MASK VC4_MASK(9, 9)
-#define VC4_TEX_P0_CMMODE_SHIFT 9
-#define VC4_TEX_P0_FLIPY_MASK VC4_MASK(8, 8)
-#define VC4_TEX_P0_FLIPY_SHIFT 8
-#define VC4_TEX_P0_TYPE_MASK VC4_MASK(7, 4)
-#define VC4_TEX_P0_TYPE_SHIFT 4
-#define VC4_TEX_P0_MIPLVLS_MASK VC4_MASK(3, 0)
-#define VC4_TEX_P0_MIPLVLS_SHIFT 0
-
-#define VC4_TEX_P1_TYPE4_MASK VC4_MASK(31, 31)
-#define VC4_TEX_P1_TYPE4_SHIFT 31
-#define VC4_TEX_P1_HEIGHT_MASK VC4_MASK(30, 20)
-#define VC4_TEX_P1_HEIGHT_SHIFT 20
-#define VC4_TEX_P1_ETCFLIP_MASK VC4_MASK(19, 19)
-#define VC4_TEX_P1_ETCFLIP_SHIFT 19
-#define VC4_TEX_P1_WIDTH_MASK VC4_MASK(18, 8)
-#define VC4_TEX_P1_WIDTH_SHIFT 8
-
-#define VC4_TEX_P1_MAGFILT_MASK VC4_MASK(7, 7)
-#define VC4_TEX_P1_MAGFILT_SHIFT 7
-# define VC4_TEX_P1_MAGFILT_LINEAR 0
-# define VC4_TEX_P1_MAGFILT_NEAREST 1
-
-#define VC4_TEX_P1_MINFILT_MASK VC4_MASK(6, 4)
-#define VC4_TEX_P1_MINFILT_SHIFT 4
-# define VC4_TEX_P1_MINFILT_LINEAR 0
-# define VC4_TEX_P1_MINFILT_NEAREST 1
-# define VC4_TEX_P1_MINFILT_NEAR_MIP_NEAR 2
-# define VC4_TEX_P1_MINFILT_NEAR_MIP_LIN 3
-# define VC4_TEX_P1_MINFILT_LIN_MIP_NEAR 4
-# define VC4_TEX_P1_MINFILT_LIN_MIP_LIN 5
-
-#define VC4_TEX_P1_WRAP_T_MASK VC4_MASK(3, 2)
-#define VC4_TEX_P1_WRAP_T_SHIFT 2
-#define VC4_TEX_P1_WRAP_S_MASK VC4_MASK(1, 0)
-#define VC4_TEX_P1_WRAP_S_SHIFT 0
-# define VC4_TEX_P1_WRAP_REPEAT 0
-# define VC4_TEX_P1_WRAP_CLAMP 1
-# define VC4_TEX_P1_WRAP_MIRROR 2
-# define VC4_TEX_P1_WRAP_BORDER 3
-
-#define VC4_TEX_P2_PTYPE_MASK VC4_MASK(31, 30)
-#define VC4_TEX_P2_PTYPE_SHIFT 30
-# define VC4_TEX_P2_PTYPE_IGNORED 0
-# define VC4_TEX_P2_PTYPE_CUBE_MAP_STRIDE 1
-# define VC4_TEX_P2_PTYPE_CHILD_IMAGE_DIMENSIONS 2
-# define VC4_TEX_P2_PTYPE_CHILD_IMAGE_OFFSETS 3
-
-/* VC4_TEX_P2_PTYPE_CUBE_MAP_STRIDE bits */
-#define VC4_TEX_P2_CMST_MASK VC4_MASK(29, 12)
-#define VC4_TEX_P2_CMST_SHIFT 12
-#define VC4_TEX_P2_BSLOD_MASK VC4_MASK(0, 0)
-#define VC4_TEX_P2_BSLOD_SHIFT 0
-
-/* VC4_TEX_P2_PTYPE_CHILD_IMAGE_DIMENSIONS */
-#define VC4_TEX_P2_CHEIGHT_MASK VC4_MASK(22, 12)
-#define VC4_TEX_P2_CHEIGHT_SHIFT 12
-#define VC4_TEX_P2_CWIDTH_MASK VC4_MASK(10, 0)
-#define VC4_TEX_P2_CWIDTH_SHIFT 0
-
-/* VC4_TEX_P2_PTYPE_CHILD_IMAGE_OFFSETS */
-#define VC4_TEX_P2_CYOFF_MASK VC4_MASK(22, 12)
-#define VC4_TEX_P2_CYOFF_SHIFT 12
-#define VC4_TEX_P2_CXOFF_MASK VC4_MASK(10, 0)
-#define VC4_TEX_P2_CXOFF_SHIFT 0
-
-#endif /* VC4_PACKET_H */
diff --git a/chromium/third_party/libdrm/src/vc4/vc4_qpu_defines.h b/chromium/third_party/libdrm/src/vc4/vc4_qpu_defines.h
deleted file mode 100644
index 26fcf505fe4..00000000000
--- a/chromium/third_party/libdrm/src/vc4/vc4_qpu_defines.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Copyright © 2014 Broadcom
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef VC4_QPU_DEFINES_H
-#define VC4_QPU_DEFINES_H
-
-enum qpu_op_add {
- QPU_A_NOP,
- QPU_A_FADD,
- QPU_A_FSUB,
- QPU_A_FMIN,
- QPU_A_FMAX,
- QPU_A_FMINABS,
- QPU_A_FMAXABS,
- QPU_A_FTOI,
- QPU_A_ITOF,
- QPU_A_ADD = 12,
- QPU_A_SUB,
- QPU_A_SHR,
- QPU_A_ASR,
- QPU_A_ROR,
- QPU_A_SHL,
- QPU_A_MIN,
- QPU_A_MAX,
- QPU_A_AND,
- QPU_A_OR,
- QPU_A_XOR,
- QPU_A_NOT,
- QPU_A_CLZ,
- QPU_A_V8ADDS = 30,
- QPU_A_V8SUBS = 31,
-};
-
-enum qpu_op_mul {
- QPU_M_NOP,
- QPU_M_FMUL,
- QPU_M_MUL24,
- QPU_M_V8MULD,
- QPU_M_V8MIN,
- QPU_M_V8MAX,
- QPU_M_V8ADDS,
- QPU_M_V8SUBS,
-};
-
-enum qpu_raddr {
- QPU_R_FRAG_PAYLOAD_ZW = 15, /* W for A file, Z for B file */
- /* 0-31 are the plain regfile a or b fields */
- QPU_R_UNIF = 32,
- QPU_R_VARY = 35,
- QPU_R_ELEM_QPU = 38,
- QPU_R_NOP,
- QPU_R_XY_PIXEL_COORD = 41,
- QPU_R_MS_REV_FLAGS = 42,
- QPU_R_VPM = 48,
- QPU_R_VPM_LD_BUSY,
- QPU_R_VPM_LD_WAIT,
- QPU_R_MUTEX_ACQUIRE,
-};
-
-enum qpu_waddr {
- /* 0-31 are the plain regfile a or b fields */
- QPU_W_ACC0 = 32, /* aka r0 */
- QPU_W_ACC1,
- QPU_W_ACC2,
- QPU_W_ACC3,
- QPU_W_TMU_NOSWAP,
- QPU_W_ACC5,
- QPU_W_HOST_INT,
- QPU_W_NOP,
- QPU_W_UNIFORMS_ADDRESS,
- QPU_W_QUAD_XY, /* X for regfile a, Y for regfile b */
- QPU_W_MS_FLAGS = 42,
- QPU_W_REV_FLAG = 42,
- QPU_W_TLB_STENCIL_SETUP = 43,
- QPU_W_TLB_Z,
- QPU_W_TLB_COLOR_MS,
- QPU_W_TLB_COLOR_ALL,
- QPU_W_TLB_ALPHA_MASK,
- QPU_W_VPM,
- QPU_W_VPMVCD_SETUP, /* LD for regfile a, ST for regfile b */
- QPU_W_VPM_ADDR, /* LD for regfile a, ST for regfile b */
- QPU_W_MUTEX_RELEASE,
- QPU_W_SFU_RECIP,
- QPU_W_SFU_RECIPSQRT,
- QPU_W_SFU_EXP,
- QPU_W_SFU_LOG,
- QPU_W_TMU0_S,
- QPU_W_TMU0_T,
- QPU_W_TMU0_R,
- QPU_W_TMU0_B,
- QPU_W_TMU1_S,
- QPU_W_TMU1_T,
- QPU_W_TMU1_R,
- QPU_W_TMU1_B,
-};
-
-enum qpu_sig_bits {
- QPU_SIG_SW_BREAKPOINT,
- QPU_SIG_NONE,
- QPU_SIG_THREAD_SWITCH,
- QPU_SIG_PROG_END,
- QPU_SIG_WAIT_FOR_SCOREBOARD,
- QPU_SIG_SCOREBOARD_UNLOCK,
- QPU_SIG_LAST_THREAD_SWITCH,
- QPU_SIG_COVERAGE_LOAD,
- QPU_SIG_COLOR_LOAD,
- QPU_SIG_COLOR_LOAD_END,
- QPU_SIG_LOAD_TMU0,
- QPU_SIG_LOAD_TMU1,
- QPU_SIG_ALPHA_MASK_LOAD,
- QPU_SIG_SMALL_IMM,
- QPU_SIG_LOAD_IMM,
- QPU_SIG_BRANCH
-};
-
-enum qpu_mux {
- /* hardware mux values */
- QPU_MUX_R0,
- QPU_MUX_R1,
- QPU_MUX_R2,
- QPU_MUX_R3,
- QPU_MUX_R4,
- QPU_MUX_R5,
- QPU_MUX_A,
- QPU_MUX_B,
-
- /**
- * Non-hardware mux value, stores a small immediate field to be
- * programmed into raddr_b in the qpu_reg.index.
- */
- QPU_MUX_SMALL_IMM,
-};
-
-enum qpu_cond {
- QPU_COND_NEVER,
- QPU_COND_ALWAYS,
- QPU_COND_ZS,
- QPU_COND_ZC,
- QPU_COND_NS,
- QPU_COND_NC,
- QPU_COND_CS,
- QPU_COND_CC,
-};
-
-enum qpu_pack_mul {
- QPU_PACK_MUL_NOP,
- QPU_PACK_MUL_8888 = 3, /* replicated to each 8 bits of the 32-bit dst. */
- QPU_PACK_MUL_8A,
- QPU_PACK_MUL_8B,
- QPU_PACK_MUL_8C,
- QPU_PACK_MUL_8D,
-};
-
-enum qpu_pack_a {
- QPU_PACK_A_NOP,
- /* convert to 16 bit float if float input, or to int16. */
- QPU_PACK_A_16A,
- QPU_PACK_A_16B,
- /* replicated to each 8 bits of the 32-bit dst. */
- QPU_PACK_A_8888,
- /* Convert to 8-bit unsigned int. */
- QPU_PACK_A_8A,
- QPU_PACK_A_8B,
- QPU_PACK_A_8C,
- QPU_PACK_A_8D,
-
- /* Saturating variants of the previous instructions. */
- QPU_PACK_A_32_SAT, /* int-only */
- QPU_PACK_A_16A_SAT, /* int or float */
- QPU_PACK_A_16B_SAT,
- QPU_PACK_A_8888_SAT,
- QPU_PACK_A_8A_SAT,
- QPU_PACK_A_8B_SAT,
- QPU_PACK_A_8C_SAT,
- QPU_PACK_A_8D_SAT,
-};
-
-enum qpu_unpack {
- QPU_UNPACK_NOP,
- QPU_UNPACK_16A,
- QPU_UNPACK_16B,
- QPU_UNPACK_8D_REP,
- QPU_UNPACK_8A,
- QPU_UNPACK_8B,
- QPU_UNPACK_8C,
- QPU_UNPACK_8D,
-};
-
-#define QPU_MASK(high, low) ((((uint64_t)1<<((high)-(low)+1))-1)<<(low))
-/* Using the GNU statement expression extension */
-#define QPU_SET_FIELD(value, field) \
- ({ \
- uint64_t fieldval = (uint64_t)(value) << field ## _SHIFT; \
- assert((fieldval & ~ field ## _MASK) == 0); \
- fieldval & field ## _MASK; \
- })
-
-#define QPU_GET_FIELD(word, field) ((uint32_t)(((word) & field ## _MASK) >> field ## _SHIFT))
-
-#define QPU_UPDATE_FIELD(inst, value, field) \
- (((inst) & ~(field ## _MASK)) | QPU_SET_FIELD(value, field))
-
-#define QPU_SIG_SHIFT 60
-#define QPU_SIG_MASK QPU_MASK(63, 60)
-
-#define QPU_UNPACK_SHIFT 57
-#define QPU_UNPACK_MASK QPU_MASK(59, 57)
-
-/**
- * If set, the pack field means PACK_MUL or R4 packing, instead of normal
- * regfile a packing.
- */
-#define QPU_PM ((uint64_t)1 << 56)
-
-#define QPU_PACK_SHIFT 52
-#define QPU_PACK_MASK QPU_MASK(55, 52)
-
-#define QPU_COND_ADD_SHIFT 49
-#define QPU_COND_ADD_MASK QPU_MASK(51, 49)
-#define QPU_COND_MUL_SHIFT 46
-#define QPU_COND_MUL_MASK QPU_MASK(48, 46)
-
-#define QPU_SF ((uint64_t)1 << 45)
-
-#define QPU_WADDR_ADD_SHIFT 38
-#define QPU_WADDR_ADD_MASK QPU_MASK(43, 38)
-#define QPU_WADDR_MUL_SHIFT 32
-#define QPU_WADDR_MUL_MASK QPU_MASK(37, 32)
-
-#define QPU_OP_MUL_SHIFT 29
-#define QPU_OP_MUL_MASK QPU_MASK(31, 29)
-
-#define QPU_RADDR_A_SHIFT 18
-#define QPU_RADDR_A_MASK QPU_MASK(23, 18)
-#define QPU_RADDR_B_SHIFT 12
-#define QPU_RADDR_B_MASK QPU_MASK(17, 12)
-#define QPU_SMALL_IMM_SHIFT 12
-#define QPU_SMALL_IMM_MASK QPU_MASK(17, 12)
-
-#define QPU_ADD_A_SHIFT 9
-#define QPU_ADD_A_MASK QPU_MASK(11, 9)
-#define QPU_ADD_B_SHIFT 6
-#define QPU_ADD_B_MASK QPU_MASK(8, 6)
-#define QPU_MUL_A_SHIFT 3
-#define QPU_MUL_A_MASK QPU_MASK(5, 3)
-#define QPU_MUL_B_SHIFT 0
-#define QPU_MUL_B_MASK QPU_MASK(2, 0)
-
-#define QPU_WS ((uint64_t)1 << 44)
-
-#define QPU_OP_ADD_SHIFT 24
-#define QPU_OP_ADD_MASK QPU_MASK(28, 24)
-
-#endif /* VC4_QPU_DEFINES_H */
diff --git a/chromium/third_party/libdrm/src/xf86drm.c b/chromium/third_party/libdrm/src/xf86drm.c
index 9b52889e4ce..7e28b4f7b1c 100644
--- a/chromium/third_party/libdrm/src/xf86drm.c
+++ b/chromium/third_party/libdrm/src/xf86drm.c
@@ -1,5 +1,5 @@
/**
- * \file xf86drm.c
+ * \file xf86drm.c
* User-level interface to DRM device
*
* \author Rickard E. (Rik) Faith <faith@valinux.com>
@@ -54,11 +54,8 @@
#include <sys/ioctl.h>
#include <sys/time.h>
#include <stdarg.h>
-#ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
-#endif
-#ifdef MAJOR_IN_SYSMACROS
-#include <sys/sysmacros.h>
+#ifdef HAVE_SYS_MKDEV_H
+# include <sys/mkdev.h> /* defines major(), minor(), and makedev() on Solaris */
#endif
#include <math.h>
@@ -73,13 +70,13 @@
#include "util_math.h"
#ifdef __OpenBSD__
-#define DRM_PRIMARY_MINOR_NAME "drm"
-#define DRM_CONTROL_MINOR_NAME "drmC"
-#define DRM_RENDER_MINOR_NAME "drmR"
+#define DRM_PRIMARY_MINOR_NAME "drm"
+#define DRM_CONTROL_MINOR_NAME "drmC"
+#define DRM_RENDER_MINOR_NAME "drmR"
#else
-#define DRM_PRIMARY_MINOR_NAME "card"
-#define DRM_CONTROL_MINOR_NAME "controlD"
-#define DRM_RENDER_MINOR_NAME "renderD"
+#define DRM_PRIMARY_MINOR_NAME "card"
+#define DRM_CONTROL_MINOR_NAME "controlD"
+#define DRM_RENDER_MINOR_NAME "renderD"
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
@@ -99,7 +96,7 @@
#endif /* __OpenBSD__ */
#ifndef DRM_MAJOR
-#define DRM_MAJOR 226 /* Linux */
+#define DRM_MAJOR 226 /* Linux */
#endif
#define DRM_MSG_VERBOSITY 3
@@ -131,18 +128,18 @@ drmDebugPrint(const char *format, va_list ap)
void
drmMsg(const char *format, ...)
{
- va_list ap;
+ va_list ap;
const char *env;
if (((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) ||
(drm_server_info && drm_server_info->debug_print))
{
- va_start(ap, format);
- if (drm_server_info) {
- drm_server_info->debug_print(format,ap);
- } else {
- drmDebugPrint(format, ap);
- }
- va_end(ap);
+ va_start(ap, format);
+ if (drm_server_info) {
+ drm_server_info->debug_print(format,ap);
+ } else {
+ drmDebugPrint(format, ap);
+ }
+ va_end(ap);
}
}
@@ -169,10 +166,10 @@ void drmFree(void *pt)
int
drmIoctl(int fd, unsigned long request, void *arg)
{
- int ret;
+ int ret;
do {
- ret = ioctl(fd, request, arg);
+ ret = ioctl(fd, request, arg);
} while (ret == -1 && (errno == EINTR || errno == EAGAIN));
return ret;
}
@@ -193,16 +190,16 @@ drmHashEntry *drmGetEntry(int fd)
drmHashEntry *entry;
if (!drmHashTable)
- drmHashTable = drmHashCreate();
+ drmHashTable = drmHashCreate();
if (drmHashLookup(drmHashTable, key, &value)) {
- entry = drmMalloc(sizeof(*entry));
- entry->fd = fd;
- entry->f = NULL;
- entry->tagTable = drmHashCreate();
- drmHashInsert(drmHashTable, key, entry);
+ entry = drmMalloc(sizeof(*entry));
+ entry->fd = fd;
+ entry->f = NULL;
+ entry->tagTable = drmHashCreate();
+ drmHashInsert(drmHashTable, key, entry);
} else {
- entry = value;
+ entry = value;
}
return entry;
}
@@ -224,41 +221,41 @@ static int drmMatchBusID(const char *id1, const char *id2, int pci_domain_ok)
{
/* First, check if the IDs are exactly the same */
if (strcasecmp(id1, id2) == 0)
- return 1;
+ return 1;
/* Try to match old/new-style PCI bus IDs. */
if (strncasecmp(id1, "pci", 3) == 0) {
- unsigned int o1, b1, d1, f1;
- unsigned int o2, b2, d2, f2;
- int ret;
-
- ret = sscanf(id1, "pci:%04x:%02x:%02x.%u", &o1, &b1, &d1, &f1);
- if (ret != 4) {
- o1 = 0;
- ret = sscanf(id1, "PCI:%u:%u:%u", &b1, &d1, &f1);
- if (ret != 3)
- return 0;
- }
-
- ret = sscanf(id2, "pci:%04x:%02x:%02x.%u", &o2, &b2, &d2, &f2);
- if (ret != 4) {
- o2 = 0;
- ret = sscanf(id2, "PCI:%u:%u:%u", &b2, &d2, &f2);
- if (ret != 3)
- return 0;
- }
-
- /* If domains aren't properly supported by the kernel interface,
- * just ignore them, which sucks less than picking a totally random
- * card with "open by name"
- */
- if (!pci_domain_ok)
- o1 = o2 = 0;
-
- if ((o1 != o2) || (b1 != b2) || (d1 != d2) || (f1 != f2))
- return 0;
- else
- return 1;
+ unsigned int o1, b1, d1, f1;
+ unsigned int o2, b2, d2, f2;
+ int ret;
+
+ ret = sscanf(id1, "pci:%04x:%02x:%02x.%u", &o1, &b1, &d1, &f1);
+ if (ret != 4) {
+ o1 = 0;
+ ret = sscanf(id1, "PCI:%u:%u:%u", &b1, &d1, &f1);
+ if (ret != 3)
+ return 0;
+ }
+
+ ret = sscanf(id2, "pci:%04x:%02x:%02x.%u", &o2, &b2, &d2, &f2);
+ if (ret != 4) {
+ o2 = 0;
+ ret = sscanf(id2, "PCI:%u:%u:%u", &b2, &d2, &f2);
+ if (ret != 3)
+ return 0;
+ }
+
+ /* If domains aren't properly supported by the kernel interface,
+ * just ignore them, which sucks less than picking a totally random
+ * card with "open by name"
+ */
+ if (!pci_domain_ok)
+ o1 = o2 = 0;
+
+ if ((o1 != o2) || (b1 != b2) || (d1 != d2) || (f1 != f2))
+ return 0;
+ else
+ return 1;
}
return 0;
}
@@ -280,18 +277,18 @@ static int drmMatchBusID(const char *id1, const char *id2, int pci_domain_ok)
#if !defined(UDEV)
static int chown_check_return(const char *path, uid_t owner, gid_t group)
{
- int rv;
+ int rv;
- do {
- rv = chown(path, owner, group);
- } while (rv != 0 && errno == EINTR);
+ do {
+ rv = chown(path, owner, group);
+ } while (rv != 0 && errno == EINTR);
- if (rv == 0)
- return 0;
+ if (rv == 0)
+ return 0;
- drmMsg("Failed to change owner or group for file %s! %d: %s\n",
- path, errno, strerror(errno));
- return -1;
+ drmMsg("Failed to change owner or group for file %s! %d: %s\n",
+ path, errno, strerror(errno));
+ return -1;
}
#endif
@@ -300,7 +297,7 @@ static int chown_check_return(const char *path, uid_t owner, gid_t group)
*
* \param dev major and minor numbers of the device.
* \param minor minor number of the device.
- *
+ *
* \return a file descriptor on success, or a negative value on error.
*
* \internal
@@ -324,99 +321,99 @@ static int drmOpenDevice(dev_t dev, int minor, int type)
switch (type) {
case DRM_NODE_PRIMARY:
- dev_name = DRM_DEV_NAME;
- break;
+ dev_name = DRM_DEV_NAME;
+ break;
case DRM_NODE_CONTROL:
- dev_name = DRM_CONTROL_DEV_NAME;
- break;
+ dev_name = DRM_CONTROL_DEV_NAME;
+ break;
case DRM_NODE_RENDER:
- dev_name = DRM_RENDER_DEV_NAME;
- break;
+ dev_name = DRM_RENDER_DEV_NAME;
+ break;
default:
- return -EINVAL;
+ return -EINVAL;
};
sprintf(buf, dev_name, DRM_DIR_NAME, minor);
drmMsg("drmOpenDevice: node name is %s\n", buf);
if (drm_server_info && drm_server_info->get_perms) {
- drm_server_info->get_perms(&serv_group, &serv_mode);
- devmode = serv_mode ? serv_mode : DRM_DEV_MODE;
- devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
+ drm_server_info->get_perms(&serv_group, &serv_mode);
+ devmode = serv_mode ? serv_mode : DRM_DEV_MODE;
+ devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
}
#if !defined(UDEV)
if (stat(DRM_DIR_NAME, &st)) {
- if (!isroot)
- return DRM_ERR_NOT_ROOT;
- mkdir(DRM_DIR_NAME, DRM_DEV_DIRMODE);
- chown_check_return(DRM_DIR_NAME, 0, 0); /* root:root */
- chmod(DRM_DIR_NAME, DRM_DEV_DIRMODE);
+ if (!isroot)
+ return DRM_ERR_NOT_ROOT;
+ mkdir(DRM_DIR_NAME, DRM_DEV_DIRMODE);
+ chown_check_return(DRM_DIR_NAME, 0, 0); /* root:root */
+ chmod(DRM_DIR_NAME, DRM_DEV_DIRMODE);
}
/* Check if the device node exists and create it if necessary. */
if (stat(buf, &st)) {
- if (!isroot)
- return DRM_ERR_NOT_ROOT;
- remove(buf);
- mknod(buf, S_IFCHR | devmode, dev);
+ if (!isroot)
+ return DRM_ERR_NOT_ROOT;
+ remove(buf);
+ mknod(buf, S_IFCHR | devmode, dev);
}
if (drm_server_info && drm_server_info->get_perms) {
- group = ((int)serv_group >= 0) ? serv_group : DRM_DEV_GID;
- chown_check_return(buf, user, group);
- chmod(buf, devmode);
+ group = ((int)serv_group >= 0) ? serv_group : DRM_DEV_GID;
+ chown_check_return(buf, user, group);
+ chmod(buf, devmode);
}
#else
/* if we modprobed then wait for udev */
{
- int udev_count = 0;
+ int udev_count = 0;
wait_for_udev:
if (stat(DRM_DIR_NAME, &st)) {
- usleep(20);
- udev_count++;
-
- if (udev_count == 50)
- return -1;
- goto wait_for_udev;
- }
-
- if (stat(buf, &st)) {
- usleep(20);
- udev_count++;
-
- if (udev_count == 50)
- return -1;
- goto wait_for_udev;
- }
+ usleep(20);
+ udev_count++;
+
+ if (udev_count == 50)
+ return -1;
+ goto wait_for_udev;
+ }
+
+ if (stat(buf, &st)) {
+ usleep(20);
+ udev_count++;
+
+ if (udev_count == 50)
+ return -1;
+ goto wait_for_udev;
+ }
}
#endif
fd = open(buf, O_RDWR, 0);
drmMsg("drmOpenDevice: open result is %d, (%s)\n",
- fd, fd < 0 ? strerror(errno) : "OK");
+ fd, fd < 0 ? strerror(errno) : "OK");
if (fd >= 0)
- return fd;
+ return fd;
#if !defined(UDEV)
/* Check if the device node is not what we expect it to be, and recreate it
* and try again if so.
*/
if (st.st_rdev != dev) {
- if (!isroot)
- return DRM_ERR_NOT_ROOT;
- remove(buf);
- mknod(buf, S_IFCHR | devmode, dev);
- if (drm_server_info && drm_server_info->get_perms) {
- chown_check_return(buf, user, group);
- chmod(buf, devmode);
- }
+ if (!isroot)
+ return DRM_ERR_NOT_ROOT;
+ remove(buf);
+ mknod(buf, S_IFCHR | devmode, dev);
+ if (drm_server_info && drm_server_info->get_perms) {
+ chown_check_return(buf, user, group);
+ chmod(buf, devmode);
+ }
}
fd = open(buf, O_RDWR, 0);
drmMsg("drmOpenDevice: open result is %d, (%s)\n",
- fd, fd < 0 ? strerror(errno) : "OK");
+ fd, fd < 0 ? strerror(errno) : "OK");
if (fd >= 0)
- return fd;
+ return fd;
drmMsg("drmOpenDevice: Open failed\n");
remove(buf);
@@ -432,7 +429,7 @@ wait_for_udev:
* \param create allow to create the device if set.
*
* \return a file descriptor on success, or a negative value on error.
- *
+ *
* \internal
* Calls drmOpenDevice() if \p create is set, otherwise assembles the device
* name from \p minor and opens it.
@@ -442,37 +439,37 @@ static int drmOpenMinor(int minor, int create, int type)
int fd;
char buf[64];
const char *dev_name;
-
+
if (create)
- return drmOpenDevice(makedev(DRM_MAJOR, minor), minor, type);
-
+ return drmOpenDevice(makedev(DRM_MAJOR, minor), minor, type);
+
switch (type) {
case DRM_NODE_PRIMARY:
- dev_name = DRM_DEV_NAME;
- break;
+ dev_name = DRM_DEV_NAME;
+ break;
case DRM_NODE_CONTROL:
- dev_name = DRM_CONTROL_DEV_NAME;
- break;
+ dev_name = DRM_CONTROL_DEV_NAME;
+ break;
case DRM_NODE_RENDER:
- dev_name = DRM_RENDER_DEV_NAME;
- break;
+ dev_name = DRM_RENDER_DEV_NAME;
+ break;
default:
- return -EINVAL;
+ return -EINVAL;
};
sprintf(buf, dev_name, DRM_DIR_NAME, minor);
if ((fd = open(buf, O_RDWR, 0)) >= 0)
- return fd;
+ return fd;
return -errno;
}
/**
* Determine whether the DRM kernel driver has been loaded.
- *
+ *
* \return 1 if the DRM driver is loaded, 0 otherwise.
*
- * \internal
+ * \internal
* Determine the presence of the kernel driver by attempting to open the 0
* minor and get version information. For backward compatibility with older
* Linux implementations, /proc/dri is also checked.
@@ -485,16 +482,16 @@ int drmAvailable(void)
if ((fd = drmOpenMinor(0, 1, DRM_NODE_PRIMARY)) < 0) {
#ifdef __linux__
- /* Try proc for backward Linux compatibility */
- if (!access("/proc/dri/0", R_OK))
- return 1;
+ /* Try proc for backward Linux compatibility */
+ if (!access("/proc/dri/0", R_OK))
+ return 1;
#endif
- return 0;
+ return 0;
}
-
+
if ((version = drmGetVersion(fd))) {
- retval = 1;
- drmFreeVersion(version);
+ retval = 1;
+ drmFreeVersion(version);
}
close(fd);
@@ -573,37 +570,37 @@ static int drmOpenByBusid(const char *busid, int type)
drmMsg("drmOpenByBusid: Searching for BusID %s\n", busid);
for (i = base; i < base + DRM_MAX_MINOR; i++) {
- fd = drmOpenMinor(i, 1, type);
- drmMsg("drmOpenByBusid: drmOpenMinor returns %d\n", fd);
- if (fd >= 0) {
- /* We need to try for 1.4 first for proper PCI domain support
- * and if that fails, we know the kernel is busted
- */
- sv.drm_di_major = 1;
- sv.drm_di_minor = 4;
- sv.drm_dd_major = -1; /* Don't care */
- sv.drm_dd_minor = -1; /* Don't care */
- if (drmSetInterfaceVersion(fd, &sv)) {
+ fd = drmOpenMinor(i, 1, type);
+ drmMsg("drmOpenByBusid: drmOpenMinor returns %d\n", fd);
+ if (fd >= 0) {
+ /* We need to try for 1.4 first for proper PCI domain support
+ * and if that fails, we know the kernel is busted
+ */
+ sv.drm_di_major = 1;
+ sv.drm_di_minor = 4;
+ sv.drm_dd_major = -1; /* Don't care */
+ sv.drm_dd_minor = -1; /* Don't care */
+ if (drmSetInterfaceVersion(fd, &sv)) {
#ifndef __alpha__
- pci_domain_ok = 0;
+ pci_domain_ok = 0;
#endif
- sv.drm_di_major = 1;
- sv.drm_di_minor = 1;
- sv.drm_dd_major = -1; /* Don't care */
- sv.drm_dd_minor = -1; /* Don't care */
- drmMsg("drmOpenByBusid: Interface 1.4 failed, trying 1.1\n");
- drmSetInterfaceVersion(fd, &sv);
- }
- buf = drmGetBusid(fd);
- drmMsg("drmOpenByBusid: drmGetBusid reports %s\n", buf);
- if (buf && drmMatchBusID(buf, busid, pci_domain_ok)) {
- drmFreeBusid(buf);
- return fd;
- }
- if (buf)
- drmFreeBusid(buf);
- close(fd);
- }
+ sv.drm_di_major = 1;
+ sv.drm_di_minor = 1;
+ sv.drm_dd_major = -1; /* Don't care */
+ sv.drm_dd_minor = -1; /* Don't care */
+ drmMsg("drmOpenByBusid: Interface 1.4 failed, trying 1.1\n");
+ drmSetInterfaceVersion(fd, &sv);
+ }
+ buf = drmGetBusid(fd);
+ drmMsg("drmOpenByBusid: drmGetBusid reports %s\n", buf);
+ if (buf && drmMatchBusID(buf, busid, pci_domain_ok)) {
+ drmFreeBusid(buf);
+ return fd;
+ }
+ if (buf)
+ drmFreeBusid(buf);
+ close(fd);
+ }
}
return -1;
}
@@ -614,14 +611,14 @@ static int drmOpenByBusid(const char *busid, int type)
*
* \param name driver name.
* \param type the device node type.
- *
+ *
* \return a file descriptor on success, or a negative value on error.
- *
+ *
* \internal
* This function opens the first minor number that matches the driver name and
* isn't already in use. If it's in use it then it will already have a bus ID
* assigned.
- *
+ *
* \sa drmOpenMinor(), drmGetVersion() and drmGetBusid().
*/
static int drmOpenByName(const char *name, int type)
@@ -640,56 +637,56 @@ static int drmOpenByName(const char *name, int type)
* already in use. If it's in use it will have a busid assigned already.
*/
for (i = base; i < base + DRM_MAX_MINOR; i++) {
- if ((fd = drmOpenMinor(i, 1, type)) >= 0) {
- if ((version = drmGetVersion(fd))) {
- if (!strcmp(version->name, name)) {
- drmFreeVersion(version);
- id = drmGetBusid(fd);
- drmMsg("drmGetBusid returned '%s'\n", id ? id : "NULL");
- if (!id || !*id) {
- if (id)
- drmFreeBusid(id);
- return fd;
- } else {
- drmFreeBusid(id);
- }
- } else {
- drmFreeVersion(version);
- }
- }
- close(fd);
- }
+ if ((fd = drmOpenMinor(i, 1, type)) >= 0) {
+ if ((version = drmGetVersion(fd))) {
+ if (!strcmp(version->name, name)) {
+ drmFreeVersion(version);
+ id = drmGetBusid(fd);
+ drmMsg("drmGetBusid returned '%s'\n", id ? id : "NULL");
+ if (!id || !*id) {
+ if (id)
+ drmFreeBusid(id);
+ return fd;
+ } else {
+ drmFreeBusid(id);
+ }
+ } else {
+ drmFreeVersion(version);
+ }
+ }
+ close(fd);
+ }
}
#ifdef __linux__
/* Backward-compatibility /proc support */
for (i = 0; i < 8; i++) {
- char proc_name[64], buf[512];
- char *driver, *pt, *devstring;
- int retcode;
-
- sprintf(proc_name, "/proc/dri/%d/name", i);
- if ((fd = open(proc_name, 0, 0)) >= 0) {
- retcode = read(fd, buf, sizeof(buf)-1);
- close(fd);
- if (retcode) {
- buf[retcode-1] = '\0';
- for (driver = pt = buf; *pt && *pt != ' '; ++pt)
- ;
- if (*pt) { /* Device is next */
- *pt = '\0';
- if (!strcmp(driver, name)) { /* Match */
- for (devstring = ++pt; *pt && *pt != ' '; ++pt)
- ;
- if (*pt) { /* Found busid */
- return drmOpenByBusid(++pt, type);
- } else { /* No busid */
- return drmOpenDevice(strtol(devstring, NULL, 0),i, type);
- }
- }
- }
- }
- }
+ char proc_name[64], buf[512];
+ char *driver, *pt, *devstring;
+ int retcode;
+
+ sprintf(proc_name, "/proc/dri/%d/name", i);
+ if ((fd = open(proc_name, 0, 0)) >= 0) {
+ retcode = read(fd, buf, sizeof(buf)-1);
+ close(fd);
+ if (retcode) {
+ buf[retcode-1] = '\0';
+ for (driver = pt = buf; *pt && *pt != ' '; ++pt)
+ ;
+ if (*pt) { /* Device is next */
+ *pt = '\0';
+ if (!strcmp(driver, name)) { /* Match */
+ for (devstring = ++pt; *pt && *pt != ' '; ++pt)
+ ;
+ if (*pt) { /* Found busid */
+ return drmOpenByBusid(++pt, type);
+ } else { /* No busid */
+ return drmOpenDevice(strtol(devstring, NULL, 0),i, type);
+ }
+ }
+ }
+ }
+ }
}
#endif
@@ -705,9 +702,9 @@ static int drmOpenByName(const char *name, int type)
*
* \param name driver name. Not referenced if bus ID is supplied.
* \param busid bus ID. Zero if not known.
- *
+ *
* \return a file descriptor on success, or a negative value on error.
- *
+ *
* \internal
* It calls drmOpenByBusid() if \p busid is specified or drmOpenByName()
* otherwise.
@@ -737,21 +734,21 @@ int drmOpenWithType(const char *name, const char *busid, int type)
{
if (!drmAvailable() && name != NULL && drm_server_info &&
drm_server_info->load_module) {
- /* try to load the kernel module */
- if (!drm_server_info->load_module(name)) {
- drmMsg("[drm] failed to load kernel module \"%s\"\n", name);
- return -1;
- }
+ /* try to load the kernel module */
+ if (!drm_server_info->load_module(name)) {
+ drmMsg("[drm] failed to load kernel module \"%s\"\n", name);
+ return -1;
+ }
}
if (busid) {
- int fd = drmOpenByBusid(busid, type);
- if (fd >= 0)
- return fd;
+ int fd = drmOpenByBusid(busid, type);
+ if (fd >= 0)
+ return fd;
}
-
+
if (name)
- return drmOpenByName(name, type);
+ return drmOpenByName(name, type);
return -1;
}
@@ -778,7 +775,7 @@ int drmOpenRender(int minor)
void drmFreeVersion(drmVersionPtr v)
{
if (!v)
- return;
+ return;
drmFree(v->name);
drmFree(v->date);
drmFree(v->desc);
@@ -798,7 +795,7 @@ void drmFreeVersion(drmVersionPtr v)
static void drmFreeKernelVersion(drm_version_t *v)
{
if (!v)
- return;
+ return;
drmFree(v->name);
drmFree(v->date);
drmFree(v->desc);
@@ -808,10 +805,10 @@ static void drmFreeKernelVersion(drm_version_t *v)
/**
* Copy version information.
- *
+ *
* \param d destination pointer.
* \param s source pointer.
- *
+ *
* \internal
* Used by drmGetVersion() to translate the information returned by the ioctl
* interface in a private structure into the public structure counterpart.
@@ -834,12 +831,12 @@ static void drmCopyVersion(drmVersionPtr d, const drm_version_t *s)
* Query the driver version information.
*
* \param fd file descriptor.
- *
+ *
* \return pointer to a drmVersion structure which should be freed with
* drmFreeVersion().
- *
+ *
* \note Similar information is available via /proc/dri.
- *
+ *
* \internal
* It gets the version information via successive DRM_IOCTL_VERSION ioctls,
* first with zeros to get the string lengths, and then the actually strings.
@@ -853,21 +850,21 @@ drmVersionPtr drmGetVersion(int fd)
memclear(*version);
if (drmIoctl(fd, DRM_IOCTL_VERSION, version)) {
- drmFreeKernelVersion(version);
- return NULL;
+ drmFreeKernelVersion(version);
+ return NULL;
}
if (version->name_len)
- version->name = drmMalloc(version->name_len + 1);
+ version->name = drmMalloc(version->name_len + 1);
if (version->date_len)
- version->date = drmMalloc(version->date_len + 1);
+ version->date = drmMalloc(version->date_len + 1);
if (version->desc_len)
- version->desc = drmMalloc(version->desc_len + 1);
+ version->desc = drmMalloc(version->desc_len + 1);
if (drmIoctl(fd, DRM_IOCTL_VERSION, version)) {
- drmMsg("DRM_IOCTL_VERSION: %s\n", strerror(errno));
- drmFreeKernelVersion(version);
- return NULL;
+ drmMsg("DRM_IOCTL_VERSION: %s\n", strerror(errno));
+ drmFreeKernelVersion(version);
+ return NULL;
}
/* The results might not be null-terminated strings, so terminate them. */
@@ -884,13 +881,13 @@ drmVersionPtr drmGetVersion(int fd)
/**
* Get version information for the DRM user space library.
- *
+ *
* This version number is driver independent.
- *
+ *
* \param fd file descriptor.
*
* \return version information.
- *
+ *
* \internal
* This function allocates and fills a drm_version structure with a hard coded
* version number.
@@ -918,29 +915,29 @@ drmVersionPtr drmGetLibVersion(int fd)
int drmGetCap(int fd, uint64_t capability, uint64_t *value)
{
- struct drm_get_cap cap;
- int ret;
+ struct drm_get_cap cap;
+ int ret;
- memclear(cap);
- cap.capability = capability;
+ memclear(cap);
+ cap.capability = capability;
- ret = drmIoctl(fd, DRM_IOCTL_GET_CAP, &cap);
- if (ret)
- return ret;
+ ret = drmIoctl(fd, DRM_IOCTL_GET_CAP, &cap);
+ if (ret)
+ return ret;
- *value = cap.value;
- return 0;
+ *value = cap.value;
+ return 0;
}
int drmSetClientCap(int fd, uint64_t capability, uint64_t value)
{
- struct drm_set_client_cap cap;
+ struct drm_set_client_cap cap;
- memclear(cap);
- cap.capability = capability;
- cap.value = value;
+ memclear(cap);
+ cap.capability = capability;
+ cap.value = value;
- return drmIoctl(fd, DRM_IOCTL_SET_CLIENT_CAP, &cap);
+ return drmIoctl(fd, DRM_IOCTL_SET_CLIENT_CAP, &cap);
}
/**
@@ -976,10 +973,10 @@ char *drmGetBusid(int fd)
memclear(u);
if (drmIoctl(fd, DRM_IOCTL_GET_UNIQUE, &u))
- return NULL;
+ return NULL;
u.unique = drmMalloc(u.unique_len + 1);
if (drmIoctl(fd, DRM_IOCTL_GET_UNIQUE, &u))
- return NULL;
+ return NULL;
u.unique[u.unique_len] = '\0';
return u.unique;
@@ -1007,7 +1004,7 @@ int drmSetBusid(int fd, const char *busid)
u.unique_len = strlen(busid);
if (drmIoctl(fd, DRM_IOCTL_SET_UNIQUE, &u)) {
- return -errno;
+ return -errno;
}
return 0;
}
@@ -1020,7 +1017,7 @@ int drmGetMagic(int fd, drm_magic_t * magic)
*magic = 0;
if (drmIoctl(fd, DRM_IOCTL_GET_MAGIC, &auth))
- return -errno;
+ return -errno;
*magic = auth.magic;
return 0;
}
@@ -1032,7 +1029,7 @@ int drmAuthMagic(int fd, drm_magic_t magic)
memclear(auth);
auth.magic = magic;
if (drmIoctl(fd, DRM_IOCTL_AUTH_MAGIC, &auth))
- return -errno;
+ return -errno;
return 0;
}
@@ -1048,7 +1045,7 @@ int drmAuthMagic(int fd, drm_magic_t magic)
* \param flags combination of several flags to modify the function actions.
* \param handle will be set to a value that may be used as the offset
* parameter for mmap().
- *
+ *
* \return zero on success or a negative value on error.
*
* \par Mapping the frame buffer
@@ -1059,7 +1056,7 @@ int drmAuthMagic(int fd, drm_magic_t magic)
*
* \par
* The area mapped will be uncached. If MTRR support is available in the
- * kernel, the frame buffer area will be set to write combining.
+ * kernel, the frame buffer area will be set to write combining.
*
* \par Mapping the MMIO register area
* For the MMIO register area,
@@ -1067,19 +1064,19 @@ int drmAuthMagic(int fd, drm_magic_t magic)
* - \p size will be the size of the register area bytes, and
* - \p type will be DRM_REGISTERS.
* \par
- * The area mapped will be uncached.
- *
+ * The area mapped will be uncached.
+ *
* \par Mapping the SAREA
* For the SAREA,
* - \p offset will be ignored and should be set to zero,
* - \p size will be the desired size of the SAREA in bytes,
* - \p type will be DRM_SHM.
- *
+ *
* \par
* A shared memory area of the requested size will be created and locked in
* kernel memory. This area may be mapped into client-space by using the handle
- * returned.
- *
+ * returned.
+ *
* \note May only be called by root.
*
* \internal
@@ -1087,7 +1084,7 @@ int drmAuthMagic(int fd, drm_magic_t magic)
* the arguments in a drm_map structure.
*/
int drmAddMap(int fd, drm_handle_t offset, drmSize size, drmMapType type,
- drmMapFlags flags, drm_handle_t *handle)
+ drmMapFlags flags, drm_handle_t *handle)
{
drm_map_t map;
@@ -1097,9 +1094,9 @@ int drmAddMap(int fd, drm_handle_t offset, drmSize size, drmMapType type,
map.type = type;
map.flags = flags;
if (drmIoctl(fd, DRM_IOCTL_ADD_MAP, &map))
- return -errno;
+ return -errno;
if (handle)
- *handle = (drm_handle_t)(uintptr_t)map.handle;
+ *handle = (drm_handle_t)(uintptr_t)map.handle;
return 0;
}
@@ -1111,18 +1108,18 @@ int drmRmMap(int fd, drm_handle_t handle)
map.handle = (void *)(uintptr_t)handle;
if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map))
- return -errno;
+ return -errno;
return 0;
}
/**
* Make buffers available for DMA transfers.
- *
+ *
* \param fd file descriptor.
* \param count number of buffers.
* \param size size of each buffer.
* \param flags buffer allocation flags.
- * \param agp_offset offset in the AGP aperture
+ * \param agp_offset offset in the AGP aperture
*
* \return number of buffers allocated, negative on error.
*
@@ -1132,7 +1129,7 @@ int drmRmMap(int fd, drm_handle_t handle)
* \sa drm_buf_desc.
*/
int drmAddBufs(int fd, int count, int size, drmBufDescFlags flags,
- int agp_offset)
+ int agp_offset)
{
drm_buf_desc_t request;
@@ -1143,7 +1140,7 @@ int drmAddBufs(int fd, int count, int size, drmBufDescFlags flags,
request.agp_start = agp_offset;
if (drmIoctl(fd, DRM_IOCTL_ADD_BUFS, &request))
- return -errno;
+ return -errno;
return request.count;
}
@@ -1155,28 +1152,28 @@ int drmMarkBufs(int fd, double low, double high)
memclear(info);
if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info))
- return -EINVAL;
+ return -EINVAL;
if (!info.count)
- return -EINVAL;
+ return -EINVAL;
if (!(info.list = drmMalloc(info.count * sizeof(*info.list))))
- return -ENOMEM;
+ return -ENOMEM;
if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) {
- int retval = -errno;
- drmFree(info.list);
- return retval;
+ int retval = -errno;
+ drmFree(info.list);
+ return retval;
}
for (i = 0; i < info.count; i++) {
- info.list[i].low_mark = low * info.list[i].count;
- info.list[i].high_mark = high * info.list[i].count;
- if (drmIoctl(fd, DRM_IOCTL_MARK_BUFS, &info.list[i])) {
- int retval = -errno;
- drmFree(info.list);
- return retval;
- }
+ info.list[i].low_mark = low * info.list[i].count;
+ info.list[i].high_mark = high * info.list[i].count;
+ if (drmIoctl(fd, DRM_IOCTL_MARK_BUFS, &info.list[i])) {
+ int retval = -errno;
+ drmFree(info.list);
+ return retval;
+ }
}
drmFree(info.list);
@@ -1191,9 +1188,9 @@ int drmMarkBufs(int fd, double low, double high)
* \param list list of buffers to be freed.
*
* \return zero on success, or a negative value on failure.
- *
+ *
* \note This function is primarily used for debugging.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_FREE_BUFS ioctl, passing
* the arguments in a drm_buf_free structure.
@@ -1206,7 +1203,7 @@ int drmFreeBufs(int fd, int count, int *list)
request.count = count;
request.list = list;
if (drmIoctl(fd, DRM_IOCTL_FREE_BUFS, &request))
- return -errno;
+ return -errno;
return 0;
}
@@ -1246,7 +1243,7 @@ int drmClose(int fd)
* begins.
*
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper for mmap().
*/
@@ -1255,16 +1252,16 @@ int drmMap(int fd, drm_handle_t handle, drmSize size, drmAddressPtr address)
static unsigned long pagesize_mask = 0;
if (fd < 0)
- return -EINVAL;
+ return -EINVAL;
if (!pagesize_mask)
- pagesize_mask = getpagesize() - 1;
+ pagesize_mask = getpagesize() - 1;
size = (size + pagesize_mask) & ~pagesize_mask;
*address = drm_mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle);
if (*address == MAP_FAILED)
- return -errno;
+ return -errno;
return 0;
}
@@ -1274,7 +1271,7 @@ int drmMap(int fd, drm_handle_t handle, drmSize size, drmAddressPtr address)
*
* \param address address as given by drmMap().
* \param size size in bytes. Must match the size used by drmMap().
- *
+ *
* \return zero on success, or a negative value on failure.
*
* \internal
@@ -1294,28 +1291,28 @@ drmBufInfoPtr drmGetBufInfo(int fd)
memclear(info);
if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info))
- return NULL;
+ return NULL;
if (info.count) {
- if (!(info.list = drmMalloc(info.count * sizeof(*info.list))))
- return NULL;
-
- if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) {
- drmFree(info.list);
- return NULL;
- }
-
- retval = drmMalloc(sizeof(*retval));
- retval->count = info.count;
- retval->list = drmMalloc(info.count * sizeof(*retval->list));
- for (i = 0; i < info.count; i++) {
- retval->list[i].count = info.list[i].count;
- retval->list[i].size = info.list[i].size;
- retval->list[i].low_mark = info.list[i].low_mark;
- retval->list[i].high_mark = info.list[i].high_mark;
- }
- drmFree(info.list);
- return retval;
+ if (!(info.list = drmMalloc(info.count * sizeof(*info.list))))
+ return NULL;
+
+ if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) {
+ drmFree(info.list);
+ return NULL;
+ }
+
+ retval = drmMalloc(sizeof(*retval));
+ retval->count = info.count;
+ retval->list = drmMalloc(info.count * sizeof(*retval->list));
+ for (i = 0; i < info.count; i++) {
+ retval->list[i].count = info.list[i].count;
+ retval->list[i].size = info.list[i].size;
+ retval->list[i].low_mark = info.list[i].low_mark;
+ retval->list[i].high_mark = info.list[i].high_mark;
+ }
+ drmFree(info.list);
+ return retval;
}
return NULL;
}
@@ -1329,12 +1326,12 @@ drmBufInfoPtr drmGetBufInfo(int fd)
*
* \note The client may not use these buffers until obtaining buffer indices
* with drmDMA().
- *
+ *
* \internal
* This function calls the DRM_IOCTL_MAP_BUFS ioctl and copies the returned
* information about the buffers in a drm_buf_map structure into the
* client-visible data structures.
- */
+ */
drmBufMapPtr drmMapBufs(int fd)
{
drm_buf_map_t bufs;
@@ -1343,31 +1340,32 @@ drmBufMapPtr drmMapBufs(int fd)
memclear(bufs);
if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs))
- return NULL;
+ return NULL;
if (!bufs.count)
- return NULL;
+ return NULL;
- if (!(bufs.list = drmMalloc(bufs.count * sizeof(*bufs.list))))
- return NULL;
+ if (!(bufs.list = drmMalloc(bufs.count * sizeof(*bufs.list))))
+ return NULL;
- if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) {
- drmFree(bufs.list);
- return NULL;
- }
+ if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) {
+ drmFree(bufs.list);
+ return NULL;
+ }
- retval = drmMalloc(sizeof(*retval));
- retval->count = bufs.count;
- retval->list = drmMalloc(bufs.count * sizeof(*retval->list));
- for (i = 0; i < bufs.count; i++) {
- retval->list[i].idx = bufs.list[i].idx;
- retval->list[i].total = bufs.list[i].total;
- retval->list[i].used = 0;
- retval->list[i].address = bufs.list[i].address;
- }
+ retval = drmMalloc(sizeof(*retval));
+ retval->count = bufs.count;
+ retval->list = drmMalloc(bufs.count * sizeof(*retval->list));
+ for (i = 0; i < bufs.count; i++) {
+ retval->list[i].idx = bufs.list[i].idx;
+ retval->list[i].total = bufs.list[i].total;
+ retval->list[i].used = 0;
+ retval->list[i].address = bufs.list[i].address;
+ }
- drmFree(bufs.list);
- return retval;
+ drmFree(bufs.list);
+
+ return retval;
}
@@ -1385,23 +1383,24 @@ int drmUnmapBufs(drmBufMapPtr bufs)
int i;
for (i = 0; i < bufs->count; i++) {
- drm_munmap(bufs->list[i].address, bufs->list[i].total);
+ drm_munmap(bufs->list[i].address, bufs->list[i].total);
}
drmFree(bufs->list);
drmFree(bufs);
+
return 0;
}
-#define DRM_DMA_RETRY 16
+#define DRM_DMA_RETRY 16
/**
* Reserve DMA buffers.
*
* \param fd file descriptor.
- * \param request
- *
+ * \param request
+ *
* \return zero on success, or a negative value on failure.
*
* \internal
@@ -1425,14 +1424,14 @@ int drmDMA(int fd, drmDMAReqPtr request)
dma.granted_count = 0;
do {
- ret = ioctl( fd, DRM_IOCTL_DMA, &dma );
+ ret = ioctl( fd, DRM_IOCTL_DMA, &dma );
} while ( ret && errno == EAGAIN && i++ < DRM_DMA_RETRY );
if ( ret == 0 ) {
- request->granted_count = dma.granted_count;
- return 0;
+ request->granted_count = dma.granted_count;
+ return 0;
} else {
- return -errno;
+ return -errno;
}
}
@@ -1444,9 +1443,9 @@ int drmDMA(int fd, drmDMAReqPtr request)
* \param context context.
* \param flags flags that determine the sate of the hardware when the function
* returns.
- *
+ *
* \return always zero.
- *
+ *
* \internal
* This function translates the arguments into a drm_lock structure and issue
* the DRM_IOCTL_LOCK ioctl until the lock is successfully acquired.
@@ -1466,7 +1465,7 @@ int drmGetLock(int fd, drm_context_t context, drmLockFlags flags)
if (flags & DRM_HALT_CUR_QUEUES) lock.flags |= _DRM_HALT_CUR_QUEUES;
while (drmIoctl(fd, DRM_IOCTL_LOCK, &lock))
- ;
+ ;
return 0;
}
@@ -1475,9 +1474,9 @@ int drmGetLock(int fd, drm_context_t context, drmLockFlags flags)
*
* \param fd file descriptor.
* \param context context.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_UNLOCK ioctl, passing the
* argument in a drm_lock structure.
@@ -1500,24 +1499,24 @@ drm_context_t *drmGetReservedContextList(int fd, int *count)
memclear(res);
if (drmIoctl(fd, DRM_IOCTL_RES_CTX, &res))
- return NULL;
+ return NULL;
if (!res.count)
- return NULL;
+ return NULL;
if (!(list = drmMalloc(res.count * sizeof(*list))))
- return NULL;
+ return NULL;
if (!(retval = drmMalloc(res.count * sizeof(*retval)))) {
- drmFree(list);
- return NULL;
+ drmFree(list);
+ return NULL;
}
res.contexts = list;
if (drmIoctl(fd, DRM_IOCTL_RES_CTX, &res))
- return NULL;
+ return NULL;
for (i = 0; i < res.count; i++)
- retval[i] = list[i].handle;
+ retval[i] = list[i].handle;
drmFree(list);
*count = res.count;
@@ -1538,11 +1537,11 @@ void drmFreeReservedContextList(drm_context_t *pt)
* \param fd file descriptor.
* \param handle is set on success. To be used by the client when requesting DMA
* dispatch with drmDMA().
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \note May only be called by root.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_ADD_CTX ioctl, passing the
* argument in a drm_ctx structure.
@@ -1553,7 +1552,7 @@ int drmCreateContext(int fd, drm_context_t *handle)
memclear(ctx);
if (drmIoctl(fd, DRM_IOCTL_ADD_CTX, &ctx))
- return -errno;
+ return -errno;
*handle = ctx.handle;
return 0;
}
@@ -1565,7 +1564,7 @@ int drmSwitchToContext(int fd, drm_context_t context)
memclear(ctx);
ctx.handle = context;
if (drmIoctl(fd, DRM_IOCTL_SWITCH_CTX, &ctx))
- return -errno;
+ return -errno;
return 0;
}
@@ -1582,11 +1581,11 @@ int drmSetContextFlags(int fd, drm_context_t context, drm_context_tFlags flags)
memclear(ctx);
ctx.handle = context;
if (flags & DRM_CONTEXT_PRESERVED)
- ctx.flags |= _DRM_CONTEXT_PRESERVED;
+ ctx.flags |= _DRM_CONTEXT_PRESERVED;
if (flags & DRM_CONTEXT_2DONLY)
- ctx.flags |= _DRM_CONTEXT_2DONLY;
+ ctx.flags |= _DRM_CONTEXT_2DONLY;
if (drmIoctl(fd, DRM_IOCTL_MOD_CTX, &ctx))
- return -errno;
+ return -errno;
return 0;
}
@@ -1598,12 +1597,12 @@ int drmGetContextFlags(int fd, drm_context_t context,
memclear(ctx);
ctx.handle = context;
if (drmIoctl(fd, DRM_IOCTL_GET_CTX, &ctx))
- return -errno;
+ return -errno;
*flags = 0;
if (ctx.flags & _DRM_CONTEXT_PRESERVED)
- *flags |= DRM_CONTEXT_PRESERVED;
+ *flags |= DRM_CONTEXT_PRESERVED;
if (ctx.flags & _DRM_CONTEXT_2DONLY)
- *flags |= DRM_CONTEXT_2DONLY;
+ *flags |= DRM_CONTEXT_2DONLY;
return 0;
}
@@ -1612,14 +1611,14 @@ int drmGetContextFlags(int fd, drm_context_t context,
*
* Free any kernel-level resources allocated with drmCreateContext() associated
* with the context.
- *
+ *
* \param fd file descriptor.
* \param handle handle given by drmCreateContext().
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \note May only be called by root.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_RM_CTX ioctl, passing the
* argument in a drm_ctx structure.
@@ -1631,7 +1630,7 @@ int drmDestroyContext(int fd, drm_context_t handle)
memclear(ctx);
ctx.handle = handle;
if (drmIoctl(fd, DRM_IOCTL_RM_CTX, &ctx))
- return -errno;
+ return -errno;
return 0;
}
@@ -1641,7 +1640,7 @@ int drmCreateDrawable(int fd, drm_drawable_t *handle)
memclear(draw);
if (drmIoctl(fd, DRM_IOCTL_ADD_DRAW, &draw))
- return -errno;
+ return -errno;
*handle = draw.handle;
return 0;
}
@@ -1653,13 +1652,13 @@ int drmDestroyDrawable(int fd, drm_drawable_t handle)
memclear(draw);
draw.handle = handle;
if (drmIoctl(fd, DRM_IOCTL_RM_DRAW, &draw))
- return -errno;
+ return -errno;
return 0;
}
int drmUpdateDrawableInfo(int fd, drm_drawable_t handle,
- drm_drawable_info_type_t type, unsigned int num,
- void *data)
+ drm_drawable_info_type_t type, unsigned int num,
+ void *data)
{
drm_update_draw_t update;
@@ -1670,7 +1669,7 @@ int drmUpdateDrawableInfo(int fd, drm_drawable_t handle,
update.data = (unsigned long long)(unsigned long)data;
if (drmIoctl(fd, DRM_IOCTL_UPDATE_DRAW, &update))
- return -errno;
+ return -errno;
return 0;
}
@@ -1681,16 +1680,16 @@ int drmUpdateDrawableInfo(int fd, drm_drawable_t handle,
* Must be called before any of the other AGP related calls.
*
* \param fd file descriptor.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_ACQUIRE ioctl.
*/
int drmAgpAcquire(int fd)
{
if (drmIoctl(fd, DRM_IOCTL_AGP_ACQUIRE, NULL))
- return -errno;
+ return -errno;
return 0;
}
@@ -1699,16 +1698,16 @@ int drmAgpAcquire(int fd)
* Release the AGP device.
*
* \param fd file descriptor.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_RELEASE ioctl.
*/
int drmAgpRelease(int fd)
{
if (drmIoctl(fd, DRM_IOCTL_AGP_RELEASE, NULL))
- return -errno;
+ return -errno;
return 0;
}
@@ -1718,9 +1717,9 @@ int drmAgpRelease(int fd)
*
* \param fd file descriptor.
* \param mode AGP mode.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_ENABLE ioctl, passing the
* argument in a drm_agp_mode structure.
@@ -1732,7 +1731,7 @@ int drmAgpEnable(int fd, unsigned long mode)
memclear(m);
m.mode = mode;
if (drmIoctl(fd, DRM_IOCTL_AGP_ENABLE, &m))
- return -errno;
+ return -errno;
return 0;
}
@@ -1746,15 +1745,15 @@ int drmAgpEnable(int fd, unsigned long mode)
* \param address if not zero, will be set to the physical address of the
* allocated memory.
* \param handle on success will be set to a handle of the allocated memory.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_ALLOC ioctl, passing the
* arguments in a drm_agp_buffer structure.
*/
int drmAgpAlloc(int fd, unsigned long size, unsigned long type,
- unsigned long *address, drm_handle_t *handle)
+ unsigned long *address, drm_handle_t *handle)
{
drm_agp_buffer_t b;
@@ -1763,9 +1762,9 @@ int drmAgpAlloc(int fd, unsigned long size, unsigned long type,
b.size = size;
b.type = type;
if (drmIoctl(fd, DRM_IOCTL_AGP_ALLOC, &b))
- return -errno;
+ return -errno;
if (address != 0UL)
- *address = b.physical;
+ *address = b.physical;
*handle = b.handle;
return 0;
}
@@ -1776,9 +1775,9 @@ int drmAgpAlloc(int fd, unsigned long size, unsigned long type,
*
* \param fd file descriptor.
* \param handle handle to the allocated memory, as given by drmAgpAllocate().
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_FREE ioctl, passing the
* argument in a drm_agp_buffer structure.
@@ -1790,7 +1789,7 @@ int drmAgpFree(int fd, drm_handle_t handle)
memclear(b);
b.handle = handle;
if (drmIoctl(fd, DRM_IOCTL_AGP_FREE, &b))
- return -errno;
+ return -errno;
return 0;
}
@@ -1801,9 +1800,9 @@ int drmAgpFree(int fd, drm_handle_t handle)
* \param fd file descriptor.
* \param handle handle to the allocated memory, as given by drmAgpAllocate().
* \param offset offset in bytes. It will round to page boundary.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_BIND ioctl, passing the
* argument in a drm_agp_binding structure.
@@ -1816,7 +1815,7 @@ int drmAgpBind(int fd, drm_handle_t handle, unsigned long offset)
b.handle = handle;
b.offset = offset;
if (drmIoctl(fd, DRM_IOCTL_AGP_BIND, &b))
- return -errno;
+ return -errno;
return 0;
}
@@ -1826,9 +1825,9 @@ int drmAgpBind(int fd, drm_handle_t handle, unsigned long offset)
*
* \param fd file descriptor.
* \param handle handle to the allocated memory, as given by drmAgpAllocate().
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_UNBIND ioctl, passing
* the argument in a drm_agp_binding structure.
@@ -1840,7 +1839,7 @@ int drmAgpUnbind(int fd, drm_handle_t handle)
memclear(b);
b.handle = handle;
if (drmIoctl(fd, DRM_IOCTL_AGP_UNBIND, &b))
- return -errno;
+ return -errno;
return 0;
}
@@ -1849,9 +1848,9 @@ int drmAgpUnbind(int fd, drm_handle_t handle)
* Get AGP driver major version number.
*
* \param fd file descriptor.
- *
+ *
* \return major version number on success, or a negative value on failure..
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -1863,7 +1862,7 @@ int drmAgpVersionMajor(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return -errno;
+ return -errno;
return i.agp_version_major;
}
@@ -1872,9 +1871,9 @@ int drmAgpVersionMajor(int fd)
* Get AGP driver minor version number.
*
* \param fd file descriptor.
- *
+ *
* \return minor version number on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -1886,7 +1885,7 @@ int drmAgpVersionMinor(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return -errno;
+ return -errno;
return i.agp_version_minor;
}
@@ -1895,9 +1894,9 @@ int drmAgpVersionMinor(int fd)
* Get AGP mode.
*
* \param fd file descriptor.
- *
+ *
* \return mode on success, or zero on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -1909,7 +1908,7 @@ unsigned long drmAgpGetMode(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return 0;
+ return 0;
return i.mode;
}
@@ -1918,9 +1917,9 @@ unsigned long drmAgpGetMode(int fd)
* Get AGP aperture base.
*
* \param fd file descriptor.
- *
+ *
* \return aperture base on success, zero on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -1932,7 +1931,7 @@ unsigned long drmAgpBase(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return 0;
+ return 0;
return i.aperture_base;
}
@@ -1941,9 +1940,9 @@ unsigned long drmAgpBase(int fd)
* Get AGP aperture size.
*
* \param fd file descriptor.
- *
+ *
* \return aperture size on success, zero on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -1955,7 +1954,7 @@ unsigned long drmAgpSize(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return 0;
+ return 0;
return i.aperture_size;
}
@@ -1964,9 +1963,9 @@ unsigned long drmAgpSize(int fd)
* Get used AGP memory.
*
* \param fd file descriptor.
- *
+ *
* \return memory used on success, or zero on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -1978,7 +1977,7 @@ unsigned long drmAgpMemoryUsed(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return 0;
+ return 0;
return i.memory_used;
}
@@ -1987,9 +1986,9 @@ unsigned long drmAgpMemoryUsed(int fd)
* Get available AGP memory.
*
* \param fd file descriptor.
- *
+ *
* \return memory available on success, or zero on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -2001,7 +2000,7 @@ unsigned long drmAgpMemoryAvail(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return 0;
+ return 0;
return i.memory_allowed;
}
@@ -2010,9 +2009,9 @@ unsigned long drmAgpMemoryAvail(int fd)
* Get hardware vendor ID.
*
* \param fd file descriptor.
- *
+ *
* \return vendor ID on success, or zero on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -2024,7 +2023,7 @@ unsigned int drmAgpVendorId(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return 0;
+ return 0;
return i.id_vendor;
}
@@ -2033,9 +2032,9 @@ unsigned int drmAgpVendorId(int fd)
* Get hardware device ID.
*
* \param fd file descriptor.
- *
+ *
* \return zero on success, or zero on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_AGP_INFO ioctl, getting the
* necessary information in a drm_agp_info structure.
@@ -2047,7 +2046,7 @@ unsigned int drmAgpDeviceId(int fd)
memclear(i);
if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i))
- return 0;
+ return 0;
return i.id_device;
}
@@ -2060,7 +2059,7 @@ int drmScatterGatherAlloc(int fd, unsigned long size, drm_handle_t *handle)
*handle = 0;
sg.size = size;
if (drmIoctl(fd, DRM_IOCTL_SG_ALLOC, &sg))
- return -errno;
+ return -errno;
*handle = sg.handle;
return 0;
}
@@ -2072,7 +2071,7 @@ int drmScatterGatherFree(int fd, drm_handle_t handle)
memclear(sg);
sg.handle = handle;
if (drmIoctl(fd, DRM_IOCTL_SG_FREE, &sg))
- return -errno;
+ return -errno;
return 0;
}
@@ -2081,9 +2080,9 @@ int drmScatterGatherFree(int fd, drm_handle_t handle)
*
* \param fd file descriptor.
* \param vbl pointer to a drmVBlank structure.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_WAIT_VBLANK ioctl.
*/
@@ -2094,8 +2093,8 @@ int drmWaitVBlank(int fd, drmVBlankPtr vbl)
ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
if (ret < 0) {
- fprintf(stderr, "clock_gettime failed: %s\n", strerror(errno));
- goto out;
+ fprintf(stderr, "clock_gettime failed: %s\n", strerror(errno));
+ goto out;
}
timeout.tv_sec++;
@@ -2103,15 +2102,15 @@ int drmWaitVBlank(int fd, drmVBlankPtr vbl)
ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl);
vbl->request.type &= ~DRM_VBLANK_RELATIVE;
if (ret && errno == EINTR) {
- clock_gettime(CLOCK_MONOTONIC, &cur);
- /* Timeout after 1s */
- if (cur.tv_sec > timeout.tv_sec + 1 ||
- (cur.tv_sec == timeout.tv_sec && cur.tv_nsec >=
- timeout.tv_nsec)) {
- errno = EBUSY;
- ret = -1;
- break;
- }
+ clock_gettime(CLOCK_MONOTONIC, &cur);
+ /* Timeout after 1s */
+ if (cur.tv_sec > timeout.tv_sec + 1 ||
+ (cur.tv_sec == timeout.tv_sec && cur.tv_nsec >=
+ timeout.tv_nsec)) {
+ errno = EBUSY;
+ ret = -1;
+ break;
+ }
}
} while (ret && errno == EINTR);
@@ -2123,22 +2122,22 @@ int drmError(int err, const char *label)
{
switch (err) {
case DRM_ERR_NO_DEVICE:
- fprintf(stderr, "%s: no device\n", label);
- break;
+ fprintf(stderr, "%s: no device\n", label);
+ break;
case DRM_ERR_NO_ACCESS:
- fprintf(stderr, "%s: no access\n", label);
- break;
+ fprintf(stderr, "%s: no access\n", label);
+ break;
case DRM_ERR_NOT_ROOT:
- fprintf(stderr, "%s: not root\n", label);
- break;
+ fprintf(stderr, "%s: not root\n", label);
+ break;
case DRM_ERR_INVALID:
- fprintf(stderr, "%s: invalid args\n", label);
- break;
+ fprintf(stderr, "%s: invalid args\n", label);
+ break;
default:
- if (err < 0)
- err = -err;
- fprintf( stderr, "%s: error %d (%s)\n", label, err, strerror(err) );
- break;
+ if (err < 0)
+ err = -err;
+ fprintf( stderr, "%s: error %d (%s)\n", label, err, strerror(err) );
+ break;
}
return 1;
@@ -2149,9 +2148,9 @@ int drmError(int err, const char *label)
*
* \param fd file descriptor.
* \param irq IRQ number.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_CONTROL ioctl, passing the
* argument in a drm_control structure.
@@ -2164,7 +2163,7 @@ int drmCtlInstHandler(int fd, int irq)
ctl.func = DRM_INST_HANDLER;
ctl.irq = irq;
if (drmIoctl(fd, DRM_IOCTL_CONTROL, &ctl))
- return -errno;
+ return -errno;
return 0;
}
@@ -2173,9 +2172,9 @@ int drmCtlInstHandler(int fd, int irq)
* Uninstall IRQ handler.
*
* \param fd file descriptor.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_CONTROL ioctl, passing the
* argument in a drm_control structure.
@@ -2188,7 +2187,7 @@ int drmCtlUninstHandler(int fd)
ctl.func = DRM_UNINST_HANDLER;
ctl.irq = 0;
if (drmIoctl(fd, DRM_IOCTL_CONTROL, &ctl))
- return -errno;
+ return -errno;
return 0;
}
@@ -2205,7 +2204,7 @@ int drmFinish(int fd, int context, drmLockFlags flags)
if (flags & DRM_HALT_ALL_QUEUES) lock.flags |= _DRM_HALT_ALL_QUEUES;
if (flags & DRM_HALT_CUR_QUEUES) lock.flags |= _DRM_HALT_CUR_QUEUES;
if (drmIoctl(fd, DRM_IOCTL_FINISH, &lock))
- return -errno;
+ return -errno;
return 0;
}
@@ -2216,9 +2215,9 @@ int drmFinish(int fd, int context, drmLockFlags flags)
* \param busnum bus number.
* \param devnum device number.
* \param funcnum function number.
- *
+ *
* \return IRQ number on success, or a negative value on failure.
- *
+ *
* \internal
* This function is a wrapper around the DRM_IOCTL_IRQ_BUSID ioctl, passing the
* arguments in a drm_irq_busid structure.
@@ -2232,7 +2231,7 @@ int drmGetInterruptFromBusID(int fd, int busnum, int devnum, int funcnum)
p.devnum = devnum;
p.funcnum = funcnum;
if (drmIoctl(fd, DRM_IOCTL_IRQ_BUSID, &p))
- return -errno;
+ return -errno;
return p.irq;
}
@@ -2241,8 +2240,8 @@ int drmAddContextTag(int fd, drm_context_t context, void *tag)
drmHashEntry *entry = drmGetEntry(fd);
if (drmHashInsert(entry->tagTable, context, tag)) {
- drmHashDelete(entry->tagTable, context);
- drmHashInsert(entry->tagTable, context, tag);
+ drmHashDelete(entry->tagTable, context);
+ drmHashInsert(entry->tagTable, context, tag);
}
return 0;
}
@@ -2260,7 +2259,7 @@ void *drmGetContextTag(int fd, drm_context_t context)
void *value;
if (drmHashLookup(entry->tagTable, context, &value))
- return NULL;
+ return NULL;
return value;
}
@@ -2275,7 +2274,7 @@ int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id,
map.handle = (void *)(uintptr_t)handle;
if (drmIoctl(fd, DRM_IOCTL_SET_SAREA_CTX, &map))
- return -errno;
+ return -errno;
return 0;
}
@@ -2288,23 +2287,23 @@ int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id,
map.ctx_id = ctx_id;
if (drmIoctl(fd, DRM_IOCTL_GET_SAREA_CTX, &map))
- return -errno;
+ return -errno;
if (handle)
- *handle = (drm_handle_t)(uintptr_t)map.handle;
+ *handle = (drm_handle_t)(uintptr_t)map.handle;
return 0;
}
int drmGetMap(int fd, int idx, drm_handle_t *offset, drmSize *size,
- drmMapType *type, drmMapFlags *flags, drm_handle_t *handle,
- int *mtrr)
+ drmMapType *type, drmMapFlags *flags, drm_handle_t *handle,
+ int *mtrr)
{
drm_map_t map;
memclear(map);
map.offset = idx;
if (drmIoctl(fd, DRM_IOCTL_GET_MAP, &map))
- return -errno;
+ return -errno;
*offset = map.offset;
*size = map.size;
*type = map.type;
@@ -2315,14 +2314,14 @@ int drmGetMap(int fd, int idx, drm_handle_t *offset, drmSize *size,
}
int drmGetClient(int fd, int idx, int *auth, int *pid, int *uid,
- unsigned long *magic, unsigned long *iocs)
+ unsigned long *magic, unsigned long *iocs)
{
drm_client_t client;
memclear(client);
client.idx = idx;
if (drmIoctl(fd, DRM_IOCTL_GET_CLIENT, &client))
- return -errno;
+ return -errno;
*auth = client.auth;
*pid = client.pid;
*uid = client.uid;
@@ -2338,12 +2337,12 @@ int drmGetStats(int fd, drmStatsT *stats)
memclear(s);
if (drmIoctl(fd, DRM_IOCTL_GET_STATS, &s))
- return -errno;
+ return -errno;
stats->count = 0;
memset(stats, 0, sizeof(*stats));
if (s.count > sizeof(stats->data)/sizeof(stats->data[0]))
- return -1;
+ return -1;
#define SET_VALUE \
stats->data[i].long_format = "%-20.20s"; \
@@ -2370,87 +2369,87 @@ int drmGetStats(int fd, drmStatsT *stats)
stats->count = s.count;
for (i = 0; i < s.count; i++) {
- stats->data[i].value = s.data[i].value;
- switch (s.data[i].type) {
- case _DRM_STAT_LOCK:
- stats->data[i].long_name = "Lock";
- stats->data[i].rate_name = "Lock";
- SET_VALUE;
- break;
- case _DRM_STAT_OPENS:
- stats->data[i].long_name = "Opens";
- stats->data[i].rate_name = "O";
- SET_COUNT;
- stats->data[i].verbose = 1;
- break;
- case _DRM_STAT_CLOSES:
- stats->data[i].long_name = "Closes";
- stats->data[i].rate_name = "Lock";
- SET_COUNT;
- stats->data[i].verbose = 1;
- break;
- case _DRM_STAT_IOCTLS:
- stats->data[i].long_name = "Ioctls";
- stats->data[i].rate_name = "Ioc/s";
- SET_COUNT;
- break;
- case _DRM_STAT_LOCKS:
- stats->data[i].long_name = "Locks";
- stats->data[i].rate_name = "Lck/s";
- SET_COUNT;
- break;
- case _DRM_STAT_UNLOCKS:
- stats->data[i].long_name = "Unlocks";
- stats->data[i].rate_name = "Unl/s";
- SET_COUNT;
- break;
- case _DRM_STAT_IRQ:
- stats->data[i].long_name = "IRQs";
- stats->data[i].rate_name = "IRQ/s";
- SET_COUNT;
- break;
- case _DRM_STAT_PRIMARY:
- stats->data[i].long_name = "Primary Bytes";
- stats->data[i].rate_name = "PB/s";
- SET_BYTE;
- break;
- case _DRM_STAT_SECONDARY:
- stats->data[i].long_name = "Secondary Bytes";
- stats->data[i].rate_name = "SB/s";
- SET_BYTE;
- break;
- case _DRM_STAT_DMA:
- stats->data[i].long_name = "DMA";
- stats->data[i].rate_name = "DMA/s";
- SET_COUNT;
- break;
- case _DRM_STAT_SPECIAL:
- stats->data[i].long_name = "Special DMA";
- stats->data[i].rate_name = "dma/s";
- SET_COUNT;
- break;
- case _DRM_STAT_MISSED:
- stats->data[i].long_name = "Miss";
- stats->data[i].rate_name = "Ms/s";
- SET_COUNT;
- break;
- case _DRM_STAT_VALUE:
- stats->data[i].long_name = "Value";
- stats->data[i].rate_name = "Value";
- SET_VALUE;
- break;
- case _DRM_STAT_BYTE:
- stats->data[i].long_name = "Bytes";
- stats->data[i].rate_name = "B/s";
- SET_BYTE;
- break;
- case _DRM_STAT_COUNT:
- default:
- stats->data[i].long_name = "Count";
- stats->data[i].rate_name = "Cnt/s";
- SET_COUNT;
- break;
- }
+ stats->data[i].value = s.data[i].value;
+ switch (s.data[i].type) {
+ case _DRM_STAT_LOCK:
+ stats->data[i].long_name = "Lock";
+ stats->data[i].rate_name = "Lock";
+ SET_VALUE;
+ break;
+ case _DRM_STAT_OPENS:
+ stats->data[i].long_name = "Opens";
+ stats->data[i].rate_name = "O";
+ SET_COUNT;
+ stats->data[i].verbose = 1;
+ break;
+ case _DRM_STAT_CLOSES:
+ stats->data[i].long_name = "Closes";
+ stats->data[i].rate_name = "Lock";
+ SET_COUNT;
+ stats->data[i].verbose = 1;
+ break;
+ case _DRM_STAT_IOCTLS:
+ stats->data[i].long_name = "Ioctls";
+ stats->data[i].rate_name = "Ioc/s";
+ SET_COUNT;
+ break;
+ case _DRM_STAT_LOCKS:
+ stats->data[i].long_name = "Locks";
+ stats->data[i].rate_name = "Lck/s";
+ SET_COUNT;
+ break;
+ case _DRM_STAT_UNLOCKS:
+ stats->data[i].long_name = "Unlocks";
+ stats->data[i].rate_name = "Unl/s";
+ SET_COUNT;
+ break;
+ case _DRM_STAT_IRQ:
+ stats->data[i].long_name = "IRQs";
+ stats->data[i].rate_name = "IRQ/s";
+ SET_COUNT;
+ break;
+ case _DRM_STAT_PRIMARY:
+ stats->data[i].long_name = "Primary Bytes";
+ stats->data[i].rate_name = "PB/s";
+ SET_BYTE;
+ break;
+ case _DRM_STAT_SECONDARY:
+ stats->data[i].long_name = "Secondary Bytes";
+ stats->data[i].rate_name = "SB/s";
+ SET_BYTE;
+ break;
+ case _DRM_STAT_DMA:
+ stats->data[i].long_name = "DMA";
+ stats->data[i].rate_name = "DMA/s";
+ SET_COUNT;
+ break;
+ case _DRM_STAT_SPECIAL:
+ stats->data[i].long_name = "Special DMA";
+ stats->data[i].rate_name = "dma/s";
+ SET_COUNT;
+ break;
+ case _DRM_STAT_MISSED:
+ stats->data[i].long_name = "Miss";
+ stats->data[i].rate_name = "Ms/s";
+ SET_COUNT;
+ break;
+ case _DRM_STAT_VALUE:
+ stats->data[i].long_name = "Value";
+ stats->data[i].rate_name = "Value";
+ SET_VALUE;
+ break;
+ case _DRM_STAT_BYTE:
+ stats->data[i].long_name = "Bytes";
+ stats->data[i].rate_name = "B/s";
+ SET_BYTE;
+ break;
+ case _DRM_STAT_COUNT:
+ default:
+ stats->data[i].long_name = "Count";
+ stats->data[i].rate_name = "Cnt/s";
+ SET_COUNT;
+ break;
+ }
}
return 0;
}
@@ -2459,14 +2458,14 @@ int drmGetStats(int fd, drmStatsT *stats)
* Issue a set-version ioctl.
*
* \param fd file descriptor.
- * \param drmCommandIndex command index
+ * \param drmCommandIndex command index
* \param data source pointer of the data to be read and written.
* \param size size of the data to be read and written.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
- * It issues a read-write ioctl given by
+ * It issues a read-write ioctl given by
* \code DRM_COMMAND_BASE + drmCommandIndex \endcode.
*/
int drmSetInterfaceVersion(int fd, drmSetVersion *version)
@@ -2481,7 +2480,7 @@ int drmSetInterfaceVersion(int fd, drmSetVersion *version)
sv.drm_dd_minor = version->drm_dd_minor;
if (drmIoctl(fd, DRM_IOCTL_SET_VERSION, &sv)) {
- retcode = -errno;
+ retcode = -errno;
}
version->drm_di_major = sv.drm_di_major;
@@ -2496,12 +2495,12 @@ int drmSetInterfaceVersion(int fd, drmSetVersion *version)
* Send a device-specific command.
*
* \param fd file descriptor.
- * \param drmCommandIndex command index
- *
+ * \param drmCommandIndex command index
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
- * It issues a ioctl given by
+ * It issues a ioctl given by
* \code DRM_COMMAND_BASE + drmCommandIndex \endcode.
*/
int drmCommandNone(int fd, unsigned long drmCommandIndex)
@@ -2511,7 +2510,7 @@ int drmCommandNone(int fd, unsigned long drmCommandIndex)
request = DRM_IO( DRM_COMMAND_BASE + drmCommandIndex);
if (drmIoctl(fd, request, NULL)) {
- return -errno;
+ return -errno;
}
return 0;
}
@@ -2521,14 +2520,14 @@ int drmCommandNone(int fd, unsigned long drmCommandIndex)
* Send a device-specific read command.
*
* \param fd file descriptor.
- * \param drmCommandIndex command index
+ * \param drmCommandIndex command index
* \param data destination pointer of the data to be read.
* \param size size of the data to be read.
- *
+ *
* \return zero on success, or a negative value on failure.
*
* \internal
- * It issues a read ioctl given by
+ * It issues a read ioctl given by
* \code DRM_COMMAND_BASE + drmCommandIndex \endcode.
*/
int drmCommandRead(int fd, unsigned long drmCommandIndex, void *data,
@@ -2536,11 +2535,11 @@ int drmCommandRead(int fd, unsigned long drmCommandIndex, void *data,
{
unsigned long request;
- request = DRM_IOC( DRM_IOC_READ, DRM_IOCTL_BASE,
- DRM_COMMAND_BASE + drmCommandIndex, size);
+ request = DRM_IOC( DRM_IOC_READ, DRM_IOCTL_BASE,
+ DRM_COMMAND_BASE + drmCommandIndex, size);
if (drmIoctl(fd, request, data)) {
- return -errno;
+ return -errno;
}
return 0;
}
@@ -2550,14 +2549,14 @@ int drmCommandRead(int fd, unsigned long drmCommandIndex, void *data,
* Send a device-specific write command.
*
* \param fd file descriptor.
- * \param drmCommandIndex command index
+ * \param drmCommandIndex command index
* \param data source pointer of the data to be written.
* \param size size of the data to be written.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
- * It issues a write ioctl given by
+ * It issues a write ioctl given by
* \code DRM_COMMAND_BASE + drmCommandIndex \endcode.
*/
int drmCommandWrite(int fd, unsigned long drmCommandIndex, void *data,
@@ -2565,11 +2564,11 @@ int drmCommandWrite(int fd, unsigned long drmCommandIndex, void *data,
{
unsigned long request;
- request = DRM_IOC( DRM_IOC_WRITE, DRM_IOCTL_BASE,
- DRM_COMMAND_BASE + drmCommandIndex, size);
+ request = DRM_IOC( DRM_IOC_WRITE, DRM_IOCTL_BASE,
+ DRM_COMMAND_BASE + drmCommandIndex, size);
if (drmIoctl(fd, request, data)) {
- return -errno;
+ return -errno;
}
return 0;
}
@@ -2579,14 +2578,14 @@ int drmCommandWrite(int fd, unsigned long drmCommandIndex, void *data,
* Send a device-specific read-write command.
*
* \param fd file descriptor.
- * \param drmCommandIndex command index
+ * \param drmCommandIndex command index
* \param data source pointer of the data to be read and written.
* \param size size of the data to be read and written.
- *
+ *
* \return zero on success, or a negative value on failure.
- *
+ *
* \internal
- * It issues a read-write ioctl given by
+ * It issues a read-write ioctl given by
* \code DRM_COMMAND_BASE + drmCommandIndex \endcode.
*/
int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, void *data,
@@ -2594,11 +2593,11 @@ int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, void *data,
{
unsigned long request;
- request = DRM_IOC( DRM_IOC_READ|DRM_IOC_WRITE, DRM_IOCTL_BASE,
- DRM_COMMAND_BASE + drmCommandIndex, size);
+ request = DRM_IOC( DRM_IOC_READ|DRM_IOC_WRITE, DRM_IOCTL_BASE,
+ DRM_COMMAND_BASE + drmCommandIndex, size);
if (drmIoctl(fd, request, data))
- return -errno;
+ return -errno;
return 0;
}
@@ -2612,9 +2611,9 @@ static struct {
static int nr_fds = 0;
-int drmOpenOnce(void *unused,
- const char *BusID,
- int *newlyopened)
+int drmOpenOnce(void *unused,
+ const char *BusID,
+ int *newlyopened)
{
return drmOpenOnceWithType(BusID, newlyopened, DRM_NODE_PRIMARY);
}
@@ -2623,19 +2622,19 @@ int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type)
{
int i;
int fd;
-
+
for (i = 0; i < nr_fds; i++)
- if ((strcmp(BusID, connection[i].BusID) == 0) &&
- (connection[i].type == type)) {
- connection[i].refcount++;
- *newlyopened = 0;
- return connection[i].fd;
- }
+ if ((strcmp(BusID, connection[i].BusID) == 0) &&
+ (connection[i].type == type)) {
+ connection[i].refcount++;
+ *newlyopened = 0;
+ return connection[i].fd;
+ }
fd = drmOpenWithType(NULL, BusID, type);
if (fd < 0 || nr_fds == DRM_MAX_FDS)
- return fd;
-
+ return fd;
+
connection[nr_fds].BusID = strdup(BusID);
connection[nr_fds].fd = fd;
connection[nr_fds].refcount = 1;
@@ -2643,9 +2642,9 @@ int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type)
*newlyopened = 1;
if (0)
- fprintf(stderr, "saved connection %d for %s %d\n",
- nr_fds, connection[nr_fds].BusID,
- strcmp(BusID, connection[nr_fds].BusID));
+ fprintf(stderr, "saved connection %d for %s %d\n",
+ nr_fds, connection[nr_fds].BusID,
+ strcmp(BusID, connection[nr_fds].BusID));
nr_fds++;
@@ -2657,180 +2656,180 @@ void drmCloseOnce(int fd)
int i;
for (i = 0; i < nr_fds; i++) {
- if (fd == connection[i].fd) {
- if (--connection[i].refcount == 0) {
- drmClose(connection[i].fd);
- free(connection[i].BusID);
-
- if (i < --nr_fds)
- connection[i] = connection[nr_fds];
-
- return;
- }
- }
+ if (fd == connection[i].fd) {
+ if (--connection[i].refcount == 0) {
+ drmClose(connection[i].fd);
+ free(connection[i].BusID);
+
+ if (i < --nr_fds)
+ connection[i] = connection[nr_fds];
+
+ return;
+ }
+ }
}
}
int drmSetMaster(int fd)
{
- return drmIoctl(fd, DRM_IOCTL_SET_MASTER, NULL);
+ return drmIoctl(fd, DRM_IOCTL_SET_MASTER, NULL);
}
int drmDropMaster(int fd)
{
- return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL);
+ return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, NULL);
}
char *drmGetDeviceNameFromFd(int fd)
{
- char name[128];
- struct stat sbuf;
- dev_t d;
- int i;
+ char name[128];
+ struct stat sbuf;
+ dev_t d;
+ int i;
- /* The whole drmOpen thing is a fiasco and we need to find a way
- * back to just using open(2). For now, however, lets just make
- * things worse with even more ad hoc directory walking code to
- * discover the device file name. */
+ /* The whole drmOpen thing is a fiasco and we need to find a way
+ * back to just using open(2). For now, however, lets just make
+ * things worse with even more ad hoc directory walking code to
+ * discover the device file name. */
- fstat(fd, &sbuf);
- d = sbuf.st_rdev;
+ fstat(fd, &sbuf);
+ d = sbuf.st_rdev;
- for (i = 0; i < DRM_MAX_MINOR; i++) {
- snprintf(name, sizeof name, DRM_DEV_NAME, DRM_DIR_NAME, i);
- if (stat(name, &sbuf) == 0 && sbuf.st_rdev == d)
- break;
- }
- if (i == DRM_MAX_MINOR)
- return NULL;
+ for (i = 0; i < DRM_MAX_MINOR; i++) {
+ snprintf(name, sizeof name, DRM_DEV_NAME, DRM_DIR_NAME, i);
+ if (stat(name, &sbuf) == 0 && sbuf.st_rdev == d)
+ break;
+ }
+ if (i == DRM_MAX_MINOR)
+ return NULL;
- return strdup(name);
+ return strdup(name);
}
int drmGetNodeTypeFromFd(int fd)
{
- struct stat sbuf;
- int maj, min, type;
+ struct stat sbuf;
+ int maj, min, type;
- if (fstat(fd, &sbuf))
- return -1;
+ if (fstat(fd, &sbuf))
+ return -1;
- maj = major(sbuf.st_rdev);
- min = minor(sbuf.st_rdev);
+ maj = major(sbuf.st_rdev);
+ min = minor(sbuf.st_rdev);
- if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) {
- errno = EINVAL;
- return -1;
- }
+ if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) {
+ errno = EINVAL;
+ return -1;
+ }
- type = drmGetMinorType(min);
- if (type == -1)
- errno = ENODEV;
- return type;
+ type = drmGetMinorType(min);
+ if (type == -1)
+ errno = ENODEV;
+ return type;
}
int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd)
{
- struct drm_prime_handle args;
- int ret;
+ struct drm_prime_handle args;
+ int ret;
- memclear(args);
- args.fd = -1;
- args.handle = handle;
- args.flags = flags;
- ret = drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args);
- if (ret)
- return ret;
+ memclear(args);
+ args.fd = -1;
+ args.handle = handle;
+ args.flags = flags;
+ ret = drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args);
+ if (ret)
+ return ret;
- *prime_fd = args.fd;
- return 0;
+ *prime_fd = args.fd;
+ return 0;
}
int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle)
{
- struct drm_prime_handle args;
- int ret;
+ struct drm_prime_handle args;
+ int ret;
- memclear(args);
- args.fd = prime_fd;
- ret = drmIoctl(fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &args);
- if (ret)
- return ret;
+ memclear(args);
+ args.fd = prime_fd;
+ ret = drmIoctl(fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &args);
+ if (ret)
+ return ret;
- *handle = args.handle;
- return 0;
+ *handle = args.handle;
+ return 0;
}
static char *drmGetMinorNameForFD(int fd, int type)
{
#ifdef __linux__
- DIR *sysdir;
- struct dirent *pent, *ent;
- struct stat sbuf;
- const char *name = drmGetMinorName(type);
- int len;
- char dev_name[64], buf[64];
- long name_max;
- int maj, min;
+ DIR *sysdir;
+ struct dirent *pent, *ent;
+ struct stat sbuf;
+ const char *name = drmGetMinorName(type);
+ int len;
+ char dev_name[64], buf[64];
+ long name_max;
+ int maj, min;
- if (!name)
- return NULL;
+ if (!name)
+ return NULL;
- len = strlen(name);
+ len = strlen(name);
- if (fstat(fd, &sbuf))
- return NULL;
+ if (fstat(fd, &sbuf))
+ return NULL;
- maj = major(sbuf.st_rdev);
- min = minor(sbuf.st_rdev);
+ maj = major(sbuf.st_rdev);
+ min = minor(sbuf.st_rdev);
- if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
- return NULL;
+ if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+ return NULL;
- snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/device/drm", maj, min);
+ snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/device/drm", maj, min);
- sysdir = opendir(buf);
- if (!sysdir)
- return NULL;
+ sysdir = opendir(buf);
+ if (!sysdir)
+ return NULL;
- name_max = fpathconf(dirfd(sysdir), _PC_NAME_MAX);
- if (name_max == -1)
- goto out_close_dir;
+ name_max = fpathconf(dirfd(sysdir), _PC_NAME_MAX);
+ if (name_max == -1)
+ goto out_close_dir;
- pent = malloc(offsetof(struct dirent, d_name) + name_max + 1);
- if (pent == NULL)
- goto out_close_dir;
+ pent = malloc(offsetof(struct dirent, d_name) + name_max + 1);
+ if (pent == NULL)
+ goto out_close_dir;
- while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) {
- if (strncmp(ent->d_name, name, len) == 0) {
- snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
- ent->d_name);
+ while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) {
+ if (strncmp(ent->d_name, name, len) == 0) {
+ snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s",
+ ent->d_name);
- free(pent);
- closedir(sysdir);
+ free(pent);
+ closedir(sysdir);
- return strdup(dev_name);
- }
- }
+ return strdup(dev_name);
+ }
+ }
- free(pent);
+ free(pent);
out_close_dir:
- closedir(sysdir);
+ closedir(sysdir);
#else
#warning "Missing implementation of drmGetMinorNameForFD"
#endif
- return NULL;
+ return NULL;
}
char *drmGetPrimaryDeviceNameFromFd(int fd)
{
- return drmGetMinorNameForFD(fd, DRM_NODE_PRIMARY);
+ return drmGetMinorNameForFD(fd, DRM_NODE_PRIMARY);
}
char *drmGetRenderDeviceNameFromFd(int fd)
{
- return drmGetMinorNameForFD(fd, DRM_NODE_RENDER);
+ return drmGetMinorNameForFD(fd, DRM_NODE_RENDER);
}
static int drmParseSubsystemType(int maj, int min)
@@ -2864,7 +2863,7 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info)
{
#ifdef __linux__
char path[PATH_MAX + 1];
- char data[128 + 1];
+ char data[128];
char *str;
int domain, bus, dev, func;
int fd, ret;
@@ -2875,7 +2874,6 @@ static int drmParsePciBusInfo(int maj, int min, drmPciBusInfoPtr info)
return -errno;
ret = read(fd, data, sizeof(data));
- data[128] = '\0';
close(fd);
if (ret < 0)
return -errno;
@@ -2943,7 +2941,7 @@ static int drmGetMaxNodeName(void)
MAX3(sizeof(DRM_PRIMARY_MINOR_NAME),
sizeof(DRM_CONTROL_MINOR_NAME),
sizeof(DRM_RENDER_MINOR_NAME)) +
- 3 /* length of the node number */;
+ 3 /* lenght of the node number */;
}
static int drmParsePciDeviceInfo(const char *d_name,
@@ -2993,28 +2991,27 @@ void drmFreeDevices(drmDevicePtr devices[], int count)
if (devices == NULL)
return;
- for (i = 0; i < count; i++)
- if (devices[i])
- drmFreeDevice(&devices[i]);
+ for (i = 0; i < count && devices[i] != NULL; i++)
+ drmFreeDevice(&devices[i]);
}
static int drmProcessPciDevice(drmDevicePtr *device, const char *d_name,
const char *node, int node_type,
int maj, int min, bool fetch_deviceinfo)
{
- const int max_node_str = ALIGN(drmGetMaxNodeName(), sizeof(void *));
+ const int max_node_str = drmGetMaxNodeName();
int ret, i;
char *addr;
*device = calloc(1, sizeof(drmDevice) +
- (DRM_NODE_MAX * (sizeof(void *) + max_node_str)) +
- sizeof(drmPciBusInfo) +
- sizeof(drmPciDeviceInfo));
+ (DRM_NODE_MAX * (sizeof(void *) + max_node_str)) +
+ sizeof(drmPciBusInfo) +
+ sizeof(drmPciDeviceInfo));
if (!*device)
return -ENOMEM;
addr = (char*)*device;
-
+
(*device)->bustype = DRM_BUS_PCI;
(*device)->available_nodes = 1 << node_type;
@@ -3051,11 +3048,6 @@ free_device:
return ret;
}
-/* Consider devices located on the same bus as duplicate and fold the respective
- * entries into a single one.
- *
- * Note: this leaves "gaps" in the array, while preserving the length.
- */
static void drmFoldDuplicatedDevices(drmDevicePtr local_devices[], int count)
{
int node_type, i, j;
@@ -3094,7 +3086,6 @@ int drmGetDevice(int fd, drmDevicePtr *device)
int maj, min;
int ret, i, node_count;
int max_count = 16;
- dev_t find_rdev;
if (fd == -1 || device == NULL)
return -EINVAL;
@@ -3102,7 +3093,6 @@ int drmGetDevice(int fd, drmDevicePtr *device)
if (fstat(fd, &sbuf))
return -errno;
- find_rdev = sbuf.st_rdev;
maj = major(sbuf.st_rdev);
min = minor(sbuf.st_rdev);
@@ -3163,26 +3153,20 @@ int drmGetDevice(int fd, drmDevicePtr *device)
local_devices = temp;
}
- /* store target at local_devices[0] for ease to use below */
- if (find_rdev == sbuf.st_rdev && i) {
- local_devices[i] = local_devices[0];
- local_devices[0] = d;
- }
- else
- local_devices[i] = d;
+ local_devices[i] = d;
i++;
}
node_count = i;
+ /* Fold nodes into a single device if they share the same bus info */
drmFoldDuplicatedDevices(local_devices, node_count);
*device = local_devices[0];
- drmFreeDevices(&local_devices[1], node_count - 1);
+ for (i = 1; i < node_count && local_devices[i]; i++)
+ drmFreeDevice(&local_devices[i]);
closedir(sysdir);
free(local_devices);
- if (*device == NULL)
- return -ENODEV;
return 0;
free_devices:
@@ -3278,13 +3262,11 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
}
node_count = i;
+ /* Fold nodes into a single device if they share the same bus info */
drmFoldDuplicatedDevices(local_devices, node_count);
device_count = 0;
- for (i = 0; i < node_count; i++) {
- if (!local_devices[i])
- continue;
-
+ for (i = 0; i < node_count && local_devices[i]; i++) {
if ((devices != NULL) && (device_count < max_devices))
devices[device_count] = local_devices[i];
else
diff --git a/chromium/third_party/libdrm/src/xf86drmMode.c b/chromium/third_party/libdrm/src/xf86drmMode.c
index aaf259b7b1d..ab6b5195e8d 100644
--- a/chromium/third_party/libdrm/src/xf86drmMode.c
+++ b/chromium/third_party/libdrm/src/xf86drmMode.c
@@ -34,7 +34,7 @@
*/
/*
- * TODO the types we are after are defined in different headers on different
+ * TODO the types we are after are defined in diffrent headers on diffrent
* platforms find which headers to include to get uint32_t
*/
@@ -270,10 +270,10 @@ int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth,
return 0;
}
-int drmModeAddFB2WithModifiers(int fd, uint32_t width, uint32_t height,
- uint32_t pixel_format, uint32_t bo_handles[4],
- uint32_t pitches[4], uint32_t offsets[4],
- uint64_t modifier[4], uint32_t *buf_id, uint32_t flags)
+int drmModeAddFB2(int fd, uint32_t width, uint32_t height,
+ uint32_t pixel_format, uint32_t bo_handles[4],
+ uint32_t pitches[4], uint32_t offsets[4],
+ uint32_t *buf_id, uint32_t flags)
{
struct drm_mode_fb_cmd2 f;
int ret;
@@ -286,8 +286,6 @@ int drmModeAddFB2WithModifiers(int fd, uint32_t width, uint32_t height,
memcpy(f.handles, bo_handles, 4 * sizeof(bo_handles[0]));
memcpy(f.pitches, pitches, 4 * sizeof(pitches[0]));
memcpy(f.offsets, offsets, 4 * sizeof(offsets[0]));
- if (modifier)
- memcpy(f.modifier, modifier, 4 * sizeof(modifier[0]));
if ((ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ADDFB2, &f)))
return ret;
@@ -296,17 +294,6 @@ int drmModeAddFB2WithModifiers(int fd, uint32_t width, uint32_t height,
return 0;
}
-int drmModeAddFB2(int fd, uint32_t width, uint32_t height,
- uint32_t pixel_format, uint32_t bo_handles[4],
- uint32_t pitches[4], uint32_t offsets[4],
- uint32_t *buf_id, uint32_t flags)
-{
- return drmModeAddFB2WithModifiers(fd, width, height,
- pixel_format, bo_handles,
- pitches, offsets, NULL,
- buf_id, flags);
-}
-
int drmModeRmFB(int fd, uint32_t bufferId)
{
return DRM_IOCTL(fd, DRM_IOCTL_MODE_RMFB, &bufferId);
@@ -488,13 +475,12 @@ _drmModeGetConnector(int fd, uint32_t connector_id, int probe)
{
struct drm_mode_get_connector conn, counts;
drmModeConnectorPtr r = NULL;
- struct drm_mode_modeinfo stack_mode;
memclear(conn);
conn.connector_id = connector_id;
if (!probe) {
conn.count_modes = 1;
- conn.modes_ptr = VOID2U64(&stack_mode);
+ conn.modes_ptr = VOID2U64(drmMalloc(sizeof(struct drm_mode_modeinfo)));
}
if (drmIoctl(fd, DRM_IOCTL_MODE_GETCONNECTOR, &conn))
@@ -518,7 +504,7 @@ retry:
goto err_allocs;
} else {
conn.count_modes = 1;
- conn.modes_ptr = VOID2U64(&stack_mode);
+ conn.modes_ptr = VOID2U64(drmMalloc(sizeof(struct drm_mode_modeinfo)));
}
if (conn.count_encoders) {
@@ -539,8 +525,7 @@ retry:
counts.count_encoders < conn.count_encoders) {
drmFree(U642VOID(conn.props_ptr));
drmFree(U642VOID(conn.prop_values_ptr));
- if (U642VOID(conn.modes_ptr) != &stack_mode)
- drmFree(U642VOID(conn.modes_ptr));
+ drmFree(U642VOID(conn.modes_ptr));
drmFree(U642VOID(conn.encoders_ptr));
goto retry;
@@ -582,8 +567,7 @@ retry:
err_allocs:
drmFree(U642VOID(conn.prop_values_ptr));
drmFree(U642VOID(conn.props_ptr));
- if (U642VOID(conn.modes_ptr) != &stack_mode)
- drmFree(U642VOID(conn.modes_ptr));
+ drmFree(U642VOID(conn.modes_ptr));
drmFree(U642VOID(conn.encoders_ptr));
return r;
@@ -974,15 +958,15 @@ int drmModeSetPlane(int fd, uint32_t plane_id, uint32_t crtc_id,
return DRM_IOCTL(fd, DRM_IOCTL_MODE_SETPLANE, &s);
}
-static drmModePlanePtr get_plane(unsigned long cmd, int fd, uint32_t plane_id)
+drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id)
{
- struct drm_mode_get_plane2 ovr, counts;
+ struct drm_mode_get_plane ovr, counts;
drmModePlanePtr r = 0;
retry:
memclear(ovr);
ovr.plane_id = plane_id;
- if (drmIoctl(fd, cmd, &ovr))
+ if (drmIoctl(fd, DRM_IOCTL_MODE_GETPLANE, &ovr))
return 0;
counts = ovr;
@@ -994,21 +978,11 @@ retry:
goto err_allocs;
}
- if (ovr.count_format_modifiers) {
- ovr.format_modifier_ptr =
- VOID2U64(drmMalloc(ovr.count_format_modifiers *
- sizeof(struct drm_format_modifier)));
- if (!ovr.format_modifier_ptr)
- goto err_allocs;
- }
-
- if (drmIoctl(fd, cmd, &ovr))
+ if (drmIoctl(fd, DRM_IOCTL_MODE_GETPLANE, &ovr))
goto err_allocs;
- if (counts.count_format_types < ovr.count_format_types ||
- counts.count_format_modifiers < ovr.count_format_modifiers) {
+ if (counts.count_format_types < ovr.count_format_types) {
drmFree(U642VOID(ovr.format_type_ptr));
- drmFree(U642VOID(ovr.format_modifier_ptr));
goto retry;
}
@@ -1016,7 +990,6 @@ retry:
goto err_allocs;
r->count_formats = ovr.count_format_types;
- r->count_format_modifiers = ovr.count_format_modifiers;
r->plane_id = ovr.plane_id;
r->crtc_id = ovr.crtc_id;
r->fb_id = ovr.fb_id;
@@ -1028,48 +1001,20 @@ retry:
drmFree(r->formats);
drmFree(r);
r = 0;
- goto err_allocs;
- }
-
- r->format_modifiers =
- drmAllocCpy(U642VOID(ovr.format_modifier_ptr),
- ovr.count_format_modifiers,
- sizeof(struct drm_format_modifier));
- if (ovr.count_format_modifiers && !r->format_modifiers) {
- drmFree(r->formats);
- drmFree(r);
- r = 0;
}
err_allocs:
drmFree(U642VOID(ovr.format_type_ptr));
- drmFree(U642VOID(ovr.format_modifier_ptr));
return r;
}
-drmModePlanePtr drmModeGetPlane2(int fd, uint32_t plane_id)
-{
- drmModePlanePtr r = get_plane(DRM_IOCTL_MODE_GETPLANE2, fd, plane_id);
-
- if (r || errno != EINVAL)
- return r;
-
- return get_plane(DRM_IOCTL_MODE_GETPLANE, fd, plane_id);
-}
-
-drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id)
-{
- return get_plane(DRM_IOCTL_MODE_GETPLANE, fd, plane_id);
-}
-
void drmModeFreePlane(drmModePlanePtr ptr)
{
if (!ptr)
return;
drmFree(ptr->formats);
- drmFree(ptr->format_modifiers);
drmFree(ptr);
}
diff --git a/chromium/third_party/libdrm/src/xf86drmMode.h b/chromium/third_party/libdrm/src/xf86drmMode.h
index 3ecc2eb4e68..4de7bbbe541 100644
--- a/chromium/third_party/libdrm/src/xf86drmMode.h
+++ b/chromium/third_party/libdrm/src/xf86drmMode.h
@@ -328,9 +328,6 @@ typedef struct _drmModePlane {
uint32_t possible_crtcs;
uint32_t gamma_size;
-
- uint32_t count_format_modifiers;
- struct drm_format_modifier *format_modifiers;
} drmModePlane, *drmModePlanePtr;
typedef struct _drmModePlaneRes {
@@ -372,13 +369,6 @@ extern int drmModeAddFB2(int fd, uint32_t width, uint32_t height,
uint32_t pixel_format, uint32_t bo_handles[4],
uint32_t pitches[4], uint32_t offsets[4],
uint32_t *buf_id, uint32_t flags);
-
-/* ...with format modifiers */
-int drmModeAddFB2WithModifiers(int fd, uint32_t width, uint32_t height,
- uint32_t pixel_format, uint32_t bo_handles[4],
- uint32_t pitches[4], uint32_t offsets[4],
- uint64_t modifier[4], uint32_t *buf_id, uint32_t flags);
-
/**
* Destroies the given framebuffer.
*/
@@ -479,7 +469,6 @@ extern int drmModePageFlip(int fd, uint32_t crtc_id, uint32_t fb_id,
extern drmModePlaneResPtr drmModeGetPlaneResources(int fd);
extern drmModePlanePtr drmModeGetPlane(int fd, uint32_t plane_id);
-extern drmModePlanePtr drmModeGetPlane2(int fd, uint32_t plane_id);
extern int drmModeSetPlane(int fd, uint32_t plane_id, uint32_t crtc_id,
uint32_t fb_id, uint32_t flags,
int32_t crtc_x, int32_t crtc_y,
diff --git a/chromium/third_party/libxslt/linux/COPYING b/chromium/third_party/libxslt/linux/COPYING
index 0e91a5bd163..627eeff982f 120000..100644
--- a/chromium/third_party/libxslt/linux/COPYING
+++ b/chromium/third_party/libxslt/linux/COPYING
@@ -1 +1,53 @@
-../src/Copyright \ No newline at end of file
+Licence for libxslt except libexslt
+----------------------------------------------------------------------
+ Copyright (C) 2001-2002 Daniel Veillard. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is fur-
+nished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
+NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Daniel Veillard shall not
+be used in advertising or otherwise to promote the sale, use or other deal-
+ings in this Software without prior written authorization from him.
+
+----------------------------------------------------------------------
+
+Licence for libexslt
+----------------------------------------------------------------------
+ Copyright (C) 2001-2002 Thomas Broyer, Charlie Bozeman and Daniel Veillard.
+ All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is fur-
+nished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
+NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the authors shall not
+be used in advertising or otherwise to promote the sale, use or other deal-
+ings in this Software without prior written authorization from him.
+----------------------------------------------------------------------
diff --git a/chromium/third_party/mesa/src/src/gallium/state_trackers/d3d1x/w32api b/chromium/third_party/mesa/src/src/gallium/state_trackers/d3d1x/w32api
deleted file mode 120000
index e47a1989e10..00000000000
--- a/chromium/third_party/mesa/src/src/gallium/state_trackers/d3d1x/w32api
+++ /dev/null
@@ -1 +0,0 @@
-/usr/include/wine/windows \ No newline at end of file
diff --git a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_context.c b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_context.c
index 5cfbbaeb068..040382698b1 120000..100644
--- a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_context.c
+++ b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_context.c
@@ -1 +1,266 @@
-../common/dri_context.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2009, VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+/*
+ * Author: Keith Whitwell <keithw@vmware.com>
+ * Author: Jakob Bornecrantz <wallbraker@gmail.com>
+ */
+
+#include "utils.h"
+
+#include "dri_screen.h"
+#include "dri_drawable.h"
+#include "dri_context.h"
+#include "state_tracker/drm_driver.h"
+
+#include "pipe/p_context.h"
+#include "state_tracker/st_context.h"
+
+static void
+dri_pp_query(struct dri_context *ctx)
+{
+ unsigned int i;
+
+ for (i = 0; i < PP_FILTERS; i++) {
+ ctx->pp_enabled[i] = driQueryOptioni(&ctx->optionCache, pp_filters[i].name);
+ }
+}
+
+static void dri_fill_st_options(struct st_config_options *options,
+ const struct driOptionCache * optionCache)
+{
+ options->force_glsl_extensions_warn =
+ driQueryOptionb(optionCache, "force_glsl_extensions_warn");
+}
+
+GLboolean
+dri_create_context(gl_api api, const struct gl_config * visual,
+ __DRIcontext * cPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ uint32_t flags,
+ unsigned *error,
+ void *sharedContextPrivate)
+{
+ __DRIscreen *sPriv = cPriv->driScreenPriv;
+ struct dri_screen *screen = dri_screen(sPriv);
+ struct st_api *stapi = screen->st_api;
+ struct dri_context *ctx = NULL;
+ struct st_context_iface *st_share = NULL;
+ struct st_context_attribs attribs;
+ enum st_context_error ctx_err = 0;
+
+ memset(&attribs, 0, sizeof(attribs));
+ switch (api) {
+ case API_OPENGLES:
+ attribs.profile = ST_PROFILE_OPENGL_ES1;
+ break;
+ case API_OPENGLES2:
+ attribs.profile = ST_PROFILE_OPENGL_ES2;
+ break;
+ case API_OPENGL:
+ attribs.profile = ST_PROFILE_DEFAULT;
+ attribs.major = major_version;
+ attribs.minor = minor_version;
+
+ if ((flags & __DRI_CTX_FLAG_DEBUG) != 0)
+ attribs.flags |= ST_CONTEXT_FLAG_DEBUG;
+
+ if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0)
+ attribs.flags |= ST_CONTEXT_FLAG_FORWARD_COMPATIBLE;
+ break;
+ default:
+ *error = __DRI_CTX_ERROR_BAD_API;
+ goto fail;
+ }
+
+ if (sharedContextPrivate) {
+ st_share = ((struct dri_context *)sharedContextPrivate)->st;
+ }
+
+ ctx = CALLOC_STRUCT(dri_context);
+ if (ctx == NULL) {
+ *error = __DRI_CTX_ERROR_NO_MEMORY;
+ goto fail;
+ }
+
+ cPriv->driverPrivate = ctx;
+ ctx->cPriv = cPriv;
+ ctx->sPriv = sPriv;
+
+ driParseConfigFiles(&ctx->optionCache,
+ &screen->optionCache, sPriv->myNum, driver_descriptor.name);
+
+ dri_fill_st_options(&attribs.options, &ctx->optionCache);
+ dri_fill_st_visual(&attribs.visual, screen, visual);
+ ctx->st = stapi->create_context(stapi, &screen->base, &attribs, &ctx_err,
+ st_share);
+ if (ctx->st == NULL) {
+ switch (ctx_err) {
+ case ST_CONTEXT_SUCCESS:
+ *error = __DRI_CTX_ERROR_SUCCESS;
+ break;
+ case ST_CONTEXT_ERROR_NO_MEMORY:
+ *error = __DRI_CTX_ERROR_NO_MEMORY;
+ break;
+ case ST_CONTEXT_ERROR_BAD_API:
+ *error = __DRI_CTX_ERROR_BAD_API;
+ break;
+ case ST_CONTEXT_ERROR_BAD_VERSION:
+ *error = __DRI_CTX_ERROR_BAD_VERSION;
+ break;
+ case ST_CONTEXT_ERROR_BAD_FLAG:
+ *error = __DRI_CTX_ERROR_BAD_FLAG;
+ break;
+ case ST_CONTEXT_ERROR_UNKNOWN_ATTRIBUTE:
+ *error = __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE;
+ break;
+ case ST_CONTEXT_ERROR_UNKNOWN_FLAG:
+ *error = __DRI_CTX_ERROR_UNKNOWN_FLAG;
+ break;
+ }
+ goto fail;
+ }
+ ctx->st->st_manager_private = (void *) ctx;
+ ctx->stapi = stapi;
+
+ // Context successfully created. See if post-processing is requested.
+ dri_pp_query(ctx);
+
+ ctx->pp = pp_init(screen->base.screen, ctx->pp_enabled);
+
+ *error = __DRI_CTX_ERROR_SUCCESS;
+ return GL_TRUE;
+
+ fail:
+ if (ctx && ctx->st)
+ ctx->st->destroy(ctx->st);
+
+ FREE(ctx);
+ return GL_FALSE;
+}
+
+void
+dri_destroy_context(__DRIcontext * cPriv)
+{
+ struct dri_context *ctx = dri_context(cPriv);
+
+ /* note: we are freeing values and nothing more because
+ * driParseConfigFiles allocated values only - the rest
+ * is owned by screen optionCache.
+ */
+ FREE(ctx->optionCache.values);
+
+ /* No particular reason to wait for command completion before
+ * destroying a context, but we flush the context here
+ * to avoid having to add code elsewhere to cope with flushing a
+ * partially destroyed context.
+ */
+ ctx->st->flush(ctx->st, 0, NULL);
+ ctx->st->destroy(ctx->st);
+
+ if (ctx->pp) pp_free(ctx->pp);
+
+ FREE(ctx);
+}
+
+GLboolean
+dri_unbind_context(__DRIcontext * cPriv)
+{
+ /* dri_util.c ensures cPriv is not null */
+ struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
+ struct dri_context *ctx = dri_context(cPriv);
+ struct st_api *stapi = screen->st_api;
+
+ if (--ctx->bind_count == 0) {
+ if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
+ /* For conformance, unbind is supposed to flush the context.
+ * However, if we do it here we might end up flushing a partially
+ * destroyed context. Instead, we flush in dri_make_current and
+ * in dri_destroy_context which should cover all the cases.
+ */
+ stapi->make_current(stapi, NULL, NULL, NULL);
+ }
+ }
+
+ return GL_TRUE;
+}
+
+GLboolean
+dri_make_current(__DRIcontext * cPriv,
+ __DRIdrawable * driDrawPriv,
+ __DRIdrawable * driReadPriv)
+{
+ /* dri_util.c ensures cPriv is not null */
+ struct dri_context *ctx = dri_context(cPriv);
+ struct dri_drawable *draw = dri_drawable(driDrawPriv);
+ struct dri_drawable *read = dri_drawable(driReadPriv);
+ struct st_context_iface *old_st = ctx->stapi->get_current(ctx->stapi);
+
+ /* Flush the old context here so we don't have to flush on unbind() */
+ if (old_st && old_st != ctx->st)
+ old_st->flush(old_st, ST_FLUSH_FRONT, NULL);
+
+ ++ctx->bind_count;
+
+ if (!driDrawPriv && !driReadPriv)
+ return ctx->stapi->make_current(ctx->stapi, ctx->st, NULL, NULL);
+ else if (!driDrawPriv || !driReadPriv)
+ return GL_FALSE;
+
+ if (ctx->dPriv != driDrawPriv) {
+ ctx->dPriv = driDrawPriv;
+ draw->texture_stamp = driDrawPriv->lastStamp - 1;
+ }
+ if (ctx->rPriv != driReadPriv) {
+ ctx->rPriv = driReadPriv;
+ read->texture_stamp = driReadPriv->lastStamp - 1;
+ }
+
+ ctx->stapi->make_current(ctx->stapi, ctx->st, &draw->base, &read->base);
+
+ // This is ok to call here. If they are already init, it's a no-op.
+ if (draw->textures[ST_ATTACHMENT_BACK_LEFT] && draw->textures[ST_ATTACHMENT_DEPTH_STENCIL]
+ && ctx->pp)
+ pp_init_fbos(ctx->pp, draw->textures[ST_ATTACHMENT_BACK_LEFT]->width0,
+ draw->textures[ST_ATTACHMENT_BACK_LEFT]->height0);
+
+ return GL_TRUE;
+}
+
+struct dri_context *
+dri_get_current(__DRIscreen *sPriv)
+{
+ struct dri_screen *screen = dri_screen(sPriv);
+ struct st_api *stapi = screen->st_api;
+ struct st_context_iface *st;
+
+ st = stapi->get_current(stapi);
+
+ return (struct dri_context *) (st) ? st->st_manager_private : NULL;
+}
+
+/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_drawable.c b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_drawable.c
index 0fc19be6ea6..5a261ddb300 120000..100644
--- a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_drawable.c
+++ b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_drawable.c
@@ -1 +1,402 @@
-../common/dri_drawable.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2009, VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+/*
+ * Author: Keith Whitwell <keithw@vmware.com>
+ * Author: Jakob Bornecrantz <wallbraker@gmail.com>
+ */
+
+#include "dri_screen.h"
+#include "dri_context.h"
+#include "dri_drawable.h"
+
+#include "pipe/p_screen.h"
+#include "util/u_format.h"
+#include "util/u_memory.h"
+#include "util/u_inlines.h"
+
+static void
+swap_fences_unref(struct dri_drawable *draw);
+
+static boolean
+dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,
+ const enum st_attachment_type *statts,
+ unsigned count,
+ struct pipe_resource **out)
+{
+ struct dri_drawable *drawable =
+ (struct dri_drawable *) stfbi->st_manager_private;
+ struct dri_screen *screen = dri_screen(drawable->sPriv);
+ unsigned statt_mask, new_mask;
+ boolean new_stamp;
+ int i;
+ unsigned int lastStamp;
+
+ statt_mask = 0x0;
+ for (i = 0; i < count; i++)
+ statt_mask |= (1 << statts[i]);
+
+ /* record newly allocated textures */
+ new_mask = (statt_mask & ~drawable->texture_mask);
+
+ /*
+ * dPriv->dri2.stamp is the server stamp. dPriv->lastStamp is the
+ * client stamp. It has the value of the server stamp when last
+ * checked.
+ */
+ do {
+ lastStamp = drawable->dPriv->lastStamp;
+ new_stamp = (drawable->texture_stamp != lastStamp);
+
+ if (new_stamp || new_mask || screen->broken_invalidate) {
+ if (new_stamp && drawable->update_drawable_info)
+ drawable->update_drawable_info(drawable);
+
+ drawable->allocate_textures(drawable, statts, count);
+
+ /* add existing textures */
+ for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
+ if (drawable->textures[i])
+ statt_mask |= (1 << i);
+ }
+
+ drawable->texture_stamp = lastStamp;
+ drawable->texture_mask = statt_mask;
+ }
+ } while (lastStamp != drawable->dPriv->lastStamp);
+
+ if (!out)
+ return TRUE;
+
+ for (i = 0; i < count; i++) {
+ out[i] = NULL;
+ pipe_resource_reference(&out[i], drawable->textures[statts[i]]);
+ }
+
+ return TRUE;
+}
+
+static boolean
+dri_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi,
+ enum st_attachment_type statt)
+{
+ struct dri_drawable *drawable =
+ (struct dri_drawable *) stfbi->st_manager_private;
+
+ /* XXX remove this and just set the correct one on the framebuffer */
+ drawable->flush_frontbuffer(drawable, statt);
+
+ return TRUE;
+}
+
+/**
+ * This is called when we need to set up GL rendering to a new X window.
+ */
+boolean
+dri_create_buffer(__DRIscreen * sPriv,
+ __DRIdrawable * dPriv,
+ const struct gl_config * visual, boolean isPixmap)
+{
+ struct dri_screen *screen = sPriv->driverPrivate;
+ struct dri_drawable *drawable = NULL;
+
+ if (isPixmap)
+ goto fail; /* not implemented */
+
+ drawable = CALLOC_STRUCT(dri_drawable);
+ if (drawable == NULL)
+ goto fail;
+
+ dri_fill_st_visual(&drawable->stvis, screen, visual);
+
+ /* setup the st_framebuffer_iface */
+ drawable->base.visual = &drawable->stvis;
+ drawable->base.flush_front = dri_st_framebuffer_flush_front;
+ drawable->base.validate = dri_st_framebuffer_validate;
+ drawable->base.st_manager_private = (void *) drawable;
+
+ drawable->screen = screen;
+ drawable->sPriv = sPriv;
+ drawable->dPriv = dPriv;
+ drawable->desired_fences = screen->default_throttle_frames;
+ if (drawable->desired_fences > DRI_SWAP_FENCES_MAX)
+ drawable->desired_fences = DRI_SWAP_FENCES_MAX;
+
+ dPriv->driverPrivate = (void *)drawable;
+ p_atomic_set(&drawable->base.stamp, 1);
+
+ return GL_TRUE;
+fail:
+ FREE(drawable);
+ return GL_FALSE;
+}
+
+void
+dri_destroy_buffer(__DRIdrawable * dPriv)
+{
+ struct dri_drawable *drawable = dri_drawable(dPriv);
+ int i;
+
+ pipe_surface_reference(&drawable->drisw_surface, NULL);
+
+ for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
+ pipe_resource_reference(&drawable->textures[i], NULL);
+
+ swap_fences_unref(drawable);
+
+ FREE(drawable);
+}
+
+/**
+ * Validate the texture at an attachment. Allocate the texture if it does not
+ * exist. Used by the TFP extension.
+ */
+static void
+dri_drawable_validate_att(struct dri_drawable *drawable,
+ enum st_attachment_type statt)
+{
+ enum st_attachment_type statts[ST_ATTACHMENT_COUNT];
+ unsigned i, count = 0;
+
+ /* check if buffer already exists */
+ if (drawable->texture_mask & (1 << statt))
+ return;
+
+ /* make sure DRI2 does not destroy existing buffers */
+ for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
+ if (drawable->texture_mask & (1 << i)) {
+ statts[count++] = i;
+ }
+ }
+ statts[count++] = statt;
+
+ drawable->texture_stamp = drawable->dPriv->lastStamp - 1;
+
+ drawable->base.validate(&drawable->base, statts, count, NULL);
+}
+
+/**
+ * These are used for GLX_EXT_texture_from_pixmap
+ */
+static void
+dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
+ GLint format, __DRIdrawable *dPriv)
+{
+ struct dri_context *ctx = dri_context(pDRICtx);
+ struct dri_drawable *drawable = dri_drawable(dPriv);
+ struct pipe_resource *pt;
+
+ dri_drawable_validate_att(drawable, ST_ATTACHMENT_FRONT_LEFT);
+
+ /* Use the pipe resource associated with the X drawable */
+ pt = drawable->textures[ST_ATTACHMENT_FRONT_LEFT];
+
+ if (pt) {
+ enum pipe_format internal_format = pt->format;
+
+ if (format == __DRI_TEXTURE_FORMAT_RGB) {
+ /* only need to cover the formats recognized by dri_fill_st_visual */
+ switch (internal_format) {
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
+ internal_format = PIPE_FORMAT_B8G8R8X8_UNORM;
+ break;
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ internal_format = PIPE_FORMAT_X8R8G8B8_UNORM;
+ break;
+ default:
+ break;
+ }
+ }
+
+ drawable->update_tex_buffer(drawable, ctx, pt);
+
+ ctx->st->teximage(ctx->st,
+ (target == GL_TEXTURE_2D) ? ST_TEXTURE_2D : ST_TEXTURE_RECT,
+ 0, internal_format, pt, FALSE);
+ }
+}
+
+static void
+dri_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,
+ __DRIdrawable *dPriv)
+{
+ dri_set_tex_buffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
+}
+
+const __DRItexBufferExtension driTexBufferExtension = {
+ { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
+ dri_set_tex_buffer,
+ dri_set_tex_buffer2,
+ NULL,
+};
+
+/**
+ * Get the format and binding of an attachment.
+ */
+void
+dri_drawable_get_format(struct dri_drawable *drawable,
+ enum st_attachment_type statt,
+ enum pipe_format *format,
+ unsigned *bind)
+{
+ switch (statt) {
+ case ST_ATTACHMENT_FRONT_LEFT:
+ case ST_ATTACHMENT_BACK_LEFT:
+ case ST_ATTACHMENT_FRONT_RIGHT:
+ case ST_ATTACHMENT_BACK_RIGHT:
+ *format = drawable->stvis.color_format;
+ *bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
+ break;
+ case ST_ATTACHMENT_DEPTH_STENCIL:
+ *format = drawable->stvis.depth_stencil_format;
+ *bind = PIPE_BIND_DEPTH_STENCIL; /* XXX sampler? */
+ break;
+ default:
+ *format = PIPE_FORMAT_NONE;
+ *bind = 0;
+ break;
+ }
+}
+
+
+/**
+ * swap_fences_pop_front - pull a fence from the throttle queue
+ *
+ * If the throttle queue is filled to the desired number of fences,
+ * pull fences off the queue until the number is less than the desired
+ * number of fences, and return the last fence pulled.
+ */
+static struct pipe_fence_handle *
+swap_fences_pop_front(struct dri_drawable *draw)
+{
+ struct pipe_screen *screen = draw->screen->base.screen;
+ struct pipe_fence_handle *fence = NULL;
+
+ if (draw->desired_fences == 0)
+ return NULL;
+
+ if (draw->cur_fences >= draw->desired_fences) {
+ screen->fence_reference(screen, &fence, draw->swap_fences[draw->tail]);
+ screen->fence_reference(screen, &draw->swap_fences[draw->tail++], NULL);
+ draw->tail &= DRI_SWAP_FENCES_MASK;
+ --draw->cur_fences;
+ }
+ return fence;
+}
+
+
+/**
+ * swap_fences_push_back - push a fence onto the throttle queue
+ *
+ * push a fence onto the throttle queue and pull fences of the queue
+ * so that the desired number of fences are on the queue.
+ */
+static void
+swap_fences_push_back(struct dri_drawable *draw,
+ struct pipe_fence_handle *fence)
+{
+ struct pipe_screen *screen = draw->screen->base.screen;
+
+ if (!fence || draw->desired_fences == 0)
+ return;
+
+ while(draw->cur_fences == draw->desired_fences)
+ swap_fences_pop_front(draw);
+
+ draw->cur_fences++;
+ screen->fence_reference(screen, &draw->swap_fences[draw->head++],
+ fence);
+ draw->head &= DRI_SWAP_FENCES_MASK;
+}
+
+
+/**
+ * swap_fences_unref - empty the throttle queue
+ *
+ * pulls fences of the throttle queue until it is empty.
+ */
+static void
+swap_fences_unref(struct dri_drawable *draw)
+{
+ struct pipe_screen *screen = draw->screen->base.screen;
+
+ while(draw->cur_fences) {
+ screen->fence_reference(screen, &draw->swap_fences[draw->tail++], NULL);
+ draw->tail &= DRI_SWAP_FENCES_MASK;
+ --draw->cur_fences;
+ }
+}
+
+
+/**
+ * dri_throttle - A DRI2ThrottleExtension throttling function.
+ *
+ * pulls a fence off the throttling queue and waits for it if the
+ * number of fences on the throttling queue has reached the desired
+ * number.
+ *
+ * Then flushes to insert a fence at the current rendering position, and
+ * pushes that fence on the queue. This requires that the st_context_iface
+ * flush method returns a fence even if there are no commands to flush.
+ */
+static void
+dri_throttle(__DRIcontext *driCtx, __DRIdrawable *dPriv,
+ enum __DRI2throttleReason reason)
+{
+ struct dri_drawable *draw = dri_drawable(dPriv);
+ struct st_context_iface *ctxi;
+ struct pipe_screen *screen = draw->screen->base.screen;
+ struct pipe_fence_handle *fence;
+
+ if (reason != __DRI2_THROTTLE_SWAPBUFFER &&
+ reason != __DRI2_THROTTLE_FLUSHFRONT)
+ return;
+
+ fence = swap_fences_pop_front(draw);
+ if (fence) {
+ (void) screen->fence_finish(screen, fence, PIPE_TIMEOUT_INFINITE);
+ screen->fence_reference(screen, &fence, NULL);
+ }
+
+ if (driCtx == NULL)
+ return;
+
+ ctxi = dri_context(driCtx)->st;
+ ctxi->flush(ctxi, 0, &fence);
+ if (fence) {
+ swap_fences_push_back(draw, fence);
+ screen->fence_reference(screen, &fence, NULL);
+ }
+}
+
+
+const __DRI2throttleExtension dri2ThrottleExtension = {
+ .base = { __DRI2_THROTTLE, __DRI2_THROTTLE_VERSION },
+ .throttle = dri_throttle,
+};
+
+
+/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_screen.c b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_screen.c
index 847f6515f25..102a1326133 120000..100644
--- a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_screen.c
+++ b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/drm/dri_screen.c
@@ -1 +1,420 @@
-../common/dri_screen.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2009, VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+/*
+ * Author: Keith Whitwell <keithw@vmware.com>
+ * Author: Jakob Bornecrantz <wallbraker@gmail.com>
+ */
+
+#include "utils.h"
+#include "xmlpool.h"
+
+#include "dri_screen.h"
+
+#include "util/u_inlines.h"
+#include "pipe/p_screen.h"
+#include "pipe/p_format.h"
+#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
+
+#include "util/u_debug.h"
+
+#define MSAA_VISUAL_MAX_SAMPLES 8
+
+#undef false
+
+PUBLIC const char __driConfigOptions[] =
+ DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
+ DRI_CONF_SECTION_END
+
+ DRI_CONF_SECTION_QUALITY
+/* DRI_CONF_FORCE_S3TC_ENABLE(false) */
+ DRI_CONF_ALLOW_LARGE_TEXTURES(1)
+ DRI_CONF_PP_CELSHADE(0)
+ DRI_CONF_PP_NORED(0)
+ DRI_CONF_PP_NOGREEN(0)
+ DRI_CONF_PP_NOBLUE(0)
+ DRI_CONF_PP_JIMENEZMLAA(0, 0, 32)
+ DRI_CONF_PP_JIMENEZMLAA_COLOR(0, 0, 32)
+ DRI_CONF_SECTION_END
+
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
+ DRI_CONF_SECTION_END
+
+ DRI_CONF_END;
+
+#define false 0
+
+static const uint __driNConfigOptions = 10;
+
+static const __DRIconfig **
+dri_fill_in_modes(struct dri_screen *screen,
+ unsigned pixel_bits)
+{
+ __DRIconfig **configs = NULL;
+ __DRIconfig **configs_r5g6b5 = NULL;
+ __DRIconfig **configs_a8r8g8b8 = NULL;
+ __DRIconfig **configs_x8r8g8b8 = NULL;
+ uint8_t depth_bits_array[5];
+ uint8_t stencil_bits_array[5];
+ uint8_t msaa_samples_array[MSAA_VISUAL_MAX_SAMPLES];
+ unsigned depth_buffer_factor;
+ unsigned back_buffer_factor;
+ unsigned msaa_samples_factor, msaa_samples_max;
+ unsigned i;
+ struct pipe_screen *p_screen = screen->base.screen;
+ boolean pf_r5g6b5, pf_a8r8g8b8, pf_x8r8g8b8;
+ boolean pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32;
+
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ };
+
+ depth_bits_array[0] = 0;
+ stencil_bits_array[0] = 0;
+ depth_buffer_factor = 1;
+
+ msaa_samples_max = (screen->st_api->feature_mask & ST_API_FEATURE_MS_VISUALS)
+ ? MSAA_VISUAL_MAX_SAMPLES : 1;
+
+ pf_x8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24X8_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_z24x8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_X8Z24_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_s8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24_UNORM_S8_UINT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_z24s8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_S8_UINT_Z24_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_a8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8A8_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET);
+ pf_x8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8X8_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET);
+ pf_r5g6b5 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B5G6R5_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET);
+
+ /* We can only get a 16 or 32 bit depth buffer with getBuffersWithFormat */
+ if (dri_with_format(screen->sPriv)) {
+ pf_z16 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z16_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_z32 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z32_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ } else {
+ pf_z16 = FALSE;
+ pf_z32 = FALSE;
+ }
+
+ if (pf_z16) {
+ depth_bits_array[depth_buffer_factor] = 16;
+ stencil_bits_array[depth_buffer_factor++] = 0;
+ }
+ if (pf_x8z24 || pf_z24x8) {
+ depth_bits_array[depth_buffer_factor] = 24;
+ stencil_bits_array[depth_buffer_factor++] = 0;
+ screen->d_depth_bits_last = pf_x8z24;
+ }
+ if (pf_s8z24 || pf_z24s8) {
+ depth_bits_array[depth_buffer_factor] = 24;
+ stencil_bits_array[depth_buffer_factor++] = 8;
+ screen->sd_depth_bits_last = pf_s8z24;
+ }
+ if (pf_z32) {
+ depth_bits_array[depth_buffer_factor] = 32;
+ stencil_bits_array[depth_buffer_factor++] = 0;
+ }
+
+ msaa_samples_array[0] = 0;
+ back_buffer_factor = 3;
+
+ /* Also test for color multisample support - just assume it'll work
+ * for all depth buffers.
+ */
+ if (pf_r5g6b5) {
+ msaa_samples_factor = 1;
+ for (i = 2; i <= msaa_samples_max; i++) {
+ if (p_screen->is_format_supported(p_screen, PIPE_FORMAT_B5G6R5_UNORM,
+ PIPE_TEXTURE_2D, i,
+ PIPE_BIND_RENDER_TARGET)) {
+ msaa_samples_array[msaa_samples_factor] = i;
+ msaa_samples_factor++;
+ }
+ }
+
+ configs_r5g6b5 = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, msaa_samples_factor,
+ GL_TRUE);
+ }
+
+ if (pf_a8r8g8b8) {
+ msaa_samples_factor = 1;
+ for (i = 2; i <= msaa_samples_max; i++) {
+ if (p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8A8_UNORM,
+ PIPE_TEXTURE_2D, i,
+ PIPE_BIND_RENDER_TARGET)) {
+ msaa_samples_array[msaa_samples_factor] = i;
+ msaa_samples_factor++;
+ }
+ }
+
+ configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array,
+ msaa_samples_factor,
+ GL_TRUE);
+ }
+
+ if (pf_x8r8g8b8) {
+ msaa_samples_factor = 1;
+ for (i = 2; i <= msaa_samples_max; i++) {
+ if (p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8X8_UNORM,
+ PIPE_TEXTURE_2D, i,
+ PIPE_BIND_RENDER_TARGET)) {
+ msaa_samples_array[msaa_samples_factor] = i;
+ msaa_samples_factor++;
+ }
+ }
+
+ configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array,
+ msaa_samples_factor,
+ GL_TRUE);
+ }
+
+ if (pixel_bits == 16) {
+ configs = configs_r5g6b5;
+ configs = driConcatConfigs(configs, configs_a8r8g8b8);
+ configs = driConcatConfigs(configs, configs_x8r8g8b8);
+ } else {
+ configs = configs_a8r8g8b8;
+ configs = driConcatConfigs(configs, configs_x8r8g8b8);
+ configs = driConcatConfigs(configs, configs_r5g6b5);
+ }
+
+ if (configs == NULL) {
+ debug_printf("%s: driCreateConfigs failed\n", __FUNCTION__);
+ return NULL;
+ }
+
+ return (const __DRIconfig **)configs;
+}
+
+/**
+ * Roughly the converse of dri_fill_in_modes.
+ */
+void
+dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
+ const struct gl_config *mode)
+{
+ memset(stvis, 0, sizeof(*stvis));
+
+ if (!mode)
+ return;
+
+ stvis->samples = mode->samples;
+
+ if (mode->redBits == 8) {
+ if (mode->alphaBits == 8)
+ stvis->color_format = PIPE_FORMAT_B8G8R8A8_UNORM;
+ else
+ stvis->color_format = PIPE_FORMAT_B8G8R8X8_UNORM;
+ } else {
+ stvis->color_format = PIPE_FORMAT_B5G6R5_UNORM;
+ }
+
+ switch (mode->depthBits) {
+ default:
+ case 0:
+ stvis->depth_stencil_format = PIPE_FORMAT_NONE;
+ break;
+ case 16:
+ stvis->depth_stencil_format = PIPE_FORMAT_Z16_UNORM;
+ break;
+ case 24:
+ if (mode->stencilBits == 0) {
+ stvis->depth_stencil_format = (screen->d_depth_bits_last) ?
+ PIPE_FORMAT_Z24X8_UNORM:
+ PIPE_FORMAT_X8Z24_UNORM;
+ } else {
+ stvis->depth_stencil_format = (screen->sd_depth_bits_last) ?
+ PIPE_FORMAT_Z24_UNORM_S8_UINT:
+ PIPE_FORMAT_S8_UINT_Z24_UNORM;
+ }
+ break;
+ case 32:
+ stvis->depth_stencil_format = PIPE_FORMAT_Z32_UNORM;
+ break;
+ }
+
+ stvis->accum_format = (mode->haveAccumBuffer) ?
+ PIPE_FORMAT_R16G16B16A16_SNORM : PIPE_FORMAT_NONE;
+
+ stvis->buffer_mask |= ST_ATTACHMENT_FRONT_LEFT_MASK;
+ stvis->render_buffer = ST_ATTACHMENT_FRONT_LEFT;
+ if (mode->doubleBufferMode) {
+ stvis->buffer_mask |= ST_ATTACHMENT_BACK_LEFT_MASK;
+ stvis->render_buffer = ST_ATTACHMENT_BACK_LEFT;
+ }
+ if (mode->stereoMode) {
+ stvis->buffer_mask |= ST_ATTACHMENT_FRONT_RIGHT_MASK;
+ if (mode->doubleBufferMode)
+ stvis->buffer_mask |= ST_ATTACHMENT_BACK_RIGHT_MASK;
+ }
+
+ if (mode->haveDepthBuffer || mode->haveStencilBuffer)
+ stvis->buffer_mask |= ST_ATTACHMENT_DEPTH_STENCIL_MASK;
+ /* let the state tracker allocate the accum buffer */
+}
+
+static boolean
+dri_get_egl_image(struct st_manager *smapi,
+ void *egl_image,
+ struct st_egl_image *stimg)
+{
+ struct dri_screen *screen = (struct dri_screen *)smapi;
+ __DRIimage *img = NULL;
+
+ if (screen->lookup_egl_image) {
+ img = screen->lookup_egl_image(screen, egl_image);
+ }
+
+ if (!img)
+ return FALSE;
+
+ stimg->texture = NULL;
+ pipe_resource_reference(&stimg->texture, img->texture);
+ stimg->level = img->level;
+ stimg->layer = img->layer;
+
+ return TRUE;
+}
+
+static int
+dri_get_param(struct st_manager *smapi,
+ enum st_manager_param param)
+{
+ struct dri_screen *screen = (struct dri_screen *)smapi;
+
+ switch(param) {
+ case ST_MANAGER_BROKEN_INVALIDATE:
+ return screen->broken_invalidate;
+ default:
+ return 0;
+ }
+}
+
+static void
+dri_destroy_option_cache(struct dri_screen * screen)
+{
+ int i;
+
+ if (screen->optionCache.info) {
+ for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
+ FREE(screen->optionCache.info[i].name);
+ FREE(screen->optionCache.info[i].ranges);
+ }
+ FREE(screen->optionCache.info);
+ }
+
+ FREE(screen->optionCache.values);
+}
+
+void
+dri_destroy_screen_helper(struct dri_screen * screen)
+{
+ if (screen->st_api && screen->st_api->destroy)
+ screen->st_api->destroy(screen->st_api);
+
+ if (screen->base.screen)
+ screen->base.screen->destroy(screen->base.screen);
+
+ dri_destroy_option_cache(screen);
+}
+
+void
+dri_destroy_screen(__DRIscreen * sPriv)
+{
+ struct dri_screen *screen = dri_screen(sPriv);
+
+ dri_destroy_screen_helper(screen);
+
+ FREE(screen);
+ sPriv->driverPrivate = NULL;
+ sPriv->extensions = NULL;
+}
+
+const __DRIconfig **
+dri_init_screen_helper(struct dri_screen *screen,
+ struct pipe_screen *pscreen,
+ unsigned pixel_bits)
+{
+ screen->base.screen = pscreen;
+ if (!screen->base.screen) {
+ debug_printf("%s: failed to create pipe_screen\n", __FUNCTION__);
+ return NULL;
+ }
+
+ screen->base.get_egl_image = dri_get_egl_image;
+ screen->base.get_param = dri_get_param;
+
+ screen->st_api = st_gl_api_create();
+ if (!screen->st_api)
+ return NULL;
+
+ if(pscreen->get_param(pscreen, PIPE_CAP_NPOT_TEXTURES))
+ screen->target = PIPE_TEXTURE_2D;
+ else
+ screen->target = PIPE_TEXTURE_RECT;
+
+ driParseOptionInfo(&screen->optionCache,
+ __driConfigOptions, __driNConfigOptions);
+
+ return dri_fill_in_modes(screen, pixel_bits);
+}
+
+/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_context.c b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_context.c
index 5cfbbaeb068..040382698b1 120000..100644
--- a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_context.c
+++ b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_context.c
@@ -1 +1,266 @@
-../common/dri_context.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2009, VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+/*
+ * Author: Keith Whitwell <keithw@vmware.com>
+ * Author: Jakob Bornecrantz <wallbraker@gmail.com>
+ */
+
+#include "utils.h"
+
+#include "dri_screen.h"
+#include "dri_drawable.h"
+#include "dri_context.h"
+#include "state_tracker/drm_driver.h"
+
+#include "pipe/p_context.h"
+#include "state_tracker/st_context.h"
+
+static void
+dri_pp_query(struct dri_context *ctx)
+{
+ unsigned int i;
+
+ for (i = 0; i < PP_FILTERS; i++) {
+ ctx->pp_enabled[i] = driQueryOptioni(&ctx->optionCache, pp_filters[i].name);
+ }
+}
+
+static void dri_fill_st_options(struct st_config_options *options,
+ const struct driOptionCache * optionCache)
+{
+ options->force_glsl_extensions_warn =
+ driQueryOptionb(optionCache, "force_glsl_extensions_warn");
+}
+
+GLboolean
+dri_create_context(gl_api api, const struct gl_config * visual,
+ __DRIcontext * cPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ uint32_t flags,
+ unsigned *error,
+ void *sharedContextPrivate)
+{
+ __DRIscreen *sPriv = cPriv->driScreenPriv;
+ struct dri_screen *screen = dri_screen(sPriv);
+ struct st_api *stapi = screen->st_api;
+ struct dri_context *ctx = NULL;
+ struct st_context_iface *st_share = NULL;
+ struct st_context_attribs attribs;
+ enum st_context_error ctx_err = 0;
+
+ memset(&attribs, 0, sizeof(attribs));
+ switch (api) {
+ case API_OPENGLES:
+ attribs.profile = ST_PROFILE_OPENGL_ES1;
+ break;
+ case API_OPENGLES2:
+ attribs.profile = ST_PROFILE_OPENGL_ES2;
+ break;
+ case API_OPENGL:
+ attribs.profile = ST_PROFILE_DEFAULT;
+ attribs.major = major_version;
+ attribs.minor = minor_version;
+
+ if ((flags & __DRI_CTX_FLAG_DEBUG) != 0)
+ attribs.flags |= ST_CONTEXT_FLAG_DEBUG;
+
+ if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0)
+ attribs.flags |= ST_CONTEXT_FLAG_FORWARD_COMPATIBLE;
+ break;
+ default:
+ *error = __DRI_CTX_ERROR_BAD_API;
+ goto fail;
+ }
+
+ if (sharedContextPrivate) {
+ st_share = ((struct dri_context *)sharedContextPrivate)->st;
+ }
+
+ ctx = CALLOC_STRUCT(dri_context);
+ if (ctx == NULL) {
+ *error = __DRI_CTX_ERROR_NO_MEMORY;
+ goto fail;
+ }
+
+ cPriv->driverPrivate = ctx;
+ ctx->cPriv = cPriv;
+ ctx->sPriv = sPriv;
+
+ driParseConfigFiles(&ctx->optionCache,
+ &screen->optionCache, sPriv->myNum, driver_descriptor.name);
+
+ dri_fill_st_options(&attribs.options, &ctx->optionCache);
+ dri_fill_st_visual(&attribs.visual, screen, visual);
+ ctx->st = stapi->create_context(stapi, &screen->base, &attribs, &ctx_err,
+ st_share);
+ if (ctx->st == NULL) {
+ switch (ctx_err) {
+ case ST_CONTEXT_SUCCESS:
+ *error = __DRI_CTX_ERROR_SUCCESS;
+ break;
+ case ST_CONTEXT_ERROR_NO_MEMORY:
+ *error = __DRI_CTX_ERROR_NO_MEMORY;
+ break;
+ case ST_CONTEXT_ERROR_BAD_API:
+ *error = __DRI_CTX_ERROR_BAD_API;
+ break;
+ case ST_CONTEXT_ERROR_BAD_VERSION:
+ *error = __DRI_CTX_ERROR_BAD_VERSION;
+ break;
+ case ST_CONTEXT_ERROR_BAD_FLAG:
+ *error = __DRI_CTX_ERROR_BAD_FLAG;
+ break;
+ case ST_CONTEXT_ERROR_UNKNOWN_ATTRIBUTE:
+ *error = __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE;
+ break;
+ case ST_CONTEXT_ERROR_UNKNOWN_FLAG:
+ *error = __DRI_CTX_ERROR_UNKNOWN_FLAG;
+ break;
+ }
+ goto fail;
+ }
+ ctx->st->st_manager_private = (void *) ctx;
+ ctx->stapi = stapi;
+
+ // Context successfully created. See if post-processing is requested.
+ dri_pp_query(ctx);
+
+ ctx->pp = pp_init(screen->base.screen, ctx->pp_enabled);
+
+ *error = __DRI_CTX_ERROR_SUCCESS;
+ return GL_TRUE;
+
+ fail:
+ if (ctx && ctx->st)
+ ctx->st->destroy(ctx->st);
+
+ FREE(ctx);
+ return GL_FALSE;
+}
+
+void
+dri_destroy_context(__DRIcontext * cPriv)
+{
+ struct dri_context *ctx = dri_context(cPriv);
+
+ /* note: we are freeing values and nothing more because
+ * driParseConfigFiles allocated values only - the rest
+ * is owned by screen optionCache.
+ */
+ FREE(ctx->optionCache.values);
+
+ /* No particular reason to wait for command completion before
+ * destroying a context, but we flush the context here
+ * to avoid having to add code elsewhere to cope with flushing a
+ * partially destroyed context.
+ */
+ ctx->st->flush(ctx->st, 0, NULL);
+ ctx->st->destroy(ctx->st);
+
+ if (ctx->pp) pp_free(ctx->pp);
+
+ FREE(ctx);
+}
+
+GLboolean
+dri_unbind_context(__DRIcontext * cPriv)
+{
+ /* dri_util.c ensures cPriv is not null */
+ struct dri_screen *screen = dri_screen(cPriv->driScreenPriv);
+ struct dri_context *ctx = dri_context(cPriv);
+ struct st_api *stapi = screen->st_api;
+
+ if (--ctx->bind_count == 0) {
+ if (ctx->st == ctx->stapi->get_current(ctx->stapi)) {
+ /* For conformance, unbind is supposed to flush the context.
+ * However, if we do it here we might end up flushing a partially
+ * destroyed context. Instead, we flush in dri_make_current and
+ * in dri_destroy_context which should cover all the cases.
+ */
+ stapi->make_current(stapi, NULL, NULL, NULL);
+ }
+ }
+
+ return GL_TRUE;
+}
+
+GLboolean
+dri_make_current(__DRIcontext * cPriv,
+ __DRIdrawable * driDrawPriv,
+ __DRIdrawable * driReadPriv)
+{
+ /* dri_util.c ensures cPriv is not null */
+ struct dri_context *ctx = dri_context(cPriv);
+ struct dri_drawable *draw = dri_drawable(driDrawPriv);
+ struct dri_drawable *read = dri_drawable(driReadPriv);
+ struct st_context_iface *old_st = ctx->stapi->get_current(ctx->stapi);
+
+ /* Flush the old context here so we don't have to flush on unbind() */
+ if (old_st && old_st != ctx->st)
+ old_st->flush(old_st, ST_FLUSH_FRONT, NULL);
+
+ ++ctx->bind_count;
+
+ if (!driDrawPriv && !driReadPriv)
+ return ctx->stapi->make_current(ctx->stapi, ctx->st, NULL, NULL);
+ else if (!driDrawPriv || !driReadPriv)
+ return GL_FALSE;
+
+ if (ctx->dPriv != driDrawPriv) {
+ ctx->dPriv = driDrawPriv;
+ draw->texture_stamp = driDrawPriv->lastStamp - 1;
+ }
+ if (ctx->rPriv != driReadPriv) {
+ ctx->rPriv = driReadPriv;
+ read->texture_stamp = driReadPriv->lastStamp - 1;
+ }
+
+ ctx->stapi->make_current(ctx->stapi, ctx->st, &draw->base, &read->base);
+
+ // This is ok to call here. If they are already init, it's a no-op.
+ if (draw->textures[ST_ATTACHMENT_BACK_LEFT] && draw->textures[ST_ATTACHMENT_DEPTH_STENCIL]
+ && ctx->pp)
+ pp_init_fbos(ctx->pp, draw->textures[ST_ATTACHMENT_BACK_LEFT]->width0,
+ draw->textures[ST_ATTACHMENT_BACK_LEFT]->height0);
+
+ return GL_TRUE;
+}
+
+struct dri_context *
+dri_get_current(__DRIscreen *sPriv)
+{
+ struct dri_screen *screen = dri_screen(sPriv);
+ struct st_api *stapi = screen->st_api;
+ struct st_context_iface *st;
+
+ st = stapi->get_current(stapi);
+
+ return (struct dri_context *) (st) ? st->st_manager_private : NULL;
+}
+
+/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_drawable.c b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_drawable.c
index 0fc19be6ea6..5a261ddb300 120000..100644
--- a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_drawable.c
+++ b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_drawable.c
@@ -1 +1,402 @@
-../common/dri_drawable.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2009, VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+/*
+ * Author: Keith Whitwell <keithw@vmware.com>
+ * Author: Jakob Bornecrantz <wallbraker@gmail.com>
+ */
+
+#include "dri_screen.h"
+#include "dri_context.h"
+#include "dri_drawable.h"
+
+#include "pipe/p_screen.h"
+#include "util/u_format.h"
+#include "util/u_memory.h"
+#include "util/u_inlines.h"
+
+static void
+swap_fences_unref(struct dri_drawable *draw);
+
+static boolean
+dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,
+ const enum st_attachment_type *statts,
+ unsigned count,
+ struct pipe_resource **out)
+{
+ struct dri_drawable *drawable =
+ (struct dri_drawable *) stfbi->st_manager_private;
+ struct dri_screen *screen = dri_screen(drawable->sPriv);
+ unsigned statt_mask, new_mask;
+ boolean new_stamp;
+ int i;
+ unsigned int lastStamp;
+
+ statt_mask = 0x0;
+ for (i = 0; i < count; i++)
+ statt_mask |= (1 << statts[i]);
+
+ /* record newly allocated textures */
+ new_mask = (statt_mask & ~drawable->texture_mask);
+
+ /*
+ * dPriv->dri2.stamp is the server stamp. dPriv->lastStamp is the
+ * client stamp. It has the value of the server stamp when last
+ * checked.
+ */
+ do {
+ lastStamp = drawable->dPriv->lastStamp;
+ new_stamp = (drawable->texture_stamp != lastStamp);
+
+ if (new_stamp || new_mask || screen->broken_invalidate) {
+ if (new_stamp && drawable->update_drawable_info)
+ drawable->update_drawable_info(drawable);
+
+ drawable->allocate_textures(drawable, statts, count);
+
+ /* add existing textures */
+ for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
+ if (drawable->textures[i])
+ statt_mask |= (1 << i);
+ }
+
+ drawable->texture_stamp = lastStamp;
+ drawable->texture_mask = statt_mask;
+ }
+ } while (lastStamp != drawable->dPriv->lastStamp);
+
+ if (!out)
+ return TRUE;
+
+ for (i = 0; i < count; i++) {
+ out[i] = NULL;
+ pipe_resource_reference(&out[i], drawable->textures[statts[i]]);
+ }
+
+ return TRUE;
+}
+
+static boolean
+dri_st_framebuffer_flush_front(struct st_framebuffer_iface *stfbi,
+ enum st_attachment_type statt)
+{
+ struct dri_drawable *drawable =
+ (struct dri_drawable *) stfbi->st_manager_private;
+
+ /* XXX remove this and just set the correct one on the framebuffer */
+ drawable->flush_frontbuffer(drawable, statt);
+
+ return TRUE;
+}
+
+/**
+ * This is called when we need to set up GL rendering to a new X window.
+ */
+boolean
+dri_create_buffer(__DRIscreen * sPriv,
+ __DRIdrawable * dPriv,
+ const struct gl_config * visual, boolean isPixmap)
+{
+ struct dri_screen *screen = sPriv->driverPrivate;
+ struct dri_drawable *drawable = NULL;
+
+ if (isPixmap)
+ goto fail; /* not implemented */
+
+ drawable = CALLOC_STRUCT(dri_drawable);
+ if (drawable == NULL)
+ goto fail;
+
+ dri_fill_st_visual(&drawable->stvis, screen, visual);
+
+ /* setup the st_framebuffer_iface */
+ drawable->base.visual = &drawable->stvis;
+ drawable->base.flush_front = dri_st_framebuffer_flush_front;
+ drawable->base.validate = dri_st_framebuffer_validate;
+ drawable->base.st_manager_private = (void *) drawable;
+
+ drawable->screen = screen;
+ drawable->sPriv = sPriv;
+ drawable->dPriv = dPriv;
+ drawable->desired_fences = screen->default_throttle_frames;
+ if (drawable->desired_fences > DRI_SWAP_FENCES_MAX)
+ drawable->desired_fences = DRI_SWAP_FENCES_MAX;
+
+ dPriv->driverPrivate = (void *)drawable;
+ p_atomic_set(&drawable->base.stamp, 1);
+
+ return GL_TRUE;
+fail:
+ FREE(drawable);
+ return GL_FALSE;
+}
+
+void
+dri_destroy_buffer(__DRIdrawable * dPriv)
+{
+ struct dri_drawable *drawable = dri_drawable(dPriv);
+ int i;
+
+ pipe_surface_reference(&drawable->drisw_surface, NULL);
+
+ for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
+ pipe_resource_reference(&drawable->textures[i], NULL);
+
+ swap_fences_unref(drawable);
+
+ FREE(drawable);
+}
+
+/**
+ * Validate the texture at an attachment. Allocate the texture if it does not
+ * exist. Used by the TFP extension.
+ */
+static void
+dri_drawable_validate_att(struct dri_drawable *drawable,
+ enum st_attachment_type statt)
+{
+ enum st_attachment_type statts[ST_ATTACHMENT_COUNT];
+ unsigned i, count = 0;
+
+ /* check if buffer already exists */
+ if (drawable->texture_mask & (1 << statt))
+ return;
+
+ /* make sure DRI2 does not destroy existing buffers */
+ for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
+ if (drawable->texture_mask & (1 << i)) {
+ statts[count++] = i;
+ }
+ }
+ statts[count++] = statt;
+
+ drawable->texture_stamp = drawable->dPriv->lastStamp - 1;
+
+ drawable->base.validate(&drawable->base, statts, count, NULL);
+}
+
+/**
+ * These are used for GLX_EXT_texture_from_pixmap
+ */
+static void
+dri_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
+ GLint format, __DRIdrawable *dPriv)
+{
+ struct dri_context *ctx = dri_context(pDRICtx);
+ struct dri_drawable *drawable = dri_drawable(dPriv);
+ struct pipe_resource *pt;
+
+ dri_drawable_validate_att(drawable, ST_ATTACHMENT_FRONT_LEFT);
+
+ /* Use the pipe resource associated with the X drawable */
+ pt = drawable->textures[ST_ATTACHMENT_FRONT_LEFT];
+
+ if (pt) {
+ enum pipe_format internal_format = pt->format;
+
+ if (format == __DRI_TEXTURE_FORMAT_RGB) {
+ /* only need to cover the formats recognized by dri_fill_st_visual */
+ switch (internal_format) {
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
+ internal_format = PIPE_FORMAT_B8G8R8X8_UNORM;
+ break;
+ case PIPE_FORMAT_A8R8G8B8_UNORM:
+ internal_format = PIPE_FORMAT_X8R8G8B8_UNORM;
+ break;
+ default:
+ break;
+ }
+ }
+
+ drawable->update_tex_buffer(drawable, ctx, pt);
+
+ ctx->st->teximage(ctx->st,
+ (target == GL_TEXTURE_2D) ? ST_TEXTURE_2D : ST_TEXTURE_RECT,
+ 0, internal_format, pt, FALSE);
+ }
+}
+
+static void
+dri_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,
+ __DRIdrawable *dPriv)
+{
+ dri_set_tex_buffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
+}
+
+const __DRItexBufferExtension driTexBufferExtension = {
+ { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
+ dri_set_tex_buffer,
+ dri_set_tex_buffer2,
+ NULL,
+};
+
+/**
+ * Get the format and binding of an attachment.
+ */
+void
+dri_drawable_get_format(struct dri_drawable *drawable,
+ enum st_attachment_type statt,
+ enum pipe_format *format,
+ unsigned *bind)
+{
+ switch (statt) {
+ case ST_ATTACHMENT_FRONT_LEFT:
+ case ST_ATTACHMENT_BACK_LEFT:
+ case ST_ATTACHMENT_FRONT_RIGHT:
+ case ST_ATTACHMENT_BACK_RIGHT:
+ *format = drawable->stvis.color_format;
+ *bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
+ break;
+ case ST_ATTACHMENT_DEPTH_STENCIL:
+ *format = drawable->stvis.depth_stencil_format;
+ *bind = PIPE_BIND_DEPTH_STENCIL; /* XXX sampler? */
+ break;
+ default:
+ *format = PIPE_FORMAT_NONE;
+ *bind = 0;
+ break;
+ }
+}
+
+
+/**
+ * swap_fences_pop_front - pull a fence from the throttle queue
+ *
+ * If the throttle queue is filled to the desired number of fences,
+ * pull fences off the queue until the number is less than the desired
+ * number of fences, and return the last fence pulled.
+ */
+static struct pipe_fence_handle *
+swap_fences_pop_front(struct dri_drawable *draw)
+{
+ struct pipe_screen *screen = draw->screen->base.screen;
+ struct pipe_fence_handle *fence = NULL;
+
+ if (draw->desired_fences == 0)
+ return NULL;
+
+ if (draw->cur_fences >= draw->desired_fences) {
+ screen->fence_reference(screen, &fence, draw->swap_fences[draw->tail]);
+ screen->fence_reference(screen, &draw->swap_fences[draw->tail++], NULL);
+ draw->tail &= DRI_SWAP_FENCES_MASK;
+ --draw->cur_fences;
+ }
+ return fence;
+}
+
+
+/**
+ * swap_fences_push_back - push a fence onto the throttle queue
+ *
+ * push a fence onto the throttle queue and pull fences of the queue
+ * so that the desired number of fences are on the queue.
+ */
+static void
+swap_fences_push_back(struct dri_drawable *draw,
+ struct pipe_fence_handle *fence)
+{
+ struct pipe_screen *screen = draw->screen->base.screen;
+
+ if (!fence || draw->desired_fences == 0)
+ return;
+
+ while(draw->cur_fences == draw->desired_fences)
+ swap_fences_pop_front(draw);
+
+ draw->cur_fences++;
+ screen->fence_reference(screen, &draw->swap_fences[draw->head++],
+ fence);
+ draw->head &= DRI_SWAP_FENCES_MASK;
+}
+
+
+/**
+ * swap_fences_unref - empty the throttle queue
+ *
+ * pulls fences of the throttle queue until it is empty.
+ */
+static void
+swap_fences_unref(struct dri_drawable *draw)
+{
+ struct pipe_screen *screen = draw->screen->base.screen;
+
+ while(draw->cur_fences) {
+ screen->fence_reference(screen, &draw->swap_fences[draw->tail++], NULL);
+ draw->tail &= DRI_SWAP_FENCES_MASK;
+ --draw->cur_fences;
+ }
+}
+
+
+/**
+ * dri_throttle - A DRI2ThrottleExtension throttling function.
+ *
+ * pulls a fence off the throttling queue and waits for it if the
+ * number of fences on the throttling queue has reached the desired
+ * number.
+ *
+ * Then flushes to insert a fence at the current rendering position, and
+ * pushes that fence on the queue. This requires that the st_context_iface
+ * flush method returns a fence even if there are no commands to flush.
+ */
+static void
+dri_throttle(__DRIcontext *driCtx, __DRIdrawable *dPriv,
+ enum __DRI2throttleReason reason)
+{
+ struct dri_drawable *draw = dri_drawable(dPriv);
+ struct st_context_iface *ctxi;
+ struct pipe_screen *screen = draw->screen->base.screen;
+ struct pipe_fence_handle *fence;
+
+ if (reason != __DRI2_THROTTLE_SWAPBUFFER &&
+ reason != __DRI2_THROTTLE_FLUSHFRONT)
+ return;
+
+ fence = swap_fences_pop_front(draw);
+ if (fence) {
+ (void) screen->fence_finish(screen, fence, PIPE_TIMEOUT_INFINITE);
+ screen->fence_reference(screen, &fence, NULL);
+ }
+
+ if (driCtx == NULL)
+ return;
+
+ ctxi = dri_context(driCtx)->st;
+ ctxi->flush(ctxi, 0, &fence);
+ if (fence) {
+ swap_fences_push_back(draw, fence);
+ screen->fence_reference(screen, &fence, NULL);
+ }
+}
+
+
+const __DRI2throttleExtension dri2ThrottleExtension = {
+ .base = { __DRI2_THROTTLE, __DRI2_THROTTLE_VERSION },
+ .throttle = dri_throttle,
+};
+
+
+/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_screen.c b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_screen.c
index 847f6515f25..102a1326133 120000..100644
--- a/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_screen.c
+++ b/chromium/third_party/mesa/src/src/gallium/state_trackers/dri/sw/dri_screen.c
@@ -1 +1,420 @@
-../common/dri_screen.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2009, VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+/*
+ * Author: Keith Whitwell <keithw@vmware.com>
+ * Author: Jakob Bornecrantz <wallbraker@gmail.com>
+ */
+
+#include "utils.h"
+#include "xmlpool.h"
+
+#include "dri_screen.h"
+
+#include "util/u_inlines.h"
+#include "pipe/p_screen.h"
+#include "pipe/p_format.h"
+#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
+
+#include "util/u_debug.h"
+
+#define MSAA_VISUAL_MAX_SAMPLES 8
+
+#undef false
+
+PUBLIC const char __driConfigOptions[] =
+ DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
+ DRI_CONF_SECTION_END
+
+ DRI_CONF_SECTION_QUALITY
+/* DRI_CONF_FORCE_S3TC_ENABLE(false) */
+ DRI_CONF_ALLOW_LARGE_TEXTURES(1)
+ DRI_CONF_PP_CELSHADE(0)
+ DRI_CONF_PP_NORED(0)
+ DRI_CONF_PP_NOGREEN(0)
+ DRI_CONF_PP_NOBLUE(0)
+ DRI_CONF_PP_JIMENEZMLAA(0, 0, 32)
+ DRI_CONF_PP_JIMENEZMLAA_COLOR(0, 0, 32)
+ DRI_CONF_SECTION_END
+
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
+ DRI_CONF_SECTION_END
+
+ DRI_CONF_END;
+
+#define false 0
+
+static const uint __driNConfigOptions = 10;
+
+static const __DRIconfig **
+dri_fill_in_modes(struct dri_screen *screen,
+ unsigned pixel_bits)
+{
+ __DRIconfig **configs = NULL;
+ __DRIconfig **configs_r5g6b5 = NULL;
+ __DRIconfig **configs_a8r8g8b8 = NULL;
+ __DRIconfig **configs_x8r8g8b8 = NULL;
+ uint8_t depth_bits_array[5];
+ uint8_t stencil_bits_array[5];
+ uint8_t msaa_samples_array[MSAA_VISUAL_MAX_SAMPLES];
+ unsigned depth_buffer_factor;
+ unsigned back_buffer_factor;
+ unsigned msaa_samples_factor, msaa_samples_max;
+ unsigned i;
+ struct pipe_screen *p_screen = screen->base.screen;
+ boolean pf_r5g6b5, pf_a8r8g8b8, pf_x8r8g8b8;
+ boolean pf_z16, pf_x8z24, pf_z24x8, pf_s8z24, pf_z24s8, pf_z32;
+
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ };
+
+ depth_bits_array[0] = 0;
+ stencil_bits_array[0] = 0;
+ depth_buffer_factor = 1;
+
+ msaa_samples_max = (screen->st_api->feature_mask & ST_API_FEATURE_MS_VISUALS)
+ ? MSAA_VISUAL_MAX_SAMPLES : 1;
+
+ pf_x8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24X8_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_z24x8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_X8Z24_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_s8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24_UNORM_S8_UINT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_z24s8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_S8_UINT_Z24_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_a8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8A8_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET);
+ pf_x8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8X8_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET);
+ pf_r5g6b5 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B5G6R5_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET);
+
+ /* We can only get a 16 or 32 bit depth buffer with getBuffersWithFormat */
+ if (dri_with_format(screen->sPriv)) {
+ pf_z16 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z16_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ pf_z32 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z32_UNORM,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_DEPTH_STENCIL);
+ } else {
+ pf_z16 = FALSE;
+ pf_z32 = FALSE;
+ }
+
+ if (pf_z16) {
+ depth_bits_array[depth_buffer_factor] = 16;
+ stencil_bits_array[depth_buffer_factor++] = 0;
+ }
+ if (pf_x8z24 || pf_z24x8) {
+ depth_bits_array[depth_buffer_factor] = 24;
+ stencil_bits_array[depth_buffer_factor++] = 0;
+ screen->d_depth_bits_last = pf_x8z24;
+ }
+ if (pf_s8z24 || pf_z24s8) {
+ depth_bits_array[depth_buffer_factor] = 24;
+ stencil_bits_array[depth_buffer_factor++] = 8;
+ screen->sd_depth_bits_last = pf_s8z24;
+ }
+ if (pf_z32) {
+ depth_bits_array[depth_buffer_factor] = 32;
+ stencil_bits_array[depth_buffer_factor++] = 0;
+ }
+
+ msaa_samples_array[0] = 0;
+ back_buffer_factor = 3;
+
+ /* Also test for color multisample support - just assume it'll work
+ * for all depth buffers.
+ */
+ if (pf_r5g6b5) {
+ msaa_samples_factor = 1;
+ for (i = 2; i <= msaa_samples_max; i++) {
+ if (p_screen->is_format_supported(p_screen, PIPE_FORMAT_B5G6R5_UNORM,
+ PIPE_TEXTURE_2D, i,
+ PIPE_BIND_RENDER_TARGET)) {
+ msaa_samples_array[msaa_samples_factor] = i;
+ msaa_samples_factor++;
+ }
+ }
+
+ configs_r5g6b5 = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array, msaa_samples_factor,
+ GL_TRUE);
+ }
+
+ if (pf_a8r8g8b8) {
+ msaa_samples_factor = 1;
+ for (i = 2; i <= msaa_samples_max; i++) {
+ if (p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8A8_UNORM,
+ PIPE_TEXTURE_2D, i,
+ PIPE_BIND_RENDER_TARGET)) {
+ msaa_samples_array[msaa_samples_factor] = i;
+ msaa_samples_factor++;
+ }
+ }
+
+ configs_a8r8g8b8 = driCreateConfigs(GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array,
+ msaa_samples_factor,
+ GL_TRUE);
+ }
+
+ if (pf_x8r8g8b8) {
+ msaa_samples_factor = 1;
+ for (i = 2; i <= msaa_samples_max; i++) {
+ if (p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8X8_UNORM,
+ PIPE_TEXTURE_2D, i,
+ PIPE_BIND_RENDER_TARGET)) {
+ msaa_samples_array[msaa_samples_factor] = i;
+ msaa_samples_factor++;
+ }
+ }
+
+ configs_x8r8g8b8 = driCreateConfigs(GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV,
+ depth_bits_array,
+ stencil_bits_array,
+ depth_buffer_factor,
+ back_buffer_modes,
+ back_buffer_factor,
+ msaa_samples_array,
+ msaa_samples_factor,
+ GL_TRUE);
+ }
+
+ if (pixel_bits == 16) {
+ configs = configs_r5g6b5;
+ configs = driConcatConfigs(configs, configs_a8r8g8b8);
+ configs = driConcatConfigs(configs, configs_x8r8g8b8);
+ } else {
+ configs = configs_a8r8g8b8;
+ configs = driConcatConfigs(configs, configs_x8r8g8b8);
+ configs = driConcatConfigs(configs, configs_r5g6b5);
+ }
+
+ if (configs == NULL) {
+ debug_printf("%s: driCreateConfigs failed\n", __FUNCTION__);
+ return NULL;
+ }
+
+ return (const __DRIconfig **)configs;
+}
+
+/**
+ * Roughly the converse of dri_fill_in_modes.
+ */
+void
+dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen,
+ const struct gl_config *mode)
+{
+ memset(stvis, 0, sizeof(*stvis));
+
+ if (!mode)
+ return;
+
+ stvis->samples = mode->samples;
+
+ if (mode->redBits == 8) {
+ if (mode->alphaBits == 8)
+ stvis->color_format = PIPE_FORMAT_B8G8R8A8_UNORM;
+ else
+ stvis->color_format = PIPE_FORMAT_B8G8R8X8_UNORM;
+ } else {
+ stvis->color_format = PIPE_FORMAT_B5G6R5_UNORM;
+ }
+
+ switch (mode->depthBits) {
+ default:
+ case 0:
+ stvis->depth_stencil_format = PIPE_FORMAT_NONE;
+ break;
+ case 16:
+ stvis->depth_stencil_format = PIPE_FORMAT_Z16_UNORM;
+ break;
+ case 24:
+ if (mode->stencilBits == 0) {
+ stvis->depth_stencil_format = (screen->d_depth_bits_last) ?
+ PIPE_FORMAT_Z24X8_UNORM:
+ PIPE_FORMAT_X8Z24_UNORM;
+ } else {
+ stvis->depth_stencil_format = (screen->sd_depth_bits_last) ?
+ PIPE_FORMAT_Z24_UNORM_S8_UINT:
+ PIPE_FORMAT_S8_UINT_Z24_UNORM;
+ }
+ break;
+ case 32:
+ stvis->depth_stencil_format = PIPE_FORMAT_Z32_UNORM;
+ break;
+ }
+
+ stvis->accum_format = (mode->haveAccumBuffer) ?
+ PIPE_FORMAT_R16G16B16A16_SNORM : PIPE_FORMAT_NONE;
+
+ stvis->buffer_mask |= ST_ATTACHMENT_FRONT_LEFT_MASK;
+ stvis->render_buffer = ST_ATTACHMENT_FRONT_LEFT;
+ if (mode->doubleBufferMode) {
+ stvis->buffer_mask |= ST_ATTACHMENT_BACK_LEFT_MASK;
+ stvis->render_buffer = ST_ATTACHMENT_BACK_LEFT;
+ }
+ if (mode->stereoMode) {
+ stvis->buffer_mask |= ST_ATTACHMENT_FRONT_RIGHT_MASK;
+ if (mode->doubleBufferMode)
+ stvis->buffer_mask |= ST_ATTACHMENT_BACK_RIGHT_MASK;
+ }
+
+ if (mode->haveDepthBuffer || mode->haveStencilBuffer)
+ stvis->buffer_mask |= ST_ATTACHMENT_DEPTH_STENCIL_MASK;
+ /* let the state tracker allocate the accum buffer */
+}
+
+static boolean
+dri_get_egl_image(struct st_manager *smapi,
+ void *egl_image,
+ struct st_egl_image *stimg)
+{
+ struct dri_screen *screen = (struct dri_screen *)smapi;
+ __DRIimage *img = NULL;
+
+ if (screen->lookup_egl_image) {
+ img = screen->lookup_egl_image(screen, egl_image);
+ }
+
+ if (!img)
+ return FALSE;
+
+ stimg->texture = NULL;
+ pipe_resource_reference(&stimg->texture, img->texture);
+ stimg->level = img->level;
+ stimg->layer = img->layer;
+
+ return TRUE;
+}
+
+static int
+dri_get_param(struct st_manager *smapi,
+ enum st_manager_param param)
+{
+ struct dri_screen *screen = (struct dri_screen *)smapi;
+
+ switch(param) {
+ case ST_MANAGER_BROKEN_INVALIDATE:
+ return screen->broken_invalidate;
+ default:
+ return 0;
+ }
+}
+
+static void
+dri_destroy_option_cache(struct dri_screen * screen)
+{
+ int i;
+
+ if (screen->optionCache.info) {
+ for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
+ FREE(screen->optionCache.info[i].name);
+ FREE(screen->optionCache.info[i].ranges);
+ }
+ FREE(screen->optionCache.info);
+ }
+
+ FREE(screen->optionCache.values);
+}
+
+void
+dri_destroy_screen_helper(struct dri_screen * screen)
+{
+ if (screen->st_api && screen->st_api->destroy)
+ screen->st_api->destroy(screen->st_api);
+
+ if (screen->base.screen)
+ screen->base.screen->destroy(screen->base.screen);
+
+ dri_destroy_option_cache(screen);
+}
+
+void
+dri_destroy_screen(__DRIscreen * sPriv)
+{
+ struct dri_screen *screen = dri_screen(sPriv);
+
+ dri_destroy_screen_helper(screen);
+
+ FREE(screen);
+ sPriv->driverPrivate = NULL;
+ sPriv->extensions = NULL;
+}
+
+const __DRIconfig **
+dri_init_screen_helper(struct dri_screen *screen,
+ struct pipe_screen *pscreen,
+ unsigned pixel_bits)
+{
+ screen->base.screen = pscreen;
+ if (!screen->base.screen) {
+ debug_printf("%s: failed to create pipe_screen\n", __FUNCTION__);
+ return NULL;
+ }
+
+ screen->base.get_egl_image = dri_get_egl_image;
+ screen->base.get_param = dri_get_param;
+
+ screen->st_api = st_gl_api_create();
+ if (!screen->st_api)
+ return NULL;
+
+ if(pscreen->get_param(pscreen, PIPE_CAP_NPOT_TEXTURES))
+ screen->target = PIPE_TEXTURE_2D;
+ else
+ screen->target = PIPE_TEXTURE_RECT;
+
+ driParseOptionInfo(&screen->optionCache,
+ __driConfigOptions, __driNConfigOptions);
+
+ return dri_fill_in_modes(screen, pixel_bits);
+}
+
+/* vim: set sw=3 ts=8 sts=3 expandtab: */
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_batchbuffer.c
index d38cdf31cc6..06cbaecc74d 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_batchbuffer.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_batchbuffer.c
@@ -1 +1,543 @@
-../intel/intel_batchbuffer.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_buffer_objects.h"
+#include "intel_reg.h"
+#include "intel_bufmgr.h"
+#include "intel_buffers.h"
+
+struct cached_batch_item {
+ struct cached_batch_item *next;
+ uint16_t header;
+ uint16_t size;
+};
+
+static void clear_cache( struct intel_context *intel )
+{
+ struct cached_batch_item *item = intel->batch.cached_items;
+
+ while (item) {
+ struct cached_batch_item *next = item->next;
+ free(item);
+ item = next;
+ }
+
+ intel->batch.cached_items = NULL;
+}
+
+void
+intel_batchbuffer_init(struct intel_context *intel)
+{
+ intel_batchbuffer_reset(intel);
+
+ if (intel->gen >= 6) {
+ /* We can't just use brw_state_batch to get a chunk of space for
+ * the gen6 workaround because it involves actually writing to
+ * the buffer, and the kernel doesn't let us write to the batch.
+ */
+ intel->batch.workaround_bo = drm_intel_bo_alloc(intel->bufmgr,
+ "pipe_control workaround",
+ 4096, 4096);
+ }
+}
+
+void
+intel_batchbuffer_reset(struct intel_context *intel)
+{
+ if (intel->batch.last_bo != NULL) {
+ drm_intel_bo_unreference(intel->batch.last_bo);
+ intel->batch.last_bo = NULL;
+ }
+ intel->batch.last_bo = intel->batch.bo;
+
+ clear_cache(intel);
+
+ intel->batch.bo = drm_intel_bo_alloc(intel->bufmgr, "batchbuffer",
+ intel->maxBatchSize, 4096);
+
+ intel->batch.reserved_space = BATCH_RESERVED;
+ intel->batch.state_batch_offset = intel->batch.bo->size;
+ intel->batch.used = 0;
+ intel->batch.needs_sol_reset = false;
+}
+
+void
+intel_batchbuffer_save_state(struct intel_context *intel)
+{
+ intel->batch.saved.used = intel->batch.used;
+ intel->batch.saved.reloc_count =
+ drm_intel_gem_bo_get_reloc_count(intel->batch.bo);
+}
+
+void
+intel_batchbuffer_reset_to_saved(struct intel_context *intel)
+{
+ drm_intel_gem_bo_clear_relocs(intel->batch.bo, intel->batch.saved.reloc_count);
+
+ intel->batch.used = intel->batch.saved.used;
+
+ /* Cached batch state is dead, since we just cleared some unknown part of the
+ * batchbuffer. Assume that the caller resets any other state necessary.
+ */
+ clear_cache(intel);
+}
+
+void
+intel_batchbuffer_free(struct intel_context *intel)
+{
+ drm_intel_bo_unreference(intel->batch.last_bo);
+ drm_intel_bo_unreference(intel->batch.bo);
+ drm_intel_bo_unreference(intel->batch.workaround_bo);
+ clear_cache(intel);
+}
+
+static void
+do_batch_dump(struct intel_context *intel)
+{
+ struct drm_intel_decode *decode;
+ struct intel_batchbuffer *batch = &intel->batch;
+ int ret;
+
+ decode = drm_intel_decode_context_alloc(intel->intelScreen->deviceID);
+ if (!decode)
+ return;
+
+ ret = drm_intel_bo_map(batch->bo, false);
+ if (ret == 0) {
+ drm_intel_decode_set_batch_pointer(decode,
+ batch->bo->virtual,
+ batch->bo->offset,
+ batch->used);
+ } else {
+ fprintf(stderr,
+ "WARNING: failed to map batchbuffer (%s), "
+ "dumping uploaded data instead.\n", strerror(ret));
+
+ drm_intel_decode_set_batch_pointer(decode,
+ batch->map,
+ batch->bo->offset,
+ batch->used);
+ }
+
+ drm_intel_decode(decode);
+
+ drm_intel_decode_context_free(decode);
+
+ if (ret == 0) {
+ drm_intel_bo_unmap(batch->bo);
+
+ if (intel->vtbl.debug_batch != NULL)
+ intel->vtbl.debug_batch(intel);
+ }
+}
+
+/* TODO: Push this whole function into bufmgr.
+ */
+static int
+do_flush_locked(struct intel_context *intel)
+{
+ struct intel_batchbuffer *batch = &intel->batch;
+ int ret = 0;
+
+ ret = drm_intel_bo_subdata(batch->bo, 0, 4*batch->used, batch->map);
+ if (ret == 0 && batch->state_batch_offset != batch->bo->size) {
+ ret = drm_intel_bo_subdata(batch->bo,
+ batch->state_batch_offset,
+ batch->bo->size - batch->state_batch_offset,
+ (char *)batch->map + batch->state_batch_offset);
+ }
+
+ if (!intel->intelScreen->no_hw) {
+ int flags;
+
+ if (intel->gen < 6 || !batch->is_blit) {
+ flags = I915_EXEC_RENDER;
+ } else {
+ flags = I915_EXEC_BLT;
+ }
+
+ if (batch->needs_sol_reset)
+ flags |= I915_EXEC_GEN7_SOL_RESET;
+
+ if (ret == 0) {
+ if (unlikely(INTEL_DEBUG & DEBUG_AUB) && intel->vtbl.annotate_aub)
+ intel->vtbl.annotate_aub(intel);
+ if (intel->hw_ctx == NULL || batch->is_blit) {
+ ret = drm_intel_bo_mrb_exec(batch->bo, 4 * batch->used, NULL, 0, 0,
+ flags);
+ } else {
+ ret = drm_intel_gem_bo_context_exec(batch->bo, intel->hw_ctx,
+ 4 * batch->used, flags);
+ }
+ }
+ }
+
+ if (unlikely(INTEL_DEBUG & DEBUG_BATCH))
+ do_batch_dump(intel);
+
+ if (ret != 0) {
+ fprintf(stderr, "intel_do_flush_locked failed: %s\n", strerror(-ret));
+ exit(1);
+ }
+ intel->vtbl.new_batch(intel);
+
+ return ret;
+}
+
+int
+_intel_batchbuffer_flush(struct intel_context *intel,
+ const char *file, int line)
+{
+ int ret;
+
+ if (intel->batch.used == 0)
+ return 0;
+
+ if (intel->first_post_swapbuffers_batch == NULL) {
+ intel->first_post_swapbuffers_batch = intel->batch.bo;
+ drm_intel_bo_reference(intel->first_post_swapbuffers_batch);
+ }
+
+ if (unlikely(INTEL_DEBUG & DEBUG_BATCH))
+ fprintf(stderr, "%s:%d: Batchbuffer flush with %db used\n", file, line,
+ 4*intel->batch.used);
+
+ intel->batch.reserved_space = 0;
+
+ if (intel->vtbl.finish_batch)
+ intel->vtbl.finish_batch(intel);
+
+ /* Mark the end of the buffer. */
+ intel_batchbuffer_emit_dword(intel, MI_BATCH_BUFFER_END);
+ if (intel->batch.used & 1) {
+ /* Round batchbuffer usage to 2 DWORDs. */
+ intel_batchbuffer_emit_dword(intel, MI_NOOP);
+ }
+
+ intel_upload_finish(intel);
+
+ /* Check that we didn't just wrap our batchbuffer at a bad time. */
+ assert(!intel->no_batch_wrap);
+
+ ret = do_flush_locked(intel);
+
+ if (unlikely(INTEL_DEBUG & DEBUG_SYNC)) {
+ fprintf(stderr, "waiting for idle\n");
+ drm_intel_bo_wait_rendering(intel->batch.bo);
+ }
+
+ /* Reset the buffer:
+ */
+ intel_batchbuffer_reset(intel);
+
+ return ret;
+}
+
+
+/* This is the only way buffers get added to the validate list.
+ */
+bool
+intel_batchbuffer_emit_reloc(struct intel_context *intel,
+ drm_intel_bo *buffer,
+ uint32_t read_domains, uint32_t write_domain,
+ uint32_t delta)
+{
+ int ret;
+
+ ret = drm_intel_bo_emit_reloc(intel->batch.bo, 4*intel->batch.used,
+ buffer, delta,
+ read_domains, write_domain);
+ assert(ret == 0);
+ (void)ret;
+
+ /*
+ * Using the old buffer offset, write in what the right data would be, in case
+ * the buffer doesn't move and we can short-circuit the relocation processing
+ * in the kernel
+ */
+ intel_batchbuffer_emit_dword(intel, buffer->offset + delta);
+
+ return true;
+}
+
+bool
+intel_batchbuffer_emit_reloc_fenced(struct intel_context *intel,
+ drm_intel_bo *buffer,
+ uint32_t read_domains,
+ uint32_t write_domain,
+ uint32_t delta)
+{
+ int ret;
+
+ ret = drm_intel_bo_emit_reloc_fence(intel->batch.bo, 4*intel->batch.used,
+ buffer, delta,
+ read_domains, write_domain);
+ assert(ret == 0);
+ (void)ret;
+
+ /*
+ * Using the old buffer offset, write in what the right data would
+ * be, in case the buffer doesn't move and we can short-circuit the
+ * relocation processing in the kernel
+ */
+ intel_batchbuffer_emit_dword(intel, buffer->offset + delta);
+
+ return true;
+}
+
+void
+intel_batchbuffer_data(struct intel_context *intel,
+ const void *data, GLuint bytes, bool is_blit)
+{
+ assert((bytes & 3) == 0);
+ intel_batchbuffer_require_space(intel, bytes, is_blit);
+ __memcpy(intel->batch.map + intel->batch.used, data, bytes);
+ intel->batch.used += bytes >> 2;
+}
+
+void
+intel_batchbuffer_cached_advance(struct intel_context *intel)
+{
+ struct cached_batch_item **prev = &intel->batch.cached_items, *item;
+ uint32_t sz = (intel->batch.used - intel->batch.emit) * sizeof(uint32_t);
+ uint32_t *start = intel->batch.map + intel->batch.emit;
+ uint16_t op = *start >> 16;
+
+ while (*prev) {
+ uint32_t *old;
+
+ item = *prev;
+ old = intel->batch.map + item->header;
+ if (op == *old >> 16) {
+ if (item->size == sz && memcmp(old, start, sz) == 0) {
+ if (prev != &intel->batch.cached_items) {
+ *prev = item->next;
+ item->next = intel->batch.cached_items;
+ intel->batch.cached_items = item;
+ }
+ intel->batch.used = intel->batch.emit;
+ return;
+ }
+
+ goto emit;
+ }
+ prev = &item->next;
+ }
+
+ item = malloc(sizeof(struct cached_batch_item));
+ if (item == NULL)
+ return;
+
+ item->next = intel->batch.cached_items;
+ intel->batch.cached_items = item;
+
+emit:
+ item->size = sz;
+ item->header = intel->batch.emit;
+}
+
+/**
+ * Restriction [DevSNB, DevIVB]:
+ *
+ * Prior to changing Depth/Stencil Buffer state (i.e. any combination of
+ * 3DSTATE_DEPTH_BUFFER, 3DSTATE_CLEAR_PARAMS, 3DSTATE_STENCIL_BUFFER,
+ * 3DSTATE_HIER_DEPTH_BUFFER) SW must first issue a pipelined depth stall
+ * (PIPE_CONTROL with Depth Stall bit set), followed by a pipelined depth
+ * cache flush (PIPE_CONTROL with Depth Flush Bit set), followed by
+ * another pipelined depth stall (PIPE_CONTROL with Depth Stall bit set),
+ * unless SW can otherwise guarantee that the pipeline from WM onwards is
+ * already flushed (e.g., via a preceding MI_FLUSH).
+ */
+void
+intel_emit_depth_stall_flushes(struct intel_context *intel)
+{
+ assert(intel->gen >= 6 && intel->gen <= 7);
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_DEPTH_STALL);
+ OUT_BATCH(0); /* address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH()
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_DEPTH_CACHE_FLUSH);
+ OUT_BATCH(0); /* address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_DEPTH_STALL);
+ OUT_BATCH(0); /* address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+}
+
+/**
+ * From the BSpec, volume 2a.03: VS Stage Input / State:
+ * "[DevIVB] A PIPE_CONTROL with Post-Sync Operation set to 1h and a depth
+ * stall needs to be sent just prior to any 3DSTATE_VS, 3DSTATE_URB_VS,
+ * 3DSTATE_CONSTANT_VS, 3DSTATE_BINDING_TABLE_POINTER_VS,
+ * 3DSTATE_SAMPLER_STATE_POINTER_VS command. Only one PIPE_CONTROL needs
+ * to be sent before any combination of VS associated 3DSTATE."
+ */
+void
+gen7_emit_vs_workaround_flush(struct intel_context *intel)
+{
+ assert(intel->gen == 7);
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_DEPTH_STALL | PIPE_CONTROL_WRITE_IMMEDIATE);
+ OUT_RELOC(intel->batch.workaround_bo,
+ I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, 0);
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+}
+
+/**
+ * Emits a PIPE_CONTROL with a non-zero post-sync operation, for
+ * implementing two workarounds on gen6. From section 1.4.7.1
+ * "PIPE_CONTROL" of the Sandy Bridge PRM volume 2 part 1:
+ *
+ * [DevSNB-C+{W/A}] Before any depth stall flush (including those
+ * produced by non-pipelined state commands), software needs to first
+ * send a PIPE_CONTROL with no bits set except Post-Sync Operation !=
+ * 0.
+ *
+ * [Dev-SNB{W/A}]: Before a PIPE_CONTROL with Write Cache Flush Enable
+ * =1, a PIPE_CONTROL with any non-zero post-sync-op is required.
+ *
+ * And the workaround for these two requires this workaround first:
+ *
+ * [Dev-SNB{W/A}]: Pipe-control with CS-stall bit set must be sent
+ * BEFORE the pipe-control with a post-sync op and no write-cache
+ * flushes.
+ *
+ * And this last workaround is tricky because of the requirements on
+ * that bit. From section 1.4.7.2.3 "Stall" of the Sandy Bridge PRM
+ * volume 2 part 1:
+ *
+ * "1 of the following must also be set:
+ * - Render Target Cache Flush Enable ([12] of DW1)
+ * - Depth Cache Flush Enable ([0] of DW1)
+ * - Stall at Pixel Scoreboard ([1] of DW1)
+ * - Depth Stall ([13] of DW1)
+ * - Post-Sync Operation ([13] of DW1)
+ * - Notify Enable ([8] of DW1)"
+ *
+ * The cache flushes require the workaround flush that triggered this
+ * one, so we can't use it. Depth stall would trigger the same.
+ * Post-sync nonzero is what triggered this second workaround, so we
+ * can't use that one either. Notify enable is IRQs, which aren't
+ * really our business. That leaves only stall at scoreboard.
+ */
+void
+intel_emit_post_sync_nonzero_flush(struct intel_context *intel)
+{
+ if (!intel->batch.need_workaround_flush)
+ return;
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_CS_STALL |
+ PIPE_CONTROL_STALL_AT_SCOREBOARD);
+ OUT_BATCH(0); /* address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_WRITE_IMMEDIATE);
+ OUT_RELOC(intel->batch.workaround_bo,
+ I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, 0);
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+
+ intel->batch.need_workaround_flush = false;
+}
+
+/* Emit a pipelined flush to either flush render and texture cache for
+ * reading from a FBO-drawn texture, or flush so that frontbuffer
+ * render appears on the screen in DRI1.
+ *
+ * This is also used for the always_flush_cache driconf debug option.
+ */
+void
+intel_batchbuffer_emit_mi_flush(struct intel_context *intel)
+{
+ if (intel->gen >= 6) {
+ if (intel->batch.is_blit) {
+ BEGIN_BATCH_BLT(4);
+ OUT_BATCH(MI_FLUSH_DW);
+ OUT_BATCH(0);
+ OUT_BATCH(0);
+ OUT_BATCH(0);
+ ADVANCE_BATCH();
+ } else {
+ if (intel->gen == 6) {
+ /* Hardware workaround: SNB B-Spec says:
+ *
+ * [Dev-SNB{W/A}]: Before a PIPE_CONTROL with Write Cache
+ * Flush Enable =1, a PIPE_CONTROL with any non-zero
+ * post-sync-op is required.
+ */
+ intel_emit_post_sync_nonzero_flush(intel);
+ }
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_INSTRUCTION_FLUSH |
+ PIPE_CONTROL_WRITE_FLUSH |
+ PIPE_CONTROL_DEPTH_CACHE_FLUSH |
+ PIPE_CONTROL_VF_CACHE_INVALIDATE |
+ PIPE_CONTROL_TC_FLUSH |
+ PIPE_CONTROL_NO_WRITE |
+ PIPE_CONTROL_CS_STALL);
+ OUT_BATCH(0); /* write address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+ }
+ } else if (intel->gen >= 4) {
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2) |
+ PIPE_CONTROL_WRITE_FLUSH |
+ PIPE_CONTROL_NO_WRITE);
+ OUT_BATCH(0); /* write address */
+ OUT_BATCH(0); /* write data */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+ } else {
+ BEGIN_BATCH(1);
+ OUT_BATCH(MI_FLUSH);
+ ADVANCE_BATCH();
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_blit.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_blit.c
index dd6c8d17c28..36a2c6aadac 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_blit.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_blit.c
@@ -1 +1,604 @@
-../intel/intel_blit.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/mtypes.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/fbobject.h"
+
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_context.h"
+#include "intel_fbo.h"
+#include "intel_reg.h"
+#include "intel_regions.h"
+#include "intel_batchbuffer.h"
+#include "intel_mipmap_tree.h"
+
+#define FILE_DEBUG_FLAG DEBUG_BLIT
+
+static GLuint translate_raster_op(GLenum logicop)
+{
+ switch(logicop) {
+ case GL_CLEAR: return 0x00;
+ case GL_AND: return 0x88;
+ case GL_AND_REVERSE: return 0x44;
+ case GL_COPY: return 0xCC;
+ case GL_AND_INVERTED: return 0x22;
+ case GL_NOOP: return 0xAA;
+ case GL_XOR: return 0x66;
+ case GL_OR: return 0xEE;
+ case GL_NOR: return 0x11;
+ case GL_EQUIV: return 0x99;
+ case GL_INVERT: return 0x55;
+ case GL_OR_REVERSE: return 0xDD;
+ case GL_COPY_INVERTED: return 0x33;
+ case GL_OR_INVERTED: return 0xBB;
+ case GL_NAND: return 0x77;
+ case GL_SET: return 0xFF;
+ default: return 0;
+ }
+}
+
+static uint32_t
+br13_for_cpp(int cpp)
+{
+ switch (cpp) {
+ case 4:
+ return BR13_8888;
+ break;
+ case 2:
+ return BR13_565;
+ break;
+ case 1:
+ return BR13_8;
+ break;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+/* Copy BitBlt
+ */
+bool
+intelEmitCopyBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLshort src_pitch,
+ drm_intel_bo *src_buffer,
+ GLuint src_offset,
+ uint32_t src_tiling,
+ GLshort dst_pitch,
+ drm_intel_bo *dst_buffer,
+ GLuint dst_offset,
+ uint32_t dst_tiling,
+ GLshort src_x, GLshort src_y,
+ GLshort dst_x, GLshort dst_y,
+ GLshort w, GLshort h,
+ GLenum logic_op)
+{
+ GLuint CMD, BR13, pass = 0;
+ int dst_y2 = dst_y + h;
+ int dst_x2 = dst_x + w;
+ drm_intel_bo *aper_array[3];
+ BATCH_LOCALS;
+
+ if (dst_tiling != I915_TILING_NONE) {
+ if (dst_offset & 4095)
+ return false;
+ if (dst_tiling == I915_TILING_Y)
+ return false;
+ }
+ if (src_tiling != I915_TILING_NONE) {
+ if (src_offset & 4095)
+ return false;
+ if (src_tiling == I915_TILING_Y)
+ return false;
+ }
+
+ /* do space check before going any further */
+ do {
+ aper_array[0] = intel->batch.bo;
+ aper_array[1] = dst_buffer;
+ aper_array[2] = src_buffer;
+
+ if (dri_bufmgr_check_aperture_space(aper_array, 3) != 0) {
+ intel_batchbuffer_flush(intel);
+ pass++;
+ } else
+ break;
+ } while (pass < 2);
+
+ if (pass >= 2)
+ return false;
+
+ intel_batchbuffer_require_space(intel, 8 * 4, true);
+ DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
+ __FUNCTION__,
+ src_buffer, src_pitch, src_offset, src_x, src_y,
+ dst_buffer, dst_pitch, dst_offset, dst_x, dst_y, w, h);
+
+ src_pitch *= cpp;
+ dst_pitch *= cpp;
+
+ /* Blit pitch must be dword-aligned. Otherwise, the hardware appears to drop
+ * the low bits.
+ */
+ assert(src_pitch % 4 == 0);
+ assert(dst_pitch % 4 == 0);
+
+ /* For big formats (such as floating point), do the copy using 32bpp and
+ * multiply the coordinates.
+ */
+ if (cpp > 4) {
+ assert(cpp % 4 == 0);
+ dst_x *= cpp / 4;
+ dst_x2 *= cpp / 4;
+ src_x *= cpp / 4;
+ cpp = 4;
+ }
+
+ BR13 = br13_for_cpp(cpp) | translate_raster_op(logic_op) << 16;
+
+ switch (cpp) {
+ case 1:
+ case 2:
+ CMD = XY_SRC_COPY_BLT_CMD;
+ break;
+ case 4:
+ CMD = XY_SRC_COPY_BLT_CMD | XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB;
+ break;
+ default:
+ return false;
+ }
+
+#ifndef I915
+ if (dst_tiling != I915_TILING_NONE) {
+ CMD |= XY_DST_TILED;
+ dst_pitch /= 4;
+ }
+ if (src_tiling != I915_TILING_NONE) {
+ CMD |= XY_SRC_TILED;
+ src_pitch /= 4;
+ }
+#endif
+
+ if (dst_y2 <= dst_y || dst_x2 <= dst_x) {
+ return true;
+ }
+
+ assert(dst_x < dst_x2);
+ assert(dst_y < dst_y2);
+
+ BEGIN_BATCH_BLT(8);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13 | (uint16_t)dst_pitch);
+ OUT_BATCH((dst_y << 16) | dst_x);
+ OUT_BATCH((dst_y2 << 16) | dst_x2);
+ OUT_RELOC_FENCED(dst_buffer,
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+ dst_offset);
+ OUT_BATCH((src_y << 16) | src_x);
+ OUT_BATCH((uint16_t)src_pitch);
+ OUT_RELOC_FENCED(src_buffer,
+ I915_GEM_DOMAIN_RENDER, 0,
+ src_offset);
+ ADVANCE_BATCH();
+
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ return true;
+}
+
+
+/**
+ * Use blitting to clear the renderbuffers named by 'flags'.
+ * Note: we can't use the ctx->DrawBuffer->_ColorDrawBufferIndexes field
+ * since that might include software renderbuffers or renderbuffers
+ * which we're clearing with triangles.
+ * \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear
+ */
+GLbitfield
+intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ GLuint clear_depth_value, clear_depth_mask;
+ GLint cx, cy, cw, ch;
+ GLbitfield fail_mask = 0;
+ BATCH_LOCALS;
+
+ /*
+ * Compute values for clearing the buffers.
+ */
+ clear_depth_value = 0;
+ clear_depth_mask = 0;
+ if (mask & BUFFER_BIT_DEPTH) {
+ clear_depth_value = (GLuint) (fb->_DepthMax * ctx->Depth.Clear);
+ clear_depth_mask = XY_BLT_WRITE_RGB;
+ }
+ if (mask & BUFFER_BIT_STENCIL) {
+ clear_depth_value |= (ctx->Stencil.Clear & 0xff) << 24;
+ clear_depth_mask |= XY_BLT_WRITE_ALPHA;
+ }
+
+ cx = fb->_Xmin;
+ if (_mesa_is_winsys_fbo(fb))
+ cy = ctx->DrawBuffer->Height - fb->_Ymax;
+ else
+ cy = fb->_Ymin;
+ cw = fb->_Xmax - fb->_Xmin;
+ ch = fb->_Ymax - fb->_Ymin;
+
+ if (cw == 0 || ch == 0)
+ return 0;
+
+ /* Loop over all renderbuffers */
+ mask &= (1 << BUFFER_COUNT) - 1;
+ while (mask) {
+ GLuint buf = ffs(mask) - 1;
+ bool is_depth_stencil = buf == BUFFER_DEPTH || buf == BUFFER_STENCIL;
+ struct intel_renderbuffer *irb;
+ int x1, y1, x2, y2;
+ uint32_t clear_val;
+ uint32_t BR13, CMD;
+ struct intel_region *region;
+ int pitch, cpp;
+ drm_intel_bo *aper_array[2];
+
+ mask &= ~(1 << buf);
+
+ irb = intel_get_renderbuffer(fb, buf);
+ if (irb && irb->mt) {
+ region = irb->mt->region;
+ assert(region);
+ assert(region->bo);
+ } else {
+ fail_mask |= 1 << buf;
+ continue;
+ }
+
+ /* OK, clear this renderbuffer */
+ x1 = cx + irb->draw_x;
+ y1 = cy + irb->draw_y;
+ x2 = cx + cw + irb->draw_x;
+ y2 = cy + ch + irb->draw_y;
+
+ pitch = region->pitch;
+ cpp = region->cpp;
+
+ DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n",
+ __FUNCTION__,
+ region->bo, (pitch * cpp),
+ x1, y1, x2 - x1, y2 - y1);
+
+ BR13 = 0xf0 << 16;
+ CMD = XY_COLOR_BLT_CMD;
+
+ /* Setup the blit command */
+ if (cpp == 4) {
+ if (is_depth_stencil) {
+ CMD |= clear_depth_mask;
+ } else {
+ /* clearing RGBA */
+ CMD |= XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB;
+ }
+ }
+
+ assert(region->tiling != I915_TILING_Y);
+
+#ifndef I915
+ if (region->tiling != I915_TILING_NONE) {
+ CMD |= XY_DST_TILED;
+ pitch /= 4;
+ }
+#endif
+ BR13 |= (pitch * cpp);
+
+ if (is_depth_stencil) {
+ clear_val = clear_depth_value;
+ } else {
+ uint8_t clear[4];
+ GLfloat *color = ctx->Color.ClearColor.f;
+
+ _mesa_unclamped_float_rgba_to_ubyte(clear, color);
+
+ switch (intel_rb_format(irb)) {
+ case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_XRGB8888:
+ clear_val = PACK_COLOR_8888(clear[3], clear[0],
+ clear[1], clear[2]);
+ break;
+ case MESA_FORMAT_RGB565:
+ clear_val = PACK_COLOR_565(clear[0], clear[1], clear[2]);
+ break;
+ case MESA_FORMAT_ARGB4444:
+ clear_val = PACK_COLOR_4444(clear[3], clear[0],
+ clear[1], clear[2]);
+ break;
+ case MESA_FORMAT_ARGB1555:
+ clear_val = PACK_COLOR_1555(clear[3], clear[0],
+ clear[1], clear[2]);
+ break;
+ case MESA_FORMAT_A8:
+ clear_val = PACK_COLOR_8888(clear[3], clear[3],
+ clear[3], clear[3]);
+ break;
+ default:
+ fail_mask |= 1 << buf;
+ continue;
+ }
+ }
+
+ BR13 |= br13_for_cpp(cpp);
+
+ assert(x1 < x2);
+ assert(y1 < y2);
+
+ /* do space check before going any further */
+ aper_array[0] = intel->batch.bo;
+ aper_array[1] = region->bo;
+
+ if (drm_intel_bufmgr_check_aperture_space(aper_array,
+ ARRAY_SIZE(aper_array)) != 0) {
+ intel_batchbuffer_flush(intel);
+ }
+
+ BEGIN_BATCH_BLT(6);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13);
+ OUT_BATCH((y1 << 16) | x1);
+ OUT_BATCH((y2 << 16) | x2);
+ OUT_RELOC_FENCED(region->bo,
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+ 0);
+ OUT_BATCH(clear_val);
+ ADVANCE_BATCH();
+
+ if (intel->always_flush_cache)
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL)
+ mask &= ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
+ }
+
+ return fail_mask;
+}
+
+bool
+intelEmitImmediateColorExpandBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLubyte *src_bits, GLuint src_size,
+ GLuint fg_color,
+ GLshort dst_pitch,
+ drm_intel_bo *dst_buffer,
+ GLuint dst_offset,
+ uint32_t dst_tiling,
+ GLshort x, GLshort y,
+ GLshort w, GLshort h,
+ GLenum logic_op)
+{
+ int dwords = ALIGN(src_size, 8) / 4;
+ uint32_t opcode, br13, blit_cmd;
+
+ if (dst_tiling != I915_TILING_NONE) {
+ if (dst_offset & 4095)
+ return false;
+ if (dst_tiling == I915_TILING_Y)
+ return false;
+ }
+
+ assert( logic_op - GL_CLEAR >= 0 );
+ assert( logic_op - GL_CLEAR < 0x10 );
+ assert(dst_pitch > 0);
+
+ if (w < 0 || h < 0)
+ return true;
+
+ dst_pitch *= cpp;
+
+ DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d, %d bytes %d dwords\n",
+ __FUNCTION__,
+ dst_buffer, dst_pitch, dst_offset, x, y, w, h, src_size, dwords);
+
+ intel_batchbuffer_require_space(intel,
+ (8 * 4) +
+ (3 * 4) +
+ dwords * 4, true);
+
+ opcode = XY_SETUP_BLT_CMD;
+ if (cpp == 4)
+ opcode |= XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB;
+#ifndef I915
+ if (dst_tiling != I915_TILING_NONE) {
+ opcode |= XY_DST_TILED;
+ dst_pitch /= 4;
+ }
+#endif
+
+ br13 = dst_pitch | (translate_raster_op(logic_op) << 16) | (1 << 29);
+ br13 |= br13_for_cpp(cpp);
+
+ blit_cmd = XY_TEXT_IMMEDIATE_BLIT_CMD | XY_TEXT_BYTE_PACKED; /* packing? */
+ if (dst_tiling != I915_TILING_NONE)
+ blit_cmd |= XY_DST_TILED;
+
+ BEGIN_BATCH_BLT(8 + 3);
+ OUT_BATCH(opcode);
+ OUT_BATCH(br13);
+ OUT_BATCH((0 << 16) | 0); /* clip x1, y1 */
+ OUT_BATCH((100 << 16) | 100); /* clip x2, y2 */
+ OUT_RELOC_FENCED(dst_buffer,
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+ dst_offset);
+ OUT_BATCH(0); /* bg */
+ OUT_BATCH(fg_color); /* fg */
+ OUT_BATCH(0); /* pattern base addr */
+
+ OUT_BATCH(blit_cmd | ((3 - 2) + dwords));
+ OUT_BATCH((y << 16) | x);
+ OUT_BATCH(((y + h) << 16) | (x + w));
+ ADVANCE_BATCH();
+
+ intel_batchbuffer_data(intel, src_bits, dwords * 4, true);
+
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ return true;
+}
+
+/* We don't have a memmove-type blit like some other hardware, so we'll do a
+ * rectangular blit covering a large space, then emit 1-scanline blit at the
+ * end to cover the last if we need.
+ */
+void
+intel_emit_linear_blit(struct intel_context *intel,
+ drm_intel_bo *dst_bo,
+ unsigned int dst_offset,
+ drm_intel_bo *src_bo,
+ unsigned int src_offset,
+ unsigned int size)
+{
+ GLuint pitch, height;
+ bool ok;
+
+ /* The pitch given to the GPU must be DWORD aligned, and
+ * we want width to match pitch. Max width is (1 << 15 - 1),
+ * rounding that down to the nearest DWORD is 1 << 15 - 4
+ */
+ pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);
+ height = (pitch == 0) ? 1 : size / pitch;
+ ok = intelEmitCopyBlit(intel, 1,
+ pitch, src_bo, src_offset, I915_TILING_NONE,
+ pitch, dst_bo, dst_offset, I915_TILING_NONE,
+ 0, 0, /* src x/y */
+ 0, 0, /* dst x/y */
+ pitch, height, /* w, h */
+ GL_COPY);
+ assert(ok);
+
+ src_offset += pitch * height;
+ dst_offset += pitch * height;
+ size -= pitch * height;
+ assert (size < (1 << 15));
+ pitch = ALIGN(size, 4);
+ if (size != 0) {
+ ok = intelEmitCopyBlit(intel, 1,
+ pitch, src_bo, src_offset, I915_TILING_NONE,
+ pitch, dst_bo, dst_offset, I915_TILING_NONE,
+ 0, 0, /* src x/y */
+ 0, 0, /* dst x/y */
+ size, 1, /* w, h */
+ GL_COPY);
+ assert(ok);
+ }
+}
+
+/**
+ * Used to initialize the alpha value of an ARGB8888 teximage after
+ * loading it from an XRGB8888 source.
+ *
+ * This is very common with glCopyTexImage2D().
+ */
+void
+intel_set_teximage_alpha_to_one(struct gl_context *ctx,
+ struct intel_texture_image *intel_image)
+{
+ struct intel_context *intel = intel_context(ctx);
+ unsigned int image_x, image_y;
+ uint32_t x1, y1, x2, y2;
+ uint32_t BR13, CMD;
+ int pitch, cpp;
+ drm_intel_bo *aper_array[2];
+ struct intel_region *region = intel_image->mt->region;
+ int width, height, depth;
+ BATCH_LOCALS;
+
+ intel_miptree_get_dimensions_for_image(&intel_image->base.Base,
+ &width, &height, &depth);
+ assert(depth == 1);
+
+ assert(intel_image->base.Base.TexFormat == MESA_FORMAT_ARGB8888);
+
+ /* get dest x/y in destination texture */
+ intel_miptree_get_image_offset(intel_image->mt,
+ intel_image->base.Base.Level,
+ intel_image->base.Base.Face,
+ 0,
+ &image_x, &image_y);
+
+ x1 = image_x;
+ y1 = image_y;
+ x2 = image_x + width;
+ y2 = image_y + height;
+
+ pitch = region->pitch;
+ cpp = region->cpp;
+
+ DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n",
+ __FUNCTION__,
+ intel_image->mt->region->bo, (pitch * cpp),
+ x1, y1, x2 - x1, y2 - y1);
+
+ BR13 = br13_for_cpp(cpp) | 0xf0 << 16;
+ CMD = XY_COLOR_BLT_CMD;
+ CMD |= XY_BLT_WRITE_ALPHA;
+
+ assert(region->tiling != I915_TILING_Y);
+
+#ifndef I915
+ if (region->tiling != I915_TILING_NONE) {
+ CMD |= XY_DST_TILED;
+ pitch /= 4;
+ }
+#endif
+ BR13 |= (pitch * cpp);
+
+ /* do space check before going any further */
+ aper_array[0] = intel->batch.bo;
+ aper_array[1] = region->bo;
+
+ if (drm_intel_bufmgr_check_aperture_space(aper_array,
+ ARRAY_SIZE(aper_array)) != 0) {
+ intel_batchbuffer_flush(intel);
+ }
+
+ BEGIN_BATCH_BLT(6);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13);
+ OUT_BATCH((y1 << 16) | x1);
+ OUT_BATCH((y2 << 16) | x2);
+ OUT_RELOC_FENCED(region->bo,
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+ 0);
+ OUT_BATCH(0xffffffff); /* white, but only alpha gets written */
+ ADVANCE_BATCH();
+
+ intel_batchbuffer_emit_mi_flush(intel);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffer_objects.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffer_objects.c
index e06dd3c8d3c..df8ac7fb301 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffer_objects.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffer_objects.c
@@ -1 +1,849 @@
-../intel/intel_buffer_objects.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/imports.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/bufferobj.h"
+
+#include "intel_blit.h"
+#include "intel_buffer_objects.h"
+#include "intel_batchbuffer.h"
+#include "intel_context.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+
+static GLboolean
+intel_bufferobj_unmap(struct gl_context * ctx, struct gl_buffer_object *obj);
+
+/** Allocates a new drm_intel_bo to store the data for the buffer object. */
+static void
+intel_bufferobj_alloc_buffer(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj)
+{
+ intel_obj->buffer = drm_intel_bo_alloc(intel->bufmgr, "bufferobj",
+ intel_obj->Base.Size, 64);
+}
+
+static void
+release_buffer(struct intel_buffer_object *intel_obj)
+{
+ drm_intel_bo_unreference(intel_obj->buffer);
+ intel_obj->buffer = NULL;
+ intel_obj->offset = 0;
+ intel_obj->source = 0;
+}
+
+/**
+ * There is some duplication between mesa's bufferobjects and our
+ * bufmgr buffers. Both have an integer handle and a hashtable to
+ * lookup an opaque structure. It would be nice if the handles and
+ * internal structure where somehow shared.
+ */
+static struct gl_buffer_object *
+intel_bufferobj_alloc(struct gl_context * ctx, GLuint name, GLenum target)
+{
+ struct intel_buffer_object *obj = CALLOC_STRUCT(intel_buffer_object);
+
+ _mesa_initialize_buffer_object(ctx, &obj->Base, name, target);
+
+ obj->buffer = NULL;
+
+ return &obj->Base;
+}
+
+/**
+ * Deallocate/free a vertex/pixel buffer object.
+ * Called via glDeleteBuffersARB().
+ */
+static void
+intel_bufferobj_free(struct gl_context * ctx, struct gl_buffer_object *obj)
+{
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+
+ /* Buffer objects are automatically unmapped when deleting according
+ * to the spec, but Mesa doesn't do UnmapBuffer for us at context destroy
+ * (though it does if you call glDeleteBuffers)
+ */
+ if (obj->Pointer)
+ intel_bufferobj_unmap(ctx, obj);
+
+ free(intel_obj->sys_buffer);
+
+ drm_intel_bo_unreference(intel_obj->buffer);
+ free(intel_obj);
+}
+
+
+
+/**
+ * Allocate space for and store data in a buffer object. Any data that was
+ * previously stored in the buffer object is lost. If data is NULL,
+ * memory will be allocated, but no copy will occur.
+ * Called via ctx->Driver.BufferData().
+ * \return true for success, false if out of memory
+ */
+static GLboolean
+intel_bufferobj_data(struct gl_context * ctx,
+ GLenum target,
+ GLsizeiptrARB size,
+ const GLvoid * data,
+ GLenum usage, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ /* Part of the ABI, but this function doesn't use it.
+ */
+#ifndef I915
+ (void) target;
+#endif
+
+ intel_obj->Base.Size = size;
+ intel_obj->Base.Usage = usage;
+
+ assert(!obj->Pointer); /* Mesa should have unmapped it */
+
+ if (intel_obj->buffer != NULL)
+ release_buffer(intel_obj);
+
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+
+ if (size != 0) {
+#ifdef I915
+ /* On pre-965, stick VBOs in system memory, as we're always doing
+ * swtnl with their contents anyway.
+ */
+ if (target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER) {
+ intel_obj->sys_buffer = malloc(size);
+ if (intel_obj->sys_buffer != NULL) {
+ if (data != NULL)
+ memcpy(intel_obj->sys_buffer, data, size);
+ return true;
+ }
+ }
+#endif
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ if (!intel_obj->buffer)
+ return false;
+
+ if (data != NULL)
+ drm_intel_bo_subdata(intel_obj->buffer, 0, size, data);
+ }
+
+ return true;
+}
+
+
+/**
+ * Replace data in a subrange of buffer object. If the data range
+ * specified by size + offset extends beyond the end of the buffer or
+ * if data is NULL, no copy is performed.
+ * Called via glBufferSubDataARB().
+ */
+static void
+intel_bufferobj_subdata(struct gl_context * ctx,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ const GLvoid * data, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+ bool busy;
+
+ if (size == 0)
+ return;
+
+ assert(intel_obj);
+
+ /* If we have a single copy in system memory, update that */
+ if (intel_obj->sys_buffer) {
+ if (intel_obj->source)
+ release_buffer(intel_obj);
+
+ if (intel_obj->buffer == NULL) {
+ memcpy((char *)intel_obj->sys_buffer + offset, data, size);
+ return;
+ }
+
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+ }
+
+ /* Otherwise we need to update the copy in video memory. */
+ busy =
+ drm_intel_bo_busy(intel_obj->buffer) ||
+ drm_intel_bo_references(intel->batch.bo, intel_obj->buffer);
+
+ if (busy) {
+ if (size == intel_obj->Base.Size) {
+ /* Replace the current busy bo with fresh data. */
+ drm_intel_bo_unreference(intel_obj->buffer);
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ drm_intel_bo_subdata(intel_obj->buffer, 0, size, data);
+ } else {
+ perf_debug("Using a blit copy to avoid stalling on glBufferSubData() "
+ "to a busy buffer object.\n");
+ drm_intel_bo *temp_bo =
+ drm_intel_bo_alloc(intel->bufmgr, "subdata temp", size, 64);
+
+ drm_intel_bo_subdata(temp_bo, 0, size, data);
+
+ intel_emit_linear_blit(intel,
+ intel_obj->buffer, offset,
+ temp_bo, 0,
+ size);
+
+ drm_intel_bo_unreference(temp_bo);
+ }
+ } else {
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ if (drm_intel_bo_busy(intel_obj->buffer)) {
+ perf_debug("Stalling on the GPU in glBufferSubData().\n");
+ }
+ }
+ drm_intel_bo_subdata(intel_obj->buffer, offset, size, data);
+ }
+}
+
+
+/**
+ * Called via glGetBufferSubDataARB().
+ */
+static void
+intel_bufferobj_get_subdata(struct gl_context * ctx,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ GLvoid * data, struct gl_buffer_object *obj)
+{
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+ struct intel_context *intel = intel_context(ctx);
+
+ assert(intel_obj);
+ if (intel_obj->sys_buffer)
+ memcpy(data, (char *)intel_obj->sys_buffer + offset, size);
+ else {
+ if (drm_intel_bo_references(intel->batch.bo, intel_obj->buffer)) {
+ intel_batchbuffer_flush(intel);
+ }
+ drm_intel_bo_get_subdata(intel_obj->buffer, offset, size, data);
+ }
+}
+
+
+
+/**
+ * Called via glMapBufferRange and glMapBuffer
+ *
+ * The goal of this extension is to allow apps to accumulate their rendering
+ * at the same time as they accumulate their buffer object. Without it,
+ * you'd end up blocking on execution of rendering every time you mapped
+ * the buffer to put new data in.
+ *
+ * We support it in 3 ways: If unsynchronized, then don't bother
+ * flushing the batchbuffer before mapping the buffer, which can save blocking
+ * in many cases. If we would still block, and they allow the whole buffer
+ * to be invalidated, then just allocate a new buffer to replace the old one.
+ * If not, and we'd block, and they allow the subrange of the buffer to be
+ * invalidated, then we can make a new little BO, let them write into that,
+ * and blit it into the real BO at unmap time.
+ */
+static void *
+intel_bufferobj_map_range(struct gl_context * ctx,
+ GLintptr offset, GLsizeiptr length,
+ GLbitfield access, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+
+ /* _mesa_MapBufferRange (GL entrypoint) sets these, but the vbo module also
+ * internally uses our functions directly.
+ */
+ obj->Offset = offset;
+ obj->Length = length;
+ obj->AccessFlags = access;
+
+ if (intel_obj->sys_buffer) {
+ const bool read_only =
+ (access & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) == GL_MAP_READ_BIT;
+
+ if (!read_only && intel_obj->source)
+ release_buffer(intel_obj);
+
+ if (!intel_obj->buffer || intel_obj->source) {
+ obj->Pointer = intel_obj->sys_buffer + offset;
+ return obj->Pointer;
+ }
+
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+ }
+
+ if (intel_obj->buffer == NULL) {
+ obj->Pointer = NULL;
+ return NULL;
+ }
+
+ /* If the access is synchronized (like a normal buffer mapping), then get
+ * things flushed out so the later mapping syncs appropriately through GEM.
+ * If the user doesn't care about existing buffer contents and mapping would
+ * cause us to block, then throw out the old buffer.
+ *
+ * If they set INVALIDATE_BUFFER, we can pitch the current contents to
+ * achieve the required synchronization.
+ */
+ if (!(access & GL_MAP_UNSYNCHRONIZED_BIT)) {
+ if (drm_intel_bo_references(intel->batch.bo, intel_obj->buffer)) {
+ if (access & GL_MAP_INVALIDATE_BUFFER_BIT) {
+ drm_intel_bo_unreference(intel_obj->buffer);
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ } else {
+ intel_flush(ctx);
+ }
+ } else if (drm_intel_bo_busy(intel_obj->buffer) &&
+ (access & GL_MAP_INVALIDATE_BUFFER_BIT)) {
+ drm_intel_bo_unreference(intel_obj->buffer);
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ }
+ }
+
+ /* If the user is mapping a range of an active buffer object but
+ * doesn't require the current contents of that range, make a new
+ * BO, and we'll copy what they put in there out at unmap or
+ * FlushRange time.
+ */
+ if ((access & GL_MAP_INVALIDATE_RANGE_BIT) &&
+ drm_intel_bo_busy(intel_obj->buffer)) {
+ if (access & GL_MAP_FLUSH_EXPLICIT_BIT) {
+ intel_obj->range_map_buffer = malloc(length);
+ obj->Pointer = intel_obj->range_map_buffer;
+ } else {
+ intel_obj->range_map_bo = drm_intel_bo_alloc(intel->bufmgr,
+ "range map",
+ length, 64);
+ if (!(access & GL_MAP_READ_BIT)) {
+ drm_intel_gem_bo_map_gtt(intel_obj->range_map_bo);
+ } else {
+ drm_intel_bo_map(intel_obj->range_map_bo,
+ (access & GL_MAP_WRITE_BIT) != 0);
+ }
+ obj->Pointer = intel_obj->range_map_bo->virtual;
+ }
+ return obj->Pointer;
+ }
+
+ if (access & GL_MAP_UNSYNCHRONIZED_BIT)
+ drm_intel_gem_bo_map_unsynchronized(intel_obj->buffer);
+ else if (!(access & GL_MAP_READ_BIT)) {
+ drm_intel_gem_bo_map_gtt(intel_obj->buffer);
+ } else {
+ drm_intel_bo_map(intel_obj->buffer, (access & GL_MAP_WRITE_BIT) != 0);
+ }
+
+ obj->Pointer = intel_obj->buffer->virtual + offset;
+ return obj->Pointer;
+}
+
+/* Ideally we'd use a BO to avoid taking up cache space for the temporary
+ * data, but FlushMappedBufferRange may be followed by further writes to
+ * the pointer, so we would have to re-map after emitting our blit, which
+ * would defeat the point.
+ */
+static void
+intel_bufferobj_flush_mapped_range(struct gl_context *ctx,
+ GLintptr offset, GLsizeiptr length,
+ struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+ drm_intel_bo *temp_bo;
+
+ /* Unless we're in the range map using a temporary system buffer,
+ * there's no work to do.
+ */
+ if (intel_obj->range_map_buffer == NULL)
+ return;
+
+ if (length == 0)
+ return;
+
+ temp_bo = drm_intel_bo_alloc(intel->bufmgr, "range map flush", length, 64);
+
+ drm_intel_bo_subdata(temp_bo, 0, length, intel_obj->range_map_buffer);
+
+ intel_emit_linear_blit(intel,
+ intel_obj->buffer, obj->Offset + offset,
+ temp_bo, 0,
+ length);
+
+ drm_intel_bo_unreference(temp_bo);
+}
+
+
+/**
+ * Called via glUnmapBuffer().
+ */
+static GLboolean
+intel_bufferobj_unmap(struct gl_context * ctx, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+ assert(obj->Pointer);
+ if (intel_obj->sys_buffer != NULL) {
+ /* always keep the mapping around. */
+ } else if (intel_obj->range_map_buffer != NULL) {
+ /* Since we've emitted some blits to buffers that will (likely) be used
+ * in rendering operations in other cache domains in this batch, emit a
+ * flush. Once again, we wish for a domain tracker in libdrm to cover
+ * usage inside of a batchbuffer.
+ */
+ intel_batchbuffer_emit_mi_flush(intel);
+ free(intel_obj->range_map_buffer);
+ intel_obj->range_map_buffer = NULL;
+ } else if (intel_obj->range_map_bo != NULL) {
+ drm_intel_bo_unmap(intel_obj->range_map_bo);
+
+ intel_emit_linear_blit(intel,
+ intel_obj->buffer, obj->Offset,
+ intel_obj->range_map_bo, 0,
+ obj->Length);
+
+ /* Since we've emitted some blits to buffers that will (likely) be used
+ * in rendering operations in other cache domains in this batch, emit a
+ * flush. Once again, we wish for a domain tracker in libdrm to cover
+ * usage inside of a batchbuffer.
+ */
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ drm_intel_bo_unreference(intel_obj->range_map_bo);
+ intel_obj->range_map_bo = NULL;
+ } else if (intel_obj->buffer != NULL) {
+ drm_intel_bo_unmap(intel_obj->buffer);
+ }
+ obj->Pointer = NULL;
+ obj->Offset = 0;
+ obj->Length = 0;
+
+ return true;
+}
+
+drm_intel_bo *
+intel_bufferobj_buffer(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj,
+ GLuint flag)
+{
+ if (intel_obj->source)
+ release_buffer(intel_obj);
+
+ if (intel_obj->buffer == NULL) {
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ drm_intel_bo_subdata(intel_obj->buffer,
+ 0, intel_obj->Base.Size,
+ intel_obj->sys_buffer);
+
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+ intel_obj->offset = 0;
+ }
+
+ return intel_obj->buffer;
+}
+
+#define INTEL_UPLOAD_SIZE (64*1024)
+
+void
+intel_upload_finish(struct intel_context *intel)
+{
+ if (!intel->upload.bo)
+ return;
+
+ if (intel->upload.buffer_len) {
+ drm_intel_bo_subdata(intel->upload.bo,
+ intel->upload.buffer_offset,
+ intel->upload.buffer_len,
+ intel->upload.buffer);
+ intel->upload.buffer_len = 0;
+ }
+
+ drm_intel_bo_unreference(intel->upload.bo);
+ intel->upload.bo = NULL;
+}
+
+static void wrap_buffers(struct intel_context *intel, GLuint size)
+{
+ intel_upload_finish(intel);
+
+ if (size < INTEL_UPLOAD_SIZE)
+ size = INTEL_UPLOAD_SIZE;
+
+ intel->upload.bo = drm_intel_bo_alloc(intel->bufmgr, "upload", size, 0);
+ intel->upload.offset = 0;
+}
+
+void intel_upload_data(struct intel_context *intel,
+ const void *ptr, GLuint size, GLuint align,
+ drm_intel_bo **return_bo,
+ GLuint *return_offset)
+{
+ GLuint base, delta;
+
+ base = (intel->upload.offset + align - 1) / align * align;
+ if (intel->upload.bo == NULL || base + size > intel->upload.bo->size) {
+ wrap_buffers(intel, size);
+ base = 0;
+ }
+
+ drm_intel_bo_reference(intel->upload.bo);
+ *return_bo = intel->upload.bo;
+ *return_offset = base;
+
+ delta = base - intel->upload.offset;
+ if (intel->upload.buffer_len &&
+ intel->upload.buffer_len + delta + size > sizeof(intel->upload.buffer))
+ {
+ drm_intel_bo_subdata(intel->upload.bo,
+ intel->upload.buffer_offset,
+ intel->upload.buffer_len,
+ intel->upload.buffer);
+ intel->upload.buffer_len = 0;
+ }
+
+ if (size < sizeof(intel->upload.buffer))
+ {
+ if (intel->upload.buffer_len == 0)
+ intel->upload.buffer_offset = base;
+ else
+ intel->upload.buffer_len += delta;
+
+ memcpy(intel->upload.buffer + intel->upload.buffer_len, ptr, size);
+ intel->upload.buffer_len += size;
+ }
+ else
+ {
+ drm_intel_bo_subdata(intel->upload.bo, base, size, ptr);
+ }
+
+ intel->upload.offset = base + size;
+}
+
+void *intel_upload_map(struct intel_context *intel, GLuint size, GLuint align)
+{
+ GLuint base, delta;
+ char *ptr;
+
+ base = (intel->upload.offset + align - 1) / align * align;
+ if (intel->upload.bo == NULL || base + size > intel->upload.bo->size) {
+ wrap_buffers(intel, size);
+ base = 0;
+ }
+
+ delta = base - intel->upload.offset;
+ if (intel->upload.buffer_len &&
+ intel->upload.buffer_len + delta + size > sizeof(intel->upload.buffer))
+ {
+ drm_intel_bo_subdata(intel->upload.bo,
+ intel->upload.buffer_offset,
+ intel->upload.buffer_len,
+ intel->upload.buffer);
+ intel->upload.buffer_len = 0;
+ }
+
+ if (size <= sizeof(intel->upload.buffer)) {
+ if (intel->upload.buffer_len == 0)
+ intel->upload.buffer_offset = base;
+ else
+ intel->upload.buffer_len += delta;
+
+ ptr = intel->upload.buffer + intel->upload.buffer_len;
+ intel->upload.buffer_len += size;
+ } else
+ ptr = malloc(size);
+
+ return ptr;
+}
+
+void intel_upload_unmap(struct intel_context *intel,
+ const void *ptr, GLuint size, GLuint align,
+ drm_intel_bo **return_bo,
+ GLuint *return_offset)
+{
+ GLuint base;
+
+ base = (intel->upload.offset + align - 1) / align * align;
+ if (size > sizeof(intel->upload.buffer)) {
+ drm_intel_bo_subdata(intel->upload.bo, base, size, ptr);
+ free((void*)ptr);
+ }
+
+ drm_intel_bo_reference(intel->upload.bo);
+ *return_bo = intel->upload.bo;
+ *return_offset = base;
+
+ intel->upload.offset = base + size;
+}
+
+drm_intel_bo *
+intel_bufferobj_source(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj,
+ GLuint align, GLuint *offset)
+{
+ if (intel_obj->buffer == NULL) {
+ intel_upload_data(intel,
+ intel_obj->sys_buffer, intel_obj->Base.Size, align,
+ &intel_obj->buffer, &intel_obj->offset);
+ intel_obj->source = 1;
+ }
+
+ *offset = intel_obj->offset;
+ return intel_obj->buffer;
+}
+
+static void
+intel_bufferobj_copy_subdata(struct gl_context *ctx,
+ struct gl_buffer_object *src,
+ struct gl_buffer_object *dst,
+ GLintptr read_offset, GLintptr write_offset,
+ GLsizeiptr size)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_src = intel_buffer_object(src);
+ struct intel_buffer_object *intel_dst = intel_buffer_object(dst);
+ drm_intel_bo *src_bo, *dst_bo;
+ GLuint src_offset;
+
+ if (size == 0)
+ return;
+
+ /* If we're in system memory, just map and memcpy. */
+ if (intel_src->sys_buffer || intel_dst->sys_buffer) {
+ /* The same buffer may be used, but note that regions copied may
+ * not overlap.
+ */
+ if (src == dst) {
+ char *ptr = intel_bufferobj_map_range(ctx, 0, dst->Size,
+ GL_MAP_READ_BIT |
+ GL_MAP_WRITE_BIT,
+ dst);
+ memmove(ptr + write_offset, ptr + read_offset, size);
+ intel_bufferobj_unmap(ctx, dst);
+ } else {
+ const char *src_ptr;
+ char *dst_ptr;
+
+ src_ptr = intel_bufferobj_map_range(ctx, 0, src->Size,
+ GL_MAP_READ_BIT, src);
+ dst_ptr = intel_bufferobj_map_range(ctx, 0, dst->Size,
+ GL_MAP_WRITE_BIT, dst);
+
+ memcpy(dst_ptr + write_offset, src_ptr + read_offset, size);
+
+ intel_bufferobj_unmap(ctx, src);
+ intel_bufferobj_unmap(ctx, dst);
+ }
+ return;
+ }
+
+ /* Otherwise, we have real BOs, so blit them. */
+
+ dst_bo = intel_bufferobj_buffer(intel, intel_dst, INTEL_WRITE_PART);
+ src_bo = intel_bufferobj_source(intel, intel_src, 64, &src_offset);
+
+ intel_emit_linear_blit(intel,
+ dst_bo, write_offset,
+ src_bo, read_offset + src_offset, size);
+
+ /* Since we've emitted some blits to buffers that will (likely) be used
+ * in rendering operations in other cache domains in this batch, emit a
+ * flush. Once again, we wish for a domain tracker in libdrm to cover
+ * usage inside of a batchbuffer.
+ */
+ intel_batchbuffer_emit_mi_flush(intel);
+}
+
+#if FEATURE_APPLE_object_purgeable
+static GLenum
+intel_buffer_purgeable(drm_intel_bo *buffer)
+{
+ int retained = 0;
+
+ if (buffer != NULL)
+ retained = drm_intel_bo_madvise (buffer, I915_MADV_DONTNEED);
+
+ return retained ? GL_VOLATILE_APPLE : GL_RELEASED_APPLE;
+}
+
+static GLenum
+intel_buffer_object_purgeable(struct gl_context * ctx,
+ struct gl_buffer_object *obj,
+ GLenum option)
+{
+ struct intel_buffer_object *intel_obj = intel_buffer_object (obj);
+
+ if (intel_obj->buffer != NULL)
+ return intel_buffer_purgeable(intel_obj->buffer);
+
+ if (option == GL_RELEASED_APPLE) {
+ if (intel_obj->sys_buffer != NULL) {
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+ }
+
+ return GL_RELEASED_APPLE;
+ } else {
+ /* XXX Create the buffer and madvise(MADV_DONTNEED)? */
+ struct intel_context *intel = intel_context(ctx);
+ drm_intel_bo *bo = intel_bufferobj_buffer(intel, intel_obj, INTEL_READ);
+
+ return intel_buffer_purgeable(bo);
+ }
+}
+
+static GLenum
+intel_texture_object_purgeable(struct gl_context * ctx,
+ struct gl_texture_object *obj,
+ GLenum option)
+{
+ struct intel_texture_object *intel;
+
+ (void) ctx;
+ (void) option;
+
+ intel = intel_texture_object(obj);
+ if (intel->mt == NULL || intel->mt->region == NULL)
+ return GL_RELEASED_APPLE;
+
+ return intel_buffer_purgeable(intel->mt->region->bo);
+}
+
+static GLenum
+intel_render_object_purgeable(struct gl_context * ctx,
+ struct gl_renderbuffer *obj,
+ GLenum option)
+{
+ struct intel_renderbuffer *intel;
+
+ (void) ctx;
+ (void) option;
+
+ intel = intel_renderbuffer(obj);
+ if (intel->mt == NULL)
+ return GL_RELEASED_APPLE;
+
+ return intel_buffer_purgeable(intel->mt->region->bo);
+}
+
+static GLenum
+intel_buffer_unpurgeable(drm_intel_bo *buffer)
+{
+ int retained;
+
+ retained = 0;
+ if (buffer != NULL)
+ retained = drm_intel_bo_madvise (buffer, I915_MADV_WILLNEED);
+
+ return retained ? GL_RETAINED_APPLE : GL_UNDEFINED_APPLE;
+}
+
+static GLenum
+intel_buffer_object_unpurgeable(struct gl_context * ctx,
+ struct gl_buffer_object *obj,
+ GLenum option)
+{
+ (void) ctx;
+ (void) option;
+
+ return intel_buffer_unpurgeable(intel_buffer_object (obj)->buffer);
+}
+
+static GLenum
+intel_texture_object_unpurgeable(struct gl_context * ctx,
+ struct gl_texture_object *obj,
+ GLenum option)
+{
+ struct intel_texture_object *intel;
+
+ (void) ctx;
+ (void) option;
+
+ intel = intel_texture_object(obj);
+ if (intel->mt == NULL || intel->mt->region == NULL)
+ return GL_UNDEFINED_APPLE;
+
+ return intel_buffer_unpurgeable(intel->mt->region->bo);
+}
+
+static GLenum
+intel_render_object_unpurgeable(struct gl_context * ctx,
+ struct gl_renderbuffer *obj,
+ GLenum option)
+{
+ struct intel_renderbuffer *intel;
+
+ (void) ctx;
+ (void) option;
+
+ intel = intel_renderbuffer(obj);
+ if (intel->mt == NULL)
+ return GL_UNDEFINED_APPLE;
+
+ return intel_buffer_unpurgeable(intel->mt->region->bo);
+}
+#endif
+
+void
+intelInitBufferObjectFuncs(struct dd_function_table *functions)
+{
+ functions->NewBufferObject = intel_bufferobj_alloc;
+ functions->DeleteBuffer = intel_bufferobj_free;
+ functions->BufferData = intel_bufferobj_data;
+ functions->BufferSubData = intel_bufferobj_subdata;
+ functions->GetBufferSubData = intel_bufferobj_get_subdata;
+ functions->MapBufferRange = intel_bufferobj_map_range;
+ functions->FlushMappedBufferRange = intel_bufferobj_flush_mapped_range;
+ functions->UnmapBuffer = intel_bufferobj_unmap;
+ functions->CopyBufferSubData = intel_bufferobj_copy_subdata;
+
+#if FEATURE_APPLE_object_purgeable
+ functions->BufferObjectPurgeable = intel_buffer_object_purgeable;
+ functions->TextureObjectPurgeable = intel_texture_object_purgeable;
+ functions->RenderObjectPurgeable = intel_render_object_purgeable;
+
+ functions->BufferObjectUnpurgeable = intel_buffer_object_unpurgeable;
+ functions->TextureObjectUnpurgeable = intel_texture_object_unpurgeable;
+ functions->RenderObjectUnpurgeable = intel_render_object_unpurgeable;
+#endif
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffers.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffers.c
index c86daa49f47..9a9a259c9e5 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffers.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_buffers.c
@@ -1 +1,132 @@
-../intel/intel_buffers.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "intel_context.h"
+#include "intel_buffers.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+
+/**
+ * Return pointer to current color drawing region, or NULL.
+ */
+struct intel_region *
+intel_drawbuf_region(struct intel_context *intel)
+{
+ struct intel_renderbuffer *irbColor =
+ intel_renderbuffer(intel->ctx.DrawBuffer->_ColorDrawBuffers[0]);
+ if (irbColor && irbColor->mt)
+ return irbColor->mt->region;
+ else
+ return NULL;
+}
+
+/**
+ * Return pointer to current color reading region, or NULL.
+ */
+struct intel_region *
+intel_readbuf_region(struct intel_context *intel)
+{
+ struct intel_renderbuffer *irb
+ = intel_renderbuffer(intel->ctx.ReadBuffer->_ColorReadBuffer);
+ if (irb && irb->mt)
+ return irb->mt->region;
+ else
+ return NULL;
+}
+
+/**
+ * Check if we're about to draw into the front color buffer.
+ * If so, set the intel->front_buffer_dirty field to true.
+ */
+void
+intel_check_front_buffer_rendering(struct intel_context *intel)
+{
+ const struct gl_framebuffer *fb = intel->ctx.DrawBuffer;
+ if (_mesa_is_winsys_fbo(fb)) {
+ /* drawing to window system buffer */
+ if (fb->_NumColorDrawBuffers > 0) {
+ if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
+ intel->front_buffer_dirty = true;
+ }
+ }
+ }
+}
+
+static void
+intelDrawBuffer(struct gl_context * ctx, GLenum mode)
+{
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ struct intel_context *const intel = intel_context(ctx);
+ const bool was_front_buffer_rendering =
+ intel->is_front_buffer_rendering;
+
+ intel->is_front_buffer_rendering = (mode == GL_FRONT_LEFT)
+ || (mode == GL_FRONT) || (mode == GL_FRONT_AND_BACK);
+
+ /* If we weren't front-buffer rendering before but we are now,
+ * invalidate our DRI drawable so we'll ask for new buffers
+ * (including the fake front) before we start rendering again.
+ */
+ if (!was_front_buffer_rendering && intel->is_front_buffer_rendering)
+ dri2InvalidateDrawable(intel->driContext->driDrawablePriv);
+ }
+
+ intel_draw_buffer(ctx);
+}
+
+
+static void
+intelReadBuffer(struct gl_context * ctx, GLenum mode)
+{
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ struct intel_context *const intel = intel_context(ctx);
+ const bool was_front_buffer_reading =
+ intel->is_front_buffer_reading;
+
+ intel->is_front_buffer_reading = (mode == GL_FRONT_LEFT)
+ || (mode == GL_FRONT);
+
+ /* If we weren't front-buffer reading before but we are now,
+ * invalidate our DRI drawable so we'll ask for new buffers
+ * (including the fake front) before we start reading again.
+ */
+ if (!was_front_buffer_reading && intel->is_front_buffer_reading)
+ dri2InvalidateDrawable(intel->driContext->driReadablePriv);
+ }
+}
+
+
+void
+intelInitBufferFuncs(struct dd_function_table *functions)
+{
+ functions->DrawBuffer = intelDrawBuffer;
+ functions->ReadBuffer = intelReadBuffer;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_context.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_context.c
index 27a1cbb255e..25334da33f7 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_context.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_context.c
@@ -1 +1,1030 @@
-../intel/intel_context.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/imports.h"
+#include "main/points.h"
+#include "main/renderbuffer.h"
+
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "tnl/tnl.h"
+#include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
+
+#include "intel_chipset.h"
+#include "intel_buffers.h"
+#include "intel_tex.h"
+#include "intel_batchbuffer.h"
+#include "intel_clear.h"
+#include "intel_extensions.h"
+#include "intel_pixel.h"
+#include "intel_regions.h"
+#include "intel_buffer_objects.h"
+#include "intel_fbo.h"
+#include "intel_bufmgr.h"
+#include "intel_screen.h"
+#include "intel_mipmap_tree.h"
+
+#include "utils.h"
+#include "../glsl/ralloc.h"
+
+#ifndef INTEL_DEBUG
+int INTEL_DEBUG = (0);
+#endif
+
+
+static const GLubyte *
+intelGetString(struct gl_context * ctx, GLenum name)
+{
+ const struct intel_context *const intel = intel_context(ctx);
+ const char *chipset;
+ static char buffer[128];
+
+ switch (name) {
+ case GL_VENDOR:
+ return (GLubyte *) "Intel Open Source Technology Center";
+ break;
+
+ case GL_RENDERER:
+ switch (intel->intelScreen->deviceID) {
+ case PCI_CHIP_845_G:
+ chipset = "Intel(R) 845G";
+ break;
+ case PCI_CHIP_I830_M:
+ chipset = "Intel(R) 830M";
+ break;
+ case PCI_CHIP_I855_GM:
+ chipset = "Intel(R) 852GM/855GM";
+ break;
+ case PCI_CHIP_I865_G:
+ chipset = "Intel(R) 865G";
+ break;
+ case PCI_CHIP_I915_G:
+ chipset = "Intel(R) 915G";
+ break;
+ case PCI_CHIP_E7221_G:
+ chipset = "Intel (R) E7221G (i915)";
+ break;
+ case PCI_CHIP_I915_GM:
+ chipset = "Intel(R) 915GM";
+ break;
+ case PCI_CHIP_I945_G:
+ chipset = "Intel(R) 945G";
+ break;
+ case PCI_CHIP_I945_GM:
+ chipset = "Intel(R) 945GM";
+ break;
+ case PCI_CHIP_I945_GME:
+ chipset = "Intel(R) 945GME";
+ break;
+ case PCI_CHIP_G33_G:
+ chipset = "Intel(R) G33";
+ break;
+ case PCI_CHIP_Q35_G:
+ chipset = "Intel(R) Q35";
+ break;
+ case PCI_CHIP_Q33_G:
+ chipset = "Intel(R) Q33";
+ break;
+ case PCI_CHIP_IGD_GM:
+ case PCI_CHIP_IGD_G:
+ chipset = "Intel(R) IGD";
+ break;
+ case PCI_CHIP_I965_Q:
+ chipset = "Intel(R) 965Q";
+ break;
+ case PCI_CHIP_I965_G:
+ case PCI_CHIP_I965_G_1:
+ chipset = "Intel(R) 965G";
+ break;
+ case PCI_CHIP_I946_GZ:
+ chipset = "Intel(R) 946GZ";
+ break;
+ case PCI_CHIP_I965_GM:
+ chipset = "Intel(R) 965GM";
+ break;
+ case PCI_CHIP_I965_GME:
+ chipset = "Intel(R) 965GME/GLE";
+ break;
+ case PCI_CHIP_GM45_GM:
+ chipset = "Mobile Intel® GM45 Express Chipset";
+ break;
+ case PCI_CHIP_IGD_E_G:
+ chipset = "Intel(R) Integrated Graphics Device";
+ break;
+ case PCI_CHIP_G45_G:
+ chipset = "Intel(R) G45/G43";
+ break;
+ case PCI_CHIP_Q45_G:
+ chipset = "Intel(R) Q45/Q43";
+ break;
+ case PCI_CHIP_G41_G:
+ chipset = "Intel(R) G41";
+ break;
+ case PCI_CHIP_B43_G:
+ case PCI_CHIP_B43_G1:
+ chipset = "Intel(R) B43";
+ break;
+ case PCI_CHIP_ILD_G:
+ chipset = "Intel(R) Ironlake Desktop";
+ break;
+ case PCI_CHIP_ILM_G:
+ chipset = "Intel(R) Ironlake Mobile";
+ break;
+ case PCI_CHIP_SANDYBRIDGE_GT1:
+ case PCI_CHIP_SANDYBRIDGE_GT2:
+ case PCI_CHIP_SANDYBRIDGE_GT2_PLUS:
+ chipset = "Intel(R) Sandybridge Desktop";
+ break;
+ case PCI_CHIP_SANDYBRIDGE_M_GT1:
+ case PCI_CHIP_SANDYBRIDGE_M_GT2:
+ case PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS:
+ chipset = "Intel(R) Sandybridge Mobile";
+ break;
+ case PCI_CHIP_SANDYBRIDGE_S:
+ chipset = "Intel(R) Sandybridge Server";
+ break;
+ case PCI_CHIP_IVYBRIDGE_GT1:
+ case PCI_CHIP_IVYBRIDGE_GT2:
+ chipset = "Intel(R) Ivybridge Desktop";
+ break;
+ case PCI_CHIP_IVYBRIDGE_M_GT1:
+ case PCI_CHIP_IVYBRIDGE_M_GT2:
+ chipset = "Intel(R) Ivybridge Mobile";
+ break;
+ case PCI_CHIP_IVYBRIDGE_S_GT1:
+ case PCI_CHIP_IVYBRIDGE_S_GT2:
+ chipset = "Intel(R) Ivybridge Server";
+ break;
+ case PCI_CHIP_HASWELL_GT1:
+ case PCI_CHIP_HASWELL_GT2:
+ case PCI_CHIP_HASWELL_GT2_PLUS:
+ case PCI_CHIP_HASWELL_SDV_GT1:
+ case PCI_CHIP_HASWELL_SDV_GT2:
+ case PCI_CHIP_HASWELL_SDV_GT2_PLUS:
+ case PCI_CHIP_HASWELL_ULT_GT1:
+ case PCI_CHIP_HASWELL_ULT_GT2:
+ case PCI_CHIP_HASWELL_ULT_GT2_PLUS:
+ case PCI_CHIP_HASWELL_CRW_GT1:
+ case PCI_CHIP_HASWELL_CRW_GT2:
+ case PCI_CHIP_HASWELL_CRW_GT2_PLUS:
+ chipset = "Intel(R) Haswell Desktop";
+ break;
+ case PCI_CHIP_HASWELL_M_GT1:
+ case PCI_CHIP_HASWELL_M_GT2:
+ case PCI_CHIP_HASWELL_M_GT2_PLUS:
+ case PCI_CHIP_HASWELL_SDV_M_GT1:
+ case PCI_CHIP_HASWELL_SDV_M_GT2:
+ case PCI_CHIP_HASWELL_SDV_M_GT2_PLUS:
+ case PCI_CHIP_HASWELL_ULT_M_GT1:
+ case PCI_CHIP_HASWELL_ULT_M_GT2:
+ case PCI_CHIP_HASWELL_ULT_M_GT2_PLUS:
+ case PCI_CHIP_HASWELL_CRW_M_GT1:
+ case PCI_CHIP_HASWELL_CRW_M_GT2:
+ case PCI_CHIP_HASWELL_CRW_M_GT2_PLUS:
+ chipset = "Intel(R) Haswell Mobile";
+ break;
+ case PCI_CHIP_HASWELL_S_GT1:
+ case PCI_CHIP_HASWELL_S_GT2:
+ case PCI_CHIP_HASWELL_S_GT2_PLUS:
+ case PCI_CHIP_HASWELL_SDV_S_GT1:
+ case PCI_CHIP_HASWELL_SDV_S_GT2:
+ case PCI_CHIP_HASWELL_SDV_S_GT2_PLUS:
+ case PCI_CHIP_HASWELL_ULT_S_GT1:
+ case PCI_CHIP_HASWELL_ULT_S_GT2:
+ case PCI_CHIP_HASWELL_ULT_S_GT2_PLUS:
+ case PCI_CHIP_HASWELL_CRW_S_GT1:
+ case PCI_CHIP_HASWELL_CRW_S_GT2:
+ case PCI_CHIP_HASWELL_CRW_S_GT2_PLUS:
+ chipset = "Intel(R) Haswell Server";
+ break;
+ default:
+ chipset = "Unknown Intel Chipset";
+ break;
+ }
+
+ (void) driGetRendererString(buffer, chipset, 0);
+ return (GLubyte *) buffer;
+
+ default:
+ return NULL;
+ }
+}
+
+void
+intel_downsample_for_dri2_flush(struct intel_context *intel,
+ __DRIdrawable *drawable)
+{
+ if (intel->gen < 6) {
+ /* MSAA is not supported, so don't waste time checking for
+ * a multisample buffer.
+ */
+ return;
+ }
+
+ struct gl_framebuffer *fb = drawable->driverPrivate;
+ struct intel_renderbuffer *rb;
+
+ /* Usually, only the back buffer will need to be downsampled. However,
+ * the front buffer will also need it if the user has rendered into it.
+ */
+ static const gl_buffer_index buffers[2] = {
+ BUFFER_BACK_LEFT,
+ BUFFER_FRONT_LEFT,
+ };
+
+ for (int i = 0; i < 2; ++i) {
+ rb = intel_get_renderbuffer(fb, buffers[i]);
+ if (rb == NULL || rb->mt == NULL)
+ continue;
+ intel_miptree_downsample(intel, rb->mt);
+ }
+}
+
+static void
+intel_flush_front(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ __DRIcontext *driContext = intel->driContext;
+ __DRIdrawable *driDrawable = driContext->driDrawablePriv;
+ __DRIscreen *const screen = intel->intelScreen->driScrnPriv;
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && intel->front_buffer_dirty) {
+ if (screen->dri2.loader->flushFrontBuffer != NULL &&
+ driDrawable &&
+ driDrawable->loaderPrivate) {
+
+ /* Downsample before flushing FAKE_FRONT_LEFT to FRONT_LEFT.
+ *
+ * This potentially downsamples both front and back buffer. It
+ * is unnecessary to downsample the back, but harms nothing except
+ * performance. And no one cares about front-buffer render
+ * performance.
+ */
+ intel_downsample_for_dri2_flush(intel, driDrawable);
+
+ screen->dri2.loader->flushFrontBuffer(driDrawable,
+ driDrawable->loaderPrivate);
+
+ /* We set the dirty bit in intel_prepare_render() if we're
+ * front buffer rendering once we get there.
+ */
+ intel->front_buffer_dirty = false;
+ }
+ }
+}
+
+static unsigned
+intel_bits_per_pixel(const struct intel_renderbuffer *rb)
+{
+ return _mesa_get_format_bytes(intel_rb_format(rb)) * 8;
+}
+
+static void
+intel_query_dri2_buffers(struct intel_context *intel,
+ __DRIdrawable *drawable,
+ __DRIbuffer **buffers,
+ int *count);
+
+static void
+intel_process_dri2_buffer(struct intel_context *intel,
+ __DRIdrawable *drawable,
+ __DRIbuffer *buffer,
+ struct intel_renderbuffer *rb,
+ const char *buffer_name);
+
+void
+intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
+{
+ struct gl_framebuffer *fb = drawable->driverPrivate;
+ struct intel_renderbuffer *rb;
+ struct intel_context *intel = context->driverPrivate;
+ __DRIbuffer *buffers = NULL;
+ int i, count;
+ const char *region_name;
+
+ /* If we're rendering to the fake front buffer, make sure all the
+ * pending drawing has landed on the real front buffer. Otherwise
+ * when we eventually get to DRI2GetBuffersWithFormat the stale
+ * real front buffer contents will get copied to the new fake front
+ * buffer.
+ */
+ if (intel->is_front_buffer_rendering) {
+ intel_flush(&intel->ctx);
+ intel_flush_front(&intel->ctx);
+ }
+
+ /* Set this up front, so that in case our buffers get invalidated
+ * while we're getting new buffers, we don't clobber the stamp and
+ * thus ignore the invalidate. */
+ drawable->lastStamp = drawable->dri2.stamp;
+
+ if (unlikely(INTEL_DEBUG & DEBUG_DRI))
+ fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
+
+ intel_query_dri2_buffers(intel, drawable, &buffers, &count);
+
+ if (buffers == NULL)
+ return;
+
+ for (i = 0; i < count; i++) {
+ switch (buffers[i].attachment) {
+ case __DRI_BUFFER_FRONT_LEFT:
+ rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+ region_name = "dri2 front buffer";
+ break;
+
+ case __DRI_BUFFER_FAKE_FRONT_LEFT:
+ rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+ region_name = "dri2 fake front buffer";
+ break;
+
+ case __DRI_BUFFER_BACK_LEFT:
+ rb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT);
+ region_name = "dri2 back buffer";
+ break;
+
+ case __DRI_BUFFER_DEPTH:
+ case __DRI_BUFFER_HIZ:
+ case __DRI_BUFFER_DEPTH_STENCIL:
+ case __DRI_BUFFER_STENCIL:
+ case __DRI_BUFFER_ACCUM:
+ default:
+ fprintf(stderr,
+ "unhandled buffer attach event, attachment type %d\n",
+ buffers[i].attachment);
+ return;
+ }
+
+ intel_process_dri2_buffer(intel, drawable, &buffers[i], rb, region_name);
+ }
+
+ driUpdateFramebufferSize(&intel->ctx, drawable);
+}
+
+/**
+ * intel_prepare_render should be called anywhere that curent read/drawbuffer
+ * state is required.
+ */
+void
+intel_prepare_render(struct intel_context *intel)
+{
+ __DRIcontext *driContext = intel->driContext;
+ __DRIdrawable *drawable;
+
+ drawable = driContext->driDrawablePriv;
+ if (drawable && drawable->dri2.stamp != driContext->dri2.draw_stamp) {
+ if (drawable->lastStamp != drawable->dri2.stamp)
+ intel_update_renderbuffers(driContext, drawable);
+ intel_draw_buffer(&intel->ctx);
+ driContext->dri2.draw_stamp = drawable->dri2.stamp;
+ }
+
+ drawable = driContext->driReadablePriv;
+ if (drawable && drawable->dri2.stamp != driContext->dri2.read_stamp) {
+ if (drawable->lastStamp != drawable->dri2.stamp)
+ intel_update_renderbuffers(driContext, drawable);
+ driContext->dri2.read_stamp = drawable->dri2.stamp;
+ }
+
+ /* If we're currently rendering to the front buffer, the rendering
+ * that will happen next will probably dirty the front buffer. So
+ * mark it as dirty here.
+ */
+ if (intel->is_front_buffer_rendering)
+ intel->front_buffer_dirty = true;
+
+ /* Wait for the swapbuffers before the one we just emitted, so we
+ * don't get too many swaps outstanding for apps that are GPU-heavy
+ * but not CPU-heavy.
+ *
+ * We're using intelDRI2Flush (called from the loader before
+ * swapbuffer) and glFlush (for front buffer rendering) as the
+ * indicator that a frame is done and then throttle when we get
+ * here as we prepare to render the next frame. At this point for
+ * round trips for swap/copy and getting new buffers are done and
+ * we'll spend less time waiting on the GPU.
+ *
+ * Unfortunately, we don't have a handle to the batch containing
+ * the swap, and getting our hands on that doesn't seem worth it,
+ * so we just us the first batch we emitted after the last swap.
+ */
+ if (intel->need_throttle && intel->first_post_swapbuffers_batch) {
+ drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
+ drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
+ intel->first_post_swapbuffers_batch = NULL;
+ intel->need_throttle = false;
+ }
+}
+
+static void
+intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ struct intel_context *intel = intel_context(ctx);
+ __DRIcontext *driContext = intel->driContext;
+
+ if (intel->saved_viewport)
+ intel->saved_viewport(ctx, x, y, w, h);
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ dri2InvalidateDrawable(driContext->driDrawablePriv);
+ dri2InvalidateDrawable(driContext->driReadablePriv);
+ }
+}
+
+static const struct dri_debug_control debug_control[] = {
+ { "tex", DEBUG_TEXTURE},
+ { "state", DEBUG_STATE},
+ { "ioctl", DEBUG_IOCTL},
+ { "blit", DEBUG_BLIT},
+ { "mip", DEBUG_MIPTREE},
+ { "fall", DEBUG_PERF},
+ { "perf", DEBUG_PERF},
+ { "verb", DEBUG_VERBOSE},
+ { "bat", DEBUG_BATCH},
+ { "pix", DEBUG_PIXEL},
+ { "buf", DEBUG_BUFMGR},
+ { "reg", DEBUG_REGION},
+ { "fbo", DEBUG_FBO},
+ { "gs", DEBUG_GS},
+ { "sync", DEBUG_SYNC},
+ { "prim", DEBUG_PRIMS },
+ { "vert", DEBUG_VERTS },
+ { "dri", DEBUG_DRI },
+ { "sf", DEBUG_SF },
+ { "san", DEBUG_SANITY },
+ { "sleep", DEBUG_SLEEP },
+ { "stats", DEBUG_STATS },
+ { "tile", DEBUG_TILE },
+ { "wm", DEBUG_WM },
+ { "urb", DEBUG_URB },
+ { "vs", DEBUG_VS },
+ { "clip", DEBUG_CLIP },
+ { "aub", DEBUG_AUB },
+ { NULL, 0 }
+};
+
+
+static void
+intelInvalidateState(struct gl_context * ctx, GLuint new_state)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ if (ctx->swrast_context)
+ _swrast_InvalidateState(ctx, new_state);
+ _vbo_InvalidateState(ctx, new_state);
+
+ intel->NewGLState |= new_state;
+
+ if (intel->vtbl.invalidate_state)
+ intel->vtbl.invalidate_state( intel, new_state );
+}
+
+void
+intel_flush_rendering_to_batch(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ if (intel->Fallback)
+ _swrast_flush(ctx);
+
+ if (intel->gen < 4)
+ INTEL_FIREVERTICES(intel);
+}
+
+void
+_intel_flush(struct gl_context *ctx, const char *file, int line)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_flush_rendering_to_batch(ctx);
+
+ if (intel->batch.used)
+ _intel_batchbuffer_flush(intel, file, line);
+}
+
+static void
+intel_glFlush(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_flush(ctx);
+ intel_flush_front(ctx);
+ if (intel->is_front_buffer_rendering)
+ intel->need_throttle = true;
+}
+
+void
+intelFinish(struct gl_context * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_flush(ctx);
+ intel_flush_front(ctx);
+
+ if (intel->batch.last_bo)
+ drm_intel_bo_wait_rendering(intel->batch.last_bo);
+}
+
+void
+intelInitDriverFunctions(struct dd_function_table *functions)
+{
+ _mesa_init_driver_functions(functions);
+
+ functions->Flush = intel_glFlush;
+ functions->Finish = intelFinish;
+ functions->GetString = intelGetString;
+ functions->UpdateState = intelInvalidateState;
+
+ intelInitTextureFuncs(functions);
+ intelInitTextureImageFuncs(functions);
+ intelInitTextureSubImageFuncs(functions);
+ intelInitTextureCopyImageFuncs(functions);
+ intelInitClearFuncs(functions);
+ intelInitBufferFuncs(functions);
+ intelInitPixelFuncs(functions);
+ intelInitBufferObjectFuncs(functions);
+ intel_init_syncobj_functions(functions);
+}
+
+bool
+intelInitContext(struct intel_context *intel,
+ int api,
+ const struct gl_config * mesaVis,
+ __DRIcontext * driContextPriv,
+ void *sharedContextPrivate,
+ struct dd_function_table *functions)
+{
+ struct gl_context *ctx = &intel->ctx;
+ struct gl_context *shareCtx = (struct gl_context *) sharedContextPrivate;
+ __DRIscreen *sPriv = driContextPriv->driScreenPriv;
+ struct intel_screen *intelScreen = sPriv->driverPrivate;
+ int bo_reuse_mode;
+ struct gl_config visual;
+
+ /* we can't do anything without a connection to the device */
+ if (intelScreen->bufmgr == NULL)
+ return false;
+
+ /* Can't rely on invalidate events, fall back to glViewport hack */
+ if (!driContextPriv->driScreenPriv->dri2.useInvalidate) {
+ intel->saved_viewport = functions->Viewport;
+ functions->Viewport = intel_viewport;
+ }
+
+ if (mesaVis == NULL) {
+ memset(&visual, 0, sizeof visual);
+ mesaVis = &visual;
+ }
+
+ if (!_mesa_initialize_context(&intel->ctx, api, mesaVis, shareCtx,
+ functions, (void *) intel)) {
+ printf("%s: failed to init mesa context\n", __FUNCTION__);
+ return false;
+ }
+
+ driContextPriv->driverPrivate = intel;
+ intel->intelScreen = intelScreen;
+ intel->driContext = driContextPriv;
+ intel->driFd = sPriv->fd;
+
+ intel->gen = intelScreen->gen;
+
+ const int devID = intelScreen->deviceID;
+ if (IS_SNB_GT1(devID) || IS_IVB_GT1(devID) || IS_HSW_GT1(devID))
+ intel->gt = 1;
+ else if (IS_SNB_GT2(devID) || IS_IVB_GT2(devID) || IS_HSW_GT2(devID))
+ intel->gt = 2;
+ else
+ intel->gt = 0;
+
+ if (IS_HASWELL(devID)) {
+ intel->is_haswell = true;
+ } else if (IS_G4X(devID)) {
+ intel->is_g4x = true;
+ } else if (IS_945(devID)) {
+ intel->is_945 = true;
+ }
+
+ if (intel->gen >= 5) {
+ intel->needs_ff_sync = true;
+ }
+
+ intel->has_separate_stencil = intel->intelScreen->hw_has_separate_stencil;
+ intel->must_use_separate_stencil = intel->intelScreen->hw_must_use_separate_stencil;
+ intel->has_hiz = intel->gen >= 6 && !intel->is_haswell;
+ intel->has_llc = intel->intelScreen->hw_has_llc;
+ intel->has_swizzling = intel->intelScreen->hw_has_swizzling;
+
+ memset(&ctx->TextureFormatSupported,
+ 0, sizeof(ctx->TextureFormatSupported));
+
+ driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
+ sPriv->myNum, (intel->gen >= 4) ? "i965" : "i915");
+ if (intel->gen < 4)
+ intel->maxBatchSize = 4096;
+ else
+ intel->maxBatchSize = sizeof(intel->batch.map);
+
+ intel->bufmgr = intelScreen->bufmgr;
+
+ bo_reuse_mode = driQueryOptioni(&intel->optionCache, "bo_reuse");
+ switch (bo_reuse_mode) {
+ case DRI_CONF_BO_REUSE_DISABLED:
+ break;
+ case DRI_CONF_BO_REUSE_ALL:
+ intel_bufmgr_gem_enable_reuse(intel->bufmgr);
+ break;
+ }
+
+ ctx->Const.MinLineWidth = 1.0;
+ ctx->Const.MinLineWidthAA = 1.0;
+ ctx->Const.MaxLineWidth = 5.0;
+ ctx->Const.MaxLineWidthAA = 5.0;
+ ctx->Const.LineWidthGranularity = 0.5;
+
+ ctx->Const.MinPointSize = 1.0;
+ ctx->Const.MinPointSizeAA = 1.0;
+ ctx->Const.MaxPointSize = 255.0;
+ ctx->Const.MaxPointSizeAA = 3.0;
+ ctx->Const.PointSizeGranularity = 1.0;
+
+ ctx->Const.MaxSamples = 1.0;
+
+ if (intel->gen >= 6)
+ ctx->Const.MaxClipPlanes = 8;
+
+ ctx->Const.StripTextureBorder = GL_TRUE;
+
+ /* reinitialize the context point state.
+ * It depend on constants in __struct gl_contextRec::Const
+ */
+ _mesa_init_point(ctx);
+
+ if (intel->gen >= 4) {
+ ctx->Const.MaxRenderbufferSize = 8192;
+ } else {
+ ctx->Const.MaxRenderbufferSize = 2048;
+ }
+
+ /* Initialize the software rasterizer and helper modules.
+ *
+ * As of GL 3.1 core, the gen4+ driver doesn't need the swrast context for
+ * software fallbacks (which we have to support on legacy GL to do weird
+ * glDrawPixels(), glBitmap(), and other functions).
+ */
+ if (intel->gen <= 3 || api != API_OPENGL_CORE) {
+ _swrast_CreateContext(ctx);
+ }
+
+ _vbo_CreateContext(ctx);
+ if (ctx->swrast_context) {
+ _tnl_CreateContext(ctx);
+ _swsetup_CreateContext(ctx);
+
+ /* Configure swrast to match hardware characteristics: */
+ _swrast_allow_pixel_fog(ctx, false);
+ _swrast_allow_vertex_fog(ctx, true);
+ }
+
+ _mesa_meta_init(ctx);
+
+ intel->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
+ intel->hw_stipple = 1;
+
+ /* XXX FBO: this doesn't seem to be used anywhere */
+ switch (mesaVis->depthBits) {
+ case 0: /* what to do in this case? */
+ case 16:
+ intel->polygon_offset_scale = 1.0;
+ break;
+ case 24:
+ intel->polygon_offset_scale = 2.0; /* req'd to pass glean */
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ if (intel->gen >= 4)
+ intel->polygon_offset_scale /= 0xffff;
+
+ intel->RenderIndex = ~0;
+
+ intelInitExtensions(ctx);
+
+ INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
+ if (INTEL_DEBUG & DEBUG_BUFMGR)
+ dri_bufmgr_set_debug(intel->bufmgr, true);
+
+ if (INTEL_DEBUG & DEBUG_AUB)
+ drm_intel_bufmgr_gem_set_aub_dump(intel->bufmgr, true);
+
+ intel_batchbuffer_init(intel);
+
+ intel_fbo_init(intel);
+
+ intel->use_texture_tiling = driQueryOptionb(&intel->optionCache,
+ "texture_tiling");
+ intel->use_early_z = driQueryOptionb(&intel->optionCache, "early_z");
+
+ if (!driQueryOptionb(&intel->optionCache, "hiz")) {
+ intel->has_hiz = false;
+ /* On gen6, you can only do separate stencil with HIZ. */
+ if (intel->gen == 6)
+ intel->has_separate_stencil = false;
+ }
+
+ intel->prim.primitive = ~0;
+
+ /* Force all software fallbacks */
+#ifdef I915
+ if (driQueryOptionb(&intel->optionCache, "no_rast")) {
+ fprintf(stderr, "disabling 3D rasterization\n");
+ intel->no_rast = 1;
+ }
+#endif
+
+ if (driQueryOptionb(&intel->optionCache, "always_flush_batch")) {
+ fprintf(stderr, "flushing batchbuffer before/after each draw call\n");
+ intel->always_flush_batch = 1;
+ }
+
+ if (driQueryOptionb(&intel->optionCache, "always_flush_cache")) {
+ fprintf(stderr, "flushing GPU caches before/after each draw call\n");
+ intel->always_flush_cache = 1;
+ }
+
+ return true;
+}
+
+void
+intelDestroyContext(__DRIcontext * driContextPriv)
+{
+ struct intel_context *intel =
+ (struct intel_context *) driContextPriv->driverPrivate;
+ struct gl_context *ctx = &intel->ctx;
+
+ assert(intel); /* should never be null */
+ if (intel) {
+ INTEL_FIREVERTICES(intel);
+
+ /* Dump a final BMP in case the application doesn't call SwapBuffers */
+ if (INTEL_DEBUG & DEBUG_AUB) {
+ intel_batchbuffer_flush(intel);
+ aub_dump_bmp(&intel->ctx);
+ }
+
+ _mesa_meta_free(&intel->ctx);
+
+ intel->vtbl.destroy(intel);
+
+ if (ctx->swrast_context) {
+ _swsetup_DestroyContext(&intel->ctx);
+ _tnl_DestroyContext(&intel->ctx);
+ }
+ _vbo_DestroyContext(&intel->ctx);
+
+ if (ctx->swrast_context)
+ _swrast_DestroyContext(&intel->ctx);
+ intel->Fallback = 0x0; /* don't call _swrast_Flush later */
+
+ intel_batchbuffer_free(intel);
+
+ free(intel->prim.vb);
+ intel->prim.vb = NULL;
+ drm_intel_bo_unreference(intel->prim.vb_bo);
+ intel->prim.vb_bo = NULL;
+ drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
+ intel->first_post_swapbuffers_batch = NULL;
+
+ driDestroyOptionCache(&intel->optionCache);
+
+ /* free the Mesa context */
+ _mesa_free_context_data(&intel->ctx);
+
+ _math_matrix_dtr(&intel->ViewportMatrix);
+
+ ralloc_free(intel);
+ driContextPriv->driverPrivate = NULL;
+ }
+}
+
+GLboolean
+intelUnbindContext(__DRIcontext * driContextPriv)
+{
+ /* Unset current context and dispath table */
+ _mesa_make_current(NULL, NULL, NULL);
+
+ return true;
+}
+
+GLboolean
+intelMakeCurrent(__DRIcontext * driContextPriv,
+ __DRIdrawable * driDrawPriv,
+ __DRIdrawable * driReadPriv)
+{
+ struct intel_context *intel;
+ GET_CURRENT_CONTEXT(curCtx);
+
+ if (driContextPriv)
+ intel = (struct intel_context *) driContextPriv->driverPrivate;
+ else
+ intel = NULL;
+
+ /* According to the glXMakeCurrent() man page: "Pending commands to
+ * the previous context, if any, are flushed before it is released."
+ * But only flush if we're actually changing contexts.
+ */
+ if (intel_context(curCtx) && intel_context(curCtx) != intel) {
+ _mesa_flush(curCtx);
+ }
+
+ if (driContextPriv) {
+ struct gl_framebuffer *fb, *readFb;
+
+ if (driDrawPriv == NULL && driReadPriv == NULL) {
+ fb = _mesa_get_incomplete_framebuffer();
+ readFb = _mesa_get_incomplete_framebuffer();
+ } else {
+ fb = driDrawPriv->driverPrivate;
+ readFb = driReadPriv->driverPrivate;
+ driContextPriv->dri2.draw_stamp = driDrawPriv->dri2.stamp - 1;
+ driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1;
+ }
+
+ intel_prepare_render(intel);
+ _mesa_make_current(&intel->ctx, fb, readFb);
+
+ /* We do this in intel_prepare_render() too, but intel->ctx.DrawBuffer
+ * is NULL at that point. We can't call _mesa_makecurrent()
+ * first, since we need the buffer size for the initial
+ * viewport. So just call intel_draw_buffer() again here. */
+ intel_draw_buffer(&intel->ctx);
+ }
+ else {
+ _mesa_make_current(NULL, NULL, NULL);
+ }
+
+ return true;
+}
+
+/**
+ * \brief Query DRI2 to obtain a DRIdrawable's buffers.
+ *
+ * To determine which DRI buffers to request, examine the renderbuffers
+ * attached to the drawable's framebuffer. Then request the buffers with
+ * DRI2GetBuffers() or DRI2GetBuffersWithFormat().
+ *
+ * This is called from intel_update_renderbuffers().
+ *
+ * \param drawable Drawable whose buffers are queried.
+ * \param buffers [out] List of buffers returned by DRI2 query.
+ * \param buffer_count [out] Number of buffers returned.
+ *
+ * \see intel_update_renderbuffers()
+ * \see DRI2GetBuffers()
+ * \see DRI2GetBuffersWithFormat()
+ */
+static void
+intel_query_dri2_buffers(struct intel_context *intel,
+ __DRIdrawable *drawable,
+ __DRIbuffer **buffers,
+ int *buffer_count)
+{
+ __DRIscreen *screen = intel->intelScreen->driScrnPriv;
+ struct gl_framebuffer *fb = drawable->driverPrivate;
+ int i = 0;
+ const int max_attachments = 4;
+ unsigned *attachments = calloc(2 * max_attachments, sizeof(unsigned));
+
+ struct intel_renderbuffer *front_rb;
+ struct intel_renderbuffer *back_rb;
+
+ front_rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+ back_rb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT);
+
+ if ((intel->is_front_buffer_rendering ||
+ intel->is_front_buffer_reading ||
+ !back_rb) && front_rb) {
+ attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
+ attachments[i++] = intel_bits_per_pixel(front_rb);
+ }
+
+ if (back_rb) {
+ attachments[i++] = __DRI_BUFFER_BACK_LEFT;
+ attachments[i++] = intel_bits_per_pixel(back_rb);
+ }
+
+ assert(i <= 2 * max_attachments);
+
+ *buffers = screen->dri2.loader->getBuffersWithFormat(drawable,
+ &drawable->w,
+ &drawable->h,
+ attachments, i / 2,
+ buffer_count,
+ drawable->loaderPrivate);
+ free(attachments);
+}
+
+/**
+ * \brief Assign a DRI buffer's DRM region to a renderbuffer.
+ *
+ * This is called from intel_update_renderbuffers().
+ *
+ * \par Note:
+ * DRI buffers whose attachment point is DRI2BufferStencil or
+ * DRI2BufferDepthStencil are handled as special cases.
+ *
+ * \param buffer_name is a human readable name, such as "dri2 front buffer",
+ * that is passed to intel_region_alloc_for_handle().
+ *
+ * \see intel_update_renderbuffers()
+ * \see intel_region_alloc_for_handle()
+ */
+static void
+intel_process_dri2_buffer(struct intel_context *intel,
+ __DRIdrawable *drawable,
+ __DRIbuffer *buffer,
+ struct intel_renderbuffer *rb,
+ const char *buffer_name)
+{
+ struct intel_region *region = NULL;
+
+ if (!rb)
+ return;
+
+ unsigned num_samples = rb->Base.Base.NumSamples;
+
+ /* We try to avoid closing and reopening the same BO name, because the first
+ * use of a mapping of the buffer involves a bunch of page faulting which is
+ * moderately expensive.
+ */
+ if (num_samples == 0) {
+ if (rb->mt &&
+ rb->mt->region &&
+ rb->mt->region->name == buffer->name)
+ return;
+ } else {
+ if (rb->mt &&
+ rb->mt->singlesample_mt &&
+ rb->mt->singlesample_mt->region &&
+ rb->mt->singlesample_mt->region->name == buffer->name)
+ return;
+ }
+
+ if (unlikely(INTEL_DEBUG & DEBUG_DRI)) {
+ fprintf(stderr,
+ "attaching buffer %d, at %d, cpp %d, pitch %d\n",
+ buffer->name, buffer->attachment,
+ buffer->cpp, buffer->pitch);
+ }
+
+ intel_miptree_release(&rb->mt);
+ region = intel_region_alloc_for_handle(intel->intelScreen,
+ buffer->cpp,
+ drawable->w,
+ drawable->h,
+ buffer->pitch / buffer->cpp,
+ buffer->name,
+ buffer_name);
+ if (!region)
+ return;
+
+ rb->mt = intel_miptree_create_for_dri2_buffer(intel,
+ buffer->attachment,
+ intel_rb_format(rb),
+ num_samples,
+ region);
+ intel_region_release(&region);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_extensions.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_extensions.c
index a2f3e8cd208..885e8a43e80 120000..100755
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_extensions.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_extensions.c
@@ -1 +1,197 @@
-../intel/intel_extensions.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/mfeatures.h"
+#include "main/version.h"
+
+#include "intel_chipset.h"
+#include "intel_context.h"
+#include "intel_extensions.h"
+#include "intel_reg.h"
+#include "utils.h"
+
+/**
+ * Initializes potential list of extensions if ctx == NULL, or actually enables
+ * extensions for a context.
+ */
+void
+intelInitExtensions(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ ctx->Extensions.ARB_draw_elements_base_vertex = true;
+ ctx->Extensions.ARB_explicit_attrib_location = true;
+ if (_mesa_is_desktop_gl(ctx))
+ ctx->Extensions.ARB_framebuffer_object = true;
+ ctx->Extensions.ARB_half_float_pixel = true;
+ ctx->Extensions.ARB_map_buffer_range = true;
+ ctx->Extensions.ARB_point_sprite = true;
+ ctx->Extensions.ARB_shader_objects = true;
+ ctx->Extensions.ARB_shading_language_100 = true;
+ ctx->Extensions.ARB_sync = true;
+ ctx->Extensions.ARB_texture_border_clamp = true;
+ ctx->Extensions.ARB_texture_cube_map = true;
+ ctx->Extensions.ARB_texture_env_combine = true;
+ ctx->Extensions.ARB_texture_env_crossbar = true;
+ ctx->Extensions.ARB_texture_env_dot3 = true;
+ ctx->Extensions.ARB_texture_storage = true;
+ ctx->Extensions.ARB_vertex_program = true;
+ ctx->Extensions.ARB_vertex_shader = true;
+ ctx->Extensions.EXT_blend_color = true;
+ ctx->Extensions.EXT_blend_equation_separate = true;
+ ctx->Extensions.EXT_blend_func_separate = true;
+ ctx->Extensions.EXT_blend_minmax = true;
+ ctx->Extensions.EXT_framebuffer_blit = true;
+ ctx->Extensions.EXT_framebuffer_object = true;
+ ctx->Extensions.EXT_framebuffer_multisample = true;
+ ctx->Extensions.EXT_fog_coord = true;
+ ctx->Extensions.EXT_gpu_program_parameters = true;
+ ctx->Extensions.EXT_packed_depth_stencil = true;
+ ctx->Extensions.EXT_pixel_buffer_object = true;
+ ctx->Extensions.EXT_point_parameters = true;
+ ctx->Extensions.EXT_provoking_vertex = true;
+ ctx->Extensions.EXT_secondary_color = true;
+ ctx->Extensions.EXT_separate_shader_objects = true;
+ ctx->Extensions.EXT_texture_env_dot3 = true;
+ ctx->Extensions.EXT_texture_filter_anisotropic = true;
+ ctx->Extensions.APPLE_object_purgeable = true;
+ ctx->Extensions.MESA_pack_invert = true;
+ ctx->Extensions.MESA_ycbcr_texture = true;
+ ctx->Extensions.NV_blend_square = true;
+ ctx->Extensions.NV_texture_rectangle = true;
+ ctx->Extensions.NV_vertex_program = true;
+ ctx->Extensions.NV_vertex_program1_1 = true;
+ ctx->Extensions.TDFX_texture_compression_FXT1 = true;
+#if FEATURE_OES_EGL_image
+ ctx->Extensions.OES_EGL_image = true;
+#endif
+ ctx->Extensions.OES_draw_texture = true;
+ ctx->Extensions.OES_compressed_ETC1_RGB8_texture = true;
+ ctx->Extensions.ARB_texture_rgb10_a2ui = true;
+
+ if (intel->gen >= 6)
+ if (ctx->API == API_OPENGL_CORE) {
+ ctx->Const.GLSLVersion = 140;
+ } else {
+ ctx->Const.GLSLVersion = 130;
+ }
+ else
+ ctx->Const.GLSLVersion = 120;
+ _mesa_override_glsl_version(ctx);
+
+ if (intel->gen == 6 ||
+ (intel->gen == 7 && intel->intelScreen->kernel_has_gen7_sol_reset))
+ ctx->Extensions.EXT_transform_feedback = true;
+
+ if (intel->gen >= 6) {
+ ctx->Extensions.ARB_blend_func_extended = !driQueryOptionb(&intel->optionCache, "disable_blend_func_extended");
+ ctx->Extensions.ARB_draw_buffers_blend = true;
+ ctx->Extensions.ARB_uniform_buffer_object = true;
+
+ if (ctx->API == API_OPENGL_CORE) {
+ ctx->Extensions.ARB_texture_buffer_object = true;
+ }
+ }
+
+ if (intel->gen >= 5)
+ ctx->Extensions.EXT_timer_query = true;
+
+ if (intel->gen >= 6) {
+ uint64_t dummy;
+ /* Test if the kernel has the ioctl. */
+ if (drm_intel_reg_read(intel->bufmgr, TIMESTAMP, &dummy) == 0)
+ ctx->Extensions.ARB_timer_query = true;
+ }
+
+ if (intel->gen >= 4) {
+ ctx->Extensions.ARB_color_buffer_float = true;
+ ctx->Extensions.ARB_depth_buffer_float = true;
+ ctx->Extensions.ARB_depth_clamp = true;
+ ctx->Extensions.ARB_draw_instanced = true;
+ ctx->Extensions.ARB_instanced_arrays = true;
+ ctx->Extensions.ARB_fragment_coord_conventions = true;
+ ctx->Extensions.ARB_fragment_program_shadow = true;
+ ctx->Extensions.ARB_fragment_shader = true;
+ ctx->Extensions.ARB_half_float_vertex = true;
+ ctx->Extensions.ARB_occlusion_query = true;
+ ctx->Extensions.ARB_occlusion_query2 = true;
+ ctx->Extensions.ARB_point_sprite = true;
+ ctx->Extensions.ARB_seamless_cube_map = true;
+ ctx->Extensions.ARB_shader_bit_encoding = true;
+ ctx->Extensions.ARB_shader_texture_lod = true;
+#ifdef TEXTURE_FLOAT_ENABLED
+ ctx->Extensions.ARB_texture_float = true;
+ ctx->Extensions.EXT_texture_shared_exponent = true;
+ ctx->Extensions.EXT_packed_float = true;
+#endif
+ ctx->Extensions.ARB_texture_compression_rgtc = true;
+ ctx->Extensions.ARB_texture_rg = true;
+ ctx->Extensions.EXT_draw_buffers2 = true;
+ ctx->Extensions.EXT_framebuffer_sRGB = true;
+ ctx->Extensions.EXT_texture_array = true;
+ ctx->Extensions.EXT_texture_integer = true;
+ ctx->Extensions.EXT_texture_snorm = true;
+ ctx->Extensions.EXT_texture_sRGB = true;
+ ctx->Extensions.EXT_texture_sRGB_decode = true;
+ ctx->Extensions.EXT_texture_swizzle = true;
+ ctx->Extensions.EXT_vertex_array_bgra = true;
+ ctx->Extensions.ATI_envmap_bumpmap = true;
+ ctx->Extensions.MESA_texture_array = true;
+ ctx->Extensions.NV_conditional_render = true;
+ }
+
+ if (intel->gen >= 3) {
+ ctx->Extensions.ARB_ES2_compatibility = true;
+ ctx->Extensions.ARB_depth_texture = true;
+ ctx->Extensions.ARB_fragment_program = true;
+ ctx->Extensions.ARB_shadow = true;
+ ctx->Extensions.ARB_texture_non_power_of_two = true;
+ ctx->Extensions.EXT_shadow_funcs = true;
+ ctx->Extensions.EXT_stencil_two_side = true;
+ ctx->Extensions.ATI_separate_stencil = true;
+ ctx->Extensions.ATI_texture_env_combine3 = true;
+ ctx->Extensions.NV_texture_env_combine4 = true;
+
+ if (driQueryOptionb(&intel->optionCache, "fragment_shader"))
+ ctx->Extensions.ARB_fragment_shader = true;
+
+ if (driQueryOptionb(&intel->optionCache, "stub_occlusion_query"))
+ ctx->Extensions.ARB_occlusion_query = true;
+ }
+
+ if (intel->ctx.Mesa_DXTn) {
+ ctx->Extensions.EXT_texture_compression_s3tc = true;
+ ctx->Extensions.S3_s3tc = true;
+ }
+ else if (driQueryOptionb(&intel->optionCache, "force_s3tc_enable")) {
+ ctx->Extensions.EXT_texture_compression_s3tc = true;
+ }
+
+ if (intel->gen >= 4) {
+ ctx->Extensions.NV_primitive_restart = true;
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_fbo.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_fbo.c
index a19f86dcc57..65494a2d506 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_fbo.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_fbo.c
@@ -1 +1,964 @@
-../intel/intel_fbo.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/enums.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/context.h"
+#include "main/teximage.h"
+#include "main/image.h"
+
+#include "swrast/swrast.h"
+#include "drivers/common/meta.h"
+
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_buffers.h"
+#include "intel_blit.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_tex.h"
+#include "intel_span.h"
+#ifndef I915
+#include "brw_context.h"
+#endif
+
+#define FILE_DEBUG_FLAG DEBUG_FBO
+
+static struct gl_renderbuffer *
+intel_new_renderbuffer(struct gl_context * ctx, GLuint name);
+
+struct intel_region*
+intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
+{
+ struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex);
+ if (irb && irb->mt) {
+ if (attIndex == BUFFER_STENCIL && irb->mt->stencil_mt)
+ return irb->mt->stencil_mt->region;
+ else
+ return irb->mt->region;
+ } else
+ return NULL;
+}
+
+/**
+ * Create a new framebuffer object.
+ */
+static struct gl_framebuffer *
+intel_new_framebuffer(struct gl_context * ctx, GLuint name)
+{
+ /* Only drawable state in intel_framebuffer at this time, just use Mesa's
+ * class
+ */
+ return _mesa_new_framebuffer(ctx, name);
+}
+
+
+/** Called by gl_renderbuffer::Delete() */
+static void
+intel_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
+{
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+
+ ASSERT(irb);
+
+ intel_miptree_release(&irb->mt);
+
+ _mesa_delete_renderbuffer(ctx, rb);
+}
+
+/**
+ * \see dd_function_table::MapRenderbuffer
+ */
+static void
+intel_map_renderbuffer(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **out_map,
+ GLint *out_stride)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct swrast_renderbuffer *srb = (struct swrast_renderbuffer *)rb;
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+ void *map;
+ int stride;
+
+ if (srb->Buffer) {
+ /* this is a malloc'd renderbuffer (accum buffer), not an irb */
+ GLint bpp = _mesa_get_format_bytes(rb->Format);
+ GLint rowStride = srb->RowStride;
+ *out_map = (GLubyte *) srb->Buffer + y * rowStride + x * bpp;
+ *out_stride = rowStride;
+ return;
+ }
+
+ /* We sometimes get called with this by our intel_span.c usage. */
+ if (!irb->mt) {
+ *out_map = NULL;
+ *out_stride = 0;
+ return;
+ }
+
+ /* For a window-system renderbuffer, we need to flip the mapping we receive
+ * upside-down. So we need to ask for a rectangle on flipped vertically, and
+ * we then return a pointer to the bottom of it with a negative stride.
+ */
+ if (rb->Name == 0) {
+ y = rb->Height - y - h;
+ }
+
+ intel_miptree_map(intel, irb->mt, irb->mt_level, irb->mt_layer,
+ x, y, w, h, mode, &map, &stride);
+
+ if (rb->Name == 0) {
+ map += (h - 1) * stride;
+ stride = -stride;
+ }
+
+ DBG("%s: rb %d (%s) mt mapped: (%d, %d) (%dx%d) -> %p/%d\n",
+ __FUNCTION__, rb->Name, _mesa_get_format_name(rb->Format),
+ x, y, w, h, map, stride);
+
+ *out_map = map;
+ *out_stride = stride;
+}
+
+/**
+ * \see dd_function_table::UnmapRenderbuffer
+ */
+static void
+intel_unmap_renderbuffer(struct gl_context *ctx,
+ struct gl_renderbuffer *rb)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct swrast_renderbuffer *srb = (struct swrast_renderbuffer *)rb;
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+
+ DBG("%s: rb %d (%s)\n", __FUNCTION__,
+ rb->Name, _mesa_get_format_name(rb->Format));
+
+ if (srb->Buffer) {
+ /* this is a malloc'd renderbuffer (accum buffer) */
+ /* nothing to do */
+ return;
+ }
+
+ intel_miptree_unmap(intel, irb->mt, irb->mt_level, irb->mt_layer);
+}
+
+
+/**
+ * Round up the requested multisample count to the next supported sample size.
+ */
+unsigned
+intel_quantize_num_samples(struct intel_screen *intel, unsigned num_samples)
+{
+ switch (intel->gen) {
+ case 6:
+ /* Gen6 supports only 4x multisampling. */
+ if (num_samples > 0)
+ return 4;
+ else
+ return 0;
+ case 7:
+ /* Gen7 supports 4x and 8x multisampling. */
+ if (num_samples > 4)
+ return 8;
+ else if (num_samples > 0)
+ return 4;
+ else
+ return 0;
+ return 0;
+ default:
+ /* MSAA unsupported. However, a careful reading of
+ * EXT_framebuffer_multisample reveals that we need to permit
+ * num_samples to be 1 (since num_samples is permitted to be as high as
+ * GL_MAX_SAMPLES, and GL_MAX_SAMPLES must be at least 1). Since
+ * platforms before Gen6 don't support MSAA, this is safe, because
+ * multisampling won't happen anyhow.
+ */
+ if (num_samples > 0)
+ return 1;
+ return 0;
+ }
+}
+
+
+/**
+ * Called via glRenderbufferStorageEXT() to set the format and allocate
+ * storage for a user-created renderbuffer.
+ */
+GLboolean
+intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width, GLuint height)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_screen *screen = intel->intelScreen;
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+ rb->NumSamples = intel_quantize_num_samples(screen, rb->NumSamples);
+
+ switch (internalFormat) {
+ default:
+ /* Use the same format-choice logic as for textures.
+ * Renderbuffers aren't any different from textures for us,
+ * except they're less useful because you can't texture with
+ * them.
+ */
+ rb->Format = intel->ctx.Driver.ChooseTextureFormat(ctx, GL_TEXTURE_2D,
+ internalFormat,
+ GL_NONE, GL_NONE);
+ break;
+ case GL_STENCIL_INDEX:
+ case GL_STENCIL_INDEX1_EXT:
+ case GL_STENCIL_INDEX4_EXT:
+ case GL_STENCIL_INDEX8_EXT:
+ case GL_STENCIL_INDEX16_EXT:
+ /* These aren't actual texture formats, so force them here. */
+ if (intel->has_separate_stencil) {
+ rb->Format = MESA_FORMAT_S8;
+ } else {
+ assert(!intel->must_use_separate_stencil);
+ rb->Format = MESA_FORMAT_S8_Z24;
+ }
+ break;
+ }
+
+ rb->Width = width;
+ rb->Height = height;
+ rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
+
+ intel_miptree_release(&irb->mt);
+
+ DBG("%s: %s: %s (%dx%d)\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_get_format_name(rb->Format), width, height);
+
+ if (width == 0 || height == 0)
+ return true;
+
+ irb->mt = intel_miptree_create_for_renderbuffer(intel, rb->Format,
+ width, height,
+ rb->NumSamples);
+ if (!irb->mt)
+ return false;
+
+ return true;
+}
+
+
+#if FEATURE_OES_EGL_image
+static void
+intel_image_target_renderbuffer_storage(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ void *image_handle)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_renderbuffer *irb;
+ __DRIscreen *screen;
+ __DRIimage *image;
+
+ screen = intel->intelScreen->driScrnPriv;
+ image = screen->dri2.image->lookupEGLImage(screen, image_handle,
+ screen->loaderPrivate);
+ if (image == NULL)
+ return;
+
+ /* __DRIimage is opaque to the core so it has to be checked here */
+ switch (image->format) {
+ case MESA_FORMAT_RGBA8888_REV:
+ _mesa_error(&intel->ctx, GL_INVALID_OPERATION,
+ "glEGLImageTargetRenderbufferStorage(unsupported image format");
+ return;
+ break;
+ default:
+ break;
+ }
+
+ irb = intel_renderbuffer(rb);
+ intel_miptree_release(&irb->mt);
+ irb->mt = intel_miptree_create_for_region(intel,
+ GL_TEXTURE_2D,
+ image->format,
+ image->region);
+ if (!irb->mt)
+ return;
+
+ rb->InternalFormat = image->internal_format;
+ rb->Width = image->region->width;
+ rb->Height = image->region->height;
+ rb->Format = image->format;
+ rb->_BaseFormat = _mesa_base_fbo_format(&intel->ctx,
+ image->internal_format);
+}
+#endif
+
+/**
+ * Called for each hardware renderbuffer when a _window_ is resized.
+ * Just update fields.
+ * Not used for user-created renderbuffers!
+ */
+static GLboolean
+intel_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ ASSERT(rb->Name == 0);
+ rb->Width = width;
+ rb->Height = height;
+ rb->InternalFormat = internalFormat;
+
+ return true;
+}
+
+
+static void
+intel_resize_buffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint width, GLuint height)
+{
+ int i;
+
+ _mesa_resize_framebuffer(ctx, fb, width, height);
+
+ fb->Initialized = true; /* XXX remove someday */
+
+ if (_mesa_is_user_fbo(fb)) {
+ return;
+ }
+
+
+ /* Make sure all window system renderbuffers are up to date */
+ for (i = BUFFER_FRONT_LEFT; i <= BUFFER_BACK_RIGHT; i++) {
+ struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
+
+ /* only resize if size is changing */
+ if (rb && (rb->Width != width || rb->Height != height)) {
+ rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height);
+ }
+ }
+}
+
+
+/** Dummy function for gl_renderbuffer::AllocStorage() */
+static GLboolean
+intel_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ _mesa_problem(ctx, "intel_op_alloc_storage should never be called.");
+ return false;
+}
+
+/**
+ * Create a new intel_renderbuffer which corresponds to an on-screen window,
+ * not a user-created renderbuffer.
+ *
+ * \param num_samples must be quantized.
+ */
+struct intel_renderbuffer *
+intel_create_renderbuffer(gl_format format, unsigned num_samples)
+{
+ struct intel_renderbuffer *irb;
+ struct gl_renderbuffer *rb;
+
+ GET_CURRENT_CONTEXT(ctx);
+
+ irb = CALLOC_STRUCT(intel_renderbuffer);
+ if (!irb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer");
+ return NULL;
+ }
+
+ rb = &irb->Base.Base;
+
+ _mesa_init_renderbuffer(rb, 0);
+ rb->ClassID = INTEL_RB_CLASS;
+ rb->_BaseFormat = _mesa_get_format_base_format(format);
+ rb->Format = format;
+ rb->InternalFormat = rb->_BaseFormat;
+ rb->NumSamples = num_samples;
+
+ /* intel-specific methods */
+ rb->Delete = intel_delete_renderbuffer;
+ rb->AllocStorage = intel_alloc_window_storage;
+
+ return irb;
+}
+
+/**
+ * Private window-system buffers (as opposed to ones shared with the display
+ * server created with intel_create_renderbuffer()) are most similar in their
+ * handling to user-created renderbuffers, but they have a resize handler that
+ * may be called at intel_update_renderbuffers() time.
+ *
+ * \param num_samples must be quantized.
+ */
+struct intel_renderbuffer *
+intel_create_private_renderbuffer(gl_format format, unsigned num_samples)
+{
+ struct intel_renderbuffer *irb;
+
+ irb = intel_create_renderbuffer(format, num_samples);
+ irb->Base.Base.AllocStorage = intel_alloc_renderbuffer_storage;
+
+ return irb;
+}
+
+/**
+ * Create a new renderbuffer object.
+ * Typically called via glBindRenderbufferEXT().
+ */
+static struct gl_renderbuffer *
+intel_new_renderbuffer(struct gl_context * ctx, GLuint name)
+{
+ /*struct intel_context *intel = intel_context(ctx); */
+ struct intel_renderbuffer *irb;
+ struct gl_renderbuffer *rb;
+
+ irb = CALLOC_STRUCT(intel_renderbuffer);
+ if (!irb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer");
+ return NULL;
+ }
+
+ rb = &irb->Base.Base;
+
+ _mesa_init_renderbuffer(rb, name);
+ rb->ClassID = INTEL_RB_CLASS;
+
+ /* intel-specific methods */
+ rb->Delete = intel_delete_renderbuffer;
+ rb->AllocStorage = intel_alloc_renderbuffer_storage;
+ /* span routines set in alloc_storage function */
+
+ return rb;
+}
+
+
+/**
+ * Called via glBindFramebufferEXT().
+ */
+static void
+intel_bind_framebuffer(struct gl_context * ctx, GLenum target,
+ struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
+{
+ if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
+ intel_draw_buffer(ctx);
+ }
+ else {
+ /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */
+ }
+}
+
+
+/**
+ * Called via glFramebufferRenderbufferEXT().
+ */
+static void
+intel_framebuffer_renderbuffer(struct gl_context * ctx,
+ struct gl_framebuffer *fb,
+ GLenum attachment, struct gl_renderbuffer *rb)
+{
+ DBG("Intel FramebufferRenderbuffer %u %u\n", fb->Name, rb ? rb->Name : 0);
+
+ _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
+ intel_draw_buffer(ctx);
+}
+
+/**
+ * \par Special case for separate stencil
+ *
+ * When wrapping a depthstencil texture that uses separate stencil, this
+ * function is recursively called twice: once to create \c
+ * irb->wrapped_depth and again to create \c irb->wrapped_stencil. On the
+ * call to create \c irb->wrapped_depth, the \c format and \c
+ * internal_format parameters do not match \c mt->format. In that case, \c
+ * mt->format is MESA_FORMAT_S8_Z24 and \c format is \c
+ * MESA_FORMAT_X8_Z24.
+ *
+ * @return true on success
+ */
+
+static bool
+intel_renderbuffer_update_wrapper(struct intel_context *intel,
+ struct intel_renderbuffer *irb,
+ struct gl_texture_image *image,
+ uint32_t layer)
+{
+ struct gl_renderbuffer *rb = &irb->Base.Base;
+ struct intel_texture_image *intel_image = intel_texture_image(image);
+ struct intel_mipmap_tree *mt = intel_image->mt;
+ int level = image->Level;
+
+ rb->Format = image->TexFormat;
+ rb->InternalFormat = image->InternalFormat;
+ rb->_BaseFormat = image->_BaseFormat;
+ rb->Width = mt->level[level].width;
+ rb->Height = mt->level[level].height;
+
+ rb->Delete = intel_delete_renderbuffer;
+ rb->AllocStorage = intel_nop_alloc_storage;
+
+ intel_miptree_check_level_layer(mt, level, layer);
+ irb->mt_level = level;
+ irb->mt_layer = layer;
+
+ intel_miptree_reference(&irb->mt, mt);
+
+ intel_renderbuffer_set_draw_offset(irb);
+
+ if (mt->hiz_mt == NULL &&
+ intel->vtbl.is_hiz_depth_format(intel, rb->Format)) {
+ intel_miptree_alloc_hiz(intel, mt, 0 /* num_samples */);
+ if (!mt->hiz_mt)
+ return false;
+ }
+
+ return true;
+}
+
+void
+intel_renderbuffer_set_draw_offset(struct intel_renderbuffer *irb)
+{
+ unsigned int dst_x, dst_y;
+
+ /* compute offset of the particular 2D image within the texture region */
+ intel_miptree_get_image_offset(irb->mt,
+ irb->mt_level,
+ 0, /* face, which we ignore */
+ irb->mt_layer,
+ &dst_x, &dst_y);
+
+ irb->draw_x = dst_x;
+ irb->draw_y = dst_y;
+}
+
+/**
+ * Rendering to tiled buffers requires that the base address of the
+ * buffer be aligned to a page boundary. We generally render to
+ * textures by pointing the surface at the mipmap image level, which
+ * may not be aligned to a tile boundary.
+ *
+ * This function returns an appropriately-aligned base offset
+ * according to the tiling restrictions, plus any required x/y offset
+ * from there.
+ */
+uint32_t
+intel_renderbuffer_tile_offsets(struct intel_renderbuffer *irb,
+ uint32_t *tile_x,
+ uint32_t *tile_y)
+{
+ struct intel_region *region = irb->mt->region;
+ uint32_t mask_x, mask_y;
+
+ intel_region_get_tile_masks(region, &mask_x, &mask_y, false);
+
+ *tile_x = irb->draw_x & mask_x;
+ *tile_y = irb->draw_y & mask_y;
+ return intel_region_get_aligned_offset(region, irb->draw_x & ~mask_x,
+ irb->draw_y & ~mask_y, false);
+}
+
+/**
+ * Called by glFramebufferTexture[123]DEXT() (and other places) to
+ * prepare for rendering into texture memory. This might be called
+ * many times to choose different texture levels, cube faces, etc
+ * before intel_finish_render_texture() is ever called.
+ */
+static void
+intel_render_texture(struct gl_context * ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct gl_texture_image *image = _mesa_get_attachment_teximage(att);
+ struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
+ struct intel_texture_image *intel_image = intel_texture_image(image);
+ struct intel_mipmap_tree *mt = intel_image->mt;
+ int layer;
+
+ (void) fb;
+
+ if (att->CubeMapFace > 0) {
+ assert(att->Zoffset == 0);
+ layer = att->CubeMapFace;
+ } else {
+ layer = att->Zoffset;
+ }
+
+ if (!intel_image->mt) {
+ /* Fallback on drawing to a texture that doesn't have a miptree
+ * (has a border, width/height 0, etc.)
+ */
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+ else if (!irb) {
+ intel_miptree_check_level_layer(mt, att->TextureLevel, layer);
+
+ irb = (struct intel_renderbuffer *)intel_new_renderbuffer(ctx, ~0);
+
+ if (irb) {
+ /* bind the wrapper to the attachment point */
+ _mesa_reference_renderbuffer(&att->Renderbuffer, &irb->Base.Base);
+ }
+ else {
+ /* fallback to software rendering */
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+ }
+
+ if (!intel_renderbuffer_update_wrapper(intel, irb, image, layer)) {
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+
+ irb->tex_image = image;
+
+ DBG("Begin render %s texture tex=%u w=%d h=%d refcount=%d\n",
+ _mesa_get_format_name(image->TexFormat),
+ att->Texture->Name, image->Width, image->Height,
+ irb->Base.Base.RefCount);
+
+ /* update drawing region, etc */
+ intel_draw_buffer(ctx);
+}
+
+
+/**
+ * Called by Mesa when rendering to a texture is done.
+ */
+static void
+intel_finish_render_texture(struct gl_context * ctx,
+ struct gl_renderbuffer_attachment *att)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct gl_texture_object *tex_obj = att->Texture;
+ struct gl_texture_image *image =
+ tex_obj->Image[att->CubeMapFace][att->TextureLevel];
+ struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
+
+ DBG("Finish render %s texture tex=%u\n",
+ _mesa_get_format_name(image->TexFormat), att->Texture->Name);
+
+ if (irb)
+ irb->tex_image = NULL;
+
+ /* Since we've (probably) rendered to the texture and will (likely) use
+ * it in the texture domain later on in this batchbuffer, flush the
+ * batch. Once again, we wish for a domain tracker in libdrm to cover
+ * usage inside of a batchbuffer like GEM does in the kernel.
+ */
+ intel_batchbuffer_emit_mi_flush(intel);
+}
+
+/**
+ * Do additional "completeness" testing of a framebuffer object.
+ */
+static void
+intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ struct intel_context *intel = intel_context(ctx);
+ const struct intel_renderbuffer *depthRb =
+ intel_get_renderbuffer(fb, BUFFER_DEPTH);
+ const struct intel_renderbuffer *stencilRb =
+ intel_get_renderbuffer(fb, BUFFER_STENCIL);
+ struct intel_mipmap_tree *depth_mt = NULL, *stencil_mt = NULL;
+ int i;
+
+ DBG("%s() on fb %p (%s)\n", __FUNCTION__,
+ fb, (fb == ctx->DrawBuffer ? "drawbuffer" :
+ (fb == ctx->ReadBuffer ? "readbuffer" : "other buffer")));
+
+ if (depthRb)
+ depth_mt = depthRb->mt;
+ if (stencilRb) {
+ stencil_mt = stencilRb->mt;
+ if (stencil_mt->stencil_mt)
+ stencil_mt = stencil_mt->stencil_mt;
+ }
+
+ if (depth_mt && stencil_mt) {
+ if (depth_mt == stencil_mt) {
+ /* For true packed depth/stencil (not faked on prefers-separate-stencil
+ * hardware) we need to be sure they're the same level/layer, since
+ * we'll be emitting a single packet describing the packed setup.
+ */
+ if (depthRb->mt_level != stencilRb->mt_level ||
+ depthRb->mt_layer != stencilRb->mt_layer) {
+ DBG("depth image level/layer %d/%d != stencil image %d/%d\n",
+ depthRb->mt_level,
+ depthRb->mt_layer,
+ stencilRb->mt_level,
+ stencilRb->mt_layer);
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+ } else {
+ if (!intel->has_separate_stencil) {
+ DBG("separate stencil unsupported\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+ if (stencil_mt->format != MESA_FORMAT_S8) {
+ DBG("separate stencil is %s instead of S8\n",
+ _mesa_get_format_name(stencil_mt->format));
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+ if (intel->gen < 7 && depth_mt->hiz_mt == NULL) {
+ /* Before Gen7, separate depth and stencil buffers can be used
+ * only if HiZ is enabled. From the Sandybridge PRM, Volume 2,
+ * Part 1, Bit 3DSTATE_DEPTH_BUFFER.SeparateStencilBufferEnable:
+ * [DevSNB]: This field must be set to the same value (enabled
+ * or disabled) as Hierarchical Depth Buffer Enable.
+ */
+ DBG("separate stencil without HiZ\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;
+ }
+ }
+ }
+
+ for (i = 0; i < Elements(fb->Attachment); i++) {
+ struct gl_renderbuffer *rb;
+ struct intel_renderbuffer *irb;
+
+ if (fb->Attachment[i].Type == GL_NONE)
+ continue;
+
+ /* A supported attachment will have a Renderbuffer set either
+ * from being a Renderbuffer or being a texture that got the
+ * intel_wrap_texture() treatment.
+ */
+ rb = fb->Attachment[i].Renderbuffer;
+ if (rb == NULL) {
+ DBG("attachment without renderbuffer\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ continue;
+ }
+
+ if (fb->Attachment[i].Type == GL_TEXTURE) {
+ const struct gl_texture_image *img =
+ _mesa_get_attachment_teximage_const(&fb->Attachment[i]);
+
+ if (img->Border) {
+ DBG("texture with border\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ continue;
+ }
+ }
+
+ irb = intel_renderbuffer(rb);
+ if (irb == NULL) {
+ DBG("software rendering renderbuffer\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ continue;
+ }
+
+ if (!intel->vtbl.render_target_supported(intel, rb)) {
+ DBG("Unsupported HW texture/renderbuffer format attached: %s\n",
+ _mesa_get_format_name(intel_rb_format(irb)));
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+ }
+}
+
+/**
+ * Try to do a glBlitFramebuffer using glCopyTexSubImage2D
+ * We can do this when the dst renderbuffer is actually a texture and
+ * there is no scaling, mirroring or scissoring.
+ *
+ * \return new buffer mask indicating the buffers left to blit using the
+ * normal path.
+ */
+static GLbitfield
+intel_blit_framebuffer_copy_tex_sub_image(struct gl_context *ctx,
+ GLint srcX0, GLint srcY0,
+ GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0,
+ GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ const struct gl_framebuffer *drawFb = ctx->DrawBuffer;
+ const struct gl_framebuffer *readFb = ctx->ReadBuffer;
+ const struct gl_renderbuffer_attachment *drawAtt =
+ &drawFb->Attachment[drawFb->_ColorDrawBufferIndexes[0]];
+ struct intel_renderbuffer *srcRb =
+ intel_renderbuffer(readFb->_ColorReadBuffer);
+
+ /* If the source and destination are the same size with no
+ mirroring, the rectangles are within the size of the
+ texture and there is no scissor then we can use
+ glCopyTexSubimage2D to implement the blit. This will end
+ up as a fast hardware blit on some drivers */
+ if (srcRb && drawAtt && drawAtt->Texture &&
+ srcX0 - srcX1 == dstX0 - dstX1 &&
+ srcY0 - srcY1 == dstY0 - dstY1 &&
+ srcX1 >= srcX0 &&
+ srcY1 >= srcY0 &&
+ srcX0 >= 0 && srcX1 <= readFb->Width &&
+ srcY0 >= 0 && srcY1 <= readFb->Height &&
+ dstX0 >= 0 && dstX1 <= drawFb->Width &&
+ dstY0 >= 0 && dstY1 <= drawFb->Height &&
+ !ctx->Scissor.Enabled) {
+ const struct gl_texture_object *texObj = drawAtt->Texture;
+ const GLuint dstLevel = drawAtt->TextureLevel;
+ const GLenum target = texObj->Target;
+
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, dstLevel);
+
+ if (intel_copy_texsubimage(intel_context(ctx),
+ intel_texture_image(texImage),
+ dstX0, dstY0,
+ srcRb,
+ srcX0, srcY0,
+ srcX1 - srcX0, /* width */
+ srcY1 - srcY0))
+ mask &= ~GL_COLOR_BUFFER_BIT;
+ }
+ }
+
+ return mask;
+}
+
+static void
+intel_blit_framebuffer(struct gl_context *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ /* Try faster, glCopyTexSubImage2D approach first which uses the BLT. */
+ mask = intel_blit_framebuffer_copy_tex_sub_image(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+ if (mask == 0x0)
+ return;
+
+#ifndef I915
+ mask = brw_blorp_framebuffer(intel_context(ctx),
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+ if (mask == 0x0)
+ return;
+#endif
+
+ _mesa_meta_BlitFramebuffer(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+}
+
+/**
+ * This is a no-op except on multisample buffers shared with DRI2.
+ */
+void
+intel_renderbuffer_set_needs_downsample(struct intel_renderbuffer *irb)
+{
+ if (irb->mt && irb->mt->singlesample_mt)
+ irb->mt->need_downsample = true;
+}
+
+void
+intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb)
+{
+ if (irb->mt) {
+ intel_miptree_slice_set_needs_hiz_resolve(irb->mt,
+ irb->mt_level,
+ irb->mt_layer);
+ }
+}
+
+void
+intel_renderbuffer_set_needs_depth_resolve(struct intel_renderbuffer *irb)
+{
+ if (irb->mt) {
+ intel_miptree_slice_set_needs_depth_resolve(irb->mt,
+ irb->mt_level,
+ irb->mt_layer);
+ }
+}
+
+bool
+intel_renderbuffer_resolve_hiz(struct intel_context *intel,
+ struct intel_renderbuffer *irb)
+{
+ if (irb->mt)
+ return intel_miptree_slice_resolve_hiz(intel,
+ irb->mt,
+ irb->mt_level,
+ irb->mt_layer);
+
+ return false;
+}
+
+bool
+intel_renderbuffer_resolve_depth(struct intel_context *intel,
+ struct intel_renderbuffer *irb)
+{
+ if (irb->mt)
+ return intel_miptree_slice_resolve_depth(intel,
+ irb->mt,
+ irb->mt_level,
+ irb->mt_layer);
+
+ return false;
+}
+
+/**
+ * Do one-time context initializations related to GL_EXT_framebuffer_object.
+ * Hook in device driver functions.
+ */
+void
+intel_fbo_init(struct intel_context *intel)
+{
+ intel->ctx.Driver.NewFramebuffer = intel_new_framebuffer;
+ intel->ctx.Driver.NewRenderbuffer = intel_new_renderbuffer;
+ intel->ctx.Driver.MapRenderbuffer = intel_map_renderbuffer;
+ intel->ctx.Driver.UnmapRenderbuffer = intel_unmap_renderbuffer;
+ intel->ctx.Driver.BindFramebuffer = intel_bind_framebuffer;
+ intel->ctx.Driver.FramebufferRenderbuffer = intel_framebuffer_renderbuffer;
+ intel->ctx.Driver.RenderTexture = intel_render_texture;
+ intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
+ intel->ctx.Driver.ResizeBuffers = intel_resize_buffers;
+ intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer;
+ intel->ctx.Driver.BlitFramebuffer = intel_blit_framebuffer;
+
+#if FEATURE_OES_EGL_image
+ intel->ctx.Driver.EGLImageTargetRenderbufferStorage =
+ intel_image_target_renderbuffer_storage;
+#endif
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_mipmap_tree.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
index 242fed0b6ae..556a82fc7ff 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_mipmap_tree.c
@@ -1 +1,1711 @@
-../intel/intel_mipmap_tree.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <GL/gl.h>
+#include <GL/internal/dri_interface.h>
+
+#include "intel_batchbuffer.h"
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_resolve_map.h"
+#include "intel_span.h"
+#include "intel_tex_layout.h"
+#include "intel_tex.h"
+#include "intel_blit.h"
+
+#ifndef I915
+#include "brw_blorp.h"
+#endif
+
+#include "main/enums.h"
+#include "main/formats.h"
+#include "main/glformats.h"
+#include "main/texcompress_etc.h"
+#include "main/teximage.h"
+
+#define FILE_DEBUG_FLAG DEBUG_MIPTREE
+
+static GLenum
+target_to_target(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ return GL_TEXTURE_CUBE_MAP_ARB;
+ default:
+ return target;
+ }
+}
+
+/**
+ * @param for_region Indicates that the caller is
+ * intel_miptree_create_for_region(). If true, then do not create
+ * \c stencil_mt.
+ */
+static struct intel_mipmap_tree *
+intel_miptree_create_internal(struct intel_context *intel,
+ GLenum target,
+ gl_format format,
+ GLuint first_level,
+ GLuint last_level,
+ GLuint width0,
+ GLuint height0,
+ GLuint depth0,
+ bool for_region,
+ GLuint num_samples,
+ enum intel_msaa_layout msaa_layout)
+{
+ struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
+ int compress_byte = 0;
+
+ DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_get_format_name(format),
+ first_level, last_level, mt);
+
+ if (_mesa_is_format_compressed(format))
+ compress_byte = intel_compressed_num_bytes(format);
+
+ mt->target = target_to_target(target);
+ mt->format = format;
+ mt->first_level = first_level;
+ mt->last_level = last_level;
+ mt->width0 = width0;
+ mt->height0 = height0;
+ mt->cpp = compress_byte ? compress_byte : _mesa_get_format_bytes(mt->format);
+ mt->num_samples = num_samples;
+ mt->compressed = compress_byte ? 1 : 0;
+ mt->msaa_layout = msaa_layout;
+ mt->refcount = 1;
+
+ /* array_spacing_lod0 is only used for non-IMS MSAA surfaces. TODO: can we
+ * use it elsewhere?
+ */
+ switch (msaa_layout) {
+ case INTEL_MSAA_LAYOUT_NONE:
+ case INTEL_MSAA_LAYOUT_IMS:
+ mt->array_spacing_lod0 = false;
+ break;
+ case INTEL_MSAA_LAYOUT_UMS:
+ case INTEL_MSAA_LAYOUT_CMS:
+ mt->array_spacing_lod0 = true;
+ break;
+ }
+
+ if (target == GL_TEXTURE_CUBE_MAP) {
+ assert(depth0 == 1);
+ mt->depth0 = 6;
+ } else {
+ mt->depth0 = depth0;
+ }
+
+ if (!for_region &&
+ _mesa_is_depthstencil_format(_mesa_get_format_base_format(format)) &&
+ (intel->must_use_separate_stencil ||
+ (intel->has_separate_stencil &&
+ intel->vtbl.is_hiz_depth_format(intel, format)))) {
+ /* MSAA stencil surfaces always use IMS layout. */
+ enum intel_msaa_layout msaa_layout =
+ num_samples > 1 ? INTEL_MSAA_LAYOUT_IMS : INTEL_MSAA_LAYOUT_NONE;
+ mt->stencil_mt = intel_miptree_create(intel,
+ mt->target,
+ MESA_FORMAT_S8,
+ mt->first_level,
+ mt->last_level,
+ mt->width0,
+ mt->height0,
+ mt->depth0,
+ true,
+ num_samples,
+ msaa_layout);
+ if (!mt->stencil_mt) {
+ intel_miptree_release(&mt);
+ return NULL;
+ }
+
+ /* Fix up the Z miptree format for how we're splitting out separate
+ * stencil. Gen7 expects there to be no stencil bits in its depth buffer.
+ */
+ if (mt->format == MESA_FORMAT_S8_Z24) {
+ mt->format = MESA_FORMAT_X8_Z24;
+ } else if (mt->format == MESA_FORMAT_Z32_FLOAT_X24S8) {
+ mt->format = MESA_FORMAT_Z32_FLOAT;
+ mt->cpp = 4;
+ } else {
+ _mesa_problem(NULL, "Unknown format %s in separate stencil mt\n",
+ _mesa_get_format_name(mt->format));
+ }
+ }
+
+ intel_get_texture_alignment_unit(intel, mt->format,
+ &mt->align_w, &mt->align_h);
+
+#ifdef I915
+ (void) intel;
+ if (intel->is_945)
+ i945_miptree_layout(mt);
+ else
+ i915_miptree_layout(mt);
+#else
+ brw_miptree_layout(intel, mt);
+#endif
+
+ return mt;
+}
+
+
+struct intel_mipmap_tree *
+intel_miptree_create(struct intel_context *intel,
+ GLenum target,
+ gl_format format,
+ GLuint first_level,
+ GLuint last_level,
+ GLuint width0,
+ GLuint height0,
+ GLuint depth0,
+ bool expect_accelerated_upload,
+ GLuint num_samples,
+ enum intel_msaa_layout msaa_layout)
+{
+ struct intel_mipmap_tree *mt;
+ uint32_t tiling = I915_TILING_NONE;
+ GLenum base_format;
+ bool wraps_etc1 = false;
+ GLuint total_width, total_height;
+
+ if (format == MESA_FORMAT_ETC1_RGB8) {
+ format = MESA_FORMAT_RGBX8888_REV;
+ wraps_etc1 = true;
+ }
+
+ base_format = _mesa_get_format_base_format(format);
+
+ if (intel->use_texture_tiling && !_mesa_is_format_compressed(format)) {
+ if (intel->gen >= 4 &&
+ (base_format == GL_DEPTH_COMPONENT ||
+ base_format == GL_DEPTH_STENCIL_EXT))
+ tiling = I915_TILING_Y;
+ else if (msaa_layout != INTEL_MSAA_LAYOUT_NONE) {
+ /* From p82 of the Sandy Bridge PRM, dw3[1] of SURFACE_STATE ("Tiled
+ * Surface"):
+ *
+ * [DevSNB+]: For multi-sample render targets, this field must be
+ * 1. MSRTs can only be tiled.
+ *
+ * Our usual reason for preferring X tiling (fast blits using the
+ * blitting engine) doesn't apply to MSAA, since we'll generally be
+ * downsampling or upsampling when blitting between the MSAA buffer
+ * and another buffer, and the blitting engine doesn't support that.
+ * So use Y tiling, since it makes better use of the cache.
+ */
+ tiling = I915_TILING_Y;
+ } else if (width0 >= 64)
+ tiling = I915_TILING_X;
+ }
+
+ mt = intel_miptree_create_internal(intel, target, format,
+ first_level, last_level, width0,
+ height0, depth0,
+ false, num_samples, msaa_layout);
+ /*
+ * pitch == 0 || height == 0 indicates the null texture
+ */
+ if (!mt || !mt->total_width || !mt->total_height) {
+ intel_miptree_release(&mt);
+ return NULL;
+ }
+
+ total_width = mt->total_width;
+ total_height = mt->total_height;
+
+ if (format == MESA_FORMAT_S8) {
+ /* The stencil buffer is W tiled. However, we request from the kernel a
+ * non-tiled buffer because the GTT is incapable of W fencing. So round
+ * up the width and height to match the size of W tiles (64x64).
+ */
+ tiling = I915_TILING_NONE;
+ total_width = ALIGN(total_width, 64);
+ total_height = ALIGN(total_height, 64);
+ }
+
+ mt->wraps_etc1 = wraps_etc1;
+ mt->region = intel_region_alloc(intel->intelScreen,
+ tiling,
+ mt->cpp,
+ total_width,
+ total_height,
+ expect_accelerated_upload);
+ mt->offset = 0;
+
+ if (!mt->region) {
+ intel_miptree_release(&mt);
+ return NULL;
+ }
+
+ return mt;
+}
+
+
+struct intel_mipmap_tree *
+intel_miptree_create_for_region(struct intel_context *intel,
+ GLenum target,
+ gl_format format,
+ struct intel_region *region)
+{
+ struct intel_mipmap_tree *mt;
+
+ mt = intel_miptree_create_internal(intel, target, format,
+ 0, 0,
+ region->width, region->height, 1,
+ true, 0 /* num_samples */,
+ INTEL_MSAA_LAYOUT_NONE);
+ if (!mt)
+ return mt;
+
+ intel_region_reference(&mt->region, region);
+
+ return mt;
+}
+
+/**
+ * Determine which MSAA layout should be used by the MSAA surface being
+ * created, based on the chip generation and the surface type.
+ */
+static enum intel_msaa_layout
+compute_msaa_layout(struct intel_context *intel, gl_format format)
+{
+ /* Prior to Gen7, all MSAA surfaces used IMS layout. */
+ if (intel->gen < 7)
+ return INTEL_MSAA_LAYOUT_IMS;
+
+ /* In Gen7, IMS layout is only used for depth and stencil buffers. */
+ switch (_mesa_get_format_base_format(format)) {
+ case GL_DEPTH_COMPONENT:
+ case GL_STENCIL_INDEX:
+ case GL_DEPTH_STENCIL:
+ return INTEL_MSAA_LAYOUT_IMS;
+ default:
+ /* From the Ivy Bridge PRM, Vol4 Part1 p77 ("MCS Enable"):
+ *
+ * This field must be set to 0 for all SINT MSRTs when all RT channels
+ * are not written
+ *
+ * In practice this means that we have to disable MCS for all signed
+ * integer MSAA buffers. The alternative, to disable MCS only when one
+ * of the render target channels is disabled, is impractical because it
+ * would require converting between CMS and UMS MSAA layouts on the fly,
+ * which is expensive.
+ */
+ if (_mesa_get_format_datatype(format) == GL_INT) {
+ /* TODO: is this workaround needed for future chipsets? */
+ assert(intel->gen == 7);
+ return INTEL_MSAA_LAYOUT_UMS;
+ } else {
+ return INTEL_MSAA_LAYOUT_CMS;
+ }
+ }
+}
+
+/**
+ * For a singlesample DRI2 buffer, this simply wraps the given region with a miptree.
+ *
+ * For a multisample DRI2 buffer, this wraps the given region with
+ * a singlesample miptree, then creates a multisample miptree into which the
+ * singlesample miptree is embedded as a child.
+ */
+struct intel_mipmap_tree*
+intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
+ unsigned dri_attachment,
+ gl_format format,
+ uint32_t num_samples,
+ struct intel_region *region)
+{
+ struct intel_mipmap_tree *singlesample_mt = NULL;
+ struct intel_mipmap_tree *multisample_mt = NULL;
+ GLenum base_format = _mesa_get_format_base_format(format);
+
+ /* Only the front and back buffers, which are color buffers, are shared
+ * through DRI2.
+ */
+ assert(dri_attachment == __DRI_BUFFER_BACK_LEFT ||
+ dri_attachment == __DRI_BUFFER_FRONT_LEFT ||
+ dri_attachment == __DRI_BUFFER_FAKE_FRONT_LEFT);
+ assert(base_format == GL_RGB || base_format == GL_RGBA);
+
+ singlesample_mt = intel_miptree_create_for_region(intel, GL_TEXTURE_2D,
+ format, region);
+ if (!singlesample_mt)
+ return NULL;
+
+ if (num_samples == 0)
+ return singlesample_mt;
+
+ multisample_mt = intel_miptree_create_for_renderbuffer(intel,
+ format,
+ region->width,
+ region->height,
+ num_samples);
+ if (!multisample_mt) {
+ intel_miptree_release(&singlesample_mt);
+ return NULL;
+ }
+
+ multisample_mt->singlesample_mt = singlesample_mt;
+ multisample_mt->need_downsample = false;
+
+ if (intel->is_front_buffer_rendering &&
+ (dri_attachment == __DRI_BUFFER_FRONT_LEFT ||
+ dri_attachment == __DRI_BUFFER_FAKE_FRONT_LEFT)) {
+ intel_miptree_upsample(intel, multisample_mt);
+ }
+
+ return multisample_mt;
+}
+
+struct intel_mipmap_tree*
+intel_miptree_create_for_renderbuffer(struct intel_context *intel,
+ gl_format format,
+ uint32_t width,
+ uint32_t height,
+ uint32_t num_samples)
+{
+ struct intel_mipmap_tree *mt;
+ uint32_t depth = 1;
+ enum intel_msaa_layout msaa_layout = INTEL_MSAA_LAYOUT_NONE;
+ const uint32_t singlesample_width = width;
+ const uint32_t singlesample_height = height;
+ bool ok;
+
+ if (num_samples > 1) {
+ /* Adjust width/height/depth for MSAA */
+ msaa_layout = compute_msaa_layout(intel, format);
+ if (msaa_layout == INTEL_MSAA_LAYOUT_IMS) {
+ /* In the Sandy Bridge PRM, volume 4, part 1, page 31, it says:
+ *
+ * "Any of the other messages (sample*, LOD, load4) used with a
+ * (4x) multisampled surface will in-effect sample a surface with
+ * double the height and width as that indicated in the surface
+ * state. Each pixel position on the original-sized surface is
+ * replaced with a 2x2 of samples with the following arrangement:
+ *
+ * sample 0 sample 2
+ * sample 1 sample 3"
+ *
+ * Thus, when sampling from a multisampled texture, it behaves as
+ * though the layout in memory for (x,y,sample) is:
+ *
+ * (0,0,0) (0,0,2) (1,0,0) (1,0,2)
+ * (0,0,1) (0,0,3) (1,0,1) (1,0,3)
+ *
+ * (0,1,0) (0,1,2) (1,1,0) (1,1,2)
+ * (0,1,1) (0,1,3) (1,1,1) (1,1,3)
+ *
+ * However, the actual layout of multisampled data in memory is:
+ *
+ * (0,0,0) (1,0,0) (0,0,1) (1,0,1)
+ * (0,1,0) (1,1,0) (0,1,1) (1,1,1)
+ *
+ * (0,0,2) (1,0,2) (0,0,3) (1,0,3)
+ * (0,1,2) (1,1,2) (0,1,3) (1,1,3)
+ *
+ * This pattern repeats for each 2x2 pixel block.
+ *
+ * As a result, when calculating the size of our 4-sample buffer for
+ * an odd width or height, we have to align before scaling up because
+ * sample 3 is in that bottom right 2x2 block.
+ */
+ switch (num_samples) {
+ case 4:
+ width = ALIGN(width, 2) * 2;
+ height = ALIGN(height, 2) * 2;
+ break;
+ case 8:
+ width = ALIGN(width, 2) * 4;
+ height = ALIGN(height, 2) * 2;
+ break;
+ default:
+ /* num_samples should already have been quantized to 0, 1, 4, or
+ * 8.
+ */
+ assert(false);
+ }
+ } else {
+ /* Non-interleaved */
+ depth = num_samples;
+ }
+ }
+
+ mt = intel_miptree_create(intel, GL_TEXTURE_2D, format, 0, 0,
+ width, height, depth, true, num_samples,
+ msaa_layout);
+ if (!mt)
+ goto fail;
+
+ if (intel->vtbl.is_hiz_depth_format(intel, format)) {
+ ok = intel_miptree_alloc_hiz(intel, mt, num_samples);
+ if (!ok)
+ goto fail;
+ }
+
+ if (mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
+ ok = intel_miptree_alloc_mcs(intel, mt, num_samples);
+ if (!ok)
+ goto fail;
+ }
+
+ mt->singlesample_width0 = singlesample_width;
+ mt->singlesample_height0 = singlesample_height;
+
+ return mt;
+
+fail:
+ intel_miptree_release(&mt);
+ return NULL;
+}
+
+void
+intel_miptree_reference(struct intel_mipmap_tree **dst,
+ struct intel_mipmap_tree *src)
+{
+ if (*dst == src)
+ return;
+
+ intel_miptree_release(dst);
+
+ if (src) {
+ src->refcount++;
+ DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount);
+ }
+
+ *dst = src;
+}
+
+
+void
+intel_miptree_release(struct intel_mipmap_tree **mt)
+{
+ if (!*mt)
+ return;
+
+ DBG("%s %p refcount will be %d\n", __FUNCTION__, *mt, (*mt)->refcount - 1);
+ if (--(*mt)->refcount <= 0) {
+ GLuint i;
+
+ DBG("%s deleting %p\n", __FUNCTION__, *mt);
+
+ intel_region_release(&((*mt)->region));
+ intel_miptree_release(&(*mt)->stencil_mt);
+ intel_miptree_release(&(*mt)->hiz_mt);
+ intel_miptree_release(&(*mt)->mcs_mt);
+ intel_miptree_release(&(*mt)->singlesample_mt);
+ intel_resolve_map_clear(&(*mt)->hiz_map);
+
+ for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
+ free((*mt)->level[i].slice);
+ }
+
+ free(*mt);
+ }
+ *mt = NULL;
+}
+
+void
+intel_miptree_get_dimensions_for_image(struct gl_texture_image *image,
+ int *width, int *height, int *depth)
+{
+ switch (image->TexObject->Target) {
+ case GL_TEXTURE_1D_ARRAY:
+ *width = image->Width;
+ *height = 1;
+ *depth = image->Height;
+ break;
+ default:
+ *width = image->Width;
+ *height = image->Height;
+ *depth = image->Depth;
+ break;
+ }
+}
+
+/**
+ * Can the image be pulled into a unified mipmap tree? This mirrors
+ * the completeness test in a lot of ways.
+ *
+ * Not sure whether I want to pass gl_texture_image here.
+ */
+bool
+intel_miptree_match_image(struct intel_mipmap_tree *mt,
+ struct gl_texture_image *image)
+{
+ struct intel_texture_image *intelImage = intel_texture_image(image);
+ GLuint level = intelImage->base.Base.Level;
+ int width, height, depth;
+
+ if (target_to_target(image->TexObject->Target) != mt->target)
+ return false;
+
+ if (image->TexFormat != mt->format &&
+ !(image->TexFormat == MESA_FORMAT_S8_Z24 &&
+ mt->format == MESA_FORMAT_X8_Z24 &&
+ mt->stencil_mt)) {
+ return false;
+ }
+
+ intel_miptree_get_dimensions_for_image(image, &width, &height, &depth);
+
+ if (mt->target == GL_TEXTURE_CUBE_MAP)
+ depth = 6;
+
+ /* Test image dimensions against the base level image adjusted for
+ * minification. This will also catch images not present in the
+ * tree, changed targets, etc.
+ */
+ if (width != mt->level[level].width ||
+ height != mt->level[level].height ||
+ depth != mt->level[level].depth)
+ return false;
+
+ return true;
+}
+
+
+void
+intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
+ GLuint level,
+ GLuint x, GLuint y,
+ GLuint w, GLuint h, GLuint d)
+{
+ mt->level[level].width = w;
+ mt->level[level].height = h;
+ mt->level[level].depth = d;
+ mt->level[level].level_x = x;
+ mt->level[level].level_y = y;
+
+ DBG("%s level %d size: %d,%d,%d offset %d,%d\n", __FUNCTION__,
+ level, w, h, d, x, y);
+
+ assert(mt->level[level].slice == NULL);
+
+ mt->level[level].slice = calloc(d, sizeof(*mt->level[0].slice));
+ mt->level[level].slice[0].x_offset = mt->level[level].level_x;
+ mt->level[level].slice[0].y_offset = mt->level[level].level_y;
+}
+
+
+void
+intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
+ GLuint level, GLuint img,
+ GLuint x, GLuint y)
+{
+ if (img == 0 && level == 0)
+ assert(x == 0 && y == 0);
+
+ assert(img < mt->level[level].depth);
+
+ mt->level[level].slice[img].x_offset = mt->level[level].level_x + x;
+ mt->level[level].slice[img].y_offset = mt->level[level].level_y + y;
+
+ DBG("%s level %d img %d pos %d,%d\n",
+ __FUNCTION__, level, img,
+ mt->level[level].slice[img].x_offset,
+ mt->level[level].slice[img].y_offset);
+}
+
+
+/**
+ * For cube map textures, either the \c face parameter can be used, of course,
+ * or the cube face can be interpreted as a depth layer and the \c layer
+ * parameter used.
+ */
+void
+intel_miptree_get_image_offset(struct intel_mipmap_tree *mt,
+ GLuint level, GLuint face, GLuint layer,
+ GLuint *x, GLuint *y)
+{
+ int slice;
+
+ if (face > 0) {
+ assert(mt->target == GL_TEXTURE_CUBE_MAP);
+ assert(face < 6);
+ assert(layer == 0);
+ slice = face;
+ } else {
+ /* This branch may be taken even if the texture target is a cube map. In
+ * that case, the caller chose to interpret each cube face as a layer.
+ */
+ assert(face == 0);
+ slice = layer;
+ }
+
+ *x = mt->level[level].slice[slice].x_offset;
+ *y = mt->level[level].slice[slice].y_offset;
+}
+
+static void
+intel_miptree_copy_slice(struct intel_context *intel,
+ struct intel_mipmap_tree *dst_mt,
+ struct intel_mipmap_tree *src_mt,
+ int level,
+ int face,
+ int depth)
+
+{
+ gl_format format = src_mt->format;
+ uint32_t width = src_mt->level[level].width;
+ uint32_t height = src_mt->level[level].height;
+
+ assert(depth < src_mt->level[level].depth);
+
+ if (dst_mt->compressed) {
+ height = ALIGN(height, dst_mt->align_h) / dst_mt->align_h;
+ width = ALIGN(width, dst_mt->align_w);
+ }
+
+ uint32_t dst_x, dst_y, src_x, src_y;
+ intel_miptree_get_image_offset(dst_mt, level, face, depth,
+ &dst_x, &dst_y);
+ intel_miptree_get_image_offset(src_mt, level, face, depth,
+ &src_x, &src_y);
+
+ DBG("validate blit mt %p %d,%d/%d -> mt %p %d,%d/%d (%dx%d)\n",
+ src_mt, src_x, src_y, src_mt->region->pitch * src_mt->region->cpp,
+ dst_mt, dst_x, dst_y, dst_mt->region->pitch * dst_mt->region->cpp,
+ width, height);
+
+ if (!intelEmitCopyBlit(intel,
+ dst_mt->region->cpp,
+ src_mt->region->pitch, src_mt->region->bo,
+ 0, src_mt->region->tiling,
+ dst_mt->region->pitch, dst_mt->region->bo,
+ 0, dst_mt->region->tiling,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ GL_COPY)) {
+
+ fallback_debug("miptree validate blit for %s failed\n",
+ _mesa_get_format_name(format));
+ void *dst = intel_region_map(intel, dst_mt->region, GL_MAP_WRITE_BIT);
+ void *src = intel_region_map(intel, src_mt->region, GL_MAP_READ_BIT);
+
+ _mesa_copy_rect(dst,
+ dst_mt->cpp,
+ dst_mt->region->pitch,
+ dst_x, dst_y,
+ width, height,
+ src, src_mt->region->pitch,
+ src_x, src_y);
+
+ intel_region_unmap(intel, dst_mt->region);
+ intel_region_unmap(intel, src_mt->region);
+ }
+
+ if (src_mt->stencil_mt) {
+ intel_miptree_copy_slice(intel,
+ dst_mt->stencil_mt, src_mt->stencil_mt,
+ level, face, depth);
+ }
+}
+
+/**
+ * Copies the image's current data to the given miptree, and associates that
+ * miptree with the image.
+ */
+void
+intel_miptree_copy_teximage(struct intel_context *intel,
+ struct intel_texture_image *intelImage,
+ struct intel_mipmap_tree *dst_mt)
+{
+ struct intel_mipmap_tree *src_mt = intelImage->mt;
+ int level = intelImage->base.Base.Level;
+ int face = intelImage->base.Base.Face;
+ GLuint depth = intelImage->base.Base.Depth;
+
+ for (int slice = 0; slice < depth; slice++) {
+ intel_miptree_copy_slice(intel, dst_mt, src_mt, level, face, slice);
+ }
+
+ intel_miptree_reference(&intelImage->mt, dst_mt);
+}
+
+bool
+intel_miptree_alloc_mcs(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ GLuint num_samples)
+{
+ assert(mt->mcs_mt == NULL);
+ assert(intel->gen >= 7); /* MCS only used on Gen7+ */
+
+ /* Choose the correct format for the MCS buffer. All that really matters
+ * is that we allocate the right buffer size, since we'll always be
+ * accessing this miptree using MCS-specific hardware mechanisms, which
+ * infer the correct format based on num_samples.
+ */
+ gl_format format;
+ switch (num_samples) {
+ case 4:
+ /* 8 bits/pixel are required for MCS data when using 4x MSAA (2 bits for
+ * each sample).
+ */
+ format = MESA_FORMAT_R8;
+ break;
+ case 8:
+ /* 32 bits/pixel are required for MCS data when using 8x MSAA (3 bits
+ * for each sample, plus 8 padding bits).
+ */
+ format = MESA_FORMAT_R_UINT32;
+ break;
+ default:
+ assert(!"Unrecognized sample count in intel_miptree_alloc_mcs");
+ break;
+ };
+
+ /* From the Ivy Bridge PRM, Vol4 Part1 p76, "MCS Base Address":
+ *
+ * "The MCS surface must be stored as Tile Y."
+ *
+ * We set msaa_format to INTEL_MSAA_LAYOUT_CMS to force
+ * intel_miptree_create() to use Y tiling. msaa_format is otherwise
+ * ignored for the MCS miptree.
+ */
+ mt->mcs_mt = intel_miptree_create(intel,
+ mt->target,
+ format,
+ mt->first_level,
+ mt->last_level,
+ mt->width0,
+ mt->height0,
+ mt->depth0,
+ true,
+ 0 /* num_samples */,
+ INTEL_MSAA_LAYOUT_CMS);
+
+ /* From the Ivy Bridge PRM, Vol 2 Part 1 p326:
+ *
+ * When MCS buffer is enabled and bound to MSRT, it is required that it
+ * is cleared prior to any rendering.
+ *
+ * Since we don't use the MCS buffer for any purpose other than rendering,
+ * it makes sense to just clear it immediately upon allocation.
+ *
+ * Note: the clear value for MCS buffers is all 1's, so we memset to 0xff.
+ */
+ void *data = intel_region_map(intel, mt->mcs_mt->region, 0);
+ memset(data, 0xff, mt->mcs_mt->region->bo->size);
+ intel_region_unmap(intel, mt->mcs_mt->region);
+
+ return mt->mcs_mt;
+}
+
+bool
+intel_miptree_alloc_hiz(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ GLuint num_samples)
+{
+ assert(mt->hiz_mt == NULL);
+ /* MSAA HiZ surfaces always use IMS layout. */
+ mt->hiz_mt = intel_miptree_create(intel,
+ mt->target,
+ MESA_FORMAT_X8_Z24,
+ mt->first_level,
+ mt->last_level,
+ mt->width0,
+ mt->height0,
+ mt->depth0,
+ true,
+ num_samples,
+ INTEL_MSAA_LAYOUT_IMS);
+
+ if (!mt->hiz_mt)
+ return false;
+
+ /* Mark that all slices need a HiZ resolve. */
+ struct intel_resolve_map *head = &mt->hiz_map;
+ for (int level = mt->first_level; level <= mt->last_level; ++level) {
+ for (int layer = 0; layer < mt->level[level].depth; ++layer) {
+ head->next = malloc(sizeof(*head->next));
+ head->next->prev = head;
+ head->next->next = NULL;
+ head = head->next;
+
+ head->level = level;
+ head->layer = layer;
+ head->need = GEN6_HIZ_OP_HIZ_RESOLVE;
+ }
+ }
+
+ return true;
+}
+
+void
+intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer)
+{
+ intel_miptree_check_level_layer(mt, level, layer);
+
+ if (!mt->hiz_mt)
+ return;
+
+ intel_resolve_map_set(&mt->hiz_map,
+ level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
+}
+
+
+void
+intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer)
+{
+ intel_miptree_check_level_layer(mt, level, layer);
+
+ if (!mt->hiz_mt)
+ return;
+
+ intel_resolve_map_set(&mt->hiz_map,
+ level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
+}
+
+static bool
+intel_miptree_slice_resolve(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer,
+ enum gen6_hiz_op need)
+{
+ intel_miptree_check_level_layer(mt, level, layer);
+
+ struct intel_resolve_map *item =
+ intel_resolve_map_get(&mt->hiz_map, level, layer);
+
+ if (!item || item->need != need)
+ return false;
+
+ intel_hiz_exec(intel, mt, level, layer, need);
+ intel_resolve_map_remove(item);
+ return true;
+}
+
+bool
+intel_miptree_slice_resolve_hiz(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer)
+{
+ return intel_miptree_slice_resolve(intel, mt, level, layer,
+ GEN6_HIZ_OP_HIZ_RESOLVE);
+}
+
+bool
+intel_miptree_slice_resolve_depth(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer)
+{
+ return intel_miptree_slice_resolve(intel, mt, level, layer,
+ GEN6_HIZ_OP_DEPTH_RESOLVE);
+}
+
+static bool
+intel_miptree_all_slices_resolve(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ enum gen6_hiz_op need)
+{
+ bool did_resolve = false;
+ struct intel_resolve_map *i, *next;
+
+ for (i = mt->hiz_map.next; i; i = next) {
+ next = i->next;
+ if (i->need != need)
+ continue;
+
+ intel_hiz_exec(intel, mt, i->level, i->layer, need);
+ intel_resolve_map_remove(i);
+ did_resolve = true;
+ }
+
+ return did_resolve;
+}
+
+bool
+intel_miptree_all_slices_resolve_hiz(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ return intel_miptree_all_slices_resolve(intel, mt,
+ GEN6_HIZ_OP_HIZ_RESOLVE);
+}
+
+bool
+intel_miptree_all_slices_resolve_depth(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ return intel_miptree_all_slices_resolve(intel, mt,
+ GEN6_HIZ_OP_DEPTH_RESOLVE);
+}
+
+static void
+intel_miptree_updownsample(struct intel_context *intel,
+ struct intel_mipmap_tree *src,
+ struct intel_mipmap_tree *dst,
+ unsigned width,
+ unsigned height)
+{
+#ifndef I915
+ int src_x0 = 0;
+ int src_y0 = 0;
+ int dst_x0 = 0;
+ int dst_y0 = 0;
+
+ intel_miptree_slice_resolve_depth(intel, src, 0, 0);
+ intel_miptree_slice_resolve_depth(intel, dst, 0, 0);
+
+ brw_blorp_blit_miptrees(intel,
+ src, 0 /* level */, 0 /* layer */,
+ dst, 0 /* level */, 0 /* layer */,
+ src_x0, src_y0,
+ dst_x0, dst_y0,
+ width, height,
+ false, false /*mirror x, y*/);
+
+ if (src->stencil_mt) {
+ brw_blorp_blit_miptrees(intel,
+ src->stencil_mt, 0 /* level */, 0 /* layer */,
+ dst->stencil_mt, 0 /* level */, 0 /* layer */,
+ src_x0, src_y0,
+ dst_x0, dst_y0,
+ width, height,
+ false, false /*mirror x, y*/);
+ }
+#endif /* I915 */
+}
+
+static void
+assert_is_flat(struct intel_mipmap_tree *mt)
+{
+ assert(mt->target == GL_TEXTURE_2D);
+ assert(mt->first_level == 0);
+ assert(mt->last_level == 0);
+}
+
+/**
+ * \brief Downsample from mt to mt->singlesample_mt.
+ *
+ * If the miptree needs no downsample, then skip.
+ */
+void
+intel_miptree_downsample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ /* Only flat, renderbuffer-like miptrees are supported. */
+ assert_is_flat(mt);
+
+ if (!mt->need_downsample)
+ return;
+ intel_miptree_updownsample(intel,
+ mt, mt->singlesample_mt,
+ mt->singlesample_mt->width0,
+ mt->singlesample_mt->height0);
+ mt->need_downsample = false;
+
+ /* Strictly speaking, after a downsample on a depth miptree, a hiz
+ * resolve is needed on the singlesample miptree. However, since the
+ * singlesample miptree is never rendered to, the hiz resolve will never
+ * occur. Therefore we do not mark the needed hiz resolve after
+ * downsampling.
+ */
+}
+
+/**
+ * \brief Upsample from mt->singlesample_mt to mt.
+ *
+ * The upsample is done unconditionally.
+ */
+void
+intel_miptree_upsample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ /* Only flat, renderbuffer-like miptrees are supported. */
+ assert_is_flat(mt);
+ assert(!mt->need_downsample);
+
+ intel_miptree_updownsample(intel,
+ mt->singlesample_mt, mt,
+ mt->singlesample_mt->width0,
+ mt->singlesample_mt->height0);
+ intel_miptree_slice_set_needs_hiz_resolve(mt, 0, 0);
+}
+
+static void
+intel_miptree_map_gtt(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
+{
+ unsigned int bw, bh;
+ void *base;
+ unsigned int image_x, image_y;
+ int x = map->x;
+ int y = map->y;
+
+ /* For compressed formats, the stride is the number of bytes per
+ * row of blocks. intel_miptree_get_image_offset() already does
+ * the divide.
+ */
+ _mesa_get_format_block_size(mt->format, &bw, &bh);
+ assert(y % bh == 0);
+ y /= bh;
+
+ base = intel_region_map(intel, mt->region, map->mode);
+
+ if (base == NULL)
+ map->ptr = NULL;
+ else {
+ /* Note that in the case of cube maps, the caller must have passed the
+ * slice number referencing the face.
+ */
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+ x += image_x;
+ y += image_y;
+
+ map->stride = mt->region->pitch * mt->cpp;
+ map->ptr = base + y * map->stride + x * mt->cpp;
+ }
+
+ DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, _mesa_get_format_name(mt->format),
+ x, y, map->ptr, map->stride);
+}
+
+static void
+intel_miptree_unmap_gtt(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ intel_region_unmap(intel, mt->region);
+}
+
+static void
+intel_miptree_map_blit(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
+{
+ unsigned int image_x, image_y;
+ int x = map->x;
+ int y = map->y;
+ int ret;
+
+ /* The blitter requires the pitch to be aligned to 4. */
+ map->stride = ALIGN(map->w * mt->region->cpp, 4);
+
+ map->bo = drm_intel_bo_alloc(intel->bufmgr, "intel_miptree_map_blit() temp",
+ map->stride * map->h, 4096);
+ if (!map->bo) {
+ fprintf(stderr, "Failed to allocate blit temporary\n");
+ goto fail;
+ }
+
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+ x += image_x;
+ y += image_y;
+
+ if (!intelEmitCopyBlit(intel,
+ mt->region->cpp,
+ mt->region->pitch, mt->region->bo,
+ 0, mt->region->tiling,
+ map->stride / mt->region->cpp, map->bo,
+ 0, I915_TILING_NONE,
+ x, y,
+ 0, 0,
+ map->w, map->h,
+ GL_COPY)) {
+ fprintf(stderr, "Failed to blit\n");
+ goto fail;
+ }
+
+ intel_batchbuffer_flush(intel);
+ ret = drm_intel_bo_map(map->bo, (map->mode & GL_MAP_WRITE_BIT) != 0);
+ if (ret) {
+ fprintf(stderr, "Failed to map blit temporary\n");
+ goto fail;
+ }
+
+ map->ptr = map->bo->virtual;
+
+ DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, _mesa_get_format_name(mt->format),
+ x, y, map->ptr, map->stride);
+
+ return;
+
+fail:
+ drm_intel_bo_unreference(map->bo);
+ map->ptr = NULL;
+ map->stride = 0;
+}
+
+static void
+intel_miptree_unmap_blit(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ assert(!(map->mode & GL_MAP_WRITE_BIT));
+
+ drm_intel_bo_unmap(map->bo);
+ drm_intel_bo_unreference(map->bo);
+}
+
+static void
+intel_miptree_map_s8(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
+{
+ map->stride = map->w;
+ map->buffer = map->ptr = malloc(map->stride * map->h);
+ if (!map->buffer)
+ return;
+
+ /* One of either READ_BIT or WRITE_BIT or both is set. READ_BIT implies no
+ * INVALIDATE_RANGE_BIT. WRITE_BIT needs the original values read in unless
+ * invalidate is set, since we'll be writing the whole rectangle from our
+ * temporary buffer back out.
+ */
+ if (!(map->mode & GL_MAP_INVALIDATE_RANGE_BIT)) {
+ uint8_t *untiled_s8_map = map->ptr;
+ uint8_t *tiled_s8_map = intel_region_map(intel, mt->region,
+ GL_MAP_READ_BIT);
+ unsigned int image_x, image_y;
+
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+
+ for (uint32_t y = 0; y < map->h; y++) {
+ for (uint32_t x = 0; x < map->w; x++) {
+ ptrdiff_t offset = intel_offset_S8(mt->region->pitch,
+ x + image_x + map->x,
+ y + image_y + map->y,
+ intel->has_swizzling);
+ untiled_s8_map[y * map->w + x] = tiled_s8_map[offset];
+ }
+ }
+
+ intel_region_unmap(intel, mt->region);
+
+ DBG("%s: %d,%d %dx%d from mt %p %d,%d = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, map->x + image_x, map->y + image_y, map->ptr, map->stride);
+ } else {
+ DBG("%s: %d,%d %dx%d from mt %p = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, map->ptr, map->stride);
+ }
+}
+
+static void
+intel_miptree_unmap_s8(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ if (map->mode & GL_MAP_WRITE_BIT) {
+ unsigned int image_x, image_y;
+ uint8_t *untiled_s8_map = map->ptr;
+ uint8_t *tiled_s8_map = intel_region_map(intel, mt->region, map->mode);
+
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+
+ for (uint32_t y = 0; y < map->h; y++) {
+ for (uint32_t x = 0; x < map->w; x++) {
+ ptrdiff_t offset = intel_offset_S8(mt->region->pitch,
+ x + map->x,
+ y + map->y,
+ intel->has_swizzling);
+ tiled_s8_map[offset] = untiled_s8_map[y * map->w + x];
+ }
+ }
+
+ intel_region_unmap(intel, mt->region);
+ }
+
+ free(map->buffer);
+}
+
+static void
+intel_miptree_map_etc1(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ /* For justification of these invariants,
+ * see intel_mipmap_tree:wraps_etc1.
+ */
+ assert(mt->wraps_etc1);
+ assert(mt->format == MESA_FORMAT_RGBX8888_REV);
+
+ /* From the GL_OES_compressed_ETC1_RGB8_texture spec:
+ * INVALID_OPERATION is generated by CompressedTexSubImage2D,
+ * TexSubImage2D, or CopyTexSubImage2D if the texture image <level>
+ * bound to <target> has internal format ETC1_RGB8_OES.
+ *
+ * This implies that intel_miptree_map_etc1() can only be called from
+ * glCompressedTexImage2D, and hence the assertions below hold.
+ */
+ assert(map->mode & GL_MAP_WRITE_BIT);
+ assert(map->mode & GL_MAP_INVALIDATE_RANGE_BIT);
+ assert(map->x == 0);
+ assert(map->y == 0);
+
+ /* Each ETC1 block contains 4x4 pixels in 8 bytes. */
+ map->stride = 2 * map->w;
+ map->buffer = map->ptr = malloc(map->stride * map->h);
+}
+
+static void
+intel_miptree_unmap_etc1(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ uint32_t image_x;
+ uint32_t image_y;
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+
+ uint8_t *xbgr = intel_region_map(intel, mt->region, map->mode)
+ + image_y * mt->region->pitch * mt->region->cpp
+ + image_x * mt->region->cpp;
+
+ _mesa_etc1_unpack_rgba8888(xbgr, mt->region->pitch * mt->region->cpp,
+ map->ptr, map->stride,
+ map->w, map->h);
+
+ intel_region_unmap(intel, mt->region);
+ free(map->buffer);
+}
+
+/**
+ * Mapping function for packed depth/stencil miptrees backed by real separate
+ * miptrees for depth and stencil.
+ *
+ * On gen7, and to support HiZ pre-gen7, we have to have the stencil buffer
+ * separate from the depth buffer. Yet at the GL API level, we have to expose
+ * packed depth/stencil textures and FBO attachments, and Mesa core expects to
+ * be able to map that memory for texture storage and glReadPixels-type
+ * operations. We give Mesa core that access by mallocing a temporary and
+ * copying the data between the actual backing store and the temporary.
+ */
+static void
+intel_miptree_map_depthstencil(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
+{
+ struct intel_mipmap_tree *z_mt = mt;
+ struct intel_mipmap_tree *s_mt = mt->stencil_mt;
+ bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z32_FLOAT;
+ int packed_bpp = map_z32f_x24s8 ? 8 : 4;
+
+ map->stride = map->w * packed_bpp;
+ map->buffer = map->ptr = malloc(map->stride * map->h);
+ if (!map->buffer)
+ return;
+
+ /* One of either READ_BIT or WRITE_BIT or both is set. READ_BIT implies no
+ * INVALIDATE_RANGE_BIT. WRITE_BIT needs the original values read in unless
+ * invalidate is set, since we'll be writing the whole rectangle from our
+ * temporary buffer back out.
+ */
+ if (!(map->mode & GL_MAP_INVALIDATE_RANGE_BIT)) {
+ uint32_t *packed_map = map->ptr;
+ uint8_t *s_map = intel_region_map(intel, s_mt->region, GL_MAP_READ_BIT);
+ uint32_t *z_map = intel_region_map(intel, z_mt->region, GL_MAP_READ_BIT);
+ unsigned int s_image_x, s_image_y;
+ unsigned int z_image_x, z_image_y;
+
+ intel_miptree_get_image_offset(s_mt, level, 0, slice,
+ &s_image_x, &s_image_y);
+ intel_miptree_get_image_offset(z_mt, level, 0, slice,
+ &z_image_x, &z_image_y);
+
+ for (uint32_t y = 0; y < map->h; y++) {
+ for (uint32_t x = 0; x < map->w; x++) {
+ int map_x = map->x + x, map_y = map->y + y;
+ ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
+ map_x + s_image_x,
+ map_y + s_image_y,
+ intel->has_swizzling);
+ ptrdiff_t z_offset = ((map_y + z_image_y) * z_mt->region->pitch +
+ (map_x + z_image_x));
+ uint8_t s = s_map[s_offset];
+ uint32_t z = z_map[z_offset];
+
+ if (map_z32f_x24s8) {
+ packed_map[(y * map->w + x) * 2 + 0] = z;
+ packed_map[(y * map->w + x) * 2 + 1] = s;
+ } else {
+ packed_map[y * map->w + x] = (s << 24) | (z & 0x00ffffff);
+ }
+ }
+ }
+
+ intel_region_unmap(intel, s_mt->region);
+ intel_region_unmap(intel, z_mt->region);
+
+ DBG("%s: %d,%d %dx%d from z mt %p %d,%d, s mt %p %d,%d = %p/%d\n",
+ __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ z_mt, map->x + z_image_x, map->y + z_image_y,
+ s_mt, map->x + s_image_x, map->y + s_image_y,
+ map->ptr, map->stride);
+ } else {
+ DBG("%s: %d,%d %dx%d from mt %p = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, map->ptr, map->stride);
+ }
+}
+
+static void
+intel_miptree_unmap_depthstencil(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ struct intel_mipmap_tree *z_mt = mt;
+ struct intel_mipmap_tree *s_mt = mt->stencil_mt;
+ bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z32_FLOAT;
+
+ if (map->mode & GL_MAP_WRITE_BIT) {
+ uint32_t *packed_map = map->ptr;
+ uint8_t *s_map = intel_region_map(intel, s_mt->region, map->mode);
+ uint32_t *z_map = intel_region_map(intel, z_mt->region, map->mode);
+ unsigned int s_image_x, s_image_y;
+ unsigned int z_image_x, z_image_y;
+
+ intel_miptree_get_image_offset(s_mt, level, 0, slice,
+ &s_image_x, &s_image_y);
+ intel_miptree_get_image_offset(z_mt, level, 0, slice,
+ &z_image_x, &z_image_y);
+
+ for (uint32_t y = 0; y < map->h; y++) {
+ for (uint32_t x = 0; x < map->w; x++) {
+ ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
+ x + s_image_x + map->x,
+ y + s_image_y + map->y,
+ intel->has_swizzling);
+ ptrdiff_t z_offset = ((y + z_image_y) * z_mt->region->pitch +
+ (x + z_image_x));
+
+ if (map_z32f_x24s8) {
+ z_map[z_offset] = packed_map[(y * map->w + x) * 2 + 0];
+ s_map[s_offset] = packed_map[(y * map->w + x) * 2 + 1];
+ } else {
+ uint32_t packed = packed_map[y * map->w + x];
+ s_map[s_offset] = packed >> 24;
+ z_map[z_offset] = packed;
+ }
+ }
+ }
+
+ intel_region_unmap(intel, s_mt->region);
+ intel_region_unmap(intel, z_mt->region);
+
+ DBG("%s: %d,%d %dx%d from z mt %p (%s) %d,%d, s mt %p %d,%d = %p/%d\n",
+ __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ z_mt, _mesa_get_format_name(z_mt->format),
+ map->x + z_image_x, map->y + z_image_y,
+ s_mt, map->x + s_image_x, map->y + s_image_y,
+ map->ptr, map->stride);
+ }
+
+ free(map->buffer);
+}
+
+/**
+ * Create and attach a map to the miptree at (level, slice). Return the
+ * attached map.
+ */
+static struct intel_miptree_map*
+intel_miptree_attach_map(struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h,
+ GLbitfield mode)
+{
+ struct intel_miptree_map *map = calloc(1, sizeof(*map));
+
+ if (!map)
+ return NULL;
+
+ assert(mt->level[level].slice[slice].map == NULL);
+ mt->level[level].slice[slice].map = map;
+
+ map->mode = mode;
+ map->x = x;
+ map->y = y;
+ map->w = w;
+ map->h = h;
+
+ return map;
+}
+
+/**
+ * Release the map at (level, slice).
+ */
+static void
+intel_miptree_release_map(struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice)
+{
+ struct intel_miptree_map **map;
+
+ map = &mt->level[level].slice[slice].map;
+ free(*map);
+ *map = NULL;
+}
+
+static void
+intel_miptree_map_singlesample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h,
+ GLbitfield mode,
+ void **out_ptr,
+ int *out_stride)
+{
+ struct intel_miptree_map *map;
+
+ assert(mt->num_samples <= 1);
+
+ map = intel_miptree_attach_map(mt, level, slice, x, y, w, h, mode);
+ if (!map){
+ *out_ptr = NULL;
+ *out_stride = 0;
+ return;
+ }
+
+ intel_miptree_slice_resolve_depth(intel, mt, level, slice);
+ if (map->mode & GL_MAP_WRITE_BIT) {
+ intel_miptree_slice_set_needs_hiz_resolve(mt, level, slice);
+ }
+
+ if (mt->format == MESA_FORMAT_S8) {
+ intel_miptree_map_s8(intel, mt, map, level, slice);
+ } else if (mt->wraps_etc1) {
+ intel_miptree_map_etc1(intel, mt, map, level, slice);
+ } else if (mt->stencil_mt) {
+ intel_miptree_map_depthstencil(intel, mt, map, level, slice);
+ } else if (intel->has_llc &&
+ !(mode & GL_MAP_WRITE_BIT) &&
+ !mt->compressed &&
+ mt->region->tiling == I915_TILING_X) {
+ intel_miptree_map_blit(intel, mt, map, level, slice);
+ } else {
+ intel_miptree_map_gtt(intel, mt, map, level, slice);
+ }
+
+ *out_ptr = map->ptr;
+ *out_stride = map->stride;
+
+ if (map->ptr == NULL)
+ intel_miptree_release_map(mt, level, slice);
+}
+
+static void
+intel_miptree_unmap_singlesample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice)
+{
+ struct intel_miptree_map *map = mt->level[level].slice[slice].map;
+
+ assert(mt->num_samples <= 1);
+
+ if (!map)
+ return;
+
+ DBG("%s: mt %p (%s) level %d slice %d\n", __FUNCTION__,
+ mt, _mesa_get_format_name(mt->format), level, slice);
+
+ if (mt->format == MESA_FORMAT_S8) {
+ intel_miptree_unmap_s8(intel, mt, map, level, slice);
+ } else if (mt->wraps_etc1) {
+ intel_miptree_unmap_etc1(intel, mt, map, level, slice);
+ } else if (mt->stencil_mt) {
+ intel_miptree_unmap_depthstencil(intel, mt, map, level, slice);
+ } else if (map->bo) {
+ intel_miptree_unmap_blit(intel, mt, map, level, slice);
+ } else {
+ intel_miptree_unmap_gtt(intel, mt, map, level, slice);
+ }
+
+ intel_miptree_release_map(mt, level, slice);
+}
+
+static void
+intel_miptree_map_multisample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h,
+ GLbitfield mode,
+ void **out_ptr,
+ int *out_stride)
+{
+ struct intel_miptree_map *map;
+
+ assert(mt->num_samples > 1);
+
+ /* Only flat, renderbuffer-like miptrees are supported. */
+ if (mt->target != GL_TEXTURE_2D ||
+ mt->first_level != 0 ||
+ mt->last_level != 0) {
+ _mesa_problem(&intel->ctx, "attempt to map a multisample miptree for "
+ "which (target, first_level, last_level != "
+ "(GL_TEXTURE_2D, 0, 0)");
+ goto fail;
+ }
+
+ map = intel_miptree_attach_map(mt, level, slice, x, y, w, h, mode);
+ if (!map)
+ goto fail;
+
+ if (!mt->singlesample_mt) {
+ mt->singlesample_mt =
+ intel_miptree_create_for_renderbuffer(intel,
+ mt->format,
+ mt->singlesample_width0,
+ mt->singlesample_height0,
+ 0 /*num_samples*/);
+ if (!mt->singlesample_mt)
+ goto fail;
+
+ map->singlesample_mt_is_tmp = true;
+ mt->need_downsample = true;
+ }
+
+ intel_miptree_downsample(intel, mt);
+ intel_miptree_map_singlesample(intel, mt->singlesample_mt,
+ level, slice,
+ x, y, w, h,
+ mode,
+ out_ptr, out_stride);
+ return;
+
+fail:
+ intel_miptree_release_map(mt, level, slice);
+ *out_ptr = NULL;
+ *out_stride = 0;
+}
+
+static void
+intel_miptree_unmap_multisample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice)
+{
+ struct intel_miptree_map *map = mt->level[level].slice[slice].map;
+
+ assert(mt->num_samples > 1);
+
+ if (!map)
+ return;
+
+ intel_miptree_unmap_singlesample(intel, mt->singlesample_mt, level, slice);
+
+ mt->need_downsample = false;
+ if (map->mode & GL_MAP_WRITE_BIT)
+ intel_miptree_upsample(intel, mt);
+
+ if (map->singlesample_mt_is_tmp)
+ intel_miptree_release(&mt->singlesample_mt);
+
+ intel_miptree_release_map(mt, level, slice);
+}
+
+void
+intel_miptree_map(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h,
+ GLbitfield mode,
+ void **out_ptr,
+ int *out_stride)
+{
+ if (mt->num_samples <= 1)
+ intel_miptree_map_singlesample(intel, mt,
+ level, slice,
+ x, y, w, h,
+ mode,
+ out_ptr, out_stride);
+ else
+ intel_miptree_map_multisample(intel, mt,
+ level, slice,
+ x, y, w, h,
+ mode,
+ out_ptr, out_stride);
+}
+
+void
+intel_miptree_unmap(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice)
+{
+ if (mt->num_samples <= 1)
+ intel_miptree_unmap_singlesample(intel, mt, level, slice);
+ else
+ intel_miptree_unmap_multisample(intel, mt, level, slice);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel.c
index d733c5e8745..bc705105d4d 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel.c
@@ -1 +1,167 @@
-../intel/intel_pixel.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/accum.h"
+#include "main/enums.h"
+#include "main/state.h"
+#include "main/bufferobj.h"
+#include "main/context.h"
+#include "swrast/swrast.h"
+
+#include "intel_context.h"
+#include "intel_pixel.h"
+#include "intel_regions.h"
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+static GLenum
+effective_func(GLenum func, bool src_alpha_is_one)
+{
+ if (src_alpha_is_one) {
+ if (func == GL_SRC_ALPHA)
+ return GL_ONE;
+ if (func == GL_ONE_MINUS_SRC_ALPHA)
+ return GL_ZERO;
+ }
+
+ return func;
+}
+
+/**
+ * Check if any fragment operations are in effect which might effect
+ * glDraw/CopyPixels.
+ */
+bool
+intel_check_blit_fragment_ops(struct gl_context * ctx, bool src_alpha_is_one)
+{
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ if (ctx->FragmentProgram._Enabled) {
+ DBG("fallback due to fragment program\n");
+ return false;
+ }
+
+ if (ctx->Color.BlendEnabled &&
+ (effective_func(ctx->Color.Blend[0].SrcRGB, src_alpha_is_one) != GL_ONE ||
+ effective_func(ctx->Color.Blend[0].DstRGB, src_alpha_is_one) != GL_ZERO ||
+ ctx->Color.Blend[0].EquationRGB != GL_FUNC_ADD ||
+ effective_func(ctx->Color.Blend[0].SrcA, src_alpha_is_one) != GL_ONE ||
+ effective_func(ctx->Color.Blend[0].DstA, src_alpha_is_one) != GL_ZERO ||
+ ctx->Color.Blend[0].EquationA != GL_FUNC_ADD)) {
+ DBG("fallback due to blend\n");
+ return false;
+ }
+
+ if (ctx->Texture._EnabledUnits) {
+ DBG("fallback due to texturing\n");
+ return false;
+ }
+
+ if (!(ctx->Color.ColorMask[0][0] &&
+ ctx->Color.ColorMask[0][1] &&
+ ctx->Color.ColorMask[0][2] &&
+ ctx->Color.ColorMask[0][3])) {
+ DBG("fallback due to color masking\n");
+ return false;
+ }
+
+ if (ctx->Color.AlphaEnabled) {
+ DBG("fallback due to alpha\n");
+ return false;
+ }
+
+ if (ctx->Depth.Test) {
+ DBG("fallback due to depth test\n");
+ return false;
+ }
+
+ if (ctx->Fog.Enabled) {
+ DBG("fallback due to fog\n");
+ return false;
+ }
+
+ if (ctx->_ImageTransferState) {
+ DBG("fallback due to image transfer\n");
+ return false;
+ }
+
+ if (ctx->Stencil._Enabled) {
+ DBG("fallback due to image stencil\n");
+ return false;
+ }
+
+ if (ctx->RenderMode != GL_RENDER) {
+ DBG("fallback due to render mode\n");
+ return false;
+ }
+
+ return true;
+}
+
+/* The intel_region struct doesn't really do enough to capture the
+ * format of the pixels in the region. For now this code assumes that
+ * the region is a display surface and hence is either ARGB8888 or
+ * RGB565.
+ * XXX FBO: If we'd pass in the intel_renderbuffer instead of region, we'd
+ * know the buffer's pixel format.
+ *
+ * \param format as given to glDraw/ReadPixels
+ * \param type as given to glDraw/ReadPixels
+ */
+bool
+intel_check_blit_format(struct intel_region * region,
+ GLenum format, GLenum type)
+{
+ if (region->cpp == 4 &&
+ (type == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ type == GL_UNSIGNED_BYTE) && format == GL_BGRA) {
+ return true;
+ }
+
+ if (region->cpp == 2 &&
+ type == GL_UNSIGNED_SHORT_5_6_5_REV && format == GL_BGR) {
+ return true;
+ }
+
+ DBG("%s: bad format for blit (cpp %d, type %s format %s)\n",
+ __FUNCTION__, region->cpp,
+ _mesa_lookup_enum_by_nr(type), _mesa_lookup_enum_by_nr(format));
+
+ return false;
+}
+
+void
+intelInitPixelFuncs(struct dd_function_table *functions)
+{
+ functions->Accum = _mesa_accum;
+ functions->Bitmap = intelBitmap;
+ functions->CopyPixels = intelCopyPixels;
+ functions->DrawPixels = intelDrawPixels;
+ functions->ReadPixels = intelReadPixels;
+}
+
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c
index 9085c7b0397..954dfc50b14 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c
@@ -1 +1,340 @@
-../intel/intel_pixel_bitmap.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/colormac.h"
+#include "main/condrender.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/pbo.h"
+#include "main/bufferobj.h"
+#include "main/state.h"
+#include "main/texobj.h"
+#include "main/context.h"
+#include "main/fbobject.h"
+#include "swrast/swrast.h"
+#include "drivers/common/meta.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_regions.h"
+#include "intel_buffers.h"
+#include "intel_pixel.h"
+#include "intel_reg.h"
+
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+
+/* Unlike the other intel_pixel_* functions, the expectation here is
+ * that the incoming data is not in a PBO. With the XY_TEXT blit
+ * method, there's no benefit haveing it in a PBO, but we could
+ * implement a path based on XY_MONO_SRC_COPY_BLIT which might benefit
+ * PBO bitmaps. I think they are probably pretty rare though - I
+ * wonder if Xgl uses them?
+ */
+static const GLubyte *map_pbo( struct gl_context *ctx,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ GLubyte *buf;
+
+ if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
+ GL_COLOR_INDEX, GL_BITMAP,
+ INT_MAX, (const GLvoid *) bitmap)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,"glBitmap(invalid PBO access)");
+ return NULL;
+ }
+
+ buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ unpack->BufferObj);
+ if (!buf) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)");
+ return NULL;
+ }
+
+ return ADD_POINTERS(buf, bitmap);
+}
+
+static bool test_bit( const GLubyte *src, GLuint bit )
+{
+ return (src[bit/8] & (1<<(bit % 8))) ? 1 : 0;
+}
+
+static void set_bit( GLubyte *dest, GLuint bit )
+{
+ dest[bit/8] |= 1 << (bit % 8);
+}
+
+/* Extract a rectangle's worth of data from the bitmap. Called
+ * per chunk of HW-sized bitmap.
+ */
+static GLuint get_bitmap_rect(GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap,
+ GLuint x, GLuint y,
+ GLuint w, GLuint h,
+ GLubyte *dest,
+ GLuint row_align,
+ bool invert)
+{
+ GLuint src_offset = (x + unpack->SkipPixels) & 0x7;
+ GLuint mask = unpack->LsbFirst ? 0 : 7;
+ GLuint bit = 0;
+ GLint row, col;
+ GLint first, last;
+ GLint incr;
+ GLuint count = 0;
+
+ DBG("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
+ __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
+
+ if (invert) {
+ first = h-1;
+ last = 0;
+ incr = -1;
+ }
+ else {
+ first = 0;
+ last = h-1;
+ incr = 1;
+ }
+
+ /* Require that dest be pre-zero'd.
+ */
+ for (row = first; row != (last+incr); row += incr) {
+ const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap,
+ width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ y + row, x);
+
+ for (col = 0; col < w; col++, bit++) {
+ if (test_bit(rowsrc, (col + src_offset) ^ mask)) {
+ set_bit(dest, bit ^ 7);
+ count++;
+ }
+ }
+
+ if (row_align)
+ bit = ALIGN(bit, row_align);
+ }
+
+ return count;
+}
+
+/**
+ * Returns the low Y value of the vertical range given, flipped according to
+ * whether the framebuffer is or not.
+ */
+static INLINE int
+y_flip(struct gl_framebuffer *fb, int y, int height)
+{
+ if (_mesa_is_user_fbo(fb))
+ return y;
+ else
+ return fb->Height - y - height;
+}
+
+/*
+ * Render a bitmap.
+ */
+static bool
+do_blit_bitmap( struct gl_context *ctx,
+ GLint dstx, GLint dsty,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst;
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ GLfloat tmpColor[4];
+ GLubyte ubcolor[4];
+ GLuint color;
+ GLsizei bitmap_width = width;
+ GLsizei bitmap_height = height;
+ GLint px, py;
+ GLuint stipple[32];
+ GLint orig_dstx = dstx;
+ GLint orig_dsty = dsty;
+
+ /* Update draw buffer bounds */
+ _mesa_update_state(ctx);
+
+ if (ctx->Depth.Test) {
+ /* The blit path produces incorrect results when depth testing is on.
+ * It seems the blit Z coord is always 1.0 (the far plane) so fragments
+ * will likely be obscured by other, closer geometry.
+ */
+ return false;
+ }
+
+ intel_prepare_render(intel);
+ dst = intel_drawbuf_region(intel);
+
+ if (!dst)
+ return false;
+
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ bitmap = map_pbo(ctx, width, height, unpack, bitmap);
+ if (bitmap == NULL)
+ return true; /* even though this is an error, we're done */
+ }
+
+ COPY_4V(tmpColor, ctx->Current.RasterColor);
+
+ if (_mesa_need_secondary_color(ctx)) {
+ ADD_3V(tmpColor, tmpColor, ctx->Current.RasterSecondaryColor);
+ }
+
+ UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[0], tmpColor[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[1], tmpColor[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[2], tmpColor[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
+
+ if (dst->cpp == 2)
+ color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]);
+ else
+ color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
+
+ if (!intel_check_blit_fragment_ops(ctx, tmpColor[3] == 1.0F))
+ return false;
+
+ /* Clip to buffer bounds and scissor. */
+ if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin,
+ fb->_Xmax, fb->_Ymax,
+ &dstx, &dsty, &width, &height))
+ goto out;
+
+ dsty = y_flip(fb, dsty, height);
+
+#define DY 32
+#define DX 32
+
+ /* Chop it all into chunks that can be digested by hardware: */
+ for (py = 0; py < height; py += DY) {
+ for (px = 0; px < width; px += DX) {
+ int h = MIN2(DY, height - py);
+ int w = MIN2(DX, width - px);
+ GLuint sz = ALIGN(ALIGN(w,8) * h, 64)/8;
+ GLenum logic_op = ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY;
+
+ assert(sz <= sizeof(stipple));
+ memset(stipple, 0, sz);
+
+ /* May need to adjust this when padding has been introduced in
+ * sz above:
+ *
+ * Have to translate destination coordinates back into source
+ * coordinates.
+ */
+ if (get_bitmap_rect(bitmap_width, bitmap_height, unpack,
+ bitmap,
+ -orig_dstx + (dstx + px),
+ -orig_dsty + y_flip(fb, dsty + py, h),
+ w, h,
+ (GLubyte *)stipple,
+ 8,
+ _mesa_is_winsys_fbo(fb)) == 0)
+ continue;
+
+ if (!intelEmitImmediateColorExpandBlit(intel,
+ dst->cpp,
+ (GLubyte *)stipple,
+ sz,
+ color,
+ dst->pitch,
+ dst->bo,
+ 0,
+ dst->tiling,
+ dstx + px,
+ dsty + py,
+ w, h,
+ logic_op)) {
+ return false;
+ }
+ }
+ }
+out:
+
+ if (unlikely(INTEL_DEBUG & DEBUG_SYNC))
+ intel_batchbuffer_flush(intel);
+
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ /* done with PBO so unmap it now */
+ ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj);
+ }
+
+ intel_check_front_buffer_rendering(intel);
+
+ return true;
+}
+
+
+/* There are a large number of possible ways to implement bitmap on
+ * this hardware, most of them have some sort of drawback. Here are a
+ * few that spring to mind:
+ *
+ * Blit:
+ * - XY_MONO_SRC_BLT_CMD
+ * - use XY_SETUP_CLIP_BLT for cliprect clipping.
+ * - XY_TEXT_BLT
+ * - XY_TEXT_IMMEDIATE_BLT
+ * - blit per cliprect, subject to maximum immediate data size.
+ * - XY_COLOR_BLT
+ * - per pixel or run of pixels
+ * - XY_PIXEL_BLT
+ * - good for sparse bitmaps
+ *
+ * 3D engine:
+ * - Point per pixel
+ * - Translate bitmap to an alpha texture and render as a quad
+ * - Chop bitmap up into 32x32 squares and render w/polygon stipple.
+ */
+void
+intelBitmap(struct gl_context * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte * pixels)
+{
+ if (!_mesa_check_conditional_render(ctx))
+ return;
+
+ if (do_blit_bitmap(ctx, x, y, width, height,
+ unpack, pixels))
+ return;
+
+ _mesa_meta_Bitmap(ctx, x, y, width, height, unpack, pixels);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_copy.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_copy.c
index ee433605904..682a52d97d2 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_copy.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_copy.c
@@ -1 +1,230 @@
-../intel/intel_pixel_copy.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/image.h"
+#include "main/state.h"
+#include "main/mtypes.h"
+#include "main/condrender.h"
+#include "main/fbobject.h"
+#include "drivers/common/meta.h"
+
+#include "intel_context.h"
+#include "intel_buffers.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_pixel.h"
+#include "intel_fbo.h"
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+/**
+ * Check if any fragment operations are in effect which might effect
+ * glCopyPixels. Differs from intel_check_blit_fragment_ops in that
+ * we allow Scissor.
+ */
+static bool
+intel_check_copypixel_blit_fragment_ops(struct gl_context * ctx)
+{
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ /* Could do logicop with the blitter:
+ */
+ return !(ctx->_ImageTransferState ||
+ ctx->Color.AlphaEnabled ||
+ ctx->Depth.Test ||
+ ctx->Fog.Enabled ||
+ ctx->Stencil._Enabled ||
+ !ctx->Color.ColorMask[0][0] ||
+ !ctx->Color.ColorMask[0][1] ||
+ !ctx->Color.ColorMask[0][2] ||
+ !ctx->Color.ColorMask[0][3] ||
+ ctx->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
+}
+
+
+/**
+ * CopyPixels with the blitter. Don't support zooming, pixel transfer, etc.
+ */
+static bool
+do_blit_copypixels(struct gl_context * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_framebuffer *read_fb = ctx->ReadBuffer;
+ GLint orig_dstx;
+ GLint orig_dsty;
+ GLint orig_srcx;
+ GLint orig_srcy;
+ bool flip = false;
+ struct intel_renderbuffer *draw_irb = NULL;
+ struct intel_renderbuffer *read_irb = NULL;
+ gl_format read_format, draw_format;
+
+ /* Update draw buffer bounds */
+ _mesa_update_state(ctx);
+
+ switch (type) {
+ case GL_COLOR:
+ if (fb->_NumColorDrawBuffers != 1) {
+ fallback_debug("glCopyPixels() fallback: MRT\n");
+ return false;
+ }
+
+ draw_irb = intel_renderbuffer(fb->_ColorDrawBuffers[0]);
+ read_irb = intel_renderbuffer(read_fb->_ColorReadBuffer);
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ draw_irb = intel_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+ read_irb =
+ intel_renderbuffer(read_fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+ break;
+ case GL_DEPTH:
+ fallback_debug("glCopyPixels() fallback: GL_DEPTH\n");
+ return false;
+ case GL_STENCIL:
+ fallback_debug("glCopyPixels() fallback: GL_STENCIL\n");
+ return false;
+ default:
+ fallback_debug("glCopyPixels(): Unknown type\n");
+ return false;
+ }
+
+ if (!draw_irb) {
+ fallback_debug("glCopyPixels() fallback: missing draw buffer\n");
+ return false;
+ }
+
+ if (!read_irb) {
+ fallback_debug("glCopyPixels() fallback: missing read buffer\n");
+ return false;
+ }
+
+ read_format = intel_rb_format(read_irb);
+ draw_format = intel_rb_format(draw_irb);
+
+ if (draw_format != read_format &&
+ !(draw_format == MESA_FORMAT_XRGB8888 &&
+ read_format == MESA_FORMAT_ARGB8888)) {
+ fallback_debug("glCopyPixels() fallback: mismatched formats (%s -> %s\n",
+ _mesa_get_format_name(read_format),
+ _mesa_get_format_name(draw_format));
+ return false;
+ }
+
+ /* Copypixels can be more than a straight copy. Ensure all the
+ * extra operations are disabled:
+ */
+ if (!intel_check_copypixel_blit_fragment_ops(ctx) ||
+ ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F)
+ return false;
+
+ intel_prepare_render(intel);
+
+ intel_flush(&intel->ctx);
+
+ /* Clip to destination buffer. */
+ orig_dstx = dstx;
+ orig_dsty = dsty;
+ if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin,
+ fb->_Xmax, fb->_Ymax,
+ &dstx, &dsty, &width, &height))
+ goto out;
+ /* Adjust src coords for our post-clipped destination origin */
+ srcx += dstx - orig_dstx;
+ srcy += dsty - orig_dsty;
+
+ /* Clip to source buffer. */
+ orig_srcx = srcx;
+ orig_srcy = srcy;
+ if (!_mesa_clip_to_region(0, 0,
+ read_fb->Width, read_fb->Height,
+ &srcx, &srcy, &width, &height))
+ goto out;
+ /* Adjust dst coords for our post-clipped source origin */
+ dstx += srcx - orig_srcx;
+ dsty += srcy - orig_srcy;
+
+ /* Flip dest Y if it's a window system framebuffer. */
+ if (_mesa_is_winsys_fbo(fb)) {
+ /* copypixels to a window system framebuffer */
+ dsty = fb->Height - dsty - height;
+ flip = !flip;
+ }
+
+ /* Flip source Y if it's a window system framebuffer. */
+ if (_mesa_is_winsys_fbo(read_fb)) {
+ srcy = read_fb->Height - srcy - height;
+ flip = !flip;
+ }
+
+ srcx += read_irb->draw_x;
+ srcy += read_irb->draw_y;
+ dstx += draw_irb->draw_x;
+ dsty += draw_irb->draw_y;
+
+ if (!intel_region_copy(intel,
+ draw_irb->mt->region, 0, dstx, dsty,
+ read_irb->mt->region, 0, srcx, srcy,
+ width, height, flip,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY)) {
+ DBG("%s: blit failure\n", __FUNCTION__);
+ return false;
+ }
+
+out:
+ intel_check_front_buffer_rendering(intel);
+
+ DBG("%s: success\n", __FUNCTION__);
+ return true;
+}
+
+
+void
+intelCopyPixels(struct gl_context * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint destx, GLint desty, GLenum type)
+{
+ DBG("%s\n", __FUNCTION__);
+
+ if (!_mesa_check_conditional_render(ctx))
+ return;
+
+ if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
+ return;
+
+ /* this will use swrast if needed */
+ _mesa_meta_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_draw.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_draw.c
index 8431a24edfc..2ec7ed8e269 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_draw.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_draw.c
@@ -1 +1,58 @@
-../intel/intel_pixel_draw.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/mtypes.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/texstate.h"
+#include "swrast/swrast.h"
+#include "drivers/common/meta.h"
+
+#include "intel_context.h"
+#include "intel_pixel.h"
+
+void
+intelDrawPixels(struct gl_context * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format,
+ GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid * pixels)
+{
+ if (format == GL_STENCIL_INDEX) {
+ _swrast_DrawPixels(ctx, x, y, width, height, format, type,
+ unpack, pixels);
+ return;
+ }
+
+ _mesa_meta_DrawPixels(ctx, x, y, width, height, format, type,
+ unpack, pixels);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_read.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_read.c
index cc4589f4d42..ab4e581c400 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_read.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_pixel_read.c
@@ -1 +1,205 @@
-../intel/intel_pixel_read.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/fbobject.h"
+#include "main/image.h"
+#include "main/bufferobj.h"
+#include "main/readpix.h"
+#include "main/state.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_regions.h"
+#include "intel_pixel.h"
+#include "intel_buffer_objects.h"
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+/* For many applications, the new ability to pull the source buffers
+ * back out of the GTT and then do the packing/conversion operations
+ * in software will be as much of an improvement as trying to get the
+ * blitter and/or texture engine to do the work.
+ *
+ * This step is gated on private backbuffers.
+ *
+ * Obviously the frontbuffer can't be pulled back, so that is either
+ * an argument for blit/texture readpixels, or for blitting to a
+ * temporary and then pulling that back.
+ *
+ * When the destination is a pbo, however, it's not clear if it is
+ * ever going to be pulled to main memory (though the access param
+ * will be a good hint). So it sounds like we do want to be able to
+ * choose between blit/texture implementation on the gpu and pullback
+ * and cpu-based copying.
+ *
+ * Unless you can magically turn client memory into a PBO for the
+ * duration of this call, there will be a cpu-based copying step in
+ * any case.
+ */
+
+static bool
+do_blit_readpixels(struct gl_context * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *src = intel_readbuf_region(intel);
+ struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
+ GLuint dst_offset;
+ GLuint rowLength;
+ drm_intel_bo *dst_buffer;
+ bool all;
+ GLint dst_x, dst_y;
+ GLuint dirty;
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (!src)
+ return false;
+
+ if (!_mesa_is_bufferobj(pack->BufferObj)) {
+ /* PBO only for now:
+ */
+ DBG("%s - not PBO\n", __FUNCTION__);
+ return false;
+ }
+
+
+ if (ctx->_ImageTransferState ||
+ !intel_check_blit_format(src, format, type)) {
+ DBG("%s - bad format for blit\n", __FUNCTION__);
+ return false;
+ }
+
+ if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
+ DBG("%s: bad packing params\n", __FUNCTION__);
+ return false;
+ }
+
+ if (pack->RowLength > 0)
+ rowLength = pack->RowLength;
+ else
+ rowLength = width;
+
+ if (pack->Invert) {
+ DBG("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
+ return false;
+ }
+ else {
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
+ rowLength = -rowLength;
+ }
+
+ dst_offset = (GLintptr)pixels;
+ dst_offset += _mesa_image_offset(2, pack, width, height,
+ format, type, 0, 0, 0);
+
+ if (!_mesa_clip_copytexsubimage(ctx,
+ &dst_x, &dst_y,
+ &x, &y,
+ &width, &height)) {
+ return true;
+ }
+
+ dirty = intel->front_buffer_dirty;
+ intel_prepare_render(intel);
+ intel->front_buffer_dirty = dirty;
+
+ all = (width * height * src->cpp == dst->Base.Size &&
+ x == 0 && dst_offset == 0);
+
+ dst_x = 0;
+ dst_y = 0;
+
+ dst_buffer = intel_bufferobj_buffer(intel, dst,
+ all ? INTEL_WRITE_FULL :
+ INTEL_WRITE_PART);
+
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
+ y = ctx->ReadBuffer->Height - (y + height);
+
+ if (!intelEmitCopyBlit(intel,
+ src->cpp,
+ src->pitch, src->bo, 0, src->tiling,
+ rowLength, dst_buffer, dst_offset, false,
+ x, y,
+ dst_x, dst_y,
+ width, height,
+ GL_COPY)) {
+ return false;
+ }
+
+ DBG("%s - DONE\n", __FUNCTION__);
+
+ return true;
+}
+
+void
+intelReadPixels(struct gl_context * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
+{
+ struct intel_context *intel = intel_context(ctx);
+ bool dirty;
+
+ intel_flush_rendering_to_batch(ctx);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (do_blit_readpixels
+ (ctx, x, y, width, height, format, type, pack, pixels))
+ return;
+
+ /* glReadPixels() wont dirty the front buffer, so reset the dirty
+ * flag after calling intel_prepare_render(). */
+ dirty = intel->front_buffer_dirty;
+ intel_prepare_render(intel);
+ intel->front_buffer_dirty = dirty;
+
+ fallback_debug("%s: fallback to swrast\n", __FUNCTION__);
+
+ /* Update Mesa state before calling _mesa_readpixels().
+ * XXX this may not be needed since ReadPixels no longer uses the
+ * span code.
+ */
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ _mesa_readpixels(ctx, x, y, width, height, format, type, pack, pixels);
+
+ /* There's an intel_prepare_render() call in intelSpanRenderStart(). */
+ intel->front_buffer_dirty = dirty;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_regions.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_regions.c
index 89b2f15c10f..7cb008c2f71 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_regions.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_regions.c
@@ -1 +1,473 @@
-../intel/intel_regions.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/* Provide additional functionality on top of bufmgr buffers:
+ * - 2d semantics and blit operations
+ * - refcounting of buffers for multiple images in a buffer.
+ * - refcounting of buffer mappings.
+ * - some logic for moving the buffers to the best memory pools for
+ * given operations.
+ *
+ * Most of this is to make it easier to implement the fixed-layout
+ * mipmap tree required by intel hardware in the face of GL's
+ * programming interface where each image can be specifed in random
+ * order and it isn't clear what layout the tree should have until the
+ * last moment.
+ */
+
+#include <sys/ioctl.h>
+#include <errno.h>
+
+#include "main/hash.h"
+#include "intel_context.h"
+#include "intel_regions.h"
+#include "intel_blit.h"
+#include "intel_buffer_objects.h"
+#include "intel_bufmgr.h"
+#include "intel_batchbuffer.h"
+
+#define FILE_DEBUG_FLAG DEBUG_REGION
+
+/* This should be set to the maximum backtrace size desired.
+ * Set it to 0 to disable backtrace debugging.
+ */
+#define DEBUG_BACKTRACE_SIZE 0
+
+#if DEBUG_BACKTRACE_SIZE == 0
+/* Use the standard debug output */
+#define _DBG(...) DBG(__VA_ARGS__)
+#else
+/* Use backtracing debug output */
+#define _DBG(...) {debug_backtrace(); DBG(__VA_ARGS__);}
+
+/* Backtracing debug support */
+#include <execinfo.h>
+
+static void
+debug_backtrace(void)
+{
+ void *trace[DEBUG_BACKTRACE_SIZE];
+ char **strings = NULL;
+ int traceSize;
+ register int i;
+
+ traceSize = backtrace(trace, DEBUG_BACKTRACE_SIZE);
+ strings = backtrace_symbols(trace, traceSize);
+ if (strings == NULL) {
+ DBG("no backtrace:");
+ return;
+ }
+
+ /* Spit out all the strings with a colon separator. Ignore
+ * the first, since we don't really care about the call
+ * to debug_backtrace() itself. Skip until the final "/" in
+ * the trace to avoid really long lines.
+ */
+ for (i = 1; i < traceSize; i++) {
+ char *p = strings[i], *slash = strings[i];
+ while (*p) {
+ if (*p++ == '/') {
+ slash = p;
+ }
+ }
+
+ DBG("%s:", slash);
+ }
+
+ /* Free up the memory, and we're done */
+ free(strings);
+}
+
+#endif
+
+
+
+/* XXX: Thread safety?
+ */
+void *
+intel_region_map(struct intel_context *intel, struct intel_region *region,
+ GLbitfield mode)
+{
+ /* We have the region->map_refcount controlling mapping of the BO because
+ * in software fallbacks we may end up mapping the same buffer multiple
+ * times on Mesa's behalf, so we refcount our mappings to make sure that
+ * the pointer stays valid until the end of the unmap chain. However, we
+ * must not emit any batchbuffers between the start of mapping and the end
+ * of unmapping, or further use of the map will be incoherent with the GPU
+ * rendering done by that batchbuffer. Hence we assert in
+ * intel_batchbuffer_flush() that that doesn't happen, which means that the
+ * flush is only needed on first map of the buffer.
+ */
+
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ if (drm_intel_bo_busy(region->bo)) {
+ perf_debug("Mapping a busy BO, causing a stall on the GPU.\n");
+ }
+ }
+
+ _DBG("%s %p\n", __FUNCTION__, region);
+ if (!region->map_refcount) {
+ intel_flush(&intel->ctx);
+
+ if (region->tiling != I915_TILING_NONE)
+ drm_intel_gem_bo_map_gtt(region->bo);
+ else
+ drm_intel_bo_map(region->bo, true);
+
+ region->map = region->bo->virtual;
+ }
+ if (region->map) {
+ intel->num_mapped_regions++;
+ region->map_refcount++;
+ }
+
+ return region->map;
+}
+
+void
+intel_region_unmap(struct intel_context *intel, struct intel_region *region)
+{
+ _DBG("%s %p\n", __FUNCTION__, region);
+ if (!--region->map_refcount) {
+ if (region->tiling != I915_TILING_NONE)
+ drm_intel_gem_bo_unmap_gtt(region->bo);
+ else
+ drm_intel_bo_unmap(region->bo);
+
+ region->map = NULL;
+ --intel->num_mapped_regions;
+ assert(intel->num_mapped_regions >= 0);
+ }
+}
+
+static struct intel_region *
+intel_region_alloc_internal(struct intel_screen *screen,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
+ uint32_t tiling, drm_intel_bo *buffer)
+{
+ struct intel_region *region;
+
+ region = calloc(sizeof(*region), 1);
+ if (region == NULL)
+ return region;
+
+ region->cpp = cpp;
+ region->width = width;
+ region->height = height;
+ region->pitch = pitch;
+ region->refcount = 1;
+ region->bo = buffer;
+ region->tiling = tiling;
+ region->screen = screen;
+
+ _DBG("%s <-- %p\n", __FUNCTION__, region);
+ return region;
+}
+
+struct intel_region *
+intel_region_alloc(struct intel_screen *screen,
+ uint32_t tiling,
+ GLuint cpp, GLuint width, GLuint height,
+ bool expect_accelerated_upload)
+{
+ drm_intel_bo *buffer;
+ unsigned long flags = 0;
+ unsigned long aligned_pitch;
+ struct intel_region *region;
+
+ if (expect_accelerated_upload)
+ flags |= BO_ALLOC_FOR_RENDER;
+
+ buffer = drm_intel_bo_alloc_tiled(screen->bufmgr, "region",
+ width, height, cpp,
+ &tiling, &aligned_pitch, flags);
+ if (buffer == NULL)
+ return NULL;
+
+ region = intel_region_alloc_internal(screen, cpp, width, height,
+ aligned_pitch / cpp, tiling, buffer);
+ if (region == NULL) {
+ drm_intel_bo_unreference(buffer);
+ return NULL;
+ }
+
+ return region;
+}
+
+bool
+intel_region_flink(struct intel_region *region, uint32_t *name)
+{
+ if (region->name == 0) {
+ if (drm_intel_bo_flink(region->bo, &region->name))
+ return false;
+
+ _mesa_HashInsert(region->screen->named_regions,
+ region->name, region);
+ }
+
+ *name = region->name;
+
+ return true;
+}
+
+struct intel_region *
+intel_region_alloc_for_handle(struct intel_screen *screen,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
+ GLuint handle, const char *name)
+{
+ struct intel_region *region, *dummy;
+ drm_intel_bo *buffer;
+ int ret;
+ uint32_t bit_6_swizzle, tiling;
+
+ region = _mesa_HashLookup(screen->named_regions, handle);
+ if (region != NULL) {
+ dummy = NULL;
+ if (region->width != width || region->height != height ||
+ region->cpp != cpp || region->pitch != pitch) {
+ fprintf(stderr,
+ "Region for name %d already exists but is not compatible\n",
+ handle);
+ return NULL;
+ }
+ intel_region_reference(&dummy, region);
+ return dummy;
+ }
+
+ buffer = intel_bo_gem_create_from_name(screen->bufmgr, name, handle);
+ if (buffer == NULL)
+ return NULL;
+ ret = drm_intel_bo_get_tiling(buffer, &tiling, &bit_6_swizzle);
+ if (ret != 0) {
+ fprintf(stderr, "Couldn't get tiling of buffer %d (%s): %s\n",
+ handle, name, strerror(-ret));
+ drm_intel_bo_unreference(buffer);
+ return NULL;
+ }
+
+ region = intel_region_alloc_internal(screen, cpp,
+ width, height, pitch, tiling, buffer);
+ if (region == NULL) {
+ drm_intel_bo_unreference(buffer);
+ return NULL;
+ }
+
+ region->name = handle;
+ _mesa_HashInsert(screen->named_regions, handle, region);
+
+ return region;
+}
+
+void
+intel_region_reference(struct intel_region **dst, struct intel_region *src)
+{
+ _DBG("%s: %p(%d) -> %p(%d)\n", __FUNCTION__,
+ *dst, *dst ? (*dst)->refcount : 0, src, src ? src->refcount : 0);
+
+ if (src != *dst) {
+ if (*dst)
+ intel_region_release(dst);
+
+ if (src)
+ src->refcount++;
+ *dst = src;
+ }
+}
+
+void
+intel_region_release(struct intel_region **region_handle)
+{
+ struct intel_region *region = *region_handle;
+
+ if (region == NULL) {
+ _DBG("%s NULL\n", __FUNCTION__);
+ return;
+ }
+
+ _DBG("%s %p %d\n", __FUNCTION__, region, region->refcount - 1);
+
+ ASSERT(region->refcount > 0);
+ region->refcount--;
+
+ if (region->refcount == 0) {
+ assert(region->map_refcount == 0);
+
+ drm_intel_bo_unreference(region->bo);
+
+ if (region->name > 0)
+ _mesa_HashRemove(region->screen->named_regions, region->name);
+
+ free(region);
+ }
+ *region_handle = NULL;
+}
+
+/*
+ * XXX Move this into core Mesa?
+ */
+void
+_mesa_copy_rect(GLubyte * dst,
+ GLuint cpp,
+ GLuint dst_pitch,
+ GLuint dst_x,
+ GLuint dst_y,
+ GLuint width,
+ GLuint height,
+ const GLubyte * src,
+ GLuint src_pitch, GLuint src_x, GLuint src_y)
+{
+ GLuint i;
+
+ dst_pitch *= cpp;
+ src_pitch *= cpp;
+ dst += dst_x * cpp;
+ src += src_x * cpp;
+ dst += dst_y * dst_pitch;
+ src += src_y * src_pitch;
+ width *= cpp;
+
+ if (width == dst_pitch && width == src_pitch)
+ memcpy(dst, src, height * width);
+ else {
+ for (i = 0; i < height; i++) {
+ memcpy(dst, src, width);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
+}
+
+/* Copy rectangular sub-regions. Need better logic about when to
+ * push buffers into AGP - will currently do so whenever possible.
+ */
+bool
+intel_region_copy(struct intel_context *intel,
+ struct intel_region *dst,
+ GLuint dst_offset,
+ GLuint dstx, GLuint dsty,
+ struct intel_region *src,
+ GLuint src_offset,
+ GLuint srcx, GLuint srcy, GLuint width, GLuint height,
+ bool flip,
+ GLenum logicop)
+{
+ uint32_t src_pitch = src->pitch;
+
+ _DBG("%s\n", __FUNCTION__);
+
+ if (intel == NULL)
+ return false;
+
+ assert(src->cpp == dst->cpp);
+
+ if (flip)
+ src_pitch = -src_pitch;
+
+ return intelEmitCopyBlit(intel,
+ dst->cpp,
+ src_pitch, src->bo, src_offset, src->tiling,
+ dst->pitch, dst->bo, dst_offset, dst->tiling,
+ srcx, srcy, dstx, dsty, width, height,
+ logicop);
+}
+
+/**
+ * This function computes masks that may be used to select the bits of the X
+ * and Y coordinates that indicate the offset within a tile. If the region is
+ * untiled, the masks are set to 0.
+ */
+void
+intel_region_get_tile_masks(struct intel_region *region,
+ uint32_t *mask_x, uint32_t *mask_y,
+ bool map_stencil_as_y_tiled)
+{
+ int cpp = region->cpp;
+ uint32_t tiling = region->tiling;
+
+ if (map_stencil_as_y_tiled)
+ tiling = I915_TILING_Y;
+
+ switch (tiling) {
+ default:
+ assert(false);
+ case I915_TILING_NONE:
+ *mask_x = *mask_y = 0;
+ break;
+ case I915_TILING_X:
+ *mask_x = 512 / cpp - 1;
+ *mask_y = 7;
+ break;
+ case I915_TILING_Y:
+ *mask_x = 128 / cpp - 1;
+ *mask_y = 31;
+ break;
+ }
+}
+
+/**
+ * Compute the offset (in bytes) from the start of the region to the given x
+ * and y coordinate. For tiled regions, caller must ensure that x and y are
+ * multiples of the tile size.
+ */
+uint32_t
+intel_region_get_aligned_offset(struct intel_region *region, uint32_t x,
+ uint32_t y, bool map_stencil_as_y_tiled)
+{
+ int cpp = region->cpp;
+ uint32_t pitch = region->pitch * cpp;
+ uint32_t tiling = region->tiling;
+
+ if (map_stencil_as_y_tiled) {
+ tiling = I915_TILING_Y;
+
+ /* When mapping a W-tiled stencil buffer as Y-tiled, each 64-high W-tile
+ * gets transformed into a 32-high Y-tile. Accordingly, the pitch of
+ * the resulting region is twice the pitch of the original region, since
+ * each row in the Y-tiled view corresponds to two rows in the actual
+ * W-tiled surface. So we need to correct the pitch before computing
+ * the offsets.
+ */
+ pitch *= 2;
+ }
+
+ switch (tiling) {
+ default:
+ assert(false);
+ case I915_TILING_NONE:
+ return y * pitch + x * cpp;
+ case I915_TILING_X:
+ assert((x % (512 / cpp)) == 0);
+ assert((y % 8) == 0);
+ return y * pitch + x / (512 / cpp) * 4096;
+ case I915_TILING_Y:
+ assert((x % (128 / cpp)) == 0);
+ assert((y % 32) == 0);
+ return y * pitch + x / (128 / cpp) * 4096;
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_resolve_map.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_resolve_map.c
index 77e50fbaea4..04b5c942432 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_resolve_map.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_resolve_map.c
@@ -1 +1,111 @@
-../intel/intel_resolve_map.c \ No newline at end of file
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "intel_resolve_map.h"
+
+#include <assert.h>
+#include <stdlib.h>
+
+/**
+ * \brief Set that the miptree slice at (level, layer) needs a resolve.
+ *
+ * If a map element already exists with the given key, then the value is
+ * changed to the given value of \c need.
+ */
+void
+intel_resolve_map_set(struct intel_resolve_map *head,
+ uint32_t level,
+ uint32_t layer,
+ enum gen6_hiz_op need)
+{
+ struct intel_resolve_map **tail = &head->next;
+ struct intel_resolve_map *prev = head;
+
+ while (*tail) {
+ if ((*tail)->level == level && (*tail)->layer == layer) {
+ (*tail)->need = need;
+ return;
+ }
+ prev = *tail;
+ tail = &(*tail)->next;
+ }
+
+ *tail = malloc(sizeof(**tail));
+ (*tail)->prev = prev;
+ (*tail)->next = NULL;
+ (*tail)->level = level;
+ (*tail)->layer = layer;
+ (*tail)->need = need;
+}
+
+/**
+ * \brief Get an element from the map.
+ * \return null if element is not contained in map.
+ */
+struct intel_resolve_map*
+intel_resolve_map_get(struct intel_resolve_map *head,
+ uint32_t level,
+ uint32_t layer)
+{
+ struct intel_resolve_map *item = head->next;
+
+ while (item) {
+ if (item->level == level && item->layer == layer)
+ break;
+ else
+ item = item->next;
+ }
+
+ return item;
+}
+
+/**
+ * \brief Remove and free an element from the map.
+ */
+void
+intel_resolve_map_remove(struct intel_resolve_map *elem)
+{
+ if (elem->prev)
+ elem->prev->next = elem->next;
+ if (elem->next)
+ elem->next->prev = elem->prev;
+ free(elem);
+}
+
+/**
+ * \brief Remove and free all elements of the map.
+ */
+void
+intel_resolve_map_clear(struct intel_resolve_map *head)
+{
+ struct intel_resolve_map *next = head->next;
+ struct intel_resolve_map *trash;
+
+ while (next) {
+ trash = next;
+ next = next->next;
+ free(trash);
+ }
+
+ head->next = NULL;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_screen.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_screen.c
index f2db48272b9..00a1b0122ec 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_screen.c
@@ -1 +1,1204 @@
-../intel/intel_screen.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <errno.h>
+#include <time.h>
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/hash.h"
+#include "main/fbobject.h"
+#include "main/mfeatures.h"
+#include "main/version.h"
+#include "swrast/s_renderbuffer.h"
+
+#include "utils.h"
+#include "xmlpool.h"
+
+PUBLIC const char __driConfigOptions[] =
+ DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_ALWAYS_SYNC)
+ /* Options correspond to DRI_CONF_BO_REUSE_DISABLED,
+ * DRI_CONF_BO_REUSE_ALL
+ */
+ DRI_CONF_OPT_BEGIN_V(bo_reuse, enum, 1, "0:1")
+ DRI_CONF_DESC_BEGIN(en, "Buffer object reuse")
+ DRI_CONF_ENUM(0, "Disable buffer object reuse")
+ DRI_CONF_ENUM(1, "Enable reuse of all sizes of buffer objects")
+ DRI_CONF_DESC_END
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(texture_tiling, bool, true)
+ DRI_CONF_DESC(en, "Enable texture tiling")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(hiz, bool, true)
+ DRI_CONF_DESC(en, "Enable Hierarchical Z on gen6+")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(early_z, bool, false)
+ DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(fragment_shader, bool, true)
+ DRI_CONF_DESC(en, "Enable limited ARB_fragment_shader support on 915/945.")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_QUALITY
+ DRI_CONF_FORCE_S3TC_ENABLE(false)
+ DRI_CONF_ALLOW_LARGE_TEXTURES(2)
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_NO_RAST(false)
+ DRI_CONF_ALWAYS_FLUSH_BATCH(false)
+ DRI_CONF_ALWAYS_FLUSH_CACHE(false)
+ DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
+ DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
+
+ DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false)
+ DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(shader_precompile, bool, true)
+ DRI_CONF_DESC(en, "Perform code generation at shader link time.")
+ DRI_CONF_OPT_END
+ DRI_CONF_SECTION_END
+DRI_CONF_END;
+
+const GLuint __driNConfigOptions = 15;
+
+#include "intel_batchbuffer.h"
+#include "intel_buffers.h"
+#include "intel_bufmgr.h"
+#include "intel_chipset.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_screen.h"
+#include "intel_tex.h"
+#include "intel_regions.h"
+
+#include "i915_drm.h"
+
+#ifdef USE_NEW_INTERFACE
+static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
+#endif /*USE_NEW_INTERFACE */
+
+/**
+ * For debugging purposes, this returns a time in seconds.
+ */
+double
+get_time(void)
+{
+ struct timespec tp;
+
+ clock_gettime(CLOCK_MONOTONIC, &tp);
+
+ return tp.tv_sec + tp.tv_nsec / 1000000000.0;
+}
+
+void
+aub_dump_bmp(struct gl_context *ctx)
+{
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+
+ for (int i = 0; i < fb->_NumColorDrawBuffers; i++) {
+ struct intel_renderbuffer *irb =
+ intel_renderbuffer(fb->_ColorDrawBuffers[i]);
+
+ if (irb && irb->mt) {
+ enum aub_dump_bmp_format format;
+
+ switch (irb->Base.Base.Format) {
+ case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_XRGB8888:
+ format = AUB_DUMP_BMP_FORMAT_ARGB_8888;
+ break;
+ default:
+ continue;
+ }
+
+ drm_intel_gem_bo_aub_dump_bmp(irb->mt->region->bo,
+ irb->draw_x,
+ irb->draw_y,
+ irb->Base.Base.Width,
+ irb->Base.Base.Height,
+ format,
+ irb->mt->region->pitch *
+ irb->mt->region->cpp,
+ 0);
+ }
+ }
+}
+
+static const __DRItexBufferExtension intelTexBufferExtension = {
+ { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
+ intelSetTexBuffer,
+ intelSetTexBuffer2,
+};
+
+static void
+intelDRI2Flush(__DRIdrawable *drawable)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct intel_context *intel = intel_context(ctx);
+ if (intel == NULL)
+ return;
+
+ if (intel->gen < 4)
+ INTEL_FIREVERTICES(intel);
+
+ intel_downsample_for_dri2_flush(intel, drawable);
+ intel->need_throttle = true;
+
+ if (intel->batch.used)
+ intel_batchbuffer_flush(intel);
+
+ if (INTEL_DEBUG & DEBUG_AUB) {
+ aub_dump_bmp(ctx);
+ }
+}
+
+static const struct __DRI2flushExtensionRec intelFlushExtension = {
+ { __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
+ intelDRI2Flush,
+ dri2InvalidateDrawable,
+};
+
+struct intel_image_format intel_image_formats[] = {
+ { __DRI_IMAGE_FOURCC_ARGB8888, __DRI_IMAGE_COMPONENTS_RGBA, 1,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_ARGB8888, 4 } } },
+
+ { __DRI_IMAGE_FOURCC_XRGB8888, __DRI_IMAGE_COMPONENTS_RGB, 1,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_XRGB8888, 4 }, } },
+
+ { __DRI_IMAGE_FOURCC_YUV410, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_YUV411, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 2, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 2, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_YUV420, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_YUV422, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 1, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 1, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_YUV444, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_NV12, __DRI_IMAGE_COMPONENTS_Y_UV, 2,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 1, 1, __DRI_IMAGE_FORMAT_GR88, 2 } } },
+
+ { __DRI_IMAGE_FOURCC_NV16, __DRI_IMAGE_COMPONENTS_Y_UV, 2,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 1, 0, __DRI_IMAGE_FORMAT_GR88, 2 } } },
+
+ /* For YUYV buffers, we set up two overlapping DRI images and treat
+ * them as planar buffers in the compositors. Plane 0 is GR88 and
+ * samples YU or YV pairs and places Y into the R component, while
+ * plane 1 is ARGB and samples YUYV clusters and places pairs and
+ * places U into the G component and V into A. This lets the
+ * texture sampler interpolate the Y components correctly when
+ * sampling from plane 0, and interpolate U and V correctly when
+ * sampling from plane 1. */
+ { __DRI_IMAGE_FOURCC_YUYV, __DRI_IMAGE_COMPONENTS_Y_XUXV, 2,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_GR88, 2 },
+ { 0, 1, 0, __DRI_IMAGE_FORMAT_ARGB8888, 4 } } }
+};
+
+static __DRIimage *
+intel_allocate_image(int dri_format, void *loaderPrivate)
+{
+ __DRIimage *image;
+
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ image->dri_format = dri_format;
+ image->offset = 0;
+
+ switch (dri_format) {
+ case __DRI_IMAGE_FORMAT_RGB565:
+ image->format = MESA_FORMAT_RGB565;
+ break;
+ case __DRI_IMAGE_FORMAT_XRGB8888:
+ image->format = MESA_FORMAT_XRGB8888;
+ break;
+ case __DRI_IMAGE_FORMAT_ARGB8888:
+ image->format = MESA_FORMAT_ARGB8888;
+ break;
+ case __DRI_IMAGE_FORMAT_ABGR8888:
+ image->format = MESA_FORMAT_RGBA8888_REV;
+ break;
+ case __DRI_IMAGE_FORMAT_XBGR8888:
+ image->format = MESA_FORMAT_RGBX8888_REV;
+ break;
+ case __DRI_IMAGE_FORMAT_R8:
+ image->format = MESA_FORMAT_R8;
+ break;
+ case __DRI_IMAGE_FORMAT_GR88:
+ image->format = MESA_FORMAT_GR88;
+ break;
+ case __DRI_IMAGE_FORMAT_NONE:
+ image->format = MESA_FORMAT_NONE;
+ break;
+ default:
+ free(image);
+ return NULL;
+ }
+
+ image->internal_format = _mesa_get_format_base_format(image->format);
+ image->data = loaderPrivate;
+
+ return image;
+}
+
+static __DRIimage *
+intel_create_image_from_name(__DRIscreen *screen,
+ int width, int height, int format,
+ int name, int pitch, void *loaderPrivate)
+{
+ struct intel_screen *intelScreen = screen->driverPrivate;
+ __DRIimage *image;
+ int cpp;
+
+ image = intel_allocate_image(format, loaderPrivate);
+ if (image->format == MESA_FORMAT_NONE)
+ cpp = 1;
+ else
+ cpp = _mesa_get_format_bytes(image->format);
+ image->region = intel_region_alloc_for_handle(intelScreen,
+ cpp, width, height,
+ pitch, name, "image");
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ return image;
+}
+
+static __DRIimage *
+intel_create_image_from_renderbuffer(__DRIcontext *context,
+ int renderbuffer, void *loaderPrivate)
+{
+ __DRIimage *image;
+ struct intel_context *intel = context->driverPrivate;
+ struct gl_renderbuffer *rb;
+ struct intel_renderbuffer *irb;
+
+ rb = _mesa_lookup_renderbuffer(&intel->ctx, renderbuffer);
+ if (!rb) {
+ _mesa_error(&intel->ctx,
+ GL_INVALID_OPERATION, "glRenderbufferExternalMESA");
+ return NULL;
+ }
+
+ irb = intel_renderbuffer(rb);
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ image->internal_format = rb->InternalFormat;
+ image->format = rb->Format;
+ image->offset = 0;
+ image->data = loaderPrivate;
+ intel_region_reference(&image->region, irb->mt->region);
+
+ switch (image->format) {
+ case MESA_FORMAT_RGB565:
+ image->dri_format = __DRI_IMAGE_FORMAT_RGB565;
+ break;
+ case MESA_FORMAT_XRGB8888:
+ image->dri_format = __DRI_IMAGE_FORMAT_XRGB8888;
+ break;
+ case MESA_FORMAT_ARGB8888:
+ image->dri_format = __DRI_IMAGE_FORMAT_ARGB8888;
+ break;
+ case MESA_FORMAT_RGBA8888_REV:
+ image->dri_format = __DRI_IMAGE_FORMAT_ABGR8888;
+ break;
+ case MESA_FORMAT_R8:
+ image->dri_format = __DRI_IMAGE_FORMAT_R8;
+ break;
+ case MESA_FORMAT_RG88:
+ image->dri_format = __DRI_IMAGE_FORMAT_GR88;
+ break;
+ }
+
+ return image;
+}
+
+static void
+intel_destroy_image(__DRIimage *image)
+{
+ intel_region_release(&image->region);
+ FREE(image);
+}
+
+static __DRIimage *
+intel_create_image(__DRIscreen *screen,
+ int width, int height, int format,
+ unsigned int use,
+ void *loaderPrivate)
+{
+ __DRIimage *image;
+ struct intel_screen *intelScreen = screen->driverPrivate;
+ uint32_t tiling;
+ int cpp;
+
+ tiling = I915_TILING_X;
+ if (use & __DRI_IMAGE_USE_CURSOR) {
+ if (width != 64 || height != 64)
+ return NULL;
+ tiling = I915_TILING_NONE;
+ }
+
+ image = intel_allocate_image(format, loaderPrivate);
+ cpp = _mesa_get_format_bytes(image->format);
+ image->region =
+ intel_region_alloc(intelScreen, tiling, cpp, width, height, true);
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ return image;
+}
+
+static GLboolean
+intel_query_image(__DRIimage *image, int attrib, int *value)
+{
+ switch (attrib) {
+ case __DRI_IMAGE_ATTRIB_STRIDE:
+ *value = image->region->pitch * image->region->cpp;
+ return true;
+ case __DRI_IMAGE_ATTRIB_HANDLE:
+ *value = image->region->bo->handle;
+ return true;
+ case __DRI_IMAGE_ATTRIB_NAME:
+ return intel_region_flink(image->region, (uint32_t *) value);
+ case __DRI_IMAGE_ATTRIB_FORMAT:
+ *value = image->dri_format;
+ return true;
+ case __DRI_IMAGE_ATTRIB_WIDTH:
+ *value = image->region->width;
+ return true;
+ case __DRI_IMAGE_ATTRIB_HEIGHT:
+ *value = image->region->height;
+ return true;
+ case __DRI_IMAGE_ATTRIB_COMPONENTS:
+ if (image->planar_format == NULL)
+ return false;
+ *value = image->planar_format->components;
+ return true;
+ default:
+ return false;
+ }
+}
+
+static __DRIimage *
+intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
+{
+ __DRIimage *image;
+
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ intel_region_reference(&image->region, orig_image->region);
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ image->internal_format = orig_image->internal_format;
+ image->planar_format = orig_image->planar_format;
+ image->dri_format = orig_image->dri_format;
+ image->format = orig_image->format;
+ image->offset = orig_image->offset;
+ image->data = loaderPrivate;
+
+ memcpy(image->strides, orig_image->strides, sizeof(image->strides));
+ memcpy(image->offsets, orig_image->offsets, sizeof(image->offsets));
+
+ return image;
+}
+
+static GLboolean
+intel_validate_usage(__DRIimage *image, unsigned int use)
+{
+ if (use & __DRI_IMAGE_USE_CURSOR) {
+ if (image->region->width != 64 || image->region->height != 64)
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static __DRIimage *
+intel_create_image_from_names(__DRIscreen *screen,
+ int width, int height, int fourcc,
+ int *names, int num_names,
+ int *strides, int *offsets,
+ void *loaderPrivate)
+{
+ struct intel_image_format *f = NULL;
+ __DRIimage *image;
+ int i, index;
+
+ if (screen == NULL || names == NULL || num_names != 1)
+ return NULL;
+
+ for (i = 0; i < ARRAY_SIZE(intel_image_formats); i++) {
+ if (intel_image_formats[i].fourcc == fourcc) {
+ f = &intel_image_formats[i];
+ }
+ }
+
+ if (f == NULL)
+ return NULL;
+
+ image = intel_create_image_from_name(screen, width, height,
+ __DRI_IMAGE_FORMAT_NONE,
+ names[0], strides[0],
+ loaderPrivate);
+
+ if (image == NULL)
+ return NULL;
+
+ image->planar_format = f;
+ for (i = 0; i < f->nplanes; i++) {
+ index = f->planes[i].buffer_index;
+ image->offsets[index] = offsets[index];
+ image->strides[index] = strides[index];
+ }
+
+ return image;
+}
+
+static __DRIimage *
+intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
+{
+ int width, height, offset, stride, dri_format, cpp, index, pitch;
+ struct intel_image_format *f;
+ uint32_t mask_x, mask_y;
+ __DRIimage *image;
+
+ if (parent == NULL || parent->planar_format == NULL)
+ return NULL;
+
+ f = parent->planar_format;
+
+ if (plane >= f->nplanes)
+ return NULL;
+
+ width = parent->region->width >> f->planes[plane].width_shift;
+ height = parent->region->height >> f->planes[plane].height_shift;
+ dri_format = f->planes[plane].dri_format;
+ index = f->planes[plane].buffer_index;
+ offset = parent->offsets[index];
+ stride = parent->strides[index];
+
+ image = intel_allocate_image(dri_format, loaderPrivate);
+ cpp = _mesa_get_format_bytes(image->format); /* safe since no none format */
+ pitch = stride / cpp;
+ if (offset + height * cpp * pitch > parent->region->bo->size) {
+ _mesa_warning(NULL, "intel_create_sub_image: subimage out of bounds");
+ FREE(image);
+ return NULL;
+ }
+
+ image->region = calloc(sizeof(*image->region), 1);
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ image->region->cpp = _mesa_get_format_bytes(image->format);
+ image->region->width = width;
+ image->region->height = height;
+ image->region->pitch = pitch;
+ image->region->refcount = 1;
+ image->region->bo = parent->region->bo;
+ drm_intel_bo_reference(image->region->bo);
+ image->region->tiling = parent->region->tiling;
+ image->region->screen = parent->region->screen;
+ image->offset = offset;
+
+ intel_region_get_tile_masks(image->region, &mask_x, &mask_y, false);
+ if (offset & mask_x)
+ _mesa_warning(NULL,
+ "intel_create_sub_image: offset not on tile boundary");
+
+ return image;
+}
+
+static struct __DRIimageExtensionRec intelImageExtension = {
+ { __DRI_IMAGE, 5 },
+ intel_create_image_from_name,
+ intel_create_image_from_renderbuffer,
+ intel_destroy_image,
+ intel_create_image,
+ intel_query_image,
+ intel_dup_image,
+ intel_validate_usage,
+ intel_create_image_from_names,
+ intel_from_planar
+};
+
+static const __DRIextension *intelScreenExtensions[] = {
+ &intelTexBufferExtension.base,
+ &intelFlushExtension.base,
+ &intelImageExtension.base,
+ &dri2ConfigQueryExtension.base,
+ NULL
+};
+
+static bool
+intel_get_param(__DRIscreen *psp, int param, int *value)
+{
+ int ret;
+ struct drm_i915_getparam gp;
+
+ memset(&gp, 0, sizeof(gp));
+ gp.param = param;
+ gp.value = value;
+
+ ret = drmCommandWriteRead(psp->fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
+ if (ret) {
+ if (ret != -EINVAL)
+ _mesa_warning(NULL, "drm_i915_getparam: %d", ret);
+ return false;
+ }
+
+ return true;
+}
+
+static bool
+intel_get_boolean(__DRIscreen *psp, int param)
+{
+ int value = 0;
+ return intel_get_param(psp, param, &value) && value;
+}
+
+static void
+nop_callback(GLuint key, void *data, void *userData)
+{
+}
+
+static void
+intelDestroyScreen(__DRIscreen * sPriv)
+{
+ struct intel_screen *intelScreen = sPriv->driverPrivate;
+
+ dri_bufmgr_destroy(intelScreen->bufmgr);
+ driDestroyOptionInfo(&intelScreen->optionCache);
+
+ /* Some regions may still have references to them at this point, so
+ * flush the hash table to prevent _mesa_DeleteHashTable() from
+ * complaining about the hash not being empty; */
+ _mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL);
+ _mesa_DeleteHashTable(intelScreen->named_regions);
+
+ FREE(intelScreen);
+ sPriv->driverPrivate = NULL;
+}
+
+
+/**
+ * This is called when we need to set up GL rendering to a new X window.
+ */
+static GLboolean
+intelCreateBuffer(__DRIscreen * driScrnPriv,
+ __DRIdrawable * driDrawPriv,
+ const struct gl_config * mesaVis, GLboolean isPixmap)
+{
+ struct intel_renderbuffer *rb;
+ struct intel_screen *screen = (struct intel_screen*) driScrnPriv->driverPrivate;
+ gl_format rgbFormat;
+ unsigned num_samples = intel_quantize_num_samples(screen, mesaVis->samples);
+ struct gl_framebuffer *fb;
+
+ if (isPixmap)
+ return false;
+
+ fb = CALLOC_STRUCT(gl_framebuffer);
+ if (!fb)
+ return false;
+
+ _mesa_initialize_window_framebuffer(fb, mesaVis);
+
+ if (mesaVis->redBits == 5)
+ rgbFormat = MESA_FORMAT_RGB565;
+ else if (mesaVis->alphaBits == 0)
+ rgbFormat = MESA_FORMAT_XRGB8888;
+ else
+ rgbFormat = MESA_FORMAT_ARGB8888;
+
+ /* setup the hardware-based renderbuffers */
+ rb = intel_create_renderbuffer(rgbFormat, num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &rb->Base.Base);
+
+ if (mesaVis->doubleBufferMode) {
+ rb = intel_create_renderbuffer(rgbFormat, num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &rb->Base.Base);
+ }
+
+ /*
+ * Assert here that the gl_config has an expected depth/stencil bit
+ * combination: one of d24/s8, d16/s0, d0/s0. (See intelInitScreen2(),
+ * which constructs the advertised configs.)
+ */
+ if (mesaVis->depthBits == 24) {
+ assert(mesaVis->stencilBits == 8);
+
+ if (screen->hw_has_separate_stencil) {
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_X8_Z24,
+ num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_S8,
+ num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base);
+ } else {
+ /*
+ * Use combined depth/stencil. Note that the renderbuffer is
+ * attached to two attachment points.
+ */
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_S8_Z24,
+ num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
+ _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base);
+ }
+ }
+ else if (mesaVis->depthBits == 16) {
+ assert(mesaVis->stencilBits == 0);
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_Z16,
+ num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
+ }
+ else {
+ assert(mesaVis->depthBits == 0);
+ assert(mesaVis->stencilBits == 0);
+ }
+
+ /* now add any/all software-based renderbuffers we may need */
+ _swrast_add_soft_renderbuffers(fb,
+ false, /* never sw color */
+ false, /* never sw depth */
+ false, /* never sw stencil */
+ mesaVis->accumRedBits > 0,
+ false, /* never sw alpha */
+ false /* never sw aux */ );
+ driDrawPriv->driverPrivate = fb;
+
+ return true;
+}
+
+static void
+intelDestroyBuffer(__DRIdrawable * driDrawPriv)
+{
+ struct gl_framebuffer *fb = driDrawPriv->driverPrivate;
+
+ _mesa_reference_framebuffer(&fb, NULL);
+}
+
+/* There are probably better ways to do this, such as an
+ * init-designated function to register chipids and createcontext
+ * functions.
+ */
+extern bool
+i830CreateContext(const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ void *sharedContextPrivate);
+
+extern bool
+i915CreateContext(int api,
+ const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ unsigned *error,
+ void *sharedContextPrivate);
+extern bool
+brwCreateContext(int api,
+ const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ uint32_t flags,
+ unsigned *error,
+ void *sharedContextPrivate);
+
+static GLboolean
+intelCreateContext(gl_api api,
+ const struct gl_config * mesaVis,
+ __DRIcontext * driContextPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ uint32_t flags,
+ unsigned *error,
+ void *sharedContextPrivate)
+{
+ __DRIscreen *sPriv = driContextPriv->driScreenPriv;
+ struct intel_screen *intelScreen = sPriv->driverPrivate;
+ bool success = false;
+
+#ifdef I915
+ if (IS_9XX(intelScreen->deviceID)) {
+ success = i915CreateContext(api, mesaVis, driContextPriv,
+ major_version, minor_version, error,
+ sharedContextPrivate);
+ } else {
+ switch (api) {
+ case API_OPENGL:
+ if (major_version > 1 || minor_version > 3) {
+ *error = __DRI_CTX_ERROR_BAD_VERSION;
+ success = false;
+ }
+ break;
+ case API_OPENGLES:
+ break;
+ default:
+ *error = __DRI_CTX_ERROR_BAD_API;
+ success = false;
+ }
+
+ if (success) {
+ intelScreen->no_vbo = true;
+ success = i830CreateContext(mesaVis, driContextPriv,
+ sharedContextPrivate);
+ if (!success)
+ *error = __DRI_CTX_ERROR_NO_MEMORY;
+ }
+ }
+#else
+ success = brwCreateContext(api, mesaVis,
+ driContextPriv,
+ major_version, minor_version, flags,
+ error, sharedContextPrivate);
+#endif
+
+ if (success)
+ return true;
+
+ if (driContextPriv->driverPrivate != NULL)
+ intelDestroyContext(driContextPriv);
+
+ return false;
+}
+
+static bool
+intel_init_bufmgr(struct intel_screen *intelScreen)
+{
+ __DRIscreen *spriv = intelScreen->driScrnPriv;
+ int num_fences = 0;
+
+ intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL;
+
+ intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ);
+ if (intelScreen->bufmgr == NULL) {
+ fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n",
+ __func__, __LINE__);
+ return false;
+ }
+
+ if (!intel_get_param(spriv, I915_PARAM_NUM_FENCES_AVAIL, &num_fences) ||
+ num_fences == 0) {
+ fprintf(stderr, "[%s: %u] Kernel 2.6.29 required.\n", __func__, __LINE__);
+ return false;
+ }
+
+ drm_intel_bufmgr_gem_enable_fenced_relocs(intelScreen->bufmgr);
+
+ intelScreen->named_regions = _mesa_NewHashTable();
+
+ intelScreen->relaxed_relocations = 0;
+ intelScreen->relaxed_relocations |=
+ intel_get_boolean(spriv, I915_PARAM_HAS_RELAXED_DELTA) << 0;
+
+ return true;
+}
+
+/**
+ * Override intel_screen.hw_has_separate_stencil with environment variable
+ * INTEL_SEPARATE_STENCIL.
+ *
+ * Valid values for INTEL_SEPARATE_STENCIL are "0" and "1". If an invalid
+ * valid value is encountered, a warning is emitted and INTEL_SEPARATE_STENCIL
+ * is ignored.
+ */
+static void
+intel_override_separate_stencil(struct intel_screen *screen)
+{
+ const char *s = getenv("INTEL_SEPARATE_STENCIL");
+ if (!s) {
+ return;
+ } else if (!strncmp("0", s, 2)) {
+ screen->hw_has_separate_stencil = false;
+ } else if (!strncmp("1", s, 2)) {
+ screen->hw_has_separate_stencil = true;
+ } else {
+ fprintf(stderr,
+ "warning: env variable INTEL_SEPARATE_STENCIL=\"%s\" has "
+ "invalid value and is ignored", s);
+ }
+}
+
+static bool
+intel_detect_swizzling(struct intel_screen *screen)
+{
+ drm_intel_bo *buffer;
+ unsigned long flags = 0;
+ unsigned long aligned_pitch;
+ uint32_t tiling = I915_TILING_X;
+ uint32_t swizzle_mode = 0;
+
+ buffer = drm_intel_bo_alloc_tiled(screen->bufmgr, "swizzle test",
+ 64, 64, 4,
+ &tiling, &aligned_pitch, flags);
+ if (buffer == NULL)
+ return false;
+
+ drm_intel_bo_get_tiling(buffer, &tiling, &swizzle_mode);
+ drm_intel_bo_unreference(buffer);
+
+ if (swizzle_mode == I915_BIT_6_SWIZZLE_NONE)
+ return false;
+ else
+ return true;
+}
+
+static __DRIconfig**
+intel_screen_make_configs(__DRIscreen *dri_screen)
+{
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ };
+
+ static const uint8_t singlesample_samples[1] = {0};
+ static const uint8_t multisample_samples[2] = {4, 8};
+
+ struct intel_screen *screen = dri_screen->driverPrivate;
+ GLenum fb_format[3];
+ GLenum fb_type[3];
+ uint8_t depth_bits[4], stencil_bits[4];
+ __DRIconfig **configs = NULL;
+
+ fb_format[0] = GL_RGB;
+ fb_type[0] = GL_UNSIGNED_SHORT_5_6_5;
+
+ fb_format[1] = GL_BGR;
+ fb_type[1] = GL_UNSIGNED_INT_8_8_8_8_REV;
+
+ fb_format[2] = GL_BGRA;
+ fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV;
+
+ /* Generate singlesample configs without accumulation buffer. */
+ for (int i = 0; i < ARRAY_SIZE(fb_format); i++) {
+ __DRIconfig **new_configs;
+ const int num_depth_stencil_bits = 2;
+
+ /* Starting with DRI2 protocol version 1.1 we can request a depth/stencil
+ * buffer that has a different number of bits per pixel than the color
+ * buffer. This isn't yet supported here.
+ */
+ depth_bits[0] = 0;
+ stencil_bits[0] = 0;
+
+ if (fb_type[i] == GL_UNSIGNED_SHORT_5_6_5) {
+ depth_bits[1] = 16;
+ stencil_bits[1] = 0;
+ } else {
+ depth_bits[1] = 24;
+ stencil_bits[1] = 8;
+ }
+
+ new_configs = driCreateConfigs(fb_format[i], fb_type[i],
+ depth_bits,
+ stencil_bits,
+ num_depth_stencil_bits,
+ back_buffer_modes,
+ ARRAY_SIZE(back_buffer_modes),
+ singlesample_samples, 1,
+ false);
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ /* Generate the minimum possible set of configs that include an
+ * accumulation buffer.
+ */
+ for (int i = 0; i < ARRAY_SIZE(fb_format); i++) {
+ __DRIconfig **new_configs;
+
+ if (fb_type[i] == GL_UNSIGNED_SHORT_5_6_5) {
+ depth_bits[0] = 16;
+ stencil_bits[0] = 0;
+ } else {
+ depth_bits[0] = 24;
+ stencil_bits[0] = 8;
+ }
+
+ new_configs = driCreateConfigs(fb_format[i], fb_type[i],
+ depth_bits, stencil_bits, 1,
+ back_buffer_modes + 1, 1,
+ singlesample_samples, 1,
+ true);
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ /* Generate multisample configs.
+ *
+ * This loop breaks early, and hence is a no-op, on gen < 6.
+ *
+ * Multisample configs must follow the singlesample configs in order to
+ * work around an X server bug present in 1.12. The X server chooses to
+ * associate the first listed RGBA888-Z24S8 config, regardless of its
+ * sample count, with the 32-bit depth visual used for compositing.
+ *
+ * Only doublebuffer configs with GLX_SWAP_UNDEFINED_OML behavior are
+ * supported. Singlebuffer configs are not supported because no one wants
+ * them. GLX_SWAP_COPY_OML is not supported due to page flipping.
+ */
+ for (int i = 0; i < ARRAY_SIZE(fb_format); i++) {
+ if (screen->gen < 6)
+ break;
+
+ __DRIconfig **new_configs;
+ const int num_depth_stencil_bits = 2;
+ int num_msaa_modes = 0;
+
+ depth_bits[0] = 0;
+ stencil_bits[0] = 0;
+
+ if (fb_type[i] == GL_UNSIGNED_SHORT_5_6_5) {
+ depth_bits[1] = 16;
+ stencil_bits[1] = 0;
+ } else {
+ depth_bits[1] = 24;
+ stencil_bits[1] = 8;
+ }
+
+ if (screen->gen >= 7)
+ num_msaa_modes = 2;
+ else if (screen->gen == 6)
+ num_msaa_modes = 1;
+
+ new_configs = driCreateConfigs(fb_format[i], fb_type[i],
+ depth_bits,
+ stencil_bits,
+ num_depth_stencil_bits,
+ back_buffer_modes + 1, 1,
+ multisample_samples,
+ num_msaa_modes,
+ false);
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ if (configs == NULL) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ __LINE__);
+ return NULL;
+ }
+
+ return configs;
+}
+
+/**
+ * This is the driver specific part of the createNewScreen entry point.
+ * Called when using DRI2.
+ *
+ * \return the struct gl_config supported by this driver
+ */
+static const
+__DRIconfig **intelInitScreen2(__DRIscreen *psp)
+{
+ struct intel_screen *intelScreen;
+ unsigned int api_mask;
+
+ if (psp->dri2.loader->base.version <= 2 ||
+ psp->dri2.loader->getBuffersWithFormat == NULL) {
+ fprintf(stderr,
+ "\nERROR! DRI2 loader with getBuffersWithFormat() "
+ "support required\n");
+ return false;
+ }
+
+ /* Allocate the private area */
+ intelScreen = CALLOC(sizeof *intelScreen);
+ if (!intelScreen) {
+ fprintf(stderr, "\nERROR! Allocating private area failed\n");
+ return false;
+ }
+ /* parse information in __driConfigOptions */
+ driParseOptionInfo(&intelScreen->optionCache,
+ __driConfigOptions, __driNConfigOptions);
+
+ intelScreen->driScrnPriv = psp;
+ psp->driverPrivate = (void *) intelScreen;
+
+ if (!intel_init_bufmgr(intelScreen))
+ return false;
+
+ intelScreen->deviceID = drm_intel_bufmgr_gem_get_devid(intelScreen->bufmgr);
+
+ intelScreen->kernel_has_gen7_sol_reset =
+ intel_get_boolean(intelScreen->driScrnPriv,
+ I915_PARAM_HAS_GEN7_SOL_RESET);
+
+ if (IS_GEN7(intelScreen->deviceID)) {
+ intelScreen->gen = 7;
+ } else if (IS_GEN6(intelScreen->deviceID)) {
+ intelScreen->gen = 6;
+ } else if (IS_GEN5(intelScreen->deviceID)) {
+ intelScreen->gen = 5;
+ } else if (IS_965(intelScreen->deviceID)) {
+ intelScreen->gen = 4;
+ } else if (IS_9XX(intelScreen->deviceID)) {
+ intelScreen->gen = 3;
+ } else {
+ intelScreen->gen = 2;
+ }
+
+ intelScreen->hw_has_separate_stencil = intelScreen->gen >= 6;
+ intelScreen->hw_must_use_separate_stencil = intelScreen->gen >= 7;
+
+ int has_llc = 0;
+ bool success = intel_get_param(intelScreen->driScrnPriv, I915_PARAM_HAS_LLC,
+ &has_llc);
+ if (success && has_llc)
+ intelScreen->hw_has_llc = true;
+ else if (!success && intelScreen->gen >= 6)
+ intelScreen->hw_has_llc = true;
+
+ intel_override_separate_stencil(intelScreen);
+
+ api_mask = (1 << __DRI_API_OPENGL);
+#if FEATURE_ES1
+ api_mask |= (1 << __DRI_API_GLES);
+#endif
+#if FEATURE_ES2
+ api_mask |= (1 << __DRI_API_GLES2);
+#endif
+
+ if (IS_9XX(intelScreen->deviceID) || IS_965(intelScreen->deviceID))
+ psp->api_mask = api_mask;
+
+ intelScreen->hw_has_swizzling = intel_detect_swizzling(intelScreen);
+
+ psp->extensions = intelScreenExtensions;
+
+ return (const __DRIconfig**) intel_screen_make_configs(psp);
+}
+
+struct intel_buffer {
+ __DRIbuffer base;
+ struct intel_region *region;
+};
+
+static __DRIbuffer *
+intelAllocateBuffer(__DRIscreen *screen,
+ unsigned attachment, unsigned format,
+ int width, int height)
+{
+ struct intel_buffer *intelBuffer;
+ struct intel_screen *intelScreen = screen->driverPrivate;
+
+ assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
+ attachment == __DRI_BUFFER_BACK_LEFT);
+
+ intelBuffer = CALLOC(sizeof *intelBuffer);
+ if (intelBuffer == NULL)
+ return NULL;
+
+ /* The front and back buffers are color buffers, which are X tiled. */
+ intelBuffer->region = intel_region_alloc(intelScreen,
+ I915_TILING_X,
+ format / 8,
+ width,
+ height,
+ true);
+
+ if (intelBuffer->region == NULL) {
+ FREE(intelBuffer);
+ return NULL;
+ }
+
+ intel_region_flink(intelBuffer->region, &intelBuffer->base.name);
+
+ intelBuffer->base.attachment = attachment;
+ intelBuffer->base.cpp = intelBuffer->region->cpp;
+ intelBuffer->base.pitch =
+ intelBuffer->region->pitch * intelBuffer->region->cpp;
+
+ return &intelBuffer->base;
+}
+
+static void
+intelReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
+{
+ struct intel_buffer *intelBuffer = (struct intel_buffer *) buffer;
+
+ intel_region_release(&intelBuffer->region);
+ free(intelBuffer);
+}
+
+
+const struct __DriverAPIRec driDriverAPI = {
+ .InitScreen = intelInitScreen2,
+ .DestroyScreen = intelDestroyScreen,
+ .CreateContext = intelCreateContext,
+ .DestroyContext = intelDestroyContext,
+ .CreateBuffer = intelCreateBuffer,
+ .DestroyBuffer = intelDestroyBuffer,
+ .MakeCurrent = intelMakeCurrent,
+ .UnbindContext = intelUnbindContext,
+ .AllocateBuffer = intelAllocateBuffer,
+ .ReleaseBuffer = intelReleaseBuffer
+};
+
+/* This is the table of extensions that the loader will dlsym() for. */
+PUBLIC const __DRIextension *__driDriverExtensions[] = {
+ &driCoreExtension.base,
+ &driDRI2Extension.base,
+ NULL
+};
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_span.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_span.c
index 05e5e8e5833..d7eaa41241e 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_span.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_span.c
@@ -1 +1,215 @@
-../intel/intel_span.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2011 Intel Corporation
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Chad Versace <chad@chad-versace.us>
+ *
+ **************************************************************************/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/renderbuffer.h"
+
+#include "intel_buffers.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_screen.h"
+#include "intel_span.h"
+#include "intel_regions.h"
+#include "intel_tex.h"
+
+#include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
+
+/**
+ * \brief Get pointer offset into stencil buffer.
+ *
+ * The stencil buffer is W tiled. Since the GTT is incapable of W fencing, we
+ * must decode the tile's layout in software.
+ *
+ * See
+ * - PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section 4.5.2.1 W-Major Tile
+ * Format.
+ * - PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section 4.5.3 Tiling Algorithm
+ *
+ * Even though the returned offset is always positive, the return type is
+ * signed due to
+ * commit e8b1c6d6f55f5be3bef25084fdd8b6127517e137
+ * mesa: Fix return type of _mesa_get_format_bytes() (#37351)
+ */
+intptr_t
+intel_offset_S8(uint32_t stride, uint32_t x, uint32_t y, bool swizzled)
+{
+ uint32_t tile_size = 4096;
+ uint32_t tile_width = 64;
+ uint32_t tile_height = 64;
+ uint32_t row_size = 64 * stride;
+
+ uint32_t tile_x = x / tile_width;
+ uint32_t tile_y = y / tile_height;
+
+ /* The byte's address relative to the tile's base addres. */
+ uint32_t byte_x = x % tile_width;
+ uint32_t byte_y = y % tile_height;
+
+ uintptr_t u = tile_y * row_size
+ + tile_x * tile_size
+ + 512 * (byte_x / 8)
+ + 64 * (byte_y / 8)
+ + 32 * ((byte_y / 4) % 2)
+ + 16 * ((byte_x / 4) % 2)
+ + 8 * ((byte_y / 2) % 2)
+ + 4 * ((byte_x / 2) % 2)
+ + 2 * (byte_y % 2)
+ + 1 * (byte_x % 2);
+
+ if (swizzled) {
+ /* adjust for bit6 swizzling */
+ if (((byte_x / 8) % 2) == 1) {
+ if (((byte_y / 8) % 2) == 0) {
+ u += 64;
+ } else {
+ u -= 64;
+ }
+ }
+ }
+
+ return u;
+}
+
+/**
+ * Map the regions needed by intelSpanRenderStart().
+ */
+static void
+intel_span_map_buffers(struct intel_context *intel)
+{
+ struct gl_context *ctx = &intel->ctx;
+ struct intel_texture_object *tex_obj;
+
+ for (int i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (!ctx->Texture.Unit[i]._ReallyEnabled)
+ continue;
+ tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current);
+ intel_finalize_mipmap_tree(intel, i);
+ intel_tex_map_images(intel, tex_obj,
+ GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
+ }
+
+ _swrast_map_renderbuffers(ctx);
+}
+
+/**
+ * Prepare for software rendering. Map current read/draw framebuffers'
+ * renderbuffes and all currently bound texture objects.
+ *
+ * Old note: Moved locking out to get reasonable span performance.
+ */
+void
+intelSpanRenderStart(struct gl_context * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_flush(ctx);
+ intel_prepare_render(intel);
+ intel_flush(ctx);
+ intel_span_map_buffers(intel);
+}
+
+/**
+ * Called when done software rendering. Unmap the buffers we mapped in
+ * the above function.
+ */
+void
+intelSpanRenderFinish(struct gl_context * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ GLuint i;
+
+ _swrast_flush(ctx);
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
+ intel_tex_unmap_images(intel, intel_texture_object(texObj));
+ }
+ }
+
+ _swrast_unmap_renderbuffers(ctx);
+}
+
+
+void
+intelInitSpanFuncs(struct gl_context * ctx)
+{
+ struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
+ if (swdd) {
+ swdd->SpanRenderStart = intelSpanRenderStart;
+ swdd->SpanRenderFinish = intelSpanRenderFinish;
+ }
+}
+
+void
+intel_map_vertex_shader_textures(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ int i;
+
+ if (ctx->VertexProgram._Current == NULL)
+ return;
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled &&
+ ctx->VertexProgram._Current->Base.TexturesUsed[i] != 0) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
+
+ intel_tex_map_images(intel, intel_texture_object(texObj),
+ GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
+ }
+ }
+}
+
+void
+intel_unmap_vertex_shader_textures(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ int i;
+
+ if (ctx->VertexProgram._Current == NULL)
+ return;
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled &&
+ ctx->VertexProgram._Current->Base.TexturesUsed[i] != 0) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
+
+ intel_tex_unmap_images(intel, intel_texture_object(texObj));
+ }
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_state.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_state.c
index 519672fc359..6a817cdf3f6 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_state.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_state.c
@@ -1 +1,195 @@
-../intel/intel_state.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/dd.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+
+int
+intel_translate_shadow_compare_func(GLenum func)
+{
+ switch (func) {
+ case GL_NEVER:
+ return COMPAREFUNC_ALWAYS;
+ case GL_LESS:
+ return COMPAREFUNC_LEQUAL;
+ case GL_LEQUAL:
+ return COMPAREFUNC_LESS;
+ case GL_GREATER:
+ return COMPAREFUNC_GEQUAL;
+ case GL_GEQUAL:
+ return COMPAREFUNC_GREATER;
+ case GL_NOTEQUAL:
+ return COMPAREFUNC_EQUAL;
+ case GL_EQUAL:
+ return COMPAREFUNC_NOTEQUAL;
+ case GL_ALWAYS:
+ return COMPAREFUNC_NEVER;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+ return COMPAREFUNC_NEVER;
+}
+
+int
+intel_translate_compare_func(GLenum func)
+{
+ switch (func) {
+ case GL_NEVER:
+ return COMPAREFUNC_NEVER;
+ case GL_LESS:
+ return COMPAREFUNC_LESS;
+ case GL_LEQUAL:
+ return COMPAREFUNC_LEQUAL;
+ case GL_GREATER:
+ return COMPAREFUNC_GREATER;
+ case GL_GEQUAL:
+ return COMPAREFUNC_GEQUAL;
+ case GL_NOTEQUAL:
+ return COMPAREFUNC_NOTEQUAL;
+ case GL_EQUAL:
+ return COMPAREFUNC_EQUAL;
+ case GL_ALWAYS:
+ return COMPAREFUNC_ALWAYS;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+ return COMPAREFUNC_ALWAYS;
+}
+
+int
+intel_translate_stencil_op(GLenum op)
+{
+ switch (op) {
+ case GL_KEEP:
+ return STENCILOP_KEEP;
+ case GL_ZERO:
+ return STENCILOP_ZERO;
+ case GL_REPLACE:
+ return STENCILOP_REPLACE;
+ case GL_INCR:
+ return STENCILOP_INCRSAT;
+ case GL_DECR:
+ return STENCILOP_DECRSAT;
+ case GL_INCR_WRAP:
+ return STENCILOP_INCR;
+ case GL_DECR_WRAP:
+ return STENCILOP_DECR;
+ case GL_INVERT:
+ return STENCILOP_INVERT;
+ default:
+ return STENCILOP_ZERO;
+ }
+}
+
+int
+intel_translate_blend_factor(GLenum factor)
+{
+ switch (factor) {
+ case GL_ZERO:
+ return BLENDFACT_ZERO;
+ case GL_SRC_ALPHA:
+ return BLENDFACT_SRC_ALPHA;
+ case GL_ONE:
+ return BLENDFACT_ONE;
+ case GL_SRC_COLOR:
+ return BLENDFACT_SRC_COLR;
+ case GL_ONE_MINUS_SRC_COLOR:
+ return BLENDFACT_INV_SRC_COLR;
+ case GL_DST_COLOR:
+ return BLENDFACT_DST_COLR;
+ case GL_ONE_MINUS_DST_COLOR:
+ return BLENDFACT_INV_DST_COLR;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ return BLENDFACT_INV_SRC_ALPHA;
+ case GL_DST_ALPHA:
+ return BLENDFACT_DST_ALPHA;
+ case GL_ONE_MINUS_DST_ALPHA:
+ return BLENDFACT_INV_DST_ALPHA;
+ case GL_SRC_ALPHA_SATURATE:
+ return BLENDFACT_SRC_ALPHA_SATURATE;
+ case GL_CONSTANT_COLOR:
+ return BLENDFACT_CONST_COLOR;
+ case GL_ONE_MINUS_CONSTANT_COLOR:
+ return BLENDFACT_INV_CONST_COLOR;
+ case GL_CONSTANT_ALPHA:
+ return BLENDFACT_CONST_ALPHA;
+ case GL_ONE_MINUS_CONSTANT_ALPHA:
+ return BLENDFACT_INV_CONST_ALPHA;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor);
+ return BLENDFACT_ZERO;
+}
+
+int
+intel_translate_logic_op(GLenum opcode)
+{
+ switch (opcode) {
+ case GL_CLEAR:
+ return LOGICOP_CLEAR;
+ case GL_AND:
+ return LOGICOP_AND;
+ case GL_AND_REVERSE:
+ return LOGICOP_AND_RVRSE;
+ case GL_COPY:
+ return LOGICOP_COPY;
+ case GL_COPY_INVERTED:
+ return LOGICOP_COPY_INV;
+ case GL_AND_INVERTED:
+ return LOGICOP_AND_INV;
+ case GL_NOOP:
+ return LOGICOP_NOOP;
+ case GL_XOR:
+ return LOGICOP_XOR;
+ case GL_OR:
+ return LOGICOP_OR;
+ case GL_OR_INVERTED:
+ return LOGICOP_OR_INV;
+ case GL_NOR:
+ return LOGICOP_NOR;
+ case GL_EQUIV:
+ return LOGICOP_EQUIV;
+ case GL_INVERT:
+ return LOGICOP_INV;
+ case GL_OR_REVERSE:
+ return LOGICOP_OR_RVRSE;
+ case GL_NAND:
+ return LOGICOP_NAND;
+ case GL_SET:
+ return LOGICOP_SET;
+ default:
+ return LOGICOP_SET;
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_syncobj.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_syncobj.c
index 0b2e56ab246..e965896df60 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_syncobj.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_syncobj.c
@@ -1 +1,132 @@
-../intel/intel_syncobj.c \ No newline at end of file
+/*
+ * Copyright © 2008 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+/** @file intel_syncobj.c
+ *
+ * Support for ARB_sync
+ *
+ * ARB_sync is implemented by flushing the current batchbuffer and keeping a
+ * reference on it. We can then check for completion or wait for completion
+ * using the normal buffer object mechanisms. This does mean that if an
+ * application is using many sync objects, it will emit small batchbuffers
+ * which may end up being a significant overhead. In other tests of removing
+ * gratuitous batchbuffer syncs in Mesa, it hasn't appeared to be a significant
+ * performance bottleneck, though.
+ */
+
+#include "main/simple_list.h"
+#include "main/imports.h"
+
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_reg.h"
+
+static struct gl_sync_object *
+intel_new_sync_object(struct gl_context *ctx, GLuint id)
+{
+ struct intel_sync_object *sync;
+
+ sync = calloc(1, sizeof(struct intel_sync_object));
+
+ return &sync->Base;
+}
+
+static void
+intel_delete_sync_object(struct gl_context *ctx, struct gl_sync_object *s)
+{
+ struct intel_sync_object *sync = (struct intel_sync_object *)s;
+
+ drm_intel_bo_unreference(sync->bo);
+ free(sync);
+}
+
+static void
+intel_fence_sync(struct gl_context *ctx, struct gl_sync_object *s,
+ GLenum condition, GLbitfield flags)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_sync_object *sync = (struct intel_sync_object *)s;
+
+ assert(condition == GL_SYNC_GPU_COMMANDS_COMPLETE);
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ sync->bo = intel->batch.bo;
+ drm_intel_bo_reference(sync->bo);
+
+ intel_flush(ctx);
+}
+
+/* We ignore the user-supplied timeout. This is weaselly -- we're allowed to
+ * round to an implementation-dependent accuracy, and right now our
+ * implementation "rounds" to the wait-forever value.
+ *
+ * The fix would be a new kernel function to do the GTT transition with a
+ * timeout.
+ */
+static void intel_client_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
+ GLbitfield flags, GLuint64 timeout)
+{
+ struct intel_sync_object *sync = (struct intel_sync_object *)s;
+
+ if (sync->bo) {
+ drm_intel_bo_wait_rendering(sync->bo);
+ s->StatusFlag = 1;
+ drm_intel_bo_unreference(sync->bo);
+ sync->bo = NULL;
+ }
+}
+
+/* We have nothing to do for WaitSync. Our GL command stream is sequential,
+ * so given that the sync object has already flushed the batchbuffer,
+ * any batchbuffers coming after this waitsync will naturally not occur until
+ * the previous one is done.
+ */
+static void intel_server_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
+ GLbitfield flags, GLuint64 timeout)
+{
+}
+
+static void intel_check_sync(struct gl_context *ctx, struct gl_sync_object *s)
+{
+ struct intel_sync_object *sync = (struct intel_sync_object *)s;
+
+ if (sync->bo && !drm_intel_bo_busy(sync->bo)) {
+ drm_intel_bo_unreference(sync->bo);
+ sync->bo = NULL;
+ s->StatusFlag = 1;
+ }
+}
+
+void intel_init_syncobj_functions(struct dd_function_table *functions)
+{
+ functions->NewSyncObject = intel_new_sync_object;
+ functions->DeleteSyncObject = intel_delete_sync_object;
+ functions->FenceSync = intel_fence_sync;
+ functions->CheckSync = intel_check_sync;
+ functions->ClientWaitSync = intel_client_wait_sync;
+ functions->ServerWaitSync = intel_server_wait_sync;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex.c
index d77ce749a3e..5d938798d9f 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex.c
@@ -1 +1,222 @@
-../intel/intel_tex.c \ No newline at end of file
+#include "swrast/swrast.h"
+#include "main/renderbuffer.h"
+#include "main/texobj.h"
+#include "main/teximage.h"
+#include "main/mipmap.h"
+#include "drivers/common/meta.h"
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_tex.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+static struct gl_texture_image *
+intelNewTextureImage(struct gl_context * ctx)
+{
+ DBG("%s\n", __FUNCTION__);
+ (void) ctx;
+ return (struct gl_texture_image *) CALLOC_STRUCT(intel_texture_image);
+}
+
+static void
+intelDeleteTextureImage(struct gl_context * ctx, struct gl_texture_image *img)
+{
+ /* nothing special (yet) for intel_texture_image */
+ _mesa_delete_texture_image(ctx, img);
+}
+
+
+static struct gl_texture_object *
+intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
+{
+ struct intel_texture_object *obj = CALLOC_STRUCT(intel_texture_object);
+
+ (void) ctx;
+
+ DBG("%s\n", __FUNCTION__);
+ _mesa_initialize_texture_object(&obj->base, name, target);
+
+ return &obj->base;
+}
+
+static void
+intelDeleteTextureObject(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ struct intel_texture_object *intelObj = intel_texture_object(texObj);
+
+ intel_miptree_release(&intelObj->mt);
+ _mesa_delete_texture_object(ctx, texObj);
+}
+
+static GLboolean
+intel_alloc_texture_image_buffer(struct gl_context *ctx,
+ struct gl_texture_image *image)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intel_image = intel_texture_image(image);
+ struct gl_texture_object *texobj = image->TexObject;
+ struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
+ GLuint slices;
+
+ assert(image->Border == 0);
+
+ /* Because the driver uses AllocTextureImageBuffer() internally, it may end
+ * up mismatched with FreeTextureImageBuffer(), but that is safe to call
+ * multiple times.
+ */
+ ctx->Driver.FreeTextureImageBuffer(ctx, image);
+
+ /* Allocate the swrast_texture_image::ImageOffsets array now */
+ switch (texobj->Target) {
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_2D_ARRAY:
+ slices = image->Depth;
+ break;
+ case GL_TEXTURE_1D_ARRAY:
+ slices = image->Height;
+ break;
+ default:
+ slices = 1;
+ }
+ assert(!intel_image->base.ImageOffsets);
+ intel_image->base.ImageOffsets = malloc(slices * sizeof(GLuint));
+
+ _swrast_init_texture_image(image);
+
+ if (intel_texobj->mt &&
+ intel_miptree_match_image(intel_texobj->mt, image)) {
+ intel_miptree_reference(&intel_image->mt, intel_texobj->mt);
+ DBG("%s: alloc obj %p level %d %dx%dx%d using object's miptree %p\n",
+ __FUNCTION__, texobj, image->Level,
+ image->Width, image->Height, image->Depth, intel_texobj->mt);
+ } else {
+ intel_image->mt = intel_miptree_create_for_teximage(intel, intel_texobj,
+ intel_image,
+ false);
+
+ /* Even if the object currently has a mipmap tree associated
+ * with it, this one is a more likely candidate to represent the
+ * whole object since our level didn't fit what was there
+ * before, and any lower levels would fit into our miptree.
+ */
+ intel_miptree_reference(&intel_texobj->mt, intel_image->mt);
+
+ DBG("%s: alloc obj %p level %d %dx%dx%d using new miptree %p\n",
+ __FUNCTION__, texobj, image->Level,
+ image->Width, image->Height, image->Depth, intel_image->mt);
+ }
+
+ return true;
+}
+
+/**
+ * Called via ctx->Driver.AllocTextureStorage()
+ * Just have to allocate memory for the texture images.
+ */
+static GLboolean
+intel_alloc_texture_storage(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLsizei levels, GLsizei width,
+ GLsizei height, GLsizei depth)
+{
+ const int numFaces = _mesa_num_tex_faces(texObj->Target);
+ int face;
+ int level;
+
+ for (face = 0; face < numFaces; face++) {
+ for (level = 0; level < levels; level++) {
+ struct gl_texture_image *const texImage = texObj->Image[face][level];
+ if (!intel_alloc_texture_image_buffer(ctx, texImage))
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static void
+intel_free_texture_image_buffer(struct gl_context * ctx,
+ struct gl_texture_image *texImage)
+{
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
+
+ DBG("%s\n", __FUNCTION__);
+
+ intel_miptree_release(&intelImage->mt);
+
+ if (intelImage->base.Buffer) {
+ _mesa_align_free(intelImage->base.Buffer);
+ intelImage->base.Buffer = NULL;
+ }
+
+ if (intelImage->base.ImageOffsets) {
+ free(intelImage->base.ImageOffsets);
+ intelImage->base.ImageOffsets = NULL;
+ }
+}
+
+/**
+ * Map texture memory/buffer into user space.
+ * Note: the region of interest parameters are ignored here.
+ * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
+ * \param mapOut returns start of mapping of region of interest
+ * \param rowStrideOut returns row stride in bytes
+ */
+static void
+intel_map_texture_image(struct gl_context *ctx,
+ struct gl_texture_image *tex_image,
+ GLuint slice,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **map,
+ GLint *stride)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intel_image = intel_texture_image(tex_image);
+ struct intel_mipmap_tree *mt = intel_image->mt;
+
+ /* Our texture data is always stored in a miptree. */
+ assert(mt);
+
+ /* Check that our caller wasn't confused about how to map a 1D texture. */
+ assert(tex_image->TexObject->Target != GL_TEXTURE_1D_ARRAY ||
+ h == 1);
+
+ /* intel_miptree_map operates on a unified "slice" number that references the
+ * cube face, since it's all just slices to the miptree code.
+ */
+ if (tex_image->TexObject->Target == GL_TEXTURE_CUBE_MAP)
+ slice = tex_image->Face;
+
+ intel_miptree_map(intel, mt, tex_image->Level, slice, x, y, w, h, mode,
+ (void **)map, stride);
+}
+
+static void
+intel_unmap_texture_image(struct gl_context *ctx,
+ struct gl_texture_image *tex_image, GLuint slice)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intel_image = intel_texture_image(tex_image);
+ struct intel_mipmap_tree *mt = intel_image->mt;
+
+ if (tex_image->TexObject->Target == GL_TEXTURE_CUBE_MAP)
+ slice = tex_image->Face;
+
+ intel_miptree_unmap(intel, mt, tex_image->Level, slice);
+}
+
+void
+intelInitTextureFuncs(struct dd_function_table *functions)
+{
+ functions->NewTextureObject = intelNewTextureObject;
+ functions->NewTextureImage = intelNewTextureImage;
+ functions->DeleteTextureImage = intelDeleteTextureImage;
+ functions->DeleteTexture = intelDeleteTextureObject;
+ functions->AllocTextureImageBuffer = intel_alloc_texture_image_buffer;
+ functions->FreeTextureImageBuffer = intel_free_texture_image_buffer;
+ functions->AllocTextureStorage = intel_alloc_texture_storage;
+ functions->MapTextureImage = intel_map_texture_image;
+ functions->UnmapTextureImage = intel_unmap_texture_image;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_copy.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_copy.c
index 87196c5d1ed..f4366330f88 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_copy.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_copy.c
@@ -1 +1,171 @@
-../intel/intel_tex_copy.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/teximage.h"
+#include "main/texstate.h"
+#include "main/fbobject.h"
+
+#include "drivers/common/meta.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_fbo.h"
+#include "intel_tex.h"
+#include "intel_blit.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+
+bool
+intel_copy_texsubimage(struct intel_context *intel,
+ struct intel_texture_image *intelImage,
+ GLint dstx, GLint dsty,
+ struct intel_renderbuffer *irb,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ struct gl_context *ctx = &intel->ctx;
+ struct intel_region *region;
+ const GLenum internalFormat = intelImage->base.Base.InternalFormat;
+ bool copy_supported = false;
+ bool copy_supported_with_alpha_override = false;
+
+ intel_prepare_render(intel);
+
+ if (!intelImage->mt || !irb || !irb->mt) {
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF))
+ fprintf(stderr, "%s fail %p %p (0x%08x)\n",
+ __FUNCTION__, intelImage->mt, irb, internalFormat);
+ return false;
+ } else {
+ region = irb->mt->region;
+ assert(region);
+ }
+
+ copy_supported = intelImage->base.Base.TexFormat == intel_rb_format(irb);
+
+ /* Converting ARGB8888 to XRGB8888 is trivial: ignore the alpha bits */
+ if (intel_rb_format(irb) == MESA_FORMAT_ARGB8888 &&
+ intelImage->base.Base.TexFormat == MESA_FORMAT_XRGB8888) {
+ copy_supported = true;
+ }
+
+ /* Converting XRGB8888 to ARGB8888 requires setting the alpha bits to 1.0 */
+ if (intel_rb_format(irb) == MESA_FORMAT_XRGB8888 &&
+ intelImage->base.Base.TexFormat == MESA_FORMAT_ARGB8888) {
+ copy_supported_with_alpha_override = true;
+ }
+
+ if (!copy_supported && !copy_supported_with_alpha_override) {
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF))
+ fprintf(stderr, "%s mismatched formats %s, %s\n",
+ __FUNCTION__,
+ _mesa_get_format_name(intelImage->base.Base.TexFormat),
+ _mesa_get_format_name(intel_rb_format(irb)));
+ return false;
+ }
+
+ {
+ GLuint image_x, image_y;
+ GLshort src_pitch;
+
+ /* get dest x/y in destination texture */
+ intel_miptree_get_image_offset(intelImage->mt,
+ intelImage->base.Base.Level,
+ intelImage->base.Base.Face,
+ 0,
+ &image_x, &image_y);
+
+ /* The blitter can't handle Y-tiled buffers. */
+ if (intelImage->mt->region->tiling == I915_TILING_Y) {
+ return false;
+ }
+
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer)) {
+ /* Flip vertical orientation for system framebuffers */
+ y = ctx->ReadBuffer->Height - (y + height);
+ src_pitch = -region->pitch;
+ } else {
+ /* reading from a FBO, y is already oriented the way we like */
+ src_pitch = region->pitch;
+ }
+
+ /* blit from src buffer to texture */
+ if (!intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ src_pitch,
+ region->bo,
+ 0,
+ region->tiling,
+ intelImage->mt->region->pitch,
+ intelImage->mt->region->bo,
+ 0,
+ intelImage->mt->region->tiling,
+ irb->draw_x + x, irb->draw_y + y,
+ image_x + dstx, image_y + dsty,
+ width, height,
+ GL_COPY)) {
+ return false;
+ }
+ }
+
+ if (copy_supported_with_alpha_override)
+ intel_set_teximage_alpha_to_one(ctx, intelImage);
+
+ return true;
+}
+
+
+static void
+intelCopyTexSubImage(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ struct gl_renderbuffer *rb,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height)
+{
+ if (dims == 3 || !intel_copy_texsubimage(intel_context(ctx),
+ intel_texture_image(texImage),
+ xoffset, yoffset,
+ intel_renderbuffer(rb), x, y, width, height)) {
+ fallback_debug("%s - fallback to swrast\n", __FUNCTION__);
+ _mesa_meta_CopyTexSubImage(ctx, dims, texImage,
+ xoffset, yoffset, zoffset,
+ rb, x, y, width, height);
+ }
+}
+
+
+void
+intelInitTextureCopyImageFuncs(struct dd_function_table *functions)
+{
+ functions->CopyTexSubImage = intelCopyTexSubImage;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_format.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_format.c
index 3415f754705..f53054d55d3 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_format.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_format.c
@@ -1 +1,65 @@
-../intel/intel_tex_format.c \ No newline at end of file
+#include "intel_context.h"
+#include "intel_tex.h"
+#include "main/enums.h"
+#include "main/formats.h"
+
+/**
+ * Returns the renderbuffer DataType for a MESA_FORMAT.
+ */
+GLenum
+intel_mesa_format_to_rb_datatype(gl_format format)
+{
+ switch (format) {
+ case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_SARGB8:
+ case MESA_FORMAT_R8:
+ case MESA_FORMAT_GR88:
+ case MESA_FORMAT_A8:
+ case MESA_FORMAT_I8:
+ case MESA_FORMAT_L8:
+ case MESA_FORMAT_AL88:
+ case MESA_FORMAT_RGB565:
+ case MESA_FORMAT_ARGB1555:
+ case MESA_FORMAT_ARGB4444:
+ case MESA_FORMAT_S8:
+ return GL_UNSIGNED_BYTE;
+ case MESA_FORMAT_R16:
+ case MESA_FORMAT_RG1616:
+ case MESA_FORMAT_Z16:
+ return GL_UNSIGNED_SHORT;
+ case MESA_FORMAT_X8_Z24:
+ return GL_UNSIGNED_INT;
+ case MESA_FORMAT_S8_Z24:
+ return GL_UNSIGNED_INT_24_8_EXT;
+ case MESA_FORMAT_RGBA_FLOAT32:
+ case MESA_FORMAT_RG_FLOAT32:
+ case MESA_FORMAT_R_FLOAT32:
+ case MESA_FORMAT_INTENSITY_FLOAT32:
+ case MESA_FORMAT_LUMINANCE_FLOAT32:
+ case MESA_FORMAT_ALPHA_FLOAT32:
+ case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32:
+ return GL_FLOAT;
+
+ /* The core depthstencil wrappers demand this. */
+ case MESA_FORMAT_Z32_FLOAT_X24S8:
+ return GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
+
+ default:
+ /* Unsupported format. We may hit this when people ask for FBO-incomplete
+ * formats.
+ */
+ return GL_NONE;
+ }
+}
+
+int intel_compressed_num_bytes(GLuint mesaFormat)
+{
+ GLuint bw, bh;
+ GLuint block_size;
+
+ block_size = _mesa_get_format_bytes(mesaFormat);
+ _mesa_get_format_block_size(mesaFormat, &bw, &bh);
+
+ return block_size / bw;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_image.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_image.c
index 567abe4974e..fe9040cf1b6 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_image.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_image.c
@@ -1 +1,360 @@
-../intel/intel_tex_image.c \ No newline at end of file
+
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/bufferobj.h"
+#include "main/context.h"
+#include "main/formats.h"
+#include "main/pbo.h"
+#include "main/renderbuffer.h"
+#include "main/texcompress.h"
+#include "main/texgetimage.h"
+#include "main/texobj.h"
+#include "main/teximage.h"
+#include "main/texstore.h"
+
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_buffer_objects.h"
+#include "intel_batchbuffer.h"
+#include "intel_tex.h"
+#include "intel_blit.h"
+#include "intel_fbo.h"
+#include "intel_span.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+/* Work back from the specified level of the image to the baselevel and create a
+ * miptree of that size.
+ */
+struct intel_mipmap_tree *
+intel_miptree_create_for_teximage(struct intel_context *intel,
+ struct intel_texture_object *intelObj,
+ struct intel_texture_image *intelImage,
+ bool expect_accelerated_upload)
+{
+ GLuint firstLevel;
+ GLuint lastLevel;
+ int width, height, depth;
+ GLuint i;
+
+ intel_miptree_get_dimensions_for_image(&intelImage->base.Base,
+ &width, &height, &depth);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (intelImage->base.Base.Level > intelObj->base.BaseLevel &&
+ (width == 1 ||
+ (intelObj->base.Target != GL_TEXTURE_1D && height == 1) ||
+ (intelObj->base.Target == GL_TEXTURE_3D && depth == 1))) {
+ /* For this combination, we're at some lower mipmap level and
+ * some important dimension is 1. We can't extrapolate up to a
+ * likely base level width/height/depth for a full mipmap stack
+ * from this info, so just allocate this one level.
+ */
+ firstLevel = intelImage->base.Base.Level;
+ lastLevel = intelImage->base.Base.Level;
+ } else {
+ /* If this image disrespects BaseLevel, allocate from level zero.
+ * Usually BaseLevel == 0, so it's unlikely to happen.
+ */
+ if (intelImage->base.Base.Level < intelObj->base.BaseLevel)
+ firstLevel = 0;
+ else
+ firstLevel = intelObj->base.BaseLevel;
+
+ /* Figure out image dimensions at start level. */
+ for (i = intelImage->base.Base.Level; i > firstLevel; i--) {
+ width <<= 1;
+ if (height != 1)
+ height <<= 1;
+ if (depth != 1)
+ depth <<= 1;
+ }
+
+ /* Guess a reasonable value for lastLevel. This is probably going
+ * to be wrong fairly often and might mean that we have to look at
+ * resizable buffers, or require that buffers implement lazy
+ * pagetable arrangements.
+ */
+ if ((intelObj->base.Sampler.MinFilter == GL_NEAREST ||
+ intelObj->base.Sampler.MinFilter == GL_LINEAR) &&
+ intelImage->base.Base.Level == firstLevel &&
+ (intel->gen < 4 || firstLevel == 0)) {
+ lastLevel = firstLevel;
+ } else if (intelObj->base.Target == GL_TEXTURE_EXTERNAL_OES) {
+ lastLevel = firstLevel;
+ } else {
+ lastLevel = firstLevel + _mesa_logbase2(MAX2(MAX2(width, height), depth));
+ }
+ }
+
+ return intel_miptree_create(intel,
+ intelObj->base.Target,
+ intelImage->base.Base.TexFormat,
+ firstLevel,
+ lastLevel,
+ width,
+ height,
+ depth,
+ expect_accelerated_upload,
+ 0 /* num_samples */,
+ INTEL_MSAA_LAYOUT_NONE);
+}
+
+/* There are actually quite a few combinations this will work for,
+ * more than what I've listed here.
+ */
+static bool
+check_pbo_format(GLenum format, GLenum type,
+ gl_format mesa_format)
+{
+ switch (mesa_format) {
+ case MESA_FORMAT_ARGB8888:
+ return (format == GL_BGRA && (type == GL_UNSIGNED_BYTE ||
+ type == GL_UNSIGNED_INT_8_8_8_8_REV));
+ case MESA_FORMAT_RGB565:
+ return (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5);
+ case MESA_FORMAT_L8:
+ return (format == GL_LUMINANCE && type == GL_UNSIGNED_BYTE);
+ case MESA_FORMAT_YCBCR:
+ return (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE);
+ default:
+ return false;
+ }
+}
+
+
+/* XXX: Do this for TexSubImage also:
+ */
+static bool
+try_pbo_upload(struct gl_context *ctx,
+ struct gl_texture_image *image,
+ const struct gl_pixelstore_attrib *unpack,
+ GLenum format, GLenum type, const void *pixels)
+{
+ struct intel_texture_image *intelImage = intel_texture_image(image);
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
+ GLuint src_offset, src_stride;
+ GLuint dst_x, dst_y, dst_stride;
+ drm_intel_bo *dst_buffer, *src_buffer;
+
+ if (!_mesa_is_bufferobj(unpack->BufferObj))
+ return false;
+
+ DBG("trying pbo upload\n");
+
+ if (intel->ctx._ImageTransferState ||
+ unpack->SkipPixels || unpack->SkipRows) {
+ DBG("%s: image transfer\n", __FUNCTION__);
+ return false;
+ }
+
+ if (!check_pbo_format(format, type, intelImage->base.Base.TexFormat)) {
+ DBG("%s: format mismatch (upload to %s with format 0x%x, type 0x%x)\n",
+ __FUNCTION__, _mesa_get_format_name(intelImage->base.Base.TexFormat),
+ format, type);
+ return false;
+ }
+
+ ctx->Driver.AllocTextureImageBuffer(ctx, image);
+
+ if (!intelImage->mt) {
+ DBG("%s: no miptree\n", __FUNCTION__);
+ return false;
+ }
+
+ dst_buffer = intelImage->mt->region->bo;
+ src_buffer = intel_bufferobj_source(intel, pbo, 64, &src_offset);
+ /* note: potential 64-bit ptr to 32-bit int cast */
+ src_offset += (GLuint) (unsigned long) pixels;
+
+ if (unpack->RowLength > 0)
+ src_stride = unpack->RowLength;
+ else
+ src_stride = image->Width;
+
+ intel_miptree_get_image_offset(intelImage->mt, intelImage->base.Base.Level,
+ intelImage->base.Base.Face, 0,
+ &dst_x, &dst_y);
+
+ dst_stride = intelImage->mt->region->pitch;
+
+ if (!intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ src_stride, src_buffer,
+ src_offset, false,
+ dst_stride, dst_buffer, 0,
+ intelImage->mt->region->tiling,
+ 0, 0, dst_x, dst_y, image->Width, image->Height,
+ GL_COPY)) {
+ DBG("%s: blit failed\n", __FUNCTION__);
+ return false;
+ }
+
+ DBG("%s: success\n", __FUNCTION__);
+ return true;
+}
+
+static void
+intelTexImage(struct gl_context * ctx,
+ GLuint dims,
+ struct gl_texture_image *texImage,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack)
+{
+ DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
+ texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
+
+ /* Attempt to use the blitter for PBO image uploads.
+ */
+ if (dims <= 2 &&
+ try_pbo_upload(ctx, texImage, unpack, format, type, pixels)) {
+ return;
+ }
+
+ DBG("%s: upload image %dx%dx%d pixels %p\n",
+ __FUNCTION__, texImage->Width, texImage->Height, texImage->Depth,
+ pixels);
+
+ _mesa_store_teximage(ctx, dims, texImage,
+ format, type, pixels, unpack);
+}
+
+
+/**
+ * Binds a region to a texture image, like it was uploaded by glTexImage2D().
+ *
+ * Used for GLX_EXT_texture_from_pixmap and EGL image extensions,
+ */
+static void
+intel_set_texture_image_region(struct gl_context *ctx,
+ struct gl_texture_image *image,
+ struct intel_region *region,
+ GLenum target,
+ GLenum internalFormat,
+ gl_format format,
+ uint32_t offset)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intel_image = intel_texture_image(image);
+ struct gl_texture_object *texobj = image->TexObject;
+ struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
+
+ _mesa_init_teximage_fields(&intel->ctx, image,
+ region->width, region->height, 1,
+ 0, internalFormat, format);
+
+ ctx->Driver.FreeTextureImageBuffer(ctx, image);
+
+ intel_image->mt = intel_miptree_create_for_region(intel, target,
+ image->TexFormat,
+ region);
+ if (intel_image->mt == NULL)
+ return;
+
+ intel_image->mt->offset = offset;
+ intel_image->base.RowStride = region->pitch;
+
+ /* Immediately validate the image to the object. */
+ intel_miptree_reference(&intel_texobj->mt, intel_image->mt);
+}
+
+void
+intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
+ GLint texture_format,
+ __DRIdrawable *dPriv)
+{
+ struct gl_framebuffer *fb = dPriv->driverPrivate;
+ struct intel_context *intel = pDRICtx->driverPrivate;
+ struct gl_context *ctx = &intel->ctx;
+ struct intel_texture_object *intelObj;
+ struct intel_renderbuffer *rb;
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+ int level = 0, internalFormat = 0;
+ gl_format texFormat = MESA_FORMAT_NONE;
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+ intelObj = intel_texture_object(texObj);
+
+ if (!intelObj)
+ return;
+
+ if (dPriv->lastStamp != dPriv->dri2.stamp ||
+ !pDRICtx->driScreenPriv->dri2.useInvalidate)
+ intel_update_renderbuffers(pDRICtx, dPriv);
+
+ rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+ /* If the region isn't set, then intel_update_renderbuffers was unable
+ * to get the buffers for the drawable.
+ */
+ if (!rb || !rb->mt)
+ return;
+
+ if (rb->mt->cpp == 4) {
+ if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
+ internalFormat = GL_RGB;
+ texFormat = MESA_FORMAT_XRGB8888;
+ }
+ else {
+ internalFormat = GL_RGBA;
+ texFormat = MESA_FORMAT_ARGB8888;
+ }
+ } else if (rb->mt->cpp == 2) {
+ internalFormat = GL_RGB;
+ texFormat = MESA_FORMAT_RGB565;
+ }
+
+ _mesa_lock_texture(&intel->ctx, texObj);
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ intel_set_texture_image_region(ctx, texImage, rb->mt->region, target,
+ internalFormat, texFormat, 0);
+ _mesa_unlock_texture(&intel->ctx, texObj);
+}
+
+void
+intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
+{
+ /* The old interface didn't have the format argument, so copy our
+ * implementation's behavior at the time.
+ */
+ intelSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
+}
+
+#if FEATURE_OES_EGL_image
+static void
+intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage,
+ GLeglImageOES image_handle)
+{
+ struct intel_context *intel = intel_context(ctx);
+ __DRIscreen *screen;
+ __DRIimage *image;
+
+ screen = intel->intelScreen->driScrnPriv;
+ image = screen->dri2.image->lookupEGLImage(screen, image_handle,
+ screen->loaderPrivate);
+ if (image == NULL)
+ return;
+
+ intel_set_texture_image_region(ctx, texImage, image->region,
+ target, image->internal_format,
+ image->format, image->offset);
+}
+#endif
+
+void
+intelInitTextureImageFuncs(struct dd_function_table *functions)
+{
+ functions->TexImage = intelTexImage;
+
+#if FEATURE_OES_EGL_image
+ functions->EGLImageTargetTexture2D = intel_image_target_texture_2d;
+#endif
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_layout.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_layout.c
index fe61b441945..65645bc46a4 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_layout.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_layout.c
@@ -1 +1,206 @@
-../intel/intel_tex_layout.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Michel Dänzer <michel@tungstengraphics.com>
+ */
+
+#include "intel_mipmap_tree.h"
+#include "intel_tex_layout.h"
+#include "intel_context.h"
+
+#include "main/image.h"
+#include "main/macros.h"
+
+static unsigned int
+intel_horizontal_texture_alignment_unit(struct intel_context *intel,
+ gl_format format)
+{
+ /**
+ * From the "Alignment Unit Size" section of various specs, namely:
+ * - Gen3 Spec: "Memory Data Formats" Volume, Section 1.20.1.4
+ * - i965 and G45 PRMs: Volume 1, Section 6.17.3.4.
+ * - Ironlake and Sandybridge PRMs: Volume 1, Part 1, Section 7.18.3.4
+ * - BSpec (for Ivybridge and slight variations in separate stencil)
+ *
+ * +----------------------------------------------------------------------+
+ * | | alignment unit width ("i") |
+ * | Surface Property |-----------------------------|
+ * | | 915 | 965 | ILK | SNB | IVB |
+ * +----------------------------------------------------------------------+
+ * | YUV 4:2:2 format | 8 | 4 | 4 | 4 | 4 |
+ * | BC1-5 compressed format (DXTn/S3TC) | 4 | 4 | 4 | 4 | 4 |
+ * | FXT1 compressed format | 8 | 8 | 8 | 8 | 8 |
+ * | Depth Buffer (16-bit) | 4 | 4 | 4 | 4 | 8 |
+ * | Depth Buffer (other) | 4 | 4 | 4 | 4 | 4 |
+ * | Separate Stencil Buffer | N/A | N/A | 8 | 8 | 8 |
+ * | All Others | 4 | 4 | 4 | 4 | 4 |
+ * +----------------------------------------------------------------------+
+ *
+ * On IVB+, non-special cases can be overridden by setting the SURFACE_STATE
+ * "Surface Horizontal Alignment" field to HALIGN_4 or HALIGN_8.
+ */
+ if (_mesa_is_format_compressed(format)) {
+ /* The hardware alignment requirements for compressed textures
+ * happen to match the block boundaries.
+ */
+ unsigned int i, j;
+ _mesa_get_format_block_size(format, &i, &j);
+ return i;
+ }
+
+ if (format == MESA_FORMAT_S8)
+ return 8;
+
+ if (intel->gen >= 7 && format == MESA_FORMAT_Z16)
+ return 8;
+
+ return 4;
+}
+
+static unsigned int
+intel_vertical_texture_alignment_unit(struct intel_context *intel,
+ gl_format format)
+{
+ /**
+ * From the "Alignment Unit Size" section of various specs, namely:
+ * - Gen3 Spec: "Memory Data Formats" Volume, Section 1.20.1.4
+ * - i965 and G45 PRMs: Volume 1, Section 6.17.3.4.
+ * - Ironlake and Sandybridge PRMs: Volume 1, Part 1, Section 7.18.3.4
+ * - BSpec (for Ivybridge and slight variations in separate stencil)
+ *
+ * +----------------------------------------------------------------------+
+ * | | alignment unit height ("j") |
+ * | Surface Property |-----------------------------|
+ * | | 915 | 965 | ILK | SNB | IVB |
+ * +----------------------------------------------------------------------+
+ * | BC1-5 compressed format (DXTn/S3TC) | 4 | 4 | 4 | 4 | 4 |
+ * | FXT1 compressed format | 4 | 4 | 4 | 4 | 4 |
+ * | Depth Buffer | 2 | 2 | 2 | 4 | 4 |
+ * | Separate Stencil Buffer | N/A | N/A | N/A | 4 | 8 |
+ * | Multisampled (4x or 8x) render target | N/A | N/A | N/A | 4 | 4 |
+ * | All Others | 2 | 2 | 2 | 2 | 2 |
+ * +----------------------------------------------------------------------+
+ *
+ * On SNB+, non-special cases can be overridden by setting the SURFACE_STATE
+ * "Surface Vertical Alignment" field to VALIGN_2 or VALIGN_4.
+ *
+ * We currently don't support multisampling.
+ */
+ if (_mesa_is_format_compressed(format))
+ return 4;
+
+ if (format == MESA_FORMAT_S8)
+ return intel->gen >= 7 ? 8 : 4;
+
+ GLenum base_format = _mesa_get_format_base_format(format);
+
+ if (intel->gen >= 6 &&
+ (base_format == GL_DEPTH_COMPONENT ||
+ base_format == GL_DEPTH_STENCIL)) {
+ return 4;
+ }
+
+ return 2;
+}
+
+void
+intel_get_texture_alignment_unit(struct intel_context *intel,
+ gl_format format,
+ unsigned int *w, unsigned int *h)
+{
+ *w = intel_horizontal_texture_alignment_unit(intel, format);
+ *h = intel_vertical_texture_alignment_unit(intel, format);
+}
+
+void i945_miptree_layout_2d(struct intel_mipmap_tree *mt)
+{
+ GLuint level;
+ GLuint x = 0;
+ GLuint y = 0;
+ GLuint width = mt->width0;
+ GLuint height = mt->height0;
+ GLuint depth = mt->depth0; /* number of array layers. */
+
+ mt->total_width = mt->width0;
+
+ if (mt->compressed) {
+ mt->total_width = ALIGN(mt->width0, mt->align_w);
+ }
+
+ /* May need to adjust width to accomodate the placement of
+ * the 2nd mipmap. This occurs when the alignment
+ * constraints of mipmap placement push the right edge of the
+ * 2nd mipmap out past the width of its parent.
+ */
+ if (mt->first_level != mt->last_level) {
+ GLuint mip1_width;
+
+ if (mt->compressed) {
+ mip1_width = ALIGN(minify(mt->width0), mt->align_w)
+ + ALIGN(minify(minify(mt->width0)), mt->align_w);
+ } else {
+ mip1_width = ALIGN(minify(mt->width0), mt->align_w)
+ + minify(minify(mt->width0));
+ }
+
+ if (mip1_width > mt->total_width) {
+ mt->total_width = mip1_width;
+ }
+ }
+
+ mt->total_height = 0;
+
+ for ( level = mt->first_level ; level <= mt->last_level ; level++ ) {
+ GLuint img_height;
+
+ intel_miptree_set_level_info(mt, level, x, y, width,
+ height, depth);
+
+ img_height = ALIGN(height, mt->align_h);
+ if (mt->compressed)
+ img_height /= mt->align_h;
+
+ /* Because the images are packed better, the final offset
+ * might not be the maximal one:
+ */
+ mt->total_height = MAX2(mt->total_height, y + img_height);
+
+ /* Layout_below: step right after second mipmap.
+ */
+ if (level == mt->first_level + 1) {
+ x += ALIGN(width, mt->align_w);
+ }
+ else {
+ y += img_height;
+ }
+
+ width = minify(width);
+ height = minify(height);
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_subimage.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_subimage.c
index b3a8a3d7ca7..ae4b3bca305 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_subimage.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_subimage.c
@@ -1 +1,177 @@
-../intel/intel_tex_subimage.c \ No newline at end of file
+
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/mtypes.h"
+#include "main/pbo.h"
+#include "main/texobj.h"
+#include "main/texstore.h"
+#include "main/texcompress.h"
+#include "main/enums.h"
+
+#include "intel_context.h"
+#include "intel_tex.h"
+#include "intel_mipmap_tree.h"
+#include "intel_blit.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+static bool
+intel_blit_texsubimage(struct gl_context * ctx,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset,
+ GLint width, GLint height,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *packing)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
+ GLuint dstRowStride = 0;
+ drm_intel_bo *temp_bo = NULL;
+ unsigned int blit_x = 0, blit_y = 0;
+ unsigned long pitch;
+ uint32_t tiling_mode = I915_TILING_NONE;
+ GLubyte *dstMap;
+
+ /* Try to do a blit upload of the subimage if the texture is
+ * currently busy.
+ */
+ if (!intelImage->mt)
+ return false;
+
+ /* The blitter can't handle Y tiling */
+ if (intelImage->mt->region->tiling == I915_TILING_Y)
+ return false;
+
+ if (texImage->TexObject->Target != GL_TEXTURE_2D)
+ return false;
+
+ /* On gen6, it's probably not worth swapping to the blit ring to do
+ * this because of all the overhead involved.
+ */
+ if (intel->gen >= 6)
+ return false;
+
+ if (!drm_intel_bo_busy(intelImage->mt->region->bo))
+ return false;
+
+ DBG("BLT subimage %s target %s level %d offset %d,%d %dx%d\n",
+ __FUNCTION__,
+ _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
+ texImage->Level, xoffset, yoffset, width, height);
+
+ pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1,
+ format, type, pixels, packing,
+ "glTexSubImage");
+ if (!pixels)
+ return false;
+
+ temp_bo = drm_intel_bo_alloc_tiled(intel->bufmgr,
+ "subimage blit bo",
+ width, height,
+ intelImage->mt->cpp,
+ &tiling_mode,
+ &pitch,
+ 0);
+ if (temp_bo == NULL) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage");
+ return false;
+ }
+
+ if (drm_intel_gem_bo_map_gtt(temp_bo)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage");
+ return false;
+ }
+
+ dstMap = temp_bo->virtual;
+ dstRowStride = pitch;
+
+ intel_miptree_get_image_offset(intelImage->mt, texImage->Level,
+ intelImage->base.Base.Face, 0,
+ &blit_x, &blit_y);
+ blit_x += xoffset;
+ blit_y += yoffset;
+
+ if (!_mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat,
+ dstRowStride,
+ &dstMap,
+ width, height, 1,
+ format, type, pixels, packing)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage");
+ }
+
+ bool ret;
+ unsigned int dst_pitch = intelImage->mt->region->pitch *
+ intelImage->mt->cpp;
+
+ drm_intel_gem_bo_unmap_gtt(temp_bo);
+
+ ret = intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ dstRowStride / intelImage->mt->cpp,
+ temp_bo, 0, false,
+ dst_pitch / intelImage->mt->cpp,
+ intelImage->mt->region->bo, 0,
+ intelImage->mt->region->tiling,
+ 0, 0, blit_x, blit_y, width, height,
+ GL_COPY);
+ assert(ret);
+
+ drm_intel_bo_unreference(temp_bo);
+ _mesa_unmap_teximage_pbo(ctx, packing);
+
+ return true;
+}
+
+static void
+intelTexSubImage(struct gl_context * ctx,
+ GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ const GLvoid * pixels,
+ const struct gl_pixelstore_attrib *packing)
+{
+ /* The intel_blit_texsubimage() function only handles 2D images */
+ if (dims != 2 || !intel_blit_texsubimage(ctx, texImage,
+ xoffset, yoffset,
+ width, height,
+ format, type, pixels, packing)) {
+ _mesa_store_texsubimage(ctx, dims, texImage,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, pixels, packing);
+ }
+}
+
+void
+intelInitTextureSubImageFuncs(struct dd_function_table *functions)
+{
+ functions->TexSubImage = intelTexSubImage;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_validate.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_validate.c
index 41a75674c27..578b4173512 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_validate.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i915/intel_tex_validate.c
@@ -1 +1,218 @@
-../intel/intel_tex_validate.c \ No newline at end of file
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/samplerobj.h"
+#include "main/texobj.h"
+
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_blit.h"
+#include "intel_tex.h"
+#include "intel_tex_layout.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+/**
+ * When validating, we only care about the texture images that could
+ * be seen, so for non-mipmapped modes we want to ignore everything
+ * but BaseLevel.
+ */
+static void
+intel_update_max_level(struct intel_texture_object *intelObj,
+ struct gl_sampler_object *sampler)
+{
+ struct gl_texture_object *tObj = &intelObj->base;
+
+ if (sampler->MinFilter == GL_NEAREST ||
+ sampler->MinFilter == GL_LINEAR) {
+ intelObj->_MaxLevel = tObj->BaseLevel;
+ } else {
+ intelObj->_MaxLevel = tObj->_MaxLevel;
+ }
+}
+
+/*
+ */
+GLuint
+intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
+{
+ struct gl_context *ctx = &intel->ctx;
+ struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current;
+ struct intel_texture_object *intelObj = intel_texture_object(tObj);
+ struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
+ GLuint face, i;
+ GLuint nr_faces = 0;
+ struct intel_texture_image *firstImage;
+ int width, height, depth;
+
+ /* TBOs require no validation -- they always just point to their BO. */
+ if (tObj->Target == GL_TEXTURE_BUFFER)
+ return true;
+
+ /* We know/require this is true by now:
+ */
+ assert(intelObj->base._BaseComplete);
+
+ /* What levels must the tree include at a minimum?
+ */
+ intel_update_max_level(intelObj, sampler);
+ firstImage = intel_texture_image(tObj->Image[0][tObj->BaseLevel]);
+
+ /* Check tree can hold all active levels. Check tree matches
+ * target, imageFormat, etc.
+ *
+ * For pre-gen4, we have to match first_level == tObj->BaseLevel,
+ * because we don't have the control that gen4 does to make min/mag
+ * determination happen at a nonzero (hardware) baselevel. Because
+ * of that, we just always relayout on baselevel change.
+ */
+ if (intelObj->mt &&
+ (!intel_miptree_match_image(intelObj->mt, &firstImage->base.Base) ||
+ intelObj->mt->first_level != tObj->BaseLevel ||
+ intelObj->mt->last_level < intelObj->_MaxLevel)) {
+ intel_miptree_release(&intelObj->mt);
+ }
+
+
+ /* May need to create a new tree:
+ */
+ if (!intelObj->mt) {
+ intel_miptree_get_dimensions_for_image(&firstImage->base.Base,
+ &width, &height, &depth);
+
+ intelObj->mt = intel_miptree_create(intel,
+ intelObj->base.Target,
+ firstImage->base.Base.TexFormat,
+ tObj->BaseLevel,
+ intelObj->_MaxLevel,
+ width,
+ height,
+ depth,
+ true,
+ 0 /* num_samples */,
+ INTEL_MSAA_LAYOUT_NONE);
+ if (!intelObj->mt)
+ return false;
+ }
+
+ /* Pull in any images not in the object's tree:
+ */
+ nr_faces = _mesa_num_tex_faces(intelObj->base.Target);
+ for (face = 0; face < nr_faces; face++) {
+ for (i = tObj->BaseLevel; i <= intelObj->_MaxLevel; i++) {
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][i]);
+ /* skip too small size mipmap */
+ if (intelImage == NULL)
+ break;
+
+ if (intelObj->mt != intelImage->mt) {
+ intel_miptree_copy_teximage(intel, intelImage, intelObj->mt);
+ }
+ }
+ }
+
+ return true;
+}
+
+/**
+ * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
+ */
+static void
+intel_tex_map_image_for_swrast(struct intel_context *intel,
+ struct intel_texture_image *intel_image,
+ GLbitfield mode)
+{
+ int level;
+ int face;
+ struct intel_mipmap_tree *mt;
+ unsigned int x, y;
+
+ if (!intel_image || !intel_image->mt)
+ return;
+
+ level = intel_image->base.Base.Level;
+ face = intel_image->base.Base.Face;
+ mt = intel_image->mt;
+
+ for (int i = 0; i < mt->level[level].depth; i++)
+ intel_miptree_slice_resolve_depth(intel, mt, level, i);
+
+ if (mt->target == GL_TEXTURE_3D ||
+ mt->target == GL_TEXTURE_2D_ARRAY ||
+ mt->target == GL_TEXTURE_1D_ARRAY) {
+ int i;
+
+ /* ImageOffsets[] is only used for swrast's fetch_texel_3d, so we can't
+ * share code with the normal path.
+ */
+ for (i = 0; i < mt->level[level].depth; i++) {
+ intel_miptree_get_image_offset(mt, level, face, i, &x, &y);
+ intel_image->base.ImageOffsets[i] = x + y * mt->region->pitch;
+ }
+
+ DBG("%s \n", __FUNCTION__);
+
+ intel_image->base.Map = intel_region_map(intel, mt->region, mode);
+ } else {
+ assert(intel_image->base.Base.Depth == 1);
+ intel_miptree_get_image_offset(mt, level, face, 0, &x, &y);
+
+ DBG("%s: (%d,%d) -> (%d, %d)/%d\n",
+ __FUNCTION__, face, level, x, y, mt->region->pitch * mt->cpp);
+
+ intel_image->base.Map = intel_region_map(intel, mt->region, mode) +
+ (x + y * mt->region->pitch) * mt->cpp;
+ }
+
+ intel_image->base.RowStride = mt->region->pitch;
+}
+
+static void
+intel_tex_unmap_image_for_swrast(struct intel_context *intel,
+ struct intel_texture_image *intel_image)
+{
+ if (intel_image && intel_image->mt) {
+ intel_region_unmap(intel, intel_image->mt->region);
+ intel_image->base.Map = NULL;
+ }
+}
+
+/**
+ * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
+ */
+void
+intel_tex_map_images(struct intel_context *intel,
+ struct intel_texture_object *intelObj,
+ GLbitfield mode)
+{
+ GLuint nr_faces = _mesa_num_tex_faces(intelObj->base.Target);
+ int i, face;
+
+ DBG("%s\n", __FUNCTION__);
+
+ for (i = intelObj->base.BaseLevel; i <= intelObj->_MaxLevel; i++) {
+ for (face = 0; face < nr_faces; face++) {
+ struct intel_texture_image *intel_image =
+ intel_texture_image(intelObj->base.Image[face][i]);
+
+ intel_tex_map_image_for_swrast(intel, intel_image, mode);
+ }
+ }
+}
+
+void
+intel_tex_unmap_images(struct intel_context *intel,
+ struct intel_texture_object *intelObj)
+{
+ GLuint nr_faces = _mesa_num_tex_faces(intelObj->base.Target);
+ int i, face;
+
+ for (i = intelObj->base.BaseLevel; i <= intelObj->_MaxLevel; i++) {
+ for (face = 0; face < nr_faces; face++) {
+ struct intel_texture_image *intel_image =
+ intel_texture_image(intelObj->base.Image[face][i]);
+
+ intel_tex_unmap_image_for_swrast(intel, intel_image);
+ }
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index d38cdf31cc6..06cbaecc74d 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -1 +1,543 @@
-../intel/intel_batchbuffer.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_buffer_objects.h"
+#include "intel_reg.h"
+#include "intel_bufmgr.h"
+#include "intel_buffers.h"
+
+struct cached_batch_item {
+ struct cached_batch_item *next;
+ uint16_t header;
+ uint16_t size;
+};
+
+static void clear_cache( struct intel_context *intel )
+{
+ struct cached_batch_item *item = intel->batch.cached_items;
+
+ while (item) {
+ struct cached_batch_item *next = item->next;
+ free(item);
+ item = next;
+ }
+
+ intel->batch.cached_items = NULL;
+}
+
+void
+intel_batchbuffer_init(struct intel_context *intel)
+{
+ intel_batchbuffer_reset(intel);
+
+ if (intel->gen >= 6) {
+ /* We can't just use brw_state_batch to get a chunk of space for
+ * the gen6 workaround because it involves actually writing to
+ * the buffer, and the kernel doesn't let us write to the batch.
+ */
+ intel->batch.workaround_bo = drm_intel_bo_alloc(intel->bufmgr,
+ "pipe_control workaround",
+ 4096, 4096);
+ }
+}
+
+void
+intel_batchbuffer_reset(struct intel_context *intel)
+{
+ if (intel->batch.last_bo != NULL) {
+ drm_intel_bo_unreference(intel->batch.last_bo);
+ intel->batch.last_bo = NULL;
+ }
+ intel->batch.last_bo = intel->batch.bo;
+
+ clear_cache(intel);
+
+ intel->batch.bo = drm_intel_bo_alloc(intel->bufmgr, "batchbuffer",
+ intel->maxBatchSize, 4096);
+
+ intel->batch.reserved_space = BATCH_RESERVED;
+ intel->batch.state_batch_offset = intel->batch.bo->size;
+ intel->batch.used = 0;
+ intel->batch.needs_sol_reset = false;
+}
+
+void
+intel_batchbuffer_save_state(struct intel_context *intel)
+{
+ intel->batch.saved.used = intel->batch.used;
+ intel->batch.saved.reloc_count =
+ drm_intel_gem_bo_get_reloc_count(intel->batch.bo);
+}
+
+void
+intel_batchbuffer_reset_to_saved(struct intel_context *intel)
+{
+ drm_intel_gem_bo_clear_relocs(intel->batch.bo, intel->batch.saved.reloc_count);
+
+ intel->batch.used = intel->batch.saved.used;
+
+ /* Cached batch state is dead, since we just cleared some unknown part of the
+ * batchbuffer. Assume that the caller resets any other state necessary.
+ */
+ clear_cache(intel);
+}
+
+void
+intel_batchbuffer_free(struct intel_context *intel)
+{
+ drm_intel_bo_unreference(intel->batch.last_bo);
+ drm_intel_bo_unreference(intel->batch.bo);
+ drm_intel_bo_unreference(intel->batch.workaround_bo);
+ clear_cache(intel);
+}
+
+static void
+do_batch_dump(struct intel_context *intel)
+{
+ struct drm_intel_decode *decode;
+ struct intel_batchbuffer *batch = &intel->batch;
+ int ret;
+
+ decode = drm_intel_decode_context_alloc(intel->intelScreen->deviceID);
+ if (!decode)
+ return;
+
+ ret = drm_intel_bo_map(batch->bo, false);
+ if (ret == 0) {
+ drm_intel_decode_set_batch_pointer(decode,
+ batch->bo->virtual,
+ batch->bo->offset,
+ batch->used);
+ } else {
+ fprintf(stderr,
+ "WARNING: failed to map batchbuffer (%s), "
+ "dumping uploaded data instead.\n", strerror(ret));
+
+ drm_intel_decode_set_batch_pointer(decode,
+ batch->map,
+ batch->bo->offset,
+ batch->used);
+ }
+
+ drm_intel_decode(decode);
+
+ drm_intel_decode_context_free(decode);
+
+ if (ret == 0) {
+ drm_intel_bo_unmap(batch->bo);
+
+ if (intel->vtbl.debug_batch != NULL)
+ intel->vtbl.debug_batch(intel);
+ }
+}
+
+/* TODO: Push this whole function into bufmgr.
+ */
+static int
+do_flush_locked(struct intel_context *intel)
+{
+ struct intel_batchbuffer *batch = &intel->batch;
+ int ret = 0;
+
+ ret = drm_intel_bo_subdata(batch->bo, 0, 4*batch->used, batch->map);
+ if (ret == 0 && batch->state_batch_offset != batch->bo->size) {
+ ret = drm_intel_bo_subdata(batch->bo,
+ batch->state_batch_offset,
+ batch->bo->size - batch->state_batch_offset,
+ (char *)batch->map + batch->state_batch_offset);
+ }
+
+ if (!intel->intelScreen->no_hw) {
+ int flags;
+
+ if (intel->gen < 6 || !batch->is_blit) {
+ flags = I915_EXEC_RENDER;
+ } else {
+ flags = I915_EXEC_BLT;
+ }
+
+ if (batch->needs_sol_reset)
+ flags |= I915_EXEC_GEN7_SOL_RESET;
+
+ if (ret == 0) {
+ if (unlikely(INTEL_DEBUG & DEBUG_AUB) && intel->vtbl.annotate_aub)
+ intel->vtbl.annotate_aub(intel);
+ if (intel->hw_ctx == NULL || batch->is_blit) {
+ ret = drm_intel_bo_mrb_exec(batch->bo, 4 * batch->used, NULL, 0, 0,
+ flags);
+ } else {
+ ret = drm_intel_gem_bo_context_exec(batch->bo, intel->hw_ctx,
+ 4 * batch->used, flags);
+ }
+ }
+ }
+
+ if (unlikely(INTEL_DEBUG & DEBUG_BATCH))
+ do_batch_dump(intel);
+
+ if (ret != 0) {
+ fprintf(stderr, "intel_do_flush_locked failed: %s\n", strerror(-ret));
+ exit(1);
+ }
+ intel->vtbl.new_batch(intel);
+
+ return ret;
+}
+
+int
+_intel_batchbuffer_flush(struct intel_context *intel,
+ const char *file, int line)
+{
+ int ret;
+
+ if (intel->batch.used == 0)
+ return 0;
+
+ if (intel->first_post_swapbuffers_batch == NULL) {
+ intel->first_post_swapbuffers_batch = intel->batch.bo;
+ drm_intel_bo_reference(intel->first_post_swapbuffers_batch);
+ }
+
+ if (unlikely(INTEL_DEBUG & DEBUG_BATCH))
+ fprintf(stderr, "%s:%d: Batchbuffer flush with %db used\n", file, line,
+ 4*intel->batch.used);
+
+ intel->batch.reserved_space = 0;
+
+ if (intel->vtbl.finish_batch)
+ intel->vtbl.finish_batch(intel);
+
+ /* Mark the end of the buffer. */
+ intel_batchbuffer_emit_dword(intel, MI_BATCH_BUFFER_END);
+ if (intel->batch.used & 1) {
+ /* Round batchbuffer usage to 2 DWORDs. */
+ intel_batchbuffer_emit_dword(intel, MI_NOOP);
+ }
+
+ intel_upload_finish(intel);
+
+ /* Check that we didn't just wrap our batchbuffer at a bad time. */
+ assert(!intel->no_batch_wrap);
+
+ ret = do_flush_locked(intel);
+
+ if (unlikely(INTEL_DEBUG & DEBUG_SYNC)) {
+ fprintf(stderr, "waiting for idle\n");
+ drm_intel_bo_wait_rendering(intel->batch.bo);
+ }
+
+ /* Reset the buffer:
+ */
+ intel_batchbuffer_reset(intel);
+
+ return ret;
+}
+
+
+/* This is the only way buffers get added to the validate list.
+ */
+bool
+intel_batchbuffer_emit_reloc(struct intel_context *intel,
+ drm_intel_bo *buffer,
+ uint32_t read_domains, uint32_t write_domain,
+ uint32_t delta)
+{
+ int ret;
+
+ ret = drm_intel_bo_emit_reloc(intel->batch.bo, 4*intel->batch.used,
+ buffer, delta,
+ read_domains, write_domain);
+ assert(ret == 0);
+ (void)ret;
+
+ /*
+ * Using the old buffer offset, write in what the right data would be, in case
+ * the buffer doesn't move and we can short-circuit the relocation processing
+ * in the kernel
+ */
+ intel_batchbuffer_emit_dword(intel, buffer->offset + delta);
+
+ return true;
+}
+
+bool
+intel_batchbuffer_emit_reloc_fenced(struct intel_context *intel,
+ drm_intel_bo *buffer,
+ uint32_t read_domains,
+ uint32_t write_domain,
+ uint32_t delta)
+{
+ int ret;
+
+ ret = drm_intel_bo_emit_reloc_fence(intel->batch.bo, 4*intel->batch.used,
+ buffer, delta,
+ read_domains, write_domain);
+ assert(ret == 0);
+ (void)ret;
+
+ /*
+ * Using the old buffer offset, write in what the right data would
+ * be, in case the buffer doesn't move and we can short-circuit the
+ * relocation processing in the kernel
+ */
+ intel_batchbuffer_emit_dword(intel, buffer->offset + delta);
+
+ return true;
+}
+
+void
+intel_batchbuffer_data(struct intel_context *intel,
+ const void *data, GLuint bytes, bool is_blit)
+{
+ assert((bytes & 3) == 0);
+ intel_batchbuffer_require_space(intel, bytes, is_blit);
+ __memcpy(intel->batch.map + intel->batch.used, data, bytes);
+ intel->batch.used += bytes >> 2;
+}
+
+void
+intel_batchbuffer_cached_advance(struct intel_context *intel)
+{
+ struct cached_batch_item **prev = &intel->batch.cached_items, *item;
+ uint32_t sz = (intel->batch.used - intel->batch.emit) * sizeof(uint32_t);
+ uint32_t *start = intel->batch.map + intel->batch.emit;
+ uint16_t op = *start >> 16;
+
+ while (*prev) {
+ uint32_t *old;
+
+ item = *prev;
+ old = intel->batch.map + item->header;
+ if (op == *old >> 16) {
+ if (item->size == sz && memcmp(old, start, sz) == 0) {
+ if (prev != &intel->batch.cached_items) {
+ *prev = item->next;
+ item->next = intel->batch.cached_items;
+ intel->batch.cached_items = item;
+ }
+ intel->batch.used = intel->batch.emit;
+ return;
+ }
+
+ goto emit;
+ }
+ prev = &item->next;
+ }
+
+ item = malloc(sizeof(struct cached_batch_item));
+ if (item == NULL)
+ return;
+
+ item->next = intel->batch.cached_items;
+ intel->batch.cached_items = item;
+
+emit:
+ item->size = sz;
+ item->header = intel->batch.emit;
+}
+
+/**
+ * Restriction [DevSNB, DevIVB]:
+ *
+ * Prior to changing Depth/Stencil Buffer state (i.e. any combination of
+ * 3DSTATE_DEPTH_BUFFER, 3DSTATE_CLEAR_PARAMS, 3DSTATE_STENCIL_BUFFER,
+ * 3DSTATE_HIER_DEPTH_BUFFER) SW must first issue a pipelined depth stall
+ * (PIPE_CONTROL with Depth Stall bit set), followed by a pipelined depth
+ * cache flush (PIPE_CONTROL with Depth Flush Bit set), followed by
+ * another pipelined depth stall (PIPE_CONTROL with Depth Stall bit set),
+ * unless SW can otherwise guarantee that the pipeline from WM onwards is
+ * already flushed (e.g., via a preceding MI_FLUSH).
+ */
+void
+intel_emit_depth_stall_flushes(struct intel_context *intel)
+{
+ assert(intel->gen >= 6 && intel->gen <= 7);
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_DEPTH_STALL);
+ OUT_BATCH(0); /* address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH()
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_DEPTH_CACHE_FLUSH);
+ OUT_BATCH(0); /* address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_DEPTH_STALL);
+ OUT_BATCH(0); /* address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+}
+
+/**
+ * From the BSpec, volume 2a.03: VS Stage Input / State:
+ * "[DevIVB] A PIPE_CONTROL with Post-Sync Operation set to 1h and a depth
+ * stall needs to be sent just prior to any 3DSTATE_VS, 3DSTATE_URB_VS,
+ * 3DSTATE_CONSTANT_VS, 3DSTATE_BINDING_TABLE_POINTER_VS,
+ * 3DSTATE_SAMPLER_STATE_POINTER_VS command. Only one PIPE_CONTROL needs
+ * to be sent before any combination of VS associated 3DSTATE."
+ */
+void
+gen7_emit_vs_workaround_flush(struct intel_context *intel)
+{
+ assert(intel->gen == 7);
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_DEPTH_STALL | PIPE_CONTROL_WRITE_IMMEDIATE);
+ OUT_RELOC(intel->batch.workaround_bo,
+ I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, 0);
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+}
+
+/**
+ * Emits a PIPE_CONTROL with a non-zero post-sync operation, for
+ * implementing two workarounds on gen6. From section 1.4.7.1
+ * "PIPE_CONTROL" of the Sandy Bridge PRM volume 2 part 1:
+ *
+ * [DevSNB-C+{W/A}] Before any depth stall flush (including those
+ * produced by non-pipelined state commands), software needs to first
+ * send a PIPE_CONTROL with no bits set except Post-Sync Operation !=
+ * 0.
+ *
+ * [Dev-SNB{W/A}]: Before a PIPE_CONTROL with Write Cache Flush Enable
+ * =1, a PIPE_CONTROL with any non-zero post-sync-op is required.
+ *
+ * And the workaround for these two requires this workaround first:
+ *
+ * [Dev-SNB{W/A}]: Pipe-control with CS-stall bit set must be sent
+ * BEFORE the pipe-control with a post-sync op and no write-cache
+ * flushes.
+ *
+ * And this last workaround is tricky because of the requirements on
+ * that bit. From section 1.4.7.2.3 "Stall" of the Sandy Bridge PRM
+ * volume 2 part 1:
+ *
+ * "1 of the following must also be set:
+ * - Render Target Cache Flush Enable ([12] of DW1)
+ * - Depth Cache Flush Enable ([0] of DW1)
+ * - Stall at Pixel Scoreboard ([1] of DW1)
+ * - Depth Stall ([13] of DW1)
+ * - Post-Sync Operation ([13] of DW1)
+ * - Notify Enable ([8] of DW1)"
+ *
+ * The cache flushes require the workaround flush that triggered this
+ * one, so we can't use it. Depth stall would trigger the same.
+ * Post-sync nonzero is what triggered this second workaround, so we
+ * can't use that one either. Notify enable is IRQs, which aren't
+ * really our business. That leaves only stall at scoreboard.
+ */
+void
+intel_emit_post_sync_nonzero_flush(struct intel_context *intel)
+{
+ if (!intel->batch.need_workaround_flush)
+ return;
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_CS_STALL |
+ PIPE_CONTROL_STALL_AT_SCOREBOARD);
+ OUT_BATCH(0); /* address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_WRITE_IMMEDIATE);
+ OUT_RELOC(intel->batch.workaround_bo,
+ I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION, 0);
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+
+ intel->batch.need_workaround_flush = false;
+}
+
+/* Emit a pipelined flush to either flush render and texture cache for
+ * reading from a FBO-drawn texture, or flush so that frontbuffer
+ * render appears on the screen in DRI1.
+ *
+ * This is also used for the always_flush_cache driconf debug option.
+ */
+void
+intel_batchbuffer_emit_mi_flush(struct intel_context *intel)
+{
+ if (intel->gen >= 6) {
+ if (intel->batch.is_blit) {
+ BEGIN_BATCH_BLT(4);
+ OUT_BATCH(MI_FLUSH_DW);
+ OUT_BATCH(0);
+ OUT_BATCH(0);
+ OUT_BATCH(0);
+ ADVANCE_BATCH();
+ } else {
+ if (intel->gen == 6) {
+ /* Hardware workaround: SNB B-Spec says:
+ *
+ * [Dev-SNB{W/A}]: Before a PIPE_CONTROL with Write Cache
+ * Flush Enable =1, a PIPE_CONTROL with any non-zero
+ * post-sync-op is required.
+ */
+ intel_emit_post_sync_nonzero_flush(intel);
+ }
+
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+ OUT_BATCH(PIPE_CONTROL_INSTRUCTION_FLUSH |
+ PIPE_CONTROL_WRITE_FLUSH |
+ PIPE_CONTROL_DEPTH_CACHE_FLUSH |
+ PIPE_CONTROL_VF_CACHE_INVALIDATE |
+ PIPE_CONTROL_TC_FLUSH |
+ PIPE_CONTROL_NO_WRITE |
+ PIPE_CONTROL_CS_STALL);
+ OUT_BATCH(0); /* write address */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+ }
+ } else if (intel->gen >= 4) {
+ BEGIN_BATCH(4);
+ OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2) |
+ PIPE_CONTROL_WRITE_FLUSH |
+ PIPE_CONTROL_NO_WRITE);
+ OUT_BATCH(0); /* write address */
+ OUT_BATCH(0); /* write data */
+ OUT_BATCH(0); /* write data */
+ ADVANCE_BATCH();
+ } else {
+ BEGIN_BATCH(1);
+ OUT_BATCH(MI_FLUSH);
+ ADVANCE_BATCH();
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_blit.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_blit.c
index dd6c8d17c28..36a2c6aadac 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_blit.c
@@ -1 +1,604 @@
-../intel/intel_blit.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/mtypes.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/fbobject.h"
+
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_context.h"
+#include "intel_fbo.h"
+#include "intel_reg.h"
+#include "intel_regions.h"
+#include "intel_batchbuffer.h"
+#include "intel_mipmap_tree.h"
+
+#define FILE_DEBUG_FLAG DEBUG_BLIT
+
+static GLuint translate_raster_op(GLenum logicop)
+{
+ switch(logicop) {
+ case GL_CLEAR: return 0x00;
+ case GL_AND: return 0x88;
+ case GL_AND_REVERSE: return 0x44;
+ case GL_COPY: return 0xCC;
+ case GL_AND_INVERTED: return 0x22;
+ case GL_NOOP: return 0xAA;
+ case GL_XOR: return 0x66;
+ case GL_OR: return 0xEE;
+ case GL_NOR: return 0x11;
+ case GL_EQUIV: return 0x99;
+ case GL_INVERT: return 0x55;
+ case GL_OR_REVERSE: return 0xDD;
+ case GL_COPY_INVERTED: return 0x33;
+ case GL_OR_INVERTED: return 0xBB;
+ case GL_NAND: return 0x77;
+ case GL_SET: return 0xFF;
+ default: return 0;
+ }
+}
+
+static uint32_t
+br13_for_cpp(int cpp)
+{
+ switch (cpp) {
+ case 4:
+ return BR13_8888;
+ break;
+ case 2:
+ return BR13_565;
+ break;
+ case 1:
+ return BR13_8;
+ break;
+ default:
+ assert(0);
+ return 0;
+ }
+}
+
+/* Copy BitBlt
+ */
+bool
+intelEmitCopyBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLshort src_pitch,
+ drm_intel_bo *src_buffer,
+ GLuint src_offset,
+ uint32_t src_tiling,
+ GLshort dst_pitch,
+ drm_intel_bo *dst_buffer,
+ GLuint dst_offset,
+ uint32_t dst_tiling,
+ GLshort src_x, GLshort src_y,
+ GLshort dst_x, GLshort dst_y,
+ GLshort w, GLshort h,
+ GLenum logic_op)
+{
+ GLuint CMD, BR13, pass = 0;
+ int dst_y2 = dst_y + h;
+ int dst_x2 = dst_x + w;
+ drm_intel_bo *aper_array[3];
+ BATCH_LOCALS;
+
+ if (dst_tiling != I915_TILING_NONE) {
+ if (dst_offset & 4095)
+ return false;
+ if (dst_tiling == I915_TILING_Y)
+ return false;
+ }
+ if (src_tiling != I915_TILING_NONE) {
+ if (src_offset & 4095)
+ return false;
+ if (src_tiling == I915_TILING_Y)
+ return false;
+ }
+
+ /* do space check before going any further */
+ do {
+ aper_array[0] = intel->batch.bo;
+ aper_array[1] = dst_buffer;
+ aper_array[2] = src_buffer;
+
+ if (dri_bufmgr_check_aperture_space(aper_array, 3) != 0) {
+ intel_batchbuffer_flush(intel);
+ pass++;
+ } else
+ break;
+ } while (pass < 2);
+
+ if (pass >= 2)
+ return false;
+
+ intel_batchbuffer_require_space(intel, 8 * 4, true);
+ DBG("%s src:buf(%p)/%d+%d %d,%d dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
+ __FUNCTION__,
+ src_buffer, src_pitch, src_offset, src_x, src_y,
+ dst_buffer, dst_pitch, dst_offset, dst_x, dst_y, w, h);
+
+ src_pitch *= cpp;
+ dst_pitch *= cpp;
+
+ /* Blit pitch must be dword-aligned. Otherwise, the hardware appears to drop
+ * the low bits.
+ */
+ assert(src_pitch % 4 == 0);
+ assert(dst_pitch % 4 == 0);
+
+ /* For big formats (such as floating point), do the copy using 32bpp and
+ * multiply the coordinates.
+ */
+ if (cpp > 4) {
+ assert(cpp % 4 == 0);
+ dst_x *= cpp / 4;
+ dst_x2 *= cpp / 4;
+ src_x *= cpp / 4;
+ cpp = 4;
+ }
+
+ BR13 = br13_for_cpp(cpp) | translate_raster_op(logic_op) << 16;
+
+ switch (cpp) {
+ case 1:
+ case 2:
+ CMD = XY_SRC_COPY_BLT_CMD;
+ break;
+ case 4:
+ CMD = XY_SRC_COPY_BLT_CMD | XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB;
+ break;
+ default:
+ return false;
+ }
+
+#ifndef I915
+ if (dst_tiling != I915_TILING_NONE) {
+ CMD |= XY_DST_TILED;
+ dst_pitch /= 4;
+ }
+ if (src_tiling != I915_TILING_NONE) {
+ CMD |= XY_SRC_TILED;
+ src_pitch /= 4;
+ }
+#endif
+
+ if (dst_y2 <= dst_y || dst_x2 <= dst_x) {
+ return true;
+ }
+
+ assert(dst_x < dst_x2);
+ assert(dst_y < dst_y2);
+
+ BEGIN_BATCH_BLT(8);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13 | (uint16_t)dst_pitch);
+ OUT_BATCH((dst_y << 16) | dst_x);
+ OUT_BATCH((dst_y2 << 16) | dst_x2);
+ OUT_RELOC_FENCED(dst_buffer,
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+ dst_offset);
+ OUT_BATCH((src_y << 16) | src_x);
+ OUT_BATCH((uint16_t)src_pitch);
+ OUT_RELOC_FENCED(src_buffer,
+ I915_GEM_DOMAIN_RENDER, 0,
+ src_offset);
+ ADVANCE_BATCH();
+
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ return true;
+}
+
+
+/**
+ * Use blitting to clear the renderbuffers named by 'flags'.
+ * Note: we can't use the ctx->DrawBuffer->_ColorDrawBufferIndexes field
+ * since that might include software renderbuffers or renderbuffers
+ * which we're clearing with triangles.
+ * \param mask bitmask of BUFFER_BIT_* values indicating buffers to clear
+ */
+GLbitfield
+intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ GLuint clear_depth_value, clear_depth_mask;
+ GLint cx, cy, cw, ch;
+ GLbitfield fail_mask = 0;
+ BATCH_LOCALS;
+
+ /*
+ * Compute values for clearing the buffers.
+ */
+ clear_depth_value = 0;
+ clear_depth_mask = 0;
+ if (mask & BUFFER_BIT_DEPTH) {
+ clear_depth_value = (GLuint) (fb->_DepthMax * ctx->Depth.Clear);
+ clear_depth_mask = XY_BLT_WRITE_RGB;
+ }
+ if (mask & BUFFER_BIT_STENCIL) {
+ clear_depth_value |= (ctx->Stencil.Clear & 0xff) << 24;
+ clear_depth_mask |= XY_BLT_WRITE_ALPHA;
+ }
+
+ cx = fb->_Xmin;
+ if (_mesa_is_winsys_fbo(fb))
+ cy = ctx->DrawBuffer->Height - fb->_Ymax;
+ else
+ cy = fb->_Ymin;
+ cw = fb->_Xmax - fb->_Xmin;
+ ch = fb->_Ymax - fb->_Ymin;
+
+ if (cw == 0 || ch == 0)
+ return 0;
+
+ /* Loop over all renderbuffers */
+ mask &= (1 << BUFFER_COUNT) - 1;
+ while (mask) {
+ GLuint buf = ffs(mask) - 1;
+ bool is_depth_stencil = buf == BUFFER_DEPTH || buf == BUFFER_STENCIL;
+ struct intel_renderbuffer *irb;
+ int x1, y1, x2, y2;
+ uint32_t clear_val;
+ uint32_t BR13, CMD;
+ struct intel_region *region;
+ int pitch, cpp;
+ drm_intel_bo *aper_array[2];
+
+ mask &= ~(1 << buf);
+
+ irb = intel_get_renderbuffer(fb, buf);
+ if (irb && irb->mt) {
+ region = irb->mt->region;
+ assert(region);
+ assert(region->bo);
+ } else {
+ fail_mask |= 1 << buf;
+ continue;
+ }
+
+ /* OK, clear this renderbuffer */
+ x1 = cx + irb->draw_x;
+ y1 = cy + irb->draw_y;
+ x2 = cx + cw + irb->draw_x;
+ y2 = cy + ch + irb->draw_y;
+
+ pitch = region->pitch;
+ cpp = region->cpp;
+
+ DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n",
+ __FUNCTION__,
+ region->bo, (pitch * cpp),
+ x1, y1, x2 - x1, y2 - y1);
+
+ BR13 = 0xf0 << 16;
+ CMD = XY_COLOR_BLT_CMD;
+
+ /* Setup the blit command */
+ if (cpp == 4) {
+ if (is_depth_stencil) {
+ CMD |= clear_depth_mask;
+ } else {
+ /* clearing RGBA */
+ CMD |= XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB;
+ }
+ }
+
+ assert(region->tiling != I915_TILING_Y);
+
+#ifndef I915
+ if (region->tiling != I915_TILING_NONE) {
+ CMD |= XY_DST_TILED;
+ pitch /= 4;
+ }
+#endif
+ BR13 |= (pitch * cpp);
+
+ if (is_depth_stencil) {
+ clear_val = clear_depth_value;
+ } else {
+ uint8_t clear[4];
+ GLfloat *color = ctx->Color.ClearColor.f;
+
+ _mesa_unclamped_float_rgba_to_ubyte(clear, color);
+
+ switch (intel_rb_format(irb)) {
+ case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_XRGB8888:
+ clear_val = PACK_COLOR_8888(clear[3], clear[0],
+ clear[1], clear[2]);
+ break;
+ case MESA_FORMAT_RGB565:
+ clear_val = PACK_COLOR_565(clear[0], clear[1], clear[2]);
+ break;
+ case MESA_FORMAT_ARGB4444:
+ clear_val = PACK_COLOR_4444(clear[3], clear[0],
+ clear[1], clear[2]);
+ break;
+ case MESA_FORMAT_ARGB1555:
+ clear_val = PACK_COLOR_1555(clear[3], clear[0],
+ clear[1], clear[2]);
+ break;
+ case MESA_FORMAT_A8:
+ clear_val = PACK_COLOR_8888(clear[3], clear[3],
+ clear[3], clear[3]);
+ break;
+ default:
+ fail_mask |= 1 << buf;
+ continue;
+ }
+ }
+
+ BR13 |= br13_for_cpp(cpp);
+
+ assert(x1 < x2);
+ assert(y1 < y2);
+
+ /* do space check before going any further */
+ aper_array[0] = intel->batch.bo;
+ aper_array[1] = region->bo;
+
+ if (drm_intel_bufmgr_check_aperture_space(aper_array,
+ ARRAY_SIZE(aper_array)) != 0) {
+ intel_batchbuffer_flush(intel);
+ }
+
+ BEGIN_BATCH_BLT(6);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13);
+ OUT_BATCH((y1 << 16) | x1);
+ OUT_BATCH((y2 << 16) | x2);
+ OUT_RELOC_FENCED(region->bo,
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+ 0);
+ OUT_BATCH(clear_val);
+ ADVANCE_BATCH();
+
+ if (intel->always_flush_cache)
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ if (buf == BUFFER_DEPTH || buf == BUFFER_STENCIL)
+ mask &= ~(BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL);
+ }
+
+ return fail_mask;
+}
+
+bool
+intelEmitImmediateColorExpandBlit(struct intel_context *intel,
+ GLuint cpp,
+ GLubyte *src_bits, GLuint src_size,
+ GLuint fg_color,
+ GLshort dst_pitch,
+ drm_intel_bo *dst_buffer,
+ GLuint dst_offset,
+ uint32_t dst_tiling,
+ GLshort x, GLshort y,
+ GLshort w, GLshort h,
+ GLenum logic_op)
+{
+ int dwords = ALIGN(src_size, 8) / 4;
+ uint32_t opcode, br13, blit_cmd;
+
+ if (dst_tiling != I915_TILING_NONE) {
+ if (dst_offset & 4095)
+ return false;
+ if (dst_tiling == I915_TILING_Y)
+ return false;
+ }
+
+ assert( logic_op - GL_CLEAR >= 0 );
+ assert( logic_op - GL_CLEAR < 0x10 );
+ assert(dst_pitch > 0);
+
+ if (w < 0 || h < 0)
+ return true;
+
+ dst_pitch *= cpp;
+
+ DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d, %d bytes %d dwords\n",
+ __FUNCTION__,
+ dst_buffer, dst_pitch, dst_offset, x, y, w, h, src_size, dwords);
+
+ intel_batchbuffer_require_space(intel,
+ (8 * 4) +
+ (3 * 4) +
+ dwords * 4, true);
+
+ opcode = XY_SETUP_BLT_CMD;
+ if (cpp == 4)
+ opcode |= XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB;
+#ifndef I915
+ if (dst_tiling != I915_TILING_NONE) {
+ opcode |= XY_DST_TILED;
+ dst_pitch /= 4;
+ }
+#endif
+
+ br13 = dst_pitch | (translate_raster_op(logic_op) << 16) | (1 << 29);
+ br13 |= br13_for_cpp(cpp);
+
+ blit_cmd = XY_TEXT_IMMEDIATE_BLIT_CMD | XY_TEXT_BYTE_PACKED; /* packing? */
+ if (dst_tiling != I915_TILING_NONE)
+ blit_cmd |= XY_DST_TILED;
+
+ BEGIN_BATCH_BLT(8 + 3);
+ OUT_BATCH(opcode);
+ OUT_BATCH(br13);
+ OUT_BATCH((0 << 16) | 0); /* clip x1, y1 */
+ OUT_BATCH((100 << 16) | 100); /* clip x2, y2 */
+ OUT_RELOC_FENCED(dst_buffer,
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+ dst_offset);
+ OUT_BATCH(0); /* bg */
+ OUT_BATCH(fg_color); /* fg */
+ OUT_BATCH(0); /* pattern base addr */
+
+ OUT_BATCH(blit_cmd | ((3 - 2) + dwords));
+ OUT_BATCH((y << 16) | x);
+ OUT_BATCH(((y + h) << 16) | (x + w));
+ ADVANCE_BATCH();
+
+ intel_batchbuffer_data(intel, src_bits, dwords * 4, true);
+
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ return true;
+}
+
+/* We don't have a memmove-type blit like some other hardware, so we'll do a
+ * rectangular blit covering a large space, then emit 1-scanline blit at the
+ * end to cover the last if we need.
+ */
+void
+intel_emit_linear_blit(struct intel_context *intel,
+ drm_intel_bo *dst_bo,
+ unsigned int dst_offset,
+ drm_intel_bo *src_bo,
+ unsigned int src_offset,
+ unsigned int size)
+{
+ GLuint pitch, height;
+ bool ok;
+
+ /* The pitch given to the GPU must be DWORD aligned, and
+ * we want width to match pitch. Max width is (1 << 15 - 1),
+ * rounding that down to the nearest DWORD is 1 << 15 - 4
+ */
+ pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);
+ height = (pitch == 0) ? 1 : size / pitch;
+ ok = intelEmitCopyBlit(intel, 1,
+ pitch, src_bo, src_offset, I915_TILING_NONE,
+ pitch, dst_bo, dst_offset, I915_TILING_NONE,
+ 0, 0, /* src x/y */
+ 0, 0, /* dst x/y */
+ pitch, height, /* w, h */
+ GL_COPY);
+ assert(ok);
+
+ src_offset += pitch * height;
+ dst_offset += pitch * height;
+ size -= pitch * height;
+ assert (size < (1 << 15));
+ pitch = ALIGN(size, 4);
+ if (size != 0) {
+ ok = intelEmitCopyBlit(intel, 1,
+ pitch, src_bo, src_offset, I915_TILING_NONE,
+ pitch, dst_bo, dst_offset, I915_TILING_NONE,
+ 0, 0, /* src x/y */
+ 0, 0, /* dst x/y */
+ size, 1, /* w, h */
+ GL_COPY);
+ assert(ok);
+ }
+}
+
+/**
+ * Used to initialize the alpha value of an ARGB8888 teximage after
+ * loading it from an XRGB8888 source.
+ *
+ * This is very common with glCopyTexImage2D().
+ */
+void
+intel_set_teximage_alpha_to_one(struct gl_context *ctx,
+ struct intel_texture_image *intel_image)
+{
+ struct intel_context *intel = intel_context(ctx);
+ unsigned int image_x, image_y;
+ uint32_t x1, y1, x2, y2;
+ uint32_t BR13, CMD;
+ int pitch, cpp;
+ drm_intel_bo *aper_array[2];
+ struct intel_region *region = intel_image->mt->region;
+ int width, height, depth;
+ BATCH_LOCALS;
+
+ intel_miptree_get_dimensions_for_image(&intel_image->base.Base,
+ &width, &height, &depth);
+ assert(depth == 1);
+
+ assert(intel_image->base.Base.TexFormat == MESA_FORMAT_ARGB8888);
+
+ /* get dest x/y in destination texture */
+ intel_miptree_get_image_offset(intel_image->mt,
+ intel_image->base.Base.Level,
+ intel_image->base.Base.Face,
+ 0,
+ &image_x, &image_y);
+
+ x1 = image_x;
+ y1 = image_y;
+ x2 = image_x + width;
+ y2 = image_y + height;
+
+ pitch = region->pitch;
+ cpp = region->cpp;
+
+ DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n",
+ __FUNCTION__,
+ intel_image->mt->region->bo, (pitch * cpp),
+ x1, y1, x2 - x1, y2 - y1);
+
+ BR13 = br13_for_cpp(cpp) | 0xf0 << 16;
+ CMD = XY_COLOR_BLT_CMD;
+ CMD |= XY_BLT_WRITE_ALPHA;
+
+ assert(region->tiling != I915_TILING_Y);
+
+#ifndef I915
+ if (region->tiling != I915_TILING_NONE) {
+ CMD |= XY_DST_TILED;
+ pitch /= 4;
+ }
+#endif
+ BR13 |= (pitch * cpp);
+
+ /* do space check before going any further */
+ aper_array[0] = intel->batch.bo;
+ aper_array[1] = region->bo;
+
+ if (drm_intel_bufmgr_check_aperture_space(aper_array,
+ ARRAY_SIZE(aper_array)) != 0) {
+ intel_batchbuffer_flush(intel);
+ }
+
+ BEGIN_BATCH_BLT(6);
+ OUT_BATCH(CMD);
+ OUT_BATCH(BR13);
+ OUT_BATCH((y1 << 16) | x1);
+ OUT_BATCH((y2 << 16) | x2);
+ OUT_RELOC_FENCED(region->bo,
+ I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
+ 0);
+ OUT_BATCH(0xffffffff); /* white, but only alpha gets written */
+ ADVANCE_BATCH();
+
+ intel_batchbuffer_emit_mi_flush(intel);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffer_objects.c
index e06dd3c8d3c..df8ac7fb301 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffer_objects.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffer_objects.c
@@ -1 +1,849 @@
-../intel/intel_buffer_objects.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/imports.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/bufferobj.h"
+
+#include "intel_blit.h"
+#include "intel_buffer_objects.h"
+#include "intel_batchbuffer.h"
+#include "intel_context.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+
+static GLboolean
+intel_bufferobj_unmap(struct gl_context * ctx, struct gl_buffer_object *obj);
+
+/** Allocates a new drm_intel_bo to store the data for the buffer object. */
+static void
+intel_bufferobj_alloc_buffer(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj)
+{
+ intel_obj->buffer = drm_intel_bo_alloc(intel->bufmgr, "bufferobj",
+ intel_obj->Base.Size, 64);
+}
+
+static void
+release_buffer(struct intel_buffer_object *intel_obj)
+{
+ drm_intel_bo_unreference(intel_obj->buffer);
+ intel_obj->buffer = NULL;
+ intel_obj->offset = 0;
+ intel_obj->source = 0;
+}
+
+/**
+ * There is some duplication between mesa's bufferobjects and our
+ * bufmgr buffers. Both have an integer handle and a hashtable to
+ * lookup an opaque structure. It would be nice if the handles and
+ * internal structure where somehow shared.
+ */
+static struct gl_buffer_object *
+intel_bufferobj_alloc(struct gl_context * ctx, GLuint name, GLenum target)
+{
+ struct intel_buffer_object *obj = CALLOC_STRUCT(intel_buffer_object);
+
+ _mesa_initialize_buffer_object(ctx, &obj->Base, name, target);
+
+ obj->buffer = NULL;
+
+ return &obj->Base;
+}
+
+/**
+ * Deallocate/free a vertex/pixel buffer object.
+ * Called via glDeleteBuffersARB().
+ */
+static void
+intel_bufferobj_free(struct gl_context * ctx, struct gl_buffer_object *obj)
+{
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+
+ /* Buffer objects are automatically unmapped when deleting according
+ * to the spec, but Mesa doesn't do UnmapBuffer for us at context destroy
+ * (though it does if you call glDeleteBuffers)
+ */
+ if (obj->Pointer)
+ intel_bufferobj_unmap(ctx, obj);
+
+ free(intel_obj->sys_buffer);
+
+ drm_intel_bo_unreference(intel_obj->buffer);
+ free(intel_obj);
+}
+
+
+
+/**
+ * Allocate space for and store data in a buffer object. Any data that was
+ * previously stored in the buffer object is lost. If data is NULL,
+ * memory will be allocated, but no copy will occur.
+ * Called via ctx->Driver.BufferData().
+ * \return true for success, false if out of memory
+ */
+static GLboolean
+intel_bufferobj_data(struct gl_context * ctx,
+ GLenum target,
+ GLsizeiptrARB size,
+ const GLvoid * data,
+ GLenum usage, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ /* Part of the ABI, but this function doesn't use it.
+ */
+#ifndef I915
+ (void) target;
+#endif
+
+ intel_obj->Base.Size = size;
+ intel_obj->Base.Usage = usage;
+
+ assert(!obj->Pointer); /* Mesa should have unmapped it */
+
+ if (intel_obj->buffer != NULL)
+ release_buffer(intel_obj);
+
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+
+ if (size != 0) {
+#ifdef I915
+ /* On pre-965, stick VBOs in system memory, as we're always doing
+ * swtnl with their contents anyway.
+ */
+ if (target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER) {
+ intel_obj->sys_buffer = malloc(size);
+ if (intel_obj->sys_buffer != NULL) {
+ if (data != NULL)
+ memcpy(intel_obj->sys_buffer, data, size);
+ return true;
+ }
+ }
+#endif
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ if (!intel_obj->buffer)
+ return false;
+
+ if (data != NULL)
+ drm_intel_bo_subdata(intel_obj->buffer, 0, size, data);
+ }
+
+ return true;
+}
+
+
+/**
+ * Replace data in a subrange of buffer object. If the data range
+ * specified by size + offset extends beyond the end of the buffer or
+ * if data is NULL, no copy is performed.
+ * Called via glBufferSubDataARB().
+ */
+static void
+intel_bufferobj_subdata(struct gl_context * ctx,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ const GLvoid * data, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+ bool busy;
+
+ if (size == 0)
+ return;
+
+ assert(intel_obj);
+
+ /* If we have a single copy in system memory, update that */
+ if (intel_obj->sys_buffer) {
+ if (intel_obj->source)
+ release_buffer(intel_obj);
+
+ if (intel_obj->buffer == NULL) {
+ memcpy((char *)intel_obj->sys_buffer + offset, data, size);
+ return;
+ }
+
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+ }
+
+ /* Otherwise we need to update the copy in video memory. */
+ busy =
+ drm_intel_bo_busy(intel_obj->buffer) ||
+ drm_intel_bo_references(intel->batch.bo, intel_obj->buffer);
+
+ if (busy) {
+ if (size == intel_obj->Base.Size) {
+ /* Replace the current busy bo with fresh data. */
+ drm_intel_bo_unreference(intel_obj->buffer);
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ drm_intel_bo_subdata(intel_obj->buffer, 0, size, data);
+ } else {
+ perf_debug("Using a blit copy to avoid stalling on glBufferSubData() "
+ "to a busy buffer object.\n");
+ drm_intel_bo *temp_bo =
+ drm_intel_bo_alloc(intel->bufmgr, "subdata temp", size, 64);
+
+ drm_intel_bo_subdata(temp_bo, 0, size, data);
+
+ intel_emit_linear_blit(intel,
+ intel_obj->buffer, offset,
+ temp_bo, 0,
+ size);
+
+ drm_intel_bo_unreference(temp_bo);
+ }
+ } else {
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ if (drm_intel_bo_busy(intel_obj->buffer)) {
+ perf_debug("Stalling on the GPU in glBufferSubData().\n");
+ }
+ }
+ drm_intel_bo_subdata(intel_obj->buffer, offset, size, data);
+ }
+}
+
+
+/**
+ * Called via glGetBufferSubDataARB().
+ */
+static void
+intel_bufferobj_get_subdata(struct gl_context * ctx,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ GLvoid * data, struct gl_buffer_object *obj)
+{
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+ struct intel_context *intel = intel_context(ctx);
+
+ assert(intel_obj);
+ if (intel_obj->sys_buffer)
+ memcpy(data, (char *)intel_obj->sys_buffer + offset, size);
+ else {
+ if (drm_intel_bo_references(intel->batch.bo, intel_obj->buffer)) {
+ intel_batchbuffer_flush(intel);
+ }
+ drm_intel_bo_get_subdata(intel_obj->buffer, offset, size, data);
+ }
+}
+
+
+
+/**
+ * Called via glMapBufferRange and glMapBuffer
+ *
+ * The goal of this extension is to allow apps to accumulate their rendering
+ * at the same time as they accumulate their buffer object. Without it,
+ * you'd end up blocking on execution of rendering every time you mapped
+ * the buffer to put new data in.
+ *
+ * We support it in 3 ways: If unsynchronized, then don't bother
+ * flushing the batchbuffer before mapping the buffer, which can save blocking
+ * in many cases. If we would still block, and they allow the whole buffer
+ * to be invalidated, then just allocate a new buffer to replace the old one.
+ * If not, and we'd block, and they allow the subrange of the buffer to be
+ * invalidated, then we can make a new little BO, let them write into that,
+ * and blit it into the real BO at unmap time.
+ */
+static void *
+intel_bufferobj_map_range(struct gl_context * ctx,
+ GLintptr offset, GLsizeiptr length,
+ GLbitfield access, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+
+ /* _mesa_MapBufferRange (GL entrypoint) sets these, but the vbo module also
+ * internally uses our functions directly.
+ */
+ obj->Offset = offset;
+ obj->Length = length;
+ obj->AccessFlags = access;
+
+ if (intel_obj->sys_buffer) {
+ const bool read_only =
+ (access & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) == GL_MAP_READ_BIT;
+
+ if (!read_only && intel_obj->source)
+ release_buffer(intel_obj);
+
+ if (!intel_obj->buffer || intel_obj->source) {
+ obj->Pointer = intel_obj->sys_buffer + offset;
+ return obj->Pointer;
+ }
+
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+ }
+
+ if (intel_obj->buffer == NULL) {
+ obj->Pointer = NULL;
+ return NULL;
+ }
+
+ /* If the access is synchronized (like a normal buffer mapping), then get
+ * things flushed out so the later mapping syncs appropriately through GEM.
+ * If the user doesn't care about existing buffer contents and mapping would
+ * cause us to block, then throw out the old buffer.
+ *
+ * If they set INVALIDATE_BUFFER, we can pitch the current contents to
+ * achieve the required synchronization.
+ */
+ if (!(access & GL_MAP_UNSYNCHRONIZED_BIT)) {
+ if (drm_intel_bo_references(intel->batch.bo, intel_obj->buffer)) {
+ if (access & GL_MAP_INVALIDATE_BUFFER_BIT) {
+ drm_intel_bo_unreference(intel_obj->buffer);
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ } else {
+ intel_flush(ctx);
+ }
+ } else if (drm_intel_bo_busy(intel_obj->buffer) &&
+ (access & GL_MAP_INVALIDATE_BUFFER_BIT)) {
+ drm_intel_bo_unreference(intel_obj->buffer);
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ }
+ }
+
+ /* If the user is mapping a range of an active buffer object but
+ * doesn't require the current contents of that range, make a new
+ * BO, and we'll copy what they put in there out at unmap or
+ * FlushRange time.
+ */
+ if ((access & GL_MAP_INVALIDATE_RANGE_BIT) &&
+ drm_intel_bo_busy(intel_obj->buffer)) {
+ if (access & GL_MAP_FLUSH_EXPLICIT_BIT) {
+ intel_obj->range_map_buffer = malloc(length);
+ obj->Pointer = intel_obj->range_map_buffer;
+ } else {
+ intel_obj->range_map_bo = drm_intel_bo_alloc(intel->bufmgr,
+ "range map",
+ length, 64);
+ if (!(access & GL_MAP_READ_BIT)) {
+ drm_intel_gem_bo_map_gtt(intel_obj->range_map_bo);
+ } else {
+ drm_intel_bo_map(intel_obj->range_map_bo,
+ (access & GL_MAP_WRITE_BIT) != 0);
+ }
+ obj->Pointer = intel_obj->range_map_bo->virtual;
+ }
+ return obj->Pointer;
+ }
+
+ if (access & GL_MAP_UNSYNCHRONIZED_BIT)
+ drm_intel_gem_bo_map_unsynchronized(intel_obj->buffer);
+ else if (!(access & GL_MAP_READ_BIT)) {
+ drm_intel_gem_bo_map_gtt(intel_obj->buffer);
+ } else {
+ drm_intel_bo_map(intel_obj->buffer, (access & GL_MAP_WRITE_BIT) != 0);
+ }
+
+ obj->Pointer = intel_obj->buffer->virtual + offset;
+ return obj->Pointer;
+}
+
+/* Ideally we'd use a BO to avoid taking up cache space for the temporary
+ * data, but FlushMappedBufferRange may be followed by further writes to
+ * the pointer, so we would have to re-map after emitting our blit, which
+ * would defeat the point.
+ */
+static void
+intel_bufferobj_flush_mapped_range(struct gl_context *ctx,
+ GLintptr offset, GLsizeiptr length,
+ struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+ drm_intel_bo *temp_bo;
+
+ /* Unless we're in the range map using a temporary system buffer,
+ * there's no work to do.
+ */
+ if (intel_obj->range_map_buffer == NULL)
+ return;
+
+ if (length == 0)
+ return;
+
+ temp_bo = drm_intel_bo_alloc(intel->bufmgr, "range map flush", length, 64);
+
+ drm_intel_bo_subdata(temp_bo, 0, length, intel_obj->range_map_buffer);
+
+ intel_emit_linear_blit(intel,
+ intel_obj->buffer, obj->Offset + offset,
+ temp_bo, 0,
+ length);
+
+ drm_intel_bo_unreference(temp_bo);
+}
+
+
+/**
+ * Called via glUnmapBuffer().
+ */
+static GLboolean
+intel_bufferobj_unmap(struct gl_context * ctx, struct gl_buffer_object *obj)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_obj = intel_buffer_object(obj);
+
+ assert(intel_obj);
+ assert(obj->Pointer);
+ if (intel_obj->sys_buffer != NULL) {
+ /* always keep the mapping around. */
+ } else if (intel_obj->range_map_buffer != NULL) {
+ /* Since we've emitted some blits to buffers that will (likely) be used
+ * in rendering operations in other cache domains in this batch, emit a
+ * flush. Once again, we wish for a domain tracker in libdrm to cover
+ * usage inside of a batchbuffer.
+ */
+ intel_batchbuffer_emit_mi_flush(intel);
+ free(intel_obj->range_map_buffer);
+ intel_obj->range_map_buffer = NULL;
+ } else if (intel_obj->range_map_bo != NULL) {
+ drm_intel_bo_unmap(intel_obj->range_map_bo);
+
+ intel_emit_linear_blit(intel,
+ intel_obj->buffer, obj->Offset,
+ intel_obj->range_map_bo, 0,
+ obj->Length);
+
+ /* Since we've emitted some blits to buffers that will (likely) be used
+ * in rendering operations in other cache domains in this batch, emit a
+ * flush. Once again, we wish for a domain tracker in libdrm to cover
+ * usage inside of a batchbuffer.
+ */
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ drm_intel_bo_unreference(intel_obj->range_map_bo);
+ intel_obj->range_map_bo = NULL;
+ } else if (intel_obj->buffer != NULL) {
+ drm_intel_bo_unmap(intel_obj->buffer);
+ }
+ obj->Pointer = NULL;
+ obj->Offset = 0;
+ obj->Length = 0;
+
+ return true;
+}
+
+drm_intel_bo *
+intel_bufferobj_buffer(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj,
+ GLuint flag)
+{
+ if (intel_obj->source)
+ release_buffer(intel_obj);
+
+ if (intel_obj->buffer == NULL) {
+ intel_bufferobj_alloc_buffer(intel, intel_obj);
+ drm_intel_bo_subdata(intel_obj->buffer,
+ 0, intel_obj->Base.Size,
+ intel_obj->sys_buffer);
+
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+ intel_obj->offset = 0;
+ }
+
+ return intel_obj->buffer;
+}
+
+#define INTEL_UPLOAD_SIZE (64*1024)
+
+void
+intel_upload_finish(struct intel_context *intel)
+{
+ if (!intel->upload.bo)
+ return;
+
+ if (intel->upload.buffer_len) {
+ drm_intel_bo_subdata(intel->upload.bo,
+ intel->upload.buffer_offset,
+ intel->upload.buffer_len,
+ intel->upload.buffer);
+ intel->upload.buffer_len = 0;
+ }
+
+ drm_intel_bo_unreference(intel->upload.bo);
+ intel->upload.bo = NULL;
+}
+
+static void wrap_buffers(struct intel_context *intel, GLuint size)
+{
+ intel_upload_finish(intel);
+
+ if (size < INTEL_UPLOAD_SIZE)
+ size = INTEL_UPLOAD_SIZE;
+
+ intel->upload.bo = drm_intel_bo_alloc(intel->bufmgr, "upload", size, 0);
+ intel->upload.offset = 0;
+}
+
+void intel_upload_data(struct intel_context *intel,
+ const void *ptr, GLuint size, GLuint align,
+ drm_intel_bo **return_bo,
+ GLuint *return_offset)
+{
+ GLuint base, delta;
+
+ base = (intel->upload.offset + align - 1) / align * align;
+ if (intel->upload.bo == NULL || base + size > intel->upload.bo->size) {
+ wrap_buffers(intel, size);
+ base = 0;
+ }
+
+ drm_intel_bo_reference(intel->upload.bo);
+ *return_bo = intel->upload.bo;
+ *return_offset = base;
+
+ delta = base - intel->upload.offset;
+ if (intel->upload.buffer_len &&
+ intel->upload.buffer_len + delta + size > sizeof(intel->upload.buffer))
+ {
+ drm_intel_bo_subdata(intel->upload.bo,
+ intel->upload.buffer_offset,
+ intel->upload.buffer_len,
+ intel->upload.buffer);
+ intel->upload.buffer_len = 0;
+ }
+
+ if (size < sizeof(intel->upload.buffer))
+ {
+ if (intel->upload.buffer_len == 0)
+ intel->upload.buffer_offset = base;
+ else
+ intel->upload.buffer_len += delta;
+
+ memcpy(intel->upload.buffer + intel->upload.buffer_len, ptr, size);
+ intel->upload.buffer_len += size;
+ }
+ else
+ {
+ drm_intel_bo_subdata(intel->upload.bo, base, size, ptr);
+ }
+
+ intel->upload.offset = base + size;
+}
+
+void *intel_upload_map(struct intel_context *intel, GLuint size, GLuint align)
+{
+ GLuint base, delta;
+ char *ptr;
+
+ base = (intel->upload.offset + align - 1) / align * align;
+ if (intel->upload.bo == NULL || base + size > intel->upload.bo->size) {
+ wrap_buffers(intel, size);
+ base = 0;
+ }
+
+ delta = base - intel->upload.offset;
+ if (intel->upload.buffer_len &&
+ intel->upload.buffer_len + delta + size > sizeof(intel->upload.buffer))
+ {
+ drm_intel_bo_subdata(intel->upload.bo,
+ intel->upload.buffer_offset,
+ intel->upload.buffer_len,
+ intel->upload.buffer);
+ intel->upload.buffer_len = 0;
+ }
+
+ if (size <= sizeof(intel->upload.buffer)) {
+ if (intel->upload.buffer_len == 0)
+ intel->upload.buffer_offset = base;
+ else
+ intel->upload.buffer_len += delta;
+
+ ptr = intel->upload.buffer + intel->upload.buffer_len;
+ intel->upload.buffer_len += size;
+ } else
+ ptr = malloc(size);
+
+ return ptr;
+}
+
+void intel_upload_unmap(struct intel_context *intel,
+ const void *ptr, GLuint size, GLuint align,
+ drm_intel_bo **return_bo,
+ GLuint *return_offset)
+{
+ GLuint base;
+
+ base = (intel->upload.offset + align - 1) / align * align;
+ if (size > sizeof(intel->upload.buffer)) {
+ drm_intel_bo_subdata(intel->upload.bo, base, size, ptr);
+ free((void*)ptr);
+ }
+
+ drm_intel_bo_reference(intel->upload.bo);
+ *return_bo = intel->upload.bo;
+ *return_offset = base;
+
+ intel->upload.offset = base + size;
+}
+
+drm_intel_bo *
+intel_bufferobj_source(struct intel_context *intel,
+ struct intel_buffer_object *intel_obj,
+ GLuint align, GLuint *offset)
+{
+ if (intel_obj->buffer == NULL) {
+ intel_upload_data(intel,
+ intel_obj->sys_buffer, intel_obj->Base.Size, align,
+ &intel_obj->buffer, &intel_obj->offset);
+ intel_obj->source = 1;
+ }
+
+ *offset = intel_obj->offset;
+ return intel_obj->buffer;
+}
+
+static void
+intel_bufferobj_copy_subdata(struct gl_context *ctx,
+ struct gl_buffer_object *src,
+ struct gl_buffer_object *dst,
+ GLintptr read_offset, GLintptr write_offset,
+ GLsizeiptr size)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *intel_src = intel_buffer_object(src);
+ struct intel_buffer_object *intel_dst = intel_buffer_object(dst);
+ drm_intel_bo *src_bo, *dst_bo;
+ GLuint src_offset;
+
+ if (size == 0)
+ return;
+
+ /* If we're in system memory, just map and memcpy. */
+ if (intel_src->sys_buffer || intel_dst->sys_buffer) {
+ /* The same buffer may be used, but note that regions copied may
+ * not overlap.
+ */
+ if (src == dst) {
+ char *ptr = intel_bufferobj_map_range(ctx, 0, dst->Size,
+ GL_MAP_READ_BIT |
+ GL_MAP_WRITE_BIT,
+ dst);
+ memmove(ptr + write_offset, ptr + read_offset, size);
+ intel_bufferobj_unmap(ctx, dst);
+ } else {
+ const char *src_ptr;
+ char *dst_ptr;
+
+ src_ptr = intel_bufferobj_map_range(ctx, 0, src->Size,
+ GL_MAP_READ_BIT, src);
+ dst_ptr = intel_bufferobj_map_range(ctx, 0, dst->Size,
+ GL_MAP_WRITE_BIT, dst);
+
+ memcpy(dst_ptr + write_offset, src_ptr + read_offset, size);
+
+ intel_bufferobj_unmap(ctx, src);
+ intel_bufferobj_unmap(ctx, dst);
+ }
+ return;
+ }
+
+ /* Otherwise, we have real BOs, so blit them. */
+
+ dst_bo = intel_bufferobj_buffer(intel, intel_dst, INTEL_WRITE_PART);
+ src_bo = intel_bufferobj_source(intel, intel_src, 64, &src_offset);
+
+ intel_emit_linear_blit(intel,
+ dst_bo, write_offset,
+ src_bo, read_offset + src_offset, size);
+
+ /* Since we've emitted some blits to buffers that will (likely) be used
+ * in rendering operations in other cache domains in this batch, emit a
+ * flush. Once again, we wish for a domain tracker in libdrm to cover
+ * usage inside of a batchbuffer.
+ */
+ intel_batchbuffer_emit_mi_flush(intel);
+}
+
+#if FEATURE_APPLE_object_purgeable
+static GLenum
+intel_buffer_purgeable(drm_intel_bo *buffer)
+{
+ int retained = 0;
+
+ if (buffer != NULL)
+ retained = drm_intel_bo_madvise (buffer, I915_MADV_DONTNEED);
+
+ return retained ? GL_VOLATILE_APPLE : GL_RELEASED_APPLE;
+}
+
+static GLenum
+intel_buffer_object_purgeable(struct gl_context * ctx,
+ struct gl_buffer_object *obj,
+ GLenum option)
+{
+ struct intel_buffer_object *intel_obj = intel_buffer_object (obj);
+
+ if (intel_obj->buffer != NULL)
+ return intel_buffer_purgeable(intel_obj->buffer);
+
+ if (option == GL_RELEASED_APPLE) {
+ if (intel_obj->sys_buffer != NULL) {
+ free(intel_obj->sys_buffer);
+ intel_obj->sys_buffer = NULL;
+ }
+
+ return GL_RELEASED_APPLE;
+ } else {
+ /* XXX Create the buffer and madvise(MADV_DONTNEED)? */
+ struct intel_context *intel = intel_context(ctx);
+ drm_intel_bo *bo = intel_bufferobj_buffer(intel, intel_obj, INTEL_READ);
+
+ return intel_buffer_purgeable(bo);
+ }
+}
+
+static GLenum
+intel_texture_object_purgeable(struct gl_context * ctx,
+ struct gl_texture_object *obj,
+ GLenum option)
+{
+ struct intel_texture_object *intel;
+
+ (void) ctx;
+ (void) option;
+
+ intel = intel_texture_object(obj);
+ if (intel->mt == NULL || intel->mt->region == NULL)
+ return GL_RELEASED_APPLE;
+
+ return intel_buffer_purgeable(intel->mt->region->bo);
+}
+
+static GLenum
+intel_render_object_purgeable(struct gl_context * ctx,
+ struct gl_renderbuffer *obj,
+ GLenum option)
+{
+ struct intel_renderbuffer *intel;
+
+ (void) ctx;
+ (void) option;
+
+ intel = intel_renderbuffer(obj);
+ if (intel->mt == NULL)
+ return GL_RELEASED_APPLE;
+
+ return intel_buffer_purgeable(intel->mt->region->bo);
+}
+
+static GLenum
+intel_buffer_unpurgeable(drm_intel_bo *buffer)
+{
+ int retained;
+
+ retained = 0;
+ if (buffer != NULL)
+ retained = drm_intel_bo_madvise (buffer, I915_MADV_WILLNEED);
+
+ return retained ? GL_RETAINED_APPLE : GL_UNDEFINED_APPLE;
+}
+
+static GLenum
+intel_buffer_object_unpurgeable(struct gl_context * ctx,
+ struct gl_buffer_object *obj,
+ GLenum option)
+{
+ (void) ctx;
+ (void) option;
+
+ return intel_buffer_unpurgeable(intel_buffer_object (obj)->buffer);
+}
+
+static GLenum
+intel_texture_object_unpurgeable(struct gl_context * ctx,
+ struct gl_texture_object *obj,
+ GLenum option)
+{
+ struct intel_texture_object *intel;
+
+ (void) ctx;
+ (void) option;
+
+ intel = intel_texture_object(obj);
+ if (intel->mt == NULL || intel->mt->region == NULL)
+ return GL_UNDEFINED_APPLE;
+
+ return intel_buffer_unpurgeable(intel->mt->region->bo);
+}
+
+static GLenum
+intel_render_object_unpurgeable(struct gl_context * ctx,
+ struct gl_renderbuffer *obj,
+ GLenum option)
+{
+ struct intel_renderbuffer *intel;
+
+ (void) ctx;
+ (void) option;
+
+ intel = intel_renderbuffer(obj);
+ if (intel->mt == NULL)
+ return GL_UNDEFINED_APPLE;
+
+ return intel_buffer_unpurgeable(intel->mt->region->bo);
+}
+#endif
+
+void
+intelInitBufferObjectFuncs(struct dd_function_table *functions)
+{
+ functions->NewBufferObject = intel_bufferobj_alloc;
+ functions->DeleteBuffer = intel_bufferobj_free;
+ functions->BufferData = intel_bufferobj_data;
+ functions->BufferSubData = intel_bufferobj_subdata;
+ functions->GetBufferSubData = intel_bufferobj_get_subdata;
+ functions->MapBufferRange = intel_bufferobj_map_range;
+ functions->FlushMappedBufferRange = intel_bufferobj_flush_mapped_range;
+ functions->UnmapBuffer = intel_bufferobj_unmap;
+ functions->CopyBufferSubData = intel_bufferobj_copy_subdata;
+
+#if FEATURE_APPLE_object_purgeable
+ functions->BufferObjectPurgeable = intel_buffer_object_purgeable;
+ functions->TextureObjectPurgeable = intel_texture_object_purgeable;
+ functions->RenderObjectPurgeable = intel_render_object_purgeable;
+
+ functions->BufferObjectUnpurgeable = intel_buffer_object_unpurgeable;
+ functions->TextureObjectUnpurgeable = intel_texture_object_unpurgeable;
+ functions->RenderObjectUnpurgeable = intel_render_object_unpurgeable;
+#endif
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffers.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffers.c
index c86daa49f47..9a9a259c9e5 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffers.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_buffers.c
@@ -1 +1,132 @@
-../intel/intel_buffers.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "intel_context.h"
+#include "intel_buffers.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+
+/**
+ * Return pointer to current color drawing region, or NULL.
+ */
+struct intel_region *
+intel_drawbuf_region(struct intel_context *intel)
+{
+ struct intel_renderbuffer *irbColor =
+ intel_renderbuffer(intel->ctx.DrawBuffer->_ColorDrawBuffers[0]);
+ if (irbColor && irbColor->mt)
+ return irbColor->mt->region;
+ else
+ return NULL;
+}
+
+/**
+ * Return pointer to current color reading region, or NULL.
+ */
+struct intel_region *
+intel_readbuf_region(struct intel_context *intel)
+{
+ struct intel_renderbuffer *irb
+ = intel_renderbuffer(intel->ctx.ReadBuffer->_ColorReadBuffer);
+ if (irb && irb->mt)
+ return irb->mt->region;
+ else
+ return NULL;
+}
+
+/**
+ * Check if we're about to draw into the front color buffer.
+ * If so, set the intel->front_buffer_dirty field to true.
+ */
+void
+intel_check_front_buffer_rendering(struct intel_context *intel)
+{
+ const struct gl_framebuffer *fb = intel->ctx.DrawBuffer;
+ if (_mesa_is_winsys_fbo(fb)) {
+ /* drawing to window system buffer */
+ if (fb->_NumColorDrawBuffers > 0) {
+ if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
+ intel->front_buffer_dirty = true;
+ }
+ }
+ }
+}
+
+static void
+intelDrawBuffer(struct gl_context * ctx, GLenum mode)
+{
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ struct intel_context *const intel = intel_context(ctx);
+ const bool was_front_buffer_rendering =
+ intel->is_front_buffer_rendering;
+
+ intel->is_front_buffer_rendering = (mode == GL_FRONT_LEFT)
+ || (mode == GL_FRONT) || (mode == GL_FRONT_AND_BACK);
+
+ /* If we weren't front-buffer rendering before but we are now,
+ * invalidate our DRI drawable so we'll ask for new buffers
+ * (including the fake front) before we start rendering again.
+ */
+ if (!was_front_buffer_rendering && intel->is_front_buffer_rendering)
+ dri2InvalidateDrawable(intel->driContext->driDrawablePriv);
+ }
+
+ intel_draw_buffer(ctx);
+}
+
+
+static void
+intelReadBuffer(struct gl_context * ctx, GLenum mode)
+{
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ struct intel_context *const intel = intel_context(ctx);
+ const bool was_front_buffer_reading =
+ intel->is_front_buffer_reading;
+
+ intel->is_front_buffer_reading = (mode == GL_FRONT_LEFT)
+ || (mode == GL_FRONT);
+
+ /* If we weren't front-buffer reading before but we are now,
+ * invalidate our DRI drawable so we'll ask for new buffers
+ * (including the fake front) before we start reading again.
+ */
+ if (!was_front_buffer_reading && intel->is_front_buffer_reading)
+ dri2InvalidateDrawable(intel->driContext->driReadablePriv);
+ }
+}
+
+
+void
+intelInitBufferFuncs(struct dd_function_table *functions)
+{
+ functions->DrawBuffer = intelDrawBuffer;
+ functions->ReadBuffer = intelReadBuffer;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_context.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_context.c
index 27a1cbb255e..25334da33f7 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_context.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_context.c
@@ -1 +1,1030 @@
-../intel/intel_context.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/imports.h"
+#include "main/points.h"
+#include "main/renderbuffer.h"
+
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "tnl/tnl.h"
+#include "drivers/common/driverfuncs.h"
+#include "drivers/common/meta.h"
+
+#include "intel_chipset.h"
+#include "intel_buffers.h"
+#include "intel_tex.h"
+#include "intel_batchbuffer.h"
+#include "intel_clear.h"
+#include "intel_extensions.h"
+#include "intel_pixel.h"
+#include "intel_regions.h"
+#include "intel_buffer_objects.h"
+#include "intel_fbo.h"
+#include "intel_bufmgr.h"
+#include "intel_screen.h"
+#include "intel_mipmap_tree.h"
+
+#include "utils.h"
+#include "../glsl/ralloc.h"
+
+#ifndef INTEL_DEBUG
+int INTEL_DEBUG = (0);
+#endif
+
+
+static const GLubyte *
+intelGetString(struct gl_context * ctx, GLenum name)
+{
+ const struct intel_context *const intel = intel_context(ctx);
+ const char *chipset;
+ static char buffer[128];
+
+ switch (name) {
+ case GL_VENDOR:
+ return (GLubyte *) "Intel Open Source Technology Center";
+ break;
+
+ case GL_RENDERER:
+ switch (intel->intelScreen->deviceID) {
+ case PCI_CHIP_845_G:
+ chipset = "Intel(R) 845G";
+ break;
+ case PCI_CHIP_I830_M:
+ chipset = "Intel(R) 830M";
+ break;
+ case PCI_CHIP_I855_GM:
+ chipset = "Intel(R) 852GM/855GM";
+ break;
+ case PCI_CHIP_I865_G:
+ chipset = "Intel(R) 865G";
+ break;
+ case PCI_CHIP_I915_G:
+ chipset = "Intel(R) 915G";
+ break;
+ case PCI_CHIP_E7221_G:
+ chipset = "Intel (R) E7221G (i915)";
+ break;
+ case PCI_CHIP_I915_GM:
+ chipset = "Intel(R) 915GM";
+ break;
+ case PCI_CHIP_I945_G:
+ chipset = "Intel(R) 945G";
+ break;
+ case PCI_CHIP_I945_GM:
+ chipset = "Intel(R) 945GM";
+ break;
+ case PCI_CHIP_I945_GME:
+ chipset = "Intel(R) 945GME";
+ break;
+ case PCI_CHIP_G33_G:
+ chipset = "Intel(R) G33";
+ break;
+ case PCI_CHIP_Q35_G:
+ chipset = "Intel(R) Q35";
+ break;
+ case PCI_CHIP_Q33_G:
+ chipset = "Intel(R) Q33";
+ break;
+ case PCI_CHIP_IGD_GM:
+ case PCI_CHIP_IGD_G:
+ chipset = "Intel(R) IGD";
+ break;
+ case PCI_CHIP_I965_Q:
+ chipset = "Intel(R) 965Q";
+ break;
+ case PCI_CHIP_I965_G:
+ case PCI_CHIP_I965_G_1:
+ chipset = "Intel(R) 965G";
+ break;
+ case PCI_CHIP_I946_GZ:
+ chipset = "Intel(R) 946GZ";
+ break;
+ case PCI_CHIP_I965_GM:
+ chipset = "Intel(R) 965GM";
+ break;
+ case PCI_CHIP_I965_GME:
+ chipset = "Intel(R) 965GME/GLE";
+ break;
+ case PCI_CHIP_GM45_GM:
+ chipset = "Mobile Intel® GM45 Express Chipset";
+ break;
+ case PCI_CHIP_IGD_E_G:
+ chipset = "Intel(R) Integrated Graphics Device";
+ break;
+ case PCI_CHIP_G45_G:
+ chipset = "Intel(R) G45/G43";
+ break;
+ case PCI_CHIP_Q45_G:
+ chipset = "Intel(R) Q45/Q43";
+ break;
+ case PCI_CHIP_G41_G:
+ chipset = "Intel(R) G41";
+ break;
+ case PCI_CHIP_B43_G:
+ case PCI_CHIP_B43_G1:
+ chipset = "Intel(R) B43";
+ break;
+ case PCI_CHIP_ILD_G:
+ chipset = "Intel(R) Ironlake Desktop";
+ break;
+ case PCI_CHIP_ILM_G:
+ chipset = "Intel(R) Ironlake Mobile";
+ break;
+ case PCI_CHIP_SANDYBRIDGE_GT1:
+ case PCI_CHIP_SANDYBRIDGE_GT2:
+ case PCI_CHIP_SANDYBRIDGE_GT2_PLUS:
+ chipset = "Intel(R) Sandybridge Desktop";
+ break;
+ case PCI_CHIP_SANDYBRIDGE_M_GT1:
+ case PCI_CHIP_SANDYBRIDGE_M_GT2:
+ case PCI_CHIP_SANDYBRIDGE_M_GT2_PLUS:
+ chipset = "Intel(R) Sandybridge Mobile";
+ break;
+ case PCI_CHIP_SANDYBRIDGE_S:
+ chipset = "Intel(R) Sandybridge Server";
+ break;
+ case PCI_CHIP_IVYBRIDGE_GT1:
+ case PCI_CHIP_IVYBRIDGE_GT2:
+ chipset = "Intel(R) Ivybridge Desktop";
+ break;
+ case PCI_CHIP_IVYBRIDGE_M_GT1:
+ case PCI_CHIP_IVYBRIDGE_M_GT2:
+ chipset = "Intel(R) Ivybridge Mobile";
+ break;
+ case PCI_CHIP_IVYBRIDGE_S_GT1:
+ case PCI_CHIP_IVYBRIDGE_S_GT2:
+ chipset = "Intel(R) Ivybridge Server";
+ break;
+ case PCI_CHIP_HASWELL_GT1:
+ case PCI_CHIP_HASWELL_GT2:
+ case PCI_CHIP_HASWELL_GT2_PLUS:
+ case PCI_CHIP_HASWELL_SDV_GT1:
+ case PCI_CHIP_HASWELL_SDV_GT2:
+ case PCI_CHIP_HASWELL_SDV_GT2_PLUS:
+ case PCI_CHIP_HASWELL_ULT_GT1:
+ case PCI_CHIP_HASWELL_ULT_GT2:
+ case PCI_CHIP_HASWELL_ULT_GT2_PLUS:
+ case PCI_CHIP_HASWELL_CRW_GT1:
+ case PCI_CHIP_HASWELL_CRW_GT2:
+ case PCI_CHIP_HASWELL_CRW_GT2_PLUS:
+ chipset = "Intel(R) Haswell Desktop";
+ break;
+ case PCI_CHIP_HASWELL_M_GT1:
+ case PCI_CHIP_HASWELL_M_GT2:
+ case PCI_CHIP_HASWELL_M_GT2_PLUS:
+ case PCI_CHIP_HASWELL_SDV_M_GT1:
+ case PCI_CHIP_HASWELL_SDV_M_GT2:
+ case PCI_CHIP_HASWELL_SDV_M_GT2_PLUS:
+ case PCI_CHIP_HASWELL_ULT_M_GT1:
+ case PCI_CHIP_HASWELL_ULT_M_GT2:
+ case PCI_CHIP_HASWELL_ULT_M_GT2_PLUS:
+ case PCI_CHIP_HASWELL_CRW_M_GT1:
+ case PCI_CHIP_HASWELL_CRW_M_GT2:
+ case PCI_CHIP_HASWELL_CRW_M_GT2_PLUS:
+ chipset = "Intel(R) Haswell Mobile";
+ break;
+ case PCI_CHIP_HASWELL_S_GT1:
+ case PCI_CHIP_HASWELL_S_GT2:
+ case PCI_CHIP_HASWELL_S_GT2_PLUS:
+ case PCI_CHIP_HASWELL_SDV_S_GT1:
+ case PCI_CHIP_HASWELL_SDV_S_GT2:
+ case PCI_CHIP_HASWELL_SDV_S_GT2_PLUS:
+ case PCI_CHIP_HASWELL_ULT_S_GT1:
+ case PCI_CHIP_HASWELL_ULT_S_GT2:
+ case PCI_CHIP_HASWELL_ULT_S_GT2_PLUS:
+ case PCI_CHIP_HASWELL_CRW_S_GT1:
+ case PCI_CHIP_HASWELL_CRW_S_GT2:
+ case PCI_CHIP_HASWELL_CRW_S_GT2_PLUS:
+ chipset = "Intel(R) Haswell Server";
+ break;
+ default:
+ chipset = "Unknown Intel Chipset";
+ break;
+ }
+
+ (void) driGetRendererString(buffer, chipset, 0);
+ return (GLubyte *) buffer;
+
+ default:
+ return NULL;
+ }
+}
+
+void
+intel_downsample_for_dri2_flush(struct intel_context *intel,
+ __DRIdrawable *drawable)
+{
+ if (intel->gen < 6) {
+ /* MSAA is not supported, so don't waste time checking for
+ * a multisample buffer.
+ */
+ return;
+ }
+
+ struct gl_framebuffer *fb = drawable->driverPrivate;
+ struct intel_renderbuffer *rb;
+
+ /* Usually, only the back buffer will need to be downsampled. However,
+ * the front buffer will also need it if the user has rendered into it.
+ */
+ static const gl_buffer_index buffers[2] = {
+ BUFFER_BACK_LEFT,
+ BUFFER_FRONT_LEFT,
+ };
+
+ for (int i = 0; i < 2; ++i) {
+ rb = intel_get_renderbuffer(fb, buffers[i]);
+ if (rb == NULL || rb->mt == NULL)
+ continue;
+ intel_miptree_downsample(intel, rb->mt);
+ }
+}
+
+static void
+intel_flush_front(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ __DRIcontext *driContext = intel->driContext;
+ __DRIdrawable *driDrawable = driContext->driDrawablePriv;
+ __DRIscreen *const screen = intel->intelScreen->driScrnPriv;
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && intel->front_buffer_dirty) {
+ if (screen->dri2.loader->flushFrontBuffer != NULL &&
+ driDrawable &&
+ driDrawable->loaderPrivate) {
+
+ /* Downsample before flushing FAKE_FRONT_LEFT to FRONT_LEFT.
+ *
+ * This potentially downsamples both front and back buffer. It
+ * is unnecessary to downsample the back, but harms nothing except
+ * performance. And no one cares about front-buffer render
+ * performance.
+ */
+ intel_downsample_for_dri2_flush(intel, driDrawable);
+
+ screen->dri2.loader->flushFrontBuffer(driDrawable,
+ driDrawable->loaderPrivate);
+
+ /* We set the dirty bit in intel_prepare_render() if we're
+ * front buffer rendering once we get there.
+ */
+ intel->front_buffer_dirty = false;
+ }
+ }
+}
+
+static unsigned
+intel_bits_per_pixel(const struct intel_renderbuffer *rb)
+{
+ return _mesa_get_format_bytes(intel_rb_format(rb)) * 8;
+}
+
+static void
+intel_query_dri2_buffers(struct intel_context *intel,
+ __DRIdrawable *drawable,
+ __DRIbuffer **buffers,
+ int *count);
+
+static void
+intel_process_dri2_buffer(struct intel_context *intel,
+ __DRIdrawable *drawable,
+ __DRIbuffer *buffer,
+ struct intel_renderbuffer *rb,
+ const char *buffer_name);
+
+void
+intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
+{
+ struct gl_framebuffer *fb = drawable->driverPrivate;
+ struct intel_renderbuffer *rb;
+ struct intel_context *intel = context->driverPrivate;
+ __DRIbuffer *buffers = NULL;
+ int i, count;
+ const char *region_name;
+
+ /* If we're rendering to the fake front buffer, make sure all the
+ * pending drawing has landed on the real front buffer. Otherwise
+ * when we eventually get to DRI2GetBuffersWithFormat the stale
+ * real front buffer contents will get copied to the new fake front
+ * buffer.
+ */
+ if (intel->is_front_buffer_rendering) {
+ intel_flush(&intel->ctx);
+ intel_flush_front(&intel->ctx);
+ }
+
+ /* Set this up front, so that in case our buffers get invalidated
+ * while we're getting new buffers, we don't clobber the stamp and
+ * thus ignore the invalidate. */
+ drawable->lastStamp = drawable->dri2.stamp;
+
+ if (unlikely(INTEL_DEBUG & DEBUG_DRI))
+ fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
+
+ intel_query_dri2_buffers(intel, drawable, &buffers, &count);
+
+ if (buffers == NULL)
+ return;
+
+ for (i = 0; i < count; i++) {
+ switch (buffers[i].attachment) {
+ case __DRI_BUFFER_FRONT_LEFT:
+ rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+ region_name = "dri2 front buffer";
+ break;
+
+ case __DRI_BUFFER_FAKE_FRONT_LEFT:
+ rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+ region_name = "dri2 fake front buffer";
+ break;
+
+ case __DRI_BUFFER_BACK_LEFT:
+ rb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT);
+ region_name = "dri2 back buffer";
+ break;
+
+ case __DRI_BUFFER_DEPTH:
+ case __DRI_BUFFER_HIZ:
+ case __DRI_BUFFER_DEPTH_STENCIL:
+ case __DRI_BUFFER_STENCIL:
+ case __DRI_BUFFER_ACCUM:
+ default:
+ fprintf(stderr,
+ "unhandled buffer attach event, attachment type %d\n",
+ buffers[i].attachment);
+ return;
+ }
+
+ intel_process_dri2_buffer(intel, drawable, &buffers[i], rb, region_name);
+ }
+
+ driUpdateFramebufferSize(&intel->ctx, drawable);
+}
+
+/**
+ * intel_prepare_render should be called anywhere that curent read/drawbuffer
+ * state is required.
+ */
+void
+intel_prepare_render(struct intel_context *intel)
+{
+ __DRIcontext *driContext = intel->driContext;
+ __DRIdrawable *drawable;
+
+ drawable = driContext->driDrawablePriv;
+ if (drawable && drawable->dri2.stamp != driContext->dri2.draw_stamp) {
+ if (drawable->lastStamp != drawable->dri2.stamp)
+ intel_update_renderbuffers(driContext, drawable);
+ intel_draw_buffer(&intel->ctx);
+ driContext->dri2.draw_stamp = drawable->dri2.stamp;
+ }
+
+ drawable = driContext->driReadablePriv;
+ if (drawable && drawable->dri2.stamp != driContext->dri2.read_stamp) {
+ if (drawable->lastStamp != drawable->dri2.stamp)
+ intel_update_renderbuffers(driContext, drawable);
+ driContext->dri2.read_stamp = drawable->dri2.stamp;
+ }
+
+ /* If we're currently rendering to the front buffer, the rendering
+ * that will happen next will probably dirty the front buffer. So
+ * mark it as dirty here.
+ */
+ if (intel->is_front_buffer_rendering)
+ intel->front_buffer_dirty = true;
+
+ /* Wait for the swapbuffers before the one we just emitted, so we
+ * don't get too many swaps outstanding for apps that are GPU-heavy
+ * but not CPU-heavy.
+ *
+ * We're using intelDRI2Flush (called from the loader before
+ * swapbuffer) and glFlush (for front buffer rendering) as the
+ * indicator that a frame is done and then throttle when we get
+ * here as we prepare to render the next frame. At this point for
+ * round trips for swap/copy and getting new buffers are done and
+ * we'll spend less time waiting on the GPU.
+ *
+ * Unfortunately, we don't have a handle to the batch containing
+ * the swap, and getting our hands on that doesn't seem worth it,
+ * so we just us the first batch we emitted after the last swap.
+ */
+ if (intel->need_throttle && intel->first_post_swapbuffers_batch) {
+ drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
+ drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
+ intel->first_post_swapbuffers_batch = NULL;
+ intel->need_throttle = false;
+ }
+}
+
+static void
+intel_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ struct intel_context *intel = intel_context(ctx);
+ __DRIcontext *driContext = intel->driContext;
+
+ if (intel->saved_viewport)
+ intel->saved_viewport(ctx, x, y, w, h);
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ dri2InvalidateDrawable(driContext->driDrawablePriv);
+ dri2InvalidateDrawable(driContext->driReadablePriv);
+ }
+}
+
+static const struct dri_debug_control debug_control[] = {
+ { "tex", DEBUG_TEXTURE},
+ { "state", DEBUG_STATE},
+ { "ioctl", DEBUG_IOCTL},
+ { "blit", DEBUG_BLIT},
+ { "mip", DEBUG_MIPTREE},
+ { "fall", DEBUG_PERF},
+ { "perf", DEBUG_PERF},
+ { "verb", DEBUG_VERBOSE},
+ { "bat", DEBUG_BATCH},
+ { "pix", DEBUG_PIXEL},
+ { "buf", DEBUG_BUFMGR},
+ { "reg", DEBUG_REGION},
+ { "fbo", DEBUG_FBO},
+ { "gs", DEBUG_GS},
+ { "sync", DEBUG_SYNC},
+ { "prim", DEBUG_PRIMS },
+ { "vert", DEBUG_VERTS },
+ { "dri", DEBUG_DRI },
+ { "sf", DEBUG_SF },
+ { "san", DEBUG_SANITY },
+ { "sleep", DEBUG_SLEEP },
+ { "stats", DEBUG_STATS },
+ { "tile", DEBUG_TILE },
+ { "wm", DEBUG_WM },
+ { "urb", DEBUG_URB },
+ { "vs", DEBUG_VS },
+ { "clip", DEBUG_CLIP },
+ { "aub", DEBUG_AUB },
+ { NULL, 0 }
+};
+
+
+static void
+intelInvalidateState(struct gl_context * ctx, GLuint new_state)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ if (ctx->swrast_context)
+ _swrast_InvalidateState(ctx, new_state);
+ _vbo_InvalidateState(ctx, new_state);
+
+ intel->NewGLState |= new_state;
+
+ if (intel->vtbl.invalidate_state)
+ intel->vtbl.invalidate_state( intel, new_state );
+}
+
+void
+intel_flush_rendering_to_batch(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ if (intel->Fallback)
+ _swrast_flush(ctx);
+
+ if (intel->gen < 4)
+ INTEL_FIREVERTICES(intel);
+}
+
+void
+_intel_flush(struct gl_context *ctx, const char *file, int line)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_flush_rendering_to_batch(ctx);
+
+ if (intel->batch.used)
+ _intel_batchbuffer_flush(intel, file, line);
+}
+
+static void
+intel_glFlush(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_flush(ctx);
+ intel_flush_front(ctx);
+ if (intel->is_front_buffer_rendering)
+ intel->need_throttle = true;
+}
+
+void
+intelFinish(struct gl_context * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_flush(ctx);
+ intel_flush_front(ctx);
+
+ if (intel->batch.last_bo)
+ drm_intel_bo_wait_rendering(intel->batch.last_bo);
+}
+
+void
+intelInitDriverFunctions(struct dd_function_table *functions)
+{
+ _mesa_init_driver_functions(functions);
+
+ functions->Flush = intel_glFlush;
+ functions->Finish = intelFinish;
+ functions->GetString = intelGetString;
+ functions->UpdateState = intelInvalidateState;
+
+ intelInitTextureFuncs(functions);
+ intelInitTextureImageFuncs(functions);
+ intelInitTextureSubImageFuncs(functions);
+ intelInitTextureCopyImageFuncs(functions);
+ intelInitClearFuncs(functions);
+ intelInitBufferFuncs(functions);
+ intelInitPixelFuncs(functions);
+ intelInitBufferObjectFuncs(functions);
+ intel_init_syncobj_functions(functions);
+}
+
+bool
+intelInitContext(struct intel_context *intel,
+ int api,
+ const struct gl_config * mesaVis,
+ __DRIcontext * driContextPriv,
+ void *sharedContextPrivate,
+ struct dd_function_table *functions)
+{
+ struct gl_context *ctx = &intel->ctx;
+ struct gl_context *shareCtx = (struct gl_context *) sharedContextPrivate;
+ __DRIscreen *sPriv = driContextPriv->driScreenPriv;
+ struct intel_screen *intelScreen = sPriv->driverPrivate;
+ int bo_reuse_mode;
+ struct gl_config visual;
+
+ /* we can't do anything without a connection to the device */
+ if (intelScreen->bufmgr == NULL)
+ return false;
+
+ /* Can't rely on invalidate events, fall back to glViewport hack */
+ if (!driContextPriv->driScreenPriv->dri2.useInvalidate) {
+ intel->saved_viewport = functions->Viewport;
+ functions->Viewport = intel_viewport;
+ }
+
+ if (mesaVis == NULL) {
+ memset(&visual, 0, sizeof visual);
+ mesaVis = &visual;
+ }
+
+ if (!_mesa_initialize_context(&intel->ctx, api, mesaVis, shareCtx,
+ functions, (void *) intel)) {
+ printf("%s: failed to init mesa context\n", __FUNCTION__);
+ return false;
+ }
+
+ driContextPriv->driverPrivate = intel;
+ intel->intelScreen = intelScreen;
+ intel->driContext = driContextPriv;
+ intel->driFd = sPriv->fd;
+
+ intel->gen = intelScreen->gen;
+
+ const int devID = intelScreen->deviceID;
+ if (IS_SNB_GT1(devID) || IS_IVB_GT1(devID) || IS_HSW_GT1(devID))
+ intel->gt = 1;
+ else if (IS_SNB_GT2(devID) || IS_IVB_GT2(devID) || IS_HSW_GT2(devID))
+ intel->gt = 2;
+ else
+ intel->gt = 0;
+
+ if (IS_HASWELL(devID)) {
+ intel->is_haswell = true;
+ } else if (IS_G4X(devID)) {
+ intel->is_g4x = true;
+ } else if (IS_945(devID)) {
+ intel->is_945 = true;
+ }
+
+ if (intel->gen >= 5) {
+ intel->needs_ff_sync = true;
+ }
+
+ intel->has_separate_stencil = intel->intelScreen->hw_has_separate_stencil;
+ intel->must_use_separate_stencil = intel->intelScreen->hw_must_use_separate_stencil;
+ intel->has_hiz = intel->gen >= 6 && !intel->is_haswell;
+ intel->has_llc = intel->intelScreen->hw_has_llc;
+ intel->has_swizzling = intel->intelScreen->hw_has_swizzling;
+
+ memset(&ctx->TextureFormatSupported,
+ 0, sizeof(ctx->TextureFormatSupported));
+
+ driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
+ sPriv->myNum, (intel->gen >= 4) ? "i965" : "i915");
+ if (intel->gen < 4)
+ intel->maxBatchSize = 4096;
+ else
+ intel->maxBatchSize = sizeof(intel->batch.map);
+
+ intel->bufmgr = intelScreen->bufmgr;
+
+ bo_reuse_mode = driQueryOptioni(&intel->optionCache, "bo_reuse");
+ switch (bo_reuse_mode) {
+ case DRI_CONF_BO_REUSE_DISABLED:
+ break;
+ case DRI_CONF_BO_REUSE_ALL:
+ intel_bufmgr_gem_enable_reuse(intel->bufmgr);
+ break;
+ }
+
+ ctx->Const.MinLineWidth = 1.0;
+ ctx->Const.MinLineWidthAA = 1.0;
+ ctx->Const.MaxLineWidth = 5.0;
+ ctx->Const.MaxLineWidthAA = 5.0;
+ ctx->Const.LineWidthGranularity = 0.5;
+
+ ctx->Const.MinPointSize = 1.0;
+ ctx->Const.MinPointSizeAA = 1.0;
+ ctx->Const.MaxPointSize = 255.0;
+ ctx->Const.MaxPointSizeAA = 3.0;
+ ctx->Const.PointSizeGranularity = 1.0;
+
+ ctx->Const.MaxSamples = 1.0;
+
+ if (intel->gen >= 6)
+ ctx->Const.MaxClipPlanes = 8;
+
+ ctx->Const.StripTextureBorder = GL_TRUE;
+
+ /* reinitialize the context point state.
+ * It depend on constants in __struct gl_contextRec::Const
+ */
+ _mesa_init_point(ctx);
+
+ if (intel->gen >= 4) {
+ ctx->Const.MaxRenderbufferSize = 8192;
+ } else {
+ ctx->Const.MaxRenderbufferSize = 2048;
+ }
+
+ /* Initialize the software rasterizer and helper modules.
+ *
+ * As of GL 3.1 core, the gen4+ driver doesn't need the swrast context for
+ * software fallbacks (which we have to support on legacy GL to do weird
+ * glDrawPixels(), glBitmap(), and other functions).
+ */
+ if (intel->gen <= 3 || api != API_OPENGL_CORE) {
+ _swrast_CreateContext(ctx);
+ }
+
+ _vbo_CreateContext(ctx);
+ if (ctx->swrast_context) {
+ _tnl_CreateContext(ctx);
+ _swsetup_CreateContext(ctx);
+
+ /* Configure swrast to match hardware characteristics: */
+ _swrast_allow_pixel_fog(ctx, false);
+ _swrast_allow_vertex_fog(ctx, true);
+ }
+
+ _mesa_meta_init(ctx);
+
+ intel->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24;
+ intel->hw_stipple = 1;
+
+ /* XXX FBO: this doesn't seem to be used anywhere */
+ switch (mesaVis->depthBits) {
+ case 0: /* what to do in this case? */
+ case 16:
+ intel->polygon_offset_scale = 1.0;
+ break;
+ case 24:
+ intel->polygon_offset_scale = 2.0; /* req'd to pass glean */
+ break;
+ default:
+ assert(0);
+ break;
+ }
+
+ if (intel->gen >= 4)
+ intel->polygon_offset_scale /= 0xffff;
+
+ intel->RenderIndex = ~0;
+
+ intelInitExtensions(ctx);
+
+ INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control);
+ if (INTEL_DEBUG & DEBUG_BUFMGR)
+ dri_bufmgr_set_debug(intel->bufmgr, true);
+
+ if (INTEL_DEBUG & DEBUG_AUB)
+ drm_intel_bufmgr_gem_set_aub_dump(intel->bufmgr, true);
+
+ intel_batchbuffer_init(intel);
+
+ intel_fbo_init(intel);
+
+ intel->use_texture_tiling = driQueryOptionb(&intel->optionCache,
+ "texture_tiling");
+ intel->use_early_z = driQueryOptionb(&intel->optionCache, "early_z");
+
+ if (!driQueryOptionb(&intel->optionCache, "hiz")) {
+ intel->has_hiz = false;
+ /* On gen6, you can only do separate stencil with HIZ. */
+ if (intel->gen == 6)
+ intel->has_separate_stencil = false;
+ }
+
+ intel->prim.primitive = ~0;
+
+ /* Force all software fallbacks */
+#ifdef I915
+ if (driQueryOptionb(&intel->optionCache, "no_rast")) {
+ fprintf(stderr, "disabling 3D rasterization\n");
+ intel->no_rast = 1;
+ }
+#endif
+
+ if (driQueryOptionb(&intel->optionCache, "always_flush_batch")) {
+ fprintf(stderr, "flushing batchbuffer before/after each draw call\n");
+ intel->always_flush_batch = 1;
+ }
+
+ if (driQueryOptionb(&intel->optionCache, "always_flush_cache")) {
+ fprintf(stderr, "flushing GPU caches before/after each draw call\n");
+ intel->always_flush_cache = 1;
+ }
+
+ return true;
+}
+
+void
+intelDestroyContext(__DRIcontext * driContextPriv)
+{
+ struct intel_context *intel =
+ (struct intel_context *) driContextPriv->driverPrivate;
+ struct gl_context *ctx = &intel->ctx;
+
+ assert(intel); /* should never be null */
+ if (intel) {
+ INTEL_FIREVERTICES(intel);
+
+ /* Dump a final BMP in case the application doesn't call SwapBuffers */
+ if (INTEL_DEBUG & DEBUG_AUB) {
+ intel_batchbuffer_flush(intel);
+ aub_dump_bmp(&intel->ctx);
+ }
+
+ _mesa_meta_free(&intel->ctx);
+
+ intel->vtbl.destroy(intel);
+
+ if (ctx->swrast_context) {
+ _swsetup_DestroyContext(&intel->ctx);
+ _tnl_DestroyContext(&intel->ctx);
+ }
+ _vbo_DestroyContext(&intel->ctx);
+
+ if (ctx->swrast_context)
+ _swrast_DestroyContext(&intel->ctx);
+ intel->Fallback = 0x0; /* don't call _swrast_Flush later */
+
+ intel_batchbuffer_free(intel);
+
+ free(intel->prim.vb);
+ intel->prim.vb = NULL;
+ drm_intel_bo_unreference(intel->prim.vb_bo);
+ intel->prim.vb_bo = NULL;
+ drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
+ intel->first_post_swapbuffers_batch = NULL;
+
+ driDestroyOptionCache(&intel->optionCache);
+
+ /* free the Mesa context */
+ _mesa_free_context_data(&intel->ctx);
+
+ _math_matrix_dtr(&intel->ViewportMatrix);
+
+ ralloc_free(intel);
+ driContextPriv->driverPrivate = NULL;
+ }
+}
+
+GLboolean
+intelUnbindContext(__DRIcontext * driContextPriv)
+{
+ /* Unset current context and dispath table */
+ _mesa_make_current(NULL, NULL, NULL);
+
+ return true;
+}
+
+GLboolean
+intelMakeCurrent(__DRIcontext * driContextPriv,
+ __DRIdrawable * driDrawPriv,
+ __DRIdrawable * driReadPriv)
+{
+ struct intel_context *intel;
+ GET_CURRENT_CONTEXT(curCtx);
+
+ if (driContextPriv)
+ intel = (struct intel_context *) driContextPriv->driverPrivate;
+ else
+ intel = NULL;
+
+ /* According to the glXMakeCurrent() man page: "Pending commands to
+ * the previous context, if any, are flushed before it is released."
+ * But only flush if we're actually changing contexts.
+ */
+ if (intel_context(curCtx) && intel_context(curCtx) != intel) {
+ _mesa_flush(curCtx);
+ }
+
+ if (driContextPriv) {
+ struct gl_framebuffer *fb, *readFb;
+
+ if (driDrawPriv == NULL && driReadPriv == NULL) {
+ fb = _mesa_get_incomplete_framebuffer();
+ readFb = _mesa_get_incomplete_framebuffer();
+ } else {
+ fb = driDrawPriv->driverPrivate;
+ readFb = driReadPriv->driverPrivate;
+ driContextPriv->dri2.draw_stamp = driDrawPriv->dri2.stamp - 1;
+ driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1;
+ }
+
+ intel_prepare_render(intel);
+ _mesa_make_current(&intel->ctx, fb, readFb);
+
+ /* We do this in intel_prepare_render() too, but intel->ctx.DrawBuffer
+ * is NULL at that point. We can't call _mesa_makecurrent()
+ * first, since we need the buffer size for the initial
+ * viewport. So just call intel_draw_buffer() again here. */
+ intel_draw_buffer(&intel->ctx);
+ }
+ else {
+ _mesa_make_current(NULL, NULL, NULL);
+ }
+
+ return true;
+}
+
+/**
+ * \brief Query DRI2 to obtain a DRIdrawable's buffers.
+ *
+ * To determine which DRI buffers to request, examine the renderbuffers
+ * attached to the drawable's framebuffer. Then request the buffers with
+ * DRI2GetBuffers() or DRI2GetBuffersWithFormat().
+ *
+ * This is called from intel_update_renderbuffers().
+ *
+ * \param drawable Drawable whose buffers are queried.
+ * \param buffers [out] List of buffers returned by DRI2 query.
+ * \param buffer_count [out] Number of buffers returned.
+ *
+ * \see intel_update_renderbuffers()
+ * \see DRI2GetBuffers()
+ * \see DRI2GetBuffersWithFormat()
+ */
+static void
+intel_query_dri2_buffers(struct intel_context *intel,
+ __DRIdrawable *drawable,
+ __DRIbuffer **buffers,
+ int *buffer_count)
+{
+ __DRIscreen *screen = intel->intelScreen->driScrnPriv;
+ struct gl_framebuffer *fb = drawable->driverPrivate;
+ int i = 0;
+ const int max_attachments = 4;
+ unsigned *attachments = calloc(2 * max_attachments, sizeof(unsigned));
+
+ struct intel_renderbuffer *front_rb;
+ struct intel_renderbuffer *back_rb;
+
+ front_rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+ back_rb = intel_get_renderbuffer(fb, BUFFER_BACK_LEFT);
+
+ if ((intel->is_front_buffer_rendering ||
+ intel->is_front_buffer_reading ||
+ !back_rb) && front_rb) {
+ attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
+ attachments[i++] = intel_bits_per_pixel(front_rb);
+ }
+
+ if (back_rb) {
+ attachments[i++] = __DRI_BUFFER_BACK_LEFT;
+ attachments[i++] = intel_bits_per_pixel(back_rb);
+ }
+
+ assert(i <= 2 * max_attachments);
+
+ *buffers = screen->dri2.loader->getBuffersWithFormat(drawable,
+ &drawable->w,
+ &drawable->h,
+ attachments, i / 2,
+ buffer_count,
+ drawable->loaderPrivate);
+ free(attachments);
+}
+
+/**
+ * \brief Assign a DRI buffer's DRM region to a renderbuffer.
+ *
+ * This is called from intel_update_renderbuffers().
+ *
+ * \par Note:
+ * DRI buffers whose attachment point is DRI2BufferStencil or
+ * DRI2BufferDepthStencil are handled as special cases.
+ *
+ * \param buffer_name is a human readable name, such as "dri2 front buffer",
+ * that is passed to intel_region_alloc_for_handle().
+ *
+ * \see intel_update_renderbuffers()
+ * \see intel_region_alloc_for_handle()
+ */
+static void
+intel_process_dri2_buffer(struct intel_context *intel,
+ __DRIdrawable *drawable,
+ __DRIbuffer *buffer,
+ struct intel_renderbuffer *rb,
+ const char *buffer_name)
+{
+ struct intel_region *region = NULL;
+
+ if (!rb)
+ return;
+
+ unsigned num_samples = rb->Base.Base.NumSamples;
+
+ /* We try to avoid closing and reopening the same BO name, because the first
+ * use of a mapping of the buffer involves a bunch of page faulting which is
+ * moderately expensive.
+ */
+ if (num_samples == 0) {
+ if (rb->mt &&
+ rb->mt->region &&
+ rb->mt->region->name == buffer->name)
+ return;
+ } else {
+ if (rb->mt &&
+ rb->mt->singlesample_mt &&
+ rb->mt->singlesample_mt->region &&
+ rb->mt->singlesample_mt->region->name == buffer->name)
+ return;
+ }
+
+ if (unlikely(INTEL_DEBUG & DEBUG_DRI)) {
+ fprintf(stderr,
+ "attaching buffer %d, at %d, cpp %d, pitch %d\n",
+ buffer->name, buffer->attachment,
+ buffer->cpp, buffer->pitch);
+ }
+
+ intel_miptree_release(&rb->mt);
+ region = intel_region_alloc_for_handle(intel->intelScreen,
+ buffer->cpp,
+ drawable->w,
+ drawable->h,
+ buffer->pitch / buffer->cpp,
+ buffer->name,
+ buffer_name);
+ if (!region)
+ return;
+
+ rb->mt = intel_miptree_create_for_dri2_buffer(intel,
+ buffer->attachment,
+ intel_rb_format(rb),
+ num_samples,
+ region);
+ intel_region_release(&region);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_extensions.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_extensions.c
index a2f3e8cd208..885e8a43e80 120000..100755
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_extensions.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_extensions.c
@@ -1 +1,197 @@
-../intel/intel_extensions.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/mfeatures.h"
+#include "main/version.h"
+
+#include "intel_chipset.h"
+#include "intel_context.h"
+#include "intel_extensions.h"
+#include "intel_reg.h"
+#include "utils.h"
+
+/**
+ * Initializes potential list of extensions if ctx == NULL, or actually enables
+ * extensions for a context.
+ */
+void
+intelInitExtensions(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ ctx->Extensions.ARB_draw_elements_base_vertex = true;
+ ctx->Extensions.ARB_explicit_attrib_location = true;
+ if (_mesa_is_desktop_gl(ctx))
+ ctx->Extensions.ARB_framebuffer_object = true;
+ ctx->Extensions.ARB_half_float_pixel = true;
+ ctx->Extensions.ARB_map_buffer_range = true;
+ ctx->Extensions.ARB_point_sprite = true;
+ ctx->Extensions.ARB_shader_objects = true;
+ ctx->Extensions.ARB_shading_language_100 = true;
+ ctx->Extensions.ARB_sync = true;
+ ctx->Extensions.ARB_texture_border_clamp = true;
+ ctx->Extensions.ARB_texture_cube_map = true;
+ ctx->Extensions.ARB_texture_env_combine = true;
+ ctx->Extensions.ARB_texture_env_crossbar = true;
+ ctx->Extensions.ARB_texture_env_dot3 = true;
+ ctx->Extensions.ARB_texture_storage = true;
+ ctx->Extensions.ARB_vertex_program = true;
+ ctx->Extensions.ARB_vertex_shader = true;
+ ctx->Extensions.EXT_blend_color = true;
+ ctx->Extensions.EXT_blend_equation_separate = true;
+ ctx->Extensions.EXT_blend_func_separate = true;
+ ctx->Extensions.EXT_blend_minmax = true;
+ ctx->Extensions.EXT_framebuffer_blit = true;
+ ctx->Extensions.EXT_framebuffer_object = true;
+ ctx->Extensions.EXT_framebuffer_multisample = true;
+ ctx->Extensions.EXT_fog_coord = true;
+ ctx->Extensions.EXT_gpu_program_parameters = true;
+ ctx->Extensions.EXT_packed_depth_stencil = true;
+ ctx->Extensions.EXT_pixel_buffer_object = true;
+ ctx->Extensions.EXT_point_parameters = true;
+ ctx->Extensions.EXT_provoking_vertex = true;
+ ctx->Extensions.EXT_secondary_color = true;
+ ctx->Extensions.EXT_separate_shader_objects = true;
+ ctx->Extensions.EXT_texture_env_dot3 = true;
+ ctx->Extensions.EXT_texture_filter_anisotropic = true;
+ ctx->Extensions.APPLE_object_purgeable = true;
+ ctx->Extensions.MESA_pack_invert = true;
+ ctx->Extensions.MESA_ycbcr_texture = true;
+ ctx->Extensions.NV_blend_square = true;
+ ctx->Extensions.NV_texture_rectangle = true;
+ ctx->Extensions.NV_vertex_program = true;
+ ctx->Extensions.NV_vertex_program1_1 = true;
+ ctx->Extensions.TDFX_texture_compression_FXT1 = true;
+#if FEATURE_OES_EGL_image
+ ctx->Extensions.OES_EGL_image = true;
+#endif
+ ctx->Extensions.OES_draw_texture = true;
+ ctx->Extensions.OES_compressed_ETC1_RGB8_texture = true;
+ ctx->Extensions.ARB_texture_rgb10_a2ui = true;
+
+ if (intel->gen >= 6)
+ if (ctx->API == API_OPENGL_CORE) {
+ ctx->Const.GLSLVersion = 140;
+ } else {
+ ctx->Const.GLSLVersion = 130;
+ }
+ else
+ ctx->Const.GLSLVersion = 120;
+ _mesa_override_glsl_version(ctx);
+
+ if (intel->gen == 6 ||
+ (intel->gen == 7 && intel->intelScreen->kernel_has_gen7_sol_reset))
+ ctx->Extensions.EXT_transform_feedback = true;
+
+ if (intel->gen >= 6) {
+ ctx->Extensions.ARB_blend_func_extended = !driQueryOptionb(&intel->optionCache, "disable_blend_func_extended");
+ ctx->Extensions.ARB_draw_buffers_blend = true;
+ ctx->Extensions.ARB_uniform_buffer_object = true;
+
+ if (ctx->API == API_OPENGL_CORE) {
+ ctx->Extensions.ARB_texture_buffer_object = true;
+ }
+ }
+
+ if (intel->gen >= 5)
+ ctx->Extensions.EXT_timer_query = true;
+
+ if (intel->gen >= 6) {
+ uint64_t dummy;
+ /* Test if the kernel has the ioctl. */
+ if (drm_intel_reg_read(intel->bufmgr, TIMESTAMP, &dummy) == 0)
+ ctx->Extensions.ARB_timer_query = true;
+ }
+
+ if (intel->gen >= 4) {
+ ctx->Extensions.ARB_color_buffer_float = true;
+ ctx->Extensions.ARB_depth_buffer_float = true;
+ ctx->Extensions.ARB_depth_clamp = true;
+ ctx->Extensions.ARB_draw_instanced = true;
+ ctx->Extensions.ARB_instanced_arrays = true;
+ ctx->Extensions.ARB_fragment_coord_conventions = true;
+ ctx->Extensions.ARB_fragment_program_shadow = true;
+ ctx->Extensions.ARB_fragment_shader = true;
+ ctx->Extensions.ARB_half_float_vertex = true;
+ ctx->Extensions.ARB_occlusion_query = true;
+ ctx->Extensions.ARB_occlusion_query2 = true;
+ ctx->Extensions.ARB_point_sprite = true;
+ ctx->Extensions.ARB_seamless_cube_map = true;
+ ctx->Extensions.ARB_shader_bit_encoding = true;
+ ctx->Extensions.ARB_shader_texture_lod = true;
+#ifdef TEXTURE_FLOAT_ENABLED
+ ctx->Extensions.ARB_texture_float = true;
+ ctx->Extensions.EXT_texture_shared_exponent = true;
+ ctx->Extensions.EXT_packed_float = true;
+#endif
+ ctx->Extensions.ARB_texture_compression_rgtc = true;
+ ctx->Extensions.ARB_texture_rg = true;
+ ctx->Extensions.EXT_draw_buffers2 = true;
+ ctx->Extensions.EXT_framebuffer_sRGB = true;
+ ctx->Extensions.EXT_texture_array = true;
+ ctx->Extensions.EXT_texture_integer = true;
+ ctx->Extensions.EXT_texture_snorm = true;
+ ctx->Extensions.EXT_texture_sRGB = true;
+ ctx->Extensions.EXT_texture_sRGB_decode = true;
+ ctx->Extensions.EXT_texture_swizzle = true;
+ ctx->Extensions.EXT_vertex_array_bgra = true;
+ ctx->Extensions.ATI_envmap_bumpmap = true;
+ ctx->Extensions.MESA_texture_array = true;
+ ctx->Extensions.NV_conditional_render = true;
+ }
+
+ if (intel->gen >= 3) {
+ ctx->Extensions.ARB_ES2_compatibility = true;
+ ctx->Extensions.ARB_depth_texture = true;
+ ctx->Extensions.ARB_fragment_program = true;
+ ctx->Extensions.ARB_shadow = true;
+ ctx->Extensions.ARB_texture_non_power_of_two = true;
+ ctx->Extensions.EXT_shadow_funcs = true;
+ ctx->Extensions.EXT_stencil_two_side = true;
+ ctx->Extensions.ATI_separate_stencil = true;
+ ctx->Extensions.ATI_texture_env_combine3 = true;
+ ctx->Extensions.NV_texture_env_combine4 = true;
+
+ if (driQueryOptionb(&intel->optionCache, "fragment_shader"))
+ ctx->Extensions.ARB_fragment_shader = true;
+
+ if (driQueryOptionb(&intel->optionCache, "stub_occlusion_query"))
+ ctx->Extensions.ARB_occlusion_query = true;
+ }
+
+ if (intel->ctx.Mesa_DXTn) {
+ ctx->Extensions.EXT_texture_compression_s3tc = true;
+ ctx->Extensions.S3_s3tc = true;
+ }
+ else if (driQueryOptionb(&intel->optionCache, "force_s3tc_enable")) {
+ ctx->Extensions.EXT_texture_compression_s3tc = true;
+ }
+
+ if (intel->gen >= 4) {
+ ctx->Extensions.NV_primitive_restart = true;
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_fbo.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_fbo.c
index a19f86dcc57..65494a2d506 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -1 +1,964 @@
-../intel/intel_fbo.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/enums.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/context.h"
+#include "main/teximage.h"
+#include "main/image.h"
+
+#include "swrast/swrast.h"
+#include "drivers/common/meta.h"
+
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_buffers.h"
+#include "intel_blit.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_tex.h"
+#include "intel_span.h"
+#ifndef I915
+#include "brw_context.h"
+#endif
+
+#define FILE_DEBUG_FLAG DEBUG_FBO
+
+static struct gl_renderbuffer *
+intel_new_renderbuffer(struct gl_context * ctx, GLuint name);
+
+struct intel_region*
+intel_get_rb_region(struct gl_framebuffer *fb, GLuint attIndex)
+{
+ struct intel_renderbuffer *irb = intel_get_renderbuffer(fb, attIndex);
+ if (irb && irb->mt) {
+ if (attIndex == BUFFER_STENCIL && irb->mt->stencil_mt)
+ return irb->mt->stencil_mt->region;
+ else
+ return irb->mt->region;
+ } else
+ return NULL;
+}
+
+/**
+ * Create a new framebuffer object.
+ */
+static struct gl_framebuffer *
+intel_new_framebuffer(struct gl_context * ctx, GLuint name)
+{
+ /* Only drawable state in intel_framebuffer at this time, just use Mesa's
+ * class
+ */
+ return _mesa_new_framebuffer(ctx, name);
+}
+
+
+/** Called by gl_renderbuffer::Delete() */
+static void
+intel_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
+{
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+
+ ASSERT(irb);
+
+ intel_miptree_release(&irb->mt);
+
+ _mesa_delete_renderbuffer(ctx, rb);
+}
+
+/**
+ * \see dd_function_table::MapRenderbuffer
+ */
+static void
+intel_map_renderbuffer(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **out_map,
+ GLint *out_stride)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct swrast_renderbuffer *srb = (struct swrast_renderbuffer *)rb;
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+ void *map;
+ int stride;
+
+ if (srb->Buffer) {
+ /* this is a malloc'd renderbuffer (accum buffer), not an irb */
+ GLint bpp = _mesa_get_format_bytes(rb->Format);
+ GLint rowStride = srb->RowStride;
+ *out_map = (GLubyte *) srb->Buffer + y * rowStride + x * bpp;
+ *out_stride = rowStride;
+ return;
+ }
+
+ /* We sometimes get called with this by our intel_span.c usage. */
+ if (!irb->mt) {
+ *out_map = NULL;
+ *out_stride = 0;
+ return;
+ }
+
+ /* For a window-system renderbuffer, we need to flip the mapping we receive
+ * upside-down. So we need to ask for a rectangle on flipped vertically, and
+ * we then return a pointer to the bottom of it with a negative stride.
+ */
+ if (rb->Name == 0) {
+ y = rb->Height - y - h;
+ }
+
+ intel_miptree_map(intel, irb->mt, irb->mt_level, irb->mt_layer,
+ x, y, w, h, mode, &map, &stride);
+
+ if (rb->Name == 0) {
+ map += (h - 1) * stride;
+ stride = -stride;
+ }
+
+ DBG("%s: rb %d (%s) mt mapped: (%d, %d) (%dx%d) -> %p/%d\n",
+ __FUNCTION__, rb->Name, _mesa_get_format_name(rb->Format),
+ x, y, w, h, map, stride);
+
+ *out_map = map;
+ *out_stride = stride;
+}
+
+/**
+ * \see dd_function_table::UnmapRenderbuffer
+ */
+static void
+intel_unmap_renderbuffer(struct gl_context *ctx,
+ struct gl_renderbuffer *rb)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct swrast_renderbuffer *srb = (struct swrast_renderbuffer *)rb;
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+
+ DBG("%s: rb %d (%s)\n", __FUNCTION__,
+ rb->Name, _mesa_get_format_name(rb->Format));
+
+ if (srb->Buffer) {
+ /* this is a malloc'd renderbuffer (accum buffer) */
+ /* nothing to do */
+ return;
+ }
+
+ intel_miptree_unmap(intel, irb->mt, irb->mt_level, irb->mt_layer);
+}
+
+
+/**
+ * Round up the requested multisample count to the next supported sample size.
+ */
+unsigned
+intel_quantize_num_samples(struct intel_screen *intel, unsigned num_samples)
+{
+ switch (intel->gen) {
+ case 6:
+ /* Gen6 supports only 4x multisampling. */
+ if (num_samples > 0)
+ return 4;
+ else
+ return 0;
+ case 7:
+ /* Gen7 supports 4x and 8x multisampling. */
+ if (num_samples > 4)
+ return 8;
+ else if (num_samples > 0)
+ return 4;
+ else
+ return 0;
+ return 0;
+ default:
+ /* MSAA unsupported. However, a careful reading of
+ * EXT_framebuffer_multisample reveals that we need to permit
+ * num_samples to be 1 (since num_samples is permitted to be as high as
+ * GL_MAX_SAMPLES, and GL_MAX_SAMPLES must be at least 1). Since
+ * platforms before Gen6 don't support MSAA, this is safe, because
+ * multisampling won't happen anyhow.
+ */
+ if (num_samples > 0)
+ return 1;
+ return 0;
+ }
+}
+
+
+/**
+ * Called via glRenderbufferStorageEXT() to set the format and allocate
+ * storage for a user-created renderbuffer.
+ */
+GLboolean
+intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width, GLuint height)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_screen *screen = intel->intelScreen;
+ struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+ rb->NumSamples = intel_quantize_num_samples(screen, rb->NumSamples);
+
+ switch (internalFormat) {
+ default:
+ /* Use the same format-choice logic as for textures.
+ * Renderbuffers aren't any different from textures for us,
+ * except they're less useful because you can't texture with
+ * them.
+ */
+ rb->Format = intel->ctx.Driver.ChooseTextureFormat(ctx, GL_TEXTURE_2D,
+ internalFormat,
+ GL_NONE, GL_NONE);
+ break;
+ case GL_STENCIL_INDEX:
+ case GL_STENCIL_INDEX1_EXT:
+ case GL_STENCIL_INDEX4_EXT:
+ case GL_STENCIL_INDEX8_EXT:
+ case GL_STENCIL_INDEX16_EXT:
+ /* These aren't actual texture formats, so force them here. */
+ if (intel->has_separate_stencil) {
+ rb->Format = MESA_FORMAT_S8;
+ } else {
+ assert(!intel->must_use_separate_stencil);
+ rb->Format = MESA_FORMAT_S8_Z24;
+ }
+ break;
+ }
+
+ rb->Width = width;
+ rb->Height = height;
+ rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
+
+ intel_miptree_release(&irb->mt);
+
+ DBG("%s: %s: %s (%dx%d)\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(internalFormat),
+ _mesa_get_format_name(rb->Format), width, height);
+
+ if (width == 0 || height == 0)
+ return true;
+
+ irb->mt = intel_miptree_create_for_renderbuffer(intel, rb->Format,
+ width, height,
+ rb->NumSamples);
+ if (!irb->mt)
+ return false;
+
+ return true;
+}
+
+
+#if FEATURE_OES_EGL_image
+static void
+intel_image_target_renderbuffer_storage(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ void *image_handle)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_renderbuffer *irb;
+ __DRIscreen *screen;
+ __DRIimage *image;
+
+ screen = intel->intelScreen->driScrnPriv;
+ image = screen->dri2.image->lookupEGLImage(screen, image_handle,
+ screen->loaderPrivate);
+ if (image == NULL)
+ return;
+
+ /* __DRIimage is opaque to the core so it has to be checked here */
+ switch (image->format) {
+ case MESA_FORMAT_RGBA8888_REV:
+ _mesa_error(&intel->ctx, GL_INVALID_OPERATION,
+ "glEGLImageTargetRenderbufferStorage(unsupported image format");
+ return;
+ break;
+ default:
+ break;
+ }
+
+ irb = intel_renderbuffer(rb);
+ intel_miptree_release(&irb->mt);
+ irb->mt = intel_miptree_create_for_region(intel,
+ GL_TEXTURE_2D,
+ image->format,
+ image->region);
+ if (!irb->mt)
+ return;
+
+ rb->InternalFormat = image->internal_format;
+ rb->Width = image->region->width;
+ rb->Height = image->region->height;
+ rb->Format = image->format;
+ rb->_BaseFormat = _mesa_base_fbo_format(&intel->ctx,
+ image->internal_format);
+}
+#endif
+
+/**
+ * Called for each hardware renderbuffer when a _window_ is resized.
+ * Just update fields.
+ * Not used for user-created renderbuffers!
+ */
+static GLboolean
+intel_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ ASSERT(rb->Name == 0);
+ rb->Width = width;
+ rb->Height = height;
+ rb->InternalFormat = internalFormat;
+
+ return true;
+}
+
+
+static void
+intel_resize_buffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint width, GLuint height)
+{
+ int i;
+
+ _mesa_resize_framebuffer(ctx, fb, width, height);
+
+ fb->Initialized = true; /* XXX remove someday */
+
+ if (_mesa_is_user_fbo(fb)) {
+ return;
+ }
+
+
+ /* Make sure all window system renderbuffers are up to date */
+ for (i = BUFFER_FRONT_LEFT; i <= BUFFER_BACK_RIGHT; i++) {
+ struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
+
+ /* only resize if size is changing */
+ if (rb && (rb->Width != width || rb->Height != height)) {
+ rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height);
+ }
+ }
+}
+
+
+/** Dummy function for gl_renderbuffer::AllocStorage() */
+static GLboolean
+intel_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ _mesa_problem(ctx, "intel_op_alloc_storage should never be called.");
+ return false;
+}
+
+/**
+ * Create a new intel_renderbuffer which corresponds to an on-screen window,
+ * not a user-created renderbuffer.
+ *
+ * \param num_samples must be quantized.
+ */
+struct intel_renderbuffer *
+intel_create_renderbuffer(gl_format format, unsigned num_samples)
+{
+ struct intel_renderbuffer *irb;
+ struct gl_renderbuffer *rb;
+
+ GET_CURRENT_CONTEXT(ctx);
+
+ irb = CALLOC_STRUCT(intel_renderbuffer);
+ if (!irb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer");
+ return NULL;
+ }
+
+ rb = &irb->Base.Base;
+
+ _mesa_init_renderbuffer(rb, 0);
+ rb->ClassID = INTEL_RB_CLASS;
+ rb->_BaseFormat = _mesa_get_format_base_format(format);
+ rb->Format = format;
+ rb->InternalFormat = rb->_BaseFormat;
+ rb->NumSamples = num_samples;
+
+ /* intel-specific methods */
+ rb->Delete = intel_delete_renderbuffer;
+ rb->AllocStorage = intel_alloc_window_storage;
+
+ return irb;
+}
+
+/**
+ * Private window-system buffers (as opposed to ones shared with the display
+ * server created with intel_create_renderbuffer()) are most similar in their
+ * handling to user-created renderbuffers, but they have a resize handler that
+ * may be called at intel_update_renderbuffers() time.
+ *
+ * \param num_samples must be quantized.
+ */
+struct intel_renderbuffer *
+intel_create_private_renderbuffer(gl_format format, unsigned num_samples)
+{
+ struct intel_renderbuffer *irb;
+
+ irb = intel_create_renderbuffer(format, num_samples);
+ irb->Base.Base.AllocStorage = intel_alloc_renderbuffer_storage;
+
+ return irb;
+}
+
+/**
+ * Create a new renderbuffer object.
+ * Typically called via glBindRenderbufferEXT().
+ */
+static struct gl_renderbuffer *
+intel_new_renderbuffer(struct gl_context * ctx, GLuint name)
+{
+ /*struct intel_context *intel = intel_context(ctx); */
+ struct intel_renderbuffer *irb;
+ struct gl_renderbuffer *rb;
+
+ irb = CALLOC_STRUCT(intel_renderbuffer);
+ if (!irb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "creating renderbuffer");
+ return NULL;
+ }
+
+ rb = &irb->Base.Base;
+
+ _mesa_init_renderbuffer(rb, name);
+ rb->ClassID = INTEL_RB_CLASS;
+
+ /* intel-specific methods */
+ rb->Delete = intel_delete_renderbuffer;
+ rb->AllocStorage = intel_alloc_renderbuffer_storage;
+ /* span routines set in alloc_storage function */
+
+ return rb;
+}
+
+
+/**
+ * Called via glBindFramebufferEXT().
+ */
+static void
+intel_bind_framebuffer(struct gl_context * ctx, GLenum target,
+ struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
+{
+ if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
+ intel_draw_buffer(ctx);
+ }
+ else {
+ /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */
+ }
+}
+
+
+/**
+ * Called via glFramebufferRenderbufferEXT().
+ */
+static void
+intel_framebuffer_renderbuffer(struct gl_context * ctx,
+ struct gl_framebuffer *fb,
+ GLenum attachment, struct gl_renderbuffer *rb)
+{
+ DBG("Intel FramebufferRenderbuffer %u %u\n", fb->Name, rb ? rb->Name : 0);
+
+ _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
+ intel_draw_buffer(ctx);
+}
+
+/**
+ * \par Special case for separate stencil
+ *
+ * When wrapping a depthstencil texture that uses separate stencil, this
+ * function is recursively called twice: once to create \c
+ * irb->wrapped_depth and again to create \c irb->wrapped_stencil. On the
+ * call to create \c irb->wrapped_depth, the \c format and \c
+ * internal_format parameters do not match \c mt->format. In that case, \c
+ * mt->format is MESA_FORMAT_S8_Z24 and \c format is \c
+ * MESA_FORMAT_X8_Z24.
+ *
+ * @return true on success
+ */
+
+static bool
+intel_renderbuffer_update_wrapper(struct intel_context *intel,
+ struct intel_renderbuffer *irb,
+ struct gl_texture_image *image,
+ uint32_t layer)
+{
+ struct gl_renderbuffer *rb = &irb->Base.Base;
+ struct intel_texture_image *intel_image = intel_texture_image(image);
+ struct intel_mipmap_tree *mt = intel_image->mt;
+ int level = image->Level;
+
+ rb->Format = image->TexFormat;
+ rb->InternalFormat = image->InternalFormat;
+ rb->_BaseFormat = image->_BaseFormat;
+ rb->Width = mt->level[level].width;
+ rb->Height = mt->level[level].height;
+
+ rb->Delete = intel_delete_renderbuffer;
+ rb->AllocStorage = intel_nop_alloc_storage;
+
+ intel_miptree_check_level_layer(mt, level, layer);
+ irb->mt_level = level;
+ irb->mt_layer = layer;
+
+ intel_miptree_reference(&irb->mt, mt);
+
+ intel_renderbuffer_set_draw_offset(irb);
+
+ if (mt->hiz_mt == NULL &&
+ intel->vtbl.is_hiz_depth_format(intel, rb->Format)) {
+ intel_miptree_alloc_hiz(intel, mt, 0 /* num_samples */);
+ if (!mt->hiz_mt)
+ return false;
+ }
+
+ return true;
+}
+
+void
+intel_renderbuffer_set_draw_offset(struct intel_renderbuffer *irb)
+{
+ unsigned int dst_x, dst_y;
+
+ /* compute offset of the particular 2D image within the texture region */
+ intel_miptree_get_image_offset(irb->mt,
+ irb->mt_level,
+ 0, /* face, which we ignore */
+ irb->mt_layer,
+ &dst_x, &dst_y);
+
+ irb->draw_x = dst_x;
+ irb->draw_y = dst_y;
+}
+
+/**
+ * Rendering to tiled buffers requires that the base address of the
+ * buffer be aligned to a page boundary. We generally render to
+ * textures by pointing the surface at the mipmap image level, which
+ * may not be aligned to a tile boundary.
+ *
+ * This function returns an appropriately-aligned base offset
+ * according to the tiling restrictions, plus any required x/y offset
+ * from there.
+ */
+uint32_t
+intel_renderbuffer_tile_offsets(struct intel_renderbuffer *irb,
+ uint32_t *tile_x,
+ uint32_t *tile_y)
+{
+ struct intel_region *region = irb->mt->region;
+ uint32_t mask_x, mask_y;
+
+ intel_region_get_tile_masks(region, &mask_x, &mask_y, false);
+
+ *tile_x = irb->draw_x & mask_x;
+ *tile_y = irb->draw_y & mask_y;
+ return intel_region_get_aligned_offset(region, irb->draw_x & ~mask_x,
+ irb->draw_y & ~mask_y, false);
+}
+
+/**
+ * Called by glFramebufferTexture[123]DEXT() (and other places) to
+ * prepare for rendering into texture memory. This might be called
+ * many times to choose different texture levels, cube faces, etc
+ * before intel_finish_render_texture() is ever called.
+ */
+static void
+intel_render_texture(struct gl_context * ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct gl_texture_image *image = _mesa_get_attachment_teximage(att);
+ struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
+ struct intel_texture_image *intel_image = intel_texture_image(image);
+ struct intel_mipmap_tree *mt = intel_image->mt;
+ int layer;
+
+ (void) fb;
+
+ if (att->CubeMapFace > 0) {
+ assert(att->Zoffset == 0);
+ layer = att->CubeMapFace;
+ } else {
+ layer = att->Zoffset;
+ }
+
+ if (!intel_image->mt) {
+ /* Fallback on drawing to a texture that doesn't have a miptree
+ * (has a border, width/height 0, etc.)
+ */
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+ else if (!irb) {
+ intel_miptree_check_level_layer(mt, att->TextureLevel, layer);
+
+ irb = (struct intel_renderbuffer *)intel_new_renderbuffer(ctx, ~0);
+
+ if (irb) {
+ /* bind the wrapper to the attachment point */
+ _mesa_reference_renderbuffer(&att->Renderbuffer, &irb->Base.Base);
+ }
+ else {
+ /* fallback to software rendering */
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+ }
+
+ if (!intel_renderbuffer_update_wrapper(intel, irb, image, layer)) {
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+
+ irb->tex_image = image;
+
+ DBG("Begin render %s texture tex=%u w=%d h=%d refcount=%d\n",
+ _mesa_get_format_name(image->TexFormat),
+ att->Texture->Name, image->Width, image->Height,
+ irb->Base.Base.RefCount);
+
+ /* update drawing region, etc */
+ intel_draw_buffer(ctx);
+}
+
+
+/**
+ * Called by Mesa when rendering to a texture is done.
+ */
+static void
+intel_finish_render_texture(struct gl_context * ctx,
+ struct gl_renderbuffer_attachment *att)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct gl_texture_object *tex_obj = att->Texture;
+ struct gl_texture_image *image =
+ tex_obj->Image[att->CubeMapFace][att->TextureLevel];
+ struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer);
+
+ DBG("Finish render %s texture tex=%u\n",
+ _mesa_get_format_name(image->TexFormat), att->Texture->Name);
+
+ if (irb)
+ irb->tex_image = NULL;
+
+ /* Since we've (probably) rendered to the texture and will (likely) use
+ * it in the texture domain later on in this batchbuffer, flush the
+ * batch. Once again, we wish for a domain tracker in libdrm to cover
+ * usage inside of a batchbuffer like GEM does in the kernel.
+ */
+ intel_batchbuffer_emit_mi_flush(intel);
+}
+
+/**
+ * Do additional "completeness" testing of a framebuffer object.
+ */
+static void
+intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ struct intel_context *intel = intel_context(ctx);
+ const struct intel_renderbuffer *depthRb =
+ intel_get_renderbuffer(fb, BUFFER_DEPTH);
+ const struct intel_renderbuffer *stencilRb =
+ intel_get_renderbuffer(fb, BUFFER_STENCIL);
+ struct intel_mipmap_tree *depth_mt = NULL, *stencil_mt = NULL;
+ int i;
+
+ DBG("%s() on fb %p (%s)\n", __FUNCTION__,
+ fb, (fb == ctx->DrawBuffer ? "drawbuffer" :
+ (fb == ctx->ReadBuffer ? "readbuffer" : "other buffer")));
+
+ if (depthRb)
+ depth_mt = depthRb->mt;
+ if (stencilRb) {
+ stencil_mt = stencilRb->mt;
+ if (stencil_mt->stencil_mt)
+ stencil_mt = stencil_mt->stencil_mt;
+ }
+
+ if (depth_mt && stencil_mt) {
+ if (depth_mt == stencil_mt) {
+ /* For true packed depth/stencil (not faked on prefers-separate-stencil
+ * hardware) we need to be sure they're the same level/layer, since
+ * we'll be emitting a single packet describing the packed setup.
+ */
+ if (depthRb->mt_level != stencilRb->mt_level ||
+ depthRb->mt_layer != stencilRb->mt_layer) {
+ DBG("depth image level/layer %d/%d != stencil image %d/%d\n",
+ depthRb->mt_level,
+ depthRb->mt_layer,
+ stencilRb->mt_level,
+ stencilRb->mt_layer);
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+ } else {
+ if (!intel->has_separate_stencil) {
+ DBG("separate stencil unsupported\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+ if (stencil_mt->format != MESA_FORMAT_S8) {
+ DBG("separate stencil is %s instead of S8\n",
+ _mesa_get_format_name(stencil_mt->format));
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+ if (intel->gen < 7 && depth_mt->hiz_mt == NULL) {
+ /* Before Gen7, separate depth and stencil buffers can be used
+ * only if HiZ is enabled. From the Sandybridge PRM, Volume 2,
+ * Part 1, Bit 3DSTATE_DEPTH_BUFFER.SeparateStencilBufferEnable:
+ * [DevSNB]: This field must be set to the same value (enabled
+ * or disabled) as Hierarchical Depth Buffer Enable.
+ */
+ DBG("separate stencil without HiZ\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;
+ }
+ }
+ }
+
+ for (i = 0; i < Elements(fb->Attachment); i++) {
+ struct gl_renderbuffer *rb;
+ struct intel_renderbuffer *irb;
+
+ if (fb->Attachment[i].Type == GL_NONE)
+ continue;
+
+ /* A supported attachment will have a Renderbuffer set either
+ * from being a Renderbuffer or being a texture that got the
+ * intel_wrap_texture() treatment.
+ */
+ rb = fb->Attachment[i].Renderbuffer;
+ if (rb == NULL) {
+ DBG("attachment without renderbuffer\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ continue;
+ }
+
+ if (fb->Attachment[i].Type == GL_TEXTURE) {
+ const struct gl_texture_image *img =
+ _mesa_get_attachment_teximage_const(&fb->Attachment[i]);
+
+ if (img->Border) {
+ DBG("texture with border\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ continue;
+ }
+ }
+
+ irb = intel_renderbuffer(rb);
+ if (irb == NULL) {
+ DBG("software rendering renderbuffer\n");
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ continue;
+ }
+
+ if (!intel->vtbl.render_target_supported(intel, rb)) {
+ DBG("Unsupported HW texture/renderbuffer format attached: %s\n",
+ _mesa_get_format_name(intel_rb_format(irb)));
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ }
+ }
+}
+
+/**
+ * Try to do a glBlitFramebuffer using glCopyTexSubImage2D
+ * We can do this when the dst renderbuffer is actually a texture and
+ * there is no scaling, mirroring or scissoring.
+ *
+ * \return new buffer mask indicating the buffers left to blit using the
+ * normal path.
+ */
+static GLbitfield
+intel_blit_framebuffer_copy_tex_sub_image(struct gl_context *ctx,
+ GLint srcX0, GLint srcY0,
+ GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0,
+ GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ if (mask & GL_COLOR_BUFFER_BIT) {
+ const struct gl_framebuffer *drawFb = ctx->DrawBuffer;
+ const struct gl_framebuffer *readFb = ctx->ReadBuffer;
+ const struct gl_renderbuffer_attachment *drawAtt =
+ &drawFb->Attachment[drawFb->_ColorDrawBufferIndexes[0]];
+ struct intel_renderbuffer *srcRb =
+ intel_renderbuffer(readFb->_ColorReadBuffer);
+
+ /* If the source and destination are the same size with no
+ mirroring, the rectangles are within the size of the
+ texture and there is no scissor then we can use
+ glCopyTexSubimage2D to implement the blit. This will end
+ up as a fast hardware blit on some drivers */
+ if (srcRb && drawAtt && drawAtt->Texture &&
+ srcX0 - srcX1 == dstX0 - dstX1 &&
+ srcY0 - srcY1 == dstY0 - dstY1 &&
+ srcX1 >= srcX0 &&
+ srcY1 >= srcY0 &&
+ srcX0 >= 0 && srcX1 <= readFb->Width &&
+ srcY0 >= 0 && srcY1 <= readFb->Height &&
+ dstX0 >= 0 && dstX1 <= drawFb->Width &&
+ dstY0 >= 0 && dstY1 <= drawFb->Height &&
+ !ctx->Scissor.Enabled) {
+ const struct gl_texture_object *texObj = drawAtt->Texture;
+ const GLuint dstLevel = drawAtt->TextureLevel;
+ const GLenum target = texObj->Target;
+
+ struct gl_texture_image *texImage =
+ _mesa_select_tex_image(ctx, texObj, target, dstLevel);
+
+ if (intel_copy_texsubimage(intel_context(ctx),
+ intel_texture_image(texImage),
+ dstX0, dstY0,
+ srcRb,
+ srcX0, srcY0,
+ srcX1 - srcX0, /* width */
+ srcY1 - srcY0))
+ mask &= ~GL_COLOR_BUFFER_BIT;
+ }
+ }
+
+ return mask;
+}
+
+static void
+intel_blit_framebuffer(struct gl_context *ctx,
+ GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
+ GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
+ GLbitfield mask, GLenum filter)
+{
+ /* Try faster, glCopyTexSubImage2D approach first which uses the BLT. */
+ mask = intel_blit_framebuffer_copy_tex_sub_image(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+ if (mask == 0x0)
+ return;
+
+#ifndef I915
+ mask = brw_blorp_framebuffer(intel_context(ctx),
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+ if (mask == 0x0)
+ return;
+#endif
+
+ _mesa_meta_BlitFramebuffer(ctx,
+ srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
+}
+
+/**
+ * This is a no-op except on multisample buffers shared with DRI2.
+ */
+void
+intel_renderbuffer_set_needs_downsample(struct intel_renderbuffer *irb)
+{
+ if (irb->mt && irb->mt->singlesample_mt)
+ irb->mt->need_downsample = true;
+}
+
+void
+intel_renderbuffer_set_needs_hiz_resolve(struct intel_renderbuffer *irb)
+{
+ if (irb->mt) {
+ intel_miptree_slice_set_needs_hiz_resolve(irb->mt,
+ irb->mt_level,
+ irb->mt_layer);
+ }
+}
+
+void
+intel_renderbuffer_set_needs_depth_resolve(struct intel_renderbuffer *irb)
+{
+ if (irb->mt) {
+ intel_miptree_slice_set_needs_depth_resolve(irb->mt,
+ irb->mt_level,
+ irb->mt_layer);
+ }
+}
+
+bool
+intel_renderbuffer_resolve_hiz(struct intel_context *intel,
+ struct intel_renderbuffer *irb)
+{
+ if (irb->mt)
+ return intel_miptree_slice_resolve_hiz(intel,
+ irb->mt,
+ irb->mt_level,
+ irb->mt_layer);
+
+ return false;
+}
+
+bool
+intel_renderbuffer_resolve_depth(struct intel_context *intel,
+ struct intel_renderbuffer *irb)
+{
+ if (irb->mt)
+ return intel_miptree_slice_resolve_depth(intel,
+ irb->mt,
+ irb->mt_level,
+ irb->mt_layer);
+
+ return false;
+}
+
+/**
+ * Do one-time context initializations related to GL_EXT_framebuffer_object.
+ * Hook in device driver functions.
+ */
+void
+intel_fbo_init(struct intel_context *intel)
+{
+ intel->ctx.Driver.NewFramebuffer = intel_new_framebuffer;
+ intel->ctx.Driver.NewRenderbuffer = intel_new_renderbuffer;
+ intel->ctx.Driver.MapRenderbuffer = intel_map_renderbuffer;
+ intel->ctx.Driver.UnmapRenderbuffer = intel_unmap_renderbuffer;
+ intel->ctx.Driver.BindFramebuffer = intel_bind_framebuffer;
+ intel->ctx.Driver.FramebufferRenderbuffer = intel_framebuffer_renderbuffer;
+ intel->ctx.Driver.RenderTexture = intel_render_texture;
+ intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture;
+ intel->ctx.Driver.ResizeBuffers = intel_resize_buffers;
+ intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer;
+ intel->ctx.Driver.BlitFramebuffer = intel_blit_framebuffer;
+
+#if FEATURE_OES_EGL_image
+ intel->ctx.Driver.EGLImageTargetRenderbufferStorage =
+ intel_image_target_renderbuffer_storage;
+#endif
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 242fed0b6ae..556a82fc7ff 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1 +1,1711 @@
-../intel/intel_mipmap_tree.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <GL/gl.h>
+#include <GL/internal/dri_interface.h>
+
+#include "intel_batchbuffer.h"
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_resolve_map.h"
+#include "intel_span.h"
+#include "intel_tex_layout.h"
+#include "intel_tex.h"
+#include "intel_blit.h"
+
+#ifndef I915
+#include "brw_blorp.h"
+#endif
+
+#include "main/enums.h"
+#include "main/formats.h"
+#include "main/glformats.h"
+#include "main/texcompress_etc.h"
+#include "main/teximage.h"
+
+#define FILE_DEBUG_FLAG DEBUG_MIPTREE
+
+static GLenum
+target_to_target(GLenum target)
+{
+ switch (target) {
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
+ return GL_TEXTURE_CUBE_MAP_ARB;
+ default:
+ return target;
+ }
+}
+
+/**
+ * @param for_region Indicates that the caller is
+ * intel_miptree_create_for_region(). If true, then do not create
+ * \c stencil_mt.
+ */
+static struct intel_mipmap_tree *
+intel_miptree_create_internal(struct intel_context *intel,
+ GLenum target,
+ gl_format format,
+ GLuint first_level,
+ GLuint last_level,
+ GLuint width0,
+ GLuint height0,
+ GLuint depth0,
+ bool for_region,
+ GLuint num_samples,
+ enum intel_msaa_layout msaa_layout)
+{
+ struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
+ int compress_byte = 0;
+
+ DBG("%s target %s format %s level %d..%d <-- %p\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(target),
+ _mesa_get_format_name(format),
+ first_level, last_level, mt);
+
+ if (_mesa_is_format_compressed(format))
+ compress_byte = intel_compressed_num_bytes(format);
+
+ mt->target = target_to_target(target);
+ mt->format = format;
+ mt->first_level = first_level;
+ mt->last_level = last_level;
+ mt->width0 = width0;
+ mt->height0 = height0;
+ mt->cpp = compress_byte ? compress_byte : _mesa_get_format_bytes(mt->format);
+ mt->num_samples = num_samples;
+ mt->compressed = compress_byte ? 1 : 0;
+ mt->msaa_layout = msaa_layout;
+ mt->refcount = 1;
+
+ /* array_spacing_lod0 is only used for non-IMS MSAA surfaces. TODO: can we
+ * use it elsewhere?
+ */
+ switch (msaa_layout) {
+ case INTEL_MSAA_LAYOUT_NONE:
+ case INTEL_MSAA_LAYOUT_IMS:
+ mt->array_spacing_lod0 = false;
+ break;
+ case INTEL_MSAA_LAYOUT_UMS:
+ case INTEL_MSAA_LAYOUT_CMS:
+ mt->array_spacing_lod0 = true;
+ break;
+ }
+
+ if (target == GL_TEXTURE_CUBE_MAP) {
+ assert(depth0 == 1);
+ mt->depth0 = 6;
+ } else {
+ mt->depth0 = depth0;
+ }
+
+ if (!for_region &&
+ _mesa_is_depthstencil_format(_mesa_get_format_base_format(format)) &&
+ (intel->must_use_separate_stencil ||
+ (intel->has_separate_stencil &&
+ intel->vtbl.is_hiz_depth_format(intel, format)))) {
+ /* MSAA stencil surfaces always use IMS layout. */
+ enum intel_msaa_layout msaa_layout =
+ num_samples > 1 ? INTEL_MSAA_LAYOUT_IMS : INTEL_MSAA_LAYOUT_NONE;
+ mt->stencil_mt = intel_miptree_create(intel,
+ mt->target,
+ MESA_FORMAT_S8,
+ mt->first_level,
+ mt->last_level,
+ mt->width0,
+ mt->height0,
+ mt->depth0,
+ true,
+ num_samples,
+ msaa_layout);
+ if (!mt->stencil_mt) {
+ intel_miptree_release(&mt);
+ return NULL;
+ }
+
+ /* Fix up the Z miptree format for how we're splitting out separate
+ * stencil. Gen7 expects there to be no stencil bits in its depth buffer.
+ */
+ if (mt->format == MESA_FORMAT_S8_Z24) {
+ mt->format = MESA_FORMAT_X8_Z24;
+ } else if (mt->format == MESA_FORMAT_Z32_FLOAT_X24S8) {
+ mt->format = MESA_FORMAT_Z32_FLOAT;
+ mt->cpp = 4;
+ } else {
+ _mesa_problem(NULL, "Unknown format %s in separate stencil mt\n",
+ _mesa_get_format_name(mt->format));
+ }
+ }
+
+ intel_get_texture_alignment_unit(intel, mt->format,
+ &mt->align_w, &mt->align_h);
+
+#ifdef I915
+ (void) intel;
+ if (intel->is_945)
+ i945_miptree_layout(mt);
+ else
+ i915_miptree_layout(mt);
+#else
+ brw_miptree_layout(intel, mt);
+#endif
+
+ return mt;
+}
+
+
+struct intel_mipmap_tree *
+intel_miptree_create(struct intel_context *intel,
+ GLenum target,
+ gl_format format,
+ GLuint first_level,
+ GLuint last_level,
+ GLuint width0,
+ GLuint height0,
+ GLuint depth0,
+ bool expect_accelerated_upload,
+ GLuint num_samples,
+ enum intel_msaa_layout msaa_layout)
+{
+ struct intel_mipmap_tree *mt;
+ uint32_t tiling = I915_TILING_NONE;
+ GLenum base_format;
+ bool wraps_etc1 = false;
+ GLuint total_width, total_height;
+
+ if (format == MESA_FORMAT_ETC1_RGB8) {
+ format = MESA_FORMAT_RGBX8888_REV;
+ wraps_etc1 = true;
+ }
+
+ base_format = _mesa_get_format_base_format(format);
+
+ if (intel->use_texture_tiling && !_mesa_is_format_compressed(format)) {
+ if (intel->gen >= 4 &&
+ (base_format == GL_DEPTH_COMPONENT ||
+ base_format == GL_DEPTH_STENCIL_EXT))
+ tiling = I915_TILING_Y;
+ else if (msaa_layout != INTEL_MSAA_LAYOUT_NONE) {
+ /* From p82 of the Sandy Bridge PRM, dw3[1] of SURFACE_STATE ("Tiled
+ * Surface"):
+ *
+ * [DevSNB+]: For multi-sample render targets, this field must be
+ * 1. MSRTs can only be tiled.
+ *
+ * Our usual reason for preferring X tiling (fast blits using the
+ * blitting engine) doesn't apply to MSAA, since we'll generally be
+ * downsampling or upsampling when blitting between the MSAA buffer
+ * and another buffer, and the blitting engine doesn't support that.
+ * So use Y tiling, since it makes better use of the cache.
+ */
+ tiling = I915_TILING_Y;
+ } else if (width0 >= 64)
+ tiling = I915_TILING_X;
+ }
+
+ mt = intel_miptree_create_internal(intel, target, format,
+ first_level, last_level, width0,
+ height0, depth0,
+ false, num_samples, msaa_layout);
+ /*
+ * pitch == 0 || height == 0 indicates the null texture
+ */
+ if (!mt || !mt->total_width || !mt->total_height) {
+ intel_miptree_release(&mt);
+ return NULL;
+ }
+
+ total_width = mt->total_width;
+ total_height = mt->total_height;
+
+ if (format == MESA_FORMAT_S8) {
+ /* The stencil buffer is W tiled. However, we request from the kernel a
+ * non-tiled buffer because the GTT is incapable of W fencing. So round
+ * up the width and height to match the size of W tiles (64x64).
+ */
+ tiling = I915_TILING_NONE;
+ total_width = ALIGN(total_width, 64);
+ total_height = ALIGN(total_height, 64);
+ }
+
+ mt->wraps_etc1 = wraps_etc1;
+ mt->region = intel_region_alloc(intel->intelScreen,
+ tiling,
+ mt->cpp,
+ total_width,
+ total_height,
+ expect_accelerated_upload);
+ mt->offset = 0;
+
+ if (!mt->region) {
+ intel_miptree_release(&mt);
+ return NULL;
+ }
+
+ return mt;
+}
+
+
+struct intel_mipmap_tree *
+intel_miptree_create_for_region(struct intel_context *intel,
+ GLenum target,
+ gl_format format,
+ struct intel_region *region)
+{
+ struct intel_mipmap_tree *mt;
+
+ mt = intel_miptree_create_internal(intel, target, format,
+ 0, 0,
+ region->width, region->height, 1,
+ true, 0 /* num_samples */,
+ INTEL_MSAA_LAYOUT_NONE);
+ if (!mt)
+ return mt;
+
+ intel_region_reference(&mt->region, region);
+
+ return mt;
+}
+
+/**
+ * Determine which MSAA layout should be used by the MSAA surface being
+ * created, based on the chip generation and the surface type.
+ */
+static enum intel_msaa_layout
+compute_msaa_layout(struct intel_context *intel, gl_format format)
+{
+ /* Prior to Gen7, all MSAA surfaces used IMS layout. */
+ if (intel->gen < 7)
+ return INTEL_MSAA_LAYOUT_IMS;
+
+ /* In Gen7, IMS layout is only used for depth and stencil buffers. */
+ switch (_mesa_get_format_base_format(format)) {
+ case GL_DEPTH_COMPONENT:
+ case GL_STENCIL_INDEX:
+ case GL_DEPTH_STENCIL:
+ return INTEL_MSAA_LAYOUT_IMS;
+ default:
+ /* From the Ivy Bridge PRM, Vol4 Part1 p77 ("MCS Enable"):
+ *
+ * This field must be set to 0 for all SINT MSRTs when all RT channels
+ * are not written
+ *
+ * In practice this means that we have to disable MCS for all signed
+ * integer MSAA buffers. The alternative, to disable MCS only when one
+ * of the render target channels is disabled, is impractical because it
+ * would require converting between CMS and UMS MSAA layouts on the fly,
+ * which is expensive.
+ */
+ if (_mesa_get_format_datatype(format) == GL_INT) {
+ /* TODO: is this workaround needed for future chipsets? */
+ assert(intel->gen == 7);
+ return INTEL_MSAA_LAYOUT_UMS;
+ } else {
+ return INTEL_MSAA_LAYOUT_CMS;
+ }
+ }
+}
+
+/**
+ * For a singlesample DRI2 buffer, this simply wraps the given region with a miptree.
+ *
+ * For a multisample DRI2 buffer, this wraps the given region with
+ * a singlesample miptree, then creates a multisample miptree into which the
+ * singlesample miptree is embedded as a child.
+ */
+struct intel_mipmap_tree*
+intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
+ unsigned dri_attachment,
+ gl_format format,
+ uint32_t num_samples,
+ struct intel_region *region)
+{
+ struct intel_mipmap_tree *singlesample_mt = NULL;
+ struct intel_mipmap_tree *multisample_mt = NULL;
+ GLenum base_format = _mesa_get_format_base_format(format);
+
+ /* Only the front and back buffers, which are color buffers, are shared
+ * through DRI2.
+ */
+ assert(dri_attachment == __DRI_BUFFER_BACK_LEFT ||
+ dri_attachment == __DRI_BUFFER_FRONT_LEFT ||
+ dri_attachment == __DRI_BUFFER_FAKE_FRONT_LEFT);
+ assert(base_format == GL_RGB || base_format == GL_RGBA);
+
+ singlesample_mt = intel_miptree_create_for_region(intel, GL_TEXTURE_2D,
+ format, region);
+ if (!singlesample_mt)
+ return NULL;
+
+ if (num_samples == 0)
+ return singlesample_mt;
+
+ multisample_mt = intel_miptree_create_for_renderbuffer(intel,
+ format,
+ region->width,
+ region->height,
+ num_samples);
+ if (!multisample_mt) {
+ intel_miptree_release(&singlesample_mt);
+ return NULL;
+ }
+
+ multisample_mt->singlesample_mt = singlesample_mt;
+ multisample_mt->need_downsample = false;
+
+ if (intel->is_front_buffer_rendering &&
+ (dri_attachment == __DRI_BUFFER_FRONT_LEFT ||
+ dri_attachment == __DRI_BUFFER_FAKE_FRONT_LEFT)) {
+ intel_miptree_upsample(intel, multisample_mt);
+ }
+
+ return multisample_mt;
+}
+
+struct intel_mipmap_tree*
+intel_miptree_create_for_renderbuffer(struct intel_context *intel,
+ gl_format format,
+ uint32_t width,
+ uint32_t height,
+ uint32_t num_samples)
+{
+ struct intel_mipmap_tree *mt;
+ uint32_t depth = 1;
+ enum intel_msaa_layout msaa_layout = INTEL_MSAA_LAYOUT_NONE;
+ const uint32_t singlesample_width = width;
+ const uint32_t singlesample_height = height;
+ bool ok;
+
+ if (num_samples > 1) {
+ /* Adjust width/height/depth for MSAA */
+ msaa_layout = compute_msaa_layout(intel, format);
+ if (msaa_layout == INTEL_MSAA_LAYOUT_IMS) {
+ /* In the Sandy Bridge PRM, volume 4, part 1, page 31, it says:
+ *
+ * "Any of the other messages (sample*, LOD, load4) used with a
+ * (4x) multisampled surface will in-effect sample a surface with
+ * double the height and width as that indicated in the surface
+ * state. Each pixel position on the original-sized surface is
+ * replaced with a 2x2 of samples with the following arrangement:
+ *
+ * sample 0 sample 2
+ * sample 1 sample 3"
+ *
+ * Thus, when sampling from a multisampled texture, it behaves as
+ * though the layout in memory for (x,y,sample) is:
+ *
+ * (0,0,0) (0,0,2) (1,0,0) (1,0,2)
+ * (0,0,1) (0,0,3) (1,0,1) (1,0,3)
+ *
+ * (0,1,0) (0,1,2) (1,1,0) (1,1,2)
+ * (0,1,1) (0,1,3) (1,1,1) (1,1,3)
+ *
+ * However, the actual layout of multisampled data in memory is:
+ *
+ * (0,0,0) (1,0,0) (0,0,1) (1,0,1)
+ * (0,1,0) (1,1,0) (0,1,1) (1,1,1)
+ *
+ * (0,0,2) (1,0,2) (0,0,3) (1,0,3)
+ * (0,1,2) (1,1,2) (0,1,3) (1,1,3)
+ *
+ * This pattern repeats for each 2x2 pixel block.
+ *
+ * As a result, when calculating the size of our 4-sample buffer for
+ * an odd width or height, we have to align before scaling up because
+ * sample 3 is in that bottom right 2x2 block.
+ */
+ switch (num_samples) {
+ case 4:
+ width = ALIGN(width, 2) * 2;
+ height = ALIGN(height, 2) * 2;
+ break;
+ case 8:
+ width = ALIGN(width, 2) * 4;
+ height = ALIGN(height, 2) * 2;
+ break;
+ default:
+ /* num_samples should already have been quantized to 0, 1, 4, or
+ * 8.
+ */
+ assert(false);
+ }
+ } else {
+ /* Non-interleaved */
+ depth = num_samples;
+ }
+ }
+
+ mt = intel_miptree_create(intel, GL_TEXTURE_2D, format, 0, 0,
+ width, height, depth, true, num_samples,
+ msaa_layout);
+ if (!mt)
+ goto fail;
+
+ if (intel->vtbl.is_hiz_depth_format(intel, format)) {
+ ok = intel_miptree_alloc_hiz(intel, mt, num_samples);
+ if (!ok)
+ goto fail;
+ }
+
+ if (mt->msaa_layout == INTEL_MSAA_LAYOUT_CMS) {
+ ok = intel_miptree_alloc_mcs(intel, mt, num_samples);
+ if (!ok)
+ goto fail;
+ }
+
+ mt->singlesample_width0 = singlesample_width;
+ mt->singlesample_height0 = singlesample_height;
+
+ return mt;
+
+fail:
+ intel_miptree_release(&mt);
+ return NULL;
+}
+
+void
+intel_miptree_reference(struct intel_mipmap_tree **dst,
+ struct intel_mipmap_tree *src)
+{
+ if (*dst == src)
+ return;
+
+ intel_miptree_release(dst);
+
+ if (src) {
+ src->refcount++;
+ DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount);
+ }
+
+ *dst = src;
+}
+
+
+void
+intel_miptree_release(struct intel_mipmap_tree **mt)
+{
+ if (!*mt)
+ return;
+
+ DBG("%s %p refcount will be %d\n", __FUNCTION__, *mt, (*mt)->refcount - 1);
+ if (--(*mt)->refcount <= 0) {
+ GLuint i;
+
+ DBG("%s deleting %p\n", __FUNCTION__, *mt);
+
+ intel_region_release(&((*mt)->region));
+ intel_miptree_release(&(*mt)->stencil_mt);
+ intel_miptree_release(&(*mt)->hiz_mt);
+ intel_miptree_release(&(*mt)->mcs_mt);
+ intel_miptree_release(&(*mt)->singlesample_mt);
+ intel_resolve_map_clear(&(*mt)->hiz_map);
+
+ for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
+ free((*mt)->level[i].slice);
+ }
+
+ free(*mt);
+ }
+ *mt = NULL;
+}
+
+void
+intel_miptree_get_dimensions_for_image(struct gl_texture_image *image,
+ int *width, int *height, int *depth)
+{
+ switch (image->TexObject->Target) {
+ case GL_TEXTURE_1D_ARRAY:
+ *width = image->Width;
+ *height = 1;
+ *depth = image->Height;
+ break;
+ default:
+ *width = image->Width;
+ *height = image->Height;
+ *depth = image->Depth;
+ break;
+ }
+}
+
+/**
+ * Can the image be pulled into a unified mipmap tree? This mirrors
+ * the completeness test in a lot of ways.
+ *
+ * Not sure whether I want to pass gl_texture_image here.
+ */
+bool
+intel_miptree_match_image(struct intel_mipmap_tree *mt,
+ struct gl_texture_image *image)
+{
+ struct intel_texture_image *intelImage = intel_texture_image(image);
+ GLuint level = intelImage->base.Base.Level;
+ int width, height, depth;
+
+ if (target_to_target(image->TexObject->Target) != mt->target)
+ return false;
+
+ if (image->TexFormat != mt->format &&
+ !(image->TexFormat == MESA_FORMAT_S8_Z24 &&
+ mt->format == MESA_FORMAT_X8_Z24 &&
+ mt->stencil_mt)) {
+ return false;
+ }
+
+ intel_miptree_get_dimensions_for_image(image, &width, &height, &depth);
+
+ if (mt->target == GL_TEXTURE_CUBE_MAP)
+ depth = 6;
+
+ /* Test image dimensions against the base level image adjusted for
+ * minification. This will also catch images not present in the
+ * tree, changed targets, etc.
+ */
+ if (width != mt->level[level].width ||
+ height != mt->level[level].height ||
+ depth != mt->level[level].depth)
+ return false;
+
+ return true;
+}
+
+
+void
+intel_miptree_set_level_info(struct intel_mipmap_tree *mt,
+ GLuint level,
+ GLuint x, GLuint y,
+ GLuint w, GLuint h, GLuint d)
+{
+ mt->level[level].width = w;
+ mt->level[level].height = h;
+ mt->level[level].depth = d;
+ mt->level[level].level_x = x;
+ mt->level[level].level_y = y;
+
+ DBG("%s level %d size: %d,%d,%d offset %d,%d\n", __FUNCTION__,
+ level, w, h, d, x, y);
+
+ assert(mt->level[level].slice == NULL);
+
+ mt->level[level].slice = calloc(d, sizeof(*mt->level[0].slice));
+ mt->level[level].slice[0].x_offset = mt->level[level].level_x;
+ mt->level[level].slice[0].y_offset = mt->level[level].level_y;
+}
+
+
+void
+intel_miptree_set_image_offset(struct intel_mipmap_tree *mt,
+ GLuint level, GLuint img,
+ GLuint x, GLuint y)
+{
+ if (img == 0 && level == 0)
+ assert(x == 0 && y == 0);
+
+ assert(img < mt->level[level].depth);
+
+ mt->level[level].slice[img].x_offset = mt->level[level].level_x + x;
+ mt->level[level].slice[img].y_offset = mt->level[level].level_y + y;
+
+ DBG("%s level %d img %d pos %d,%d\n",
+ __FUNCTION__, level, img,
+ mt->level[level].slice[img].x_offset,
+ mt->level[level].slice[img].y_offset);
+}
+
+
+/**
+ * For cube map textures, either the \c face parameter can be used, of course,
+ * or the cube face can be interpreted as a depth layer and the \c layer
+ * parameter used.
+ */
+void
+intel_miptree_get_image_offset(struct intel_mipmap_tree *mt,
+ GLuint level, GLuint face, GLuint layer,
+ GLuint *x, GLuint *y)
+{
+ int slice;
+
+ if (face > 0) {
+ assert(mt->target == GL_TEXTURE_CUBE_MAP);
+ assert(face < 6);
+ assert(layer == 0);
+ slice = face;
+ } else {
+ /* This branch may be taken even if the texture target is a cube map. In
+ * that case, the caller chose to interpret each cube face as a layer.
+ */
+ assert(face == 0);
+ slice = layer;
+ }
+
+ *x = mt->level[level].slice[slice].x_offset;
+ *y = mt->level[level].slice[slice].y_offset;
+}
+
+static void
+intel_miptree_copy_slice(struct intel_context *intel,
+ struct intel_mipmap_tree *dst_mt,
+ struct intel_mipmap_tree *src_mt,
+ int level,
+ int face,
+ int depth)
+
+{
+ gl_format format = src_mt->format;
+ uint32_t width = src_mt->level[level].width;
+ uint32_t height = src_mt->level[level].height;
+
+ assert(depth < src_mt->level[level].depth);
+
+ if (dst_mt->compressed) {
+ height = ALIGN(height, dst_mt->align_h) / dst_mt->align_h;
+ width = ALIGN(width, dst_mt->align_w);
+ }
+
+ uint32_t dst_x, dst_y, src_x, src_y;
+ intel_miptree_get_image_offset(dst_mt, level, face, depth,
+ &dst_x, &dst_y);
+ intel_miptree_get_image_offset(src_mt, level, face, depth,
+ &src_x, &src_y);
+
+ DBG("validate blit mt %p %d,%d/%d -> mt %p %d,%d/%d (%dx%d)\n",
+ src_mt, src_x, src_y, src_mt->region->pitch * src_mt->region->cpp,
+ dst_mt, dst_x, dst_y, dst_mt->region->pitch * dst_mt->region->cpp,
+ width, height);
+
+ if (!intelEmitCopyBlit(intel,
+ dst_mt->region->cpp,
+ src_mt->region->pitch, src_mt->region->bo,
+ 0, src_mt->region->tiling,
+ dst_mt->region->pitch, dst_mt->region->bo,
+ 0, dst_mt->region->tiling,
+ src_x, src_y,
+ dst_x, dst_y,
+ width, height,
+ GL_COPY)) {
+
+ fallback_debug("miptree validate blit for %s failed\n",
+ _mesa_get_format_name(format));
+ void *dst = intel_region_map(intel, dst_mt->region, GL_MAP_WRITE_BIT);
+ void *src = intel_region_map(intel, src_mt->region, GL_MAP_READ_BIT);
+
+ _mesa_copy_rect(dst,
+ dst_mt->cpp,
+ dst_mt->region->pitch,
+ dst_x, dst_y,
+ width, height,
+ src, src_mt->region->pitch,
+ src_x, src_y);
+
+ intel_region_unmap(intel, dst_mt->region);
+ intel_region_unmap(intel, src_mt->region);
+ }
+
+ if (src_mt->stencil_mt) {
+ intel_miptree_copy_slice(intel,
+ dst_mt->stencil_mt, src_mt->stencil_mt,
+ level, face, depth);
+ }
+}
+
+/**
+ * Copies the image's current data to the given miptree, and associates that
+ * miptree with the image.
+ */
+void
+intel_miptree_copy_teximage(struct intel_context *intel,
+ struct intel_texture_image *intelImage,
+ struct intel_mipmap_tree *dst_mt)
+{
+ struct intel_mipmap_tree *src_mt = intelImage->mt;
+ int level = intelImage->base.Base.Level;
+ int face = intelImage->base.Base.Face;
+ GLuint depth = intelImage->base.Base.Depth;
+
+ for (int slice = 0; slice < depth; slice++) {
+ intel_miptree_copy_slice(intel, dst_mt, src_mt, level, face, slice);
+ }
+
+ intel_miptree_reference(&intelImage->mt, dst_mt);
+}
+
+bool
+intel_miptree_alloc_mcs(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ GLuint num_samples)
+{
+ assert(mt->mcs_mt == NULL);
+ assert(intel->gen >= 7); /* MCS only used on Gen7+ */
+
+ /* Choose the correct format for the MCS buffer. All that really matters
+ * is that we allocate the right buffer size, since we'll always be
+ * accessing this miptree using MCS-specific hardware mechanisms, which
+ * infer the correct format based on num_samples.
+ */
+ gl_format format;
+ switch (num_samples) {
+ case 4:
+ /* 8 bits/pixel are required for MCS data when using 4x MSAA (2 bits for
+ * each sample).
+ */
+ format = MESA_FORMAT_R8;
+ break;
+ case 8:
+ /* 32 bits/pixel are required for MCS data when using 8x MSAA (3 bits
+ * for each sample, plus 8 padding bits).
+ */
+ format = MESA_FORMAT_R_UINT32;
+ break;
+ default:
+ assert(!"Unrecognized sample count in intel_miptree_alloc_mcs");
+ break;
+ };
+
+ /* From the Ivy Bridge PRM, Vol4 Part1 p76, "MCS Base Address":
+ *
+ * "The MCS surface must be stored as Tile Y."
+ *
+ * We set msaa_format to INTEL_MSAA_LAYOUT_CMS to force
+ * intel_miptree_create() to use Y tiling. msaa_format is otherwise
+ * ignored for the MCS miptree.
+ */
+ mt->mcs_mt = intel_miptree_create(intel,
+ mt->target,
+ format,
+ mt->first_level,
+ mt->last_level,
+ mt->width0,
+ mt->height0,
+ mt->depth0,
+ true,
+ 0 /* num_samples */,
+ INTEL_MSAA_LAYOUT_CMS);
+
+ /* From the Ivy Bridge PRM, Vol 2 Part 1 p326:
+ *
+ * When MCS buffer is enabled and bound to MSRT, it is required that it
+ * is cleared prior to any rendering.
+ *
+ * Since we don't use the MCS buffer for any purpose other than rendering,
+ * it makes sense to just clear it immediately upon allocation.
+ *
+ * Note: the clear value for MCS buffers is all 1's, so we memset to 0xff.
+ */
+ void *data = intel_region_map(intel, mt->mcs_mt->region, 0);
+ memset(data, 0xff, mt->mcs_mt->region->bo->size);
+ intel_region_unmap(intel, mt->mcs_mt->region);
+
+ return mt->mcs_mt;
+}
+
+bool
+intel_miptree_alloc_hiz(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ GLuint num_samples)
+{
+ assert(mt->hiz_mt == NULL);
+ /* MSAA HiZ surfaces always use IMS layout. */
+ mt->hiz_mt = intel_miptree_create(intel,
+ mt->target,
+ MESA_FORMAT_X8_Z24,
+ mt->first_level,
+ mt->last_level,
+ mt->width0,
+ mt->height0,
+ mt->depth0,
+ true,
+ num_samples,
+ INTEL_MSAA_LAYOUT_IMS);
+
+ if (!mt->hiz_mt)
+ return false;
+
+ /* Mark that all slices need a HiZ resolve. */
+ struct intel_resolve_map *head = &mt->hiz_map;
+ for (int level = mt->first_level; level <= mt->last_level; ++level) {
+ for (int layer = 0; layer < mt->level[level].depth; ++layer) {
+ head->next = malloc(sizeof(*head->next));
+ head->next->prev = head;
+ head->next->next = NULL;
+ head = head->next;
+
+ head->level = level;
+ head->layer = layer;
+ head->need = GEN6_HIZ_OP_HIZ_RESOLVE;
+ }
+ }
+
+ return true;
+}
+
+void
+intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer)
+{
+ intel_miptree_check_level_layer(mt, level, layer);
+
+ if (!mt->hiz_mt)
+ return;
+
+ intel_resolve_map_set(&mt->hiz_map,
+ level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
+}
+
+
+void
+intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer)
+{
+ intel_miptree_check_level_layer(mt, level, layer);
+
+ if (!mt->hiz_mt)
+ return;
+
+ intel_resolve_map_set(&mt->hiz_map,
+ level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
+}
+
+static bool
+intel_miptree_slice_resolve(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer,
+ enum gen6_hiz_op need)
+{
+ intel_miptree_check_level_layer(mt, level, layer);
+
+ struct intel_resolve_map *item =
+ intel_resolve_map_get(&mt->hiz_map, level, layer);
+
+ if (!item || item->need != need)
+ return false;
+
+ intel_hiz_exec(intel, mt, level, layer, need);
+ intel_resolve_map_remove(item);
+ return true;
+}
+
+bool
+intel_miptree_slice_resolve_hiz(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer)
+{
+ return intel_miptree_slice_resolve(intel, mt, level, layer,
+ GEN6_HIZ_OP_HIZ_RESOLVE);
+}
+
+bool
+intel_miptree_slice_resolve_depth(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ uint32_t level,
+ uint32_t layer)
+{
+ return intel_miptree_slice_resolve(intel, mt, level, layer,
+ GEN6_HIZ_OP_DEPTH_RESOLVE);
+}
+
+static bool
+intel_miptree_all_slices_resolve(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ enum gen6_hiz_op need)
+{
+ bool did_resolve = false;
+ struct intel_resolve_map *i, *next;
+
+ for (i = mt->hiz_map.next; i; i = next) {
+ next = i->next;
+ if (i->need != need)
+ continue;
+
+ intel_hiz_exec(intel, mt, i->level, i->layer, need);
+ intel_resolve_map_remove(i);
+ did_resolve = true;
+ }
+
+ return did_resolve;
+}
+
+bool
+intel_miptree_all_slices_resolve_hiz(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ return intel_miptree_all_slices_resolve(intel, mt,
+ GEN6_HIZ_OP_HIZ_RESOLVE);
+}
+
+bool
+intel_miptree_all_slices_resolve_depth(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ return intel_miptree_all_slices_resolve(intel, mt,
+ GEN6_HIZ_OP_DEPTH_RESOLVE);
+}
+
+static void
+intel_miptree_updownsample(struct intel_context *intel,
+ struct intel_mipmap_tree *src,
+ struct intel_mipmap_tree *dst,
+ unsigned width,
+ unsigned height)
+{
+#ifndef I915
+ int src_x0 = 0;
+ int src_y0 = 0;
+ int dst_x0 = 0;
+ int dst_y0 = 0;
+
+ intel_miptree_slice_resolve_depth(intel, src, 0, 0);
+ intel_miptree_slice_resolve_depth(intel, dst, 0, 0);
+
+ brw_blorp_blit_miptrees(intel,
+ src, 0 /* level */, 0 /* layer */,
+ dst, 0 /* level */, 0 /* layer */,
+ src_x0, src_y0,
+ dst_x0, dst_y0,
+ width, height,
+ false, false /*mirror x, y*/);
+
+ if (src->stencil_mt) {
+ brw_blorp_blit_miptrees(intel,
+ src->stencil_mt, 0 /* level */, 0 /* layer */,
+ dst->stencil_mt, 0 /* level */, 0 /* layer */,
+ src_x0, src_y0,
+ dst_x0, dst_y0,
+ width, height,
+ false, false /*mirror x, y*/);
+ }
+#endif /* I915 */
+}
+
+static void
+assert_is_flat(struct intel_mipmap_tree *mt)
+{
+ assert(mt->target == GL_TEXTURE_2D);
+ assert(mt->first_level == 0);
+ assert(mt->last_level == 0);
+}
+
+/**
+ * \brief Downsample from mt to mt->singlesample_mt.
+ *
+ * If the miptree needs no downsample, then skip.
+ */
+void
+intel_miptree_downsample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ /* Only flat, renderbuffer-like miptrees are supported. */
+ assert_is_flat(mt);
+
+ if (!mt->need_downsample)
+ return;
+ intel_miptree_updownsample(intel,
+ mt, mt->singlesample_mt,
+ mt->singlesample_mt->width0,
+ mt->singlesample_mt->height0);
+ mt->need_downsample = false;
+
+ /* Strictly speaking, after a downsample on a depth miptree, a hiz
+ * resolve is needed on the singlesample miptree. However, since the
+ * singlesample miptree is never rendered to, the hiz resolve will never
+ * occur. Therefore we do not mark the needed hiz resolve after
+ * downsampling.
+ */
+}
+
+/**
+ * \brief Upsample from mt->singlesample_mt to mt.
+ *
+ * The upsample is done unconditionally.
+ */
+void
+intel_miptree_upsample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt)
+{
+ /* Only flat, renderbuffer-like miptrees are supported. */
+ assert_is_flat(mt);
+ assert(!mt->need_downsample);
+
+ intel_miptree_updownsample(intel,
+ mt->singlesample_mt, mt,
+ mt->singlesample_mt->width0,
+ mt->singlesample_mt->height0);
+ intel_miptree_slice_set_needs_hiz_resolve(mt, 0, 0);
+}
+
+static void
+intel_miptree_map_gtt(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
+{
+ unsigned int bw, bh;
+ void *base;
+ unsigned int image_x, image_y;
+ int x = map->x;
+ int y = map->y;
+
+ /* For compressed formats, the stride is the number of bytes per
+ * row of blocks. intel_miptree_get_image_offset() already does
+ * the divide.
+ */
+ _mesa_get_format_block_size(mt->format, &bw, &bh);
+ assert(y % bh == 0);
+ y /= bh;
+
+ base = intel_region_map(intel, mt->region, map->mode);
+
+ if (base == NULL)
+ map->ptr = NULL;
+ else {
+ /* Note that in the case of cube maps, the caller must have passed the
+ * slice number referencing the face.
+ */
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+ x += image_x;
+ y += image_y;
+
+ map->stride = mt->region->pitch * mt->cpp;
+ map->ptr = base + y * map->stride + x * mt->cpp;
+ }
+
+ DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, _mesa_get_format_name(mt->format),
+ x, y, map->ptr, map->stride);
+}
+
+static void
+intel_miptree_unmap_gtt(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ intel_region_unmap(intel, mt->region);
+}
+
+static void
+intel_miptree_map_blit(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
+{
+ unsigned int image_x, image_y;
+ int x = map->x;
+ int y = map->y;
+ int ret;
+
+ /* The blitter requires the pitch to be aligned to 4. */
+ map->stride = ALIGN(map->w * mt->region->cpp, 4);
+
+ map->bo = drm_intel_bo_alloc(intel->bufmgr, "intel_miptree_map_blit() temp",
+ map->stride * map->h, 4096);
+ if (!map->bo) {
+ fprintf(stderr, "Failed to allocate blit temporary\n");
+ goto fail;
+ }
+
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+ x += image_x;
+ y += image_y;
+
+ if (!intelEmitCopyBlit(intel,
+ mt->region->cpp,
+ mt->region->pitch, mt->region->bo,
+ 0, mt->region->tiling,
+ map->stride / mt->region->cpp, map->bo,
+ 0, I915_TILING_NONE,
+ x, y,
+ 0, 0,
+ map->w, map->h,
+ GL_COPY)) {
+ fprintf(stderr, "Failed to blit\n");
+ goto fail;
+ }
+
+ intel_batchbuffer_flush(intel);
+ ret = drm_intel_bo_map(map->bo, (map->mode & GL_MAP_WRITE_BIT) != 0);
+ if (ret) {
+ fprintf(stderr, "Failed to map blit temporary\n");
+ goto fail;
+ }
+
+ map->ptr = map->bo->virtual;
+
+ DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, _mesa_get_format_name(mt->format),
+ x, y, map->ptr, map->stride);
+
+ return;
+
+fail:
+ drm_intel_bo_unreference(map->bo);
+ map->ptr = NULL;
+ map->stride = 0;
+}
+
+static void
+intel_miptree_unmap_blit(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ assert(!(map->mode & GL_MAP_WRITE_BIT));
+
+ drm_intel_bo_unmap(map->bo);
+ drm_intel_bo_unreference(map->bo);
+}
+
+static void
+intel_miptree_map_s8(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
+{
+ map->stride = map->w;
+ map->buffer = map->ptr = malloc(map->stride * map->h);
+ if (!map->buffer)
+ return;
+
+ /* One of either READ_BIT or WRITE_BIT or both is set. READ_BIT implies no
+ * INVALIDATE_RANGE_BIT. WRITE_BIT needs the original values read in unless
+ * invalidate is set, since we'll be writing the whole rectangle from our
+ * temporary buffer back out.
+ */
+ if (!(map->mode & GL_MAP_INVALIDATE_RANGE_BIT)) {
+ uint8_t *untiled_s8_map = map->ptr;
+ uint8_t *tiled_s8_map = intel_region_map(intel, mt->region,
+ GL_MAP_READ_BIT);
+ unsigned int image_x, image_y;
+
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+
+ for (uint32_t y = 0; y < map->h; y++) {
+ for (uint32_t x = 0; x < map->w; x++) {
+ ptrdiff_t offset = intel_offset_S8(mt->region->pitch,
+ x + image_x + map->x,
+ y + image_y + map->y,
+ intel->has_swizzling);
+ untiled_s8_map[y * map->w + x] = tiled_s8_map[offset];
+ }
+ }
+
+ intel_region_unmap(intel, mt->region);
+
+ DBG("%s: %d,%d %dx%d from mt %p %d,%d = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, map->x + image_x, map->y + image_y, map->ptr, map->stride);
+ } else {
+ DBG("%s: %d,%d %dx%d from mt %p = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, map->ptr, map->stride);
+ }
+}
+
+static void
+intel_miptree_unmap_s8(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ if (map->mode & GL_MAP_WRITE_BIT) {
+ unsigned int image_x, image_y;
+ uint8_t *untiled_s8_map = map->ptr;
+ uint8_t *tiled_s8_map = intel_region_map(intel, mt->region, map->mode);
+
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+
+ for (uint32_t y = 0; y < map->h; y++) {
+ for (uint32_t x = 0; x < map->w; x++) {
+ ptrdiff_t offset = intel_offset_S8(mt->region->pitch,
+ x + map->x,
+ y + map->y,
+ intel->has_swizzling);
+ tiled_s8_map[offset] = untiled_s8_map[y * map->w + x];
+ }
+ }
+
+ intel_region_unmap(intel, mt->region);
+ }
+
+ free(map->buffer);
+}
+
+static void
+intel_miptree_map_etc1(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ /* For justification of these invariants,
+ * see intel_mipmap_tree:wraps_etc1.
+ */
+ assert(mt->wraps_etc1);
+ assert(mt->format == MESA_FORMAT_RGBX8888_REV);
+
+ /* From the GL_OES_compressed_ETC1_RGB8_texture spec:
+ * INVALID_OPERATION is generated by CompressedTexSubImage2D,
+ * TexSubImage2D, or CopyTexSubImage2D if the texture image <level>
+ * bound to <target> has internal format ETC1_RGB8_OES.
+ *
+ * This implies that intel_miptree_map_etc1() can only be called from
+ * glCompressedTexImage2D, and hence the assertions below hold.
+ */
+ assert(map->mode & GL_MAP_WRITE_BIT);
+ assert(map->mode & GL_MAP_INVALIDATE_RANGE_BIT);
+ assert(map->x == 0);
+ assert(map->y == 0);
+
+ /* Each ETC1 block contains 4x4 pixels in 8 bytes. */
+ map->stride = 2 * map->w;
+ map->buffer = map->ptr = malloc(map->stride * map->h);
+}
+
+static void
+intel_miptree_unmap_etc1(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ uint32_t image_x;
+ uint32_t image_y;
+ intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
+
+ uint8_t *xbgr = intel_region_map(intel, mt->region, map->mode)
+ + image_y * mt->region->pitch * mt->region->cpp
+ + image_x * mt->region->cpp;
+
+ _mesa_etc1_unpack_rgba8888(xbgr, mt->region->pitch * mt->region->cpp,
+ map->ptr, map->stride,
+ map->w, map->h);
+
+ intel_region_unmap(intel, mt->region);
+ free(map->buffer);
+}
+
+/**
+ * Mapping function for packed depth/stencil miptrees backed by real separate
+ * miptrees for depth and stencil.
+ *
+ * On gen7, and to support HiZ pre-gen7, we have to have the stencil buffer
+ * separate from the depth buffer. Yet at the GL API level, we have to expose
+ * packed depth/stencil textures and FBO attachments, and Mesa core expects to
+ * be able to map that memory for texture storage and glReadPixels-type
+ * operations. We give Mesa core that access by mallocing a temporary and
+ * copying the data between the actual backing store and the temporary.
+ */
+static void
+intel_miptree_map_depthstencil(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level, unsigned int slice)
+{
+ struct intel_mipmap_tree *z_mt = mt;
+ struct intel_mipmap_tree *s_mt = mt->stencil_mt;
+ bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z32_FLOAT;
+ int packed_bpp = map_z32f_x24s8 ? 8 : 4;
+
+ map->stride = map->w * packed_bpp;
+ map->buffer = map->ptr = malloc(map->stride * map->h);
+ if (!map->buffer)
+ return;
+
+ /* One of either READ_BIT or WRITE_BIT or both is set. READ_BIT implies no
+ * INVALIDATE_RANGE_BIT. WRITE_BIT needs the original values read in unless
+ * invalidate is set, since we'll be writing the whole rectangle from our
+ * temporary buffer back out.
+ */
+ if (!(map->mode & GL_MAP_INVALIDATE_RANGE_BIT)) {
+ uint32_t *packed_map = map->ptr;
+ uint8_t *s_map = intel_region_map(intel, s_mt->region, GL_MAP_READ_BIT);
+ uint32_t *z_map = intel_region_map(intel, z_mt->region, GL_MAP_READ_BIT);
+ unsigned int s_image_x, s_image_y;
+ unsigned int z_image_x, z_image_y;
+
+ intel_miptree_get_image_offset(s_mt, level, 0, slice,
+ &s_image_x, &s_image_y);
+ intel_miptree_get_image_offset(z_mt, level, 0, slice,
+ &z_image_x, &z_image_y);
+
+ for (uint32_t y = 0; y < map->h; y++) {
+ for (uint32_t x = 0; x < map->w; x++) {
+ int map_x = map->x + x, map_y = map->y + y;
+ ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
+ map_x + s_image_x,
+ map_y + s_image_y,
+ intel->has_swizzling);
+ ptrdiff_t z_offset = ((map_y + z_image_y) * z_mt->region->pitch +
+ (map_x + z_image_x));
+ uint8_t s = s_map[s_offset];
+ uint32_t z = z_map[z_offset];
+
+ if (map_z32f_x24s8) {
+ packed_map[(y * map->w + x) * 2 + 0] = z;
+ packed_map[(y * map->w + x) * 2 + 1] = s;
+ } else {
+ packed_map[y * map->w + x] = (s << 24) | (z & 0x00ffffff);
+ }
+ }
+ }
+
+ intel_region_unmap(intel, s_mt->region);
+ intel_region_unmap(intel, z_mt->region);
+
+ DBG("%s: %d,%d %dx%d from z mt %p %d,%d, s mt %p %d,%d = %p/%d\n",
+ __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ z_mt, map->x + z_image_x, map->y + z_image_y,
+ s_mt, map->x + s_image_x, map->y + s_image_y,
+ map->ptr, map->stride);
+ } else {
+ DBG("%s: %d,%d %dx%d from mt %p = %p/%d\n", __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ mt, map->ptr, map->stride);
+ }
+}
+
+static void
+intel_miptree_unmap_depthstencil(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ struct intel_miptree_map *map,
+ unsigned int level,
+ unsigned int slice)
+{
+ struct intel_mipmap_tree *z_mt = mt;
+ struct intel_mipmap_tree *s_mt = mt->stencil_mt;
+ bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z32_FLOAT;
+
+ if (map->mode & GL_MAP_WRITE_BIT) {
+ uint32_t *packed_map = map->ptr;
+ uint8_t *s_map = intel_region_map(intel, s_mt->region, map->mode);
+ uint32_t *z_map = intel_region_map(intel, z_mt->region, map->mode);
+ unsigned int s_image_x, s_image_y;
+ unsigned int z_image_x, z_image_y;
+
+ intel_miptree_get_image_offset(s_mt, level, 0, slice,
+ &s_image_x, &s_image_y);
+ intel_miptree_get_image_offset(z_mt, level, 0, slice,
+ &z_image_x, &z_image_y);
+
+ for (uint32_t y = 0; y < map->h; y++) {
+ for (uint32_t x = 0; x < map->w; x++) {
+ ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
+ x + s_image_x + map->x,
+ y + s_image_y + map->y,
+ intel->has_swizzling);
+ ptrdiff_t z_offset = ((y + z_image_y) * z_mt->region->pitch +
+ (x + z_image_x));
+
+ if (map_z32f_x24s8) {
+ z_map[z_offset] = packed_map[(y * map->w + x) * 2 + 0];
+ s_map[s_offset] = packed_map[(y * map->w + x) * 2 + 1];
+ } else {
+ uint32_t packed = packed_map[y * map->w + x];
+ s_map[s_offset] = packed >> 24;
+ z_map[z_offset] = packed;
+ }
+ }
+ }
+
+ intel_region_unmap(intel, s_mt->region);
+ intel_region_unmap(intel, z_mt->region);
+
+ DBG("%s: %d,%d %dx%d from z mt %p (%s) %d,%d, s mt %p %d,%d = %p/%d\n",
+ __FUNCTION__,
+ map->x, map->y, map->w, map->h,
+ z_mt, _mesa_get_format_name(z_mt->format),
+ map->x + z_image_x, map->y + z_image_y,
+ s_mt, map->x + s_image_x, map->y + s_image_y,
+ map->ptr, map->stride);
+ }
+
+ free(map->buffer);
+}
+
+/**
+ * Create and attach a map to the miptree at (level, slice). Return the
+ * attached map.
+ */
+static struct intel_miptree_map*
+intel_miptree_attach_map(struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h,
+ GLbitfield mode)
+{
+ struct intel_miptree_map *map = calloc(1, sizeof(*map));
+
+ if (!map)
+ return NULL;
+
+ assert(mt->level[level].slice[slice].map == NULL);
+ mt->level[level].slice[slice].map = map;
+
+ map->mode = mode;
+ map->x = x;
+ map->y = y;
+ map->w = w;
+ map->h = h;
+
+ return map;
+}
+
+/**
+ * Release the map at (level, slice).
+ */
+static void
+intel_miptree_release_map(struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice)
+{
+ struct intel_miptree_map **map;
+
+ map = &mt->level[level].slice[slice].map;
+ free(*map);
+ *map = NULL;
+}
+
+static void
+intel_miptree_map_singlesample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h,
+ GLbitfield mode,
+ void **out_ptr,
+ int *out_stride)
+{
+ struct intel_miptree_map *map;
+
+ assert(mt->num_samples <= 1);
+
+ map = intel_miptree_attach_map(mt, level, slice, x, y, w, h, mode);
+ if (!map){
+ *out_ptr = NULL;
+ *out_stride = 0;
+ return;
+ }
+
+ intel_miptree_slice_resolve_depth(intel, mt, level, slice);
+ if (map->mode & GL_MAP_WRITE_BIT) {
+ intel_miptree_slice_set_needs_hiz_resolve(mt, level, slice);
+ }
+
+ if (mt->format == MESA_FORMAT_S8) {
+ intel_miptree_map_s8(intel, mt, map, level, slice);
+ } else if (mt->wraps_etc1) {
+ intel_miptree_map_etc1(intel, mt, map, level, slice);
+ } else if (mt->stencil_mt) {
+ intel_miptree_map_depthstencil(intel, mt, map, level, slice);
+ } else if (intel->has_llc &&
+ !(mode & GL_MAP_WRITE_BIT) &&
+ !mt->compressed &&
+ mt->region->tiling == I915_TILING_X) {
+ intel_miptree_map_blit(intel, mt, map, level, slice);
+ } else {
+ intel_miptree_map_gtt(intel, mt, map, level, slice);
+ }
+
+ *out_ptr = map->ptr;
+ *out_stride = map->stride;
+
+ if (map->ptr == NULL)
+ intel_miptree_release_map(mt, level, slice);
+}
+
+static void
+intel_miptree_unmap_singlesample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice)
+{
+ struct intel_miptree_map *map = mt->level[level].slice[slice].map;
+
+ assert(mt->num_samples <= 1);
+
+ if (!map)
+ return;
+
+ DBG("%s: mt %p (%s) level %d slice %d\n", __FUNCTION__,
+ mt, _mesa_get_format_name(mt->format), level, slice);
+
+ if (mt->format == MESA_FORMAT_S8) {
+ intel_miptree_unmap_s8(intel, mt, map, level, slice);
+ } else if (mt->wraps_etc1) {
+ intel_miptree_unmap_etc1(intel, mt, map, level, slice);
+ } else if (mt->stencil_mt) {
+ intel_miptree_unmap_depthstencil(intel, mt, map, level, slice);
+ } else if (map->bo) {
+ intel_miptree_unmap_blit(intel, mt, map, level, slice);
+ } else {
+ intel_miptree_unmap_gtt(intel, mt, map, level, slice);
+ }
+
+ intel_miptree_release_map(mt, level, slice);
+}
+
+static void
+intel_miptree_map_multisample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h,
+ GLbitfield mode,
+ void **out_ptr,
+ int *out_stride)
+{
+ struct intel_miptree_map *map;
+
+ assert(mt->num_samples > 1);
+
+ /* Only flat, renderbuffer-like miptrees are supported. */
+ if (mt->target != GL_TEXTURE_2D ||
+ mt->first_level != 0 ||
+ mt->last_level != 0) {
+ _mesa_problem(&intel->ctx, "attempt to map a multisample miptree for "
+ "which (target, first_level, last_level != "
+ "(GL_TEXTURE_2D, 0, 0)");
+ goto fail;
+ }
+
+ map = intel_miptree_attach_map(mt, level, slice, x, y, w, h, mode);
+ if (!map)
+ goto fail;
+
+ if (!mt->singlesample_mt) {
+ mt->singlesample_mt =
+ intel_miptree_create_for_renderbuffer(intel,
+ mt->format,
+ mt->singlesample_width0,
+ mt->singlesample_height0,
+ 0 /*num_samples*/);
+ if (!mt->singlesample_mt)
+ goto fail;
+
+ map->singlesample_mt_is_tmp = true;
+ mt->need_downsample = true;
+ }
+
+ intel_miptree_downsample(intel, mt);
+ intel_miptree_map_singlesample(intel, mt->singlesample_mt,
+ level, slice,
+ x, y, w, h,
+ mode,
+ out_ptr, out_stride);
+ return;
+
+fail:
+ intel_miptree_release_map(mt, level, slice);
+ *out_ptr = NULL;
+ *out_stride = 0;
+}
+
+static void
+intel_miptree_unmap_multisample(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice)
+{
+ struct intel_miptree_map *map = mt->level[level].slice[slice].map;
+
+ assert(mt->num_samples > 1);
+
+ if (!map)
+ return;
+
+ intel_miptree_unmap_singlesample(intel, mt->singlesample_mt, level, slice);
+
+ mt->need_downsample = false;
+ if (map->mode & GL_MAP_WRITE_BIT)
+ intel_miptree_upsample(intel, mt);
+
+ if (map->singlesample_mt_is_tmp)
+ intel_miptree_release(&mt->singlesample_mt);
+
+ intel_miptree_release_map(mt, level, slice);
+}
+
+void
+intel_miptree_map(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice,
+ unsigned int x,
+ unsigned int y,
+ unsigned int w,
+ unsigned int h,
+ GLbitfield mode,
+ void **out_ptr,
+ int *out_stride)
+{
+ if (mt->num_samples <= 1)
+ intel_miptree_map_singlesample(intel, mt,
+ level, slice,
+ x, y, w, h,
+ mode,
+ out_ptr, out_stride);
+ else
+ intel_miptree_map_multisample(intel, mt,
+ level, slice,
+ x, y, w, h,
+ mode,
+ out_ptr, out_stride);
+}
+
+void
+intel_miptree_unmap(struct intel_context *intel,
+ struct intel_mipmap_tree *mt,
+ unsigned int level,
+ unsigned int slice)
+{
+ if (mt->num_samples <= 1)
+ intel_miptree_unmap_singlesample(intel, mt, level, slice);
+ else
+ intel_miptree_unmap_multisample(intel, mt, level, slice);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel.c
index d733c5e8745..bc705105d4d 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel.c
@@ -1 +1,167 @@
-../intel/intel_pixel.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/accum.h"
+#include "main/enums.h"
+#include "main/state.h"
+#include "main/bufferobj.h"
+#include "main/context.h"
+#include "swrast/swrast.h"
+
+#include "intel_context.h"
+#include "intel_pixel.h"
+#include "intel_regions.h"
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+static GLenum
+effective_func(GLenum func, bool src_alpha_is_one)
+{
+ if (src_alpha_is_one) {
+ if (func == GL_SRC_ALPHA)
+ return GL_ONE;
+ if (func == GL_ONE_MINUS_SRC_ALPHA)
+ return GL_ZERO;
+ }
+
+ return func;
+}
+
+/**
+ * Check if any fragment operations are in effect which might effect
+ * glDraw/CopyPixels.
+ */
+bool
+intel_check_blit_fragment_ops(struct gl_context * ctx, bool src_alpha_is_one)
+{
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ if (ctx->FragmentProgram._Enabled) {
+ DBG("fallback due to fragment program\n");
+ return false;
+ }
+
+ if (ctx->Color.BlendEnabled &&
+ (effective_func(ctx->Color.Blend[0].SrcRGB, src_alpha_is_one) != GL_ONE ||
+ effective_func(ctx->Color.Blend[0].DstRGB, src_alpha_is_one) != GL_ZERO ||
+ ctx->Color.Blend[0].EquationRGB != GL_FUNC_ADD ||
+ effective_func(ctx->Color.Blend[0].SrcA, src_alpha_is_one) != GL_ONE ||
+ effective_func(ctx->Color.Blend[0].DstA, src_alpha_is_one) != GL_ZERO ||
+ ctx->Color.Blend[0].EquationA != GL_FUNC_ADD)) {
+ DBG("fallback due to blend\n");
+ return false;
+ }
+
+ if (ctx->Texture._EnabledUnits) {
+ DBG("fallback due to texturing\n");
+ return false;
+ }
+
+ if (!(ctx->Color.ColorMask[0][0] &&
+ ctx->Color.ColorMask[0][1] &&
+ ctx->Color.ColorMask[0][2] &&
+ ctx->Color.ColorMask[0][3])) {
+ DBG("fallback due to color masking\n");
+ return false;
+ }
+
+ if (ctx->Color.AlphaEnabled) {
+ DBG("fallback due to alpha\n");
+ return false;
+ }
+
+ if (ctx->Depth.Test) {
+ DBG("fallback due to depth test\n");
+ return false;
+ }
+
+ if (ctx->Fog.Enabled) {
+ DBG("fallback due to fog\n");
+ return false;
+ }
+
+ if (ctx->_ImageTransferState) {
+ DBG("fallback due to image transfer\n");
+ return false;
+ }
+
+ if (ctx->Stencil._Enabled) {
+ DBG("fallback due to image stencil\n");
+ return false;
+ }
+
+ if (ctx->RenderMode != GL_RENDER) {
+ DBG("fallback due to render mode\n");
+ return false;
+ }
+
+ return true;
+}
+
+/* The intel_region struct doesn't really do enough to capture the
+ * format of the pixels in the region. For now this code assumes that
+ * the region is a display surface and hence is either ARGB8888 or
+ * RGB565.
+ * XXX FBO: If we'd pass in the intel_renderbuffer instead of region, we'd
+ * know the buffer's pixel format.
+ *
+ * \param format as given to glDraw/ReadPixels
+ * \param type as given to glDraw/ReadPixels
+ */
+bool
+intel_check_blit_format(struct intel_region * region,
+ GLenum format, GLenum type)
+{
+ if (region->cpp == 4 &&
+ (type == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ type == GL_UNSIGNED_BYTE) && format == GL_BGRA) {
+ return true;
+ }
+
+ if (region->cpp == 2 &&
+ type == GL_UNSIGNED_SHORT_5_6_5_REV && format == GL_BGR) {
+ return true;
+ }
+
+ DBG("%s: bad format for blit (cpp %d, type %s format %s)\n",
+ __FUNCTION__, region->cpp,
+ _mesa_lookup_enum_by_nr(type), _mesa_lookup_enum_by_nr(format));
+
+ return false;
+}
+
+void
+intelInitPixelFuncs(struct dd_function_table *functions)
+{
+ functions->Accum = _mesa_accum;
+ functions->Bitmap = intelBitmap;
+ functions->CopyPixels = intelCopyPixels;
+ functions->DrawPixels = intelDrawPixels;
+ functions->ReadPixels = intelReadPixels;
+}
+
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
index 9085c7b0397..954dfc50b14 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
@@ -1 +1,340 @@
-../intel/intel_pixel_bitmap.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/colormac.h"
+#include "main/condrender.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/pbo.h"
+#include "main/bufferobj.h"
+#include "main/state.h"
+#include "main/texobj.h"
+#include "main/context.h"
+#include "main/fbobject.h"
+#include "swrast/swrast.h"
+#include "drivers/common/meta.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_blit.h"
+#include "intel_regions.h"
+#include "intel_buffers.h"
+#include "intel_pixel.h"
+#include "intel_reg.h"
+
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+
+/* Unlike the other intel_pixel_* functions, the expectation here is
+ * that the incoming data is not in a PBO. With the XY_TEXT blit
+ * method, there's no benefit haveing it in a PBO, but we could
+ * implement a path based on XY_MONO_SRC_COPY_BLIT which might benefit
+ * PBO bitmaps. I think they are probably pretty rare though - I
+ * wonder if Xgl uses them?
+ */
+static const GLubyte *map_pbo( struct gl_context *ctx,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ GLubyte *buf;
+
+ if (!_mesa_validate_pbo_access(2, unpack, width, height, 1,
+ GL_COLOR_INDEX, GL_BITMAP,
+ INT_MAX, (const GLvoid *) bitmap)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,"glBitmap(invalid PBO access)");
+ return NULL;
+ }
+
+ buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ unpack->BufferObj);
+ if (!buf) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)");
+ return NULL;
+ }
+
+ return ADD_POINTERS(buf, bitmap);
+}
+
+static bool test_bit( const GLubyte *src, GLuint bit )
+{
+ return (src[bit/8] & (1<<(bit % 8))) ? 1 : 0;
+}
+
+static void set_bit( GLubyte *dest, GLuint bit )
+{
+ dest[bit/8] |= 1 << (bit % 8);
+}
+
+/* Extract a rectangle's worth of data from the bitmap. Called
+ * per chunk of HW-sized bitmap.
+ */
+static GLuint get_bitmap_rect(GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap,
+ GLuint x, GLuint y,
+ GLuint w, GLuint h,
+ GLubyte *dest,
+ GLuint row_align,
+ bool invert)
+{
+ GLuint src_offset = (x + unpack->SkipPixels) & 0x7;
+ GLuint mask = unpack->LsbFirst ? 0 : 7;
+ GLuint bit = 0;
+ GLint row, col;
+ GLint first, last;
+ GLint incr;
+ GLuint count = 0;
+
+ DBG("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n",
+ __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask);
+
+ if (invert) {
+ first = h-1;
+ last = 0;
+ incr = -1;
+ }
+ else {
+ first = 0;
+ last = h-1;
+ incr = 1;
+ }
+
+ /* Require that dest be pre-zero'd.
+ */
+ for (row = first; row != (last+incr); row += incr) {
+ const GLubyte *rowsrc = _mesa_image_address2d(unpack, bitmap,
+ width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ y + row, x);
+
+ for (col = 0; col < w; col++, bit++) {
+ if (test_bit(rowsrc, (col + src_offset) ^ mask)) {
+ set_bit(dest, bit ^ 7);
+ count++;
+ }
+ }
+
+ if (row_align)
+ bit = ALIGN(bit, row_align);
+ }
+
+ return count;
+}
+
+/**
+ * Returns the low Y value of the vertical range given, flipped according to
+ * whether the framebuffer is or not.
+ */
+static INLINE int
+y_flip(struct gl_framebuffer *fb, int y, int height)
+{
+ if (_mesa_is_user_fbo(fb))
+ return y;
+ else
+ return fb->Height - y - height;
+}
+
+/*
+ * Render a bitmap.
+ */
+static bool
+do_blit_bitmap( struct gl_context *ctx,
+ GLint dstx, GLint dsty,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte *bitmap )
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *dst;
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ GLfloat tmpColor[4];
+ GLubyte ubcolor[4];
+ GLuint color;
+ GLsizei bitmap_width = width;
+ GLsizei bitmap_height = height;
+ GLint px, py;
+ GLuint stipple[32];
+ GLint orig_dstx = dstx;
+ GLint orig_dsty = dsty;
+
+ /* Update draw buffer bounds */
+ _mesa_update_state(ctx);
+
+ if (ctx->Depth.Test) {
+ /* The blit path produces incorrect results when depth testing is on.
+ * It seems the blit Z coord is always 1.0 (the far plane) so fragments
+ * will likely be obscured by other, closer geometry.
+ */
+ return false;
+ }
+
+ intel_prepare_render(intel);
+ dst = intel_drawbuf_region(intel);
+
+ if (!dst)
+ return false;
+
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ bitmap = map_pbo(ctx, width, height, unpack, bitmap);
+ if (bitmap == NULL)
+ return true; /* even though this is an error, we're done */
+ }
+
+ COPY_4V(tmpColor, ctx->Current.RasterColor);
+
+ if (_mesa_need_secondary_color(ctx)) {
+ ADD_3V(tmpColor, tmpColor, ctx->Current.RasterSecondaryColor);
+ }
+
+ UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[0], tmpColor[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[1], tmpColor[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[2], tmpColor[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
+
+ if (dst->cpp == 2)
+ color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]);
+ else
+ color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
+
+ if (!intel_check_blit_fragment_ops(ctx, tmpColor[3] == 1.0F))
+ return false;
+
+ /* Clip to buffer bounds and scissor. */
+ if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin,
+ fb->_Xmax, fb->_Ymax,
+ &dstx, &dsty, &width, &height))
+ goto out;
+
+ dsty = y_flip(fb, dsty, height);
+
+#define DY 32
+#define DX 32
+
+ /* Chop it all into chunks that can be digested by hardware: */
+ for (py = 0; py < height; py += DY) {
+ for (px = 0; px < width; px += DX) {
+ int h = MIN2(DY, height - py);
+ int w = MIN2(DX, width - px);
+ GLuint sz = ALIGN(ALIGN(w,8) * h, 64)/8;
+ GLenum logic_op = ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY;
+
+ assert(sz <= sizeof(stipple));
+ memset(stipple, 0, sz);
+
+ /* May need to adjust this when padding has been introduced in
+ * sz above:
+ *
+ * Have to translate destination coordinates back into source
+ * coordinates.
+ */
+ if (get_bitmap_rect(bitmap_width, bitmap_height, unpack,
+ bitmap,
+ -orig_dstx + (dstx + px),
+ -orig_dsty + y_flip(fb, dsty + py, h),
+ w, h,
+ (GLubyte *)stipple,
+ 8,
+ _mesa_is_winsys_fbo(fb)) == 0)
+ continue;
+
+ if (!intelEmitImmediateColorExpandBlit(intel,
+ dst->cpp,
+ (GLubyte *)stipple,
+ sz,
+ color,
+ dst->pitch,
+ dst->bo,
+ 0,
+ dst->tiling,
+ dstx + px,
+ dsty + py,
+ w, h,
+ logic_op)) {
+ return false;
+ }
+ }
+ }
+out:
+
+ if (unlikely(INTEL_DEBUG & DEBUG_SYNC))
+ intel_batchbuffer_flush(intel);
+
+ if (_mesa_is_bufferobj(unpack->BufferObj)) {
+ /* done with PBO so unmap it now */
+ ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj);
+ }
+
+ intel_check_front_buffer_rendering(intel);
+
+ return true;
+}
+
+
+/* There are a large number of possible ways to implement bitmap on
+ * this hardware, most of them have some sort of drawback. Here are a
+ * few that spring to mind:
+ *
+ * Blit:
+ * - XY_MONO_SRC_BLT_CMD
+ * - use XY_SETUP_CLIP_BLT for cliprect clipping.
+ * - XY_TEXT_BLT
+ * - XY_TEXT_IMMEDIATE_BLT
+ * - blit per cliprect, subject to maximum immediate data size.
+ * - XY_COLOR_BLT
+ * - per pixel or run of pixels
+ * - XY_PIXEL_BLT
+ * - good for sparse bitmaps
+ *
+ * 3D engine:
+ * - Point per pixel
+ * - Translate bitmap to an alpha texture and render as a quad
+ * - Chop bitmap up into 32x32 squares and render w/polygon stipple.
+ */
+void
+intelBitmap(struct gl_context * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLubyte * pixels)
+{
+ if (!_mesa_check_conditional_render(ctx))
+ return;
+
+ if (do_blit_bitmap(ctx, x, y, width, height,
+ unpack, pixels))
+ return;
+
+ _mesa_meta_Bitmap(ctx, x, y, width, height, unpack, pixels);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_copy.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_copy.c
index ee433605904..682a52d97d2 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_copy.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_copy.c
@@ -1 +1,230 @@
-../intel/intel_pixel_copy.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/image.h"
+#include "main/state.h"
+#include "main/mtypes.h"
+#include "main/condrender.h"
+#include "main/fbobject.h"
+#include "drivers/common/meta.h"
+
+#include "intel_context.h"
+#include "intel_buffers.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_pixel.h"
+#include "intel_fbo.h"
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+/**
+ * Check if any fragment operations are in effect which might effect
+ * glCopyPixels. Differs from intel_check_blit_fragment_ops in that
+ * we allow Scissor.
+ */
+static bool
+intel_check_copypixel_blit_fragment_ops(struct gl_context * ctx)
+{
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ /* Could do logicop with the blitter:
+ */
+ return !(ctx->_ImageTransferState ||
+ ctx->Color.AlphaEnabled ||
+ ctx->Depth.Test ||
+ ctx->Fog.Enabled ||
+ ctx->Stencil._Enabled ||
+ !ctx->Color.ColorMask[0][0] ||
+ !ctx->Color.ColorMask[0][1] ||
+ !ctx->Color.ColorMask[0][2] ||
+ !ctx->Color.ColorMask[0][3] ||
+ ctx->Texture._EnabledUnits ||
+ ctx->FragmentProgram._Enabled ||
+ ctx->Color.BlendEnabled);
+}
+
+
+/**
+ * CopyPixels with the blitter. Don't support zooming, pixel transfer, etc.
+ */
+static bool
+do_blit_copypixels(struct gl_context * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint dstx, GLint dsty, GLenum type)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct gl_framebuffer *read_fb = ctx->ReadBuffer;
+ GLint orig_dstx;
+ GLint orig_dsty;
+ GLint orig_srcx;
+ GLint orig_srcy;
+ bool flip = false;
+ struct intel_renderbuffer *draw_irb = NULL;
+ struct intel_renderbuffer *read_irb = NULL;
+ gl_format read_format, draw_format;
+
+ /* Update draw buffer bounds */
+ _mesa_update_state(ctx);
+
+ switch (type) {
+ case GL_COLOR:
+ if (fb->_NumColorDrawBuffers != 1) {
+ fallback_debug("glCopyPixels() fallback: MRT\n");
+ return false;
+ }
+
+ draw_irb = intel_renderbuffer(fb->_ColorDrawBuffers[0]);
+ read_irb = intel_renderbuffer(read_fb->_ColorReadBuffer);
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ draw_irb = intel_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+ read_irb =
+ intel_renderbuffer(read_fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+ break;
+ case GL_DEPTH:
+ fallback_debug("glCopyPixels() fallback: GL_DEPTH\n");
+ return false;
+ case GL_STENCIL:
+ fallback_debug("glCopyPixels() fallback: GL_STENCIL\n");
+ return false;
+ default:
+ fallback_debug("glCopyPixels(): Unknown type\n");
+ return false;
+ }
+
+ if (!draw_irb) {
+ fallback_debug("glCopyPixels() fallback: missing draw buffer\n");
+ return false;
+ }
+
+ if (!read_irb) {
+ fallback_debug("glCopyPixels() fallback: missing read buffer\n");
+ return false;
+ }
+
+ read_format = intel_rb_format(read_irb);
+ draw_format = intel_rb_format(draw_irb);
+
+ if (draw_format != read_format &&
+ !(draw_format == MESA_FORMAT_XRGB8888 &&
+ read_format == MESA_FORMAT_ARGB8888)) {
+ fallback_debug("glCopyPixels() fallback: mismatched formats (%s -> %s\n",
+ _mesa_get_format_name(read_format),
+ _mesa_get_format_name(draw_format));
+ return false;
+ }
+
+ /* Copypixels can be more than a straight copy. Ensure all the
+ * extra operations are disabled:
+ */
+ if (!intel_check_copypixel_blit_fragment_ops(ctx) ||
+ ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F)
+ return false;
+
+ intel_prepare_render(intel);
+
+ intel_flush(&intel->ctx);
+
+ /* Clip to destination buffer. */
+ orig_dstx = dstx;
+ orig_dsty = dsty;
+ if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin,
+ fb->_Xmax, fb->_Ymax,
+ &dstx, &dsty, &width, &height))
+ goto out;
+ /* Adjust src coords for our post-clipped destination origin */
+ srcx += dstx - orig_dstx;
+ srcy += dsty - orig_dsty;
+
+ /* Clip to source buffer. */
+ orig_srcx = srcx;
+ orig_srcy = srcy;
+ if (!_mesa_clip_to_region(0, 0,
+ read_fb->Width, read_fb->Height,
+ &srcx, &srcy, &width, &height))
+ goto out;
+ /* Adjust dst coords for our post-clipped source origin */
+ dstx += srcx - orig_srcx;
+ dsty += srcy - orig_srcy;
+
+ /* Flip dest Y if it's a window system framebuffer. */
+ if (_mesa_is_winsys_fbo(fb)) {
+ /* copypixels to a window system framebuffer */
+ dsty = fb->Height - dsty - height;
+ flip = !flip;
+ }
+
+ /* Flip source Y if it's a window system framebuffer. */
+ if (_mesa_is_winsys_fbo(read_fb)) {
+ srcy = read_fb->Height - srcy - height;
+ flip = !flip;
+ }
+
+ srcx += read_irb->draw_x;
+ srcy += read_irb->draw_y;
+ dstx += draw_irb->draw_x;
+ dsty += draw_irb->draw_y;
+
+ if (!intel_region_copy(intel,
+ draw_irb->mt->region, 0, dstx, dsty,
+ read_irb->mt->region, 0, srcx, srcy,
+ width, height, flip,
+ ctx->Color.ColorLogicOpEnabled ?
+ ctx->Color.LogicOp : GL_COPY)) {
+ DBG("%s: blit failure\n", __FUNCTION__);
+ return false;
+ }
+
+out:
+ intel_check_front_buffer_rendering(intel);
+
+ DBG("%s: success\n", __FUNCTION__);
+ return true;
+}
+
+
+void
+intelCopyPixels(struct gl_context * ctx,
+ GLint srcx, GLint srcy,
+ GLsizei width, GLsizei height,
+ GLint destx, GLint desty, GLenum type)
+{
+ DBG("%s\n", __FUNCTION__);
+
+ if (!_mesa_check_conditional_render(ctx))
+ return;
+
+ if (do_blit_copypixels(ctx, srcx, srcy, width, height, destx, desty, type))
+ return;
+
+ /* this will use swrast if needed */
+ _mesa_meta_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_draw.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_draw.c
index 8431a24edfc..2ec7ed8e269 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_draw.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_draw.c
@@ -1 +1,58 @@
-../intel/intel_pixel_draw.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portionsalloc
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/mtypes.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/texstate.h"
+#include "swrast/swrast.h"
+#include "drivers/common/meta.h"
+
+#include "intel_context.h"
+#include "intel_pixel.h"
+
+void
+intelDrawPixels(struct gl_context * ctx,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height,
+ GLenum format,
+ GLenum type,
+ const struct gl_pixelstore_attrib *unpack,
+ const GLvoid * pixels)
+{
+ if (format == GL_STENCIL_INDEX) {
+ _swrast_DrawPixels(ctx, x, y, width, height, format, type,
+ unpack, pixels);
+ return;
+ }
+
+ _mesa_meta_DrawPixels(ctx, x, y, width, height, format, type,
+ unpack, pixels);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_read.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_read.c
index cc4589f4d42..ab4e581c400 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_read.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_pixel_read.c
@@ -1 +1,205 @@
-../intel/intel_pixel_read.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/fbobject.h"
+#include "main/image.h"
+#include "main/bufferobj.h"
+#include "main/readpix.h"
+#include "main/state.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_blit.h"
+#include "intel_buffers.h"
+#include "intel_regions.h"
+#include "intel_pixel.h"
+#include "intel_buffer_objects.h"
+
+#define FILE_DEBUG_FLAG DEBUG_PIXEL
+
+/* For many applications, the new ability to pull the source buffers
+ * back out of the GTT and then do the packing/conversion operations
+ * in software will be as much of an improvement as trying to get the
+ * blitter and/or texture engine to do the work.
+ *
+ * This step is gated on private backbuffers.
+ *
+ * Obviously the frontbuffer can't be pulled back, so that is either
+ * an argument for blit/texture readpixels, or for blitting to a
+ * temporary and then pulling that back.
+ *
+ * When the destination is a pbo, however, it's not clear if it is
+ * ever going to be pulled to main memory (though the access param
+ * will be a good hint). So it sounds like we do want to be able to
+ * choose between blit/texture implementation on the gpu and pullback
+ * and cpu-based copying.
+ *
+ * Unless you can magically turn client memory into a PBO for the
+ * duration of this call, there will be a cpu-based copying step in
+ * any case.
+ */
+
+static bool
+do_blit_readpixels(struct gl_context * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_region *src = intel_readbuf_region(intel);
+ struct intel_buffer_object *dst = intel_buffer_object(pack->BufferObj);
+ GLuint dst_offset;
+ GLuint rowLength;
+ drm_intel_bo *dst_buffer;
+ bool all;
+ GLint dst_x, dst_y;
+ GLuint dirty;
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (!src)
+ return false;
+
+ if (!_mesa_is_bufferobj(pack->BufferObj)) {
+ /* PBO only for now:
+ */
+ DBG("%s - not PBO\n", __FUNCTION__);
+ return false;
+ }
+
+
+ if (ctx->_ImageTransferState ||
+ !intel_check_blit_format(src, format, type)) {
+ DBG("%s - bad format for blit\n", __FUNCTION__);
+ return false;
+ }
+
+ if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) {
+ DBG("%s: bad packing params\n", __FUNCTION__);
+ return false;
+ }
+
+ if (pack->RowLength > 0)
+ rowLength = pack->RowLength;
+ else
+ rowLength = width;
+
+ if (pack->Invert) {
+ DBG("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__);
+ return false;
+ }
+ else {
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
+ rowLength = -rowLength;
+ }
+
+ dst_offset = (GLintptr)pixels;
+ dst_offset += _mesa_image_offset(2, pack, width, height,
+ format, type, 0, 0, 0);
+
+ if (!_mesa_clip_copytexsubimage(ctx,
+ &dst_x, &dst_y,
+ &x, &y,
+ &width, &height)) {
+ return true;
+ }
+
+ dirty = intel->front_buffer_dirty;
+ intel_prepare_render(intel);
+ intel->front_buffer_dirty = dirty;
+
+ all = (width * height * src->cpp == dst->Base.Size &&
+ x == 0 && dst_offset == 0);
+
+ dst_x = 0;
+ dst_y = 0;
+
+ dst_buffer = intel_bufferobj_buffer(intel, dst,
+ all ? INTEL_WRITE_FULL :
+ INTEL_WRITE_PART);
+
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer))
+ y = ctx->ReadBuffer->Height - (y + height);
+
+ if (!intelEmitCopyBlit(intel,
+ src->cpp,
+ src->pitch, src->bo, 0, src->tiling,
+ rowLength, dst_buffer, dst_offset, false,
+ x, y,
+ dst_x, dst_y,
+ width, height,
+ GL_COPY)) {
+ return false;
+ }
+
+ DBG("%s - DONE\n", __FUNCTION__);
+
+ return true;
+}
+
+void
+intelReadPixels(struct gl_context * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
+{
+ struct intel_context *intel = intel_context(ctx);
+ bool dirty;
+
+ intel_flush_rendering_to_batch(ctx);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (do_blit_readpixels
+ (ctx, x, y, width, height, format, type, pack, pixels))
+ return;
+
+ /* glReadPixels() wont dirty the front buffer, so reset the dirty
+ * flag after calling intel_prepare_render(). */
+ dirty = intel->front_buffer_dirty;
+ intel_prepare_render(intel);
+ intel->front_buffer_dirty = dirty;
+
+ fallback_debug("%s: fallback to swrast\n", __FUNCTION__);
+
+ /* Update Mesa state before calling _mesa_readpixels().
+ * XXX this may not be needed since ReadPixels no longer uses the
+ * span code.
+ */
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ _mesa_readpixels(ctx, x, y, width, height, format, type, pack, pixels);
+
+ /* There's an intel_prepare_render() call in intelSpanRenderStart(). */
+ intel->front_buffer_dirty = dirty;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_regions.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_regions.c
index 89b2f15c10f..7cb008c2f71 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_regions.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_regions.c
@@ -1 +1,473 @@
-../intel/intel_regions.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/* Provide additional functionality on top of bufmgr buffers:
+ * - 2d semantics and blit operations
+ * - refcounting of buffers for multiple images in a buffer.
+ * - refcounting of buffer mappings.
+ * - some logic for moving the buffers to the best memory pools for
+ * given operations.
+ *
+ * Most of this is to make it easier to implement the fixed-layout
+ * mipmap tree required by intel hardware in the face of GL's
+ * programming interface where each image can be specifed in random
+ * order and it isn't clear what layout the tree should have until the
+ * last moment.
+ */
+
+#include <sys/ioctl.h>
+#include <errno.h>
+
+#include "main/hash.h"
+#include "intel_context.h"
+#include "intel_regions.h"
+#include "intel_blit.h"
+#include "intel_buffer_objects.h"
+#include "intel_bufmgr.h"
+#include "intel_batchbuffer.h"
+
+#define FILE_DEBUG_FLAG DEBUG_REGION
+
+/* This should be set to the maximum backtrace size desired.
+ * Set it to 0 to disable backtrace debugging.
+ */
+#define DEBUG_BACKTRACE_SIZE 0
+
+#if DEBUG_BACKTRACE_SIZE == 0
+/* Use the standard debug output */
+#define _DBG(...) DBG(__VA_ARGS__)
+#else
+/* Use backtracing debug output */
+#define _DBG(...) {debug_backtrace(); DBG(__VA_ARGS__);}
+
+/* Backtracing debug support */
+#include <execinfo.h>
+
+static void
+debug_backtrace(void)
+{
+ void *trace[DEBUG_BACKTRACE_SIZE];
+ char **strings = NULL;
+ int traceSize;
+ register int i;
+
+ traceSize = backtrace(trace, DEBUG_BACKTRACE_SIZE);
+ strings = backtrace_symbols(trace, traceSize);
+ if (strings == NULL) {
+ DBG("no backtrace:");
+ return;
+ }
+
+ /* Spit out all the strings with a colon separator. Ignore
+ * the first, since we don't really care about the call
+ * to debug_backtrace() itself. Skip until the final "/" in
+ * the trace to avoid really long lines.
+ */
+ for (i = 1; i < traceSize; i++) {
+ char *p = strings[i], *slash = strings[i];
+ while (*p) {
+ if (*p++ == '/') {
+ slash = p;
+ }
+ }
+
+ DBG("%s:", slash);
+ }
+
+ /* Free up the memory, and we're done */
+ free(strings);
+}
+
+#endif
+
+
+
+/* XXX: Thread safety?
+ */
+void *
+intel_region_map(struct intel_context *intel, struct intel_region *region,
+ GLbitfield mode)
+{
+ /* We have the region->map_refcount controlling mapping of the BO because
+ * in software fallbacks we may end up mapping the same buffer multiple
+ * times on Mesa's behalf, so we refcount our mappings to make sure that
+ * the pointer stays valid until the end of the unmap chain. However, we
+ * must not emit any batchbuffers between the start of mapping and the end
+ * of unmapping, or further use of the map will be incoherent with the GPU
+ * rendering done by that batchbuffer. Hence we assert in
+ * intel_batchbuffer_flush() that that doesn't happen, which means that the
+ * flush is only needed on first map of the buffer.
+ */
+
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF)) {
+ if (drm_intel_bo_busy(region->bo)) {
+ perf_debug("Mapping a busy BO, causing a stall on the GPU.\n");
+ }
+ }
+
+ _DBG("%s %p\n", __FUNCTION__, region);
+ if (!region->map_refcount) {
+ intel_flush(&intel->ctx);
+
+ if (region->tiling != I915_TILING_NONE)
+ drm_intel_gem_bo_map_gtt(region->bo);
+ else
+ drm_intel_bo_map(region->bo, true);
+
+ region->map = region->bo->virtual;
+ }
+ if (region->map) {
+ intel->num_mapped_regions++;
+ region->map_refcount++;
+ }
+
+ return region->map;
+}
+
+void
+intel_region_unmap(struct intel_context *intel, struct intel_region *region)
+{
+ _DBG("%s %p\n", __FUNCTION__, region);
+ if (!--region->map_refcount) {
+ if (region->tiling != I915_TILING_NONE)
+ drm_intel_gem_bo_unmap_gtt(region->bo);
+ else
+ drm_intel_bo_unmap(region->bo);
+
+ region->map = NULL;
+ --intel->num_mapped_regions;
+ assert(intel->num_mapped_regions >= 0);
+ }
+}
+
+static struct intel_region *
+intel_region_alloc_internal(struct intel_screen *screen,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
+ uint32_t tiling, drm_intel_bo *buffer)
+{
+ struct intel_region *region;
+
+ region = calloc(sizeof(*region), 1);
+ if (region == NULL)
+ return region;
+
+ region->cpp = cpp;
+ region->width = width;
+ region->height = height;
+ region->pitch = pitch;
+ region->refcount = 1;
+ region->bo = buffer;
+ region->tiling = tiling;
+ region->screen = screen;
+
+ _DBG("%s <-- %p\n", __FUNCTION__, region);
+ return region;
+}
+
+struct intel_region *
+intel_region_alloc(struct intel_screen *screen,
+ uint32_t tiling,
+ GLuint cpp, GLuint width, GLuint height,
+ bool expect_accelerated_upload)
+{
+ drm_intel_bo *buffer;
+ unsigned long flags = 0;
+ unsigned long aligned_pitch;
+ struct intel_region *region;
+
+ if (expect_accelerated_upload)
+ flags |= BO_ALLOC_FOR_RENDER;
+
+ buffer = drm_intel_bo_alloc_tiled(screen->bufmgr, "region",
+ width, height, cpp,
+ &tiling, &aligned_pitch, flags);
+ if (buffer == NULL)
+ return NULL;
+
+ region = intel_region_alloc_internal(screen, cpp, width, height,
+ aligned_pitch / cpp, tiling, buffer);
+ if (region == NULL) {
+ drm_intel_bo_unreference(buffer);
+ return NULL;
+ }
+
+ return region;
+}
+
+bool
+intel_region_flink(struct intel_region *region, uint32_t *name)
+{
+ if (region->name == 0) {
+ if (drm_intel_bo_flink(region->bo, &region->name))
+ return false;
+
+ _mesa_HashInsert(region->screen->named_regions,
+ region->name, region);
+ }
+
+ *name = region->name;
+
+ return true;
+}
+
+struct intel_region *
+intel_region_alloc_for_handle(struct intel_screen *screen,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
+ GLuint handle, const char *name)
+{
+ struct intel_region *region, *dummy;
+ drm_intel_bo *buffer;
+ int ret;
+ uint32_t bit_6_swizzle, tiling;
+
+ region = _mesa_HashLookup(screen->named_regions, handle);
+ if (region != NULL) {
+ dummy = NULL;
+ if (region->width != width || region->height != height ||
+ region->cpp != cpp || region->pitch != pitch) {
+ fprintf(stderr,
+ "Region for name %d already exists but is not compatible\n",
+ handle);
+ return NULL;
+ }
+ intel_region_reference(&dummy, region);
+ return dummy;
+ }
+
+ buffer = intel_bo_gem_create_from_name(screen->bufmgr, name, handle);
+ if (buffer == NULL)
+ return NULL;
+ ret = drm_intel_bo_get_tiling(buffer, &tiling, &bit_6_swizzle);
+ if (ret != 0) {
+ fprintf(stderr, "Couldn't get tiling of buffer %d (%s): %s\n",
+ handle, name, strerror(-ret));
+ drm_intel_bo_unreference(buffer);
+ return NULL;
+ }
+
+ region = intel_region_alloc_internal(screen, cpp,
+ width, height, pitch, tiling, buffer);
+ if (region == NULL) {
+ drm_intel_bo_unreference(buffer);
+ return NULL;
+ }
+
+ region->name = handle;
+ _mesa_HashInsert(screen->named_regions, handle, region);
+
+ return region;
+}
+
+void
+intel_region_reference(struct intel_region **dst, struct intel_region *src)
+{
+ _DBG("%s: %p(%d) -> %p(%d)\n", __FUNCTION__,
+ *dst, *dst ? (*dst)->refcount : 0, src, src ? src->refcount : 0);
+
+ if (src != *dst) {
+ if (*dst)
+ intel_region_release(dst);
+
+ if (src)
+ src->refcount++;
+ *dst = src;
+ }
+}
+
+void
+intel_region_release(struct intel_region **region_handle)
+{
+ struct intel_region *region = *region_handle;
+
+ if (region == NULL) {
+ _DBG("%s NULL\n", __FUNCTION__);
+ return;
+ }
+
+ _DBG("%s %p %d\n", __FUNCTION__, region, region->refcount - 1);
+
+ ASSERT(region->refcount > 0);
+ region->refcount--;
+
+ if (region->refcount == 0) {
+ assert(region->map_refcount == 0);
+
+ drm_intel_bo_unreference(region->bo);
+
+ if (region->name > 0)
+ _mesa_HashRemove(region->screen->named_regions, region->name);
+
+ free(region);
+ }
+ *region_handle = NULL;
+}
+
+/*
+ * XXX Move this into core Mesa?
+ */
+void
+_mesa_copy_rect(GLubyte * dst,
+ GLuint cpp,
+ GLuint dst_pitch,
+ GLuint dst_x,
+ GLuint dst_y,
+ GLuint width,
+ GLuint height,
+ const GLubyte * src,
+ GLuint src_pitch, GLuint src_x, GLuint src_y)
+{
+ GLuint i;
+
+ dst_pitch *= cpp;
+ src_pitch *= cpp;
+ dst += dst_x * cpp;
+ src += src_x * cpp;
+ dst += dst_y * dst_pitch;
+ src += src_y * src_pitch;
+ width *= cpp;
+
+ if (width == dst_pitch && width == src_pitch)
+ memcpy(dst, src, height * width);
+ else {
+ for (i = 0; i < height; i++) {
+ memcpy(dst, src, width);
+ dst += dst_pitch;
+ src += src_pitch;
+ }
+ }
+}
+
+/* Copy rectangular sub-regions. Need better logic about when to
+ * push buffers into AGP - will currently do so whenever possible.
+ */
+bool
+intel_region_copy(struct intel_context *intel,
+ struct intel_region *dst,
+ GLuint dst_offset,
+ GLuint dstx, GLuint dsty,
+ struct intel_region *src,
+ GLuint src_offset,
+ GLuint srcx, GLuint srcy, GLuint width, GLuint height,
+ bool flip,
+ GLenum logicop)
+{
+ uint32_t src_pitch = src->pitch;
+
+ _DBG("%s\n", __FUNCTION__);
+
+ if (intel == NULL)
+ return false;
+
+ assert(src->cpp == dst->cpp);
+
+ if (flip)
+ src_pitch = -src_pitch;
+
+ return intelEmitCopyBlit(intel,
+ dst->cpp,
+ src_pitch, src->bo, src_offset, src->tiling,
+ dst->pitch, dst->bo, dst_offset, dst->tiling,
+ srcx, srcy, dstx, dsty, width, height,
+ logicop);
+}
+
+/**
+ * This function computes masks that may be used to select the bits of the X
+ * and Y coordinates that indicate the offset within a tile. If the region is
+ * untiled, the masks are set to 0.
+ */
+void
+intel_region_get_tile_masks(struct intel_region *region,
+ uint32_t *mask_x, uint32_t *mask_y,
+ bool map_stencil_as_y_tiled)
+{
+ int cpp = region->cpp;
+ uint32_t tiling = region->tiling;
+
+ if (map_stencil_as_y_tiled)
+ tiling = I915_TILING_Y;
+
+ switch (tiling) {
+ default:
+ assert(false);
+ case I915_TILING_NONE:
+ *mask_x = *mask_y = 0;
+ break;
+ case I915_TILING_X:
+ *mask_x = 512 / cpp - 1;
+ *mask_y = 7;
+ break;
+ case I915_TILING_Y:
+ *mask_x = 128 / cpp - 1;
+ *mask_y = 31;
+ break;
+ }
+}
+
+/**
+ * Compute the offset (in bytes) from the start of the region to the given x
+ * and y coordinate. For tiled regions, caller must ensure that x and y are
+ * multiples of the tile size.
+ */
+uint32_t
+intel_region_get_aligned_offset(struct intel_region *region, uint32_t x,
+ uint32_t y, bool map_stencil_as_y_tiled)
+{
+ int cpp = region->cpp;
+ uint32_t pitch = region->pitch * cpp;
+ uint32_t tiling = region->tiling;
+
+ if (map_stencil_as_y_tiled) {
+ tiling = I915_TILING_Y;
+
+ /* When mapping a W-tiled stencil buffer as Y-tiled, each 64-high W-tile
+ * gets transformed into a 32-high Y-tile. Accordingly, the pitch of
+ * the resulting region is twice the pitch of the original region, since
+ * each row in the Y-tiled view corresponds to two rows in the actual
+ * W-tiled surface. So we need to correct the pitch before computing
+ * the offsets.
+ */
+ pitch *= 2;
+ }
+
+ switch (tiling) {
+ default:
+ assert(false);
+ case I915_TILING_NONE:
+ return y * pitch + x * cpp;
+ case I915_TILING_X:
+ assert((x % (512 / cpp)) == 0);
+ assert((y % 8) == 0);
+ return y * pitch + x / (512 / cpp) * 4096;
+ case I915_TILING_Y:
+ assert((x % (128 / cpp)) == 0);
+ assert((y % 32) == 0);
+ return y * pitch + x / (128 / cpp) * 4096;
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_resolve_map.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_resolve_map.c
index 77e50fbaea4..04b5c942432 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_resolve_map.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_resolve_map.c
@@ -1 +1,111 @@
-../intel/intel_resolve_map.c \ No newline at end of file
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "intel_resolve_map.h"
+
+#include <assert.h>
+#include <stdlib.h>
+
+/**
+ * \brief Set that the miptree slice at (level, layer) needs a resolve.
+ *
+ * If a map element already exists with the given key, then the value is
+ * changed to the given value of \c need.
+ */
+void
+intel_resolve_map_set(struct intel_resolve_map *head,
+ uint32_t level,
+ uint32_t layer,
+ enum gen6_hiz_op need)
+{
+ struct intel_resolve_map **tail = &head->next;
+ struct intel_resolve_map *prev = head;
+
+ while (*tail) {
+ if ((*tail)->level == level && (*tail)->layer == layer) {
+ (*tail)->need = need;
+ return;
+ }
+ prev = *tail;
+ tail = &(*tail)->next;
+ }
+
+ *tail = malloc(sizeof(**tail));
+ (*tail)->prev = prev;
+ (*tail)->next = NULL;
+ (*tail)->level = level;
+ (*tail)->layer = layer;
+ (*tail)->need = need;
+}
+
+/**
+ * \brief Get an element from the map.
+ * \return null if element is not contained in map.
+ */
+struct intel_resolve_map*
+intel_resolve_map_get(struct intel_resolve_map *head,
+ uint32_t level,
+ uint32_t layer)
+{
+ struct intel_resolve_map *item = head->next;
+
+ while (item) {
+ if (item->level == level && item->layer == layer)
+ break;
+ else
+ item = item->next;
+ }
+
+ return item;
+}
+
+/**
+ * \brief Remove and free an element from the map.
+ */
+void
+intel_resolve_map_remove(struct intel_resolve_map *elem)
+{
+ if (elem->prev)
+ elem->prev->next = elem->next;
+ if (elem->next)
+ elem->next->prev = elem->prev;
+ free(elem);
+}
+
+/**
+ * \brief Remove and free all elements of the map.
+ */
+void
+intel_resolve_map_clear(struct intel_resolve_map *head)
+{
+ struct intel_resolve_map *next = head->next;
+ struct intel_resolve_map *trash;
+
+ while (next) {
+ trash = next;
+ next = next->next;
+ free(trash);
+ }
+
+ head->next = NULL;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_screen.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_screen.c
index f2db48272b9..00a1b0122ec 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1 +1,1204 @@
-../intel/intel_screen.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <errno.h>
+#include <time.h>
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/hash.h"
+#include "main/fbobject.h"
+#include "main/mfeatures.h"
+#include "main/version.h"
+#include "swrast/s_renderbuffer.h"
+
+#include "utils.h"
+#include "xmlpool.h"
+
+PUBLIC const char __driConfigOptions[] =
+ DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_ALWAYS_SYNC)
+ /* Options correspond to DRI_CONF_BO_REUSE_DISABLED,
+ * DRI_CONF_BO_REUSE_ALL
+ */
+ DRI_CONF_OPT_BEGIN_V(bo_reuse, enum, 1, "0:1")
+ DRI_CONF_DESC_BEGIN(en, "Buffer object reuse")
+ DRI_CONF_ENUM(0, "Disable buffer object reuse")
+ DRI_CONF_ENUM(1, "Enable reuse of all sizes of buffer objects")
+ DRI_CONF_DESC_END
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(texture_tiling, bool, true)
+ DRI_CONF_DESC(en, "Enable texture tiling")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(hiz, bool, true)
+ DRI_CONF_DESC(en, "Enable Hierarchical Z on gen6+")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(early_z, bool, false)
+ DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(fragment_shader, bool, true)
+ DRI_CONF_DESC(en, "Enable limited ARB_fragment_shader support on 915/945.")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_QUALITY
+ DRI_CONF_FORCE_S3TC_ENABLE(false)
+ DRI_CONF_ALLOW_LARGE_TEXTURES(2)
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_NO_RAST(false)
+ DRI_CONF_ALWAYS_FLUSH_BATCH(false)
+ DRI_CONF_ALWAYS_FLUSH_CACHE(false)
+ DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
+ DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
+
+ DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false)
+ DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.")
+ DRI_CONF_OPT_END
+
+ DRI_CONF_OPT_BEGIN(shader_precompile, bool, true)
+ DRI_CONF_DESC(en, "Perform code generation at shader link time.")
+ DRI_CONF_OPT_END
+ DRI_CONF_SECTION_END
+DRI_CONF_END;
+
+const GLuint __driNConfigOptions = 15;
+
+#include "intel_batchbuffer.h"
+#include "intel_buffers.h"
+#include "intel_bufmgr.h"
+#include "intel_chipset.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_screen.h"
+#include "intel_tex.h"
+#include "intel_regions.h"
+
+#include "i915_drm.h"
+
+#ifdef USE_NEW_INTERFACE
+static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
+#endif /*USE_NEW_INTERFACE */
+
+/**
+ * For debugging purposes, this returns a time in seconds.
+ */
+double
+get_time(void)
+{
+ struct timespec tp;
+
+ clock_gettime(CLOCK_MONOTONIC, &tp);
+
+ return tp.tv_sec + tp.tv_nsec / 1000000000.0;
+}
+
+void
+aub_dump_bmp(struct gl_context *ctx)
+{
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+
+ for (int i = 0; i < fb->_NumColorDrawBuffers; i++) {
+ struct intel_renderbuffer *irb =
+ intel_renderbuffer(fb->_ColorDrawBuffers[i]);
+
+ if (irb && irb->mt) {
+ enum aub_dump_bmp_format format;
+
+ switch (irb->Base.Base.Format) {
+ case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_XRGB8888:
+ format = AUB_DUMP_BMP_FORMAT_ARGB_8888;
+ break;
+ default:
+ continue;
+ }
+
+ drm_intel_gem_bo_aub_dump_bmp(irb->mt->region->bo,
+ irb->draw_x,
+ irb->draw_y,
+ irb->Base.Base.Width,
+ irb->Base.Base.Height,
+ format,
+ irb->mt->region->pitch *
+ irb->mt->region->cpp,
+ 0);
+ }
+ }
+}
+
+static const __DRItexBufferExtension intelTexBufferExtension = {
+ { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
+ intelSetTexBuffer,
+ intelSetTexBuffer2,
+};
+
+static void
+intelDRI2Flush(__DRIdrawable *drawable)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct intel_context *intel = intel_context(ctx);
+ if (intel == NULL)
+ return;
+
+ if (intel->gen < 4)
+ INTEL_FIREVERTICES(intel);
+
+ intel_downsample_for_dri2_flush(intel, drawable);
+ intel->need_throttle = true;
+
+ if (intel->batch.used)
+ intel_batchbuffer_flush(intel);
+
+ if (INTEL_DEBUG & DEBUG_AUB) {
+ aub_dump_bmp(ctx);
+ }
+}
+
+static const struct __DRI2flushExtensionRec intelFlushExtension = {
+ { __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
+ intelDRI2Flush,
+ dri2InvalidateDrawable,
+};
+
+struct intel_image_format intel_image_formats[] = {
+ { __DRI_IMAGE_FOURCC_ARGB8888, __DRI_IMAGE_COMPONENTS_RGBA, 1,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_ARGB8888, 4 } } },
+
+ { __DRI_IMAGE_FOURCC_XRGB8888, __DRI_IMAGE_COMPONENTS_RGB, 1,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_XRGB8888, 4 }, } },
+
+ { __DRI_IMAGE_FOURCC_YUV410, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 2, 2, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_YUV411, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 2, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 2, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_YUV420, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 1, 1, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_YUV422, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 1, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 1, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_YUV444, __DRI_IMAGE_COMPONENTS_Y_U_V, 3,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 2, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 } } },
+
+ { __DRI_IMAGE_FOURCC_NV12, __DRI_IMAGE_COMPONENTS_Y_UV, 2,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 1, 1, __DRI_IMAGE_FORMAT_GR88, 2 } } },
+
+ { __DRI_IMAGE_FOURCC_NV16, __DRI_IMAGE_COMPONENTS_Y_UV, 2,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_R8, 1 },
+ { 1, 1, 0, __DRI_IMAGE_FORMAT_GR88, 2 } } },
+
+ /* For YUYV buffers, we set up two overlapping DRI images and treat
+ * them as planar buffers in the compositors. Plane 0 is GR88 and
+ * samples YU or YV pairs and places Y into the R component, while
+ * plane 1 is ARGB and samples YUYV clusters and places pairs and
+ * places U into the G component and V into A. This lets the
+ * texture sampler interpolate the Y components correctly when
+ * sampling from plane 0, and interpolate U and V correctly when
+ * sampling from plane 1. */
+ { __DRI_IMAGE_FOURCC_YUYV, __DRI_IMAGE_COMPONENTS_Y_XUXV, 2,
+ { { 0, 0, 0, __DRI_IMAGE_FORMAT_GR88, 2 },
+ { 0, 1, 0, __DRI_IMAGE_FORMAT_ARGB8888, 4 } } }
+};
+
+static __DRIimage *
+intel_allocate_image(int dri_format, void *loaderPrivate)
+{
+ __DRIimage *image;
+
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ image->dri_format = dri_format;
+ image->offset = 0;
+
+ switch (dri_format) {
+ case __DRI_IMAGE_FORMAT_RGB565:
+ image->format = MESA_FORMAT_RGB565;
+ break;
+ case __DRI_IMAGE_FORMAT_XRGB8888:
+ image->format = MESA_FORMAT_XRGB8888;
+ break;
+ case __DRI_IMAGE_FORMAT_ARGB8888:
+ image->format = MESA_FORMAT_ARGB8888;
+ break;
+ case __DRI_IMAGE_FORMAT_ABGR8888:
+ image->format = MESA_FORMAT_RGBA8888_REV;
+ break;
+ case __DRI_IMAGE_FORMAT_XBGR8888:
+ image->format = MESA_FORMAT_RGBX8888_REV;
+ break;
+ case __DRI_IMAGE_FORMAT_R8:
+ image->format = MESA_FORMAT_R8;
+ break;
+ case __DRI_IMAGE_FORMAT_GR88:
+ image->format = MESA_FORMAT_GR88;
+ break;
+ case __DRI_IMAGE_FORMAT_NONE:
+ image->format = MESA_FORMAT_NONE;
+ break;
+ default:
+ free(image);
+ return NULL;
+ }
+
+ image->internal_format = _mesa_get_format_base_format(image->format);
+ image->data = loaderPrivate;
+
+ return image;
+}
+
+static __DRIimage *
+intel_create_image_from_name(__DRIscreen *screen,
+ int width, int height, int format,
+ int name, int pitch, void *loaderPrivate)
+{
+ struct intel_screen *intelScreen = screen->driverPrivate;
+ __DRIimage *image;
+ int cpp;
+
+ image = intel_allocate_image(format, loaderPrivate);
+ if (image->format == MESA_FORMAT_NONE)
+ cpp = 1;
+ else
+ cpp = _mesa_get_format_bytes(image->format);
+ image->region = intel_region_alloc_for_handle(intelScreen,
+ cpp, width, height,
+ pitch, name, "image");
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ return image;
+}
+
+static __DRIimage *
+intel_create_image_from_renderbuffer(__DRIcontext *context,
+ int renderbuffer, void *loaderPrivate)
+{
+ __DRIimage *image;
+ struct intel_context *intel = context->driverPrivate;
+ struct gl_renderbuffer *rb;
+ struct intel_renderbuffer *irb;
+
+ rb = _mesa_lookup_renderbuffer(&intel->ctx, renderbuffer);
+ if (!rb) {
+ _mesa_error(&intel->ctx,
+ GL_INVALID_OPERATION, "glRenderbufferExternalMESA");
+ return NULL;
+ }
+
+ irb = intel_renderbuffer(rb);
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ image->internal_format = rb->InternalFormat;
+ image->format = rb->Format;
+ image->offset = 0;
+ image->data = loaderPrivate;
+ intel_region_reference(&image->region, irb->mt->region);
+
+ switch (image->format) {
+ case MESA_FORMAT_RGB565:
+ image->dri_format = __DRI_IMAGE_FORMAT_RGB565;
+ break;
+ case MESA_FORMAT_XRGB8888:
+ image->dri_format = __DRI_IMAGE_FORMAT_XRGB8888;
+ break;
+ case MESA_FORMAT_ARGB8888:
+ image->dri_format = __DRI_IMAGE_FORMAT_ARGB8888;
+ break;
+ case MESA_FORMAT_RGBA8888_REV:
+ image->dri_format = __DRI_IMAGE_FORMAT_ABGR8888;
+ break;
+ case MESA_FORMAT_R8:
+ image->dri_format = __DRI_IMAGE_FORMAT_R8;
+ break;
+ case MESA_FORMAT_RG88:
+ image->dri_format = __DRI_IMAGE_FORMAT_GR88;
+ break;
+ }
+
+ return image;
+}
+
+static void
+intel_destroy_image(__DRIimage *image)
+{
+ intel_region_release(&image->region);
+ FREE(image);
+}
+
+static __DRIimage *
+intel_create_image(__DRIscreen *screen,
+ int width, int height, int format,
+ unsigned int use,
+ void *loaderPrivate)
+{
+ __DRIimage *image;
+ struct intel_screen *intelScreen = screen->driverPrivate;
+ uint32_t tiling;
+ int cpp;
+
+ tiling = I915_TILING_X;
+ if (use & __DRI_IMAGE_USE_CURSOR) {
+ if (width != 64 || height != 64)
+ return NULL;
+ tiling = I915_TILING_NONE;
+ }
+
+ image = intel_allocate_image(format, loaderPrivate);
+ cpp = _mesa_get_format_bytes(image->format);
+ image->region =
+ intel_region_alloc(intelScreen, tiling, cpp, width, height, true);
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ return image;
+}
+
+static GLboolean
+intel_query_image(__DRIimage *image, int attrib, int *value)
+{
+ switch (attrib) {
+ case __DRI_IMAGE_ATTRIB_STRIDE:
+ *value = image->region->pitch * image->region->cpp;
+ return true;
+ case __DRI_IMAGE_ATTRIB_HANDLE:
+ *value = image->region->bo->handle;
+ return true;
+ case __DRI_IMAGE_ATTRIB_NAME:
+ return intel_region_flink(image->region, (uint32_t *) value);
+ case __DRI_IMAGE_ATTRIB_FORMAT:
+ *value = image->dri_format;
+ return true;
+ case __DRI_IMAGE_ATTRIB_WIDTH:
+ *value = image->region->width;
+ return true;
+ case __DRI_IMAGE_ATTRIB_HEIGHT:
+ *value = image->region->height;
+ return true;
+ case __DRI_IMAGE_ATTRIB_COMPONENTS:
+ if (image->planar_format == NULL)
+ return false;
+ *value = image->planar_format->components;
+ return true;
+ default:
+ return false;
+ }
+}
+
+static __DRIimage *
+intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
+{
+ __DRIimage *image;
+
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ intel_region_reference(&image->region, orig_image->region);
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ image->internal_format = orig_image->internal_format;
+ image->planar_format = orig_image->planar_format;
+ image->dri_format = orig_image->dri_format;
+ image->format = orig_image->format;
+ image->offset = orig_image->offset;
+ image->data = loaderPrivate;
+
+ memcpy(image->strides, orig_image->strides, sizeof(image->strides));
+ memcpy(image->offsets, orig_image->offsets, sizeof(image->offsets));
+
+ return image;
+}
+
+static GLboolean
+intel_validate_usage(__DRIimage *image, unsigned int use)
+{
+ if (use & __DRI_IMAGE_USE_CURSOR) {
+ if (image->region->width != 64 || image->region->height != 64)
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static __DRIimage *
+intel_create_image_from_names(__DRIscreen *screen,
+ int width, int height, int fourcc,
+ int *names, int num_names,
+ int *strides, int *offsets,
+ void *loaderPrivate)
+{
+ struct intel_image_format *f = NULL;
+ __DRIimage *image;
+ int i, index;
+
+ if (screen == NULL || names == NULL || num_names != 1)
+ return NULL;
+
+ for (i = 0; i < ARRAY_SIZE(intel_image_formats); i++) {
+ if (intel_image_formats[i].fourcc == fourcc) {
+ f = &intel_image_formats[i];
+ }
+ }
+
+ if (f == NULL)
+ return NULL;
+
+ image = intel_create_image_from_name(screen, width, height,
+ __DRI_IMAGE_FORMAT_NONE,
+ names[0], strides[0],
+ loaderPrivate);
+
+ if (image == NULL)
+ return NULL;
+
+ image->planar_format = f;
+ for (i = 0; i < f->nplanes; i++) {
+ index = f->planes[i].buffer_index;
+ image->offsets[index] = offsets[index];
+ image->strides[index] = strides[index];
+ }
+
+ return image;
+}
+
+static __DRIimage *
+intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
+{
+ int width, height, offset, stride, dri_format, cpp, index, pitch;
+ struct intel_image_format *f;
+ uint32_t mask_x, mask_y;
+ __DRIimage *image;
+
+ if (parent == NULL || parent->planar_format == NULL)
+ return NULL;
+
+ f = parent->planar_format;
+
+ if (plane >= f->nplanes)
+ return NULL;
+
+ width = parent->region->width >> f->planes[plane].width_shift;
+ height = parent->region->height >> f->planes[plane].height_shift;
+ dri_format = f->planes[plane].dri_format;
+ index = f->planes[plane].buffer_index;
+ offset = parent->offsets[index];
+ stride = parent->strides[index];
+
+ image = intel_allocate_image(dri_format, loaderPrivate);
+ cpp = _mesa_get_format_bytes(image->format); /* safe since no none format */
+ pitch = stride / cpp;
+ if (offset + height * cpp * pitch > parent->region->bo->size) {
+ _mesa_warning(NULL, "intel_create_sub_image: subimage out of bounds");
+ FREE(image);
+ return NULL;
+ }
+
+ image->region = calloc(sizeof(*image->region), 1);
+ if (image->region == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ image->region->cpp = _mesa_get_format_bytes(image->format);
+ image->region->width = width;
+ image->region->height = height;
+ image->region->pitch = pitch;
+ image->region->refcount = 1;
+ image->region->bo = parent->region->bo;
+ drm_intel_bo_reference(image->region->bo);
+ image->region->tiling = parent->region->tiling;
+ image->region->screen = parent->region->screen;
+ image->offset = offset;
+
+ intel_region_get_tile_masks(image->region, &mask_x, &mask_y, false);
+ if (offset & mask_x)
+ _mesa_warning(NULL,
+ "intel_create_sub_image: offset not on tile boundary");
+
+ return image;
+}
+
+static struct __DRIimageExtensionRec intelImageExtension = {
+ { __DRI_IMAGE, 5 },
+ intel_create_image_from_name,
+ intel_create_image_from_renderbuffer,
+ intel_destroy_image,
+ intel_create_image,
+ intel_query_image,
+ intel_dup_image,
+ intel_validate_usage,
+ intel_create_image_from_names,
+ intel_from_planar
+};
+
+static const __DRIextension *intelScreenExtensions[] = {
+ &intelTexBufferExtension.base,
+ &intelFlushExtension.base,
+ &intelImageExtension.base,
+ &dri2ConfigQueryExtension.base,
+ NULL
+};
+
+static bool
+intel_get_param(__DRIscreen *psp, int param, int *value)
+{
+ int ret;
+ struct drm_i915_getparam gp;
+
+ memset(&gp, 0, sizeof(gp));
+ gp.param = param;
+ gp.value = value;
+
+ ret = drmCommandWriteRead(psp->fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
+ if (ret) {
+ if (ret != -EINVAL)
+ _mesa_warning(NULL, "drm_i915_getparam: %d", ret);
+ return false;
+ }
+
+ return true;
+}
+
+static bool
+intel_get_boolean(__DRIscreen *psp, int param)
+{
+ int value = 0;
+ return intel_get_param(psp, param, &value) && value;
+}
+
+static void
+nop_callback(GLuint key, void *data, void *userData)
+{
+}
+
+static void
+intelDestroyScreen(__DRIscreen * sPriv)
+{
+ struct intel_screen *intelScreen = sPriv->driverPrivate;
+
+ dri_bufmgr_destroy(intelScreen->bufmgr);
+ driDestroyOptionInfo(&intelScreen->optionCache);
+
+ /* Some regions may still have references to them at this point, so
+ * flush the hash table to prevent _mesa_DeleteHashTable() from
+ * complaining about the hash not being empty; */
+ _mesa_HashDeleteAll(intelScreen->named_regions, nop_callback, NULL);
+ _mesa_DeleteHashTable(intelScreen->named_regions);
+
+ FREE(intelScreen);
+ sPriv->driverPrivate = NULL;
+}
+
+
+/**
+ * This is called when we need to set up GL rendering to a new X window.
+ */
+static GLboolean
+intelCreateBuffer(__DRIscreen * driScrnPriv,
+ __DRIdrawable * driDrawPriv,
+ const struct gl_config * mesaVis, GLboolean isPixmap)
+{
+ struct intel_renderbuffer *rb;
+ struct intel_screen *screen = (struct intel_screen*) driScrnPriv->driverPrivate;
+ gl_format rgbFormat;
+ unsigned num_samples = intel_quantize_num_samples(screen, mesaVis->samples);
+ struct gl_framebuffer *fb;
+
+ if (isPixmap)
+ return false;
+
+ fb = CALLOC_STRUCT(gl_framebuffer);
+ if (!fb)
+ return false;
+
+ _mesa_initialize_window_framebuffer(fb, mesaVis);
+
+ if (mesaVis->redBits == 5)
+ rgbFormat = MESA_FORMAT_RGB565;
+ else if (mesaVis->alphaBits == 0)
+ rgbFormat = MESA_FORMAT_XRGB8888;
+ else
+ rgbFormat = MESA_FORMAT_ARGB8888;
+
+ /* setup the hardware-based renderbuffers */
+ rb = intel_create_renderbuffer(rgbFormat, num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &rb->Base.Base);
+
+ if (mesaVis->doubleBufferMode) {
+ rb = intel_create_renderbuffer(rgbFormat, num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &rb->Base.Base);
+ }
+
+ /*
+ * Assert here that the gl_config has an expected depth/stencil bit
+ * combination: one of d24/s8, d16/s0, d0/s0. (See intelInitScreen2(),
+ * which constructs the advertised configs.)
+ */
+ if (mesaVis->depthBits == 24) {
+ assert(mesaVis->stencilBits == 8);
+
+ if (screen->hw_has_separate_stencil) {
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_X8_Z24,
+ num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_S8,
+ num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base);
+ } else {
+ /*
+ * Use combined depth/stencil. Note that the renderbuffer is
+ * attached to two attachment points.
+ */
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_S8_Z24,
+ num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
+ _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base);
+ }
+ }
+ else if (mesaVis->depthBits == 16) {
+ assert(mesaVis->stencilBits == 0);
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_Z16,
+ num_samples);
+ _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
+ }
+ else {
+ assert(mesaVis->depthBits == 0);
+ assert(mesaVis->stencilBits == 0);
+ }
+
+ /* now add any/all software-based renderbuffers we may need */
+ _swrast_add_soft_renderbuffers(fb,
+ false, /* never sw color */
+ false, /* never sw depth */
+ false, /* never sw stencil */
+ mesaVis->accumRedBits > 0,
+ false, /* never sw alpha */
+ false /* never sw aux */ );
+ driDrawPriv->driverPrivate = fb;
+
+ return true;
+}
+
+static void
+intelDestroyBuffer(__DRIdrawable * driDrawPriv)
+{
+ struct gl_framebuffer *fb = driDrawPriv->driverPrivate;
+
+ _mesa_reference_framebuffer(&fb, NULL);
+}
+
+/* There are probably better ways to do this, such as an
+ * init-designated function to register chipids and createcontext
+ * functions.
+ */
+extern bool
+i830CreateContext(const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ void *sharedContextPrivate);
+
+extern bool
+i915CreateContext(int api,
+ const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ unsigned *error,
+ void *sharedContextPrivate);
+extern bool
+brwCreateContext(int api,
+ const struct gl_config *mesaVis,
+ __DRIcontext *driContextPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ uint32_t flags,
+ unsigned *error,
+ void *sharedContextPrivate);
+
+static GLboolean
+intelCreateContext(gl_api api,
+ const struct gl_config * mesaVis,
+ __DRIcontext * driContextPriv,
+ unsigned major_version,
+ unsigned minor_version,
+ uint32_t flags,
+ unsigned *error,
+ void *sharedContextPrivate)
+{
+ __DRIscreen *sPriv = driContextPriv->driScreenPriv;
+ struct intel_screen *intelScreen = sPriv->driverPrivate;
+ bool success = false;
+
+#ifdef I915
+ if (IS_9XX(intelScreen->deviceID)) {
+ success = i915CreateContext(api, mesaVis, driContextPriv,
+ major_version, minor_version, error,
+ sharedContextPrivate);
+ } else {
+ switch (api) {
+ case API_OPENGL:
+ if (major_version > 1 || minor_version > 3) {
+ *error = __DRI_CTX_ERROR_BAD_VERSION;
+ success = false;
+ }
+ break;
+ case API_OPENGLES:
+ break;
+ default:
+ *error = __DRI_CTX_ERROR_BAD_API;
+ success = false;
+ }
+
+ if (success) {
+ intelScreen->no_vbo = true;
+ success = i830CreateContext(mesaVis, driContextPriv,
+ sharedContextPrivate);
+ if (!success)
+ *error = __DRI_CTX_ERROR_NO_MEMORY;
+ }
+ }
+#else
+ success = brwCreateContext(api, mesaVis,
+ driContextPriv,
+ major_version, minor_version, flags,
+ error, sharedContextPrivate);
+#endif
+
+ if (success)
+ return true;
+
+ if (driContextPriv->driverPrivate != NULL)
+ intelDestroyContext(driContextPriv);
+
+ return false;
+}
+
+static bool
+intel_init_bufmgr(struct intel_screen *intelScreen)
+{
+ __DRIscreen *spriv = intelScreen->driScrnPriv;
+ int num_fences = 0;
+
+ intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL;
+
+ intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ);
+ if (intelScreen->bufmgr == NULL) {
+ fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n",
+ __func__, __LINE__);
+ return false;
+ }
+
+ if (!intel_get_param(spriv, I915_PARAM_NUM_FENCES_AVAIL, &num_fences) ||
+ num_fences == 0) {
+ fprintf(stderr, "[%s: %u] Kernel 2.6.29 required.\n", __func__, __LINE__);
+ return false;
+ }
+
+ drm_intel_bufmgr_gem_enable_fenced_relocs(intelScreen->bufmgr);
+
+ intelScreen->named_regions = _mesa_NewHashTable();
+
+ intelScreen->relaxed_relocations = 0;
+ intelScreen->relaxed_relocations |=
+ intel_get_boolean(spriv, I915_PARAM_HAS_RELAXED_DELTA) << 0;
+
+ return true;
+}
+
+/**
+ * Override intel_screen.hw_has_separate_stencil with environment variable
+ * INTEL_SEPARATE_STENCIL.
+ *
+ * Valid values for INTEL_SEPARATE_STENCIL are "0" and "1". If an invalid
+ * valid value is encountered, a warning is emitted and INTEL_SEPARATE_STENCIL
+ * is ignored.
+ */
+static void
+intel_override_separate_stencil(struct intel_screen *screen)
+{
+ const char *s = getenv("INTEL_SEPARATE_STENCIL");
+ if (!s) {
+ return;
+ } else if (!strncmp("0", s, 2)) {
+ screen->hw_has_separate_stencil = false;
+ } else if (!strncmp("1", s, 2)) {
+ screen->hw_has_separate_stencil = true;
+ } else {
+ fprintf(stderr,
+ "warning: env variable INTEL_SEPARATE_STENCIL=\"%s\" has "
+ "invalid value and is ignored", s);
+ }
+}
+
+static bool
+intel_detect_swizzling(struct intel_screen *screen)
+{
+ drm_intel_bo *buffer;
+ unsigned long flags = 0;
+ unsigned long aligned_pitch;
+ uint32_t tiling = I915_TILING_X;
+ uint32_t swizzle_mode = 0;
+
+ buffer = drm_intel_bo_alloc_tiled(screen->bufmgr, "swizzle test",
+ 64, 64, 4,
+ &tiling, &aligned_pitch, flags);
+ if (buffer == NULL)
+ return false;
+
+ drm_intel_bo_get_tiling(buffer, &tiling, &swizzle_mode);
+ drm_intel_bo_unreference(buffer);
+
+ if (swizzle_mode == I915_BIT_6_SWIZZLE_NONE)
+ return false;
+ else
+ return true;
+}
+
+static __DRIconfig**
+intel_screen_make_configs(__DRIscreen *dri_screen)
+{
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ };
+
+ static const uint8_t singlesample_samples[1] = {0};
+ static const uint8_t multisample_samples[2] = {4, 8};
+
+ struct intel_screen *screen = dri_screen->driverPrivate;
+ GLenum fb_format[3];
+ GLenum fb_type[3];
+ uint8_t depth_bits[4], stencil_bits[4];
+ __DRIconfig **configs = NULL;
+
+ fb_format[0] = GL_RGB;
+ fb_type[0] = GL_UNSIGNED_SHORT_5_6_5;
+
+ fb_format[1] = GL_BGR;
+ fb_type[1] = GL_UNSIGNED_INT_8_8_8_8_REV;
+
+ fb_format[2] = GL_BGRA;
+ fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV;
+
+ /* Generate singlesample configs without accumulation buffer. */
+ for (int i = 0; i < ARRAY_SIZE(fb_format); i++) {
+ __DRIconfig **new_configs;
+ const int num_depth_stencil_bits = 2;
+
+ /* Starting with DRI2 protocol version 1.1 we can request a depth/stencil
+ * buffer that has a different number of bits per pixel than the color
+ * buffer. This isn't yet supported here.
+ */
+ depth_bits[0] = 0;
+ stencil_bits[0] = 0;
+
+ if (fb_type[i] == GL_UNSIGNED_SHORT_5_6_5) {
+ depth_bits[1] = 16;
+ stencil_bits[1] = 0;
+ } else {
+ depth_bits[1] = 24;
+ stencil_bits[1] = 8;
+ }
+
+ new_configs = driCreateConfigs(fb_format[i], fb_type[i],
+ depth_bits,
+ stencil_bits,
+ num_depth_stencil_bits,
+ back_buffer_modes,
+ ARRAY_SIZE(back_buffer_modes),
+ singlesample_samples, 1,
+ false);
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ /* Generate the minimum possible set of configs that include an
+ * accumulation buffer.
+ */
+ for (int i = 0; i < ARRAY_SIZE(fb_format); i++) {
+ __DRIconfig **new_configs;
+
+ if (fb_type[i] == GL_UNSIGNED_SHORT_5_6_5) {
+ depth_bits[0] = 16;
+ stencil_bits[0] = 0;
+ } else {
+ depth_bits[0] = 24;
+ stencil_bits[0] = 8;
+ }
+
+ new_configs = driCreateConfigs(fb_format[i], fb_type[i],
+ depth_bits, stencil_bits, 1,
+ back_buffer_modes + 1, 1,
+ singlesample_samples, 1,
+ true);
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ /* Generate multisample configs.
+ *
+ * This loop breaks early, and hence is a no-op, on gen < 6.
+ *
+ * Multisample configs must follow the singlesample configs in order to
+ * work around an X server bug present in 1.12. The X server chooses to
+ * associate the first listed RGBA888-Z24S8 config, regardless of its
+ * sample count, with the 32-bit depth visual used for compositing.
+ *
+ * Only doublebuffer configs with GLX_SWAP_UNDEFINED_OML behavior are
+ * supported. Singlebuffer configs are not supported because no one wants
+ * them. GLX_SWAP_COPY_OML is not supported due to page flipping.
+ */
+ for (int i = 0; i < ARRAY_SIZE(fb_format); i++) {
+ if (screen->gen < 6)
+ break;
+
+ __DRIconfig **new_configs;
+ const int num_depth_stencil_bits = 2;
+ int num_msaa_modes = 0;
+
+ depth_bits[0] = 0;
+ stencil_bits[0] = 0;
+
+ if (fb_type[i] == GL_UNSIGNED_SHORT_5_6_5) {
+ depth_bits[1] = 16;
+ stencil_bits[1] = 0;
+ } else {
+ depth_bits[1] = 24;
+ stencil_bits[1] = 8;
+ }
+
+ if (screen->gen >= 7)
+ num_msaa_modes = 2;
+ else if (screen->gen == 6)
+ num_msaa_modes = 1;
+
+ new_configs = driCreateConfigs(fb_format[i], fb_type[i],
+ depth_bits,
+ stencil_bits,
+ num_depth_stencil_bits,
+ back_buffer_modes + 1, 1,
+ multisample_samples,
+ num_msaa_modes,
+ false);
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ if (configs == NULL) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ __LINE__);
+ return NULL;
+ }
+
+ return configs;
+}
+
+/**
+ * This is the driver specific part of the createNewScreen entry point.
+ * Called when using DRI2.
+ *
+ * \return the struct gl_config supported by this driver
+ */
+static const
+__DRIconfig **intelInitScreen2(__DRIscreen *psp)
+{
+ struct intel_screen *intelScreen;
+ unsigned int api_mask;
+
+ if (psp->dri2.loader->base.version <= 2 ||
+ psp->dri2.loader->getBuffersWithFormat == NULL) {
+ fprintf(stderr,
+ "\nERROR! DRI2 loader with getBuffersWithFormat() "
+ "support required\n");
+ return false;
+ }
+
+ /* Allocate the private area */
+ intelScreen = CALLOC(sizeof *intelScreen);
+ if (!intelScreen) {
+ fprintf(stderr, "\nERROR! Allocating private area failed\n");
+ return false;
+ }
+ /* parse information in __driConfigOptions */
+ driParseOptionInfo(&intelScreen->optionCache,
+ __driConfigOptions, __driNConfigOptions);
+
+ intelScreen->driScrnPriv = psp;
+ psp->driverPrivate = (void *) intelScreen;
+
+ if (!intel_init_bufmgr(intelScreen))
+ return false;
+
+ intelScreen->deviceID = drm_intel_bufmgr_gem_get_devid(intelScreen->bufmgr);
+
+ intelScreen->kernel_has_gen7_sol_reset =
+ intel_get_boolean(intelScreen->driScrnPriv,
+ I915_PARAM_HAS_GEN7_SOL_RESET);
+
+ if (IS_GEN7(intelScreen->deviceID)) {
+ intelScreen->gen = 7;
+ } else if (IS_GEN6(intelScreen->deviceID)) {
+ intelScreen->gen = 6;
+ } else if (IS_GEN5(intelScreen->deviceID)) {
+ intelScreen->gen = 5;
+ } else if (IS_965(intelScreen->deviceID)) {
+ intelScreen->gen = 4;
+ } else if (IS_9XX(intelScreen->deviceID)) {
+ intelScreen->gen = 3;
+ } else {
+ intelScreen->gen = 2;
+ }
+
+ intelScreen->hw_has_separate_stencil = intelScreen->gen >= 6;
+ intelScreen->hw_must_use_separate_stencil = intelScreen->gen >= 7;
+
+ int has_llc = 0;
+ bool success = intel_get_param(intelScreen->driScrnPriv, I915_PARAM_HAS_LLC,
+ &has_llc);
+ if (success && has_llc)
+ intelScreen->hw_has_llc = true;
+ else if (!success && intelScreen->gen >= 6)
+ intelScreen->hw_has_llc = true;
+
+ intel_override_separate_stencil(intelScreen);
+
+ api_mask = (1 << __DRI_API_OPENGL);
+#if FEATURE_ES1
+ api_mask |= (1 << __DRI_API_GLES);
+#endif
+#if FEATURE_ES2
+ api_mask |= (1 << __DRI_API_GLES2);
+#endif
+
+ if (IS_9XX(intelScreen->deviceID) || IS_965(intelScreen->deviceID))
+ psp->api_mask = api_mask;
+
+ intelScreen->hw_has_swizzling = intel_detect_swizzling(intelScreen);
+
+ psp->extensions = intelScreenExtensions;
+
+ return (const __DRIconfig**) intel_screen_make_configs(psp);
+}
+
+struct intel_buffer {
+ __DRIbuffer base;
+ struct intel_region *region;
+};
+
+static __DRIbuffer *
+intelAllocateBuffer(__DRIscreen *screen,
+ unsigned attachment, unsigned format,
+ int width, int height)
+{
+ struct intel_buffer *intelBuffer;
+ struct intel_screen *intelScreen = screen->driverPrivate;
+
+ assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
+ attachment == __DRI_BUFFER_BACK_LEFT);
+
+ intelBuffer = CALLOC(sizeof *intelBuffer);
+ if (intelBuffer == NULL)
+ return NULL;
+
+ /* The front and back buffers are color buffers, which are X tiled. */
+ intelBuffer->region = intel_region_alloc(intelScreen,
+ I915_TILING_X,
+ format / 8,
+ width,
+ height,
+ true);
+
+ if (intelBuffer->region == NULL) {
+ FREE(intelBuffer);
+ return NULL;
+ }
+
+ intel_region_flink(intelBuffer->region, &intelBuffer->base.name);
+
+ intelBuffer->base.attachment = attachment;
+ intelBuffer->base.cpp = intelBuffer->region->cpp;
+ intelBuffer->base.pitch =
+ intelBuffer->region->pitch * intelBuffer->region->cpp;
+
+ return &intelBuffer->base;
+}
+
+static void
+intelReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
+{
+ struct intel_buffer *intelBuffer = (struct intel_buffer *) buffer;
+
+ intel_region_release(&intelBuffer->region);
+ free(intelBuffer);
+}
+
+
+const struct __DriverAPIRec driDriverAPI = {
+ .InitScreen = intelInitScreen2,
+ .DestroyScreen = intelDestroyScreen,
+ .CreateContext = intelCreateContext,
+ .DestroyContext = intelDestroyContext,
+ .CreateBuffer = intelCreateBuffer,
+ .DestroyBuffer = intelDestroyBuffer,
+ .MakeCurrent = intelMakeCurrent,
+ .UnbindContext = intelUnbindContext,
+ .AllocateBuffer = intelAllocateBuffer,
+ .ReleaseBuffer = intelReleaseBuffer
+};
+
+/* This is the table of extensions that the loader will dlsym() for. */
+PUBLIC const __DRIextension *__driDriverExtensions[] = {
+ &driCoreExtension.base,
+ &driDRI2Extension.base,
+ NULL
+};
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_span.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_span.c
index 05e5e8e5833..d7eaa41241e 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_span.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_span.c
@@ -1 +1,215 @@
-../intel/intel_span.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2011 Intel Corporation
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Chad Versace <chad@chad-versace.us>
+ *
+ **************************************************************************/
+
+#include <stdbool.h>
+#include <stdint.h>
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/renderbuffer.h"
+
+#include "intel_buffers.h"
+#include "intel_fbo.h"
+#include "intel_mipmap_tree.h"
+#include "intel_screen.h"
+#include "intel_span.h"
+#include "intel_regions.h"
+#include "intel_tex.h"
+
+#include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
+
+/**
+ * \brief Get pointer offset into stencil buffer.
+ *
+ * The stencil buffer is W tiled. Since the GTT is incapable of W fencing, we
+ * must decode the tile's layout in software.
+ *
+ * See
+ * - PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section 4.5.2.1 W-Major Tile
+ * Format.
+ * - PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section 4.5.3 Tiling Algorithm
+ *
+ * Even though the returned offset is always positive, the return type is
+ * signed due to
+ * commit e8b1c6d6f55f5be3bef25084fdd8b6127517e137
+ * mesa: Fix return type of _mesa_get_format_bytes() (#37351)
+ */
+intptr_t
+intel_offset_S8(uint32_t stride, uint32_t x, uint32_t y, bool swizzled)
+{
+ uint32_t tile_size = 4096;
+ uint32_t tile_width = 64;
+ uint32_t tile_height = 64;
+ uint32_t row_size = 64 * stride;
+
+ uint32_t tile_x = x / tile_width;
+ uint32_t tile_y = y / tile_height;
+
+ /* The byte's address relative to the tile's base addres. */
+ uint32_t byte_x = x % tile_width;
+ uint32_t byte_y = y % tile_height;
+
+ uintptr_t u = tile_y * row_size
+ + tile_x * tile_size
+ + 512 * (byte_x / 8)
+ + 64 * (byte_y / 8)
+ + 32 * ((byte_y / 4) % 2)
+ + 16 * ((byte_x / 4) % 2)
+ + 8 * ((byte_y / 2) % 2)
+ + 4 * ((byte_x / 2) % 2)
+ + 2 * (byte_y % 2)
+ + 1 * (byte_x % 2);
+
+ if (swizzled) {
+ /* adjust for bit6 swizzling */
+ if (((byte_x / 8) % 2) == 1) {
+ if (((byte_y / 8) % 2) == 0) {
+ u += 64;
+ } else {
+ u -= 64;
+ }
+ }
+ }
+
+ return u;
+}
+
+/**
+ * Map the regions needed by intelSpanRenderStart().
+ */
+static void
+intel_span_map_buffers(struct intel_context *intel)
+{
+ struct gl_context *ctx = &intel->ctx;
+ struct intel_texture_object *tex_obj;
+
+ for (int i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (!ctx->Texture.Unit[i]._ReallyEnabled)
+ continue;
+ tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current);
+ intel_finalize_mipmap_tree(intel, i);
+ intel_tex_map_images(intel, tex_obj,
+ GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
+ }
+
+ _swrast_map_renderbuffers(ctx);
+}
+
+/**
+ * Prepare for software rendering. Map current read/draw framebuffers'
+ * renderbuffes and all currently bound texture objects.
+ *
+ * Old note: Moved locking out to get reasonable span performance.
+ */
+void
+intelSpanRenderStart(struct gl_context * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+
+ intel_flush(ctx);
+ intel_prepare_render(intel);
+ intel_flush(ctx);
+ intel_span_map_buffers(intel);
+}
+
+/**
+ * Called when done software rendering. Unmap the buffers we mapped in
+ * the above function.
+ */
+void
+intelSpanRenderFinish(struct gl_context * ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ GLuint i;
+
+ _swrast_flush(ctx);
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
+ intel_tex_unmap_images(intel, intel_texture_object(texObj));
+ }
+ }
+
+ _swrast_unmap_renderbuffers(ctx);
+}
+
+
+void
+intelInitSpanFuncs(struct gl_context * ctx)
+{
+ struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
+ if (swdd) {
+ swdd->SpanRenderStart = intelSpanRenderStart;
+ swdd->SpanRenderFinish = intelSpanRenderFinish;
+ }
+}
+
+void
+intel_map_vertex_shader_textures(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ int i;
+
+ if (ctx->VertexProgram._Current == NULL)
+ return;
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled &&
+ ctx->VertexProgram._Current->Base.TexturesUsed[i] != 0) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
+
+ intel_tex_map_images(intel, intel_texture_object(texObj),
+ GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
+ }
+ }
+}
+
+void
+intel_unmap_vertex_shader_textures(struct gl_context *ctx)
+{
+ struct intel_context *intel = intel_context(ctx);
+ int i;
+
+ if (ctx->VertexProgram._Current == NULL)
+ return;
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled &&
+ ctx->VertexProgram._Current->Base.TexturesUsed[i] != 0) {
+ struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current;
+
+ intel_tex_unmap_images(intel, intel_texture_object(texObj));
+ }
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_state.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_state.c
index 519672fc359..6a817cdf3f6 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_state.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_state.c
@@ -1 +1,195 @@
-../intel/intel_state.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/dd.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+
+int
+intel_translate_shadow_compare_func(GLenum func)
+{
+ switch (func) {
+ case GL_NEVER:
+ return COMPAREFUNC_ALWAYS;
+ case GL_LESS:
+ return COMPAREFUNC_LEQUAL;
+ case GL_LEQUAL:
+ return COMPAREFUNC_LESS;
+ case GL_GREATER:
+ return COMPAREFUNC_GEQUAL;
+ case GL_GEQUAL:
+ return COMPAREFUNC_GREATER;
+ case GL_NOTEQUAL:
+ return COMPAREFUNC_EQUAL;
+ case GL_EQUAL:
+ return COMPAREFUNC_NOTEQUAL;
+ case GL_ALWAYS:
+ return COMPAREFUNC_NEVER;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+ return COMPAREFUNC_NEVER;
+}
+
+int
+intel_translate_compare_func(GLenum func)
+{
+ switch (func) {
+ case GL_NEVER:
+ return COMPAREFUNC_NEVER;
+ case GL_LESS:
+ return COMPAREFUNC_LESS;
+ case GL_LEQUAL:
+ return COMPAREFUNC_LEQUAL;
+ case GL_GREATER:
+ return COMPAREFUNC_GREATER;
+ case GL_GEQUAL:
+ return COMPAREFUNC_GEQUAL;
+ case GL_NOTEQUAL:
+ return COMPAREFUNC_NOTEQUAL;
+ case GL_EQUAL:
+ return COMPAREFUNC_EQUAL;
+ case GL_ALWAYS:
+ return COMPAREFUNC_ALWAYS;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
+ return COMPAREFUNC_ALWAYS;
+}
+
+int
+intel_translate_stencil_op(GLenum op)
+{
+ switch (op) {
+ case GL_KEEP:
+ return STENCILOP_KEEP;
+ case GL_ZERO:
+ return STENCILOP_ZERO;
+ case GL_REPLACE:
+ return STENCILOP_REPLACE;
+ case GL_INCR:
+ return STENCILOP_INCRSAT;
+ case GL_DECR:
+ return STENCILOP_DECRSAT;
+ case GL_INCR_WRAP:
+ return STENCILOP_INCR;
+ case GL_DECR_WRAP:
+ return STENCILOP_DECR;
+ case GL_INVERT:
+ return STENCILOP_INVERT;
+ default:
+ return STENCILOP_ZERO;
+ }
+}
+
+int
+intel_translate_blend_factor(GLenum factor)
+{
+ switch (factor) {
+ case GL_ZERO:
+ return BLENDFACT_ZERO;
+ case GL_SRC_ALPHA:
+ return BLENDFACT_SRC_ALPHA;
+ case GL_ONE:
+ return BLENDFACT_ONE;
+ case GL_SRC_COLOR:
+ return BLENDFACT_SRC_COLR;
+ case GL_ONE_MINUS_SRC_COLOR:
+ return BLENDFACT_INV_SRC_COLR;
+ case GL_DST_COLOR:
+ return BLENDFACT_DST_COLR;
+ case GL_ONE_MINUS_DST_COLOR:
+ return BLENDFACT_INV_DST_COLR;
+ case GL_ONE_MINUS_SRC_ALPHA:
+ return BLENDFACT_INV_SRC_ALPHA;
+ case GL_DST_ALPHA:
+ return BLENDFACT_DST_ALPHA;
+ case GL_ONE_MINUS_DST_ALPHA:
+ return BLENDFACT_INV_DST_ALPHA;
+ case GL_SRC_ALPHA_SATURATE:
+ return BLENDFACT_SRC_ALPHA_SATURATE;
+ case GL_CONSTANT_COLOR:
+ return BLENDFACT_CONST_COLOR;
+ case GL_ONE_MINUS_CONSTANT_COLOR:
+ return BLENDFACT_INV_CONST_COLOR;
+ case GL_CONSTANT_ALPHA:
+ return BLENDFACT_CONST_ALPHA;
+ case GL_ONE_MINUS_CONSTANT_ALPHA:
+ return BLENDFACT_INV_CONST_ALPHA;
+ }
+
+ fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, factor);
+ return BLENDFACT_ZERO;
+}
+
+int
+intel_translate_logic_op(GLenum opcode)
+{
+ switch (opcode) {
+ case GL_CLEAR:
+ return LOGICOP_CLEAR;
+ case GL_AND:
+ return LOGICOP_AND;
+ case GL_AND_REVERSE:
+ return LOGICOP_AND_RVRSE;
+ case GL_COPY:
+ return LOGICOP_COPY;
+ case GL_COPY_INVERTED:
+ return LOGICOP_COPY_INV;
+ case GL_AND_INVERTED:
+ return LOGICOP_AND_INV;
+ case GL_NOOP:
+ return LOGICOP_NOOP;
+ case GL_XOR:
+ return LOGICOP_XOR;
+ case GL_OR:
+ return LOGICOP_OR;
+ case GL_OR_INVERTED:
+ return LOGICOP_OR_INV;
+ case GL_NOR:
+ return LOGICOP_NOR;
+ case GL_EQUIV:
+ return LOGICOP_EQUIV;
+ case GL_INVERT:
+ return LOGICOP_INV;
+ case GL_OR_REVERSE:
+ return LOGICOP_OR_RVRSE;
+ case GL_NAND:
+ return LOGICOP_NAND;
+ case GL_SET:
+ return LOGICOP_SET;
+ default:
+ return LOGICOP_SET;
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_syncobj.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_syncobj.c
index 0b2e56ab246..e965896df60 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_syncobj.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_syncobj.c
@@ -1 +1,132 @@
-../intel/intel_syncobj.c \ No newline at end of file
+/*
+ * Copyright © 2008 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Eric Anholt <eric@anholt.net>
+ *
+ */
+
+/** @file intel_syncobj.c
+ *
+ * Support for ARB_sync
+ *
+ * ARB_sync is implemented by flushing the current batchbuffer and keeping a
+ * reference on it. We can then check for completion or wait for completion
+ * using the normal buffer object mechanisms. This does mean that if an
+ * application is using many sync objects, it will emit small batchbuffers
+ * which may end up being a significant overhead. In other tests of removing
+ * gratuitous batchbuffer syncs in Mesa, it hasn't appeared to be a significant
+ * performance bottleneck, though.
+ */
+
+#include "main/simple_list.h"
+#include "main/imports.h"
+
+#include "intel_context.h"
+#include "intel_batchbuffer.h"
+#include "intel_reg.h"
+
+static struct gl_sync_object *
+intel_new_sync_object(struct gl_context *ctx, GLuint id)
+{
+ struct intel_sync_object *sync;
+
+ sync = calloc(1, sizeof(struct intel_sync_object));
+
+ return &sync->Base;
+}
+
+static void
+intel_delete_sync_object(struct gl_context *ctx, struct gl_sync_object *s)
+{
+ struct intel_sync_object *sync = (struct intel_sync_object *)s;
+
+ drm_intel_bo_unreference(sync->bo);
+ free(sync);
+}
+
+static void
+intel_fence_sync(struct gl_context *ctx, struct gl_sync_object *s,
+ GLenum condition, GLbitfield flags)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_sync_object *sync = (struct intel_sync_object *)s;
+
+ assert(condition == GL_SYNC_GPU_COMMANDS_COMPLETE);
+ intel_batchbuffer_emit_mi_flush(intel);
+
+ sync->bo = intel->batch.bo;
+ drm_intel_bo_reference(sync->bo);
+
+ intel_flush(ctx);
+}
+
+/* We ignore the user-supplied timeout. This is weaselly -- we're allowed to
+ * round to an implementation-dependent accuracy, and right now our
+ * implementation "rounds" to the wait-forever value.
+ *
+ * The fix would be a new kernel function to do the GTT transition with a
+ * timeout.
+ */
+static void intel_client_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
+ GLbitfield flags, GLuint64 timeout)
+{
+ struct intel_sync_object *sync = (struct intel_sync_object *)s;
+
+ if (sync->bo) {
+ drm_intel_bo_wait_rendering(sync->bo);
+ s->StatusFlag = 1;
+ drm_intel_bo_unreference(sync->bo);
+ sync->bo = NULL;
+ }
+}
+
+/* We have nothing to do for WaitSync. Our GL command stream is sequential,
+ * so given that the sync object has already flushed the batchbuffer,
+ * any batchbuffers coming after this waitsync will naturally not occur until
+ * the previous one is done.
+ */
+static void intel_server_wait_sync(struct gl_context *ctx, struct gl_sync_object *s,
+ GLbitfield flags, GLuint64 timeout)
+{
+}
+
+static void intel_check_sync(struct gl_context *ctx, struct gl_sync_object *s)
+{
+ struct intel_sync_object *sync = (struct intel_sync_object *)s;
+
+ if (sync->bo && !drm_intel_bo_busy(sync->bo)) {
+ drm_intel_bo_unreference(sync->bo);
+ sync->bo = NULL;
+ s->StatusFlag = 1;
+ }
+}
+
+void intel_init_syncobj_functions(struct dd_function_table *functions)
+{
+ functions->NewSyncObject = intel_new_sync_object;
+ functions->DeleteSyncObject = intel_delete_sync_object;
+ functions->FenceSync = intel_fence_sync;
+ functions->CheckSync = intel_check_sync;
+ functions->ClientWaitSync = intel_client_wait_sync;
+ functions->ServerWaitSync = intel_server_wait_sync;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex.c
index d77ce749a3e..5d938798d9f 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex.c
@@ -1 +1,222 @@
-../intel/intel_tex.c \ No newline at end of file
+#include "swrast/swrast.h"
+#include "main/renderbuffer.h"
+#include "main/texobj.h"
+#include "main/teximage.h"
+#include "main/mipmap.h"
+#include "drivers/common/meta.h"
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_tex.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+static struct gl_texture_image *
+intelNewTextureImage(struct gl_context * ctx)
+{
+ DBG("%s\n", __FUNCTION__);
+ (void) ctx;
+ return (struct gl_texture_image *) CALLOC_STRUCT(intel_texture_image);
+}
+
+static void
+intelDeleteTextureImage(struct gl_context * ctx, struct gl_texture_image *img)
+{
+ /* nothing special (yet) for intel_texture_image */
+ _mesa_delete_texture_image(ctx, img);
+}
+
+
+static struct gl_texture_object *
+intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
+{
+ struct intel_texture_object *obj = CALLOC_STRUCT(intel_texture_object);
+
+ (void) ctx;
+
+ DBG("%s\n", __FUNCTION__);
+ _mesa_initialize_texture_object(&obj->base, name, target);
+
+ return &obj->base;
+}
+
+static void
+intelDeleteTextureObject(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ struct intel_texture_object *intelObj = intel_texture_object(texObj);
+
+ intel_miptree_release(&intelObj->mt);
+ _mesa_delete_texture_object(ctx, texObj);
+}
+
+static GLboolean
+intel_alloc_texture_image_buffer(struct gl_context *ctx,
+ struct gl_texture_image *image)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intel_image = intel_texture_image(image);
+ struct gl_texture_object *texobj = image->TexObject;
+ struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
+ GLuint slices;
+
+ assert(image->Border == 0);
+
+ /* Because the driver uses AllocTextureImageBuffer() internally, it may end
+ * up mismatched with FreeTextureImageBuffer(), but that is safe to call
+ * multiple times.
+ */
+ ctx->Driver.FreeTextureImageBuffer(ctx, image);
+
+ /* Allocate the swrast_texture_image::ImageOffsets array now */
+ switch (texobj->Target) {
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_2D_ARRAY:
+ slices = image->Depth;
+ break;
+ case GL_TEXTURE_1D_ARRAY:
+ slices = image->Height;
+ break;
+ default:
+ slices = 1;
+ }
+ assert(!intel_image->base.ImageOffsets);
+ intel_image->base.ImageOffsets = malloc(slices * sizeof(GLuint));
+
+ _swrast_init_texture_image(image);
+
+ if (intel_texobj->mt &&
+ intel_miptree_match_image(intel_texobj->mt, image)) {
+ intel_miptree_reference(&intel_image->mt, intel_texobj->mt);
+ DBG("%s: alloc obj %p level %d %dx%dx%d using object's miptree %p\n",
+ __FUNCTION__, texobj, image->Level,
+ image->Width, image->Height, image->Depth, intel_texobj->mt);
+ } else {
+ intel_image->mt = intel_miptree_create_for_teximage(intel, intel_texobj,
+ intel_image,
+ false);
+
+ /* Even if the object currently has a mipmap tree associated
+ * with it, this one is a more likely candidate to represent the
+ * whole object since our level didn't fit what was there
+ * before, and any lower levels would fit into our miptree.
+ */
+ intel_miptree_reference(&intel_texobj->mt, intel_image->mt);
+
+ DBG("%s: alloc obj %p level %d %dx%dx%d using new miptree %p\n",
+ __FUNCTION__, texobj, image->Level,
+ image->Width, image->Height, image->Depth, intel_image->mt);
+ }
+
+ return true;
+}
+
+/**
+ * Called via ctx->Driver.AllocTextureStorage()
+ * Just have to allocate memory for the texture images.
+ */
+static GLboolean
+intel_alloc_texture_storage(struct gl_context *ctx,
+ struct gl_texture_object *texObj,
+ GLsizei levels, GLsizei width,
+ GLsizei height, GLsizei depth)
+{
+ const int numFaces = _mesa_num_tex_faces(texObj->Target);
+ int face;
+ int level;
+
+ for (face = 0; face < numFaces; face++) {
+ for (level = 0; level < levels; level++) {
+ struct gl_texture_image *const texImage = texObj->Image[face][level];
+ if (!intel_alloc_texture_image_buffer(ctx, texImage))
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static void
+intel_free_texture_image_buffer(struct gl_context * ctx,
+ struct gl_texture_image *texImage)
+{
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
+
+ DBG("%s\n", __FUNCTION__);
+
+ intel_miptree_release(&intelImage->mt);
+
+ if (intelImage->base.Buffer) {
+ _mesa_align_free(intelImage->base.Buffer);
+ intelImage->base.Buffer = NULL;
+ }
+
+ if (intelImage->base.ImageOffsets) {
+ free(intelImage->base.ImageOffsets);
+ intelImage->base.ImageOffsets = NULL;
+ }
+}
+
+/**
+ * Map texture memory/buffer into user space.
+ * Note: the region of interest parameters are ignored here.
+ * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
+ * \param mapOut returns start of mapping of region of interest
+ * \param rowStrideOut returns row stride in bytes
+ */
+static void
+intel_map_texture_image(struct gl_context *ctx,
+ struct gl_texture_image *tex_image,
+ GLuint slice,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **map,
+ GLint *stride)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intel_image = intel_texture_image(tex_image);
+ struct intel_mipmap_tree *mt = intel_image->mt;
+
+ /* Our texture data is always stored in a miptree. */
+ assert(mt);
+
+ /* Check that our caller wasn't confused about how to map a 1D texture. */
+ assert(tex_image->TexObject->Target != GL_TEXTURE_1D_ARRAY ||
+ h == 1);
+
+ /* intel_miptree_map operates on a unified "slice" number that references the
+ * cube face, since it's all just slices to the miptree code.
+ */
+ if (tex_image->TexObject->Target == GL_TEXTURE_CUBE_MAP)
+ slice = tex_image->Face;
+
+ intel_miptree_map(intel, mt, tex_image->Level, slice, x, y, w, h, mode,
+ (void **)map, stride);
+}
+
+static void
+intel_unmap_texture_image(struct gl_context *ctx,
+ struct gl_texture_image *tex_image, GLuint slice)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intel_image = intel_texture_image(tex_image);
+ struct intel_mipmap_tree *mt = intel_image->mt;
+
+ if (tex_image->TexObject->Target == GL_TEXTURE_CUBE_MAP)
+ slice = tex_image->Face;
+
+ intel_miptree_unmap(intel, mt, tex_image->Level, slice);
+}
+
+void
+intelInitTextureFuncs(struct dd_function_table *functions)
+{
+ functions->NewTextureObject = intelNewTextureObject;
+ functions->NewTextureImage = intelNewTextureImage;
+ functions->DeleteTextureImage = intelDeleteTextureImage;
+ functions->DeleteTexture = intelDeleteTextureObject;
+ functions->AllocTextureImageBuffer = intel_alloc_texture_image_buffer;
+ functions->FreeTextureImageBuffer = intel_free_texture_image_buffer;
+ functions->AllocTextureStorage = intel_alloc_texture_storage;
+ functions->MapTextureImage = intel_map_texture_image;
+ functions->UnmapTextureImage = intel_unmap_texture_image;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_copy.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_copy.c
index 87196c5d1ed..f4366330f88 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_copy.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_copy.c
@@ -1 +1,171 @@
-../intel/intel_tex_copy.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/teximage.h"
+#include "main/texstate.h"
+#include "main/fbobject.h"
+
+#include "drivers/common/meta.h"
+
+#include "intel_screen.h"
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_regions.h"
+#include "intel_fbo.h"
+#include "intel_tex.h"
+#include "intel_blit.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+
+bool
+intel_copy_texsubimage(struct intel_context *intel,
+ struct intel_texture_image *intelImage,
+ GLint dstx, GLint dsty,
+ struct intel_renderbuffer *irb,
+ GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ struct gl_context *ctx = &intel->ctx;
+ struct intel_region *region;
+ const GLenum internalFormat = intelImage->base.Base.InternalFormat;
+ bool copy_supported = false;
+ bool copy_supported_with_alpha_override = false;
+
+ intel_prepare_render(intel);
+
+ if (!intelImage->mt || !irb || !irb->mt) {
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF))
+ fprintf(stderr, "%s fail %p %p (0x%08x)\n",
+ __FUNCTION__, intelImage->mt, irb, internalFormat);
+ return false;
+ } else {
+ region = irb->mt->region;
+ assert(region);
+ }
+
+ copy_supported = intelImage->base.Base.TexFormat == intel_rb_format(irb);
+
+ /* Converting ARGB8888 to XRGB8888 is trivial: ignore the alpha bits */
+ if (intel_rb_format(irb) == MESA_FORMAT_ARGB8888 &&
+ intelImage->base.Base.TexFormat == MESA_FORMAT_XRGB8888) {
+ copy_supported = true;
+ }
+
+ /* Converting XRGB8888 to ARGB8888 requires setting the alpha bits to 1.0 */
+ if (intel_rb_format(irb) == MESA_FORMAT_XRGB8888 &&
+ intelImage->base.Base.TexFormat == MESA_FORMAT_ARGB8888) {
+ copy_supported_with_alpha_override = true;
+ }
+
+ if (!copy_supported && !copy_supported_with_alpha_override) {
+ if (unlikely(INTEL_DEBUG & DEBUG_PERF))
+ fprintf(stderr, "%s mismatched formats %s, %s\n",
+ __FUNCTION__,
+ _mesa_get_format_name(intelImage->base.Base.TexFormat),
+ _mesa_get_format_name(intel_rb_format(irb)));
+ return false;
+ }
+
+ {
+ GLuint image_x, image_y;
+ GLshort src_pitch;
+
+ /* get dest x/y in destination texture */
+ intel_miptree_get_image_offset(intelImage->mt,
+ intelImage->base.Base.Level,
+ intelImage->base.Base.Face,
+ 0,
+ &image_x, &image_y);
+
+ /* The blitter can't handle Y-tiled buffers. */
+ if (intelImage->mt->region->tiling == I915_TILING_Y) {
+ return false;
+ }
+
+ if (_mesa_is_winsys_fbo(ctx->ReadBuffer)) {
+ /* Flip vertical orientation for system framebuffers */
+ y = ctx->ReadBuffer->Height - (y + height);
+ src_pitch = -region->pitch;
+ } else {
+ /* reading from a FBO, y is already oriented the way we like */
+ src_pitch = region->pitch;
+ }
+
+ /* blit from src buffer to texture */
+ if (!intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ src_pitch,
+ region->bo,
+ 0,
+ region->tiling,
+ intelImage->mt->region->pitch,
+ intelImage->mt->region->bo,
+ 0,
+ intelImage->mt->region->tiling,
+ irb->draw_x + x, irb->draw_y + y,
+ image_x + dstx, image_y + dsty,
+ width, height,
+ GL_COPY)) {
+ return false;
+ }
+ }
+
+ if (copy_supported_with_alpha_override)
+ intel_set_teximage_alpha_to_one(ctx, intelImage);
+
+ return true;
+}
+
+
+static void
+intelCopyTexSubImage(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ struct gl_renderbuffer *rb,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height)
+{
+ if (dims == 3 || !intel_copy_texsubimage(intel_context(ctx),
+ intel_texture_image(texImage),
+ xoffset, yoffset,
+ intel_renderbuffer(rb), x, y, width, height)) {
+ fallback_debug("%s - fallback to swrast\n", __FUNCTION__);
+ _mesa_meta_CopyTexSubImage(ctx, dims, texImage,
+ xoffset, yoffset, zoffset,
+ rb, x, y, width, height);
+ }
+}
+
+
+void
+intelInitTextureCopyImageFuncs(struct dd_function_table *functions)
+{
+ functions->CopyTexSubImage = intelCopyTexSubImage;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_format.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_format.c
index 3415f754705..f53054d55d3 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_format.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_format.c
@@ -1 +1,65 @@
-../intel/intel_tex_format.c \ No newline at end of file
+#include "intel_context.h"
+#include "intel_tex.h"
+#include "main/enums.h"
+#include "main/formats.h"
+
+/**
+ * Returns the renderbuffer DataType for a MESA_FORMAT.
+ */
+GLenum
+intel_mesa_format_to_rb_datatype(gl_format format)
+{
+ switch (format) {
+ case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_SARGB8:
+ case MESA_FORMAT_R8:
+ case MESA_FORMAT_GR88:
+ case MESA_FORMAT_A8:
+ case MESA_FORMAT_I8:
+ case MESA_FORMAT_L8:
+ case MESA_FORMAT_AL88:
+ case MESA_FORMAT_RGB565:
+ case MESA_FORMAT_ARGB1555:
+ case MESA_FORMAT_ARGB4444:
+ case MESA_FORMAT_S8:
+ return GL_UNSIGNED_BYTE;
+ case MESA_FORMAT_R16:
+ case MESA_FORMAT_RG1616:
+ case MESA_FORMAT_Z16:
+ return GL_UNSIGNED_SHORT;
+ case MESA_FORMAT_X8_Z24:
+ return GL_UNSIGNED_INT;
+ case MESA_FORMAT_S8_Z24:
+ return GL_UNSIGNED_INT_24_8_EXT;
+ case MESA_FORMAT_RGBA_FLOAT32:
+ case MESA_FORMAT_RG_FLOAT32:
+ case MESA_FORMAT_R_FLOAT32:
+ case MESA_FORMAT_INTENSITY_FLOAT32:
+ case MESA_FORMAT_LUMINANCE_FLOAT32:
+ case MESA_FORMAT_ALPHA_FLOAT32:
+ case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32:
+ return GL_FLOAT;
+
+ /* The core depthstencil wrappers demand this. */
+ case MESA_FORMAT_Z32_FLOAT_X24S8:
+ return GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
+
+ default:
+ /* Unsupported format. We may hit this when people ask for FBO-incomplete
+ * formats.
+ */
+ return GL_NONE;
+ }
+}
+
+int intel_compressed_num_bytes(GLuint mesaFormat)
+{
+ GLuint bw, bh;
+ GLuint block_size;
+
+ block_size = _mesa_get_format_bytes(mesaFormat);
+ _mesa_get_format_block_size(mesaFormat, &bw, &bh);
+
+ return block_size / bw;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_image.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_image.c
index 567abe4974e..fe9040cf1b6 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -1 +1,360 @@
-../intel/intel_tex_image.c \ No newline at end of file
+
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/bufferobj.h"
+#include "main/context.h"
+#include "main/formats.h"
+#include "main/pbo.h"
+#include "main/renderbuffer.h"
+#include "main/texcompress.h"
+#include "main/texgetimage.h"
+#include "main/texobj.h"
+#include "main/teximage.h"
+#include "main/texstore.h"
+
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_buffer_objects.h"
+#include "intel_batchbuffer.h"
+#include "intel_tex.h"
+#include "intel_blit.h"
+#include "intel_fbo.h"
+#include "intel_span.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+/* Work back from the specified level of the image to the baselevel and create a
+ * miptree of that size.
+ */
+struct intel_mipmap_tree *
+intel_miptree_create_for_teximage(struct intel_context *intel,
+ struct intel_texture_object *intelObj,
+ struct intel_texture_image *intelImage,
+ bool expect_accelerated_upload)
+{
+ GLuint firstLevel;
+ GLuint lastLevel;
+ int width, height, depth;
+ GLuint i;
+
+ intel_miptree_get_dimensions_for_image(&intelImage->base.Base,
+ &width, &height, &depth);
+
+ DBG("%s\n", __FUNCTION__);
+
+ if (intelImage->base.Base.Level > intelObj->base.BaseLevel &&
+ (width == 1 ||
+ (intelObj->base.Target != GL_TEXTURE_1D && height == 1) ||
+ (intelObj->base.Target == GL_TEXTURE_3D && depth == 1))) {
+ /* For this combination, we're at some lower mipmap level and
+ * some important dimension is 1. We can't extrapolate up to a
+ * likely base level width/height/depth for a full mipmap stack
+ * from this info, so just allocate this one level.
+ */
+ firstLevel = intelImage->base.Base.Level;
+ lastLevel = intelImage->base.Base.Level;
+ } else {
+ /* If this image disrespects BaseLevel, allocate from level zero.
+ * Usually BaseLevel == 0, so it's unlikely to happen.
+ */
+ if (intelImage->base.Base.Level < intelObj->base.BaseLevel)
+ firstLevel = 0;
+ else
+ firstLevel = intelObj->base.BaseLevel;
+
+ /* Figure out image dimensions at start level. */
+ for (i = intelImage->base.Base.Level; i > firstLevel; i--) {
+ width <<= 1;
+ if (height != 1)
+ height <<= 1;
+ if (depth != 1)
+ depth <<= 1;
+ }
+
+ /* Guess a reasonable value for lastLevel. This is probably going
+ * to be wrong fairly often and might mean that we have to look at
+ * resizable buffers, or require that buffers implement lazy
+ * pagetable arrangements.
+ */
+ if ((intelObj->base.Sampler.MinFilter == GL_NEAREST ||
+ intelObj->base.Sampler.MinFilter == GL_LINEAR) &&
+ intelImage->base.Base.Level == firstLevel &&
+ (intel->gen < 4 || firstLevel == 0)) {
+ lastLevel = firstLevel;
+ } else if (intelObj->base.Target == GL_TEXTURE_EXTERNAL_OES) {
+ lastLevel = firstLevel;
+ } else {
+ lastLevel = firstLevel + _mesa_logbase2(MAX2(MAX2(width, height), depth));
+ }
+ }
+
+ return intel_miptree_create(intel,
+ intelObj->base.Target,
+ intelImage->base.Base.TexFormat,
+ firstLevel,
+ lastLevel,
+ width,
+ height,
+ depth,
+ expect_accelerated_upload,
+ 0 /* num_samples */,
+ INTEL_MSAA_LAYOUT_NONE);
+}
+
+/* There are actually quite a few combinations this will work for,
+ * more than what I've listed here.
+ */
+static bool
+check_pbo_format(GLenum format, GLenum type,
+ gl_format mesa_format)
+{
+ switch (mesa_format) {
+ case MESA_FORMAT_ARGB8888:
+ return (format == GL_BGRA && (type == GL_UNSIGNED_BYTE ||
+ type == GL_UNSIGNED_INT_8_8_8_8_REV));
+ case MESA_FORMAT_RGB565:
+ return (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5);
+ case MESA_FORMAT_L8:
+ return (format == GL_LUMINANCE && type == GL_UNSIGNED_BYTE);
+ case MESA_FORMAT_YCBCR:
+ return (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE);
+ default:
+ return false;
+ }
+}
+
+
+/* XXX: Do this for TexSubImage also:
+ */
+static bool
+try_pbo_upload(struct gl_context *ctx,
+ struct gl_texture_image *image,
+ const struct gl_pixelstore_attrib *unpack,
+ GLenum format, GLenum type, const void *pixels)
+{
+ struct intel_texture_image *intelImage = intel_texture_image(image);
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj);
+ GLuint src_offset, src_stride;
+ GLuint dst_x, dst_y, dst_stride;
+ drm_intel_bo *dst_buffer, *src_buffer;
+
+ if (!_mesa_is_bufferobj(unpack->BufferObj))
+ return false;
+
+ DBG("trying pbo upload\n");
+
+ if (intel->ctx._ImageTransferState ||
+ unpack->SkipPixels || unpack->SkipRows) {
+ DBG("%s: image transfer\n", __FUNCTION__);
+ return false;
+ }
+
+ if (!check_pbo_format(format, type, intelImage->base.Base.TexFormat)) {
+ DBG("%s: format mismatch (upload to %s with format 0x%x, type 0x%x)\n",
+ __FUNCTION__, _mesa_get_format_name(intelImage->base.Base.TexFormat),
+ format, type);
+ return false;
+ }
+
+ ctx->Driver.AllocTextureImageBuffer(ctx, image);
+
+ if (!intelImage->mt) {
+ DBG("%s: no miptree\n", __FUNCTION__);
+ return false;
+ }
+
+ dst_buffer = intelImage->mt->region->bo;
+ src_buffer = intel_bufferobj_source(intel, pbo, 64, &src_offset);
+ /* note: potential 64-bit ptr to 32-bit int cast */
+ src_offset += (GLuint) (unsigned long) pixels;
+
+ if (unpack->RowLength > 0)
+ src_stride = unpack->RowLength;
+ else
+ src_stride = image->Width;
+
+ intel_miptree_get_image_offset(intelImage->mt, intelImage->base.Base.Level,
+ intelImage->base.Base.Face, 0,
+ &dst_x, &dst_y);
+
+ dst_stride = intelImage->mt->region->pitch;
+
+ if (!intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ src_stride, src_buffer,
+ src_offset, false,
+ dst_stride, dst_buffer, 0,
+ intelImage->mt->region->tiling,
+ 0, 0, dst_x, dst_y, image->Width, image->Height,
+ GL_COPY)) {
+ DBG("%s: blit failed\n", __FUNCTION__);
+ return false;
+ }
+
+ DBG("%s: success\n", __FUNCTION__);
+ return true;
+}
+
+static void
+intelTexImage(struct gl_context * ctx,
+ GLuint dims,
+ struct gl_texture_image *texImage,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *unpack)
+{
+ DBG("%s target %s level %d %dx%dx%d\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
+ texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
+
+ /* Attempt to use the blitter for PBO image uploads.
+ */
+ if (dims <= 2 &&
+ try_pbo_upload(ctx, texImage, unpack, format, type, pixels)) {
+ return;
+ }
+
+ DBG("%s: upload image %dx%dx%d pixels %p\n",
+ __FUNCTION__, texImage->Width, texImage->Height, texImage->Depth,
+ pixels);
+
+ _mesa_store_teximage(ctx, dims, texImage,
+ format, type, pixels, unpack);
+}
+
+
+/**
+ * Binds a region to a texture image, like it was uploaded by glTexImage2D().
+ *
+ * Used for GLX_EXT_texture_from_pixmap and EGL image extensions,
+ */
+static void
+intel_set_texture_image_region(struct gl_context *ctx,
+ struct gl_texture_image *image,
+ struct intel_region *region,
+ GLenum target,
+ GLenum internalFormat,
+ gl_format format,
+ uint32_t offset)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intel_image = intel_texture_image(image);
+ struct gl_texture_object *texobj = image->TexObject;
+ struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
+
+ _mesa_init_teximage_fields(&intel->ctx, image,
+ region->width, region->height, 1,
+ 0, internalFormat, format);
+
+ ctx->Driver.FreeTextureImageBuffer(ctx, image);
+
+ intel_image->mt = intel_miptree_create_for_region(intel, target,
+ image->TexFormat,
+ region);
+ if (intel_image->mt == NULL)
+ return;
+
+ intel_image->mt->offset = offset;
+ intel_image->base.RowStride = region->pitch;
+
+ /* Immediately validate the image to the object. */
+ intel_miptree_reference(&intel_texobj->mt, intel_image->mt);
+}
+
+void
+intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
+ GLint texture_format,
+ __DRIdrawable *dPriv)
+{
+ struct gl_framebuffer *fb = dPriv->driverPrivate;
+ struct intel_context *intel = pDRICtx->driverPrivate;
+ struct gl_context *ctx = &intel->ctx;
+ struct intel_texture_object *intelObj;
+ struct intel_renderbuffer *rb;
+ struct gl_texture_object *texObj;
+ struct gl_texture_image *texImage;
+ int level = 0, internalFormat = 0;
+ gl_format texFormat = MESA_FORMAT_NONE;
+
+ texObj = _mesa_get_current_tex_object(ctx, target);
+ intelObj = intel_texture_object(texObj);
+
+ if (!intelObj)
+ return;
+
+ if (dPriv->lastStamp != dPriv->dri2.stamp ||
+ !pDRICtx->driScreenPriv->dri2.useInvalidate)
+ intel_update_renderbuffers(pDRICtx, dPriv);
+
+ rb = intel_get_renderbuffer(fb, BUFFER_FRONT_LEFT);
+ /* If the region isn't set, then intel_update_renderbuffers was unable
+ * to get the buffers for the drawable.
+ */
+ if (!rb || !rb->mt)
+ return;
+
+ if (rb->mt->cpp == 4) {
+ if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
+ internalFormat = GL_RGB;
+ texFormat = MESA_FORMAT_XRGB8888;
+ }
+ else {
+ internalFormat = GL_RGBA;
+ texFormat = MESA_FORMAT_ARGB8888;
+ }
+ } else if (rb->mt->cpp == 2) {
+ internalFormat = GL_RGB;
+ texFormat = MESA_FORMAT_RGB565;
+ }
+
+ _mesa_lock_texture(&intel->ctx, texObj);
+ texImage = _mesa_get_tex_image(ctx, texObj, target, level);
+ intel_set_texture_image_region(ctx, texImage, rb->mt->region, target,
+ internalFormat, texFormat, 0);
+ _mesa_unlock_texture(&intel->ctx, texObj);
+}
+
+void
+intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
+{
+ /* The old interface didn't have the format argument, so copy our
+ * implementation's behavior at the time.
+ */
+ intelSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv);
+}
+
+#if FEATURE_OES_EGL_image
+static void
+intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage,
+ GLeglImageOES image_handle)
+{
+ struct intel_context *intel = intel_context(ctx);
+ __DRIscreen *screen;
+ __DRIimage *image;
+
+ screen = intel->intelScreen->driScrnPriv;
+ image = screen->dri2.image->lookupEGLImage(screen, image_handle,
+ screen->loaderPrivate);
+ if (image == NULL)
+ return;
+
+ intel_set_texture_image_region(ctx, texImage, image->region,
+ target, image->internal_format,
+ image->format, image->offset);
+}
+#endif
+
+void
+intelInitTextureImageFuncs(struct dd_function_table *functions)
+{
+ functions->TexImage = intelTexImage;
+
+#if FEATURE_OES_EGL_image
+ functions->EGLImageTargetTexture2D = intel_image_target_texture_2d;
+#endif
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_layout.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_layout.c
index fe61b441945..65645bc46a4 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_layout.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_layout.c
@@ -1 +1,206 @@
-../intel/intel_tex_layout.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+ /*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Michel Dänzer <michel@tungstengraphics.com>
+ */
+
+#include "intel_mipmap_tree.h"
+#include "intel_tex_layout.h"
+#include "intel_context.h"
+
+#include "main/image.h"
+#include "main/macros.h"
+
+static unsigned int
+intel_horizontal_texture_alignment_unit(struct intel_context *intel,
+ gl_format format)
+{
+ /**
+ * From the "Alignment Unit Size" section of various specs, namely:
+ * - Gen3 Spec: "Memory Data Formats" Volume, Section 1.20.1.4
+ * - i965 and G45 PRMs: Volume 1, Section 6.17.3.4.
+ * - Ironlake and Sandybridge PRMs: Volume 1, Part 1, Section 7.18.3.4
+ * - BSpec (for Ivybridge and slight variations in separate stencil)
+ *
+ * +----------------------------------------------------------------------+
+ * | | alignment unit width ("i") |
+ * | Surface Property |-----------------------------|
+ * | | 915 | 965 | ILK | SNB | IVB |
+ * +----------------------------------------------------------------------+
+ * | YUV 4:2:2 format | 8 | 4 | 4 | 4 | 4 |
+ * | BC1-5 compressed format (DXTn/S3TC) | 4 | 4 | 4 | 4 | 4 |
+ * | FXT1 compressed format | 8 | 8 | 8 | 8 | 8 |
+ * | Depth Buffer (16-bit) | 4 | 4 | 4 | 4 | 8 |
+ * | Depth Buffer (other) | 4 | 4 | 4 | 4 | 4 |
+ * | Separate Stencil Buffer | N/A | N/A | 8 | 8 | 8 |
+ * | All Others | 4 | 4 | 4 | 4 | 4 |
+ * +----------------------------------------------------------------------+
+ *
+ * On IVB+, non-special cases can be overridden by setting the SURFACE_STATE
+ * "Surface Horizontal Alignment" field to HALIGN_4 or HALIGN_8.
+ */
+ if (_mesa_is_format_compressed(format)) {
+ /* The hardware alignment requirements for compressed textures
+ * happen to match the block boundaries.
+ */
+ unsigned int i, j;
+ _mesa_get_format_block_size(format, &i, &j);
+ return i;
+ }
+
+ if (format == MESA_FORMAT_S8)
+ return 8;
+
+ if (intel->gen >= 7 && format == MESA_FORMAT_Z16)
+ return 8;
+
+ return 4;
+}
+
+static unsigned int
+intel_vertical_texture_alignment_unit(struct intel_context *intel,
+ gl_format format)
+{
+ /**
+ * From the "Alignment Unit Size" section of various specs, namely:
+ * - Gen3 Spec: "Memory Data Formats" Volume, Section 1.20.1.4
+ * - i965 and G45 PRMs: Volume 1, Section 6.17.3.4.
+ * - Ironlake and Sandybridge PRMs: Volume 1, Part 1, Section 7.18.3.4
+ * - BSpec (for Ivybridge and slight variations in separate stencil)
+ *
+ * +----------------------------------------------------------------------+
+ * | | alignment unit height ("j") |
+ * | Surface Property |-----------------------------|
+ * | | 915 | 965 | ILK | SNB | IVB |
+ * +----------------------------------------------------------------------+
+ * | BC1-5 compressed format (DXTn/S3TC) | 4 | 4 | 4 | 4 | 4 |
+ * | FXT1 compressed format | 4 | 4 | 4 | 4 | 4 |
+ * | Depth Buffer | 2 | 2 | 2 | 4 | 4 |
+ * | Separate Stencil Buffer | N/A | N/A | N/A | 4 | 8 |
+ * | Multisampled (4x or 8x) render target | N/A | N/A | N/A | 4 | 4 |
+ * | All Others | 2 | 2 | 2 | 2 | 2 |
+ * +----------------------------------------------------------------------+
+ *
+ * On SNB+, non-special cases can be overridden by setting the SURFACE_STATE
+ * "Surface Vertical Alignment" field to VALIGN_2 or VALIGN_4.
+ *
+ * We currently don't support multisampling.
+ */
+ if (_mesa_is_format_compressed(format))
+ return 4;
+
+ if (format == MESA_FORMAT_S8)
+ return intel->gen >= 7 ? 8 : 4;
+
+ GLenum base_format = _mesa_get_format_base_format(format);
+
+ if (intel->gen >= 6 &&
+ (base_format == GL_DEPTH_COMPONENT ||
+ base_format == GL_DEPTH_STENCIL)) {
+ return 4;
+ }
+
+ return 2;
+}
+
+void
+intel_get_texture_alignment_unit(struct intel_context *intel,
+ gl_format format,
+ unsigned int *w, unsigned int *h)
+{
+ *w = intel_horizontal_texture_alignment_unit(intel, format);
+ *h = intel_vertical_texture_alignment_unit(intel, format);
+}
+
+void i945_miptree_layout_2d(struct intel_mipmap_tree *mt)
+{
+ GLuint level;
+ GLuint x = 0;
+ GLuint y = 0;
+ GLuint width = mt->width0;
+ GLuint height = mt->height0;
+ GLuint depth = mt->depth0; /* number of array layers. */
+
+ mt->total_width = mt->width0;
+
+ if (mt->compressed) {
+ mt->total_width = ALIGN(mt->width0, mt->align_w);
+ }
+
+ /* May need to adjust width to accomodate the placement of
+ * the 2nd mipmap. This occurs when the alignment
+ * constraints of mipmap placement push the right edge of the
+ * 2nd mipmap out past the width of its parent.
+ */
+ if (mt->first_level != mt->last_level) {
+ GLuint mip1_width;
+
+ if (mt->compressed) {
+ mip1_width = ALIGN(minify(mt->width0), mt->align_w)
+ + ALIGN(minify(minify(mt->width0)), mt->align_w);
+ } else {
+ mip1_width = ALIGN(minify(mt->width0), mt->align_w)
+ + minify(minify(mt->width0));
+ }
+
+ if (mip1_width > mt->total_width) {
+ mt->total_width = mip1_width;
+ }
+ }
+
+ mt->total_height = 0;
+
+ for ( level = mt->first_level ; level <= mt->last_level ; level++ ) {
+ GLuint img_height;
+
+ intel_miptree_set_level_info(mt, level, x, y, width,
+ height, depth);
+
+ img_height = ALIGN(height, mt->align_h);
+ if (mt->compressed)
+ img_height /= mt->align_h;
+
+ /* Because the images are packed better, the final offset
+ * might not be the maximal one:
+ */
+ mt->total_height = MAX2(mt->total_height, y + img_height);
+
+ /* Layout_below: step right after second mipmap.
+ */
+ if (level == mt->first_level + 1) {
+ x += ALIGN(width, mt->align_w);
+ }
+ else {
+ y += img_height;
+ }
+
+ width = minify(width);
+ height = minify(height);
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index b3a8a3d7ca7..ae4b3bca305 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -1 +1,177 @@
-../intel/intel_tex_subimage.c \ No newline at end of file
+
+/**************************************************************************
+ *
+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include "main/mtypes.h"
+#include "main/pbo.h"
+#include "main/texobj.h"
+#include "main/texstore.h"
+#include "main/texcompress.h"
+#include "main/enums.h"
+
+#include "intel_context.h"
+#include "intel_tex.h"
+#include "intel_mipmap_tree.h"
+#include "intel_blit.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+static bool
+intel_blit_texsubimage(struct gl_context * ctx,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset,
+ GLint width, GLint height,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *packing)
+{
+ struct intel_context *intel = intel_context(ctx);
+ struct intel_texture_image *intelImage = intel_texture_image(texImage);
+ GLuint dstRowStride = 0;
+ drm_intel_bo *temp_bo = NULL;
+ unsigned int blit_x = 0, blit_y = 0;
+ unsigned long pitch;
+ uint32_t tiling_mode = I915_TILING_NONE;
+ GLubyte *dstMap;
+
+ /* Try to do a blit upload of the subimage if the texture is
+ * currently busy.
+ */
+ if (!intelImage->mt)
+ return false;
+
+ /* The blitter can't handle Y tiling */
+ if (intelImage->mt->region->tiling == I915_TILING_Y)
+ return false;
+
+ if (texImage->TexObject->Target != GL_TEXTURE_2D)
+ return false;
+
+ /* On gen6, it's probably not worth swapping to the blit ring to do
+ * this because of all the overhead involved.
+ */
+ if (intel->gen >= 6)
+ return false;
+
+ if (!drm_intel_bo_busy(intelImage->mt->region->bo))
+ return false;
+
+ DBG("BLT subimage %s target %s level %d offset %d,%d %dx%d\n",
+ __FUNCTION__,
+ _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
+ texImage->Level, xoffset, yoffset, width, height);
+
+ pixels = _mesa_validate_pbo_teximage(ctx, 2, width, height, 1,
+ format, type, pixels, packing,
+ "glTexSubImage");
+ if (!pixels)
+ return false;
+
+ temp_bo = drm_intel_bo_alloc_tiled(intel->bufmgr,
+ "subimage blit bo",
+ width, height,
+ intelImage->mt->cpp,
+ &tiling_mode,
+ &pitch,
+ 0);
+ if (temp_bo == NULL) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage");
+ return false;
+ }
+
+ if (drm_intel_gem_bo_map_gtt(temp_bo)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage");
+ return false;
+ }
+
+ dstMap = temp_bo->virtual;
+ dstRowStride = pitch;
+
+ intel_miptree_get_image_offset(intelImage->mt, texImage->Level,
+ intelImage->base.Base.Face, 0,
+ &blit_x, &blit_y);
+ blit_x += xoffset;
+ blit_y += yoffset;
+
+ if (!_mesa_texstore(ctx, 2, texImage->_BaseFormat,
+ texImage->TexFormat,
+ dstRowStride,
+ &dstMap,
+ width, height, 1,
+ format, type, pixels, packing)) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage");
+ }
+
+ bool ret;
+ unsigned int dst_pitch = intelImage->mt->region->pitch *
+ intelImage->mt->cpp;
+
+ drm_intel_gem_bo_unmap_gtt(temp_bo);
+
+ ret = intelEmitCopyBlit(intel,
+ intelImage->mt->cpp,
+ dstRowStride / intelImage->mt->cpp,
+ temp_bo, 0, false,
+ dst_pitch / intelImage->mt->cpp,
+ intelImage->mt->region->bo, 0,
+ intelImage->mt->region->tiling,
+ 0, 0, blit_x, blit_y, width, height,
+ GL_COPY);
+ assert(ret);
+
+ drm_intel_bo_unreference(temp_bo);
+ _mesa_unmap_teximage_pbo(ctx, packing);
+
+ return true;
+}
+
+static void
+intelTexSubImage(struct gl_context * ctx,
+ GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLenum type,
+ const GLvoid * pixels,
+ const struct gl_pixelstore_attrib *packing)
+{
+ /* The intel_blit_texsubimage() function only handles 2D images */
+ if (dims != 2 || !intel_blit_texsubimage(ctx, texImage,
+ xoffset, yoffset,
+ width, height,
+ format, type, pixels, packing)) {
+ _mesa_store_texsubimage(ctx, dims, texImage,
+ xoffset, yoffset, zoffset,
+ width, height, depth,
+ format, type, pixels, packing);
+ }
+}
+
+void
+intelInitTextureSubImageFuncs(struct dd_function_table *functions)
+{
+ functions->TexSubImage = intelTexSubImage;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_validate.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_validate.c
index 41a75674c27..578b4173512 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_validate.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/i965/intel_tex_validate.c
@@ -1 +1,218 @@
-../intel/intel_tex_validate.c \ No newline at end of file
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/samplerobj.h"
+#include "main/texobj.h"
+
+#include "intel_context.h"
+#include "intel_mipmap_tree.h"
+#include "intel_blit.h"
+#include "intel_tex.h"
+#include "intel_tex_layout.h"
+
+#define FILE_DEBUG_FLAG DEBUG_TEXTURE
+
+/**
+ * When validating, we only care about the texture images that could
+ * be seen, so for non-mipmapped modes we want to ignore everything
+ * but BaseLevel.
+ */
+static void
+intel_update_max_level(struct intel_texture_object *intelObj,
+ struct gl_sampler_object *sampler)
+{
+ struct gl_texture_object *tObj = &intelObj->base;
+
+ if (sampler->MinFilter == GL_NEAREST ||
+ sampler->MinFilter == GL_LINEAR) {
+ intelObj->_MaxLevel = tObj->BaseLevel;
+ } else {
+ intelObj->_MaxLevel = tObj->_MaxLevel;
+ }
+}
+
+/*
+ */
+GLuint
+intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
+{
+ struct gl_context *ctx = &intel->ctx;
+ struct gl_texture_object *tObj = intel->ctx.Texture.Unit[unit]._Current;
+ struct intel_texture_object *intelObj = intel_texture_object(tObj);
+ struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
+ GLuint face, i;
+ GLuint nr_faces = 0;
+ struct intel_texture_image *firstImage;
+ int width, height, depth;
+
+ /* TBOs require no validation -- they always just point to their BO. */
+ if (tObj->Target == GL_TEXTURE_BUFFER)
+ return true;
+
+ /* We know/require this is true by now:
+ */
+ assert(intelObj->base._BaseComplete);
+
+ /* What levels must the tree include at a minimum?
+ */
+ intel_update_max_level(intelObj, sampler);
+ firstImage = intel_texture_image(tObj->Image[0][tObj->BaseLevel]);
+
+ /* Check tree can hold all active levels. Check tree matches
+ * target, imageFormat, etc.
+ *
+ * For pre-gen4, we have to match first_level == tObj->BaseLevel,
+ * because we don't have the control that gen4 does to make min/mag
+ * determination happen at a nonzero (hardware) baselevel. Because
+ * of that, we just always relayout on baselevel change.
+ */
+ if (intelObj->mt &&
+ (!intel_miptree_match_image(intelObj->mt, &firstImage->base.Base) ||
+ intelObj->mt->first_level != tObj->BaseLevel ||
+ intelObj->mt->last_level < intelObj->_MaxLevel)) {
+ intel_miptree_release(&intelObj->mt);
+ }
+
+
+ /* May need to create a new tree:
+ */
+ if (!intelObj->mt) {
+ intel_miptree_get_dimensions_for_image(&firstImage->base.Base,
+ &width, &height, &depth);
+
+ intelObj->mt = intel_miptree_create(intel,
+ intelObj->base.Target,
+ firstImage->base.Base.TexFormat,
+ tObj->BaseLevel,
+ intelObj->_MaxLevel,
+ width,
+ height,
+ depth,
+ true,
+ 0 /* num_samples */,
+ INTEL_MSAA_LAYOUT_NONE);
+ if (!intelObj->mt)
+ return false;
+ }
+
+ /* Pull in any images not in the object's tree:
+ */
+ nr_faces = _mesa_num_tex_faces(intelObj->base.Target);
+ for (face = 0; face < nr_faces; face++) {
+ for (i = tObj->BaseLevel; i <= intelObj->_MaxLevel; i++) {
+ struct intel_texture_image *intelImage =
+ intel_texture_image(intelObj->base.Image[face][i]);
+ /* skip too small size mipmap */
+ if (intelImage == NULL)
+ break;
+
+ if (intelObj->mt != intelImage->mt) {
+ intel_miptree_copy_teximage(intel, intelImage, intelObj->mt);
+ }
+ }
+ }
+
+ return true;
+}
+
+/**
+ * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
+ */
+static void
+intel_tex_map_image_for_swrast(struct intel_context *intel,
+ struct intel_texture_image *intel_image,
+ GLbitfield mode)
+{
+ int level;
+ int face;
+ struct intel_mipmap_tree *mt;
+ unsigned int x, y;
+
+ if (!intel_image || !intel_image->mt)
+ return;
+
+ level = intel_image->base.Base.Level;
+ face = intel_image->base.Base.Face;
+ mt = intel_image->mt;
+
+ for (int i = 0; i < mt->level[level].depth; i++)
+ intel_miptree_slice_resolve_depth(intel, mt, level, i);
+
+ if (mt->target == GL_TEXTURE_3D ||
+ mt->target == GL_TEXTURE_2D_ARRAY ||
+ mt->target == GL_TEXTURE_1D_ARRAY) {
+ int i;
+
+ /* ImageOffsets[] is only used for swrast's fetch_texel_3d, so we can't
+ * share code with the normal path.
+ */
+ for (i = 0; i < mt->level[level].depth; i++) {
+ intel_miptree_get_image_offset(mt, level, face, i, &x, &y);
+ intel_image->base.ImageOffsets[i] = x + y * mt->region->pitch;
+ }
+
+ DBG("%s \n", __FUNCTION__);
+
+ intel_image->base.Map = intel_region_map(intel, mt->region, mode);
+ } else {
+ assert(intel_image->base.Base.Depth == 1);
+ intel_miptree_get_image_offset(mt, level, face, 0, &x, &y);
+
+ DBG("%s: (%d,%d) -> (%d, %d)/%d\n",
+ __FUNCTION__, face, level, x, y, mt->region->pitch * mt->cpp);
+
+ intel_image->base.Map = intel_region_map(intel, mt->region, mode) +
+ (x + y * mt->region->pitch) * mt->cpp;
+ }
+
+ intel_image->base.RowStride = mt->region->pitch;
+}
+
+static void
+intel_tex_unmap_image_for_swrast(struct intel_context *intel,
+ struct intel_texture_image *intel_image)
+{
+ if (intel_image && intel_image->mt) {
+ intel_region_unmap(intel, intel_image->mt->region);
+ intel_image->base.Map = NULL;
+ }
+}
+
+/**
+ * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT
+ */
+void
+intel_tex_map_images(struct intel_context *intel,
+ struct intel_texture_object *intelObj,
+ GLbitfield mode)
+{
+ GLuint nr_faces = _mesa_num_tex_faces(intelObj->base.Target);
+ int i, face;
+
+ DBG("%s\n", __FUNCTION__);
+
+ for (i = intelObj->base.BaseLevel; i <= intelObj->_MaxLevel; i++) {
+ for (face = 0; face < nr_faces; face++) {
+ struct intel_texture_image *intel_image =
+ intel_texture_image(intelObj->base.Image[face][i]);
+
+ intel_tex_map_image_for_swrast(intel, intel_image, mode);
+ }
+ }
+}
+
+void
+intel_tex_unmap_images(struct intel_context *intel,
+ struct intel_texture_object *intelObj)
+{
+ GLuint nr_faces = _mesa_num_tex_faces(intelObj->base.Target);
+ int i, face;
+
+ for (i = intelObj->base.BaseLevel; i <= intelObj->_MaxLevel; i++) {
+ for (face = 0; face < nr_faces; face++) {
+ struct intel_texture_image *intel_image =
+ intel_texture_image(intelObj->base.Image[face][i]);
+
+ intel_tex_unmap_image_for_swrast(intel, intel_image);
+ }
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.c
index f6a5f664701..5abc52ba3f7 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.c
@@ -1 +1,233 @@
-../radeon/radeon_buffer_objects.c \ No newline at end of file
+/*
+ * Copyright 2009 Maciej Cencora <m.cencora@gmail.com>
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "radeon_buffer_objects.h"
+
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/bufferobj.h"
+
+#include "radeon_common.h"
+
+struct radeon_buffer_object *
+get_radeon_buffer_object(struct gl_buffer_object *obj)
+{
+ return (struct radeon_buffer_object *) obj;
+}
+
+static struct gl_buffer_object *
+radeonNewBufferObject(struct gl_context * ctx,
+ GLuint name,
+ GLenum target)
+{
+ struct radeon_buffer_object *obj = CALLOC_STRUCT(radeon_buffer_object);
+
+ _mesa_initialize_buffer_object(ctx, &obj->Base, name, target);
+
+ obj->bo = NULL;
+
+ return &obj->Base;
+}
+
+/**
+ * Called via glDeleteBuffersARB().
+ */
+static void
+radeonDeleteBufferObject(struct gl_context * ctx,
+ struct gl_buffer_object *obj)
+{
+ struct radeon_buffer_object *radeon_obj = get_radeon_buffer_object(obj);
+
+ if (obj->Pointer) {
+ radeon_bo_unmap(radeon_obj->bo);
+ }
+
+ if (radeon_obj->bo) {
+ radeon_bo_unref(radeon_obj->bo);
+ }
+
+ free(radeon_obj);
+}
+
+
+/**
+ * Allocate space for and store data in a buffer object. Any data that was
+ * previously stored in the buffer object is lost. If data is NULL,
+ * memory will be allocated, but no copy will occur.
+ * Called via ctx->Driver.BufferData().
+ * \return GL_TRUE for success, GL_FALSE if out of memory
+ */
+static GLboolean
+radeonBufferData(struct gl_context * ctx,
+ GLenum target,
+ GLsizeiptrARB size,
+ const GLvoid * data,
+ GLenum usage,
+ struct gl_buffer_object *obj)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct radeon_buffer_object *radeon_obj = get_radeon_buffer_object(obj);
+
+ radeon_obj->Base.Size = size;
+ radeon_obj->Base.Usage = usage;
+
+ if (radeon_obj->bo != NULL) {
+ radeon_bo_unref(radeon_obj->bo);
+ radeon_obj->bo = NULL;
+ }
+
+ if (size != 0) {
+ radeon_obj->bo = radeon_bo_open(radeon->radeonScreen->bom,
+ 0,
+ size,
+ 32,
+ RADEON_GEM_DOMAIN_GTT,
+ 0);
+
+ if (!radeon_obj->bo)
+ return GL_FALSE;
+
+ if (data != NULL) {
+ radeon_bo_map(radeon_obj->bo, GL_TRUE);
+
+ memcpy(radeon_obj->bo->ptr, data, size);
+
+ radeon_bo_unmap(radeon_obj->bo);
+ }
+ }
+ return GL_TRUE;
+}
+
+/**
+ * Replace data in a subrange of buffer object. If the data range
+ * specified by size + offset extends beyond the end of the buffer or
+ * if data is NULL, no copy is performed.
+ * Called via glBufferSubDataARB().
+ */
+static void
+radeonBufferSubData(struct gl_context * ctx,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ const GLvoid * data,
+ struct gl_buffer_object *obj)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct radeon_buffer_object *radeon_obj = get_radeon_buffer_object(obj);
+
+ if (radeon_bo_is_referenced_by_cs(radeon_obj->bo, radeon->cmdbuf.cs)) {
+ radeon_firevertices(radeon);
+ }
+
+ radeon_bo_map(radeon_obj->bo, GL_TRUE);
+
+ memcpy(radeon_obj->bo->ptr + offset, data, size);
+
+ radeon_bo_unmap(radeon_obj->bo);
+}
+
+/**
+ * Called via glGetBufferSubDataARB()
+ */
+static void
+radeonGetBufferSubData(struct gl_context * ctx,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ GLvoid * data,
+ struct gl_buffer_object *obj)
+{
+ struct radeon_buffer_object *radeon_obj = get_radeon_buffer_object(obj);
+
+ radeon_bo_map(radeon_obj->bo, GL_FALSE);
+
+ memcpy(data, radeon_obj->bo->ptr + offset, size);
+
+ radeon_bo_unmap(radeon_obj->bo);
+}
+
+/**
+ * Called via glMapBuffer() and glMapBufferRange()
+ */
+static void *
+radeonMapBufferRange(struct gl_context * ctx,
+ GLintptr offset, GLsizeiptr length,
+ GLbitfield access, struct gl_buffer_object *obj)
+{
+ struct radeon_buffer_object *radeon_obj = get_radeon_buffer_object(obj);
+ const GLboolean write_only =
+ (access & (GL_MAP_READ_BIT | GL_MAP_WRITE_BIT)) == GL_MAP_WRITE_BIT;
+
+ if (write_only) {
+ ctx->Driver.Flush(ctx);
+ }
+
+ if (radeon_obj->bo == NULL) {
+ obj->Pointer = NULL;
+ return NULL;
+ }
+
+ obj->Offset = offset;
+ obj->Length = length;
+ obj->AccessFlags = access;
+
+ radeon_bo_map(radeon_obj->bo, write_only);
+
+ obj->Pointer = radeon_obj->bo->ptr + offset;
+ return obj->Pointer;
+}
+
+
+/**
+ * Called via glUnmapBufferARB()
+ */
+static GLboolean
+radeonUnmapBuffer(struct gl_context * ctx,
+ struct gl_buffer_object *obj)
+{
+ struct radeon_buffer_object *radeon_obj = get_radeon_buffer_object(obj);
+
+ if (radeon_obj->bo != NULL) {
+ radeon_bo_unmap(radeon_obj->bo);
+ }
+
+ obj->Pointer = NULL;
+ obj->Offset = 0;
+ obj->Length = 0;
+
+ return GL_TRUE;
+}
+
+void
+radeonInitBufferObjectFuncs(struct dd_function_table *functions)
+{
+ functions->NewBufferObject = radeonNewBufferObject;
+ functions->DeleteBuffer = radeonDeleteBufferObject;
+ functions->BufferData = radeonBufferData;
+ functions->BufferSubData = radeonBufferSubData;
+ functions->GetBufferSubData = radeonGetBufferSubData;
+ functions->MapBufferRange = radeonMapBufferRange;
+ functions->UnmapBuffer = radeonUnmapBuffer;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.h
index 2f134fd17b8..d681960825a 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_buffer_objects.h
@@ -1 +1,52 @@
-../radeon/radeon_buffer_objects.h \ No newline at end of file
+/*
+ * Copyright 2009 Maciej Cencora <m.cencora@gmail.com>
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef RADEON_BUFFER_OBJECTS_H
+#define RADEON_BUFFER_OBJECTS_H
+
+#include "main/mtypes.h"
+
+struct radeon_bo;
+
+/**
+ * Radeon vertex/pixel buffer object, derived from Mesa's gl_buffer_object.
+ */
+struct radeon_buffer_object
+{
+ struct gl_buffer_object Base;
+ struct radeon_bo *bo;
+};
+
+struct radeon_buffer_object *
+get_radeon_buffer_object(struct gl_buffer_object *obj);
+
+/**
+ * Hook the bufferobject implementation into mesa:
+ */
+void radeonInitBufferObjectFuncs(struct dd_function_table *functions);
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_chipset.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_chipset.h
index eba99001ff8..023c12c790d 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_chipset.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_chipset.h
@@ -1 +1,41 @@
-../radeon/radeon_chipset.h \ No newline at end of file
+#ifndef _RADEON_CHIPSET_H
+#define _RADEON_CHIPSET_H
+
+/* General chip classes:
+ * r100 includes R100, RV100, RV200, RS100, RS200, RS250.
+ * r200 includes R200, RV250, RV280, RS300.
+ * (RS* denotes IGP)
+ */
+
+enum {
+#define CHIPSET(id, name, family) PCI_CHIP_##name = id,
+#if defined(RADEON_R100)
+#include "pci_ids/radeon_pci_ids.h"
+#elif defined(RADEON_R200)
+#include "pci_ids/r200_pci_ids.h"
+#endif
+#undef CHIPSET
+};
+
+enum {
+#if defined(RADEON_R100)
+ CHIP_FAMILY_R100,
+ CHIP_FAMILY_RV100,
+ CHIP_FAMILY_RS100,
+ CHIP_FAMILY_RV200,
+ CHIP_FAMILY_RS200,
+#elif defined(RADEON_R200)
+ CHIP_FAMILY_R200,
+ CHIP_FAMILY_RV250,
+ CHIP_FAMILY_RS300,
+ CHIP_FAMILY_RV280,
+#endif
+ CHIP_FAMILY_LAST
+};
+
+#define RADEON_CHIPSET_TCL (1 << 0) /* tcl support - any radeon */
+#define RADEON_CHIPSET_BROKEN_STENCIL (1 << 1) /* r100 stencil bug */
+#define R200_CHIPSET_YCBCR_BROKEN (1 << 2) /* r200 ycbcr bug */
+#define RADEON_CHIPSET_DEPTH_ALWAYS_TILED (1 << 3) /* M7 and R200s */
+
+#endif /* _RADEON_CHIPSET_H */
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_cmdbuf.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_cmdbuf.h
index a799e1dc6df..9f8d6cc49de 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_cmdbuf.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_cmdbuf.h
@@ -1 +1,113 @@
-../radeon/radeon_cmdbuf.h \ No newline at end of file
+#ifndef COMMON_CMDBUF_H
+#define COMMON_CMDBUF_H
+
+GLboolean rcommonEnsureCmdBufSpace(radeonContextPtr rmesa, int dwords, const char *caller);
+int rcommonFlushCmdBuf(radeonContextPtr rmesa, const char *caller);
+int rcommonFlushCmdBufLocked(radeonContextPtr rmesa, const char *caller);
+void rcommonInitCmdBuf(radeonContextPtr rmesa);
+void rcommonDestroyCmdBuf(radeonContextPtr rmesa);
+
+void rcommonBeginBatch(radeonContextPtr rmesa,
+ int n,
+ int dostate,
+ const char *file,
+ const char *function,
+ int line);
+
+/* +r6/r7 : code here moved */
+
+#define CP_PACKET2 (2 << 30)
+#define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2))
+#define CP_PACKET0_ONE(reg, n) (RADEON_CP_PACKET0 | RADEON_CP_PACKET0_ONE_REG_WR | ((n)<<16) | ((reg)>>2))
+#define CP_PACKET3(pkt, n) (RADEON_CP_PACKET3 | (pkt) | ((n) << 16))
+
+/**
+ * Every function writing to the command buffer needs to declare this
+ * to get the necessary local variables.
+ */
+#define BATCH_LOCALS(rmesa) \
+ const radeonContextPtr b_l_rmesa = rmesa
+
+/**
+ * Prepare writing n dwords to the command buffer,
+ * including producing any necessary state emits on buffer wraparound.
+ */
+#define BEGIN_BATCH(n) rcommonBeginBatch(b_l_rmesa, n, 1, __FILE__, __FUNCTION__, __LINE__)
+
+/**
+ * Same as BEGIN_BATCH, but do not cause automatic state emits.
+ */
+#define BEGIN_BATCH_NO_AUTOSTATE(n) rcommonBeginBatch(b_l_rmesa, n, 0, __FILE__, __FUNCTION__, __LINE__)
+
+/**
+ * Write one dword to the command buffer.
+ */
+#define OUT_BATCH(data) \
+ do { \
+ radeon_cs_write_dword(b_l_rmesa->cmdbuf.cs, data);\
+ } while(0)
+
+/**
+ * Write a relocated dword to the command buffer.
+ */
+#define OUT_BATCH_RELOC(data, bo, offset, rd, wd, flags) \
+ do { \
+ int __offset = (offset); \
+ if (0 && __offset) { \
+ fprintf(stderr, "(%s:%s:%d) offset : %d\n", \
+ __FILE__, __FUNCTION__, __LINE__, __offset); \
+ } \
+ radeon_cs_write_dword(b_l_rmesa->cmdbuf.cs, __offset); \
+ radeon_cs_write_reloc(b_l_rmesa->cmdbuf.cs, \
+ bo, rd, wd, flags); \
+ } while(0)
+
+
+/**
+ * Write n dwords from ptr to the command buffer.
+ */
+#define OUT_BATCH_TABLE(ptr,n) \
+ do { \
+ radeon_cs_write_table(b_l_rmesa->cmdbuf.cs, (ptr), (n));\
+ } while(0)
+
+/**
+ * Finish writing dwords to the command buffer.
+ * The number of (direct or indirect) OUT_BATCH calls between the previous
+ * BEGIN_BATCH and END_BATCH must match the number specified at BEGIN_BATCH time.
+ */
+#define END_BATCH() \
+ do { \
+ radeon_cs_end(b_l_rmesa->cmdbuf.cs, __FILE__, __FUNCTION__, __LINE__);\
+ } while(0)
+
+/**
+ * After the last END_BATCH() of rendering, this indicates that flushing
+ * the command buffer now is okay.
+ */
+#define COMMIT_BATCH() \
+ do { \
+ } while(0)
+
+
+/** Single register write to command buffer; requires 2 dwords. */
+#define OUT_BATCH_REGVAL(reg, val) \
+ OUT_BATCH(cmdpacket0(b_l_rmesa->radeonScreen, (reg), 1)); \
+ OUT_BATCH((val))
+
+/** Continuous register range write to command buffer; requires 1 dword,
+ * expects count dwords afterwards for register contents. */
+#define OUT_BATCH_REGSEQ(reg, count) \
+ OUT_BATCH(cmdpacket0(b_l_rmesa->radeonScreen, (reg), (count)))
+
+/* +r6/r7 : code here moved */
+
+/* Fire the buffered vertices no matter what.
+ */
+static INLINE void radeon_firevertices(radeonContextPtr radeon)
+{
+ if (radeon->cmdbuf.cs->cdw || radeon->dma.flush )
+ radeon->glCtx->Driver.Flush(radeon->glCtx); /* +r6/r7 */
+}
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.c
index 67b19ba940d..c9f9b207811 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.c
@@ -1 +1,791 @@
-../radeon/radeon_common.c \ No newline at end of file
+/**************************************************************************
+
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+/*
+ - Scissor implementation
+ - buffer swap/copy ioctls
+ - finish/flush
+ - state emission
+ - cmdbuffer management
+*/
+
+#include <errno.h>
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "drivers/common/meta.h"
+
+#include "radeon_common.h"
+#include "radeon_drm.h"
+#include "radeon_queryobj.h"
+
+/**
+ * Enable verbose debug output for emit code.
+ * 0 no output
+ * 1 most output
+ * 2 also print state alues
+ */
+#define RADEON_CMDBUF 0
+
+/* =============================================================
+ * Scissoring
+ */
+
+/**
+ * Update cliprects and scissors.
+ */
+void radeonSetCliprects(radeonContextPtr radeon)
+{
+ __DRIdrawable *const drawable = radeon_get_drawable(radeon);
+ __DRIdrawable *const readable = radeon_get_readable(radeon);
+
+ if(drawable == NULL && readable == NULL)
+ return;
+
+ struct radeon_framebuffer *const draw_rfb = drawable->driverPrivate;
+ struct radeon_framebuffer *const read_rfb = readable->driverPrivate;
+
+ if ((draw_rfb->base.Width != drawable->w) ||
+ (draw_rfb->base.Height != drawable->h)) {
+ _mesa_resize_framebuffer(radeon->glCtx, &draw_rfb->base,
+ drawable->w, drawable->h);
+ draw_rfb->base.Initialized = GL_TRUE;
+ }
+
+ if (drawable != readable) {
+ if ((read_rfb->base.Width != readable->w) ||
+ (read_rfb->base.Height != readable->h)) {
+ _mesa_resize_framebuffer(radeon->glCtx, &read_rfb->base,
+ readable->w, readable->h);
+ read_rfb->base.Initialized = GL_TRUE;
+ }
+ }
+
+ if (radeon->state.scissor.enabled)
+ radeonUpdateScissor(radeon->glCtx);
+
+}
+
+
+
+void radeonUpdateScissor( struct gl_context *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLint x = ctx->Scissor.X, y = ctx->Scissor.Y;
+ GLsizei w = ctx->Scissor.Width, h = ctx->Scissor.Height;
+ int x1, y1, x2, y2;
+ int min_x, min_y, max_x, max_y;
+
+ if (!ctx->DrawBuffer)
+ return;
+ min_x = min_y = 0;
+ max_x = ctx->DrawBuffer->Width - 1;
+ max_y = ctx->DrawBuffer->Height - 1;
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ x1 = x;
+ y1 = ctx->DrawBuffer->Height - (y + h);
+ x2 = x + w - 1;
+ y2 = y1 + h - 1;
+ } else {
+ x1 = x;
+ y1 = y;
+ x2 = x + w - 1;
+ y2 = y + h - 1;
+
+ }
+
+ rmesa->state.scissor.rect.x1 = CLAMP(x1, min_x, max_x);
+ rmesa->state.scissor.rect.y1 = CLAMP(y1, min_y, max_y);
+ rmesa->state.scissor.rect.x2 = CLAMP(x2, min_x, max_x);
+ rmesa->state.scissor.rect.y2 = CLAMP(y2, min_y, max_y);
+
+ if (rmesa->vtbl.update_scissor)
+ rmesa->vtbl.update_scissor(ctx);
+}
+
+/* =============================================================
+ * Scissoring
+ */
+
+void radeonScissor(struct gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ if (ctx->Scissor.Enabled) {
+ /* We don't pipeline cliprect changes */
+ radeon_firevertices(radeon);
+ radeonUpdateScissor(ctx);
+ }
+}
+
+/* ================================================================
+ * SwapBuffers with client-side throttling
+ */
+
+uint32_t radeonGetAge(radeonContextPtr radeon)
+{
+ drm_radeon_getparam_t gp;
+ int ret;
+ uint32_t age;
+
+ gp.param = RADEON_PARAM_LAST_CLEAR;
+ gp.value = (int *)&age;
+ ret = drmCommandWriteRead(radeon->dri.fd, DRM_RADEON_GETPARAM,
+ &gp, sizeof(gp));
+ if (ret) {
+ fprintf(stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__,
+ ret);
+ exit(1);
+ }
+
+ return age;
+}
+
+/**
+ * Check if we're about to draw into the front color buffer.
+ * If so, set the intel->front_buffer_dirty field to true.
+ */
+void
+radeon_check_front_buffer_rendering(struct gl_context *ctx)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ const struct gl_framebuffer *fb = ctx->DrawBuffer;
+
+ if (fb->Name == 0) {
+ /* drawing to window system buffer */
+ if (fb->_NumColorDrawBuffers > 0) {
+ if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
+ radeon->front_buffer_dirty = GL_TRUE;
+ }
+ }
+ }
+}
+
+
+void radeon_draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct radeon_renderbuffer *rrbDepth = NULL, *rrbStencil = NULL,
+ *rrbColor = NULL;
+ uint32_t offset = 0;
+
+
+ if (!fb) {
+ /* this can happen during the initial context initialization */
+ return;
+ }
+
+ /* radeons only handle 1 color draw so far */
+ if (fb->_NumColorDrawBuffers != 1) {
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_DRAW_BUFFER, GL_TRUE);
+ return;
+ }
+
+ /* Do this here, note core Mesa, since this function is called from
+ * many places within the driver.
+ */
+ if (ctx->NewState & (_NEW_BUFFERS | _NEW_COLOR | _NEW_PIXEL)) {
+ /* this updates the DrawBuffer->_NumColorDrawBuffers fields, etc */
+ _mesa_update_framebuffer(ctx);
+ /* this updates the DrawBuffer's Width/Height if it's a FBO */
+ _mesa_update_draw_buffer_bounds(ctx);
+ }
+
+ if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ /* this may occur when we're called by glBindFrameBuffer() during
+ * the process of someone setting up renderbuffers, etc.
+ */
+ /*_mesa_debug(ctx, "DrawBuffer: incomplete user FBO\n");*/
+ return;
+ }
+
+ if (fb->Name)
+ ;/* do something depthy/stencily TODO */
+
+
+ /* none */
+ if (fb->Name == 0) {
+ if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) {
+ rrbColor = radeon_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
+ radeon->front_cliprects = GL_TRUE;
+ } else {
+ rrbColor = radeon_renderbuffer(fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer);
+ radeon->front_cliprects = GL_FALSE;
+ }
+ } else {
+ /* user FBO in theory */
+ struct radeon_renderbuffer *rrb;
+ rrb = radeon_renderbuffer(fb->_ColorDrawBuffers[0]);
+ if (rrb) {
+ offset = rrb->draw_offset;
+ rrbColor = rrb;
+ }
+ }
+
+ if (rrbColor == NULL)
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_DRAW_BUFFER, GL_TRUE);
+ else
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_DRAW_BUFFER, GL_FALSE);
+
+
+ if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
+ rrbDepth = radeon_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
+ if (rrbDepth && rrbDepth->bo) {
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_DEPTH_BUFFER, GL_FALSE);
+ } else {
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_DEPTH_BUFFER, GL_TRUE);
+ }
+ } else {
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_DEPTH_BUFFER, GL_FALSE);
+ rrbDepth = NULL;
+ }
+
+ if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) {
+ rrbStencil = radeon_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
+ if (rrbStencil && rrbStencil->bo) {
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_STENCIL_BUFFER, GL_FALSE);
+ /* need to re-compute stencil hw state */
+ if (!rrbDepth)
+ rrbDepth = rrbStencil;
+ } else {
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_STENCIL_BUFFER, GL_TRUE);
+ }
+ } else {
+ radeon->vtbl.fallback(ctx, RADEON_FALLBACK_STENCIL_BUFFER, GL_FALSE);
+ if (ctx->Driver.Enable != NULL)
+ ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled);
+ else
+ ctx->NewState |= _NEW_STENCIL;
+ }
+
+ /* Update culling direction which changes depending on the
+ * orientation of the buffer:
+ */
+ if (ctx->Driver.FrontFace)
+ ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
+ else
+ ctx->NewState |= _NEW_POLYGON;
+
+ /*
+ * Update depth test state
+ */
+ if (ctx->Driver.Enable) {
+ ctx->Driver.Enable(ctx, GL_DEPTH_TEST,
+ (ctx->Depth.Test && fb->Visual.depthBits > 0));
+ /* Need to update the derived ctx->Stencil._Enabled first */
+ ctx->Driver.Enable(ctx, GL_STENCIL_TEST,
+ (ctx->Stencil.Enabled && fb->Visual.stencilBits > 0));
+ } else {
+ ctx->NewState |= (_NEW_DEPTH | _NEW_STENCIL);
+ }
+
+ _mesa_reference_renderbuffer(&radeon->state.depth.rb, &rrbDepth->base.Base);
+ _mesa_reference_renderbuffer(&radeon->state.color.rb, &rrbColor->base.Base);
+ radeon->state.color.draw_offset = offset;
+
+#if 0
+ /* update viewport since it depends on window size */
+ if (ctx->Driver.Viewport) {
+ ctx->Driver.Viewport(ctx, ctx->Viewport.X, ctx->Viewport.Y,
+ ctx->Viewport.Width, ctx->Viewport.Height);
+ } else {
+
+ }
+#endif
+ ctx->NewState |= _NEW_VIEWPORT;
+
+ /* Set state we know depends on drawable parameters:
+ */
+ radeonUpdateScissor(ctx);
+ radeon->NewGLState |= _NEW_SCISSOR;
+
+ if (ctx->Driver.DepthRange)
+ ctx->Driver.DepthRange(ctx,
+ ctx->Viewport.Near,
+ ctx->Viewport.Far);
+
+ /* Update culling direction which changes depending on the
+ * orientation of the buffer:
+ */
+ if (ctx->Driver.FrontFace)
+ ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace);
+ else
+ ctx->NewState |= _NEW_POLYGON;
+}
+
+/**
+ * Called via glDrawBuffer.
+ */
+void radeonDrawBuffer( struct gl_context *ctx, GLenum mode )
+{
+ if (RADEON_DEBUG & RADEON_DRI)
+ fprintf(stderr, "%s %s\n", __FUNCTION__,
+ _mesa_lookup_enum_by_nr( mode ));
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+
+ const GLboolean was_front_buffer_rendering =
+ radeon->is_front_buffer_rendering;
+
+ radeon->is_front_buffer_rendering = (mode == GL_FRONT_LEFT) ||
+ (mode == GL_FRONT);
+
+ /* If we weren't front-buffer rendering before but we are now, make sure
+ * that the front-buffer has actually been allocated.
+ */
+ if (!was_front_buffer_rendering && radeon->is_front_buffer_rendering) {
+ radeon_update_renderbuffers(radeon->dri.context,
+ radeon->dri.context->driDrawablePriv, GL_FALSE);
+ }
+ }
+
+ radeon_draw_buffer(ctx, ctx->DrawBuffer);
+}
+
+void radeonReadBuffer( struct gl_context *ctx, GLenum mode )
+{
+ if (ctx->DrawBuffer && _mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ struct radeon_context *const rmesa = RADEON_CONTEXT(ctx);
+ const GLboolean was_front_buffer_reading = rmesa->is_front_buffer_reading;
+ rmesa->is_front_buffer_reading = (mode == GL_FRONT_LEFT)
+ || (mode == GL_FRONT);
+
+ if (!was_front_buffer_reading && rmesa->is_front_buffer_reading) {
+ radeon_update_renderbuffers(rmesa->dri.context,
+ rmesa->dri.context->driReadablePriv, GL_FALSE);
+ }
+ }
+ /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */
+ if (ctx->ReadBuffer == ctx->DrawBuffer) {
+ /* This will update FBO completeness status.
+ * A framebuffer will be incomplete if the GL_READ_BUFFER setting
+ * refers to a missing renderbuffer. Calling glReadBuffer can set
+ * that straight and can make the drawing buffer complete.
+ */
+ radeon_draw_buffer(ctx, ctx->DrawBuffer);
+ }
+}
+
+void radeon_window_moved(radeonContextPtr radeon)
+{
+ /* Cliprects has to be updated before doing anything else */
+ radeonSetCliprects(radeon);
+}
+
+void radeon_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ __DRIcontext *driContext = radeon->dri.context;
+ void (*old_viewport)(struct gl_context *ctx, GLint x, GLint y,
+ GLsizei w, GLsizei h);
+
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
+ if (radeon->is_front_buffer_rendering) {
+ ctx->Driver.Flush(ctx);
+ }
+ radeon_update_renderbuffers(driContext, driContext->driDrawablePriv, GL_FALSE);
+ if (driContext->driDrawablePriv != driContext->driReadablePriv)
+ radeon_update_renderbuffers(driContext, driContext->driReadablePriv, GL_FALSE);
+ }
+
+ old_viewport = ctx->Driver.Viewport;
+ ctx->Driver.Viewport = NULL;
+ radeon_window_moved(radeon);
+ radeon_draw_buffer(ctx, radeon->glCtx->DrawBuffer);
+ ctx->Driver.Viewport = old_viewport;
+}
+
+static void radeon_print_state_atom(radeonContextPtr radeon, struct radeon_state_atom *state)
+{
+ int i, j, reg, count;
+ int dwords;
+ uint32_t packet0;
+ if (!radeon_is_debug_enabled(RADEON_STATE, RADEON_VERBOSE) )
+ return;
+
+ dwords = (*state->check) (radeon->glCtx, state);
+
+ fprintf(stderr, " emit %s %d/%d\n", state->name, dwords, state->cmd_size);
+
+ if (state->cmd && radeon_is_debug_enabled(RADEON_STATE, RADEON_TRACE)) {
+ if (dwords > state->cmd_size)
+ dwords = state->cmd_size;
+ for (i = 0; i < dwords;) {
+ packet0 = state->cmd[i];
+ reg = (packet0 & 0x1FFF) << 2;
+ count = ((packet0 & 0x3FFF0000) >> 16) + 1;
+ fprintf(stderr, " %s[%d]: cmdpacket0 (first reg=0x%04x, count=%d)\n",
+ state->name, i, reg, count);
+ ++i;
+ for (j = 0; j < count && i < dwords; j++) {
+ fprintf(stderr, " %s[%d]: 0x%04x = %08x\n",
+ state->name, i, reg, state->cmd[i]);
+ reg += 4;
+ ++i;
+ }
+ }
+ }
+}
+
+/**
+ * Count total size for next state emit.
+ **/
+GLuint radeonCountStateEmitSize(radeonContextPtr radeon)
+{
+ struct radeon_state_atom *atom;
+ GLuint dwords = 0;
+ /* check if we are going to emit full state */
+
+ if (radeon->cmdbuf.cs->cdw && !radeon->hw.all_dirty) {
+ if (!radeon->hw.is_dirty)
+ goto out;
+ foreach(atom, &radeon->hw.atomlist) {
+ if (atom->dirty) {
+ const GLuint atom_size = atom->check(radeon->glCtx, atom);
+ dwords += atom_size;
+ if (RADEON_CMDBUF && atom_size) {
+ radeon_print_state_atom(radeon, atom);
+ }
+ }
+ }
+ } else {
+ foreach(atom, &radeon->hw.atomlist) {
+ const GLuint atom_size = atom->check(radeon->glCtx, atom);
+ dwords += atom_size;
+ if (RADEON_CMDBUF && atom_size) {
+ radeon_print_state_atom(radeon, atom);
+ }
+
+ }
+ }
+out:
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s %u\n", __func__, dwords);
+ return dwords;
+}
+
+static INLINE void radeon_emit_atom(radeonContextPtr radeon, struct radeon_state_atom *atom)
+{
+ BATCH_LOCALS(radeon);
+ int dwords;
+
+ dwords = (*atom->check) (radeon->glCtx, atom);
+ if (dwords) {
+
+ radeon_print_state_atom(radeon, atom);
+
+ if (atom->emit) {
+ (*atom->emit)(radeon->glCtx, atom);
+ } else {
+ BEGIN_BATCH_NO_AUTOSTATE(dwords);
+ OUT_BATCH_TABLE(atom->cmd, dwords);
+ END_BATCH();
+ }
+ atom->dirty = GL_FALSE;
+
+ } else {
+ radeon_print(RADEON_STATE, RADEON_VERBOSE, " skip state %s\n", atom->name);
+ }
+
+}
+
+static INLINE void radeonEmitAtoms(radeonContextPtr radeon, GLboolean emitAll)
+{
+ struct radeon_state_atom *atom;
+
+ if (radeon->vtbl.pre_emit_atoms)
+ radeon->vtbl.pre_emit_atoms(radeon);
+
+ /* Emit actual atoms */
+ if (radeon->hw.all_dirty || emitAll) {
+ foreach(atom, &radeon->hw.atomlist)
+ radeon_emit_atom( radeon, atom );
+ } else {
+ foreach(atom, &radeon->hw.atomlist) {
+ if ( atom->dirty )
+ radeon_emit_atom( radeon, atom );
+ }
+ }
+
+ COMMIT_BATCH();
+}
+
+static GLboolean radeon_revalidate_bos(struct gl_context *ctx)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ int ret;
+
+ ret = radeon_cs_space_check(radeon->cmdbuf.cs);
+ if (ret == RADEON_CS_SPACE_FLUSH)
+ return GL_FALSE;
+ return GL_TRUE;
+}
+
+void radeonEmitState(radeonContextPtr radeon)
+{
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s\n", __FUNCTION__);
+
+ if (radeon->vtbl.pre_emit_state)
+ radeon->vtbl.pre_emit_state(radeon);
+
+ /* this code used to return here but now it emits zbs */
+ if (radeon->cmdbuf.cs->cdw && !radeon->hw.is_dirty && !radeon->hw.all_dirty)
+ return;
+
+ if (!radeon->cmdbuf.cs->cdw) {
+ if (RADEON_DEBUG & RADEON_STATE)
+ fprintf(stderr, "Begin reemit state\n");
+
+ radeonEmitAtoms(radeon, GL_TRUE);
+ } else {
+
+ if (RADEON_DEBUG & RADEON_STATE)
+ fprintf(stderr, "Begin dirty state\n");
+
+ radeonEmitAtoms(radeon, GL_FALSE);
+ }
+
+ radeon->hw.is_dirty = GL_FALSE;
+ radeon->hw.all_dirty = GL_FALSE;
+}
+
+
+void radeonFlush(struct gl_context *ctx)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ if (RADEON_DEBUG & RADEON_IOCTL)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, radeon->cmdbuf.cs->cdw);
+
+ /* okay if we have no cmds in the buffer &&
+ we have no DMA flush &&
+ we have no DMA buffer allocated.
+ then no point flushing anything at all.
+ */
+ if (!radeon->dma.flush && !radeon->cmdbuf.cs->cdw && is_empty_list(&radeon->dma.reserved))
+ goto flush_front;
+
+ if (radeon->dma.flush)
+ radeon->dma.flush( ctx );
+
+ if (radeon->cmdbuf.cs->cdw)
+ rcommonFlushCmdBuf(radeon, __FUNCTION__);
+
+flush_front:
+ if (_mesa_is_winsys_fbo(ctx->DrawBuffer) && radeon->front_buffer_dirty) {
+ __DRIscreen *const screen = radeon->radeonScreen->driScreen;
+
+ if (screen->dri2.loader && (screen->dri2.loader->base.version >= 2)
+ && (screen->dri2.loader->flushFrontBuffer != NULL)) {
+ __DRIdrawable * drawable = radeon_get_drawable(radeon);
+
+ /* We set the dirty bit in radeon_prepare_render() if we're
+ * front buffer rendering once we get there.
+ */
+ radeon->front_buffer_dirty = GL_FALSE;
+
+ (*screen->dri2.loader->flushFrontBuffer)(drawable, drawable->loaderPrivate);
+ }
+ }
+}
+
+/* Make sure all commands have been sent to the hardware and have
+ * completed processing.
+ */
+void radeonFinish(struct gl_context * ctx)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
+ struct radeon_renderbuffer *rrb;
+ int i;
+
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx); /* +r6/r7 */
+
+ for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
+ struct radeon_renderbuffer *rrb;
+ rrb = radeon_renderbuffer(fb->_ColorDrawBuffers[i]);
+ if (rrb && rrb->bo)
+ radeon_bo_wait(rrb->bo);
+ }
+ rrb = radeon_get_depthbuffer(radeon);
+ if (rrb && rrb->bo)
+ radeon_bo_wait(rrb->bo);
+}
+
+/* cmdbuffer */
+/**
+ * Send the current command buffer via ioctl to the hardware.
+ */
+int rcommonFlushCmdBufLocked(radeonContextPtr rmesa, const char *caller)
+{
+ int ret = 0;
+
+ if (rmesa->cmdbuf.flushing) {
+ fprintf(stderr, "Recursive call into r300FlushCmdBufLocked!\n");
+ exit(-1);
+ }
+ rmesa->cmdbuf.flushing = 1;
+
+ if (RADEON_DEBUG & RADEON_IOCTL) {
+ fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
+ }
+
+ radeonEmitQueryEnd(rmesa->glCtx);
+
+ if (rmesa->cmdbuf.cs->cdw) {
+ ret = radeon_cs_emit(rmesa->cmdbuf.cs);
+ rmesa->hw.all_dirty = GL_TRUE;
+ }
+ radeon_cs_erase(rmesa->cmdbuf.cs);
+ rmesa->cmdbuf.flushing = 0;
+
+ if (radeon_revalidate_bos(rmesa->glCtx) == GL_FALSE) {
+ fprintf(stderr,"failed to revalidate buffers\n");
+ }
+
+ return ret;
+}
+
+int rcommonFlushCmdBuf(radeonContextPtr rmesa, const char *caller)
+{
+ int ret;
+
+ radeonReleaseDmaRegions(rmesa);
+
+ ret = rcommonFlushCmdBufLocked(rmesa, caller);
+
+ if (ret) {
+ fprintf(stderr, "drmRadeonCmdBuffer: %d. Kernel failed to "
+ "parse or rejected command stream. See dmesg "
+ "for more info.\n", ret);
+ exit(ret);
+ }
+
+ return ret;
+}
+
+/**
+ * Make sure that enough space is available in the command buffer
+ * by flushing if necessary.
+ *
+ * \param dwords The number of dwords we need to be free on the command buffer
+ */
+GLboolean rcommonEnsureCmdBufSpace(radeonContextPtr rmesa, int dwords, const char *caller)
+{
+ if ((rmesa->cmdbuf.cs->cdw + dwords + 128) > rmesa->cmdbuf.size
+ || radeon_cs_need_flush(rmesa->cmdbuf.cs)) {
+ /* If we try to flush empty buffer there is too big rendering operation. */
+ assert(rmesa->cmdbuf.cs->cdw);
+ rcommonFlushCmdBuf(rmesa, caller);
+ return GL_TRUE;
+ }
+ return GL_FALSE;
+}
+
+void rcommonInitCmdBuf(radeonContextPtr rmesa)
+{
+ GLuint size;
+ struct drm_radeon_gem_info mminfo = { 0 };
+
+ /* Initialize command buffer */
+ size = 256 * driQueryOptioni(&rmesa->optionCache,
+ "command_buffer_size");
+ if (size < 2 * rmesa->hw.max_state_size) {
+ size = 2 * rmesa->hw.max_state_size + 65535;
+ }
+ if (size > 64 * 256)
+ size = 64 * 256;
+
+ radeon_print(RADEON_CS, RADEON_VERBOSE,
+ "sizeof(drm_r300_cmd_header_t)=%zd\n", sizeof(drm_r300_cmd_header_t));
+ radeon_print(RADEON_CS, RADEON_VERBOSE,
+ "sizeof(drm_radeon_cmd_buffer_t)=%zd\n", sizeof(drm_radeon_cmd_buffer_t));
+ radeon_print(RADEON_CS, RADEON_VERBOSE,
+ "Allocating %d bytes command buffer (max state is %d bytes)\n",
+ size * 4, rmesa->hw.max_state_size * 4);
+
+ rmesa->cmdbuf.csm =
+ radeon_cs_manager_gem_ctor(rmesa->radeonScreen->driScreen->fd);
+ if (rmesa->cmdbuf.csm == NULL) {
+ /* FIXME: fatal error */
+ return;
+ }
+ rmesa->cmdbuf.cs = radeon_cs_create(rmesa->cmdbuf.csm, size);
+ assert(rmesa->cmdbuf.cs != NULL);
+ rmesa->cmdbuf.size = size;
+
+ radeon_cs_space_set_flush(rmesa->cmdbuf.cs,
+ (void (*)(void *))rmesa->glCtx->Driver.Flush, rmesa->glCtx);
+
+
+ if (!drmCommandWriteRead(rmesa->dri.fd, DRM_RADEON_GEM_INFO,
+ &mminfo, sizeof(mminfo))) {
+ radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_VRAM,
+ mminfo.vram_visible);
+ radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_GTT,
+ mminfo.gart_size);
+ }
+}
+
+/**
+ * Destroy the command buffer
+ */
+void rcommonDestroyCmdBuf(radeonContextPtr rmesa)
+{
+ radeon_cs_destroy(rmesa->cmdbuf.cs);
+ radeon_cs_manager_gem_dtor(rmesa->cmdbuf.csm);
+}
+
+void rcommonBeginBatch(radeonContextPtr rmesa, int n,
+ int dostate,
+ const char *file,
+ const char *function,
+ int line)
+{
+ radeon_cs_begin(rmesa->cmdbuf.cs, n, file, function, line);
+
+ radeon_print(RADEON_CS, RADEON_VERBOSE, "BEGIN_BATCH(%d) at %d, from %s:%i\n",
+ n, rmesa->cmdbuf.cs->cdw, function, line);
+
+}
+
+void radeonUserClear(struct gl_context *ctx, GLuint mask)
+{
+ _mesa_meta_Clear(ctx, mask);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.h
index 5bcb696a9f7..636822faed2 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common.h
@@ -1 +1,88 @@
-../radeon/radeon_common.h \ No newline at end of file
+#ifndef COMMON_MISC_H
+#define COMMON_MISC_H
+
+#include "radeon_common_context.h"
+#include "radeon_dma.h"
+#include "radeon_texture.h"
+
+void radeonUserClear(struct gl_context *ctx, GLuint mask);
+void radeonSetCliprects(radeonContextPtr radeon);
+void radeonUpdateScissor( struct gl_context *ctx );
+void radeonScissor(struct gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h);
+
+extern uint32_t radeonGetAge(radeonContextPtr radeon);
+
+void radeonFlush(struct gl_context *ctx);
+void radeonFinish(struct gl_context * ctx);
+void radeonEmitState(radeonContextPtr radeon);
+GLuint radeonCountStateEmitSize(radeonContextPtr radeon);
+
+void radeon_clear_tris(struct gl_context *ctx, GLbitfield mask);
+
+void radeon_window_moved(radeonContextPtr radeon);
+void radeon_draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb);
+void radeonDrawBuffer( struct gl_context *ctx, GLenum mode );
+void radeonReadBuffer( struct gl_context *ctx, GLenum mode );
+void radeon_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height);
+void radeon_fbo_init(struct radeon_context *radeon);
+void
+radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
+ struct radeon_bo *bo);
+struct radeon_renderbuffer *
+radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv);
+
+void
+radeonReadPixels(struct gl_context * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack, GLvoid * pixels);
+
+void radeon_check_front_buffer_rendering(struct gl_context *ctx);
+static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbuffer *rb)
+{
+ struct radeon_renderbuffer *rrb = (struct radeon_renderbuffer *)rb;
+ radeon_print(RADEON_MEMORY, RADEON_TRACE,
+ "%s(rb %p)\n",
+ __func__, (void *) rb);
+ if (rrb && rrb->base.Base.ClassID == RADEON_RB_CLASS)
+ return rrb;
+ else
+ return NULL;
+}
+
+static inline struct radeon_renderbuffer *radeon_get_renderbuffer(struct gl_framebuffer *fb, int att_index)
+{
+ radeon_print(RADEON_MEMORY, RADEON_TRACE,
+ "%s(fb %p, index %d)\n",
+ __func__, (void *) fb, att_index);
+
+ if (att_index >= 0)
+ return radeon_renderbuffer(fb->Attachment[att_index].Renderbuffer);
+ else
+ return NULL;
+}
+
+static inline struct radeon_renderbuffer *radeon_get_depthbuffer(radeonContextPtr rmesa)
+{
+ struct radeon_renderbuffer *rrb;
+ rrb = radeon_renderbuffer(rmesa->state.depth.rb);
+ if (!rrb)
+ return NULL;
+
+ return rrb;
+}
+
+static inline struct radeon_renderbuffer *radeon_get_colorbuffer(radeonContextPtr rmesa)
+{
+ struct radeon_renderbuffer *rrb;
+
+ rrb = radeon_renderbuffer(rmesa->state.color.rb);
+ if (!rrb)
+ return NULL;
+ return rrb;
+}
+
+#include "radeon_cmdbuf.h"
+
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.c
index 86800f3819c..8ea8925d8a2 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.c
@@ -1 +1,633 @@
-../radeon/radeon_common_context.c \ No newline at end of file
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ VA Linux Systems Inc., Fremont, California.
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include "radeon_common.h"
+#include "xmlpool.h" /* for symbolic values of enum-type options */
+#include "utils.h"
+#include "drivers/common/meta.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/fbobject.h"
+#include "main/renderbuffer.h"
+#include "main/state.h"
+#include "main/simple_list.h"
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+#include "tnl/tnl.h"
+
+#ifndef RADEON_DEBUG
+int RADEON_DEBUG = (0);
+#endif
+
+
+static const char* get_chip_family_name(int chip_family)
+{
+ switch(chip_family) {
+#if defined(RADEON_R100)
+ case CHIP_FAMILY_R100: return "R100";
+ case CHIP_FAMILY_RV100: return "RV100";
+ case CHIP_FAMILY_RS100: return "RS100";
+ case CHIP_FAMILY_RV200: return "RV200";
+ case CHIP_FAMILY_RS200: return "RS200";
+#elif defined(RADEON_R200)
+ case CHIP_FAMILY_R200: return "R200";
+ case CHIP_FAMILY_RV250: return "RV250";
+ case CHIP_FAMILY_RS300: return "RS300";
+ case CHIP_FAMILY_RV280: return "RV280";
+#endif
+ default: return "unknown";
+ }
+}
+
+
+/* Return various strings for glGetString().
+ */
+static const GLubyte *radeonGetString(struct gl_context * ctx, GLenum name)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ static char buffer[128];
+
+ switch (name) {
+ case GL_VENDOR:
+ return (GLubyte *) "Tungsten Graphics, Inc.";
+
+ case GL_RENDERER:
+ {
+ unsigned offset;
+ GLuint agp_mode = (radeon->radeonScreen->card_type==RADEON_CARD_PCI) ? 0 :
+ radeon->radeonScreen->AGPMode;
+ char hardwarename[32];
+
+ sprintf(hardwarename, "%s (%s %04X)",
+#if defined(RADEON_R100)
+ "R100",
+#elif defined(RADEON_R200)
+ "R200",
+#endif
+ get_chip_family_name(radeon->radeonScreen->chip_family),
+ radeon->radeonScreen->device_id);
+
+ offset = driGetRendererString(buffer, hardwarename, agp_mode);
+
+ sprintf(&buffer[offset], " %sTCL",
+ !(radeon->TclFallback & RADEON_TCL_FALLBACK_TCL_DISABLE)
+ ? "" : "NO-");
+
+ strcat(buffer, " DRI2");
+
+ return (GLubyte *) buffer;
+ }
+
+ default:
+ return NULL;
+ }
+}
+
+/* Initialize the driver's misc functions.
+ */
+static void radeonInitDriverFuncs(struct dd_function_table *functions)
+{
+ functions->GetString = radeonGetString;
+}
+
+/**
+ * Create and initialize all common fields of the context,
+ * including the Mesa context itself.
+ */
+GLboolean radeonInitContext(radeonContextPtr radeon,
+ struct dd_function_table* functions,
+ const struct gl_config * glVisual,
+ __DRIcontext * driContextPriv,
+ void *sharedContextPrivate)
+{
+ __DRIscreen *sPriv = driContextPriv->driScreenPriv;
+ radeonScreenPtr screen = (radeonScreenPtr) (sPriv->driverPrivate);
+ struct gl_context* ctx;
+ struct gl_context* shareCtx;
+ int fthrottle_mode;
+
+ /* Fill in additional standard functions. */
+ radeonInitDriverFuncs(functions);
+
+ radeon->radeonScreen = screen;
+ /* Allocate and initialize the Mesa context */
+ if (sharedContextPrivate)
+ shareCtx = ((radeonContextPtr)sharedContextPrivate)->glCtx;
+ else
+ shareCtx = NULL;
+ radeon->glCtx = _mesa_create_context(API_OPENGL, glVisual, shareCtx,
+ functions, (void *)radeon);
+ if (!radeon->glCtx)
+ return GL_FALSE;
+
+ ctx = radeon->glCtx;
+ driContextPriv->driverPrivate = radeon;
+
+ _mesa_meta_init(ctx);
+
+ /* DRI fields */
+ radeon->dri.context = driContextPriv;
+ radeon->dri.screen = sPriv;
+ radeon->dri.fd = sPriv->fd;
+ radeon->dri.drmMinor = sPriv->drm_version.minor;
+
+ /* Setup IRQs */
+ fthrottle_mode = driQueryOptioni(&radeon->optionCache, "fthrottle_mode");
+ radeon->iw.irq_seq = -1;
+ radeon->irqsEmitted = 0;
+ radeon->do_irqs = (fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS &&
+ radeon->radeonScreen->irq);
+
+ radeon->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS);
+
+ if (!radeon->do_irqs)
+ fprintf(stderr,
+ "IRQ's not enabled, falling back to %s: %d %d\n",
+ radeon->do_usleeps ? "usleeps" : "busy waits",
+ fthrottle_mode, radeon->radeonScreen->irq);
+
+ radeon->texture_depth = driQueryOptioni (&radeon->optionCache,
+ "texture_depth");
+ if (radeon->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
+ radeon->texture_depth = ( glVisual->rgbBits > 16 ) ?
+ DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
+
+ radeon->texture_row_align = 32;
+ radeon->texture_rect_row_align = 64;
+ radeon->texture_compressed_row_align = 32;
+
+ radeon_init_dma(radeon);
+
+ return GL_TRUE;
+}
+
+
+
+/**
+ * Destroy the command buffer and state atoms.
+ */
+static void radeon_destroy_atom_list(radeonContextPtr radeon)
+{
+ struct radeon_state_atom *atom;
+
+ foreach(atom, &radeon->hw.atomlist) {
+ FREE(atom->cmd);
+ if (atom->lastcmd)
+ FREE(atom->lastcmd);
+ }
+
+}
+
+/**
+ * Cleanup common context fields.
+ * Called by r200DestroyContext
+ */
+void radeonDestroyContext(__DRIcontext *driContextPriv )
+{
+#ifdef RADEON_BO_TRACK
+ FILE *track;
+#endif
+ GET_CURRENT_CONTEXT(ctx);
+ radeonContextPtr radeon = (radeonContextPtr) driContextPriv->driverPrivate;
+ radeonContextPtr current = ctx ? RADEON_CONTEXT(ctx) : NULL;
+
+ assert(radeon);
+
+ _mesa_meta_free(radeon->glCtx);
+
+ if (radeon == current) {
+ _mesa_make_current(NULL, NULL, NULL);
+ }
+
+ radeon_firevertices(radeon);
+ if (!is_empty_list(&radeon->dma.reserved)) {
+ rcommonFlushCmdBuf( radeon, __FUNCTION__ );
+ }
+
+ radeonFreeDmaRegions(radeon);
+ radeonReleaseArrays(radeon->glCtx, ~0);
+ if (radeon->vtbl.free_context)
+ radeon->vtbl.free_context(radeon->glCtx);
+ _swsetup_DestroyContext( radeon->glCtx );
+ _tnl_DestroyContext( radeon->glCtx );
+ _vbo_DestroyContext( radeon->glCtx );
+ _swrast_DestroyContext( radeon->glCtx );
+
+ /* free atom list */
+ /* free the Mesa context */
+ _mesa_destroy_context(radeon->glCtx);
+
+ /* _mesa_destroy_context() might result in calls to functions that
+ * depend on the DriverCtx, so don't set it to NULL before.
+ *
+ * radeon->glCtx->DriverCtx = NULL;
+ */
+ /* free the option cache */
+ driDestroyOptionCache(&radeon->optionCache);
+
+ rcommonDestroyCmdBuf(radeon);
+
+ radeon_destroy_atom_list(radeon);
+
+#ifdef RADEON_BO_TRACK
+ track = fopen("/tmp/tracklog", "w");
+ if (track) {
+ radeon_tracker_print(&radeon->radeonScreen->bom->tracker, track);
+ fclose(track);
+ }
+#endif
+ FREE(radeon);
+}
+
+/* Force the context `c' to be unbound from its buffer.
+ */
+GLboolean radeonUnbindContext(__DRIcontext * driContextPriv)
+{
+ radeonContextPtr radeon = (radeonContextPtr) driContextPriv->driverPrivate;
+
+ if (RADEON_DEBUG & RADEON_DRI)
+ fprintf(stderr, "%s ctx %p\n", __FUNCTION__,
+ radeon->glCtx);
+
+ /* Unset current context and dispath table */
+ _mesa_make_current(NULL, NULL, NULL);
+
+ return GL_TRUE;
+}
+
+
+static unsigned
+radeon_bits_per_pixel(const struct radeon_renderbuffer *rb)
+{
+ return _mesa_get_format_bytes(rb->base.Base.Format) * 8;
+}
+
+/*
+ * Check if drawable has been invalidated by dri2InvalidateDrawable().
+ * Update renderbuffers if so. This prevents a client from accessing
+ * a backbuffer that has a swap pending but not yet completed.
+ *
+ * See intel_prepare_render for equivalent code in intel driver.
+ *
+ */
+void radeon_prepare_render(radeonContextPtr radeon)
+{
+ __DRIcontext *driContext = radeon->dri.context;
+ __DRIdrawable *drawable;
+ __DRIscreen *screen;
+
+ screen = driContext->driScreenPriv;
+ if (!screen->dri2.loader)
+ return;
+
+ drawable = driContext->driDrawablePriv;
+ if (drawable->dri2.stamp != driContext->dri2.draw_stamp) {
+ if (drawable->lastStamp != drawable->dri2.stamp)
+ radeon_update_renderbuffers(driContext, drawable, GL_FALSE);
+
+ /* Intel driver does the equivalent of this, no clue if it is needed:*/
+ radeon_draw_buffer(radeon->glCtx, radeon->glCtx->DrawBuffer);
+
+ driContext->dri2.draw_stamp = drawable->dri2.stamp;
+ }
+
+ drawable = driContext->driReadablePriv;
+ if (drawable->dri2.stamp != driContext->dri2.read_stamp) {
+ if (drawable->lastStamp != drawable->dri2.stamp)
+ radeon_update_renderbuffers(driContext, drawable, GL_FALSE);
+ driContext->dri2.read_stamp = drawable->dri2.stamp;
+ }
+
+ /* If we're currently rendering to the front buffer, the rendering
+ * that will happen next will probably dirty the front buffer. So
+ * mark it as dirty here.
+ */
+ if (radeon->is_front_buffer_rendering)
+ radeon->front_buffer_dirty = GL_TRUE;
+}
+
+void
+radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable,
+ GLboolean front_only)
+{
+ unsigned int attachments[10];
+ __DRIbuffer *buffers = NULL;
+ __DRIscreen *screen;
+ struct radeon_renderbuffer *rb;
+ int i, count;
+ struct radeon_framebuffer *draw;
+ radeonContextPtr radeon;
+ char *regname;
+ struct radeon_bo *depth_bo = NULL, *bo;
+
+ if (RADEON_DEBUG & RADEON_DRI)
+ fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable);
+
+ draw = drawable->driverPrivate;
+ screen = context->driScreenPriv;
+ radeon = (radeonContextPtr) context->driverPrivate;
+
+ /* Set this up front, so that in case our buffers get invalidated
+ * while we're getting new buffers, we don't clobber the stamp and
+ * thus ignore the invalidate. */
+ drawable->lastStamp = drawable->dri2.stamp;
+
+ if (screen->dri2.loader
+ && (screen->dri2.loader->base.version > 2)
+ && (screen->dri2.loader->getBuffersWithFormat != NULL)) {
+ struct radeon_renderbuffer *depth_rb;
+ struct radeon_renderbuffer *stencil_rb;
+
+ i = 0;
+ if ((front_only || radeon->is_front_buffer_rendering ||
+ radeon->is_front_buffer_reading ||
+ !draw->color_rb[1])
+ && draw->color_rb[0]) {
+ attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
+ attachments[i++] = radeon_bits_per_pixel(draw->color_rb[0]);
+ }
+
+ if (!front_only) {
+ if (draw->color_rb[1]) {
+ attachments[i++] = __DRI_BUFFER_BACK_LEFT;
+ attachments[i++] = radeon_bits_per_pixel(draw->color_rb[1]);
+ }
+
+ depth_rb = radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH);
+ stencil_rb = radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL);
+
+ if ((depth_rb != NULL) && (stencil_rb != NULL)) {
+ attachments[i++] = __DRI_BUFFER_DEPTH_STENCIL;
+ attachments[i++] = radeon_bits_per_pixel(depth_rb);
+ } else if (depth_rb != NULL) {
+ attachments[i++] = __DRI_BUFFER_DEPTH;
+ attachments[i++] = radeon_bits_per_pixel(depth_rb);
+ } else if (stencil_rb != NULL) {
+ attachments[i++] = __DRI_BUFFER_STENCIL;
+ attachments[i++] = radeon_bits_per_pixel(stencil_rb);
+ }
+ }
+
+ buffers = (*screen->dri2.loader->getBuffersWithFormat)(drawable,
+ &drawable->w,
+ &drawable->h,
+ attachments, i / 2,
+ &count,
+ drawable->loaderPrivate);
+ } else if (screen->dri2.loader) {
+ i = 0;
+ if (draw->color_rb[0])
+ attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
+ if (!front_only) {
+ if (draw->color_rb[1])
+ attachments[i++] = __DRI_BUFFER_BACK_LEFT;
+ if (radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH))
+ attachments[i++] = __DRI_BUFFER_DEPTH;
+ if (radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL))
+ attachments[i++] = __DRI_BUFFER_STENCIL;
+ }
+
+ buffers = (*screen->dri2.loader->getBuffers)(drawable,
+ &drawable->w,
+ &drawable->h,
+ attachments, i,
+ &count,
+ drawable->loaderPrivate);
+ }
+
+ if (buffers == NULL)
+ return;
+
+ for (i = 0; i < count; i++) {
+ switch (buffers[i].attachment) {
+ case __DRI_BUFFER_FRONT_LEFT:
+ rb = draw->color_rb[0];
+ regname = "dri2 front buffer";
+ break;
+ case __DRI_BUFFER_FAKE_FRONT_LEFT:
+ rb = draw->color_rb[0];
+ regname = "dri2 fake front buffer";
+ break;
+ case __DRI_BUFFER_BACK_LEFT:
+ rb = draw->color_rb[1];
+ regname = "dri2 back buffer";
+ break;
+ case __DRI_BUFFER_DEPTH:
+ rb = radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH);
+ regname = "dri2 depth buffer";
+ break;
+ case __DRI_BUFFER_DEPTH_STENCIL:
+ rb = radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH);
+ regname = "dri2 depth / stencil buffer";
+ break;
+ case __DRI_BUFFER_STENCIL:
+ rb = radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL);
+ regname = "dri2 stencil buffer";
+ break;
+ case __DRI_BUFFER_ACCUM:
+ default:
+ fprintf(stderr,
+ "unhandled buffer attach event, attacment type %d\n",
+ buffers[i].attachment);
+ return;
+ }
+
+ if (rb == NULL)
+ continue;
+
+ if (rb->bo) {
+ uint32_t name = radeon_gem_name_bo(rb->bo);
+ if (name == buffers[i].name)
+ continue;
+ }
+
+ if (RADEON_DEBUG & RADEON_DRI)
+ fprintf(stderr,
+ "attaching buffer %s, %d, at %d, cpp %d, pitch %d\n",
+ regname, buffers[i].name, buffers[i].attachment,
+ buffers[i].cpp, buffers[i].pitch);
+
+ rb->cpp = buffers[i].cpp;
+ rb->pitch = buffers[i].pitch;
+ rb->base.Base.Width = drawable->w;
+ rb->base.Base.Height = drawable->h;
+ rb->has_surface = 0;
+
+ if (buffers[i].attachment == __DRI_BUFFER_STENCIL && depth_bo) {
+ if (RADEON_DEBUG & RADEON_DRI)
+ fprintf(stderr, "(reusing depth buffer as stencil)\n");
+ bo = depth_bo;
+ radeon_bo_ref(bo);
+ } else {
+ uint32_t tiling_flags = 0, pitch = 0;
+ int ret;
+
+ bo = radeon_bo_open(radeon->radeonScreen->bom,
+ buffers[i].name,
+ 0,
+ 0,
+ RADEON_GEM_DOMAIN_VRAM,
+ buffers[i].flags);
+
+ if (bo == NULL) {
+ fprintf(stderr, "failed to attach %s %d\n",
+ regname, buffers[i].name);
+ continue;
+ }
+
+ ret = radeon_bo_get_tiling(bo, &tiling_flags, &pitch);
+ if (ret) {
+ fprintf(stderr,
+ "failed to get tiling for %s %d\n",
+ regname, buffers[i].name);
+ radeon_bo_unref(bo);
+ bo = NULL;
+ continue;
+ } else {
+ if (tiling_flags & RADEON_TILING_MACRO)
+ bo->flags |= RADEON_BO_FLAGS_MACRO_TILE;
+ if (tiling_flags & RADEON_TILING_MICRO)
+ bo->flags |= RADEON_BO_FLAGS_MICRO_TILE;
+ }
+ }
+
+ if (buffers[i].attachment == __DRI_BUFFER_DEPTH) {
+ if (draw->base.Visual.depthBits == 16)
+ rb->cpp = 2;
+ depth_bo = bo;
+ }
+
+ radeon_renderbuffer_set_bo(rb, bo);
+ radeon_bo_unref(bo);
+
+ if (buffers[i].attachment == __DRI_BUFFER_DEPTH_STENCIL) {
+ rb = radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL);
+ if (rb != NULL) {
+ struct radeon_bo *stencil_bo = NULL;
+
+ if (rb->bo) {
+ uint32_t name = radeon_gem_name_bo(rb->bo);
+ if (name == buffers[i].name)
+ continue;
+ }
+
+ stencil_bo = bo;
+ radeon_bo_ref(stencil_bo);
+ radeon_renderbuffer_set_bo(rb, stencil_bo);
+ radeon_bo_unref(stencil_bo);
+ }
+ }
+ }
+
+ driUpdateFramebufferSize(radeon->glCtx, drawable);
+}
+
+/* Force the context `c' to be the current context and associate with it
+ * buffer `b'.
+ */
+GLboolean radeonMakeCurrent(__DRIcontext * driContextPriv,
+ __DRIdrawable * driDrawPriv,
+ __DRIdrawable * driReadPriv)
+{
+ radeonContextPtr radeon;
+ GET_CURRENT_CONTEXT(curCtx);
+ struct gl_framebuffer *drfb, *readfb;
+
+ if (driContextPriv)
+ radeon = (radeonContextPtr)driContextPriv->driverPrivate;
+ else
+ radeon = NULL;
+ /* According to the glXMakeCurrent() man page: "Pending commands to
+ * the previous context, if any, are flushed before it is released."
+ * But only flush if we're actually changing contexts.
+ */
+
+ if ((radeonContextPtr)curCtx && (radeonContextPtr)curCtx != radeon) {
+ _mesa_flush(curCtx);
+ }
+
+ if (!driContextPriv) {
+ if (RADEON_DEBUG & RADEON_DRI)
+ fprintf(stderr, "%s ctx is null\n", __FUNCTION__);
+ _mesa_make_current(NULL, NULL, NULL);
+ return GL_TRUE;
+ }
+
+ if(driDrawPriv == NULL && driReadPriv == NULL) {
+ drfb = _mesa_create_framebuffer(&radeon->glCtx->Visual);
+ readfb = drfb;
+ }
+ else {
+ drfb = driDrawPriv->driverPrivate;
+ readfb = driReadPriv->driverPrivate;
+ }
+
+ if(driDrawPriv)
+ radeon_update_renderbuffers(driContextPriv, driDrawPriv, GL_FALSE);
+ if (driDrawPriv != driReadPriv)
+ radeon_update_renderbuffers(driContextPriv, driReadPriv, GL_FALSE);
+ _mesa_reference_renderbuffer(&radeon->state.color.rb,
+ &(radeon_get_renderbuffer(drfb, BUFFER_BACK_LEFT)->base.Base));
+ _mesa_reference_renderbuffer(&radeon->state.depth.rb,
+ &(radeon_get_renderbuffer(drfb, BUFFER_DEPTH)->base.Base));
+
+ if (RADEON_DEBUG & RADEON_DRI)
+ fprintf(stderr, "%s ctx %p dfb %p rfb %p\n", __FUNCTION__, radeon->glCtx, drfb, readfb);
+
+ if(driDrawPriv)
+ driUpdateFramebufferSize(radeon->glCtx, driDrawPriv);
+ if (driReadPriv != driDrawPriv)
+ driUpdateFramebufferSize(radeon->glCtx, driReadPriv);
+
+ _mesa_make_current(radeon->glCtx, drfb, readfb);
+ if (driDrawPriv == NULL && driReadPriv == NULL)
+ _mesa_reference_framebuffer(&drfb, NULL);
+
+ _mesa_update_state(radeon->glCtx);
+
+ if (radeon->glCtx->DrawBuffer == drfb) {
+ if(driDrawPriv != NULL) {
+ radeon_window_moved(radeon);
+ }
+
+ radeon_draw_buffer(radeon->glCtx, drfb);
+ }
+
+
+ if (RADEON_DEBUG & RADEON_DRI)
+ fprintf(stderr, "End %s\n", __FUNCTION__);
+
+ return GL_TRUE;
+}
+
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.h
index 4d663125500..5c2389208f1 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_common_context.h
@@ -1 +1,530 @@
-../radeon/radeon_common_context.h \ No newline at end of file
+
+#ifndef COMMON_CONTEXT_H
+#define COMMON_CONTEXT_H
+
+#include "main/mm.h"
+#include "math/m_vector.h"
+#include "tnl/t_context.h"
+#include "main/colormac.h"
+
+#include "radeon_debug.h"
+#include "radeon_screen.h"
+#include "radeon_drm.h"
+#include "dri_util.h"
+#include "tnl/t_vertex.h"
+#include "swrast/s_context.h"
+
+struct radeon_context;
+
+#include "radeon_bo_gem.h"
+#include "radeon_cs_gem.h"
+
+/* This union is used to avoid warnings/miscompilation
+ with float to uint32_t casts due to strict-aliasing */
+typedef union { GLfloat f; uint32_t ui32; } float_ui32_type;
+
+struct radeon_context;
+typedef struct radeon_context radeonContextRec;
+typedef struct radeon_context *radeonContextPtr;
+
+
+#define TEX_0 0x1
+#define TEX_1 0x2
+#define TEX_2 0x4
+#define TEX_3 0x8
+#define TEX_4 0x10
+#define TEX_5 0x20
+
+/* Rasterizing fallbacks */
+/* See correponding strings in r200_swtcl.c */
+#define RADEON_FALLBACK_TEXTURE 0x0001
+#define RADEON_FALLBACK_DRAW_BUFFER 0x0002
+#define RADEON_FALLBACK_STENCIL 0x0004
+#define RADEON_FALLBACK_RENDER_MODE 0x0008
+#define RADEON_FALLBACK_BLEND_EQ 0x0010
+#define RADEON_FALLBACK_BLEND_FUNC 0x0020
+#define RADEON_FALLBACK_DISABLE 0x0040
+#define RADEON_FALLBACK_BORDER_MODE 0x0080
+#define RADEON_FALLBACK_DEPTH_BUFFER 0x0100
+#define RADEON_FALLBACK_STENCIL_BUFFER 0x0200
+
+#define R200_FALLBACK_TEXTURE 0x01
+#define R200_FALLBACK_DRAW_BUFFER 0x02
+#define R200_FALLBACK_STENCIL 0x04
+#define R200_FALLBACK_RENDER_MODE 0x08
+#define R200_FALLBACK_DISABLE 0x10
+#define R200_FALLBACK_BORDER_MODE 0x20
+
+#define RADEON_TCL_FALLBACK_RASTER 0x1 /* rasterization */
+#define RADEON_TCL_FALLBACK_UNFILLED 0x2 /* unfilled tris */
+#define RADEON_TCL_FALLBACK_LIGHT_TWOSIDE 0x4 /* twoside tris */
+#define RADEON_TCL_FALLBACK_MATERIAL 0x8 /* material in vb */
+#define RADEON_TCL_FALLBACK_TEXGEN_0 0x10 /* texgen, unit 0 */
+#define RADEON_TCL_FALLBACK_TEXGEN_1 0x20 /* texgen, unit 1 */
+#define RADEON_TCL_FALLBACK_TEXGEN_2 0x40 /* texgen, unit 2 */
+#define RADEON_TCL_FALLBACK_TCL_DISABLE 0x80 /* user disable */
+#define RADEON_TCL_FALLBACK_FOGCOORDSPEC 0x100 /* fogcoord, sep. spec light */
+
+/* The blit width for texture uploads
+ */
+#define BLIT_WIDTH_BYTES 1024
+
+/* Use the templated vertex format:
+ */
+#define COLOR_IS_RGBA
+#define TAG(x) radeon##x
+#include "tnl_dd/t_dd_vertex.h"
+#undef TAG
+
+#define RADEON_RB_CLASS 0xdeadbeef
+
+struct radeon_renderbuffer
+{
+ struct swrast_renderbuffer base;
+
+ struct radeon_bo *bo;
+ unsigned int cpp;
+ /* unsigned int offset; */
+ unsigned int pitch;
+
+ struct radeon_bo *map_bo;
+ GLbitfield map_mode;
+ int map_x, map_y, map_w, map_h;
+ int map_pitch;
+ void *map_buffer;
+
+ uint32_t draw_offset; /* FBO */
+ /* boo Xorg 6.8.2 compat */
+ int has_surface;
+
+ GLuint pf_pending; /**< sequence number of pending flip */
+ __DRIdrawable *dPriv;
+};
+
+struct radeon_framebuffer
+{
+ struct gl_framebuffer base;
+
+ struct radeon_renderbuffer *color_rb[2];
+};
+
+
+struct radeon_colorbuffer_state {
+ int roundEnable;
+ struct gl_renderbuffer *rb;
+ uint32_t draw_offset; /* offset into color renderbuffer - FBOs */
+};
+
+struct radeon_depthbuffer_state {
+ struct gl_renderbuffer *rb;
+};
+
+struct radeon_scissor_state {
+ drm_clip_rect_t rect;
+ GLboolean enabled;
+};
+
+struct radeon_state_atom {
+ struct radeon_state_atom *next, *prev;
+ const char *name; /* for debug */
+ int cmd_size; /* size in bytes */
+ GLuint idx;
+ GLuint is_tcl;
+ GLuint *cmd; /* one or more cmd's */
+ GLuint *lastcmd; /* one or more cmd's */
+ GLboolean dirty; /* dirty-mark in emit_state_list */
+ int (*check) (struct gl_context *, struct radeon_state_atom *atom); /* is this state active? */
+ void (*emit) (struct gl_context *, struct radeon_state_atom *atom);
+};
+
+struct radeon_hw_state {
+ /* Head of the linked list of state atoms. */
+ struct radeon_state_atom atomlist;
+ int max_state_size; /* Number of bytes necessary for a full state emit. */
+ int max_post_flush_size; /* Number of bytes necessary for post flushing emits */
+ GLboolean is_dirty, all_dirty;
+};
+
+
+/* Texture related */
+typedef struct _radeon_texture_image radeon_texture_image;
+
+
+/**
+ * This is a subclass of swrast_texture_image since we use swrast
+ * for software fallback rendering.
+ */
+struct _radeon_texture_image {
+ struct swrast_texture_image base;
+
+ /**
+ * If mt != 0, the image is stored in hardware format in the
+ * given mipmap tree. In this case, base.Data may point into the
+ * mapping of the buffer object that contains the mipmap tree.
+ *
+ * If mt == 0, the image is stored in normal memory pointed to
+ * by base.Data.
+ */
+ struct _radeon_mipmap_tree *mt;
+ struct radeon_bo *bo;
+ GLboolean used_as_render_target;
+};
+
+
+static INLINE radeon_texture_image *get_radeon_texture_image(struct gl_texture_image *image)
+{
+ return (radeon_texture_image*)image;
+}
+
+
+typedef struct radeon_tex_obj radeonTexObj, *radeonTexObjPtr;
+
+#define RADEON_TXO_MICRO_TILE (1 << 3)
+
+/* Texture object in locally shared texture space.
+ */
+struct radeon_tex_obj {
+ struct gl_texture_object base;
+ struct _radeon_mipmap_tree *mt;
+
+ /**
+ * This is true if we've verified that the mipmap tree above is complete
+ * and so on.
+ */
+ GLboolean validated;
+ /* Minimum LOD to be used during rendering */
+ unsigned minLod;
+ /* Miximum LOD to be used during rendering */
+ unsigned maxLod;
+
+ GLuint override_offset;
+ GLboolean image_override; /* Image overridden by GLX_EXT_tfp */
+ GLuint tile_bits; /* hw texture tile bits used on this texture */
+ struct radeon_bo *bo;
+
+ GLuint pp_txfilter; /* hardware register values */
+ GLuint pp_txformat;
+ GLuint pp_txformat_x;
+ GLuint pp_txsize; /* npot only */
+ GLuint pp_txpitch; /* npot only */
+ GLuint pp_border_color;
+ GLuint pp_cubic_faces; /* cube face 1,2,3,4 log2 sizes */
+
+ GLboolean border_fallback;
+};
+
+static INLINE radeonTexObj* radeon_tex_obj(struct gl_texture_object *texObj)
+{
+ return (radeonTexObj*)texObj;
+}
+
+/* occlusion query */
+struct radeon_query_object {
+ struct gl_query_object Base;
+ struct radeon_bo *bo;
+ int curr_offset;
+ GLboolean emitted_begin;
+
+ /* Double linked list of not flushed query objects */
+ struct radeon_query_object *prev, *next;
+};
+
+/* Need refcounting on dma buffers:
+ */
+struct radeon_dma_buffer {
+ int refcount; /* the number of retained regions in buf */
+ drmBufPtr buf;
+};
+
+struct radeon_aos {
+ struct radeon_bo *bo; /** Buffer object where vertex data is stored */
+ int offset; /** Offset into buffer object, in bytes */
+ int components; /** Number of components per vertex */
+ int stride; /** Stride in dwords (may be 0 for repeating) */
+ int count; /** Number of vertices */
+};
+
+#define DMA_BO_FREE_TIME 100
+
+struct radeon_dma_bo {
+ struct radeon_dma_bo *next, *prev;
+ struct radeon_bo *bo;
+ int expire_counter;
+};
+
+struct radeon_dma {
+ /* Active dma region. Allocations for vertices and retained
+ * regions come from here. Also used for emitting random vertices,
+ * these may be flushed by calling flush_current();
+ */
+ struct radeon_dma_bo free;
+ struct radeon_dma_bo wait;
+ struct radeon_dma_bo reserved;
+ size_t current_used; /** Number of bytes allocated and forgotten about */
+ size_t current_vertexptr; /** End of active vertex region */
+ size_t minimum_size;
+
+ /**
+ * If current_vertexptr != current_used then flush must be non-zero.
+ * flush must be called before non-active vertex allocations can be
+ * performed.
+ */
+ void (*flush) (struct gl_context *);
+};
+
+/* radeon_swtcl.c
+ */
+struct radeon_swtcl_info {
+
+ GLuint RenderIndex;
+ GLuint vertex_size;
+ GLubyte *verts;
+
+ /* Fallback rasterization functions
+ */
+ GLuint hw_primitive;
+ GLenum render_primitive;
+ GLuint numverts;
+
+ struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
+ GLuint vertex_attr_count;
+
+ GLuint emit_prediction;
+ struct radeon_bo *bo;
+};
+
+#define RADEON_MAX_AOS_ARRAYS 16
+struct radeon_tcl_info {
+ struct radeon_aos aos[RADEON_MAX_AOS_ARRAYS];
+ GLuint aos_count;
+ struct radeon_bo *elt_dma_bo; /** Buffer object that contains element indices */
+ int elt_dma_offset; /** Offset into this buffer object, in bytes */
+};
+
+struct radeon_ioctl {
+ GLuint vertex_offset;
+ GLuint vertex_max;
+ struct radeon_bo *bo;
+ GLuint vertex_size;
+};
+
+#define RADEON_MAX_PRIMS 64
+
+struct radeon_prim {
+ GLuint start;
+ GLuint end;
+ GLuint prim;
+};
+
+static INLINE GLuint radeonPackColor(GLuint cpp,
+ GLubyte r, GLubyte g,
+ GLubyte b, GLubyte a)
+{
+ switch (cpp) {
+ case 2:
+ return PACK_COLOR_565(r, g, b);
+ case 4:
+ return PACK_COLOR_8888(a, r, g, b);
+ default:
+ return 0;
+ }
+}
+
+#define MAX_CMD_BUF_SZ (16*1024)
+
+#define MAX_DMA_BUF_SZ (64*1024)
+
+struct radeon_store {
+ GLuint statenr;
+ GLuint primnr;
+ char cmd_buf[MAX_CMD_BUF_SZ];
+ int cmd_used;
+ int elts_start;
+};
+
+struct radeon_dri_mirror {
+ __DRIcontext *context; /* DRI context */
+ __DRIscreen *screen; /* DRI screen */
+
+ drm_context_t hwContext;
+ drm_hw_lock_t *hwLock;
+ int hwLockCount;
+ int fd;
+ int drmMinor;
+};
+
+typedef void (*radeon_tri_func) (radeonContextPtr,
+ radeonVertex *,
+ radeonVertex *, radeonVertex *);
+
+typedef void (*radeon_line_func) (radeonContextPtr,
+ radeonVertex *, radeonVertex *);
+
+typedef void (*radeon_point_func) (radeonContextPtr, radeonVertex *);
+
+#define RADEON_MAX_BOS 32
+struct radeon_state {
+ struct radeon_colorbuffer_state color;
+ struct radeon_depthbuffer_state depth;
+ struct radeon_scissor_state scissor;
+};
+
+/**
+ * This structure holds the command buffer while it is being constructed.
+ *
+ * The first batch of commands in the buffer is always the state that needs
+ * to be re-emitted when the context is lost. This batch can be skipped
+ * otherwise.
+ */
+struct radeon_cmdbuf {
+ struct radeon_cs_manager *csm;
+ struct radeon_cs *cs;
+ int size; /** # of dwords total */
+ unsigned int flushing:1; /** whether we're currently in FlushCmdBufLocked */
+};
+
+struct radeon_context {
+ struct gl_context *glCtx;
+ radeonScreenPtr radeonScreen; /* Screen private DRI data */
+
+ /* Texture object bookkeeping
+ */
+ int texture_depth;
+ float initialMaxAnisotropy;
+ uint32_t texture_row_align;
+ uint32_t texture_rect_row_align;
+ uint32_t texture_compressed_row_align;
+
+ struct radeon_dma dma;
+ struct radeon_hw_state hw;
+ /* Rasterization and vertex state:
+ */
+ GLuint TclFallback;
+ GLuint Fallback;
+ GLuint NewGLState;
+ GLbitfield64 tnl_index_bitset; /* index of bits for last tnl_install_attrs */
+
+ /* Drawable information */
+ unsigned int lastStamp;
+ drm_radeon_sarea_t *sarea; /* Private SAREA data */
+
+ /* Mirrors of some DRI state */
+ struct radeon_dri_mirror dri;
+
+ /* Busy waiting */
+ GLuint do_usleeps;
+ GLuint do_irqs;
+ GLuint irqsEmitted;
+ drm_radeon_irq_wait_t iw;
+
+ /* Derived state - for r300 only */
+ struct radeon_state state;
+
+ struct radeon_swtcl_info swtcl;
+ struct radeon_tcl_info tcl;
+ /* Configuration cache
+ */
+ driOptionCache optionCache;
+
+ struct radeon_cmdbuf cmdbuf;
+
+ struct radeon_debug debug;
+
+ drm_clip_rect_t fboRect;
+ GLboolean front_cliprects;
+
+ /**
+ * Set if rendering has occured to the drawable's front buffer.
+ *
+ * This is used in the DRI2 case to detect that glFlush should also copy
+ * the contents of the fake front buffer to the real front buffer.
+ */
+ GLboolean front_buffer_dirty;
+
+ /**
+ * Track whether front-buffer rendering is currently enabled
+ *
+ * A separate flag is used to track this in order to support MRT more
+ * easily.
+ */
+ GLboolean is_front_buffer_rendering;
+
+ /**
+ * Track whether front-buffer is the current read target.
+ *
+ * This is closely associated with is_front_buffer_rendering, but may
+ * be set separately. The DRI2 fake front buffer must be referenced
+ * either way.
+ */
+ GLboolean is_front_buffer_reading;
+
+ struct {
+ struct radeon_query_object *current;
+ struct radeon_state_atom queryobj;
+ } query;
+
+ struct {
+ void (*get_lock)(radeonContextPtr radeon);
+ void (*update_viewport_offset)(struct gl_context *ctx);
+ void (*emit_cs_header)(struct radeon_cs *cs, radeonContextPtr rmesa);
+ void (*swtcl_flush)(struct gl_context *ctx, uint32_t offset);
+ void (*pre_emit_atoms)(radeonContextPtr rmesa);
+ void (*pre_emit_state)(radeonContextPtr rmesa);
+ void (*fallback)(struct gl_context *ctx, GLuint bit, GLboolean mode);
+ void (*free_context)(struct gl_context *ctx);
+ void (*emit_query_finish)(radeonContextPtr radeon);
+ void (*update_scissor)(struct gl_context *ctx);
+ unsigned (*check_blit)(gl_format mesa_format, uint32_t dst_pitch);
+ unsigned (*blit)(struct gl_context *ctx,
+ struct radeon_bo *src_bo,
+ intptr_t src_offset,
+ gl_format src_mesaformat,
+ unsigned src_pitch,
+ unsigned src_width,
+ unsigned src_height,
+ unsigned src_x_offset,
+ unsigned src_y_offset,
+ struct radeon_bo *dst_bo,
+ intptr_t dst_offset,
+ gl_format dst_mesaformat,
+ unsigned dst_pitch,
+ unsigned dst_width,
+ unsigned dst_height,
+ unsigned dst_x_offset,
+ unsigned dst_y_offset,
+ unsigned reg_width,
+ unsigned reg_height,
+ unsigned flip_y);
+ unsigned (*is_format_renderable)(gl_format mesa_format);
+ } vtbl;
+};
+
+#define RADEON_CONTEXT(glctx) ((radeonContextPtr)(ctx->DriverCtx))
+
+static inline __DRIdrawable* radeon_get_drawable(radeonContextPtr radeon)
+{
+ return radeon->dri.context->driDrawablePriv;
+}
+
+static inline __DRIdrawable* radeon_get_readable(radeonContextPtr radeon)
+{
+ return radeon->dri.context->driReadablePriv;
+}
+
+GLboolean radeonInitContext(radeonContextPtr radeon,
+ struct dd_function_table* functions,
+ const struct gl_config * glVisual,
+ __DRIcontext * driContextPriv,
+ void *sharedContextPrivate);
+
+void radeonCleanupContext(radeonContextPtr radeon);
+GLboolean radeonUnbindContext(__DRIcontext * driContextPriv);
+void radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable,
+ GLboolean front_only);
+GLboolean radeonMakeCurrent(__DRIcontext * driContextPriv,
+ __DRIdrawable * driDrawPriv,
+ __DRIdrawable * driReadPriv);
+extern void radeonDestroyContext(__DRIcontext * driContextPriv);
+void radeon_prepare_render(radeonContextPtr radeon);
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.c
index c98c2e074c5..dd0afb809a0 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.c
@@ -1 +1,108 @@
-../radeon/radeon_debug.c \ No newline at end of file
+/*
+ * Copyright © 2009 Pauli Nieminen
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Pauli Nieminen <suokkos@gmail.com>
+ */
+
+#include "utils.h"
+
+#include "radeon_debug.h"
+#include "radeon_common_context.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+
+static const struct dri_debug_control debug_control[] = {
+ {"fall", RADEON_FALLBACKS},
+ {"tex", RADEON_TEXTURE},
+ {"ioctl", RADEON_IOCTL},
+ {"verts", RADEON_VERTS},
+ {"render", RADEON_RENDER},
+ {"swrender", RADEON_SWRENDER},
+ {"state", RADEON_STATE},
+ {"shader", RADEON_SHADER},
+ {"vfmt", RADEON_VFMT},
+ {"vtxf", RADEON_VFMT},
+ {"dri", RADEON_DRI},
+ {"dma", RADEON_DMA},
+ {"sanity", RADEON_SANITY},
+ {"sync", RADEON_SYNC},
+ {"pixel", RADEON_PIXEL},
+ {"mem", RADEON_MEMORY},
+ {"cs", RADEON_CS},
+ {"allmsg", ~RADEON_SYNC}, /* avoid the term "sync" because the parser uses strstr */
+ {NULL, 0}
+};
+
+radeon_debug_type_t radeon_enabled_debug_types;
+
+void radeon_init_debug(void)
+{
+ radeon_enabled_debug_types = driParseDebugString(getenv("RADEON_DEBUG"), debug_control);
+
+ radeon_enabled_debug_types |= RADEON_GENERAL;
+}
+
+void _radeon_debug_add_indent(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ const size_t length = sizeof(radeon->debug.indent)
+ / sizeof(radeon->debug.indent[0]);
+ if (radeon->debug.indent_depth < length - 1) {
+ radeon->debug.indent[radeon->debug.indent_depth] = '\t';
+ ++radeon->debug.indent_depth;
+ };
+}
+
+void _radeon_debug_remove_indent(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ if (radeon->debug.indent_depth > 0) {
+ radeon->debug.indent[radeon->debug.indent_depth] = '\0';
+ --radeon->debug.indent_depth;
+ }
+}
+
+void _radeon_print(const radeon_debug_type_t type,
+ const radeon_debug_level_t level,
+ const char* message,
+ ...)
+{
+ va_list values;
+
+ GET_CURRENT_CONTEXT(ctx);
+ if (ctx) {
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ // FIXME: Make this multi thread safe
+ if (radeon->debug.indent_depth)
+ fprintf(stderr, "%s", radeon->debug.indent);
+ }
+ va_start( values, message );
+ vfprintf(stderr, message, values);
+ va_end( values );
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.h
index bd8aa28e89e..449c27a3fe1 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_debug.h
@@ -1 +1,174 @@
-../radeon/radeon_debug.h \ No newline at end of file
+/*
+ * Copyright © 2009 Pauli Nieminen
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ */
+/*
+ * Authors:
+ * Pauli Nieminen <suokkos@gmail.com>
+ */
+
+#ifndef RADEON_DEBUG_H_INCLUDED
+#define RADEON_DEBUG_H_INCLUDED
+
+#include <stdlib.h>
+
+typedef enum radeon_debug_levels {
+ RADEON_CRITICAL = 0, /* Only errors */
+ RADEON_IMPORTANT = 1, /* Important warnings and messages */
+ RADEON_NORMAL = 2, /* Normal log messages usefull for debugging */
+ RADEON_VERBOSE = 3, /* Extra details to debugging */
+ RADEON_TRACE = 4 /* Log about everything that happens */
+} radeon_debug_level_t;
+
+/**
+ * Compile time option to change level of debugging compiled to dri driver.
+ * Selecting critical level is not recommended because perfromance gains are
+ * going to minimal but you will lose a lot of important warnings in case of
+ * errors.
+ */
+#ifndef RADEON_DEBUG_LEVEL
+# ifdef DEBUG
+# define RADEON_DEBUG_LEVEL RADEON_TRACE
+# else
+# define RADEON_DEBUG_LEVEL RADEON_VERBOSE
+# endif
+#endif
+
+typedef enum radeon_debug_types {
+ RADEON_TEXTURE = 0x00001,
+ RADEON_STATE = 0x00002,
+ RADEON_IOCTL = 0x00004,
+ RADEON_RENDER = 0x00008,
+ RADEON_SWRENDER = 0x00010,
+ RADEON_FALLBACKS = 0x00020,
+ RADEON_VFMT = 0x00040,
+ RADEON_SHADER = 0x00080,
+ RADEON_CS = 0x00100,
+ RADEON_DRI = 0x00200,
+ RADEON_DMA = 0x00400,
+ RADEON_SANITY = 0x00800,
+ RADEON_SYNC = 0x01000,
+ RADEON_PIXEL = 0x02000,
+ RADEON_MEMORY = 0x04000,
+ RADEON_VERTS = 0x08000,
+ RADEON_GENERAL = 0x10000 /* Used for errors and warnings */
+} radeon_debug_type_t;
+
+#define RADEON_MAX_INDENT 5
+
+struct radeon_debug {
+ size_t indent_depth;
+ char indent[RADEON_MAX_INDENT];
+};
+
+extern radeon_debug_type_t radeon_enabled_debug_types;
+
+/**
+ * Compabibility layer for old debug code
+ **/
+#define RADEON_DEBUG radeon_enabled_debug_types
+
+static inline int radeon_is_debug_enabled(const radeon_debug_type_t type,
+ const radeon_debug_level_t level)
+{
+ return RADEON_DEBUG_LEVEL >= level
+ && (type & radeon_enabled_debug_types);
+}
+/*
+ * define macro for gcc specific __attribute__ if using alternative compiler
+ */
+#ifndef __GNUC__
+#define __attribute__(x) /*empty*/
+#endif
+
+
+extern void _radeon_print(const radeon_debug_type_t type,
+ const radeon_debug_level_t level,
+ const char* message,
+ ...) __attribute__((format(printf,3,4)));
+/**
+ * Print out debug message if channel specified by type is enabled
+ * and compile time debugging level is at least as high as level parameter
+ */
+#define radeon_print(type, level, ...) do { \
+ const radeon_debug_level_t _debug_level = (level); \
+ const radeon_debug_type_t _debug_type = (type); \
+ /* Compile out if level of message is too high */ \
+ if (radeon_is_debug_enabled(type, level)) { \
+ _radeon_print(_debug_type, _debug_level, \
+ __VA_ARGS__); \
+ } \
+} while(0)
+
+/**
+ * printf style function for writing error messages.
+ */
+#define radeon_error(...) do { \
+ radeon_print(RADEON_GENERAL, RADEON_CRITICAL, \
+ __VA_ARGS__); \
+} while(0)
+
+/**
+ * printf style function for writing warnings.
+ */
+#define radeon_warning(...) do { \
+ radeon_print(RADEON_GENERAL, RADEON_IMPORTANT, \
+ __VA_ARGS__); \
+} while(0)
+
+extern void radeon_init_debug(void);
+extern void _radeon_debug_add_indent(void);
+extern void _radeon_debug_remove_indent(void);
+
+static inline void radeon_debug_add_indent(void)
+{
+ if (RADEON_DEBUG_LEVEL >= RADEON_VERBOSE) {
+ _radeon_debug_add_indent();
+ }
+}
+static inline void radeon_debug_remove_indent(void)
+{
+ if (RADEON_DEBUG_LEVEL >= RADEON_VERBOSE) {
+ _radeon_debug_remove_indent();
+ }
+}
+
+
+/* From http://gcc. gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html .
+ I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble
+ with other compilers ... GLUE!
+*/
+#define WARN_ONCE(...) do { \
+ static int __warn_once=1; \
+ if(__warn_once){ \
+ radeon_warning("*********************************WARN_ONCE*********************************\n"); \
+ radeon_warning("File %s function %s line %d\n", \
+ __FILE__, __FUNCTION__, __LINE__); \
+ radeon_warning(__VA_ARGS__);\
+ radeon_warning("***************************************************************************\n"); \
+ __warn_once=0;\
+ } \
+ } while(0)
+
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.c
index 43be0006255..61cddda5dc1 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.c
@@ -1 +1,511 @@
-../radeon/radeon_dma.c \ No newline at end of file
+/**************************************************************************
+
+Copyright (C) 2004 Nicolai Haehnle.
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#include <errno.h>
+#include "radeon_common.h"
+#include "radeon_fog.h"
+#include "main/simple_list.h"
+
+#if defined(USE_X86_ASM)
+#define COPY_DWORDS( dst, src, nr ) \
+do { \
+ int __tmp; \
+ __asm__ __volatile__( "rep ; movsl" \
+ : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \
+ : "0" (nr), \
+ "D" ((long)dst), \
+ "S" ((long)src) ); \
+} while (0)
+#else
+#define COPY_DWORDS( dst, src, nr ) \
+do { \
+ int j; \
+ for ( j = 0 ; j < nr ; j++ ) \
+ dst[j] = ((int *)src)[j]; \
+ dst += nr; \
+} while (0)
+#endif
+
+void radeonEmitVec4(uint32_t *out, const GLvoid * data, int stride, int count)
+{
+ int i;
+
+ if (RADEON_DEBUG & RADEON_VERTS)
+ fprintf(stderr, "%s count %d stride %d out %p data %p\n",
+ __FUNCTION__, count, stride, (void *)out, (void *)data);
+
+ if (stride == 4)
+ COPY_DWORDS(out, data, count);
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out++;
+ data += stride;
+ }
+}
+
+void radeonEmitVec8(uint32_t *out, const GLvoid * data, int stride, int count)
+{
+ int i;
+
+ if (RADEON_DEBUG & RADEON_VERTS)
+ fprintf(stderr, "%s count %d stride %d out %p data %p\n",
+ __FUNCTION__, count, stride, (void *)out, (void *)data);
+
+ if (stride == 8)
+ COPY_DWORDS(out, data, count * 2);
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data + 4);
+ out += 2;
+ data += stride;
+ }
+}
+
+void radeonEmitVec12(uint32_t *out, const GLvoid * data, int stride, int count)
+{
+ int i;
+
+ if (RADEON_DEBUG & RADEON_VERTS)
+ fprintf(stderr, "%s count %d stride %d out %p data %p\n",
+ __FUNCTION__, count, stride, (void *)out, (void *)data);
+
+ if (stride == 12) {
+ COPY_DWORDS(out, data, count * 3);
+ }
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data + 4);
+ out[2] = *(int *)(data + 8);
+ out += 3;
+ data += stride;
+ }
+}
+
+void radeonEmitVec16(uint32_t *out, const GLvoid * data, int stride, int count)
+{
+ int i;
+
+ if (RADEON_DEBUG & RADEON_VERTS)
+ fprintf(stderr, "%s count %d stride %d out %p data %p\n",
+ __FUNCTION__, count, stride, (void *)out, (void *)data);
+
+ if (stride == 16)
+ COPY_DWORDS(out, data, count * 4);
+ else
+ for (i = 0; i < count; i++) {
+ out[0] = *(int *)data;
+ out[1] = *(int *)(data + 4);
+ out[2] = *(int *)(data + 8);
+ out[3] = *(int *)(data + 12);
+ out += 4;
+ data += stride;
+ }
+}
+
+void rcommon_emit_vector(struct gl_context * ctx, struct radeon_aos *aos,
+ const GLvoid * data, int size, int stride, int count)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ uint32_t *out;
+
+ if (stride == 0) {
+ radeonAllocDmaRegion(rmesa, &aos->bo, &aos->offset, size * 4, 32);
+ count = 1;
+ aos->stride = 0;
+ } else {
+ radeonAllocDmaRegion(rmesa, &aos->bo, &aos->offset, size * count * 4, 32);
+ aos->stride = size;
+ }
+
+ aos->components = size;
+ aos->count = count;
+
+ radeon_bo_map(aos->bo, 1);
+ out = (uint32_t*)((char*)aos->bo->ptr + aos->offset);
+ switch (size) {
+ case 1: radeonEmitVec4(out, data, stride, count); break;
+ case 2: radeonEmitVec8(out, data, stride, count); break;
+ case 3: radeonEmitVec12(out, data, stride, count); break;
+ case 4: radeonEmitVec16(out, data, stride, count); break;
+ default:
+ assert(0);
+ break;
+ }
+ radeon_bo_unmap(aos->bo);
+}
+
+void rcommon_emit_vecfog(struct gl_context *ctx, struct radeon_aos *aos,
+ GLvoid *data, int stride, int count)
+{
+ int i;
+ float *out;
+ int size = 1;
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+
+ if (RADEON_DEBUG & RADEON_VERTS)
+ fprintf(stderr, "%s count %d stride %d\n",
+ __FUNCTION__, count, stride);
+
+ if (stride == 0) {
+ radeonAllocDmaRegion( rmesa, &aos->bo, &aos->offset, size * 4, 32 );
+ count = 1;
+ aos->stride = 0;
+ } else {
+ radeonAllocDmaRegion(rmesa, &aos->bo, &aos->offset, size * count * 4, 32);
+ aos->stride = size;
+ }
+
+ aos->components = size;
+ aos->count = count;
+
+ /* Emit the data */
+ radeon_bo_map(aos->bo, 1);
+ out = (float*)((char*)aos->bo->ptr + aos->offset);
+ for (i = 0; i < count; i++) {
+ out[0] = radeonComputeFogBlendFactor( ctx, *(GLfloat *)data );
+ out++;
+ data += stride;
+ }
+ radeon_bo_unmap(aos->bo);
+}
+
+void radeon_init_dma(radeonContextPtr rmesa)
+{
+ make_empty_list(&rmesa->dma.free);
+ make_empty_list(&rmesa->dma.wait);
+ make_empty_list(&rmesa->dma.reserved);
+ rmesa->dma.minimum_size = MAX_DMA_BUF_SZ;
+}
+
+void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size)
+{
+ struct radeon_dma_bo *dma_bo = NULL;
+ /* we set minimum sizes to at least requested size
+ aligned to next 16 bytes. */
+ if (size > rmesa->dma.minimum_size)
+ rmesa->dma.minimum_size = (size + 15) & (~15);
+
+ radeon_print(RADEON_DMA, RADEON_NORMAL, "%s size %d minimum_size %Zi\n",
+ __FUNCTION__, size, rmesa->dma.minimum_size);
+
+ if (is_empty_list(&rmesa->dma.free)
+ || last_elem(&rmesa->dma.free)->bo->size < size) {
+ dma_bo = CALLOC_STRUCT(radeon_dma_bo);
+ assert(dma_bo);
+
+again_alloc:
+ dma_bo->bo = radeon_bo_open(rmesa->radeonScreen->bom,
+ 0, rmesa->dma.minimum_size, 4,
+ RADEON_GEM_DOMAIN_GTT, 0);
+
+ if (!dma_bo->bo) {
+ rcommonFlushCmdBuf(rmesa, __FUNCTION__);
+ goto again_alloc;
+ }
+ insert_at_head(&rmesa->dma.reserved, dma_bo);
+ } else {
+ /* We push and pop buffers from end of list so we can keep
+ counter on unused buffers for later freeing them from
+ begin of list */
+ dma_bo = last_elem(&rmesa->dma.free);
+ remove_from_list(dma_bo);
+ insert_at_head(&rmesa->dma.reserved, dma_bo);
+ }
+
+ rmesa->dma.current_used = 0;
+ rmesa->dma.current_vertexptr = 0;
+
+ if (radeon_cs_space_check_with_bo(rmesa->cmdbuf.cs,
+ first_elem(&rmesa->dma.reserved)->bo,
+ RADEON_GEM_DOMAIN_GTT, 0))
+ fprintf(stderr,"failure to revalidate BOs - badness\n");
+
+ if (is_empty_list(&rmesa->dma.reserved)) {
+ /* Cmd buff have been flushed in radeon_revalidate_bos */
+ goto again_alloc;
+ }
+ radeon_bo_map(first_elem(&rmesa->dma.reserved)->bo, 1);
+}
+
+/* Allocates a region from rmesa->dma.current. If there isn't enough
+ * space in current, grab a new buffer (and discard what was left of current)
+ */
+void radeonAllocDmaRegion(radeonContextPtr rmesa,
+ struct radeon_bo **pbo, int *poffset,
+ int bytes, int alignment)
+{
+ if (RADEON_DEBUG & RADEON_IOCTL)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, bytes);
+
+ if (rmesa->dma.flush)
+ rmesa->dma.flush(rmesa->glCtx);
+
+ assert(rmesa->dma.current_used == rmesa->dma.current_vertexptr);
+
+ alignment--;
+ rmesa->dma.current_used = (rmesa->dma.current_used + alignment) & ~alignment;
+
+ if (is_empty_list(&rmesa->dma.reserved)
+ || rmesa->dma.current_used + bytes > first_elem(&rmesa->dma.reserved)->bo->size)
+ radeonRefillCurrentDmaRegion(rmesa, bytes);
+
+ *poffset = rmesa->dma.current_used;
+ *pbo = first_elem(&rmesa->dma.reserved)->bo;
+ radeon_bo_ref(*pbo);
+
+ /* Always align to at least 16 bytes */
+ rmesa->dma.current_used = (rmesa->dma.current_used + bytes + 15) & ~15;
+ rmesa->dma.current_vertexptr = rmesa->dma.current_used;
+
+ assert(rmesa->dma.current_used <= first_elem(&rmesa->dma.reserved)->bo->size);
+}
+
+void radeonFreeDmaRegions(radeonContextPtr rmesa)
+{
+ struct radeon_dma_bo *dma_bo;
+ struct radeon_dma_bo *temp;
+ if (RADEON_DEBUG & RADEON_DMA)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ foreach_s(dma_bo, temp, &rmesa->dma.free) {
+ remove_from_list(dma_bo);
+ radeon_bo_unref(dma_bo->bo);
+ FREE(dma_bo);
+ }
+
+ foreach_s(dma_bo, temp, &rmesa->dma.wait) {
+ remove_from_list(dma_bo);
+ radeon_bo_unref(dma_bo->bo);
+ FREE(dma_bo);
+ }
+
+ foreach_s(dma_bo, temp, &rmesa->dma.reserved) {
+ remove_from_list(dma_bo);
+ radeon_bo_unref(dma_bo->bo);
+ FREE(dma_bo);
+ }
+}
+
+void radeonReturnDmaRegion(radeonContextPtr rmesa, int return_bytes)
+{
+ if (is_empty_list(&rmesa->dma.reserved))
+ return;
+
+ if (RADEON_DEBUG & RADEON_IOCTL)
+ fprintf(stderr, "%s %d\n", __FUNCTION__, return_bytes);
+ rmesa->dma.current_used -= return_bytes;
+ rmesa->dma.current_vertexptr = rmesa->dma.current_used;
+}
+
+static int radeon_bo_is_idle(struct radeon_bo* bo)
+{
+ uint32_t domain;
+ int ret = radeon_bo_is_busy(bo, &domain);
+ if (ret == -EINVAL) {
+ WARN_ONCE("Your libdrm or kernel doesn't have support for busy query.\n"
+ "This may cause small performance drop for you.\n");
+ }
+ return ret != -EBUSY;
+}
+
+void radeonReleaseDmaRegions(radeonContextPtr rmesa)
+{
+ struct radeon_dma_bo *dma_bo;
+ struct radeon_dma_bo *temp;
+ const int expire_at = ++rmesa->dma.free.expire_counter + DMA_BO_FREE_TIME;
+ const int time = rmesa->dma.free.expire_counter;
+
+ if (RADEON_DEBUG & RADEON_DMA) {
+ size_t free = 0,
+ wait = 0,
+ reserved = 0;
+ foreach(dma_bo, &rmesa->dma.free)
+ ++free;
+
+ foreach(dma_bo, &rmesa->dma.wait)
+ ++wait;
+
+ foreach(dma_bo, &rmesa->dma.reserved)
+ ++reserved;
+
+ fprintf(stderr, "%s: free %zu, wait %zu, reserved %zu, minimum_size: %zu\n",
+ __FUNCTION__, free, wait, reserved, rmesa->dma.minimum_size);
+ }
+
+ /* move waiting bos to free list.
+ wait list provides gpu time to handle data before reuse */
+ foreach_s(dma_bo, temp, &rmesa->dma.wait) {
+ if (dma_bo->expire_counter == time) {
+ WARN_ONCE("Leaking dma buffer object!\n");
+ radeon_bo_unref(dma_bo->bo);
+ remove_from_list(dma_bo);
+ FREE(dma_bo);
+ continue;
+ }
+ /* free objects that are too small to be used because of large request */
+ if (dma_bo->bo->size < rmesa->dma.minimum_size) {
+ radeon_bo_unref(dma_bo->bo);
+ remove_from_list(dma_bo);
+ FREE(dma_bo);
+ continue;
+ }
+ if (!radeon_bo_is_idle(dma_bo->bo)) {
+ break;
+ }
+ remove_from_list(dma_bo);
+ dma_bo->expire_counter = expire_at;
+ insert_at_tail(&rmesa->dma.free, dma_bo);
+ }
+
+ /* move reserved to wait list */
+ foreach_s(dma_bo, temp, &rmesa->dma.reserved) {
+ radeon_bo_unmap(dma_bo->bo);
+ /* free objects that are too small to be used because of large request */
+ if (dma_bo->bo->size < rmesa->dma.minimum_size) {
+ radeon_bo_unref(dma_bo->bo);
+ remove_from_list(dma_bo);
+ FREE(dma_bo);
+ continue;
+ }
+ remove_from_list(dma_bo);
+ dma_bo->expire_counter = expire_at;
+ insert_at_tail(&rmesa->dma.wait, dma_bo);
+ }
+
+ /* free bos that have been unused for some time */
+ foreach_s(dma_bo, temp, &rmesa->dma.free) {
+ if (dma_bo->expire_counter != time)
+ break;
+ remove_from_list(dma_bo);
+ radeon_bo_unref(dma_bo->bo);
+ FREE(dma_bo);
+ }
+
+}
+
+
+/* Flush vertices in the current dma region.
+ */
+void rcommon_flush_last_swtcl_prim( struct gl_context *ctx )
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ struct radeon_dma *dma = &rmesa->dma;
+
+ if (RADEON_DEBUG & RADEON_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+ dma->flush = NULL;
+
+ radeon_bo_unmap(rmesa->swtcl.bo);
+
+ if (!is_empty_list(&dma->reserved)) {
+ GLuint current_offset = dma->current_used;
+
+ assert (dma->current_used +
+ rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
+ dma->current_vertexptr);
+
+ if (dma->current_used != dma->current_vertexptr) {
+ dma->current_used = dma->current_vertexptr;
+
+ rmesa->vtbl.swtcl_flush(ctx, current_offset);
+ }
+ rmesa->swtcl.numverts = 0;
+ }
+ radeon_bo_unref(rmesa->swtcl.bo);
+ rmesa->swtcl.bo = NULL;
+}
+/* Alloc space in the current dma region.
+ */
+void *
+rcommonAllocDmaLowVerts( radeonContextPtr rmesa, int nverts, int vsize )
+{
+ GLuint bytes = vsize * nverts;
+ void *head;
+ if (RADEON_DEBUG & RADEON_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if(is_empty_list(&rmesa->dma.reserved)
+ ||rmesa->dma.current_vertexptr + bytes > first_elem(&rmesa->dma.reserved)->bo->size) {
+ if (rmesa->dma.flush) {
+ rmesa->dma.flush(rmesa->glCtx);
+ }
+
+ radeonRefillCurrentDmaRegion(rmesa, bytes);
+
+ return NULL;
+ }
+
+ if (!rmesa->dma.flush) {
+ /* if cmdbuf flushed DMA restart */
+ rmesa->glCtx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
+ rmesa->dma.flush = rcommon_flush_last_swtcl_prim;
+ }
+
+ ASSERT( vsize == rmesa->swtcl.vertex_size * 4 );
+ ASSERT( rmesa->dma.flush == rcommon_flush_last_swtcl_prim );
+ ASSERT( rmesa->dma.current_used +
+ rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 ==
+ rmesa->dma.current_vertexptr );
+
+ if (!rmesa->swtcl.bo) {
+ rmesa->swtcl.bo = first_elem(&rmesa->dma.reserved)->bo;
+ radeon_bo_ref(rmesa->swtcl.bo);
+ radeon_bo_map(rmesa->swtcl.bo, 1);
+ }
+
+ head = (rmesa->swtcl.bo->ptr + rmesa->dma.current_vertexptr);
+ rmesa->dma.current_vertexptr += bytes;
+ rmesa->swtcl.numverts += nverts;
+ return head;
+}
+
+void radeonReleaseArrays( struct gl_context *ctx, GLuint newinputs )
+{
+ radeonContextPtr radeon = RADEON_CONTEXT( ctx );
+ int i;
+ if (RADEON_DEBUG & RADEON_IOCTL)
+ fprintf(stderr, "%s\n", __FUNCTION__);
+
+ if (radeon->dma.flush) {
+ radeon->dma.flush(radeon->glCtx);
+ }
+ for (i = 0; i < radeon->tcl.aos_count; i++) {
+ if (radeon->tcl.aos[i].bo) {
+ radeon_bo_unref(radeon->tcl.aos[i].bo);
+ radeon->tcl.aos[i].bo = NULL;
+
+ }
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.h
index 82e50634e3c..db7b84ebd1e 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_dma.h
@@ -1 +1,60 @@
-../radeon/radeon_dma.h \ No newline at end of file
+/**************************************************************************
+
+Copyright (C) 2004 Nicolai Haehnle.
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifndef RADEON_DMA_H
+#define RADEON_DMA_H
+
+void radeonEmitVec4(uint32_t *out, const GLvoid * data, int stride, int count);
+void radeonEmitVec8(uint32_t *out, const GLvoid * data, int stride, int count);
+void radeonEmitVec12(uint32_t *out, const GLvoid * data, int stride, int count);
+void radeonEmitVec16(uint32_t *out, const GLvoid * data, int stride, int count);
+
+void rcommon_emit_vector(struct gl_context * ctx, struct radeon_aos *aos,
+ const GLvoid * data, int size, int stride, int count);
+void rcommon_emit_vecfog(struct gl_context *ctx, struct radeon_aos *aos,
+ GLvoid *data, int stride, int count);
+
+void radeonReturnDmaRegion(radeonContextPtr rmesa, int return_bytes);
+void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size);
+void radeon_init_dma(radeonContextPtr rmesa);
+void radeonReturnDmaRegion(radeonContextPtr rmesa, int return_bytes);
+void radeonAllocDmaRegion(radeonContextPtr rmesa,
+ struct radeon_bo **pbo, int *poffset,
+ int bytes, int alignment);
+void radeonReleaseDmaRegions(radeonContextPtr rmesa);
+
+void rcommon_flush_last_swtcl_prim(struct gl_context *ctx);
+
+void *rcommonAllocDmaLowVerts(radeonContextPtr rmesa, int nverts, int vsize);
+void radeonFreeDmaRegions(radeonContextPtr rmesa);
+void radeonReleaseArrays( struct gl_context *ctx, GLuint newinputs );
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fbo.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fbo.c
index 0d738d8d780..f597f35c0f7 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fbo.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fbo.c
@@ -1 +1,980 @@
-../radeon/radeon_fbo.c \ No newline at end of file
+/**************************************************************************
+ *
+ * Copyright 2008 Red Hat Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mfeatures.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/context.h"
+#include "swrast/swrast.h"
+#include "drivers/common/meta.h"
+
+#include "radeon_common.h"
+#include "radeon_mipmap_tree.h"
+
+#define FILE_DEBUG_FLAG RADEON_TEXTURE
+#define DBG(...) do { \
+ if (RADEON_DEBUG & FILE_DEBUG_FLAG) \
+ printf(__VA_ARGS__); \
+} while(0)
+
+static struct gl_framebuffer *
+radeon_new_framebuffer(struct gl_context *ctx, GLuint name)
+{
+ return _mesa_new_framebuffer(ctx, name);
+}
+
+static void
+radeon_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb)
+{
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(rb %p, rrb %p) \n",
+ __func__, rb, rrb);
+
+ ASSERT(rrb);
+
+ if (rrb && rrb->bo) {
+ radeon_bo_unref(rrb->bo);
+ }
+ _mesa_delete_renderbuffer(ctx, rb);
+}
+
+#if defined(RADEON_R100)
+static GLuint get_depth_z32(const struct radeon_renderbuffer * rrb,
+ GLint x, GLint y)
+{
+ GLuint ba, address = 0;
+
+ ba = (y >> 4) * (rrb->pitch >> 6) + (x >> 4);
+
+ address |= (x & 0x7) << 2;
+ address |= (y & 0x3) << 5;
+ address |= (((x & 0x10) >> 2) ^ (y & 0x4)) << 5;
+ address |= (ba & 3) << 8;
+ address |= (y & 0x8) << 7;
+ address |= (((x & 0x8) << 1) ^ (y & 0x10)) << 7;
+ address |= (ba & ~0x3) << 10;
+ return address;
+}
+
+static GLuint get_depth_z16(const struct radeon_renderbuffer * rrb,
+ GLint x, GLint y)
+{
+ GLuint ba, address = 0; /* a[0] = 0 */
+
+ ba = (y / 16) * (rrb->pitch >> 6) + (x / 32);
+
+ address |= (x & 0x7) << 1; /* a[1..3] = x[0..2] */
+ address |= (y & 0x7) << 4; /* a[4..6] = y[0..2] */
+ address |= (x & 0x8) << 4; /* a[7] = x[3] */
+ address |= (ba & 0x3) << 8; /* a[8..9] = ba[0..1] */
+ address |= (y & 0x8) << 7; /* a[10] = y[3] */
+ address |= ((x & 0x10) ^ (y & 0x10)) << 7;/* a[11] = x[4] ^ y[4] */
+ address |= (ba & ~0x3) << 10; /* a[12..] = ba[2..] */
+ return address;
+}
+#endif
+
+#if defined(RADEON_R200)
+static GLuint get_depth_z32(const struct radeon_renderbuffer * rrb,
+ GLint x, GLint y)
+{
+ GLuint offset;
+ GLuint b;
+ offset = 0;
+ b = (((y & 0x7ff) >> 4) * (rrb->pitch >> 7) + (x >> 5));
+ offset += (b >> 1) << 12;
+ offset += (((rrb->pitch >> 7) & 0x1) ? (b & 0x1) : ((b & 0x1) ^ ((y >> 4) & 0x1))) << 11;
+ offset += ((y >> 2) & 0x3) << 9;
+ offset += ((x >> 2) & 0x1) << 8;
+ offset += ((x >> 3) & 0x3) << 6;
+ offset += ((y >> 1) & 0x1) << 5;
+ offset += ((x >> 1) & 0x1) << 4;
+ offset += (y & 0x1) << 3;
+ offset += (x & 0x1) << 2;
+
+ return offset;
+}
+
+static GLuint get_depth_z16(const struct radeon_renderbuffer *rrb,
+ GLint x, GLint y)
+{
+ GLuint offset;
+ GLuint b;
+
+ offset = 0;
+ b = (((y >> 4) * (rrb->pitch >> 7) + (x >> 6)));
+ offset += (b >> 1) << 12;
+ offset += (((rrb->pitch >> 7) & 0x1) ? (b & 0x1) : ((b & 0x1) ^ ((y >> 4) & 0x1))) << 11;
+ offset += ((y >> 2) & 0x3) << 9;
+ offset += ((x >> 3) & 0x1) << 8;
+ offset += ((x >> 4) & 0x3) << 6;
+ offset += ((x >> 2) & 0x1) << 5;
+ offset += ((y >> 1) & 0x1) << 4;
+ offset += ((x >> 1) & 0x1) << 3;
+ offset += (y & 0x1) << 2;
+ offset += (x & 0x1) << 1;
+
+ return offset;
+}
+#endif
+
+static void
+radeon_map_renderbuffer_s8z24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **out_map,
+ GLint *out_stride)
+{
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+ uint32_t *untiled_s8z24_map, *tiled_s8z24_map;
+ int ret;
+ int y_flip = (rb->Name == 0) ? -1 : 1;
+ int y_bias = (rb->Name == 0) ? (rb->Height - 1) : 0;
+ uint32_t pitch = w * rrb->cpp;
+
+ rrb->map_pitch = pitch;
+
+ rrb->map_buffer = malloc(w * h * 4);
+ ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
+ assert(!ret);
+ untiled_s8z24_map = rrb->map_buffer;
+ tiled_s8z24_map = rrb->bo->ptr;
+
+ for (uint32_t pix_y = 0; pix_y < h; ++ pix_y) {
+ for (uint32_t pix_x = 0; pix_x < w; ++pix_x) {
+ uint32_t flipped_y = y_flip * (int32_t)(y + pix_y) + y_bias;
+ uint32_t src_offset = get_depth_z32(rrb, x + pix_x, flipped_y);
+ uint32_t dst_offset = pix_y * rrb->map_pitch + pix_x * rrb->cpp;
+ untiled_s8z24_map[dst_offset/4] = tiled_s8z24_map[src_offset/4];
+ }
+ }
+
+ radeon_bo_unmap(rrb->bo);
+
+ *out_map = rrb->map_buffer;
+ *out_stride = rrb->map_pitch;
+}
+
+static void
+radeon_map_renderbuffer_z16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **out_map,
+ GLint *out_stride)
+{
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+ uint16_t *untiled_z16_map, *tiled_z16_map;
+ int ret;
+ int y_flip = (rb->Name == 0) ? -1 : 1;
+ int y_bias = (rb->Name == 0) ? (rb->Height - 1) : 0;
+ uint32_t pitch = w * rrb->cpp;
+
+ rrb->map_pitch = pitch;
+
+ rrb->map_buffer = malloc(w * h * 2);
+ ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
+ assert(!ret);
+
+ untiled_z16_map = rrb->map_buffer;
+ tiled_z16_map = rrb->bo->ptr;
+
+ for (uint32_t pix_y = 0; pix_y < h; ++ pix_y) {
+ for (uint32_t pix_x = 0; pix_x < w; ++pix_x) {
+ uint32_t flipped_y = y_flip * (int32_t)(y + pix_y) + y_bias;
+ uint32_t src_offset = get_depth_z16(rrb, x + pix_x, flipped_y);
+ uint32_t dst_offset = pix_y * rrb->map_pitch + pix_x * rrb->cpp;
+ untiled_z16_map[dst_offset/2] = tiled_z16_map[src_offset/2];
+ }
+ }
+
+ radeon_bo_unmap(rrb->bo);
+
+ *out_map = rrb->map_buffer;
+ *out_stride = rrb->map_pitch;
+}
+
+static void
+radeon_map_renderbuffer(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **out_map,
+ GLint *out_stride)
+{
+ struct radeon_context *const rmesa = RADEON_CONTEXT(ctx);
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+ GLubyte *map;
+ GLboolean ok;
+ int stride, flip_stride;
+ int ret;
+ int src_x, src_y;
+
+ if (!rrb || !rrb->bo) {
+ *out_map = NULL;
+ *out_stride = 0;
+ return;
+ }
+
+ rrb->map_mode = mode;
+ rrb->map_x = x;
+ rrb->map_y = y;
+ rrb->map_w = w;
+ rrb->map_h = h;
+ rrb->map_pitch = rrb->pitch;
+
+ ok = rmesa->vtbl.check_blit(rb->Format, rrb->pitch / rrb->cpp);
+ if (ok) {
+ if (rb->Name) {
+ src_x = x;
+ src_y = y;
+ } else {
+ src_x = x;
+ src_y = rrb->base.Base.Height - y - h;
+ }
+
+ /* Make a temporary buffer and blit the current contents of the renderbuffer
+ * out to it. This gives us linear access to the buffer, instead of having
+ * to do detiling in software.
+ */
+
+ rrb->map_pitch = rrb->pitch;
+
+ assert(!rrb->map_bo);
+ rrb->map_bo = radeon_bo_open(rmesa->radeonScreen->bom, 0,
+ rrb->map_pitch * h, 4,
+ RADEON_GEM_DOMAIN_GTT, 0);
+
+ ok = rmesa->vtbl.blit(ctx, rrb->bo, rrb->draw_offset,
+ rb->Format, rrb->pitch / rrb->cpp,
+ rb->Width, rb->Height,
+ src_x, src_y,
+ rrb->map_bo, 0,
+ rb->Format, rrb->map_pitch / rrb->cpp,
+ w, h,
+ 0, 0,
+ w, h,
+ GL_FALSE);
+ assert(ok);
+
+ ret = radeon_bo_map(rrb->map_bo, !!(mode & GL_MAP_WRITE_BIT));
+ assert(!ret);
+
+ map = rrb->map_bo->ptr;
+
+ if (rb->Name) {
+ *out_map = map;
+ *out_stride = rrb->map_pitch;
+ } else {
+ *out_map = map + (h - 1) * rrb->map_pitch;
+ *out_stride = -rrb->map_pitch;
+ }
+ return;
+ }
+
+ /* sw fallback flush stuff */
+ if (radeon_bo_is_referenced_by_cs(rrb->bo, rmesa->cmdbuf.cs)) {
+ radeon_firevertices(rmesa);
+ }
+
+ if ((rmesa->radeonScreen->chip_flags & RADEON_CHIPSET_DEPTH_ALWAYS_TILED) && !rrb->has_surface) {
+ if (rb->Format == MESA_FORMAT_S8_Z24 || rb->Format == MESA_FORMAT_X8_Z24) {
+ radeon_map_renderbuffer_s8z24(ctx, rb, x, y, w, h,
+ mode, out_map, out_stride);
+ return;
+ }
+ if (rb->Format == MESA_FORMAT_Z16) {
+ radeon_map_renderbuffer_z16(ctx, rb, x, y, w, h,
+ mode, out_map, out_stride);
+ return;
+ }
+ }
+
+ ret = radeon_bo_map(rrb->bo, !!(mode & GL_MAP_WRITE_BIT));
+ assert(!ret);
+
+ map = rrb->bo->ptr;
+ stride = rrb->map_pitch;
+
+ if (rb->Name == 0) {
+ y = rb->Height - 1 - y;
+ flip_stride = -stride;
+ } else {
+ flip_stride = stride;
+ map += rrb->draw_offset;
+ }
+
+ map += x * rrb->cpp;
+ map += (int)y * stride;
+
+ *out_map = map;
+ *out_stride = flip_stride;
+}
+
+static void
+radeon_unmap_renderbuffer_s8z24(struct gl_context *ctx,
+ struct gl_renderbuffer *rb)
+{
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+
+ if (!rrb->map_buffer)
+ return;
+
+ if (rrb->map_mode & GL_MAP_WRITE_BIT) {
+ uint32_t *untiled_s8z24_map = rrb->map_buffer;
+ uint32_t *tiled_s8z24_map;
+ int y_flip = (rb->Name == 0) ? -1 : 1;
+ int y_bias = (rb->Name == 0) ? (rb->Height - 1) : 0;
+
+ radeon_bo_map(rrb->bo, 1);
+
+ tiled_s8z24_map = rrb->bo->ptr;
+
+ for (uint32_t pix_y = 0; pix_y < rrb->map_h; pix_y++) {
+ for (uint32_t pix_x = 0; pix_x < rrb->map_w; pix_x++) {
+ uint32_t flipped_y = y_flip * (int32_t)(pix_y + rrb->map_y) + y_bias;
+ uint32_t dst_offset = get_depth_z32(rrb, rrb->map_x + pix_x, flipped_y);
+ uint32_t src_offset = pix_y * rrb->map_pitch + pix_x * rrb->cpp;
+ tiled_s8z24_map[dst_offset/4] = untiled_s8z24_map[src_offset/4];
+ }
+ }
+ radeon_bo_unmap(rrb->bo);
+ }
+ free(rrb->map_buffer);
+ rrb->map_buffer = NULL;
+}
+
+static void
+radeon_unmap_renderbuffer_z16(struct gl_context *ctx,
+ struct gl_renderbuffer *rb)
+{
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+
+ if (!rrb->map_buffer)
+ return;
+
+ if (rrb->map_mode & GL_MAP_WRITE_BIT) {
+ uint16_t *untiled_z16_map = rrb->map_buffer;
+ uint16_t *tiled_z16_map;
+ int y_flip = (rb->Name == 0) ? -1 : 1;
+ int y_bias = (rb->Name == 0) ? (rb->Height - 1) : 0;
+
+ radeon_bo_map(rrb->bo, 1);
+
+ tiled_z16_map = rrb->bo->ptr;
+
+ for (uint32_t pix_y = 0; pix_y < rrb->map_h; pix_y++) {
+ for (uint32_t pix_x = 0; pix_x < rrb->map_w; pix_x++) {
+ uint32_t flipped_y = y_flip * (int32_t)(pix_y + rrb->map_y) + y_bias;
+ uint32_t dst_offset = get_depth_z16(rrb, rrb->map_x + pix_x, flipped_y);
+ uint32_t src_offset = pix_y * rrb->map_pitch + pix_x * rrb->cpp;
+ tiled_z16_map[dst_offset/2] = untiled_z16_map[src_offset/2];
+ }
+ }
+ radeon_bo_unmap(rrb->bo);
+ }
+ free(rrb->map_buffer);
+ rrb->map_buffer = NULL;
+}
+
+
+static void
+radeon_unmap_renderbuffer(struct gl_context *ctx,
+ struct gl_renderbuffer *rb)
+{
+ struct radeon_context *const rmesa = RADEON_CONTEXT(ctx);
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+ GLboolean ok;
+
+ if ((rmesa->radeonScreen->chip_flags & RADEON_CHIPSET_DEPTH_ALWAYS_TILED) && !rrb->has_surface) {
+ if (rb->Format == MESA_FORMAT_S8_Z24 || rb->Format == MESA_FORMAT_X8_Z24) {
+ radeon_unmap_renderbuffer_s8z24(ctx, rb);
+ return;
+ }
+ if (rb->Format == MESA_FORMAT_Z16) {
+ radeon_unmap_renderbuffer_z16(ctx, rb);
+ return;
+ }
+ }
+
+ if (!rrb->map_bo) {
+ if (rrb->bo)
+ radeon_bo_unmap(rrb->bo);
+ return;
+ }
+
+ radeon_bo_unmap(rrb->map_bo);
+
+ if (rrb->map_mode & GL_MAP_WRITE_BIT) {
+ ok = rmesa->vtbl.blit(ctx, rrb->map_bo, 0,
+ rb->Format, rrb->map_pitch / rrb->cpp,
+ rrb->map_w, rrb->map_h,
+ 0, 0,
+ rrb->bo, rrb->draw_offset,
+ rb->Format, rrb->pitch / rrb->cpp,
+ rb->Width, rb->Height,
+ rrb->map_x, rrb->map_y,
+ rrb->map_w, rrb->map_h,
+ GL_FALSE);
+ assert(ok);
+ }
+
+ radeon_bo_unref(rrb->map_bo);
+ rrb->map_bo = NULL;
+}
+
+
+/**
+ * Called via glRenderbufferStorageEXT() to set the format and allocate
+ * storage for a user-created renderbuffer.
+ */
+static GLboolean
+radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat,
+ GLuint width, GLuint height)
+{
+ struct radeon_context *radeon = RADEON_CONTEXT(ctx);
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+ uint32_t size, pitch;
+ int cpp;
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, rb %p) \n",
+ __func__, ctx, rb);
+
+ ASSERT(rb->Name != 0);
+ switch (internalFormat) {
+ case GL_R3_G3_B2:
+ case GL_RGB4:
+ case GL_RGB5:
+ rb->Format = _radeon_texformat_rgb565;
+ cpp = 2;
+ break;
+ case GL_RGB:
+ case GL_RGB8:
+ case GL_RGB10:
+ case GL_RGB12:
+ case GL_RGB16:
+ rb->Format = _radeon_texformat_argb8888;
+ cpp = 4;
+ break;
+ case GL_RGBA:
+ case GL_RGBA2:
+ case GL_RGBA4:
+ case GL_RGB5_A1:
+ case GL_RGBA8:
+ case GL_RGB10_A2:
+ case GL_RGBA12:
+ case GL_RGBA16:
+ rb->Format = _radeon_texformat_argb8888;
+ cpp = 4;
+ break;
+ case GL_STENCIL_INDEX:
+ case GL_STENCIL_INDEX1_EXT:
+ case GL_STENCIL_INDEX4_EXT:
+ case GL_STENCIL_INDEX8_EXT:
+ case GL_STENCIL_INDEX16_EXT:
+ /* alloc a depth+stencil buffer */
+ rb->Format = MESA_FORMAT_S8_Z24;
+ cpp = 4;
+ break;
+ case GL_DEPTH_COMPONENT16:
+ rb->Format = MESA_FORMAT_Z16;
+ cpp = 2;
+ break;
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
+ rb->Format = MESA_FORMAT_X8_Z24;
+ cpp = 4;
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DEPTH24_STENCIL8_EXT:
+ rb->Format = MESA_FORMAT_S8_Z24;
+ cpp = 4;
+ break;
+ default:
+ _mesa_problem(ctx,
+ "Unexpected format in radeon_alloc_renderbuffer_storage");
+ return GL_FALSE;
+ }
+
+ rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
+
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx); /* +r6/r7 */
+
+ if (rrb->bo)
+ radeon_bo_unref(rrb->bo);
+
+ pitch = ((cpp * width + 63) & ~63) / cpp;
+
+ if (RADEON_DEBUG & RADEON_MEMORY)
+ fprintf(stderr,"Allocating %d x %d radeon RBO (pitch %d)\n", width,
+ height, pitch);
+
+ size = pitch * height * cpp;
+ rrb->pitch = pitch * cpp;
+ rrb->cpp = cpp;
+ rrb->bo = radeon_bo_open(radeon->radeonScreen->bom,
+ 0,
+ size,
+ 0,
+ RADEON_GEM_DOMAIN_VRAM,
+ 0);
+ rb->Width = width;
+ rb->Height = height;
+ return GL_TRUE;
+}
+
+#if FEATURE_OES_EGL_image
+static void
+radeon_image_target_renderbuffer_storage(struct gl_context *ctx,
+ struct gl_renderbuffer *rb,
+ void *image_handle)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct radeon_renderbuffer *rrb;
+ __DRIscreen *screen;
+ __DRIimage *image;
+
+ screen = radeon->radeonScreen->driScreen;
+ image = screen->dri2.image->lookupEGLImage(screen, image_handle,
+ screen->loaderPrivate);
+ if (image == NULL)
+ return;
+
+ rrb = radeon_renderbuffer(rb);
+
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx); /* +r6/r7 */
+
+ if (rrb->bo)
+ radeon_bo_unref(rrb->bo);
+ rrb->bo = image->bo;
+ radeon_bo_ref(rrb->bo);
+ fprintf(stderr, "image->bo: %p, name: %d, rbs: w %d -> p %d\n", image->bo, image->bo->handle,
+ image->width, image->pitch);
+
+ rrb->cpp = image->cpp;
+ rrb->pitch = image->pitch * image->cpp;
+
+ rb->Format = image->format;
+ rb->InternalFormat = image->internal_format;
+ rb->Width = image->width;
+ rb->Height = image->height;
+ rb->Format = image->format;
+ rb->_BaseFormat = _mesa_base_fbo_format(radeon->glCtx,
+ image->internal_format);
+}
+#endif
+
+/**
+ * Called for each hardware renderbuffer when a _window_ is resized.
+ * Just update fields.
+ * Not used for user-created renderbuffers!
+ */
+static GLboolean
+radeon_alloc_window_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ ASSERT(rb->Name == 0);
+ rb->Width = width;
+ rb->Height = height;
+ rb->InternalFormat = internalFormat;
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, rb %p) \n",
+ __func__, ctx, rb);
+
+
+ return GL_TRUE;
+}
+
+
+static void
+radeon_resize_buffers(struct gl_context *ctx, struct gl_framebuffer *fb,
+ GLuint width, GLuint height)
+{
+ struct radeon_framebuffer *radeon_fb = (struct radeon_framebuffer*)fb;
+ int i;
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, fb %p) \n",
+ __func__, ctx, fb);
+
+ _mesa_resize_framebuffer(ctx, fb, width, height);
+
+ fb->Initialized = GL_TRUE; /* XXX remove someday */
+
+ if (fb->Name != 0) {
+ return;
+ }
+
+ /* Make sure all window system renderbuffers are up to date */
+ for (i = 0; i < 2; i++) {
+ struct gl_renderbuffer *rb = &radeon_fb->color_rb[i]->base.Base;
+
+ /* only resize if size is changing */
+ if (rb && (rb->Width != width || rb->Height != height)) {
+ rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height);
+ }
+ }
+}
+
+
+/** Dummy function for gl_renderbuffer::AllocStorage() */
+static GLboolean
+radeon_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
+ GLenum internalFormat, GLuint width, GLuint height)
+{
+ _mesa_problem(ctx, "radeon_op_alloc_storage should never be called.");
+ return GL_FALSE;
+}
+
+
+/**
+ * Create a renderbuffer for a window's color, depth and/or stencil buffer.
+ * Not used for user-created renderbuffers.
+ */
+struct radeon_renderbuffer *
+radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv)
+{
+ struct radeon_renderbuffer *rrb;
+ struct gl_renderbuffer *rb;
+
+ rrb = CALLOC_STRUCT(radeon_renderbuffer);
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s( rrb %p ) \n",
+ __func__, rrb);
+
+ if (!rrb)
+ return NULL;
+
+ rb = &rrb->base.Base;
+
+ _mesa_init_renderbuffer(rb, 0);
+ rb->ClassID = RADEON_RB_CLASS;
+ rb->Format = format;
+ rb->_BaseFormat = _mesa_get_format_base_format(format);
+ rb->InternalFormat = _mesa_get_format_base_format(format);
+
+ rrb->dPriv = driDrawPriv;
+
+ rb->Delete = radeon_delete_renderbuffer;
+ rb->AllocStorage = radeon_alloc_window_storage;
+
+ rrb->bo = NULL;
+ return rrb;
+}
+
+static struct gl_renderbuffer *
+radeon_new_renderbuffer(struct gl_context * ctx, GLuint name)
+{
+ struct radeon_renderbuffer *rrb;
+ struct gl_renderbuffer *rb;
+
+
+ rrb = CALLOC_STRUCT(radeon_renderbuffer);
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, rrb %p) \n",
+ __func__, ctx, rrb);
+
+ if (!rrb)
+ return NULL;
+
+ rb = &rrb->base.Base;
+
+ _mesa_init_renderbuffer(rb, name);
+ rb->ClassID = RADEON_RB_CLASS;
+ rb->Delete = radeon_delete_renderbuffer;
+ rb->AllocStorage = radeon_alloc_renderbuffer_storage;
+
+ return rb;
+}
+
+static void
+radeon_bind_framebuffer(struct gl_context * ctx, GLenum target,
+ struct gl_framebuffer *fb, struct gl_framebuffer *fbread)
+{
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, fb %p, target %s) \n",
+ __func__, ctx, fb,
+ _mesa_lookup_enum_by_nr(target));
+
+ if (target == GL_FRAMEBUFFER_EXT || target == GL_DRAW_FRAMEBUFFER_EXT) {
+ radeon_draw_buffer(ctx, fb);
+ }
+ else {
+ /* don't need to do anything if target == GL_READ_FRAMEBUFFER_EXT */
+ }
+}
+
+static void
+radeon_framebuffer_renderbuffer(struct gl_context * ctx,
+ struct gl_framebuffer *fb,
+ GLenum attachment, struct gl_renderbuffer *rb)
+{
+
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx); /* +r6/r7 */
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, fb %p, rb %p) \n",
+ __func__, ctx, fb, rb);
+
+ _mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
+ radeon_draw_buffer(ctx, fb);
+}
+
+static GLboolean
+radeon_update_wrapper(struct gl_context *ctx, struct radeon_renderbuffer *rrb,
+ struct gl_texture_image *texImage)
+{
+ struct gl_renderbuffer *rb = &rrb->base.Base;
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, rrb %p, texImage %p, texFormat %s) \n",
+ __func__, ctx, rrb, texImage, _mesa_get_format_name(texImage->TexFormat));
+
+ rrb->cpp = _mesa_get_format_bytes(texImage->TexFormat);
+ rrb->pitch = texImage->Width * rrb->cpp;
+ rb->Format = texImage->TexFormat;
+ rb->InternalFormat = texImage->InternalFormat;
+ rb->_BaseFormat = _mesa_base_fbo_format(ctx, rb->InternalFormat);
+ rb->Width = texImage->Width;
+ rb->Height = texImage->Height;
+ rb->Delete = radeon_delete_renderbuffer;
+ rb->AllocStorage = radeon_nop_alloc_storage;
+
+ return GL_TRUE;
+}
+
+
+static struct radeon_renderbuffer *
+radeon_wrap_texture(struct gl_context * ctx, struct gl_texture_image *texImage)
+{
+ const GLuint name = ~0; /* not significant, but distinct for debugging */
+ struct radeon_renderbuffer *rrb;
+
+ /* make an radeon_renderbuffer to wrap the texture image */
+ rrb = CALLOC_STRUCT(radeon_renderbuffer);
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, rrb %p, texImage %p) \n",
+ __func__, ctx, rrb, texImage);
+
+ if (!rrb) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glFramebufferTexture");
+ return NULL;
+ }
+
+ _mesa_init_renderbuffer(&rrb->base.Base, name);
+ rrb->base.Base.ClassID = RADEON_RB_CLASS;
+
+ if (!radeon_update_wrapper(ctx, rrb, texImage)) {
+ free(rrb);
+ return NULL;
+ }
+
+ return rrb;
+
+}
+static void
+radeon_render_texture(struct gl_context * ctx,
+ struct gl_framebuffer *fb,
+ struct gl_renderbuffer_attachment *att)
+{
+ struct gl_texture_image *newImage
+ = att->Texture->Image[att->CubeMapFace][att->TextureLevel];
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(att->Renderbuffer);
+ radeon_texture_image *radeon_image;
+ GLuint imageOffset;
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, fb %p, rrb %p, att %p)\n",
+ __func__, ctx, fb, rrb, att);
+
+ (void) fb;
+
+ ASSERT(newImage);
+
+ radeon_image = (radeon_texture_image *)newImage;
+
+ if (!radeon_image->mt) {
+ /* Fallback on drawing to a texture without a miptree.
+ */
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+ else if (!rrb) {
+ rrb = radeon_wrap_texture(ctx, newImage);
+ if (rrb) {
+ /* bind the wrapper to the attachment point */
+ _mesa_reference_renderbuffer(&att->Renderbuffer, &rrb->base.Base);
+ }
+ else {
+ /* fallback to software rendering */
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+ }
+
+ if (!radeon_update_wrapper(ctx, rrb, newImage)) {
+ _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
+ _swrast_render_texture(ctx, fb, att);
+ return;
+ }
+
+ DBG("Begin render texture tid %lx tex=%u w=%d h=%d refcount=%d\n",
+ _glthread_GetID(),
+ att->Texture->Name, newImage->Width, newImage->Height,
+ rrb->base.Base.RefCount);
+
+ /* point the renderbufer's region to the texture image region */
+ if (rrb->bo != radeon_image->mt->bo) {
+ if (rrb->bo)
+ radeon_bo_unref(rrb->bo);
+ rrb->bo = radeon_image->mt->bo;
+ radeon_bo_ref(rrb->bo);
+ }
+
+ /* compute offset of the particular 2D image within the texture region */
+ imageOffset = radeon_miptree_image_offset(radeon_image->mt,
+ att->CubeMapFace,
+ att->TextureLevel);
+
+ if (att->Texture->Target == GL_TEXTURE_3D) {
+ imageOffset += radeon_image->mt->levels[att->TextureLevel].rowstride *
+ radeon_image->mt->levels[att->TextureLevel].height *
+ att->Zoffset;
+ }
+
+ /* store that offset in the region, along with the correct pitch for
+ * the image we are rendering to */
+ rrb->draw_offset = imageOffset;
+ rrb->pitch = radeon_image->mt->levels[att->TextureLevel].rowstride;
+ radeon_image->used_as_render_target = GL_TRUE;
+
+ /* update drawing region, etc */
+ radeon_draw_buffer(ctx, fb);
+}
+
+static void
+radeon_finish_render_texture(struct gl_context * ctx,
+ struct gl_renderbuffer_attachment *att)
+{
+ struct gl_texture_object *tex_obj = att->Texture;
+ struct gl_texture_image *image =
+ tex_obj->Image[att->CubeMapFace][att->TextureLevel];
+ radeon_texture_image *radeon_image = (radeon_texture_image *)image;
+
+ if (radeon_image)
+ radeon_image->used_as_render_target = GL_FALSE;
+
+ if (ctx->Driver.Flush)
+ ctx->Driver.Flush(ctx); /* +r6/r7 */
+}
+static void
+radeon_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ gl_format mesa_format;
+ int i;
+
+ for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
+ struct gl_renderbuffer_attachment *att;
+ if (i == -2) {
+ att = &fb->Attachment[BUFFER_DEPTH];
+ } else if (i == -1) {
+ att = &fb->Attachment[BUFFER_STENCIL];
+ } else {
+ att = &fb->Attachment[BUFFER_COLOR0 + i];
+ }
+
+ if (att->Type == GL_TEXTURE) {
+ mesa_format = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->TexFormat;
+ } else {
+ /* All renderbuffer formats are renderable, but not sampable */
+ continue;
+ }
+
+ if (!radeon->vtbl.is_format_renderable(mesa_format)){
+ fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED;
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s: HW doesn't support format %s as output format of attachment %d\n",
+ __FUNCTION__, _mesa_get_format_name(mesa_format), i);
+ return;
+ }
+ }
+}
+
+void radeon_fbo_init(struct radeon_context *radeon)
+{
+#if FEATURE_EXT_framebuffer_object
+ radeon->glCtx->Driver.NewFramebuffer = radeon_new_framebuffer;
+ radeon->glCtx->Driver.NewRenderbuffer = radeon_new_renderbuffer;
+ radeon->glCtx->Driver.MapRenderbuffer = radeon_map_renderbuffer;
+ radeon->glCtx->Driver.UnmapRenderbuffer = radeon_unmap_renderbuffer;
+ radeon->glCtx->Driver.BindFramebuffer = radeon_bind_framebuffer;
+ radeon->glCtx->Driver.FramebufferRenderbuffer = radeon_framebuffer_renderbuffer;
+ radeon->glCtx->Driver.RenderTexture = radeon_render_texture;
+ radeon->glCtx->Driver.FinishRenderTexture = radeon_finish_render_texture;
+ radeon->glCtx->Driver.ResizeBuffers = radeon_resize_buffers;
+ radeon->glCtx->Driver.ValidateFramebuffer = radeon_validate_framebuffer;
+#endif
+#if FEATURE_EXT_framebuffer_blit
+ radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer;
+#endif
+#if FEATURE_OES_EGL_image
+ radeon->glCtx->Driver.EGLImageTargetRenderbufferStorage =
+ radeon_image_target_renderbuffer_storage;
+#endif
+}
+
+
+void radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
+ struct radeon_bo *bo)
+{
+ struct radeon_bo *old;
+ old = rb->bo;
+ rb->bo = bo;
+ radeon_bo_ref(bo);
+ if (old)
+ radeon_bo_unref(old);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.c
index 231aa4ffcb3..bd2642b1304 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.c
@@ -1 +1,125 @@
-../radeon/radeon_fog.c \ No newline at end of file
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Austin, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/macros.h"
+
+#include "radeon_fog.h"
+
+/**********************************************************************/
+/* Fog blend factor computation for hw tcl */
+/* same calculation used as in t_vb_fog.c */
+/**********************************************************************/
+
+#define FOG_EXP_TABLE_SIZE 256
+#define FOG_MAX (10.0)
+#define EXP_FOG_MAX .0006595
+#define FOG_INCR (FOG_MAX/FOG_EXP_TABLE_SIZE)
+static GLfloat exp_table[FOG_EXP_TABLE_SIZE];
+
+#if 1
+#define NEG_EXP( result, narg ) \
+do { \
+ GLfloat f = (GLfloat) (narg * (1.0/FOG_INCR)); \
+ GLint k = (GLint) f; \
+ if (k > FOG_EXP_TABLE_SIZE-2) \
+ result = (GLfloat) EXP_FOG_MAX; \
+ else \
+ result = exp_table[k] + (f-k)*(exp_table[k+1]-exp_table[k]); \
+} while (0)
+#else
+#define NEG_EXP( result, narg ) \
+do { \
+ result = exp(-narg); \
+} while (0)
+#endif
+
+
+/**
+ * Initialize the exp_table[] lookup table for approximating exp().
+ */
+void
+radeonInitStaticFogData( void )
+{
+ GLfloat f = 0.0F;
+ GLint i = 0;
+ for ( ; i < FOG_EXP_TABLE_SIZE ; i++, f += FOG_INCR) {
+ exp_table[i] = (GLfloat) exp(-f);
+ }
+}
+
+/**
+ * Compute per-vertex fog blend factors from fog coordinates by
+ * evaluating the GL_LINEAR, GL_EXP or GL_EXP2 fog function.
+ * Fog coordinates are distances from the eye (typically between the
+ * near and far clip plane distances).
+ * Note the fog (eye Z) coords may be negative so we use ABS(z) below.
+ * Fog blend factors are in the range [0,1].
+ */
+float
+radeonComputeFogBlendFactor( struct gl_context *ctx, GLfloat fogcoord )
+{
+ GLfloat end = ctx->Fog.End;
+ GLfloat d, temp;
+ const GLfloat z = FABSF(fogcoord);
+
+ switch (ctx->Fog.Mode) {
+ case GL_LINEAR:
+ if (ctx->Fog.Start == ctx->Fog.End)
+ d = 1.0F;
+ else
+ d = 1.0F / (ctx->Fog.End - ctx->Fog.Start);
+ temp = (end - z) * d;
+ return CLAMP(temp, 0.0F, 1.0F);
+ break;
+ case GL_EXP:
+ d = ctx->Fog.Density;
+ NEG_EXP( temp, d * z );
+ return temp;
+ break;
+ case GL_EXP2:
+ d = ctx->Fog.Density*ctx->Fog.Density;
+ NEG_EXP( temp, d * z * z );
+ return temp;
+ break;
+ default:
+ _mesa_problem(ctx, "Bad fog mode in make_fog_coord");
+ return 0;
+ }
+}
+
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.h
index 76c40f621f3..0c3b8d5166b 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_fog.h
@@ -1 +1,44 @@
-../radeon/radeon_fog.h \ No newline at end of file
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ Tungsten Graphics Inc., Austin, Texas.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Keith Whitwell <keith@tungstengraphics.com>
+ */
+
+#ifndef RADEON_FOG_H
+#define RADEON_FOG_H
+
+void
+radeonInitStaticFogData( void );
+
+float
+radeonComputeFogBlendFactor( struct gl_context *ctx, GLfloat fogcoord );
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.c
index 31c0cfbe942..f4fb3a55a5d 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.c
@@ -1 +1,610 @@
-../radeon/radeon_mipmap_tree.c \ No newline at end of file
+/*
+ * Copyright (C) 2009 Maciej Cencora.
+ * Copyright (C) 2008 Nicolai Haehnle.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "radeon_mipmap_tree.h"
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "main/simple_list.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/enums.h"
+#include "radeon_texture.h"
+#include "radeon_tile.h"
+
+static unsigned get_aligned_compressed_row_stride(
+ gl_format format,
+ unsigned width,
+ unsigned minStride)
+{
+ const unsigned blockBytes = _mesa_get_format_bytes(format);
+ unsigned blockWidth, blockHeight;
+ unsigned stride;
+
+ _mesa_get_format_block_size(format, &blockWidth, &blockHeight);
+
+ /* Count number of blocks required to store the given width.
+ * And then multiple it with bytes required to store a block.
+ */
+ stride = (width + blockWidth - 1) / blockWidth * blockBytes;
+
+ /* Round the given minimum stride to the next full blocksize.
+ * (minStride + blockBytes - 1) / blockBytes * blockBytes
+ */
+ if ( stride < minStride )
+ stride = (minStride + blockBytes - 1) / blockBytes * blockBytes;
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s width %u, minStride %u, block(bytes %u, width %u):"
+ "stride %u\n",
+ __func__, width, minStride,
+ blockBytes, blockWidth,
+ stride);
+
+ return stride;
+}
+
+unsigned get_texture_image_size(
+ gl_format format,
+ unsigned rowStride,
+ unsigned height,
+ unsigned depth,
+ unsigned tiling)
+{
+ if (_mesa_is_format_compressed(format)) {
+ unsigned blockWidth, blockHeight;
+
+ _mesa_get_format_block_size(format, &blockWidth, &blockHeight);
+
+ return rowStride * ((height + blockHeight - 1) / blockHeight) * depth;
+ } else if (tiling) {
+ /* Need to align height to tile height */
+ unsigned tileWidth, tileHeight;
+
+ get_tile_size(format, &tileWidth, &tileHeight);
+ tileHeight--;
+
+ height = (height + tileHeight) & ~tileHeight;
+ }
+
+ return rowStride * height * depth;
+}
+
+unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling, GLuint target)
+{
+ if (_mesa_is_format_compressed(format)) {
+ return get_aligned_compressed_row_stride(format, width, rmesa->texture_compressed_row_align);
+ } else {
+ unsigned row_align;
+
+ if (!_mesa_is_pow_two(width) || target == GL_TEXTURE_RECTANGLE) {
+ row_align = rmesa->texture_rect_row_align - 1;
+ } else if (tiling) {
+ unsigned tileWidth, tileHeight;
+ get_tile_size(format, &tileWidth, &tileHeight);
+ row_align = tileWidth * _mesa_get_format_bytes(format) - 1;
+ } else {
+ row_align = rmesa->texture_row_align - 1;
+ }
+
+ return (_mesa_format_row_stride(format, width) + row_align) & ~row_align;
+ }
+}
+
+/**
+ * Compute sizes and fill in offset and blit information for the given
+ * image (determined by \p face and \p level).
+ *
+ * \param curOffset points to the offset at which the image is to be stored
+ * and is updated by this function according to the size of the image.
+ */
+static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree *mt,
+ GLuint face, GLuint level, GLuint* curOffset)
+{
+ radeon_mipmap_level *lvl = &mt->levels[level];
+ GLuint height;
+
+ height = _mesa_next_pow_two_32(lvl->height);
+
+ lvl->rowstride = get_texture_image_row_stride(rmesa, mt->mesaFormat, lvl->width, mt->tilebits, mt->target);
+ lvl->size = get_texture_image_size(mt->mesaFormat, lvl->rowstride, height, lvl->depth, mt->tilebits);
+
+ assert(lvl->size > 0);
+
+ lvl->faces[face].offset = *curOffset;
+ *curOffset += lvl->size;
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p) level %d, face %d: rs:%d %dx%d at %d\n",
+ __func__, rmesa,
+ level, face,
+ lvl->rowstride, lvl->width, height, lvl->faces[face].offset);
+}
+
+static GLuint minify(GLuint size, GLuint levels)
+{
+ size = size >> levels;
+ if (size < 1)
+ size = 1;
+ return size;
+}
+
+
+static void calculate_miptree_layout(radeonContextPtr rmesa, radeon_mipmap_tree *mt)
+{
+ GLuint curOffset, i, face, level;
+
+ assert(mt->numLevels <= rmesa->glCtx->Const.MaxTextureLevels);
+
+ curOffset = 0;
+ for(face = 0; face < mt->faces; face++) {
+
+ for(i = 0, level = mt->baseLevel; i < mt->numLevels; i++, level++) {
+ mt->levels[level].valid = 1;
+ mt->levels[level].width = minify(mt->width0, i);
+ mt->levels[level].height = minify(mt->height0, i);
+ mt->levels[level].depth = minify(mt->depth0, i);
+ compute_tex_image_offset(rmesa, mt, face, level, &curOffset);
+ }
+ }
+
+ /* Note the required size in memory */
+ mt->totalsize = (curOffset + RADEON_OFFSET_MASK) & ~RADEON_OFFSET_MASK;
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p, %p) total size %d\n",
+ __func__, rmesa, mt, mt->totalsize);
+}
+
+/**
+ * Create a new mipmap tree, calculate its layout and allocate memory.
+ */
+radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa,
+ GLenum target, gl_format mesaFormat, GLuint baseLevel, GLuint numLevels,
+ GLuint width0, GLuint height0, GLuint depth0, GLuint tilebits)
+{
+ radeon_mipmap_tree *mt = CALLOC_STRUCT(_radeon_mipmap_tree);
+
+ radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
+ "%s(%p) new tree is %p.\n",
+ __func__, rmesa, mt);
+
+ mt->mesaFormat = mesaFormat;
+ mt->refcount = 1;
+ mt->target = target;
+ mt->faces = _mesa_num_tex_faces(target);
+ mt->baseLevel = baseLevel;
+ mt->numLevels = numLevels;
+ mt->width0 = width0;
+ mt->height0 = height0;
+ mt->depth0 = depth0;
+ mt->tilebits = tilebits;
+
+ calculate_miptree_layout(rmesa, mt);
+
+ mt->bo = radeon_bo_open(rmesa->radeonScreen->bom,
+ 0, mt->totalsize, 1024,
+ RADEON_GEM_DOMAIN_VRAM,
+ 0);
+
+ return mt;
+}
+
+void radeon_miptree_reference(radeon_mipmap_tree *mt, radeon_mipmap_tree **ptr)
+{
+ assert(!*ptr);
+
+ mt->refcount++;
+ assert(mt->refcount > 0);
+
+ *ptr = mt;
+}
+
+void radeon_miptree_unreference(radeon_mipmap_tree **ptr)
+{
+ radeon_mipmap_tree *mt = *ptr;
+ if (!mt)
+ return;
+
+ assert(mt->refcount > 0);
+
+ mt->refcount--;
+ if (!mt->refcount) {
+ radeon_bo_unref(mt->bo);
+ free(mt);
+ }
+
+ *ptr = 0;
+}
+
+/**
+ * Calculate min and max LOD for the given texture object.
+ * @param[in] tObj texture object whose LOD values to calculate
+ * @param[out] pminLod minimal LOD
+ * @param[out] pmaxLod maximal LOD
+ */
+static void calculate_min_max_lod(struct gl_sampler_object *samp, struct gl_texture_object *tObj,
+ unsigned *pminLod, unsigned *pmaxLod)
+{
+ int minLod, maxLod;
+ /* Yes, this looks overly complicated, but it's all needed.
+ */
+ switch (tObj->Target) {
+ case GL_TEXTURE_1D:
+ case GL_TEXTURE_2D:
+ case GL_TEXTURE_3D:
+ case GL_TEXTURE_CUBE_MAP:
+ if (samp->MinFilter == GL_NEAREST || samp->MinFilter == GL_LINEAR) {
+ /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL.
+ */
+ minLod = maxLod = tObj->BaseLevel;
+ } else {
+ minLod = tObj->BaseLevel + (GLint)(samp->MinLod);
+ minLod = MAX2(minLod, tObj->BaseLevel);
+ minLod = MIN2(minLod, tObj->MaxLevel);
+ maxLod = tObj->BaseLevel + (GLint)(samp->MaxLod + 0.5);
+ maxLod = MIN2(maxLod, tObj->MaxLevel);
+ maxLod = MIN2(maxLod, tObj->Image[0][minLod]->MaxNumLevels - 1 + minLod);
+ maxLod = MAX2(maxLod, minLod); /* need at least one level */
+ }
+ break;
+ case GL_TEXTURE_RECTANGLE_NV:
+ case GL_TEXTURE_4D_SGIS:
+ minLod = maxLod = 0;
+ break;
+ default:
+ return;
+ }
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s(%p) target %s, min %d, max %d.\n",
+ __func__, tObj,
+ _mesa_lookup_enum_by_nr(tObj->Target),
+ minLod, maxLod);
+
+ /* save these values */
+ *pminLod = minLod;
+ *pmaxLod = maxLod;
+}
+
+/**
+ * Checks whether the given miptree can hold the given texture image at the
+ * given face and level.
+ */
+GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt,
+ struct gl_texture_image *texImage)
+{
+ radeon_mipmap_level *lvl;
+ GLuint level = texImage->Level;
+ if (texImage->TexFormat != mt->mesaFormat)
+ return GL_FALSE;
+
+ lvl = &mt->levels[level];
+ if (!lvl->valid ||
+ lvl->width != texImage->Width ||
+ lvl->height != texImage->Height ||
+ lvl->depth != texImage->Depth)
+ return GL_FALSE;
+
+ return GL_TRUE;
+}
+
+/**
+ * Checks whether the given miptree has the right format to store the given texture object.
+ */
+static GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_texture_object *texObj)
+{
+ struct gl_texture_image *firstImage;
+ unsigned numLevels;
+ radeon_mipmap_level *mtBaseLevel;
+
+ if (texObj->BaseLevel < mt->baseLevel)
+ return GL_FALSE;
+
+ mtBaseLevel = &mt->levels[texObj->BaseLevel - mt->baseLevel];
+ firstImage = texObj->Image[0][texObj->BaseLevel];
+ numLevels = MIN2(texObj->_MaxLevel - texObj->BaseLevel + 1, firstImage->MaxNumLevels);
+
+ if (radeon_is_debug_enabled(RADEON_TEXTURE,RADEON_TRACE)) {
+ fprintf(stderr, "Checking if miptree %p matches texObj %p\n", mt, texObj);
+ fprintf(stderr, "target %d vs %d\n", mt->target, texObj->Target);
+ fprintf(stderr, "format %d vs %d\n", mt->mesaFormat, firstImage->TexFormat);
+ fprintf(stderr, "numLevels %d vs %d\n", mt->numLevels, numLevels);
+ fprintf(stderr, "width0 %d vs %d\n", mtBaseLevel->width, firstImage->Width);
+ fprintf(stderr, "height0 %d vs %d\n", mtBaseLevel->height, firstImage->Height);
+ fprintf(stderr, "depth0 %d vs %d\n", mtBaseLevel->depth, firstImage->Depth);
+ if (mt->target == texObj->Target &&
+ mt->mesaFormat == firstImage->TexFormat &&
+ mt->numLevels >= numLevels &&
+ mtBaseLevel->width == firstImage->Width &&
+ mtBaseLevel->height == firstImage->Height &&
+ mtBaseLevel->depth == firstImage->Depth) {
+ fprintf(stderr, "MATCHED\n");
+ } else {
+ fprintf(stderr, "NOT MATCHED\n");
+ }
+ }
+
+ return (mt->target == texObj->Target &&
+ mt->mesaFormat == firstImage->TexFormat &&
+ mt->numLevels >= numLevels &&
+ mtBaseLevel->width == firstImage->Width &&
+ mtBaseLevel->height == firstImage->Height &&
+ mtBaseLevel->depth == firstImage->Depth);
+}
+
+/**
+ * Try to allocate a mipmap tree for the given texture object.
+ * @param[in] rmesa radeon context
+ * @param[in] t radeon texture object
+ */
+void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t)
+{
+ struct gl_texture_object *texObj = &t->base;
+ struct gl_texture_image *texImg = texObj->Image[0][texObj->BaseLevel];
+ GLuint numLevels;
+ assert(!t->mt);
+
+ if (!texImg) {
+ radeon_warning("%s(%p) No image in given texture object(%p).\n",
+ __func__, rmesa, t);
+ return;
+ }
+
+
+ numLevels = MIN2(texObj->MaxLevel - texObj->BaseLevel + 1, texImg->MaxNumLevels);
+
+ t->mt = radeon_miptree_create(rmesa, t->base.Target,
+ texImg->TexFormat, texObj->BaseLevel,
+ numLevels, texImg->Width, texImg->Height,
+ texImg->Depth, t->tile_bits);
+}
+
+GLuint
+radeon_miptree_image_offset(radeon_mipmap_tree *mt,
+ GLuint face, GLuint level)
+{
+ if (mt->target == GL_TEXTURE_CUBE_MAP_ARB)
+ return (mt->levels[level].faces[face].offset);
+ else
+ return mt->levels[level].faces[0].offset;
+}
+
+/**
+ * Ensure that the given image is stored in the given miptree from now on.
+ */
+static void migrate_image_to_miptree(radeon_mipmap_tree *mt,
+ radeon_texture_image *image,
+ int face, int level)
+{
+ radeon_mipmap_level *dstlvl = &mt->levels[level];
+ unsigned char *dest;
+
+ assert(image->mt != mt);
+ assert(dstlvl->valid);
+ assert(dstlvl->width == image->base.Base.Width);
+ assert(dstlvl->height == image->base.Base.Height);
+ assert(dstlvl->depth == image->base.Base.Depth);
+
+ radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+ "%s miptree %p, image %p, face %d, level %d.\n",
+ __func__, mt, image, face, level);
+
+ radeon_bo_map(mt->bo, GL_TRUE);
+ dest = mt->bo->ptr + dstlvl->faces[face].offset;
+
+ if (image->mt) {
+ /* Format etc. should match, so we really just need a memcpy().
+ * In fact, that memcpy() could be done by the hardware in many
+ * cases, provided that we have a proper memory manager.
+ */
+ assert(mt->mesaFormat == image->base.Base.TexFormat);
+
+ radeon_mipmap_level *srclvl = &image->mt->levels[image->base.Base.Level];
+
+ assert(image->base.Base.Level == level);
+ assert(srclvl->size == dstlvl->size);
+ assert(srclvl->rowstride == dstlvl->rowstride);
+
+ radeon_bo_map(image->mt->bo, GL_FALSE);
+
+ memcpy(dest,
+ image->mt->bo->ptr + srclvl->faces[face].offset,
+ dstlvl->size);
+ radeon_bo_unmap(image->mt->bo);
+
+ radeon_miptree_unreference(&image->mt);
+ } else if (image->base.Map) {
+ /* This condition should be removed, it's here to workaround
+ * a segfault when mapping textures during software fallbacks.
+ */
+ radeon_print(RADEON_FALLBACKS, RADEON_IMPORTANT,
+ "%s Trying to map texture in software fallback.\n",
+ __func__);
+ const uint32_t srcrowstride = _mesa_format_row_stride(image->base.Base.TexFormat, image->base.Base.Width);
+ uint32_t rows = image->base.Base.Height * image->base.Base.Depth;
+
+ if (_mesa_is_format_compressed(image->base.Base.TexFormat)) {
+ uint32_t blockWidth, blockHeight;
+ _mesa_get_format_block_size(image->base.Base.TexFormat, &blockWidth, &blockHeight);
+ rows = (rows + blockHeight - 1) / blockHeight;
+ }
+
+ copy_rows(dest, dstlvl->rowstride, image->base.Map, srcrowstride,
+ rows, srcrowstride);
+
+ _mesa_align_free(image->base.Map);
+ image->base.Map = 0;
+ }
+
+ radeon_bo_unmap(mt->bo);
+
+ radeon_miptree_reference(mt, &image->mt);
+}
+
+/**
+ * Filter matching miptrees, and select one with the most of data.
+ * @param[in] texObj radeon texture object
+ * @param[in] firstLevel first texture level to check
+ * @param[in] lastLevel last texture level to check
+ */
+static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj,
+ unsigned firstLevel,
+ unsigned lastLevel)
+{
+ const unsigned numLevels = lastLevel - firstLevel + 1;
+ unsigned *mtSizes = calloc(numLevels, sizeof(unsigned));
+ radeon_mipmap_tree **mts = calloc(numLevels, sizeof(radeon_mipmap_tree *));
+ unsigned mtCount = 0;
+ unsigned maxMtIndex = 0;
+ radeon_mipmap_tree *tmp;
+ unsigned int level;
+ int i;
+
+ for (level = firstLevel; level <= lastLevel; ++level) {
+ radeon_texture_image *img = get_radeon_texture_image(texObj->base.Image[0][level]);
+ unsigned found = 0;
+ // TODO: why this hack??
+ if (!img)
+ break;
+
+ if (!img->mt)
+ continue;
+
+ for (i = 0; i < mtCount; ++i) {
+ if (mts[i] == img->mt) {
+ found = 1;
+ mtSizes[i] += img->mt->levels[img->base.Base.Level].size;
+ break;
+ }
+ }
+
+ if (!found && radeon_miptree_matches_texture(img->mt, &texObj->base)) {
+ mtSizes[mtCount] = img->mt->levels[img->base.Base.Level].size;
+ mts[mtCount] = img->mt;
+ mtCount++;
+ }
+ }
+
+ if (mtCount == 0) {
+ free(mtSizes);
+ free(mts);
+ return NULL;
+ }
+
+ for (i = 1; i < mtCount; ++i) {
+ if (mtSizes[i] > mtSizes[maxMtIndex]) {
+ maxMtIndex = i;
+ }
+ }
+
+ tmp = mts[maxMtIndex];
+ free(mtSizes);
+ free(mts);
+
+ return tmp;
+}
+
+/**
+ * Validate texture mipmap tree.
+ * If individual images are stored in different mipmap trees
+ * use the mipmap tree that has the most of the correct data.
+ */
+int radeon_validate_texture_miptree(struct gl_context * ctx,
+ struct gl_sampler_object *samp,
+ struct gl_texture_object *texObj)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ radeonTexObj *t = radeon_tex_obj(texObj);
+ radeon_mipmap_tree *dst_miptree;
+
+ if (samp == &texObj->Sampler && (t->validated || t->image_override)) {
+ return GL_TRUE;
+ }
+
+ calculate_min_max_lod(samp, &t->base, &t->minLod, &t->maxLod);
+
+ radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
+ "%s: Validating texture %p now, minLod = %d, maxLod = %d\n",
+ __FUNCTION__, texObj ,t->minLod, t->maxLod);
+
+ dst_miptree = get_biggest_matching_miptree(t, t->base.BaseLevel, t->base._MaxLevel);
+
+ radeon_miptree_unreference(&t->mt);
+ if (!dst_miptree) {
+ radeon_try_alloc_miptree(rmesa, t);
+ radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
+ "%s: No matching miptree found, allocated new one %p\n",
+ __FUNCTION__, t->mt);
+
+ } else {
+ radeon_miptree_reference(dst_miptree, &t->mt);
+ radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
+ "%s: Using miptree %p\n", __FUNCTION__, t->mt);
+ }
+
+ const unsigned faces = _mesa_num_tex_faces(texObj->Target);
+ unsigned face, level;
+ radeon_texture_image *img;
+ /* Validate only the levels that will actually be used during rendering */
+ for (face = 0; face < faces; ++face) {
+ for (level = t->minLod; level <= t->maxLod; ++level) {
+ img = get_radeon_texture_image(texObj->Image[face][level]);
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "Checking image level %d, face %d, mt %p ... ",
+ level, face, img->mt);
+
+ if (img->mt != t->mt && !img->used_as_render_target) {
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "MIGRATING\n");
+
+ struct radeon_bo *src_bo = (img->mt) ? img->mt->bo : img->bo;
+ if (src_bo && radeon_bo_is_referenced_by_cs(src_bo, rmesa->cmdbuf.cs)) {
+ radeon_firevertices(rmesa);
+ }
+ migrate_image_to_miptree(t->mt, img, face, level);
+ } else
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE, "OK\n");
+ }
+ }
+
+ t->validated = GL_TRUE;
+
+ return GL_TRUE;
+}
+
+uint32_t get_base_teximage_offset(radeonTexObj *texObj)
+{
+ if (!texObj->mt) {
+ return 0;
+ } else {
+ return radeon_miptree_image_offset(texObj->mt, 0, texObj->minLod);
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.h
index 254d50cf8c5..74007ffdebc 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_mipmap_tree.h
@@ -1 +1,106 @@
-../radeon/radeon_mipmap_tree.h \ No newline at end of file
+/*
+ * Copyright (C) 2008 Nicolai Haehnle.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __RADEON_MIPMAP_TREE_H_
+#define __RADEON_MIPMAP_TREE_H_
+
+#include "radeon_common.h"
+
+typedef struct _radeon_mipmap_tree radeon_mipmap_tree;
+typedef struct _radeon_mipmap_level radeon_mipmap_level;
+typedef struct _radeon_mipmap_image radeon_mipmap_image;
+
+struct _radeon_mipmap_image {
+ GLuint offset; /** Offset of this image from the start of mipmap tree buffer, in bytes */
+};
+
+struct _radeon_mipmap_level {
+ GLuint width;
+ GLuint height;
+ GLuint depth;
+ GLuint size; /** Size of each image, in bytes */
+ GLuint rowstride; /** in bytes */
+ GLuint valid;
+ radeon_mipmap_image faces[6];
+};
+
+/* store the max possible in the miptree */
+#define RADEON_MIPTREE_MAX_TEXTURE_LEVELS 15
+
+/**
+ * A mipmap tree contains texture images in the layout that the hardware
+ * expects.
+ *
+ * The meta-data of mipmap trees is immutable, i.e. you cannot change the
+ * layout on-the-fly; however, the texture contents (i.e. texels) can be
+ * changed.
+ */
+struct _radeon_mipmap_tree {
+ struct radeon_bo *bo;
+ GLuint refcount;
+
+ GLuint totalsize; /** total size of the miptree, in bytes */
+
+ GLenum target; /** GL_TEXTURE_xxx */
+ GLenum mesaFormat; /** MESA_FORMAT_xxx */
+ GLuint faces; /** # of faces: 6 for cubemaps, 1 otherwise */
+ GLuint baseLevel; /** gl_texture_object->baseLevel it was created for */
+ GLuint numLevels; /** Number of mip levels stored in this mipmap tree */
+
+ GLuint width0; /** Width of baseLevel image */
+ GLuint height0; /** Height of baseLevel image */
+ GLuint depth0; /** Depth of baseLevel image */
+
+ GLuint tilebits; /** RADEON_TXO_xxx_TILE */
+
+ radeon_mipmap_level levels[RADEON_MIPTREE_MAX_TEXTURE_LEVELS];
+};
+
+void radeon_miptree_reference(radeon_mipmap_tree *mt, radeon_mipmap_tree **ptr);
+void radeon_miptree_unreference(radeon_mipmap_tree **ptr);
+
+GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt,
+ struct gl_texture_image *texImage);
+
+void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t);
+GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt,
+ GLuint face, GLuint level);
+uint32_t get_base_teximage_offset(radeonTexObj *texObj);
+
+unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling, unsigned target);
+
+unsigned get_texture_image_size(
+ gl_format format,
+ unsigned rowStride,
+ unsigned height,
+ unsigned depth,
+ unsigned tiling);
+
+radeon_mipmap_tree *radeon_miptree_create(radeonContextPtr rmesa,
+ GLenum target, gl_format mesaFormat, GLuint baseLevel, GLuint numLevels,
+ GLuint width0, GLuint height0, GLuint depth0, GLuint tilebits);
+#endif /* __RADEON_MIPMAP_TREE_H_ */
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_pixel_read.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_pixel_read.c
index 3b03803126f..db5e01da49b 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_pixel_read.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_pixel_read.c
@@ -1 +1,221 @@
-../radeon/radeon_pixel_read.c \ No newline at end of file
+/*
+ * Copyright (C) 2010 Maciej Cencora <m.cencora@gmail.com>
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "stdint.h"
+#include "main/bufferobj.h"
+#include "main/enums.h"
+#include "main/fbobject.h"
+#include "main/image.h"
+#include "main/readpix.h"
+#include "main/state.h"
+
+#include "radeon_buffer_objects.h"
+#include "radeon_common_context.h"
+#include "radeon_debug.h"
+#include "radeon_mipmap_tree.h"
+
+static gl_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
+{
+ switch (format)
+ {
+ case GL_RGB:
+ switch (type) {
+ case GL_UNSIGNED_SHORT_5_6_5:
+ return MESA_FORMAT_RGB565;
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ return MESA_FORMAT_RGB565_REV;
+ }
+ break;
+ case GL_RGBA:
+ switch (type) {
+ case GL_FLOAT:
+ return MESA_FORMAT_RGBA_FLOAT32;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ return MESA_FORMAT_RGBA5551;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ return MESA_FORMAT_RGBA8888;
+ case GL_UNSIGNED_BYTE:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ return MESA_FORMAT_RGBA8888_REV;
+ }
+ break;
+ case GL_BGRA:
+ switch (type) {
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ return MESA_FORMAT_ARGB4444_REV;
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ return MESA_FORMAT_ARGB4444;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ return MESA_FORMAT_ARGB1555_REV;
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ return MESA_FORMAT_ARGB1555;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ return MESA_FORMAT_ARGB8888_REV;
+ case GL_UNSIGNED_BYTE:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ return MESA_FORMAT_ARGB8888;
+
+ }
+ break;
+ }
+
+ return MESA_FORMAT_NONE;
+}
+
+static GLboolean
+do_blit_readpixels(struct gl_context * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ const struct radeon_renderbuffer *rrb = radeon_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
+ const gl_format dst_format = gl_format_and_type_to_mesa_format(format, type);
+ unsigned dst_rowstride, dst_imagesize, aligned_rowstride, flip_y;
+ struct radeon_bo *dst_buffer;
+ GLint dst_x = 0, dst_y = 0;
+ intptr_t dst_offset;
+
+ /* It's not worth if number of pixels to copy is really small */
+ if (width * height < 100) {
+ return GL_FALSE;
+ }
+
+ if (dst_format == MESA_FORMAT_NONE ||
+ !radeon->vtbl.check_blit(dst_format, rrb->pitch / rrb->cpp) || !radeon->vtbl.blit) {
+ return GL_FALSE;
+ }
+
+ if (ctx->_ImageTransferState || ctx->Color.ColorLogicOpEnabled) {
+ return GL_FALSE;
+ }
+
+ if (pack->SwapBytes || pack->LsbFirst) {
+ return GL_FALSE;
+ }
+
+ if (pack->RowLength > 0) {
+ dst_rowstride = pack->RowLength;
+ } else {
+ dst_rowstride = width;
+ }
+
+ if (!_mesa_clip_copytexsubimage(ctx, &dst_x, &dst_y, &x, &y, &width, &height)) {
+ return GL_TRUE;
+ }
+ assert(x >= 0 && y >= 0);
+
+ aligned_rowstride = get_texture_image_row_stride(radeon, dst_format, dst_rowstride, 0, GL_TEXTURE_2D);
+ dst_rowstride *= _mesa_get_format_bytes(dst_format);
+ if (_mesa_is_bufferobj(pack->BufferObj) && aligned_rowstride != dst_rowstride)
+ return GL_FALSE;
+ dst_imagesize = get_texture_image_size(dst_format,
+ aligned_rowstride,
+ height, 1, 0);
+
+ if (!_mesa_is_bufferobj(pack->BufferObj))
+ {
+ dst_buffer = radeon_bo_open(radeon->radeonScreen->bom, 0, dst_imagesize, 1024, RADEON_GEM_DOMAIN_GTT, 0);
+ dst_offset = 0;
+ }
+ else
+ {
+ dst_buffer = get_radeon_buffer_object(pack->BufferObj)->bo;
+ dst_offset = (intptr_t)pixels;
+ }
+
+ /* Disable source Y flipping for FBOs */
+ flip_y = _mesa_is_winsys_fbo(ctx->ReadBuffer);
+ if (pack->Invert) {
+ y = rrb->base.Base.Height - height - y;
+ flip_y = !flip_y;
+ }
+
+ if (radeon->vtbl.blit(ctx,
+ rrb->bo,
+ rrb->draw_offset,
+ rrb->base.Base.Format,
+ rrb->pitch / rrb->cpp,
+ rrb->base.Base.Width,
+ rrb->base.Base.Height,
+ x,
+ y,
+ dst_buffer,
+ dst_offset,
+ dst_format,
+ aligned_rowstride / _mesa_get_format_bytes(dst_format),
+ width,
+ height,
+ 0, /* dst_x */
+ 0, /* dst_y */
+ width,
+ height,
+ flip_y))
+ {
+ if (!_mesa_is_bufferobj(pack->BufferObj))
+ {
+ radeon_bo_map(dst_buffer, 0);
+ copy_rows(pixels, dst_rowstride, dst_buffer->ptr,
+ aligned_rowstride, height, dst_rowstride);
+ radeon_bo_unmap(dst_buffer);
+ radeon_bo_unref(dst_buffer);
+ }
+
+ return GL_TRUE;
+ }
+
+ if (!_mesa_is_bufferobj(pack->BufferObj))
+ radeon_bo_unref(dst_buffer);
+
+ return GL_FALSE;
+}
+
+void
+radeonReadPixels(struct gl_context * ctx,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const struct gl_pixelstore_attrib *pack, GLvoid * pixels)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ radeon_prepare_render(radeon);
+
+ if (do_blit_readpixels(ctx, x, y, width, height, format, type, pack, pixels))
+ return;
+
+ /* Update Mesa state before calling _mesa_readpixels().
+ * XXX this may not be needed since ReadPixels no longer uses the
+ * span code.
+ */
+ radeon_print(RADEON_FALLBACKS, RADEON_NORMAL,
+ "Falling back to sw for ReadPixels (format %s, type %s)\n",
+ _mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type));
+
+ if (ctx->NewState)
+ _mesa_update_state(ctx);
+
+ _mesa_readpixels(ctx, x, y, width, height, format, type, pack, pixels);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.c
index 1d6ebc1c48b..5c02f5c2ed0 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.c
@@ -1 +1,217 @@
-../radeon/radeon_queryobj.c \ No newline at end of file
+/*
+ * Copyright © 2008-2009 Maciej Cencora <m.cencora@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Maciej Cencora <m.cencora@gmail.com>
+ *
+ */
+#include "radeon_common.h"
+#include "radeon_queryobj.h"
+#include "radeon_debug.h"
+
+#include "main/imports.h"
+#include "main/simple_list.h"
+
+#include <inttypes.h>
+
+static void radeonQueryGetResult(struct gl_context *ctx, struct gl_query_object *q)
+{
+ struct radeon_query_object *query = (struct radeon_query_object *)q;
+ uint32_t *result;
+ int i;
+
+ radeon_print(RADEON_STATE, RADEON_VERBOSE,
+ "%s: query id %d, result %d\n",
+ __FUNCTION__, query->Base.Id, (int) query->Base.Result);
+
+ radeon_bo_map(query->bo, GL_FALSE);
+ result = query->bo->ptr;
+
+ query->Base.Result = 0;
+ for (i = 0; i < query->curr_offset/sizeof(uint32_t); ++i) {
+ query->Base.Result += LE32_TO_CPU(result[i]);
+ radeon_print(RADEON_STATE, RADEON_TRACE, "result[%d] = %d\n", i, LE32_TO_CPU(result[i]));
+ }
+
+ radeon_bo_unmap(query->bo);
+}
+
+static struct gl_query_object * radeonNewQueryObject(struct gl_context *ctx, GLuint id)
+{
+ struct radeon_query_object *query;
+
+ query = calloc(1, sizeof(struct radeon_query_object));
+
+ query->Base.Id = id;
+ query->Base.Result = 0;
+ query->Base.Active = GL_FALSE;
+ query->Base.Ready = GL_TRUE;
+
+ radeon_print(RADEON_STATE, RADEON_VERBOSE,"%s: query id %d\n", __FUNCTION__, query->Base.Id);
+
+ return &query->Base;
+}
+
+static void radeonDeleteQuery(struct gl_context *ctx, struct gl_query_object *q)
+{
+ struct radeon_query_object *query = (struct radeon_query_object *)q;
+
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s: query id %d\n", __FUNCTION__, q->Id);
+
+ if (query->bo) {
+ radeon_bo_unref(query->bo);
+ }
+
+ free(query);
+}
+
+static void radeonWaitQuery(struct gl_context *ctx, struct gl_query_object *q)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct radeon_query_object *query = (struct radeon_query_object *)q;
+
+ /* If the cmdbuf with packets for this query hasn't been flushed yet, do it now */
+ if (radeon_bo_is_referenced_by_cs(query->bo, radeon->cmdbuf.cs))
+ ctx->Driver.Flush(ctx);
+
+ radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s: query id %d, bo %p, offset %d\n", __FUNCTION__, q->Id, query->bo, query->curr_offset);
+
+ radeonQueryGetResult(ctx, q);
+
+ query->Base.Ready = GL_TRUE;
+}
+
+
+static void radeonBeginQuery(struct gl_context *ctx, struct gl_query_object *q)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct radeon_query_object *query = (struct radeon_query_object *)q;
+
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s: query id %d\n", __FUNCTION__, q->Id);
+
+ assert(radeon->query.current == NULL);
+
+ if (radeon->dma.flush)
+ radeon->dma.flush(radeon->glCtx);
+
+ if (!query->bo) {
+ query->bo = radeon_bo_open(radeon->radeonScreen->bom, 0, RADEON_QUERY_PAGE_SIZE, RADEON_QUERY_PAGE_SIZE, RADEON_GEM_DOMAIN_GTT, 0);
+ }
+ query->curr_offset = 0;
+
+ radeon->query.current = query;
+
+ radeon->query.queryobj.dirty = GL_TRUE;
+ radeon->hw.is_dirty = GL_TRUE;
+}
+
+void radeonEmitQueryEnd(struct gl_context *ctx)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct radeon_query_object *query = radeon->query.current;
+
+ if (!query)
+ return;
+
+ if (query->emitted_begin == GL_FALSE)
+ return;
+
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s: query id %d, bo %p, offset %d\n", __FUNCTION__, query->Base.Id, query->bo, query->curr_offset);
+
+ radeon_cs_space_check_with_bo(radeon->cmdbuf.cs,
+ query->bo,
+ 0, RADEON_GEM_DOMAIN_GTT);
+
+ radeon->vtbl.emit_query_finish(radeon);
+}
+
+static void radeonEndQuery(struct gl_context *ctx, struct gl_query_object *q)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+
+ radeon_print(RADEON_STATE, RADEON_NORMAL, "%s: query id %d\n", __FUNCTION__, q->Id);
+
+ if (radeon->dma.flush)
+ radeon->dma.flush(radeon->glCtx);
+ radeonEmitQueryEnd(ctx);
+
+ radeon->query.current = NULL;
+}
+
+static void radeonCheckQuery(struct gl_context *ctx, struct gl_query_object *q)
+{
+ radeon_print(RADEON_STATE, RADEON_TRACE, "%s: query id %d\n", __FUNCTION__, q->Id);
+\
+#ifdef DRM_RADEON_GEM_BUSY
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+
+ struct radeon_query_object *query = (struct radeon_query_object *)q;
+ uint32_t domain;
+
+ /* Need to perform a flush, as per ARB_occlusion_query spec */
+ if (radeon_bo_is_referenced_by_cs(query->bo, radeon->cmdbuf.cs)) {
+ ctx->Driver.Flush(ctx);
+ }
+
+ if (radeon_bo_is_busy(query->bo, &domain) == 0) {
+ radeonQueryGetResult(ctx, q);
+ query->Base.Ready = GL_TRUE;
+ }
+#else
+ radeonWaitQuery(ctx, q);
+#endif
+}
+
+void radeonInitQueryObjFunctions(struct dd_function_table *functions)
+{
+ functions->NewQueryObject = radeonNewQueryObject;
+ functions->DeleteQuery = radeonDeleteQuery;
+ functions->BeginQuery = radeonBeginQuery;
+ functions->EndQuery = radeonEndQuery;
+ functions->CheckQuery = radeonCheckQuery;
+ functions->WaitQuery = radeonWaitQuery;
+}
+
+int radeon_check_query_active(struct gl_context *ctx, struct radeon_state_atom *atom)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ struct radeon_query_object *query = radeon->query.current;
+
+ if (!query || query->emitted_begin)
+ return 0;
+ return atom->cmd_size;
+}
+
+void radeon_emit_queryobj(struct gl_context *ctx, struct radeon_state_atom *atom)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ BATCH_LOCALS(radeon);
+ int dwords;
+
+ dwords = (*atom->check) (ctx, atom);
+
+ BEGIN_BATCH_NO_AUTOSTATE(dwords);
+ OUT_BATCH_TABLE(atom->cmd, dwords);
+ END_BATCH();
+
+ radeon->query.current->emitted_begin = GL_TRUE;
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.h
index 8f6f842b0a6..e5063934824 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_queryobj.h
@@ -1 +1,55 @@
-../radeon/radeon_queryobj.h \ No newline at end of file
+/*
+ * Copyright © 2008 Maciej Cencora <m.cencora@gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ * Maciej Cencora <m.cencora@gmail.com>
+ *
+ */
+
+#include "main/imports.h"
+#include "main/simple_list.h"
+#include "radeon_common_context.h"
+
+extern void radeonEmitQueryBegin(struct gl_context *ctx);
+extern void radeonEmitQueryEnd(struct gl_context *ctx);
+
+extern void radeonInitQueryObjFunctions(struct dd_function_table *functions);
+
+#define RADEON_QUERY_PAGE_SIZE 4096
+
+int radeon_check_query_active(struct gl_context *ctx, struct radeon_state_atom *atom);
+void radeon_emit_queryobj(struct gl_context *ctx, struct radeon_state_atom *atom);
+
+static inline void radeon_init_query_stateobj(radeonContextPtr radeon, int SZ)
+{
+ radeon->query.queryobj.cmd_size = (SZ);
+ radeon->query.queryobj.cmd = (uint32_t*)CALLOC((SZ) * sizeof(uint32_t));
+ radeon->query.queryobj.name = "queryobj";
+ radeon->query.queryobj.idx = 0;
+ radeon->query.queryobj.check = radeon_check_query_active;
+ radeon->query.queryobj.dirty = GL_FALSE;
+ radeon->query.queryobj.emit = radeon_emit_queryobj;
+
+ radeon->hw.max_state_size += (SZ);
+ insert_at_tail(&radeon->hw.atomlist, &radeon->query.queryobj);
+}
+
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.c
index 86161118dd3..27b57c5a3ea 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.c
@@ -1 +1,796 @@
-../radeon/radeon_screen.c \ No newline at end of file
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ VA Linux Systems Inc., Fremont, California.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/**
+ * \file radeon_screen.c
+ * Screen initialization functions for the Radeon driver.
+ *
+ * \author Kevin E. Martin <martin@valinux.com>
+ * \author Gareth Hughes <gareth@valinux.com>
+ */
+
+#include <errno.h>
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/fbobject.h"
+#include "swrast/s_renderbuffer.h"
+
+#define STANDALONE_MMIO
+#include "radeon_chipset.h"
+#include "radeon_macros.h"
+#include "radeon_screen.h"
+#include "radeon_common.h"
+#include "radeon_common_context.h"
+#if defined(RADEON_R100)
+#include "radeon_context.h"
+#include "radeon_tex.h"
+#elif defined(RADEON_R200)
+#include "r200_context.h"
+#include "r200_tex.h"
+#endif
+
+#include "utils.h"
+
+#include "GL/internal/dri_interface.h"
+
+/* Radeon configuration
+ */
+#include "xmlpool.h"
+
+#define DRI_CONF_COMMAND_BUFFER_SIZE(def,min,max) \
+DRI_CONF_OPT_BEGIN_V(command_buffer_size,int,def, # min ":" # max ) \
+ DRI_CONF_DESC(en,"Size of command buffer (in KB)") \
+ DRI_CONF_DESC(de,"Grösse des Befehlspuffers (in KB)") \
+DRI_CONF_OPT_END
+
+#if defined(RADEON_R100) /* R100 */
+PUBLIC const char __driConfigOptions[] =
+DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN)
+ DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
+ DRI_CONF_MAX_TEXTURE_UNITS(3,2,3)
+ DRI_CONF_HYPERZ(false)
+ DRI_CONF_COMMAND_BUFFER_SIZE(8, 8, 32)
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_QUALITY
+ DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
+ DRI_CONF_DEF_MAX_ANISOTROPY(1.0,"1.0,2.0,4.0,8.0,16.0")
+ DRI_CONF_NO_NEG_LOD_BIAS(false)
+ DRI_CONF_FORCE_S3TC_ENABLE(false)
+ DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
+ DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
+ DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
+ DRI_CONF_ALLOW_LARGE_TEXTURES(2)
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_NO_RAST(false)
+ DRI_CONF_SECTION_END
+DRI_CONF_END;
+static const GLuint __driNConfigOptions = 15;
+
+#elif defined(RADEON_R200)
+
+PUBLIC const char __driConfigOptions[] =
+DRI_CONF_BEGIN
+ DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_TCL_MODE(DRI_CONF_TCL_CODEGEN)
+ DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
+ DRI_CONF_MAX_TEXTURE_UNITS(6,2,6)
+ DRI_CONF_HYPERZ(false)
+ DRI_CONF_COMMAND_BUFFER_SIZE(8, 8, 32)
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_QUALITY
+ DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
+ DRI_CONF_DEF_MAX_ANISOTROPY(1.0,"1.0,2.0,4.0,8.0,16.0")
+ DRI_CONF_NO_NEG_LOD_BIAS(false)
+ DRI_CONF_FORCE_S3TC_ENABLE(false)
+ DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
+ DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
+ DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
+ DRI_CONF_ALLOW_LARGE_TEXTURES(2)
+ DRI_CONF_TEXTURE_BLEND_QUALITY(1.0,"0.0:1.0")
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_DEBUG
+ DRI_CONF_NO_RAST(false)
+ DRI_CONF_SECTION_END
+ DRI_CONF_SECTION_SOFTWARE
+ DRI_CONF_NV_VERTEX_PROGRAM(false)
+ DRI_CONF_SECTION_END
+DRI_CONF_END;
+static const GLuint __driNConfigOptions = 17;
+
+#endif
+
+#ifndef RADEON_INFO_TILE_CONFIG
+#define RADEON_INFO_TILE_CONFIG 0x6
+#endif
+
+static int
+radeonGetParam(__DRIscreen *sPriv, int param, void *value)
+{
+ int ret;
+ drm_radeon_getparam_t gp = { 0 };
+ struct drm_radeon_info info = { 0 };
+
+ if (sPriv->drm_version.major >= 2) {
+ info.value = (uint64_t)(uintptr_t)value;
+ switch (param) {
+ case RADEON_PARAM_DEVICE_ID:
+ info.request = RADEON_INFO_DEVICE_ID;
+ break;
+ case RADEON_PARAM_NUM_GB_PIPES:
+ info.request = RADEON_INFO_NUM_GB_PIPES;
+ break;
+ case RADEON_PARAM_NUM_Z_PIPES:
+ info.request = RADEON_INFO_NUM_Z_PIPES;
+ break;
+ case RADEON_INFO_TILE_CONFIG:
+ info.request = RADEON_INFO_TILE_CONFIG;
+ break;
+ default:
+ return -EINVAL;
+ }
+ ret = drmCommandWriteRead(sPriv->fd, DRM_RADEON_INFO, &info, sizeof(info));
+ } else {
+ gp.param = param;
+ gp.value = value;
+
+ ret = drmCommandWriteRead(sPriv->fd, DRM_RADEON_GETPARAM, &gp, sizeof(gp));
+ }
+ return ret;
+}
+
+#if defined(RADEON_R100)
+static const __DRItexBufferExtension radeonTexBufferExtension = {
+ { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
+ radeonSetTexBuffer,
+ radeonSetTexBuffer2,
+};
+#elif defined(RADEON_R200)
+static const __DRItexBufferExtension r200TexBufferExtension = {
+ { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
+ r200SetTexBuffer,
+ r200SetTexBuffer2,
+};
+#endif
+
+static void
+radeonDRI2Flush(__DRIdrawable *drawable)
+{
+ radeonContextPtr rmesa;
+
+ rmesa = (radeonContextPtr) drawable->driContextPriv->driverPrivate;
+ radeonFlush(rmesa->glCtx);
+}
+
+static const struct __DRI2flushExtensionRec radeonFlushExtension = {
+ { __DRI2_FLUSH, __DRI2_FLUSH_VERSION },
+ radeonDRI2Flush,
+ dri2InvalidateDrawable,
+};
+
+static __DRIimage *
+radeon_create_image_from_name(__DRIscreen *screen,
+ int width, int height, int format,
+ int name, int pitch, void *loaderPrivate)
+{
+ __DRIimage *image;
+ radeonScreenPtr radeonScreen = screen->driverPrivate;
+
+ if (name == 0)
+ return NULL;
+
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ switch (format) {
+ case __DRI_IMAGE_FORMAT_RGB565:
+ image->format = MESA_FORMAT_RGB565;
+ image->internal_format = GL_RGB;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
+ case __DRI_IMAGE_FORMAT_XRGB8888:
+ image->format = MESA_FORMAT_XRGB8888;
+ image->internal_format = GL_RGB;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
+ case __DRI_IMAGE_FORMAT_ARGB8888:
+ image->format = MESA_FORMAT_ARGB8888;
+ image->internal_format = GL_RGBA;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
+ default:
+ free(image);
+ return NULL;
+ }
+
+ image->data = loaderPrivate;
+ image->cpp = _mesa_get_format_bytes(image->format);
+ image->width = width;
+ image->pitch = pitch;
+ image->height = height;
+
+ image->bo = radeon_bo_open(radeonScreen->bom,
+ (uint32_t)name,
+ image->pitch * image->height * image->cpp,
+ 0,
+ RADEON_GEM_DOMAIN_VRAM,
+ 0);
+
+ if (image->bo == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ return image;
+}
+
+static __DRIimage *
+radeon_create_image_from_renderbuffer(__DRIcontext *context,
+ int renderbuffer, void *loaderPrivate)
+{
+ __DRIimage *image;
+ radeonContextPtr radeon = context->driverPrivate;
+ struct gl_renderbuffer *rb;
+ struct radeon_renderbuffer *rrb;
+
+ rb = _mesa_lookup_renderbuffer(radeon->glCtx, renderbuffer);
+ if (!rb) {
+ _mesa_error(radeon->glCtx,
+ GL_INVALID_OPERATION, "glRenderbufferExternalMESA");
+ return NULL;
+ }
+
+ rrb = radeon_renderbuffer(rb);
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ image->internal_format = rb->InternalFormat;
+ image->format = rb->Format;
+ image->cpp = rrb->cpp;
+ image->data_type = GL_UNSIGNED_BYTE;
+ image->data = loaderPrivate;
+ radeon_bo_ref(rrb->bo);
+ image->bo = rrb->bo;
+
+ image->width = rb->Width;
+ image->height = rb->Height;
+ image->pitch = rrb->pitch / image->cpp;
+
+ return image;
+}
+
+static void
+radeon_destroy_image(__DRIimage *image)
+{
+ radeon_bo_unref(image->bo);
+ FREE(image);
+}
+
+static __DRIimage *
+radeon_create_image(__DRIscreen *screen,
+ int width, int height, int format,
+ unsigned int use,
+ void *loaderPrivate)
+{
+ __DRIimage *image;
+ radeonScreenPtr radeonScreen = screen->driverPrivate;
+
+ image = CALLOC(sizeof *image);
+ if (image == NULL)
+ return NULL;
+
+ image->dri_format = format;
+
+ switch (format) {
+ case __DRI_IMAGE_FORMAT_RGB565:
+ image->format = MESA_FORMAT_RGB565;
+ image->internal_format = GL_RGB;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
+ case __DRI_IMAGE_FORMAT_XRGB8888:
+ image->format = MESA_FORMAT_XRGB8888;
+ image->internal_format = GL_RGB;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
+ case __DRI_IMAGE_FORMAT_ARGB8888:
+ image->format = MESA_FORMAT_ARGB8888;
+ image->internal_format = GL_RGBA;
+ image->data_type = GL_UNSIGNED_BYTE;
+ break;
+ default:
+ free(image);
+ return NULL;
+ }
+
+ image->data = loaderPrivate;
+ image->cpp = _mesa_get_format_bytes(image->format);
+ image->width = width;
+ image->height = height;
+ image->pitch = ((image->cpp * image->width + 255) & ~255) / image->cpp;
+
+ image->bo = radeon_bo_open(radeonScreen->bom,
+ 0,
+ image->pitch * image->height * image->cpp,
+ 0,
+ RADEON_GEM_DOMAIN_VRAM,
+ 0);
+
+ if (image->bo == NULL) {
+ FREE(image);
+ return NULL;
+ }
+
+ return image;
+}
+
+static GLboolean
+radeon_query_image(__DRIimage *image, int attrib, int *value)
+{
+ switch (attrib) {
+ case __DRI_IMAGE_ATTRIB_STRIDE:
+ *value = image->pitch * image->cpp;
+ return GL_TRUE;
+ case __DRI_IMAGE_ATTRIB_HANDLE:
+ *value = image->bo->handle;
+ return GL_TRUE;
+ case __DRI_IMAGE_ATTRIB_NAME:
+ radeon_gem_get_kernel_name(image->bo, (uint32_t *) value);
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
+static struct __DRIimageExtensionRec radeonImageExtension = {
+ { __DRI_IMAGE, 1 },
+ radeon_create_image_from_name,
+ radeon_create_image_from_renderbuffer,
+ radeon_destroy_image,
+ radeon_create_image,
+ radeon_query_image
+};
+
+static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id)
+{
+ screen->device_id = device_id;
+ screen->chip_flags = 0;
+ switch ( device_id ) {
+#if defined(RADEON_R100)
+ case PCI_CHIP_RN50_515E:
+ case PCI_CHIP_RN50_5969:
+ return -1;
+
+ case PCI_CHIP_RADEON_LY:
+ case PCI_CHIP_RADEON_LZ:
+ case PCI_CHIP_RADEON_QY:
+ case PCI_CHIP_RADEON_QZ:
+ screen->chip_family = CHIP_FAMILY_RV100;
+ break;
+
+ case PCI_CHIP_RS100_4136:
+ case PCI_CHIP_RS100_4336:
+ screen->chip_family = CHIP_FAMILY_RS100;
+ break;
+
+ case PCI_CHIP_RS200_4137:
+ case PCI_CHIP_RS200_4337:
+ case PCI_CHIP_RS250_4237:
+ case PCI_CHIP_RS250_4437:
+ screen->chip_family = CHIP_FAMILY_RS200;
+ break;
+
+ case PCI_CHIP_RADEON_QD:
+ case PCI_CHIP_RADEON_QE:
+ case PCI_CHIP_RADEON_QF:
+ case PCI_CHIP_RADEON_QG:
+ /* all original radeons (7200) presumably have a stencil op bug */
+ screen->chip_family = CHIP_FAMILY_R100;
+ screen->chip_flags = RADEON_CHIPSET_TCL | RADEON_CHIPSET_BROKEN_STENCIL | RADEON_CHIPSET_DEPTH_ALWAYS_TILED;
+ break;
+
+ case PCI_CHIP_RV200_QW:
+ case PCI_CHIP_RV200_QX:
+ case PCI_CHIP_RADEON_LW:
+ case PCI_CHIP_RADEON_LX:
+ screen->chip_family = CHIP_FAMILY_RV200;
+ screen->chip_flags = RADEON_CHIPSET_TCL | RADEON_CHIPSET_DEPTH_ALWAYS_TILED;
+ break;
+
+#elif defined(RADEON_R200)
+ case PCI_CHIP_R200_BB:
+ case PCI_CHIP_R200_QH:
+ case PCI_CHIP_R200_QL:
+ case PCI_CHIP_R200_QM:
+ screen->chip_family = CHIP_FAMILY_R200;
+ screen->chip_flags = RADEON_CHIPSET_TCL | RADEON_CHIPSET_DEPTH_ALWAYS_TILED;
+ break;
+
+ case PCI_CHIP_RV250_If:
+ case PCI_CHIP_RV250_Ig:
+ case PCI_CHIP_RV250_Ld:
+ case PCI_CHIP_RV250_Lf:
+ case PCI_CHIP_RV250_Lg:
+ screen->chip_family = CHIP_FAMILY_RV250;
+ screen->chip_flags = R200_CHIPSET_YCBCR_BROKEN | RADEON_CHIPSET_TCL | RADEON_CHIPSET_DEPTH_ALWAYS_TILED;
+ break;
+
+ case PCI_CHIP_RV280_4C6E:
+ case PCI_CHIP_RV280_5960:
+ case PCI_CHIP_RV280_5961:
+ case PCI_CHIP_RV280_5962:
+ case PCI_CHIP_RV280_5964:
+ case PCI_CHIP_RV280_5965:
+ case PCI_CHIP_RV280_5C61:
+ case PCI_CHIP_RV280_5C63:
+ screen->chip_family = CHIP_FAMILY_RV280;
+ screen->chip_flags = RADEON_CHIPSET_TCL | RADEON_CHIPSET_DEPTH_ALWAYS_TILED;
+ break;
+
+ case PCI_CHIP_RS300_5834:
+ case PCI_CHIP_RS300_5835:
+ case PCI_CHIP_RS350_7834:
+ case PCI_CHIP_RS350_7835:
+ screen->chip_family = CHIP_FAMILY_RS300;
+ screen->chip_flags = RADEON_CHIPSET_DEPTH_ALWAYS_TILED;
+ break;
+#endif
+
+ default:
+ fprintf(stderr, "unknown chip id 0x%x, can't guess.\n",
+ device_id);
+ return -1;
+ }
+
+ return 0;
+}
+
+static radeonScreenPtr
+radeonCreateScreen2(__DRIscreen *sPriv)
+{
+ radeonScreenPtr screen;
+ int i;
+ int ret;
+ uint32_t device_id = 0;
+
+ /* Allocate the private area */
+ screen = (radeonScreenPtr) CALLOC( sizeof(*screen) );
+ if ( !screen ) {
+ fprintf(stderr, "%s: Could not allocate memory for screen structure", __FUNCTION__);
+ fprintf(stderr, "leaving here\n");
+ return NULL;
+ }
+
+ radeon_init_debug();
+
+ /* parse information in __driConfigOptions */
+ driParseOptionInfo (&screen->optionCache,
+ __driConfigOptions, __driNConfigOptions);
+
+ screen->chip_flags = 0;
+
+ screen->irq = 1;
+
+ ret = radeonGetParam(sPriv, RADEON_PARAM_DEVICE_ID, &device_id);
+ if (ret) {
+ FREE( screen );
+ fprintf(stderr, "drm_radeon_getparam_t (RADEON_PARAM_DEVICE_ID): %d\n", ret);
+ return NULL;
+ }
+
+ ret = radeon_set_screen_flags(screen, device_id);
+ if (ret == -1)
+ return NULL;
+
+ if (getenv("RADEON_NO_TCL"))
+ screen->chip_flags &= ~RADEON_CHIPSET_TCL;
+
+ i = 0;
+ screen->extensions[i++] = &dri2ConfigQueryExtension.base;
+
+#if defined(RADEON_R100)
+ screen->extensions[i++] = &radeonTexBufferExtension.base;
+#elif defined(RADEON_R200)
+ screen->extensions[i++] = &r200TexBufferExtension.base;
+#endif
+
+ screen->extensions[i++] = &radeonFlushExtension.base;
+ screen->extensions[i++] = &radeonImageExtension.base;
+
+ screen->extensions[i++] = NULL;
+ sPriv->extensions = screen->extensions;
+
+ screen->driScreen = sPriv;
+ screen->bom = radeon_bo_manager_gem_ctor(sPriv->fd);
+ if (screen->bom == NULL) {
+ free(screen);
+ return NULL;
+ }
+ return screen;
+}
+
+/* Destroy the device specific screen private data struct.
+ */
+static void
+radeonDestroyScreen( __DRIscreen *sPriv )
+{
+ radeonScreenPtr screen = (radeonScreenPtr)sPriv->driverPrivate;
+
+ if (!screen)
+ return;
+
+#ifdef RADEON_BO_TRACK
+ radeon_tracker_print(&screen->bom->tracker, stderr);
+#endif
+ radeon_bo_manager_gem_dtor(screen->bom);
+
+ /* free all option information */
+ driDestroyOptionInfo (&screen->optionCache);
+
+ FREE( screen );
+ sPriv->driverPrivate = NULL;
+}
+
+
+/* Initialize the driver specific screen private data.
+ */
+static GLboolean
+radeonInitDriver( __DRIscreen *sPriv )
+{
+ sPriv->driverPrivate = (void *) radeonCreateScreen2( sPriv );
+ if ( !sPriv->driverPrivate ) {
+ radeonDestroyScreen( sPriv );
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+
+
+/**
+ * Create the Mesa framebuffer and renderbuffers for a given window/drawable.
+ *
+ * \todo This function (and its interface) will need to be updated to support
+ * pbuffers.
+ */
+static GLboolean
+radeonCreateBuffer( __DRIscreen *driScrnPriv,
+ __DRIdrawable *driDrawPriv,
+ const struct gl_config *mesaVis,
+ GLboolean isPixmap )
+{
+ radeonScreenPtr screen = (radeonScreenPtr) driScrnPriv->driverPrivate;
+
+ const GLboolean swDepth = GL_FALSE;
+ const GLboolean swAlpha = GL_FALSE;
+ const GLboolean swAccum = mesaVis->accumRedBits > 0;
+ const GLboolean swStencil = mesaVis->stencilBits > 0 &&
+ mesaVis->depthBits != 24;
+ gl_format rgbFormat;
+ struct radeon_framebuffer *rfb;
+
+ if (isPixmap)
+ return GL_FALSE; /* not implemented */
+
+ rfb = CALLOC_STRUCT(radeon_framebuffer);
+ if (!rfb)
+ return GL_FALSE;
+
+ _mesa_initialize_window_framebuffer(&rfb->base, mesaVis);
+
+ if (mesaVis->redBits == 5)
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_RGB565 : MESA_FORMAT_RGB565_REV;
+ else if (mesaVis->alphaBits == 0)
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_XRGB8888 : MESA_FORMAT_XRGB8888_REV;
+ else
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB8888_REV;
+
+ /* front color renderbuffer */
+ rfb->color_rb[0] = radeon_create_renderbuffer(rgbFormat, driDrawPriv);
+ _mesa_add_renderbuffer(&rfb->base, BUFFER_FRONT_LEFT, &rfb->color_rb[0]->base.Base);
+ rfb->color_rb[0]->has_surface = 1;
+
+ /* back color renderbuffer */
+ if (mesaVis->doubleBufferMode) {
+ rfb->color_rb[1] = radeon_create_renderbuffer(rgbFormat, driDrawPriv);
+ _mesa_add_renderbuffer(&rfb->base, BUFFER_BACK_LEFT, &rfb->color_rb[1]->base.Base);
+ rfb->color_rb[1]->has_surface = 1;
+ }
+
+ if (mesaVis->depthBits == 24) {
+ if (mesaVis->stencilBits == 8) {
+ struct radeon_renderbuffer *depthStencilRb =
+ radeon_create_renderbuffer(MESA_FORMAT_S8_Z24, driDrawPriv);
+ _mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depthStencilRb->base.Base);
+ _mesa_add_renderbuffer(&rfb->base, BUFFER_STENCIL, &depthStencilRb->base.Base);
+ depthStencilRb->has_surface = screen->depthHasSurface;
+ } else {
+ /* depth renderbuffer */
+ struct radeon_renderbuffer *depth =
+ radeon_create_renderbuffer(MESA_FORMAT_X8_Z24, driDrawPriv);
+ _mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depth->base.Base);
+ depth->has_surface = screen->depthHasSurface;
+ }
+ } else if (mesaVis->depthBits == 16) {
+ /* just 16-bit depth buffer, no hw stencil */
+ struct radeon_renderbuffer *depth =
+ radeon_create_renderbuffer(MESA_FORMAT_Z16, driDrawPriv);
+ _mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depth->base.Base);
+ depth->has_surface = screen->depthHasSurface;
+ }
+
+ _swrast_add_soft_renderbuffers(&rfb->base,
+ GL_FALSE, /* color */
+ swDepth,
+ swStencil,
+ swAccum,
+ swAlpha,
+ GL_FALSE /* aux */);
+ driDrawPriv->driverPrivate = (void *) rfb;
+
+ return (driDrawPriv->driverPrivate != NULL);
+}
+
+
+static void radeon_cleanup_renderbuffers(struct radeon_framebuffer *rfb)
+{
+ struct radeon_renderbuffer *rb;
+
+ rb = rfb->color_rb[0];
+ if (rb && rb->bo) {
+ radeon_bo_unref(rb->bo);
+ rb->bo = NULL;
+ }
+ rb = rfb->color_rb[1];
+ if (rb && rb->bo) {
+ radeon_bo_unref(rb->bo);
+ rb->bo = NULL;
+ }
+ rb = radeon_get_renderbuffer(&rfb->base, BUFFER_DEPTH);
+ if (rb && rb->bo) {
+ radeon_bo_unref(rb->bo);
+ rb->bo = NULL;
+ }
+}
+
+void
+radeonDestroyBuffer(__DRIdrawable *driDrawPriv)
+{
+ struct radeon_framebuffer *rfb;
+ if (!driDrawPriv)
+ return;
+
+ rfb = (void*)driDrawPriv->driverPrivate;
+ if (!rfb)
+ return;
+ radeon_cleanup_renderbuffers(rfb);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+}
+
+#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
+
+/**
+ * This is the driver specific part of the createNewScreen entry point.
+ * Called when using DRI2.
+ *
+ * \return the struct gl_config supported by this driver
+ */
+static const
+__DRIconfig **radeonInitScreen2(__DRIscreen *psp)
+{
+ GLenum fb_format[3];
+ GLenum fb_type[3];
+ /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
+ * support pageflipping at all.
+ */
+ static const GLenum back_buffer_modes[] = {
+ GLX_NONE, GLX_SWAP_UNDEFINED_OML, /*, GLX_SWAP_COPY_OML*/
+ };
+ uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1];
+ int color;
+ __DRIconfig **configs = NULL;
+
+ if (!radeonInitDriver(psp)) {
+ return NULL;
+ }
+ depth_bits[0] = 0;
+ stencil_bits[0] = 0;
+ depth_bits[1] = 16;
+ stencil_bits[1] = 0;
+ depth_bits[2] = 24;
+ stencil_bits[2] = 0;
+ depth_bits[3] = 24;
+ stencil_bits[3] = 8;
+
+ msaa_samples_array[0] = 0;
+
+ fb_format[0] = GL_RGB;
+ fb_type[0] = GL_UNSIGNED_SHORT_5_6_5;
+
+ fb_format[1] = GL_BGR;
+ fb_type[1] = GL_UNSIGNED_INT_8_8_8_8_REV;
+
+ fb_format[2] = GL_BGRA;
+ fb_type[2] = GL_UNSIGNED_INT_8_8_8_8_REV;
+
+ for (color = 0; color < ARRAY_SIZE(fb_format); color++) {
+ __DRIconfig **new_configs;
+
+ new_configs = driCreateConfigs(fb_format[color], fb_type[color],
+ depth_bits,
+ stencil_bits,
+ ARRAY_SIZE(depth_bits),
+ back_buffer_modes,
+ ARRAY_SIZE(back_buffer_modes),
+ msaa_samples_array,
+ ARRAY_SIZE(msaa_samples_array),
+ GL_TRUE);
+ configs = driConcatConfigs(configs, new_configs);
+ }
+
+ if (configs == NULL) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ __LINE__);
+ return NULL;
+ }
+
+ return (const __DRIconfig **)configs;
+}
+
+const struct __DriverAPIRec driDriverAPI = {
+ .InitScreen = radeonInitScreen2,
+ .DestroyScreen = radeonDestroyScreen,
+#if defined(RADEON_R200)
+ .CreateContext = r200CreateContext,
+ .DestroyContext = r200DestroyContext,
+#else
+ .CreateContext = r100CreateContext,
+ .DestroyContext = radeonDestroyContext,
+#endif
+ .CreateBuffer = radeonCreateBuffer,
+ .DestroyBuffer = radeonDestroyBuffer,
+ .MakeCurrent = radeonMakeCurrent,
+ .UnbindContext = radeonUnbindContext,
+};
+
+/* This is the table of extensions that the loader will dlsym() for. */
+PUBLIC const __DRIextension *__driDriverExtensions[] = {
+ &driCoreExtension.base,
+ &driDRI2Extension.base,
+ NULL
+};
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.h
index 23bb6bd4598..dd618f5836f 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_screen.h
@@ -1 +1,122 @@
-../radeon/radeon_screen.h \ No newline at end of file
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ VA Linux Systems Inc., Fremont, California.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Gareth Hughes <gareth@valinux.com>
+ */
+
+#ifndef __RADEON_SCREEN_H__
+#define __RADEON_SCREEN_H__
+
+/*
+ * IMPORTS: these headers contain all the DRI, X and kernel-related
+ * definitions that we need.
+ */
+#include "dri_util.h"
+#include "radeon_dri.h"
+#include "radeon_chipset.h"
+#include "radeon_reg.h"
+#include "drm_sarea.h"
+#include "xmlconfig.h"
+
+
+typedef struct {
+ drm_handle_t handle; /* Handle to the DRM region */
+ drmSize size; /* Size of the DRM region */
+ drmAddress map; /* Mapping of the DRM region */
+} radeonRegionRec, *radeonRegionPtr;
+
+typedef struct radeon_screen {
+ int chip_family;
+ int chip_flags;
+ int cpp;
+ int card_type;
+ int device_id; /* PCI ID */
+ int AGPMode;
+ unsigned int irq; /* IRQ number (0 means none) */
+
+ unsigned int fbLocation;
+ unsigned int frontOffset;
+ unsigned int frontPitch;
+ unsigned int backOffset;
+ unsigned int backPitch;
+
+ unsigned int depthOffset;
+ unsigned int depthPitch;
+
+ /* Shared texture data */
+ int numTexHeaps;
+ int texOffset[RADEON_NR_TEX_HEAPS];
+ int texSize[RADEON_NR_TEX_HEAPS];
+ int logTexGranularity[RADEON_NR_TEX_HEAPS];
+
+ radeonRegionRec mmio;
+ radeonRegionRec status;
+ radeonRegionRec gartTextures;
+
+ drmBufMapPtr buffers;
+
+ __volatile__ uint32_t *scratch;
+
+ __DRIscreen *driScreen;
+ unsigned int sarea_priv_offset;
+ unsigned int gart_buffer_offset; /* offset in card memory space */
+ unsigned int gart_texture_offset; /* offset in card memory space */
+ unsigned int gart_base;
+
+ GLboolean depthHasSurface;
+
+ /* Configuration cache with default values for all contexts */
+ driOptionCache optionCache;
+
+ const __DRIextension *extensions[17];
+
+ int num_gb_pipes;
+ int num_z_pipes;
+ drm_radeon_sarea_t *sarea; /* Private SAREA data */
+ struct radeon_bo_manager *bom;
+
+} radeonScreenRec, *radeonScreenPtr;
+
+struct __DRIimageRec {
+ struct radeon_bo *bo;
+ GLenum internal_format;
+ uint32_t dri_format;
+ GLuint format;
+ GLenum data_type;
+ int width, height; /* in pixels */
+ int pitch; /* in pixels */
+ int cpp;
+ void *data;
+};
+
+extern void radeonDestroyBuffer(__DRIdrawable *driDrawPriv);
+#endif /* __RADEON_SCREEN_H__ */
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.c
index 232868c4c9e..0617adc5bc5 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.c
@@ -1 +1,161 @@
-../radeon/radeon_span.c \ No newline at end of file
+/**************************************************************************
+
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ VA Linux Systems Inc., Fremont, California.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ *
+ */
+
+#include "main/glheader.h"
+#include "main/texformat.h"
+#include "main/renderbuffer.h"
+#include "main/samplerobj.h"
+#include "swrast/swrast.h"
+#include "swrast/s_renderbuffer.h"
+
+#include "radeon_common.h"
+#include "radeon_span.h"
+
+
+static void
+radeon_renderbuffer_map(struct gl_context *ctx, struct gl_renderbuffer *rb)
+{
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+ GLubyte *map;
+ int stride;
+
+ if (!rb || !rrb)
+ return;
+
+ ctx->Driver.MapRenderbuffer(ctx, rb, 0, 0, rb->Width, rb->Height,
+ GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
+ &map, &stride);
+
+ rrb->base.Map = map;
+ rrb->base.RowStride = stride;
+ /* No floating point color buffers, use GLubytes */
+ rrb->base.ColorType = GL_UNSIGNED_BYTE;
+}
+
+static void
+radeon_renderbuffer_unmap(struct gl_context *ctx, struct gl_renderbuffer *rb)
+{
+ struct radeon_renderbuffer *rrb = radeon_renderbuffer(rb);
+ if (!rb || !rrb)
+ return;
+
+ ctx->Driver.UnmapRenderbuffer(ctx, rb);
+
+ rrb->base.Map = NULL;
+ rrb->base.RowStride = 0;
+}
+
+static void
+radeon_map_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ GLuint i;
+
+ radeon_print(RADEON_MEMORY, RADEON_TRACE,
+ "%s( %p , fb %p )\n",
+ __func__, ctx, fb);
+
+ /* check for render to textures */
+ for (i = 0; i < BUFFER_COUNT; i++)
+ radeon_renderbuffer_map(ctx, fb->Attachment[i].Renderbuffer);
+
+ radeon_check_front_buffer_rendering(ctx);
+}
+
+static void
+radeon_unmap_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
+{
+ GLuint i;
+
+ radeon_print(RADEON_MEMORY, RADEON_TRACE,
+ "%s( %p , fb %p)\n",
+ __func__, ctx, fb);
+
+ /* check for render to textures */
+ for (i = 0; i < BUFFER_COUNT; i++)
+ radeon_renderbuffer_unmap(ctx, fb->Attachment[i].Renderbuffer);
+
+ radeon_check_front_buffer_rendering(ctx);
+}
+
+static void radeonSpanRenderStart(struct gl_context * ctx)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ int i;
+
+ radeon_firevertices(rmesa);
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+ if (ctx->Texture.Unit[i]._ReallyEnabled) {
+ radeon_validate_texture_miptree(ctx, _mesa_get_samplerobj(ctx, i),
+ ctx->Texture.Unit[i]._Current);
+ radeon_swrast_map_texture_images(ctx, ctx->Texture.Unit[i]._Current);
+ }
+ }
+
+ radeon_map_framebuffer(ctx, ctx->DrawBuffer);
+ if (ctx->ReadBuffer != ctx->DrawBuffer)
+ radeon_map_framebuffer(ctx, ctx->ReadBuffer);
+}
+
+static void radeonSpanRenderFinish(struct gl_context * ctx)
+{
+ int i;
+
+ _swrast_flush(ctx);
+
+ for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++)
+ if (ctx->Texture.Unit[i]._ReallyEnabled)
+ radeon_swrast_unmap_texture_images(ctx, ctx->Texture.Unit[i]._Current);
+
+ radeon_unmap_framebuffer(ctx, ctx->DrawBuffer);
+ if (ctx->ReadBuffer != ctx->DrawBuffer)
+ radeon_unmap_framebuffer(ctx, ctx->ReadBuffer);
+}
+
+void radeonInitSpanFuncs(struct gl_context * ctx)
+{
+ struct swrast_device_driver *swdd =
+ _swrast_GetDeviceDriverReference(ctx);
+ swdd->SpanRenderStart = radeonSpanRenderStart;
+ swdd->SpanRenderFinish = radeonSpanRenderFinish;
+}
+
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.h
index f9d634508c2..64517b59237 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_span.h
@@ -1 +1,47 @@
-../radeon/radeon_span.h \ No newline at end of file
+/**************************************************************************
+
+Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and
+ VA Linux Systems Inc., Fremont, California.
+Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+
+The Weather Channel (TM) funded Tungsten Graphics to develop the
+initial release of the Radeon 8500 driver under the XFree86 license.
+This notice must be preserved.
+
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Gareth Hughes <gareth@valinux.com>
+ * Keith Whitwell <keith@tungstengraphics.com>
+ * Kevin E. Martin <martin@valinux.com>
+ */
+
+#ifndef __RADEON_SPAN_H__
+#define __RADEON_SPAN_H__
+
+extern void radeonInitSpanFuncs(struct gl_context * ctx);
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tex_copy.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tex_copy.c
index dfa5ba34e65..a6c406b2bff 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tex_copy.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tex_copy.c
@@ -1 +1,160 @@
-../radeon/radeon_tex_copy.c \ No newline at end of file
+/*
+ * Copyright (C) 2009 Maciej Cencora <m.cencora@gmail.com>
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "radeon_common.h"
+#include "radeon_texture.h"
+
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/teximage.h"
+#include "main/texstate.h"
+#include "drivers/common/meta.h"
+
+#include "radeon_mipmap_tree.h"
+
+static GLboolean
+do_copy_texsubimage(struct gl_context *ctx,
+ struct radeon_tex_obj *tobj,
+ radeon_texture_image *timg,
+ GLint dstx, GLint dsty,
+ struct radeon_renderbuffer *rrb,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ const GLuint face = timg->base.Base.Face;
+ const GLuint level = timg->base.Base.Level;
+ unsigned src_bpp;
+ unsigned dst_bpp;
+ gl_format src_mesaformat;
+ gl_format dst_mesaformat;
+ unsigned flip_y;
+
+ if (!radeon->vtbl.blit) {
+ return GL_FALSE;
+ }
+
+ // This is software renderbuffer, fallback to swrast
+ if (!rrb) {
+ return GL_FALSE;
+ }
+
+ if (_mesa_get_format_bits(timg->base.Base.TexFormat, GL_DEPTH_BITS) > 0) {
+ /* copying depth values */
+ flip_y = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Type == GL_NONE;
+ } else {
+ /* copying color */
+ flip_y = ctx->ReadBuffer->Attachment[BUFFER_COLOR0].Type == GL_NONE;
+ }
+
+ if (!timg->mt) {
+ radeon_validate_texture_miptree(ctx, &tobj->base.Sampler, &tobj->base);
+ }
+
+ assert(rrb->bo);
+ assert(timg->mt);
+ assert(timg->mt->bo);
+ assert(timg->base.Base.Width >= dstx + width);
+ assert(timg->base.Base.Height >= dsty + height);
+
+ intptr_t src_offset = rrb->draw_offset;
+ intptr_t dst_offset = radeon_miptree_image_offset(timg->mt, face, level);
+
+ if (0) {
+ fprintf(stderr, "%s: copying to face %d, level %d\n",
+ __FUNCTION__, face, level);
+ fprintf(stderr, "to: x %d, y %d, offset %d\n", dstx, dsty, (uint32_t) dst_offset);
+ fprintf(stderr, "from (%dx%d) width %d, height %d, offset %d, pitch %d\n",
+ x, y, rrb->base.Base.Width, rrb->base.Base.Height, (uint32_t) src_offset, rrb->pitch/rrb->cpp);
+ fprintf(stderr, "src size %d, dst size %d\n", rrb->bo->size, timg->mt->bo->size);
+
+ }
+
+ src_mesaformat = rrb->base.Base.Format;
+ dst_mesaformat = timg->base.Base.TexFormat;
+ src_bpp = _mesa_get_format_bytes(src_mesaformat);
+ dst_bpp = _mesa_get_format_bytes(dst_mesaformat);
+ if (!radeon->vtbl.check_blit(dst_mesaformat, rrb->pitch / rrb->cpp)) {
+ /* depth formats tend to be special */
+ if (_mesa_get_format_bits(dst_mesaformat, GL_DEPTH_BITS) > 0)
+ return GL_FALSE;
+
+ if (src_bpp != dst_bpp)
+ return GL_FALSE;
+
+ switch (dst_bpp) {
+ case 2:
+ src_mesaformat = MESA_FORMAT_RGB565;
+ dst_mesaformat = MESA_FORMAT_RGB565;
+ break;
+ case 4:
+ src_mesaformat = MESA_FORMAT_ARGB8888;
+ dst_mesaformat = MESA_FORMAT_ARGB8888;
+ break;
+ case 1:
+ src_mesaformat = MESA_FORMAT_A8;
+ dst_mesaformat = MESA_FORMAT_A8;
+ break;
+ default:
+ return GL_FALSE;
+ }
+ }
+
+ /* blit from src buffer to texture */
+ return radeon->vtbl.blit(ctx, rrb->bo, src_offset, src_mesaformat, rrb->pitch/rrb->cpp,
+ rrb->base.Base.Width, rrb->base.Base.Height, x, y,
+ timg->mt->bo, dst_offset, dst_mesaformat,
+ timg->mt->levels[level].rowstride / dst_bpp,
+ timg->base.Base.Width, timg->base.Base.Height,
+ dstx, dsty, width, height, flip_y);
+}
+
+void
+radeonCopyTexSubImage(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ struct gl_renderbuffer *rb,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ radeon_prepare_render(radeon);
+
+ if (dims != 2 || !do_copy_texsubimage(ctx,
+ radeon_tex_obj(texImage->TexObject),
+ (radeon_texture_image *)texImage,
+ xoffset, yoffset,
+ radeon_renderbuffer(rb), x, y, width, height)) {
+
+ radeon_print(RADEON_FALLBACKS, RADEON_NORMAL,
+ "Falling back to sw for glCopyTexSubImage2D\n");
+
+ _mesa_meta_CopyTexSubImage(ctx, dims, texImage,
+ xoffset, yoffset, zoffset,
+ rb, x, y, width, height);
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.c
index a822710915f..e405f9746f1 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.c
@@ -1 +1,833 @@
-../radeon/radeon_texture.c \ No newline at end of file
+/*
+ * Copyright (C) 2009 Maciej Cencora.
+ * Copyright (C) 2008 Nicolai Haehnle.
+ * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+ *
+ * The Weather Channel (TM) funded Tungsten Graphics to develop the
+ * initial release of the Radeon 8500 driver under the XFree86 license.
+ * This notice must be preserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/mfeatures.h"
+#include "main/mipmap.h"
+#include "main/pbo.h"
+#include "main/texcompress.h"
+#include "main/texstore.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "drivers/common/meta.h"
+
+#include "xmlpool.h" /* for symbolic values of enum-type options */
+
+#include "radeon_common.h"
+
+#include "radeon_mipmap_tree.h"
+
+static void teximage_assign_miptree(radeonContextPtr rmesa,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+static radeon_mipmap_tree *radeon_miptree_create_for_teximage(radeonContextPtr rmesa,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage);
+
+void copy_rows(void* dst, GLuint dststride, const void* src, GLuint srcstride,
+ GLuint numrows, GLuint rowsize)
+{
+ assert(rowsize <= dststride);
+ assert(rowsize <= srcstride);
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s dst %p, stride %u, src %p, stride %u, "
+ "numrows %u, rowsize %u.\n",
+ __func__, dst, dststride,
+ src, srcstride,
+ numrows, rowsize);
+
+ if (rowsize == srcstride && rowsize == dststride) {
+ memcpy(dst, src, numrows*rowsize);
+ } else {
+ GLuint i;
+ for(i = 0; i < numrows; ++i) {
+ memcpy(dst, src, rowsize);
+ dst += dststride;
+ src += srcstride;
+ }
+ }
+}
+
+/* textures */
+/**
+ * Allocate an empty texture image object.
+ */
+struct gl_texture_image *radeonNewTextureImage(struct gl_context *ctx)
+{
+ return CALLOC(sizeof(radeon_texture_image));
+}
+
+
+/**
+ * Delete a texture image object.
+ */
+static void
+radeonDeleteTextureImage(struct gl_context *ctx, struct gl_texture_image *img)
+{
+ /* nothing special (yet) for radeon_texture_image */
+ _mesa_delete_texture_image(ctx, img);
+}
+
+static GLboolean
+radeonAllocTextureImageBuffer(struct gl_context *ctx,
+ struct gl_texture_image *timage)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ radeon_texture_image *image = get_radeon_texture_image(timage);
+ struct gl_texture_object *texobj = timage->TexObject;
+ int slices;
+
+ ctx->Driver.FreeTextureImageBuffer(ctx, timage);
+
+ switch (texobj->Target) {
+ case GL_TEXTURE_3D:
+ slices = timage->Depth;
+ break;
+ default:
+ slices = 1;
+ }
+ assert(!image->base.ImageOffsets);
+ image->base.ImageOffsets = malloc(slices * sizeof(GLuint));
+ teximage_assign_miptree(rmesa, texobj, timage);
+
+ return GL_TRUE;
+}
+
+
+/**
+ * Free memory associated with this texture image.
+ */
+void radeonFreeTextureImageBuffer(struct gl_context *ctx, struct gl_texture_image *timage)
+{
+ radeon_texture_image* image = get_radeon_texture_image(timage);
+
+ if (image->mt) {
+ radeon_miptree_unreference(&image->mt);
+ } else {
+ _swrast_free_texture_image_buffer(ctx, timage);
+ }
+ if (image->bo) {
+ radeon_bo_unref(image->bo);
+ image->bo = NULL;
+ }
+ if (image->base.Buffer) {
+ _mesa_align_free(image->base.Buffer);
+ image->base.Buffer = NULL;
+ }
+
+ if (image->base.ImageOffsets) {
+ free(image->base.ImageOffsets);
+ image->base.ImageOffsets = NULL;
+ }
+}
+
+/* Set Data pointer and additional data for mapped texture image */
+static void teximage_set_map_data(radeon_texture_image *image)
+{
+ radeon_mipmap_level *lvl;
+
+ if (!image->mt) {
+ radeon_warning("%s(%p) Trying to set map data without miptree.\n",
+ __func__, image);
+
+ return;
+ }
+
+ lvl = &image->mt->levels[image->base.Base.Level];
+
+ image->base.Map = image->mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
+ image->base.RowStride = lvl->rowstride / _mesa_get_format_bytes(image->base.Base.TexFormat);
+}
+
+
+/**
+ * Map a single texture image for glTexImage and friends.
+ */
+void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable)
+{
+ radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+ "%s(img %p), write_enable %s.\n",
+ __func__, image,
+ write_enable ? "true": "false");
+ if (image->mt) {
+ assert(!image->base.Map);
+
+ radeon_bo_map(image->mt->bo, write_enable);
+ teximage_set_map_data(image);
+ }
+}
+
+
+void radeon_teximage_unmap(radeon_texture_image *image)
+{
+ radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+ "%s(img %p)\n",
+ __func__, image);
+ if (image->mt) {
+ assert(image->base.Map);
+
+ image->base.Map = 0;
+ radeon_bo_unmap(image->mt->bo);
+ }
+}
+
+/**
+ * Map texture memory/buffer into user space.
+ * Note: the region of interest parameters are ignored here.
+ * \param mapOut returns start of mapping of region of interest
+ * \param rowStrideOut returns row stride in bytes
+ */
+static void
+radeon_map_texture_image(struct gl_context *ctx,
+ struct gl_texture_image *texImage,
+ GLuint slice,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **map,
+ GLint *stride)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ radeon_texture_image *image = get_radeon_texture_image(texImage);
+ radeon_mipmap_tree *mt = image->mt;
+ GLuint texel_size = _mesa_get_format_bytes(texImage->TexFormat);
+ GLuint width = texImage->Width;
+ GLuint height = texImage->Height;
+ struct radeon_bo *bo = !image->mt ? image->bo : image->mt->bo;
+ unsigned int bw, bh;
+ GLboolean write = (mode & GL_MAP_WRITE_BIT) != 0;
+
+ _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
+ assert(y % bh == 0);
+ y /= bh;
+ texel_size /= bw;
+
+ if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->cmdbuf.cs)) {
+ radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+ "%s for texture that is "
+ "queued for GPU processing.\n",
+ __func__);
+ radeon_firevertices(rmesa);
+ }
+
+ if (image->bo) {
+ /* TFP case */
+ radeon_bo_map(image->bo, write);
+ *stride = get_texture_image_row_stride(rmesa, texImage->TexFormat, width, 0, texImage->TexObject->Target);
+ *map = bo->ptr;
+ } else if (likely(mt)) {
+ void *base;
+ radeon_mipmap_level *lvl = &image->mt->levels[texImage->Level];
+
+ radeon_bo_map(mt->bo, write);
+ base = mt->bo->ptr + lvl->faces[image->base.Base.Face].offset;
+
+ *stride = lvl->rowstride;
+ *map = base + (slice * height) * *stride;
+ } else {
+ /* texture data is in malloc'd memory */
+
+ assert(map);
+
+ *stride = _mesa_format_row_stride(texImage->TexFormat, width);
+ *map = image->base.Buffer + (slice * height) * *stride;
+ }
+
+ *map += y * *stride + x * texel_size;
+}
+
+static void
+radeon_unmap_texture_image(struct gl_context *ctx,
+ struct gl_texture_image *texImage, GLuint slice)
+{
+ radeon_texture_image *image = get_radeon_texture_image(texImage);
+
+ if (image->bo)
+ radeon_bo_unmap(image->bo);
+ else if (image->mt)
+ radeon_bo_unmap(image->mt->bo);
+}
+
+/* try to find a format which will only need a memcopy */
+static gl_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
+ GLenum srcFormat,
+ GLenum srcType, GLboolean fbo)
+{
+#if defined(RADEON_R100)
+ /* r100 can only do this */
+ return _radeon_texformat_argb8888;
+#elif defined(RADEON_R200)
+ const GLuint ui = 1;
+ const GLubyte littleEndian = *((const GLubyte *)&ui);
+
+ if (fbo)
+ return _radeon_texformat_argb8888;
+
+ if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) {
+ return MESA_FORMAT_RGBA8888;
+ } else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
+ (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
+ (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) {
+ return MESA_FORMAT_RGBA8888_REV;
+ } else
+ return _radeon_texformat_argb8888;
+#endif
+}
+
+gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
+ GLenum target,
+ GLint internalFormat,
+ GLenum format,
+ GLenum type)
+{
+ return radeonChooseTextureFormat(ctx, internalFormat, format,
+ type, 0);
+}
+
+gl_format radeonChooseTextureFormat(struct gl_context * ctx,
+ GLint internalFormat,
+ GLenum format,
+ GLenum type, GLboolean fbo)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ const GLboolean do32bpt =
+ (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32);
+ const GLboolean force16bpt =
+ (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16);
+ (void)format;
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s InternalFormat=%s(%d) type=%s format=%s\n",
+ __func__,
+ _mesa_lookup_enum_by_nr(internalFormat), internalFormat,
+ _mesa_lookup_enum_by_nr(type), _mesa_lookup_enum_by_nr(format));
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "%s do32bpt=%d force16bpt=%d\n",
+ __func__, do32bpt, force16bpt);
+
+ switch (internalFormat) {
+ case 4:
+ case GL_RGBA:
+ case GL_COMPRESSED_RGBA:
+ switch (type) {
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ return do32bpt ? _radeon_texformat_argb8888 :
+ _radeon_texformat_argb1555;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ return _radeon_texformat_argb4444;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ return _radeon_texformat_argb1555;
+ default:
+ return do32bpt ? radeonChoose8888TexFormat(rmesa, format, type, fbo) :
+ _radeon_texformat_argb4444;
+ }
+
+ case 3:
+ case GL_RGB:
+ case GL_COMPRESSED_RGB:
+ switch (type) {
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ return _radeon_texformat_argb4444;
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ return _radeon_texformat_argb1555;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ return _radeon_texformat_rgb565;
+ default:
+ return do32bpt ? _radeon_texformat_argb8888 :
+ _radeon_texformat_rgb565;
+ }
+
+ case GL_RGBA8:
+ case GL_RGB10_A2:
+ case GL_RGBA12:
+ case GL_RGBA16:
+ return !force16bpt ?
+ radeonChoose8888TexFormat(rmesa, format, type, fbo) :
+ _radeon_texformat_argb4444;
+
+ case GL_RGBA4:
+ case GL_RGBA2:
+ return _radeon_texformat_argb4444;
+
+ case GL_RGB5_A1:
+ return _radeon_texformat_argb1555;
+
+ case GL_RGB8:
+ case GL_RGB10:
+ case GL_RGB12:
+ case GL_RGB16:
+ return !force16bpt ? _radeon_texformat_argb8888 :
+ _radeon_texformat_rgb565;
+
+ case GL_RGB5:
+ case GL_RGB4:
+ case GL_R3_G3_B2:
+ return _radeon_texformat_rgb565;
+
+ case GL_ALPHA:
+ case GL_ALPHA4:
+ case GL_ALPHA8:
+ case GL_ALPHA12:
+ case GL_ALPHA16:
+ case GL_COMPRESSED_ALPHA:
+#if defined(RADEON_R200)
+ /* r200: can't use a8 format since interpreting hw I8 as a8 would result
+ in wrong rgb values (same as alpha value instead of 0). */
+ return _radeon_texformat_al88;
+#else
+ return MESA_FORMAT_A8;
+#endif
+ case 1:
+ case GL_LUMINANCE:
+ case GL_LUMINANCE4:
+ case GL_LUMINANCE8:
+ case GL_LUMINANCE12:
+ case GL_LUMINANCE16:
+ case GL_COMPRESSED_LUMINANCE:
+ return MESA_FORMAT_L8;
+
+ case 2:
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE4_ALPHA4:
+ case GL_LUMINANCE6_ALPHA2:
+ case GL_LUMINANCE8_ALPHA8:
+ case GL_LUMINANCE12_ALPHA4:
+ case GL_LUMINANCE12_ALPHA12:
+ case GL_LUMINANCE16_ALPHA16:
+ case GL_COMPRESSED_LUMINANCE_ALPHA:
+ return _radeon_texformat_al88;
+
+ case GL_INTENSITY:
+ case GL_INTENSITY4:
+ case GL_INTENSITY8:
+ case GL_INTENSITY12:
+ case GL_INTENSITY16:
+ case GL_COMPRESSED_INTENSITY:
+ return MESA_FORMAT_I8;
+
+ case GL_YCBCR_MESA:
+ if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
+ type == GL_UNSIGNED_BYTE)
+ return MESA_FORMAT_YCBCR;
+ else
+ return MESA_FORMAT_YCBCR_REV;
+
+ case GL_RGB_S3TC:
+ case GL_RGB4_S3TC:
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ return MESA_FORMAT_RGB_DXT1;
+
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ return MESA_FORMAT_RGBA_DXT1;
+
+ case GL_RGBA_S3TC:
+ case GL_RGBA4_S3TC:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ return MESA_FORMAT_RGBA_DXT3;
+
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ return MESA_FORMAT_RGBA_DXT5;
+
+ case GL_ALPHA16F_ARB:
+ return MESA_FORMAT_ALPHA_FLOAT16;
+ case GL_ALPHA32F_ARB:
+ return MESA_FORMAT_ALPHA_FLOAT32;
+ case GL_LUMINANCE16F_ARB:
+ return MESA_FORMAT_LUMINANCE_FLOAT16;
+ case GL_LUMINANCE32F_ARB:
+ return MESA_FORMAT_LUMINANCE_FLOAT32;
+ case GL_LUMINANCE_ALPHA16F_ARB:
+ return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16;
+ case GL_LUMINANCE_ALPHA32F_ARB:
+ return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32;
+ case GL_INTENSITY16F_ARB:
+ return MESA_FORMAT_INTENSITY_FLOAT16;
+ case GL_INTENSITY32F_ARB:
+ return MESA_FORMAT_INTENSITY_FLOAT32;
+ case GL_RGB16F_ARB:
+ return MESA_FORMAT_RGBA_FLOAT16;
+ case GL_RGB32F_ARB:
+ return MESA_FORMAT_RGBA_FLOAT32;
+ case GL_RGBA16F_ARB:
+ return MESA_FORMAT_RGBA_FLOAT16;
+ case GL_RGBA32F_ARB:
+ return MESA_FORMAT_RGBA_FLOAT32;
+
+ case GL_DEPTH_COMPONENT:
+ case GL_DEPTH_COMPONENT16:
+ case GL_DEPTH_COMPONENT24:
+ case GL_DEPTH_COMPONENT32:
+ case GL_DEPTH_STENCIL_EXT:
+ case GL_DEPTH24_STENCIL8_EXT:
+ return MESA_FORMAT_S8_Z24;
+
+ /* EXT_texture_sRGB */
+ case GL_SRGB:
+ case GL_SRGB8:
+ case GL_SRGB_ALPHA:
+ case GL_SRGB8_ALPHA8:
+ case GL_COMPRESSED_SRGB:
+ case GL_COMPRESSED_SRGB_ALPHA:
+ return MESA_FORMAT_SARGB8;
+
+ case GL_SLUMINANCE:
+ case GL_SLUMINANCE8:
+ case GL_COMPRESSED_SLUMINANCE:
+ return MESA_FORMAT_SL8;
+
+ case GL_SLUMINANCE_ALPHA:
+ case GL_SLUMINANCE8_ALPHA8:
+ case GL_COMPRESSED_SLUMINANCE_ALPHA:
+ return MESA_FORMAT_SLA8;
+
+ case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ return MESA_FORMAT_SRGB_DXT1;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ return MESA_FORMAT_SRGBA_DXT1;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ return MESA_FORMAT_SRGBA_DXT3;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ return MESA_FORMAT_SRGBA_DXT5;
+
+ default:
+ _mesa_problem(ctx,
+ "unexpected internalFormat 0x%x in %s",
+ (int)internalFormat, __func__);
+ return MESA_FORMAT_NONE;
+ }
+
+ return MESA_FORMAT_NONE; /* never get here */
+}
+
+/** Check if given image is valid within current texture object.
+ */
+static void teximage_assign_miptree(radeonContextPtr rmesa,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ radeonTexObj *t = radeon_tex_obj(texObj);
+ radeon_texture_image* image = get_radeon_texture_image(texImage);
+
+ /* Try using current miptree, or create new if there isn't any */
+ if (!t->mt || !radeon_miptree_matches_image(t->mt, texImage)) {
+ radeon_miptree_unreference(&t->mt);
+ t->mt = radeon_miptree_create_for_teximage(rmesa,
+ texObj,
+ texImage);
+
+ radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
+ "%s: texObj %p, texImage %p, "
+ "texObj miptree doesn't match, allocated new miptree %p\n",
+ __FUNCTION__, texObj, texImage, t->mt);
+ }
+
+ /* Miptree alocation may have failed,
+ * when there was no image for baselevel specified */
+ if (t->mt) {
+ radeon_miptree_reference(t->mt, &image->mt);
+ } else
+ radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+ "%s Failed to allocate miptree.\n", __func__);
+}
+
+unsigned radeonIsFormatRenderable(gl_format mesa_format)
+{
+ if (mesa_format == _radeon_texformat_argb8888 || mesa_format == _radeon_texformat_rgb565 ||
+ mesa_format == _radeon_texformat_argb1555 || mesa_format == _radeon_texformat_argb4444)
+ return 1;
+
+ switch (mesa_format)
+ {
+ case MESA_FORMAT_Z16:
+ case MESA_FORMAT_S8_Z24:
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+#if FEATURE_OES_EGL_image
+void radeon_image_target_texture_2d(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage,
+ GLeglImageOES image_handle)
+{
+ radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+ radeonTexObj *t = radeon_tex_obj(texObj);
+ radeon_texture_image *radeonImage = get_radeon_texture_image(texImage);
+ __DRIscreen *screen;
+ __DRIimage *image;
+
+ screen = radeon->dri.screen;
+ image = screen->dri2.image->lookupEGLImage(screen, image_handle,
+ screen->loaderPrivate);
+ if (image == NULL)
+ return;
+
+ radeonFreeTextureImageBuffer(ctx, texImage);
+
+ texImage->Width = image->width;
+ texImage->Height = image->height;
+ texImage->Depth = 1;
+ texImage->_BaseFormat = GL_RGBA;
+ texImage->TexFormat = image->format;
+ radeonImage->base.RowStride = image->pitch;
+ texImage->InternalFormat = image->internal_format;
+
+ if(t->mt)
+ {
+ radeon_miptree_unreference(&t->mt);
+ t->mt = NULL;
+ }
+
+ /* NOTE: The following is *very* ugly and will probably break. But
+ I don't know how to deal with it, without creating a whole new
+ function like radeon_miptree_from_bo() so I'm going with the
+ easy but error-prone way. */
+
+ radeon_try_alloc_miptree(radeon, t);
+
+ radeon_miptree_reference(t->mt, &radeonImage->mt);
+
+ if (t->mt == NULL)
+ {
+ radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
+ "%s Failed to allocate miptree.\n", __func__);
+ return;
+ }
+
+ /* Particularly ugly: this is guaranteed to break, if image->bo is
+ not of the required size for a miptree. */
+ radeon_bo_unref(t->mt->bo);
+ radeon_bo_ref(image->bo);
+ t->mt->bo = image->bo;
+
+ if (!radeon_miptree_matches_image(t->mt, &radeonImage->base.Base))
+ fprintf(stderr, "miptree doesn't match image\n");
+}
+#endif
+
+gl_format _radeon_texformat_rgba8888 = MESA_FORMAT_NONE;
+gl_format _radeon_texformat_argb8888 = MESA_FORMAT_NONE;
+gl_format _radeon_texformat_rgb565 = MESA_FORMAT_NONE;
+gl_format _radeon_texformat_argb4444 = MESA_FORMAT_NONE;
+gl_format _radeon_texformat_argb1555 = MESA_FORMAT_NONE;
+gl_format _radeon_texformat_al88 = MESA_FORMAT_NONE;
+/*@}*/
+
+
+static void
+radeonInitTextureFormats(void)
+{
+ if (_mesa_little_endian()) {
+ _radeon_texformat_rgba8888 = MESA_FORMAT_RGBA8888;
+ _radeon_texformat_argb8888 = MESA_FORMAT_ARGB8888;
+ _radeon_texformat_rgb565 = MESA_FORMAT_RGB565;
+ _radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444;
+ _radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555;
+ _radeon_texformat_al88 = MESA_FORMAT_AL88;
+ }
+ else {
+ _radeon_texformat_rgba8888 = MESA_FORMAT_RGBA8888_REV;
+ _radeon_texformat_argb8888 = MESA_FORMAT_ARGB8888_REV;
+ _radeon_texformat_rgb565 = MESA_FORMAT_RGB565_REV;
+ _radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV;
+ _radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV;
+ _radeon_texformat_al88 = MESA_FORMAT_AL88_REV;
+ }
+}
+
+void
+radeon_init_common_texture_funcs(radeonContextPtr radeon,
+ struct dd_function_table *functions)
+{
+ functions->NewTextureImage = radeonNewTextureImage;
+ functions->DeleteTextureImage = radeonDeleteTextureImage;
+ functions->AllocTextureImageBuffer = radeonAllocTextureImageBuffer;
+ functions->FreeTextureImageBuffer = radeonFreeTextureImageBuffer;
+ functions->MapTextureImage = radeon_map_texture_image;
+ functions->UnmapTextureImage = radeon_unmap_texture_image;
+
+ functions->ChooseTextureFormat = radeonChooseTextureFormat_mesa;
+
+ functions->CopyTexSubImage = radeonCopyTexSubImage;
+
+ functions->Bitmap = _mesa_meta_Bitmap;
+#if FEATURE_OES_EGL_image
+ functions->EGLImageTargetTexture2D = radeon_image_target_texture_2d;
+#endif
+
+ radeonInitTextureFormats();
+}
+
+static void
+radeon_swrast_map_image(radeonContextPtr rmesa,
+ radeon_texture_image *image)
+{
+ GLuint level, face;
+ radeon_mipmap_tree *mt;
+ GLuint texel_size;
+ radeon_mipmap_level *lvl;
+ int rs;
+
+ if (!image || !image->mt)
+ return;
+
+ texel_size = _mesa_get_format_bytes(image->base.Base.TexFormat);
+ level = image->base.Base.Level;
+ face = image->base.Base.Face;
+ mt = image->mt;
+
+ lvl = &image->mt->levels[level];
+
+ rs = lvl->rowstride / texel_size;
+
+ radeon_bo_map(mt->bo, 1);
+
+ image->base.Map = mt->bo->ptr + lvl->faces[face].offset;
+ if (mt->target == GL_TEXTURE_3D) {
+ int i;
+
+ for (i = 0; i < mt->levels[level].depth; i++)
+ image->base.ImageOffsets[i] = rs * lvl->height * i;
+ }
+ image->base.RowStride = rs;
+}
+
+static void
+radeon_swrast_unmap_image(radeonContextPtr rmesa,
+ radeon_texture_image *image)
+{
+ if (image && image->mt) {
+ image->base.Map = NULL;
+ radeon_bo_unmap(image->mt->bo);
+ }
+}
+
+void
+radeon_swrast_map_texture_images(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint nr_faces = _mesa_num_tex_faces(texObj->Target);
+ int i, face;
+
+ for (i = texObj->BaseLevel; i <= texObj->_MaxLevel; i++) {
+ for (face = 0; face < nr_faces; face++) {
+ radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][i]);
+ radeon_swrast_map_image(rmesa, image);
+ }
+ }
+}
+
+void
+radeon_swrast_unmap_texture_images(struct gl_context *ctx,
+ struct gl_texture_object *texObj)
+{
+ radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
+ GLuint nr_faces = _mesa_num_tex_faces(texObj->Target);
+ int i, face;
+
+ for (i = texObj->BaseLevel; i <= texObj->_MaxLevel; i++) {
+ for (face = 0; face < nr_faces; face++) {
+ radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][i]);
+ radeon_swrast_unmap_image(rmesa, image);
+ }
+ }
+
+}
+
+static radeon_mipmap_tree *radeon_miptree_create_for_teximage(radeonContextPtr rmesa,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
+{
+ radeonTexObj *t = radeon_tex_obj(texObj);
+ GLuint firstLevel;
+ GLuint lastLevel;
+ int width, height, depth;
+ int i;
+
+ width = texImage->Width;
+ height = texImage->Height;
+ depth = texImage->Depth;
+
+ if (texImage->Level > texObj->BaseLevel &&
+ (width == 1 ||
+ (texObj->Target != GL_TEXTURE_1D && height == 1) ||
+ (texObj->Target == GL_TEXTURE_3D && depth == 1))) {
+ /* For this combination, we're at some lower mipmap level and
+ * some important dimension is 1. We can't extrapolate up to a
+ * likely base level width/height/depth for a full mipmap stack
+ * from this info, so just allocate this one level.
+ */
+ firstLevel = texImage->Level;
+ lastLevel = texImage->Level;
+ } else {
+ if (texImage->Level < texObj->BaseLevel)
+ firstLevel = 0;
+ else
+ firstLevel = texObj->BaseLevel;
+
+ for (i = texImage->Level; i > firstLevel; i--) {
+ width <<= 1;
+ if (height != 1)
+ height <<= 1;
+ if (depth != 1)
+ depth <<= 1;
+ }
+ if ((texObj->Sampler.MinFilter == GL_NEAREST ||
+ texObj->Sampler.MinFilter == GL_LINEAR) &&
+ texImage->Level == firstLevel) {
+ lastLevel = firstLevel;
+ } else {
+ lastLevel = firstLevel + _mesa_logbase2(MAX2(MAX2(width, height), depth));
+ }
+ }
+
+ return radeon_miptree_create(rmesa, texObj->Target,
+ texImage->TexFormat, firstLevel, lastLevel - firstLevel + 1,
+ width, height, depth,
+ t->tile_bits);
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.h
index 17fac3d5ea5..88aace840bb 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_texture.h
@@ -1 +1,91 @@
-../radeon/radeon_texture.h \ No newline at end of file
+/*
+ * Copyright (C) 2008 Nicolai Haehnle.
+ * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
+ *
+ * The Weather Channel (TM) funded Tungsten Graphics to develop the
+ * initial release of the Radeon 8500 driver under the XFree86 license.
+ * This notice must be preserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef RADEON_TEXTURE_H
+#define RADEON_TEXTURE_H
+
+#include "main/formats.h"
+#include "main/mfeatures.h"
+
+extern gl_format _radeon_texformat_rgba8888;
+extern gl_format _radeon_texformat_argb8888;
+extern gl_format _radeon_texformat_rgb565;
+extern gl_format _radeon_texformat_argb4444;
+extern gl_format _radeon_texformat_argb1555;
+extern gl_format _radeon_texformat_al88;
+
+extern
+void copy_rows(void* dst, GLuint dststride, const void* src, GLuint srcstride,
+ GLuint numrows, GLuint rowsize);
+struct gl_texture_image *radeonNewTextureImage(struct gl_context *ctx);
+void radeonFreeTextureImageBuffer(struct gl_context *ctx, struct gl_texture_image *timage);
+
+void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable);
+void radeon_teximage_unmap(radeon_texture_image *image);
+int radeon_validate_texture_miptree(struct gl_context * ctx,
+ struct gl_sampler_object *samp,
+ struct gl_texture_object *texObj);
+
+
+void radeon_swrast_map_texture_images(struct gl_context *ctx, struct gl_texture_object *texObj);
+void radeon_swrast_unmap_texture_images(struct gl_context *ctx, struct gl_texture_object *texObj);
+
+gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
+ GLenum target,
+ GLint internalFormat,
+ GLenum format,
+ GLenum type);
+
+gl_format radeonChooseTextureFormat(struct gl_context * ctx,
+ GLint internalFormat,
+ GLenum format,
+ GLenum type, GLboolean fbo);
+
+void radeonCopyTexSubImage(struct gl_context *ctx, GLuint dims,
+ struct gl_texture_image *texImage,
+ GLint xoffset, GLint yoffset, GLint zoffset,
+ struct gl_renderbuffer *rb,
+ GLint x, GLint y,
+ GLsizei width, GLsizei height);
+
+unsigned radeonIsFormatRenderable(gl_format mesa_format);
+
+#if FEATURE_OES_EGL_image
+void radeon_image_target_texture_2d(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage,
+ GLeglImageOES image_handle);
+#endif
+
+void
+radeon_init_common_texture_funcs(radeonContextPtr radeon,
+ struct dd_function_table *functions);
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.c b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.c
index d4bfe27da64..403da110106 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.c
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.c
@@ -1 +1,512 @@
-../radeon/radeon_tile.c \ No newline at end of file
+/*
+ * Copyright (C) 2010 Maciej Cencora <m.cencora@gmail.com>
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include "radeon_tile.h"
+
+#include <stdint.h>
+#include <string.h>
+
+#include "main/macros.h"
+#include "radeon_debug.h"
+
+#define MICRO_TILE_SIZE 32
+
+static void micro_tile_8_x_4_8bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current source row */
+ unsigned col; /* current source column */
+ unsigned k; /* number of processed tiles */
+ const unsigned tile_width = 8, tile_height = 4;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint8_t *src2 = (uint8_t *)src + src_pitch * row + col;
+ uint8_t *dst2 = (uint8_t *)dst + row * dst_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint8_t);
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint8_t));
+ dst2 += tile_width;
+ src2 += src_pitch;
+ }
+ }
+ }
+}
+
+static void micro_tile_4_x_4_16bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current source row */
+ unsigned col; /* current source column */
+ unsigned k; /* number of processed tiles */
+ const unsigned tile_width = 4, tile_height = 4;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint16_t *src2 = (uint16_t *)src + src_pitch * row + col;
+ uint16_t *dst2 = (uint16_t *)dst + row * dst_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint16_t);
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint16_t));
+ dst2 += tile_width;
+ src2 += src_pitch;
+ }
+ }
+ }
+}
+
+static void micro_tile_8_x_2_16bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current source row */
+ unsigned col; /* current source column */
+ unsigned k; /* number of processed tiles */
+ const unsigned tile_width = 8, tile_height = 2;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint16_t *src2 = (uint16_t *)src + src_pitch * row + col;
+ uint16_t *dst2 = (uint16_t *)dst + row * dst_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint16_t);
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint16_t));
+ dst2 += tile_width;
+ src2 += src_pitch;
+ }
+ }
+ }
+}
+
+static void micro_tile_4_x_2_32bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current source row */
+ unsigned col; /* current source column */
+ unsigned k; /* number of processed tiles */
+ const unsigned tile_width = 4, tile_height = 2;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint32_t *src2 = (uint32_t *)src + src_pitch * row + col;
+ uint32_t *dst2 = (uint32_t *)dst + row * dst_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint32_t);
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint32_t));
+ dst2 += tile_width;
+ src2 += src_pitch;
+ }
+ }
+ }
+}
+
+static void micro_tile_2_x_2_64bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current source row */
+ unsigned col; /* current source column */
+ unsigned k; /* number of processed tiles */
+ const unsigned tile_width = 2, tile_height = 2;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint64_t *src2 = (uint64_t *)src + src_pitch * row + col;
+ uint64_t *dst2 = (uint64_t *)dst + row * dst_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint64_t);
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint64_t));
+ dst2 += tile_width;
+ src2 += src_pitch;
+ }
+ }
+ }
+}
+
+static void micro_tile_1_x_1_128bit(const void * src, unsigned src_pitch,
+ void * dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned i, j;
+ const unsigned elem_size = 16; /* sizeof(uint128_t) */
+
+ for (j = 0; j < height; ++j)
+ {
+ for (i = 0; i < width; ++i)
+ {
+ memcpy(dst, src, width * elem_size);
+ dst += dst_pitch * elem_size;
+ src += src_pitch * elem_size;
+ }
+ }
+}
+
+void tile_image(const void * src, unsigned src_pitch,
+ void *dst, unsigned dst_pitch,
+ gl_format format, unsigned width, unsigned height)
+{
+ assert(src_pitch >= width);
+ assert(dst_pitch >= width);
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "Software tiling: src_pitch %d, dst_pitch %d, width %d, height %d, bpp %d\n",
+ src_pitch, dst_pitch, width, height, _mesa_get_format_bytes(format));
+
+ switch (_mesa_get_format_bytes(format))
+ {
+ case 16:
+ micro_tile_1_x_1_128bit(src, src_pitch, dst, dst_pitch, width, height);
+ break;
+ case 8:
+ micro_tile_2_x_2_64bit(src, src_pitch, dst, dst_pitch, width, height);
+ break;
+ case 4:
+ micro_tile_4_x_2_32bit(src, src_pitch, dst, dst_pitch, width, height);
+ break;
+ case 2:
+ if (_mesa_get_format_bits(format, GL_DEPTH_BITS))
+ {
+ micro_tile_4_x_4_16bit(src, src_pitch, dst, dst_pitch, width, height);
+ }
+ else
+ {
+ micro_tile_8_x_2_16bit(src, src_pitch, dst, dst_pitch, width, height);
+ }
+ break;
+ case 1:
+ micro_tile_8_x_4_8bit(src, src_pitch, dst, dst_pitch, width, height);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+}
+
+static void micro_untile_8_x_4_8bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current destination row */
+ unsigned col; /* current destination column */
+ unsigned k; /* current tile number */
+ const unsigned tile_width = 8, tile_height = 4;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ assert(src_pitch % tile_width == 0);
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint8_t *src2 = (uint8_t *)src + row * src_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint8_t);
+ uint8_t *dst2 = (uint8_t *)dst + dst_pitch * row + col;
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint8_t));
+ dst2 += dst_pitch;
+ src2 += tile_width;
+ }
+ }
+ }
+}
+
+static void micro_untile_8_x_2_16bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current destination row */
+ unsigned col; /* current destination column */
+ unsigned k; /* current tile number */
+ const unsigned tile_width = 8, tile_height = 2;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ assert(src_pitch % tile_width == 0);
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint16_t *src2 = (uint16_t *)src + row * src_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint16_t);
+ uint16_t *dst2 = (uint16_t *)dst + dst_pitch * row + col;
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint16_t));
+ dst2 += dst_pitch;
+ src2 += tile_width;
+ }
+ }
+ }
+}
+
+static void micro_untile_4_x_4_16bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current destination row */
+ unsigned col; /* current destination column */
+ unsigned k; /* current tile number */
+ const unsigned tile_width = 4, tile_height = 4;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ assert(src_pitch % tile_width == 0);
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint16_t *src2 = (uint16_t *)src + row * src_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint16_t);
+ uint16_t *dst2 = (uint16_t *)dst + dst_pitch * row + col;
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint16_t));
+ dst2 += dst_pitch;
+ src2 += tile_width;
+ }
+ }
+ }
+}
+
+static void micro_untile_4_x_2_32bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current destination row */
+ unsigned col; /* current destination column */
+ unsigned k; /* current tile number */
+ const unsigned tile_width = 4, tile_height = 2;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ assert(src_pitch % tile_width == 0);
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint32_t *src2 = (uint32_t *)src + row * src_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint32_t);
+ uint32_t *dst2 = (uint32_t *)dst + dst_pitch * row + col;
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint32_t));
+ dst2 += dst_pitch;
+ src2 += tile_width;
+ }
+ }
+ }
+}
+
+static void micro_untile_2_x_2_64bit(const void * const src, unsigned src_pitch,
+ void * const dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned row; /* current destination row */
+ unsigned col; /* current destination column */
+ unsigned k; /* current tile number */
+ const unsigned tile_width = 2, tile_height = 2;
+ const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width;
+
+ assert(src_pitch % tile_width == 0);
+
+ k = 0;
+ for (row = 0; row < height; row += tile_height)
+ {
+ for (col = 0; col < width; col += tile_width, ++k)
+ {
+ uint64_t *src2 = (uint64_t *)src + row * src_pitch +
+ (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint64_t);
+ uint64_t *dst2 = (uint64_t *)dst + dst_pitch * row + col;
+ unsigned j;
+
+ for (j = 0; j < MIN2(tile_height, height - row); ++j)
+ {
+ unsigned columns = MIN2(tile_width, width - col);
+ memcpy(dst2, src2, columns * sizeof(uint64_t));
+ dst2 += dst_pitch;
+ src2 += tile_width;
+ }
+ }
+ }
+}
+
+static void micro_untile_1_x_1_128bit(const void * src, unsigned src_pitch,
+ void * dst, unsigned dst_pitch,
+ unsigned width, unsigned height)
+{
+ unsigned i, j;
+ const unsigned elem_size = 16; /* sizeof(uint128_t) */
+
+ for (j = 0; j < height; ++j)
+ {
+ for (i = 0; i < width; ++i)
+ {
+ memcpy(dst, src, width * elem_size);
+ dst += dst_pitch * elem_size;
+ src += src_pitch * elem_size;
+ }
+ }
+}
+
+void untile_image(const void * src, unsigned src_pitch,
+ void *dst, unsigned dst_pitch,
+ gl_format format, unsigned width, unsigned height)
+{
+ assert(src_pitch >= width);
+ assert(dst_pitch >= width);
+
+ radeon_print(RADEON_TEXTURE, RADEON_TRACE,
+ "Software untiling: src_pitch %d, dst_pitch %d, width %d, height %d, bpp %d\n",
+ src_pitch, dst_pitch, width, height, _mesa_get_format_bytes(format));
+
+ switch (_mesa_get_format_bytes(format))
+ {
+ case 16:
+ micro_untile_1_x_1_128bit(src, src_pitch, dst, dst_pitch, width, height);
+ break;
+ case 8:
+ micro_untile_2_x_2_64bit(src, src_pitch, dst, dst_pitch, width, height);
+ break;
+ case 4:
+ micro_untile_4_x_2_32bit(src, src_pitch, dst, dst_pitch, width, height);
+ break;
+ case 2:
+ if (_mesa_get_format_bits(format, GL_DEPTH_BITS))
+ {
+ micro_untile_4_x_4_16bit(src, src_pitch, dst, dst_pitch, width, height);
+ }
+ else
+ {
+ micro_untile_8_x_2_16bit(src, src_pitch, dst, dst_pitch, width, height);
+ }
+ break;
+ case 1:
+ micro_untile_8_x_4_8bit(src, src_pitch, dst, dst_pitch, width, height);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+}
+
+void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height)
+{
+ switch (_mesa_get_format_bytes(format))
+ {
+ case 16:
+ *block_width = 1;
+ *block_height = 1;
+ break;
+ case 8:
+ *block_width = 2;
+ *block_height = 2;
+ break;
+ case 4:
+ *block_width = 4;
+ *block_height = 2;
+ break;
+ case 2:
+ if (_mesa_get_format_bits(format, GL_DEPTH_BITS))
+ {
+ *block_width = 4;
+ *block_height = 4;
+ }
+ else
+ {
+ *block_width = 8;
+ *block_height = 2;
+ }
+ break;
+ case 1:
+ *block_width = 8;
+ *block_height = 4;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+}
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.h
index 31074c581ea..31d9c5611c3 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/radeon_tile.h
@@ -1 +1,38 @@
-../radeon/radeon_tile.h \ No newline at end of file
+/*
+ * Copyright (C) 2010 Maciej Cencora <m.cencora@gmail.com>
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#include <main/formats.h>
+
+void tile_image(const void * src, unsigned src_pitch,
+ void *dst, unsigned dst_pitch,
+ gl_format format, unsigned width, unsigned height);
+
+void untile_image(const void * src, unsigned src_pitch,
+ void *dst, unsigned dst_pitch,
+ gl_format format, unsigned width, unsigned height);
+
+void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height);
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_dri.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_dri.h
index 27c591d3c9d..dc513721075 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_dri.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_dri.h
@@ -1 +1,115 @@
-../../radeon/server/radeon_dri.h \ No newline at end of file
+/**
+ * \file server/radeon_dri.h
+ * \brief Radeon server-side structures.
+ *
+ * \author Kevin E. Martin <martin@xfree86.org>
+ * \author Rickard E. Faith <faith@valinux.com>
+ */
+
+/*
+ * Copyright 2000 ATI Technologies Inc., Markham, Ontario,
+ * VA Linux Systems Inc., Fremont, California.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
+ * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef _RADEON_DRI_
+#define _RADEON_DRI_
+
+#include "xf86drm.h"
+#include "drm.h"
+#include "radeon_drm.h"
+
+/* DRI Driver defaults */
+#define RADEON_DEFAULT_CP_PIO_MODE RADEON_CSQ_PRIPIO_INDPIO
+#define RADEON_DEFAULT_CP_BM_MODE RADEON_CSQ_PRIBM_INDBM
+#define RADEON_DEFAULT_AGP_MODE 1
+#define RADEON_DEFAULT_AGP_FAST_WRITE 0
+#define RADEON_DEFAULT_AGP_SIZE 8 /* MB (must be 2^n and > 4MB) */
+#define RADEON_DEFAULT_RING_SIZE 1 /* MB (must be page aligned) */
+#define RADEON_DEFAULT_BUFFER_SIZE 2 /* MB (must be page aligned) */
+#define RADEON_DEFAULT_AGP_TEX_SIZE 1 /* MB (must be page aligned) */
+#define RADEON_DEFAULT_CP_TIMEOUT 10000 /* usecs */
+#define RADEON_DEFAULT_PAGE_FLIP 0 /* page flipping diabled */
+#define RADEON_BUFFER_ALIGN 0x00000fff
+
+/**
+ * \brief Radeon DRI driver private data.
+ */
+typedef struct {
+ /**
+ * \name DRI screen private data
+ */
+ /*@{*/
+ int deviceID; /**< \brief PCI device ID */
+ int width; /**< \brief width in pixels of display */
+ int height; /**< \brief height in scanlines of display */
+ int depth; /**< \brief depth of display (8, 15, 16, 24) */
+ int bpp; /**< \brief bit depth of display (8, 16, 24, 32) */
+
+ int IsPCI; /**< \brief is current card a PCI card? */
+ int AGPMode; /**< \brief AGP mode */
+
+ int frontOffset; /**< \brief front buffer offset */
+ int frontPitch; /**< \brief front buffer pitch */
+ int backOffset; /**< \brief shared back buffer offset */
+ int backPitch; /**< \brief shared back buffer pitch */
+ int depthOffset; /**< \brief shared depth buffer offset */
+ int depthPitch; /**< \brief shared depth buffer pitch */
+ int textureOffset; /**< \brief start of texture data in frame buffer */
+ int textureSize; /**< \brief size of texture date */
+ int log2TexGran; /**< \brief log2 texture granularity */
+ /*@}*/
+
+ /**
+ * \name MMIO register data
+ */
+ /*@{*/
+ drm_handle_t registerHandle; /**< \brief MMIO register map size */
+ drmSize registerSize; /**< \brief MMIO register map handle */
+ /*@}*/
+
+ /**
+ * \name CP in-memory status information
+ */
+ /*@{*/
+ drm_handle_t statusHandle; /**< \brief status map handle */
+ drmSize statusSize; /**< \brief status map size */
+ /*@}*/
+
+ /**
+ * \name CP AGP Texture data
+ */
+ /*@{*/
+ drm_handle_t gartTexHandle; /**< \brief AGP texture area map handle */
+ drmSize gartTexMapSize; /**< \brief AGP texture area map size */
+ int log2GARTTexGran; /**< \brief AGP texture granularity in log base 2 */
+ int gartTexOffset; /**< \brief AGP texture area offset in AGP space */
+ /*@}*/
+
+ unsigned int sarea_priv_offset; /**< \brief offset of the private SAREA data*/
+} RADEONDRIRec, *RADEONDRIPtr;
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_macros.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_macros.h
index c56cd735b83..355262c9bab 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_macros.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_macros.h
@@ -1 +1,128 @@
-../../radeon/server/radeon_macros.h \ No newline at end of file
+/**
+ * \file server/radeon_macros.h
+ * \brief Macros for Radeon MMIO operation.
+ *
+ * \authors Kevin E. Martin <martin@xfree86.org>
+ * \authors Rickard E. Faith <faith@valinux.com>
+ * \authors Alan Hourihane <alanh@fairlite.demon.co.uk>
+ */
+
+/*
+ * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
+ * VA Linux Systems Inc., Fremont, California.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
+ * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef _RADEON_MACROS_H_
+#define _RADEON_MACROS_H_
+
+#include <mmio.h>
+
+# define MMIO_IN8(base, offset) \
+ *(volatile unsigned char *)(((unsigned char*)(base)) + (offset))
+# define MMIO_IN32(base, offset) \
+ read_MMIO_LE32(base, offset)
+# define MMIO_OUT8(base, offset, val) \
+ *(volatile unsigned char *)(((unsigned char*)(base)) + (offset)) = (val)
+# define MMIO_OUT32(base, offset, val) \
+ *(volatile unsigned int *)(void *)(((unsigned char*)(base)) + (offset)) = CPU_TO_LE32(val)
+
+
+ /* Memory mapped register access macros */
+#define INREG8(addr) MMIO_IN8(RADEONMMIO, addr)
+#define INREG(addr) MMIO_IN32(RADEONMMIO, addr)
+#define OUTREG8(addr, val) MMIO_OUT8(RADEONMMIO, addr, val)
+#define OUTREG(addr, val) MMIO_OUT32(RADEONMMIO, addr, val)
+
+#define ADDRREG(addr) ((volatile GLuint *)(pointer)(RADEONMMIO + (addr)))
+
+
+#define OUTREGP(addr, val, mask) \
+do { \
+ GLuint tmp = INREG(addr); \
+ tmp &= (mask); \
+ tmp |= (val); \
+ OUTREG(addr, tmp); \
+} while (0)
+
+#define INPLL(dpy, addr) RADEONINPLL(dpy, addr)
+
+#define OUTPLL(addr, val) \
+do { \
+ OUTREG8(RADEON_CLOCK_CNTL_INDEX, (((addr) & 0x3f) | \
+ RADEON_PLL_WR_EN)); \
+ OUTREG(RADEON_CLOCK_CNTL_DATA, val); \
+} while (0)
+
+#define OUTPLLP(dpy, addr, val, mask) \
+do { \
+ GLuint tmp = INPLL(dpy, addr); \
+ tmp &= (mask); \
+ tmp |= (val); \
+ OUTPLL(addr, tmp); \
+} while (0)
+
+#define OUTPAL_START(idx) \
+do { \
+ OUTREG8(RADEON_PALETTE_INDEX, (idx)); \
+} while (0)
+
+#define OUTPAL_NEXT(r, g, b) \
+do { \
+ OUTREG(RADEON_PALETTE_DATA, ((r) << 16) | ((g) << 8) | (b)); \
+} while (0)
+
+#define OUTPAL_NEXT_CARD32(v) \
+do { \
+ OUTREG(RADEON_PALETTE_DATA, (v & 0x00ffffff)); \
+} while (0)
+
+#define OUTPAL(idx, r, g, b) \
+do { \
+ OUTPAL_START((idx)); \
+ OUTPAL_NEXT((r), (g), (b)); \
+} while (0)
+
+#define INPAL_START(idx) \
+do { \
+ OUTREG(RADEON_PALETTE_INDEX, (idx) << 16); \
+} while (0)
+
+#define INPAL_NEXT() INREG(RADEON_PALETTE_DATA)
+
+#define PAL_SELECT(idx) \
+do { \
+ if (!idx) { \
+ OUTREG(RADEON_DAC_CNTL2, INREG(RADEON_DAC_CNTL2) & \
+ (GLuint)~RADEON_DAC2_PALETTE_ACC_CTL); \
+ } else { \
+ OUTREG(RADEON_DAC_CNTL2, INREG(RADEON_DAC_CNTL2) | \
+ RADEON_DAC2_PALETTE_ACC_CTL); \
+ } \
+} while (0)
+
+
+#endif
diff --git a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_reg.h b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_reg.h
index e2349dcb685..7ba5b38c4cb 120000..100644
--- a/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_reg.h
+++ b/chromium/third_party/mesa/src/src/mesa/drivers/dri/r200/server/radeon_reg.h
@@ -1 +1,2163 @@
-../../radeon/server/radeon_reg.h \ No newline at end of file
+/*
+ * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
+ * VA Linux Systems Inc., Fremont, California.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
+ * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@xfree86.org>
+ * Rickard E. Faith <faith@valinux.com>
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>
+ *
+ * References:
+ *
+ * !!!! FIXME !!!!
+ * RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical
+ * Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April
+ * 1999.
+ *
+ * !!!! FIXME !!!!
+ * RAGE 128 Software Development Manual (Technical Reference Manual P/N
+ * SDK-G04000 Rev. 0.01), ATI Technologies: June 1999.
+ *
+ */
+
+/* !!!! FIXME !!!! NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h
+ * AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT
+ * ON THE RADEON. A FULL AUDIT OF THIS CODE IS NEEDED! */
+
+#ifndef _RADEON_REG_H_
+#define _RADEON_REG_H_
+
+ /* Registers for 2D/Video/Overlay */
+#define RADEON_ADAPTER_ID 0x0f2c /* PCI */
+#define RADEON_AGP_BASE 0x0170
+#define RADEON_AGP_CNTL 0x0174
+# define RADEON_AGP_APER_SIZE_256MB (0x00 << 0)
+# define RADEON_AGP_APER_SIZE_128MB (0x20 << 0)
+# define RADEON_AGP_APER_SIZE_64MB (0x30 << 0)
+# define RADEON_AGP_APER_SIZE_32MB (0x38 << 0)
+# define RADEON_AGP_APER_SIZE_16MB (0x3c << 0)
+# define RADEON_AGP_APER_SIZE_8MB (0x3e << 0)
+# define RADEON_AGP_APER_SIZE_4MB (0x3f << 0)
+# define RADEON_AGP_APER_SIZE_MASK (0x3f << 0)
+#define RADEON_AGP_COMMAND 0x0f60 /* PCI */
+#define RADEON_AGP_COMMAND_PCI_CONFIG 0x0060 /* offset in PCI config*/
+# define RADEON_AGP_ENABLE (1<<8)
+#define RADEON_AGP_PLL_CNTL 0x000b /* PLL */
+#define RADEON_AGP_STATUS 0x0f5c /* PCI */
+# define RADEON_AGP_1X_MODE 0x01
+# define RADEON_AGP_2X_MODE 0x02
+# define RADEON_AGP_4X_MODE 0x04
+# define RADEON_AGP_FW_MODE 0x10
+# define RADEON_AGP_MODE_MASK 0x17
+#define RADEON_ATTRDR 0x03c1 /* VGA */
+#define RADEON_ATTRDW 0x03c0 /* VGA */
+#define RADEON_ATTRX 0x03c0 /* VGA */
+#define RADEON_AUX_SC_CNTL 0x1660
+# define RADEON_AUX1_SC_EN (1 << 0)
+# define RADEON_AUX1_SC_MODE_OR (0 << 1)
+# define RADEON_AUX1_SC_MODE_NAND (1 << 1)
+# define RADEON_AUX2_SC_EN (1 << 2)
+# define RADEON_AUX2_SC_MODE_OR (0 << 3)
+# define RADEON_AUX2_SC_MODE_NAND (1 << 3)
+# define RADEON_AUX3_SC_EN (1 << 4)
+# define RADEON_AUX3_SC_MODE_OR (0 << 5)
+# define RADEON_AUX3_SC_MODE_NAND (1 << 5)
+#define RADEON_AUX1_SC_BOTTOM 0x1670
+#define RADEON_AUX1_SC_LEFT 0x1664
+#define RADEON_AUX1_SC_RIGHT 0x1668
+#define RADEON_AUX1_SC_TOP 0x166c
+#define RADEON_AUX2_SC_BOTTOM 0x1680
+#define RADEON_AUX2_SC_LEFT 0x1674
+#define RADEON_AUX2_SC_RIGHT 0x1678
+#define RADEON_AUX2_SC_TOP 0x167c
+#define RADEON_AUX3_SC_BOTTOM 0x1690
+#define RADEON_AUX3_SC_LEFT 0x1684
+#define RADEON_AUX3_SC_RIGHT 0x1688
+#define RADEON_AUX3_SC_TOP 0x168c
+#define RADEON_AUX_WINDOW_HORZ_CNTL 0x02d8
+#define RADEON_AUX_WINDOW_VERT_CNTL 0x02dc
+
+#define RADEON_BASE_CODE 0x0f0b
+#define RADEON_BIOS_0_SCRATCH 0x0010
+#define RADEON_BIOS_1_SCRATCH 0x0014
+#define RADEON_BIOS_2_SCRATCH 0x0018
+#define RADEON_BIOS_3_SCRATCH 0x001c
+#define RADEON_BIOS_4_SCRATCH 0x0020
+#define RADEON_BIOS_5_SCRATCH 0x0024
+#define RADEON_BIOS_6_SCRATCH 0x0028
+#define RADEON_BIOS_7_SCRATCH 0x002c
+#define RADEON_BIOS_ROM 0x0f30 /* PCI */
+#define RADEON_BIST 0x0f0f /* PCI */
+#define RADEON_BRUSH_DATA0 0x1480
+#define RADEON_BRUSH_DATA1 0x1484
+#define RADEON_BRUSH_DATA10 0x14a8
+#define RADEON_BRUSH_DATA11 0x14ac
+#define RADEON_BRUSH_DATA12 0x14b0
+#define RADEON_BRUSH_DATA13 0x14b4
+#define RADEON_BRUSH_DATA14 0x14b8
+#define RADEON_BRUSH_DATA15 0x14bc
+#define RADEON_BRUSH_DATA16 0x14c0
+#define RADEON_BRUSH_DATA17 0x14c4
+#define RADEON_BRUSH_DATA18 0x14c8
+#define RADEON_BRUSH_DATA19 0x14cc
+#define RADEON_BRUSH_DATA2 0x1488
+#define RADEON_BRUSH_DATA20 0x14d0
+#define RADEON_BRUSH_DATA21 0x14d4
+#define RADEON_BRUSH_DATA22 0x14d8
+#define RADEON_BRUSH_DATA23 0x14dc
+#define RADEON_BRUSH_DATA24 0x14e0
+#define RADEON_BRUSH_DATA25 0x14e4
+#define RADEON_BRUSH_DATA26 0x14e8
+#define RADEON_BRUSH_DATA27 0x14ec
+#define RADEON_BRUSH_DATA28 0x14f0
+#define RADEON_BRUSH_DATA29 0x14f4
+#define RADEON_BRUSH_DATA3 0x148c
+#define RADEON_BRUSH_DATA30 0x14f8
+#define RADEON_BRUSH_DATA31 0x14fc
+#define RADEON_BRUSH_DATA32 0x1500
+#define RADEON_BRUSH_DATA33 0x1504
+#define RADEON_BRUSH_DATA34 0x1508
+#define RADEON_BRUSH_DATA35 0x150c
+#define RADEON_BRUSH_DATA36 0x1510
+#define RADEON_BRUSH_DATA37 0x1514
+#define RADEON_BRUSH_DATA38 0x1518
+#define RADEON_BRUSH_DATA39 0x151c
+#define RADEON_BRUSH_DATA4 0x1490
+#define RADEON_BRUSH_DATA40 0x1520
+#define RADEON_BRUSH_DATA41 0x1524
+#define RADEON_BRUSH_DATA42 0x1528
+#define RADEON_BRUSH_DATA43 0x152c
+#define RADEON_BRUSH_DATA44 0x1530
+#define RADEON_BRUSH_DATA45 0x1534
+#define RADEON_BRUSH_DATA46 0x1538
+#define RADEON_BRUSH_DATA47 0x153c
+#define RADEON_BRUSH_DATA48 0x1540
+#define RADEON_BRUSH_DATA49 0x1544
+#define RADEON_BRUSH_DATA5 0x1494
+#define RADEON_BRUSH_DATA50 0x1548
+#define RADEON_BRUSH_DATA51 0x154c
+#define RADEON_BRUSH_DATA52 0x1550
+#define RADEON_BRUSH_DATA53 0x1554
+#define RADEON_BRUSH_DATA54 0x1558
+#define RADEON_BRUSH_DATA55 0x155c
+#define RADEON_BRUSH_DATA56 0x1560
+#define RADEON_BRUSH_DATA57 0x1564
+#define RADEON_BRUSH_DATA58 0x1568
+#define RADEON_BRUSH_DATA59 0x156c
+#define RADEON_BRUSH_DATA6 0x1498
+#define RADEON_BRUSH_DATA60 0x1570
+#define RADEON_BRUSH_DATA61 0x1574
+#define RADEON_BRUSH_DATA62 0x1578
+#define RADEON_BRUSH_DATA63 0x157c
+#define RADEON_BRUSH_DATA7 0x149c
+#define RADEON_BRUSH_DATA8 0x14a0
+#define RADEON_BRUSH_DATA9 0x14a4
+#define RADEON_BRUSH_SCALE 0x1470
+#define RADEON_BRUSH_Y_X 0x1474
+#define RADEON_BUS_CNTL 0x0030
+# define RADEON_BUS_MASTER_DIS (1 << 6)
+# define RADEON_BUS_RD_DISCARD_EN (1 << 24)
+# define RADEON_BUS_RD_ABORT_EN (1 << 25)
+# define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28)
+# define RADEON_BUS_WRT_BURST (1 << 29)
+# define RADEON_BUS_READ_BURST (1 << 30)
+#define RADEON_BUS_CNTL1 0x0034
+# define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4)
+
+#define RADEON_CACHE_CNTL 0x1724
+#define RADEON_CACHE_LINE 0x0f0c /* PCI */
+#define RADEON_CAP0_TRIG_CNTL 0x0950 /* ? */
+#define RADEON_CAP1_TRIG_CNTL 0x09c0 /* ? */
+#define RADEON_CAPABILITIES_ID 0x0f50 /* PCI */
+#define RADEON_CAPABILITIES_PTR 0x0f34 /* PCI */
+#define RADEON_CLK_PIN_CNTL 0x0001 /* PLL */
+#define RADEON_CLOCK_CNTL_DATA 0x000c
+#define RADEON_CLOCK_CNTL_INDEX 0x0008
+# define RADEON_PLL_WR_EN (1 << 7)
+# define RADEON_PLL_DIV_SEL (3 << 8)
+# define RADEON_PLL2_DIV_SEL_MASK ~(3 << 8)
+#define RADEON_CLR_CMP_CLR_3D 0x1a24
+#define RADEON_CLR_CMP_CLR_DST 0x15c8
+#define RADEON_CLR_CMP_CLR_SRC 0x15c4
+#define RADEON_CLR_CMP_CNTL 0x15c0
+# define RADEON_SRC_CMP_EQ_COLOR (4 << 0)
+# define RADEON_SRC_CMP_NEQ_COLOR (5 << 0)
+# define RADEON_CLR_CMP_SRC_SOURCE (1 << 24)
+#define RADEON_CLR_CMP_MASK 0x15cc
+# define RADEON_CLR_CMP_MSK 0xffffffff
+#define RADEON_CLR_CMP_MASK_3D 0x1A28
+#define RADEON_COMMAND 0x0f04 /* PCI */
+#define RADEON_COMPOSITE_SHADOW_ID 0x1a0c
+#define RADEON_CONFIG_APER_0_BASE 0x0100
+#define RADEON_CONFIG_APER_1_BASE 0x0104
+#define RADEON_CONFIG_APER_SIZE 0x0108
+#define RADEON_CONFIG_BONDS 0x00e8
+#define RADEON_CONFIG_CNTL 0x00e0
+# define RADEON_CFG_ATI_REV_A11 (0 << 16)
+# define RADEON_CFG_ATI_REV_A12 (1 << 16)
+# define RADEON_CFG_ATI_REV_A13 (2 << 16)
+# define RADEON_CFG_ATI_REV_ID_MASK (0xf << 16)
+#define RADEON_CONFIG_MEMSIZE 0x00f8
+#define RADEON_CONFIG_MEMSIZE_EMBEDDED 0x0114
+#define RADEON_CONFIG_REG_1_BASE 0x010c
+#define RADEON_CONFIG_REG_APER_SIZE 0x0110
+#define RADEON_CONFIG_XSTRAP 0x00e4
+#define RADEON_CONSTANT_COLOR_C 0x1d34
+# define RADEON_CONSTANT_COLOR_MASK 0x00ffffff
+# define RADEON_CONSTANT_COLOR_ONE 0x00ffffff
+# define RADEON_CONSTANT_COLOR_ZERO 0x00000000
+#define RADEON_CRC_CMDFIFO_ADDR 0x0740
+#define RADEON_CRC_CMDFIFO_DOUT 0x0744
+#define RADEON_GRPH_BUFFER_CNTL 0x02f0
+# define RADEON_GRPH_START_REQ_MASK (0x7f)
+# define RADEON_GRPH_START_REQ_SHIFT 0
+# define RADEON_GRPH_STOP_REQ_MASK (0x7f<<8)
+# define RADEON_GRPH_STOP_REQ_SHIFT 8
+# define RADEON_GRPH_CRITICAL_POINT_MASK (0x7f<<16)
+# define RADEON_GRPH_CRITICAL_POINT_SHIFT 16
+# define RADEON_GRPH_CRITICAL_CNTL (1<<28)
+# define RADEON_GRPH_BUFFER_SIZE (1<<29)
+# define RADEON_GRPH_CRITICAL_AT_SOF (1<<30)
+# define RADEON_GRPH_STOP_CNTL (1<<31)
+#define RADEON_GRPH2_BUFFER_CNTL 0x03f0
+# define RADEON_GRPH2_START_REQ_MASK (0x7f)
+# define RADEON_GRPH2_START_REQ_SHIFT 0
+# define RADEON_GRPH2_STOP_REQ_MASK (0x7f<<8)
+# define RADEON_GRPH2_STOP_REQ_SHIFT 8
+# define RADEON_GRPH2_CRITICAL_POINT_MASK (0x7f<<16)
+# define RADEON_GRPH2_CRITICAL_POINT_SHIFT 16
+# define RADEON_GRPH2_CRITICAL_CNTL (1<<28)
+# define RADEON_GRPH2_BUFFER_SIZE (1<<29)
+# define RADEON_GRPH2_CRITICAL_AT_SOF (1<<30)
+# define RADEON_GRPH2_STOP_CNTL (1<<31)
+#define RADEON_CRTC_CRNT_FRAME 0x0214
+#define RADEON_CRTC_EXT_CNTL 0x0054
+# define RADEON_CRTC_VGA_XOVERSCAN (1 << 0)
+# define RADEON_VGA_ATI_LINEAR (1 << 3)
+# define RADEON_XCRT_CNT_EN (1 << 6)
+# define RADEON_CRTC_HSYNC_DIS (1 << 8)
+# define RADEON_CRTC_VSYNC_DIS (1 << 9)
+# define RADEON_CRTC_DISPLAY_DIS (1 << 10)
+# define RADEON_CRTC_SYNC_TRISTAT (1 << 11)
+# define RADEON_CRTC_CRT_ON (1 << 15)
+#define RADEON_CRTC_EXT_CNTL_DPMS_BYTE 0x0055
+# define RADEON_CRTC_HSYNC_DIS_BYTE (1 << 0)
+# define RADEON_CRTC_VSYNC_DIS_BYTE (1 << 1)
+# define RADEON_CRTC_DISPLAY_DIS_BYTE (1 << 2)
+#define RADEON_CRTC_GEN_CNTL 0x0050
+# define RADEON_CRTC_DBL_SCAN_EN (1 << 0)
+# define RADEON_CRTC_INTERLACE_EN (1 << 1)
+# define RADEON_CRTC_CSYNC_EN (1 << 4)
+# define RADEON_CRTC_CUR_EN (1 << 16)
+# define RADEON_CRTC_CUR_MODE_MASK (7 << 17)
+# define RADEON_CRTC_ICON_EN (1 << 20)
+# define RADEON_CRTC_EXT_DISP_EN (1 << 24)
+# define RADEON_CRTC_EN (1 << 25)
+# define RADEON_CRTC_DISP_REQ_EN_B (1 << 26)
+#define RADEON_CRTC2_GEN_CNTL 0x03f8
+# define RADEON_CRTC2_DBL_SCAN_EN (1 << 0)
+# define RADEON_CRTC2_INTERLACE_EN (1 << 1)
+# define RADEON_CRTC2_SYNC_TRISTAT (1 << 4)
+# define RADEON_CRTC2_HSYNC_TRISTAT (1 << 5)
+# define RADEON_CRTC2_VSYNC_TRISTAT (1 << 6)
+# define RADEON_CRTC2_CRT2_ON (1 << 7)
+# define RADEON_CRTC2_ICON_EN (1 << 15)
+# define RADEON_CRTC2_CUR_EN (1 << 16)
+# define RADEON_CRTC2_CUR_MODE_MASK (7 << 20)
+# define RADEON_CRTC2_DISP_DIS (1 << 23)
+# define RADEON_CRTC2_EN (1 << 25)
+# define RADEON_CRTC2_DISP_REQ_EN_B (1 << 26)
+# define RADEON_CRTC2_CSYNC_EN (1 << 27)
+# define RADEON_CRTC2_HSYNC_DIS (1 << 28)
+# define RADEON_CRTC2_VSYNC_DIS (1 << 29)
+#define RADEON_CRTC_MORE_CNTL 0x27c
+# define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4)
+# define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5)
+#define RADEON_CRTC_GUI_TRIG_VLINE 0x0218
+#define RADEON_CRTC_H_SYNC_STRT_WID 0x0204
+# define RADEON_CRTC_H_SYNC_STRT_PIX (0x07 << 0)
+# define RADEON_CRTC_H_SYNC_STRT_CHAR (0x3ff << 3)
+# define RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT 3
+# define RADEON_CRTC_H_SYNC_WID (0x3f << 16)
+# define RADEON_CRTC_H_SYNC_WID_SHIFT 16
+# define RADEON_CRTC_H_SYNC_POL (1 << 23)
+#define RADEON_CRTC2_H_SYNC_STRT_WID 0x0304
+# define RADEON_CRTC2_H_SYNC_STRT_PIX (0x07 << 0)
+# define RADEON_CRTC2_H_SYNC_STRT_CHAR (0x3ff << 3)
+# define RADEON_CRTC2_H_SYNC_STRT_CHAR_SHIFT 3
+# define RADEON_CRTC2_H_SYNC_WID (0x3f << 16)
+# define RADEON_CRTC2_H_SYNC_WID_SHIFT 16
+# define RADEON_CRTC2_H_SYNC_POL (1 << 23)
+#define RADEON_CRTC_H_TOTAL_DISP 0x0200
+# define RADEON_CRTC_H_TOTAL (0x03ff << 0)
+# define RADEON_CRTC_H_TOTAL_SHIFT 0
+# define RADEON_CRTC_H_DISP (0x01ff << 16)
+# define RADEON_CRTC_H_DISP_SHIFT 16
+#define RADEON_CRTC2_H_TOTAL_DISP 0x0300
+# define RADEON_CRTC2_H_TOTAL (0x03ff << 0)
+# define RADEON_CRTC2_H_TOTAL_SHIFT 0
+# define RADEON_CRTC2_H_DISP (0x01ff << 16)
+# define RADEON_CRTC2_H_DISP_SHIFT 16
+#define RADEON_CRTC_OFFSET 0x0224
+#define RADEON_CRTC2_OFFSET 0x0324
+#define RADEON_CRTC_OFFSET_CNTL 0x0228
+# define RADEON_CRTC_TILE_EN (1 << 15)
+#define RADEON_CRTC2_OFFSET_CNTL 0x0328
+# define RADEON_CRTC2_TILE_EN (1 << 15)
+#define RADEON_CRTC_PITCH 0x022c
+#define RADEON_CRTC2_PITCH 0x032c
+#define RADEON_CRTC_STATUS 0x005c
+# define RADEON_CRTC_VBLANK_SAVE (1 << 1)
+# define RADEON_CRTC_VBLANK_SAVE_CLEAR (1 << 1)
+#define RADEON_CRTC2_STATUS 0x03fc
+# define RADEON_CRTC2_VBLANK_SAVE (1 << 1)
+# define RADEON_CRTC2_VBLANK_SAVE_CLEAR (1 << 1)
+#define RADEON_CRTC_V_SYNC_STRT_WID 0x020c
+# define RADEON_CRTC_V_SYNC_STRT (0x7ff << 0)
+# define RADEON_CRTC_V_SYNC_STRT_SHIFT 0
+# define RADEON_CRTC_V_SYNC_WID (0x1f << 16)
+# define RADEON_CRTC_V_SYNC_WID_SHIFT 16
+# define RADEON_CRTC_V_SYNC_POL (1 << 23)
+#define RADEON_CRTC2_V_SYNC_STRT_WID 0x030c
+# define RADEON_CRTC2_V_SYNC_STRT (0x7ff << 0)
+# define RADEON_CRTC2_V_SYNC_STRT_SHIFT 0
+# define RADEON_CRTC2_V_SYNC_WID (0x1f << 16)
+# define RADEON_CRTC2_V_SYNC_WID_SHIFT 16
+# define RADEON_CRTC2_V_SYNC_POL (1 << 23)
+#define RADEON_CRTC_V_TOTAL_DISP 0x0208
+# define RADEON_CRTC_V_TOTAL (0x07ff << 0)
+# define RADEON_CRTC_V_TOTAL_SHIFT 0
+# define RADEON_CRTC_V_DISP (0x07ff << 16)
+# define RADEON_CRTC_V_DISP_SHIFT 16
+#define RADEON_CRTC2_V_TOTAL_DISP 0x0308
+# define RADEON_CRTC2_V_TOTAL (0x07ff << 0)
+# define RADEON_CRTC2_V_TOTAL_SHIFT 0
+# define RADEON_CRTC2_V_DISP (0x07ff << 16)
+# define RADEON_CRTC2_V_DISP_SHIFT 16
+#define RADEON_CRTC_VLINE_CRNT_VLINE 0x0210
+# define RADEON_CRTC_CRNT_VLINE_MASK (0x7ff << 16)
+#define RADEON_CRTC2_CRNT_FRAME 0x0314
+#define RADEON_CRTC2_GUI_TRIG_VLINE 0x0318
+#define RADEON_CRTC2_STATUS 0x03fc
+#define RADEON_CRTC2_VLINE_CRNT_VLINE 0x0310
+#define RADEON_CRTC8_DATA 0x03d5 /* VGA, 0x3b5 */
+#define RADEON_CRTC8_IDX 0x03d4 /* VGA, 0x3b4 */
+#define RADEON_CUR_CLR0 0x026c
+#define RADEON_CUR_CLR1 0x0270
+#define RADEON_CUR_HORZ_VERT_OFF 0x0268
+#define RADEON_CUR_HORZ_VERT_POSN 0x0264
+#define RADEON_CUR_OFFSET 0x0260
+# define RADEON_CUR_LOCK (1 << 31)
+#define RADEON_CUR2_CLR0 0x036c
+#define RADEON_CUR2_CLR1 0x0370
+#define RADEON_CUR2_HORZ_VERT_OFF 0x0368
+#define RADEON_CUR2_HORZ_VERT_POSN 0x0364
+#define RADEON_CUR2_OFFSET 0x0360
+# define RADEON_CUR2_LOCK (1 << 31)
+
+#define RADEON_DAC_CNTL 0x0058
+# define RADEON_DAC_RANGE_CNTL (3 << 0)
+# define RADEON_DAC_RANGE_CNTL_MASK 0x03
+# define RADEON_DAC_BLANKING (1 << 2)
+# define RADEON_DAC_CMP_EN (1 << 3)
+# define RADEON_DAC_CMP_OUTPUT (1 << 7)
+# define RADEON_DAC_8BIT_EN (1 << 8)
+# define RADEON_DAC_VGA_ADR_EN (1 << 13)
+# define RADEON_DAC_PDWN (1 << 15)
+# define RADEON_DAC_MASK_ALL (0xff << 24)
+#define RADEON_DAC_CNTL2 0x007c
+# define RADEON_DAC2_DAC_CLK_SEL (1 << 0)
+# define RADEON_DAC2_DAC2_CLK_SEL (1 << 1)
+# define RADEON_DAC2_PALETTE_ACC_CTL (1 << 5)
+#define RADEON_DAC_EXT_CNTL 0x0280
+# define RADEON_DAC_FORCE_BLANK_OFF_EN (1 << 4)
+# define RADEON_DAC_FORCE_DATA_EN (1 << 5)
+# define RADEON_DAC_FORCE_DATA_SEL_MASK (3 << 6)
+# define RADEON_DAC_FORCE_DATA_MASK 0x0003ff00
+# define RADEON_DAC_FORCE_DATA_SHIFT 8
+#define RADEON_TV_DAC_CNTL 0x088c
+# define RADEON_TV_DAC_STD_MASK 0x0300
+# define RADEON_TV_DAC_RDACPD (1 << 24)
+# define RADEON_TV_DAC_GDACPD (1 << 25)
+# define RADEON_TV_DAC_BDACPD (1 << 26)
+#define RADEON_DISP_HW_DEBUG 0x0d14
+# define RADEON_CRT2_DISP1_SEL (1 << 5)
+#define RADEON_DISP_OUTPUT_CNTL 0x0d64
+# define RADEON_DISP_DAC_SOURCE_MASK 0x03
+# define RADEON_DISP_DAC2_SOURCE_MASK 0x0c
+# define RADEON_DISP_DAC_SOURCE_CRTC2 0x01
+# define RADEON_DISP_DAC2_SOURCE_CRTC2 0x04
+#define RADEON_DAC_CRC_SIG 0x02cc
+#define RADEON_DAC_DATA 0x03c9 /* VGA */
+#define RADEON_DAC_MASK 0x03c6 /* VGA */
+#define RADEON_DAC_R_INDEX 0x03c7 /* VGA */
+#define RADEON_DAC_W_INDEX 0x03c8 /* VGA */
+#define RADEON_DDA_CONFIG 0x02e0
+#define RADEON_DDA_ON_OFF 0x02e4
+#define RADEON_DEFAULT_OFFSET 0x16e0
+#define RADEON_DEFAULT_PITCH 0x16e4
+#define RADEON_DEFAULT_SC_BOTTOM_RIGHT 0x16e8
+# define RADEON_DEFAULT_SC_RIGHT_MAX (0x1fff << 0)
+# define RADEON_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16)
+#define RADEON_DESTINATION_3D_CLR_CMP_VAL 0x1820
+#define RADEON_DESTINATION_3D_CLR_CMP_MSK 0x1824
+#define RADEON_DEVICE_ID 0x0f02 /* PCI */
+#define RADEON_DISP_MISC_CNTL 0x0d00
+# define RADEON_SOFT_RESET_GRPH_PP (1 << 0)
+#define RADEON_DISP_MERGE_CNTL 0x0d60
+# define RADEON_DISP_ALPHA_MODE_MASK 0x03
+# define RADEON_DISP_ALPHA_MODE_KEY 0
+# define RADEON_DISP_ALPHA_MODE_PER_PIXEL 1
+# define RADEON_DISP_ALPHA_MODE_GLOBAL 2
+# define RADEON_DISP_RGB_OFFSET_EN (1<<8)
+# define RADEON_DISP_GRPH_ALPHA_MASK (0xff << 16)
+# define RADEON_DISP_OV0_ALPHA_MASK (0xff << 24)
+# define RADEON_DISP_LIN_TRANS_BYPASS (0x01 << 9)
+#define RADEON_DISP2_MERGE_CNTL 0x0d68
+# define RADEON_DISP2_RGB_OFFSET_EN (1<<8)
+#define RADEON_DISP_LIN_TRANS_GRPH_A 0x0d80
+#define RADEON_DISP_LIN_TRANS_GRPH_B 0x0d84
+#define RADEON_DISP_LIN_TRANS_GRPH_C 0x0d88
+#define RADEON_DISP_LIN_TRANS_GRPH_D 0x0d8c
+#define RADEON_DISP_LIN_TRANS_GRPH_E 0x0d90
+#define RADEON_DISP_LIN_TRANS_GRPH_F 0x0d98
+#define RADEON_DP_BRUSH_BKGD_CLR 0x1478
+#define RADEON_DP_BRUSH_FRGD_CLR 0x147c
+#define RADEON_DP_CNTL 0x16c0
+# define RADEON_DST_X_LEFT_TO_RIGHT (1 << 0)
+# define RADEON_DST_Y_TOP_TO_BOTTOM (1 << 1)
+#define RADEON_DP_CNTL_XDIR_YDIR_YMAJOR 0x16d0
+# define RADEON_DST_Y_MAJOR (1 << 2)
+# define RADEON_DST_Y_DIR_TOP_TO_BOTTOM (1 << 15)
+# define RADEON_DST_X_DIR_LEFT_TO_RIGHT (1 << 31)
+#define RADEON_DP_DATATYPE 0x16c4
+# define RADEON_HOST_BIG_ENDIAN_EN (1 << 29)
+#define RADEON_DP_GUI_MASTER_CNTL 0x146c
+# define RADEON_GMC_SRC_PITCH_OFFSET_CNTL (1 << 0)
+# define RADEON_GMC_DST_PITCH_OFFSET_CNTL (1 << 1)
+# define RADEON_GMC_SRC_CLIPPING (1 << 2)
+# define RADEON_GMC_DST_CLIPPING (1 << 3)
+# define RADEON_GMC_BRUSH_DATATYPE_MASK (0x0f << 4)
+# define RADEON_GMC_BRUSH_8X8_MONO_FG_BG (0 << 4)
+# define RADEON_GMC_BRUSH_8X8_MONO_FG_LA (1 << 4)
+# define RADEON_GMC_BRUSH_1X8_MONO_FG_BG (4 << 4)
+# define RADEON_GMC_BRUSH_1X8_MONO_FG_LA (5 << 4)
+# define RADEON_GMC_BRUSH_32x1_MONO_FG_BG (6 << 4)
+# define RADEON_GMC_BRUSH_32x1_MONO_FG_LA (7 << 4)
+# define RADEON_GMC_BRUSH_32x32_MONO_FG_BG (8 << 4)
+# define RADEON_GMC_BRUSH_32x32_MONO_FG_LA (9 << 4)
+# define RADEON_GMC_BRUSH_8x8_COLOR (10 << 4)
+# define RADEON_GMC_BRUSH_1X8_COLOR (12 << 4)
+# define RADEON_GMC_BRUSH_SOLID_COLOR (13 << 4)
+# define RADEON_GMC_BRUSH_NONE (15 << 4)
+# define RADEON_GMC_DST_8BPP_CI (2 << 8)
+# define RADEON_GMC_DST_15BPP (3 << 8)
+# define RADEON_GMC_DST_16BPP (4 << 8)
+# define RADEON_GMC_DST_24BPP (5 << 8)
+# define RADEON_GMC_DST_32BPP (6 << 8)
+# define RADEON_GMC_DST_8BPP_RGB (7 << 8)
+# define RADEON_GMC_DST_Y8 (8 << 8)
+# define RADEON_GMC_DST_RGB8 (9 << 8)
+# define RADEON_GMC_DST_VYUY (11 << 8)
+# define RADEON_GMC_DST_YVYU (12 << 8)
+# define RADEON_GMC_DST_AYUV444 (14 << 8)
+# define RADEON_GMC_DST_ARGB4444 (15 << 8)
+# define RADEON_GMC_DST_DATATYPE_MASK (0x0f << 8)
+# define RADEON_GMC_DST_DATATYPE_SHIFT 8
+# define RADEON_GMC_SRC_DATATYPE_MASK (3 << 12)
+# define RADEON_GMC_SRC_DATATYPE_MONO_FG_BG (0 << 12)
+# define RADEON_GMC_SRC_DATATYPE_MONO_FG_LA (1 << 12)
+# define RADEON_GMC_SRC_DATATYPE_COLOR (3 << 12)
+# define RADEON_GMC_BYTE_PIX_ORDER (1 << 14)
+# define RADEON_GMC_BYTE_MSB_TO_LSB (0 << 14)
+# define RADEON_GMC_BYTE_LSB_TO_MSB (1 << 14)
+# define RADEON_GMC_CONVERSION_TEMP (1 << 15)
+# define RADEON_GMC_CONVERSION_TEMP_6500 (0 << 15)
+# define RADEON_GMC_CONVERSION_TEMP_9300 (1 << 15)
+# define RADEON_GMC_ROP3_MASK (0xff << 16)
+# define RADEON_DP_SRC_SOURCE_MASK (7 << 24)
+# define RADEON_DP_SRC_SOURCE_MEMORY (2 << 24)
+# define RADEON_DP_SRC_SOURCE_HOST_DATA (3 << 24)
+# define RADEON_GMC_3D_FCN_EN (1 << 27)
+# define RADEON_GMC_CLR_CMP_CNTL_DIS (1 << 28)
+# define RADEON_GMC_AUX_CLIP_DIS (1 << 29)
+# define RADEON_GMC_WR_MSK_DIS (1 << 30)
+# define RADEON_GMC_LD_BRUSH_Y_X (1 << 31)
+# define RADEON_ROP3_ZERO 0x00000000
+# define RADEON_ROP3_DSa 0x00880000
+# define RADEON_ROP3_SDna 0x00440000
+# define RADEON_ROP3_S 0x00cc0000
+# define RADEON_ROP3_DSna 0x00220000
+# define RADEON_ROP3_D 0x00aa0000
+# define RADEON_ROP3_DSx 0x00660000
+# define RADEON_ROP3_DSo 0x00ee0000
+# define RADEON_ROP3_DSon 0x00110000
+# define RADEON_ROP3_DSxn 0x00990000
+# define RADEON_ROP3_Dn 0x00550000
+# define RADEON_ROP3_SDno 0x00dd0000
+# define RADEON_ROP3_Sn 0x00330000
+# define RADEON_ROP3_DSno 0x00bb0000
+# define RADEON_ROP3_DSan 0x00770000
+# define RADEON_ROP3_ONE 0x00ff0000
+# define RADEON_ROP3_DPa 0x00a00000
+# define RADEON_ROP3_PDna 0x00500000
+# define RADEON_ROP3_P 0x00f00000
+# define RADEON_ROP3_DPna 0x000a0000
+# define RADEON_ROP3_D 0x00aa0000
+# define RADEON_ROP3_DPx 0x005a0000
+# define RADEON_ROP3_DPo 0x00fa0000
+# define RADEON_ROP3_DPon 0x00050000
+# define RADEON_ROP3_PDxn 0x00a50000
+# define RADEON_ROP3_PDno 0x00f50000
+# define RADEON_ROP3_Pn 0x000f0000
+# define RADEON_ROP3_DPno 0x00af0000
+# define RADEON_ROP3_DPan 0x005f0000
+#define RADEON_DP_GUI_MASTER_CNTL_C 0x1c84
+#define RADEON_DP_MIX 0x16c8
+#define RADEON_DP_SRC_BKGD_CLR 0x15dc
+#define RADEON_DP_SRC_FRGD_CLR 0x15d8
+#define RADEON_DP_WRITE_MASK 0x16cc
+#define RADEON_DST_BRES_DEC 0x1630
+#define RADEON_DST_BRES_ERR 0x1628
+#define RADEON_DST_BRES_INC 0x162c
+#define RADEON_DST_BRES_LNTH 0x1634
+#define RADEON_DST_BRES_LNTH_SUB 0x1638
+#define RADEON_DST_HEIGHT 0x1410
+#define RADEON_DST_HEIGHT_WIDTH 0x143c
+#define RADEON_DST_HEIGHT_WIDTH_8 0x158c
+#define RADEON_DST_HEIGHT_WIDTH_BW 0x15b4
+#define RADEON_DST_HEIGHT_Y 0x15a0
+#define RADEON_DST_LINE_START 0x1600
+#define RADEON_DST_LINE_END 0x1604
+#define RADEON_DST_LINE_PATCOUNT 0x1608
+# define RADEON_BRES_CNTL_SHIFT 8
+#define RADEON_DST_OFFSET 0x1404
+#define RADEON_DST_PITCH 0x1408
+#define RADEON_DST_PITCH_OFFSET 0x142c
+#define RADEON_DST_PITCH_OFFSET_C 0x1c80
+# define RADEON_PITCH_SHIFT 21
+# define RADEON_DST_TILE_LINEAR (0 << 30)
+# define RADEON_DST_TILE_MACRO (1 << 30)
+# define RADEON_DST_TILE_MICRO (2 << 30)
+# define RADEON_DST_TILE_BOTH (3 << 30)
+#define RADEON_DST_WIDTH 0x140c
+#define RADEON_DST_WIDTH_HEIGHT 0x1598
+#define RADEON_DST_WIDTH_X 0x1588
+#define RADEON_DST_WIDTH_X_INCY 0x159c
+#define RADEON_DST_X 0x141c
+#define RADEON_DST_X_SUB 0x15a4
+#define RADEON_DST_X_Y 0x1594
+#define RADEON_DST_Y 0x1420
+#define RADEON_DST_Y_SUB 0x15a8
+#define RADEON_DST_Y_X 0x1438
+
+#define RADEON_FCP_CNTL 0x0910
+# define RADEON_FCP0_SRC_PCICLK 0
+# define RADEON_FCP0_SRC_PCLK 1
+# define RADEON_FCP0_SRC_PCLKb 2
+# define RADEON_FCP0_SRC_HREF 3
+# define RADEON_FCP0_SRC_GND 4
+# define RADEON_FCP0_SRC_HREFb 5
+#define RADEON_FLUSH_1 0x1704
+#define RADEON_FLUSH_2 0x1708
+#define RADEON_FLUSH_3 0x170c
+#define RADEON_FLUSH_4 0x1710
+#define RADEON_FLUSH_5 0x1714
+#define RADEON_FLUSH_6 0x1718
+#define RADEON_FLUSH_7 0x171c
+#define RADEON_FOG_3D_TABLE_START 0x1810
+#define RADEON_FOG_3D_TABLE_END 0x1814
+#define RADEON_FOG_3D_TABLE_DENSITY 0x181c
+#define RADEON_FOG_TABLE_INDEX 0x1a14
+#define RADEON_FOG_TABLE_DATA 0x1a18
+#define RADEON_FP_CRTC_H_TOTAL_DISP 0x0250
+#define RADEON_FP_CRTC_V_TOTAL_DISP 0x0254
+#define RADEON_FP_CRTC2_H_TOTAL_DISP 0x0350
+#define RADEON_FP_CRTC2_V_TOTAL_DISP 0x0354
+# define RADEON_FP_CRTC_H_TOTAL_MASK 0x000003ff
+# define RADEON_FP_CRTC_H_DISP_MASK 0x01ff0000
+# define RADEON_FP_CRTC_V_TOTAL_MASK 0x00000fff
+# define RADEON_FP_CRTC_V_DISP_MASK 0x0fff0000
+# define RADEON_FP_H_SYNC_STRT_CHAR_MASK 0x00001ff8
+# define RADEON_FP_H_SYNC_WID_MASK 0x003f0000
+# define RADEON_FP_V_SYNC_STRT_MASK 0x00000fff
+# define RADEON_FP_V_SYNC_WID_MASK 0x001f0000
+# define RADEON_FP_CRTC_H_TOTAL_SHIFT 0x00000000
+# define RADEON_FP_CRTC_H_DISP_SHIFT 0x00000010
+# define RADEON_FP_CRTC_V_TOTAL_SHIFT 0x00000000
+# define RADEON_FP_CRTC_V_DISP_SHIFT 0x00000010
+# define RADEON_FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003
+# define RADEON_FP_H_SYNC_WID_SHIFT 0x00000010
+# define RADEON_FP_V_SYNC_STRT_SHIFT 0x00000000
+# define RADEON_FP_V_SYNC_WID_SHIFT 0x00000010
+#define RADEON_FP_GEN_CNTL 0x0284
+# define RADEON_FP_FPON (1 << 0)
+# define RADEON_FP_TMDS_EN (1 << 2)
+# define RADEON_FP_PANEL_FORMAT (1 << 3)
+# define RADEON_FP_EN_TMDS (1 << 7)
+# define RADEON_FP_DETECT_SENSE (1 << 8)
+# define RADEON_FP_SEL_CRTC2 (1 << 13)
+# define RADEON_FP_CRTC_DONT_SHADOW_HPAR (1 << 15)
+# define RADEON_FP_CRTC_DONT_SHADOW_VPAR (1 << 16)
+# define RADEON_FP_CRTC_DONT_SHADOW_HEND (1 << 17)
+# define RADEON_FP_CRTC_USE_SHADOW_VEND (1 << 18)
+# define RADEON_FP_RMX_HVSYNC_CONTROL_EN (1 << 20)
+# define RADEON_FP_DFP_SYNC_SEL (1 << 21)
+# define RADEON_FP_CRTC_LOCK_8DOT (1 << 22)
+# define RADEON_FP_CRT_SYNC_SEL (1 << 23)
+# define RADEON_FP_USE_SHADOW_EN (1 << 24)
+# define RADEON_FP_CRT_SYNC_ALT (1 << 26)
+#define RADEON_FP2_GEN_CNTL 0x0288
+# define RADEON_FP2_BLANK_EN (1 << 1)
+# define RADEON_FP2_ON (1 << 2)
+# define RADEON_FP2_PANEL_FORMAT (1 << 3)
+# define RADEON_FP2_SOURCE_SEL_MASK (3 << 10)
+# define RADEON_FP2_SOURCE_SEL_CRTC2 (1 << 10)
+# define RADEON_FP2_SRC_SEL_MASK (3 << 13)
+# define RADEON_FP2_SRC_SEL_CRTC2 (1 << 13)
+# define RADEON_FP2_FP_POL (1 << 16)
+# define RADEON_FP2_LP_POL (1 << 17)
+# define RADEON_FP2_SCK_POL (1 << 18)
+# define RADEON_FP2_LCD_CNTL_MASK (7 << 19)
+# define RADEON_FP2_PAD_FLOP_EN (1 << 22)
+# define RADEON_FP2_CRC_EN (1 << 23)
+# define RADEON_FP2_CRC_READ_EN (1 << 24)
+# define RADEON_FP2_DV0_EN (1 << 25)
+# define RADEON_FP2_DV0_RATE_SEL_SDR (1 << 26)
+#define RADEON_FP_H_SYNC_STRT_WID 0x02c4
+#define RADEON_FP_H2_SYNC_STRT_WID 0x03c4
+#define RADEON_FP_HORZ_STRETCH 0x028c
+#define RADEON_FP_HORZ2_STRETCH 0x038c
+# define RADEON_HORZ_STRETCH_RATIO_MASK 0xffff
+# define RADEON_HORZ_STRETCH_RATIO_MAX 4096
+# define RADEON_HORZ_PANEL_SIZE (0x1ff << 16)
+# define RADEON_HORZ_PANEL_SHIFT 16
+# define RADEON_HORZ_STRETCH_PIXREP (0 << 25)
+# define RADEON_HORZ_STRETCH_BLEND (1 << 26)
+# define RADEON_HORZ_STRETCH_ENABLE (1 << 25)
+# define RADEON_HORZ_AUTO_RATIO (1 << 27)
+# define RADEON_HORZ_FP_LOOP_STRETCH (0x7 << 28)
+# define RADEON_HORZ_AUTO_RATIO_INC (1 << 31)
+#define RADEON_FP_V_SYNC_STRT_WID 0x02c8
+#define RADEON_FP_VERT_STRETCH 0x0290
+#define RADEON_FP_V2_SYNC_STRT_WID 0x03c8
+#define RADEON_FP_VERT2_STRETCH 0x0390
+# define RADEON_VERT_PANEL_SIZE (0xfff << 12)
+# define RADEON_VERT_PANEL_SHIFT 12
+# define RADEON_VERT_STRETCH_RATIO_MASK 0xfff
+# define RADEON_VERT_STRETCH_RATIO_SHIFT 0
+# define RADEON_VERT_STRETCH_RATIO_MAX 4096
+# define RADEON_VERT_STRETCH_ENABLE (1 << 25)
+# define RADEON_VERT_STRETCH_LINEREP (0 << 26)
+# define RADEON_VERT_STRETCH_BLEND (1 << 26)
+# define RADEON_VERT_AUTO_RATIO_EN (1 << 27)
+# define RADEON_VERT_STRETCH_RESERVED 0xf1000000
+
+#define RADEON_GEN_INT_CNTL 0x0040
+#define RADEON_GEN_INT_STATUS 0x0044
+# define RADEON_VSYNC_INT_AK (1 << 2)
+# define RADEON_VSYNC_INT (1 << 2)
+# define RADEON_VSYNC2_INT_AK (1 << 6)
+# define RADEON_VSYNC2_INT (1 << 6)
+#define RADEON_GENENB 0x03c3 /* VGA */
+#define RADEON_GENFC_RD 0x03ca /* VGA */
+#define RADEON_GENFC_WT 0x03da /* VGA, 0x03ba */
+#define RADEON_GENMO_RD 0x03cc /* VGA */
+#define RADEON_GENMO_WT 0x03c2 /* VGA */
+#define RADEON_GENS0 0x03c2 /* VGA */
+#define RADEON_GENS1 0x03da /* VGA, 0x03ba */
+#define RADEON_GPIO_MONID 0x0068 /* DDC interface via I2C */
+#define RADEON_GPIO_MONIDB 0x006c
+#define RADEON_GPIO_CRT2_DDC 0x006c
+#define RADEON_GPIO_DVI_DDC 0x0064
+#define RADEON_GPIO_VGA_DDC 0x0060
+# define RADEON_GPIO_A_0 (1 << 0)
+# define RADEON_GPIO_A_1 (1 << 1)
+# define RADEON_GPIO_Y_0 (1 << 8)
+# define RADEON_GPIO_Y_1 (1 << 9)
+# define RADEON_GPIO_Y_SHIFT_0 8
+# define RADEON_GPIO_Y_SHIFT_1 9
+# define RADEON_GPIO_EN_0 (1 << 16)
+# define RADEON_GPIO_EN_1 (1 << 17)
+# define RADEON_GPIO_MASK_0 (1 << 24) /*??*/
+# define RADEON_GPIO_MASK_1 (1 << 25) /*??*/
+#define RADEON_GRPH8_DATA 0x03cf /* VGA */
+#define RADEON_GRPH8_IDX 0x03ce /* VGA */
+#define RADEON_GUI_SCRATCH_REG0 0x15e0
+#define RADEON_GUI_SCRATCH_REG1 0x15e4
+#define RADEON_GUI_SCRATCH_REG2 0x15e8
+#define RADEON_GUI_SCRATCH_REG3 0x15ec
+#define RADEON_GUI_SCRATCH_REG4 0x15f0
+#define RADEON_GUI_SCRATCH_REG5 0x15f4
+
+#define RADEON_HEADER 0x0f0e /* PCI */
+#define RADEON_HOST_DATA0 0x17c0
+#define RADEON_HOST_DATA1 0x17c4
+#define RADEON_HOST_DATA2 0x17c8
+#define RADEON_HOST_DATA3 0x17cc
+#define RADEON_HOST_DATA4 0x17d0
+#define RADEON_HOST_DATA5 0x17d4
+#define RADEON_HOST_DATA6 0x17d8
+#define RADEON_HOST_DATA7 0x17dc
+#define RADEON_HOST_DATA_LAST 0x17e0
+#define RADEON_HOST_PATH_CNTL 0x0130
+# define RADEON_HDP_SOFT_RESET (1 << 26)
+#define RADEON_HTOTAL_CNTL 0x0009 /* PLL */
+#define RADEON_HTOTAL2_CNTL 0x002e /* PLL */
+
+#define RADEON_I2C_CNTL_1 0x0094 /* ? */
+#define RADEON_DVI_I2C_CNTL_1 0x02e4 /* ? */
+#define RADEON_INTERRUPT_LINE 0x0f3c /* PCI */
+#define RADEON_INTERRUPT_PIN 0x0f3d /* PCI */
+#define RADEON_IO_BASE 0x0f14 /* PCI */
+
+#define RADEON_LATENCY 0x0f0d /* PCI */
+#define RADEON_LEAD_BRES_DEC 0x1608
+#define RADEON_LEAD_BRES_LNTH 0x161c
+#define RADEON_LEAD_BRES_LNTH_SUB 0x1624
+#define RADEON_LVDS_GEN_CNTL 0x02d0
+# define RADEON_LVDS_ON (1 << 0)
+# define RADEON_LVDS_DISPLAY_DIS (1 << 1)
+# define RADEON_LVDS_PANEL_TYPE (1 << 2)
+# define RADEON_LVDS_PANEL_FORMAT (1 << 3)
+# define RADEON_LVDS_EN (1 << 7)
+# define RADEON_LVDS_DIGON (1 << 18)
+# define RADEON_LVDS_BLON (1 << 19)
+# define RADEON_LVDS_SEL_CRTC2 (1 << 23)
+#define RADEON_LVDS_PLL_CNTL 0x02d4
+# define RADEON_HSYNC_DELAY_SHIFT 28
+# define RADEON_HSYNC_DELAY_MASK (0xf << 28)
+
+#define RADEON_MAX_LATENCY 0x0f3f /* PCI */
+#define RADEON_MC_AGP_LOCATION 0x014c
+#define RADEON_MC_FB_LOCATION 0x0148
+#define RADEON_DISPLAY_BASE_ADDR 0x23c
+#define RADEON_DISPLAY2_BASE_ADDR 0x33c
+#define RADEON_OV0_BASE_ADDR 0x43c
+#define RADEON_NB_TOM 0x15c
+#define RADEON_MCLK_CNTL 0x0012 /* PLL */
+# define RADEON_FORCEON_MCLKA (1 << 16)
+# define RADEON_FORCEON_MCLKB (1 << 17)
+# define RADEON_FORCEON_YCLKA (1 << 18)
+# define RADEON_FORCEON_YCLKB (1 << 19)
+# define RADEON_FORCEON_MC (1 << 20)
+# define RADEON_FORCEON_AIC (1 << 21)
+#define RADEON_MDGPIO_A_REG 0x01ac
+#define RADEON_MDGPIO_EN_REG 0x01b0
+#define RADEON_MDGPIO_MASK 0x0198
+#define RADEON_MDGPIO_Y_REG 0x01b4
+#define RADEON_MEM_ADDR_CONFIG 0x0148
+#define RADEON_MEM_BASE 0x0f10 /* PCI */
+#define RADEON_MEM_CNTL 0x0140
+# define RADEON_MEM_NUM_CHANNELS_MASK 0x01
+# define RADEON_MEM_USE_B_CH_ONLY (1<<1)
+# define RV100_HALF_MODE (1<<3)
+#define RADEON_MEM_TIMING_CNTL 0x0144 /* EXT_MEM_CNTL */
+#define RADEON_MEM_INIT_LAT_TIMER 0x0154
+#define RADEON_MEM_INTF_CNTL 0x014c
+#define RADEON_MEM_SDRAM_MODE_REG 0x0158
+#define RADEON_MEM_STR_CNTL 0x0150
+#define RADEON_MEM_VGA_RP_SEL 0x003c
+#define RADEON_MEM_VGA_WP_SEL 0x0038
+#define RADEON_MIN_GRANT 0x0f3e /* PCI */
+#define RADEON_MM_DATA 0x0004
+#define RADEON_MM_INDEX 0x0000
+#define RADEON_MPLL_CNTL 0x000e /* PLL */
+#define RADEON_MPP_TB_CONFIG 0x01c0 /* ? */
+#define RADEON_MPP_GP_CONFIG 0x01c8 /* ? */
+
+#define RADEON_N_VIF_COUNT 0x0248
+
+#define RADEON_OV0_AUTO_FLIP_CNTL 0x0470
+#define RADEON_OV0_COLOUR_CNTL 0x04E0
+#define RADEON_OV0_DEINTERLACE_PATTERN 0x0474
+#define RADEON_OV0_EXCLUSIVE_HORZ 0x0408
+# define RADEON_EXCL_HORZ_START_MASK 0x000000ff
+# define RADEON_EXCL_HORZ_END_MASK 0x0000ff00
+# define RADEON_EXCL_HORZ_BACK_PORCH_MASK 0x00ff0000
+# define RADEON_EXCL_HORZ_EXCLUSIVE_EN 0x80000000
+#define RADEON_OV0_EXCLUSIVE_VERT 0x040C
+# define RADEON_EXCL_VERT_START_MASK 0x000003ff
+# define RADEON_EXCL_VERT_END_MASK 0x03ff0000
+#define RADEON_OV0_FILTER_CNTL 0x04A0
+#define RADEON_OV0_FOUR_TAP_COEF_0 0x04B0
+#define RADEON_OV0_FOUR_TAP_COEF_1 0x04B4
+#define RADEON_OV0_FOUR_TAP_COEF_2 0x04B8
+#define RADEON_OV0_FOUR_TAP_COEF_3 0x04BC
+#define RADEON_OV0_FOUR_TAP_COEF_4 0x04C0
+#define RADEON_OV0_GAMMA_000_00F 0x0d40
+#define RADEON_OV0_GAMMA_010_01F 0x0d44
+#define RADEON_OV0_GAMMA_020_03F 0x0d48
+#define RADEON_OV0_GAMMA_040_07F 0x0d4c
+#define RADEON_OV0_GAMMA_080_0BF 0x0e00
+#define RADEON_OV0_GAMMA_0C0_0FF 0x0e04
+#define RADEON_OV0_GAMMA_100_13F 0x0e08
+#define RADEON_OV0_GAMMA_140_17F 0x0e0c
+#define RADEON_OV0_GAMMA_180_1BF 0x0e10
+#define RADEON_OV0_GAMMA_1C0_1FF 0x0e14
+#define RADEON_OV0_GAMMA_200_23F 0x0e18
+#define RADEON_OV0_GAMMA_240_27F 0x0e1c
+#define RADEON_OV0_GAMMA_280_2BF 0x0e20
+#define RADEON_OV0_GAMMA_2C0_2FF 0x0e24
+#define RADEON_OV0_GAMMA_300_33F 0x0e28
+#define RADEON_OV0_GAMMA_340_37F 0x0e2c
+#define RADEON_OV0_GAMMA_380_3BF 0x0d50
+#define RADEON_OV0_GAMMA_3C0_3FF 0x0d54
+#define RADEON_OV0_GRAPHICS_KEY_CLR_LOW 0x04EC
+#define RADEON_OV0_GRAPHICS_KEY_CLR_HIGH 0x04F0
+#define RADEON_OV0_H_INC 0x0480
+#define RADEON_OV0_KEY_CNTL 0x04F4
+# define RADEON_VIDEO_KEY_FN_MASK 0x00000003L
+# define RADEON_VIDEO_KEY_FN_FALSE 0x00000000L
+# define RADEON_VIDEO_KEY_FN_TRUE 0x00000001L
+# define RADEON_VIDEO_KEY_FN_EQ 0x00000002L
+# define RADEON_VIDEO_KEY_FN_NE 0x00000003L
+# define RADEON_GRAPHIC_KEY_FN_MASK 0x00000030L
+# define RADEON_GRAPHIC_KEY_FN_FALSE 0x00000000L
+# define RADEON_GRAPHIC_KEY_FN_TRUE 0x00000010L
+# define RADEON_GRAPHIC_KEY_FN_EQ 0x00000020L
+# define RADEON_GRAPHIC_KEY_FN_NE 0x00000030L
+# define RADEON_CMP_MIX_MASK 0x00000100L
+# define RADEON_CMP_MIX_OR 0x00000000L
+# define RADEON_CMP_MIX_AND 0x00000100L
+#define RADEON_OV0_LIN_TRANS_A 0x0d20
+#define RADEON_OV0_LIN_TRANS_B 0x0d24
+#define RADEON_OV0_LIN_TRANS_C 0x0d28
+#define RADEON_OV0_LIN_TRANS_D 0x0d2c
+#define RADEON_OV0_LIN_TRANS_E 0x0d30
+#define RADEON_OV0_LIN_TRANS_F 0x0d34
+#define RADEON_OV0_P1_BLANK_LINES_AT_TOP 0x0430
+# define RADEON_P1_BLNK_LN_AT_TOP_M1_MASK 0x00000fffL
+# define RADEON_P1_ACTIVE_LINES_M1 0x0fff0000L
+#define RADEON_OV0_P1_H_ACCUM_INIT 0x0488
+#define RADEON_OV0_P1_V_ACCUM_INIT 0x0428
+# define RADEON_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L
+# define RADEON_OV0_P1_V_ACCUM_INIT_MASK 0x01ff8000L
+#define RADEON_OV0_P1_X_START_END 0x0494
+#define RADEON_OV0_P2_X_START_END 0x0498
+#define RADEON_OV0_P23_BLANK_LINES_AT_TOP 0x0434
+# define RADEON_P23_BLNK_LN_AT_TOP_M1_MASK 0x000007ffL
+# define RADEON_P23_ACTIVE_LINES_M1 0x07ff0000L
+#define RADEON_OV0_P23_H_ACCUM_INIT 0x048C
+#define RADEON_OV0_P23_V_ACCUM_INIT 0x042C
+#define RADEON_OV0_P3_X_START_END 0x049C
+#define RADEON_OV0_REG_LOAD_CNTL 0x0410
+# define RADEON_REG_LD_CTL_LOCK 0x00000001L
+# define RADEON_REG_LD_CTL_VBLANK_DURING_LOCK 0x00000002L
+# define RADEON_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L
+# define RADEON_REG_LD_CTL_LOCK_READBACK 0x00000008L
+#define RADEON_OV0_SCALE_CNTL 0x0420
+# define RADEON_SCALER_HORZ_PICK_NEAREST 0x00000004L
+# define RADEON_SCALER_VERT_PICK_NEAREST 0x00000008L
+# define RADEON_SCALER_SIGNED_UV 0x00000010L
+# define RADEON_SCALER_GAMMA_SEL_MASK 0x00000060L
+# define RADEON_SCALER_GAMMA_SEL_BRIGHT 0x00000000L
+# define RADEON_SCALER_GAMMA_SEL_G22 0x00000020L
+# define RADEON_SCALER_GAMMA_SEL_G18 0x00000040L
+# define RADEON_SCALER_GAMMA_SEL_G14 0x00000060L
+# define RADEON_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L
+# define RADEON_SCALER_SURFAC_FORMAT 0x00000f00L
+# define RADEON_SCALER_SOURCE_15BPP 0x00000300L
+# define RADEON_SCALER_SOURCE_16BPP 0x00000400L
+# define RADEON_SCALER_SOURCE_32BPP 0x00000600L
+# define RADEON_SCALER_SOURCE_YUV9 0x00000900L
+# define RADEON_SCALER_SOURCE_YUV12 0x00000A00L
+# define RADEON_SCALER_SOURCE_VYUY422 0x00000B00L
+# define RADEON_SCALER_SOURCE_YVYU422 0x00000C00L
+# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L
+# define RADEON_SCALER_TEMPORAL_DEINT 0x00002000L
+# define RADEON_SCALER_SMART_SWITCH 0x00008000L
+# define RADEON_SCALER_BURST_PER_PLANE 0x007F0000L
+# define RADEON_SCALER_DOUBLE_BUFFER 0x01000000L
+# define RADEON_SCALER_DIS_LIMIT 0x08000000L
+# define RADEON_SCALER_INT_EMU 0x20000000L
+# define RADEON_SCALER_ENABLE 0x40000000L
+# define RADEON_SCALER_SOFT_RESET 0x80000000L
+# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L
+#define RADEON_OV0_STEP_BY 0x0484
+#define RADEON_OV0_TEST 0x04F8
+#define RADEON_OV0_V_INC 0x0424
+#define RADEON_OV0_VID_BUF_PITCH0_VALUE 0x0460
+#define RADEON_OV0_VID_BUF_PITCH1_VALUE 0x0464
+#define RADEON_OV0_VID_BUF0_BASE_ADRS 0x0440
+# define RADEON_VIF_BUF0_PITCH_SEL 0x00000001L
+# define RADEON_VIF_BUF0_TILE_ADRS 0x00000002L
+# define RADEON_VIF_BUF0_BASE_ADRS_MASK 0x03fffff0L
+# define RADEON_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L
+#define RADEON_OV0_VID_BUF1_BASE_ADRS 0x0444
+# define RADEON_VIF_BUF1_PITCH_SEL 0x00000001L
+# define RADEON_VIF_BUF1_TILE_ADRS 0x00000002L
+# define RADEON_VIF_BUF1_BASE_ADRS_MASK 0x03fffff0L
+# define RADEON_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L
+#define RADEON_OV0_VID_BUF2_BASE_ADRS 0x0448
+# define RADEON_VIF_BUF2_PITCH_SEL 0x00000001L
+# define RADEON_VIF_BUF2_TILE_ADRS 0x00000002L
+# define RADEON_VIF_BUF2_BASE_ADRS_MASK 0x03fffff0L
+# define RADEON_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L
+#define RADEON_OV0_VID_BUF3_BASE_ADRS 0x044C
+#define RADEON_OV0_VID_BUF4_BASE_ADRS 0x0450
+#define RADEON_OV0_VID_BUF5_BASE_ADRS 0x0454
+#define RADEON_OV0_VIDEO_KEY_CLR_HIGH 0x04E8
+#define RADEON_OV0_VIDEO_KEY_CLR_LOW 0x04E4
+#define RADEON_OV0_Y_X_START 0x0400
+#define RADEON_OV0_Y_X_END 0x0404
+#define RADEON_OV1_Y_X_START 0x0600
+#define RADEON_OV1_Y_X_END 0x0604
+#define RADEON_OVR_CLR 0x0230
+#define RADEON_OVR_WID_LEFT_RIGHT 0x0234
+#define RADEON_OVR_WID_TOP_BOTTOM 0x0238
+
+#define RADEON_P2PLL_CNTL 0x002a /* P2PLL */
+# define RADEON_P2PLL_RESET (1 << 0)
+# define RADEON_P2PLL_SLEEP (1 << 1)
+# define RADEON_P2PLL_ATOMIC_UPDATE_EN (1 << 16)
+# define RADEON_P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
+# define RADEON_P2PLL_ATOMIC_UPDATE_VSYNC (1 << 18)
+#define RADEON_P2PLL_DIV_0 0x002c
+# define RADEON_P2PLL_FB0_DIV_MASK 0x07ff
+# define RADEON_P2PLL_POST0_DIV_MASK 0x00070000
+#define RADEON_P2PLL_REF_DIV 0x002B /* PLL */
+# define RADEON_P2PLL_REF_DIV_MASK 0x03ff
+# define RADEON_P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */
+# define RADEON_P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */
+#define RADEON_PALETTE_DATA 0x00b4
+#define RADEON_PALETTE_30_DATA 0x00b8
+#define RADEON_PALETTE_INDEX 0x00b0
+#define RADEON_PCI_GART_PAGE 0x017c
+#define RADEON_PIXCLKS_CNTL 0x002d
+# define RADEON_PIX2CLK_SRC_SEL_MASK 0x03
+# define RADEON_PIX2CLK_SRC_SEL_CPUCLK 0x00
+# define RADEON_PIX2CLK_SRC_SEL_PSCANCLK 0x01
+# define RADEON_PIX2CLK_SRC_SEL_BYTECLK 0x02
+# define RADEON_PIX2CLK_SRC_SEL_P2PLLCLK 0x03
+# define RADEON_PIX2CLK_ALWAYS_ONb (1<<6)
+# define RADEON_PIX2CLK_DAC_ALWAYS_ONb (1<<7)
+# define RADEON_PIXCLK_TV_SRC_SEL (1 << 8)
+# define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14)
+# define RADEON_PIXCLK_TMDS_ALWAYS_ONb (1 << 15)
+#define RADEON_PLANE_3D_MASK_C 0x1d44
+#define RADEON_PLL_TEST_CNTL 0x0013 /* PLL */
+#define RADEON_PMI_CAP_ID 0x0f5c /* PCI */
+#define RADEON_PMI_DATA 0x0f63 /* PCI */
+#define RADEON_PMI_NXT_CAP_PTR 0x0f5d /* PCI */
+#define RADEON_PMI_PMC_REG 0x0f5e /* PCI */
+#define RADEON_PMI_PMCSR_REG 0x0f60 /* PCI */
+#define RADEON_PMI_REGISTER 0x0f5c /* PCI */
+#define RADEON_PPLL_CNTL 0x0002 /* PLL */
+# define RADEON_PPLL_RESET (1 << 0)
+# define RADEON_PPLL_SLEEP (1 << 1)
+# define RADEON_PPLL_ATOMIC_UPDATE_EN (1 << 16)
+# define RADEON_PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
+# define RADEON_PPLL_ATOMIC_UPDATE_VSYNC (1 << 18)
+#define RADEON_PPLL_DIV_0 0x0004 /* PLL */
+#define RADEON_PPLL_DIV_1 0x0005 /* PLL */
+#define RADEON_PPLL_DIV_2 0x0006 /* PLL */
+#define RADEON_PPLL_DIV_3 0x0007 /* PLL */
+# define RADEON_PPLL_FB3_DIV_MASK 0x07ff
+# define RADEON_PPLL_POST3_DIV_MASK 0x00070000
+#define RADEON_PPLL_REF_DIV 0x0003 /* PLL */
+# define RADEON_PPLL_REF_DIV_MASK 0x03ff
+# define RADEON_PPLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */
+# define RADEON_PPLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */
+#define RADEON_PWR_MNGMT_CNTL_STATUS 0x0f60 /* PCI */
+
+#define RADEON_RBBM_GUICNTL 0x172c
+# define RADEON_HOST_DATA_SWAP_NONE (0 << 0)
+# define RADEON_HOST_DATA_SWAP_16BIT (1 << 0)
+# define RADEON_HOST_DATA_SWAP_32BIT (2 << 0)
+# define RADEON_HOST_DATA_SWAP_HDW (3 << 0)
+#define RADEON_RBBM_SOFT_RESET 0x00f0
+# define RADEON_SOFT_RESET_CP (1 << 0)
+# define RADEON_SOFT_RESET_HI (1 << 1)
+# define RADEON_SOFT_RESET_SE (1 << 2)
+# define RADEON_SOFT_RESET_RE (1 << 3)
+# define RADEON_SOFT_RESET_PP (1 << 4)
+# define RADEON_SOFT_RESET_E2 (1 << 5)
+# define RADEON_SOFT_RESET_RB (1 << 6)
+# define RADEON_SOFT_RESET_HDP (1 << 7)
+#define RADEON_RBBM_STATUS 0x0e40
+# define RADEON_RBBM_FIFOCNT_MASK 0x007f
+# define RADEON_RBBM_ACTIVE (1 << 31)
+#define RADEON_RB2D_DSTCACHE_CTLSTAT 0x342c
+# define RADEON_RB2D_DC_FLUSH (3 << 0)
+# define RADEON_RB2D_DC_FREE (3 << 2)
+# define RADEON_RB2D_DC_FLUSH_ALL 0xf
+# define RADEON_RB2D_DC_BUSY (1 << 31)
+#define RADEON_RB2D_DSTCACHE_MODE 0x3428
+#define RADEON_REG_BASE 0x0f18 /* PCI */
+#define RADEON_REGPROG_INF 0x0f09 /* PCI */
+#define RADEON_REVISION_ID 0x0f08 /* PCI */
+
+#define RADEON_SC_BOTTOM 0x164c
+#define RADEON_SC_BOTTOM_RIGHT 0x16f0
+#define RADEON_SC_BOTTOM_RIGHT_C 0x1c8c
+#define RADEON_SC_LEFT 0x1640
+#define RADEON_SC_RIGHT 0x1644
+#define RADEON_SC_TOP 0x1648
+#define RADEON_SC_TOP_LEFT 0x16ec
+#define RADEON_SC_TOP_LEFT_C 0x1c88
+# define RADEON_SC_SIGN_MASK_LO 0x8000
+# define RADEON_SC_SIGN_MASK_HI 0x80000000
+#define RADEON_SCLK_CNTL 0x000d /* PLL */
+# define RADEON_DYN_STOP_LAT_MASK 0x00007ff8
+# define RADEON_CP_MAX_DYN_STOP_LAT 0x0008
+# define RADEON_SCLK_FORCEON_MASK 0xffff8000
+#define RADEON_SCLK_MORE_CNTL 0x0035 /* PLL */
+# define RADEON_SCLK_MORE_FORCEON 0x0700
+#define RADEON_SDRAM_MODE_REG 0x0158
+#define RADEON_SEQ8_DATA 0x03c5 /* VGA */
+#define RADEON_SEQ8_IDX 0x03c4 /* VGA */
+#define RADEON_SNAPSHOT_F_COUNT 0x0244
+#define RADEON_SNAPSHOT_VH_COUNTS 0x0240
+#define RADEON_SNAPSHOT_VIF_COUNT 0x024c
+#define RADEON_SRC_OFFSET 0x15ac
+#define RADEON_SRC_PITCH 0x15b0
+#define RADEON_SRC_PITCH_OFFSET 0x1428
+#define RADEON_SRC_SC_BOTTOM 0x165c
+#define RADEON_SRC_SC_BOTTOM_RIGHT 0x16f4
+#define RADEON_SRC_SC_RIGHT 0x1654
+#define RADEON_SRC_X 0x1414
+#define RADEON_SRC_X_Y 0x1590
+#define RADEON_SRC_Y 0x1418
+#define RADEON_SRC_Y_X 0x1434
+#define RADEON_STATUS 0x0f06 /* PCI */
+#define RADEON_SUBPIC_CNTL 0x0540 /* ? */
+#define RADEON_SUB_CLASS 0x0f0a /* PCI */
+#define RADEON_SURFACE_CNTL 0x0b00
+# define RADEON_SURF_TRANSLATION_DIS (1 << 8)
+# define RADEON_NONSURF_AP0_SWP_16BPP (1 << 20)
+# define RADEON_NONSURF_AP0_SWP_32BPP (1 << 21)
+#define RADEON_SURFACE0_INFO 0x0b0c
+# define RADEON_SURF_TILE_COLOR_MACRO (0 << 16)
+# define RADEON_SURF_TILE_COLOR_BOTH (1 << 16)
+# define RADEON_SURF_TILE_DEPTH_32BPP (2 << 16)
+# define RADEON_SURF_TILE_DEPTH_16BPP (3 << 16)
+# define R200_SURF_TILE_NONE (0 << 16)
+# define R200_SURF_TILE_COLOR_MACRO (1 << 16)
+# define R200_SURF_TILE_COLOR_MICRO (2 << 16)
+# define R200_SURF_TILE_COLOR_BOTH (3 << 16)
+# define R200_SURF_TILE_DEPTH_32BPP (4 << 16)
+# define R200_SURF_TILE_DEPTH_16BPP (5 << 16)
+# define RADEON_SURF_AP0_SWP_16BPP (1 << 20)
+# define RADEON_SURF_AP0_SWP_32BPP (1 << 21)
+# define RADEON_SURF_AP1_SWP_16BPP (1 << 22)
+# define RADEON_SURF_AP1_SWP_32BPP (1 << 23)
+#define RADEON_SURFACE0_LOWER_BOUND 0x0b04
+#define RADEON_SURFACE0_UPPER_BOUND 0x0b08
+#define RADEON_SURFACE1_INFO 0x0b1c
+#define RADEON_SURFACE1_LOWER_BOUND 0x0b14
+#define RADEON_SURFACE1_UPPER_BOUND 0x0b18
+#define RADEON_SURFACE2_INFO 0x0b2c
+#define RADEON_SURFACE2_LOWER_BOUND 0x0b24
+#define RADEON_SURFACE2_UPPER_BOUND 0x0b28
+#define RADEON_SURFACE3_INFO 0x0b3c
+#define RADEON_SURFACE3_LOWER_BOUND 0x0b34
+#define RADEON_SURFACE3_UPPER_BOUND 0x0b38
+#define RADEON_SURFACE4_INFO 0x0b4c
+#define RADEON_SURFACE4_LOWER_BOUND 0x0b44
+#define RADEON_SURFACE4_UPPER_BOUND 0x0b48
+#define RADEON_SURFACE5_INFO 0x0b5c
+#define RADEON_SURFACE5_LOWER_BOUND 0x0b54
+#define RADEON_SURFACE5_UPPER_BOUND 0x0b58
+#define RADEON_SURFACE6_INFO 0x0b6c
+#define RADEON_SURFACE6_LOWER_BOUND 0x0b64
+#define RADEON_SURFACE6_UPPER_BOUND 0x0b68
+#define RADEON_SURFACE7_INFO 0x0b7c
+#define RADEON_SURFACE7_LOWER_BOUND 0x0b74
+#define RADEON_SURFACE7_UPPER_BOUND 0x0b78
+#define RADEON_SW_SEMAPHORE 0x013c
+
+#define RADEON_TEST_DEBUG_CNTL 0x0120
+#define RADEON_TEST_DEBUG_MUX 0x0124
+#define RADEON_TEST_DEBUG_OUT 0x012c
+#define RADEON_TMDS_PLL_CNTL 0x02a8
+#define RADEON_TMDS_TRANSMITTER_CNTL 0x02a4
+# define RADEON_TMDS_TRANSMITTER_PLLEN 1
+# define RADEON_TMDS_TRANSMITTER_PLLRST 2
+#define RADEON_TRAIL_BRES_DEC 0x1614
+#define RADEON_TRAIL_BRES_ERR 0x160c
+#define RADEON_TRAIL_BRES_INC 0x1610
+#define RADEON_TRAIL_X 0x1618
+#define RADEON_TRAIL_X_SUB 0x1620
+
+#define RADEON_VCLK_ECP_CNTL 0x0008 /* PLL */
+# define RADEON_VCLK_SRC_SEL_MASK 0x03
+# define RADEON_VCLK_SRC_SEL_CPUCLK 0x00
+# define RADEON_VCLK_SRC_SEL_PSCANCLK 0x01
+# define RADEON_VCLK_SRC_SEL_BYTECLK 0x02
+# define RADEON_VCLK_SRC_SEL_PPLLCLK 0x03
+# define RADEON_PIXCLK_ALWAYS_ONb (1<<6)
+# define RADEON_PIXCLK_DAC_ALWAYS_ONb (1<<7)
+
+#define RADEON_VENDOR_ID 0x0f00 /* PCI */
+#define RADEON_VGA_DDA_CONFIG 0x02e8
+#define RADEON_VGA_DDA_ON_OFF 0x02ec
+#define RADEON_VID_BUFFER_CONTROL 0x0900
+#define RADEON_VIDEOMUX_CNTL 0x0190
+#define RADEON_VIPH_CONTROL 0x0c40 /* ? */
+
+#define RADEON_WAIT_UNTIL 0x1720
+# define RADEON_WAIT_CRTC_PFLIP (1 << 0)
+# define RADEON_WAIT_2D_IDLECLEAN (1 << 16)
+# define RADEON_WAIT_3D_IDLECLEAN (1 << 17)
+# define RADEON_WAIT_HOST_IDLECLEAN (1 << 18)
+
+#define RADEON_X_MPLL_REF_FB_DIV 0x000a /* PLL */
+#define RADEON_XCLK_CNTL 0x000d /* PLL */
+#define RADEON_XDLL_CNTL 0x000c /* PLL */
+#define RADEON_XPLL_CNTL 0x000b /* PLL */
+
+
+
+ /* Registers for 3D/TCL */
+#define RADEON_PP_BORDER_COLOR_0 0x1d40
+#define RADEON_PP_BORDER_COLOR_1 0x1d44
+#define RADEON_PP_BORDER_COLOR_2 0x1d48
+#define RADEON_PP_CNTL 0x1c38
+# define RADEON_STIPPLE_ENABLE (1 << 0)
+# define RADEON_SCISSOR_ENABLE (1 << 1)
+# define RADEON_PATTERN_ENABLE (1 << 2)
+# define RADEON_SHADOW_ENABLE (1 << 3)
+# define RADEON_TEX_ENABLE_MASK (0xf << 4)
+# define RADEON_TEX_0_ENABLE (1 << 4)
+# define RADEON_TEX_1_ENABLE (1 << 5)
+# define RADEON_TEX_2_ENABLE (1 << 6)
+# define RADEON_TEX_3_ENABLE (1 << 7)
+# define RADEON_TEX_BLEND_ENABLE_MASK (0xf << 12)
+# define RADEON_TEX_BLEND_0_ENABLE (1 << 12)
+# define RADEON_TEX_BLEND_1_ENABLE (1 << 13)
+# define RADEON_TEX_BLEND_2_ENABLE (1 << 14)
+# define RADEON_TEX_BLEND_3_ENABLE (1 << 15)
+# define RADEON_PLANAR_YUV_ENABLE (1 << 20)
+# define RADEON_SPECULAR_ENABLE (1 << 21)
+# define RADEON_FOG_ENABLE (1 << 22)
+# define RADEON_ALPHA_TEST_ENABLE (1 << 23)
+# define RADEON_ANTI_ALIAS_NONE (0 << 24)
+# define RADEON_ANTI_ALIAS_LINE (1 << 24)
+# define RADEON_ANTI_ALIAS_POLY (2 << 24)
+# define RADEON_ANTI_ALIAS_LINE_POLY (3 << 24)
+# define RADEON_BUMP_MAP_ENABLE (1 << 26)
+# define RADEON_BUMPED_MAP_T0 (0 << 27)
+# define RADEON_BUMPED_MAP_T1 (1 << 27)
+# define RADEON_BUMPED_MAP_T2 (2 << 27)
+# define RADEON_TEX_3D_ENABLE_0 (1 << 29)
+# define RADEON_TEX_3D_ENABLE_1 (1 << 30)
+# define RADEON_MC_ENABLE (1 << 31)
+#define RADEON_PP_FOG_COLOR 0x1c18
+# define RADEON_FOG_COLOR_MASK 0x00ffffff
+# define RADEON_FOG_VERTEX (0 << 24)
+# define RADEON_FOG_TABLE (1 << 24)
+# define RADEON_FOG_USE_DEPTH (0 << 25)
+# define RADEON_FOG_USE_DIFFUSE_ALPHA (2 << 25)
+# define RADEON_FOG_USE_SPEC_ALPHA (3 << 25)
+#define RADEON_PP_LUM_MATRIX 0x1d00
+#define RADEON_PP_MISC 0x1c14
+# define RADEON_REF_ALPHA_MASK 0x000000ff
+# define RADEON_ALPHA_TEST_FAIL (0 << 8)
+# define RADEON_ALPHA_TEST_LESS (1 << 8)
+# define RADEON_ALPHA_TEST_LEQUAL (2 << 8)
+# define RADEON_ALPHA_TEST_EQUAL (3 << 8)
+# define RADEON_ALPHA_TEST_GEQUAL (4 << 8)
+# define RADEON_ALPHA_TEST_GREATER (5 << 8)
+# define RADEON_ALPHA_TEST_NEQUAL (6 << 8)
+# define RADEON_ALPHA_TEST_PASS (7 << 8)
+# define RADEON_ALPHA_TEST_OP_MASK (7 << 8)
+# define RADEON_CHROMA_FUNC_FAIL (0 << 16)
+# define RADEON_CHROMA_FUNC_PASS (1 << 16)
+# define RADEON_CHROMA_FUNC_NEQUAL (2 << 16)
+# define RADEON_CHROMA_FUNC_EQUAL (3 << 16)
+# define RADEON_CHROMA_KEY_NEAREST (0 << 18)
+# define RADEON_CHROMA_KEY_ZERO (1 << 18)
+# define RADEON_SHADOW_ID_AUTO_INC (1 << 20)
+# define RADEON_SHADOW_FUNC_EQUAL (0 << 21)
+# define RADEON_SHADOW_FUNC_NEQUAL (1 << 21)
+# define RADEON_SHADOW_PASS_1 (0 << 22)
+# define RADEON_SHADOW_PASS_2 (1 << 22)
+# define RADEON_RIGHT_HAND_CUBE_D3D (0 << 24)
+# define RADEON_RIGHT_HAND_CUBE_OGL (1 << 24)
+#define RADEON_PP_ROT_MATRIX_0 0x1d58
+#define RADEON_PP_ROT_MATRIX_1 0x1d5c
+#define RADEON_PP_TXFILTER_0 0x1c54
+#define RADEON_PP_TXFILTER_1 0x1c6c
+#define RADEON_PP_TXFILTER_2 0x1c84
+# define RADEON_MAG_FILTER_NEAREST (0 << 0)
+# define RADEON_MAG_FILTER_LINEAR (1 << 0)
+# define RADEON_MAG_FILTER_MASK (1 << 0)
+# define RADEON_MIN_FILTER_NEAREST (0 << 1)
+# define RADEON_MIN_FILTER_LINEAR (1 << 1)
+# define RADEON_MIN_FILTER_NEAREST_MIP_NEAREST (2 << 1)
+# define RADEON_MIN_FILTER_NEAREST_MIP_LINEAR (3 << 1)
+# define RADEON_MIN_FILTER_LINEAR_MIP_NEAREST (6 << 1)
+# define RADEON_MIN_FILTER_LINEAR_MIP_LINEAR (7 << 1)
+# define RADEON_MIN_FILTER_ANISO_NEAREST (8 << 1)
+# define RADEON_MIN_FILTER_ANISO_LINEAR (9 << 1)
+# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 << 1)
+# define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 << 1)
+# define RADEON_MIN_FILTER_MASK (15 << 1)
+# define RADEON_MAX_ANISO_1_TO_1 (0 << 5)
+# define RADEON_MAX_ANISO_2_TO_1 (1 << 5)
+# define RADEON_MAX_ANISO_4_TO_1 (2 << 5)
+# define RADEON_MAX_ANISO_8_TO_1 (3 << 5)
+# define RADEON_MAX_ANISO_16_TO_1 (4 << 5)
+# define RADEON_MAX_ANISO_MASK (7 << 5)
+# define RADEON_LOD_BIAS_MASK (0xff << 8)
+# define RADEON_LOD_BIAS_SHIFT 8
+# define RADEON_MAX_MIP_LEVEL_MASK (0x0f << 16)
+# define RADEON_MAX_MIP_LEVEL_SHIFT 16
+# define RADEON_YUV_TO_RGB (1 << 20)
+# define RADEON_YUV_TEMPERATURE_COOL (0 << 21)
+# define RADEON_YUV_TEMPERATURE_HOT (1 << 21)
+# define RADEON_YUV_TEMPERATURE_MASK (1 << 21)
+# define RADEON_WRAPEN_S (1 << 22)
+# define RADEON_CLAMP_S_WRAP (0 << 23)
+# define RADEON_CLAMP_S_MIRROR (1 << 23)
+# define RADEON_CLAMP_S_CLAMP_LAST (2 << 23)
+# define RADEON_CLAMP_S_MIRROR_CLAMP_LAST (3 << 23)
+# define RADEON_CLAMP_S_CLAMP_BORDER (4 << 23)
+# define RADEON_CLAMP_S_MIRROR_CLAMP_BORDER (5 << 23)
+# define RADEON_CLAMP_S_CLAMP_GL (6 << 23)
+# define RADEON_CLAMP_S_MIRROR_CLAMP_GL (7 << 23)
+# define RADEON_CLAMP_S_MASK (7 << 23)
+# define RADEON_WRAPEN_T (1 << 26)
+# define RADEON_CLAMP_T_WRAP (0 << 27)
+# define RADEON_CLAMP_T_MIRROR (1 << 27)
+# define RADEON_CLAMP_T_CLAMP_LAST (2 << 27)
+# define RADEON_CLAMP_T_MIRROR_CLAMP_LAST (3 << 27)
+# define RADEON_CLAMP_T_CLAMP_BORDER (4 << 27)
+# define RADEON_CLAMP_T_MIRROR_CLAMP_BORDER (5 << 27)
+# define RADEON_CLAMP_T_CLAMP_GL (6 << 27)
+# define RADEON_CLAMP_T_MIRROR_CLAMP_GL (7 << 27)
+# define RADEON_CLAMP_T_MASK (7 << 27)
+# define RADEON_BORDER_MODE_OGL (0 << 31)
+# define RADEON_BORDER_MODE_D3D (1 << 31)
+#define RADEON_PP_TXFORMAT_0 0x1c58
+#define RADEON_PP_TXFORMAT_1 0x1c70
+#define RADEON_PP_TXFORMAT_2 0x1c88
+# define RADEON_TXFORMAT_I8 (0 << 0)
+# define RADEON_TXFORMAT_AI88 (1 << 0)
+# define RADEON_TXFORMAT_RGB332 (2 << 0)
+# define RADEON_TXFORMAT_ARGB1555 (3 << 0)
+# define RADEON_TXFORMAT_RGB565 (4 << 0)
+# define RADEON_TXFORMAT_ARGB4444 (5 << 0)
+# define RADEON_TXFORMAT_ARGB8888 (6 << 0)
+# define RADEON_TXFORMAT_RGBA8888 (7 << 0)
+# define RADEON_TXFORMAT_Y8 (8 << 0)
+# define RADEON_TXFORMAT_VYUY422 (10 << 0)
+# define RADEON_TXFORMAT_YVYU422 (11 << 0)
+# define RADEON_TXFORMAT_DXT1 (12 << 0)
+# define RADEON_TXFORMAT_DXT23 (14 << 0)
+# define RADEON_TXFORMAT_DXT45 (15 << 0)
+# define RADEON_TXFORMAT_SHADOW16 (16 << 0)
+# define RADEON_TXFORMAT_SHADOW32 (17 << 0)
+# define RADEON_TXFORMAT_DUDV88 (18 << 0)
+# define RADEON_TXFORMAT_LDUDV655 (19 << 0)
+# define RADEON_TXFORMAT_LDUDUV8888 (20 << 0)
+# define RADEON_TXFORMAT_FORMAT_MASK (31 << 0)
+# define RADEON_TXFORMAT_FORMAT_SHIFT 0
+# define RADEON_TXFORMAT_APPLE_YUV_MODE (1 << 5)
+# define RADEON_TXFORMAT_ALPHA_IN_MAP (1 << 6)
+# define RADEON_TXFORMAT_NON_POWER2 (1 << 7)
+# define RADEON_TXFORMAT_WIDTH_MASK (15 << 8)
+# define RADEON_TXFORMAT_WIDTH_SHIFT 8
+# define RADEON_TXFORMAT_HEIGHT_MASK (15 << 12)
+# define RADEON_TXFORMAT_HEIGHT_SHIFT 12
+# define RADEON_TXFORMAT_F5_WIDTH_MASK (15 << 16)
+# define RADEON_TXFORMAT_F5_WIDTH_SHIFT 16
+# define RADEON_TXFORMAT_F5_HEIGHT_MASK (15 << 20)
+# define RADEON_TXFORMAT_F5_HEIGHT_SHIFT 20
+# define RADEON_TXFORMAT_ST_ROUTE_STQ0 (0 << 24)
+# define RADEON_TXFORMAT_ST_ROUTE_MASK (3 << 24)
+# define RADEON_TXFORMAT_ST_ROUTE_STQ1 (1 << 24)
+# define RADEON_TXFORMAT_ST_ROUTE_STQ2 (2 << 24)
+# define RADEON_TXFORMAT_ENDIAN_NO_SWAP (0 << 26)
+# define RADEON_TXFORMAT_ENDIAN_16BPP_SWAP (1 << 26)
+# define RADEON_TXFORMAT_ENDIAN_32BPP_SWAP (2 << 26)
+# define RADEON_TXFORMAT_ENDIAN_HALFDW_SWAP (3 << 26)
+# define RADEON_TXFORMAT_ALPHA_MASK_ENABLE (1 << 28)
+# define RADEON_TXFORMAT_CHROMA_KEY_ENABLE (1 << 29)
+# define RADEON_TXFORMAT_CUBIC_MAP_ENABLE (1 << 30)
+# define RADEON_TXFORMAT_PERSPECTIVE_ENABLE (1 << 31)
+#define RADEON_PP_CUBIC_FACES_0 0x1d24
+#define RADEON_PP_CUBIC_FACES_1 0x1d28
+#define RADEON_PP_CUBIC_FACES_2 0x1d2c
+# define RADEON_FACE_WIDTH_1_SHIFT 0
+# define RADEON_FACE_HEIGHT_1_SHIFT 4
+# define RADEON_FACE_WIDTH_1_MASK (0xf << 0)
+# define RADEON_FACE_HEIGHT_1_MASK (0xf << 4)
+# define RADEON_FACE_WIDTH_2_SHIFT 8
+# define RADEON_FACE_HEIGHT_2_SHIFT 12
+# define RADEON_FACE_WIDTH_2_MASK (0xf << 8)
+# define RADEON_FACE_HEIGHT_2_MASK (0xf << 12)
+# define RADEON_FACE_WIDTH_3_SHIFT 16
+# define RADEON_FACE_HEIGHT_3_SHIFT 20
+# define RADEON_FACE_WIDTH_3_MASK (0xf << 16)
+# define RADEON_FACE_HEIGHT_3_MASK (0xf << 20)
+# define RADEON_FACE_WIDTH_4_SHIFT 24
+# define RADEON_FACE_HEIGHT_4_SHIFT 28
+# define RADEON_FACE_WIDTH_4_MASK (0xf << 24)
+# define RADEON_FACE_HEIGHT_4_MASK (0xf << 28)
+
+#define RADEON_PP_TXOFFSET_0 0x1c5c
+#define RADEON_PP_TXOFFSET_1 0x1c74
+#define RADEON_PP_TXOFFSET_2 0x1c8c
+# define RADEON_TXO_ENDIAN_NO_SWAP (0 << 0)
+# define RADEON_TXO_ENDIAN_BYTE_SWAP (1 << 0)
+# define RADEON_TXO_ENDIAN_WORD_SWAP (2 << 0)
+# define RADEON_TXO_ENDIAN_HALFDW_SWAP (3 << 0)
+# define RADEON_TXO_MACRO_LINEAR (0 << 2)
+# define RADEON_TXO_MACRO_TILE (1 << 2)
+# define RADEON_TXO_MICRO_LINEAR (0 << 3)
+# define RADEON_TXO_MICRO_TILE_X2 (1 << 3)
+# define RADEON_TXO_MICRO_TILE_OPT (2 << 3)
+# define RADEON_TXO_OFFSET_MASK 0xffffffe0
+# define RADEON_TXO_OFFSET_SHIFT 5
+
+#define RADEON_PP_CUBIC_OFFSET_T0_0 0x1dd0 /* bits [31:5] */
+#define RADEON_PP_CUBIC_OFFSET_T0_1 0x1dd4
+#define RADEON_PP_CUBIC_OFFSET_T0_2 0x1dd8
+#define RADEON_PP_CUBIC_OFFSET_T0_3 0x1ddc
+#define RADEON_PP_CUBIC_OFFSET_T0_4 0x1de0
+#define RADEON_PP_CUBIC_OFFSET_T1_0 0x1e00
+#define RADEON_PP_CUBIC_OFFSET_T1_1 0x1e04
+#define RADEON_PP_CUBIC_OFFSET_T1_2 0x1e08
+#define RADEON_PP_CUBIC_OFFSET_T1_3 0x1e0c
+#define RADEON_PP_CUBIC_OFFSET_T1_4 0x1e10
+#define RADEON_PP_CUBIC_OFFSET_T2_0 0x1e14
+#define RADEON_PP_CUBIC_OFFSET_T2_1 0x1e18
+#define RADEON_PP_CUBIC_OFFSET_T2_2 0x1e1c
+#define RADEON_PP_CUBIC_OFFSET_T2_3 0x1e20
+#define RADEON_PP_CUBIC_OFFSET_T2_4 0x1e24
+
+#define RADEON_PP_TEX_SIZE_0 0x1d04 /* NPOT */
+#define RADEON_PP_TEX_SIZE_1 0x1d0c
+#define RADEON_PP_TEX_SIZE_2 0x1d14
+# define RADEON_TEX_USIZE_MASK (0x7ff << 0)
+# define RADEON_TEX_USIZE_SHIFT 0
+# define RADEON_TEX_VSIZE_MASK (0x7ff << 16)
+# define RADEON_TEX_VSIZE_SHIFT 16
+# define RADEON_SIGNED_RGB_MASK (1 << 30)
+# define RADEON_SIGNED_RGB_SHIFT 30
+# define RADEON_SIGNED_ALPHA_MASK (1 << 31)
+# define RADEON_SIGNED_ALPHA_SHIFT 31
+#define RADEON_PP_TEX_PITCH_0 0x1d08 /* NPOT */
+#define RADEON_PP_TEX_PITCH_1 0x1d10 /* NPOT */
+#define RADEON_PP_TEX_PITCH_2 0x1d18 /* NPOT */
+/* note: bits 13-5: 32 byte aligned stride of texture map */
+
+#define RADEON_PP_TXCBLEND_0 0x1c60
+#define RADEON_PP_TXCBLEND_1 0x1c78
+#define RADEON_PP_TXCBLEND_2 0x1c90
+# define RADEON_COLOR_ARG_A_SHIFT 0
+# define RADEON_COLOR_ARG_A_MASK (0x1f << 0)
+# define RADEON_COLOR_ARG_A_ZERO (0 << 0)
+# define RADEON_COLOR_ARG_A_CURRENT_COLOR (2 << 0)
+# define RADEON_COLOR_ARG_A_CURRENT_ALPHA (3 << 0)
+# define RADEON_COLOR_ARG_A_DIFFUSE_COLOR (4 << 0)
+# define RADEON_COLOR_ARG_A_DIFFUSE_ALPHA (5 << 0)
+# define RADEON_COLOR_ARG_A_SPECULAR_COLOR (6 << 0)
+# define RADEON_COLOR_ARG_A_SPECULAR_ALPHA (7 << 0)
+# define RADEON_COLOR_ARG_A_TFACTOR_COLOR (8 << 0)
+# define RADEON_COLOR_ARG_A_TFACTOR_ALPHA (9 << 0)
+# define RADEON_COLOR_ARG_A_T0_COLOR (10 << 0)
+# define RADEON_COLOR_ARG_A_T0_ALPHA (11 << 0)
+# define RADEON_COLOR_ARG_A_T1_COLOR (12 << 0)
+# define RADEON_COLOR_ARG_A_T1_ALPHA (13 << 0)
+# define RADEON_COLOR_ARG_A_T2_COLOR (14 << 0)
+# define RADEON_COLOR_ARG_A_T2_ALPHA (15 << 0)
+# define RADEON_COLOR_ARG_A_T3_COLOR (16 << 0)
+# define RADEON_COLOR_ARG_A_T3_ALPHA (17 << 0)
+# define RADEON_COLOR_ARG_B_SHIFT 5
+# define RADEON_COLOR_ARG_B_MASK (0x1f << 5)
+# define RADEON_COLOR_ARG_B_ZERO (0 << 5)
+# define RADEON_COLOR_ARG_B_CURRENT_COLOR (2 << 5)
+# define RADEON_COLOR_ARG_B_CURRENT_ALPHA (3 << 5)
+# define RADEON_COLOR_ARG_B_DIFFUSE_COLOR (4 << 5)
+# define RADEON_COLOR_ARG_B_DIFFUSE_ALPHA (5 << 5)
+# define RADEON_COLOR_ARG_B_SPECULAR_COLOR (6 << 5)
+# define RADEON_COLOR_ARG_B_SPECULAR_ALPHA (7 << 5)
+# define RADEON_COLOR_ARG_B_TFACTOR_COLOR (8 << 5)
+# define RADEON_COLOR_ARG_B_TFACTOR_ALPHA (9 << 5)
+# define RADEON_COLOR_ARG_B_T0_COLOR (10 << 5)
+# define RADEON_COLOR_ARG_B_T0_ALPHA (11 << 5)
+# define RADEON_COLOR_ARG_B_T1_COLOR (12 << 5)
+# define RADEON_COLOR_ARG_B_T1_ALPHA (13 << 5)
+# define RADEON_COLOR_ARG_B_T2_COLOR (14 << 5)
+# define RADEON_COLOR_ARG_B_T2_ALPHA (15 << 5)
+# define RADEON_COLOR_ARG_B_T3_COLOR (16 << 5)
+# define RADEON_COLOR_ARG_B_T3_ALPHA (17 << 5)
+# define RADEON_COLOR_ARG_C_SHIFT 10
+# define RADEON_COLOR_ARG_C_MASK (0x1f << 10)
+# define RADEON_COLOR_ARG_C_ZERO (0 << 10)
+# define RADEON_COLOR_ARG_C_CURRENT_COLOR (2 << 10)
+# define RADEON_COLOR_ARG_C_CURRENT_ALPHA (3 << 10)
+# define RADEON_COLOR_ARG_C_DIFFUSE_COLOR (4 << 10)
+# define RADEON_COLOR_ARG_C_DIFFUSE_ALPHA (5 << 10)
+# define RADEON_COLOR_ARG_C_SPECULAR_COLOR (6 << 10)
+# define RADEON_COLOR_ARG_C_SPECULAR_ALPHA (7 << 10)
+# define RADEON_COLOR_ARG_C_TFACTOR_COLOR (8 << 10)
+# define RADEON_COLOR_ARG_C_TFACTOR_ALPHA (9 << 10)
+# define RADEON_COLOR_ARG_C_T0_COLOR (10 << 10)
+# define RADEON_COLOR_ARG_C_T0_ALPHA (11 << 10)
+# define RADEON_COLOR_ARG_C_T1_COLOR (12 << 10)
+# define RADEON_COLOR_ARG_C_T1_ALPHA (13 << 10)
+# define RADEON_COLOR_ARG_C_T2_COLOR (14 << 10)
+# define RADEON_COLOR_ARG_C_T2_ALPHA (15 << 10)
+# define RADEON_COLOR_ARG_C_T3_COLOR (16 << 10)
+# define RADEON_COLOR_ARG_C_T3_ALPHA (17 << 10)
+# define RADEON_COMP_ARG_A (1 << 15)
+# define RADEON_COMP_ARG_A_SHIFT 15
+# define RADEON_COMP_ARG_B (1 << 16)
+# define RADEON_COMP_ARG_B_SHIFT 16
+# define RADEON_COMP_ARG_C (1 << 17)
+# define RADEON_COMP_ARG_C_SHIFT 17
+# define RADEON_BLEND_CTL_MASK (7 << 18)
+# define RADEON_BLEND_CTL_ADD (0 << 18)
+# define RADEON_BLEND_CTL_SUBTRACT (1 << 18)
+# define RADEON_BLEND_CTL_ADDSIGNED (2 << 18)
+# define RADEON_BLEND_CTL_BLEND (3 << 18)
+# define RADEON_BLEND_CTL_DOT3 (4 << 18)
+# define RADEON_SCALE_SHIFT 21
+# define RADEON_SCALE_MASK (3 << 21)
+# define RADEON_SCALE_1X (0 << 21)
+# define RADEON_SCALE_2X (1 << 21)
+# define RADEON_SCALE_4X (2 << 21)
+# define RADEON_CLAMP_TX (1 << 23)
+# define RADEON_T0_EQ_TCUR (1 << 24)
+# define RADEON_T1_EQ_TCUR (1 << 25)
+# define RADEON_T2_EQ_TCUR (1 << 26)
+# define RADEON_T3_EQ_TCUR (1 << 27)
+# define RADEON_COLOR_ARG_MASK 0x1f
+# define RADEON_COMP_ARG_SHIFT 15
+#define RADEON_PP_TXABLEND_0 0x1c64
+#define RADEON_PP_TXABLEND_1 0x1c7c
+#define RADEON_PP_TXABLEND_2 0x1c94
+# define RADEON_ALPHA_ARG_A_SHIFT 0
+# define RADEON_ALPHA_ARG_A_MASK (0xf << 0)
+# define RADEON_ALPHA_ARG_A_ZERO (0 << 0)
+# define RADEON_ALPHA_ARG_A_CURRENT_ALPHA (1 << 0)
+# define RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA (2 << 0)
+# define RADEON_ALPHA_ARG_A_SPECULAR_ALPHA (3 << 0)
+# define RADEON_ALPHA_ARG_A_TFACTOR_ALPHA (4 << 0)
+# define RADEON_ALPHA_ARG_A_T0_ALPHA (5 << 0)
+# define RADEON_ALPHA_ARG_A_T1_ALPHA (6 << 0)
+# define RADEON_ALPHA_ARG_A_T2_ALPHA (7 << 0)
+# define RADEON_ALPHA_ARG_A_T3_ALPHA (8 << 0)
+# define RADEON_ALPHA_ARG_B_SHIFT 4
+# define RADEON_ALPHA_ARG_B_MASK (0xf << 4)
+# define RADEON_ALPHA_ARG_B_ZERO (0 << 4)
+# define RADEON_ALPHA_ARG_B_CURRENT_ALPHA (1 << 4)
+# define RADEON_ALPHA_ARG_B_DIFFUSE_ALPHA (2 << 4)
+# define RADEON_ALPHA_ARG_B_SPECULAR_ALPHA (3 << 4)
+# define RADEON_ALPHA_ARG_B_TFACTOR_ALPHA (4 << 4)
+# define RADEON_ALPHA_ARG_B_T0_ALPHA (5 << 4)
+# define RADEON_ALPHA_ARG_B_T1_ALPHA (6 << 4)
+# define RADEON_ALPHA_ARG_B_T2_ALPHA (7 << 4)
+# define RADEON_ALPHA_ARG_B_T3_ALPHA (8 << 4)
+# define RADEON_ALPHA_ARG_C_SHIFT 8
+# define RADEON_ALPHA_ARG_C_MASK (0xf << 8)
+# define RADEON_ALPHA_ARG_C_ZERO (0 << 8)
+# define RADEON_ALPHA_ARG_C_CURRENT_ALPHA (1 << 8)
+# define RADEON_ALPHA_ARG_C_DIFFUSE_ALPHA (2 << 8)
+# define RADEON_ALPHA_ARG_C_SPECULAR_ALPHA (3 << 8)
+# define RADEON_ALPHA_ARG_C_TFACTOR_ALPHA (4 << 8)
+# define RADEON_ALPHA_ARG_C_T0_ALPHA (5 << 8)
+# define RADEON_ALPHA_ARG_C_T1_ALPHA (6 << 8)
+# define RADEON_ALPHA_ARG_C_T2_ALPHA (7 << 8)
+# define RADEON_ALPHA_ARG_C_T3_ALPHA (8 << 8)
+# define RADEON_DOT_ALPHA_DONT_REPLICATE (1 << 12)
+# define RADEON_ALPHA_ARG_MASK 0xf
+
+#define RADEON_PP_TFACTOR_0 0x1c68
+#define RADEON_PP_TFACTOR_1 0x1c80
+#define RADEON_PP_TFACTOR_2 0x1c98
+
+#define RADEON_RB3D_BLENDCNTL 0x1c20
+# define RADEON_COMB_FCN_MASK (3 << 12)
+# define RADEON_COMB_FCN_ADD_CLAMP (0 << 12)
+# define RADEON_COMB_FCN_ADD_NOCLAMP (1 << 12)
+# define RADEON_COMB_FCN_SUB_CLAMP (2 << 12)
+# define RADEON_COMB_FCN_SUB_NOCLAMP (3 << 12)
+# define RADEON_SRC_BLEND_GL_ZERO (32 << 16)
+# define RADEON_SRC_BLEND_GL_ONE (33 << 16)
+# define RADEON_SRC_BLEND_GL_SRC_COLOR (34 << 16)
+# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16)
+# define RADEON_SRC_BLEND_GL_DST_COLOR (36 << 16)
+# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16)
+# define RADEON_SRC_BLEND_GL_SRC_ALPHA (38 << 16)
+# define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16)
+# define RADEON_SRC_BLEND_GL_DST_ALPHA (40 << 16)
+# define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16)
+# define RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE (42 << 16)
+# define RADEON_SRC_BLEND_MASK (63 << 16)
+# define RADEON_DST_BLEND_GL_ZERO (32 << 24)
+# define RADEON_DST_BLEND_GL_ONE (33 << 24)
+# define RADEON_DST_BLEND_GL_SRC_COLOR (34 << 24)
+# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24)
+# define RADEON_DST_BLEND_GL_DST_COLOR (36 << 24)
+# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24)
+# define RADEON_DST_BLEND_GL_SRC_ALPHA (38 << 24)
+# define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24)
+# define RADEON_DST_BLEND_GL_DST_ALPHA (40 << 24)
+# define RADEON_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24)
+# define RADEON_DST_BLEND_MASK (63 << 24)
+#define RADEON_RB3D_CNTL 0x1c3c
+# define RADEON_ALPHA_BLEND_ENABLE (1 << 0)
+# define RADEON_PLANE_MASK_ENABLE (1 << 1)
+# define RADEON_DITHER_ENABLE (1 << 2)
+# define RADEON_ROUND_ENABLE (1 << 3)
+# define RADEON_SCALE_DITHER_ENABLE (1 << 4)
+# define RADEON_DITHER_INIT (1 << 5)
+# define RADEON_ROP_ENABLE (1 << 6)
+# define RADEON_STENCIL_ENABLE (1 << 7)
+# define RADEON_Z_ENABLE (1 << 8)
+# define RADEON_DEPTH_XZ_OFFEST_ENABLE (1 << 9)
+# define RADEON_COLOR_FORMAT_ARGB1555 (3 << 10)
+# define RADEON_COLOR_FORMAT_RGB565 (4 << 10)
+# define RADEON_COLOR_FORMAT_ARGB8888 (6 << 10)
+# define RADEON_COLOR_FORMAT_RGB332 (7 << 10)
+# define RADEON_COLOR_FORMAT_Y8 (8 << 10)
+# define RADEON_COLOR_FORMAT_RGB8 (9 << 10)
+# define RADEON_COLOR_FORMAT_YUV422_VYUY (11 << 10)
+# define RADEON_COLOR_FORMAT_YUV422_YVYU (12 << 10)
+# define RADEON_COLOR_FORMAT_aYUV444 (14 << 10)
+# define RADEON_COLOR_FORMAT_ARGB4444 (15 << 10)
+# define RADEON_CLRCMP_FLIP_ENABLE (1 << 14)
+# define RADEON_ZBLOCK16 (1 << 15)
+#define RADEON_RB3D_COLOROFFSET 0x1c40
+# define RADEON_COLOROFFSET_MASK 0xfffffff0
+#define RADEON_RB3D_COLORPITCH 0x1c48
+# define RADEON_COLORPITCH_MASK 0x000001ff8
+# define RADEON_COLOR_TILE_ENABLE (1 << 16)
+# define RADEON_COLOR_MICROTILE_ENABLE (1 << 17)
+# define RADEON_COLOR_ENDIAN_NO_SWAP (0 << 18)
+# define RADEON_COLOR_ENDIAN_WORD_SWAP (1 << 18)
+# define RADEON_COLOR_ENDIAN_DWORD_SWAP (2 << 18)
+#define RADEON_RB3D_DEPTHOFFSET 0x1c24
+#define RADEON_RB3D_DEPTHPITCH 0x1c28
+# define RADEON_DEPTHPITCH_MASK 0x00001ff8
+# define RADEON_DEPTH_HYPERZ (3 << 16)
+# define RADEON_DEPTH_ENDIAN_NO_SWAP (0 << 18)
+# define RADEON_DEPTH_ENDIAN_WORD_SWAP (1 << 18)
+# define RADEON_DEPTH_ENDIAN_DWORD_SWAP (2 << 18)
+#define RADEON_RB3D_PLANEMASK 0x1d84
+#define RADEON_RB3D_ROPCNTL 0x1d80
+# define RADEON_ROP_MASK (15 << 8)
+# define RADEON_ROP_CLEAR (0 << 8)
+# define RADEON_ROP_NOR (1 << 8)
+# define RADEON_ROP_AND_INVERTED (2 << 8)
+# define RADEON_ROP_COPY_INVERTED (3 << 8)
+# define RADEON_ROP_AND_REVERSE (4 << 8)
+# define RADEON_ROP_INVERT (5 << 8)
+# define RADEON_ROP_XOR (6 << 8)
+# define RADEON_ROP_NAND (7 << 8)
+# define RADEON_ROP_AND (8 << 8)
+# define RADEON_ROP_EQUIV (9 << 8)
+# define RADEON_ROP_NOOP (10 << 8)
+# define RADEON_ROP_OR_INVERTED (11 << 8)
+# define RADEON_ROP_COPY (12 << 8)
+# define RADEON_ROP_OR_REVERSE (13 << 8)
+# define RADEON_ROP_OR (14 << 8)
+# define RADEON_ROP_SET (15 << 8)
+#define RADEON_RB3D_STENCILREFMASK 0x1d7c
+# define RADEON_STENCIL_REF_SHIFT 0
+# define RADEON_STENCIL_REF_MASK (0xff << 0)
+# define RADEON_STENCIL_MASK_SHIFT 16
+# define RADEON_STENCIL_VALUE_MASK (0xff << 16)
+# define RADEON_STENCIL_WRITEMASK_SHIFT 24
+# define RADEON_STENCIL_WRITE_MASK (0xff << 24)
+#define RADEON_RB3D_ZPASS_DATA 0x3290
+#define RADEON_RB3D_ZPASS_ADDR 0x3294
+#define RADEON_RB3D_ZSTENCILCNTL 0x1c2c
+# define RADEON_DEPTH_FORMAT_MASK (0xf << 0)
+# define RADEON_DEPTH_FORMAT_16BIT_INT_Z (0 << 0)
+# define RADEON_DEPTH_FORMAT_24BIT_INT_Z (2 << 0)
+# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_Z (3 << 0)
+# define RADEON_DEPTH_FORMAT_32BIT_INT_Z (4 << 0)
+# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_Z (5 << 0)
+# define RADEON_DEPTH_FORMAT_16BIT_FLOAT_W (7 << 0)
+# define RADEON_DEPTH_FORMAT_24BIT_FLOAT_W (9 << 0)
+# define RADEON_DEPTH_FORMAT_32BIT_FLOAT_W (11 << 0)
+# define RADEON_Z_TEST_NEVER (0 << 4)
+# define RADEON_Z_TEST_LESS (1 << 4)
+# define RADEON_Z_TEST_LEQUAL (2 << 4)
+# define RADEON_Z_TEST_EQUAL (3 << 4)
+# define RADEON_Z_TEST_GEQUAL (4 << 4)
+# define RADEON_Z_TEST_GREATER (5 << 4)
+# define RADEON_Z_TEST_NEQUAL (6 << 4)
+# define RADEON_Z_TEST_ALWAYS (7 << 4)
+# define RADEON_Z_TEST_MASK (7 << 4)
+# define RADEON_Z_HIERARCHY_ENABLE (1 << 8)
+# define RADEON_STENCIL_TEST_NEVER (0 << 12)
+# define RADEON_STENCIL_TEST_LESS (1 << 12)
+# define RADEON_STENCIL_TEST_LEQUAL (2 << 12)
+# define RADEON_STENCIL_TEST_EQUAL (3 << 12)
+# define RADEON_STENCIL_TEST_GEQUAL (4 << 12)
+# define RADEON_STENCIL_TEST_GREATER (5 << 12)
+# define RADEON_STENCIL_TEST_NEQUAL (6 << 12)
+# define RADEON_STENCIL_TEST_ALWAYS (7 << 12)
+# define RADEON_STENCIL_TEST_MASK (0x7 << 12)
+# define RADEON_STENCIL_FAIL_KEEP (0 << 16)
+# define RADEON_STENCIL_FAIL_ZERO (1 << 16)
+# define RADEON_STENCIL_FAIL_REPLACE (2 << 16)
+# define RADEON_STENCIL_FAIL_INC (3 << 16)
+# define RADEON_STENCIL_FAIL_DEC (4 << 16)
+# define RADEON_STENCIL_FAIL_INVERT (5 << 16)
+# define RADEON_STENCIL_FAIL_INC_WRAP (6 << 16)
+# define RADEON_STENCIL_FAIL_DEC_WRAP (7 << 16)
+# define RADEON_STENCIL_FAIL_MASK (0x7 << 16)
+# define RADEON_STENCIL_ZPASS_KEEP (0 << 20)
+# define RADEON_STENCIL_ZPASS_ZERO (1 << 20)
+# define RADEON_STENCIL_ZPASS_REPLACE (2 << 20)
+# define RADEON_STENCIL_ZPASS_INC (3 << 20)
+# define RADEON_STENCIL_ZPASS_DEC (4 << 20)
+# define RADEON_STENCIL_ZPASS_INVERT (5 << 20)
+# define RADEON_STENCIL_ZPASS_INC_WRAP (6 << 20)
+# define RADEON_STENCIL_ZPASS_DEC_WRAP (7 << 20)
+# define RADEON_STENCIL_ZPASS_MASK (0x7 << 20)
+# define RADEON_STENCIL_ZFAIL_KEEP (0 << 24)
+# define RADEON_STENCIL_ZFAIL_ZERO (1 << 24)
+# define RADEON_STENCIL_ZFAIL_REPLACE (2 << 24)
+# define RADEON_STENCIL_ZFAIL_INC (3 << 24)
+# define RADEON_STENCIL_ZFAIL_DEC (4 << 24)
+# define RADEON_STENCIL_ZFAIL_INVERT (5 << 24)
+# define RADEON_STENCIL_ZFAIL_INC_WRAP (6 << 24)
+# define RADEON_STENCIL_ZFAIL_DEC_WRAP (7 << 24)
+# define RADEON_STENCIL_ZFAIL_MASK (0x7 << 24)
+# define RADEON_Z_COMPRESSION_ENABLE (1 << 28)
+# define RADEON_FORCE_Z_DIRTY (1 << 29)
+# define RADEON_Z_WRITE_ENABLE (1 << 30)
+# define RADEON_Z_DECOMPRESSION_ENABLE (1 << 31)
+
+#define RADEON_RE_STIPPLE_ADDR 0x1cc8
+#define RADEON_RE_STIPPLE_DATA 0x1ccc
+#define RADEON_RE_LINE_PATTERN 0x1cd0
+# define RADEON_LINE_PATTERN_MASK 0x0000ffff
+# define RADEON_LINE_REPEAT_COUNT_SHIFT 16
+# define RADEON_LINE_PATTERN_START_SHIFT 24
+# define RADEON_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28)
+# define RADEON_LINE_PATTERN_BIG_BIT_ORDER (1 << 28)
+# define RADEON_LINE_PATTERN_AUTO_RESET (1 << 29)
+#define RADEON_RE_LINE_STATE 0x1cd4
+# define RADEON_LINE_CURRENT_PTR_SHIFT 0
+# define RADEON_LINE_CURRENT_COUNT_SHIFT 8
+#define RADEON_RE_MISC 0x26c4
+# define RADEON_STIPPLE_COORD_MASK 0x1f
+# define RADEON_STIPPLE_X_OFFSET_SHIFT 0
+# define RADEON_STIPPLE_X_OFFSET_MASK (0x1f << 0)
+# define RADEON_STIPPLE_Y_OFFSET_SHIFT 8
+# define RADEON_STIPPLE_Y_OFFSET_MASK (0x1f << 8)
+# define RADEON_STIPPLE_LITTLE_BIT_ORDER (0 << 16)
+# define RADEON_STIPPLE_BIG_BIT_ORDER (1 << 16)
+#define RADEON_RE_SOLID_COLOR 0x1c1c
+#define RADEON_RE_TOP_LEFT 0x26c0
+# define RADEON_RE_LEFT_SHIFT 0
+# define RADEON_RE_TOP_SHIFT 16
+#define RADEON_RE_WIDTH_HEIGHT 0x1c44
+# define RADEON_RE_WIDTH_SHIFT 0
+# define RADEON_RE_HEIGHT_SHIFT 16
+
+#define RADEON_SE_CNTL 0x1c4c
+# define RADEON_FFACE_CULL_CW (0 << 0)
+# define RADEON_FFACE_CULL_CCW (1 << 0)
+# define RADEON_FFACE_CULL_DIR_MASK (1 << 0)
+# define RADEON_BFACE_CULL (0 << 1)
+# define RADEON_BFACE_SOLID (3 << 1)
+# define RADEON_FFACE_CULL (0 << 3)
+# define RADEON_FFACE_SOLID (3 << 3)
+# define RADEON_FFACE_CULL_MASK (3 << 3)
+# define RADEON_BADVTX_CULL_DISABLE (1 << 5)
+# define RADEON_FLAT_SHADE_VTX_0 (0 << 6)
+# define RADEON_FLAT_SHADE_VTX_1 (1 << 6)
+# define RADEON_FLAT_SHADE_VTX_2 (2 << 6)
+# define RADEON_FLAT_SHADE_VTX_LAST (3 << 6)
+# define RADEON_DIFFUSE_SHADE_SOLID (0 << 8)
+# define RADEON_DIFFUSE_SHADE_FLAT (1 << 8)
+# define RADEON_DIFFUSE_SHADE_GOURAUD (2 << 8)
+# define RADEON_DIFFUSE_SHADE_MASK (3 << 8)
+# define RADEON_ALPHA_SHADE_SOLID (0 << 10)
+# define RADEON_ALPHA_SHADE_FLAT (1 << 10)
+# define RADEON_ALPHA_SHADE_GOURAUD (2 << 10)
+# define RADEON_ALPHA_SHADE_MASK (3 << 10)
+# define RADEON_SPECULAR_SHADE_SOLID (0 << 12)
+# define RADEON_SPECULAR_SHADE_FLAT (1 << 12)
+# define RADEON_SPECULAR_SHADE_GOURAUD (2 << 12)
+# define RADEON_SPECULAR_SHADE_MASK (3 << 12)
+# define RADEON_FOG_SHADE_SOLID (0 << 14)
+# define RADEON_FOG_SHADE_FLAT (1 << 14)
+# define RADEON_FOG_SHADE_GOURAUD (2 << 14)
+# define RADEON_FOG_SHADE_MASK (3 << 14)
+# define RADEON_ZBIAS_ENABLE_POINT (1 << 16)
+# define RADEON_ZBIAS_ENABLE_LINE (1 << 17)
+# define RADEON_ZBIAS_ENABLE_TRI (1 << 18)
+# define RADEON_WIDELINE_ENABLE (1 << 20)
+# define RADEON_VPORT_XY_XFORM_ENABLE (1 << 24)
+# define RADEON_VPORT_Z_XFORM_ENABLE (1 << 25)
+# define RADEON_VTX_PIX_CENTER_D3D (0 << 27)
+# define RADEON_VTX_PIX_CENTER_OGL (1 << 27)
+# define RADEON_ROUND_MODE_TRUNC (0 << 28)
+# define RADEON_ROUND_MODE_ROUND (1 << 28)
+# define RADEON_ROUND_MODE_ROUND_EVEN (2 << 28)
+# define RADEON_ROUND_MODE_ROUND_ODD (3 << 28)
+# define RADEON_ROUND_PREC_16TH_PIX (0 << 30)
+# define RADEON_ROUND_PREC_8TH_PIX (1 << 30)
+# define RADEON_ROUND_PREC_4TH_PIX (2 << 30)
+# define RADEON_ROUND_PREC_HALF_PIX (3 << 30)
+#define RADEON_SE_CNTL_STATUS 0x2140
+# define RADEON_VC_NO_SWAP (0 << 0)
+# define RADEON_VC_16BIT_SWAP (1 << 0)
+# define RADEON_VC_32BIT_SWAP (2 << 0)
+# define RADEON_VC_HALF_DWORD_SWAP (3 << 0)
+# define RADEON_TCL_BYPASS (1 << 8)
+#define RADEON_SE_COORD_FMT 0x1c50
+# define RADEON_VTX_XY_PRE_MULT_1_OVER_W0 (1 << 0)
+# define RADEON_VTX_Z_PRE_MULT_1_OVER_W0 (1 << 1)
+# define RADEON_VTX_ST0_NONPARAMETRIC (1 << 8)
+# define RADEON_VTX_ST1_NONPARAMETRIC (1 << 9)
+# define RADEON_VTX_ST2_NONPARAMETRIC (1 << 10)
+# define RADEON_VTX_ST3_NONPARAMETRIC (1 << 11)
+# define RADEON_VTX_W0_NORMALIZE (1 << 12)
+# define RADEON_VTX_W0_IS_NOT_1_OVER_W0 (1 << 16)
+# define RADEON_VTX_ST0_PRE_MULT_1_OVER_W0 (1 << 17)
+# define RADEON_VTX_ST1_PRE_MULT_1_OVER_W0 (1 << 19)
+# define RADEON_VTX_ST2_PRE_MULT_1_OVER_W0 (1 << 21)
+# define RADEON_VTX_ST3_PRE_MULT_1_OVER_W0 (1 << 23)
+# define RADEON_TEX1_W_ROUTING_USE_W0 (0 << 26)
+# define RADEON_TEX1_W_ROUTING_USE_Q1 (1 << 26)
+#define RADEON_SE_LINE_WIDTH 0x1db8
+#define RADEON_SE_TCL_LIGHT_MODEL_CTL 0x226c
+# define RADEON_LIGHTING_ENABLE (1 << 0)
+# define RADEON_LIGHT_IN_MODELSPACE (1 << 1)
+# define RADEON_LOCAL_VIEWER (1 << 2)
+# define RADEON_NORMALIZE_NORMALS (1 << 3)
+# define RADEON_RESCALE_NORMALS (1 << 4)
+# define RADEON_SPECULAR_LIGHTS (1 << 5)
+# define RADEON_DIFFUSE_SPECULAR_COMBINE (1 << 6)
+# define RADEON_LIGHT_ALPHA (1 << 7)
+# define RADEON_LOCAL_LIGHT_VEC_GL (1 << 8)
+# define RADEON_LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9)
+# define RADEON_LM_SOURCE_STATE_PREMULT 0
+# define RADEON_LM_SOURCE_STATE_MULT 1
+# define RADEON_LM_SOURCE_VERTEX_DIFFUSE 2
+# define RADEON_LM_SOURCE_VERTEX_SPECULAR 3
+# define RADEON_EMISSIVE_SOURCE_SHIFT 16
+# define RADEON_AMBIENT_SOURCE_SHIFT 18
+# define RADEON_DIFFUSE_SOURCE_SHIFT 20
+# define RADEON_SPECULAR_SOURCE_SHIFT 22
+#define RADEON_SE_TCL_MATERIAL_AMBIENT_RED 0x2220
+#define RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN 0x2224
+#define RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE 0x2228
+#define RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA 0x222c
+#define RADEON_SE_TCL_MATERIAL_DIFFUSE_RED 0x2230
+#define RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN 0x2234
+#define RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE 0x2238
+#define RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA 0x223c
+#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED 0x2210
+#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN 0x2214
+#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE 0x2218
+#define RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA 0x221c
+#define RADEON_SE_TCL_MATERIAL_SPECULAR_RED 0x2240
+#define RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN 0x2244
+#define RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE 0x2248
+#define RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA 0x224c
+#define RADEON_SE_TCL_MATRIX_SELECT_0 0x225c
+# define RADEON_MODELVIEW_0_SHIFT 0
+# define RADEON_MODELVIEW_1_SHIFT 4
+# define RADEON_MODELVIEW_2_SHIFT 8
+# define RADEON_MODELVIEW_3_SHIFT 12
+# define RADEON_IT_MODELVIEW_0_SHIFT 16
+# define RADEON_IT_MODELVIEW_1_SHIFT 20
+# define RADEON_IT_MODELVIEW_2_SHIFT 24
+# define RADEON_IT_MODELVIEW_3_SHIFT 28
+#define RADEON_SE_TCL_MATRIX_SELECT_1 0x2260
+# define RADEON_MODELPROJECT_0_SHIFT 0
+# define RADEON_MODELPROJECT_1_SHIFT 4
+# define RADEON_MODELPROJECT_2_SHIFT 8
+# define RADEON_MODELPROJECT_3_SHIFT 12
+# define RADEON_TEXMAT_0_SHIFT 16
+# define RADEON_TEXMAT_1_SHIFT 20
+# define RADEON_TEXMAT_2_SHIFT 24
+# define RADEON_TEXMAT_3_SHIFT 28
+
+
+#define RADEON_SE_TCL_OUTPUT_VTX_FMT 0x2254
+# define RADEON_TCL_VTX_W0 (1 << 0)
+# define RADEON_TCL_VTX_FP_DIFFUSE (1 << 1)
+# define RADEON_TCL_VTX_FP_ALPHA (1 << 2)
+# define RADEON_TCL_VTX_PK_DIFFUSE (1 << 3)
+# define RADEON_TCL_VTX_FP_SPEC (1 << 4)
+# define RADEON_TCL_VTX_FP_FOG (1 << 5)
+# define RADEON_TCL_VTX_PK_SPEC (1 << 6)
+# define RADEON_TCL_VTX_ST0 (1 << 7)
+# define RADEON_TCL_VTX_ST1 (1 << 8)
+# define RADEON_TCL_VTX_Q1 (1 << 9)
+# define RADEON_TCL_VTX_ST2 (1 << 10)
+# define RADEON_TCL_VTX_Q2 (1 << 11)
+# define RADEON_TCL_VTX_ST3 (1 << 12)
+# define RADEON_TCL_VTX_Q3 (1 << 13)
+# define RADEON_TCL_VTX_Q0 (1 << 14)
+# define RADEON_TCL_VTX_WEIGHT_COUNT_SHIFT 15
+# define RADEON_TCL_VTX_NORM0 (1 << 18)
+# define RADEON_TCL_VTX_XY1 (1 << 27)
+# define RADEON_TCL_VTX_Z1 (1 << 28)
+# define RADEON_TCL_VTX_W1 (1 << 29)
+# define RADEON_TCL_VTX_NORM1 (1 << 30)
+# define RADEON_TCL_VTX_Z0 (1 << 31)
+
+#define RADEON_SE_TCL_OUTPUT_VTX_SEL 0x2258
+# define RADEON_TCL_COMPUTE_XYZW (1 << 0)
+# define RADEON_TCL_COMPUTE_DIFFUSE (1 << 1)
+# define RADEON_TCL_COMPUTE_SPECULAR (1 << 2)
+# define RADEON_TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3)
+# define RADEON_TCL_FORCE_INORDER_PROC (1 << 4)
+# define RADEON_TCL_TEX_INPUT_TEX_0 0
+# define RADEON_TCL_TEX_INPUT_TEX_1 1
+# define RADEON_TCL_TEX_INPUT_TEX_2 2
+# define RADEON_TCL_TEX_INPUT_TEX_3 3
+# define RADEON_TCL_TEX_COMPUTED_TEX_0 8
+# define RADEON_TCL_TEX_COMPUTED_TEX_1 9
+# define RADEON_TCL_TEX_COMPUTED_TEX_2 10
+# define RADEON_TCL_TEX_COMPUTED_TEX_3 11
+# define RADEON_TCL_TEX_0_OUTPUT_SHIFT 16
+# define RADEON_TCL_TEX_1_OUTPUT_SHIFT 20
+# define RADEON_TCL_TEX_2_OUTPUT_SHIFT 24
+# define RADEON_TCL_TEX_3_OUTPUT_SHIFT 28
+
+#define RADEON_SE_TCL_PER_LIGHT_CTL_0 0x2270
+# define RADEON_LIGHT_0_ENABLE (1 << 0)
+# define RADEON_LIGHT_0_ENABLE_AMBIENT (1 << 1)
+# define RADEON_LIGHT_0_ENABLE_SPECULAR (1 << 2)
+# define RADEON_LIGHT_0_IS_LOCAL (1 << 3)
+# define RADEON_LIGHT_0_IS_SPOT (1 << 4)
+# define RADEON_LIGHT_0_DUAL_CONE (1 << 5)
+# define RADEON_LIGHT_0_ENABLE_RANGE_ATTEN (1 << 6)
+# define RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN (1 << 7)
+# define RADEON_LIGHT_0_SHIFT 0
+# define RADEON_LIGHT_1_ENABLE (1 << 16)
+# define RADEON_LIGHT_1_ENABLE_AMBIENT (1 << 17)
+# define RADEON_LIGHT_1_ENABLE_SPECULAR (1 << 18)
+# define RADEON_LIGHT_1_IS_LOCAL (1 << 19)
+# define RADEON_LIGHT_1_IS_SPOT (1 << 20)
+# define RADEON_LIGHT_1_DUAL_CONE (1 << 21)
+# define RADEON_LIGHT_1_ENABLE_RANGE_ATTEN (1 << 22)
+# define RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23)
+# define RADEON_LIGHT_1_SHIFT 16
+#define RADEON_SE_TCL_PER_LIGHT_CTL_1 0x2274
+# define RADEON_LIGHT_2_SHIFT 0
+# define RADEON_LIGHT_3_SHIFT 16
+#define RADEON_SE_TCL_PER_LIGHT_CTL_2 0x2278
+# define RADEON_LIGHT_4_SHIFT 0
+# define RADEON_LIGHT_5_SHIFT 16
+#define RADEON_SE_TCL_PER_LIGHT_CTL_3 0x227c
+# define RADEON_LIGHT_6_SHIFT 0
+# define RADEON_LIGHT_7_SHIFT 16
+
+#define RADEON_SE_TCL_STATE_FLUSH 0x2284
+
+#define RADEON_SE_TCL_SHININESS 0x2250
+
+#define RADEON_SE_TCL_TEXTURE_PROC_CTL 0x2268
+# define RADEON_TEXGEN_TEXMAT_0_ENABLE (1 << 0)
+# define RADEON_TEXGEN_TEXMAT_1_ENABLE (1 << 1)
+# define RADEON_TEXGEN_TEXMAT_2_ENABLE (1 << 2)
+# define RADEON_TEXGEN_TEXMAT_3_ENABLE (1 << 3)
+# define RADEON_TEXMAT_0_ENABLE (1 << 4)
+# define RADEON_TEXMAT_1_ENABLE (1 << 5)
+# define RADEON_TEXMAT_2_ENABLE (1 << 6)
+# define RADEON_TEXMAT_3_ENABLE (1 << 7)
+# define RADEON_TEXGEN_INPUT_MASK 0xf
+# define RADEON_TEXGEN_INPUT_TEXCOORD_0 0
+# define RADEON_TEXGEN_INPUT_TEXCOORD_1 1
+# define RADEON_TEXGEN_INPUT_TEXCOORD_2 2
+# define RADEON_TEXGEN_INPUT_TEXCOORD_3 3
+# define RADEON_TEXGEN_INPUT_OBJ 4
+# define RADEON_TEXGEN_INPUT_EYE 5
+# define RADEON_TEXGEN_INPUT_EYE_NORMAL 6
+# define RADEON_TEXGEN_INPUT_EYE_REFLECT 7
+# define RADEON_TEXGEN_INPUT_EYE_NORMALIZED 8
+# define RADEON_TEXGEN_0_INPUT_SHIFT 16
+# define RADEON_TEXGEN_1_INPUT_SHIFT 20
+# define RADEON_TEXGEN_2_INPUT_SHIFT 24
+# define RADEON_TEXGEN_3_INPUT_SHIFT 28
+
+#define RADEON_SE_TCL_UCP_VERT_BLEND_CTL 0x2264
+# define RADEON_UCP_IN_CLIP_SPACE (1 << 0)
+# define RADEON_UCP_IN_MODEL_SPACE (1 << 1)
+# define RADEON_UCP_ENABLE_0 (1 << 2)
+# define RADEON_UCP_ENABLE_1 (1 << 3)
+# define RADEON_UCP_ENABLE_2 (1 << 4)
+# define RADEON_UCP_ENABLE_3 (1 << 5)
+# define RADEON_UCP_ENABLE_4 (1 << 6)
+# define RADEON_UCP_ENABLE_5 (1 << 7)
+# define RADEON_TCL_FOG_MASK (3 << 8)
+# define RADEON_TCL_FOG_DISABLE (0 << 8)
+# define RADEON_TCL_FOG_EXP (1 << 8)
+# define RADEON_TCL_FOG_EXP2 (2 << 8)
+# define RADEON_TCL_FOG_LINEAR (3 << 8)
+# define RADEON_RNG_BASED_FOG (1 << 10)
+# define RADEON_LIGHT_TWOSIDE (1 << 11)
+# define RADEON_BLEND_OP_COUNT_MASK (7 << 12)
+# define RADEON_BLEND_OP_COUNT_SHIFT 12
+# define RADEON_POSITION_BLEND_OP_ENABLE (1 << 16)
+# define RADEON_NORMAL_BLEND_OP_ENABLE (1 << 17)
+# define RADEON_VERTEX_BLEND_SRC_0_PRIMARY (0 << 18)
+# define RADEON_VERTEX_BLEND_SRC_0_SECONDARY (1 << 18)
+# define RADEON_VERTEX_BLEND_SRC_1_PRIMARY (0 << 19)
+# define RADEON_VERTEX_BLEND_SRC_1_SECONDARY (1 << 19)
+# define RADEON_VERTEX_BLEND_SRC_2_PRIMARY (0 << 20)
+# define RADEON_VERTEX_BLEND_SRC_2_SECONDARY (1 << 20)
+# define RADEON_VERTEX_BLEND_SRC_3_PRIMARY (0 << 21)
+# define RADEON_VERTEX_BLEND_SRC_3_SECONDARY (1 << 21)
+# define RADEON_VERTEX_BLEND_WGT_MINUS_ONE (1 << 22)
+# define RADEON_CULL_FRONT_IS_CW (0 << 28)
+# define RADEON_CULL_FRONT_IS_CCW (1 << 28)
+# define RADEON_CULL_FRONT (1 << 29)
+# define RADEON_CULL_BACK (1 << 30)
+# define RADEON_FORCE_W_TO_ONE (1 << 31)
+
+#define RADEON_SE_VPORT_XSCALE 0x1d98
+#define RADEON_SE_VPORT_XOFFSET 0x1d9c
+#define RADEON_SE_VPORT_YSCALE 0x1da0
+#define RADEON_SE_VPORT_YOFFSET 0x1da4
+#define RADEON_SE_VPORT_ZSCALE 0x1da8
+#define RADEON_SE_VPORT_ZOFFSET 0x1dac
+#define RADEON_SE_ZBIAS_FACTOR 0x1db0
+#define RADEON_SE_ZBIAS_CONSTANT 0x1db4
+
+#define RADEON_SE_VTX_FMT 0x2080
+# define RADEON_SE_VTX_FMT_XY 0x00000000
+# define RADEON_SE_VTX_FMT_W0 0x00000001
+# define RADEON_SE_VTX_FMT_FPCOLOR 0x00000002
+# define RADEON_SE_VTX_FMT_FPALPHA 0x00000004
+# define RADEON_SE_VTX_FMT_PKCOLOR 0x00000008
+# define RADEON_SE_VTX_FMT_FPSPEC 0x00000010
+# define RADEON_SE_VTX_FMT_FPFOG 0x00000020
+# define RADEON_SE_VTX_FMT_PKSPEC 0x00000040
+# define RADEON_SE_VTX_FMT_ST0 0x00000080
+# define RADEON_SE_VTX_FMT_ST1 0x00000100
+# define RADEON_SE_VTX_FMT_Q1 0x00000200
+# define RADEON_SE_VTX_FMT_ST2 0x00000400
+# define RADEON_SE_VTX_FMT_Q2 0x00000800
+# define RADEON_SE_VTX_FMT_ST3 0x00001000
+# define RADEON_SE_VTX_FMT_Q3 0x00002000
+# define RADEON_SE_VTX_FMT_Q0 0x00004000
+# define RADEON_SE_VTX_FMT_BLND_WEIGHT_CNT_MASK 0x00038000
+# define RADEON_SE_VTX_FMT_N0 0x00040000
+# define RADEON_SE_VTX_FMT_XY1 0x08000000
+# define RADEON_SE_VTX_FMT_Z1 0x10000000
+# define RADEON_SE_VTX_FMT_W1 0x20000000
+# define RADEON_SE_VTX_FMT_N1 0x40000000
+# define RADEON_SE_VTX_FMT_Z 0x80000000
+
+ /* Registers for CP and Microcode Engine */
+#define RADEON_CP_ME_RAM_ADDR 0x07d4
+#define RADEON_CP_ME_RAM_RADDR 0x07d8
+#define RADEON_CP_ME_RAM_DATAH 0x07dc
+#define RADEON_CP_ME_RAM_DATAL 0x07e0
+
+#define RADEON_CP_RB_BASE 0x0700
+#define RADEON_CP_RB_CNTL 0x0704
+#define RADEON_CP_RB_RPTR_ADDR 0x070c
+#define RADEON_CP_RB_RPTR 0x0710
+#define RADEON_CP_RB_WPTR 0x0714
+
+#define RADEON_CP_IB_BASE 0x0738
+#define RADEON_CP_IB_BUFSZ 0x073c
+
+#define RADEON_CP_CSQ_CNTL 0x0740
+# define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0)
+# define RADEON_CSQ_PRIDIS_INDDIS (0 << 28)
+# define RADEON_CSQ_PRIPIO_INDDIS (1 << 28)
+# define RADEON_CSQ_PRIBM_INDDIS (2 << 28)
+# define RADEON_CSQ_PRIPIO_INDBM (3 << 28)
+# define RADEON_CSQ_PRIBM_INDBM (4 << 28)
+# define RADEON_CSQ_PRIPIO_INDPIO (15 << 28)
+#define RADEON_CP_CSQ_STAT 0x07f8
+# define RADEON_CSQ_RPTR_PRIMARY_MASK (0xff << 0)
+# define RADEON_CSQ_WPTR_PRIMARY_MASK (0xff << 8)
+# define RADEON_CSQ_RPTR_INDIRECT_MASK (0xff << 16)
+# define RADEON_CSQ_WPTR_INDIRECT_MASK (0xff << 24)
+#define RADEON_CP_CSQ_ADDR 0x07f0
+#define RADEON_CP_CSQ_DATA 0x07f4
+#define RADEON_CP_CSQ_APER_PRIMARY 0x1000
+#define RADEON_CP_CSQ_APER_INDIRECT 0x1300
+
+#define RADEON_CP_RB_WPTR_DELAY 0x0718
+# define RADEON_PRE_WRITE_TIMER_SHIFT 0
+# define RADEON_PRE_WRITE_LIMIT_SHIFT 23
+
+#define RADEON_AIC_CNTL 0x01d0
+# define RADEON_PCIGART_TRANSLATE_EN (1 << 0)
+#define RADEON_AIC_LO_ADDR 0x01dc
+
+
+
+ /* Constants */
+#define RADEON_LAST_FRAME_REG RADEON_GUI_SCRATCH_REG0
+#define RADEON_LAST_CLEAR_REG RADEON_GUI_SCRATCH_REG2
+
+
+
+ /* CP packet types */
+#define RADEON_CP_PACKET0 0x00000000
+#define RADEON_CP_PACKET1 0x40000000
+#define RADEON_CP_PACKET2 0x80000000
+#define RADEON_CP_PACKET3 0xC0000000
+# define RADEON_CP_PACKET_MASK 0xC0000000
+# define RADEON_CP_PACKET_COUNT_MASK 0x3fff0000
+# define RADEON_CP_PACKET_MAX_DWORDS (1 << 12)
+# define RADEON_CP_PACKET0_REG_MASK 0x000007ff
+# define RADEON_CP_PACKET1_REG0_MASK 0x000007ff
+# define RADEON_CP_PACKET1_REG1_MASK 0x003ff800
+
+#define RADEON_CP_PACKET0_ONE_REG_WR 0x00008000
+
+#define RADEON_CP_PACKET3_NOP 0xC0001000
+#define RADEON_CP_PACKET3_NEXT_CHAR 0xC0001900
+#define RADEON_CP_PACKET3_PLY_NEXTSCAN 0xC0001D00
+#define RADEON_CP_PACKET3_SET_SCISSORS 0xC0001E00
+#define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM 0xC0002300
+#define RADEON_CP_PACKET3_LOAD_MICROCODE 0xC0002400
+#define RADEON_CP_PACKET3_WAIT_FOR_IDLE 0xC0002600
+#define RADEON_CP_PACKET3_3D_DRAW_VBUF 0xC0002800
+#define RADEON_CP_PACKET3_3D_DRAW_IMMD 0xC0002900
+#define RADEON_CP_PACKET3_3D_DRAW_INDX 0xC0002A00
+#define RADEON_CP_PACKET3_LOAD_PALETTE 0xC0002C00
+#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00
+#define R200_CP_CMD_3D_DRAW_VBUF_2 0xC0003400
+#define R200_CP_CMD_3D_DRAW_IMMD_2 0xC0003500
+#define R200_CP_CMD_3D_DRAW_INDX_2 0xC0003600
+#define RADEON_CP_PACKET3_CNTL_PAINT 0xC0009100
+#define RADEON_CP_PACKET3_CNTL_BITBLT 0xC0009200
+#define RADEON_CP_PACKET3_CNTL_SMALLTEXT 0xC0009300
+#define RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT 0xC0009400
+#define RADEON_CP_PACKET3_CNTL_POLYLINE 0xC0009500
+#define RADEON_CP_PACKET3_CNTL_POLYSCANLINES 0xC0009800
+#define RADEON_CP_PACKET3_CNTL_PAINT_MULTI 0xC0009A00
+#define RADEON_CP_PACKET3_CNTL_BITBLT_MULTI 0xC0009B00
+#define RADEON_CP_PACKET3_CNTL_TRANS_BITBLT 0xC0009C00
+
+
+#define RADEON_CP_VC_FRMT_XY 0x00000000
+#define RADEON_CP_VC_FRMT_W0 0x00000001
+#define RADEON_CP_VC_FRMT_FPCOLOR 0x00000002
+#define RADEON_CP_VC_FRMT_FPALPHA 0x00000004
+#define RADEON_CP_VC_FRMT_PKCOLOR 0x00000008
+#define RADEON_CP_VC_FRMT_FPSPEC 0x00000010
+#define RADEON_CP_VC_FRMT_FPFOG 0x00000020
+#define RADEON_CP_VC_FRMT_PKSPEC 0x00000040
+#define RADEON_CP_VC_FRMT_ST0 0x00000080
+#define RADEON_CP_VC_FRMT_ST1 0x00000100
+#define RADEON_CP_VC_FRMT_Q1 0x00000200
+#define RADEON_CP_VC_FRMT_ST2 0x00000400
+#define RADEON_CP_VC_FRMT_Q2 0x00000800
+#define RADEON_CP_VC_FRMT_ST3 0x00001000
+#define RADEON_CP_VC_FRMT_Q3 0x00002000
+#define RADEON_CP_VC_FRMT_Q0 0x00004000
+#define RADEON_CP_VC_FRMT_BLND_WEIGHT_CNT_MASK 0x00038000
+#define RADEON_CP_VC_FRMT_N0 0x00040000
+#define RADEON_CP_VC_FRMT_XY1 0x08000000
+#define RADEON_CP_VC_FRMT_Z1 0x10000000
+#define RADEON_CP_VC_FRMT_W1 0x20000000
+#define RADEON_CP_VC_FRMT_N1 0x40000000
+#define RADEON_CP_VC_FRMT_Z 0x80000000
+
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_NONE 0x00000000
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_POINT 0x00000001
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE 0x00000002
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP 0x00000003
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST 0x00000004
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN 0x00000005
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP 0x00000006
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_TYPE_2 0x00000007
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST 0x00000008
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST 0x00000009
+#define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST 0x0000000a
+#define RADEON_CP_VC_CNTL_PRIM_WALK_IND 0x00000010
+#define RADEON_CP_VC_CNTL_PRIM_WALK_LIST 0x00000020
+#define RADEON_CP_VC_CNTL_PRIM_WALK_RING 0x00000030
+#define RADEON_CP_VC_CNTL_COLOR_ORDER_BGRA 0x00000000
+#define RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA 0x00000040
+#define RADEON_CP_VC_CNTL_MAOS_ENABLE 0x00000080
+#define RADEON_CP_VC_CNTL_VTX_FMT_NON_RADEON_MODE 0x00000000
+#define RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE 0x00000100
+#define RADEON_CP_VC_CNTL_TCL_DISABLE 0x00000000
+#define RADEON_CP_VC_CNTL_TCL_ENABLE 0x00000200
+#define RADEON_CP_VC_CNTL_NUM_SHIFT 16
+
+#define RADEON_VS_MATRIX_0_ADDR 0
+#define RADEON_VS_MATRIX_1_ADDR 4
+#define RADEON_VS_MATRIX_2_ADDR 8
+#define RADEON_VS_MATRIX_3_ADDR 12
+#define RADEON_VS_MATRIX_4_ADDR 16
+#define RADEON_VS_MATRIX_5_ADDR 20
+#define RADEON_VS_MATRIX_6_ADDR 24
+#define RADEON_VS_MATRIX_7_ADDR 28
+#define RADEON_VS_MATRIX_8_ADDR 32
+#define RADEON_VS_MATRIX_9_ADDR 36
+#define RADEON_VS_MATRIX_10_ADDR 40
+#define RADEON_VS_MATRIX_11_ADDR 44
+#define RADEON_VS_MATRIX_12_ADDR 48
+#define RADEON_VS_MATRIX_13_ADDR 52
+#define RADEON_VS_MATRIX_14_ADDR 56
+#define RADEON_VS_MATRIX_15_ADDR 60
+#define RADEON_VS_LIGHT_AMBIENT_ADDR 64
+#define RADEON_VS_LIGHT_DIFFUSE_ADDR 72
+#define RADEON_VS_LIGHT_SPECULAR_ADDR 80
+#define RADEON_VS_LIGHT_DIRPOS_ADDR 88
+#define RADEON_VS_LIGHT_HWVSPOT_ADDR 96
+#define RADEON_VS_LIGHT_ATTENUATION_ADDR 104
+#define RADEON_VS_MATRIX_EYE2CLIP_ADDR 112
+#define RADEON_VS_UCP_ADDR 116
+#define RADEON_VS_GLOBAL_AMBIENT_ADDR 122
+#define RADEON_VS_FOG_PARAM_ADDR 123
+#define RADEON_VS_EYE_VECTOR_ADDR 124
+
+#define RADEON_SS_LIGHT_DCD_ADDR 0
+#define RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR 8
+#define RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR 16
+#define RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR 24
+#define RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR 32
+#define RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR 48
+#define RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR 49
+#define RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR 50
+#define RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR 51
+#define RADEON_SS_SHININESS 60
+
+#define RADEON_TV_MASTER_CNTL 0x0800
+# define RADEON_TVCLK_ALWAYS_ONb (1 << 30)
+#define RADEON_TV_DAC_CNTL 0x088c
+# define RADEON_TV_DAC_CMPOUT (1 << 5)
+#define RADEON_TV_PRE_DAC_MUX_CNTL 0x0888
+# define RADEON_Y_RED_EN (1 << 0)
+# define RADEON_C_GRN_EN (1 << 1)
+# define RADEON_CMP_BLU_EN (1 << 2)
+# define RADEON_RED_MX_FORCE_DAC_DATA (6 << 4)
+# define RADEON_GRN_MX_FORCE_DAC_DATA (6 << 8)
+# define RADEON_BLU_MX_FORCE_DAC_DATA (6 << 12)
+# define RADEON_TV_FORCE_DAC_DATA_SHIFT 16
+#endif
diff --git a/chromium/third_party/minigbm/src/Makefile b/chromium/third_party/minigbm/src/Makefile
index 17584444c41..de4fed18f3f 100644
--- a/chromium/third_party/minigbm/src/Makefile
+++ b/chromium/third_party/minigbm/src/Makefile
@@ -8,9 +8,9 @@ PC_DEPS = libdrm
PC_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PC_DEPS))
PC_LIBS := $(shell $(PKG_CONFIG) --libs $(PC_DEPS))
-CPPFLAGS += -D_GNU_SOURCE=1
-CFLAGS += -std=c99 -Wall -Wsign-compare -Wpointer-arith -Wcast-qual \
- -Wcast-align -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
+CPPFLAGS += -std=c99 -D_GNU_SOURCE=1
+CFLAGS += -Wall -Wsign-compare -Wpointer-arith -Wcast-qual -Wcast-align \
+ -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64
ifdef DRV_AMDGPU
CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_amdgpu)
@@ -21,7 +21,6 @@ ifdef DRV_EXYNOS
endif
ifdef DRV_I915
CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_intel)
- LDLIBS += $(shell $(PKG_CONFIG) --libs libdrm_intel)
endif
ifdef DRV_ROCKCHIP
CFLAGS += $(shell $(PKG_CONFIG) --cflags libdrm_rockchip)
diff --git a/chromium/third_party/minigbm/src/amdgpu.c b/chromium/third_party/minigbm/src/amdgpu.c
index 5dcfbeb0f9b..38ea8d685d8 100644
--- a/chromium/third_party/minigbm/src/amdgpu.c
+++ b/chromium/third_party/minigbm/src/amdgpu.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -8,7 +8,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/mman.h>
#include <xf86drm.h>
#include <amdgpu_drm.h>
#include <amdgpu.h>
@@ -40,16 +39,11 @@ enum {
};
static struct supported_combination combos[5] = {
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XBGR8888, DRM_FORMAT_MOD_NONE,
- BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_XBGR8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_LINEAR},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
};
static int amdgpu_set_metadata(int fd, uint32_t handle,
@@ -315,7 +309,6 @@ static int amdgpu_bo_create(struct bo *bo, uint32_t width, uint32_t height,
struct amdgpu_bo_metadata metadata = {0};
ADDR_COMPUTE_SURFACE_INFO_OUTPUT addr_out = {0};
uint32_t tiling_flags = 0;
- uint32_t gem_create_flags = 0;
int ret;
if (amdgpu_addrlib_compute(addrlib, width,
@@ -329,19 +322,13 @@ static int amdgpu_bo_create(struct bo *bo, uint32_t width, uint32_t height,
bo->sizes[0] = addr_out.surfSize;
bo->strides[0] = addr_out.pixelPitch
* DIV_ROUND_UP(addr_out.pixelBits, 8);
- if (usage & (BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_WRITE_RARELY |
- BO_USE_SW_READ_RARELY))
- gem_create_flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
- else
- gem_create_flags |= AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
memset(&gem_create, 0, sizeof(gem_create));
gem_create.in.bo_size = bo->sizes[0];
gem_create.in.alignment = addr_out.baseAlign;
/* Set the placement. */
gem_create.in.domains = AMDGPU_GEM_DOMAIN_VRAM;
- gem_create.in.domain_flags = gem_create_flags;
+ gem_create.in.domain_flags = usage;
/* Allocate the buffer with the preferred heap. */
ret = drmCommandWriteRead(drv_get_fd(bo->drv), DRM_AMDGPU_GEM_CREATE,
@@ -360,33 +347,12 @@ static int amdgpu_bo_create(struct bo *bo, uint32_t width, uint32_t height,
return ret;
}
-static void *amdgpu_bo_map(struct bo *bo, struct map_info *data, size_t plane)
-{
- int ret;
- union drm_amdgpu_gem_mmap gem_map;
-
- memset(&gem_map, 0, sizeof(gem_map));
- gem_map.in.handle = bo->handles[0].u32;
-
- ret = drmIoctl(bo->drv->fd, DRM_IOCTL_AMDGPU_GEM_MMAP, &gem_map);
- if (ret) {
- fprintf(stderr, "drv: DRM_IOCTL_AMDGPU_GEM_MMAP failed\n");
- return MAP_FAILED;
- }
- data->length = bo->sizes[0];
-
- return mmap(0, bo->sizes[0], PROT_READ | PROT_WRITE, MAP_SHARED,
- bo->drv->fd, gem_map.out.addr_ptr);
-}
-
struct backend backend_amdgpu = {
.name = "amdgpu",
.init = amdgpu_init,
.close = amdgpu_close,
.bo_create = amdgpu_bo_create,
.bo_destroy = drv_gem_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = amdgpu_bo_map,
};
#endif
diff --git a/chromium/third_party/minigbm/src/cirrus.c b/chromium/third_party/minigbm/src/cirrus.c
index f614e8ad08c..91466c96c4d 100644
--- a/chromium/third_party/minigbm/src/cirrus.c
+++ b/chromium/third_party/minigbm/src/cirrus.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -8,16 +8,12 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[3] = {
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_RGB888, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
- BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+static struct supported_combination combos[5] = {
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_RGB888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
};
static int cirrus_init(struct driver *drv)
@@ -32,6 +28,5 @@ struct backend backend_cirrus =
.init = cirrus_init,
.bo_create = drv_dumb_bo_create,
.bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = drv_dumb_bo_map,
};
diff --git a/chromium/third_party/minigbm/src/common.mk b/chromium/third_party/minigbm/src/common.mk
index 3d7e7d4674c..21de50c937e 100644
--- a/chromium/third_party/minigbm/src/common.mk
+++ b/chromium/third_party/minigbm/src/common.mk
@@ -1,4 +1,4 @@
-# Copyright 2012 The Chromium OS Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
diff --git a/chromium/third_party/minigbm/src/cros_gralloc/cros_alloc_device.cc b/chromium/third_party/minigbm/src/cros_gralloc/cros_alloc_device.cc
index 97c8186f8c6..540574418a0 100644
--- a/chromium/third_party/minigbm/src/cros_gralloc/cros_alloc_device.cc
+++ b/chromium/third_party/minigbm/src/cros_gralloc/cros_alloc_device.cc
@@ -29,14 +29,6 @@ static struct cros_gralloc_bo *cros_gralloc_bo_create(struct driver *drv,
DRM_FORMAT_MOD_NONE);
}
- if (!supported && (drv_usage & BO_USE_RENDERING) &&
- (drv_usage && (BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN))) {
- drv_usage &= ~BO_USE_RENDERING;
- supported = drv_is_combination_supported(drv, drv_format,
- drv_usage,
- DRM_FORMAT_MOD_NONE);
- }
-
if (!supported) {
cros_gralloc_error("Unsupported combination -- HAL format: %u, "
"HAL flags: %u, drv_format: %u, "
diff --git a/chromium/third_party/minigbm/src/drv.c b/chromium/third_party/minigbm/src/drv.c
index fb79e127e4f..3a9ab4caae6 100644
--- a/chromium/third_party/minigbm/src/drv.c
+++ b/chromium/third_party/minigbm/src/drv.c
@@ -1,10 +1,9 @@
/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include <assert.h>
-#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdint.h>
@@ -36,7 +35,6 @@ extern struct backend backend_marvell;
#ifdef DRV_MEDIATEK
extern struct backend backend_mediatek;
#endif
-extern struct backend backend_nouveau;
#ifdef DRV_ROCKCHIP
extern struct backend backend_rockchip;
#endif
@@ -44,9 +42,6 @@ extern struct backend backend_rockchip;
extern struct backend backend_tegra;
#endif
extern struct backend backend_udl;
-#ifdef DRV_VC4
-extern struct backend backend_vc4;
-#endif
extern struct backend backend_vgem;
extern struct backend backend_virtio_gpu;
@@ -79,7 +74,6 @@ static struct backend *drv_get_backend(int fd)
#ifdef DRV_MEDIATEK
&backend_mediatek,
#endif
- &backend_nouveau,
#ifdef DRV_ROCKCHIP
&backend_rockchip,
#endif
@@ -87,9 +81,6 @@ static struct backend *drv_get_backend(int fd)
&backend_tegra,
#endif
&backend_udl,
-#ifdef DRV_VC4
- &backend_vc4,
-#endif
&backend_vgem,
&backend_virtio_gpu,
};
@@ -256,44 +247,6 @@ struct bo *drv_bo_create(struct driver *drv, uint32_t width, uint32_t height,
return bo;
}
-struct bo *drv_bo_create_with_modifiers(struct driver *drv,
- uint32_t width, uint32_t height,
- uint32_t format,
- const uint64_t *modifiers, uint32_t count)
-{
- int ret;
- size_t plane;
- struct bo *bo;
-
- if (!drv->backend->bo_create_with_modifiers) {
- errno = ENOENT;
- return NULL;
- }
-
- bo = drv_bo_new(drv, width, height, format);
-
- if (!bo)
- return NULL;
-
- ret = drv->backend->bo_create_with_modifiers(bo, width, height,
- format, modifiers, count);
-
- if (ret) {
- free(bo);
- return NULL;
- }
-
- pthread_mutex_lock(&drv->driver_lock);
-
- for (plane = 0; plane < bo->num_planes; plane++)
- drv_increment_reference_count(drv, bo, plane);
-
- pthread_mutex_unlock(&drv->driver_lock);
-
- return bo;
-}
-
-
void drv_bo_destroy(struct bo *bo)
{
size_t plane;
@@ -321,24 +274,45 @@ struct bo *drv_bo_import(struct driver *drv, struct drv_import_fd_data *data)
int ret;
size_t plane;
struct bo *bo;
+ struct drm_prime_handle prime_handle;
bo = drv_bo_new(drv, data->width, data->height, data->format);
if (!bo)
return NULL;
- ret = drv->backend->bo_import(bo, data);
- if (ret) {
- free(bo);
- return NULL;
- }
-
for (plane = 0; plane < bo->num_planes; plane++) {
+
+ memset(&prime_handle, 0, sizeof(prime_handle));
+ prime_handle.fd = data->fds[plane];
+
+ ret = drmIoctl(drv->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE,
+ &prime_handle);
+
+ if (ret) {
+ fprintf(stderr, "drv: DRM_IOCTL_PRIME_FD_TO_HANDLE failed "
+ "(fd=%u)\n", prime_handle.fd);
+
+ if (plane > 0) {
+ bo->num_planes = plane;
+ drv_bo_destroy(bo);
+ } else {
+ free(bo);
+ }
+
+ return NULL;
+ }
+
+ bo->handles[plane].u32 = prime_handle.handle;
bo->strides[plane] = data->strides[plane];
bo->offsets[plane] = data->offsets[plane];
bo->sizes[plane] = data->sizes[plane];
bo->format_modifiers[plane] = data->format_modifiers[plane];
bo->total_size += data->sizes[plane];
+
+ pthread_mutex_lock(&drv->driver_lock);
+ drv_increment_reference_count(drv, bo, plane);
+ pthread_mutex_unlock(&drv->driver_lock);
}
return bo;
@@ -402,10 +376,7 @@ int drv_bo_unmap(struct bo *bo, void *map_data)
pthread_mutex_lock(&bo->drv->driver_lock);
if (!--data->refcount) {
- if (bo->drv->backend->bo_unmap)
- ret = bo->drv->backend->bo_unmap(bo, data);
- else
- ret = munmap(data->addr, data->length);
+ ret = munmap(data->addr, data->length);
drmHashDelete(bo->drv->map_table, data->handle);
free(data);
}
diff --git a/chromium/third_party/minigbm/src/drv.h b/chromium/third_party/minigbm/src/drv.h
index 355ea45f03e..83d3b6a4bf5 100644
--- a/chromium/third_party/minigbm/src/drv.h
+++ b/chromium/third_party/minigbm/src/drv.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -92,12 +92,6 @@ struct bo *
drv_bo_create(struct driver *drv, uint32_t width, uint32_t height,
uint32_t format, uint64_t flags);
-struct bo *
-drv_bo_create_with_modifiers(struct driver *drv,
- uint32_t width, uint32_t height,
- uint32_t format,
- const uint64_t *modifiers, uint32_t count);
-
void
drv_bo_destroy(struct bo *bo);
diff --git a/chromium/third_party/minigbm/src/drv_priv.h b/chromium/third_party/minigbm/src/drv_priv.h
index 62492c284cb..837310a70b7 100644
--- a/chromium/third_party/minigbm/src/drv_priv.h
+++ b/chromium/third_party/minigbm/src/drv_priv.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -46,7 +46,6 @@ struct map_info {
size_t length;
uint32_t handle;
int32_t refcount;
- void *priv;
};
struct supported_combination {
@@ -67,15 +66,8 @@ struct backend
void (*close)(struct driver *drv);
int (*bo_create)(struct bo *bo, uint32_t width, uint32_t height,
uint32_t format, uint32_t flags);
- int (*bo_create_with_modifiers)(struct bo *bo,
- uint32_t width, uint32_t height,
- uint32_t format,
- const uint64_t *modifiers,
- uint32_t count);
- int (*bo_destroy)(struct bo *bo);
- int (*bo_import)(struct bo *bo, struct drv_import_fd_data *data);
void* (*bo_map)(struct bo *bo, struct map_info *data, size_t plane);
- int (*bo_unmap)(struct bo *bo, struct map_info *data);
+ int (*bo_destroy)(struct bo *bo);
uint32_t (*resolve_format)(uint32_t format);
struct list_head combinations;
};
diff --git a/chromium/third_party/minigbm/src/evdi.c b/chromium/third_party/minigbm/src/evdi.c
index 988797b2f8c..97042d1dc78 100644
--- a/chromium/third_party/minigbm/src/evdi.c
+++ b/chromium/third_party/minigbm/src/evdi.c
@@ -8,13 +8,11 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[2] = {
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+static struct supported_combination combos[4] = {
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
};
static int evdi_init(struct driver *drv)
@@ -29,7 +27,6 @@ struct backend backend_evdi =
.init = evdi_init,
.bo_create = drv_dumb_bo_create,
.bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = drv_dumb_bo_map,
};
diff --git a/chromium/third_party/minigbm/src/exynos.c b/chromium/third_party/minigbm/src/exynos.c
index 4dcf6043cc1..d6dc7def46f 100644
--- a/chromium/third_party/minigbm/src/exynos.c
+++ b/chromium/third_party/minigbm/src/exynos.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -17,16 +17,12 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[3] = {
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_NV12, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
- BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+static struct supported_combination combos[5] = {
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_NV12, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
};
static int exynos_init(struct driver *drv)
@@ -110,7 +106,6 @@ struct backend backend_exynos =
.init = exynos_init,
.bo_create = exynos_bo_create,
.bo_destroy = drv_gem_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = drv_dumb_bo_map,
};
diff --git a/chromium/third_party/minigbm/src/gbm.c b/chromium/third_party/minigbm/src/gbm.c
index 6ad32ce6bbe..7389cd8a1b0 100644
--- a/chromium/third_party/minigbm/src/gbm.c
+++ b/chromium/third_party/minigbm/src/gbm.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -137,32 +137,6 @@ PUBLIC struct gbm_bo *gbm_bo_create(struct gbm_device *gbm, uint32_t width,
return bo;
}
-PUBLIC struct gbm_bo *gbm_bo_create_with_modifiers(struct gbm_device *gbm,
- uint32_t width,
- uint32_t height,
- uint32_t format,
- const uint64_t *modifiers,
- uint32_t count)
-{
- struct gbm_bo *bo;
-
- bo = gbm_bo_new(gbm, format);
-
- if (!bo)
- return NULL;
-
- bo->bo = drv_bo_create_with_modifiers(gbm->drv,
- width, height, format,
- modifiers, count);
-
- if (!bo->bo) {
- free(bo);
- return NULL;
- }
-
- return bo;
-}
-
PUBLIC void gbm_bo_destroy(struct gbm_bo *bo)
{
if (bo->destroy_user_data) {
diff --git a/chromium/third_party/minigbm/src/gbm.h b/chromium/third_party/minigbm/src/gbm.h
index 1fb338f98e3..839e2a51c63 100644
--- a/chromium/third_party/minigbm/src/gbm.h
+++ b/chromium/third_party/minigbm/src/gbm.h
@@ -35,7 +35,6 @@ extern "C" {
#define __GBM__ 1
-#include <stddef.h>
#include <stdint.h>
/**
@@ -262,12 +261,6 @@ gbm_bo_create(struct gbm_device *gbm,
uint32_t width, uint32_t height,
uint32_t format, uint32_t flags);
-struct gbm_bo *
-gbm_bo_create_with_modifiers(struct gbm_device *gbm,
- uint32_t width, uint32_t height,
- uint32_t format,
- const uint64_t *modifiers, uint32_t count);
-
#define GBM_BO_IMPORT_WL_BUFFER 0x5501
#define GBM_BO_IMPORT_EGL_IMAGE 0x5502
#define GBM_BO_IMPORT_FD 0x5503
diff --git a/chromium/third_party/minigbm/src/gbm_helpers.c b/chromium/third_party/minigbm/src/gbm_helpers.c
index c60a315b2cc..be18a398e61 100644
--- a/chromium/third_party/minigbm/src/gbm_helpers.c
+++ b/chromium/third_party/minigbm/src/gbm_helpers.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
diff --git a/chromium/third_party/minigbm/src/gbm_helpers.h b/chromium/third_party/minigbm/src/gbm_helpers.h
index 48ff3913736..8e0b8b0fd90 100644
--- a/chromium/third_party/minigbm/src/gbm_helpers.h
+++ b/chromium/third_party/minigbm/src/gbm_helpers.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
diff --git a/chromium/third_party/minigbm/src/gbm_priv.h b/chromium/third_party/minigbm/src/gbm_priv.h
index eb29f1be8a7..379bf01701a 100644
--- a/chromium/third_party/minigbm/src/gbm_priv.h
+++ b/chromium/third_party/minigbm/src/gbm_priv.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
diff --git a/chromium/third_party/minigbm/src/gma500.c b/chromium/third_party/minigbm/src/gma500.c
index d8932fb40da..0f78e8546d4 100644
--- a/chromium/third_party/minigbm/src/gma500.c
+++ b/chromium/third_party/minigbm/src/gma500.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -8,10 +8,9 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[1] = {
- {DRM_FORMAT_RGBX8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+static struct supported_combination combos[2] = {
+ {DRM_FORMAT_RGBX8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_RGBX8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
};
static int gma500_init(struct driver *drv)
@@ -26,6 +25,5 @@ struct backend backend_gma500 =
.init = gma500_init,
.bo_create = drv_dumb_bo_create,
.bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = drv_dumb_bo_map,
};
diff --git a/chromium/third_party/minigbm/src/helpers.c b/chromium/third_party/minigbm/src/helpers.c
index 87aad9df17b..f6fd0ec7ec0 100644
--- a/chromium/third_party/minigbm/src/helpers.c
+++ b/chromium/third_party/minigbm/src/helpers.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -210,46 +210,6 @@ int drv_gem_bo_destroy(struct bo *bo)
return error;
}
-int drv_prime_bo_import(struct bo *bo, struct drv_import_fd_data *data)
-{
- int ret;
- size_t plane;
- struct drm_prime_handle prime_handle;
-
- for (plane = 0; plane < bo->num_planes; plane++) {
- memset(&prime_handle, 0, sizeof(prime_handle));
- prime_handle.fd = data->fds[plane];
-
- ret = drmIoctl(bo->drv->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE,
- &prime_handle);
-
- if (ret) {
- fprintf(stderr, "drv: DRM_IOCTL_PRIME_FD_TO_HANDLE "
- "failed (fd=%u)\n", prime_handle.fd);
-
- /*
- * Need to call GEM close on planes that were opened,
- * if any. Adjust the num_planes variable to be the
- * plane that failed, so GEM close will be called on
- * planes before that plane.
- */
- bo->num_planes = plane;
- drv_gem_bo_destroy(bo);
- return ret;
- }
-
- bo->handles[plane].u32 = prime_handle.handle;
- }
-
- for (plane = 0; plane < bo->num_planes; plane++) {
- pthread_mutex_lock(&bo->drv->driver_lock);
- drv_increment_reference_count(bo->drv, bo, plane);
- pthread_mutex_unlock(&bo->drv->driver_lock);
- }
-
- return 0;
-}
-
void *drv_dumb_bo_map(struct bo *bo, struct map_info *data, size_t plane)
{
int ret;
diff --git a/chromium/third_party/minigbm/src/helpers.h b/chromium/third_party/minigbm/src/helpers.h
index 64e8489e391..5b72bacc708 100644
--- a/chromium/third_party/minigbm/src/helpers.h
+++ b/chromium/third_party/minigbm/src/helpers.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -16,7 +16,6 @@ int drv_dumb_bo_create(struct bo *bo, uint32_t width, uint32_t height,
uint32_t format, uint32_t flags);
int drv_dumb_bo_destroy(struct bo *bo);
int drv_gem_bo_destroy(struct bo *bo);
-int drv_prime_bo_import(struct bo *bo, struct drv_import_fd_data *data);
void *drv_dumb_bo_map(struct bo *bo, struct map_info *data, size_t plane);
uintptr_t drv_get_reference_count(struct driver *drv, struct bo *bo,
size_t plane);
diff --git a/chromium/third_party/minigbm/src/i915.c b/chromium/third_party/minigbm/src/i915.c
index 2c6645bf2cb..769e6a33c67 100644
--- a/chromium/third_party/minigbm/src/i915.c
+++ b/chromium/third_party/minigbm/src/i915.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -7,17 +7,17 @@
#ifdef DRV_I915
#include <errno.h>
-#include <i915_drm.h>
-#include <intel_bufmgr.h>
#include <string.h>
+#include <stdio.h>
#include <sys/mman.h>
#include <xf86drm.h>
+#include <i915_drm.h>
#include "drv_priv.h"
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[19] = {
+static struct supported_combination combos[18] = {
{DRM_FORMAT_ARGB1555, DRM_FORMAT_MOD_NONE,
BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
{DRM_FORMAT_ABGR8888, DRM_FORMAT_MOD_NONE,
@@ -54,20 +54,11 @@ static struct supported_combination combos[19] = {
BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
{DRM_FORMAT_YVU420, DRM_FORMAT_MOD_NONE,
BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_YVU420, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
};
struct i915_device
{
int gen;
- drm_intel_bufmgr *mgr;
- uint32_t count;
-};
-
-struct i915_bo
-{
- drm_intel_bo *ibos[DRV_MAX_PLANES];
};
static int get_gen(int device_id)
@@ -82,10 +73,45 @@ static int get_gen(int device_id)
return 4;
}
+static int i915_init(struct driver *drv)
+{
+ struct i915_device *i915_drv;
+ drm_i915_getparam_t get_param;
+ int device_id;
+ int ret;
+
+ i915_drv = (struct i915_device*)malloc(sizeof(*i915_drv));
+ if (!i915_drv)
+ return -1;
+
+ memset(&get_param, 0, sizeof(get_param));
+ get_param.param = I915_PARAM_CHIPSET_ID;
+ get_param.value = &device_id;
+ ret = drmIoctl(drv->fd, DRM_IOCTL_I915_GETPARAM, &get_param);
+ if (ret) {
+ fprintf(stderr, "drv: DRM_IOCTL_I915_GETPARAM failed\n");
+ free(i915_drv);
+ return -1;
+ }
+
+ i915_drv->gen = get_gen(device_id);
+
+ drv->priv = i915_drv;
+
+ drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
+ return drv_add_kms_flags(drv);
+}
+
+static void i915_close(struct driver *drv)
+{
+ free(drv->priv);
+ drv->priv = NULL;
+}
+
static void i915_align_dimensions(struct driver *drv, uint32_t tiling_mode,
uint32_t *width, uint32_t *height, int bpp)
{
- struct i915_device *i915_dev = (struct i915_device *)drv->priv;
+ struct i915_device *i915_drv = (struct i915_device *)drv->priv;
uint32_t width_alignment = 4, height_alignment = 4;
switch (tiling_mode) {
@@ -100,7 +126,7 @@ static void i915_align_dimensions(struct driver *drv, uint32_t tiling_mode,
break;
case I915_TILING_Y:
- if (i915_dev->gen == 3) {
+ if (i915_drv->gen == 3) {
width_alignment = 512 / bpp;
height_alignment = 8;
} else {
@@ -110,7 +136,7 @@ static void i915_align_dimensions(struct driver *drv, uint32_t tiling_mode,
break;
}
- if (i915_dev->gen > 3) {
+ if (i915_drv->gen > 3) {
*width = ALIGN(*width, width_alignment);
*height = ALIGN(*height, height_alignment);
} else {
@@ -125,69 +151,23 @@ static void i915_align_dimensions(struct driver *drv, uint32_t tiling_mode,
static int i915_verify_dimensions(struct driver *drv, uint32_t stride,
uint32_t height)
{
- struct i915_device *i915_dev = (struct i915_device *)drv->priv;
- if (i915_dev->gen <= 3 && stride > 8192)
+ struct i915_device *i915_drv = (struct i915_device *)drv->priv;
+ if (i915_drv->gen <= 3 && stride > 8192)
return 0;
return 1;
}
-static int i915_init(struct driver *drv)
-{
- struct i915_device *i915_dev;
- drm_i915_getparam_t get_param;
- int device_id;
- int ret;
-
- i915_dev = calloc(1, sizeof(*i915_dev));
- if (!i915_dev)
- return -1;
-
- memset(&get_param, 0, sizeof(get_param));
- get_param.param = I915_PARAM_CHIPSET_ID;
- get_param.value = &device_id;
- ret = drmIoctl(drv->fd, DRM_IOCTL_I915_GETPARAM, &get_param);
- if (ret) {
- fprintf(stderr, "drv: DRM_IOCTL_I915_GETPARAM failed\n");
- free(i915_dev);
- return -EINVAL;
- }
-
- i915_dev->gen = get_gen(device_id);
- i915_dev->count = 0;
-
- i915_dev->mgr = drm_intel_bufmgr_gem_init(drv->fd, 16 * 1024);
- if (!i915_dev->mgr) {
- fprintf(stderr, "drv: drm_intel_bufmgr_gem_init failed\n");
- free(i915_dev);
- return -EINVAL;
- }
-
- drv->priv = i915_dev;
-
- drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
- return drv_add_kms_flags(drv);
-}
-
-static void i915_close(struct driver *drv)
-{
- struct i915_device *i915_dev = drv->priv;
- drm_intel_bufmgr_destroy(i915_dev->mgr);
- free(i915_dev);
- drv->priv = NULL;
-}
-
static int i915_bo_create(struct bo *bo, uint32_t width, uint32_t height,
uint32_t format, uint32_t flags)
{
- int ret;
- size_t plane;
- char name[20];
- uint32_t tiling_mode;
- struct i915_bo *i915_bo;
-
+ struct driver *drv = bo->drv;
int bpp = drv_stride_from_format(format, 1, 0);
- struct i915_device *i915_dev = (struct i915_device *)bo->drv->priv;
+ struct drm_i915_gem_create gem_create;
+ struct drm_i915_gem_set_tiling gem_set_tiling;
+ uint32_t tiling_mode = I915_TILING_NONE;
+ size_t plane;
+ int ret;
if (flags & (BO_USE_CURSOR | BO_USE_LINEAR |
BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN))
@@ -197,114 +177,46 @@ static int i915_bo_create(struct bo *bo, uint32_t width, uint32_t height,
else
tiling_mode = I915_TILING_Y;
- i915_align_dimensions(bo->drv, tiling_mode, &width, &height, bpp);
- drv_bo_from_format(bo, width, height, format);
-
- if (!i915_verify_dimensions(bo->drv, bo->strides[0], height))
- return -EINVAL;
-
- snprintf(name, sizeof(name), "i915-buffer-%u", i915_dev->count);
- i915_dev->count++;
-
- i915_bo = calloc(1, sizeof(*i915_bo));
- if (!i915_bo)
- return -ENOMEM;
-
- bo->priv = i915_bo;
+ i915_align_dimensions(drv, tiling_mode, &width, &height, bpp);
- i915_bo->ibos[0] = drm_intel_bo_alloc(i915_dev->mgr, name,
- bo->total_size, 0);
- if (!i915_bo->ibos[0]) {
- fprintf(stderr, "drv: drm_intel_bo_alloc failed");
- free(i915_bo);
- bo->priv = NULL;
- return -ENOMEM;
- }
-
- for (plane = 0; plane < bo->num_planes; plane++) {
- if (plane > 0)
- drm_intel_bo_reference(i915_bo->ibos[0]);
-
- bo->handles[plane].u32 = i915_bo->ibos[0]->handle;
- i915_bo->ibos[plane] = i915_bo->ibos[0];
- }
+ drv_bo_from_format(bo, width, height, format);
- bo->tiling = tiling_mode;
+ if (!i915_verify_dimensions(drv, bo->strides[0], height))
+ return EINVAL;
- ret = drm_intel_bo_set_tiling(i915_bo->ibos[0], &bo->tiling,
- bo->strides[0]);
+ memset(&gem_create, 0, sizeof(gem_create));
+ gem_create.size = bo->total_size;
- if (ret || bo->tiling != tiling_mode) {
- fprintf(stderr, "drv: drm_intel_gem_bo_set_tiling failed "
- "errno=%x, stride=%x\n", errno, bo->strides[0]);
- /* Calls i915 bo destroy. */
- bo->drv->backend->bo_destroy(bo);
- return -errno;
+ ret = drmIoctl(drv->fd, DRM_IOCTL_I915_GEM_CREATE, &gem_create);
+ if (ret) {
+ fprintf(stderr, "drv: DRM_IOCTL_I915_GEM_CREATE failed "
+ "(size=%llu)\n", gem_create.size);
+ return ret;
}
- return 0;
-}
-
-static int i915_bo_destroy(struct bo *bo)
-{
- size_t plane;
- struct i915_bo *i915_bo = bo->priv;
-
for (plane = 0; plane < bo->num_planes; plane++)
- drm_intel_bo_unreference(i915_bo->ibos[plane]);
-
- free(i915_bo);
- bo->priv = NULL;
-
- return 0;
-}
-
-static int i915_bo_import(struct bo *bo, struct drv_import_fd_data *data)
-{
- size_t plane;
- uint32_t swizzling;
- struct i915_bo *i915_bo;
- struct i915_device *i915_dev = bo->drv->priv;
-
- i915_bo = calloc(1, sizeof(*i915_bo));
- if (!i915_bo)
- return -ENOMEM;
-
- bo->priv = i915_bo;
-
- /*
- * When self-importing, libdrm_intel increments the reference count
- * on the drm_intel_bo. It also returns the same drm_intel_bo per GEM
- * handle. Thus, we don't need to increase the reference count
- * (i.e, drv_increment_reference_count) when importing with this
- * backend.
- */
- for (plane = 0; plane < bo->num_planes; plane++) {
-
- i915_bo->ibos[plane] = drm_intel_bo_gem_create_from_prime(i915_dev->mgr,
- data->fds[plane], data->sizes[plane]);
-
- if (!i915_bo->ibos[plane]) {
- /*
- * Need to call GEM close on planes that were opened,
- * if any. Adjust the num_planes variable to be the
- * plane that failed, so GEM close will be called on
- * planes before that plane.
- */
- bo->num_planes = plane;
- i915_bo_destroy(bo);
- fprintf(stderr, "drv: i915: failed to import failed");
- return -EINVAL;
- }
-
- bo->handles[plane].u32 = i915_bo->ibos[plane]->handle;
- }
-
- if (drm_intel_bo_get_tiling(i915_bo->ibos[0], &bo->tiling,
- &swizzling)) {
- fprintf(stderr, "drv: drm_intel_bo_get_tiling failed");
- i915_bo_destroy(bo);
- return -EINVAL;
+ bo->handles[plane].u32 = gem_create.handle;
+
+ memset(&gem_set_tiling, 0, sizeof(gem_set_tiling));
+ do {
+ gem_set_tiling.handle = bo->handles[0].u32;
+ gem_set_tiling.tiling_mode = tiling_mode;
+ gem_set_tiling.stride = bo->strides[0];
+ ret = drmIoctl(drv->fd, DRM_IOCTL_I915_GEM_SET_TILING,
+ &gem_set_tiling);
+ } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
+
+ if (ret == -1) {
+ struct drm_gem_close gem_close;
+ gem_close.handle = bo->handles[0].u32;
+ fprintf(stderr, "drv: DRM_IOCTL_I915_GEM_SET_TILING failed "
+ "errno=%x (handle=%x, tiling=%x, stride=%x)\n",
+ errno,
+ gem_set_tiling.handle,
+ gem_set_tiling.tiling_mode,
+ gem_set_tiling.stride);
+ drmIoctl(drv->fd, DRM_IOCTL_GEM_CLOSE, &gem_close);
+ return -errno;
}
return 0;
@@ -313,35 +225,21 @@ static int i915_bo_import(struct bo *bo, struct drv_import_fd_data *data)
static void *i915_bo_map(struct bo *bo, struct map_info *data, size_t plane)
{
int ret;
- struct i915_bo *i915_bo = bo->priv;
+ struct drm_i915_gem_mmap_gtt gem_map;
- if (bo->tiling == I915_TILING_NONE)
- /* TODO(gsingh): use bo_map flags to determine if we should
- * enable writing.
- */
- ret = drm_intel_bo_map(i915_bo->ibos[0], 1);
- else
- ret = drm_intel_gem_bo_map_gtt(i915_bo->ibos[0]);
+ memset(&gem_map, 0, sizeof(gem_map));
+ gem_map.handle = bo->handles[0].u32;
+ ret = drmIoctl(bo->drv->fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &gem_map);
if (ret) {
- fprintf(stderr, "drv: i915_bo_map failed.");
+ fprintf(stderr, "drv: DRM_IOCTL_I915_GEM_MMAP_GTT failed\n");
return MAP_FAILED;
}
- return i915_bo->ibos[0]->virtual;
-}
-
-static int i915_bo_unmap(struct bo *bo, struct map_info *data)
-{
- int ret;
- struct i915_bo *i915_bo = bo->priv;
-
- if (bo->tiling == I915_TILING_NONE)
- ret = drm_intel_bo_unmap(i915_bo->ibos[0]);
- else
- ret = drm_intel_gem_bo_unmap_gtt(i915_bo->ibos[0]);
+ data->length = bo->total_size;
- return ret;
+ return mmap(0, bo->total_size, PROT_READ | PROT_WRITE, MAP_SHARED,
+ bo->drv->fd, gem_map.offset);
}
static uint32_t i915_resolve_format(uint32_t format)
@@ -363,10 +261,8 @@ struct backend backend_i915 =
.init = i915_init,
.close = i915_close,
.bo_create = i915_bo_create,
- .bo_destroy = i915_bo_destroy,
- .bo_import = i915_bo_import,
+ .bo_destroy = drv_gem_bo_destroy,
.bo_map = i915_bo_map,
- .bo_unmap = i915_bo_unmap,
.resolve_format = i915_resolve_format,
};
diff --git a/chromium/third_party/minigbm/src/marvell.c b/chromium/third_party/minigbm/src/marvell.c
index ae3dc4570dc..e088db6e496 100644
--- a/chromium/third_party/minigbm/src/marvell.c
+++ b/chromium/third_party/minigbm/src/marvell.c
@@ -10,13 +10,11 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[2] = {
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+static struct supported_combination combos[4] = {
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
}
static int marvell_init(struct driver *drv)
@@ -31,7 +29,6 @@ struct backend backend_marvell =
.init = marvell_init,
.bo_create = drv_dumb_bo_create,
.bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = drv_dumb_bo_map,
};
diff --git a/chromium/third_party/minigbm/src/mediatek.c b/chromium/third_party/minigbm/src/mediatek.c
index 7e85f63409a..d4206be55fb 100644
--- a/chromium/third_party/minigbm/src/mediatek.c
+++ b/chromium/third_party/minigbm/src/mediatek.c
@@ -16,24 +16,25 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[6] = {
+static struct supported_combination combos[8] = {
{DRM_FORMAT_ABGR8888, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
+ BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
{DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+ BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
+ BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
{DRM_FORMAT_RGB565, DRM_FORMAT_MOD_NONE,
- BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
- BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+ BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
+ BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
{DRM_FORMAT_XBGR8888, DRM_FORMAT_MOD_NONE,
BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
{DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+ BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
{DRM_FORMAT_YVU420, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
+ BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
};
@@ -107,7 +108,6 @@ struct backend backend_mediatek =
.init = mediatek_init,
.bo_create = mediatek_bo_create,
.bo_destroy = drv_gem_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = mediatek_bo_map,
.resolve_format = mediatek_resolve_format,
};
diff --git a/chromium/third_party/minigbm/src/nouveau.c b/chromium/third_party/minigbm/src/nouveau.c
deleted file mode 100644
index e0d5954db72..00000000000
--- a/chromium/third_party/minigbm/src/nouveau.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2016 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "drv_priv.h"
-#include "helpers.h"
-#include "util.h"
-
-static struct supported_combination combos[2] = {
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_RENDERING},
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_RENDERING},
-};
-
-static int nouveau_init(struct driver *drv)
-{
- drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
- return drv_add_kms_flags(drv);
-}
-
-struct backend backend_nouveau =
-{
- .name = "nouveau",
- .init = nouveau_init,
- .bo_create = drv_dumb_bo_create,
- .bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
- .bo_map = drv_dumb_bo_map,
-};
diff --git a/chromium/third_party/minigbm/src/rockchip.c b/chromium/third_party/minigbm/src/rockchip.c
index a64a42f682f..02a5c473f87 100644
--- a/chromium/third_party/minigbm/src/rockchip.c
+++ b/chromium/third_party/minigbm/src/rockchip.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -17,7 +17,7 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[12] = {
+static struct supported_combination combos[11] = {
{DRM_FORMAT_ABGR8888, DRM_FORMAT_MOD_NONE,
BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
@@ -42,79 +42,16 @@ static struct supported_combination combos[12] = {
BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
{DRM_FORMAT_YVU420, DRM_FORMAT_MOD_NONE,
BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_YVU420, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
};
-static int afbc_bo_from_format(struct bo *bo, uint32_t width, uint32_t height,
- uint32_t format)
-{
- /* We've restricted ourselves to four bytes per pixel. */
- const uint32_t pixel_size = 4;
-
- const uint32_t clump_width = 4;
- const uint32_t clump_height = 4;
-
-#define AFBC_NARROW 1
-#if AFBC_NARROW == 1
- const uint32_t block_width = 4 * clump_width;
- const uint32_t block_height = 4 * clump_height;
-#else
- const uint32_t block_width = 8 * clump_width;
- const uint32_t block_height = 2 * clump_height;
-#endif
-
- const uint32_t header_block_size = 16;
- const uint32_t body_block_size = block_width * block_height * pixel_size;
- const uint32_t width_in_blocks = DIV_ROUND_UP(width, block_width);
- const uint32_t height_in_blocks = DIV_ROUND_UP(height, block_height);
- const uint32_t total_blocks = width_in_blocks * height_in_blocks;
-
- const uint32_t header_plane_size = total_blocks * header_block_size;
- const uint32_t body_plane_size = total_blocks * body_block_size;
-
- /* GPU requires 64 bytes, but EGL import code expects 1024 byte
- * alignement for the body plane. */
- const uint32_t body_plane_alignment = 1024;
-
- const uint32_t body_plane_offset =
- ALIGN(header_plane_size, body_plane_alignment);
- const uint32_t total_size =
- body_plane_offset + body_plane_size;
-
- bo->strides[0] = width_in_blocks * block_width * pixel_size;
- bo->sizes[0] = total_size;
- bo->offsets[0] = 0;
-
- bo->total_size = total_size;
-
- bo->format_modifiers[0] = DRM_FORMAT_MOD_CHROMEOS_ROCKCHIP_AFBC;
-
- return 0;
-}
-
static int rockchip_init(struct driver *drv)
{
drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
return drv_add_kms_flags(drv);
}
-static bool has_modifier(const uint64_t *list, uint32_t count, uint64_t modifier)
-{
- uint32_t i;
-
- for (i = 0; i < count; i++)
- if (list[i] == modifier)
- return true;
-
- return false;
-}
-
-static int rockchip_bo_create_with_modifiers(struct bo *bo,
- uint32_t width, uint32_t height,
- uint32_t format,
- const uint64_t *modifiers,
- uint32_t count)
+static int rockchip_bo_create(struct bo *bo, uint32_t width, uint32_t height,
+ uint32_t format, uint32_t flags)
{
int ret;
size_t plane;
@@ -130,18 +67,7 @@ static int rockchip_bo_create_with_modifiers(struct bo *bo,
drv_bo_from_format(bo, aligned_width, height, format);
bo->total_size = bo->strides[0] * aligned_height
+ w_mbs * h_mbs * 128;
- } else if (width <= 2560 &&
- has_modifier(modifiers, count,
- DRM_FORMAT_MOD_CHROMEOS_ROCKCHIP_AFBC)) {
- /* If the caller has decided they can use AFBC, always
- * pick that */
- afbc_bo_from_format(bo, width, height, format);
} else {
- if (!has_modifier(modifiers, count, DRM_FORMAT_MOD_NONE)) {
- errno = EINVAL;
- fprintf(stderr, "no usable modifier found\n");
- return -1;
- }
drv_bo_from_format(bo, width, height, format);
}
@@ -163,25 +89,11 @@ static int rockchip_bo_create_with_modifiers(struct bo *bo,
return 0;
}
-static int rockchip_bo_create(struct bo *bo, uint32_t width, uint32_t height,
- uint32_t format, uint32_t flags)
-{
- uint64_t modifiers[] = { DRM_FORMAT_MOD_NONE };
-
- return rockchip_bo_create_with_modifiers(bo, width, height, format,
- modifiers, ARRAY_SIZE(modifiers));
-}
-
static void *rockchip_bo_map(struct bo *bo, struct map_info *data, size_t plane)
{
int ret;
struct drm_rockchip_gem_map_off gem_map;
- /* We can only map buffers created with SW access flags, which should
- * have no modifiers (ie, not AFBC). */
- if (bo->format_modifiers[0] == DRM_FORMAT_MOD_CHROMEOS_ROCKCHIP_AFBC)
- return MAP_FAILED;
-
memset(&gem_map, 0, sizeof(gem_map));
gem_map.handle = bo->handles[0].u32;
@@ -217,9 +129,7 @@ struct backend backend_rockchip =
.name = "rockchip",
.init = rockchip_init,
.bo_create = rockchip_bo_create,
- .bo_create_with_modifiers = rockchip_bo_create_with_modifiers,
.bo_destroy = drv_gem_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = rockchip_bo_map,
.resolve_format = rockchip_resolve_format,
};
diff --git a/chromium/third_party/minigbm/src/tegra.c b/chromium/third_party/minigbm/src/tegra.c
index f48352e615d..49f3c6aeb47 100644
--- a/chromium/third_party/minigbm/src/tegra.c
+++ b/chromium/third_party/minigbm/src/tegra.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -33,16 +33,6 @@ enum nv_mem_kind
NV_MEM_KIND_GENERIC_16Bx2 = 0xfe,
};
-enum tegra_map_type {
- TEGRA_READ_TILED_BUFFER = 0,
- TEGRA_WRITE_TILED_BUFFER = 1,
-};
-
-struct tegra_private_map_data {
- void *tiled;
- void *untiled;
-};
-
static struct supported_combination combos[4] = {
{DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
@@ -104,80 +94,10 @@ static void compute_layout_blocklinear(int width, int height, int format,
static void compute_layout_linear(int width, int height, int format,
uint32_t *stride, uint32_t *size)
{
- *stride = ALIGN(drv_stride_from_format(format, width, 0), 64);
+ *stride = drv_stride_from_format(format, width, 0);
*size = *stride * height;
}
-static void transfer_tile(struct bo *bo, uint8_t *tiled, uint8_t *untiled,
- enum tegra_map_type type, uint32_t bytes_per_pixel,
- uint32_t gob_top, uint32_t gob_left,
- uint32_t gob_size_pixels)
-{
- uint8_t *tmp;
- uint32_t x, y, k;
- for (k = 0; k < gob_size_pixels; k++) {
- /*
- * Given the kth pixel starting from the tile specified by
- * gob_top and gob_left, unswizzle to get the standard (x, y)
- * representation.
- */
- x = gob_left + (((k >> 3) & 8) | ((k >> 1) & 4) | (k & 3));
- y = gob_top + ((k >> 7 << 3) | ((k >> 3) & 6) | ((k >> 2) & 1));
-
- tmp = untiled + (y * bo->strides[0]) + (x * bytes_per_pixel);
-
- if (type == TEGRA_READ_TILED_BUFFER)
- memcpy(tmp, tiled, bytes_per_pixel);
- else if (type == TEGRA_WRITE_TILED_BUFFER)
- memcpy(tiled, tmp, bytes_per_pixel);
-
- /* Move on to next pixel. */
- tiled += bytes_per_pixel;
- }
-}
-
-static void transfer_tiled_memory(struct bo *bo, uint8_t *tiled,
- uint8_t *untiled, enum tegra_map_type type)
-{
- uint32_t gob_width, gob_height, gob_size_bytes, gob_size_pixels,
- gob_count_x, gob_count_y, gob_top, gob_left;
- uint32_t i, j, offset;
- uint8_t *tmp;
- uint32_t bytes_per_pixel = drv_stride_from_format(bo->format, 1, 0);
-
- /*
- * The blocklinear format consists of 8*(2^n) x 64 byte sized tiles,
- * where 0 <= n <= 4.
- */
- gob_width = DIV_ROUND_UP(NV_BLOCKLINEAR_GOB_WIDTH, bytes_per_pixel);
- gob_height = NV_BLOCKLINEAR_GOB_HEIGHT *
- (1 << NV_DEFAULT_BLOCK_HEIGHT_LOG2);
- /* Calculate the height from maximum possible gob height */
- while (gob_height > NV_BLOCKLINEAR_GOB_HEIGHT
- && gob_height >= 2 * bo->height)
- gob_height /= 2;
-
- gob_size_bytes = gob_height * NV_BLOCKLINEAR_GOB_WIDTH;
- gob_size_pixels = gob_height * gob_width;
-
- gob_count_x = DIV_ROUND_UP(bo->strides[0], NV_BLOCKLINEAR_GOB_WIDTH);
- gob_count_y = DIV_ROUND_UP(bo->height, gob_height);
-
- offset = 0;
- for (j = 0; j < gob_count_y; j++) {
- gob_top = j * gob_height;
- for (i = 0; i < gob_count_x; i++) {
- tmp = tiled + offset;
- gob_left = i * gob_width;
-
- transfer_tile(bo, tmp, untiled, type, bytes_per_pixel,
- gob_top, gob_left, gob_size_pixels);
-
- offset += gob_size_bytes;
- }
- }
-}
-
static int tegra_init(struct driver *drv)
{
drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
@@ -242,7 +162,6 @@ static void *tegra_bo_map(struct bo *bo, struct map_info *data, size_t plane)
{
int ret;
struct drm_tegra_gem_mmap gem_map;
- struct tegra_private_map_data *priv;
memset(&gem_map, 0, sizeof(gem_map));
gem_map.handle = bo->handles[0].u32;
@@ -254,37 +173,10 @@ static void *tegra_bo_map(struct bo *bo, struct map_info *data, size_t plane)
return MAP_FAILED;
}
- void *addr = mmap(0, bo->total_size, PROT_READ | PROT_WRITE, MAP_SHARED,
- bo->drv->fd, gem_map.offset);
-
data->length = bo->total_size;
- if ((bo->tiling & 0xFF) == NV_MEM_KIND_C32_2CRA && addr != MAP_FAILED) {
- priv = calloc(1, sizeof(*priv));
- priv->untiled = calloc(1, bo->total_size);
- priv->tiled = addr;
- data->priv = priv;
- transfer_tiled_memory(bo, priv->tiled, priv->untiled,
- TEGRA_READ_TILED_BUFFER);
- addr = priv->untiled;
- }
-
- return addr;
-}
-
-static int tegra_bo_unmap(struct bo *bo, struct map_info *data)
-{
- if (data->priv) {
- struct tegra_private_map_data *priv = data->priv;
- transfer_tiled_memory(bo, priv->tiled, priv->untiled,
- TEGRA_WRITE_TILED_BUFFER);
- data->addr = priv->tiled;
- free(priv->untiled);
- free(priv);
- data->priv = NULL;
- }
-
- return munmap(data->addr, data->length);
+ return mmap(0, bo->total_size, PROT_READ | PROT_WRITE, MAP_SHARED,
+ bo->drv->fd, gem_map.offset);
}
struct backend backend_tegra =
@@ -293,9 +185,7 @@ struct backend backend_tegra =
.init = tegra_init,
.bo_create = tegra_bo_create,
.bo_destroy = drv_gem_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = tegra_bo_map,
- .bo_unmap = tegra_bo_unmap,
};
#endif
diff --git a/chromium/third_party/minigbm/src/udl.c b/chromium/third_party/minigbm/src/udl.c
index c607772b736..a4fb07b5b47 100644
--- a/chromium/third_party/minigbm/src/udl.c
+++ b/chromium/third_party/minigbm/src/udl.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -8,13 +8,11 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[2] = {
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+static struct supported_combination combos[4] = {
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
};
static int udl_init(struct driver *drv)
@@ -29,6 +27,5 @@ struct backend backend_udl =
.init = udl_init,
.bo_create = drv_dumb_bo_create,
.bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = drv_dumb_bo_map,
};
diff --git a/chromium/third_party/minigbm/src/util.h b/chromium/third_party/minigbm/src/util.h
index 696b996b9af..9606336fdc4 100644
--- a/chromium/third_party/minigbm/src/util.h
+++ b/chromium/third_party/minigbm/src/util.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 The Chromium OS Authors. All rights reserved.
+ * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
diff --git a/chromium/third_party/minigbm/src/vc4.c b/chromium/third_party/minigbm/src/vc4.c
deleted file mode 100644
index 7e5351f2775..00000000000
--- a/chromium/third_party/minigbm/src/vc4.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2017 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifdef DRV_VC4
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <vc4_drm.h>
-#include <xf86drm.h>
-
-#include "drv_priv.h"
-#include "helpers.h"
-#include "util.h"
-
-static struct supported_combination combos[3] = {
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_RGB565, DRM_FORMAT_MOD_NONE,
- BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
- BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
-};
-
-static int vc4_init(struct driver *drv)
-{
- drv_insert_combinations(drv, combos, ARRAY_SIZE(combos));
- return drv_add_kms_flags(drv);
-}
-
-static int vc4_bo_create(struct bo *bo, uint32_t width, uint32_t height,
- uint32_t format, uint32_t flags)
-{
- int ret;
- size_t plane;
- struct drm_vc4_create_bo bo_create;
-
- drv_bo_from_format(bo, width, height, format);
-
- memset(&bo_create, 0, sizeof(bo_create));
- bo_create.size = bo->total_size;
-
- ret = drmIoctl(bo->drv->fd, DRM_IOCTL_VC4_CREATE_BO, &bo_create);
- if (ret) {
- fprintf(stderr, "drv: DRM_IOCTL_VC4_GEM_CREATE failed "
- "(size=%zu)\n", bo->total_size);
- return ret;
- }
-
- for (plane = 0; plane < bo->num_planes; plane++)
- bo->handles[plane].u32 = bo_create.handle;
-
- return 0;
-}
-
-static void *vc4_bo_map(struct bo *bo, struct map_info *data, size_t plane)
-{
- int ret;
- struct drm_vc4_mmap_bo bo_map;
-
- memset(&bo_map, 0, sizeof(bo_map));
- bo_map.handle = bo->handles[0].u32;
-
- ret = drmCommandWriteRead(bo->drv->fd, DRM_VC4_MMAP_BO, &bo_map,
- sizeof(bo_map));
- if (ret) {
- fprintf(stderr, "drv: DRM_VC4_MMAP_BO failed\n");
- return MAP_FAILED;
- }
-
- data->length = bo->total_size;
-
- return mmap(0, bo->total_size, PROT_READ | PROT_WRITE, MAP_SHARED,
- bo->drv->fd, bo_map.offset);
-}
-
-struct backend backend_vc4 =
-{
- .name = "vc4",
- .init = vc4_init,
- .bo_create = vc4_bo_create,
- .bo_import = drv_prime_bo_import,
- .bo_destroy = drv_gem_bo_destroy,
- .bo_map = vc4_bo_map,
-};
-
-#endif
diff --git a/chromium/third_party/minigbm/src/vgem.c b/chromium/third_party/minigbm/src/vgem.c
index 0f3d2e3e0e3..815f73c9051 100644
--- a/chromium/third_party/minigbm/src/vgem.c
+++ b/chromium/third_party/minigbm/src/vgem.c
@@ -13,17 +13,14 @@
static struct supported_combination combos[4] = {
{DRM_FORMAT_ABGR8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+ BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN},
{DRM_FORMAT_RGB565, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
- BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+ BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
{DRM_FORMAT_XBGR8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_YVU420, DRM_FORMAT_MOD_NONE,
- BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
+ BO_USE_RENDERING | BO_USE_SW_READ_OFTEN | BO_USE_SW_WRITE_OFTEN |
BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+ {DRM_FORMAT_YVU420, DRM_FORMAT_MOD_NONE,
+ BO_USE_RENDERING | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
};
static int vgem_init(struct driver *drv)
@@ -63,7 +60,6 @@ struct backend backend_vgem =
.init = vgem_init,
.bo_create = vgem_bo_create,
.bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = drv_dumb_bo_map,
.resolve_format = vgem_resolve_format,
};
diff --git a/chromium/third_party/minigbm/src/virtio_gpu.c b/chromium/third_party/minigbm/src/virtio_gpu.c
index 5ac0e314aa0..f169101be27 100644
--- a/chromium/third_party/minigbm/src/virtio_gpu.c
+++ b/chromium/third_party/minigbm/src/virtio_gpu.c
@@ -8,13 +8,11 @@
#include "helpers.h"
#include "util.h"
-static struct supported_combination combos[2] = {
- {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
- {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE,
- BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_RENDERING | BO_USE_SW_READ_OFTEN |
- BO_USE_SW_WRITE_OFTEN | BO_USE_SW_READ_RARELY | BO_USE_SW_WRITE_RARELY},
+static struct supported_combination combos[4] = {
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_ARGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_CURSOR | BO_USE_LINEAR},
+ {DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_NONE, BO_USE_RENDERING},
};
static int virtio_gpu_init(struct driver *drv)
@@ -29,7 +27,6 @@ struct backend backend_virtio_gpu =
.init = virtio_gpu_init,
.bo_create = drv_dumb_bo_create,
.bo_destroy = drv_dumb_bo_destroy,
- .bo_import = drv_prime_bo_import,
.bo_map = drv_dumb_bo_map,
};
diff --git a/chromium/third_party/pyelftools/.hgignore b/chromium/third_party/pyelftools/.hgignore
new file mode 100644
index 00000000000..b5fbddea2f8
--- /dev/null
+++ b/chromium/third_party/pyelftools/.hgignore
@@ -0,0 +1,12 @@
+syntax: glob
+
+*.pyc
+.coverage
+.tox
+htmlcov
+tags
+build
+dist
+MANIFEST
+
+
diff --git a/chromium/third_party/pyelftools/.travis.yml b/chromium/third_party/pyelftools/.travis.yml
deleted file mode 100644
index c2eaf2356ed..00000000000
--- a/chromium/third_party/pyelftools/.travis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-language: python
-python:
- - "2.7"
- - "3.2"
- - "3.3"
- - "3.4"
-script: python test/all_tests.py
-
diff --git a/chromium/third_party/pyelftools/CHANGES b/chromium/third_party/pyelftools/CHANGES
index 926dbe07c39..dc64e660e85 100644
--- a/chromium/third_party/pyelftools/CHANGES
+++ b/chromium/third_party/pyelftools/CHANGES
@@ -1,31 +1,10 @@
Changelog
=========
-+ Version 0.22 (30.03.2014)
-
- - pyelftools repository moved to https://github.com/eliben/pyelftools
- - Support for version sections - contributed by Yann Rouillard.
- - Better ARM support (including AArch64) - contributed by Dobromir Stefanov.
- - Added some initial support for parsing Solaris OpenCSW ELF files
- (contributed by Yann Rouillard).
- - Added some initial support for DWARF4 (as generated by gcc 4.8)
- and DWARF generated by recent versions of Clang (3.3).
- - Added the get_full_path utility method to DIEs that have an associated
- file name / path (based on pull request #16 by Shaheed Haque).
- - Set up Travis CI integration.
-
-+ Version 0.21 (17.04.2013)
++ Version 0.21 (??)
- Added new example: dwarf_decode_address - decode function name and
file & line information from an address.
- - Issue #7: parsing incorrect DWARF was made a bit more forgiving for cases
- where serialized DIE trees have extra NULLs at the end.
- - Very initial support for ARM ELF files (Matthew Fernandez - pull
- request #6).
- - Support support for dumping the dynamic section (Mike Frysinger - pull
- request #7).
- - Output of scripts/readelf.py now matches that of binutils 2.23.52.
- - Added more machine EM_ values to ENUM_E_TYPE.
+ Version 0.20 (27.01.2012)
@@ -35,3 +14,4 @@ Changelog
on Windows.
+ Version 0.10 - Initial public release (06.01.2012)
+
diff --git a/chromium/third_party/pyelftools/MANIFEST.in b/chromium/third_party/pyelftools/MANIFEST.in
index 872e667abca..1f3af68ba39 100644
--- a/chromium/third_party/pyelftools/MANIFEST.in
+++ b/chromium/third_party/pyelftools/MANIFEST.in
@@ -1,8 +1,11 @@
-recursive-include elftools *.py
+recursive-include elftools *.py
recursive-include scripts *.py
recursive-include examples *.py *.elf *.out
-recursive-include test *.py *.elf *.arm
+recursive-include test *.py *.elf
include README
include LICENSE
include CHANGES
include tox.ini
+
+
+
diff --git a/chromium/third_party/pyelftools/README b/chromium/third_party/pyelftools/README
new file mode 100644
index 00000000000..836c1f28926
--- /dev/null
+++ b/chromium/third_party/pyelftools/README
@@ -0,0 +1,43 @@
+Introduction: what is pyelftools?
+---------------------------------
+
+**pyelftools** is a pure-Python library for parsing and analyzing ELF files
+and DWARF debugging information. See the
+`User's guide <https://bitbucket.org/eliben/pyelftools/wiki/Userguide>`_ for more details.
+
+Pre-requisites
+--------------
+
+As a user of **pyelftools**, one only needs Python to run. It works with
+Python versions 2.6, 2.7 and 3.2. For hacking on **pyelftools** the
+requirements are a bit more strict, please see the
+`hacking guide <https://bitbucket.org/eliben/pyelftools/wiki/Hacking>`_.
+
+Installing
+----------
+
+When you unzip the source distribution, run::
+
+ > python setup.py install
+
+Alternatively, **pyelftools** can be installed from PyPI (Python package
+index)::
+
+ > pip install pyelftools
+
+How to use it?
+--------------
+
+**pyelftools** is a regular Python library: you import and invoke it from your
+own code. For a detailed usage guide and links to examples, please consult the
+`user's guide <https://bitbucket.org/eliben/pyelftools/wiki/Userguide>`_.
+
+License
+-------
+
+**pyelftools** is open source software. Its code is in the public domain. See
+the ``LICENSE`` file for more details.
+
+
+
+
diff --git a/chromium/third_party/pyelftools/README.rst b/chromium/third_party/pyelftools/README.rst
deleted file mode 100644
index d668f3b35f9..00000000000
--- a/chromium/third_party/pyelftools/README.rst
+++ /dev/null
@@ -1,57 +0,0 @@
-Introduction: what is pyelftools?
----------------------------------
-
-**pyelftools** is a pure-Python library for parsing and analyzing ELF files
-and DWARF debugging information. See the
-`User's guide <https://github.com/eliben/pyelftools/wiki/User's-guide>`_
-for more details.
-
-Pre-requisites
---------------
-
-As a user of **pyelftools**, one only needs Python to run. It works with
-Python versions 2.6, 2.7 and 3.x (x >= 2). For hacking on **pyelftools** the
-requirements are a bit more strict, please see the
-`hacking guide <https://github.com/eliben/pyelftools/wiki/Hacking-guide>`_.
-
-Installing
-----------
-
-**pyelftools** can be installed from PyPI (Python package index)::
-
- > pip install pyelftools
-
-Alternatively, you can download the source distribution for the most recent and
-historic versions from the *Downloads* tab on the `pyelftools project page
-<https://github.com/eliben/pyelftools>`_ (by going to *Tags*). Then, you can
-install from source, as usual::
-
- > python setup.py install
-
-Since **pyelftools** is a work in progress, it's recommended to have the most
-recent version of the code. This can be done by downloading the `master zip
-file <https://github.com/eliben/pyelftools/archive/master.zip>`_ or just
-cloning the Git repository.
-
-How to use it?
---------------
-
-**pyelftools** is a regular Python library: you import and invoke it from your
-own code. For a detailed usage guide and links to examples, please consult the
-`user's guide <https://github.com/eliben/pyelftools/wiki/User's-guide>`_.
-
-License
--------
-
-**pyelftools** is open source software. Its code is in the public domain. See
-the ``LICENSE`` file for more details.
-
-CI Status
----------
-
-**pyelftools** has automatic testing enabled through the convenient
-`Travis CI project <https://travis-ci.org>`_. Here is the latest build status:
-
-.. image:: https://travis-ci.org/eliben/pyelftools.png?branch=master
- :align: center
- :target: https://travis-ci.org/eliben/pyelftools
diff --git a/chromium/third_party/pyelftools/TODO b/chromium/third_party/pyelftools/TODO
index 90280447160..1f8d11d1d7c 100644
--- a/chromium/third_party/pyelftools/TODO
+++ b/chromium/third_party/pyelftools/TODO
@@ -4,15 +4,7 @@ New version
* Update elftools/__init__.py
* Update setup.py
* Update CHANGES
-* Tag in git (v0.xx)
-
-construct
----------
-
-The construct seems to be maintained again - they also backported my Python 3
-fixes. Theoretically, I can remove construct from pyelftools and use it as a
-dependency instead. I don't really have time to play with this now, but may
-do so in the future.
+* Tag in hg
Distribution
------------
@@ -22,11 +14,15 @@ python setup.py build sdist upload
Preparing a new release
-----------------------
-* Run 'tox' tests (with '-r' to create new venvs)
+* Run all tests with Python 2.7 before packaging, on Linux
* Make sure new version was updated everywhere appropriate
+* Packaging done on Linux
* Run ``python setup.py build sdist`` (no 'upload' yet)
* Untar the created ``dist/pyelftools-x.y.tar.gz`` and make sure
everything looks ok
+* Runt 'tox' tests (with '-r' to create new venvs)
* Now build with upload to send it to PyPi
* Test with pip install from some new virtualenv
+* If everything is OK, upload the distribution to BitBucket as well
* The older download can be kept alive for a couple of days
+
diff --git a/chromium/third_party/pyelftools/elftools/__init__.py b/chromium/third_party/pyelftools/elftools/__init__.py
index 8a3e56cdffc..0f14043bf4b 100644
--- a/chromium/third_party/pyelftools/elftools/__init__.py
+++ b/chromium/third_party/pyelftools/elftools/__init__.py
@@ -1,7 +1,3 @@
-#-------------------------------------------------------------------------------
-# elftools
-#
-# Eli Bendersky (eliben@gmail.com)
-# This code is in the public domain
-#-------------------------------------------------------------------------------
-__version__ = '0.22'
+__version__ = '0.20'
+
+
diff --git a/chromium/third_party/pyelftools/elftools/common/ordereddict.py b/chromium/third_party/pyelftools/elftools/common/ordereddict.py
index 18ee0458fe7..43356435eab 100644
--- a/chromium/third_party/pyelftools/elftools/common/ordereddict.py
+++ b/chromium/third_party/pyelftools/elftools/common/ordereddict.py
@@ -1,9 +1,11 @@
-#-------------------------------------------------------------------------------
-# elftools: port of OrderedDict to work on Python < 2.7
+# http://code.activestate.com/recipes/576693/ (r9)
+# Created by Raymond Hettinger on Wed, 18 Mar 2009 (MIT)
#
-# Taken from http://code.activestate.com/recipes/576693/ , revision 9
-# Code by Raymond Hettinger. License: MIT
-#-------------------------------------------------------------------------------
+# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7
+# and pypy.
+# Passes Python2.7's test suite and incorporates all the latest updates.
+#
+
try:
from thread import get_ident as _get_ident
except ImportError:
diff --git a/chromium/third_party/pyelftools/elftools/common/utils.py b/chromium/third_party/pyelftools/elftools/common/utils.py
index a2c9edbe356..2daed04c51c 100644
--- a/chromium/third_party/pyelftools/elftools/common/utils.py
+++ b/chromium/third_party/pyelftools/elftools/common/utils.py
@@ -31,8 +31,8 @@ def struct_parse(struct, stream, stream_pos=None):
stream.seek(stream_pos)
return struct.parse_stream(stream)
except ConstructError as e:
- raise ELFParseError(str(e))
-
+ raise ELFParseError(e.message)
+
def parse_cstring_from_stream(stream, stream_pos=None):
""" Parse a C-string from the given stream. The string is returned without
@@ -41,8 +41,6 @@ def parse_cstring_from_stream(stream, stream_pos=None):
If stream_pos is provided, the stream is seeked to this position before
the parsing is done. Otherwise, the current position of the stream is
used.
- Note: a bytes object is returned here, because this is what's read from
- the binary file.
"""
if stream_pos is not None:
stream.seek(stream_pos)
@@ -78,10 +76,11 @@ def dwarf_assert(cond, msg=''):
@contextmanager
def preserve_stream_pos(stream):
""" Usage:
- # stream has some position FOO (return value of stream.tell())
- with preserve_stream_pos(stream):
- # do stuff that manipulates the stream
- # stream still has position FOO
+
+ # stream has some position FOO (return value of stream.tell())
+ with preserve_stream_pos(stream):
+ # do stuff that manipulates the stream
+ # stream still has position FOO
"""
saved_pos = stream.tell()
yield
diff --git a/chromium/third_party/pyelftools/elftools/construct/README b/chromium/third_party/pyelftools/elftools/construct/README
index 7f9e1418c76..2c1b79852fb 100644
--- a/chromium/third_party/pyelftools/elftools/construct/README
+++ b/chromium/third_party/pyelftools/elftools/construct/README
@@ -1,10 +1,8 @@
-construct is a Python library for declarative parsing and building of binary
-data. This is my fork of construct 2, with some modifications for Python 3
-and bug fixes. The construct website is http://construct.readthedocs.org
+'construct' is the actual library, with my modifications for Python 3
+compatibility and various bug fixes.
-pyelftools carries construct around because construct has been abandoned for
-a long time and didn't get bugfixes; it also didn't work with Python 3.
+Taken from my fork: https://github.com/eliben/construct
-LICENSE is the original license.
+Take a look at LICENSE for the original license
diff --git a/chromium/third_party/pyelftools/elftools/dwarf/callframe.py b/chromium/third_party/pyelftools/elftools/dwarf/callframe.py
index 264adb8dc31..de67a43eaca 100644
--- a/chromium/third_party/pyelftools/elftools/dwarf/callframe.py
+++ b/chromium/third_party/pyelftools/elftools/dwarf/callframe.py
@@ -11,12 +11,12 @@ from collections import namedtuple
from ..common.utils import (struct_parse, dwarf_assert, preserve_stream_pos)
from ..common.py3compat import iterkeys
from .structs import DWARFStructs
-from .constants import *
+from .constants import *
class CallFrameInfo(object):
""" DWARF CFI (Call Frame Info)
-
+
stream, size:
A stream holding the .debug_frame section, and the size of the
section in it.
@@ -26,13 +26,14 @@ class CallFrameInfo(object):
Eventually, each entry gets its own structs based on the initial
length field it starts with. The address_size, however, is taken
from base_structs. This appears to be a limitation of the DWARFv3
- standard, fixed in v4.
- A discussion I had on dwarf-discuss confirms this.
- So for DWARFv4 we'll take the address size from the CIE header,
- but for earlier versions will use the elfclass of the containing
- file; more sophisticated methods are used by libdwarf and others,
- such as guessing which CU contains which FDEs (based on their
- address ranges) and taking the address_size from those CUs.
+ standard, fixed in v4 (where an address_size field exists for each
+ CFI. I had a discussion about this on dwarf-discuss that confirms
+ this.
+ Currently for base_structs I simply use the elfclass of the
+ containing file, but more sophisticated methods are used by
+ libdwarf and others, such as guessing which CU contains which FDEs
+ (based on their address ranges) and taking the address_size from
+ those CUs.
"""
def __init__(self, stream, size, base_structs):
self.stream = stream
@@ -86,7 +87,7 @@ class CallFrameInfo(object):
entry_structs.Dwarf_offset(''), self.stream)
is_CIE = (
- (dwarf_format == 32 and CIE_id == 0xFFFFFFFF) or
+ (dwarf_format == 32 and CIE_id == 0xFFFFFFFF) or
CIE_id == 0xFFFFFFFFFFFFFFFF)
if is_CIE:
@@ -99,14 +100,6 @@ class CallFrameInfo(object):
header = struct_parse(
header_struct, self.stream, offset)
- # If this is DWARF version 4 or later, we can have a more precise
- # address size, read from the CIE header.
- if entry_structs.dwarf_version >= 4:
- entry_structs = DWARFStructs(
- little_endian=entry_structs.little_endian,
- dwarf_format=entry_structs.dwarf_format,
- address_size=header.address_size)
-
# For convenience, compute the end offset for this entry
end_offset = (
offset + header.length +
@@ -258,7 +251,7 @@ class CFIEntry(object):
reg_order = []
else: # FDE
# For a FDE, we need to decode the attached CIE first, because its
- # decoded table is needed. Its "initial instructions" describe a
+ # decoded table is needed. Its "initial instructions" describe a
# line that serves as the base (first) line in the FDE's table.
cie = self.cie
cie_decoded_table = cie.get_decoded()
@@ -266,7 +259,7 @@ class CFIEntry(object):
cur_line = last_line_in_CIE
cur_line['pc'] = self['initial_location']
reg_order = copy.copy(cie_decoded_table.reg_order)
-
+
table = []
# Keeps a stack for the use of DW_CFA_{remember|restore}_state
diff --git a/chromium/third_party/pyelftools/elftools/dwarf/compileunit.py b/chromium/third_party/pyelftools/elftools/dwarf/compileunit.py
index f5011dde835..fbe4a8b3022 100644
--- a/chromium/third_party/pyelftools/elftools/dwarf/compileunit.py
+++ b/chromium/third_party/pyelftools/elftools/dwarf/compileunit.py
@@ -10,36 +10,36 @@ from .die import DIE
class CompileUnit(object):
- """ A DWARF compilation unit (CU).
-
+ """ A DWARF compilation unit (CU).
+
A normal compilation unit typically represents the text and data
contributed to an executable by a single relocatable object file.
- It may be derived from several source files,
+ It may be derived from several source files,
including pre-processed "include files"
-
+
Serves as a container and context to DIEs that describe objects and code
belonging to a compilation unit.
-
+
CU header entries can be accessed as dict keys from this object, i.e.
cu = CompileUnit(...)
cu['version'] # version field of the CU header
-
- To get the top-level DIE describing the compilation unit, call the
+
+ To get the top-level DIE describing the compilation unit, call the
get_top_DIE method.
"""
def __init__(self, header, dwarfinfo, structs, cu_offset, cu_die_offset):
""" header:
CU header for this compile unit
-
+
dwarfinfo:
The DWARFInfo context object which created this one
-
+
structs:
A DWARFStructs instance suitable for this compile unit
-
+
cu_offset:
Offset in the stream to the beginning of this CU (its header)
-
+
cu_die_offset:
Offset in the stream of the top DIE of this CU
"""
@@ -48,19 +48,19 @@ class CompileUnit(object):
self.structs = structs
self.cu_offset = cu_offset
self.cu_die_offset = cu_die_offset
-
- # The abbreviation table for this CU. Filled lazily when DIEs are
+
+ # The abbreviation table for this CU. Filled lazily when DIEs are
# requested.
self._abbrev_table = None
-
+
# A list of DIEs belonging to this CU. Lazily parsed.
self._dielist = []
-
+
def dwarf_format(self):
""" Get the DWARF format (32 or 64) for this CU
"""
return self.structs.dwarf_format
-
+
def get_abbrev_table(self):
""" Get the abbreviation table (AbbrevTable object) for this CU
"""
@@ -70,31 +70,31 @@ class CompileUnit(object):
return self._abbrev_table
def get_top_DIE(self):
- """ Get the top DIE (which is either a DW_TAG_compile_unit or
+ """ Get the top DIE (which is either a DW_TAG_compile_unit or
DW_TAG_partial_unit) of this CU
"""
return self._get_DIE(0)
-
+
def iter_DIEs(self):
""" Iterate over all the DIEs in the CU, in order of their appearance.
Note that null DIEs will also be returned.
"""
self._parse_DIEs()
return iter(self._dielist)
-
+
#------ PRIVATE ------#
-
+
def __getitem__(self, name):
""" Implement dict-like access to header entries
"""
return self.header[name]
def _get_DIE(self, index):
- """ Get the DIE at the given index
+ """ Get the DIE at the given index
"""
self._parse_DIEs()
return self._dielist[index]
-
+
def _parse_DIEs(self):
""" Parse all the DIEs pertaining to this CU from the stream and shove
them sequentially into self._dielist.
@@ -103,13 +103,13 @@ class CompileUnit(object):
"""
if len(self._dielist) > 0:
return
-
- # Compute the boundary (one byte past the bounds) of this CU in the
+
+ # Compute the boundary (one byte past the bounds) of this CU in the
# stream
- cu_boundary = ( self.cu_offset +
- self['unit_length'] +
+ cu_boundary = ( self.cu_offset +
+ self['unit_length'] +
self.structs.initial_length_field_size())
-
+
# First pass: parse all DIEs and place them into self._dielist
die_offset = self.cu_die_offset
while die_offset < cu_boundary:
@@ -122,18 +122,18 @@ class CompileUnit(object):
# Second pass - unflatten the DIE tree
self._unflatten_tree()
-
+
def _unflatten_tree(self):
""" "Unflatten" the DIE tree from it serial representation, by setting
the child/sibling/parent links of DIEs.
-
+
Assumes self._dielist was already populated by a linear list of DIEs
read from the stream section
"""
# the first DIE in the list is the root node
root = self._dielist[0]
parentstack = [root]
-
+
for die in self._dielist[1:]:
if not die.is_null():
cur_parent = parentstack[-1]
@@ -143,11 +143,6 @@ class CompileUnit(object):
if die.has_children:
parentstack.append(die)
else:
- # parentstack should not be really empty here. However, some
- # compilers generate DWARF that has extra NULLs in the end and
- # we don't want pyelftools to fail parsing them just because of
- # this.
- if len(parentstack) > 0:
- # end of children for the current parent
- parentstack.pop()
+ # end of children for the current parent
+ parentstack.pop()
diff --git a/chromium/third_party/pyelftools/elftools/dwarf/descriptions.py b/chromium/third_party/pyelftools/elftools/dwarf/descriptions.py
index ca00cd1ee7c..721c97a5172 100644
--- a/chromium/third_party/pyelftools/elftools/dwarf/descriptions.py
+++ b/chromium/third_party/pyelftools/elftools/dwarf/descriptions.py
@@ -24,7 +24,7 @@ def set_global_machine_arch(machine_arch):
def describe_attr_value(attr, die, section_offset):
""" Given an attribute attr, return the textual representation of its
value, suitable for tools like readelf.
-
+
To cover all cases, this function needs some extra arguments:
die: the DIE this attribute was extracted from
@@ -32,11 +32,11 @@ def describe_attr_value(attr, die, section_offset):
"""
descr_func = _ATTR_DESCRIPTION_MAP[attr.form]
val_description = descr_func(attr, die, section_offset)
-
+
# For some attributes we can display further information
extra_info_func = _EXTRA_INFO_DESCRIPTION_MAP[attr.name]
extra_info = extra_info_func(attr, die, section_offset)
- return str(val_description) + '\t' + extra_info
+ return str(val_description) + '\t' + extra_info
def describe_CFI_instructions(entry):
@@ -45,7 +45,7 @@ def describe_CFI_instructions(entry):
"""
def _assert_FDE_instruction(instr):
dwarf_assert(
- isinstance(entry, FDE),
+ isinstance(entry, FDE),
'Unexpected instruction "%s" for a CIE' % instr)
def _full_reg_name(regnum):
@@ -82,7 +82,7 @@ def describe_CFI_instructions(entry):
'DW_CFA_advance_loc4', 'DW_CFA_advance_loc'):
_assert_FDE_instruction(instr)
factored_offset = instr.args[0] * cie['code_alignment_factor']
- s += ' %s: %s to %016x\n' % (
+ s += ' %s: %s to %08x\n' % (
name, factored_offset, factored_offset + pc)
pc += factored_offset
elif name in ( 'DW_CFA_remember_state', 'DW_CFA_restore_state',
@@ -126,7 +126,7 @@ def describe_CFI_CFA_rule(rule):
return 'exp'
else:
return '%s%+d' % (describe_reg_name(rule.reg), rule.offset)
-
+
def describe_DWARF_expr(expr, structs):
""" Textual description of a DWARF expression encoded in 'expr'.
@@ -197,29 +197,23 @@ def _describe_attr_debool(attr, die, section_offset):
"""
return '1' if attr.value else '0'
-def _describe_attr_present(attr, die, section_offset):
- """ Some forms may simply mean that an attribute is present,
- without providing any value.
- """
- return '1'
-
def _describe_attr_block(attr, die, section_offset):
s = '%s byte block: ' % len(attr.value)
- s += ' '.join('%x' % item for item in attr.value) + ' '
+ s += ' '.join('%x' % item for item in attr.value)
return s
-
+
_ATTR_DESCRIPTION_MAP = defaultdict(
lambda: _describe_attr_value_passthrough, # default_factory
-
+
DW_FORM_ref1=_describe_attr_ref,
DW_FORM_ref2=_describe_attr_ref,
DW_FORM_ref4=_describe_attr_ref,
DW_FORM_ref8=_describe_attr_split_64bit,
- DW_FORM_ref_udata=_describe_attr_ref,
+ DW_FORM_ref_udata=_describe_attr_ref,
DW_FORM_ref_addr=_describe_attr_hex_addr,
DW_FORM_data4=_describe_attr_hex,
- DW_FORM_data8=_describe_attr_hex,
+ DW_FORM_data8=_describe_attr_split_64bit,
DW_FORM_addr=_describe_attr_hex,
DW_FORM_sec_offset=_describe_attr_hex,
DW_FORM_flag=_describe_attr_debool,
@@ -233,9 +227,6 @@ _ATTR_DESCRIPTION_MAP = defaultdict(
DW_FORM_block2=_describe_attr_block,
DW_FORM_block4=_describe_attr_block,
DW_FORM_block=_describe_attr_block,
- DW_FORM_flag_present=_describe_attr_present,
- DW_FORM_exprloc=_describe_attr_block,
- DW_FORM_ref_sig8=_describe_attr_ref,
)
@@ -411,7 +402,7 @@ def _import_extra(attr, die, section_offset):
_EXTRA_INFO_DESCRIPTION_MAP = defaultdict(
lambda: _make_extra_string(''), # default_factory
-
+
DW_AT_inline=_make_extra_mapper(
_DESCR_DW_INL, '(Unknown inline attribute value: %x',
default_interpolate_value=True),
@@ -472,7 +463,7 @@ _REG_NAMES_x64 = [
class ExprDumper(GenericExprVisitor):
""" A concrete visitor for DWARF expressions that dumps a textual
representation of the complete expression.
-
+
Usage: after creation, call process_expr, and then get_str for a
semicolon-delimited string representation of the decoded expression.
"""
@@ -494,10 +485,10 @@ class ExprDumper(GenericExprVisitor):
'DW_OP_pick', 'DW_OP_plus_uconst', 'DW_OP_bra', 'DW_OP_skip',
'DW_OP_fbreg', 'DW_OP_piece', 'DW_OP_deref_size',
'DW_OP_xderef_size', 'DW_OP_regx',])
-
+
for n in range(0, 32):
self._ops_with_decimal_arg.add('DW_OP_breg%s' % n)
-
+
self._ops_with_two_decimal_args = set([
'DW_OP_const8u', 'DW_OP_const8s', 'DW_OP_bregx', 'DW_OP_bit_piece'])
diff --git a/chromium/third_party/pyelftools/elftools/dwarf/die.py b/chromium/third_party/pyelftools/elftools/dwarf/die.py
index 86830fc3bed..f0b5eb8dd48 100644
--- a/chromium/third_party/pyelftools/elftools/dwarf/die.py
+++ b/chromium/third_party/pyelftools/elftools/dwarf/die.py
@@ -7,20 +7,17 @@
# This code is in the public domain
#-------------------------------------------------------------------------------
from collections import namedtuple
-import os
-from ..common.exceptions import DWARFError
-from ..common.py3compat import OrderedDict, bytes2str, iteritems
+from ..common.py3compat import OrderedDict
from ..common.utils import struct_parse, preserve_stream_pos
-from .enums import DW_FORM_raw2name
-# AttributeValue - describes an attribute value in the DIE:
+# AttributeValue - describes an attribute value in the DIE:
#
# name:
# The name (DW_AT_*) of this attribute
-#
-# form:
+#
+# form:
# The DW_FORM_* name of this attribute
#
# value:
@@ -42,37 +39,37 @@ AttributeValue = namedtuple(
class DIE(object):
""" A DWARF debugging information entry. On creation, parses itself from
the stream. Each DIE is held by a CU.
-
+
Accessible attributes:
-
+
tag:
The DIE tag
-
+
size:
The size this DIE occupies in the section
-
+
offset:
The offset of this DIE in the stream
-
+
attributes:
- An ordered dictionary mapping attribute names to values. It's
+ An ordered dictionary mapping attribute names to values. It's
ordered to preserve the order of attributes in the section
-
+
has_children:
Specifies whether this DIE has children
-
+
abbrev_code:
- The abbreviation code pointing to an abbreviation entry (note
- that this is for informational pusposes only - this object
+ The abbreviation code pointing to an abbreviation entry (not
+ that this is for informational pusposes only - this object
interacts with its abbreviation table transparently).
-
+
See also the public methods.
"""
def __init__(self, cu, stream, offset):
""" cu:
CompileUnit object this DIE belongs to. Used to obtain context
information (structs, abbrev table, etc.)
-
+
stream, offset:
The stream and offset into it where this DIE's data is located
"""
@@ -80,7 +77,7 @@ class DIE(object):
self.dwarfinfo = self.cu.dwarfinfo # get DWARFInfo context
self.stream = stream
self.offset = offset
-
+
self.attributes = OrderedDict()
self.tag = None
self.has_children = None
@@ -88,39 +85,25 @@ class DIE(object):
self.size = 0
self._children = []
self._parent = None
-
- self._parse_DIE()
-
+
+ self._parse_DIE()
+
def is_null(self):
""" Is this a null entry?
"""
return self.tag is None
-
+
def get_parent(self):
- """ The parent DIE of this DIE. None if the DIE has no parent (i.e. a
+ """ The parent DIE of this DIE. None if the DIE has no parent (i.e. a
top-level DIE).
"""
return self._parent
-
- def get_full_path(self):
- """ Return the full path filename for the DIE.
-
- The filename is the join of 'DW_AT_comp_dir' and 'DW_AT_name',
- either of which may be missing in practice. Note that its value is
- usually a string taken from the .debug_string section and the
- returned value will be a string.
- """
- comp_dir_attr = self.attributes.get('DW_AT_comp_dir', None)
- comp_dir = bytes2str(comp_dir_attr.value) if comp_dir_attr else ''
- fname_attr = self.attributes.get('DW_AT_name', None)
- fname = bytes2str(fname_attr.value) if fname_attr else ''
- return os.path.join(comp_dir, fname)
-
+
def iter_children(self):
""" Yield all children of this DIE
"""
return iter(self._children)
-
+
def iter_siblings(self):
""" Yield all siblings of this DIE
"""
@@ -136,41 +119,41 @@ class DIE(object):
#
def add_child(self, die):
self._children.append(die)
-
+
def set_parent(self, die):
self._parent = die
#------ PRIVATE ------#
-
+
def __repr__(self):
s = 'DIE %s, size=%s, has_chidren=%s\n' % (
self.tag, self.size, self.has_children)
- for attrname, attrval in iteritems(self.attributes):
+ for attrname, attrval in self.attributes.iteritems():
s += ' |%-18s: %s\n' % (attrname, attrval)
return s
-
+
def __str__(self):
return self.__repr__()
-
+
def _parse_DIE(self):
""" Parses the DIE info from the section, based on the abbreviation
table of the CU
"""
structs = self.cu.structs
-
- # A DIE begins with the abbreviation code. Read it and use it to
+
+ # A DIE begins with the abbreviation code. Read it and use it to
# obtain the abbrev declaration for this DIE.
# Note: here and elsewhere, preserve_stream_pos is used on operations
# that manipulate the stream by reading data from it.
#
self.abbrev_code = struct_parse(
structs.Dwarf_uleb128(''), self.stream, self.offset)
-
+
# This may be a null entry
if self.abbrev_code == 0:
self.size = self.stream.tell() - self.offset
return
-
+
with preserve_stream_pos(self.stream):
abbrev_decl = self.cu.get_abbrev_table().get_abbrev(
self.abbrev_code)
@@ -184,14 +167,14 @@ class DIE(object):
attr_offset = self.stream.tell()
raw_value = struct_parse(structs.Dwarf_dw_form[form], self.stream)
- value = self._translate_attr_value(form, raw_value)
+ value = self._translate_attr_value(form, raw_value)
self.attributes[name] = AttributeValue(
name=name,
form=form,
value=value,
raw_value=raw_value,
offset=attr_offset)
-
+
self.size = self.stream.tell() - self.offset
def _translate_attr_value(self, form, raw_value):
@@ -204,17 +187,13 @@ class DIE(object):
elif form == 'DW_FORM_flag':
value = not raw_value == 0
elif form == 'DW_FORM_indirect':
- try:
- form = DW_FORM_raw2name[raw_value]
- except KeyError as err:
- raise DWARFError(
- 'Found DW_FORM_indirect with unknown raw_value=' +
- str(raw_value))
-
+ form = raw_value
raw_value = struct_parse(
- self.cu.structs.Dwarf_dw_form[form], self.stream)
+ structs.Dwarf_dw_form[form], self.stream)
# Let's hope this doesn't get too deep :-)
return self._translate_attr_value(form, raw_value)
else:
value = raw_value
return value
+
+
diff --git a/chromium/third_party/pyelftools/elftools/dwarf/dwarfinfo.py b/chromium/third_party/pyelftools/elftools/dwarf/dwarfinfo.py
index 1995fc88f77..9aa2f520e6d 100644
--- a/chromium/third_party/pyelftools/elftools/dwarf/dwarfinfo.py
+++ b/chromium/third_party/pyelftools/elftools/dwarf/dwarfinfo.py
@@ -21,7 +21,7 @@ from .ranges import RangeLists
# Describes a debug section
-#
+#
# stream: a stream object containing the data of this section
# name: section name in the container file
# global_offset: the global offset of the section in its container file
@@ -30,7 +30,7 @@ from .ranges import RangeLists
# 'name' and 'global_offset' are for descriptional purposes only and
# aren't strictly required for the DWARF parsing to work.
#
-DebugSectionDescriptor = namedtuple('DebugSectionDescriptor',
+DebugSectionDescriptor = namedtuple('DebugSectionDescriptor',
'stream name global_offset size')
@@ -51,7 +51,7 @@ DwarfConfig = namedtuple('DwarfConfig',
class DWARFInfo(object):
- """ Acts also as a "context" to other major objects, bridging between
+ """ Acts also as a "context" to other major objects, bridging between
various parts of the debug infromation.
"""
def __init__(self,
@@ -59,7 +59,6 @@ class DWARFInfo(object):
debug_info_sec,
debug_abbrev_sec,
debug_frame_sec,
- eh_frame_sec,
debug_str_sec,
debug_loc_sec,
debug_ranges_sec,
@@ -69,20 +68,19 @@ class DWARFInfo(object):
debug_*_sec:
DebugSectionDescriptor for a section. Pass None for sections
- that don't exist. These arguments are best given with
+ that don't exist. These arguments are best given with
keyword syntax.
"""
self.config = config
self.debug_info_sec = debug_info_sec
self.debug_abbrev_sec = debug_abbrev_sec
self.debug_frame_sec = debug_frame_sec
- self.eh_frame_sec = eh_frame_sec
self.debug_str_sec = debug_str_sec
self.debug_loc_sec = debug_loc_sec
self.debug_ranges_sec = debug_ranges_sec
self.debug_line_sec = debug_line_sec
- # This is the DWARFStructs the context uses, so it doesn't depend on
+ # This is the DWARFStructs the context uses, so it doesn't depend on
# DWARF format and address_size (these are determined per CU) - set them
# to default values.
self.structs = DWARFStructs(
@@ -121,7 +119,7 @@ class DWARFInfo(object):
return self._abbrevtable_cache[offset]
def get_string_from_table(self, offset):
- """ Obtain a string from the string table section, given an offset
+ """ Obtain a string from the string table section, given an offset
relative to the section.
"""
return parse_cstring_from_stream(self.debug_str_sec.stream, offset)
@@ -141,12 +139,12 @@ class DWARFInfo(object):
return None
def has_CFI(self):
- """ Does this dwarf info have a dwarf_frame CFI section?
+ """ Does this dwarf info has a CFI section?
"""
return self.debug_frame_sec is not None
def CFI_entries(self):
- """ Get a list of dwarf_frame CFI entries from the .debug_frame section.
+ """ Get a list of CFI entries from the .debug_frame section.
"""
cfi = CallFrameInfo(
stream=self.debug_frame_sec.stream,
@@ -154,37 +152,17 @@ class DWARFInfo(object):
base_structs=self.structs)
return cfi.get_entries()
- def has_EH_CFI(self):
- """ Does this dwarf info have a eh_frame CFI section?
- """
- return self.eh_frame_sec is not None
-
- def EH_CFI_entries(self):
- """ Get a list of eh_frame CFI entries from the .eh_frame section.
- """
- cfi = CallFrameInfo(
- stream=self.eh_frame_sec.stream,
- size=self.eh_frame_sec.size,
- base_structs=self.structs)
- return cfi.get_entries()
-
def location_lists(self):
""" Get a LocationLists object representing the .debug_loc section of
the DWARF data, or None if this section doesn't exist.
"""
- if self.debug_loc_sec:
- return LocationLists(self.debug_loc_sec.stream, self.structs)
- else:
- return None
+ return LocationLists(self.debug_loc_sec.stream, self.structs)
def range_lists(self):
""" Get a RangeLists object representing the .debug_ranges section of
the DWARF data, or None if this section doesn't exist.
"""
- if self.debug_ranges_sec:
- return RangeLists(self.debug_ranges_sec.stream, self.structs)
- else:
- return None
+ return RangeLists(self.debug_ranges_sec.stream, self.structs)
#------ PRIVATE ------#
@@ -197,18 +175,18 @@ class DWARFInfo(object):
# Compute the offset of the next CU in the section. The unit_length
# field of the CU header contains its size not including the length
# field itself.
- offset = ( offset +
- cu['unit_length'] +
+ offset = ( offset +
+ cu['unit_length'] +
cu.structs.initial_length_field_size())
yield cu
-
+
def _parse_CU_at_offset(self, offset):
""" Parse and return a CU at the given offset in the debug_info stream.
"""
# Section 7.4 (32-bit and 64-bit DWARF Formats) of the DWARF spec v3
- # states that the first 32-bit word of the CU header determines
+ # states that the first 32-bit word of the CU header determines
# whether the CU is represented with 32-bit or 64-bit DWARF format.
- #
+ #
# So we peek at the first word in the CU header to determine its
# dwarf format. Based on it, we then create a new DWARFStructs
# instance suitable for this CU and use it to parse the rest.
@@ -227,15 +205,15 @@ class DWARFInfo(object):
little_endian=self.config.little_endian,
dwarf_format=dwarf_format,
address_size=4)
-
+
cu_header = struct_parse(
cu_structs.Dwarf_CU_header, self.debug_info_sec.stream, offset)
if cu_header['address_size'] == 8:
cu_structs = DWARFStructs(
little_endian=self.config.little_endian,
dwarf_format=dwarf_format,
- address_size=8)
-
+ address_size=8)
+
cu_die_offset = self.debug_info_sec.stream.tell()
dwarf_assert(
self._is_supported_version(cu_header['version']),
@@ -246,11 +224,11 @@ class DWARFInfo(object):
structs=cu_structs,
cu_offset=offset,
cu_die_offset=cu_die_offset)
-
+
def _is_supported_version(self, version):
""" DWARF version supported by this parser
"""
- return 2 <= version <= 4
+ return 2 <= version <= 3
def _parse_line_program_at_offset(self, debug_line_offset, structs):
""" Given an offset to the .debug_line section, parse the line program
diff --git a/chromium/third_party/pyelftools/elftools/dwarf/enums.py b/chromium/third_party/pyelftools/elftools/dwarf/enums.py
index d576dffb505..1338725701d 100644
--- a/chromium/third_party/pyelftools/elftools/dwarf/enums.py
+++ b/chromium/third_party/pyelftools/elftools/dwarf/enums.py
@@ -7,7 +7,6 @@
# This code is in the public domain
#-------------------------------------------------------------------------------
from ..construct import Pass
-from ..common.py3compat import iteritems
ENUM_DW_TAG = dict(
@@ -53,12 +52,10 @@ ENUM_DW_TAG = dict(
DW_TAG_namelist_items = 0x2c,
DW_TAG_packed_type = 0x2d,
DW_TAG_subprogram = 0x2e,
-
- # The DWARF standard defines these as _parameter, not _param, but we
- # maintain compatibility with readelf.
+ DW_TAG_template_type_parameter = 0x2f,
DW_TAG_template_type_param = 0x2f,
+ DW_TAG_template_value_parameter = 0x30,
DW_TAG_template_value_param = 0x30,
-
DW_TAG_thrown_type = 0x31,
DW_TAG_try_block = 0x32,
DW_TAG_variant_part = 0x33,
@@ -188,9 +185,7 @@ ENUM_DW_AT = dict(
DW_AT_main_subprogram = 0x6a,
DW_AT_data_bit_offset = 0x6b,
DW_AT_const_expr = 0x6c,
- DW_AT_enum_class = 0x6d,
- DW_AT_linkage_name = 0x6e,
-
+
DW_AT_MIPS_fde = 0x2001,
DW_AT_MIPS_loop_begin = 0x2002,
DW_AT_MIPS_tail_loop_begin = 0x2003,
@@ -202,46 +197,8 @@ ENUM_DW_AT = dict(
DW_AT_MIPS_abstract_name = 0x2009,
DW_AT_MIPS_clone_origin = 0x200a,
DW_AT_MIPS_has_inlines = 0x200b,
- DW_AT_MIPS_stride_byte = 0x200c,
- DW_AT_MIPS_stride_elem = 0x200d,
- DW_AT_MIPS_ptr_dopetype = 0x200e,
- DW_AT_MIPS_allocatable_dopetype = 0x200f,
- DW_AT_MIPS_assumed_shape_dopetype = 0x2010,
- DW_AT_MIPS_assumed_size = 0x2011,
-
- DW_AT_sf_names = 0x2101,
- DW_AT_src_info = 0x2102,
- DW_AT_mac_info = 0x2103,
- DW_AT_src_coords = 0x2104,
- DW_AT_body_begin = 0x2105,
- DW_AT_body_end = 0x2106,
- DW_AT_GNU_vector = 0x2107,
- DW_AT_GNU_template_name = 0x2110,
- DW_AT_GNU_call_site_value = 0x2111,
- DW_AT_GNU_call_site_data_value = 0x2112,
- DW_AT_GNU_call_site_target = 0x2113,
- DW_AT_GNU_call_site_target_clobbered = 0x2114,
- DW_AT_GNU_tail_call = 0x2115,
- DW_AT_GNU_all_tail_call_sites = 0x2116,
- DW_AT_GNU_all_call_sites = 0x2117,
- DW_AT_GNU_all_source_call_sites = 0x2118,
-
- DW_AT_APPLE_optimized = 0x3fe1,
- DW_AT_APPLE_flags = 0x3fe2,
- DW_AT_APPLE_isa = 0x3fe3,
- DW_AT_APPLE_block = 0x3fe4,
- DW_AT_APPLE_major_runtime_vers = 0x3fe5,
- DW_AT_APPLE_runtime_class = 0x3fe6,
- DW_AT_APPLE_omit_frame_ptr = 0x3fe7,
- DW_AT_APPLE_property_name = 0x3fe8,
- DW_AT_APPLE_property_getter = 0x3fe9,
- DW_AT_APPLE_property_setter = 0x3fea,
- DW_AT_APPLE_property_attribute = 0x3feb,
- DW_AT_APPLE_objc_complete_type = 0x3fec,
- DW_AT_APPLE_property = 0x3fed,
-
- _default_ = Pass,
+ _default_ = Pass,
)
@@ -268,16 +225,7 @@ ENUM_DW_FORM = dict(
DW_FORM_ref8 = 0x14,
DW_FORM_ref_udata = 0x15,
DW_FORM_indirect = 0x16,
- DW_FORM_sec_offset = 0x17,
- DW_FORM_exprloc = 0x18,
- DW_FORM_flag_present = 0x19,
- DW_FORM_ref_sig8 = 0x20,
- DW_FORM_GNU_strp_alt = 0x1f21,
- DW_FORM_GNU_ref_alt = 0x1f20,
_default_ = Pass,
)
-# Inverse mapping for ENUM_DW_FORM
-DW_FORM_raw2name = dict((v, k) for k, v in iteritems(ENUM_DW_FORM))
-
diff --git a/chromium/third_party/pyelftools/elftools/dwarf/lineprogram.py b/chromium/third_party/pyelftools/elftools/dwarf/lineprogram.py
index 810e60398cb..ee5193ee868 100644
--- a/chromium/third_party/pyelftools/elftools/dwarf/lineprogram.py
+++ b/chromium/third_party/pyelftools/elftools/dwarf/lineprogram.py
@@ -215,10 +215,10 @@ class LineProgram(object):
add_entry_old_state(opcode, [operand])
elif opcode == DW_LNS_negate_stmt:
state.is_stmt = not state.is_stmt
- add_entry_old_state(opcode, [])
+ add_entry_old_state(opcode, [operand])
elif opcode == DW_LNS_set_basic_block:
state.basic_block = True
- add_entry_old_state(opcode, [])
+ add_entry_old_state(opcode, [operand])
elif opcode == DW_LNS_const_add_pc:
adjusted_opcode = 255 - self['opcode_base']
address_addend = ((adjusted_opcode // self['line_range']) *
diff --git a/chromium/third_party/pyelftools/elftools/dwarf/structs.py b/chromium/third_party/pyelftools/elftools/dwarf/structs.py
index 39e4815b2f4..cfb2515a0ab 100644
--- a/chromium/third_party/pyelftools/elftools/dwarf/structs.py
+++ b/chromium/third_party/pyelftools/elftools/dwarf/structs.py
@@ -11,7 +11,7 @@ from ..construct import (
UBInt8, UBInt16, UBInt32, UBInt64, ULInt8, ULInt16, ULInt32, ULInt64,
SBInt8, SBInt16, SBInt32, SBInt64, SLInt8, SLInt16, SLInt32, SLInt64,
Adapter, Struct, ConstructError, If, RepeatUntil, Field, Rename, Enum,
- Array, PrefixedArray, CString, Embed, StaticField
+ Array, PrefixedArray, CString, Embed,
)
from ..common.construct_utils import RepeatUntilExcluding
@@ -19,39 +19,39 @@ from .enums import *
class DWARFStructs(object):
- """ Exposes Construct structs suitable for parsing information from DWARF
+ """ Exposes Construct structs suitable for parsing information from DWARF
sections. Each compile unit in DWARF info can have its own structs
- object. Keep in mind that these structs have to be given a name (by
+ object. Keep in mind that these structs have to be given a name (by
calling them with a name) before being used for parsing (like other
Construct structs). Those that should be used without a name are marked
by (+).
-
+
Accessible attributes (mostly as described in chapter 7 of the DWARF
spec v3):
-
+
Dwarf_[u]int{8,16,32,64):
Data chunks of the common sizes
-
+
Dwarf_offset:
32-bit or 64-bit word, depending on dwarf_format
-
+
Dwarf_target_addr:
32-bit or 64-bit word, depending on address size
-
+
Dwarf_initial_length:
"Initial length field" encoding
section 7.4
-
+
Dwarf_{u,s}leb128:
ULEB128 and SLEB128 variable-length encoding
-
+
Dwarf_CU_header (+):
Compilation unit header
-
+
Dwarf_abbrev_declaration (+):
Abbreviation table declaration - doesn't include the initial
code, only the contents.
-
+
Dwarf_dw_form (+):
A dictionary mapping 'DW_FORM_*' keys into construct Structs
that parse such forms. These Structs have already been given
@@ -62,7 +62,7 @@ class DWARFStructs(object):
Dwarf_lineprog_file_entry (+):
A single file entry in a line program header or instruction
-
+
Dwarf_CIE_header (+):
A call-frame CIE
@@ -71,27 +71,22 @@ class DWARFStructs(object):
See also the documentation of public methods.
"""
- def __init__(self,
- little_endian, dwarf_format, address_size, dwarf_version=2):
- """ dwarf_version:
- Numeric DWARF version
-
- little_endian:
+ def __init__(self, little_endian, dwarf_format, address_size):
+ """ little_endian:
True if the file is little endian, False if big
-
+
dwarf_format:
DWARF Format: 32 or 64-bit (see spec section 7.4)
-
+
address_size:
- Target machine address size, in bytes (4 or 8). (See spec
+ Target machine address size, in bytes (4 or 8). (See spec
section 7.5.1)
"""
assert dwarf_format == 32 or dwarf_format == 64
assert address_size == 8 or address_size == 4
self.little_endian = little_endian
- self.dwarf_format = dwarf_format
+ self.dwarf_format = dwarf_format
self.address_size = address_size
- self.dwarf_version = dwarf_version
self._create_structs()
def initial_length_field_size(self):
@@ -136,7 +131,7 @@ class DWARFStructs(object):
def _create_initial_length(self):
def _InitialLength(name):
# Adapts a Struct that parses forward a full initial length field.
- # Only if the first word is the continuation value, the second
+ # Only if the first word is the continuation value, the second
# word is parsed from the stream.
#
return _InitialLengthAdapter(
@@ -157,13 +152,13 @@ class DWARFStructs(object):
self.Dwarf_uint16('version'),
self.Dwarf_offset('debug_abbrev_offset'),
self.Dwarf_uint8('address_size'))
-
+
def _create_abbrev_declaration(self):
self.Dwarf_abbrev_declaration = Struct('Dwarf_abbrev_entry',
Enum(self.Dwarf_uleb128('tag'), **ENUM_DW_TAG),
Enum(self.Dwarf_uint8('children_flag'), **ENUM_DW_CHILDREN),
RepeatUntilExcluding(
- lambda obj, ctx:
+ lambda obj, ctx:
obj.name == 'DW_AT_null' and obj.form == 'DW_FORM_null',
Struct('attr_spec',
Enum(self.Dwarf_uleb128('name'), **ENUM_DW_AT),
@@ -172,12 +167,12 @@ class DWARFStructs(object):
def _create_dw_form(self):
self.Dwarf_dw_form = dict(
DW_FORM_addr=self.Dwarf_target_addr(''),
-
+
DW_FORM_block1=self._make_block_struct(self.Dwarf_uint8),
DW_FORM_block2=self._make_block_struct(self.Dwarf_uint16),
DW_FORM_block4=self._make_block_struct(self.Dwarf_uint32),
DW_FORM_block=self._make_block_struct(self.Dwarf_uleb128),
-
+
# All DW_FORM_data<n> forms are assumed to be unsigned
DW_FORM_data1=self.Dwarf_uint8(''),
DW_FORM_data2=self.Dwarf_uint16(''),
@@ -185,29 +180,19 @@ class DWARFStructs(object):
DW_FORM_data8=self.Dwarf_uint64(''),
DW_FORM_sdata=self.Dwarf_sleb128(''),
DW_FORM_udata=self.Dwarf_uleb128(''),
-
+
DW_FORM_string=CString(''),
DW_FORM_strp=self.Dwarf_offset(''),
DW_FORM_flag=self.Dwarf_uint8(''),
-
+
DW_FORM_ref1=self.Dwarf_uint8(''),
DW_FORM_ref2=self.Dwarf_uint16(''),
DW_FORM_ref4=self.Dwarf_uint32(''),
DW_FORM_ref8=self.Dwarf_uint64(''),
DW_FORM_ref_udata=self.Dwarf_uleb128(''),
DW_FORM_ref_addr=self.Dwarf_offset(''),
-
+
DW_FORM_indirect=self.Dwarf_uleb128(''),
-
- # New forms in DWARFv4
- DW_FORM_flag_present = StaticField('', 0),
- DW_FORM_sec_offset = self.Dwarf_offset(''),
- DW_FORM_exprloc = self._make_block_struct(self.Dwarf_uleb128),
- DW_FORM_ref_sig8 = self.Dwarf_offset(''),
-
- DW_FORM_GNU_strp_alt=self.Dwarf_offset(''),
- DW_FORM_GNU_ref_alt=self.Dwarf_offset(''),
- DW_AT_GNU_all_call_sites=self.Dwarf_uleb128(''),
)
def _create_lineprog_header(self):
@@ -230,7 +215,7 @@ class DWARFStructs(object):
self.Dwarf_int8('line_base'),
self.Dwarf_uint8('line_range'),
self.Dwarf_uint8('opcode_base'),
- Array(lambda ctx: ctx['opcode_base'] - 1,
+ Array(lambda ctx: ctx['opcode_base'] - 1,
self.Dwarf_uint8('standard_opcode_lengths')),
RepeatUntilExcluding(
lambda obj, ctx: obj == b'',
@@ -241,27 +226,14 @@ class DWARFStructs(object):
)
def _create_callframe_entry_headers(self):
- # The CIE header was modified in DWARFv4.
- if self.dwarf_version == 4:
- self.Dwarf_CIE_header = Struct('Dwarf_CIE_header',
- self.Dwarf_initial_length('length'),
- self.Dwarf_offset('CIE_id'),
- self.Dwarf_uint8('version'),
- CString('augmentation'),
- self.Dwarf_uint8('address_size'),
- self.Dwarf_uint8('segment_size'),
- self.Dwarf_uleb128('code_alignment_factor'),
- self.Dwarf_sleb128('data_alignment_factor'),
- self.Dwarf_uleb128('return_address_register'))
- else:
- self.Dwarf_CIE_header = Struct('Dwarf_CIE_header',
- self.Dwarf_initial_length('length'),
- self.Dwarf_offset('CIE_id'),
- self.Dwarf_uint8('version'),
- CString('augmentation'),
- self.Dwarf_uleb128('code_alignment_factor'),
- self.Dwarf_sleb128('data_alignment_factor'),
- self.Dwarf_uleb128('return_address_register'))
+ self.Dwarf_CIE_header = Struct('Dwarf_CIE_header',
+ self.Dwarf_initial_length('length'),
+ self.Dwarf_offset('CIE_id'),
+ self.Dwarf_uint8('version'),
+ CString('augmentation'),
+ self.Dwarf_uleb128('code_alignment_factor'),
+ self.Dwarf_sleb128('data_alignment_factor'),
+ self.Dwarf_uleb128('return_address_register'))
self.Dwarf_FDE_header = Struct('Dwarf_FDE_header',
self.Dwarf_initial_length('length'),
@@ -270,7 +242,7 @@ class DWARFStructs(object):
self.Dwarf_target_addr('address_range'))
def _make_block_struct(self, length_field):
- """ Create a struct for DW_FORM_block<size>
+ """ Create a struct for DW_FORM_block<size>
"""
return PrefixedArray(
subcon=self.Dwarf_uint8('elem'),
diff --git a/chromium/third_party/pyelftools/elftools/elf/constants.py b/chromium/third_party/pyelftools/elftools/elf/constants.py
index b41f35a96f4..df75e16fe0e 100644
--- a/chromium/third_party/pyelftools/elftools/elf/constants.py
+++ b/chromium/third_party/pyelftools/elftools/elf/constants.py
@@ -6,26 +6,6 @@
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-
-class E_FLAGS(object):
- """ Flag values for the e_flags field of the ELF header
- """
- EF_ARM_EABIMASK=0xFF000000
- EF_ARM_EABI_VER1=0x01000000
- EF_ARM_EABI_VER2=0x02000000
- EF_ARM_EABI_VER3=0x03000000
- EF_ARM_EABI_VER4=0x04000000
- EF_ARM_EABI_VER5=0x05000000
- EF_ARM_GCCMASK=0x00400FFF
- EF_ARM_HASENTRY=0x02
- EF_ARM_SYMSARESORTED=0x04
- EF_ARM_DYNSYMSUSESEGIDX=0x8
- EF_ARM_MAPSYMSFIRST=0x10
- EF_ARM_LE8=0x00400000
- EF_ARM_BE8=0x00800000
- EF_ARM_ABI_FLOAT_SOFT=0x00000200
- EF_ARM_ABI_FLOAT_HARD=0x00000400
-
class SHN_INDICES(object):
""" Special section indices
"""
@@ -65,25 +45,3 @@ class P_FLAGS(object):
PF_MASKOS=0x00FF0000
PF_MASKPROC=0xFF000000
-
-# symbol info flags for entries
-# in the .SUNW_syminfo section
-class SUNW_SYMINFO_FLAGS(object):
- """ Flags for the si_flags field of entries
- in the .SUNW_syminfo section
- """
- SYMINFO_FLG_DIRECT=0x1
- SYMINFO_FLG_FILTER=0x2
- SYMINFO_FLG_COPY=0x4
- SYMINFO_FLG_LAZYLOAD=0x8
- SYMINFO_FLG_DIRECTBIND=0x10
- SYMINFO_FLG_NOEXTDIRECT=0x20
- SYMINFO_FLG_AUXILIARY=0x40
- SYMINFO_FLG_INTERPOSE=0x80
- SYMINFO_FLG_CAP=0x100
- SYMINFO_FLG_DEFERRED=0x200
-
-class VER_FLAGS(object):
- VER_FLG_BASE=0x1
- VER_FLG_WEAK=0x2
- VER_FLG_INFO=0x4
diff --git a/chromium/third_party/pyelftools/elftools/elf/descriptions.py b/chromium/third_party/pyelftools/elftools/elf/descriptions.py
index 6d108c2a340..2cde281b21e 100644
--- a/chromium/third_party/pyelftools/elftools/elf/descriptions.py
+++ b/chromium/third_party/pyelftools/elftools/elf/descriptions.py
@@ -6,10 +6,8 @@
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
-from .enums import (
- ENUM_D_TAG, ENUM_E_VERSION, ENUM_RELOC_TYPE_i386, ENUM_RELOC_TYPE_x64,
- ENUM_RELOC_TYPE_ARM, ENUM_RELOC_TYPE_AARCH64)
-from .constants import P_FLAGS, SH_FLAGS, SUNW_SYMINFO_FLAGS, VER_FLAGS
+from .enums import ENUM_E_VERSION, ENUM_RELOC_TYPE_i386, ENUM_RELOC_TYPE_x64
+from .constants import P_FLAGS, SH_FLAGS
from ..common.py3compat import iteritems
@@ -24,7 +22,7 @@ def describe_ei_version(x):
if x == 'EV_CURRENT':
s += ' (current)'
return s
-
+
def describe_ei_osabi(x):
return _DESCR_EI_OSABI.get(x, _unknown)
@@ -43,7 +41,7 @@ def describe_p_type(x):
def describe_p_flags(x):
s = ''
for flag in (P_FLAGS.PF_R, P_FLAGS.PF_W, P_FLAGS.PF_X):
- s += _DESCR_P_FLAGS[flag] if (x & flag) else ' '
+ s += _DESCR_P_FLAGS[flag] if (x & flag) else ' '
return s
def describe_sh_type(x):
@@ -77,43 +75,14 @@ def describe_reloc_type(x, elffile):
return _DESCR_RELOC_TYPE_i386.get(x, _unknown)
elif arch == 'x64':
return _DESCR_RELOC_TYPE_x64.get(x, _unknown)
- elif arch == 'ARM':
- return _DESCR_RELOC_TYPE_ARM.get(x, _unknown)
- elif arch == 'AArch64':
- return _DESCR_RELOC_TYPE_AARCH64.get(x, _unknown)
else:
return 'unrecognized: %-7x' % (x & 0xFFFFFFFF)
-def describe_dyn_tag(x):
- return _DESCR_D_TAG.get(x, _unknown)
-
-
-def describe_syminfo_flags(x):
- return ''.join(_DESCR_SYMINFO_FLAGS[flag] for flag in (
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_CAP,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_DIRECT,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_FILTER,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_AUXILIARY,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_DIRECTBIND,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_COPY,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_LAZYLOAD,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_NOEXTDIRECT,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_INTERPOSE,
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_DEFERRED) if x & flag)
-
-def describe_symbol_boundto(x):
- return _DESCR_SYMINFO_BOUNDTO.get(x, '%3s' % x)
-
-def describe_ver_flags(x):
- return ' | '.join(_DESCR_VER_FLAGS[flag] for flag in (
- VER_FLAGS.VER_FLG_WEAK,
- VER_FLAGS.VER_FLG_BASE,
- VER_FLAGS.VER_FLG_INFO) if x & flag)
#-------------------------------------------------------------------------------
_unknown = '<unknown>'
-
+
_DESCR_EI_CLASS = dict(
ELFCLASSNONE='none',
ELFCLASS32='ELF32',
@@ -169,9 +138,6 @@ _DESCR_E_MACHINE = dict(
EM_IA_64='Intel IA-64',
EM_X86_64='Advanced Micro Devices X86-64',
EM_AVR='Atmel AVR 8-bit microcontroller',
- EM_ARM='ARM',
- EM_AARCH64='AArch64',
- EM_BLAFKIN='Analog Devices Blackfin',
RESERVED='RESERVED',
)
@@ -186,11 +152,6 @@ _DESCR_P_TYPE = dict(
PT_GNU_EH_FRAME='GNU_EH_FRAME',
PT_GNU_STACK='GNU_STACK',
PT_GNU_RELRO='GNU_RELRO',
- PT_ARM_ARCHEXT='ARM_ARCHEXT',
- PT_ARM_EXIDX='ARM_EXIDX',
- PT_ARM_UNWIND='ARM_UNWIND',
- PT_AARCH64_ARCHEXT='AARCH64_ARCHEXT',
- PT_AARCH64_UNWIND='AARCH64_UNWIND',
)
_DESCR_P_FLAGS = {
@@ -222,10 +183,6 @@ _DESCR_SH_TYPE = dict(
SHT_GNU_verneed='VERNEED',
SHT_GNU_versym='VERSYM',
SHT_GNU_LIBLIST='GNU_LIBLIST',
- SHT_ARM_EXIDX='ARM_EXIDX',
- SHT_ARM_PREEMPTMAP='ARM_PREEMPTMAP',
- SHT_ARM_ATTRIBUTES='ARM_ATTRIBUTES',
- SHT_ARM_DEBUGOVERLAY='ARM_DEBUGOVERLAY',
)
_DESCR_SH_FLAGS = {
@@ -265,10 +222,7 @@ _DESCR_ST_VISIBILITY = dict(
STV_DEFAULT='DEFAULT',
STV_INTERNAL='INTERNAL',
STV_HIDDEN='HIDDEN',
- STV_PROTECTED='PROTECTED',
- STV_EXPORTED='EXPORTED',
- STV_SINGLETON='SINGLETON',
- STV_ELIMINATE='ELIMINATE',
+ STD_PROTECTED='PROTECTED',
)
_DESCR_ST_SHNDX = dict(
@@ -277,44 +231,10 @@ _DESCR_ST_SHNDX = dict(
SHN_COMMON='COM',
)
-_DESCR_SYMINFO_FLAGS = {
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_DIRECT: 'D',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_DIRECTBIND: 'B',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_COPY: 'C',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_LAZYLOAD: 'L',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_NOEXTDIRECT: 'N',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_AUXILIARY: 'A',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_FILTER: 'F',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_INTERPOSE: 'I',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_CAP: 'S',
- SUNW_SYMINFO_FLAGS.SYMINFO_FLG_DEFERRED: 'P',
-}
-
-_DESCR_SYMINFO_BOUNDTO = dict(
- SYMINFO_BT_SELF='<self>',
- SYMINFO_BT_PARENT='<parent>',
- SYMINFO_BT_NONE='',
- SYMINFO_BT_EXTERN='<extern>',
-)
-
-_DESCR_VER_FLAGS = {
- 0: '',
- VER_FLAGS.VER_FLG_BASE: 'BASE',
- VER_FLAGS.VER_FLG_WEAK: 'WEAK',
- VER_FLAGS.VER_FLG_INFO: 'INFO',
-}
-
_DESCR_RELOC_TYPE_i386 = dict(
(v, k) for k, v in iteritems(ENUM_RELOC_TYPE_i386))
_DESCR_RELOC_TYPE_x64 = dict(
(v, k) for k, v in iteritems(ENUM_RELOC_TYPE_x64))
-_DESCR_RELOC_TYPE_ARM = dict(
- (v, k) for k, v in iteritems(ENUM_RELOC_TYPE_ARM))
-
-_DESCR_RELOC_TYPE_AARCH64 = dict(
- (v, k) for k, v in iteritems(ENUM_RELOC_TYPE_AARCH64))
-_DESCR_D_TAG = dict(
- (v, k) for k, v in iteritems(ENUM_D_TAG))
diff --git a/chromium/third_party/pyelftools/elftools/elf/dynamic.py b/chromium/third_party/pyelftools/elftools/elf/dynamic.py
index 9f985c20037..2292470baa9 100644
--- a/chromium/third_party/pyelftools/elftools/elf/dynamic.py
+++ b/chromium/third_party/pyelftools/elftools/elf/dynamic.py
@@ -10,45 +10,26 @@ import itertools
from .sections import Section
from .segments import Segment
-from ..common.exceptions import ELFError
-from ..common.utils import struct_parse, parse_cstring_from_stream
+from ..common.utils import struct_parse
-
-class _DynamicStringTable(object):
- """ Bare string table based on values found via ELF dynamic tags and
- loadable segments only. Good enough for get_string() only.
- """
- def __init__(self, stream, table_offset):
- self._stream = stream
- self._table_offset = table_offset
-
- def get_string(self, offset):
- """ Get the string stored at the given offset in this string table.
- """
- return parse_cstring_from_stream(self._stream,
- self._table_offset + offset)
+from enums import ENUM_D_TAG
class DynamicTag(object):
""" Dynamic Tag object - representing a single dynamic tag entry from a
dynamic section.
- Allows dictionary-like access to the dynamic structure. For special
- tags (those listed in the _HANDLED_TAGS set below), creates additional
- attributes for convenience. For example, .soname will contain the actual
- value of DT_SONAME (fetched from the dynamic symbol table).
+ Similarly to Section objects, allows dictionary-like access to the
+ dynamic tag.
"""
- _HANDLED_TAGS = frozenset(
- ['DT_NEEDED', 'DT_RPATH', 'DT_RUNPATH', 'DT_SONAME',
- 'DT_SUNW_FILTER'])
- def __init__(self, entry, stringtable):
- if stringtable is None:
- raise ELFError('Creating DynamicTag without string table')
+ _HANDLED_TAGS = frozenset(['DT_NEEDED', 'DT_RPATH', 'DT_RUNPATH'])
+
+ def __init__(self, entry, elffile):
self.entry = entry
if entry.d_tag in self._HANDLED_TAGS:
- setattr(self, entry.d_tag[3:].lower(),
- stringtable.get_string(self.entry.d_val))
+ dynstr = elffile.get_section_by_name('.dynstr')
+ setattr(self, entry.d_tag[3:].lower(), dynstr.get_string(self.entry.d_val))
def __getitem__(self, name):
""" Implement dict-like access to entries
@@ -67,78 +48,35 @@ class DynamicTag(object):
class Dynamic(object):
- """ Shared functionality between dynamic sections and segments.
- """
- def __init__(self, stream, elffile, stringtable, position):
+ def __init__(self, stream, elffile, position):
self._stream = stream
self._elffile = elffile
self._elfstructs = elffile.structs
- self._num_tags = -1
+ self._num_tags = -1;
self._offset = position
self._tagsize = self._elfstructs.Elf_Dyn.sizeof()
- # Do not access this directly yourself; use _get_stringtable() instead.
- self._stringtable = stringtable
-
- def _get_stringtable(self):
- """ Return a string table for looking up dynamic tag related strings.
-
- This won't be a "full" string table object, but will at least
- support the get_string() function.
- """
- if self._stringtable:
- return self._stringtable
-
- # If the ELF has stripped its section table (which is unusual, but
- # perfectly valid), we need to use the dynamic tags to locate the
- # dynamic string table.
- strtab = None
- for tag in self._iter_tags(type='DT_STRTAB'):
- strtab = tag['d_val']
- break
- # If we found a dynamic string table, locate the offset in the file
- # by using the program headers.
- if strtab:
- table_offset = next(self._elffile.address_offsets(strtab), None)
- if table_offset is not None:
- self._stringtable = _DynamicStringTable(self._stream, table_offset)
- return self._stringtable
-
- # That didn't work for some reason. Let's use the section header
- # even though this ELF is super weird.
- self._stringtable = self._elffile.get_section_by_name(b'.dynstr')
- return self._stringtable
-
- def _iter_tags(self, type=None):
- """ Yield all raw tags (limit to |type| if specified)
+ def iter_tags(self, type=None):
+ """ Yield all tags (limit to |type| if specified)
"""
for n in itertools.count():
- tag = self._get_tag(n)
- if type is None or tag['d_tag'] == type:
+ tag = self.get_tag(n)
+ if type is None or tag.entry.d_tag == type:
yield tag
- if tag['d_tag'] == 'DT_NULL':
+ if tag.entry.d_tag == 'DT_NULL':
break
- def iter_tags(self, type=None):
- """ Yield all tags (limit to |type| if specified)
- """
- for tag in self._iter_tags(type=type):
- yield DynamicTag(tag, self._get_stringtable())
-
- def _get_tag(self, n):
- """ Get the raw tag at index #n from the file
+ def get_tag(self, n):
+ """ Get the tag at index #n from the file (DynamicTag object)
"""
offset = self._offset + n * self._tagsize
- return struct_parse(
+ entry = struct_parse(
self._elfstructs.Elf_Dyn,
self._stream,
stream_pos=offset)
+ return DynamicTag(entry, self._elffile)
- def get_tag(self, n):
- """ Get the tag at index #n from the file (DynamicTag object)
- """
- return DynamicTag(self._get_tag(n), self._get_stringtable())
-
+ @property
def num_tags(self):
""" Number of dynamic tags in the file
"""
@@ -148,8 +86,8 @@ class Dynamic(object):
for n in itertools.count():
tag = self.get_tag(n)
if tag.entry.d_tag == 'DT_NULL':
- self._num_tags = n + 1
- return self._num_tags
+ self._num_tags = n
+ return n
class DynamicSection(Section, Dynamic):
@@ -157,25 +95,12 @@ class DynamicSection(Section, Dynamic):
"""
def __init__(self, header, name, stream, elffile):
Section.__init__(self, header, name, stream)
- stringtable = elffile.get_section(header['sh_link'])
- Dynamic.__init__(self, stream, elffile, stringtable, self['sh_offset'])
+ Dynamic.__init__(self, stream, elffile, self['sh_offset'])
class DynamicSegment(Segment, Dynamic):
""" ELF dynamic table segment. Knows how to process the list of tags.
"""
def __init__(self, header, stream, elffile):
- # The string table section to be used to resolve string names in
- # the dynamic tag array is the one pointed at by the sh_link field
- # of the dynamic section header.
- # So we must look for the dynamic section contained in the dynamic
- # segment, we do so by searching for the dynamic section whose content
- # is located at the same offset as the dynamic segment
- stringtable = None
- for section in elffile.iter_sections():
- if (isinstance(section, DynamicSection) and
- section['sh_offset'] == header['p_offset']):
- stringtable = elffile.get_section(section['sh_link'])
- break
Segment.__init__(self, header, stream)
- Dynamic.__init__(self, stream, elffile, stringtable, self['p_offset'])
+ Dynamic.__init__(self, stream, elffile, self['p_offset'])
diff --git a/chromium/third_party/pyelftools/elftools/elf/elffile.py b/chromium/third_party/pyelftools/elftools/elf/elffile.py
index 15aa07e7f95..e2bd904c26f 100644
--- a/chromium/third_party/pyelftools/elftools/elf/elffile.py
+++ b/chromium/third_party/pyelftools/elftools/elf/elffile.py
@@ -12,32 +12,29 @@ from ..common.utils import struct_parse, elf_assert
from ..construct import ConstructError
from .structs import ELFStructs
from .sections import (
- Section, StringTableSection, SymbolTableSection,
- SUNWSyminfoTableSection, NullSection)
+ Section, StringTableSection, SymbolTableSection, NullSection)
from .dynamic import DynamicSection, DynamicSegment
from .relocation import RelocationSection, RelocationHandler
-from .gnuversions import (
- GNUVerNeedSection, GNUVerDefSection,
- GNUVerSymSection)
from .segments import Segment, InterpSegment
+from .enums import ENUM_RELOC_TYPE_i386, ENUM_RELOC_TYPE_x64
from ..dwarf.dwarfinfo import DWARFInfo, DebugSectionDescriptor, DwarfConfig
class ELFFile(object):
""" Creation: the constructor accepts a stream (file-like object) with the
contents of an ELF file.
-
+
Accessible attributes:
stream:
The stream holding the data of the file - must be a binary
stream (bytes, not string).
- elfclass:
+ elfclass:
32 or 64 - specifies the word size of the target machine
-
+
little_endian:
- boolean - specifies the target machine's endianness
+ boolean - specifies the target machine's endianness
header:
the complete ELF file header
@@ -55,24 +52,24 @@ class ELFFile(object):
self.stream.seek(0)
self.e_ident_raw = self.stream.read(16)
-
+
self._file_stringtable_section = self._get_file_stringtable()
self._section_name_map = None
-
+
def num_sections(self):
""" Number of sections in the file
"""
return self['e_shnum']
-
+
def get_section(self, n):
""" Get the section at index #n from the file (Section object or a
subclass)
"""
section_header = self._get_section_header(n)
return self._make_section(section_header)
-
+
def get_section_by_name(self, name):
- """ Get a section from the file, by name. Return None if no such
+ """ Get a section from the file, by name. Return None if no such
section exists.
"""
# The first time this method is called, construct a name to number
@@ -84,18 +81,18 @@ class ELFFile(object):
self._section_name_map[sec.name] = i
secnum = self._section_name_map.get(name, None)
return None if secnum is None else self.get_section(secnum)
-
+
def iter_sections(self):
""" Yield all the sections in the file
"""
for i in range(self.num_sections()):
yield self.get_section(i)
-
+
def num_segments(self):
""" Number of segments in the file
"""
return self['e_phnum']
-
+
def get_segment(self, n):
""" Get the segment at index #n from the file (Segment object)
"""
@@ -108,20 +105,8 @@ class ELFFile(object):
for i in range(self.num_segments()):
yield self.get_segment(i)
- def address_offsets(self, start, size=1):
- """ Yield a file offset for each ELF segment containing a memory region.
-
- A memory region is defined by the range [start...start+size). The
- offset of the region is yielded.
- """
- end = start + size
- for seg in self.iter_segments():
- if (start >= seg['p_vaddr'] and
- end <= seg['p_vaddr'] + seg['p_filesz']):
- yield start - seg['p_vaddr'] + seg['p_offset']
-
def has_dwarf_info(self):
- """ Check whether this file appears to have debugging information.
+ """ Check whether this file appears to have debugging information.
We assume that if it has the debug_info section, it has all theother
required sections as well.
"""
@@ -134,32 +119,30 @@ class ELFFile(object):
If relocate_dwarf_sections is True, relocations for DWARF sections
are looked up and applied.
"""
- # Expect that has_dwarf_info was called, so at least .debug_info is
- # present.
+ # Expect that has_dwarf_info was called, so at least .debug_info is
+ # present.
# Sections that aren't found will be passed as None to DWARFInfo.
#
debug_sections = {}
- for secname in (b'.debug_info', b'.debug_abbrev', b'.debug_str',
- b'.debug_line', b'.debug_frame',
- b'.debug_loc', b'.debug_ranges'):
+ for secname in (b'.debug_info', b'.debug_abbrev', b'.debug_str',
+ b'.debug_line', b'.debug_frame', b'.debug_loc',
+ b'.debug_ranges'):
section = self.get_section_by_name(secname)
if section is None:
debug_sections[secname] = None
else:
debug_sections[secname] = self._read_dwarf_section(
- section,
- relocate_dwarf_sections)
+ section,
+ relocate_dwarf_sections)
return DWARFInfo(
config=DwarfConfig(
little_endian=self.little_endian,
- default_address_size=self.elfclass // 8,
+ default_address_size=self.elfclass / 8,
machine_arch=self.get_machine_arch()),
debug_info_sec=debug_sections[b'.debug_info'],
debug_abbrev_sec=debug_sections[b'.debug_abbrev'],
debug_frame_sec=debug_sections[b'.debug_frame'],
- # TODO(eliben): reading of eh_frame is not hooked up yet
- eh_frame_sec=None,
debug_str_sec=debug_sections[b'.debug_str'],
debug_loc_sec=debug_sections[b'.debug_loc'],
debug_ranges_sec=debug_sections[b'.debug_ranges'],
@@ -167,16 +150,12 @@ class ELFFile(object):
def get_machine_arch(self):
""" Return the machine architecture, as detected from the ELF header.
- Not all architectures are supported at the moment.
+ At the moment the only supported architectures are x86 and x64.
"""
if self['e_machine'] == 'EM_X86_64':
return 'x64'
elif self['e_machine'] in ('EM_386', 'EM_486'):
return 'x86'
- elif self['e_machine'] == 'EM_ARM':
- return 'ARM'
- elif self['e_machine'] == 'EM_AARCH64':
- return 'AArch64'
else:
return '<unknown>'
@@ -191,7 +170,7 @@ class ELFFile(object):
""" Verify the ELF file and identify its class and endianness.
"""
# Note: this code reads the stream directly, without using ELFStructs,
- # since we don't yet know its exact format. ELF was designed to be
+ # since we don't yet know its exact format. ELF was designed to be
# read like this - its e_ident field is word-size and endian agnostic.
#
self.stream.seek(0)
@@ -213,17 +192,17 @@ class ELFFile(object):
self.little_endian = False
else:
raise ELFError('Invalid EI_DATA %s' % repr(ei_data))
-
+
def _section_offset(self, n):
""" Compute the offset of section #n in the file
"""
return self['e_shoff'] + n * self['e_shentsize']
-
+
def _segment_offset(self, n):
""" Compute the offset of segment #n in the file
"""
return self['e_phoff'] + n * self['e_phentsize']
-
+
def _make_segment(self, segment_header):
""" Create a Segment object of the appropriate type
"""
@@ -236,13 +215,13 @@ class ELFFile(object):
return Segment(segment_header, self.stream)
def _get_section_header(self, n):
- """ Find the header of section #n, parse it and return the struct
+ """ Find the header of section #n, parse it and return the struct
"""
return struct_parse(
self.structs.Elf_Shdr,
self.stream,
stream_pos=self._section_offset(n))
-
+
def _get_section_name(self, section_header):
""" Given a section header, find this section's name in the file's
string table
@@ -255,21 +234,13 @@ class ELFFile(object):
"""
name = self._get_section_name(section_header)
sectype = section_header['sh_type']
-
+
if sectype == 'SHT_STRTAB':
return StringTableSection(section_header, name, self.stream)
elif sectype == 'SHT_NULL':
return NullSection(section_header, name, self.stream)
- elif sectype in ('SHT_SYMTAB', 'SHT_DYNSYM', 'SHT_SUNW_LDYNSYM'):
+ elif sectype in ('SHT_SYMTAB', 'SHT_DYNSYM'):
return self._make_symbol_table_section(section_header, name)
- elif sectype == 'SHT_SUNW_syminfo':
- return self._make_sunwsyminfo_table_section(section_header, name)
- elif sectype == 'SHT_GNU_verneed':
- return self._make_gnu_verneed_section(section_header, name)
- elif sectype == 'SHT_GNU_verdef':
- return self._make_gnu_verdef_section(section_header, name)
- elif sectype == 'SHT_GNU_versym':
- return self._make_gnu_versym_section(section_header, name)
elif sectype in ('SHT_REL', 'SHT_RELA'):
return RelocationSection(
section_header, name, self.stream, self)
@@ -288,46 +259,6 @@ class ELFFile(object):
elffile=self,
stringtable=strtab_section)
- def _make_sunwsyminfo_table_section(self, section_header, name):
- """ Create a SUNWSyminfoTableSection
- """
- linked_strtab_index = section_header['sh_link']
- strtab_section = self.get_section(linked_strtab_index)
- return SUNWSyminfoTableSection(
- section_header, name, self.stream,
- elffile=self,
- symboltable=strtab_section)
-
- def _make_gnu_verneed_section(self, section_header, name):
- """ Create a GNUVerNeedSection
- """
- linked_strtab_index = section_header['sh_link']
- strtab_section = self.get_section(linked_strtab_index)
- return GNUVerNeedSection(
- section_header, name, self.stream,
- elffile=self,
- stringtable=strtab_section)
-
- def _make_gnu_verdef_section(self, section_header, name):
- """ Create a GNUVerDefSection
- """
- linked_strtab_index = section_header['sh_link']
- strtab_section = self.get_section(linked_strtab_index)
- return GNUVerDefSection(
- section_header, name, self.stream,
- elffile=self,
- stringtable=strtab_section)
-
- def _make_gnu_versym_section(self, section_header, name):
- """ Create a GNUVerSymSection
- """
- linked_strtab_index = section_header['sh_link']
- strtab_section = self.get_section(linked_strtab_index)
- return GNUVerSymSection(
- section_header, name, self.stream,
- elffile=self,
- symboltable=strtab_section)
-
def _get_segment_header(self, n):
""" Find the header of segment #n, parse it and return the struct
"""
@@ -335,7 +266,7 @@ class ELFFile(object):
self.structs.Elf_Phdr,
self.stream,
stream_pos=self._segment_offset(n))
-
+
def _get_file_stringtable(self):
""" Find the file's string table section
"""
diff --git a/chromium/third_party/pyelftools/elftools/elf/enums.py b/chromium/third_party/pyelftools/elftools/elf/enums.py
index 4aa449a8fe5..804fc45c806 100644
--- a/chromium/third_party/pyelftools/elftools/elf/enums.py
+++ b/chromium/third_party/pyelftools/elftools/elf/enums.py
@@ -47,7 +47,6 @@ ENUM_EI_OSABI = dict(
ELFOSABI_OPENVMS=13,
ELFOSABI_NSK=14,
ELFOSABI_AROS=15,
- ELFOSABI_ARM_AEABI=64,
ELFOSABI_ARM=97,
ELFOSABI_STANDALONE=255,
_default_=Pass,
@@ -66,6 +65,7 @@ ENUM_E_TYPE = dict(
)
# e_machine in the ELF header
+# (this list is currently somewhat partial...)
ENUM_E_MACHINE = dict(
EM_NONE=0,
EM_M32=1,
@@ -73,94 +73,15 @@ ENUM_E_MACHINE = dict(
EM_386=3,
EM_68K=4,
EM_88K=5,
+ EM_486=6,
EM_860=7,
EM_MIPS=8,
EM_S370=9,
- EM_MIPS_RS3_LE=10,
- EM_PARISC=15,
- EM_VPP500=17,
- EM_SPARC32PLUS=18,
- EM_960=19,
- EM_PPC=20,
- EM_PPC64=21,
- EM_S390=22,
- EM_V800=36,
- EM_FR20=37,
- EM_RH32=38,
- EM_RCE=39,
- EM_ARM=40,
- EM_ALPHA=41,
- EM_SH=42,
- EM_SPARCV9=43,
- EM_TRICORE=44,
- EM_ARC=45,
- EM_H8_300=46,
- EM_H8_300H=47,
- EM_H8S=48,
- EM_H8_500=49,
+ EM_MIPS_RS4_BE=10,
EM_IA_64=50,
- EM_MIPS_X=51,
- EM_COLDFIRE=52,
- EM_68HC12=53,
- EM_MMA=54,
- EM_PCP=55,
- EM_NCPU=56,
- EM_NDR1=57,
- EM_STARCORE=58,
- EM_ME16=59,
- EM_ST100=60,
- EM_TINYJ=61,
EM_X86_64=62,
- EM_PDSP=63,
- EM_PDP10=64,
- EM_PDP11=65,
- EM_FX66=66,
- EM_ST9PLUS=67,
- EM_ST7=68,
- EM_68HC16=69,
- EM_68HC11=70,
- EM_68HC08=71,
- EM_68HC05=72,
- EM_SVX=73,
- EM_ST19=74,
- EM_VAX=75,
- EM_CRIS=76,
- EM_JAVELIN=77,
- EM_FIREPATH=78,
- EM_ZSP=79,
- EM_MMIX=80,
- EM_HUANY=81,
- EM_PRISM=82,
EM_AVR=83,
- EM_FR30=84,
- EM_D10V=85,
- EM_D30V=86,
- EM_V850=87,
- EM_M32R=88,
- EM_MN10300=89,
- EM_MN10200=90,
- EM_PJ=91,
- EM_OPENRISC=92,
- EM_ARC_A5=93,
- EM_XTENSA=94,
- EM_VIDEOCORE=95,
- EM_TMM_GPP=96,
- EM_NS32K=97,
- EM_TPC=98,
- EM_SNP1K=99,
- EM_ST200=100,
- EM_IP2K=101,
- EM_MAX=102,
- EM_CR=103,
- EM_F2MC16=104,
- EM_MSP430=105,
- EM_BLACKFIN=106,
- EM_SE_C33=107,
- EM_SEP=108,
- EM_ARCA=109,
- EM_UNICORE=110,
EM_L10M=180,
- EM_AARCH64=183,
_default_=Pass,
)
@@ -186,20 +107,14 @@ ENUM_SH_TYPE = dict(
SHT_NUM=19,
SHT_LOOS=0x60000000,
SHT_GNU_HASH=0x6ffffff6,
- SHT_GNU_verdef=0x6ffffffd, # also SHT_SUNW_verdef
- SHT_GNU_verneed=0x6ffffffe, # also SHT_SUNW_verneed
- SHT_GNU_versym=0x6fffffff, # also SHT_SUNW_versym
+ SHT_GNU_verdef=0x6ffffffd,
+ SHT_GNU_verneed=0x6ffffffe,
+ SHT_GNU_versym=0x6fffffff,
SHT_LOPROC=0x70000000,
SHT_HIPROC=0x7fffffff,
SHT_LOUSER=0x80000000,
SHT_HIUSER=0xffffffff,
SHT_AMD64_UNWIND=0x70000001,
- SHT_SUNW_LDYNSYM=0x6ffffff3,
- SHT_SUNW_syminfo=0x6ffffffc,
- SHT_ARM_EXIDX=0x70000001,
- SHT_ARM_PREEMPTMAP=0x70000002,
- SHT_ARM_ATTRIBUTES=0x70000003,
- SHT_ARM_DEBUGOVERLAY=0x70000004,
_default_=Pass,
)
@@ -219,11 +134,6 @@ ENUM_P_TYPE = dict(
PT_GNU_EH_FRAME=0x6474e550,
PT_GNU_STACK=0x6474e551,
PT_GNU_RELRO=0x6474e552,
- PT_ARM_ARCHEXT=0x70000000,
- PT_ARM_EXIDX=0x70000001,
- PT_ARM_UNWIND=0x70000001,
- PT_AARCH64_ARCHEXT=0x70000000,
- PT_AARCH64_UNWIND=0x70000001,
_default_=Pass,
)
@@ -265,9 +175,6 @@ ENUM_ST_VISIBILITY = dict(
STV_INTERNAL=1,
STV_HIDDEN=2,
STV_PROTECTED=3,
- STV_EXPORTED=4,
- STV_SINGLETON=5,
- STV_ELIMINATE=6,
_default_=Pass,
)
@@ -317,24 +224,6 @@ ENUM_D_TAG = dict(
DT_PREINIT_ARRAYSZ=33,
DT_NUM=34,
DT_LOOS=0x6000000d,
- DT_SUNW_AUXILIARY=0x6000000d,
- DT_SUNW_RTLDINF=0x6000000e,
- DT_SUNW_FILTER=0x6000000f,
- DT_SUNW_CAP=0x60000010,
- DT_SUNW_SYMTAB=0x60000011,
- DT_SUNW_SYMSZ=0x60000012,
- DT_SUNW_ENCODING=0x60000013,
- DT_SUNW_SORTENT=0x60000013,
- DT_SUNW_SYMSORT=0x60000014,
- DT_SUNW_SYMSORTSZ=0x60000015,
- DT_SUNW_TLSSORT=0x60000016,
- DT_SUNW_TLSSORTSZ=0x60000017,
- DT_SUNW_CAPINFO=0x60000018,
- DT_SUNW_STRPAD=0x60000019,
- DT_SUNW_CAPCHAIN=0x6000001a,
- DT_SUNW_LDMACH=0x6000001b,
- DT_SUNW_CAPCHAINENT=0x6000001d,
- DT_SUNW_CAPCHAINSZ=0x6000001f,
DT_HIOS=0x6ffff000,
DT_LOPROC=0x70000000,
DT_HIPROC=0x7fffffff,
@@ -462,271 +351,3 @@ ENUM_RELOC_TYPE_x64 = dict(
_default_=Pass,
)
-# Sunw Syminfo Bound To special values
-ENUM_SUNW_SYMINFO_BOUNDTO = dict(
- SYMINFO_BT_SELF=0xffff,
- SYMINFO_BT_PARENT=0xfffe,
- SYMINFO_BT_NONE=0xfffd,
- SYMINFO_BT_EXTERN=0xfffc,
- _default_=Pass,
-)
-
-# Versym section, version dependency index
-ENUM_VERSYM = dict(
- VER_NDX_LOCAL=0,
- VER_NDX_GLOBAL=1,
- VER_NDX_LORESERVE=0xff00,
- VER_NDX_ELIMINATE=0xff01,
- _default_=Pass,
-)
-# Sunw Syminfo Bound To special values
-ENUM_SUNW_SYMINFO_BOUNDTO = dict(
- SYMINFO_BT_SELF=0xffff,
- SYMINFO_BT_PARENT=0xfffe,
- SYMINFO_BT_NONE=0xfffd,
- SYMINFO_BT_EXTERN=0xfffc,
- _default_=Pass,
-)
-
-ENUM_RELOC_TYPE_ARM = dict(
- R_ARM_NONE=0,
- R_ARM_PC24=1,
- R_ARM_ABS32=2,
- R_ARM_REL32=3,
- R_ARM_LDR_PC_G0=4,
- R_ARM_ABS16=5,
- R_ARM_ABS12=6,
- R_ARM_THM_ABS5=7,
- R_ARM_ABS8=8,
- R_ARM_SBREL32=9,
- R_ARM_THM_CALL=10,
- R_ARM_THM_PC8=11,
- R_ARM_BREL_ADJ=12,
- R_ARM_SWI24=13,
- R_ARM_THM_SWI8=14,
- R_ARM_XPC25=15,
- R_ARM_THM_XPC22=16,
- R_ARM_TLS_DTPMOD32=17,
- R_ARM_TLS_DTPOFF32=18,
- R_ARM_TLS_TPOFF32=19,
- R_ARM_COPY=20,
- R_ARM_GLOB_DAT=21,
- R_ARM_JUMP_SLOT=22,
- R_ARM_RELATIVE=23,
- R_ARM_GOTOFF32=24,
- R_ARM_BASE_PREL=25,
- R_ARM_GOT_BREL=26,
- R_ARM_PLT32=27,
- R_ARM_CALL=28,
- R_ARM_JUMP24=29,
- R_ARM_THM_JUMP24=30,
- R_ARM_BASE_ABS=31,
- R_ARM_ALU_PCREL_7_0=32,
- R_ARM_ALU_PCREL_15_8=33,
- R_ARM_ALU_PCREL_23_15=34,
- R_ARM_LDR_SBREL_11_0_NC=35,
- R_ARM_ALU_SBREL_19_12_NC=36,
- R_ARM_ALU_SBREL_27_20_CK=37,
- R_ARM_TARGET1=38,
- R_ARM_SBREL31=39,
- R_ARM_V4BX=40,
- R_ARM_TARGET2=41,
- R_ARM_PREL31=42,
- R_ARM_MOVW_ABS_NC=43,
- R_ARM_MOVT_ABS=44,
- R_ARM_MOVW_PREL_NC=45,
- R_ARM_MOVT_PREL=46,
- R_ARM_THM_MOVW_ABS_NC=47,
- R_ARM_THM_MOVT_ABS=48,
- R_ARM_THM_MOVW_PREL_NC=49,
- R_ARM_THM_MOVT_PREL=50,
- R_ARM_THM_JUMP19=51,
- R_ARM_THM_JUMP6=52,
- R_ARM_THM_ALU_PREL_11_0=53,
- R_ARM_THM_PC12=54,
- R_ARM_ABS32_NOI=55,
- R_ARM_REL32_NOI=56,
- R_ARM_ALU_PC_G0_NC=57,
- R_ARM_ALU_PC_G0=58,
- R_ARM_ALU_PC_G1_NC=59,
- R_ARM_ALU_PC_G1=60,
- R_ARM_ALU_PC_G2=61,
- R_ARM_LDR_PC_G1=62,
- R_ARM_LDR_PC_G2=63,
- R_ARM_LDRS_PC_G0=64,
- R_ARM_LDRS_PC_G1=65,
- R_ARM_LDRS_PC_G2=66,
- R_ARM_LDC_PC_G0=67,
- R_ARM_LDC_PC_G1=68,
- R_ARM_LDC_PC_G2=69,
- R_ARM_ALU_SB_G0_NC=70,
- R_ARM_ALU_SB_G0=71,
- R_ARM_ALU_SB_G1_NC=72,
- R_ARM_ALU_SB_G1=73,
- R_ARM_ALU_SB_G2=74,
- R_ARM_LDR_SB_G0=75,
- R_ARM_LDR_SB_G1=76,
- R_ARM_LDR_SB_G2=77,
- R_ARM_LDRS_SB_G0=78,
- R_ARM_LDRS_SB_G1=79,
- R_ARM_LDRS_SB_G2=80,
- R_ARM_LDC_SB_G0=81,
- R_ARM_LDC_SB_G1=82,
- R_ARM_LDC_SB_G2=83,
- R_ARM_MOVW_BREL_NC=84,
- R_ARM_MOVT_BREL=85,
- R_ARM_MOVW_BREL=86,
- R_ARM_THM_MOVW_BREL_NC=87,
- R_ARM_THM_MOVT_BREL=88,
- R_ARM_THM_MOVW_BREL=89,
- R_ARM_PLT32_ABS=94,
- R_ARM_GOT_ABS=95,
- R_ARM_GOT_PREL=96,
- R_ARM_GOT_BREL12=97,
- R_ARM_GOTOFF12=98,
- R_ARM_GOTRELAX=99,
- R_ARM_GNU_VTENTRY=100,
- R_ARM_GNU_VTINHERIT=101,
- R_ARM_THM_JUMP11=102,
- R_ARM_THM_JUMP8=103,
- R_ARM_TLS_GD32=104,
- R_ARM_TLS_LDM32=105,
- R_ARM_TLS_LDO32=106,
- R_ARM_TLS_IE32=107,
- R_ARM_TLS_LE32=108,
- R_ARM_TLS_LDO12=109,
- R_ARM_TLS_LE12=110,
- R_ARM_TLS_IE12GP=111,
- R_ARM_PRIVATE_0=112,
- R_ARM_PRIVATE_1=113,
- R_ARM_PRIVATE_2=114,
- R_ARM_PRIVATE_3=115,
- R_ARM_PRIVATE_4=116,
- R_ARM_PRIVATE_5=117,
- R_ARM_PRIVATE_6=118,
- R_ARM_PRIVATE_7=119,
- R_ARM_PRIVATE_8=120,
- R_ARM_PRIVATE_9=121,
- R_ARM_PRIVATE_10=122,
- R_ARM_PRIVATE_11=123,
- R_ARM_PRIVATE_12=124,
- R_ARM_PRIVATE_13=125,
- R_ARM_PRIVATE_14=126,
- R_ARM_PRIVATE_15=127,
- R_ARM_ME_TOO=128,
- R_ARM_THM_TLS_DESCSEQ16=129,
- R_ARM_THM_TLS_DESCSEQ32=130,
- R_ARM_THM_GOT_BREL12=131,
- R_ARM_IRELATIVE=140,
-)
-
-ENUM_RELOC_TYPE_AARCH64 = dict(
- R_AARCH64_NONE=256,
- R_AARCH64_ABS64=257,
- R_AARCH64_ABS32=258,
- R_AARCH64_ABS16=259,
- R_AARCH64_PREL64=260,
- R_AARCH64_PREL32=261,
- R_AARCH64_PREL16=262,
- R_AARCH64_MOVW_UABS_G0=263,
- R_AARCH64_MOVW_UABS_G0_NC=264,
- R_AARCH64_MOVW_UABS_G1=265,
- R_AARCH64_MOVW_UABS_G1_NC=266,
- R_AARCH64_MOVW_UABS_G2=267,
- R_AARCH64_MOVW_UABS_G2_NC=268,
- R_AARCH64_MOVW_UABS_G3=269,
- R_AARCH64_MOVW_SABS_G0=270,
- R_AARCH64_MOVW_SABS_G1=271,
- R_AARCH64_MOVW_SABS_G2=272,
- R_AARCH64_LD_PREL_LO19=273,
- R_AARCH64_ADR_PREL_LO21=274,
- R_AARCH64_ADR_PREL_PG_HI21=275,
- R_AARCH64_ADR_PREL_PG_HI21_NC=276,
- R_AARCH64_ADD_ABS_LO12_NC=277,
- R_AARCH64_LDST8_ABS_LO12_NC=278,
- R_AARCH64_TSTBR14=279,
- R_AARCH64_CONDBR19=280,
- R_AARCH64_JUMP26=282,
- R_AARCH64_CALL26=283,
- R_AARCH64_LDST16_ABS_LO12_NC=284,
- R_AARCH64_LDST32_ABS_LO12_NC=285,
- R_AARCH64_LDST64_ABS_LO12_NC=286,
- R_AARCH64_MOVW_PREL_G0=287,
- R_AARCH64_MOVW_PREL_G0_NC=288,
- R_AARCH64_MOVW_PREL_G1=289,
- R_AARCH64_MOVW_PREL_G1_NC=290,
- R_AARCH64_MOVW_PREL_G2=291,
- R_AARCH64_MOVW_PREL_G2_NC=292,
- R_AARCH64_MOVW_PREL_G3=293,
- R_AARCH64_MOVW_GOTOFF_G0=300,
- R_AARCH64_MOVW_GOTOFF_G0_NC=301,
- R_AARCH64_MOVW_GOTOFF_G1=302,
- R_AARCH64_MOVW_GOTOFF_G1_NC=303,
- R_AARCH64_MOVW_GOTOFF_G2=304,
- R_AARCH64_MOVW_GOTOFF_G2_NC=305,
- R_AARCH64_MOVW_GOTOFF_G3=306,
- R_AARCH64_GOTREL64=307,
- R_AARCH64_GOTREL32=308,
- R_AARCH64_GOT_LD_PREL19=309,
- R_AARCH64_LD64_GOTOFF_LO15=310,
- R_AARCH64_ADR_GOT_PAGE=311,
- R_AARCH64_LD64_GOT_LO12_NC=312,
- R_AARCH64_TLSGD_ADR_PREL21=512,
- R_AARCH64_TLSGD_ADR_PAGE21=513,
- R_AARCH64_TLSGD_ADD_LO12_NC=514,
- R_AARCH64_TLSGD_MOVW_G1=515,
- R_AARCH64_TLSGD_MOVW_G0_NC=516,
- R_AARCH64_TLSLD_ADR_PREL21=517,
- R_AARCH64_TLSLD_ADR_PAGE21=518,
- R_AARCH64_TLSLD_ADD_LO12_NC=519,
- R_AARCH64_TLSLD_MOVW_G1=520,
- R_AARCH64_TLSLD_MOVW_G0_NC=521,
- R_AARCH64_TLSLD_LD_PREL19=522,
- R_AARCH64_TLSLD_MOVW_DTPREL_G2=523,
- R_AARCH64_TLSLD_MOVW_DTPREL_G1=524,
- R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC=525,
- R_AARCH64_TLSLD_MOVW_DTPREL_G0=526,
- R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC=527,
- R_AARCH64_TLSLD_ADD_DTPREL_HI12=528,
- R_AARCH64_TLSLD_ADD_DTPREL_LO12=529,
- R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC=530,
- R_AARCH64_TLSLD_LDST8_DTPREL_LO12=531,
- R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC=532,
- R_AARCH64_TLSLD_LDST16_DTPREL_LO12=533,
- R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC=534,
- R_AARCH64_TLSLD_LDST32_DTPREL_LO12=535,
- R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC=536,
- R_AARCH64_TLSLD_LDST64_DTPREL_LO12=537,
- R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC=538,
- R_AARCH64_TLSIE_MOVW_GOTTPREL_G1=539,
- R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC=540,
- R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21=541,
- R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC=542,
- R_AARCH64_TLSIE_LD_GOTTPREL_PREL19=543,
- R_AARCH64_TLSLE_MOVW_TPREL_G2=544,
- R_AARCH64_TLSLE_MOVW_TPREL_G1=545,
- R_AARCH64_TLSLE_MOVW_TPREL_G1_NC=546,
- R_AARCH64_TLSLE_MOVW_TPREL_G0=547,
- R_AARCH64_TLSLE_MOVW_TPREL_G0_NC=548,
- R_AARCH64_TLSLE_ADD_TPREL_HI12=549,
- R_AARCH64_TLSLE_ADD_TPREL_LO12=550,
- R_AARCH64_TLSLE_ADD_TPREL_LO12_NC=551,
- R_AARCH64_TLSLE_LDST8_TPREL_LO12=552,
- R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC=553,
- R_AARCH64_TLSLE_LDST16_TPREL_LO12=554,
- R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC=555,
- R_AARCH64_TLSLE_LDST32_TPREL_LO12=556,
- R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC=557,
- R_AARCH64_TLSLE_LDST64_TPREL_LO12=558,
- R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC=559,
- R_AARCH64_COPY=1024,
- R_AARCH64_GLOB_DAT=1025,
- R_AARCH64_JUMP_SLOT=1026,
- R_AARCH64_RELATIVE=1027,
- R_AARCH64_TLS_DTPREL64=1028,
- R_AARCH64_TLS_DTPMOD64=1029,
- R_AARCH64_TLS_TPREL64=1030,
- R_AARCH64_TLS_DTPREL32=1031,
- R_AARCH64_TLS_DTPMOD32=1032,
- R_AARCH64_TLS_TPREL32=1033,
-)
diff --git a/chromium/third_party/pyelftools/elftools/elf/gnuversions.py b/chromium/third_party/pyelftools/elftools/elf/gnuversions.py
deleted file mode 100644
index 4a4473f3fae..00000000000
--- a/chromium/third_party/pyelftools/elftools/elf/gnuversions.py
+++ /dev/null
@@ -1,228 +0,0 @@
-#------------------------------------------------------------------------------
-# elftools: elf/gnuversions.py
-#
-# ELF sections
-#
-# Yann Rouillard (yann@pleiades.fr.eu.org)
-# This code is in the public domain
-#------------------------------------------------------------------------------
-from ..construct import CString
-from ..common.utils import struct_parse, elf_assert
-from .sections import Section, Symbol
-
-
-class Version(object):
- """ Version object - representing a version definition or dependency
- entry from a "Version Needed" or a "Version Dependency" table section.
-
- This kind of entry contains a pointer to an array of auxiliary entries
- that store the information about version names or dependencies.
- These entries are not stored in this object and should be accessed
- through the appropriate method of a section object which will return
- an iterator of VersionAuxiliary objects.
-
- Similarly to Section objects, allows dictionary-like access to
- verdef/verneed entry
- """
- def __init__(self, entry, name=None):
- self.entry = entry
- self.name = name
-
- def __getitem__(self, name):
- """ Implement dict-like access to entry
- """
- return self.entry[name]
-
-
-class VersionAuxiliary(object):
- """ Version Auxiliary object - representing an auxiliary entry of a version
- definition or dependency entry
-
- Similarly to Section objects, allows dictionary-like access to the
- verdaux/vernaux entry
- """
- def __init__(self, entry, name):
- self.entry = entry
- self.name = name
-
- def __getitem__(self, name):
- """ Implement dict-like access to entries
- """
- return self.entry[name]
-
-
-class GNUVersionSection(Section):
- """ Common ancestor class for ELF SUNW|GNU Version Needed/Dependency
- sections class which contains shareable code
- """
-
- def __init__(self, header, name, stream, elffile, stringtable,
- field_prefix, version_struct, version_auxiliaries_struct):
- super(GNUVersionSection, self).__init__(header, name, stream)
- self.elffile = elffile
- self.stringtable = stringtable
- self.field_prefix = field_prefix
- self.version_struct = version_struct
- self.version_auxiliaries_struct = version_auxiliaries_struct
-
- def num_versions(self):
- """ Number of version entries in the section
- """
- return self['sh_info']
-
- def _field_name(self, name, auxiliary=False):
- """ Return the real field's name of version or a version auxiliary
- entry
- """
- middle = 'a_' if auxiliary else '_'
- return self.field_prefix + middle + name
-
- def _iter_version_auxiliaries(self, entry_offset, count):
- """ Yield all auxiliary entries of a version entry
- """
- name_field = self._field_name('name', auxiliary=True)
- next_field = self._field_name('next', auxiliary=True)
-
- for _ in range(count):
- entry = struct_parse(
- self.version_auxiliaries_struct,
- self.stream,
- stream_pos=entry_offset)
-
- name = self.stringtable.get_string(entry[name_field])
- version_aux = VersionAuxiliary(entry, name)
- yield version_aux
-
- entry_offset += entry[next_field]
-
- def iter_versions(self):
- """ Yield all the version entries in the section
- Each time it returns the main version structure
- and an iterator to walk through its auxiliaries entries
- """
- aux_field = self._field_name('aux')
- count_field = self._field_name('cnt')
- next_field = self._field_name('next')
-
- entry_offset = self['sh_offset']
- for _ in range(self.num_versions()):
- entry = struct_parse(
- self.version_struct,
- self.stream,
- stream_pos=entry_offset)
-
- elf_assert(entry[count_field] > 0,
- 'Expected number of version auxiliary entries (%s) to be > 0'
- 'for the following version entry: %s' % (
- count_field, str(entry)))
-
- version = Version(entry)
- aux_entries_offset = entry_offset + entry[aux_field]
- version_auxiliaries_iter = self._iter_version_auxiliaries(
- aux_entries_offset, entry[count_field])
-
- yield version, version_auxiliaries_iter
-
- entry_offset += entry[next_field]
-
-
-class GNUVerNeedSection(GNUVersionSection):
- """ ELF SUNW or GNU Version Needed table section.
- Has an associated StringTableSection that's passed in the constructor.
- """
- def __init__(self, header, name, stream, elffile, stringtable):
- super(GNUVerNeedSection, self).__init__(
- header, name, stream, elffile, stringtable, 'vn',
- elffile.structs.Elf_Verneed, elffile.structs.Elf_Vernaux)
- self._has_indexes = None
-
- def has_indexes(self):
- """ Return True if at least one version definition entry has an index
- that is stored in the vna_other field.
- This information is used for symbol versioning
- """
- if self._has_indexes is None:
- self._has_indexes = False
- for _, vernaux_iter in self.iter_versions():
- for vernaux in vernaux_iter:
- if vernaux['vna_other']:
- self._has_indexes = True
- break
-
- return self._has_indexes
-
- def iter_versions(self):
- for verneed, vernaux in super(GNUVerNeedSection, self).iter_versions():
- verneed.name = self.stringtable.get_string(verneed['vn_file'])
- yield verneed, vernaux
-
- def get_version(self, index):
- """ Get the version information located at index #n in the table
- Return boths the verneed structure and the vernaux structure
- that contains the name of the version
- """
- for verneed, vernaux_iter in self.iter_versions():
- for vernaux in vernaux_iter:
- if vernaux['vna_other'] == index:
- return verneed, vernaux
-
- return None
-
-
-class GNUVerDefSection(GNUVersionSection):
- """ ELF SUNW or GNU Version Definition table section.
- Has an associated StringTableSection that's passed in the constructor.
- """
- def __init__(self, header, name, stream, elffile, stringtable):
- super(GNUVerDefSection, self).__init__(
- header, name, stream, elffile, stringtable, 'vd',
- elffile.structs.Elf_Verdef, elffile.structs.Elf_Verdaux)
-
- def get_version(self, index):
- """ Get the version information located at index #n in the table
- Return boths the verdef structure and an iterator to retrieve
- both the version names and dependencies in the form of
- verdaux entries
- """
- for verdef, verdaux_iter in self.iter_versions():
- if verdef['vd_ndx'] == index:
- return verdef, verdaux_iter
-
- return None
-
-
-class GNUVerSymSection(Section):
- """ ELF SUNW or GNU Versym table section.
- Has an associated SymbolTableSection that's passed in the constructor.
- """
- def __init__(self, header, name, stream, elffile, symboltable):
- super(GNUVerSymSection, self).__init__(header, name, stream)
- self.elffile = elffile
- self.elfstructs = self.elffile.structs
- self.symboltable = symboltable
-
- def num_symbols(self):
- """ Number of symbols in the table
- """
- return self['sh_size'] // self['sh_entsize']
-
- def get_symbol(self, n):
- """ Get the symbol at index #n from the table (Symbol object)
- It begins at 1 and not 0 since the first entry is used to
- store the current version of the syminfo table
- """
- # Grab the symbol's entry from the stream
- entry_offset = self['sh_offset'] + n * self['sh_entsize']
- entry = struct_parse(
- self.elfstructs.Elf_Versym,
- self.stream,
- stream_pos=entry_offset)
- # Find the symbol name in the associated symbol table
- name = self.symboltable.get_symbol(n).name
- return Symbol(entry, name)
-
- def iter_symbols(self):
- """ Yield all the symbols in the table
- """
- for i in range(self.num_symbols()):
- yield self.get_symbol(i)
diff --git a/chromium/third_party/pyelftools/elftools/elf/relocation.py b/chromium/third_party/pyelftools/elftools/elf/relocation.py
index 176f7c5404a..5ff853beda9 100644
--- a/chromium/third_party/pyelftools/elftools/elf/relocation.py
+++ b/chromium/third_party/pyelftools/elftools/elf/relocation.py
@@ -23,12 +23,12 @@ class Relocation(object):
def __init__(self, entry, elffile):
self.entry = entry
self.elffile = elffile
-
+
def is_RELA(self):
""" Is this a RELA relocation? If not, it's REL.
"""
return 'r_addend' in self.entry
-
+
def __getitem__(self, name):
""" Dict-like access to entries
"""
@@ -112,7 +112,7 @@ class RelocationHandler(object):
relsection.name in reloc_section_names):
return relsection
return None
-
+
def apply_section_relocations(self, stream, reloc_section):
""" Apply all relocations in reloc_section (a RelocationSection object)
to the given stream, that contains the data of the section that is
@@ -162,7 +162,7 @@ class RelocationHandler(object):
elif recipe.bytesize == 8:
value_struct = self.elffile.structs.Elf_word64('')
else:
- raise ELFRelocationError('Invalid bytesize %s for relocation' %
+ raise ELFRelocationError('Invalid bytesize %s for relocation' %
recipe_bytesize)
# 1. Read the value from the stream (with correct size and endianness)
@@ -178,11 +178,6 @@ class RelocationHandler(object):
addend=reloc['r_addend'] if recipe.has_addend else 0)
# 3. Write the relocated value back into the stream
stream.seek(reloc['r_offset'])
-
- # Make sure the relocated value fits back by wrapping it around. This
- # looks like a problem, but it seems to be the way this is done in
- # binutils too.
- relocated_value = relocated_value % (2 ** (recipe.bytesize * 8))
value_struct.build_stream(relocated_value, stream)
# Relocations are represented by "recipes". Each recipe specifies:
@@ -203,13 +198,10 @@ class RelocationHandler(object):
def _reloc_calc_sym_plus_value_pcrel(value, sym_value, offset, addend=0):
return sym_value + value - offset
-
+
def _reloc_calc_sym_plus_addend(value, sym_value, offset, addend=0):
return sym_value + addend
-
- def _reloc_calc_sym_plus_addend_pcrel(value, sym_value, offset, addend=0):
- return sym_value + addend - offset
-
+
_RELOCATION_RECIPES_X86 = {
ENUM_RELOC_TYPE_i386['R_386_NONE']: _RELOCATION_RECIPE_TYPE(
bytesize=4, has_addend=False, calc_func=_reloc_calc_identity),
@@ -220,15 +212,12 @@ class RelocationHandler(object):
bytesize=4, has_addend=False,
calc_func=_reloc_calc_sym_plus_value_pcrel),
}
-
+
_RELOCATION_RECIPES_X64 = {
ENUM_RELOC_TYPE_x64['R_X86_64_NONE']: _RELOCATION_RECIPE_TYPE(
bytesize=8, has_addend=True, calc_func=_reloc_calc_identity),
ENUM_RELOC_TYPE_x64['R_X86_64_64']: _RELOCATION_RECIPE_TYPE(
bytesize=8, has_addend=True, calc_func=_reloc_calc_sym_plus_addend),
- ENUM_RELOC_TYPE_x64['R_X86_64_PC32']: _RELOCATION_RECIPE_TYPE(
- bytesize=8, has_addend=True,
- calc_func=_reloc_calc_sym_plus_addend_pcrel),
ENUM_RELOC_TYPE_x64['R_X86_64_32']: _RELOCATION_RECIPE_TYPE(
bytesize=4, has_addend=True, calc_func=_reloc_calc_sym_plus_addend),
ENUM_RELOC_TYPE_x64['R_X86_64_32S']: _RELOCATION_RECIPE_TYPE(
diff --git a/chromium/third_party/pyelftools/elftools/elf/sections.py b/chromium/third_party/pyelftools/elftools/elf/sections.py
index 1380d6b8e0c..518c857aa92 100644
--- a/chromium/third_party/pyelftools/elftools/elf/sections.py
+++ b/chromium/third_party/pyelftools/elftools/elf/sections.py
@@ -6,13 +6,14 @@
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
+from ..construct import CString
from ..common.utils import struct_parse, elf_assert, parse_cstring_from_stream
class Section(object):
""" Base class for ELF sections. Also used for all sections types that have
no special functionality.
-
+
Allows dictionary-like access to the section header. For example:
> sec = Section(...)
> sec['sh_type'] # section type
@@ -21,7 +22,7 @@ class Section(object):
self.header = header
self.name = name
self.stream = stream
-
+
def data(self):
""" The section data from the file.
"""
@@ -32,7 +33,7 @@ class Section(object):
""" Is this a null section?
"""
return False
-
+
def __getitem__(self, name):
""" Implement dict-like access to header entries
"""
@@ -40,8 +41,6 @@ class Section(object):
def __eq__(self, other):
return self.header == other.header
- def __hash__(self):
- return hash(self.header)
class NullSection(Section):
@@ -52,14 +51,14 @@ class NullSection(Section):
def is_null(self):
return True
-
+
class StringTableSection(Section):
""" ELF string table section.
"""
def __init__(self, header, name, stream):
super(StringTableSection, self).__init__(header, name, stream)
-
+
def get_string(self, offset):
""" Get the string stored at the given offset in this string table.
"""
@@ -78,15 +77,15 @@ class SymbolTableSection(Section):
self.elfstructs = self.elffile.structs
self.stringtable = stringtable
elf_assert(self['sh_entsize'] > 0,
- 'Expected entry size of section %r to be > 0' % name)
+ 'Expected entry size of section %s to be > 0' % name)
elf_assert(self['sh_size'] % self['sh_entsize'] == 0,
- 'Expected section size to be a multiple of entry size in section %r' % name)
+ 'Expected section size to be a multiple of entry size in section %s' % name)
def num_symbols(self):
""" Number of symbols in the table
"""
return self['sh_size'] // self['sh_entsize']
-
+
def get_symbol(self, n):
""" Get the symbol at index #n from the table (Symbol object)
"""
@@ -124,38 +123,3 @@ class Symbol(object):
return self.entry[name]
-class SUNWSyminfoTableSection(Section):
- """ ELF .SUNW Syminfo table section.
- Has an associated SymbolTableSection that's passed in the constructor.
- """
- def __init__(self, header, name, stream, elffile, symboltable):
- super(SUNWSyminfoTableSection, self).__init__(header, name, stream)
- self.elffile = elffile
- self.elfstructs = self.elffile.structs
- self.symboltable = symboltable
-
- def num_symbols(self):
- """ Number of symbols in the table
- """
- return self['sh_size'] // self['sh_entsize'] - 1
-
- def get_symbol(self, n):
- """ Get the symbol at index #n from the table (Symbol object).
- It begins at 1 and not 0 since the first entry is used to
- store the current version of the syminfo table.
- """
- # Grab the symbol's entry from the stream
- entry_offset = self['sh_offset'] + n * self['sh_entsize']
- entry = struct_parse(
- self.elfstructs.Elf_Sunw_Syminfo,
- self.stream,
- stream_pos=entry_offset)
- # Find the symbol name in the associated symbol table
- name = self.symboltable.get_symbol(n).name
- return Symbol(entry, name)
-
- def iter_symbols(self):
- """ Yield all the symbols in the table
- """
- for i in range(1, self.num_symbols() + 1):
- yield self.get_symbol(i)
diff --git a/chromium/third_party/pyelftools/elftools/elf/segments.py b/chromium/third_party/pyelftools/elftools/elf/segments.py
index bc54da2c056..217ba085db6 100644
--- a/chromium/third_party/pyelftools/elftools/elf/segments.py
+++ b/chromium/third_party/pyelftools/elftools/elf/segments.py
@@ -15,7 +15,7 @@ class Segment(object):
def __init__(self, header, stream):
self.header = header
self.stream = stream
-
+
def data(self):
""" The segment data from the file.
"""
@@ -30,8 +30,8 @@ class Segment(object):
def section_in_segment(self, section):
""" Is the given section contained in this segment?
- Note: this tries to reproduce the intricate rules of the
- ELF_SECTION_IN_SEGMENT_STRICT macro of the header
+ Note: this tries to reproduce the intricate rules of the
+ ELF_SECTION_IN_SEGMENT_STRICT macro of the header
elf/include/internal.h in the source of binutils.
"""
# Only the 'strict' checks from ELF_SECTION_IN_SEGMENT_1 are included
@@ -41,7 +41,7 @@ class Segment(object):
# Only PT_LOAD, PT_GNU_RELR0 and PT_TLS segments can contain SHF_TLS
# sections
- if ( secflags & SH_FLAGS.SHF_TLS and
+ if ( secflags & SH_FLAGS.SHF_TLS and
segtype in ('PT_TLS', 'PT_GNU_RELR0', 'PT_LOAD')):
return False
# PT_TLS segment contains only SHF_TLS sections, PT_PHDR no sections
@@ -61,7 +61,7 @@ class Segment(object):
# not match at the very end of the segment (unless the segment is
# also zero size, which is handled by the second condition).
if not (secaddr >= vaddr and
- secaddr - vaddr + section['sh_size'] <= self['p_memsz'] and
+ secaddr - vaddr + section['sh_size'] <= self['p_memsz'] and
secaddr - vaddr <= self['p_memsz'] - 1):
return False
@@ -74,7 +74,7 @@ class Segment(object):
# Same logic as with secaddr vs. vaddr checks above, just on offsets in
# the file
- return (secoffset >= poffset and
+ return (secoffset >= poffset and
secoffset - poffset + section['sh_size'] <= self['p_filesz'] and
secoffset - poffset <= self['p_filesz'] - 1)
diff --git a/chromium/third_party/pyelftools/elftools/elf/structs.py b/chromium/third_party/pyelftools/elftools/elf/structs.py
index 0862400faeb..08567de4fbe 100644
--- a/chromium/third_party/pyelftools/elftools/elf/structs.py
+++ b/chromium/third_party/pyelftools/elftools/elf/structs.py
@@ -19,20 +19,20 @@ from .enums import *
class ELFStructs(object):
""" Accessible attributes:
-
+
Elf_{byte|half|word|word64|addr|offset|sword|xword|xsword}:
- Data chunks, as specified by the ELF standard, adjusted for
+ Data chunks, as specified by the ELF standard, adjusted for
correct endianness and word-size.
Elf_Ehdr:
ELF file header
-
+
Elf_Phdr:
Program header
-
+
Elf_Shdr:
Section header
-
+
Elf_Sym:
Symbol table entry
@@ -42,9 +42,9 @@ class ELFStructs(object):
def __init__(self, little_endian=True, elfclass=32):
assert elfclass == 32 or elfclass == 64
self.little_endian = little_endian
- self.elfclass = elfclass
+ self.elfclass = elfclass
self._create_structs()
-
+
def _create_structs(self):
if self.little_endian:
self.Elf_byte = ULInt8
@@ -66,18 +66,14 @@ class ELFStructs(object):
self.Elf_sword = SBInt32
self.Elf_xword = UBInt32 if self.elfclass == 32 else UBInt64
self.Elf_sxword = SBInt32 if self.elfclass == 32 else SBInt64
-
+
self._create_ehdr()
self._create_phdr()
self._create_shdr()
self._create_sym()
self._create_rel()
self._create_dyn()
- self._create_sunw_syminfo()
- self._create_gnu_verneed()
- self._create_gnu_verdef()
- self._create_gnu_versym()
-
+
def _create_ehdr(self):
self.Elf_Ehdr = Struct('Elf_Ehdr',
Struct('e_ident',
@@ -103,7 +99,7 @@ class ELFStructs(object):
self.Elf_half('e_shnum'),
self.Elf_half('e_shstrndx'),
)
-
+
def _create_phdr(self):
if self.elfclass == 32:
self.Elf_Phdr = Struct('Elf_Phdr',
@@ -126,8 +122,8 @@ class ELFStructs(object):
self.Elf_xword('p_filesz'),
self.Elf_xword('p_memsz'),
self.Elf_xword('p_align'),
- )
-
+ )
+
def _create_shdr(self):
self.Elf_Shdr = Struct('Elf_Shdr',
self.Elf_word('sh_name'),
@@ -141,7 +137,7 @@ class ELFStructs(object):
self.Elf_xword('sh_addralign'),
self.Elf_xword('sh_entsize'),
)
-
+
def _create_rel(self):
# r_info is also taken apart into r_info_sym and r_info_type.
# This is done in Value to avoid endianity issues while parsing.
@@ -207,50 +203,5 @@ class ELFStructs(object):
self.Elf_xword('st_size'),
)
- def _create_sunw_syminfo(self):
- self.Elf_Sunw_Syminfo = Struct('Elf_Sunw_Syminfo',
- Enum(self.Elf_half('si_boundto'), **ENUM_SUNW_SYMINFO_BOUNDTO),
- self.Elf_half('si_flags'),
- )
- def _create_gnu_verneed(self):
- # Structure of "version needed" entries is documented in
- # Oracle "Linker and Libraries Guide", Chapter 7 Object File Format
- self.Elf_Verneed = Struct('Elf_Verneed',
- self.Elf_half('vn_version'),
- self.Elf_half('vn_cnt'),
- self.Elf_word('vn_file'),
- self.Elf_word('vn_aux'),
- self.Elf_word('vn_next'),
- )
- self.Elf_Vernaux = Struct('Elf_Vernaux',
- self.Elf_word('vna_hash'),
- self.Elf_half('vna_flags'),
- self.Elf_half('vna_other'),
- self.Elf_word('vna_name'),
- self.Elf_word('vna_next'),
- )
- def _create_gnu_verdef(self):
- # Structure off "version definition" entries are documented in
- # Oracle "Linker and Libraries Guide", Chapter 7 Object File Format
- self.Elf_Verdef = Struct('Elf_Verdef',
- self.Elf_half('vd_version'),
- self.Elf_half('vd_flags'),
- self.Elf_half('vd_ndx'),
- self.Elf_half('vd_cnt'),
- self.Elf_word('vd_hash'),
- self.Elf_word('vd_aux'),
- self.Elf_word('vd_next'),
- )
- self.Elf_Verdaux = Struct('Elf_Verdaux',
- self.Elf_word('vda_name'),
- self.Elf_word('vda_next'),
- )
-
- def _create_gnu_versym(self):
- # Structure off "version symbol" entries are documented in
- # Oracle "Linker and Libraries Guide", Chapter 7 Object File Format
- self.Elf_Versym = Struct('Elf_Versym',
- Enum(self.Elf_half('ndx'), **ENUM_VERSYM),
- )
diff --git a/chromium/third_party/pyelftools/examples/dwarf_decode_address.py b/chromium/third_party/pyelftools/examples/dwarf_decode_address.py
index 80b53eefc89..831b4fc3110 100644
--- a/chromium/third_party/pyelftools/examples/dwarf_decode_address.py
+++ b/chromium/third_party/pyelftools/examples/dwarf_decode_address.py
@@ -10,9 +10,12 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
from elftools.common.py3compat import maxint, bytes2str
from elftools.elf.elffile import ELFFile
@@ -42,7 +45,7 @@ def process_file(filename, address):
def decode_funcname(dwarfinfo, address):
# Go over all DIEs in the DWARF information, looking for a subprogram
# entry with an address range that includes the given address. Note that
- # this simplifies things by disregarding subprograms that may have
+ # this simplifies things by disregarding subprograms that may have
# split address ranges.
for CU in dwarfinfo.iter_CUs():
for DIE in CU.iter_DIEs():
@@ -63,18 +66,16 @@ def decode_file_line(dwarfinfo, address):
for CU in dwarfinfo.iter_CUs():
# First, look at line programs to find the file/line for the address
lineprog = dwarfinfo.line_program_for_CU(CU)
- prevstate = None
+ prevaddr = maxint
for entry in lineprog.get_entries():
# We're interested in those entries where a new state is assigned
- if entry.state is None or entry.state.end_sequence:
- continue
- # Looking for a range of addresses in two consecutive states that
- # contain the required address.
- if prevstate and prevstate.address <= address < entry.state.address:
- filename = lineprog['file_entry'][prevstate.file - 1].name
- line = prevstate.line
- return filename, line
- prevstate = entry.state
+ state = entry.state
+ if state is not None and not state.end_sequence:
+ if prevaddr <= address <= state.address:
+ filename = lineprog['file_entry'][state.file - 1].name
+ line = state.line
+ return filename, line
+ prevaddr = state.address
return None, None
diff --git a/chromium/third_party/pyelftools/examples/dwarf_die_tree.py b/chromium/third_party/pyelftools/examples/dwarf_die_tree.py
index ef108c35adf..7eb07ff3a3b 100644
--- a/chromium/third_party/pyelftools/examples/dwarf_die_tree.py
+++ b/chromium/third_party/pyelftools/examples/dwarf_die_tree.py
@@ -10,10 +10,14 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
-
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
+
+from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
@@ -43,8 +47,15 @@ def process_file(filename):
top_DIE = CU.get_top_DIE()
print(' Top DIE with tag=%s' % top_DIE.tag)
- # We're interested in the filename...
- print(' name=%s' % top_DIE.get_full_path())
+ # Each DIE holds an OrderedDict of attributes, mapping names to
+ # values. Values are represented by AttributeValue objects in
+ # elftools/dwarf/die.py
+ # We're interested in the DW_AT_name attribute. Note that its value
+ # is usually a string taken from the .debug_string section. This
+ # is done transparently by the library, and such a value will be
+ # simply given as a string.
+ name_attr = top_DIE.attributes['DW_AT_name']
+ print(' name=%s' % bytes2str(name_attr.value))
# Display DIEs recursively starting with top_DIE
die_info_rec(top_DIE)
diff --git a/chromium/third_party/pyelftools/examples/dwarf_location_lists.py b/chromium/third_party/pyelftools/examples/dwarf_location_lists.py
index d8ee1e97ea5..62896189c1e 100644
--- a/chromium/third_party/pyelftools/examples/dwarf_location_lists.py
+++ b/chromium/third_party/pyelftools/examples/dwarf_location_lists.py
@@ -10,10 +10,12 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
-
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
from elftools.common.py3compat import itervalues
from elftools.elf.elffile import ELFFile
@@ -84,7 +86,7 @@ def show_loclist(loclist, dwarfinfo, indent):
else:
d.append(str(loc_entity))
return '\n'.join(indent + s for s in d)
-
+
def attribute_has_location_list(attr):
""" Only some attributes can have location list values, if they have the
diff --git a/chromium/third_party/pyelftools/examples/dwarf_range_lists.py b/chromium/third_party/pyelftools/examples/dwarf_range_lists.py
index 6e8998dfca4..c310e584f12 100644
--- a/chromium/third_party/pyelftools/examples/dwarf_range_lists.py
+++ b/chromium/third_party/pyelftools/examples/dwarf_range_lists.py
@@ -1,7 +1,7 @@
#-------------------------------------------------------------------------------
# elftools example: dwarf_range_lists.py
#
-# Examine DIE entries which have range list values, and decode these range
+# Examine DIE entries which have range list values, and decode these range
# lists.
#
# Eli Bendersky (eliben@gmail.com)
@@ -10,9 +10,12 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
from elftools.common.py3compat import itervalues
from elftools.elf.elffile import ELFFile
@@ -37,9 +40,6 @@ def process_file(filename):
# The range lists are extracted by DWARFInfo from the .debug_ranges
# section, and returned here as a RangeLists object.
range_lists = dwarfinfo.range_lists()
- if range_lists is None:
- print(' file has no .debug_ranges section')
- return
for CU in dwarfinfo.iter_CUs():
# DWARFInfo allows to iterate over the compile units contained in
diff --git a/chromium/third_party/pyelftools/examples/elf_low_high_api.py b/chromium/third_party/pyelftools/examples/elf_low_high_api.py
index e2d7f495bd7..05d75642ac8 100644
--- a/chromium/third_party/pyelftools/examples/elf_low_high_api.py
+++ b/chromium/third_party/pyelftools/examples/elf_low_high_api.py
@@ -11,9 +11,12 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
diff --git a/chromium/third_party/pyelftools/examples/elf_relocations.py b/chromium/third_party/pyelftools/examples/elf_relocations.py
index 008626619f5..fd65541954c 100644
--- a/chromium/third_party/pyelftools/examples/elf_relocations.py
+++ b/chromium/third_party/pyelftools/examples/elf_relocations.py
@@ -10,10 +10,12 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
-
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
diff --git a/chromium/third_party/pyelftools/examples/elf_show_debug_sections.py b/chromium/third_party/pyelftools/examples/elf_show_debug_sections.py
index 4e4da61e259..96e1dd9df88 100644
--- a/chromium/third_party/pyelftools/examples/elf_show_debug_sections.py
+++ b/chromium/third_party/pyelftools/examples/elf_show_debug_sections.py
@@ -9,9 +9,12 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
diff --git a/chromium/third_party/pyelftools/examples/elfclass_address_size.py b/chromium/third_party/pyelftools/examples/elfclass_address_size.py
index ac2bfaadcc3..d6b19d3d40e 100644
--- a/chromium/third_party/pyelftools/examples/elfclass_address_size.py
+++ b/chromium/third_party/pyelftools/examples/elfclass_address_size.py
@@ -10,9 +10,12 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
from elftools.elf.elffile import ELFFile
diff --git a/chromium/third_party/pyelftools/examples/examine_dwarf_info.py b/chromium/third_party/pyelftools/examples/examine_dwarf_info.py
index 0e1619e9f7a..35ce35bbc40 100644
--- a/chromium/third_party/pyelftools/examples/examine_dwarf_info.py
+++ b/chromium/third_party/pyelftools/examples/examine_dwarf_info.py
@@ -9,10 +9,14 @@
from __future__ import print_function
import sys
-# If pyelftools is not installed, the example can also run from the root or
-# examples/ dir of the source distribution.
-sys.path[0:0] = ['.', '..']
+# If elftools is not installed, maybe we're running from the root or examples
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
+from elftools.common.py3compat import bytes2str
from elftools.elf.elffile import ELFFile
@@ -42,8 +46,15 @@ def process_file(filename):
top_DIE = CU.get_top_DIE()
print(' Top DIE with tag=%s' % top_DIE.tag)
- # We're interested in the filename...
- print(' name=%s' % top_DIE.get_full_path())
+ # Each DIE holds an OrderedDict of attributes, mapping names to
+ # values. Values are represented by AttributeValue objects in
+ # elftools/dwarf/die.py
+ # We're interested in the DW_AT_name attribute. Note that its value
+ # is usually a string taken from the .debug_str section. This
+ # is done transparently by the library, and such a value will be
+ # simply given as a string.
+ name_attr = top_DIE.attributes['DW_AT_name']
+ print(' name=%s' % bytes2str(name_attr.value))
if __name__ == '__main__':
for filename in sys.argv[1:]:
diff --git a/chromium/third_party/pyelftools/examples/reference_output/dwarf_decode_address.out b/chromium/third_party/pyelftools/examples/reference_output/dwarf_decode_address.out
index e14d84a77db..73ca9eeaab9 100644
--- a/chromium/third_party/pyelftools/examples/reference_output/dwarf_decode_address.out
+++ b/chromium/third_party/pyelftools/examples/reference_output/dwarf_decode_address.out
@@ -1,4 +1,4 @@
Processing file: ./examples/sample_exe64.elf
Function: main
File: z.c
-Line: 3
+Line: 4
diff --git a/chromium/third_party/pyelftools/examples/reference_output/dwarf_die_tree.out b/chromium/third_party/pyelftools/examples/reference_output/dwarf_die_tree.out
index 4a81a8ee177..143cbbb42b2 100644
--- a/chromium/third_party/pyelftools/examples/reference_output/dwarf_die_tree.out
+++ b/chromium/third_party/pyelftools/examples/reference_output/dwarf_die_tree.out
@@ -1,11 +1,11 @@
Processing file: ./examples/sample_exe64.elf
Found a compile unit at offset 0, length 115
Top DIE with tag=DW_TAG_compile_unit
- name=/usr/src/packages/BUILD/glibc-2.11.1/csu/../sysdeps/x86_64/elf/start.S
+ name=../sysdeps/x86_64/elf/start.S
DIE tag=DW_TAG_compile_unit
Found a compile unit at offset 119, length 135
Top DIE with tag=DW_TAG_compile_unit
- name=/usr/src/packages/BUILD/glibc-2.11.1/csu/init.c
+ name=init.c
DIE tag=DW_TAG_compile_unit
DIE tag=DW_TAG_base_type
DIE tag=DW_TAG_base_type
@@ -21,7 +21,7 @@ Processing file: ./examples/sample_exe64.elf
DIE tag=DW_TAG_const_type
Found a compile unit at offset 258, length 156
Top DIE with tag=DW_TAG_compile_unit
- name=/tmp/ebenders/z.c
+ name=z.c
DIE tag=DW_TAG_compile_unit
DIE tag=DW_TAG_subprogram
DIE tag=DW_TAG_formal_parameter
@@ -33,7 +33,7 @@ Processing file: ./examples/sample_exe64.elf
DIE tag=DW_TAG_variable
Found a compile unit at offset 418, length 300
Top DIE with tag=DW_TAG_compile_unit
- name=/usr/src/packages/BUILD/glibc-2.11.1/csu/elf-init.c
+ name=elf-init.c
DIE tag=DW_TAG_compile_unit
DIE tag=DW_TAG_base_type
DIE tag=DW_TAG_typedef
diff --git a/chromium/third_party/pyelftools/examples/reference_output/examine_dwarf_info.out b/chromium/third_party/pyelftools/examples/reference_output/examine_dwarf_info.out
index 51146264cc9..968be294a67 100644
--- a/chromium/third_party/pyelftools/examples/reference_output/examine_dwarf_info.out
+++ b/chromium/third_party/pyelftools/examples/reference_output/examine_dwarf_info.out
@@ -1,13 +1,13 @@
Processing file: ./examples/sample_exe64.elf
Found a compile unit at offset 0, length 115
Top DIE with tag=DW_TAG_compile_unit
- name=/usr/src/packages/BUILD/glibc-2.11.1/csu/../sysdeps/x86_64/elf/start.S
+ name=../sysdeps/x86_64/elf/start.S
Found a compile unit at offset 119, length 135
Top DIE with tag=DW_TAG_compile_unit
- name=/usr/src/packages/BUILD/glibc-2.11.1/csu/init.c
+ name=init.c
Found a compile unit at offset 258, length 156
Top DIE with tag=DW_TAG_compile_unit
- name=/tmp/ebenders/z.c
+ name=z.c
Found a compile unit at offset 418, length 300
Top DIE with tag=DW_TAG_compile_unit
- name=/usr/src/packages/BUILD/glibc-2.11.1/csu/elf-init.c
+ name=elf-init.c
diff --git a/chromium/third_party/pyelftools/pyelftools.sublime-project b/chromium/third_party/pyelftools/pyelftools.sublime-project
deleted file mode 100644
index a92140cdf39..00000000000
--- a/chromium/third_party/pyelftools/pyelftools.sublime-project
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "folders":
- [
- {
- "path": ".",
- "folder_exclude_patterns": ["build", "dist", ".tox", ".hg"]
- }
- ]
-}
diff --git a/chromium/third_party/pyelftools/scripts/readelf.py b/chromium/third_party/pyelftools/scripts/readelf.py
index 8179c013a54..04c75bafca3 100755
--- a/chromium/third_party/pyelftools/scripts/readelf.py
+++ b/chromium/third_party/pyelftools/scripts/readelf.py
@@ -11,24 +11,20 @@ import os, sys
from optparse import OptionParser
import string
-# For running from development directory. It should take precedence over the
-# installed pyelftools.
-sys.path.insert(0, '.')
-
+# If elftools is not installed, maybe we're running from the root or scripts
+# dir of the source distribution
+try:
+ import elftools
+except ImportError:
+ sys.path.extend(['.', '..'])
from elftools import __version__
from elftools.common.exceptions import ELFError
from elftools.common.py3compat import (
ifilter, byte2int, bytes2str, itervalues, str2bytes)
from elftools.elf.elffile import ELFFile
-from elftools.elf.dynamic import DynamicSection, DynamicSegment
-from elftools.elf.enums import ENUM_D_TAG
from elftools.elf.segments import InterpSegment
from elftools.elf.sections import SymbolTableSection
-from elftools.elf.gnuversions import (
- GNUVerSymSection, GNUVerDefSection,
- GNUVerNeedSection,
- )
from elftools.elf.relocation import RelocationSection
from elftools.elf.descriptions import (
describe_ei_class, describe_ei_data, describe_ei_version,
@@ -36,10 +32,8 @@ from elftools.elf.descriptions import (
describe_e_version_numeric, describe_p_type, describe_p_flags,
describe_sh_type, describe_sh_flags,
describe_symbol_type, describe_symbol_bind, describe_symbol_visibility,
- describe_symbol_shndx, describe_reloc_type, describe_dyn_tag,
- describe_ver_flags,
+ describe_symbol_shndx, describe_reloc_type,
)
-from elftools.elf.constants import E_FLAGS
from elftools.dwarf.dwarfinfo import DWARFInfo
from elftools.dwarf.descriptions import (
describe_reg_name, describe_attr_value, set_global_machine_arch,
@@ -55,20 +49,18 @@ class ReadElf(object):
""" display_* methods are used to emit output into the output stream
"""
def __init__(self, file, output):
- """ file:
+ """ file:
stream object with the ELF file to read
-
+
output:
output stream to write to
"""
self.elffile = ELFFile(file)
self.output = output
-
+
# Lazily initialized if a debug dump is requested
self._dwarfinfo = None
- self._versioninfo = None
-
def display_file_header(self):
""" Display the ELF file header
"""
@@ -78,33 +70,32 @@ class ReadElf(object):
for b in self.elffile.e_ident_raw))
header = self.elffile.header
e_ident = header['e_ident']
- self._emitline(' Class: %s' %
+ self._emitline(' Class: %s' %
describe_ei_class(e_ident['EI_CLASS']))
- self._emitline(' Data: %s' %
+ self._emitline(' Data: %s' %
describe_ei_data(e_ident['EI_DATA']))
- self._emitline(' Version: %s' %
+ self._emitline(' Version: %s' %
describe_ei_version(e_ident['EI_VERSION']))
self._emitline(' OS/ABI: %s' %
describe_ei_osabi(e_ident['EI_OSABI']))
- self._emitline(' ABI Version: %d' %
+ self._emitline(' ABI Version: %d' %
e_ident['EI_ABIVERSION'])
self._emitline(' Type: %s' %
describe_e_type(header['e_type']))
- self._emitline(' Machine: %s' %
+ self._emitline(' Machine: %s' %
describe_e_machine(header['e_machine']))
self._emitline(' Version: %s' %
describe_e_version_numeric(header['e_version']))
- self._emitline(' Entry point address: %s' %
+ self._emitline(' Entry point address: %s' %
self._format_hex(header['e_entry']))
- self._emit(' Start of program headers: %s' %
+ self._emit(' Start of program headers: %s' %
header['e_phoff'])
self._emitline(' (bytes into file)')
- self._emit(' Start of section headers: %s' %
+ self._emit(' Start of section headers: %s' %
header['e_shoff'])
self._emitline(' (bytes into file)')
- self._emitline(' Flags: %s%s' %
- (self._format_hex(header['e_flags']),
- self.decode_flags(header['e_flags'])))
+ self._emitline(' Flags: %s' %
+ self._format_hex(header['e_flags']))
self._emitline(' Size of this header: %s (bytes)' %
header['e_ehsize'])
self._emitline(' Size of program headers: %s (bytes)' %
@@ -118,17 +109,6 @@ class ReadElf(object):
self._emitline(' Section header string table index: %s' %
header['e_shstrndx'])
- def decode_flags(self, flags):
- description = ""
- if self.elffile['e_machine'] == "EM_ARM":
- if flags & E_FLAGS.EF_ARM_HASENTRY:
- description += ", has entry point"
-
- version = flags & E_FLAGS.EF_ARM_EABIMASK
- if version == E_FLAGS.EF_ARM_EABI_VER5:
- description += ", Version5 EABI"
- return description
-
def display_program_headers(self, show_heading=True):
""" Display the ELF program headers.
If show_heading is True, displays the heading for this information
@@ -193,14 +173,14 @@ class ReadElf(object):
self._format_hex(segment['p_align'], lead0x=False)))
if isinstance(segment, InterpSegment):
- self._emitline(' [Requesting program interpreter: %s]' %
+ self._emitline(' [Requesting program interpreter: %s]' %
bytes2str(segment.get_interp_name()))
# Sections to segments mapping
#
if self.elffile.num_sections() == 0:
# No sections? We're done
- return
+ return
self._emitline('\n Section to Segment mapping:')
self._emitline(' Segment Sections...')
@@ -209,7 +189,7 @@ class ReadElf(object):
self._emit(' %2.2d ' % nseg)
for section in self.elffile.iter_sections():
- if ( not section.is_null() and
+ if ( not section.is_null() and
segment.section_in_segment(section)):
self._emit('%s ' % bytes2str(section.name))
@@ -274,8 +254,6 @@ class ReadElf(object):
def display_symbol_tables(self):
""" Display the symbol tables contained in the file
"""
- self._init_versioninfo()
-
for section in self.elffile.iter_sections():
if not isinstance(section, SymbolTableSection):
continue
@@ -294,85 +272,17 @@ class ReadElf(object):
self._emitline(' Num: Value Size Type Bind Vis Ndx Name')
for nsym, symbol in enumerate(section.iter_symbols()):
-
- version_info = ''
- # readelf doesn't display version info for Solaris versioning
- if (section['sh_type'] == 'SHT_DYNSYM' and
- self._versioninfo['type'] == 'GNU'):
- version = self._symbol_version(nsym)
- if (version['name'] != bytes2str(symbol.name) and
- version['index'] not in ('VER_NDX_LOCAL',
- 'VER_NDX_GLOBAL')):
- if version['filename']:
- # external symbol
- version_info = '@%(name)s (%(index)i)' % version
- else:
- # internal symbol
- if version['hidden']:
- version_info = '@%(name)s' % version
- else:
- version_info = '@@%(name)s' % version
-
# symbol names are truncated to 25 chars, similarly to readelf
- self._emitline('%6d: %s %5d %-7s %-6s %-7s %4s %.25s%s' % (
+ self._emitline('%6d: %s %5d %-7s %-6s %-7s %4s %.25s' % (
nsym,
- self._format_hex(
- symbol['st_value'], fullhex=True, lead0x=False),
+ self._format_hex(symbol['st_value'], fullhex=True, lead0x=False),
symbol['st_size'],
describe_symbol_type(symbol['st_info']['type']),
describe_symbol_bind(symbol['st_info']['bind']),
describe_symbol_visibility(symbol['st_other']['visibility']),
describe_symbol_shndx(symbol['st_shndx']),
- bytes2str(symbol.name),
- version_info))
-
- def display_dynamic_tags(self):
- """ Display the dynamic tags contained in the file
- """
- has_dynamic_sections = False
- for section in self.elffile.iter_sections():
- if not isinstance(section, DynamicSection):
- continue
-
- has_dynamic_sections = True
- self._emitline("\nDynamic section at offset %s contains %s entries:" % (
- self._format_hex(section['sh_offset']),
- section.num_tags()))
- self._emitline(" Tag Type Name/Value")
-
- padding = 20 + (8 if self.elffile.elfclass == 32 else 0)
- for tag in section.iter_tags():
- if tag.entry.d_tag == 'DT_NEEDED':
- parsed = 'Shared library: [%s]' % bytes2str(tag.needed)
- elif tag.entry.d_tag == 'DT_RPATH':
- parsed = 'Library rpath: [%s]' % bytes2str(tag.rpath)
- elif tag.entry.d_tag == 'DT_RUNPATH':
- parsed = 'Library runpath: [%s]' % bytes2str(tag.runpath)
- elif tag.entry.d_tag == 'DT_SONAME':
- parsed = 'Library soname: [%s]' % bytes2str(tag.soname)
- elif tag.entry.d_tag.endswith(('SZ', 'ENT')):
- parsed = '%i (bytes)' % tag['d_val']
- elif tag.entry.d_tag.endswith(('NUM', 'COUNT')):
- parsed = '%i' % tag['d_val']
- elif tag.entry.d_tag == 'DT_PLTREL':
- s = describe_dyn_tag(tag.entry.d_val)
- if s.startswith('DT_'):
- s = s[3:]
- parsed = '%s' % s
- else:
- parsed = '%#x' % tag['d_val']
-
- self._emitline(" %s %-*s %s" % (
- self._format_hex(ENUM_D_TAG.get(tag.entry.d_tag, tag.entry.d_tag),
- fullhex=True, lead0x=True),
- padding,
- '(%s)' % (tag.entry.d_tag[3:],),
- parsed))
- if not has_dynamic_sections:
- # readelf only prints this if there is at least one segment
- if self.elffile.num_segments():
- self._emitline("\nThere is no dynamic section in this file.")
-
+ bytes2str(symbol.name)))
+
def display_relocations(self):
""" Display the relocations contained in the file
"""
@@ -397,9 +307,9 @@ class ReadElf(object):
for rel in section.iter_relocations():
hexwidth = 8 if self.elffile.elfclass == 32 else 12
self._emit('%s %s %-17.17s' % (
- self._format_hex(rel['r_offset'],
+ self._format_hex(rel['r_offset'],
fieldsize=hexwidth, lead0x=False),
- self._format_hex(rel['r_info'],
+ self._format_hex(rel['r_info'],
fieldsize=hexwidth, lead0x=False),
describe_reloc_type(
rel['r_info_type'], self.elffile)))
@@ -430,112 +340,7 @@ class ReadElf(object):
if not has_relocation_sections:
self._emitline('\nThere are no relocations in this file.')
-
- def display_version_info(self):
- """ Display the version info contained in the file
- """
- self._init_versioninfo()
-
- if not self._versioninfo['type']:
- self._emitline("\nNo version information found in this file.")
- return
-
- for section in self.elffile.iter_sections():
- if isinstance(section, GNUVerSymSection):
- self._print_version_section_header(
- section, 'Version symbols', lead0x=False)
-
- num_symbols = section.num_symbols()
-
- # Symbol version info are printed four by four entries
- for idx_by_4 in range(0, num_symbols, 4):
-
- self._emit(' %03x:' % idx_by_4)
-
- for idx in range(idx_by_4, min(idx_by_4 + 4, num_symbols)):
-
- symbol_version = self._symbol_version(idx)
- if symbol_version['index'] == 'VER_NDX_LOCAL':
- version_index = 0
- version_name = '(*local*)'
- elif symbol_version['index'] == 'VER_NDX_GLOBAL':
- version_index = 1
- version_name = '(*global*)'
- else:
- version_index = symbol_version['index']
- version_name = '(%(name)s)' % symbol_version
-
- visibility = 'h' if symbol_version['hidden'] else ' '
-
- self._emit('%4x%s%-13s' % (
- version_index, visibility, version_name))
-
- self._emitline()
-
- elif isinstance(section, GNUVerDefSection):
- self._print_version_section_header(
- section, 'Version definition', indent=2)
-
- offset = 0
- for verdef, verdaux_iter in section.iter_versions():
- verdaux = next(verdaux_iter)
-
- name = verdaux.name
- if verdef['vd_flags']:
- flags = describe_ver_flags(verdef['vd_flags'])
- # Mimic exactly the readelf output
- flags += ' '
- else:
- flags = 'none'
-
- self._emitline(' %s: Rev: %i Flags: %s Index: %i'
- ' Cnt: %i Name: %s' % (
- self._format_hex(offset, fieldsize=6,
- alternate=True),
- verdef['vd_version'], flags, verdef['vd_ndx'],
- verdef['vd_cnt'], bytes2str(name)))
-
- verdaux_offset = (
- offset + verdef['vd_aux'] + verdaux['vda_next'])
- for idx, verdaux in enumerate(verdaux_iter, start=1):
- self._emitline(' %s: Parent %i: %s' %
- (self._format_hex(verdaux_offset, fieldsize=4),
- idx, bytes2str(verdaux.name)))
- verdaux_offset += verdaux['vda_next']
-
- offset += verdef['vd_next']
-
- elif isinstance(section, GNUVerNeedSection):
- self._print_version_section_header(section, 'Version needs')
-
- offset = 0
- for verneed, verneed_iter in section.iter_versions():
-
- self._emitline(' %s: Version: %i File: %s Cnt: %i' % (
- self._format_hex(offset, fieldsize=6,
- alternate=True),
- verneed['vn_version'], bytes2str(verneed.name),
- verneed['vn_cnt']))
-
- vernaux_offset = offset + verneed['vn_aux']
- for idx, vernaux in enumerate(verneed_iter, start=1):
- if vernaux['vna_flags']:
- flags = describe_ver_flags(vernaux['vna_flags'])
- # Mimic exactly the readelf output
- flags += ' '
- else:
- flags = 'none'
-
- self._emitline(
- ' %s: Name: %s Flags: %s Version: %i' % (
- self._format_hex(vernaux_offset, fieldsize=4),
- bytes2str(vernaux.name), flags,
- vernaux['vna_other']))
-
- vernaux_offset += vernaux['vna_next']
-
- offset += verneed['vn_next']
-
+
def display_hex_dump(self, section_spec):
""" Display a hex dump of a section. section_spec is either a section
number or a name.
@@ -596,7 +401,7 @@ class ReadElf(object):
dataptr = 0
while dataptr < len(data):
- while ( dataptr < len(data) and
+ while ( dataptr < len(data) and
not (32 <= byte2int(data[dataptr]) <= 127)):
dataptr += 1
@@ -624,7 +429,7 @@ class ReadElf(object):
self._init_dwarfinfo()
if self._dwarfinfo is None:
return
-
+
set_global_machine_arch(self.elffile.get_machine_arch())
if dump_what == 'info':
@@ -638,8 +443,7 @@ class ReadElf(object):
else:
self._emitline('debug dump not yet supported for "%s"' % dump_what)
- def _format_hex(self, addr, fieldsize=None, fullhex=False, lead0x=True,
- alternate=False):
+ def _format_hex(self, addr, fieldsize=None, fullhex=False, lead0x=True):
""" Format an address into a hexadecimal string.
fieldsize:
@@ -649,25 +453,12 @@ class ReadElf(object):
If None, the minimal required field size will be used.
fullhex:
- If True, override fieldsize to set it to the maximal size
+ If True, override fieldsize to set it to the maximal size
needed for the elfclass
lead0x:
If True, leading 0x is added
-
- alternate:
- If True, override lead0x to emulate the alternate
- hexadecimal form specified in format string with the #
- character: only non-zero values are prefixed with 0x.
- This form is used by readelf.
"""
- if alternate:
- if addr == 0:
- lead0x = False
- else:
- lead0x = True
- fieldsize -= 2
-
s = '0x' if lead0x else ''
if fullhex:
fieldsize = 8 if self.elffile.elfclass == 32 else 16
@@ -676,98 +467,7 @@ class ReadElf(object):
else:
field = '%' + '0%sx' % fieldsize
return s + field % addr
-
- def _print_version_section_header(self, version_section, name, lead0x=True,
- indent=1):
- """ Print a section header of one version related section (versym,
- verneed or verdef) with some options to accomodate readelf
- little differences between each header (e.g. indentation
- and 0x prefixing).
- """
- if hasattr(version_section, 'num_versions'):
- num_entries = version_section.num_versions()
- else:
- num_entries = version_section.num_symbols()
-
- self._emitline("\n%s section '%s' contains %s entries:" %
- (name, bytes2str(version_section.name), num_entries))
- self._emitline('%sAddr: %s Offset: %s Link: %i (%s)' % (
- ' ' * indent,
- self._format_hex(
- version_section['sh_addr'], fieldsize=16, lead0x=lead0x),
- self._format_hex(
- version_section['sh_offset'], fieldsize=6, lead0x=True),
- version_section['sh_link'],
- bytes2str(
- self.elffile.get_section(version_section['sh_link']).name)
- )
- )
-
- def _init_versioninfo(self):
- """ Search and initialize informations about version related sections
- and the kind of versioning used (GNU or Solaris).
- """
- if self._versioninfo is not None:
- return
-
- self._versioninfo = {'versym': None, 'verdef': None,
- 'verneed': None, 'type': None}
-
- for section in self.elffile.iter_sections():
- if isinstance(section, GNUVerSymSection):
- self._versioninfo['versym'] = section
- elif isinstance(section, GNUVerDefSection):
- self._versioninfo['verdef'] = section
- elif isinstance(section, GNUVerNeedSection):
- self._versioninfo['verneed'] = section
- elif isinstance(section, DynamicSection):
- for tag in section.iter_tags():
- if tag['d_tag'] == 'DT_VERSYM':
- self._versioninfo['type'] = 'GNU'
- break
-
- if not self._versioninfo['type'] and (
- self._versioninfo['verneed'] or self._versioninfo['verdef']):
- self._versioninfo['type'] = 'Solaris'
-
- def _symbol_version(self, nsym):
- """ Return a dict containing information on the
- or None if no version information is available
- """
- self._init_versioninfo()
-
- symbol_version = dict.fromkeys(('index', 'name', 'filename', 'hidden'))
-
- if (not self._versioninfo['versym'] or
- nsym >= self._versioninfo['versym'].num_symbols()):
- return None
-
- symbol = self._versioninfo['versym'].get_symbol(nsym)
- index = symbol.entry['ndx']
- if not index in ('VER_NDX_LOCAL', 'VER_NDX_GLOBAL'):
- index = int(index)
-
- if self._versioninfo['type'] == 'GNU':
- # In GNU versioning mode, the highest bit is used to
- # store wether the symbol is hidden or not
- if index & 0x8000:
- index &= ~0x8000
- symbol_version['hidden'] = True
-
- if (self._versioninfo['verdef'] and
- index <= self._versioninfo['verdef'].num_versions()):
- _, verdaux_iter = \
- self._versioninfo['verdef'].get_version(index)
- symbol_version['name'] = bytes2str(next(verdaux_iter).name)
- else:
- verneed, vernaux = \
- self._versioninfo['verneed'].get_version(index)
- symbol_version['name'] = bytes2str(vernaux.name)
- symbol_version['filename'] = bytes2str(verneed.name)
-
- symbol_version['index'] = index
- return symbol_version
-
+
def _section_from_spec(self, spec):
""" Retrieve a section given a "spec" (either number or name).
Return None if no such section exists in the file.
@@ -775,7 +475,7 @@ class ReadElf(object):
try:
num = int(spec)
if num < self.elffile.num_sections():
- return self.elffile.get_section(num)
+ return self.elffile.get_section(num)
else:
return None
except ValueError:
@@ -800,7 +500,7 @@ class ReadElf(object):
"""
if self._dwarfinfo is not None:
return
-
+
if self.elffile.has_dwarf_info():
self._dwarfinfo = self.elffile.get_dwarf_info()
else:
@@ -810,7 +510,7 @@ class ReadElf(object):
""" Dump the debugging info section.
"""
self._emitline('Contents of the .debug_info section:\n')
-
+
# Offset of the .debug_info section in the stream
section_offset = self._dwarfinfo.debug_info_sec.global_offset
@@ -821,11 +521,10 @@ class ReadElf(object):
self._format_hex(cu['unit_length']),
'%s-bit' % cu.dwarf_format()))
self._emitline(' Version: %s' % cu['version']),
- self._emitline(' Abbrev Offset: %s' % (
- self._format_hex(cu['debug_abbrev_offset']))),
+ self._emitline(' Abbrev Offset: %s' % cu['debug_abbrev_offset']),
self._emitline(' Pointer Size: %s' % cu['address_size'])
-
- # The nesting depth of each DIE within the tree of DIEs must be
+
+ # The nesting depth of each DIE within the tree of DIEs must be
# displayed. To implement this, a counter is incremented each time
# the current DIE has children, and decremented when a null die is
# encountered. Due to the way the DIE tree is serialized, this will
@@ -833,15 +532,15 @@ class ReadElf(object):
#
die_depth = 0
for die in cu.iter_DIEs():
- self._emitline(' <%s><%x>: Abbrev Number: %s%s' % (
- die_depth,
- die.offset,
- die.abbrev_code,
- (' (%s)' % die.tag) if not die.is_null() else ''))
if die.is_null():
die_depth -= 1
continue
-
+ self._emitline(' <%s><%x>: Abbrev Number: %s (%s)' % (
+ die_depth,
+ die.offset,
+ die.abbrev_code,
+ die.tag))
+
for attr in itervalues(die.attributes):
name = attr.name
# Unknown attribute values are passed-through as integers
@@ -852,10 +551,10 @@ class ReadElf(object):
name,
describe_attr_value(
attr, die, section_offset)))
-
+
if die.has_children:
die_depth += 1
-
+
self._emitline()
def _dump_debug_line_programs(self):
@@ -867,14 +566,13 @@ class ReadElf(object):
for cu in self._dwarfinfo.iter_CUs():
lineprogram = self._dwarfinfo.line_program_for_CU(cu)
- cu_filename = bytes2str(lineprogram['file_entry'][0].name)
+ cu_filename = ''
if len(lineprogram['include_directory']) > 0:
- dir_index = lineprogram['file_entry'][0].dir_index
- if dir_index > 0:
- dir = lineprogram['include_directory'][dir_index - 1]
- else:
- dir = b'.'
- cu_filename = '%s/%s' % (bytes2str(dir), cu_filename)
+ cu_filename = '%s/%s' % (
+ bytes2str(lineprogram['include_directory'][0]),
+ bytes2str(lineprogram['file_entry'][0].name))
+ else:
+ cu_filename = bytes2str(lineprogram['file_entry'][0].name)
self._emitline('CU: %s:' % cu_filename)
self._emitline('File name Line number Starting address')
@@ -906,7 +604,7 @@ class ReadElf(object):
self._emitline('%-35s %11d %18s' % (
bytes2str(lineprogram['file_entry'][state.file - 1].name),
state.line,
- '0' if state.address == 0 else
+ '0' if state.address == 0 else
self._format_hex(state.address)))
if entry.command == DW_LNS_copy:
# Another readelf oddity...
@@ -921,10 +619,8 @@ class ReadElf(object):
for entry in self._dwarfinfo.CFI_entries():
if isinstance(entry, CIE):
- self._emitline('\n%08x %s %s CIE' % (
- entry.offset,
- self._format_hex(entry['length'], fullhex=True, lead0x=False),
- self._format_hex(entry['CIE_id'], fullhex=True, lead0x=False)))
+ self._emitline('\n%08x %08x %08x CIE' % (
+ entry.offset, entry['length'], entry['CIE_id']))
self._emitline(' Version: %d' % entry['version'])
self._emitline(' Augmentation: "%s"' % bytes2str(entry['augmentation']))
self._emitline(' Code alignment factor: %u' % entry['code_alignment_factor'])
@@ -932,15 +628,13 @@ class ReadElf(object):
self._emitline(' Return address column: %d' % entry['return_address_register'])
self._emitline()
else: # FDE
- self._emitline('\n%08x %s %s FDE cie=%08x pc=%s..%s' % (
+ self._emitline('\n%08x %08x %08x FDE cie=%08x pc=%08x..%08x' % (
entry.offset,
- self._format_hex(entry['length'], fullhex=True, lead0x=False),
- self._format_hex(entry['CIE_pointer'], fullhex=True, lead0x=False),
+ entry['length'],
+ entry['CIE_pointer'],
entry.cie.offset,
- self._format_hex(entry['initial_location'], fullhex=True, lead0x=False),
- self._format_hex(
- entry['initial_location'] + entry['address_range'],
- fullhex=True, lead0x=False)))
+ entry['initial_location'],
+ entry['initial_location'] + entry['address_range']))
self._emit(describe_CFI_instructions(entry))
self._emitline()
@@ -955,24 +649,23 @@ class ReadElf(object):
for entry in self._dwarfinfo.CFI_entries():
if isinstance(entry, CIE):
- self._emitline('\n%08x %s %s CIE "%s" cf=%d df=%d ra=%d' % (
+ self._emitline('\n%08x %08x %08x CIE "%s" cf=%d df=%d ra=%d' % (
entry.offset,
- self._format_hex(entry['length'], fullhex=True, lead0x=False),
- self._format_hex(entry['CIE_id'], fullhex=True, lead0x=False),
+ entry['length'],
+ entry['CIE_id'],
bytes2str(entry['augmentation']),
entry['code_alignment_factor'],
entry['data_alignment_factor'],
entry['return_address_register']))
ra_regnum = entry['return_address_register']
else: # FDE
- self._emitline('\n%08x %s %s FDE cie=%08x pc=%s..%s' % (
+ self._emitline('\n%08x %08x %08x FDE cie=%08x pc=%08x..%08x' % (
entry.offset,
- self._format_hex(entry['length'], fullhex=True, lead0x=False),
- self._format_hex(entry['CIE_pointer'], fullhex=True, lead0x=False),
+ entry['length'],
+ entry['CIE_pointer'],
entry.cie.offset,
- self._format_hex(entry['initial_location'], fullhex=True, lead0x=False),
- self._format_hex(entry['initial_location'] + entry['address_range'],
- fullhex=True, lead0x=False)))
+ entry['initial_location'],
+ entry['initial_location'] + entry['address_range']))
ra_regnum = entry.cie['return_address_register']
# Print the heading row for the decoded table
@@ -986,14 +679,14 @@ class ReadElf(object):
# ra_regnum is always listed last with a special heading.
decoded_table = entry.get_decoded()
reg_order = sorted(ifilter(
- lambda r: r != ra_regnum,
+ lambda r: r != ra_regnum,
decoded_table.reg_order))
# Headings for the registers
for regnum in reg_order:
self._emit('%-6s' % describe_reg_name(regnum))
self._emitline('ra ')
-
+
# Now include ra_regnum in reg_order to print its values similarly
# to the other registers.
reg_order.append(ra_regnum)
@@ -1034,9 +727,6 @@ def main(stream=None):
add_help_option=False, # -h is a real option of readelf
prog='readelf.py',
version=VERSION_STRING)
- optparser.add_option('-d', '--dynamic',
- action='store_true', dest='show_dynamic_tags',
- help='Display the dynamic section')
optparser.add_option('-H', '--help',
action='store_true', dest='help',
help='Display this information')
@@ -1064,9 +754,6 @@ def main(stream=None):
optparser.add_option('-p', '--string-dump',
action='store', dest='show_string_dump', metavar='<number|name>',
help='Dump the contents of section <number|name> as strings')
- optparser.add_option('-V', '--version-info',
- action='store_true', dest='show_version_info',
- help='Display the version sections (if present)')
optparser.add_option('--debug-dump',
action='store', dest='debug_dump_what', metavar='<what>',
help=(
@@ -1097,14 +784,10 @@ def main(stream=None):
if do_program_header:
readelf.display_program_headers(
show_heading=not do_file_header)
- if options.show_dynamic_tags:
- readelf.display_dynamic_tags()
if options.show_symbols:
readelf.display_symbol_tables()
if options.show_relocs:
readelf.display_relocations()
- if options.show_version_info:
- readelf.display_version_info()
if options.show_hex_dump:
readelf.display_hex_dump(options.show_hex_dump)
if options.show_string_dump:
diff --git a/chromium/third_party/pyelftools/setup.py b/chromium/third_party/pyelftools/setup.py
index c6beb1682f0..3103e19892e 100644
--- a/chromium/third_party/pyelftools/setup.py
+++ b/chromium/third_party/pyelftools/setup.py
@@ -24,11 +24,11 @@ setup(
description='Library for analyzing ELF files and DWARF debugging information',
long_description=description,
license='Public domain',
- version='0.22',
+ version='0.20',
author='Eli Bendersky',
maintainer='Eli Bendersky',
author_email='eliben@gmail.com',
- url='https://github.com/eliben/pyelftools',
+ url='https://bitbucket.org/eliben/pyelftools',
platforms='Cross Platform',
classifiers = [
'Programming Language :: Python :: 2',
@@ -44,5 +44,7 @@ setup(
'elftools.construct', 'elftools.construct.lib',
],
- scripts=['scripts/readelf.py']
+ scripts=['scripts/readelf.py'],
)
+
+
diff --git a/chromium/third_party/pyelftools/tox.ini b/chromium/third_party/pyelftools/tox.ini
index 600ca1c9a60..73fbb848535 100644
--- a/chromium/third_party/pyelftools/tox.ini
+++ b/chromium/third_party/pyelftools/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py27,py33
+envlist = py27,py26,py32
[testenv]
commands =
@@ -10,3 +10,4 @@ commands =
[testenv:py26]
deps =
unittest2
+
diff --git a/chromium/third_party/pyelftools/z.py b/chromium/third_party/pyelftools/z.py
index 18f7d35b844..d30feb3e106 100644
--- a/chromium/third_party/pyelftools/z.py
+++ b/chromium/third_party/pyelftools/z.py
@@ -1,10 +1,3 @@
-#-------------------------------------------------------------------------------
-# elftools
-#
-# Eli Bendersky (eliben@gmail.com)
-# This code is in the public domain
-#-------------------------------------------------------------------------------
-
# Just a script for playing around with pyelftools during testing
# please ignore it!
#
diff --git a/chromium/third_party/skia/src/core/SkPathRef.cpp b/chromium/third_party/skia/src/core/SkPathRef.cpp
index f0fda2703b5..33382253917 100644
--- a/chromium/third_party/skia/src/core/SkPathRef.cpp
+++ b/chromium/third_party/skia/src/core/SkPathRef.cpp
@@ -190,6 +190,11 @@ void SkPathRef::CreateTransformedCopy(sk_sp<SkPathRef>* dst,
// or if an invalid verb is encountered, return false.
static bool deduce_pts_conics(const uint8_t verbs[], int vCount, int* ptCountPtr,
int* conicCountPtr) {
+ // When there is at least one verb, the first is required to be kMove_Verb.
+ if (0 < vCount && verbs[vCount-1] != SkPath::kMove_Verb) {
+ return false;
+ }
+
int ptCount = 0;
int conicCount = 0;
for (int i = 0; i < vCount; ++i) {
diff --git a/chromium/third_party/skia/tools/gyp b/chromium/third_party/skia/tools/gyp
deleted file mode 120000
index d871f5b0075..00000000000
--- a/chromium/third_party/skia/tools/gyp
+++ /dev/null
@@ -1 +0,0 @@
-../third_party/externals/gyp/ \ No newline at end of file
diff --git a/chromium/third_party/sqlite/amalgamation/sqlite3.c b/chromium/third_party/sqlite/amalgamation/sqlite3.c
index f0075cfb318..68fd260459c 100644
--- a/chromium/third_party/sqlite/amalgamation/sqlite3.c
+++ b/chromium/third_party/sqlite/amalgamation/sqlite3.c
@@ -4065,6 +4065,15 @@ typedef struct sqlite3_context sqlite3_context;
** [sqlite3_blob_open | incremental BLOB I/O] routines.
** ^A negative value for the zeroblob results in a zero-length BLOB.
**
+** ^The sqlite3_bind_pointer(S,I,P) routine causes the I-th parameter in
+** [prepared statement] S to have an SQL value of NULL, but to also be
+** associated with the pointer P.
+** ^The sqlite3_bind_pointer() routine can be used to pass
+** host-language pointers into [application-defined SQL functions].
+** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
+** to be an ordinary SQL NULL value to everything other than
+** [sqlite3_value_pointer()].
+**
** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
** for the [prepared statement] or with a prepared statement for which
** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
@@ -4098,6 +4107,7 @@ SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)
SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
void(*)(void*), unsigned char encoding);
SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
+SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*);
SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
@@ -4867,6 +4877,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
** extract UTF-16 strings as big-endian and little-endian respectively.
**
+** ^If [sqlite3_value] object V was initialized
+** using [sqlite3_bind_pointer(S,I,P)] or [sqlite3_result_pointer(C,P)], then
+** sqlite3_value_pointer(V) will return the pointer P. Otherwise,
+** sqlite3_value_pointer(V) returns a NULL.
+**
** ^(The sqlite3_value_numeric_type() interface attempts to apply
** numeric affinity to the value. This means that an attempt is
** made to convert the value to an integer or floating point. If
@@ -4894,6 +4909,7 @@ SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
+SQLITE_API void *sqlite3_value_pointer(sqlite3_value*);
SQLITE_API int sqlite3_value_type(sqlite3_value*);
SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
@@ -4906,10 +4922,6 @@ SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
** information can be used to pass a limited amount of context from
** one SQL function to another. Use the [sqlite3_result_subtype()]
** routine to set the subtype for the return value of an SQL function.
-**
-** SQLite makes no use of subtype itself. It merely passes the subtype
-** from the result of one [application-defined SQL function] into the
-** input of another.
*/
SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*);
@@ -5187,6 +5199,14 @@ typedef void (*sqlite3_destructor_type)(void*);
** [unprotected sqlite3_value] object is required, so either
** kind of [sqlite3_value] object can be used with this interface.
**
+** ^The sqlite3_result_pointer(C,P) interface sets the result to an
+** SQL NULL value, just like [sqlite3_result_null(C)], except that it
+** also associates the host-language pointer P with that NULL value such
+** that the pointer can be retrieved within an
+** [application-defined SQL function] using [sqlite3_value_pointer()].
+** This mechanism can be used to pass non-SQL values between
+** application-defined functions.
+**
** If these routines are called from within the different thread
** than the one containing the application-defined function that received
** the [sqlite3_context] pointer, the results are undefined.
@@ -5210,6 +5230,7 @@ SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*
SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
+SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*);
SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
@@ -18089,6 +18110,7 @@ struct Mem {
double r; /* Real value used when MEM_Real is set in flags */
i64 i; /* Integer value used when MEM_Int is set in flags */
int nZero; /* Used when bit MEM_Zero is set in flags */
+ void *pPtr; /* Pointer when flags=MEM_NULL and eSubtype='p' */
FuncDef *pDef; /* Used only when flags==MEM_Agg */
RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
@@ -18374,6 +18396,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem*, i64);
#else
SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem*, double);
#endif
+SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem*, void*);
SQLITE_PRIVATE void sqlite3VdbeMemInit(Mem*,sqlite3*,u16);
SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem*);
SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem*,int);
@@ -70280,6 +70303,17 @@ SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
}
}
+/*
+** Set the value stored in *pMem should already be a NULL.
+** Also store a pointer to go with it.
+*/
+SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem *pMem, void *pPtr){
+ assert( pMem->flags==MEM_Null );
+ pMem->flags = MEM_Null|MEM_Subtype;
+ pMem->u.pPtr = pPtr;
+ pMem->eSubtype = 'p';
+}
+
#ifndef SQLITE_OMIT_FLOATING_POINT
/*
** Delete any previous value and set the value stored in *pMem to val,
@@ -76159,6 +76193,14 @@ SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
Mem *pMem = (Mem*)pVal;
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
}
+SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal){
+ Mem *p = (Mem*)pVal;
+ if( (p->flags & MEM_TypeMask)==(MEM_Null|MEM_Subtype) && p->eSubtype=='p' ){
+ return p->u.pPtr;
+ }else{
+ return 0;
+ }
+}
SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
}
@@ -76337,6 +76379,12 @@ SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
sqlite3VdbeMemSetNull(pCtx->pOut);
}
+SQLITE_API void sqlite3_result_pointer(sqlite3_context *pCtx, void *pPtr){
+ Mem *pOut = pCtx->pOut;
+ assert( sqlite3_mutex_held(pOut->db->mutex) );
+ sqlite3VdbeMemSetNull(pOut);
+ sqlite3VdbeMemSetPointer(pOut, pPtr);
+}
SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
Mem *pOut = pCtx->pOut;
assert( sqlite3_mutex_held(pOut->db->mutex) );
@@ -77322,6 +77370,16 @@ SQLITE_API int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
}
return rc;
}
+SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt *pStmt, int i, void *pPtr){
+ int rc;
+ Vdbe *p = (Vdbe*)pStmt;
+ rc = vdbeUnbind(p, i);
+ if( rc==SQLITE_OK ){
+ sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr);
+ sqlite3_mutex_leave(p->db->mutex);
+ }
+ return rc;
+}
SQLITE_API int sqlite3_bind_text(
sqlite3_stmt *pStmt,
int i,
@@ -148237,9 +148295,8 @@ static int fts3ColumnMethod(
sqlite3_result_int64(pCtx, pCsr->iPrevId);
}else if( iCol==p->nColumn ){
/* The extra column whose name is the same as the table.
- ** Return a blob which is a pointer to the cursor. */
- sqlite3_result_blob(pCtx, &pCsr, sizeof(pCsr), SQLITE_TRANSIENT);
- sqlite3_result_subtype(pCtx, '3');
+ ** Return a pointer to the cursor. */
+ sqlite3_result_pointer(pCtx, pCsr);
}else if( iCol==p->nColumn+2 && pCsr->pExpr ){
sqlite3_result_int64(pCtx, pCsr->iLangid);
}else{
@@ -148451,17 +148508,13 @@ static int fts3FunctionArg(
sqlite3_value *pVal, /* argv[0] passed to function */
Fts3Cursor **ppCsr /* OUT: Store cursor handle here */
){
- Fts3Cursor *pRet;
- if( sqlite3_value_type(pVal)!=SQLITE_BLOB
- || sqlite3_value_subtype(pVal)!='3'
- || sqlite3_value_bytes(pVal)!=sizeof(Fts3Cursor *)
- ){
+ Fts3Cursor *pRet = (Fts3Cursor*)sqlite3_value_pointer(pVal);
+ if( pRet==0 ){
char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
sqlite3_result_error(pContext, zErr, -1);
sqlite3_free(zErr);
return SQLITE_ERROR;
}
- memcpy(&pRet, sqlite3_value_blob(pVal), sizeof(Fts3Cursor *));
*ppCsr = pRet;
return SQLITE_OK;
}
diff --git a/chromium/third_party/sqlite/amalgamation/sqlite3.h b/chromium/third_party/sqlite/amalgamation/sqlite3.h
index 8e4e11e0ce7..a476a98f528 100644
--- a/chromium/third_party/sqlite/amalgamation/sqlite3.h
+++ b/chromium/third_party/sqlite/amalgamation/sqlite3.h
@@ -3786,6 +3786,15 @@ typedef struct sqlite3_context sqlite3_context;
** [sqlite3_blob_open | incremental BLOB I/O] routines.
** ^A negative value for the zeroblob results in a zero-length BLOB.
**
+** ^The sqlite3_bind_pointer(S,I,P) routine causes the I-th parameter in
+** [prepared statement] S to have an SQL value of NULL, but to also be
+** associated with the pointer P.
+** ^The sqlite3_bind_pointer() routine can be used to pass
+** host-language pointers into [application-defined SQL functions].
+** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
+** to be an ordinary SQL NULL value to everything other than
+** [sqlite3_value_pointer()].
+**
** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
** for the [prepared statement] or with a prepared statement for which
** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
@@ -3819,6 +3828,7 @@ SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)
SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
void(*)(void*), unsigned char encoding);
SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
+SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt*, int, void*);
SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
@@ -4588,6 +4598,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
** extract UTF-16 strings as big-endian and little-endian respectively.
**
+** ^If [sqlite3_value] object V was initialized
+** using [sqlite3_bind_pointer(S,I,P)] or [sqlite3_result_pointer(C,P)], then
+** sqlite3_value_pointer(V) will return the pointer P. Otherwise,
+** sqlite3_value_pointer(V) returns a NULL.
+**
** ^(The sqlite3_value_numeric_type() interface attempts to apply
** numeric affinity to the value. This means that an attempt is
** made to convert the value to an integer or floating point. If
@@ -4615,6 +4630,7 @@ SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*);
SQLITE_API const void *sqlite3_value_text16(sqlite3_value*);
SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*);
SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*);
+SQLITE_API void *sqlite3_value_pointer(sqlite3_value*);
SQLITE_API int sqlite3_value_type(sqlite3_value*);
SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
@@ -4627,10 +4643,6 @@ SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
** information can be used to pass a limited amount of context from
** one SQL function to another. Use the [sqlite3_result_subtype()]
** routine to set the subtype for the return value of an SQL function.
-**
-** SQLite makes no use of subtype itself. It merely passes the subtype
-** from the result of one [application-defined SQL function] into the
-** input of another.
*/
SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*);
@@ -4908,6 +4920,14 @@ typedef void (*sqlite3_destructor_type)(void*);
** [unprotected sqlite3_value] object is required, so either
** kind of [sqlite3_value] object can be used with this interface.
**
+** ^The sqlite3_result_pointer(C,P) interface sets the result to an
+** SQL NULL value, just like [sqlite3_result_null(C)], except that it
+** also associates the host-language pointer P with that NULL value such
+** that the pointer can be retrieved within an
+** [application-defined SQL function] using [sqlite3_value_pointer()].
+** This mechanism can be used to pass non-SQL values between
+** application-defined functions.
+**
** If these routines are called from within the different thread
** than the one containing the application-defined function that received
** the [sqlite3_context] pointer, the results are undefined.
@@ -4931,6 +4951,7 @@ SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*
SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
+SQLITE_API void sqlite3_result_pointer(sqlite3_context*, void*);
SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
diff --git a/chromium/third_party/sqlite/patches/0013-Add-new-interfaces-sqlite3_bind_pointer-sqlite3_resu.patch b/chromium/third_party/sqlite/patches/0013-Add-new-interfaces-sqlite3_bind_pointer-sqlite3_resu.patch
new file mode 100644
index 00000000000..e65e75f9d60
--- /dev/null
+++ b/chromium/third_party/sqlite/patches/0013-Add-new-interfaces-sqlite3_bind_pointer-sqlite3_resu.patch
@@ -0,0 +1,420 @@
+From 3dac6f0ce5313f60acc6b7abca1d431001ad0187 Mon Sep 17 00:00:00 2001
+From: Victor Costan <pwnall@chromium.org>
+Date: Sat, 15 Jul 2017 12:30:42 -0700
+Subject: [PATCH 13/13] Add new interfaces sqlite3_bind_pointer(),
+ sqlite3_result_pointer(), and sqlite3_value_pointer() used to safely move
+ pointer values through SQL without exposing underlying memory address
+ information.
+
+---
+ third_party/sqlite/src/ext/fts3/fts3.c | 13 +++------
+ third_party/sqlite/src/ext/misc/carray.c | 46 ++++++++++++++++++++++++++----
+ third_party/sqlite/src/ext/misc/remember.c | 6 ++--
+ third_party/sqlite/src/src/sqlite.h.in | 29 ++++++++++++++++---
+ third_party/sqlite/src/src/vdbeInt.h | 2 ++
+ third_party/sqlite/src/src/vdbeapi.c | 24 ++++++++++++++++
+ third_party/sqlite/src/src/vdbemem.c | 11 +++++++
+ third_party/sqlite/src/test/tabfunc01.test | 25 ++++++++--------
+ 8 files changed, 122 insertions(+), 34 deletions(-)
+
+diff --git a/third_party/sqlite/src/ext/fts3/fts3.c b/third_party/sqlite/src/ext/fts3/fts3.c
+index 827769881616..5d2f21d2937f 100644
+--- a/third_party/sqlite/src/ext/fts3/fts3.c
++++ b/third_party/sqlite/src/ext/fts3/fts3.c
+@@ -3347,9 +3347,8 @@ static int fts3ColumnMethod(
+ sqlite3_result_int64(pCtx, pCsr->iPrevId);
+ }else if( iCol==p->nColumn ){
+ /* The extra column whose name is the same as the table.
+- ** Return a blob which is a pointer to the cursor. */
+- sqlite3_result_blob(pCtx, &pCsr, sizeof(pCsr), SQLITE_TRANSIENT);
+- sqlite3_result_subtype(pCtx, '3');
++ ** Return a pointer to the cursor. */
++ sqlite3_result_pointer(pCtx, pCsr);
+ }else if( iCol==p->nColumn+2 && pCsr->pExpr ){
+ sqlite3_result_int64(pCtx, pCsr->iLangid);
+ }else{
+@@ -3561,17 +3560,13 @@ static int fts3FunctionArg(
+ sqlite3_value *pVal, /* argv[0] passed to function */
+ Fts3Cursor **ppCsr /* OUT: Store cursor handle here */
+ ){
+- Fts3Cursor *pRet;
+- if( sqlite3_value_type(pVal)!=SQLITE_BLOB
+- || sqlite3_value_subtype(pVal)!='3'
+- || sqlite3_value_bytes(pVal)!=sizeof(Fts3Cursor *)
+- ){
++ Fts3Cursor *pRet = (Fts3Cursor*)sqlite3_value_pointer(pVal);
++ if( pRet==0 ){
+ char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
+ sqlite3_result_error(pContext, zErr, -1);
+ sqlite3_free(zErr);
+ return SQLITE_ERROR;
+ }
+- memcpy(&pRet, sqlite3_value_blob(pVal), sizeof(Fts3Cursor *));
+ *ppCsr = pRet;
+ return SQLITE_OK;
+ }
+diff --git a/third_party/sqlite/src/ext/misc/carray.c b/third_party/sqlite/src/ext/misc/carray.c
+index 025eb5db2c0e..2fdff0cd3afc 100644
+--- a/third_party/sqlite/src/ext/misc/carray.c
++++ b/third_party/sqlite/src/ext/misc/carray.c
+@@ -73,7 +73,7 @@ typedef struct carray_cursor carray_cursor;
+ struct carray_cursor {
+ sqlite3_vtab_cursor base; /* Base class - must be first */
+ sqlite3_int64 iRowid; /* The rowid */
+- sqlite3_int64 iPtr; /* Pointer to array of values */
++ void* pPtr; /* Pointer to the array of values */
+ sqlite3_int64 iCnt; /* Number of integers in the array */
+ unsigned char eType; /* One of the CARRAY_type values */
+ };
+@@ -167,7 +167,7 @@ static int carrayColumn(
+ carray_cursor *pCur = (carray_cursor*)cur;
+ sqlite3_int64 x = 0;
+ switch( i ){
+- case CARRAY_COLUMN_POINTER: x = pCur->iPtr; break;
++ case CARRAY_COLUMN_POINTER: return SQLITE_OK;
+ case CARRAY_COLUMN_COUNT: x = pCur->iCnt; break;
+ case CARRAY_COLUMN_CTYPE: {
+ sqlite3_result_text(ctx, azType[pCur->eType], -1, SQLITE_STATIC);
+@@ -232,8 +232,8 @@ static int carrayFilter(
+ ){
+ carray_cursor *pCur = (carray_cursor *)pVtabCursor;
+ if( idxNum ){
+- pCur->iPtr = sqlite3_value_int64(argv[0]);
+- pCur->iCnt = sqlite3_value_int64(argv[1]);
++ pCur->pPtr = sqlite3_value_pointer(argv[0]);
++ pCur->iCnt = pCur->pPtr ? sqlite3_value_int64(argv[1]) : 0;
+ if( idxNum<3 ){
+ pCur->eType = CARRAY_INT32;
+ }else{
+@@ -251,7 +251,7 @@ static int carrayFilter(
+ }
+ }
+ }else{
+- pCur->iPtr = 0;
++ pCur->pPtr = 0;
+ pCur->iCnt = 0;
+ }
+ pCur->iRowid = 1;
+@@ -345,6 +345,34 @@ static sqlite3_module carrayModule = {
+ 0, /* xRename */
+ };
+
++/*
++** For testing purpose in the TCL test harness, we need a method for
++** setting the pointer value. The inttoptr(X) SQL function accomplishes
++** this. Tcl script will bind an integer to X and the inttoptr() SQL
++** function will use sqlite3_result_pointer() to convert that integer into
++** a pointer.
++**
++** This is for testing on TCL only.
++*/
++#ifdef SQLITE_TEST
++static void inttoptrFunc(
++ sqlite3_context *context,
++ int argc,
++ sqlite3_value **argv
++){
++ void *p;
++ sqlite3_int64 i64;
++ i64 = sqlite3_value_int64(argv[0]);
++ if( sizeof(i64)==sizeof(p) ){
++ memcpy(&p, &i64, sizeof(p));
++ }else{
++ int i32 = i64 & 0xffffffff;
++ memcpy(&p, &i32, sizeof(p));
++ }
++ sqlite3_result_pointer(context, p);
++}
++#endif /* SQLITE_TEST */
++
+ #endif /* SQLITE_OMIT_VIRTUALTABLE */
+
+ #ifdef _WIN32
+@@ -359,6 +387,12 @@ int sqlite3_carray_init(
+ SQLITE_EXTENSION_INIT2(pApi);
+ #ifndef SQLITE_OMIT_VIRTUALTABLE
+ rc = sqlite3_create_module(db, "carray", &carrayModule, 0);
+-#endif
++#ifdef SQLITE_TEST
++ if( rc==SQLITE_OK ){
++ rc = sqlite3_create_function(db, "inttoptr", 1, SQLITE_UTF8, 0,
++ inttoptrFunc, 0, 0);
++ }
++#endif /* SQLITE_TEST */
++#endif /* SQLITE_OMIT_VIRTUALTABLE */
+ return rc;
+ }
+diff --git a/third_party/sqlite/src/ext/misc/remember.c b/third_party/sqlite/src/ext/misc/remember.c
+index aa3eff8a3f8b..587d44a12cdc 100644
+--- a/third_party/sqlite/src/ext/misc/remember.c
++++ b/third_party/sqlite/src/ext/misc/remember.c
+@@ -44,11 +44,11 @@ static void rememberFunc(
+ sqlite3_value **argv
+ ){
+ sqlite3_int64 v;
+- sqlite3_int64 ptr;
++ sqlite3_int64 *ptr;
+ assert( argc==2 );
+ v = sqlite3_value_int64(argv[0]);
+- ptr = sqlite3_value_int64(argv[1]);
+- *((sqlite3_int64*)ptr) = v;
++ ptr = sqlite3_value_pointer(argv[1]);
++ if( ptr ) *ptr = v;
+ sqlite3_result_int64(pCtx, v);
+ }
+
+diff --git a/third_party/sqlite/src/src/sqlite.h.in b/third_party/sqlite/src/src/sqlite.h.in
+index fbbf4b9f2db3..371ae5848bbc 100644
+--- a/third_party/sqlite/src/src/sqlite.h.in
++++ b/third_party/sqlite/src/src/sqlite.h.in
+@@ -3786,6 +3786,15 @@ typedef struct sqlite3_context sqlite3_context;
+ ** [sqlite3_blob_open | incremental BLOB I/O] routines.
+ ** ^A negative value for the zeroblob results in a zero-length BLOB.
+ **
++** ^The sqlite3_bind_pointer(S,I,P) routine causes the I-th parameter in
++** [prepared statement] S to have an SQL value of NULL, but to also be
++** associated with the pointer P.
++** ^The sqlite3_bind_pointer() routine can be used to pass
++** host-language pointers into [application-defined SQL functions].
++** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
++** to be an ordinary SQL NULL value to everything other than
++** [sqlite3_value_pointer()].
++**
+ ** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
+ ** for the [prepared statement] or with a prepared statement for which
+ ** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
+@@ -3819,6 +3828,7 @@ int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
+ int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
+ void(*)(void*), unsigned char encoding);
+ int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
++int sqlite3_bind_pointer(sqlite3_stmt*, int, void*);
+ int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
+ int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
+
+@@ -4588,6 +4598,11 @@ SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
+ ** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
+ ** extract UTF-16 strings as big-endian and little-endian respectively.
+ **
++** ^If [sqlite3_value] object V was initialized
++** using [sqlite3_bind_pointer(S,I,P)] or [sqlite3_result_pointer(C,P)], then
++** sqlite3_value_pointer(V) will return the pointer P. Otherwise,
++** sqlite3_value_pointer(V) returns a NULL.
++**
+ ** ^(The sqlite3_value_numeric_type() interface attempts to apply
+ ** numeric affinity to the value. This means that an attempt is
+ ** made to convert the value to an integer or floating point. If
+@@ -4615,6 +4630,7 @@ const unsigned char *sqlite3_value_text(sqlite3_value*);
+ const void *sqlite3_value_text16(sqlite3_value*);
+ const void *sqlite3_value_text16le(sqlite3_value*);
+ const void *sqlite3_value_text16be(sqlite3_value*);
++void *sqlite3_value_pointer(sqlite3_value*);
+ int sqlite3_value_type(sqlite3_value*);
+ int sqlite3_value_numeric_type(sqlite3_value*);
+
+@@ -4627,10 +4643,6 @@ int sqlite3_value_numeric_type(sqlite3_value*);
+ ** information can be used to pass a limited amount of context from
+ ** one SQL function to another. Use the [sqlite3_result_subtype()]
+ ** routine to set the subtype for the return value of an SQL function.
+-**
+-** SQLite makes no use of subtype itself. It merely passes the subtype
+-** from the result of one [application-defined SQL function] into the
+-** input of another.
+ */
+ unsigned int sqlite3_value_subtype(sqlite3_value*);
+
+@@ -4908,6 +4920,14 @@ typedef void (*sqlite3_destructor_type)(void*);
+ ** [unprotected sqlite3_value] object is required, so either
+ ** kind of [sqlite3_value] object can be used with this interface.
+ **
++** ^The sqlite3_result_pointer(C,P) interface sets the result to an
++** SQL NULL value, just like [sqlite3_result_null(C)], except that it
++** also associates the host-language pointer P with that NULL value such
++** that the pointer can be retrieved within an
++** [application-defined SQL function] using [sqlite3_value_pointer()].
++** This mechanism can be used to pass non-SQL values between
++** application-defined functions.
++**
+ ** If these routines are called from within the different thread
+ ** than the one containing the application-defined function that received
+ ** the [sqlite3_context] pointer, the results are undefined.
+@@ -4931,6 +4951,7 @@ void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
+ void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
+ void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
+ void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
++void sqlite3_result_pointer(sqlite3_context*, void*);
+ void sqlite3_result_zeroblob(sqlite3_context*, int n);
+ int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
+
+diff --git a/third_party/sqlite/src/src/vdbeInt.h b/third_party/sqlite/src/src/vdbeInt.h
+index 989cdfd34617..69eab56bc578 100644
+--- a/third_party/sqlite/src/src/vdbeInt.h
++++ b/third_party/sqlite/src/src/vdbeInt.h
+@@ -189,6 +189,7 @@ struct Mem {
+ double r; /* Real value used when MEM_Real is set in flags */
+ i64 i; /* Integer value used when MEM_Int is set in flags */
+ int nZero; /* Used when bit MEM_Zero is set in flags */
++ void *pPtr; /* Pointer when flags=MEM_NULL and eSubtype='p' */
+ FuncDef *pDef; /* Used only when flags==MEM_Agg */
+ RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
+ VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
+@@ -474,6 +475,7 @@ void sqlite3VdbeMemSetInt64(Mem*, i64);
+ #else
+ void sqlite3VdbeMemSetDouble(Mem*, double);
+ #endif
++void sqlite3VdbeMemSetPointer(Mem*, void*);
+ void sqlite3VdbeMemInit(Mem*,sqlite3*,u16);
+ void sqlite3VdbeMemSetNull(Mem*);
+ void sqlite3VdbeMemSetZeroBlob(Mem*,int);
+diff --git a/third_party/sqlite/src/src/vdbeapi.c b/third_party/sqlite/src/src/vdbeapi.c
+index 6eb97f1d1ddb..c54490c077cd 100644
+--- a/third_party/sqlite/src/src/vdbeapi.c
++++ b/third_party/sqlite/src/src/vdbeapi.c
+@@ -198,6 +198,14 @@ unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
+ Mem *pMem = (Mem*)pVal;
+ return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
+ }
++void *sqlite3_value_pointer(sqlite3_value *pVal){
++ Mem *p = (Mem*)pVal;
++ if( (p->flags & MEM_TypeMask)==(MEM_Null|MEM_Subtype) && p->eSubtype=='p' ){
++ return p->u.pPtr;
++ }else{
++ return 0;
++ }
++}
+ const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
+ return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
+ }
+@@ -376,6 +384,12 @@ void sqlite3_result_null(sqlite3_context *pCtx){
+ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
+ sqlite3VdbeMemSetNull(pCtx->pOut);
+ }
++void sqlite3_result_pointer(sqlite3_context *pCtx, void *pPtr){
++ Mem *pOut = pCtx->pOut;
++ assert( sqlite3_mutex_held(pOut->db->mutex) );
++ sqlite3VdbeMemSetNull(pOut);
++ sqlite3VdbeMemSetPointer(pOut, pPtr);
++}
+ void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
+ Mem *pOut = pCtx->pOut;
+ assert( sqlite3_mutex_held(pOut->db->mutex) );
+@@ -1361,6 +1375,16 @@ int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
+ }
+ return rc;
+ }
++int sqlite3_bind_pointer(sqlite3_stmt *pStmt, int i, void *pPtr){
++ int rc;
++ Vdbe *p = (Vdbe*)pStmt;
++ rc = vdbeUnbind(p, i);
++ if( rc==SQLITE_OK ){
++ sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr);
++ sqlite3_mutex_leave(p->db->mutex);
++ }
++ return rc;
++}
+ int sqlite3_bind_text(
+ sqlite3_stmt *pStmt,
+ int i,
+diff --git a/third_party/sqlite/src/src/vdbemem.c b/third_party/sqlite/src/src/vdbemem.c
+index 656e19bfa890..2f7aedb32171 100644
+--- a/third_party/sqlite/src/src/vdbemem.c
++++ b/third_party/sqlite/src/src/vdbemem.c
+@@ -697,6 +697,17 @@ void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
+ }
+ }
+
++/*
++** Set the value stored in *pMem should already be a NULL.
++** Also store a pointer to go with it.
++*/
++void sqlite3VdbeMemSetPointer(Mem *pMem, void *pPtr){
++ assert( pMem->flags==MEM_Null );
++ pMem->flags = MEM_Null|MEM_Subtype;
++ pMem->u.pPtr = pPtr;
++ pMem->eSubtype = 'p';
++}
++
+ #ifndef SQLITE_OMIT_FLOATING_POINT
+ /*
+ ** Delete any previous value and set the value stored in *pMem to val,
+diff --git a/third_party/sqlite/src/test/tabfunc01.test b/third_party/sqlite/src/test/tabfunc01.test
+index dcaafa420c25..bb89aec1e706 100644
+--- a/third_party/sqlite/src/test/tabfunc01.test
++++ b/third_party/sqlite/src/test/tabfunc01.test
+@@ -150,62 +150,63 @@ do_execsql_test tabfunc01-600 {
+ do_test tabfunc01-700 {
+ set PTR1 [intarray_addr 5 7 13 17 23]
+ db eval {
+- SELECT b FROM t600, carray($PTR1,5) WHERE a=value;
++ SELECT b FROM t600, carray(inttoptr($PTR1),5) WHERE a=value;
+ }
+ } {(005) (007) (013) (017) (023)}
+ do_test tabfunc01-701 {
+ db eval {
+- SELECT b FROM t600 WHERE a IN carray($PTR1,5,'int32');
++ SELECT b FROM t600 WHERE a IN carray(inttoptr($PTR1),5,'int32');
+ }
+ } {(005) (007) (013) (017) (023)}
+ do_test tabfunc01-702 {
+ db eval {
+- SELECT b FROM t600 WHERE a IN carray($PTR1,4,'int32');
++ SELECT b FROM t600 WHERE a IN carray(inttoptr($PTR1),4,'int32');
+ }
+ } {(005) (007) (013) (017)}
+ do_catchsql_test tabfunc01-710 {
+- SELECT b FROM t600 WHERE a IN carray($PTR1,5,'int33');
++ SELECT b FROM t600 WHERE a IN carray(inttoptr($PTR1),5,'int33');
+ } {1 {unknown datatype: 'int33'}}
+
+ do_test tabfunc01-720 {
+ set PTR2 [int64array_addr 5 7 13 17 23]
+ db eval {
+- SELECT b FROM t600, carray($PTR2,5,'int64') WHERE a=value;
++ SELECT b FROM t600, carray(inttoptr($PTR2),5,'int64') WHERE a=value;
+ }
+ } {(005) (007) (013) (017) (023)}
+ do_test tabfunc01-721 {
+ db eval {
+ SELECT remember(123,$PTR2);
+- SELECT value FROM carray($PTR2,5,'int64');
++ SELECT value FROM carray(inttoptr($PTR2),5,'int64');
+ }
+ } {123 123 7 13 17 23}
+ do_test tabfunc01-722 {
+ set PTR3 [expr {$PTR2+16}]
+ db eval {
+- SELECT remember(987,$PTR3);
+- SELECT value FROM carray($PTR2,5,'int64');
++ SELECT remember(987,inttoptr($PTR3));
++ SELECT value FROM carray(inttoptr($PTR2),5,'int64');
+ }
+ } {987 123 7 987 17 23}
+
+ do_test tabfunc01-730 {
+ set PTR4 [doublearray_addr 5.0 7.0 13.0 17.0 23.0]
+ db eval {
+- SELECT b FROM t600, carray($PTR4,5,'double') WHERE a=value;
++ SELECT b FROM t600, carray(inttoptr($PTR4),5,'double') WHERE a=value;
+ }
+ } {(005) (007) (013) (017) (023)}
+
+ do_test tabfunc01-740 {
+ set PTR5 [textarray_addr x5 x7 x13 x17 x23]
+ db eval {
+- SELECT b FROM t600, carray($PTR5,5,'char*') WHERE a=trim(value,'x');
++ SELECT b FROM t600, carray(inttoptr($PTR5),5,'char*')
++ WHERE a=trim(value,'x');
+ }
+ } {(005) (007) (013) (017) (023)}
+
+ do_test tabfunc01-750 {
+ db eval {
+ SELECT aa.value, bb.value, '|'
+- FROM carray($PTR4,5,'double') AS aa
+- JOIN carray($PTR5,5,'char*') AS bb ON aa.rowid=bb.rowid;
++ FROM carray(inttoptr($PTR4),5,'double') AS aa
++ JOIN carray(inttoptr($PTR5),5,'char*') AS bb ON aa.rowid=bb.rowid;
+ }
+ } {5.0 x5 | 7.0 x7 | 13.0 x13 | 17.0 x17 | 23.0 x23 |}
+
+--
+2.11
diff --git a/chromium/third_party/sqlite/src/ext/fts3/fts3.c b/chromium/third_party/sqlite/src/ext/fts3/fts3.c
index 82776988161..5d2f21d2937 100644
--- a/chromium/third_party/sqlite/src/ext/fts3/fts3.c
+++ b/chromium/third_party/sqlite/src/ext/fts3/fts3.c
@@ -3347,9 +3347,8 @@ static int fts3ColumnMethod(
sqlite3_result_int64(pCtx, pCsr->iPrevId);
}else if( iCol==p->nColumn ){
/* The extra column whose name is the same as the table.
- ** Return a blob which is a pointer to the cursor. */
- sqlite3_result_blob(pCtx, &pCsr, sizeof(pCsr), SQLITE_TRANSIENT);
- sqlite3_result_subtype(pCtx, '3');
+ ** Return a pointer to the cursor. */
+ sqlite3_result_pointer(pCtx, pCsr);
}else if( iCol==p->nColumn+2 && pCsr->pExpr ){
sqlite3_result_int64(pCtx, pCsr->iLangid);
}else{
@@ -3561,17 +3560,13 @@ static int fts3FunctionArg(
sqlite3_value *pVal, /* argv[0] passed to function */
Fts3Cursor **ppCsr /* OUT: Store cursor handle here */
){
- Fts3Cursor *pRet;
- if( sqlite3_value_type(pVal)!=SQLITE_BLOB
- || sqlite3_value_subtype(pVal)!='3'
- || sqlite3_value_bytes(pVal)!=sizeof(Fts3Cursor *)
- ){
+ Fts3Cursor *pRet = (Fts3Cursor*)sqlite3_value_pointer(pVal);
+ if( pRet==0 ){
char *zErr = sqlite3_mprintf("illegal first argument to %s", zFunc);
sqlite3_result_error(pContext, zErr, -1);
sqlite3_free(zErr);
return SQLITE_ERROR;
}
- memcpy(&pRet, sqlite3_value_blob(pVal), sizeof(Fts3Cursor *));
*ppCsr = pRet;
return SQLITE_OK;
}
diff --git a/chromium/third_party/sqlite/src/ext/misc/carray.c b/chromium/third_party/sqlite/src/ext/misc/carray.c
index 025eb5db2c0..2fdff0cd3af 100644
--- a/chromium/third_party/sqlite/src/ext/misc/carray.c
+++ b/chromium/third_party/sqlite/src/ext/misc/carray.c
@@ -73,7 +73,7 @@ typedef struct carray_cursor carray_cursor;
struct carray_cursor {
sqlite3_vtab_cursor base; /* Base class - must be first */
sqlite3_int64 iRowid; /* The rowid */
- sqlite3_int64 iPtr; /* Pointer to array of values */
+ void* pPtr; /* Pointer to the array of values */
sqlite3_int64 iCnt; /* Number of integers in the array */
unsigned char eType; /* One of the CARRAY_type values */
};
@@ -167,7 +167,7 @@ static int carrayColumn(
carray_cursor *pCur = (carray_cursor*)cur;
sqlite3_int64 x = 0;
switch( i ){
- case CARRAY_COLUMN_POINTER: x = pCur->iPtr; break;
+ case CARRAY_COLUMN_POINTER: return SQLITE_OK;
case CARRAY_COLUMN_COUNT: x = pCur->iCnt; break;
case CARRAY_COLUMN_CTYPE: {
sqlite3_result_text(ctx, azType[pCur->eType], -1, SQLITE_STATIC);
@@ -232,8 +232,8 @@ static int carrayFilter(
){
carray_cursor *pCur = (carray_cursor *)pVtabCursor;
if( idxNum ){
- pCur->iPtr = sqlite3_value_int64(argv[0]);
- pCur->iCnt = sqlite3_value_int64(argv[1]);
+ pCur->pPtr = sqlite3_value_pointer(argv[0]);
+ pCur->iCnt = pCur->pPtr ? sqlite3_value_int64(argv[1]) : 0;
if( idxNum<3 ){
pCur->eType = CARRAY_INT32;
}else{
@@ -251,7 +251,7 @@ static int carrayFilter(
}
}
}else{
- pCur->iPtr = 0;
+ pCur->pPtr = 0;
pCur->iCnt = 0;
}
pCur->iRowid = 1;
@@ -345,6 +345,34 @@ static sqlite3_module carrayModule = {
0, /* xRename */
};
+/*
+** For testing purpose in the TCL test harness, we need a method for
+** setting the pointer value. The inttoptr(X) SQL function accomplishes
+** this. Tcl script will bind an integer to X and the inttoptr() SQL
+** function will use sqlite3_result_pointer() to convert that integer into
+** a pointer.
+**
+** This is for testing on TCL only.
+*/
+#ifdef SQLITE_TEST
+static void inttoptrFunc(
+ sqlite3_context *context,
+ int argc,
+ sqlite3_value **argv
+){
+ void *p;
+ sqlite3_int64 i64;
+ i64 = sqlite3_value_int64(argv[0]);
+ if( sizeof(i64)==sizeof(p) ){
+ memcpy(&p, &i64, sizeof(p));
+ }else{
+ int i32 = i64 & 0xffffffff;
+ memcpy(&p, &i32, sizeof(p));
+ }
+ sqlite3_result_pointer(context, p);
+}
+#endif /* SQLITE_TEST */
+
#endif /* SQLITE_OMIT_VIRTUALTABLE */
#ifdef _WIN32
@@ -359,6 +387,12 @@ int sqlite3_carray_init(
SQLITE_EXTENSION_INIT2(pApi);
#ifndef SQLITE_OMIT_VIRTUALTABLE
rc = sqlite3_create_module(db, "carray", &carrayModule, 0);
-#endif
+#ifdef SQLITE_TEST
+ if( rc==SQLITE_OK ){
+ rc = sqlite3_create_function(db, "inttoptr", 1, SQLITE_UTF8, 0,
+ inttoptrFunc, 0, 0);
+ }
+#endif /* SQLITE_TEST */
+#endif /* SQLITE_OMIT_VIRTUALTABLE */
return rc;
}
diff --git a/chromium/third_party/sqlite/src/ext/misc/remember.c b/chromium/third_party/sqlite/src/ext/misc/remember.c
index aa3eff8a3f8..587d44a12cd 100644
--- a/chromium/third_party/sqlite/src/ext/misc/remember.c
+++ b/chromium/third_party/sqlite/src/ext/misc/remember.c
@@ -44,11 +44,11 @@ static void rememberFunc(
sqlite3_value **argv
){
sqlite3_int64 v;
- sqlite3_int64 ptr;
+ sqlite3_int64 *ptr;
assert( argc==2 );
v = sqlite3_value_int64(argv[0]);
- ptr = sqlite3_value_int64(argv[1]);
- *((sqlite3_int64*)ptr) = v;
+ ptr = sqlite3_value_pointer(argv[1]);
+ if( ptr ) *ptr = v;
sqlite3_result_int64(pCtx, v);
}
diff --git a/chromium/third_party/sqlite/src/src/sqlite.h.in b/chromium/third_party/sqlite/src/src/sqlite.h.in
index fbbf4b9f2db..371ae5848bb 100644
--- a/chromium/third_party/sqlite/src/src/sqlite.h.in
+++ b/chromium/third_party/sqlite/src/src/sqlite.h.in
@@ -3786,6 +3786,15 @@ typedef struct sqlite3_context sqlite3_context;
** [sqlite3_blob_open | incremental BLOB I/O] routines.
** ^A negative value for the zeroblob results in a zero-length BLOB.
**
+** ^The sqlite3_bind_pointer(S,I,P) routine causes the I-th parameter in
+** [prepared statement] S to have an SQL value of NULL, but to also be
+** associated with the pointer P.
+** ^The sqlite3_bind_pointer() routine can be used to pass
+** host-language pointers into [application-defined SQL functions].
+** ^A parameter that is initialized using [sqlite3_bind_pointer()] appears
+** to be an ordinary SQL NULL value to everything other than
+** [sqlite3_value_pointer()].
+**
** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
** for the [prepared statement] or with a prepared statement for which
** [sqlite3_step()] has been called more recently than [sqlite3_reset()],
@@ -3819,6 +3828,7 @@ int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*));
int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64,
void(*)(void*), unsigned char encoding);
int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*);
+int sqlite3_bind_pointer(sqlite3_stmt*, int, void*);
int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n);
int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64);
@@ -4588,6 +4598,11 @@ SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int),
** sqlite3_value_text16be() and sqlite3_value_text16le() interfaces
** extract UTF-16 strings as big-endian and little-endian respectively.
**
+** ^If [sqlite3_value] object V was initialized
+** using [sqlite3_bind_pointer(S,I,P)] or [sqlite3_result_pointer(C,P)], then
+** sqlite3_value_pointer(V) will return the pointer P. Otherwise,
+** sqlite3_value_pointer(V) returns a NULL.
+**
** ^(The sqlite3_value_numeric_type() interface attempts to apply
** numeric affinity to the value. This means that an attempt is
** made to convert the value to an integer or floating point. If
@@ -4615,6 +4630,7 @@ const unsigned char *sqlite3_value_text(sqlite3_value*);
const void *sqlite3_value_text16(sqlite3_value*);
const void *sqlite3_value_text16le(sqlite3_value*);
const void *sqlite3_value_text16be(sqlite3_value*);
+void *sqlite3_value_pointer(sqlite3_value*);
int sqlite3_value_type(sqlite3_value*);
int sqlite3_value_numeric_type(sqlite3_value*);
@@ -4627,10 +4643,6 @@ int sqlite3_value_numeric_type(sqlite3_value*);
** information can be used to pass a limited amount of context from
** one SQL function to another. Use the [sqlite3_result_subtype()]
** routine to set the subtype for the return value of an SQL function.
-**
-** SQLite makes no use of subtype itself. It merely passes the subtype
-** from the result of one [application-defined SQL function] into the
-** input of another.
*/
unsigned int sqlite3_value_subtype(sqlite3_value*);
@@ -4908,6 +4920,14 @@ typedef void (*sqlite3_destructor_type)(void*);
** [unprotected sqlite3_value] object is required, so either
** kind of [sqlite3_value] object can be used with this interface.
**
+** ^The sqlite3_result_pointer(C,P) interface sets the result to an
+** SQL NULL value, just like [sqlite3_result_null(C)], except that it
+** also associates the host-language pointer P with that NULL value such
+** that the pointer can be retrieved within an
+** [application-defined SQL function] using [sqlite3_value_pointer()].
+** This mechanism can be used to pass non-SQL values between
+** application-defined functions.
+**
** If these routines are called from within the different thread
** than the one containing the application-defined function that received
** the [sqlite3_context] pointer, the results are undefined.
@@ -4931,6 +4951,7 @@ void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*));
void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*));
void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*));
void sqlite3_result_value(sqlite3_context*, sqlite3_value*);
+void sqlite3_result_pointer(sqlite3_context*, void*);
void sqlite3_result_zeroblob(sqlite3_context*, int n);
int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n);
diff --git a/chromium/third_party/sqlite/src/src/vdbeInt.h b/chromium/third_party/sqlite/src/src/vdbeInt.h
index 989cdfd3461..69eab56bc57 100644
--- a/chromium/third_party/sqlite/src/src/vdbeInt.h
+++ b/chromium/third_party/sqlite/src/src/vdbeInt.h
@@ -189,6 +189,7 @@ struct Mem {
double r; /* Real value used when MEM_Real is set in flags */
i64 i; /* Integer value used when MEM_Int is set in flags */
int nZero; /* Used when bit MEM_Zero is set in flags */
+ void *pPtr; /* Pointer when flags=MEM_NULL and eSubtype='p' */
FuncDef *pDef; /* Used only when flags==MEM_Agg */
RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
@@ -474,6 +475,7 @@ void sqlite3VdbeMemSetInt64(Mem*, i64);
#else
void sqlite3VdbeMemSetDouble(Mem*, double);
#endif
+void sqlite3VdbeMemSetPointer(Mem*, void*);
void sqlite3VdbeMemInit(Mem*,sqlite3*,u16);
void sqlite3VdbeMemSetNull(Mem*);
void sqlite3VdbeMemSetZeroBlob(Mem*,int);
diff --git a/chromium/third_party/sqlite/src/src/vdbeapi.c b/chromium/third_party/sqlite/src/src/vdbeapi.c
index 6eb97f1d1dd..c54490c077c 100644
--- a/chromium/third_party/sqlite/src/src/vdbeapi.c
+++ b/chromium/third_party/sqlite/src/src/vdbeapi.c
@@ -198,6 +198,14 @@ unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
Mem *pMem = (Mem*)pVal;
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
}
+void *sqlite3_value_pointer(sqlite3_value *pVal){
+ Mem *p = (Mem*)pVal;
+ if( (p->flags & MEM_TypeMask)==(MEM_Null|MEM_Subtype) && p->eSubtype=='p' ){
+ return p->u.pPtr;
+ }else{
+ return 0;
+ }
+}
const unsigned char *sqlite3_value_text(sqlite3_value *pVal){
return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8);
}
@@ -376,6 +384,12 @@ void sqlite3_result_null(sqlite3_context *pCtx){
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
sqlite3VdbeMemSetNull(pCtx->pOut);
}
+void sqlite3_result_pointer(sqlite3_context *pCtx, void *pPtr){
+ Mem *pOut = pCtx->pOut;
+ assert( sqlite3_mutex_held(pOut->db->mutex) );
+ sqlite3VdbeMemSetNull(pOut);
+ sqlite3VdbeMemSetPointer(pOut, pPtr);
+}
void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){
Mem *pOut = pCtx->pOut;
assert( sqlite3_mutex_held(pOut->db->mutex) );
@@ -1361,6 +1375,16 @@ int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
}
return rc;
}
+int sqlite3_bind_pointer(sqlite3_stmt *pStmt, int i, void *pPtr){
+ int rc;
+ Vdbe *p = (Vdbe*)pStmt;
+ rc = vdbeUnbind(p, i);
+ if( rc==SQLITE_OK ){
+ sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr);
+ sqlite3_mutex_leave(p->db->mutex);
+ }
+ return rc;
+}
int sqlite3_bind_text(
sqlite3_stmt *pStmt,
int i,
diff --git a/chromium/third_party/sqlite/src/src/vdbemem.c b/chromium/third_party/sqlite/src/src/vdbemem.c
index 656e19bfa89..2f7aedb3217 100644
--- a/chromium/third_party/sqlite/src/src/vdbemem.c
+++ b/chromium/third_party/sqlite/src/src/vdbemem.c
@@ -697,6 +697,17 @@ void sqlite3VdbeMemSetInt64(Mem *pMem, i64 val){
}
}
+/*
+** Set the value stored in *pMem should already be a NULL.
+** Also store a pointer to go with it.
+*/
+void sqlite3VdbeMemSetPointer(Mem *pMem, void *pPtr){
+ assert( pMem->flags==MEM_Null );
+ pMem->flags = MEM_Null|MEM_Subtype;
+ pMem->u.pPtr = pPtr;
+ pMem->eSubtype = 'p';
+}
+
#ifndef SQLITE_OMIT_FLOATING_POINT
/*
** Delete any previous value and set the value stored in *pMem to val,
diff --git a/chromium/third_party/swiftshader/third_party/subzero/DESIGN.rst b/chromium/third_party/swiftshader/third_party/subzero/DESIGN.rst
index d0f71625a6c..363c19c6178 120000..100644
--- a/chromium/third_party/swiftshader/third_party/subzero/DESIGN.rst
+++ b/chromium/third_party/swiftshader/third_party/subzero/DESIGN.rst
@@ -1 +1,1593 @@
-docs/DESIGN.rst \ No newline at end of file
+Design of the Subzero fast code generator
+=========================================
+
+Introduction
+------------
+
+The `Portable Native Client (PNaCl) <http://gonacl.com>`_ project includes
+compiler technology based on `LLVM <http://llvm.org/>`_. The developer uses the
+PNaCl toolchain to compile their application to architecture-neutral PNaCl
+bitcode (a ``.pexe`` file), using as much architecture-neutral optimization as
+possible. The ``.pexe`` file is downloaded to the user's browser where the
+PNaCl translator (a component of Chrome) compiles the ``.pexe`` file to
+`sandboxed
+<https://developer.chrome.com/native-client/reference/sandbox_internals/index>`_
+native code. The translator uses architecture-specific optimizations as much as
+practical to generate good native code.
+
+The native code can be cached by the browser to avoid repeating translation on
+future page loads. However, first-time user experience is hampered by long
+translation times. The LLVM-based PNaCl translator is pretty slow, even when
+using ``-O0`` to minimize optimizations, so delays are especially noticeable on
+slow browser platforms such as ARM-based Chromebooks.
+
+Translator slowness can be mitigated or hidden in a number of ways.
+
+- Parallel translation. However, slow machines where this matters most, e.g.
+ ARM-based Chromebooks, are likely to have fewer cores to parallelize across,
+ and are likely to less memory available for multiple translation threads to
+ use.
+
+- Streaming translation, i.e. start translating as soon as the download starts.
+ This doesn't help much when translation speed is 10× slower than download
+ speed, or the ``.pexe`` file is already cached while the translated binary was
+ flushed from the cache.
+
+- Arrange the web page such that translation is done in parallel with
+ downloading large assets.
+
+- Arrange the web page to distract the user with `cat videos
+ <https://www.youtube.com/watch?v=tLt5rBfNucc>`_ while translation is in
+ progress.
+
+Or, improve translator performance to something more reasonable.
+
+This document describes Subzero's attempt to improve translation speed by an
+order of magnitude while rivaling LLVM's code quality. Subzero does this
+through minimal IR layering, lean data structures and passes, and a careful
+selection of fast optimization passes. It has two optimization recipes: full
+optimizations (``O2``) and minimal optimizations (``Om1``). The recipes are the
+following (described in more detail below):
+
++----------------------------------------+-----------------------------+
+| O2 recipe | Om1 recipe |
++========================================+=============================+
+| Parse .pexe file | Parse .pexe file |
++----------------------------------------+-----------------------------+
+| Loop nest analysis | |
++----------------------------------------+-----------------------------+
+| Local common subexpression elimination | |
++----------------------------------------+-----------------------------+
+| Address mode inference | |
++----------------------------------------+-----------------------------+
+| Read-modify-write (RMW) transform | |
++----------------------------------------+-----------------------------+
+| Basic liveness analysis | |
++----------------------------------------+-----------------------------+
+| Load optimization | |
++----------------------------------------+-----------------------------+
+| | Phi lowering (simple) |
++----------------------------------------+-----------------------------+
+| Target lowering | Target lowering |
++----------------------------------------+-----------------------------+
+| Full liveness analysis | |
++----------------------------------------+-----------------------------+
+| Register allocation | Minimal register allocation |
++----------------------------------------+-----------------------------+
+| Phi lowering (advanced) | |
++----------------------------------------+-----------------------------+
+| Post-phi register allocation | |
++----------------------------------------+-----------------------------+
+| Branch optimization | |
++----------------------------------------+-----------------------------+
+| Code emission | Code emission |
++----------------------------------------+-----------------------------+
+
+Goals
+=====
+
+Translation speed
+-----------------
+
+We'd like to be able to translate a ``.pexe`` file as fast as download speed.
+Any faster is in a sense wasted effort. Download speed varies greatly, but
+we'll arbitrarily say 1 MB/sec. We'll pick the ARM A15 CPU as the example of a
+slow machine. We observe a 3× single-thread performance difference between A15
+and a high-end x86 Xeon E5-2690 based workstation, and aggressively assume a
+``.pexe`` file could be compressed to 50% on the web server using gzip transport
+compression, so we set the translation speed goal to 6 MB/sec on the high-end
+Xeon workstation.
+
+Currently, at the ``-O0`` level, the LLVM-based PNaCl translation translates at
+⅒ the target rate. The ``-O2`` mode takes 3× as long as the ``-O0`` mode.
+
+In other words, Subzero's goal is to improve over LLVM's translation speed by
+10×.
+
+Code quality
+------------
+
+Subzero's initial goal is to produce code that meets or exceeds LLVM's ``-O0``
+code quality. The stretch goal is to approach LLVM ``-O2`` code quality. On
+average, LLVM ``-O2`` performs twice as well as LLVM ``-O0``.
+
+It's important to note that the quality of Subzero-generated code depends on
+target-neutral optimizations and simplifications being run beforehand in the
+developer environment. The ``.pexe`` file reflects these optimizations. For
+example, Subzero assumes that the basic blocks are ordered topologically where
+possible (which makes liveness analysis converge fastest), and Subzero does not
+do any function inlining because it should already have been done.
+
+Translator size
+---------------
+
+The current LLVM-based translator binary (``pnacl-llc``) is about 10 MB in size.
+We think 1 MB is a more reasonable size -- especially for such a component that
+is distributed to a billion Chrome users. Thus we target a 10× reduction in
+binary size.
+
+For development, Subzero can be built for all target architectures, and all
+debugging and diagnostic options enabled. For a smaller translator, we restrict
+to a single target architecture, and define a ``MINIMAL`` build where
+unnecessary features are compiled out.
+
+Subzero leverages some data structures from LLVM's ``ADT`` and ``Support``
+include directories, which have little impact on translator size. It also uses
+some of LLVM's bitcode decoding code (for binary-format ``.pexe`` files), again
+with little size impact. In non-``MINIMAL`` builds, the translator size is much
+larger due to including code for parsing text-format bitcode files and forming
+LLVM IR.
+
+Memory footprint
+----------------
+
+The current LLVM-based translator suffers from an issue in which some
+function-specific data has to be retained in memory until all translation
+completes, and therefore the memory footprint grows without bound. Large
+``.pexe`` files can lead to the translator process holding hundreds of MB of
+memory by the end. The translator runs in a separate process, so this memory
+growth doesn't *directly* affect other processes, but it does dirty the physical
+memory and contributes to a perception of bloat and sometimes a reality of
+out-of-memory tab killing, especially noticeable on weaker systems.
+
+Subzero should maintain a stable memory footprint throughout translation. It's
+not really practical to set a specific limit, because there is not really a
+practical limit on a single function's size, but the footprint should be
+"reasonable" and be proportional to the largest input function size, not the
+total ``.pexe`` file size. Simply put, Subzero should not have memory leaks or
+inexorable memory growth. (We use ASAN builds to test for leaks.)
+
+Multithreaded translation
+-------------------------
+
+It should be practical to translate different functions concurrently and see
+good scalability. Some locking may be needed, such as accessing output buffers
+or constant pools, but that should be fairly minimal. In contrast, LLVM was
+only designed for module-level parallelism, and as such, the PNaCl translator
+internally splits a ``.pexe`` file into several modules for concurrent
+translation. All output needs to be deterministic regardless of the level of
+multithreading, i.e. functions and data should always be output in the same
+order.
+
+Target architectures
+--------------------
+
+Initial target architectures are x86-32, x86-64, ARM32, and MIPS32. Future
+targets include ARM64 and MIPS64, though these targets lack NaCl support
+including a sandbox model or a validator.
+
+The first implementation is for x86-32, because it was expected to be
+particularly challenging, and thus more likely to draw out any design problems
+early:
+
+- There are a number of special cases, asymmetries, and warts in the x86
+ instruction set.
+
+- Complex addressing modes may be leveraged for better code quality.
+
+- 64-bit integer operations have to be lowered into longer sequences of 32-bit
+ operations.
+
+- Paucity of physical registers may reveal code quality issues early in the
+ design.
+
+Detailed design
+===============
+
+Intermediate representation - ICE
+---------------------------------
+
+Subzero's IR is called ICE. It is designed to be reasonably similar to LLVM's
+IR, which is reflected in the ``.pexe`` file's bitcode structure. It has a
+representation of global variables and initializers, and a set of functions.
+Each function contains a list of basic blocks, and each basic block constains a
+list of instructions. Instructions that operate on stack and register variables
+do so using static single assignment (SSA) form.
+
+The ``.pexe`` file is translated one function at a time (or in parallel by
+multiple translation threads). The recipe for optimization passes depends on
+the specific target and optimization level, and is described in detail below.
+Global variables (types and initializers) are simply and directly translated to
+object code, without any meaningful attempts at optimization.
+
+A function's control flow graph (CFG) is represented by the ``Ice::Cfg`` class.
+Its key contents include:
+
+- A list of ``CfgNode`` pointers, generally held in topological order.
+
+- A list of ``Variable`` pointers corresponding to local variables used in the
+ function plus compiler-generated temporaries.
+
+A basic block is represented by the ``Ice::CfgNode`` class. Its key contents
+include:
+
+- A linear list of instructions, in the same style as LLVM. The last
+ instruction of the list is always a terminator instruction: branch, switch,
+ return, unreachable.
+
+- A list of Phi instructions, also in the same style as LLVM. They are held as
+ a linear list for convenience, though per Phi semantics, they are executed "in
+ parallel" without dependencies on each other.
+
+- An unordered list of ``CfgNode`` pointers corresponding to incoming edges, and
+ another list for outgoing edges.
+
+- The node's unique, 0-based index into the CFG's node list.
+
+An instruction is represented by the ``Ice::Inst`` class. Its key contents
+include:
+
+- A list of source operands.
+
+- Its destination variable, if the instruction produces a result in an
+ ``Ice::Variable``.
+
+- A bitvector indicating which variables' live ranges this instruction ends.
+ This is computed during liveness analysis.
+
+Instructions kinds are divided into high-level ICE instructions and low-level
+ICE instructions. High-level instructions consist of the PNaCl/LLVM bitcode
+instruction kinds. Each target architecture implementation extends the
+instruction space with its own set of low-level instructions. Generally,
+low-level instructions correspond to individual machine instructions. The
+high-level ICE instruction space includes a few additional instruction kinds
+that are not part of LLVM but are generally useful (e.g., an Assignment
+instruction), or are useful across targets (e.g., BundleLock and BundleUnlock
+instructions for sandboxing).
+
+Specifically, high-level ICE instructions that derive from LLVM (but with PNaCl
+ABI restrictions as documented in the `PNaCl Bitcode Reference Manual
+<https://developer.chrome.com/native-client/reference/pnacl-bitcode-abi>`_) are
+the following:
+
+- Alloca: allocate data on the stack
+
+- Arithmetic: binary operations of the form ``A = B op C``
+
+- Br: conditional or unconditional branch
+
+- Call: function call
+
+- Cast: unary type-conversion operations
+
+- ExtractElement: extract a scalar element from a vector-type value
+
+- Fcmp: floating-point comparison
+
+- Icmp: integer comparison
+
+- IntrinsicCall: call a known intrinsic
+
+- InsertElement: insert a scalar element into a vector-type value
+
+- Load: load a value from memory
+
+- Phi: implement the SSA phi node
+
+- Ret: return from the function
+
+- Select: essentially the C language operation of the form ``X = C ? Y : Z``
+
+- Store: store a value into memory
+
+- Switch: generalized branch to multiple possible locations
+
+- Unreachable: indicate that this portion of the code is unreachable
+
+The additional high-level ICE instructions are the following:
+
+- Assign: a simple ``A=B`` assignment. This is useful for e.g. lowering Phi
+ instructions to non-SSA assignments, before lowering to machine code.
+
+- BundleLock, BundleUnlock. These are markers used for sandboxing, but are
+ common across all targets and so they are elevated to the high-level
+ instruction set.
+
+- FakeDef, FakeUse, FakeKill. These are tools used to preserve consistency in
+ liveness analysis, elevated to the high-level because they are used by all
+ targets. They are described in more detail at the end of this section.
+
+- JumpTable: this represents the result of switch optimization analysis, where
+ some switch instructions may use jump tables instead of cascading
+ compare/branches.
+
+An operand is represented by the ``Ice::Operand`` class. In high-level ICE, an
+operand is either an ``Ice::Constant`` or an ``Ice::Variable``. Constants
+include scalar integer constants, scalar floating point constants, Undef (an
+unspecified constant of a particular scalar or vector type), and symbol
+constants (essentially addresses of globals). Note that the PNaCl ABI does not
+include vector-type constants besides Undef, and as such, Subzero (so far) has
+no reason to represent vector-type constants internally. A variable represents
+a value allocated on the stack (though not including alloca-derived storage).
+Among other things, a variable holds its unique, 0-based index into the CFG's
+variable list.
+
+Each target can extend the ``Constant`` and ``Variable`` classes for its own
+needs. In addition, the ``Operand`` class may be extended, e.g. to define an
+x86 ``MemOperand`` that encodes a base register, an index register, an index
+register shift amount, and a constant offset.
+
+Register allocation and liveness analysis are restricted to Variable operands.
+Because of the importance of register allocation to code quality, and the
+translation-time cost of liveness analysis, Variable operands get some special
+treatment in ICE. Most notably, a frequent pattern in Subzero is to iterate
+across all the Variables of an instruction. An instruction holds a list of
+operands, but an operand may contain 0, 1, or more Variables. As such, the
+``Operand`` class specially holds a list of Variables contained within, for
+quick access.
+
+A Subzero transformation pass may work by deleting an existing instruction and
+replacing it with zero or more new instructions. Instead of actually deleting
+the existing instruction, we generally mark it as deleted and insert the new
+instructions right after the deleted instruction. When printing the IR for
+debugging, this is a big help because it makes it much more clear how the
+non-deleted instructions came about.
+
+Subzero has a few special instructions to help with liveness analysis
+consistency.
+
+- The FakeDef instruction gives a fake definition of some variable. For
+ example, on x86-32, a divide instruction defines both ``%eax`` and ``%edx``
+ but an ICE instruction can represent only one destination variable. This is
+ similar for multiply instructions, and for function calls that return a 64-bit
+ integer result in the ``%edx:%eax`` pair. Also, using the ``xor %eax, %eax``
+ trick to set ``%eax`` to 0 requires an initial FakeDef of ``%eax``.
+
+- The FakeUse instruction registers a use of a variable, typically to prevent an
+ earlier assignment to that variable from being dead-code eliminated. For
+ example, lowering an operation like ``x=cc?y:z`` may be done using x86's
+ conditional move (cmov) instruction: ``mov z, x; cmov_cc y, x``. Without a
+ FakeUse of ``x`` between the two instructions, the liveness analysis pass may
+ dead-code eliminate the first instruction.
+
+- The FakeKill instruction is added after a call instruction, and is a quick way
+ of indicating that caller-save registers are invalidated.
+
+Pexe parsing
+------------
+
+Subzero includes an integrated PNaCl bitcode parser for ``.pexe`` files. It
+parses the ``.pexe`` file function by function, ultimately constructing an ICE
+CFG for each function. After a function is parsed, its CFG is handed off to the
+translation phase. The bitcode parser also parses global initializer data and
+hands it off to be translated to data sections in the object file.
+
+Subzero has another parsing strategy for testing/debugging. LLVM libraries can
+be used to parse a module into LLVM IR (though very slowly relative to Subzero
+native parsing). Then we iterate across the LLVM IR and construct high-level
+ICE, handing off each CFG to the translation phase.
+
+Overview of lowering
+--------------------
+
+In general, translation goes like this:
+
+- Parse the next function from the ``.pexe`` file and construct a CFG consisting
+ of high-level ICE.
+
+- Do analysis passes and transformation passes on the high-level ICE, as
+ desired.
+
+- Lower each high-level ICE instruction into a sequence of zero or more
+ low-level ICE instructions. Each high-level instruction is generally lowered
+ independently, though the target lowering is allowed to look ahead in the
+ CfgNode's instruction list if desired.
+
+- Do more analysis and transformation passes on the low-level ICE, as desired.
+
+- Assemble the low-level CFG into an ELF object file (alternatively, a textual
+ assembly file that is later assembled by some external tool).
+
+- Repeat for all functions, and also produce object code for data such as global
+ initializers and internal constant pools.
+
+Currently there are two optimization levels: ``O2`` and ``Om1``. For ``O2``,
+the intention is to apply all available optimizations to get the best code
+quality (though the initial code quality goal is measured against LLVM's ``O0``
+code quality). For ``Om1``, the intention is to apply as few optimizations as
+possible and produce code as quickly as possible, accepting poor code quality.
+``Om1`` is short for "O-minus-one", i.e. "worse than O0", or in other words,
+"sub-zero".
+
+High-level debuggability of generated code is so far not a design requirement.
+Subzero doesn't really do transformations that would obfuscate debugging; the
+main thing might be that register allocation (including stack slot coalescing
+for stack-allocated variables whose live ranges don't overlap) may render a
+variable's value unobtainable after its live range ends. This would not be an
+issue for ``Om1`` since it doesn't register-allocate program-level variables,
+nor does it coalesce stack slots. That said, fully supporting debuggability
+would require a few additions:
+
+- DWARF support would need to be added to Subzero's ELF file emitter. Subzero
+ propagates global symbol names, local variable names, and function-internal
+ label names that are present in the ``.pexe`` file. This would allow a
+ debugger to map addresses back to symbols in the ``.pexe`` file.
+
+- To map ``.pexe`` file symbols back to meaningful source-level symbol names,
+ file names, line numbers, etc., Subzero would need to handle `LLVM bitcode
+ metadata <http://llvm.org/docs/LangRef.html#metadata>`_ and ``llvm.dbg``
+ `instrinsics<http://llvm.org/docs/LangRef.html#dbg-intrinsics>`_.
+
+- The PNaCl toolchain explicitly strips all this from the ``.pexe`` file, and so
+ the toolchain would need to be modified to preserve it.
+
+Our experience so far is that ``Om1`` translates twice as fast as ``O2``, but
+produces code with one third the code quality. ``Om1`` is good for testing and
+debugging -- during translation, it tends to expose errors in the basic lowering
+that might otherwise have been hidden by the register allocator or other
+optimization passes. It also helps determine whether a code correctness problem
+is a fundamental problem in the basic lowering, or an error in another
+optimization pass.
+
+The implementation of target lowering also controls the recipe of passes used
+for ``Om1`` and ``O2`` translation. For example, address mode inference may
+only be relevant for x86.
+
+Lowering strategy
+-----------------
+
+The core of Subzero's lowering from high-level ICE to low-level ICE is to lower
+each high-level instruction down to a sequence of low-level target-specific
+instructions, in a largely context-free setting. That is, each high-level
+instruction conceptually has a simple template expansion into low-level
+instructions, and lowering can in theory be done in any order. This may sound
+like a small effort, but quite a large number of templates may be needed because
+of the number of PNaCl types and instruction variants. Furthermore, there may
+be optimized templates, e.g. to take advantage of operator commutativity (for
+example, ``x=x+1`` might allow a bettern lowering than ``x=1+x``). This is
+similar to other template-based approaches in fast code generation or
+interpretation, though some decisions are deferred until after some global
+analysis passes, mostly related to register allocation, stack slot assignment,
+and specific choice of instruction variant and addressing mode.
+
+The key idea for a lowering template is to produce valid low-level instructions
+that are guaranteed to meet address mode and other structural requirements of
+the instruction set. For example, on x86, the source operand of an integer
+store instruction must be an immediate or a physical register; a shift
+instruction's shift amount must be an immediate or in register ``%cl``; a
+function's integer return value is in ``%eax``; most x86 instructions are
+two-operand, in contrast to corresponding three-operand high-level instructions;
+etc.
+
+Because target lowering runs before register allocation, there is no way to know
+whether a given ``Ice::Variable`` operand lives on the stack or in a physical
+register. When the low-level instruction calls for a physical register operand,
+the target lowering can create an infinite-weight Variable. This tells the
+register allocator to assign infinite weight when making decisions, effectively
+guaranteeing some physical register. Variables can also be pre-colored to a
+specific physical register (``cl`` in the shift example above), which also gives
+infinite weight.
+
+To illustrate, consider a high-level arithmetic instruction on 32-bit integer
+operands::
+
+ A = B + C
+
+X86 target lowering might produce the following::
+
+ T.inf = B // mov instruction
+ T.inf += C // add instruction
+ A = T.inf // mov instruction
+
+Here, ``T.inf`` is an infinite-weight temporary. As long as ``T.inf`` has a
+physical register, the three lowered instructions are all encodable regardless
+of whether ``B`` and ``C`` are physical registers, memory, or immediates, and
+whether ``A`` is a physical register or in memory.
+
+In this example, ``A`` must be a Variable and one may be tempted to simplify the
+lowering sequence by setting ``A`` as infinite-weight and using::
+
+ A = B // mov instruction
+ A += C // add instruction
+
+This has two problems. First, if the original instruction was actually ``A =
+B + A``, the result would be incorrect. Second, assigning ``A`` a physical
+register applies throughout ``A``'s entire live range. This is probably not
+what is intended, and may ultimately lead to a failure to allocate a register
+for an infinite-weight variable.
+
+This style of lowering leads to many temporaries being generated, so in ``O2``
+mode, we rely on the register allocator to clean things up. For example, in the
+example above, if ``B`` ends up getting a physical register and its live range
+ends at this instruction, the register allocator is likely to reuse that
+register for ``T.inf``. This leads to ``T.inf=B`` being a redundant register
+copy, which is removed as an emission-time peephole optimization.
+
+O2 lowering
+-----------
+
+Currently, the ``O2`` lowering recipe is the following:
+
+- Loop nest analysis
+
+- Local common subexpression elimination
+
+- Address mode inference
+
+- Read-modify-write (RMW) transformation
+
+- Basic liveness analysis
+
+- Load optimization
+
+- Target lowering
+
+- Full liveness analysis
+
+- Register allocation
+
+- Phi instruction lowering (advanced)
+
+- Post-phi lowering register allocation
+
+- Branch optimization
+
+These passes are described in more detail below.
+
+Om1 lowering
+------------
+
+Currently, the ``Om1`` lowering recipe is the following:
+
+- Phi instruction lowering (simple)
+
+- Target lowering
+
+- Register allocation (infinite-weight and pre-colored only)
+
+Optimization passes
+-------------------
+
+Liveness analysis
+^^^^^^^^^^^^^^^^^
+
+Liveness analysis is a standard dataflow optimization, implemented as follows.
+For each node (basic block), its live-out set is computed as the union of the
+live-in sets of its successor nodes. Then the node's instructions are processed
+in reverse order, updating the live set, until the beginning of the node is
+reached, and the node's live-in set is recorded. If this iteration has changed
+the node's live-in set, the node's predecessors are marked for reprocessing.
+This continues until no more nodes need reprocessing. If nodes are processed in
+reverse topological order, the number of iterations over the CFG is generally
+equal to the maximum loop nest depth.
+
+To implement this, each node records its live-in and live-out sets, initialized
+to the empty set. Each instruction records which of its Variables' live ranges
+end in that instruction, initialized to the empty set. A side effect of
+liveness analysis is dead instruction elimination. Each instruction can be
+marked as tentatively dead, and after the algorithm converges, the tentatively
+dead instructions are permanently deleted.
+
+Optionally, after this liveness analysis completes, we can do live range
+construction, in which we calculate the live range of each variable in terms of
+instruction numbers. A live range is represented as a union of segments, where
+the segment endpoints are instruction numbers. Instruction numbers are required
+to be unique across the CFG, and monotonically increasing within a basic block.
+As a union of segments, live ranges can contain "gaps" and are therefore
+precise. Because of SSA properties, a variable's live range can start at most
+once in a basic block, and can end at most once in a basic block. Liveness
+analysis keeps track of which variable/instruction tuples begin live ranges and
+end live ranges, and combined with live-in and live-out sets, we can efficiently
+build up live ranges of all variables across all basic blocks.
+
+A lot of care is taken to try to make liveness analysis fast and efficient.
+Because of the lowering strategy, the number of variables is generally
+proportional to the number of instructions, leading to an O(N^2) complexity
+algorithm if implemented naively. To improve things based on sparsity, we note
+that most variables are "local" and referenced in at most one basic block (in
+contrast to the "global" variables with multi-block usage), and therefore cannot
+be live across basic blocks. Therefore, the live-in and live-out sets,
+typically represented as bit vectors, can be limited to the set of global
+variables, and the intra-block liveness bit vector can be compacted to hold the
+global variables plus the local variables for that block.
+
+Register allocation
+^^^^^^^^^^^^^^^^^^^
+
+Subzero implements a simple linear-scan register allocator, based on the
+allocator described by Hanspeter Mössenböck and Michael Pfeiffer in `Linear Scan
+Register Allocation in the Context of SSA Form and Register Constraints
+<ftp://ftp.ssw.uni-linz.ac.at/pub/Papers/Moe02.PDF>`_. This allocator has
+several nice features:
+
+- Live ranges are represented as unions of segments, as described above, rather
+ than a single start/end tuple.
+
+- It allows pre-coloring of variables with specific physical registers.
+
+- It applies equally well to pre-lowered Phi instructions.
+
+The paper suggests an approach of aggressively coalescing variables across Phi
+instructions (i.e., trying to force Phi source and destination variables to have
+the same register assignment), but we reject that in favor of the more natural
+preference mechanism described below.
+
+We enhance the algorithm in the paper with the capability of automatic inference
+of register preference, and with the capability of allowing overlapping live
+ranges to safely share the same register in certain circumstances. If we are
+considering register allocation for variable ``A``, and ``A`` has a single
+defining instruction ``A=B+C``, then the preferred register for ``A``, if
+available, would be the register assigned to ``B`` or ``C``, if any, provided
+that ``B`` or ``C``'s live range does not overlap ``A``'s live range. In this
+way we infer a good register preference for ``A``.
+
+We allow overlapping live ranges to get the same register in certain cases.
+Suppose a high-level instruction like::
+
+ A = unary_op(B)
+
+has been target-lowered like::
+
+ T.inf = B
+ A = unary_op(T.inf)
+
+Further, assume that ``B``'s live range continues beyond this instruction
+sequence, and that ``B`` has already been assigned some register. Normally, we
+might want to infer ``B``'s register as a good candidate for ``T.inf``, but it
+turns out that ``T.inf`` and ``B``'s live ranges overlap, requiring them to have
+different registers. But ``T.inf`` is just a read-only copy of ``B`` that is
+guaranteed to be in a register, so in theory these overlapping live ranges could
+safely have the same register. Our implementation allows this overlap as long
+as ``T.inf`` is never modified within ``B``'s live range, and ``B`` is never
+modified within ``T.inf``'s live range.
+
+Subzero's register allocator can be run in 3 configurations.
+
+- Normal mode. All Variables are considered for register allocation. It
+ requires full liveness analysis and live range construction as a prerequisite.
+ This is used by ``O2`` lowering.
+
+- Minimal mode. Only infinite-weight or pre-colored Variables are considered.
+ All other Variables are stack-allocated. It does not require liveness
+ analysis; instead, it quickly scans the instructions and records first
+ definitions and last uses of all relevant Variables, using that to construct a
+ single-segment live range. Although this includes most of the Variables, the
+ live ranges are mostly simple, short, and rarely overlapping, which the
+ register allocator handles efficiently. This is used by ``Om1`` lowering.
+
+- Post-phi lowering mode. Advanced phi lowering is done after normal-mode
+ register allocation, and may result in new infinite-weight Variables that need
+ registers. One would like to just run something like minimal mode to assign
+ registers to the new Variables while respecting existing register allocation
+ decisions. However, it sometimes happens that there are no free registers.
+ In this case, some register needs to be forcibly spilled to the stack and
+ temporarily reassigned to the new Variable, and reloaded at the end of the new
+ Variable's live range. The register must be one that has no explicit
+ references during the Variable's live range. Since Subzero currently doesn't
+ track def/use chains (though it does record the CfgNode where a Variable is
+ defined), we just do a brute-force search across the CfgNode's instruction
+ list for the instruction numbers of interest. This situation happens very
+ rarely, so there's little point for now in improving its performance.
+
+The basic linear-scan algorithm may, as it proceeds, rescind an early register
+allocation decision, leaving that Variable to be stack-allocated. Some of these
+times, it turns out that the Variable could have been given a different register
+without conflict, but by this time it's too late. The literature recognizes
+this situation and describes "second-chance bin-packing", which Subzero can do.
+We can rerun the register allocator in a mode that respects existing register
+allocation decisions, and sometimes it finds new non-conflicting opportunities.
+In fact, we can repeatedly run the register allocator until convergence.
+Unfortunately, in the current implementation, these subsequent register
+allocation passes end up being extremely expensive. This is because of the
+treatment of the "unhandled pre-colored" Variable set, which is normally very
+small but ends up being quite large on subsequent passes. Its performance can
+probably be made acceptable with a better choice of data structures, but for now
+this second-chance mechanism is disabled.
+
+Future work is to implement LLVM's `Greedy
+<http://blog.llvm.org/2011/09/greedy-register-allocation-in-llvm-30.html>`_
+register allocator as a replacement for the basic linear-scan algorithm, given
+LLVM's experience with its improvement in code quality. (The blog post claims
+that the Greedy allocator also improved maintainability because a lot of hacks
+could be removed, but Subzero is probably not yet to that level of hacks, and is
+less likely to see that particular benefit.)
+
+Local common subexpression elimination
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The Local CSE implementation goes through each instruction and records a portion
+of each ``Seen`` instruction in a hashset-like container. That portion consists
+of the entire instruction except for any dest variable. That means ``A = X + Y``
+and ``B = X + Y`` will be considered to be 'equal' for this purpose. This allows
+us to detect common subexpressions.
+
+Whenever a repetition is detected, the redundant variables are stored in a
+container mapping the replacee to the replacement. In the case above, it would
+be ``MAP[B] = A`` assuming ``B = X + Y`` comes after ``A = X + Y``.
+
+At any point if a variable that has an entry in the replacement table is
+encountered, it is replaced with the variable it is mapped to. This ensures that
+the redundant variables will not have any uses in the basic block, allowing
+dead code elimination to clean up the redundant instruction.
+
+With SSA, the information stored is never invalidated. However, non-SSA input is
+supported with the ``-lcse=no-ssa`` option. This has to maintain some extra
+dependency information to ensure proper invalidation on variable assignment.
+This is not rigorously tested because this pass is run at an early stage where
+it is safe to assume variables have a single definition. This is not enabled by
+default because it bumps the compile time overhead from 2% to 6%.
+
+Loop-invariant code motion
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This pass utilizes the loop analysis information to hoist invariant instructions
+to loop pre-headers. A loop must have a single entry node (header) and that node
+must have a single external predecessor for this optimization to work, as it is
+currently implemented.
+
+The pass works by iterating over all instructions in the loop until the set of
+invariant instructions converges. In each iteration, a non-invariant instruction
+involving only constants or a variable known to be invariant is added to the
+result set. The destination variable of that instruction is added to the set of
+variables known to be invariant (which is initialized with the constant args).
+
+Improving the loop-analysis infrastructure is likely to have significant impact
+on this optimization. Inserting an extra node to act as the pre-header when the
+header has multiple incoming edges from outside could also be a good idea.
+Expanding the initial invariant variable set to contain all variables that do
+not have definitions inside the loop does not seem to improve anything.
+
+Short circuit evaluation
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Short circuit evaluation splits nodes and introduces early jumps when the result
+of a logical operation can be determined early and there are no observable side
+effects of skipping the rest of the computation. The instructions considered
+backwards from the end of the basic blocks. When a definition of a variable
+involved in a conditional jump is found, an extra jump can be inserted in that
+location, moving the rest of the instructions in the node to a newly inserted
+node. Consider this example::
+
+ __N :
+ a = <something>
+ Instruction 1 without side effect
+ ... b = <something> ...
+ Instruction N without side effect
+ t1 = or a b
+ br t1 __X __Y
+
+is transformed to::
+
+ __N :
+ a = <something>
+ br a __X __N_ext
+
+ __N_ext :
+ Instruction 1 without side effect
+ ... b = <something> ...
+ Instruction N without side effect
+ br b __X __Y
+
+The logic for AND is analogous, the only difference is that the early jump is
+facilitated by a ``false`` value instead of ``true``.
+
+Global Variable Splitting
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Global variable splitting (``-split-global-vars``) is run after register
+allocation. It works on the variables that did not manage to get registers (but
+are allowed to) and decomposes their live ranges into the individual segments
+(which span a single node at most). New variables are created (but not yet used)
+with these smaller live ranges and the register allocator is run again. This is
+not inefficient as the old variables that already had registers are now
+considered pre-colored.
+
+The new variables that get registers replace their parent variables for their
+portion of its (parent's) live range. A copy from the old variable to the new
+is introduced before the first use and the reverse after the last def in the
+live range.
+
+Basic phi lowering
+^^^^^^^^^^^^^^^^^^
+
+The simplest phi lowering strategy works as follows (this is how LLVM ``-O0``
+implements it). Consider this example::
+
+ L1:
+ ...
+ br L3
+ L2:
+ ...
+ br L3
+ L3:
+ A = phi [B, L1], [C, L2]
+ X = phi [Y, L1], [Z, L2]
+
+For each destination of a phi instruction, we can create a temporary and insert
+the temporary's assignment at the end of the predecessor block::
+
+ L1:
+ ...
+ A' = B
+ X' = Y
+ br L3
+ L2:
+ ...
+ A' = C
+ X' = Z
+ br L3
+ L2:
+ A = A'
+ X = X'
+
+This transformation is very simple and reliable. It can be done before target
+lowering and register allocation, and it easily avoids the classic lost-copy and
+related problems. ``Om1`` lowering uses this strategy.
+
+However, it has the disadvantage of initializing temporaries even for branches
+not taken, though that could be mitigated by splitting non-critical edges and
+putting assignments in the edge-split nodes. Another problem is that without
+extra machinery, the assignments to ``A``, ``A'``, ``X``, and ``X'`` are given a
+specific ordering even though phi semantics are that the assignments are
+parallel or unordered. This sometimes imposes false live range overlaps and
+leads to poorer register allocation.
+
+Advanced phi lowering
+^^^^^^^^^^^^^^^^^^^^^
+
+``O2`` lowering defers phi lowering until after register allocation to avoid the
+problem of false live range overlaps. It works as follows. We split each
+incoming edge and move the (parallel) phi assignments into the split nodes. We
+linearize each set of assignments by finding a safe, topological ordering of the
+assignments, respecting register assignments as well. For example::
+
+ A = B
+ X = Y
+
+Normally these assignments could be executed in either order, but if ``B`` and
+``X`` are assigned the same physical register, we would want to use the above
+ordering. Dependency cycles are broken by introducing a temporary. For
+example::
+
+ A = B
+ B = A
+
+Here, a temporary breaks the cycle::
+
+ t = A
+ A = B
+ B = t
+
+Finally, we use the existing target lowering to lower the assignments in this
+basic block, and once that is done for all basic blocks, we run the post-phi
+variant of register allocation on the edge-split basic blocks.
+
+When computing a topological order, we try to first schedule assignments whose
+source has a physical register, and last schedule assignments whose destination
+has a physical register. This helps reduce register pressure.
+
+X86 address mode inference
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+We try to take advantage of the x86 addressing mode that includes a base
+register, an index register, an index register scale amount, and an immediate
+offset. We do this through simple pattern matching. Starting with a load or
+store instruction where the address is a variable, we initialize the base
+register to that variable, and look up the instruction where that variable is
+defined. If that is an add instruction of two variables and the index register
+hasn't been set, we replace the base and index register with those two
+variables. If instead it is an add instruction of a variable and a constant, we
+replace the base register with the variable and add the constant to the
+immediate offset.
+
+There are several more patterns that can be matched. This pattern matching
+continues on the load or store instruction until no more matches are found.
+Because a program typically has few load and store instructions (not to be
+confused with instructions that manipulate stack variables), this address mode
+inference pass is fast.
+
+X86 read-modify-write inference
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A reasonably common bitcode pattern is a non-atomic update of a memory
+location::
+
+ x = load addr
+ y = add x, 1
+ store y, addr
+
+On x86, with good register allocation, the Subzero passes described above
+generate code with only this quality::
+
+ mov [%ebx], %eax
+ add $1, %eax
+ mov %eax, [%ebx]
+
+However, x86 allows for this kind of code::
+
+ add $1, [%ebx]
+
+which requires fewer instructions, but perhaps more importantly, requires fewer
+physical registers.
+
+It's also important to note that this transformation only makes sense if the
+store instruction ends ``x``'s live range.
+
+Subzero's ``O2`` recipe includes an early pass to find read-modify-write (RMW)
+opportunities via simple pattern matching. The only problem is that it is run
+before liveness analysis, which is needed to determine whether ``x``'s live
+range ends after the RMW. Since liveness analysis is one of the most expensive
+passes, it's not attractive to run it an extra time just for RMW analysis.
+Instead, we essentially generate both the RMW and the non-RMW versions, and then
+during lowering, the RMW version deletes itself if it finds x still live.
+
+X86 compare-branch inference
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+In the LLVM instruction set, the compare/branch pattern works like this::
+
+ cond = icmp eq a, b
+ br cond, target
+
+The result of the icmp instruction is a single bit, and a conditional branch
+tests that bit. By contrast, most target architectures use this pattern::
+
+ cmp a, b // implicitly sets various bits of FLAGS register
+ br eq, target // branch on a particular FLAGS bit
+
+A naive lowering sequence conditionally sets ``cond`` to 0 or 1, then tests
+``cond`` and conditionally branches. Subzero has a pass that identifies
+boolean-based operations like this and folds them into a single
+compare/branch-like operation. It is set up for more than just cmp/br though.
+Boolean producers include icmp (integer compare), fcmp (floating-point compare),
+and trunc (integer truncation when the destination has bool type). Boolean
+consumers include branch, select (the ternary operator from the C language), and
+sign-extend and zero-extend when the source has bool type.
+
+Sandboxing
+^^^^^^^^^^
+
+Native Client's sandbox model uses software fault isolation (SFI) to provide
+safety when running untrusted code in a browser or other environment. Subzero
+implements Native Client's `sandboxing
+<https://developer.chrome.com/native-client/reference/sandbox_internals/index>`_
+to enable Subzero-translated executables to be run inside Chrome. Subzero also
+provides a fairly simple framework for investigating alternative sandbox models
+or other restrictions on the sandbox model.
+
+Sandboxing in Subzero is not actually implemented as a separate pass, but is
+integrated into lowering and assembly.
+
+- Indirect branches, including the ret instruction, are masked to a bundle
+ boundary and bundle-locked.
+
+- Call instructions are aligned to the end of the bundle so that the return
+ address is bundle-aligned.
+
+- Indirect branch targets, including function entry and targets in a switch
+ statement jump table, are bundle-aligned.
+
+- The intrinsic for reading the thread pointer is inlined appropriately.
+
+- For x86-64, non-stack memory accesses are with respect to the reserved sandbox
+ base register. We reduce the aggressiveness of address mode inference to
+ leave room for the sandbox base register during lowering. There are no memory
+ sandboxing changes for x86-32.
+
+Code emission
+-------------
+
+Subzero's integrated assembler is derived from Dart's `assembler code
+<https://github.com/dart-lang/sdk/tree/master/runtime/vm>'_. There is a pass
+that iterates through the low-level ICE instructions and invokes the relevant
+assembler functions. Placeholders are added for later fixup of branch target
+offsets. (Backward branches use short offsets if possible; forward branches
+generally use long offsets unless it is an intra-block branch of "known" short
+length.) The assembler emits into a staging buffer. Once emission into the
+staging buffer for a function is complete, the data is emitted to the output
+file as an ELF object file, and metadata such as relocations, symbol table, and
+string table, are accumulated for emission at the end. Global data initializers
+are emitted similarly. A key point is that at this point, the staging buffer
+can be deallocated, and only a minimum of data needs to held until the end.
+
+As a debugging alternative, Subzero can emit textual assembly code which can
+then be run through an external assembler. This is of course super slow, but
+quite valuable when bringing up a new target.
+
+As another debugging option, the staging buffer can be emitted as textual
+assembly, primarily in the form of ".byte" lines. This allows the assembler to
+be tested separately from the ELF related code.
+
+Memory management
+-----------------
+
+Where possible, we allocate from a ``CfgLocalAllocator`` which derives from
+LLVM's ``BumpPtrAllocator``. This is an arena-style allocator where objects
+allocated from the arena are never actually freed; instead, when the CFG
+translation completes and the CFG is deleted, the entire arena memory is
+reclaimed at once. This style of allocation works well in an environment like a
+compiler where there are distinct phases with only easily-identifiable objects
+living across phases. It frees the developer from having to manage object
+deletion, and it amortizes deletion costs across just a single arena deletion at
+the end of the phase. Furthermore, it helps scalability by allocating entirely
+from thread-local memory pools, and minimizing global locking of the heap.
+
+Instructions are probably the most heavily allocated complex class in Subzero.
+We represent an instruction list as an intrusive doubly linked list, allocate
+all instructions from the ``CfgLocalAllocator``, and we make sure each
+instruction subclass is basically `POD
+<http://en.cppreference.com/w/cpp/concept/PODType>`_ (Plain Old Data) with a
+trivial destructor. This way, when the CFG is finished, we don't need to
+individually deallocate every instruction. We do similar for Variables, which
+is probably the second most popular complex class.
+
+There are some situations where passes need to use some `STL container class
+<http://en.cppreference.com/w/cpp/container>`_. Subzero has a way of using the
+``CfgLocalAllocator`` as the container allocator if this is needed.
+
+Multithreaded translation
+-------------------------
+
+Subzero is designed to be able to translate functions in parallel. With the
+``-threads=N`` command-line option, there is a 3-stage producer-consumer
+pipeline:
+
+- A single thread parses the ``.pexe`` file and produces a sequence of work
+ units. A work unit can be either a fully constructed CFG, or a set of global
+ initializers. The work unit includes its sequence number denoting its parse
+ order. Each work unit is added to the translation queue.
+
+- There are N translation threads that draw work units from the translation
+ queue and lower them into assembler buffers. Each assembler buffer is added
+ to the emitter queue, tagged with its sequence number. The CFG and its
+ ``CfgLocalAllocator`` are disposed of at this point.
+
+- A single thread draws assembler buffers from the emitter queue and appends to
+ the output file. It uses the sequence numbers to reintegrate the assembler
+ buffers according to the original parse order, such that output order is
+ always deterministic.
+
+This means that with ``-threads=N``, there are actually ``N+1`` spawned threads
+for a total of ``N+2`` execution threads, taking the parser and emitter threads
+into account. For the special case of ``N=0``, execution is entirely sequential
+-- the same thread parses, translates, and emits, one function at a time. This
+is useful for performance measurements.
+
+Ideally, we would like to get near-linear scalability as the number of
+translation threads increases. We expect that ``-threads=1`` should be slightly
+faster than ``-threads=0`` as the small amount of time spent parsing and
+emitting is done largely in parallel with translation. With perfect
+scalability, we see ``-threads=N`` translating ``N`` times as fast as
+``-threads=1``, up until the point where parsing or emitting becomes the
+bottleneck, or ``N+2`` exceeds the number of CPU cores. In reality, memory
+performance would become a bottleneck and efficiency might peak at, say, 75%.
+
+Currently, parsing takes about 11% of total sequential time. If translation
+scalability ever gets so fast and awesomely scalable that parsing becomes a
+bottleneck, it should be possible to make parsing multithreaded as well.
+
+Internally, all shared, mutable data is held in the GlobalContext object, and
+access to each field is guarded by a mutex.
+
+Security
+--------
+
+Subzero includes a number of security features in the generated code, as well as
+in the Subzero translator itself, which run on top of the existing Native Client
+sandbox as well as Chrome's OS-level sandbox.
+
+Sandboxed translator
+^^^^^^^^^^^^^^^^^^^^
+
+When running inside the browser, the Subzero translator executes as sandboxed,
+untrusted code that is initially checked by the validator, just like the
+LLVM-based ``pnacl-llc`` translator. As such, the Subzero binary should be no
+more or less secure than the translator it replaces, from the point of view of
+the Chrome sandbox. That said, Subzero is much smaller than ``pnacl-llc`` and
+was designed from the start with security in mind, so one expects fewer attacker
+opportunities here.
+
+Code diversification
+^^^^^^^^^^^^^^^^^^^^
+
+`Return-oriented programming
+<https://en.wikipedia.org/wiki/Return-oriented_programming>`_ (ROP) is a
+now-common technique for starting with e.g. a known buffer overflow situation
+and launching it into a deeper exploit. The attacker scans the executable
+looking for ROP gadgets, which are short sequences of code that happen to load
+known values into known registers and then return. An attacker who manages to
+overwrite parts of the stack can overwrite it with carefully chosen return
+addresses such that certain ROP gadgets are effectively chained together to set
+up the register state as desired, finally returning to some code that manages to
+do something nasty based on those register values.
+
+If there is a popular ``.pexe`` with a large install base, the attacker could
+run Subzero on it and scan the executable for suitable ROP gadgets to use as
+part of a potential exploit. Note that if the trusted validator is working
+correctly, these ROP gadgets are limited to starting at a bundle boundary and
+cannot use the trick of finding a gadget that happens to begin inside another
+instruction. All the same, gadgets with these constraints still exist and the
+attacker has access to them. This is the attack model we focus most on --
+protecting the user against misuse of a "trusted" developer's application, as
+opposed to mischief from a malicious ``.pexe`` file.
+
+Subzero can mitigate these attacks to some degree through code diversification.
+Specifically, we can apply some randomness to the code generation that makes ROP
+gadgets less predictable. This randomness can have some compile-time cost, and
+it can affect the code quality; and some diversifications may be more effective
+than others. A more detailed treatment of hardening techniques may be found in
+the Matasano report "`Attacking Clientside JIT Compilers
+<https://www.nccgroup.trust/globalassets/resources/us/presentations/documents/attacking_clientside_jit_compilers_paper.pdf>`_".
+
+To evaluate diversification effectiveness, we use a third-party ROP gadget
+finder and limit its results to bundle-aligned addresses. For a given
+diversification technique, we run it with a number of different random seeds,
+find ROP gadgets for each version, and determine how persistent each ROP gadget
+is across the different versions. A gadget is persistent if the same gadget is
+found at the same code address. The best diversifications are ones with low
+gadget persistence rates.
+
+Subzero implements 7 different diversification techniques. Below is a
+discussion of each technique, its effectiveness, and its cost. The discussions
+of cost and effectiveness are for a single diversification technique; the
+translation-time costs for multiple techniques are additive, but the effects of
+multiple techniques on code quality and effectiveness are not yet known.
+
+In Subzero's implementation, each randomization is "repeatable" in a sense.
+Each pass that includes a randomization option gets its own private instance of
+a random number generator (RNG). The RNG is seeded with a combination of a
+global seed, the pass ID, and the function's sequence number. The global seed
+is designed to be different across runs (perhaps based on the current time), but
+for debugging, the global seed can be set to a specific value and the results
+will be repeatable.
+
+Subzero-generated code is subject to diversification once per translation, and
+then Chrome caches the diversified binary for subsequent executions. An
+attacker may attempt to run the binary multiple times hoping for
+higher-probability combinations of ROP gadgets. When the attacker guesses
+wrong, a likely outcome is an application crash. Chrome throttles creation of
+crashy processes which reduces the likelihood of the attacker eventually gaining
+a foothold.
+
+Constant blinding
+~~~~~~~~~~~~~~~~~
+
+Here, we prevent attackers from controlling large immediates in the text
+(executable) section. A random cookie is generated for each function, and if
+the constant exceeds a specified threshold, the constant is obfuscated with the
+cookie and equivalent code is generated. For example, instead of this x86
+instruction::
+
+ mov $0x11223344, <%Reg/Mem>
+
+the following code might be generated::
+
+ mov $(0x11223344+Cookie), %temp
+ lea -Cookie(%temp), %temp
+ mov %temp, <%Reg/Mem>
+
+The ``lea`` instruction is used rather than e.g. ``add``/``sub`` or ``xor``, to
+prevent unintended effects on the flags register.
+
+This transformation has almost no effect on translation time, and about 1%
+impact on code quality, depending on the threshold chosen. It does little to
+reduce gadget persistence, but it does remove a lot of potential opportunities
+to construct intra-instruction ROP gadgets (which an attacker could use only if
+a validator bug were discovered, since the Native Client sandbox and associated
+validator force returns and other indirect branches to be to bundle-aligned
+addresses).
+
+Constant pooling
+~~~~~~~~~~~~~~~~
+
+This is similar to constant blinding, in that large immediates are removed from
+the text section. In this case, each unique constant above the threshold is
+stored in a read-only data section and the constant is accessed via a memory
+load. For the above example, the following code might be generated::
+
+ mov $Label$1, %temp
+ mov %temp, <%Reg/Mem>
+
+This has a similarly small impact on translation time and ROP gadget
+persistence, and a smaller (better) impact on code quality. This is because it
+uses fewer instructions, and in some cases good register allocation leads to no
+increase in instruction count. Note that this still gives an attacker some
+limited amount of control over some text section values, unless we randomize the
+constant pool layout.
+
+Static data reordering
+~~~~~~~~~~~~~~~~~~~~~~
+
+This transformation limits the attacker's ability to control bits in global data
+address references. It simply permutes the order in memory of global variables
+and internal constant pool entries. For the constant pool, we only permute
+within a type (i.e., emit a randomized list of ints, followed by a randomized
+list of floats, etc.) to maintain good packing in the face of alignment
+constraints.
+
+As might be expected, this has no impact on code quality, translation time, or
+ROP gadget persistence (though as above, it limits opportunities for
+intra-instruction ROP gadgets with a broken validator).
+
+Basic block reordering
+~~~~~~~~~~~~~~~~~~~~~~
+
+Here, we randomize the order of basic blocks within a function, with the
+constraint that we still want to maintain a topological order as much as
+possible, to avoid making the code too branchy.
+
+This has no impact on code quality, and about 1% impact on translation time, due
+to a separate pass to recompute layout. It ends up having a huge effect on ROP
+gadget persistence, tied for best with nop insertion, reducing ROP gadget
+persistence to less than 5%.
+
+Function reordering
+~~~~~~~~~~~~~~~~~~~
+
+Here, we permute the order that functions are emitted, primarily to shift ROP
+gadgets around to less predictable locations. It may also change call address
+offsets in case the attacker was trying to control that offset in the code.
+
+To control latency and memory footprint, we don't arbitrarily permute functions.
+Instead, for some relatively small value of N, we queue up N assembler buffers,
+and then emit the N functions in random order, and repeat until all functions
+are emitted.
+
+Function reordering has no impact on translation time or code quality.
+Measurements indicate that it reduces ROP gadget persistence to about 15%.
+
+Nop insertion
+~~~~~~~~~~~~~
+
+This diversification randomly adds a nop instruction after each regular
+instruction, with some probability. Nop instructions of different lengths may
+be selected. Nop instructions are never added inside a bundle_lock region.
+Note that when sandboxing is enabled, nop instructions are already being added
+for bundle alignment, so the diversification nop instructions may simply be
+taking the place of alignment nop instructions, though distributed differently
+through the bundle.
+
+In Subzero's currently implementation, nop insertion adds 3-5% to the
+translation time, but this is probably because it is implemented as a separate
+pass that adds actual nop instructions to the IR. The overhead would probably
+be a lot less if it were integrated into the assembler pass. The code quality
+is also reduced by 3-5%, making nop insertion the most expensive of the
+diversification techniques.
+
+Nop insertion is very effective in reducing ROP gadget persistence, at the same
+level as basic block randomization (less than 5%). But given nop insertion's
+impact on translation time and code quality, one would most likely prefer to use
+basic block randomization instead (though the combined effects of the different
+diversification techniques have not yet been studied).
+
+Register allocation randomization
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In this diversification, the register allocator tries to make different but
+mostly functionally equivalent choices, while maintaining stable code quality.
+
+A naive approach would be the following. Whenever the allocator has more than
+one choice for assigning a register, choose randomly among those options. And
+whenever there are no registers available and there is a tie for the
+lowest-weight variable, randomly select one of the lowest-weight variables to
+evict. Because of the one-pass nature of the linear-scan algorithm, this
+randomization strategy can have a large impact on which variables are ultimately
+assigned registers, with a corresponding large impact on code quality.
+
+Instead, we choose an approach that tries to keep code quality stable regardless
+of the random seed. We partition the set of physical registers into equivalence
+classes. If a register is pre-colored in the function (i.e., referenced
+explicitly by name), it forms its own equivalence class. The remaining
+registers are partitioned according to their combination of attributes such as
+integer versus floating-point, 8-bit versus 32-bit, caller-save versus
+callee-saved, etc. Each equivalence class is randomly permuted, and the
+complete permutation is applied to the final register assignments.
+
+Register randomization reduces ROP gadget persistence to about 10% on average,
+though there tends to be fairly high variance across functions and applications.
+This probably has to do with the set of restrictions in the x86-32 instruction
+set and ABI, such as few general-purpose registers, ``%eax`` used for return
+values, ``%edx`` used for division, ``%cl`` used for shifting, etc. As
+intended, register randomization has no impact on code quality, and a slight
+(0.5%) impact on translation time due to an extra scan over the variables to
+identify pre-colored registers.
+
+Fuzzing
+^^^^^^^
+
+We have started fuzz-testing the ``.pexe`` files input to Subzero, using a
+combination of `afl-fuzz <http://lcamtuf.coredump.cx/afl/>`_, LLVM's `libFuzzer
+<http://llvm.org/docs/LibFuzzer.html>`_, and custom tooling. The purpose is to
+find and fix cases where Subzero crashes or otherwise ungracefully fails on
+unexpected inputs, and to do so automatically over a large range of unexpected
+inputs. By fixing bugs that arise from fuzz testing, we reduce the possibility
+of an attacker exploiting these bugs.
+
+Most of the problems found so far are ones most appropriately handled in the
+parser. However, there have been a couple that have identified problems in the
+lowering, or otherwise inappropriately triggered assertion failures and fatal
+errors. We continue to dig into this area.
+
+Future security work
+^^^^^^^^^^^^^^^^^^^^
+
+Subzero is well-positioned to explore other future security enhancements, e.g.:
+
+- Tightening the Native Client sandbox. ABI changes, such as the previous work
+ on `hiding the sandbox base address
+ <https://docs.google.com/document/d/1eskaI4353XdsJQFJLRnZzb_YIESQx4gNRzf31dqXVG8>`_
+ in x86-64, are easy to experiment with in Subzero.
+
+- Making the executable code section read-only. This would prevent a PNaCl
+ application from inspecting its own binary and trying to find ROP gadgets even
+ after code diversification has been performed. It may still be susceptible to
+ `blind ROP <http://www.scs.stanford.edu/brop/bittau-brop.pdf>`_ attacks,
+ security is still overall improved.
+
+- Instruction selection diversification. It may be possible to lower a given
+ instruction in several largely equivalent ways, which gives more opportunities
+ for code randomization.
+
+Chrome integration
+------------------
+
+Currently Subzero is available in Chrome for the x86-32 architecture, but under
+a flag. When the flag is enabled, Subzero is used when the `manifest file
+<https://developer.chrome.com/native-client/reference/nacl-manifest-format>`_
+linking to the ``.pexe`` file specifies the ``O0`` optimization level.
+
+The next step is to remove the flag, i.e. invoke Subzero as the only translator
+for ``O0``-specified manifest files.
+
+Ultimately, Subzero might produce code rivaling LLVM ``O2`` quality, in which
+case Subzero could be used for all PNaCl translation.
+
+Command line options
+--------------------
+
+Subzero has a number of command-line options for debugging and diagnostics.
+Among the more interesting are the following.
+
+- Using the ``-verbose`` flag, Subzero will dump the CFG, or produce other
+ diagnostic output, with various levels of detail after each pass. Instruction
+ numbers can be printed or suppressed. Deleted instructions can be printed or
+ suppressed (they are retained in the instruction list, as discussed earlier,
+ because they can help explain how lower-level instructions originated).
+ Liveness information can be printed when available. Details of register
+ allocation can be printed as register allocator decisions are made. And more.
+
+- Running Subzero with any level of verbosity produces an enormous amount of
+ output. When debugging a single function, verbose output can be suppressed
+ except for a particular function. The ``-verbose-focus`` flag suppresses
+ verbose output except for the specified function.
+
+- Subzero has a ``-timing`` option that prints a breakdown of pass-level timing
+ at exit. Timing markers can be placed in the Subzero source code to demarcate
+ logical operations or passes of interest. Basic timing information plus
+ call-stack type timing information is printed at the end.
+
+- Along with ``-timing``, the user can instead get a report on the overall
+ translation time for each function, to help focus on timing outliers. Also,
+ ``-timing-focus`` limits the ``-timing`` reporting to a single function,
+ instead of aggregating pass timing across all functions.
+
+- The ``-szstats`` option reports various statistics on each function, such as
+ stack frame size, static instruction count, etc. It may be helpful to track
+ these stats over time as Subzero is improved, as an approximate measure of
+ code quality.
+
+- The flag ``-asm-verbose``, in conjunction with emitting textual assembly
+ output, annotate the assembly output with register-focused liveness
+ information. In particular, each basic block is annotated with which
+ registers are live-in and live-out, and each instruction is annotated with
+ which registers' and stack locations' live ranges end at that instruction.
+ This is really useful when studying the generated code to find opportunities
+ for code quality improvements.
+
+Testing and debugging
+---------------------
+
+LLVM lit tests
+^^^^^^^^^^^^^^
+
+For basic testing, Subzero uses LLVM's `lit
+<http://llvm.org/docs/CommandGuide/lit.html>`_ framework for running tests. We
+have a suite of hundreds of small functions where we test for particular
+assembly code patterns across different target architectures.
+
+Cross tests
+^^^^^^^^^^^
+
+Unfortunately, the lit tests don't do a great job of precisely testing the
+correctness of the output. Much better are the cross tests, which are execution
+tests that compare Subzero and ``pnacl-llc`` translated bitcode across a wide
+variety of interesting inputs. Each cross test consists of a set of C, C++,
+and/or low-level bitcode files. The C and C++ source files are compiled down to
+bitcode. The bitcode files are translated by ``pnacl-llc`` and also by Subzero.
+Subzero mangles global symbol names with a special prefix to avoid duplicate
+symbol errors. A driver program invokes both versions on a large set of
+interesting inputs, and reports when the Subzero and ``pnacl-llc`` results
+differ. Cross tests turn out to be an excellent way of testing the basic
+lowering patterns, but they are less useful for testing more global things like
+liveness analysis and register allocation.
+
+Bisection debugging
+^^^^^^^^^^^^^^^^^^^
+
+Sometimes with a new application, Subzero will end up producing incorrect code
+that either crashes at runtime or otherwise produces the wrong results. When
+this happens, we need to narrow it down to a single function (or small set of
+functions) that yield incorrect behavior. For this, we have a bisection
+debugging framework. Here, we initially translate the entire application once
+with Subzero and once with ``pnacl-llc``. We then use ``objdump`` to
+selectively weaken symbols based on a whitelist or blacklist provided on the
+command line. The two object files can then be linked together without link
+errors, with the desired version of each method "winning". Then the binary is
+tested, and bisection proceeds based on whether the binary produces correct
+output.
+
+When the bisection completes, we are left with a minimal set of
+Subzero-translated functions that cause the failure. Usually it is a single
+function, though sometimes it might require a combination of several functions
+to cause a failure; this may be due to an incorrect call ABI, for example.
+However, Murphy's Law implies that the single failing function is enormous and
+impractical to debug. In that case, we can restart the bisection, explicitly
+blacklisting the enormous function, and try to find another candidate to debug.
+(Future work is to automate this to find all minimal sets of functions, so that
+debugging can focus on the simplest example.)
+
+Fuzz testing
+^^^^^^^^^^^^
+
+As described above, we try to find internal Subzero bugs using fuzz testing
+techniques.
+
+Sanitizers
+^^^^^^^^^^
+
+Subzero can be built with `AddressSanitizer
+<http://clang.llvm.org/docs/AddressSanitizer.html>`_ (ASan) or `ThreadSanitizer
+<http://clang.llvm.org/docs/ThreadSanitizer.html>`_ (TSan) support. This is
+done using something as simple as ``make ASAN=1`` or ``make TSAN=1``. So far,
+multithreading has been simple enough that TSan hasn't found any bugs, but ASan
+has found at least one memory leak which was subsequently fixed.
+`UndefinedBehaviorSanitizer
+<http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation>`_
+(UBSan) support is in progress. `Control flow integrity sanitization
+<http://clang.llvm.org/docs/ControlFlowIntegrity.html>`_ is also under
+consideration.
+
+Current status
+==============
+
+Target architectures
+--------------------
+
+Subzero is currently more or less complete for the x86-32 target. It has been
+refactored and extended to handle x86-64 as well, and that is mostly complete at
+this point.
+
+ARM32 work is in progress. It currently lacks the testing level of x86, at
+least in part because Subzero's register allocator needs modifications to handle
+ARM's aliasing of floating point and vector registers. Specifically, a 64-bit
+register is actually a gang of two consecutive and aligned 32-bit registers, and
+a 128-bit register is a gang of 4 consecutive and aligned 32-bit registers.
+ARM64 work has not started; when it does, it will be native-only since the
+Native Client sandbox model, validator, and other tools have never been defined.
+
+An external contributor is adding MIPS support, in most part by following the
+ARM work.
+
+Translator performance
+----------------------
+
+Single-threaded translation speed is currently about 5× the ``pnacl-llc``
+translation speed. For a large ``.pexe`` file, the time breaks down as:
+
+- 11% for parsing and initial IR building
+
+- 4% for emitting to /dev/null
+
+- 27% for liveness analysis (two liveness passes plus live range construction)
+
+- 15% for linear-scan register allocation
+
+- 9% for basic lowering
+
+- 10% for advanced phi lowering
+
+- ~11% for other minor analysis
+
+- ~10% measurement overhead to acquire these numbers
+
+Some improvements could undoubtedly be made, but it will be hard to increase the
+speed to 10× of ``pnacl-llc`` while keeping acceptable code quality. With
+``-Om1`` (lack of) optimization, we do actually achieve roughly 10×
+``pnacl-llc`` translation speed, but code quality drops by a factor of 3.
+
+Code quality
+------------
+
+Measured across 16 components of spec2k, Subzero's code quality is uniformly
+better than ``pnacl-llc`` ``-O0`` code quality, and in many cases solidly
+between ``pnacl-llc`` ``-O0`` and ``-O2``.
+
+Translator size
+---------------
+
+When built in MINIMAL mode, the x86-64 native translator size for the x86-32
+target is about 700 KB, not including the size of functions referenced in
+dynamically-linked libraries. The sandboxed version of Subzero is a bit over 1
+MB, and it is statically linked and also includes nop padding for bundling as
+well as indirect branch masking.
+
+Translator memory footprint
+---------------------------
+
+It's hard to draw firm conclusions about memory footprint, since the footprint
+is at least proportional to the input function size, and there is no real limit
+on the size of functions in the ``.pexe`` file.
+
+That said, we looked at the memory footprint over time as Subzero translated
+``pnacl-llc.pexe``, which is the largest ``.pexe`` file (7.2 MB) at our
+disposal. One of LLVM's libraries that Subzero uses can report the current
+malloc heap usage. With single-threaded translation, Subzero tends to hover
+around 15 MB of memory usage. There are a couple of monstrous functions where
+Subzero grows to around 100 MB, but then it drops back down after those
+functions finish translating. In contrast, ``pnacl-llc`` grows larger and
+larger throughout translation, reaching several hundred MB by the time it
+completes.
+
+It's a bit more interesting when we enable multithreaded translation. When
+there are N translation threads, Subzero implements a policy that limits the
+size of the translation queue to N entries -- if it is "full" when the parser
+tries to add a new CFG, the parser blocks until one of the translation threads
+removes a CFG. This means the number of in-memory CFGs can (and generally does)
+reach 2*N+1, and so the memory footprint rises in proportion to the number of
+threads. Adding to the pressure is the observation that the monstrous functions
+also take proportionally longer time to translate, so there's a good chance many
+of the monstrous functions will be active at the same time with multithreaded
+translation. As a result, for N=32, Subzero's memory footprint peaks at about
+260 MB, but drops back down as the large functions finish translating.
+
+If this peak memory size becomes a problem, it might be possible for the parser
+to resequence the functions to try to spread out the larger functions, or to
+throttle the translation queue to prevent too many in-flight large functions.
+It may also be possible to throttle based on memory pressure signaling from
+Chrome.
+
+Translator scalability
+----------------------
+
+Currently scalability is "not very good". Multiple translation threads lead to
+faster translation, but not to the degree desired. We haven't dug in to
+investigate yet.
+
+There are a few areas to investigate. First, there may be contention on the
+constant pool, which all threads access, and which requires locked access even
+for reading. This could be mitigated by keeping a CFG-local cache of the most
+common constants.
+
+Second, there may be contention on memory allocation. While almost all CFG
+objects are allocated from the CFG-local allocator, some passes use temporary
+STL containers that use the default allocator, which may require global locking.
+This could be mitigated by switching these to the CFG-local allocator.
+
+Third, multithreading may make the default allocator strategy more expensive.
+In a single-threaded environment, a pass will allocate its containers, run the
+pass, and deallocate the containers. This results in stack-like allocation
+behavior and makes the heap free list easier to manage, with less heap
+fragmentation. But when multithreading is added, the allocations and
+deallocations become much less stack-like, making allocation and deallocation
+operations individually more expensive. Again, this could be mitigated by
+switching these to the CFG-local allocator.
diff --git a/chromium/third_party/swiftshader/third_party/subzero/README.rst b/chromium/third_party/swiftshader/third_party/subzero/README.rst
index cffceba7c58..922d99d2c6f 120000..100644
--- a/chromium/third_party/swiftshader/third_party/subzero/README.rst
+++ b/chromium/third_party/swiftshader/third_party/subzero/README.rst
@@ -1 +1,213 @@
-docs/README.rst \ No newline at end of file
+Subzero - Fast code generator for PNaCl bitcode
+===============================================
+
+Design
+------
+
+See the accompanying DESIGN.rst file for a more detailed technical overview of
+Subzero.
+
+Building
+--------
+
+Subzero is set up to be built within the Native Client tree. Follow the
+`Developing PNaCl
+<https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/developing-pnacl>`_
+instructions, in particular the section on building PNaCl sources. This will
+prepare the necessary external headers and libraries that Subzero needs.
+Checking out the Native Client project also gets the pre-built clang and LLVM
+tools in ``native_client/../third_party/llvm-build/Release+Asserts/bin`` which
+are used for building Subzero.
+
+The Subzero source is in ``native_client/toolchain_build/src/subzero``. From
+within that directory, ``git checkout master && git pull`` to get the latest
+version of Subzero source code.
+
+The Makefile is designed to be used as part of the higher level LLVM build
+system. To build manually, use the ``Makefile.standalone``. There are several
+build configurations from the command line::
+
+ make -f Makefile.standalone
+ make -f Makefile.standalone DEBUG=1
+ make -f Makefile.standalone NOASSERT=1
+ make -f Makefile.standalone DEBUG=1 NOASSERT=1
+ make -f Makefile.standalone MINIMAL=1
+ make -f Makefile.standalone ASAN=1
+ make -f Makefile.standalone TSAN=1
+
+``DEBUG=1`` builds without optimizations and is good when running the translator
+inside a debugger. ``NOASSERT=1`` disables assertions and is the preferred
+configuration for performance testing the translator. ``MINIMAL=1`` attempts to
+minimize the size of the translator by compiling out everything unnecessary.
+``ASAN=1`` enables AddressSanitizer, and ``TSAN=1`` enables ThreadSanitizer.
+
+The result of the ``make`` command is the target ``pnacl-sz`` in the current
+directory.
+
+Building within LLVM trunk
+--------------------------
+
+Subzero can also be built from within a standard LLVM trunk checkout. Here is
+an example of how it can be checked out and built::
+
+ mkdir llvm-git
+ cd llvm-git
+ git clone http://llvm.org/git/llvm.git
+ cd llvm/projects/
+ git clone https://chromium.googlesource.com/native_client/pnacl-subzero
+ cd ../..
+ mkdir build
+ cd build
+ cmake -G Ninja ../llvm/
+ ninja
+ ./bin/pnacl-sz -version
+
+This creates a default build of ``pnacl-sz``; currently any options such as
+``DEBUG=1`` or ``MINIMAL=1`` have to be added manually.
+
+``pnacl-sz``
+------------
+
+The ``pnacl-sz`` program parses a pexe or an LLVM bitcode file and translates it
+into ICE (Subzero's intermediate representation). It then invokes the ICE
+translate method to lower it to target-specific machine code, optionally dumping
+the intermediate representation at various stages of the translation.
+
+The program can be run as follows::
+
+ ../pnacl-sz ./path/to/<file>.pexe
+ ../pnacl-sz ./tests_lit/pnacl-sz_tests/<file>.ll
+
+At this time, ``pnacl-sz`` accepts a number of arguments, including the
+following:
+
+ ``-help`` -- Show available arguments and possible values. (Note: this
+ unfortunately also pulls in some LLVM-specific options that are reported but
+ that Subzero doesn't use.)
+
+ ``-notranslate`` -- Suppress the ICE translation phase, which is useful if
+ ICE is missing some support.
+
+ ``-target=<TARGET>`` -- Set the target architecture. The default is x8632.
+ Future targets include x8664, arm32, and arm64.
+
+ ``-filetype=obj|asm|iasm`` -- Select the output file type. ``obj`` is a
+ native ELF file, ``asm`` is a textual assembly file, and ``iasm`` is a
+ low-level textual assembly file demonstrating the integrated assembler.
+
+ ``-O<LEVEL>`` -- Set the optimization level. Valid levels are ``2``, ``1``,
+ ``0``, ``-1``, and ``m1``. Levels ``-1`` and ``m1`` are synonyms, and
+ represent the minimum optimization and worst code quality, but fastest code
+ generation.
+
+ ``-verbose=<list>`` -- Set verbosity flags. This argument allows a
+ comma-separated list of values. The default is ``none``, and the value
+ ``inst,pred`` will roughly match the .ll bitcode file. Of particular use
+ are ``all``, ``most``, and ``none``.
+
+ ``-o <FILE>`` -- Set the assembly output file name. Default is stdout.
+
+ ``-log <FILE>`` -- Set the file name for diagnostic output (whose level is
+ controlled by ``-verbose``). Default is stdout.
+
+ ``-timing`` -- Dump some pass timing information after translating the input
+ file.
+
+Running the test suite
+----------------------
+
+Subzero uses the LLVM ``lit`` testing tool for part of its test suite, which
+lives in ``tests_lit``. To execute the test suite, first build Subzero, and then
+run::
+
+ make -f Makefile.standalone check-lit
+
+There is also a suite of cross tests in the ``crosstest`` directory. A cross
+test takes a test bitcode file implementing some unit tests, and translates it
+twice, once with Subzero and once with LLVM's known-good ``llc`` translator.
+The Subzero-translated symbols are specially mangled to avoid multiple
+definition errors from the linker. Both translated versions are linked together
+with a driver program that calls each version of each unit test with a variety
+of interesting inputs and compares the results for equality. The cross tests
+are currently invoked by running::
+
+ make -f Makefile.standalone check-xtest
+
+Similar, there is a suite of unit tests::
+
+ make -f Makefile.standalone check-unit
+
+A convenient way to run the lit, cross, and unit tests is::
+
+ make -f Makefile.standalone check
+
+Assembling ``pnacl-sz`` output as needed
+----------------------------------------
+
+``pnacl-sz`` can now produce a native ELF binary using ``-filetype=obj``.
+
+``pnacl-sz`` can also produce textual assembly code in a structure suitable for
+input to ``llvm-mc``, using ``-filetype=asm`` or ``-filetype=iasm``. An object
+file can then be produced using the command::
+
+ llvm-mc -triple=i686 -filetype=obj -o=MyObj.o
+
+Building a translated binary
+----------------------------
+
+There is a helper script, ``pydir/szbuild.py``, that translates a finalized pexe
+into a fully linked executable. Run it with ``-help`` for extensive
+documentation.
+
+By default, ``szbuild.py`` builds an executable using only Subzero translation,
+but it can also be used to produce hybrid Subzero/``llc`` binaries (``llc`` is
+the name of the LLVM translator) for bisection-based debugging. In bisection
+debugging mode, the pexe is translated using both Subzero and ``llc``, and the
+resulting object files are combined into a single executable using symbol
+weakening and other linker tricks to control which Subzero symbols and which
+``llc`` symbols take precedence. This is controlled by the ``-include`` and
+``-exclude`` arguments. These can be used to rapidly find a single function
+that Subzero translates incorrectly leading to incorrect output.
+
+There is another helper script, ``pydir/szbuild_spec2k.py``, that runs
+``szbuild.py`` on one or more components of the Spec2K suite. This assumes that
+Spec2K is set up in the usual place in the Native Client tree, and the finalized
+pexe files have been built. (Note: for working with Spec2K and other pexes,
+it's helpful to finalize the pexe using ``--no-strip-syms``, to preserve the
+original function and global variable names.)
+
+Status
+------
+
+Subzero currently fully supports the x86-32 architecture, for both native and
+Native Client sandboxing modes. The x86-64 architecture is also supported in
+native mode only, and only for the x32 flavor due to the fact that pointers and
+32-bit integers are indistinguishable in PNaCl bitcode. Sandboxing support for
+x86-64 is in progress. ARM and MIPS support is in progress. Two optimization
+levels, ``-Om1`` and ``-O2``, are implemented.
+
+The ``-Om1`` configuration is designed to be the simplest and fastest possible,
+with a minimal set of passes and transformations.
+
+* Simple Phi lowering before target lowering, by generating temporaries and
+ adding assignments to the end of predecessor blocks.
+
+* Simple register allocation limited to pre-colored or infinite-weight
+ Variables.
+
+The ``-O2`` configuration is designed to use all optimizations available and
+produce the best code.
+
+* Address mode inference to leverage the complex x86 addressing modes.
+
+* Compare/branch fusing based on liveness/last-use analysis.
+
+* Global, linear-scan register allocation.
+
+* Advanced phi lowering after target lowering and global register allocation,
+ via edge splitting, topological sorting of the parallel moves, and final local
+ register allocation.
+
+* Stack slot coalescing to reduce frame size.
+
+* Branch optimization to reduce the number of branches to the following block.
diff --git a/chromium/third_party/wayland-protocols/src/configure.ac b/chromium/third_party/wayland-protocols/src/configure.ac
index 4c43daa2c7c..fbb0ec242fd 100644
--- a/chromium/third_party/wayland-protocols/src/configure.ac
+++ b/chromium/third_party/wayland-protocols/src/configure.ac
@@ -35,6 +35,7 @@ PKG_NOARCH_INSTALLDIR
AC_CONFIG_FILES([
Makefile
wayland-protocols.pc
+ wayland-protocols-uninstalled.pc
])
AC_OUTPUT
diff --git a/chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml b/chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml
index e449b37876b..a46994c8d2c 100644
--- a/chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml
+++ b/chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml
@@ -81,7 +81,6 @@
For details on what information is returned, see the
presentation_feedback interface.
</description>
-
<arg name="surface" type="object" interface="wl_surface"
summary="target surface"/>
<arg name="callback" type="new_id" interface="wp_presentation_feedback"
@@ -120,7 +119,6 @@
recommended. Clients must be able to query the current clock
value directly, not by asking the compositor.
</description>
-
<arg name="clk_id" type="uint" summary="platform clock identifier"/>
</event>
@@ -152,7 +150,6 @@
the synchronized output. If a client has not bound to the
right wl_output global at all, this event is not sent.
</description>
-
<arg name="output" type="object" interface="wl_output"
summary="presentation output"/>
</event>
@@ -192,7 +189,6 @@
Possible zero-copy cases include direct scanout of a
fullscreen surface and a surface on a hardware overlay.
</description>
-
<entry name="vsync" value="0x1" summary="presentation was vsync'd"/>
<entry name="hw_clock" value="0x2"
summary="hardware provided the presentation timestamp"/>
@@ -246,7 +242,6 @@
a way to query the refresh count, then the arguments seq_hi
and seq_lo must be zero.
</description>
-
<arg name="tv_sec_hi" type="uint"
summary="high 32 bits of the seconds part of the presentation timestamp"/>
<arg name="tv_sec_lo" type="uint"
diff --git a/chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml b/chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml
index 5d006c08719..c732d8c35bc 100644
--- a/chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml
+++ b/chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml
@@ -54,7 +54,6 @@
a wp_viewport object associated, the viewport_exists
protocol error is raised.
</description>
-
<arg name="id" type="new_id" interface="wp_viewport"
summary="the new viewport interface id"/>
<arg name="surface" type="object" interface="wl_surface"
@@ -159,7 +158,6 @@
The crop and scale state is double-buffered state, and will be
applied on the next wl_surface.commit.
</description>
-
<arg name="x" type="fixed" summary="source rectangle x"/>
<arg name="y" type="fixed" summary="source rectangle y"/>
<arg name="width" type="fixed" summary="source rectangle width"/>
@@ -180,7 +178,6 @@
The crop and scale state is double-buffered state, and will be
applied on the next wl_surface.commit.
</description>
-
<arg name="width" type="int" summary="surface width"/>
<arg name="height" type="int" summary="surface height"/>
</request>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml
index 70372fc5d79..9c06cdcba6c 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml
@@ -42,7 +42,7 @@
<request name="destroy" type="destructor">
<description summary="destroy the idle inhibitor object">
- This destroys the inhibit manager.
+ Destroy the inhibit manager.
</description>
</request>
@@ -75,7 +75,7 @@
<request name="destroy" type="destructor">
<description summary="destroy the idle inhibitor object">
- This removes the inhibitor effect from the associated wl_surface.
+ Remove the inhibitor effect from the associated wl_surface.
</description>
</request>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml
index c1b2b595d97..e9d93ba609e 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml
@@ -27,8 +27,8 @@
<interface name="zwp_input_method_context_v1" version="1">
<description summary="input method context">
Corresponds to a text input on the input method side. An input method context
- is created on text input activation on the input method side. It allows to
- receive information about the text input from the application via events.
+ is created on text input activation on the input method side. It allows
+ receiving information about the text input from the application via events.
Input method contexts do not keep state after deactivation and should be
destroyed after deactivation is handled.
@@ -86,7 +86,7 @@
<request name="preedit_styling">
<description summary="pre-edit styling">
- Sets styling information on composing text. The style is applied for
+ Set the styling information on composing text. The style is applied for
length in bytes from index relative to the beginning of
the composing text (as byte offset). Multiple styles can
be applied to a composing text.
@@ -100,7 +100,7 @@
<request name="preedit_cursor">
<description summary="pre-edit cursor">
- Sets the cursor position inside the composing text (as byte offset)
+ Set the cursor position inside the composing text (as byte offset)
relative to the start of the composing text.
When index is negative no cursor should be displayed.
@@ -112,6 +112,8 @@
<request name="delete_surrounding_text">
<description summary="delete text">
+ Remove the surrounding text.
+
This request will be handled on the text_input side directly following
a commit_string request.
</description>
@@ -121,11 +123,11 @@
<request name="cursor_position">
<description summary="set cursor to a new position">
- Sets the cursor and anchor to a new position. Index is the new cursor
- position in bytes (when >= 0 relative to the end of inserted text,
- otherwise relative to the beginning of the inserted text). Anchor is
- the new anchor position in bytes (when >= 0 relative to the end of the
- inserted text, otherwise relative to the beginning of the inserted
+ Set the cursor and anchor to a new position. Index is the new cursor
+ position in bytes (when >= 0 this is relative to the end of the inserted text,
+ otherwise it is relative to the beginning of the inserted text). Anchor is
+ the new anchor position in bytes (when >= 0 this is relative to the end of the
+ inserted text, otherwise it is relative to the beginning of the inserted
text). When there should be no selected text, anchor should be the same
as index.
@@ -145,7 +147,7 @@
Notify when a key event was sent. Key events should not be used for
normal text input operations, which should be done with commit_string,
delete_surrounding_text, etc. The key event follows the wl_keyboard key
- event convention. Sym is an XKB keysym, state a wl_keyboard key_state.
+ event convention. Sym is an XKB keysym, state is a wl_keyboard key_state.
</description>
<arg name="serial" type="uint" summary="serial of the latest known text input state"/>
<arg name="time" type="uint"/>
@@ -156,7 +158,7 @@
<request name="grab_keyboard">
<description summary="grab hardware keyboard">
- Allows an input method to receive hardware keyboard input and process
+ Allow an input method to receive hardware keyboard input and process
key events to generate text events (with pre-edit) over the wire. This
allows input methods which compose multiple key events for inputting
text like it is done for CJK languages.
@@ -166,11 +168,9 @@
<request name="key">
<description summary="forward key event">
- Should be used when filtering key events with grab_keyboard.
-
- When the wl_keyboard::key event is not processed by the input
- method itself and should be sent to the client instead, forward it
- with this request. The arguments should be the ones from the
+ Forward a wl_keyboard::key event to the client that was not processed
+ by the input method itself. Should be used when filtering key events
+ with grab_keyboard. The arguments should be the ones from the
wl_keyboard::key event.
For generating custom key events use the keysym request instead.
@@ -183,10 +183,9 @@
<request name="modifiers">
<description summary="forward modifiers event">
- Should be used when filtering key events with grab_keyboard.
-
- When the wl_keyboard::modifiers event should also be sent to the
- client, forward it with this request. The arguments should be the ones
+ Forward a wl_keyboard::modifiers event to the client that was not
+ processed by the input method itself. Should be used when filtering
+ key events with grab_keyboard. The arguments should be the ones
from the wl_keyboard::modifiers event.
</description>
<arg name="serial" type="uint" summary="serial from wl_keyboard::modifiers"/>
@@ -212,7 +211,7 @@
position in bytes within the surrounding text relative to the beginning
of the text. Anchor is the position in bytes of the selection anchor
within the surrounding text relative to the beginning of the text. If
- there is no selected text anchor is the same as cursor.
+ there is no selected text then anchor is the same as cursor.
</description>
<arg name="text" type="string"/>
<arg name="cursor" type="uint"/>
@@ -285,6 +284,8 @@
<request name="set_toplevel">
<description summary="set the surface type as a keyboard">
+ Set the input_panel_surface type to keyboard.
+
A keyboard surface is only shown when a text input is active.
</description>
<arg name="output" type="object" interface="wl_output"/>
@@ -293,8 +294,10 @@
<request name="set_overlay_panel">
<description summary="set the surface type as an overlay panel">
- An overlay panel is shown near the input cursor above the application
- window when a text input is active.
+ Set the input_panel_surface to be an overlay panel.
+
+ This is shown near the input cursor above the application window when
+ a text input is active.
</description>
</request>
</interface>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
index 3b4861f3583..60240f9df84 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
@@ -98,7 +98,8 @@
binds to this interface. A roundtrip after binding guarantees
that the client has received all supported formats.
- For the definition of the format codes, see create request.
+ For the definition of the format codes, see the
+ zwp_linux_buffer_params_v1::create request.
XXX: Can a compositor ever enumerate them?
</description>
@@ -127,22 +128,16 @@
<enum name="error">
<entry name="already_used" value="0"
summary="the dmabuf_batch object has already been used to create a wl_buffer"/>
-
<entry name="plane_idx" value="1"
summary="plane index out of bounds"/>
-
<entry name="plane_set" value="2"
summary="the plane index was already set"/>
-
<entry name="incomplete" value="3"
summary="missing or too many planes to create a buffer"/>
-
<entry name="invalid_format" value="4"
summary="format not supported"/>
-
<entry name="invalid_dimensions" value="5"
summary="invalid width or height"/>
-
<entry name="out_of_bounds" value="6"
summary="offset + stride * height goes out of dmabuf bounds"/>
</enum>
@@ -170,7 +165,6 @@
The error PLANE_SET is raised if attempting to set a plane that
was already set.
</description>
-
<arg name="fd" type="fd" summary="dmabuf fd"/>
<arg name="plane_idx" type="uint" summary="plane index"/>
<arg name="offset" type="uint" summary="offset in bytes"/>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
index 4b95a5c0e3a..4e67a13c981 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
@@ -140,7 +140,6 @@
objects of the same seat. wl_pointer.axis and wl_pointer.button events
are unaffected.
</description>
-
<arg name="id" type="new_id" interface="zwp_locked_pointer_v1"/>
<arg name="surface" type="object" interface="wl_surface"
summary="surface to lock pointer to"/>
@@ -171,7 +170,6 @@
state. See the the description of wp_confined_pointer for further
information.
</description>
-
<arg name="id" type="new_id" interface="zwp_confined_pointer_v1"/>
<arg name="surface" type="object" interface="wl_surface"
summary="surface to lock pointer to"/>
@@ -231,7 +229,6 @@
effect when the associated surface gets it pending state applied. See
wl_surface.commit for details.
</description>
-
<arg name="surface_x" type="fixed"
summary="surface-local x coordinate"/>
<arg name="surface_y" type="fixed"
@@ -248,7 +245,6 @@
For details about the lock region, see wp_locked_pointer.
</description>
-
<arg name="region" type="object" interface="wl_region" allow-null="true"
summary="region of surface"/>
</request>
@@ -317,7 +313,6 @@
For details about the confine region, see wp_confined_pointer.
</description>
-
<arg name="region" type="object" interface="wl_region" allow-null="true"
summary="region of surface"/>
</request>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml
index 24935a30009..ca6f81d12ac 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml
@@ -68,7 +68,6 @@
Create a relative pointer interface given a wl_pointer object. See the
wp_relative_pointer interface for more details.
</description>
-
<arg name="id" type="new_id" interface="zwp_relative_pointer_v1"/>
<arg name="pointer" type="object" interface="wl_pointer"/>
</request>
@@ -119,7 +118,6 @@
from a wl_pointer object of the same seat that the wp_relative_pointer
object is associated with.
</description>
-
<arg name="utime_hi" type="uint"
summary="high 32 bits of a 64 bit timestamp with microsecond granularity"/>
<arg name="utime_lo" type="uint"
diff --git a/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml
index c5f58e91c86..6db9c05a415 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml
@@ -542,7 +542,6 @@
wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for
details.
</description>
-
<arg name="serial" type="uint"/>
<arg name="button" type="uint" summary="The button whose state has changed"/>
<arg name="state" type="uint" enum="button_state" summary="Whether the button was pressed or released"/>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml b/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml
index 728a3df9f4b..b286d964af8 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml
@@ -556,7 +556,6 @@
wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for
details.
</description>
-
<arg name="serial" type="uint"/>
<arg name="button" type="uint" summary="The button whose state has changed"/>
<arg name="state" type="uint" enum="button_state" summary="Whether the button was pressed or released"/>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml
index d37ffcf8055..29a217ebe2e 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml
@@ -4,35 +4,36 @@
<copyright>
Copyright © 2012, 2013 Intel Corporation
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice (including the next
- paragraph) shall be included in all copies or substantial portions of the
- Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
</copyright>
<interface name="zwp_text_input_v1" version="1">
<description summary="text input">
An object used for text input. Adds support for text input and input
- methods to applications. A text-input object is created from a
+ methods to applications. A text_input object is created from a
wl_text_input_manager and corresponds typically to a text entry in an
application.
- Requests are used to activate/deactivate the text-input object and set
+
+ Requests are used to activate/deactivate the text_input object and set
state information like surrounding and selected text or the content type.
- The information about entered text is sent to the text-input object via
+ The information about entered text is sent to the text_input object via
the pre-edit and commit events. Using this interface removes the need
for applications to directly process hardware key events and compose text
out of them.
@@ -58,11 +59,12 @@
<request name="activate">
<description summary="request activation">
- Requests the text-input object to be activated (typically when the
+ Requests the text_input object to be activated (typically when the
text entry gets focus).
+
The seat argument is a wl_seat which maintains the focus for this
activation. The surface argument is a wl_surface assigned to the
- text-input object and tracked for focus lost. The enter event
+ text_input object and tracked for focus lost. The enter event
is emitted on successful activation.
</description>
<arg name="seat" type="object" interface="wl_seat"/>
@@ -71,7 +73,7 @@
<request name="deactivate">
<description summary="request deactivation">
- Requests the text-input object to be deactivated (typically when the
+ Requests the text_input object to be deactivated (typically when the
text entry lost focus). The seat argument is a wl_seat which was used
for activation.
</description>
@@ -104,7 +106,7 @@
UTF-8 encoded. Cursor is the byte offset within the
surrounding text. Anchor is the byte offset of the
selection anchor within the surrounding text. If there is no selected
- text anchor is the same as cursor.
+ text anchor, then it is the same as cursor.
</description>
<arg name="text" type="string"/>
<arg name="cursor" type="uint"/>
@@ -178,12 +180,12 @@
<request name="set_preferred_language">
<description summary="sets preferred language">
Sets a specific language. This allows for example a virtual keyboard to
- show a language specific layout. The "language" argument is a RFC-3066
+ show a language specific layout. The "language" argument is an RFC-3066
format language tag.
- It could be used for example in a word processor to indicate language of
- currently edited document or in an instant message application which tracks
- languages of contacts.
+ It could be used for example in a word processor to indicate the
+ language of the currently edited document or in an instant message
+ application which tracks languages of contacts.
</description>
<arg name="language" type="string"/>
</request>
@@ -199,7 +201,7 @@
<event name="enter">
<description summary="enter event">
- Notify the text-input object when it received focus. Typically in
+ Notify the text_input object when it received focus. Typically in
response to an activate request.
</description>
<arg name="surface" type="object" interface="wl_surface"/>
@@ -207,7 +209,7 @@
<event name="leave">
<description summary="leave event">
- Notify the text-input object when it lost focus. Either in response
+ Notify the text_input object when it lost focus. Either in response
to a deactivate request or when the assigned surface lost focus or was
destroyed.
</description>
@@ -215,7 +217,7 @@
<event name="modifiers_map">
<description summary="modifiers map">
- Transfer an array of 0-terminated modifiers names. The position in
+ Transfer an array of 0-terminated modifier names. The position in
the array is the index of the modifier as used in the modifiers
bitmask in the keysym event.
</description>
@@ -287,7 +289,7 @@
<description summary="commit">
Notify when text should be inserted into the editor widget. The text to
commit could be either just a single character after a key press or the
- result of some composing (pre-edit). It could be also an empty text
+ result of some composing (pre-edit). It could also be an empty text
when some text should be removed (see delete_surrounding_text) or when
the input cursor should be moved (see cursor_position).
@@ -341,8 +343,8 @@
<event name="language">
<description summary="language">
- Sets the language of the input text. The "language" argument is a RFC-3066
- format language tag.
+ Sets the language of the input text. The "language" argument is an
+ RFC-3066 format language tag.
</description>
<arg name="serial" type="uint" summary="serial of the latest known text input state"/>
<arg name="language" type="string"/>
@@ -358,8 +360,8 @@
<description summary="text direction">
Sets the text direction of input text.
- It is mainly needed for showing input cursor on correct side of the
- editor when there is no input yet done and making sure neutral
+ It is mainly needed for showing an input cursor on the correct side of
+ the editor when there is no input done yet and making sure neutral
direction text is laid out properly.
</description>
<arg name="serial" type="uint" summary="serial of the latest known text input state"/>
@@ -369,12 +371,12 @@
<interface name="zwp_text_input_manager_v1" version="1">
<description summary="text input manager">
- A factory for text-input objects. This object is a global singleton.
+ A factory for text_input objects. This object is a global singleton.
</description>
<request name="create_text_input">
<description summary="create text input">
- Creates a new text-input object.
+ Creates a new text_input object.
</description>
<arg name="id" type="new_id" interface="zwp_text_input_v1"/>
</request>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml
index c6f577573c1..062b09041a2 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml
@@ -80,7 +80,6 @@
be used to create a xdg_imported multiple times. Only xdg_surface
surfaces may be exported.
</description>
-
<arg name="id" type="new_id" interface="zxdg_exported_v1"
summary="the new xdg_exported object"/>
<arg name="surface" type="object" interface="wl_surface"
@@ -110,7 +109,6 @@
represents the imported surface, and the importing client can
manipulate its relationship using it. See xdg_imported for details.
</description>
-
<arg name="id" type="new_id" interface="zxdg_imported_v1"
summary="the new xdg_imported object"/>
<arg name="handle" type="string"
@@ -141,7 +139,6 @@
import the surface by calling xdg_importer.import. A handle may be
used to import the surface multiple times.
</description>
-
<arg name="handle" type="string" summary="the exported surface handle"/>
</event>
</interface>
@@ -168,7 +165,6 @@
sets up a surface to surface relation with the same stacking and positioning
semantics as xdg_surface.set_parent.
</description>
-
<arg name="surface" type="object" interface="wl_surface"
summary="the child surface"/>
</request>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml
index 542491fa8a8..ef0180d0107 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml
@@ -234,7 +234,6 @@
This request must be used in response to some sort of user action
like a button press, key press, or touch down event.
</description>
-
<arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
<arg name="serial" type="uint" summary="the serial of the user event"/>
<arg name="x" type="int" summary="the x position to pop up the window menu at"/>
@@ -396,7 +395,6 @@
can respond to one, it is free to discard all but the last
event it received.
</description>
-
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="states" type="array"/>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml
index 565df8ce35c..e49d74fccd8 100644
--- a/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml
+++ b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml
@@ -247,7 +247,6 @@
The adjustments can be combined, according to a defined precedence: 1)
Flip, 2) Slide, 3) Resize.
</description>
-
<entry name="none" value="0">
<description summary="don't move the child surface when constrained">
Don't alter the surface position even if it is constrained on some
@@ -567,7 +566,7 @@
service name.
The compositor shell will try to group application surfaces together
- by their app ID. As a best practice, it is suggested to select app
+ by their app ID. As a best practice, it is suggested to select app
ID's that match the basename of the application's .desktop file.
For example, "org.freedesktop.FooViewer" where the .desktop file is
"org.freedesktop.FooViewer.desktop".
@@ -595,7 +594,6 @@
This request must be used in response to some sort of user action
like a button press, key press, or touch down event.
</description>
-
<arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
<arg name="serial" type="uint" summary="the serial of the user event"/>
<arg name="x" type="int" summary="the x position to pop up the window menu at"/>
@@ -884,7 +882,7 @@
If the width or height arguments are zero, it means the client
should decide its own window dimension. This may happen when the
- compositor need to configure the state of the surface but doesn't
+ compositor needs to configure the state of the surface but doesn't
have any information about any previous or expected dimension.
The states listed in the event specify how the width/height
@@ -894,7 +892,6 @@
Clients must send an ack_configure in response to this event. See
xdg_surface.configure and xdg_surface.ack_configure for details.
</description>
-
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="states" type="array"/>
@@ -905,11 +902,11 @@
The close event is sent by the compositor when the user
wants the surface to be closed. This should be equivalent to
the user clicking the close button in client-side decorations,
- if your application has any...
+ if your application has any.
- This is only a request that the user intends to close your
+ This is only a request that the user intends to close the
window. The client may choose to ignore this request, or show
- a dialog to ask the user to save their data...
+ a dialog to ask the user to save their data, etc.
</description>
</event>
</interface>
@@ -1009,7 +1006,6 @@
"owner-events" grab in X11 parlance), while the top most grabbing popup
will always have keyboard focus.
</description>
-
<arg name="seat" type="object" interface="wl_seat"
summary="the wl_seat of the user event"/>
<arg name="serial" type="uint" summary="the serial of the user event"/>
diff --git a/chromium/third_party/wayland-protocols/src/wayland-protocols-uninstalled.pc.in b/chromium/third_party/wayland-protocols/src/wayland-protocols-uninstalled.pc.in
new file mode 100644
index 00000000000..cf7adf257a7
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/wayland-protocols-uninstalled.pc.in
@@ -0,0 +1,5 @@
+pkgdatadir=@abs_top_srcdir@
+
+Name: Wayland Protocols
+Description: Wayland protocol files (not installed)
+Version: @WAYLAND_PROTOCOLS_VERSION@
diff --git a/chromium/third_party/wayland/src/Makefile.am b/chromium/third_party/wayland/src/Makefile.am
index d35231cd33b..d78a0ca5ef6 100644
--- a/chromium/third_party/wayland/src/Makefile.am
+++ b/chromium/third_party/wayland/src/Makefile.am
@@ -151,6 +151,7 @@ built_test_programs = \
connection-test \
event-loop-test \
fixed-test \
+ interface-test \
list-test \
map-test \
os-wrappers-test \
@@ -168,16 +169,22 @@ if ENABLE_CPP_TEST
built_test_programs += cpp-compile-test
endif
-TESTS = $(built_test_programs)
+AM_TESTS_ENVIRONMENT = \
+ export WAYLAND_SCANNER='$(top_builddir)/wayland-scanner' \
+ TEST_DATA_DIR='$(top_srcdir)/tests/data' \
+ TEST_OUTPUT_DIR='$(top_builddir)/tests/output' \
+ SED=$(SED) \
+ ;
-check_PROGRAMS = \
- $(built_test_programs) \
- exec-fd-leak-checker
+TESTS = $(built_test_programs) \
+ tests/scanner-test.sh
noinst_PROGRAMS = \
+ $(built_test_programs) \
+ exec-fd-leak-checker \
fixed-benchmark
-check_LTLIBRARIES = libtest-runner.la
+noinst_LTLIBRARIES += libtest-runner.la
libtest_runner_la_SOURCES = \
tests/test-runner.c \
@@ -205,6 +212,8 @@ event_loop_test_SOURCES = tests/event-loop-test.c
event_loop_test_LDADD = libtest-runner.la
fixed_test_SOURCES = tests/fixed-test.c
fixed_test_LDADD = libtest-runner.la
+interface_test_SOURCES = tests/interface-test.c
+interface_test_LDADD = libtest-runner.la
list_test_SOURCES = tests/list-test.c
list_test_LDADD = libtest-runner.la
map_test_SOURCES = tests/map-test.c
@@ -245,4 +254,23 @@ os_wrappers_test_LDADD = libtest-runner.la
exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
exec_fd_leak_checker_LDADD = libtest-runner.la
+
+EXTRA_DIST += tests/scanner-test.sh \
+ tests/data/example.xml \
+ tests/data/example-client.h \
+ tests/data/example-server.h \
+ tests/data/example-code.c \
+ tests/data/small.xml \
+ tests/data/small-code.c \
+ tests/data/small-client.h \
+ tests/data/small-server.h \
+ tests/data/small-code-core.c \
+ tests/data/small-client-core.h \
+ tests/data/small-server-core.h
+
+tests/scanner-test.sh: $(top_builddir)/wayland-scanner
+
+clean-local:
+ -rm -rf tests/output
+
endif #ENABLE_LIBRARIES
diff --git a/chromium/third_party/wayland/src/cursor/os-compatibility.c b/chromium/third_party/wayland/src/cursor/os-compatibility.c
index d7d4b33b43b..e972d219587 100644
--- a/chromium/third_party/wayland/src/cursor/os-compatibility.c
+++ b/chromium/third_party/wayland/src/cursor/os-compatibility.c
@@ -103,7 +103,7 @@ create_tmpfile_cloexec(char *tmpname)
int
os_create_anonymous_file(off_t size)
{
- static const char template[] = "/weston-shared-XXXXXX";
+ static const char template[] = "/wayland-cursor-shared-XXXXXX";
const char *path;
char *name;
int fd;
diff --git a/chromium/third_party/wayland/src/doc/doxygen/Makefile.am b/chromium/third_party/wayland/src/doc/doxygen/Makefile.am
index c3773536230..276a395bfbf 100644
--- a/chromium/third_party/wayland/src/doc/doxygen/Makefile.am
+++ b/chromium/third_party/wayland/src/doc/doxygen/Makefile.am
@@ -9,7 +9,6 @@ noinst_DATA = \
dist_noinst_DATA = wayland.doxygen.in
scanned_src_files_shared = \
- $(top_srcdir)/src/wayland-util.c \
$(top_srcdir)/src/wayland-util.h
scanned_src_files_Client = \
diff --git a/chromium/third_party/wayland/src/doc/doxygen/wayland.doxygen.in b/chromium/third_party/wayland/src/doc/doxygen/wayland.doxygen.in
index 9d7fa0c40f1..3913a135789 100644
--- a/chromium/third_party/wayland/src/doc/doxygen/wayland.doxygen.in
+++ b/chromium/third_party/wayland/src/doc/doxygen/wayland.doxygen.in
@@ -8,7 +8,8 @@ QUIET = YES
HTML_TIMESTAMP = YES
GENERATE_LATEX = NO
MAN_LINKS = YES
-PREDEFINED = WL_EXPORT=
+PREDEFINED = WL_EXPORT= \
+ WL_PRINTF(x,y)=
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
DOT_MULTI_TARGETS = YES
diff --git a/chromium/third_party/wayland/src/doc/publican/sources/Client.xml b/chromium/third_party/wayland/src/doc/publican/sources/Client.xml
index fcdd2f2f0ba..19bf3e9572a 100644
--- a/chromium/third_party/wayland/src/doc/publican/sources/Client.xml
+++ b/chromium/third_party/wayland/src/doc/publican/sources/Client.xml
@@ -30,7 +30,7 @@
object created.
</para>
<para>
- Though some conveinence functions are provided, libwayland-client
+ Though some convenience functions are provided, libwayland-client
is designed to allow the calling code to wait for events, so that
different polling mechanisms can be used. A file descriptor is
provided, when it becomes ready for reading the calling code can
diff --git a/chromium/third_party/wayland/src/protocol/wayland.xml b/chromium/third_party/wayland/src/protocol/wayland.xml
index 8311a18de1f..098f286bab7 100644
--- a/chromium/third_party/wayland/src/protocol/wayland.xml
+++ b/chromium/third_party/wayland/src/protocol/wayland.xml
@@ -129,7 +129,7 @@
<request name="bind">
<description summary="bind an object to the display">
Binds a new, client-created object to the server using the
- specified name as the identifier.
+ specified name as the identifier.
</description>
<arg name="name" type="uint" summary="unique numeric name of the object"/>
<arg name="id" type="new_id" summary="bounded object"/>
@@ -139,9 +139,9 @@
<description summary="announce global object">
Notify the client of global objects.
- The event notifies the client that a global object with
- the given name is now available, and it implements the
- given version of the given interface.
+ The event notifies the client that a global object with
+ the given name is now available, and it implements the
+ given version of the given interface.
</description>
<arg name="name" type="uint" summary="numeric name of the global object"/>
<arg name="interface" type="string" summary="interface implemented by the object"/>
@@ -152,10 +152,10 @@
<description summary="announce removal of global object">
Notify the client of removed global objects.
- This event notifies the client that the global identified
- by name is no longer available. If the client bound to
- the global using the bind request, the client should now
- destroy that object.
+ This event notifies the client that the global identified
+ by name is no longer available. If the client bound to
+ the global using the bind request, the client should now
+ destroy that object.
The object remains valid and requests to the object will be
ignored until the client destroys it, to avoid races between
@@ -355,7 +355,7 @@
The pool can be used to create shared memory based buffer
objects. The server will mmap size bytes of the passed file
- descriptor, to use as backing memory for the pool.
+ descriptor, to use as backing memory for the pool.
</description>
<arg name="id" type="new_id" interface="wl_shm_pool" summary="pool to create"/>
<arg name="fd" type="fd" summary="file descriptor for the pool"/>
@@ -915,14 +915,14 @@
<request name="create_data_source">
<description summary="create a new data source">
- Create a new data source.
+ Create a new data source.
</description>
<arg name="id" type="new_id" interface="wl_data_source" summary="data source to create"/>
</request>
<request name="get_data_device">
<description summary="create a new data device">
- Create a new data device for a given seat.
+ Create a new data device for a given seat.
</description>
<arg name="id" type="new_id" interface="wl_data_device" summary="data device to create"/>
<arg name="seat" type="object" interface="wl_seat" summary="seat associated with the data device"/>
@@ -1308,7 +1308,7 @@
<enum name="error">
<description summary="wl_surface error values">
- These errors can be emitted in response to wl_surface requests.
+ These errors can be emitted in response to wl_surface requests.
</description>
<entry name="invalid_scale" value="0" summary="buffer scale value is invalid"/>
<entry name="invalid_transform" value="1" summary="buffer transform value is invalid"/>
@@ -1661,8 +1661,8 @@
<enum name="capability" bitfield="true">
<description summary="seat capability bitmask">
- This is a bitmask of capabilities this seat has; if a member is
- set, then it is present on the seat.
+ This is a bitmask of capabilities this seat has; if a member is
+ set, then it is present on the seat.
</description>
<entry name="pointer" value="1" summary="the seat has pointer devices"/>
<entry name="keyboard" value="2" summary="the seat has one or more keyboards"/>
@@ -1857,7 +1857,7 @@
<enum name="button_state">
<description summary="physical button state">
- Describes the physical state of a button that produced the button
+ Describes the physical state of a button that produced the button
event.
</description>
<entry name="released" value="0" summary="the button is not pressed"/>
@@ -1870,8 +1870,16 @@
The location of the click is given by the last motion or
enter event.
- The time argument is a timestamp with millisecond
- granularity, with an undefined base.
+ The time argument is a timestamp with millisecond
+ granularity, with an undefined base.
+
+ The button is a button code as defined in the Linux kernel's
+ linux/input-event-codes.h header file, e.g. BTN_LEFT.
+
+ Any 16-bit button code value is reserved for future additions to the
+ kernel's event code list. All other button codes above 0xFFFF are
+ currently undefined but may be used in future versions of this
+ protocol.
</description>
<arg name="serial" type="uint" summary="serial number of the button event"/>
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
@@ -2083,7 +2091,7 @@
<entry name="no_keymap" value="0"
summary="no keymap; client must understand how to interpret the raw keycode"/>
<entry name="xkb_v1" value="1"
- summary="libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode"/>
+ summary="libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode"/>
</enum>
<event name="keymap">
@@ -2129,8 +2137,8 @@
<event name="key">
<description summary="key event">
A key was pressed or released.
- The time argument is a timestamp with millisecond
- granularity, with an undefined base.
+ The time argument is a timestamp with millisecond
+ granularity, with an undefined base.
</description>
<arg name="serial" type="uint" summary="serial number of the key event"/>
<arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
@@ -2160,23 +2168,23 @@
<event name="repeat_info" since="4">
<description summary="repeat rate and delay">
- Informs the client about the keyboard's repeat rate and delay.
+ Informs the client about the keyboard's repeat rate and delay.
- This event is sent as soon as the wl_keyboard object has been created,
- and is guaranteed to be received by the client before any key press
- event.
+ This event is sent as soon as the wl_keyboard object has been created,
+ and is guaranteed to be received by the client before any key press
+ event.
- Negative values for either rate or delay are illegal. A rate of zero
- will disable any repeating (regardless of the value of delay).
+ Negative values for either rate or delay are illegal. A rate of zero
+ will disable any repeating (regardless of the value of delay).
- This event can be sent later on as well with a new value if necessary,
- so clients should continue listening for the event past the creation
- of wl_keyboard.
+ This event can be sent later on as well with a new value if necessary,
+ so clients should continue listening for the event past the creation
+ of wl_keyboard.
</description>
<arg name="rate" type="int"
- summary="the rate of repeating keys in characters per second"/>
+ summary="the rate of repeating keys in characters per second"/>
<arg name="delay" type="int"
- summary="delay in milliseconds since key down until repeating starts"/>
+ summary="delay in milliseconds since key down until repeating starts"/>
</event>
</interface>
@@ -2417,10 +2425,10 @@
mode that was received with the current flag set.
The size of a mode is given in physical hardware units of
- the output device. This is not necessarily the same as
- the output size in the global compositor space. For instance,
- the output may be scaled, as described in wl_output.scale,
- or transformed, as described in wl_output.transform.
+ the output device. This is not necessarily the same as
+ the output size in the global compositor space. For instance,
+ the output may be scaled, as described in wl_output.scale,
+ or transformed, as described in wl_output.transform.
</description>
<arg name="flags" type="uint" enum="mode" summary="bitfield of mode flags"/>
<arg name="width" type="int" summary="width of the mode in hardware units"/>
@@ -2432,20 +2440,20 @@
<event name="done" since="2">
<description summary="sent all information about output">
- This event is sent after all other properties have been
- sent after binding to the output object and after any
- other property changes done after that. This allows
- changes to the output properties to be seen as
- atomic, even if they happen via multiple events.
+ This event is sent after all other properties have been
+ sent after binding to the output object and after any
+ other property changes done after that. This allows
+ changes to the output properties to be seen as
+ atomic, even if they happen via multiple events.
</description>
</event>
<event name="scale" since="2">
<description summary="output scaling properties">
This event contains scaling geometry information
- that is not in the geometry event. It may be sent after
- binding the output object or if the output scale changes
- later. If it is not sent, the client should assume a
+ that is not in the geometry event. It may be sent after
+ binding the output object or if the output scale changes
+ later. If it is not sent, the client should assume a
scale of 1.
A scale larger than 1 means that the compositor will
@@ -2542,7 +2550,7 @@
<enum name="error">
<entry name="bad_surface" value="0"
- summary="the to-be sub-surface is invalid"/>
+ summary="the to-be sub-surface is invalid"/>
</enum>
<request name="get_subsurface">
@@ -2556,11 +2564,11 @@
error is raised.
</description>
<arg name="id" type="new_id" interface="wl_subsurface"
- summary="the new sub-surface object ID"/>
+ summary="the new sub-surface object ID"/>
<arg name="surface" type="object" interface="wl_surface"
- summary="the surface to be turned into a sub-surface"/>
+ summary="the surface to be turned into a sub-surface"/>
<arg name="parent" type="object" interface="wl_surface"
- summary="the parent surface"/>
+ summary="the parent surface"/>
</request>
</interface>
@@ -2629,7 +2637,7 @@
<enum name="error">
<entry name="bad_surface" value="0"
- summary="wl_surface is not a sibling or the parent"/>
+ summary="wl_surface is not a sibling or the parent"/>
</enum>
<request name="set_position">
@@ -2674,7 +2682,7 @@
of its siblings and parent.
</description>
<arg name="sibling" type="object" interface="wl_surface"
- summary="the reference surface"/>
+ summary="the reference surface"/>
</request>
<request name="place_below">
@@ -2683,7 +2691,7 @@
See wl_subsurface.place_above.
</description>
<arg name="sibling" type="object" interface="wl_surface"
- summary="the reference surface"/>
+ summary="the reference surface"/>
</request>
<request name="set_sync">
diff --git a/chromium/third_party/wayland/src/src/wayland-client-uninstalled.pc.in b/chromium/third_party/wayland/src/src/wayland-client-uninstalled.pc.in
index 3086621da4e..732736e94a3 100644
--- a/chromium/third_party/wayland/src/src/wayland-client-uninstalled.pc.in
+++ b/chromium/third_party/wayland/src/src/wayland-client-uninstalled.pc.in
@@ -1,8 +1,9 @@
libdir=@abs_builddir@/.libs
includedir=@abs_srcdir@
+protocoldir=@abs_top_builddir@/protocol
Name: Wayland Client
Description: Wayland client side library (not installed)
Version: @PACKAGE_VERSION@
-Cflags: -I${includedir}
+Cflags: -I${includedir} -I${protocoldir}
Libs: -L${libdir} -lwayland-client
diff --git a/chromium/third_party/wayland/src/src/wayland-client.c b/chromium/third_party/wayland/src/src/wayland-client.c
index 03c087a66ae..3d7361ea943 100644
--- a/chromium/third_party/wayland/src/src/wayland-client.c
+++ b/chromium/third_party/wayland/src/src/wayland-client.c
@@ -1006,7 +1006,7 @@ wl_display_connect(const char *name)
if (connection) {
int prev_errno = errno;
errno = 0;
- fd = strtol(connection, &end, 0);
+ fd = strtol(connection, &end, 10);
if (errno != 0 || connection == end || *end != '\0')
return NULL;
errno = prev_errno;
diff --git a/chromium/third_party/wayland/src/src/wayland-scanner-uninstalled.pc.in b/chromium/third_party/wayland/src/src/wayland-scanner-uninstalled.pc.in
index 8dcfef31541..132f42d0616 100644
--- a/chromium/third_party/wayland/src/src/wayland-scanner-uninstalled.pc.in
+++ b/chromium/third_party/wayland/src/src/wayland-scanner-uninstalled.pc.in
@@ -1,5 +1,5 @@
pkgdatadir=@abs_top_srcdir@
-wayland_scanner=@abs_builddir@/wayland-scanner
+wayland_scanner=@abs_top_builddir@/wayland-scanner
Name: Wayland Scanner
Description: Wayland scanner (not installed)
diff --git a/chromium/third_party/wayland/src/src/wayland-server-uninstalled.pc.in b/chromium/third_party/wayland/src/src/wayland-server-uninstalled.pc.in
index 90577828cac..562686c31d1 100644
--- a/chromium/third_party/wayland/src/src/wayland-server-uninstalled.pc.in
+++ b/chromium/third_party/wayland/src/src/wayland-server-uninstalled.pc.in
@@ -1,8 +1,9 @@
libdir=@abs_builddir@/.libs
includedir=@abs_srcdir@
+protocoldir=@abs_top_builddir@/protocol
Name: Wayland Server
Description: Server side implementation of the Wayland protocol (not installed)
Version: @PACKAGE_VERSION@
-Cflags: -I${includedir}
+Cflags: -I${includedir} -I${protocoldir}
Libs: -L${libdir} -lwayland-server
diff --git a/chromium/third_party/wayland/src/src/wayland-util.h b/chromium/third_party/wayland/src/src/wayland-util.h
index 50f3372a942..caeac826738 100644
--- a/chromium/third_party/wayland/src/src/wayland-util.h
+++ b/chromium/third_party/wayland/src/src/wayland-util.h
@@ -142,12 +142,64 @@ struct wl_message {
const struct wl_interface **types;
};
+/**
+ * Protocol object interface
+ *
+ * A wl_interface describes the API of a protocol object defined in the Wayland
+ * protocol specification. The protocol implementation uses a wl_interface
+ * within its marshalling machinery for encoding client requests.
+ *
+ * The `name` of a wl_interface is the name of the corresponding protocol
+ * interface, and `version` represents the version of the interface. The members
+ * `method_count` and `event_count` represent the number of `methods` (requests)
+ * and `events` in the respective wl_message members.
+ *
+ * For example, consider a protocol interface `foo`, marked as version `1`, with
+ * two requests and one event.
+ *
+ * \code
+ * <interface name="foo" version="1">
+ * <request name="a"></request>
+ * <request name="b"></request>
+ * <event name="c"></event>
+ * </interface>
+ * \endcode
+ *
+ * Given two wl_message arrays `foo_requests` and `foo_events`, a wl_interface
+ * for `foo` might be:
+ *
+ * \code
+ * struct wl_interface foo_interface = {
+ * "foo", 1,
+ * 2, foo_requests,
+ * 1, foo_events
+ * };
+ * \endcode
+ *
+ * \note The server side of the protocol may define interface <em>implementation
+ * types</em> that incorporate the term `interface` in their name. Take
+ * care to not confuse these server-side `struct`s with a wl_interface
+ * variable whose name also ends in `interface`. For example, while the
+ * server may define a type `struct wl_foo_interface`, the client may
+ * define a `struct wl_interface wl_foo_interface`.
+ *
+ * \sa wl_message
+ * \sa wl_proxy
+ * \sa <a href="https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Interfaces">Interfaces</a>
+ * \sa <a href="https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Versioning">Versioning</a>
+ */
struct wl_interface {
+ /** Interface name */
const char *name;
+ /** Interface version */
int version;
+ /** Number of methods (requests) */
int method_count;
+ /** Method (request) signatures */
const struct wl_message *methods;
+ /** Number of events */
int event_count;
+ /** Event signatures */
const struct wl_message *events;
};
@@ -209,7 +261,9 @@ struct wl_interface {
* \sa http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/linux/list.h
*/
struct wl_list {
+ /** Previous list element */
struct wl_list *prev;
+ /** Next list element */
struct wl_list *next;
};
@@ -438,8 +492,11 @@ wl_list_insert_list(struct wl_list *list, struct wl_list *other);
*
*/
struct wl_array {
+ /** Array size */
size_t size;
+ /** Allocated space */
size_t alloc;
+ /** Array data */
void *data;
};
@@ -588,50 +645,86 @@ wl_fixed_from_int(int i)
}
/**
- * \brief A union representing all of the basic data types that can be passed
- * along the wayland wire format.
+ * Protocol message argument data types
*
- * This union represents all of the basic data types that can be passed in the
- * wayland wire format. It is used by dispatchers and runtime-friendly
- * versions of the event and request marshaling functions.
+ * This union represents all of the argument types in the Wayland protocol wire
+ * format. The protocol implementation uses wl_argument within its marshalling
+ * machinery for dispatching messages between a client and a compositor.
+ *
+ * \sa wl_message
+ * \sa wl_interface
+ * \sa <a href="https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-wire-Format">Wire Format</a>
*/
union wl_argument {
- int32_t i; /**< signed integer */
- uint32_t u; /**< unsigned integer */
- wl_fixed_t f; /**< fixed point */
- const char *s; /**< string */
- struct wl_object *o; /**< object */
- uint32_t n; /**< new_id */
- struct wl_array *a; /**< array */
- int32_t h; /**< file descriptor */
+ int32_t i; /**< `int` */
+ uint32_t u; /**< `uint` */
+ wl_fixed_t f; /**< `fixed` */
+ const char *s; /**< `string` */
+ struct wl_object *o; /**< `object` */
+ uint32_t n; /**< `new_id` */
+ struct wl_array *a; /**< `array` */
+ int32_t h; /**< `fd` */
};
/**
- * \brief A function pointer type for a dispatcher.
+ * Dispatcher function type alias
*
* A dispatcher is a function that handles the emitting of callbacks in client
- * code. For programs directly using the C library, this is done by using
- * libffi to call function pointers. When binding to languages other than C,
+ * code. For programs directly using the C library, this is done by using
+ * libffi to call function pointers. When binding to languages other than C,
* dispatchers provide a way to abstract the function calling process to be
* friendlier to other function calling systems.
*
- * A dispatcher takes five arguments: The first is the dispatcher-specific
- * implementation data associated with the target object. The second is the
- * object on which the callback is being invoked (either wl_proxy or
- * wl_resource). The third and fourth arguments are the opcode the wl_message
- * structure corresponding to the callback being emitted. The final argument
- * is an array of arguments received from the other process via the wire
- * protocol.
+ * A dispatcher takes five arguments: The first is the dispatcher-specific
+ * implementation associated with the target object. The second is the object
+ * upon which the callback is being invoked (either wl_proxy or wl_resource).
+ * The third and fourth arguments are the opcode and the wl_message
+ * corresponding to the callback. The final argument is an array of arguments
+ * received from the other process via the wire protocol.
+ *
+ * \param "const void *" Dispatcher-specific implementation data
+ * \param "void *" Callback invocation target (wl_proxy or `wl_resource`)
+ * \param uint32_t Callback opcode
+ * \param "const struct wl_message *" Callback message signature
+ * \param "union wl_argument *" Array of received arguments
+ *
+ * \return 0 on success, or -1 on failure
*/
typedef int (*wl_dispatcher_func_t)(const void *, void *, uint32_t,
const struct wl_message *,
union wl_argument *);
+/**
+ * Log function type alias
+ *
+ * The C implementation of the Wayland protocol abstracts the details of
+ * logging. Users may customize the logging behavior, with a function conforming
+ * to the `wl_log_func_t` type, via `wl_log_set_handler_client` and
+ * `wl_log_set_handler_server`.
+ *
+ * A `wl_log_func_t` must conform to the expectations of `vprintf`, and
+ * expects two arguments: a string to write and a corresponding variable
+ * argument list. While the string to write may contain format specifiers and
+ * use values in the variable argument list, the behavior of any `wl_log_func_t`
+ * depends on the implementation.
+ *
+ * \note Take care to not confuse this with `wl_protocol_logger_func_t`, which
+ * is a specific server-side logger for requests and events.
+ *
+ * \param "const char *" String to write to the log, containing optional format
+ * specifiers
+ * \param "va_list" Variable argument list
+ *
+ * \sa wl_log_set_handler_client
+ * \sa wl_log_set_handler_server
+ */
typedef void (*wl_log_func_t)(const char *, va_list) WL_PRINTF(1, 0);
-/** \enum wl_iterator_result
+/**
+ * Return value of an iterator function
*
- * This enum represents the return value of an iterator function.
+ * \sa wl_client_for_each_resource_iterator_func_t
+ * \sa wl_client_for_each_resource
*/
enum wl_iterator_result {
/** Stop the iteration */
diff --git a/chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp b/chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp
index 24adc7acb93..d6acc956895 100644
--- a/chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp
+++ b/chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp
@@ -46,8 +46,12 @@ void MiracBrokerSource::on_connection_failure(ConnectionFailure failure) {
switch (failure) {
case CONNECTION_LOST:
std::cout << "* RTSP connection lost" << std::endl;
+ break;
case CONNECTION_TIMEOUT:
std::cout << "* RTSP connection failed: timeout" << std::endl;
+ break;
+ default:
+ std::cout << "* RTSP connection failure" << std::endl;
}
}
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec/aec_core.cc b/chromium/third_party/webrtc/modules/audio_processing/aec/aec_core.cc
index f9e96ace046..48f7737ab51 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec/aec_core.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec/aec_core.cc
@@ -206,16 +206,21 @@ void BlockBuffer::ExtractExtendedBlock(float extended_block[PART_LEN2]) {
// Extract the previous block.
WebRtc_MoveReadPtr(buffer_, -1);
- WebRtc_ReadBuffer(buffer_, reinterpret_cast<void**>(&block_ptr),
- &extended_block[0], 1);
- if (block_ptr != &extended_block[0]) {
+ size_t read_elements = WebRtc_ReadBuffer(
+ buffer_, reinterpret_cast<void**>(&block_ptr), &extended_block[0], 1);
+ if (read_elements == 0u) {
+ std::fill_n(&extended_block[0], PART_LEN, 0.0f);
+ } else if (block_ptr != &extended_block[0]) {
memcpy(&extended_block[0], block_ptr, PART_LEN * sizeof(float));
}
// Extract the current block.
- WebRtc_ReadBuffer(buffer_, reinterpret_cast<void**>(&block_ptr),
- &extended_block[PART_LEN], 1);
- if (block_ptr != &extended_block[PART_LEN]) {
+ read_elements =
+ WebRtc_ReadBuffer(buffer_, reinterpret_cast<void**>(&block_ptr),
+ &extended_block[PART_LEN], 1);
+ if (read_elements == 0u) {
+ std::fill_n(&extended_block[PART_LEN], PART_LEN, 0.0f);
+ } else if (block_ptr != &extended_block[PART_LEN]) {
memcpy(&extended_block[PART_LEN], block_ptr, PART_LEN * sizeof(float));
}
}
diff --git a/chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_context.cc b/chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_context.cc
index dffefc404f6..18ca9909707 100644
--- a/chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_context.cc
+++ b/chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_context.cc
@@ -21,10 +21,11 @@ DxgiAdapterContext::~DxgiAdapterContext() = default;
DxgiFrameContext::DxgiFrameContext() = default;
DxgiFrameContext::~DxgiFrameContext() {
- DxgiDuplicatorController::Instance()->Unregister(this);
+ Reset();
}
void DxgiFrameContext::Reset() {
+ DxgiDuplicatorController::Instance()->Unregister(this);
controller_id = 0;
}
diff --git a/chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h b/chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h
index c9838ad7a1e..128521ce6a3 100644
--- a/chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h
+++ b/chromium/third_party/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h
@@ -103,9 +103,8 @@ class DxgiDuplicatorController {
int ScreenCount();
private:
- // DxgiFrameContext calls private Unregister(Context*) function during
- // destructing.
- friend DxgiFrameContext::~DxgiFrameContext();
+ // DxgiFrameContext calls private Unregister(Context*) function in Reset().
+ friend void DxgiFrameContext::Reset();
// A private constructor to ensure consumers to use
// DxgiDuplicatorController::Instance().
diff --git a/chromium/third_party/xdg-utils/codereview.settings b/chromium/third_party/xdg-utils/codereview.settings
new file mode 100644
index 00000000000..9b30fa34ca5
--- /dev/null
+++ b/chromium/third_party/xdg-utils/codereview.settings
@@ -0,0 +1,9 @@
+CODE_REVIEW_SERVER: codereview.chromium.org
+CC_LIST: chromium-reviews@chromium.org
+VIEW_VC: https://chromium.googlesource.com/chromium/deps/xdg-utils/+/
+STATUS: http://chromium-status.appspot.com/status
+TRY_ON_UPLOAD: False
+TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try
+GITCL_PREUPLOAD: http://src.chromium.org/viewvc/chrome/trunk/tools/depot_tools/git-cl-upload-hook?revision=HEAD
+GITCL_PREDCOMMIT: http://src.chromium.org/viewvc/chrome/trunk/tools/depot_tools/git-cl-upload-hook?revision=HEAD
+PROJECT: chromium_deps
diff --git a/chromium/ui/gl/gl_surface.cc b/chromium/ui/gl/gl_surface.cc
index f89a699c807..67671902974 100644
--- a/chromium/ui/gl/gl_surface.cc
+++ b/chromium/ui/gl/gl_surface.cc
@@ -194,6 +194,12 @@ void GLSurface::WaitForSnapshotRendering() {
// By default, just executing the SwapBuffers is normally enough.
}
+void GLSurface::SetRelyOnImplicitSync() {
+ // Some GLSurface derived classes might not implement this workaround while
+ // still being allocated on devices where the workaround is enabled.
+ // It is fine to ignore this call in those cases.
+}
+
GLSurface* GLSurface::GetCurrent() {
return current_surface_.Pointer()->Get();
}
@@ -397,6 +403,10 @@ void GLSurfaceAdapter::WaitForSnapshotRendering() {
surface_->WaitForSnapshotRendering();
}
+void GLSurfaceAdapter::SetRelyOnImplicitSync() {
+ surface_->SetRelyOnImplicitSync();
+}
+
GLSurfaceAdapter::~GLSurfaceAdapter() {}
scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat(
diff --git a/chromium/ui/gl/gl_surface.h b/chromium/ui/gl/gl_surface.h
index 2b24c76dbed..5261d7c3b0b 100644
--- a/chromium/ui/gl/gl_surface.h
+++ b/chromium/ui/gl/gl_surface.h
@@ -225,6 +225,9 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// calling this.
virtual void WaitForSnapshotRendering();
+ // Tells the surface to rely on implicit sync when swapping buffers.
+ virtual void SetRelyOnImplicitSync();
+
static GLSurface* GetCurrent();
protected:
@@ -298,6 +301,7 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
bool SetDrawRectangle(const gfx::Rect& rect) override;
gfx::Vector2d GetDrawOffset() const override;
void WaitForSnapshotRendering() override;
+ void SetRelyOnImplicitSync() override;
GLSurface* surface() const { return surface_.get(); }
diff --git a/chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc b/chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
index 7c3cba72064..df8e642715e 100644
--- a/chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
+++ b/chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
@@ -43,6 +43,8 @@ GbmSurfaceless::GbmSurfaceless(GbmSurfaceFactory* surface_factory,
}
void GbmSurfaceless::QueueOverlayPlane(const OverlayPlane& plane) {
+ if (plane.buffer->RequiresGlFinish())
+ is_on_external_drm_device_ = true;
planes_.push_back(plane);
}
@@ -115,6 +117,20 @@ void GbmSurfaceless::SwapBuffersAsync(const SwapCompletionCallback& callback) {
frame->callback = surface_swap_callback;
unsubmitted_frames_.push_back(base::MakeUnique<PendingFrame>());
+ // TODO(dcastagna): Remove the following workaround once we get explicit sync
+ // on Intel.
+ // We can not rely on implicit sync on external devices (crbug.com/692508).
+ // NOTE: When on external devices, |is_on_external_drm_device_| is set to true
+ // after the first plane is enqueued in QueueOverlayPlane, that is called from
+ // GbmSurfaceless::SubmitFrame.
+ // This means |is_on_external_drm_device_| could be incorrectly set to false
+ // the first time we're testing it.
+ if (rely_on_implicit_sync_ && !is_on_external_drm_device_) {
+ frame->ready = true;
+ SubmitFrame();
+ return;
+ }
+
// TODO: the following should be replaced by a per surface flush as it gets
// implemented in GL drivers.
EGLSyncKHR fence = InsertFence(has_implicit_external_sync_);
@@ -167,6 +183,10 @@ EGLConfig GbmSurfaceless::GetConfig() {
return config_;
}
+void GbmSurfaceless::SetRelyOnImplicitSync() {
+ rely_on_implicit_sync_ = true;
+}
+
GbmSurfaceless::~GbmSurfaceless() {
Destroy(); // The EGL surface must be destroyed before SurfaceOzone.
surface_factory_->UnregisterSurface(window_->widget());
diff --git a/chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.h b/chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.h
index 1ec916ca2d5..823e0ed0f60 100644
--- a/chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.h
+++ b/chromium/ui/ozone/platform/drm/gpu/gbm_surfaceless.h
@@ -54,6 +54,7 @@ class GbmSurfaceless : public gl::SurfacelessEGL {
int height,
const SwapCompletionCallback& callback) override;
EGLConfig GetConfig() override;
+ void SetRelyOnImplicitSync() override;
protected:
~GbmSurfaceless() override;
@@ -93,6 +94,8 @@ class GbmSurfaceless : public gl::SurfacelessEGL {
bool has_implicit_external_sync_;
bool last_swap_buffers_result_ = true;
bool swap_buffers_pending_ = false;
+ bool rely_on_implicit_sync_ = false;
+ bool is_on_external_drm_device_ = false;
base::WeakPtrFactory<GbmSurfaceless> weak_factory_;
diff --git a/chromium/ui/strings/translations/ui_strings_hi.xtb b/chromium/ui/strings/translations/ui_strings_hi.xtb
index 9165651a74c..9e9a1171cff 100644
--- a/chromium/ui/strings/translations/ui_strings_hi.xtb
+++ b/chromium/ui/strings/translations/ui_strings_hi.xtb
@@ -1,7 +1,7 @@
<?xml version="1.0" ?>
<!DOCTYPE translationbundle>
<translationbundle lang="hi">
-<translation id="111910763555783249">नोटिफिकेशन सेटिंग</translation>
+<translation id="111910763555783249">नोटिफ़िकेशन सेटिंग</translation>
<translation id="1127811143501539442">{DAYS,plural, =1{1 दिन पहले}one{# दिन पहले}other{# दिन पहले}}</translation>
<translation id="1156623771253174079">{SECONDS,plural, =1{1 मिनट पहले}one{# मिनट पहले}other{# मिनट पहले}}</translation>
<translation id="1190609913194133056">सूचना केंद्र</translation>
@@ -32,7 +32,7 @@
<translation id="252373100621549798">अज्ञात डिस्प्ले</translation>
<translation id="2583543531130364912">अपनी टचस्क्रीन कैलिब्रेट करें</translation>
<translation id="2666092431469916601">शीर्ष</translation>
-<translation id="2743387203779672305">क्लिपबोर्ड पर प्रतिलिपि बनाएं</translation>
+<translation id="2743387203779672305">क्लिपबोर्ड में कॉपी करें</translation>
<translation id="2803313416453193357">फ़ोल्डर खोलें</translation>
<translation id="2824719307700604149">{YEARS,plural, =1{1 वर्ष पहले}one{# वर्ष पहले}other{# वर्ष पहले}}</translation>
<translation id="2931838996092594335">क्लिक करें</translation>
@@ -103,11 +103,11 @@
<translation id="688711909580084195">शीर्षक-रहित वेबपेज</translation>
<translation id="6907759265145635167"><ph name="QUANTITY" /> PB/s</translation>
<translation id="6917971086528278418">{YEARS,plural, =1{1 वर्ष शेष}one{# वर्ष शेष}other{# वर्ष शेष}}</translation>
-<translation id="6918245111648057970">प्रत्येक उपयोगकर्ता के लिए निम्न में से नोटिफिकेशन की अनुमति दें:</translation>
+<translation id="6918245111648057970">प्रत्येक उपयोगकर्ता के लिए निम्न में से नोटिफ़िकेशन की अनुमति दें:</translation>
<translation id="6945221475159498467">चुनें</translation>
<translation id="6965382102122355670">ठीक</translation>
<translation id="7052633198403197513">F1</translation>
-<translation id="7135556860107312402">निम्न से आने वाली नोटिफिकेशन की अनुमति दें:</translation>
+<translation id="7135556860107312402">निम्न से आने वाली नोटिफ़िकेशन की अनुमति दें:</translation>
<translation id="7222373446505536781">F11</translation>
<translation id="7238427729722629793">{MINUTES,plural, =1{1 मिनट शेष}one{# मिनट शेष}other{# मिनट शेष}}</translation>
<translation id="7365057348334984696">{MINUTES,plural, =1{1 मिनट पहले}one{# मिनट पहले}other{# मिनट पहले}}</translation>
diff --git a/chromium/ui/strings/translations/ui_strings_ru.xtb b/chromium/ui/strings/translations/ui_strings_ru.xtb
index 16a3aed55dc..27e5c06eb03 100644
--- a/chromium/ui/strings/translations/ui_strings_ru.xtb
+++ b/chromium/ui/strings/translations/ui_strings_ru.xtb
@@ -126,7 +126,7 @@
<translation id="815598010540052116">Прокрутка вниз</translation>
<translation id="8179976553408161302">ВВОД</translation>
<translation id="8210608804940886430">Прокрутка вниз</translation>
-<translation id="8245914219290430011">Вкладка</translation>
+<translation id="8245914219290430011">Tab</translation>
<translation id="8328145009876646418">Левый край</translation>
<translation id="8331626408530291785">Прокрутка вверх</translation>
<translation id="8352146631962686268">{YEARS,plural, =1{1 год}one{# год}few{# года}many{# лет}other{# года}}</translation>
diff --git a/chromium/ui/strings/translations/ui_strings_uk.xtb b/chromium/ui/strings/translations/ui_strings_uk.xtb
index 622929a2301..9d91d323b57 100644
--- a/chromium/ui/strings/translations/ui_strings_uk.xtb
+++ b/chromium/ui/strings/translations/ui_strings_uk.xtb
@@ -15,7 +15,7 @@
<translation id="1761785978543082658"><ph name="QUANTITY" /> б</translation>
<translation id="1801827354178857021">Період</translation>
<translation id="1803208670097017349">{MONTHS,plural, =1{1 місяць}one{# місяць}few{# місяці}many{# місяців}other{# місяця}}</translation>
-<translation id="1809410197924942083"><ph name="QUANTITY" /> Мб/сек.</translation>
+<translation id="1809410197924942083"><ph name="QUANTITY" /> МБ/сек.</translation>
<translation id="1830179671306812954">{HOURS,plural, =1{1 година та }one{# година та }few{# години та }many{# годин і }other{# години та }}</translation>
<translation id="1842960171412779397">вибрати</translation>
<translation id="1860796786778352021">Закрити сповіщення</translation>
@@ -25,7 +25,7 @@
<translation id="2168039046890040389">Сторінка вгору</translation>
<translation id="2190355936436201913">(пусто)</translation>
<translation id="2289052229480071835">Торкніться елементів для дотику на екрані.</translation>
-<translation id="2297836609126180313"><ph name="QUANTITY" /> Тб/сек.</translation>
+<translation id="2297836609126180313"><ph name="QUANTITY" /> ТБ/сек.</translation>
<translation id="2482878487686419369">Сповіщення</translation>
<translation id="2497284189126895209">Усі файли</translation>
<translation id="2522350507219695259">Калібрування завершено</translation>
@@ -38,7 +38,7 @@
<translation id="2931838996092594335">натиснути</translation>
<translation id="2983818520079887040">Налаштування...</translation>
<translation id="3036649622769666520">Відкрити файли</translation>
-<translation id="3049748772180311791"><ph name="QUANTITY" /> Мб</translation>
+<translation id="3049748772180311791"><ph name="QUANTITY" /> МБ</translation>
<translation id="3087734570205094154">Низ</translation>
<translation id="3157931365184549694">Відновити</translation>
<translation id="3183922693828471536">Прокрутка до цього місця</translation>
@@ -47,8 +47,8 @@
<translation id="3600566671520689681">{DAYS,plural, =1{Залишився 1 день}one{Залишився # день}few{Залишилося # дні}many{Залишилося # днів}other{Залишилося # дня}}</translation>
<translation id="364720409959344976">Виберіть папку для завантаження</translation>
<translation id="3660179305079774227">Курсор угору</translation>
-<translation id="3740362395218339114"><ph name="QUANTITY" /> Гб/сек.</translation>
-<translation id="3757388668994797779"><ph name="QUANTITY" /> Гб</translation>
+<translation id="3740362395218339114"><ph name="QUANTITY" /> ГБ/сек.</translation>
+<translation id="3757388668994797779"><ph name="QUANTITY" /> ГБ</translation>
<translation id="385051799172605136">Назад</translation>
<translation id="3889424535448813030">Курсор праворуч</translation>
<translation id="3892641579809465218">Внутрішній екран</translation>
@@ -113,7 +113,7 @@
<translation id="7365057348334984696">{MINUTES,plural, =1{1 хв тому}one{# хв тому}few{# хв тому}many{# хв тому}other{# хв тому}}</translation>
<translation id="7410957453383678442">{MINUTES,plural, =1{Залишилась 1 хвилина}one{Залишилася # хвилина}few{Залишилося # хвилини}many{Залишилося # хвилин}other{Залишилося # хвилини}}</translation>
<translation id="7457942297256758195">Очистити все</translation>
-<translation id="7460907917090416791"><ph name="QUANTITY" /> Тб</translation>
+<translation id="7460907917090416791"><ph name="QUANTITY" /> ТБ</translation>
<translation id="7647488630410863958">Розблокуйте пристрій, щоб переглянути сповіщення</translation>
<translation id="7658239707568436148">Скасувати</translation>
<translation id="7781829728241885113">Учора</translation>
@@ -137,10 +137,10 @@
<translation id="8400147561352026160">Shift+<ph name="KEY_COMBO_NAME" /></translation>
<translation id="8428213095426709021">Налаштування</translation>
<translation id="8602707065186045623">файл <ph name="SAVEAS_EXTENSION_TYPE" /> (.<ph name="SAVEAS_EXTENSION_NAME" />)</translation>
-<translation id="8677655579646609597"><ph name="QUANTITY" /> Кб/сек.</translation>
+<translation id="8677655579646609597"><ph name="QUANTITY" /> КБ/сек.</translation>
<translation id="8806053966018712535">Папка <ph name="FOLDER_NAME" /></translation>
<translation id="883911313571074303">Додати нотатку до зображення</translation>
-<translation id="8901569739625249689"><ph name="QUANTITY" /> Кб</translation>
+<translation id="8901569739625249689"><ph name="QUANTITY" /> КБ</translation>
<translation id="9002566407876343676">відкрити</translation>
<translation id="9038489124413477075">Папка без назви</translation>
<translation id="9044832324875206639">{SECONDS,plural, =1{1 с}one{# с}few{# с}many{# с}other{# с}}</translation>
diff --git a/chromium/ui/views/controls/scrollbar/overlay_scroll_bar.cc b/chromium/ui/views/controls/scrollbar/overlay_scroll_bar.cc
index d46f89c21e7..10d1d04e1d8 100644
--- a/chromium/ui/views/controls/scrollbar/overlay_scroll_bar.cc
+++ b/chromium/ui/views/controls/scrollbar/overlay_scroll_bar.cc
@@ -38,6 +38,7 @@ OverlayScrollBar::Thumb::Thumb(OverlayScrollBar* scroll_bar)
OverlayScrollBar::Thumb::~Thumb() {}
void OverlayScrollBar::Thumb::Init() {
+ EnableCanvasFlippingForRTLUI(true);
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
// Animate all changes to the layer except the first one.
@@ -107,9 +108,10 @@ void OverlayScrollBar::Thumb::OnBoundsChanged(
void OverlayScrollBar::Thumb::OnStateChanged() {
if (GetState() == CustomButton::STATE_NORMAL) {
gfx::Transform translation;
+ const int direction = base::i18n::IsRTL() ? -1 : 1;
translation.Translate(
- gfx::Vector2d(IsHorizontal() ? 0 : kThumbHoverOffset,
- IsHorizontal() ? kThumbHoverOffset: 0));
+ gfx::Vector2d(IsHorizontal() ? 0 : direction * kThumbHoverOffset,
+ IsHorizontal() ? kThumbHoverOffset : 0));
layer()->SetTransform(translation);
layer()->SetOpacity(ui::kOverlayScrollbarThumbNormalAlpha);
diff --git a/chromium/v8/include/v8-version.h b/chromium/v8/include/v8-version.h
index 06af9cb5138..1c5d5b8231c 100644
--- a/chromium/v8/include/v8-version.h
+++ b/chromium/v8/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 0
#define V8_BUILD_NUMBER 286
-#define V8_PATCH_LEVEL 37
+#define V8_PATCH_LEVEL 44
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
diff --git a/chromium/v8/src/ast/scopes.cc b/chromium/v8/src/ast/scopes.cc
index 78ff1a9d144..f4c21d75132 100644
--- a/chromium/v8/src/ast/scopes.cc
+++ b/chromium/v8/src/ast/scopes.cc
@@ -1494,6 +1494,7 @@ void DeclarationScope::ResetAfterPreparsing(AstValueFactory* ast_value_factory,
inner_scope_ = nullptr;
unresolved_ = nullptr;
sloppy_block_function_map_ = nullptr;
+ rare_data_ = nullptr;
if (aborted) {
// Prepare scope for use in the outer zone.
diff --git a/chromium/v8/src/bootstrapper.cc b/chromium/v8/src/bootstrapper.cc
index 9d8dae20d4b..b1fda971cfc 100644
--- a/chromium/v8/src/bootstrapper.cc
+++ b/chromium/v8/src/bootstrapper.cc
@@ -5022,29 +5022,6 @@ void Genesis::MakeFunctionInstancePrototypeWritable() {
}
-class NoTrackDoubleFieldsForSerializerScope {
- public:
- explicit NoTrackDoubleFieldsForSerializerScope(Isolate* isolate)
- : flag_(FLAG_track_double_fields), enabled_(false) {
- if (isolate->serializer_enabled()) {
- // Disable tracking double fields because heap numbers treated as
- // immutable by the serializer.
- FLAG_track_double_fields = false;
- enabled_ = true;
- }
- }
-
- ~NoTrackDoubleFieldsForSerializerScope() {
- if (enabled_) {
- FLAG_track_double_fields = flag_;
- }
- }
-
- private:
- bool flag_;
- bool enabled_;
-};
-
Genesis::Genesis(
Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
v8::Local<v8::ObjectTemplate> global_proxy_template,
@@ -5052,7 +5029,6 @@ Genesis::Genesis(
v8::DeserializeEmbedderFieldsCallback embedder_fields_deserializer,
GlobalContextType context_type)
: isolate_(isolate), active_(isolate->bootstrapper()) {
- NoTrackDoubleFieldsForSerializerScope disable_scope(isolate);
result_ = Handle<Context>::null();
global_proxy_ = Handle<JSGlobalProxy>::null();
@@ -5192,7 +5168,6 @@ Genesis::Genesis(Isolate* isolate,
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
v8::Local<v8::ObjectTemplate> global_proxy_template)
: isolate_(isolate), active_(isolate->bootstrapper()) {
- NoTrackDoubleFieldsForSerializerScope disable_scope(isolate);
result_ = Handle<Context>::null();
global_proxy_ = Handle<JSGlobalProxy>::null();
diff --git a/chromium/v8/src/compiler/access-builder.cc b/chromium/v8/src/compiler/access-builder.cc
index c7b85255b29..5fbbdd09daf 100644
--- a/chromium/v8/src/compiler/access-builder.cc
+++ b/chromium/v8/src/compiler/access-builder.cc
@@ -855,7 +855,7 @@ ElementAccess AccessBuilder::ForFixedArrayElement(ElementsKind kind) {
access.machine_type = MachineType::Float64();
break;
case FAST_HOLEY_DOUBLE_ELEMENTS:
- access.type = Type::Number();
+ access.type = Type::NumberOrHole();
access.write_barrier_kind = kNoWriteBarrier;
access.machine_type = MachineType::Float64();
break;
diff --git a/chromium/v8/src/compiler/wasm-compiler.cc b/chromium/v8/src/compiler/wasm-compiler.cc
index d95ec917e98..56c8f6cbefd 100644
--- a/chromium/v8/src/compiler/wasm-compiler.cc
+++ b/chromium/v8/src/compiler/wasm-compiler.cc
@@ -2250,7 +2250,7 @@ Node* WasmGraphBuilder::CallIndirect(uint32_t sig_index, Node** args,
Int32Constant(kPointerSizeLog2)),
Int32Constant(fixed_offset)),
*effect_, *control_);
- auto map = const_cast<wasm::SignatureMap&>(
+ auto& map = const_cast<wasm::SignatureMap&>(
module_->module->function_tables[0].map);
Node* sig_match = graph()->NewNode(
machine->WordEqual(), load_sig,
diff --git a/chromium/v8/src/v8.gyp b/chromium/v8/src/v8.gyp
index 192ff883d5d..34fccc19dcf 100644
--- a/chromium/v8/src/v8.gyp
+++ b/chromium/v8/src/v8.gyp
@@ -272,6 +272,11 @@
'builtins/s390/builtins-s390.cc',
],
}],
+ ['v8_target_arch=="x87"', {
+ 'sources': [ ### gcmole(arch:x87) ###
+ 'builtins/x87/builtins-x87.cc',
+ ],
+ }],
['v8_enable_i18n_support==0', {
'sources!': [
'builtins/builtins-intl-gen.cc',
@@ -1529,7 +1534,6 @@
'arm/simulator-arm.cc',
'arm/simulator-arm.h',
'arm/eh-frame-arm.cc',
- 'builtins/arm/builtins-arm.cc',
'compiler/arm/code-generator-arm.cc',
'compiler/arm/instruction-codes-arm.h',
'compiler/arm/instruction-scheduler-arm.cc',
@@ -1584,7 +1588,6 @@
'arm64/utils-arm64.cc',
'arm64/utils-arm64.h',
'arm64/eh-frame-arm64.cc',
- 'builtins/arm64/builtins-arm64.cc',
'compiler/arm64/code-generator-arm64.cc',
'compiler/arm64/instruction-codes-arm64.h',
'compiler/arm64/instruction-scheduler-arm64.cc',
@@ -1629,7 +1632,6 @@
'ia32/simulator-ia32.cc',
'ia32/simulator-ia32.h',
'ia32/sse-instr.h',
- 'builtins/ia32/builtins-ia32.cc',
'compiler/ia32/code-generator-ia32.cc',
'compiler/ia32/instruction-codes-ia32.h',
'compiler/ia32/instruction-scheduler-ia32.cc',
@@ -1668,7 +1670,6 @@
'x87/macro-assembler-x87.h',
'x87/simulator-x87.cc',
'x87/simulator-x87.h',
- 'builtins/x87/builtins-x87.cc',
'compiler/x87/code-generator-x87.cc',
'compiler/x87/instruction-codes-x87.h',
'compiler/x87/instruction-scheduler-x87.cc',
@@ -1709,7 +1710,6 @@
'mips/macro-assembler-mips.h',
'mips/simulator-mips.cc',
'mips/simulator-mips.h',
- 'builtins/mips/builtins-mips.cc',
'compiler/mips/code-generator-mips.cc',
'compiler/mips/instruction-codes-mips.h',
'compiler/mips/instruction-scheduler-mips.cc',
@@ -1750,7 +1750,6 @@
'mips64/macro-assembler-mips64.h',
'mips64/simulator-mips64.cc',
'mips64/simulator-mips64.h',
- 'builtins/mips64/builtins-mips64.cc',
'compiler/mips64/code-generator-mips64.cc',
'compiler/mips64/instruction-codes-mips64.h',
'compiler/mips64/instruction-scheduler-mips64.cc',
@@ -1772,7 +1771,6 @@
}],
['v8_target_arch=="x64"', {
'sources': [ ### gcmole(arch:x64) ###
- 'builtins/x64/builtins-x64.cc',
'compiler/x64/code-generator-x64.cc',
'compiler/x64/instruction-codes-x64.h',
'compiler/x64/instruction-scheduler-x64.cc',
@@ -1819,7 +1817,6 @@
}],
['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
'sources': [ ### gcmole(arch:ppc) ###
- 'builtins/ppc/builtins-ppc.cc',
'compiler/ppc/code-generator-ppc.cc',
'compiler/ppc/instruction-codes-ppc.h',
'compiler/ppc/instruction-scheduler-ppc.cc',
@@ -1860,7 +1857,6 @@
}],
['v8_target_arch=="s390" or v8_target_arch=="s390x"', {
'sources': [ ### gcmole(arch:s390) ###
- 'builtins/s390/builtins-s390.cc',
'compiler/s390/code-generator-s390.cc',
'compiler/s390/instruction-codes-s390.h',
'compiler/s390/instruction-scheduler-s390.cc',
@@ -1940,7 +1936,6 @@
}, { # v8_enable_i18n_support==0
'sources!': [
'builtins/builtins-intl.cc',
- 'builtins/builtins-intl-gen.cc',
'intl.cc',
'intl.h',
'objects/intl-objects.cc',
diff --git a/chromium/v8/src/wasm/wasm-module.cc b/chromium/v8/src/wasm/wasm-module.cc
index 057181b1975..4b346e6bc7c 100644
--- a/chromium/v8/src/wasm/wasm-module.cc
+++ b/chromium/v8/src/wasm/wasm-module.cc
@@ -1124,7 +1124,7 @@ void UpdateDispatchTablesInternal(Isolate* isolate,
// a dangling pointer in the signature map.
Handle<WasmInstanceObject> instance(
WasmInstanceObject::cast(dispatch_tables->get(i)), isolate);
- auto func_table = instance->module()->function_tables[table_index];
+ auto& func_table = instance->module()->function_tables[table_index];
uint32_t sig_index = func_table.map.FindOrInsert(function->sig);
signature_table->set(index, Smi::FromInt(static_cast<int>(sig_index)));
function_table->set(index, *code);