[llvm][STLExtras] Add various type_trait utilities currently present in MLIR
authorRiver Riddle <riddleriver@gmail.com>
Tue, 14 Apr 2020 21:52:52 +0000 (14:52 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 14 Apr 2020 22:14:40 +0000 (15:14 -0700)
commit8cbe371c28a30ca5b0775b095a754702e57aa7ea
tree2b6ce571d9c8aa7b56c04a2271eb7c710aef50b6
parentf52ec5d5c088305298fa2a19e4c5b7380bcd98e8
[llvm][STLExtras] Add various type_trait utilities currently present in MLIR

This revision moves several type_trait utilities from MLIR into LLVM. Namely, this revision adds:
is_detected - This matches the experimental std::is_detected
is_invocable - This matches the c++17 std::is_invocable
function_traits - A utility traits class for getting the argument and result types of a callable type

Differential Revision: https://reviews.llvm.org/D78059
llvm/include/llvm/ADT/STLExtras.h
llvm/unittests/ADT/CMakeLists.txt
llvm/unittests/ADT/TypeTraitsTest.cpp [new file with mode: 0644]
mlir/include/mlir/ADT/TypeSwitch.h
mlir/include/mlir/IR/Matchers.h
mlir/include/mlir/IR/OpDefinition.h
mlir/include/mlir/Pass/AnalysisManager.h
mlir/include/mlir/Support/STLExtras.h
mlir/include/mlir/Support/StorageUniquer.h
mlir/include/mlir/Transforms/DialectConversion.h
mlir/lib/IR/SymbolTable.cpp