- Group Reviewers
- rG2d77b272a8f9: [Demangle] Add prepend functionality to OutputString
Looks alright - guess some other boundary testing could be done (testing without anything in the buffer, testing when prepend causes the buffer to grow V when it's already big enough) but it's probably fine as-is.
Could probably skip this. Falls out naturally from the implementation.
Could use memmove for this?
I added more tests to cover the requested situations. I also forgot to add a free after a malloc on the testsuite. I also changed the manual for loop to memmove to benefit from optimized implementations.
I'm having trouble applying this patch locally - I get:
$ arc patch D111948 Created and checked out branch arcpatch-D111948. Created and checked out branch arcpatch-D111947. Checking patch llvm/unittests/Demangle/OutputStreamTest.cpp => llvm/unittests/Demangle/OutputBufferTest.cpp... Checking patch llvm/unittests/Demangle/ItaniumDemangleTest.cpp... Checking patch llvm/unittests/Demangle/CMakeLists.txt... Checking patch llvm/lib/Demangle/RustDemangle.cpp... Checking patch llvm/lib/Demangle/MicrosoftDemangleNodes.cpp... Checking patch llvm/lib/Demangle/MicrosoftDemangle.cpp... Checking patch llvm/lib/Demangle/ItaniumDemangle.cpp... Checking patch llvm/include/llvm/Demangle/Utility.h... Checking patch llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h... Checking patch llvm/include/llvm/Demangle/ItaniumDemangle.h... Checking patch libcxxabi/src/demangle/Utility.h... Checking patch libcxxabi/src/demangle/ItaniumDemangle.h... Applied patch llvm/unittests/Demangle/OutputStreamTest.cpp => llvm/unittests/Demangle/OutputBufferTest.cpp cleanly. Applied patch llvm/unittests/Demangle/ItaniumDemangleTest.cpp cleanly. Applied patch llvm/unittests/Demangle/CMakeLists.txt cleanly. Applied patch llvm/lib/Demangle/RustDemangle.cpp cleanly. Applied patch llvm/lib/Demangle/MicrosoftDemangleNodes.cpp cleanly. Applied patch llvm/lib/Demangle/MicrosoftDemangle.cpp cleanly. Applied patch llvm/lib/Demangle/ItaniumDemangle.cpp cleanly. Applied patch llvm/include/llvm/Demangle/Utility.h cleanly. Applied patch llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h cleanly. Applied patch llvm/include/llvm/Demangle/ItaniumDemangle.h cleanly. Applied patch libcxxabi/src/demangle/Utility.h cleanly. Applied patch libcxxabi/src/demangle/ItaniumDemangle.h cleanly. Cherry Pick Failed! Exception Command failed with error #1! COMMAND git cherry-pick 'arcpatch-D111947' STDOUT On branch arcpatch-D111948 You are currently cherry-picking commit f03e9f1cbed8. (all conflicts fixed: run "git cherry-pick --continue") (use "git cherry-pick --skip" to skip this patch) (use "git cherry-pick --abort" to cancel the cherry-pick operation) nothing to commit, working tree clean STDERR The previous cherry-pick is now empty, possibly due to conflict resolution. If you wish to commit it anyway, use: git commit --allow-empty Otherwise, please use 'git cherry-pick --skip' (Run with `--trace` for a full exception trace.)
Perhaps it needs to be rebased or something?