diff options
author | bzcheeseman <aman.lachapelle@gmail.com> | 2022-05-13 18:41:22 -0400 |
---|---|---|
committer | bzcheeseman <aman.lachapelle@gmail.com> | 2022-05-13 18:48:50 -0400 |
commit | c7587080188e1f46ddf8b8274e99d4481361d5dc (patch) | |
tree | e10996c8110aa6151397bd113509934f9c8f3257 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | bc65fc8bb31452107583d683a3da4b171440715c (diff) | |
download | llvm-c7587080188e1f46ddf8b8274e99d4481361d5dc.zip llvm-c7587080188e1f46ddf8b8274e99d4481361d5dc.tar.gz llvm-c7587080188e1f46ddf8b8274e99d4481361d5dc.tar.bz2 |
[LLVM][Casting.h] Add ForwardToPointerCast trait
Addresses use cases in Clang/MLIR that need pointer-to-pointer, reference-to-reference, and value-to-value casts from/to the same types. This should reduce boilerplate by allowing the user to simply specify the pointer cast and forward the reference cast directly to the pointer cast.
This cast trait DOES NOT implement `castFailed` and `doCastIfPossible` because in the general case doing so could result in a nullptr dereference. Users can use `NullableValueCastFailed` and `DefaultDoCastIfPossible` as desired for those cases where `nullptr` is acceptable.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D125576
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions