[PATCH] D25241: [libcxx] Improve code generation for vector::clear().

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 10:56:40 PDT 2016


mclow.lists added a comment.

I had no idea that we had no tests for `vector::clear`. Oosps.

This looks good to me, but I want to play with the codegen for a bit before approving it.
Also, you should add `cfe-commits` to the subscribers.

thanks for doing this!



> clear.pass.cpp:25
> +    c.clear();
> +    assert(c.empty());
> +    }

How about a couple more assertions here:

  LIBCPP_ASSERT(c.__invariants());`
  LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));

> clear.pass.cpp:32
> +    c.clear();
> +    assert(c.empty());
> +    }

Same here.

Repository:
  rL LLVM

https://reviews.llvm.org/D25241





More information about the cfe-commits mailing list