[llvm] r266218 - [IR/DebugInfoMetadata] Simplify array length calculation by using array_lengthof instead of ArrayRef::size
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 13 10:42:57 PDT 2016
Author: dblaikie
Date: Wed Apr 13 12:42:56 2016
New Revision: 266218
URL: http://llvm.org/viewvc/llvm-project?rev=266218&view=rev
Log:
[IR/DebugInfoMetadata] Simplify array length calculation by using array_lengthof instead of ArrayRef::size
Modified:
llvm/trunk/lib/IR/DebugInfoMetadata.cpp
Modified: llvm/trunk/lib/IR/DebugInfoMetadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfoMetadata.cpp?rev=266218&r1=266217&r2=266218&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfoMetadata.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfoMetadata.cpp Wed Apr 13 12:42:56 2016
@@ -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);
More information about the llvm-commits
mailing list