diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-06-22 08:50:06 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-06-22 08:50:06 +0000 |
commit | 2a4a6fecf0b8c92223f8fdf19545b564b7d3fcde (patch) | |
tree | 09f247bb053efcc97691d90d131c424a76ba1db3 /lib/VMCore/ConstantsContext.h | |
parent | 4383c282af954e4f65ae3b77c891fa41a4960a2a (diff) | |
download | llvm-2a4a6fecf0b8c92223f8fdf19545b564b7d3fcde.tar.gz llvm-2a4a6fecf0b8c92223f8fdf19545b564b7d3fcde.tar.bz2 llvm-2a4a6fecf0b8c92223f8fdf19545b564b7d3fcde.tar.xz |
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 'lib/VMCore/ConstantsContext.h')
-rw-r--r-- | lib/VMCore/ConstantsContext.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/VMCore/ConstantsContext.h b/lib/VMCore/ConstantsContext.h index 1395754578..ea6ebe9eaa 100644 --- a/lib/VMCore/ConstantsContext.h +++ b/lib/VMCore/ConstantsContext.h @@ -568,7 +568,7 @@ struct ConstantKeyData<InlineAsm> { } }; -template<class ValType, class TypeClass, class ConstantClass, +template<class ValType, class ValRefType, class TypeClass, class ConstantClass, bool HasLargeKey = false /*true for arrays and structs*/ > class ConstantUniqueMap : public AbstractTypeUser { public: @@ -656,7 +656,7 @@ private: } } - ConstantClass* Create(const TypeClass *Ty, const ValType &V, + ConstantClass* Create(const TypeClass *Ty, ValRefType V, typename MapTy::iterator I) { ConstantClass* Result = ConstantCreator<ConstantClass,TypeClass,ValType>::create(Ty, V); @@ -675,7 +675,7 @@ public: /// getOrCreate - Return the specified constant from the map, creating it if /// necessary. - ConstantClass *getOrCreate(const TypeClass *Ty, const ValType &V) { + ConstantClass *getOrCreate(const TypeClass *Ty, ValRefType V) { MapKey Lookup(Ty, V); ConstantClass* Result = 0; |