diff options
author | David Blaikie <dblaikie@gmail.com> | 2016-04-13 17:42:56 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2016-04-13 17:42:56 +0000 |
commit | 6662d6ad2add5329a462bf70381646e5e7ec39bf (patch) | |
tree | 00ffb4b27e40bc88cd6a29a446897fb8147e5425 | |
parent | 2477491a924bf5de84e829dfdfb38dffb59b33ba (diff) | |
download | bcm5719-llvm-6662d6ad2add5329a462bf70381646e5e7ec39bf.tar.gz bcm5719-llvm-6662d6ad2add5329a462bf70381646e5e7ec39bf.zip |
[IR/DebugInfoMetadata] Simplify array length calculation by using array_lengthof instead of ArrayRef::size
llvm-svn: 266218
-rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index ec0b8bb86ac..cd9ea692c95 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -194,15 +194,14 @@ void GenericDINode::recalculateHash() { } \ } while (false) #define DEFINE_GETIMPL_STORE(CLASS, ARGS, OPS) \ - return storeImpl(new (ArrayRef<Metadata *>(OPS).size()) \ + return storeImpl(new (array_lengthof(OPS)) \ CLASS(Context, Storage, UNWRAP_ARGS(ARGS), OPS), \ Storage, Context.pImpl->CLASS##s) #define DEFINE_GETIMPL_STORE_NO_OPS(CLASS, ARGS) \ return storeImpl(new (0u) CLASS(Context, Storage, UNWRAP_ARGS(ARGS)), \ Storage, Context.pImpl->CLASS##s) #define DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS(CLASS, OPS) \ - return storeImpl(new (ArrayRef<Metadata *>(OPS).size()) \ - CLASS(Context, Storage, OPS), \ + return storeImpl(new (array_lengthof(OPS)) CLASS(Context, Storage, OPS), \ Storage, Context.pImpl->CLASS##s) DISubrange *DISubrange::getImpl(LLVMContext &Context, int64_t Count, int64_t Lo, @@ -301,7 +300,7 @@ DICompileUnit *DICompileUnit::getImpl( Metadata *Ops[] = {File, Producer, Flags, SplitDebugFilename, EnumTypes, RetainedTypes, Subprograms, GlobalVariables, ImportedEntities, Macros}; - return storeImpl(new (ArrayRef<Metadata *>(Ops).size()) DICompileUnit( + return storeImpl(new (array_lengthof(Ops)) DICompileUnit( Context, Storage, SourceLanguage, IsOptimized, RuntimeVersion, EmissionKind, DWOId, Ops), Storage); |