[PATCH] D65249: [NFC] use C++11 in AlignOf.h

JF Bastien via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 16:04:12 PDT 2019


jfb created this revision.
jfb added a reviewer: chandlerc.
Herald added subscribers: llvm-commits, lldb-commits, cfe-commits, dexonsmith, jkorous, hiraditya, javed.absar.
Herald added projects: clang, LLDB, LLVM.
jfb added a comment.

This is the main event: https://reviews.llvm.org/D65249#change-IWk6CtRl45h6
The rest is side-show.


Two things in this patch:

- Use std::aligned_storage instead of AlignedCharArray. Note: template parameters are swapped.
- Use variadic templates in the implementation of AlignedCharArrayUnion.

The other files are changed accordingly:

- Use std::aligned_storage.
- The buffer is no longer implicitly a character array, requiring casting in some cases.

This should be fine since our current minimum MSVC version is now Visual Studio
2017 version 15.0.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65249

Files:
  clang/include/clang/AST/APValue.h
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/ASTTypeTraits.h
  clang/include/clang/AST/Expr.h
  clang/include/clang/Sema/Overload.h
  clang/lib/AST/APValue.cpp
  clang/lib/CodeGen/CGCleanup.cpp
  clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
  clang/lib/Frontend/PrecompiledPreamble.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/TypeLocBuilder.cpp
  clang/lib/Sema/TypeLocBuilder.h
  lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
  lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
  llvm/include/llvm/ADT/DenseMap.h
  llvm/include/llvm/ADT/IntervalMap.h
  llvm/include/llvm/CodeGen/DIE.h
  llvm/include/llvm/Support/AlignOf.h
  llvm/include/llvm/Support/Endian.h
  llvm/include/llvm/Support/Error.h
  llvm/include/llvm/Support/ErrorOr.h
  llvm/include/llvm/Support/JSON.h
  llvm/include/llvm/Support/TrailingObjects.h
  llvm/lib/Support/JSON.cpp
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/unittests/Support/AlignOfTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65249.211626.patch
Type: text/x-patch
Size: 47526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190724/f697edef/attachment-0001.bin>


More information about the cfe-commits mailing list