[PATCH] D67588: Add builtin trait for add/remove cv (and similar)

Zoe Carver via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 14 10:43:57 PDT 2019


zoecarver created this revision.
zoecarver added reviewers: EricWF, eli.friedman, rsmith, craig.topper, mclow.lists.
zoecarver added projects: clang, libc++.
zoecarver updated this revision to Diff 220226.
zoecarver added a comment.

- diff from D67052 <https://reviews.llvm.org/D67052>, not master


This patch adds six builtins: `__remove_cv`, `__remove_cosnt`, `__remove_volatile`, `__add_cv`, `__add_const`, and `__add_volatile`. I have added two stress tests to show the performace improvements. The `__remove_cv`  test sees a 160% build time imporvement while the `__add_cv` test sees an 8% improvement.

This patch is based on D67052 <https://reviews.llvm.org/D67052>.

I will submit a patch for implementing these in libc++ after this lands.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67588

Files:
  clang/include/clang/AST/Type.h
  clang/include/clang/Basic/Specifiers.h
  clang/include/clang/Basic/TokenKinds.def
  clang/include/clang/Parse/Parser.h
  clang/include/clang/Sema/DeclSpec.h
  clang/lib/Format/FormatToken.cpp
  clang/lib/Lex/PPMacroExpansion.cpp
  clang/lib/Parse/ParseDecl.cpp
  clang/lib/Parse/ParseDeclCXX.cpp
  clang/lib/Sema/DeclSpec.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaTemplateVariadic.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/SemaCXX/add_cv.cpp
  clang/test/SemaCXX/add_reference.cpp
  libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_add_cv.sh.cpp
  libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_add_lvalue_reference.sh.cpp
  libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_add_rvalue_reference.sh.cpp
  libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_remove_cv.sh.cpp
  libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_remove_reference.sh.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67588.220226.patch
Type: text/x-patch
Size: 33811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190914/90f51c78/attachment-0001.bin>


More information about the cfe-commits mailing list