aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/ADT/ArrayRef.h
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-06-22 08:50:06 +0000
committerJay Foad <jay.foad@gmail.com>2011-06-22 08:50:06 +0000
commit2a4a6fecf0b8c92223f8fdf19545b564b7d3fcde (patch)
tree09f247bb053efcc97691d90d131c424a76ba1db3 /include/llvm/ADT/ArrayRef.h
parent4383c282af954e4f65ae3b77c891fa41a4960a2a (diff)
Extend ConstantUniqueMap with a new template parameter ValRefType,
representing a constant reference to ValType. Normally this is just "const ValType &", but when ValType is a std::vector we want to use ArrayRef as the reference type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ArrayRef.h')
-rw-r--r--include/llvm/ADT/ArrayRef.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/ADT/ArrayRef.h b/include/llvm/ADT/ArrayRef.h
index 97e42cb266..a7e268b099 100644
--- a/include/llvm/ADT/ArrayRef.h
+++ b/include/llvm/ADT/ArrayRef.h
@@ -125,6 +125,13 @@ namespace llvm {
}
/// @}
+ /// @name Conversion operators
+ /// @{
+ operator std::vector<T>() const {
+ return std::vector<T>(Data, Data+Length);
+ }
+
+ /// @}
};
// ArrayRefs can be treated like a POD type.