forked from OSchip/llvm-project
Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17"
This reverts commit ef82063207
.
- It conflicts with the existing llvm::size in STLExtras, which will now
never be called.
- Calling it without llvm:: breaks C++17 compat
This commit is contained in:
parent
297bbf1062
commit
f15014ff54
|
@ -5772,11 +5772,11 @@ private:
|
||||||
/*SupportsMapper=*/true, &MapperQualifierLoc,
|
/*SupportsMapper=*/true, &MapperQualifierLoc,
|
||||||
&MapperIdInfo),
|
&MapperIdInfo),
|
||||||
MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {
|
MapType(MapType), MapTypeIsImplicit(MapTypeIsImplicit), MapLoc(MapLoc) {
|
||||||
assert(llvm::size(MapTypeModifiers) == MapModifiers.size() &&
|
assert(llvm::array_lengthof(MapTypeModifiers) == MapModifiers.size() &&
|
||||||
"Unexpected number of map type modifiers.");
|
"Unexpected number of map type modifiers.");
|
||||||
llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
|
llvm::copy(MapModifiers, std::begin(MapTypeModifiers));
|
||||||
|
|
||||||
assert(llvm::size(MapTypeModifiersLoc) ==
|
assert(llvm::array_lengthof(MapTypeModifiersLoc) ==
|
||||||
MapModifiersLoc.size() &&
|
MapModifiersLoc.size() &&
|
||||||
"Unexpected number of map type modifier locations.");
|
"Unexpected number of map type modifier locations.");
|
||||||
llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
|
llvm::copy(MapModifiersLoc, std::begin(MapTypeModifiersLoc));
|
||||||
|
@ -6694,11 +6694,11 @@ class OMPToClause final : public OMPMappableExprListClause<OMPToClause>,
|
||||||
: OMPMappableExprListClause(llvm::omp::OMPC_to, Locs, Sizes,
|
: OMPMappableExprListClause(llvm::omp::OMPC_to, Locs, Sizes,
|
||||||
/*SupportsMapper=*/true, &MapperQualifierLoc,
|
/*SupportsMapper=*/true, &MapperQualifierLoc,
|
||||||
&MapperIdInfo) {
|
&MapperIdInfo) {
|
||||||
assert(llvm::size(MotionModifiers) == TheMotionModifiers.size() &&
|
assert(llvm::array_lengthof(MotionModifiers) == TheMotionModifiers.size() &&
|
||||||
"Unexpected number of motion modifiers.");
|
"Unexpected number of motion modifiers.");
|
||||||
llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
|
llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
|
||||||
|
|
||||||
assert(llvm::size(MotionModifiersLoc) ==
|
assert(llvm::array_lengthof(MotionModifiersLoc) ==
|
||||||
TheMotionModifiersLoc.size() &&
|
TheMotionModifiersLoc.size() &&
|
||||||
"Unexpected number of motion modifier locations.");
|
"Unexpected number of motion modifier locations.");
|
||||||
llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
|
llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
|
||||||
|
@ -6896,11 +6896,11 @@ class OMPFromClause final
|
||||||
: OMPMappableExprListClause(llvm::omp::OMPC_from, Locs, Sizes,
|
: OMPMappableExprListClause(llvm::omp::OMPC_from, Locs, Sizes,
|
||||||
/*SupportsMapper=*/true, &MapperQualifierLoc,
|
/*SupportsMapper=*/true, &MapperQualifierLoc,
|
||||||
&MapperIdInfo) {
|
&MapperIdInfo) {
|
||||||
assert(llvm::size(MotionModifiers) == TheMotionModifiers.size() &&
|
assert(llvm::array_lengthof(MotionModifiers) == TheMotionModifiers.size() &&
|
||||||
"Unexpected number of motion modifiers.");
|
"Unexpected number of motion modifiers.");
|
||||||
llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
|
llvm::copy(TheMotionModifiers, std::begin(MotionModifiers));
|
||||||
|
|
||||||
assert(llvm::size(MotionModifiersLoc) ==
|
assert(llvm::array_lengthof(MotionModifiersLoc) ==
|
||||||
TheMotionModifiersLoc.size() &&
|
TheMotionModifiersLoc.size() &&
|
||||||
"Unexpected number of motion modifier locations.");
|
"Unexpected number of motion modifier locations.");
|
||||||
llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
|
llvm::copy(TheMotionModifiersLoc, std::begin(MotionModifiersLoc));
|
||||||
|
|
|
@ -6594,7 +6594,7 @@ QualType ASTContext::getPromotedIntegerType(QualType Promotable) const {
|
||||||
uint64_t FromSize = getTypeSize(BT);
|
uint64_t FromSize = getTypeSize(BT);
|
||||||
QualType PromoteTypes[] = { IntTy, UnsignedIntTy, LongTy, UnsignedLongTy,
|
QualType PromoteTypes[] = { IntTy, UnsignedIntTy, LongTy, UnsignedLongTy,
|
||||||
LongLongTy, UnsignedLongLongTy };
|
LongLongTy, UnsignedLongLongTy };
|
||||||
for (size_t Idx = 0; Idx < llvm::size(PromoteTypes); ++Idx) {
|
for (size_t Idx = 0; Idx < llvm::array_lengthof(PromoteTypes); ++Idx) {
|
||||||
uint64_t ToSize = getTypeSize(PromoteTypes[Idx]);
|
uint64_t ToSize = getTypeSize(PromoteTypes[Idx]);
|
||||||
if (FromSize < ToSize ||
|
if (FromSize < ToSize ||
|
||||||
(FromSize == ToSize &&
|
(FromSize == ToSize &&
|
||||||
|
|
|
@ -21,7 +21,7 @@ static const llvm::StringRef AttrDoc[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
llvm::StringRef clang::Attr::getDocumentation(clang::attr::Kind K) {
|
llvm::StringRef clang::Attr::getDocumentation(clang::attr::Kind K) {
|
||||||
if(K < llvm::size(AttrDoc))
|
if(K < llvm::array_lengthof(AttrDoc))
|
||||||
return AttrDoc[K];
|
return AttrDoc[K];
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace comments {
|
||||||
|
|
||||||
CommandTraits::CommandTraits(llvm::BumpPtrAllocator &Allocator,
|
CommandTraits::CommandTraits(llvm::BumpPtrAllocator &Allocator,
|
||||||
const CommentOptions &CommentOptions) :
|
const CommentOptions &CommentOptions) :
|
||||||
NextID(llvm::size(Commands)), Allocator(Allocator) {
|
NextID(llvm::array_lengthof(Commands)), Allocator(Allocator) {
|
||||||
registerCommentOptions(CommentOptions);
|
registerCommentOptions(CommentOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ const CommandInfo *CommandTraits::registerBlockCommand(StringRef CommandName) {
|
||||||
|
|
||||||
const CommandInfo *CommandTraits::getBuiltinCommandInfo(
|
const CommandInfo *CommandTraits::getBuiltinCommandInfo(
|
||||||
unsigned CommandID) {
|
unsigned CommandID) {
|
||||||
if (CommandID < llvm::size(Commands))
|
if (CommandID < llvm::array_lengthof(Commands))
|
||||||
return &Commands[CommandID];
|
return &Commands[CommandID];
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ const CommandInfo *CommandTraits::getRegisteredCommandInfo(
|
||||||
|
|
||||||
const CommandInfo *CommandTraits::getRegisteredCommandInfo(
|
const CommandInfo *CommandTraits::getRegisteredCommandInfo(
|
||||||
unsigned CommandID) const {
|
unsigned CommandID) const {
|
||||||
return RegisteredCommands[CommandID - llvm::size(Commands)];
|
return RegisteredCommands[CommandID - llvm::array_lengthof(Commands)];
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end namespace comments
|
} // end namespace comments
|
||||||
|
|
|
@ -202,7 +202,7 @@ const StaticDiagInfoRec StaticDiagInfo[] = {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
static const unsigned StaticDiagInfoSize = llvm::size(StaticDiagInfo);
|
static const unsigned StaticDiagInfoSize = llvm::array_lengthof(StaticDiagInfo);
|
||||||
|
|
||||||
/// GetDiagInfo - Return the StaticDiagInfoRec entry for the specified DiagID,
|
/// GetDiagInfo - Return the StaticDiagInfoRec entry for the specified DiagID,
|
||||||
/// or null if the ID is invalid.
|
/// or null if the ID is invalid.
|
||||||
|
@ -317,7 +317,7 @@ static const StaticDiagCategoryRec CategoryNameTable[] = {
|
||||||
|
|
||||||
/// getNumberOfCategories - Return the number of categories
|
/// getNumberOfCategories - Return the number of categories
|
||||||
unsigned DiagnosticIDs::getNumberOfCategories() {
|
unsigned DiagnosticIDs::getNumberOfCategories() {
|
||||||
return llvm::size(CategoryNameTable) - 1;
|
return llvm::array_lengthof(CategoryNameTable) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getCategoryNameFromID - Given a category ID, return the name of the
|
/// getCategoryNameFromID - Given a category ID, return the name of the
|
||||||
|
|
|
@ -159,7 +159,7 @@ public:
|
||||||
/// DWARF.
|
/// DWARF.
|
||||||
Optional<unsigned>
|
Optional<unsigned>
|
||||||
getDWARFAddressSpace(unsigned AddressSpace) const override {
|
getDWARFAddressSpace(unsigned AddressSpace) const override {
|
||||||
if (AddressSpace >= llvm::size(NVPTXDWARFAddrSpaceMap) ||
|
if (AddressSpace >= llvm::array_lengthof(NVPTXDWARFAddrSpaceMap) ||
|
||||||
NVPTXDWARFAddrSpaceMap[AddressSpace] < 0)
|
NVPTXDWARFAddrSpaceMap[AddressSpace] < 0)
|
||||||
return llvm::None;
|
return llvm::None;
|
||||||
return NVPTXDWARFAddrSpaceMap[AddressSpace];
|
return NVPTXDWARFAddrSpaceMap[AddressSpace];
|
||||||
|
|
|
@ -3206,7 +3206,7 @@ void CodeGenFunction::EmitCheck(
|
||||||
assert(IsSanitizerScope);
|
assert(IsSanitizerScope);
|
||||||
assert(Checked.size() > 0);
|
assert(Checked.size() > 0);
|
||||||
assert(CheckHandler >= 0 &&
|
assert(CheckHandler >= 0 &&
|
||||||
size_t(CheckHandler) < llvm::size(SanitizerHandlers));
|
size_t(CheckHandler) < llvm::array_lengthof(SanitizerHandlers));
|
||||||
const StringRef CheckName = SanitizerHandlers[CheckHandler].Name;
|
const StringRef CheckName = SanitizerHandlers[CheckHandler].Name;
|
||||||
|
|
||||||
llvm::Value *FatalCond = nullptr;
|
llvm::Value *FatalCond = nullptr;
|
||||||
|
|
|
@ -1749,7 +1749,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
|
||||||
&CGM.getContext().Idents.get("count")
|
&CGM.getContext().Idents.get("count")
|
||||||
};
|
};
|
||||||
Selector FastEnumSel =
|
Selector FastEnumSel =
|
||||||
CGM.getContext().Selectors.getSelector(llvm::size(II), &II[0]);
|
CGM.getContext().Selectors.getSelector(llvm::array_lengthof(II), &II[0]);
|
||||||
|
|
||||||
QualType ItemsTy =
|
QualType ItemsTy =
|
||||||
getContext().getConstantArrayType(getContext().getObjCIdType(),
|
getContext().getConstantArrayType(getContext().getObjCIdType(),
|
||||||
|
|
|
@ -278,7 +278,7 @@ void Compilation::initCompilationForDiagnostics() {
|
||||||
options::OPT_o, options::OPT_MD, options::OPT_MMD, options::OPT_M,
|
options::OPT_o, options::OPT_MD, options::OPT_MMD, options::OPT_M,
|
||||||
options::OPT_MM, options::OPT_MF, options::OPT_MG, options::OPT_MJ,
|
options::OPT_MM, options::OPT_MF, options::OPT_MG, options::OPT_MJ,
|
||||||
options::OPT_MQ, options::OPT_MT, options::OPT_MV};
|
options::OPT_MQ, options::OPT_MT, options::OPT_MV};
|
||||||
for (unsigned i = 0, e = llvm::size(OutputOpts); i != e; ++i) {
|
for (unsigned i = 0, e = llvm::array_lengthof(OutputOpts); i != e; ++i) {
|
||||||
if (TranslatedArgs->hasArg(OutputOpts[i]))
|
if (TranslatedArgs->hasArg(OutputOpts[i]))
|
||||||
TranslatedArgs->eraseArg(OutputOpts[i]);
|
TranslatedArgs->eraseArg(OutputOpts[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,7 @@ static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) {
|
||||||
{"flang", "--driver-mode=flang"},
|
{"flang", "--driver-mode=flang"},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0; i < llvm::size(DriverSuffixes); ++i) {
|
for (size_t i = 0; i < llvm::array_lengthof(DriverSuffixes); ++i) {
|
||||||
StringRef Suffix(DriverSuffixes[i].Suffix);
|
StringRef Suffix(DriverSuffixes[i].Suffix);
|
||||||
if (ProgName.endswith(Suffix)) {
|
if (ProgName.endswith(Suffix)) {
|
||||||
Pos = ProgName.size() - Suffix.size();
|
Pos = ProgName.size() - Suffix.size();
|
||||||
|
|
|
@ -1694,7 +1694,7 @@ getDeploymentTargetFromEnvironmentVariables(const Driver &TheDriver,
|
||||||
"TVOS_DEPLOYMENT_TARGET",
|
"TVOS_DEPLOYMENT_TARGET",
|
||||||
"WATCHOS_DEPLOYMENT_TARGET",
|
"WATCHOS_DEPLOYMENT_TARGET",
|
||||||
};
|
};
|
||||||
static_assert(llvm::size(EnvVars) == Darwin::LastDarwinPlatform + 1,
|
static_assert(llvm::array_lengthof(EnvVars) == Darwin::LastDarwinPlatform + 1,
|
||||||
"Missing platform");
|
"Missing platform");
|
||||||
for (const auto &I : llvm::enumerate(llvm::makeArrayRef(EnvVars))) {
|
for (const auto &I : llvm::enumerate(llvm::makeArrayRef(EnvVars))) {
|
||||||
if (char *Env = ::getenv(I.value()))
|
if (char *Env = ::getenv(I.value()))
|
||||||
|
@ -1715,11 +1715,11 @@ getDeploymentTargetFromEnvironmentVariables(const Driver &TheDriver,
|
||||||
Targets[Darwin::TvOS] = "";
|
Targets[Darwin::TvOS] = "";
|
||||||
} else {
|
} else {
|
||||||
// Don't allow conflicts in any other platform.
|
// Don't allow conflicts in any other platform.
|
||||||
unsigned FirstTarget = llvm::size(Targets);
|
unsigned FirstTarget = llvm::array_lengthof(Targets);
|
||||||
for (unsigned I = 0; I != llvm::size(Targets); ++I) {
|
for (unsigned I = 0; I != llvm::array_lengthof(Targets); ++I) {
|
||||||
if (Targets[I].empty())
|
if (Targets[I].empty())
|
||||||
continue;
|
continue;
|
||||||
if (FirstTarget == llvm::size(Targets))
|
if (FirstTarget == llvm::array_lengthof(Targets))
|
||||||
FirstTarget = I;
|
FirstTarget = I;
|
||||||
else
|
else
|
||||||
TheDriver.Diag(diag::err_drv_conflicting_deployment_targets)
|
TheDriver.Diag(diag::err_drv_conflicting_deployment_targets)
|
||||||
|
|
|
@ -42,7 +42,7 @@ static constexpr TypeInfo TypeInfos[] = {
|
||||||
#include "clang/Driver/Types.def"
|
#include "clang/Driver/Types.def"
|
||||||
#undef TYPE
|
#undef TYPE
|
||||||
};
|
};
|
||||||
static const unsigned numTypes = llvm::size(TypeInfos);
|
static const unsigned numTypes = llvm::array_lengthof(TypeInfos);
|
||||||
|
|
||||||
static const TypeInfo &getInfo(unsigned id) {
|
static const TypeInfo &getInfo(unsigned id) {
|
||||||
assert(id > 0 && id - 1 < numTypes && "Invalid Type ID.");
|
assert(id > 0 && id - 1 < numTypes && "Invalid Type ID.");
|
||||||
|
|
|
@ -863,7 +863,7 @@ static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok,
|
||||||
} else if (Tok.isLiteral() && !Tok.needsCleaning() &&
|
} else if (Tok.isLiteral() && !Tok.needsCleaning() &&
|
||||||
Tok.getLiteralData()) {
|
Tok.getLiteralData()) {
|
||||||
OS.write(Tok.getLiteralData(), Tok.getLength());
|
OS.write(Tok.getLiteralData(), Tok.getLength());
|
||||||
} else if (Tok.getLength() < llvm::size(Buffer)) {
|
} else if (Tok.getLength() < llvm::array_lengthof(Buffer)) {
|
||||||
const char *TokPtr = Buffer;
|
const char *TokPtr = Buffer;
|
||||||
unsigned Len = PP.getSpelling(Tok, TokPtr);
|
unsigned Len = PP.getSpelling(Tok, TokPtr);
|
||||||
OS.write(TokPtr, Len);
|
OS.write(TokPtr, Len);
|
||||||
|
|
|
@ -1365,7 +1365,7 @@ void Parser::ParseExternalSourceSymbolAttribute(
|
||||||
ArgsUnion Args[] = {Language.get(), DefinedInExpr.get(),
|
ArgsUnion Args[] = {Language.get(), DefinedInExpr.get(),
|
||||||
GeneratedDeclaration};
|
GeneratedDeclaration};
|
||||||
Attrs.addNew(&ExternalSourceSymbol, SourceRange(Loc, T.getCloseLocation()),
|
Attrs.addNew(&ExternalSourceSymbol, SourceRange(Loc, T.getCloseLocation()),
|
||||||
ScopeName, ScopeLoc, Args, llvm::size(Args), Syntax);
|
ScopeName, ScopeLoc, Args, llvm::array_lengthof(Args), Syntax);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse the contents of the "objc_bridge_related" attribute.
|
/// Parse the contents of the "objc_bridge_related" attribute.
|
||||||
|
@ -1493,7 +1493,7 @@ void Parser::ParseSwiftNewTypeAttribute(
|
||||||
|
|
||||||
ArgsUnion Args[] = {SwiftType};
|
ArgsUnion Args[] = {SwiftType};
|
||||||
Attrs.addNew(&AttrName, SourceRange(AttrNameLoc, T.getCloseLocation()),
|
Attrs.addNew(&AttrName, SourceRange(AttrNameLoc, T.getCloseLocation()),
|
||||||
ScopeName, ScopeLoc, Args, llvm::size(Args), Syntax);
|
ScopeName, ScopeLoc, Args, llvm::array_lengthof(Args), Syntax);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ static OpenMPDirectiveKindExWrapper parseOpenMPDirectiveKind(Parser &P) {
|
||||||
if (DKind == OMPD_unknown)
|
if (DKind == OMPD_unknown)
|
||||||
return OMPD_unknown;
|
return OMPD_unknown;
|
||||||
|
|
||||||
for (unsigned I = 0; I < llvm::size(F); ++I) {
|
for (unsigned I = 0; I < llvm::array_lengthof(F); ++I) {
|
||||||
if (DKind != F[I][0])
|
if (DKind != F[I][0])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto,
|
||||||
// is already used (consider a function returning a function pointer) or too
|
// is already used (consider a function returning a function pointer) or too
|
||||||
// small (function with too many parameters), go to the heap.
|
// small (function with too many parameters), go to the heap.
|
||||||
if (!TheDeclarator.InlineStorageUsed &&
|
if (!TheDeclarator.InlineStorageUsed &&
|
||||||
NumParams <= llvm::size(TheDeclarator.InlineParams)) {
|
NumParams <= llvm::array_lengthof(TheDeclarator.InlineParams)) {
|
||||||
I.Fun.Params = TheDeclarator.InlineParams;
|
I.Fun.Params = TheDeclarator.InlineParams;
|
||||||
new (I.Fun.Params) ParamInfo[NumParams];
|
new (I.Fun.Params) ParamInfo[NumParams];
|
||||||
I.Fun.DeleteParams = false;
|
I.Fun.DeleteParams = false;
|
||||||
|
@ -308,7 +308,7 @@ void Declarator::setDecompositionBindings(
|
||||||
// Allocate storage for bindings and stash them away.
|
// Allocate storage for bindings and stash them away.
|
||||||
if (Bindings.size()) {
|
if (Bindings.size()) {
|
||||||
if (!InlineStorageUsed &&
|
if (!InlineStorageUsed &&
|
||||||
Bindings.size() <= llvm::size(InlineBindings)) {
|
Bindings.size() <= llvm::array_lengthof(InlineBindings)) {
|
||||||
BindingGroup.Bindings = InlineBindings;
|
BindingGroup.Bindings = InlineBindings;
|
||||||
BindingGroup.DeleteBindings = false;
|
BindingGroup.DeleteBindings = false;
|
||||||
InlineStorageUsed = true;
|
InlineStorageUsed = true;
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace {
|
||||||
|
|
||||||
const ParsedAttrInfo &ParsedAttrInfo::get(const AttributeCommonInfo &A) {
|
const ParsedAttrInfo &ParsedAttrInfo::get(const AttributeCommonInfo &A) {
|
||||||
// If we have a ParsedAttrInfo for this ParsedAttr then return that.
|
// If we have a ParsedAttrInfo for this ParsedAttr then return that.
|
||||||
if ((size_t)A.getParsedKind() < llvm::size(AttrInfoMap))
|
if ((size_t)A.getParsedKind() < llvm::array_lengthof(AttrInfoMap))
|
||||||
return *AttrInfoMap[A.getParsedKind()];
|
return *AttrInfoMap[A.getParsedKind()];
|
||||||
|
|
||||||
// If this is an ignored attribute then return an appropriate ParsedAttrInfo.
|
// If this is an ignored attribute then return an appropriate ParsedAttrInfo.
|
||||||
|
|
|
@ -4726,7 +4726,7 @@ static void AddKeywordsToConsumer(Sema &SemaRef,
|
||||||
"extern", "inline", "static", "typedef"
|
"extern", "inline", "static", "typedef"
|
||||||
};
|
};
|
||||||
|
|
||||||
const unsigned NumCTypeSpecs = llvm::size(CTypeSpecs);
|
const unsigned NumCTypeSpecs = llvm::array_lengthof(CTypeSpecs);
|
||||||
for (unsigned I = 0; I != NumCTypeSpecs; ++I)
|
for (unsigned I = 0; I != NumCTypeSpecs; ++I)
|
||||||
Consumer.addKeywordResult(CTypeSpecs[I]);
|
Consumer.addKeywordResult(CTypeSpecs[I]);
|
||||||
|
|
||||||
|
@ -4780,7 +4780,7 @@ static void AddKeywordsToConsumer(Sema &SemaRef,
|
||||||
static const char *const CXXExprs[] = {
|
static const char *const CXXExprs[] = {
|
||||||
"delete", "new", "operator", "throw", "typeid"
|
"delete", "new", "operator", "throw", "typeid"
|
||||||
};
|
};
|
||||||
const unsigned NumCXXExprs = llvm::size(CXXExprs);
|
const unsigned NumCXXExprs = llvm::array_lengthof(CXXExprs);
|
||||||
for (unsigned I = 0; I != NumCXXExprs; ++I)
|
for (unsigned I = 0; I != NumCXXExprs; ++I)
|
||||||
Consumer.addKeywordResult(CXXExprs[I]);
|
Consumer.addKeywordResult(CXXExprs[I]);
|
||||||
|
|
||||||
|
@ -4806,7 +4806,7 @@ static void AddKeywordsToConsumer(Sema &SemaRef,
|
||||||
// Statements.
|
// Statements.
|
||||||
static const char *const CStmts[] = {
|
static const char *const CStmts[] = {
|
||||||
"do", "else", "for", "goto", "if", "return", "switch", "while" };
|
"do", "else", "for", "goto", "if", "return", "switch", "while" };
|
||||||
const unsigned NumCStmts = llvm::size(CStmts);
|
const unsigned NumCStmts = llvm::array_lengthof(CStmts);
|
||||||
for (unsigned I = 0; I != NumCStmts; ++I)
|
for (unsigned I = 0; I != NumCStmts; ++I)
|
||||||
Consumer.addKeywordResult(CStmts[I]);
|
Consumer.addKeywordResult(CStmts[I]);
|
||||||
|
|
||||||
|
|
|
@ -14357,7 +14357,7 @@ TreeTransform<Derived>::RebuildArrayType(QualType ElementType,
|
||||||
SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
|
SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
|
||||||
SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
|
SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
|
||||||
};
|
};
|
||||||
const unsigned NumTypes = llvm::size(Types);
|
const unsigned NumTypes = llvm::array_lengthof(Types);
|
||||||
QualType SizeType;
|
QualType SizeType;
|
||||||
for (unsigned I = 0; I != NumTypes; ++I)
|
for (unsigned I = 0; I != NumTypes; ++I)
|
||||||
if (Size->getBitWidth() == SemaRef.Context.getIntWidth(Types[I])) {
|
if (Size->getBitWidth() == SemaRef.Context.getIntWidth(Types[I])) {
|
||||||
|
|
|
@ -34,13 +34,13 @@ int main(){
|
||||||
|
|
||||||
// <rdar://problem/11949235>
|
// <rdar://problem/11949235>
|
||||||
template<class T, unsigned N>
|
template<class T, unsigned N>
|
||||||
inline unsigned size(T (&)[N]) {
|
inline unsigned array_lengthof(T (&)[N]) {
|
||||||
return N;
|
return N;
|
||||||
}
|
}
|
||||||
|
|
||||||
void testNonTypeTemplateInstantiation() {
|
void testNonTypeTemplateInstantiation() {
|
||||||
const char *S[] = { "a", "b" };
|
const char *S[] = { "a", "b" };
|
||||||
clang_analyzer_eval(size(S) == 2);
|
clang_analyzer_eval(array_lengthof(S) == 2);
|
||||||
#ifndef NO_INLINE
|
#ifndef NO_INLINE
|
||||||
// expected-warning@-2 {{TRUE}}
|
// expected-warning@-2 {{TRUE}}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace PR7985 {
|
||||||
template<int N> struct integral_c { };
|
template<int N> struct integral_c { };
|
||||||
|
|
||||||
template <typename T, int N>
|
template <typename T, int N>
|
||||||
integral_c<N> size(T (&x)[N]) { return integral_c<N>(); } // expected-note 2{{candidate template ignored: could not match 'T[N]' against 'const Data<}}
|
integral_c<N> array_lengthof(T (&x)[N]) { return integral_c<N>(); } // expected-note 2{{candidate template ignored: could not match 'T[N]' against 'const Data<}}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct Data {
|
struct Data {
|
||||||
|
@ -105,14 +105,14 @@ namespace PR7985 {
|
||||||
const Data<float*> Description<float*>::data[];
|
const Data<float*> Description<float*>::data[];
|
||||||
|
|
||||||
void test() {
|
void test() {
|
||||||
integral_c<1> ic1 = size(Description<int>::data);
|
integral_c<1> ic1 = array_lengthof(Description<int>::data);
|
||||||
(void)sizeof(size(Description<float>::data));
|
(void)sizeof(array_lengthof(Description<float>::data));
|
||||||
|
|
||||||
(void)sizeof(size( // expected-error{{no matching function for call to 'size'}}
|
(void)sizeof(array_lengthof( // expected-error{{no matching function for call to 'array_lengthof'}}
|
||||||
Description<int*>::data // expected-note{{in instantiation of static data member 'PR7985::Description<int *>::data' requested here}}
|
Description<int*>::data // expected-note{{in instantiation of static data member 'PR7985::Description<int *>::data' requested here}}
|
||||||
));
|
));
|
||||||
|
|
||||||
size(Description<float*>::data); // expected-error{{no matching function for call to 'size'}}
|
array_lengthof(Description<float*>::data); // expected-error{{no matching function for call to 'array_lengthof'}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ TEST_F(CommentLexerTest, Basic2) {
|
||||||
const char *Sources[] = {
|
const char *Sources[] = {
|
||||||
"//", "///", "//!", "///<", "//!<"
|
"//", "///", "//!", "///<", "//!<"
|
||||||
};
|
};
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -107,7 +107,7 @@ TEST_F(CommentLexerTest, Basic3) {
|
||||||
const char *Sources[] = {
|
const char *Sources[] = {
|
||||||
"/**/", "/***/", "/*!*/", "/**<*/", "/*!<*/"
|
"/**/", "/***/", "/*!*/", "/**<*/", "/*!<*/"
|
||||||
};
|
};
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -126,7 +126,7 @@ TEST_F(CommentLexerTest, Basic4) {
|
||||||
"// Meow\n", "// Meow\r\n", "//! Meow\r",
|
"// Meow\n", "// Meow\r\n", "//! Meow\r",
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -146,7 +146,7 @@ TEST_F(CommentLexerTest, Basic5) {
|
||||||
"/* Meow*/", "/** Meow*/", "/*! Meow*/"
|
"/* Meow*/", "/** Meow*/", "/*! Meow*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -169,7 +169,7 @@ TEST_F(CommentLexerTest, Basic6) {
|
||||||
"// Aaa\\\r" " Bbb\\ \r" " Ccc?" "?/\r"
|
"// Aaa\\\r" " Bbb\\ \r" " Ccc?" "?/\r"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -248,7 +248,7 @@ TEST_F(CommentLexerTest, Basic7) {
|
||||||
// A command marker followed by comment end.
|
// A command marker followed by comment end.
|
||||||
TEST_F(CommentLexerTest, DoxygenCommand1) {
|
TEST_F(CommentLexerTest, DoxygenCommand1) {
|
||||||
const char *Sources[] = { "//@", "///@", "//!@" };
|
const char *Sources[] = { "//@", "///@", "//!@" };
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -265,7 +265,7 @@ TEST_F(CommentLexerTest, DoxygenCommand1) {
|
||||||
// A command marker followed by comment end.
|
// A command marker followed by comment end.
|
||||||
TEST_F(CommentLexerTest, DoxygenCommand2) {
|
TEST_F(CommentLexerTest, DoxygenCommand2) {
|
||||||
const char *Sources[] = { "/*@*/", "/**@*/", "/*!@*/"};
|
const char *Sources[] = { "/*@*/", "/**@*/", "/*!@*/"};
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -283,7 +283,7 @@ TEST_F(CommentLexerTest, DoxygenCommand2) {
|
||||||
// A command marker followed by comment end.
|
// A command marker followed by comment end.
|
||||||
TEST_F(CommentLexerTest, DoxygenCommand3) {
|
TEST_F(CommentLexerTest, DoxygenCommand3) {
|
||||||
const char *Sources[] = { "/*\\*/", "/**\\*/" };
|
const char *Sources[] = { "/*\\*/", "/**\\*/" };
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -311,12 +311,12 @@ TEST_F(CommentLexerTest, DoxygenCommand4) {
|
||||||
"::", ""
|
"::", ""
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
|
||||||
ASSERT_EQ(size(Text), Toks.size());
|
ASSERT_EQ(array_lengthof(Text), Toks.size());
|
||||||
|
|
||||||
for (size_t j = 0, e = Toks.size(); j != e; j++) {
|
for (size_t j = 0, e = Toks.size(); j != e; j++) {
|
||||||
if(Toks[j].is(tok::text)) {
|
if(Toks[j].is(tok::text)) {
|
||||||
|
@ -578,7 +578,7 @@ TEST_F(CommentLexerTest, VerbatimBlock1) {
|
||||||
"/** \\verbatim\\endverbatim*/"
|
"/** \\verbatim\\endverbatim*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -645,7 +645,7 @@ TEST_F(CommentLexerTest, VerbatimBlock4) {
|
||||||
"/** Meow \\verbatim aaa \\endverbatim*/"
|
"/** Meow \\verbatim aaa \\endverbatim*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -676,7 +676,7 @@ TEST_F(CommentLexerTest, VerbatimBlock5) {
|
||||||
"/** Meow \\verbatim aaa */"
|
"/** Meow \\verbatim aaa */"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -901,7 +901,7 @@ TEST_F(CommentLexerTest, VerbatimLine1) {
|
||||||
"/** \\fn*/"
|
"/** \\fn*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -926,7 +926,7 @@ TEST_F(CommentLexerTest, VerbatimLine2) {
|
||||||
"/** \\fn void *foo(const char *zzz = \"\\$\");*/"
|
"/** \\fn void *foo(const char *zzz = \"\\$\");*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1052,7 +1052,7 @@ TEST_F(CommentLexerTest, HTML4) {
|
||||||
"// <img "
|
"// <img "
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1169,7 +1169,7 @@ TEST_F(CommentLexerTest, HTML9) {
|
||||||
"// <img src "
|
"// <img src "
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1195,7 +1195,7 @@ TEST_F(CommentLexerTest, HTML10) {
|
||||||
"// <img src ="
|
"// <img src ="
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1225,7 +1225,7 @@ TEST_F(CommentLexerTest, HTML11) {
|
||||||
"// <img src = \'"
|
"// <img src = \'"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1284,7 +1284,7 @@ TEST_F(CommentLexerTest, HTML13) {
|
||||||
"// <img src=\'val\\\"\\'val\'"
|
"// <img src=\'val\\\"\\'val\'"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1315,7 +1315,7 @@ TEST_F(CommentLexerTest, HTML14) {
|
||||||
"// <img src=\'val\\\"\\'val\'>"
|
"// <img src=\'val\\\"\\'val\'>"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1348,7 +1348,7 @@ TEST_F(CommentLexerTest, HTML15) {
|
||||||
"// <img />"
|
"// <img />"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1373,7 +1373,7 @@ TEST_F(CommentLexerTest, HTML16) {
|
||||||
"// <img / Aaa"
|
"// <img / Aaa"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
@ -1797,7 +1797,7 @@ TEST_F(CommentLexerTest, HTMLCharacterReferences16) {
|
||||||
"// ="
|
"// ="
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
std::vector<Token> Toks;
|
std::vector<Token> Toks;
|
||||||
|
|
||||||
lexString(Sources[i], Toks);
|
lexString(Sources[i], Toks);
|
||||||
|
|
|
@ -664,7 +664,7 @@ TEST_F(CommentParserTest, ParagraphSplitting1) {
|
||||||
"*/"),
|
"*/"),
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -801,7 +801,7 @@ TEST_F(CommentParserTest, ParamCommand3) {
|
||||||
"// Bbb\n")
|
"// Bbb\n")
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -831,7 +831,7 @@ TEST_F(CommentParserTest, ParamCommand4) {
|
||||||
"// Bbb\n"),
|
"// Bbb\n"),
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -861,7 +861,7 @@ TEST_F(CommentParserTest, ParamCommand5) {
|
||||||
"// Bbb\n"),
|
"// Bbb\n"),
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -892,7 +892,7 @@ TEST_F(CommentParserTest, ParamCommand6) {
|
||||||
"// Bbb\n"
|
"// Bbb\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -947,7 +947,7 @@ TEST_F(CommentParserTest, TParamCommand1) {
|
||||||
"// Bbb\n"
|
"// Bbb\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -1081,7 +1081,7 @@ TEST_F(CommentParserTest, HTML1) {
|
||||||
"// <a >"
|
"// <a >"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 1));
|
ASSERT_TRUE(HasChildCount(FC, 1));
|
||||||
|
|
||||||
|
@ -1103,7 +1103,7 @@ TEST_F(CommentParserTest, HTML2) {
|
||||||
"// <br />"
|
"// <br />"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 1));
|
ASSERT_TRUE(HasChildCount(FC, 1));
|
||||||
|
|
||||||
|
@ -1127,7 +1127,7 @@ TEST_F(CommentParserTest, HTML3) {
|
||||||
"// <a href >",
|
"// <a href >",
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 1));
|
ASSERT_TRUE(HasChildCount(FC, 1));
|
||||||
|
|
||||||
|
@ -1149,7 +1149,7 @@ TEST_F(CommentParserTest, HTML4) {
|
||||||
"// <a href=\"bbb\">",
|
"// <a href=\"bbb\">",
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 1));
|
ASSERT_TRUE(HasChildCount(FC, 1));
|
||||||
|
|
||||||
|
@ -1172,7 +1172,7 @@ TEST_F(CommentParserTest, HTML5) {
|
||||||
"// </a >"
|
"// </a >"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 1));
|
ASSERT_TRUE(HasChildCount(FC, 1));
|
||||||
|
|
||||||
|
@ -1285,7 +1285,7 @@ TEST_F(CommentParserTest, VerbatimBlock5) {
|
||||||
" *\\endverbatim*/"
|
" *\\endverbatim*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 1));
|
ASSERT_TRUE(HasChildCount(FC, 1));
|
||||||
|
|
||||||
|
@ -1309,7 +1309,7 @@ TEST_F(CommentParserTest, VerbatimBlock6) {
|
||||||
" * \\endverbatim*/"
|
" * \\endverbatim*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -1336,7 +1336,7 @@ TEST_F(CommentParserTest, VerbatimBlock7) {
|
||||||
" * \\endverbatim*/"
|
" * \\endverbatim*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -1364,7 +1364,7 @@ TEST_F(CommentParserTest, VerbatimBlock8) {
|
||||||
" * Bbb\n"
|
" * Bbb\n"
|
||||||
" * \\endverbatim*/"
|
" * \\endverbatim*/"
|
||||||
};
|
};
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -1387,7 +1387,7 @@ TEST_F(CommentParserTest, VerbatimLine1) {
|
||||||
"// \\fn\n"
|
"// \\fn\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -1405,7 +1405,7 @@ TEST_F(CommentParserTest, VerbatimLine2) {
|
||||||
"/** \\fn void *foo(const char *zzz = \"\\$\");*/"
|
"/** \\fn void *foo(const char *zzz = \"\\$\");*/"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
@ -1424,7 +1424,7 @@ TEST_F(CommentParserTest, Deprecated) {
|
||||||
"/// @deprecated\n"
|
"/// @deprecated\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0, e = size(Sources); i != e; i++) {
|
for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) {
|
||||||
FullComment *FC = parseString(Sources[i]);
|
FullComment *FC = parseString(Sources[i]);
|
||||||
ASSERT_TRUE(HasChildCount(FC, 2));
|
ASSERT_TRUE(HasChildCount(FC, 2));
|
||||||
|
|
||||||
|
|
|
@ -731,7 +731,7 @@ TEST(DeclPrinter, TestCXXMethodDecl_Operator1) {
|
||||||
"()", "[]"
|
"()", "[]"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (unsigned i = 0, e = llvm::size(OperatorNames); i != e; ++i) {
|
for (unsigned i = 0, e = llvm::array_lengthof(OperatorNames); i != e; ++i) {
|
||||||
SmallString<128> Code;
|
SmallString<128> Code;
|
||||||
Code.append("struct Z { void operator");
|
Code.append("struct Z { void operator");
|
||||||
Code.append(OperatorNames[i]);
|
Code.append(OperatorNames[i]);
|
||||||
|
@ -754,7 +754,7 @@ TEST(DeclPrinter, TestCXXMethodDecl_Operator2) {
|
||||||
"~", "!", "++", "--", "->"
|
"~", "!", "++", "--", "->"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (unsigned i = 0, e = llvm::size(OperatorNames); i != e; ++i) {
|
for (unsigned i = 0, e = llvm::array_lengthof(OperatorNames); i != e; ++i) {
|
||||||
SmallString<128> Code;
|
SmallString<128> Code;
|
||||||
Code.append("struct Z { void operator");
|
Code.append("struct Z { void operator");
|
||||||
Code.append(OperatorNames[i]);
|
Code.append(OperatorNames[i]);
|
||||||
|
|
|
@ -642,7 +642,7 @@ TEST(ParseFixedCompilationDatabase, HandlesPositionalArgsSyntaxOnly) {
|
||||||
// Adjust the given command line arguments to ensure that any positional
|
// Adjust the given command line arguments to ensure that any positional
|
||||||
// arguments in them are stripped.
|
// arguments in them are stripped.
|
||||||
const char *Argv[] = {"--", "somefile.cpp", "-fsyntax-only", "-DDEF3"};
|
const char *Argv[] = {"--", "somefile.cpp", "-fsyntax-only", "-DDEF3"};
|
||||||
int Argc = llvm::size(Argv);
|
int Argc = llvm::array_lengthof(Argv);
|
||||||
std::string ErrorMessage;
|
std::string ErrorMessage;
|
||||||
std::unique_ptr<CompilationDatabase> Database =
|
std::unique_ptr<CompilationDatabase> Database =
|
||||||
FixedCompilationDatabase::loadFromCommandLine(Argc, Argv, ErrorMessage);
|
FixedCompilationDatabase::loadFromCommandLine(Argc, Argv, ErrorMessage);
|
||||||
|
|
|
@ -947,7 +947,7 @@ MergeChunk::MergeChunk(uint32_t alignment)
|
||||||
void MergeChunk::addSection(COFFLinkerContext &ctx, SectionChunk *c) {
|
void MergeChunk::addSection(COFFLinkerContext &ctx, SectionChunk *c) {
|
||||||
assert(isPowerOf2_32(c->getAlignment()));
|
assert(isPowerOf2_32(c->getAlignment()));
|
||||||
uint8_t p2Align = llvm::Log2_32(c->getAlignment());
|
uint8_t p2Align = llvm::Log2_32(c->getAlignment());
|
||||||
assert(p2Align < size(ctx.mergeChunkInstances));
|
assert(p2Align < array_lengthof(ctx.mergeChunkInstances));
|
||||||
auto *&mc = ctx.mergeChunkInstances[p2Align];
|
auto *&mc = ctx.mergeChunkInstances[p2Align];
|
||||||
if (!mc)
|
if (!mc)
|
||||||
mc = make<MergeChunk>(c->getAlignment());
|
mc = make<MergeChunk>(c->getAlignment());
|
||||||
|
|
|
@ -77,7 +77,7 @@ static_assert((sizeof(g_format_infos) / sizeof(g_format_infos[0])) ==
|
||||||
kNumFormats,
|
kNumFormats,
|
||||||
"All formats must have a corresponding info entry.");
|
"All formats must have a corresponding info entry.");
|
||||||
|
|
||||||
static uint32_t g_num_format_infos = llvm::size(g_format_infos);
|
static uint32_t g_num_format_infos = llvm::array_lengthof(g_format_infos);
|
||||||
|
|
||||||
static bool GetFormatFromFormatChar(char format_char, Format &format) {
|
static bool GetFormatFromFormatChar(char format_char, Format &format) {
|
||||||
for (uint32_t i = 0; i < g_num_format_infos; ++i) {
|
for (uint32_t i = 0; i < g_num_format_infos; ++i) {
|
||||||
|
|
|
@ -108,7 +108,7 @@ Status MainLoop::RunImpl::Poll() {
|
||||||
EV_SET(&in_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0);
|
EV_SET(&in_events[i++], fd.first, EVFILT_READ, EV_ADD, 0, 0, 0);
|
||||||
|
|
||||||
num_events = kevent(loop.m_kqueue, in_events.data(), in_events.size(),
|
num_events = kevent(loop.m_kqueue, in_events.data(), in_events.size(),
|
||||||
out_events, llvm::size(out_events), nullptr);
|
out_events, llvm::array_lengthof(out_events), nullptr);
|
||||||
|
|
||||||
if (num_events < 0) {
|
if (num_events < 0) {
|
||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
|
|
|
@ -188,7 +188,7 @@ size_t ConnectionGenericFile::Read(void *dst, size_t dst_len,
|
||||||
.count()
|
.count()
|
||||||
: INFINITE;
|
: INFINITE;
|
||||||
DWORD wait_result =
|
DWORD wait_result =
|
||||||
::WaitForMultipleObjects(llvm::size(m_event_handles),
|
::WaitForMultipleObjects(llvm::array_lengthof(m_event_handles),
|
||||||
m_event_handles, FALSE, milliseconds);
|
m_event_handles, FALSE, milliseconds);
|
||||||
// All of the events are manual reset events, so make sure we reset them
|
// All of the events are manual reset events, so make sure we reset them
|
||||||
// to non-signalled.
|
// to non-signalled.
|
||||||
|
|
|
@ -549,7 +549,7 @@ void CommandInterpreter::LoadCommandDictionary() {
|
||||||
"breakpoint set --name '%1'"}};
|
"breakpoint set --name '%1'"}};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
size_t num_regexes = llvm::size(break_regexes);
|
size_t num_regexes = llvm::array_lengthof(break_regexes);
|
||||||
|
|
||||||
std::unique_ptr<CommandObjectRegexCommand> break_regex_cmd_up(
|
std::unique_ptr<CommandObjectRegexCommand> break_regex_cmd_up(
|
||||||
new CommandObjectRegexCommand(
|
new CommandObjectRegexCommand(
|
||||||
|
|
|
@ -1187,7 +1187,7 @@ static const RegisterInfo g_register_infos[] = {
|
||||||
}};
|
}};
|
||||||
|
|
||||||
static const uint32_t k_num_register_infos =
|
static const uint32_t k_num_register_infos =
|
||||||
llvm::size(g_register_infos);
|
llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
const lldb_private::RegisterInfo *
|
const lldb_private::RegisterInfo *
|
||||||
ABIMacOSX_arm::GetRegisterInfoArray(uint32_t &count) {
|
ABIMacOSX_arm::GetRegisterInfoArray(uint32_t &count) {
|
||||||
|
@ -1235,7 +1235,7 @@ bool ABIMacOSX_arm::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||||
|
|
||||||
llvm::ArrayRef<addr_t>::iterator ai = args.begin(), ae = args.end();
|
llvm::ArrayRef<addr_t>::iterator ai = args.begin(), ae = args.end();
|
||||||
|
|
||||||
for (size_t i = 0; i < llvm::size(reg_names); ++i) {
|
for (size_t i = 0; i < llvm::array_lengthof(reg_names); ++i) {
|
||||||
if (ai == ae)
|
if (ai == ae)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1190,7 +1190,7 @@ static const RegisterInfo g_register_infos[] = {
|
||||||
}};
|
}};
|
||||||
|
|
||||||
static const uint32_t k_num_register_infos =
|
static const uint32_t k_num_register_infos =
|
||||||
llvm::size(g_register_infos);
|
llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
const lldb_private::RegisterInfo *
|
const lldb_private::RegisterInfo *
|
||||||
ABISysV_arm::GetRegisterInfoArray(uint32_t &count) {
|
ABISysV_arm::GetRegisterInfoArray(uint32_t &count) {
|
||||||
|
@ -1240,7 +1240,7 @@ bool ABISysV_arm::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||||
|
|
||||||
llvm::ArrayRef<addr_t>::iterator ai = args.begin(), ae = args.end();
|
llvm::ArrayRef<addr_t>::iterator ai = args.begin(), ae = args.end();
|
||||||
|
|
||||||
for (size_t i = 0; i < llvm::size(reg_names); ++i) {
|
for (size_t i = 0; i < llvm::array_lengthof(reg_names); ++i) {
|
||||||
if (ai == ae)
|
if (ai == ae)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -503,7 +503,7 @@ static const RegisterInfo g_register_infos[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32_t k_num_register_infos =
|
static const uint32_t k_num_register_infos =
|
||||||
llvm::size(g_register_infos);
|
llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
const lldb_private::RegisterInfo *
|
const lldb_private::RegisterInfo *
|
||||||
ABISysV_mips::GetRegisterInfoArray(uint32_t &count) {
|
ABISysV_mips::GetRegisterInfoArray(uint32_t &count) {
|
||||||
|
@ -559,7 +559,7 @@ bool ABISysV_mips::PrepareTrivialCall(Thread &thread, addr_t sp,
|
||||||
llvm::ArrayRef<addr_t>::iterator ai = args.begin(), ae = args.end();
|
llvm::ArrayRef<addr_t>::iterator ai = args.begin(), ae = args.end();
|
||||||
|
|
||||||
// Write arguments to registers
|
// Write arguments to registers
|
||||||
for (size_t i = 0; i < llvm::size(reg_names); ++i) {
|
for (size_t i = 0; i < llvm::array_lengthof(reg_names); ++i) {
|
||||||
if (ai == ae)
|
if (ai == ae)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -503,7 +503,7 @@ static const RegisterInfo g_register_infos_mips64[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32_t k_num_register_infos =
|
static const uint32_t k_num_register_infos =
|
||||||
llvm::size(g_register_infos_mips64);
|
llvm::array_lengthof(g_register_infos_mips64);
|
||||||
|
|
||||||
const lldb_private::RegisterInfo *
|
const lldb_private::RegisterInfo *
|
||||||
ABISysV_mips64::GetRegisterInfoArray(uint32_t &count) {
|
ABISysV_mips64::GetRegisterInfoArray(uint32_t &count) {
|
||||||
|
|
|
@ -204,7 +204,7 @@ static const RegisterInfo g_register_infos[] = {
|
||||||
}};
|
}};
|
||||||
|
|
||||||
static const uint32_t k_num_register_infos =
|
static const uint32_t k_num_register_infos =
|
||||||
llvm::size(g_register_infos);
|
llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
const lldb_private::RegisterInfo *
|
const lldb_private::RegisterInfo *
|
||||||
ABISysV_ppc::GetRegisterInfoArray(uint32_t &count) {
|
ABISysV_ppc::GetRegisterInfoArray(uint32_t &count) {
|
||||||
|
|
|
@ -52,10 +52,10 @@ LLDB_PLUGIN_DEFINE(ABISysV_ppc64)
|
||||||
const lldb_private::RegisterInfo *
|
const lldb_private::RegisterInfo *
|
||||||
ABISysV_ppc64::GetRegisterInfoArray(uint32_t &count) {
|
ABISysV_ppc64::GetRegisterInfoArray(uint32_t &count) {
|
||||||
if (GetByteOrder() == lldb::eByteOrderLittle) {
|
if (GetByteOrder() == lldb::eByteOrderLittle) {
|
||||||
count = llvm::size(g_register_infos_ppc64le);
|
count = llvm::array_lengthof(g_register_infos_ppc64le);
|
||||||
return g_register_infos_ppc64le;
|
return g_register_infos_ppc64le;
|
||||||
} else {
|
} else {
|
||||||
count = llvm::size(g_register_infos_ppc64);
|
count = llvm::array_lengthof(g_register_infos_ppc64);
|
||||||
return g_register_infos_ppc64;
|
return g_register_infos_ppc64;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ static const RegisterInfo g_register_infos[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint32_t k_num_register_infos =
|
static const uint32_t k_num_register_infos =
|
||||||
llvm::size(g_register_infos);
|
llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
const lldb_private::RegisterInfo *
|
const lldb_private::RegisterInfo *
|
||||||
ABISysV_s390x::GetRegisterInfoArray(uint32_t &count) {
|
ABISysV_s390x::GetRegisterInfoArray(uint32_t &count) {
|
||||||
|
|
|
@ -405,7 +405,7 @@ DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::M
|
||||||
const uint32_t magicks[] = { llvm::MachO::MH_MAGIC_64, llvm::MachO::MH_MAGIC, llvm::MachO::MH_CIGAM, llvm::MachO::MH_CIGAM_64};
|
const uint32_t magicks[] = { llvm::MachO::MH_MAGIC_64, llvm::MachO::MH_MAGIC, llvm::MachO::MH_CIGAM, llvm::MachO::MH_CIGAM_64};
|
||||||
|
|
||||||
bool found_matching_pattern = false;
|
bool found_matching_pattern = false;
|
||||||
for (size_t i = 0; i < llvm::size (magicks); i++)
|
for (size_t i = 0; i < llvm::array_lengthof (magicks); i++)
|
||||||
if (::memcmp (&header.magic, &magicks[i], sizeof (uint32_t)) == 0)
|
if (::memcmp (&header.magic, &magicks[i], sizeof (uint32_t)) == 0)
|
||||||
found_matching_pattern = true;
|
found_matching_pattern = true;
|
||||||
|
|
||||||
|
|
|
@ -13198,7 +13198,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode,
|
||||||
&EmulateInstructionARM::EmulateRFE, "rfe{<amode>} <Rn>{!}"}
|
&EmulateInstructionARM::EmulateRFE, "rfe{<amode>} <Rn>{!}"}
|
||||||
|
|
||||||
};
|
};
|
||||||
static const size_t k_num_arm_opcodes = llvm::size(g_arm_opcodes);
|
static const size_t k_num_arm_opcodes = llvm::array_lengthof(g_arm_opcodes);
|
||||||
|
|
||||||
for (size_t i = 0; i < k_num_arm_opcodes; ++i) {
|
for (size_t i = 0; i < k_num_arm_opcodes; ++i) {
|
||||||
if ((g_arm_opcodes[i].mask & opcode) == g_arm_opcodes[i].value &&
|
if ((g_arm_opcodes[i].mask & opcode) == g_arm_opcodes[i].value &&
|
||||||
|
@ -13749,7 +13749,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode,
|
||||||
&EmulateInstructionARM::EmulateUXTH, "uxth<c>.w <Rd>,<Rm>{,<rotation>}"},
|
&EmulateInstructionARM::EmulateUXTH, "uxth<c>.w <Rd>,<Rm>{,<rotation>}"},
|
||||||
};
|
};
|
||||||
|
|
||||||
const size_t k_num_thumb_opcodes = llvm::size(g_thumb_opcodes);
|
const size_t k_num_thumb_opcodes = llvm::array_lengthof(g_thumb_opcodes);
|
||||||
for (size_t i = 0; i < k_num_thumb_opcodes; ++i) {
|
for (size_t i = 0; i < k_num_thumb_opcodes; ++i) {
|
||||||
if ((g_thumb_opcodes[i].mask & opcode) == g_thumb_opcodes[i].value &&
|
if ((g_thumb_opcodes[i].mask & opcode) == g_thumb_opcodes[i].value &&
|
||||||
(g_thumb_opcodes[i].variants & arm_isa) != 0)
|
(g_thumb_opcodes[i].variants & arm_isa) != 0)
|
||||||
|
|
|
@ -52,7 +52,7 @@ using namespace lldb_private;
|
||||||
LLDB_PLUGIN_DEFINE_ADV(EmulateInstructionARM64, InstructionARM64)
|
LLDB_PLUGIN_DEFINE_ADV(EmulateInstructionARM64, InstructionARM64)
|
||||||
|
|
||||||
static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo ®_info) {
|
static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo ®_info) {
|
||||||
if (reg_num >= llvm::size(g_register_infos_arm64_le))
|
if (reg_num >= llvm::array_lengthof(g_register_infos_arm64_le))
|
||||||
return false;
|
return false;
|
||||||
reg_info = g_register_infos_arm64_le[reg_num];
|
reg_info = g_register_infos_arm64_le[reg_num];
|
||||||
return true;
|
return true;
|
||||||
|
@ -360,7 +360,7 @@ EmulateInstructionARM64::GetOpcodeForInstruction(const uint32_t opcode) {
|
||||||
"TBNZ <R><t>, #<imm>, <label>"},
|
"TBNZ <R><t>, #<imm>, <label>"},
|
||||||
|
|
||||||
};
|
};
|
||||||
static const size_t k_num_arm_opcodes = llvm::size(g_opcodes);
|
static const size_t k_num_arm_opcodes = llvm::array_lengthof(g_opcodes);
|
||||||
|
|
||||||
for (size_t i = 0; i < k_num_arm_opcodes; ++i) {
|
for (size_t i = 0; i < k_num_arm_opcodes; ++i) {
|
||||||
if ((g_opcodes[i].mask & opcode) == g_opcodes[i].value)
|
if ((g_opcodes[i].mask & opcode) == g_opcodes[i].value)
|
||||||
|
|
|
@ -954,7 +954,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) {
|
||||||
{"JALRS_MM", &EmulateInstructionMIPS::Emulate_JALRS, "JALRS rt, rs"},
|
{"JALRS_MM", &EmulateInstructionMIPS::Emulate_JALRS, "JALRS rt, rs"},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const size_t k_num_mips_opcodes = llvm::size(g_opcodes);
|
static const size_t k_num_mips_opcodes = llvm::array_lengthof(g_opcodes);
|
||||||
|
|
||||||
for (size_t i = 0; i < k_num_mips_opcodes; ++i) {
|
for (size_t i = 0; i < k_num_mips_opcodes; ++i) {
|
||||||
if (!strcasecmp(g_opcodes[i].op_name, op_name))
|
if (!strcasecmp(g_opcodes[i].op_name, op_name))
|
||||||
|
|
|
@ -919,7 +919,7 @@ EmulateInstructionMIPS64::GetOpcodeForInstruction(const char *op_name) {
|
||||||
{"BZ_V", &EmulateInstructionMIPS64::Emulate_BZV, "BZ.V wt,s16"},
|
{"BZ_V", &EmulateInstructionMIPS64::Emulate_BZV, "BZ.V wt,s16"},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const size_t k_num_mips_opcodes = llvm::size(g_opcodes);
|
static const size_t k_num_mips_opcodes = llvm::array_lengthof(g_opcodes);
|
||||||
|
|
||||||
for (size_t i = 0; i < k_num_mips_opcodes; ++i) {
|
for (size_t i = 0; i < k_num_mips_opcodes; ++i) {
|
||||||
if (!strcasecmp(g_opcodes[i].op_name, op_name))
|
if (!strcasecmp(g_opcodes[i].op_name, op_name))
|
||||||
|
|
|
@ -59,7 +59,7 @@ bool EmulateInstructionPPC64::SetTargetTriple(const ArchSpec &arch) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo ®_info) {
|
static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo ®_info) {
|
||||||
if (reg_num >= llvm::size(g_register_infos_ppc64le))
|
if (reg_num >= llvm::array_lengthof(g_register_infos_ppc64le))
|
||||||
return false;
|
return false;
|
||||||
reg_info = g_register_infos_ppc64le[reg_num];
|
reg_info = g_register_infos_ppc64le[reg_num];
|
||||||
return true;
|
return true;
|
||||||
|
@ -147,7 +147,7 @@ EmulateInstructionPPC64::GetOpcodeForInstruction(uint32_t opcode) {
|
||||||
"addi RT, RA, SI"},
|
"addi RT, RA, SI"},
|
||||||
{0xfc000003, 0xe8000000, &EmulateInstructionPPC64::EmulateLD,
|
{0xfc000003, 0xe8000000, &EmulateInstructionPPC64::EmulateLD,
|
||||||
"ld RT, DS(RA)"}};
|
"ld RT, DS(RA)"}};
|
||||||
static const size_t k_num_ppc_opcodes = llvm::size(g_opcodes);
|
static const size_t k_num_ppc_opcodes = llvm::array_lengthof(g_opcodes);
|
||||||
|
|
||||||
for (size_t i = 0; i < k_num_ppc_opcodes; ++i) {
|
for (size_t i = 0; i < k_num_ppc_opcodes; ++i) {
|
||||||
if ((g_opcodes[i].mask & opcode) == g_opcodes[i].value)
|
if ((g_opcodes[i].mask & opcode) == g_opcodes[i].value)
|
||||||
|
|
|
@ -749,7 +749,7 @@ AppleObjCTrampolineHandler::AppleObjCTrampolineHandler(
|
||||||
// array into a template table, and populate the DispatchFunction
|
// array into a template table, and populate the DispatchFunction
|
||||||
// map from there.
|
// map from there.
|
||||||
|
|
||||||
for (size_t i = 0; i != llvm::size(g_dispatch_functions); i++) {
|
for (size_t i = 0; i != llvm::array_lengthof(g_dispatch_functions); i++) {
|
||||||
ConstString name_const_str(g_dispatch_functions[i].name);
|
ConstString name_const_str(g_dispatch_functions[i].name);
|
||||||
const Symbol *msgSend_symbol =
|
const Symbol *msgSend_symbol =
|
||||||
m_objc_module_sp->FindFirstSymbolWithNameAndType(name_const_str,
|
m_objc_module_sp->FindFirstSymbolWithNameAndType(name_const_str,
|
||||||
|
@ -769,7 +769,7 @@ AppleObjCTrampolineHandler::AppleObjCTrampolineHandler(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Similarly, cache the addresses of the "optimized dispatch" function.
|
// Similarly, cache the addresses of the "optimized dispatch" function.
|
||||||
for (size_t i = 0; i != llvm::size(g_opt_dispatch_names); i++) {
|
for (size_t i = 0; i != llvm::array_lengthof(g_opt_dispatch_names); i++) {
|
||||||
ConstString name_const_str(g_opt_dispatch_names[i]);
|
ConstString name_const_str(g_opt_dispatch_names[i]);
|
||||||
const Symbol *msgSend_symbol =
|
const Symbol *msgSend_symbol =
|
||||||
m_objc_module_sp->FindFirstSymbolWithNameAndType(name_const_str,
|
m_objc_module_sp->FindFirstSymbolWithNameAndType(name_const_str,
|
||||||
|
|
|
@ -574,7 +574,7 @@ bool ObjectFilePECOFF::ParseSectionHeaders(
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::StringRef ObjectFilePECOFF::GetSectionName(const section_header_t §) {
|
llvm::StringRef ObjectFilePECOFF::GetSectionName(const section_header_t §) {
|
||||||
llvm::StringRef hdr_name(sect.name, llvm::size(sect.name));
|
llvm::StringRef hdr_name(sect.name, llvm::array_lengthof(sect.name));
|
||||||
hdr_name = hdr_name.split('\0').first;
|
hdr_name = hdr_name.split('\0').first;
|
||||||
if (hdr_name.consume_front("/")) {
|
if (hdr_name.consume_front("/")) {
|
||||||
lldb::offset_t stroff;
|
lldb::offset_t stroff;
|
||||||
|
|
|
@ -169,7 +169,7 @@ uint32_t EHProgramBuilder::ConvertMachineToLLDBRegister(uint8_t machine_reg) {
|
||||||
lldb_r8_x86_64, lldb_r9_x86_64, lldb_r10_x86_64, lldb_r11_x86_64,
|
lldb_r8_x86_64, lldb_r9_x86_64, lldb_r10_x86_64, lldb_r11_x86_64,
|
||||||
lldb_r12_x86_64, lldb_r13_x86_64, lldb_r14_x86_64, lldb_r15_x86_64};
|
lldb_r12_x86_64, lldb_r13_x86_64, lldb_r14_x86_64, lldb_r15_x86_64};
|
||||||
|
|
||||||
if (machine_reg >= llvm::size(machine_to_lldb_register))
|
if (machine_reg >= llvm::array_lengthof(machine_to_lldb_register))
|
||||||
return LLDB_INVALID_REGNUM;
|
return LLDB_INVALID_REGNUM;
|
||||||
|
|
||||||
return machine_to_lldb_register[machine_reg];
|
return machine_to_lldb_register[machine_reg];
|
||||||
|
@ -184,7 +184,7 @@ uint32_t EHProgramBuilder::ConvertXMMToLLDBRegister(uint8_t xmm_reg) {
|
||||||
lldb_xmm12_x86_64, lldb_xmm13_x86_64, lldb_xmm14_x86_64,
|
lldb_xmm12_x86_64, lldb_xmm13_x86_64, lldb_xmm14_x86_64,
|
||||||
lldb_xmm15_x86_64};
|
lldb_xmm15_x86_64};
|
||||||
|
|
||||||
if (xmm_reg >= llvm::size(xmm_to_lldb_register))
|
if (xmm_reg >= llvm::array_lengthof(xmm_to_lldb_register))
|
||||||
return LLDB_INVALID_REGNUM;
|
return LLDB_INVALID_REGNUM;
|
||||||
|
|
||||||
return xmm_to_lldb_register[xmm_reg];
|
return xmm_to_lldb_register[xmm_reg];
|
||||||
|
|
|
@ -686,7 +686,7 @@ BreakpointSP PlatformDarwin::SetThreadCreationBreakpoint(Target &target) {
|
||||||
"libSystem.B.dylib"};
|
"libSystem.B.dylib"};
|
||||||
|
|
||||||
FileSpecList bp_modules;
|
FileSpecList bp_modules;
|
||||||
for (size_t i = 0; i < llvm::size(g_bp_modules); i++) {
|
for (size_t i = 0; i < llvm::array_lengthof(g_bp_modules); i++) {
|
||||||
const char *bp_module = g_bp_modules[i];
|
const char *bp_module = g_bp_modules[i];
|
||||||
bp_modules.EmplaceBack(bp_module);
|
bp_modules.EmplaceBack(bp_module);
|
||||||
}
|
}
|
||||||
|
@ -695,7 +695,7 @@ BreakpointSP PlatformDarwin::SetThreadCreationBreakpoint(Target &target) {
|
||||||
bool hardware = false;
|
bool hardware = false;
|
||||||
LazyBool skip_prologue = eLazyBoolNo;
|
LazyBool skip_prologue = eLazyBoolNo;
|
||||||
bp_sp = target.CreateBreakpoint(&bp_modules, nullptr, g_bp_names,
|
bp_sp = target.CreateBreakpoint(&bp_modules, nullptr, g_bp_names,
|
||||||
llvm::size(g_bp_names),
|
llvm::array_lengthof(g_bp_names),
|
||||||
eFunctionNameTypeFull, eLanguageTypeUnknown,
|
eFunctionNameTypeFull, eLanguageTypeUnknown,
|
||||||
0, skip_prologue, internal, hardware);
|
0, skip_prologue, internal, hardware);
|
||||||
bp_sp->SetBreakpointKind("thread-creation");
|
bp_sp->SetBreakpointKind("thread-creation");
|
||||||
|
|
|
@ -856,7 +856,7 @@ static uint32_t g_exc_regnums[] = {
|
||||||
exc_exception, exc_fsr, exc_far,
|
exc_exception, exc_fsr, exc_far,
|
||||||
};
|
};
|
||||||
|
|
||||||
static size_t k_num_register_infos = llvm::size(g_register_infos);
|
static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
RegisterContextDarwin_arm::RegisterContextDarwin_arm(
|
RegisterContextDarwin_arm::RegisterContextDarwin_arm(
|
||||||
Thread &thread, uint32_t concrete_frame_idx)
|
Thread &thread, uint32_t concrete_frame_idx)
|
||||||
|
@ -897,9 +897,9 @@ const RegisterInfo *RegisterContextDarwin_arm::GetRegisterInfos() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of registers in each register set
|
// Number of registers in each register set
|
||||||
const size_t k_num_gpr_registers = llvm::size(g_gpr_regnums);
|
const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);
|
||||||
const size_t k_num_fpu_registers = llvm::size(g_fpu_regnums);
|
const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
|
||||||
const size_t k_num_exc_registers = llvm::size(g_exc_regnums);
|
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
|
||||||
|
|
||||||
// Register set definitions. The first definitions at register set index of
|
// Register set definitions. The first definitions at register set index of
|
||||||
// zero is for all registers, followed by other registers sets. The register
|
// zero is for all registers, followed by other registers sets. The register
|
||||||
|
@ -911,7 +911,7 @@ static const RegisterSet g_reg_sets[] = {
|
||||||
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
|
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
|
||||||
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
|
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
|
||||||
|
|
||||||
const size_t k_num_regsets = llvm::size(g_reg_sets);
|
const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);
|
||||||
|
|
||||||
size_t RegisterContextDarwin_arm::GetRegisterSetCount() {
|
size_t RegisterContextDarwin_arm::GetRegisterSetCount() {
|
||||||
return k_num_regsets;
|
return k_num_regsets;
|
||||||
|
|
|
@ -91,7 +91,7 @@ static uint32_t g_fpu_regnums[] = {
|
||||||
static uint32_t g_exc_regnums[] = {exc_far, exc_esr, exc_exception};
|
static uint32_t g_exc_regnums[] = {exc_far, exc_esr, exc_exception};
|
||||||
|
|
||||||
static size_t k_num_register_infos =
|
static size_t k_num_register_infos =
|
||||||
llvm::size(g_register_infos_arm64_le);
|
llvm::array_lengthof(g_register_infos_arm64_le);
|
||||||
|
|
||||||
RegisterContextDarwin_arm64::RegisterContextDarwin_arm64(
|
RegisterContextDarwin_arm64::RegisterContextDarwin_arm64(
|
||||||
Thread &thread, uint32_t concrete_frame_idx)
|
Thread &thread, uint32_t concrete_frame_idx)
|
||||||
|
@ -132,9 +132,9 @@ const RegisterInfo *RegisterContextDarwin_arm64::GetRegisterInfos() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of registers in each register set
|
// Number of registers in each register set
|
||||||
const size_t k_num_gpr_registers = llvm::size(g_gpr_regnums);
|
const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);
|
||||||
const size_t k_num_fpu_registers = llvm::size(g_fpu_regnums);
|
const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
|
||||||
const size_t k_num_exc_registers = llvm::size(g_exc_regnums);
|
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
|
||||||
|
|
||||||
// Register set definitions. The first definitions at register set index of
|
// Register set definitions. The first definitions at register set index of
|
||||||
// zero is for all registers, followed by other registers sets. The register
|
// zero is for all registers, followed by other registers sets. The register
|
||||||
|
@ -146,7 +146,7 @@ static const RegisterSet g_reg_sets[] = {
|
||||||
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
|
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
|
||||||
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
|
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
|
||||||
|
|
||||||
const size_t k_num_regsets = llvm::size(g_reg_sets);
|
const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);
|
||||||
|
|
||||||
size_t RegisterContextDarwin_arm64::GetRegisterSetCount() {
|
size_t RegisterContextDarwin_arm64::GetRegisterSetCount() {
|
||||||
return k_num_regsets;
|
return k_num_regsets;
|
||||||
|
|
|
@ -363,7 +363,7 @@ static RegisterInfo g_register_infos[] = {
|
||||||
nullptr,
|
nullptr,
|
||||||
}};
|
}};
|
||||||
|
|
||||||
static size_t k_num_register_infos = llvm::size(g_register_infos);
|
static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
RegisterContextDarwin_i386::RegisterContextDarwin_i386(
|
RegisterContextDarwin_i386::RegisterContextDarwin_i386(
|
||||||
Thread &thread, uint32_t concrete_frame_idx)
|
Thread &thread, uint32_t concrete_frame_idx)
|
||||||
|
@ -421,9 +421,9 @@ static uint32_t g_fpu_regnums[] = {
|
||||||
static uint32_t g_exc_regnums[] = {exc_trapno, exc_err, exc_faultvaddr};
|
static uint32_t g_exc_regnums[] = {exc_trapno, exc_err, exc_faultvaddr};
|
||||||
|
|
||||||
// Number of registers in each register set
|
// Number of registers in each register set
|
||||||
const size_t k_num_gpr_registers = llvm::size(g_gpr_regnums);
|
const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);
|
||||||
const size_t k_num_fpu_registers = llvm::size(g_fpu_regnums);
|
const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
|
||||||
const size_t k_num_exc_registers = llvm::size(g_exc_regnums);
|
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
|
||||||
|
|
||||||
// Register set definitions. The first definitions at register set index of
|
// Register set definitions. The first definitions at register set index of
|
||||||
// zero is for all registers, followed by other registers sets. The register
|
// zero is for all registers, followed by other registers sets. The register
|
||||||
|
@ -435,7 +435,7 @@ static const RegisterSet g_reg_sets[] = {
|
||||||
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
|
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
|
||||||
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
|
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
|
||||||
|
|
||||||
const size_t k_num_regsets = llvm::size(g_reg_sets);
|
const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);
|
||||||
|
|
||||||
size_t RegisterContextDarwin_i386::GetRegisterSetCount() {
|
size_t RegisterContextDarwin_i386::GetRegisterSetCount() {
|
||||||
return k_num_regsets;
|
return k_num_regsets;
|
||||||
|
|
|
@ -420,7 +420,7 @@ static RegisterInfo g_register_infos[] = {
|
||||||
nullptr,
|
nullptr,
|
||||||
}};
|
}};
|
||||||
|
|
||||||
static size_t k_num_register_infos = llvm::size(g_register_infos);
|
static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
RegisterContextDarwin_x86_64::RegisterContextDarwin_x86_64(
|
RegisterContextDarwin_x86_64::RegisterContextDarwin_x86_64(
|
||||||
Thread &thread, uint32_t concrete_frame_idx)
|
Thread &thread, uint32_t concrete_frame_idx)
|
||||||
|
@ -477,9 +477,9 @@ static uint32_t g_fpu_regnums[] = {
|
||||||
static uint32_t g_exc_regnums[] = {exc_trapno, exc_err, exc_faultvaddr};
|
static uint32_t g_exc_regnums[] = {exc_trapno, exc_err, exc_faultvaddr};
|
||||||
|
|
||||||
// Number of registers in each register set
|
// Number of registers in each register set
|
||||||
const size_t k_num_gpr_registers = llvm::size(g_gpr_regnums);
|
const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums);
|
||||||
const size_t k_num_fpu_registers = llvm::size(g_fpu_regnums);
|
const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
|
||||||
const size_t k_num_exc_registers = llvm::size(g_exc_regnums);
|
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
|
||||||
|
|
||||||
// Register set definitions. The first definitions at register set index of
|
// Register set definitions. The first definitions at register set index of
|
||||||
// zero is for all registers, followed by other registers sets. The register
|
// zero is for all registers, followed by other registers sets. The register
|
||||||
|
@ -491,7 +491,7 @@ static const RegisterSet g_reg_sets[] = {
|
||||||
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
|
{"Floating Point Registers", "fpu", k_num_fpu_registers, g_fpu_regnums},
|
||||||
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
|
{"Exception State Registers", "exc", k_num_exc_registers, g_exc_regnums}};
|
||||||
|
|
||||||
const size_t k_num_regsets = llvm::size(g_reg_sets);
|
const size_t k_num_regsets = llvm::array_lengthof(g_reg_sets);
|
||||||
|
|
||||||
size_t RegisterContextDarwin_x86_64::GetRegisterSetCount() {
|
size_t RegisterContextDarwin_x86_64::GetRegisterSetCount() {
|
||||||
return k_num_regsets;
|
return k_num_regsets;
|
||||||
|
|
|
@ -78,11 +78,11 @@ const RegisterInfo *RegisterContextWindows_i386::GetRegisterInfo() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t RegisterContextWindows_i386::GetRegisterCount() const {
|
uint32_t RegisterContextWindows_i386::GetRegisterCount() const {
|
||||||
return llvm::size(g_register_infos_i386);
|
return llvm::array_lengthof(g_register_infos_i386);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t RegisterContextWindows_i386::GetUserRegisterCount() const {
|
uint32_t RegisterContextWindows_i386::GetUserRegisterCount() const {
|
||||||
return llvm::size(g_register_infos_i386);
|
return llvm::array_lengthof(g_register_infos_i386);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t RegisterContextWindows_i386::GetGPRSize() const { return sizeof(GPR); }
|
size_t RegisterContextWindows_i386::GetGPRSize() const { return sizeof(GPR); }
|
||||||
|
|
|
@ -141,11 +141,11 @@ const RegisterInfo *RegisterContextWindows_x86_64::GetRegisterInfo() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t RegisterContextWindows_x86_64::GetRegisterCount() const {
|
uint32_t RegisterContextWindows_x86_64::GetRegisterCount() const {
|
||||||
return llvm::size(g_register_infos_x86_64);
|
return llvm::array_lengthof(g_register_infos_x86_64);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t RegisterContextWindows_x86_64::GetUserRegisterCount() const {
|
uint32_t RegisterContextWindows_x86_64::GetUserRegisterCount() const {
|
||||||
return llvm::size(g_register_infos_x86_64);
|
return llvm::array_lengthof(g_register_infos_x86_64);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t RegisterContextWindows_x86_64::GetGPRSize() const { return sizeof(GPR); }
|
size_t RegisterContextWindows_x86_64::GetGPRSize() const { return sizeof(GPR); }
|
||||||
|
|
|
@ -38,7 +38,7 @@ static const uint32_t g_gpr_regnums_WoW64[] = {
|
||||||
|
|
||||||
static const RegisterSet g_reg_sets_WoW64[] = {
|
static const RegisterSet g_reg_sets_WoW64[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_regnums_WoW64) - 1, g_gpr_regnums_WoW64},
|
llvm::array_lengthof(g_gpr_regnums_WoW64) - 1, g_gpr_regnums_WoW64},
|
||||||
};
|
};
|
||||||
enum { k_num_register_sets = 1 };
|
enum { k_num_register_sets = 1 };
|
||||||
|
|
||||||
|
|
|
@ -69,9 +69,9 @@ static_assert(((sizeof g_fpr_regnums_arm / sizeof g_fpr_regnums_arm[0]) - 1) ==
|
||||||
|
|
||||||
static const RegisterSet g_reg_sets_arm[] = {
|
static const RegisterSet g_reg_sets_arm[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_regnums_arm) - 1, g_gpr_regnums_arm},
|
llvm::array_lengthof(g_gpr_regnums_arm) - 1, g_gpr_regnums_arm},
|
||||||
{"Floating Point Registers", "fpr",
|
{"Floating Point Registers", "fpr",
|
||||||
llvm::size(g_fpr_regnums_arm) - 1, g_fpr_regnums_arm},
|
llvm::array_lengthof(g_fpr_regnums_arm) - 1, g_fpr_regnums_arm},
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { k_num_register_sets = 2 };
|
enum { k_num_register_sets = 2 };
|
||||||
|
|
|
@ -85,9 +85,9 @@ static_assert(((sizeof g_fpr_regnums_arm64 / sizeof g_fpr_regnums_arm64[0]) -
|
||||||
|
|
||||||
static const RegisterSet g_reg_sets_arm64[] = {
|
static const RegisterSet g_reg_sets_arm64[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_regnums_arm64) - 1, g_gpr_regnums_arm64},
|
llvm::array_lengthof(g_gpr_regnums_arm64) - 1, g_gpr_regnums_arm64},
|
||||||
{"Floating Point Registers", "fpr",
|
{"Floating Point Registers", "fpr",
|
||||||
llvm::size(g_fpr_regnums_arm64) - 1, g_fpr_regnums_arm64},
|
llvm::array_lengthof(g_fpr_regnums_arm64) - 1, g_fpr_regnums_arm64},
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { k_num_register_sets = 2 };
|
enum { k_num_register_sets = 2 };
|
||||||
|
|
|
@ -38,7 +38,7 @@ static const uint32_t g_gpr_regnums_i386[] = {
|
||||||
|
|
||||||
static const RegisterSet g_reg_sets_i386[] = {
|
static const RegisterSet g_reg_sets_i386[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_regnums_i386) - 1, g_gpr_regnums_i386},
|
llvm::array_lengthof(g_gpr_regnums_i386) - 1, g_gpr_regnums_i386},
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { k_num_register_sets = 1 };
|
enum { k_num_register_sets = 1 };
|
||||||
|
|
|
@ -49,9 +49,9 @@ static const uint32_t g_fpr_regnums_x86_64[] = {
|
||||||
|
|
||||||
static const RegisterSet g_reg_sets_x86_64[] = {
|
static const RegisterSet g_reg_sets_x86_64[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_regnums_x86_64) - 1, g_gpr_regnums_x86_64},
|
llvm::array_lengthof(g_gpr_regnums_x86_64) - 1, g_gpr_regnums_x86_64},
|
||||||
{"Floating Point Registers", "fpr",
|
{"Floating Point Registers", "fpr",
|
||||||
llvm::size(g_fpr_regnums_x86_64) - 1, g_fpr_regnums_x86_64}};
|
llvm::array_lengthof(g_fpr_regnums_x86_64) - 1, g_fpr_regnums_x86_64}};
|
||||||
|
|
||||||
enum { k_num_register_sets = 2 };
|
enum { k_num_register_sets = 2 };
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ using namespace lldb_private;
|
||||||
#include "Plugins/Process/Utility/RegisterInfos_arm.h"
|
#include "Plugins/Process/Utility/RegisterInfos_arm.h"
|
||||||
#undef DECLARE_REGISTER_INFOS_ARM_STRUCT
|
#undef DECLARE_REGISTER_INFOS_ARM_STRUCT
|
||||||
|
|
||||||
static size_t k_num_register_infos = llvm::size(g_register_infos_arm);
|
static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos_arm);
|
||||||
|
|
||||||
// Array of lldb register numbers used to define the set of all General Purpose
|
// Array of lldb register numbers used to define the set of all General Purpose
|
||||||
// Registers
|
// Registers
|
||||||
|
@ -69,8 +69,8 @@ uint32_t g_fpu_reg_indices[] = {
|
||||||
|
|
||||||
RegisterSet g_register_sets[] = {
|
RegisterSet g_register_sets[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_reg_indices), g_gpr_reg_indices},
|
llvm::array_lengthof(g_gpr_reg_indices), g_gpr_reg_indices},
|
||||||
{"Floating Point Registers", "fpu", llvm::size(g_fpu_reg_indices),
|
{"Floating Point Registers", "fpu", llvm::array_lengthof(g_fpu_reg_indices),
|
||||||
g_fpu_reg_indices},
|
g_fpu_reg_indices},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ RegisterContextWindows_arm::RegisterContextWindows_arm(
|
||||||
RegisterContextWindows_arm::~RegisterContextWindows_arm() {}
|
RegisterContextWindows_arm::~RegisterContextWindows_arm() {}
|
||||||
|
|
||||||
size_t RegisterContextWindows_arm::GetRegisterCount() {
|
size_t RegisterContextWindows_arm::GetRegisterCount() {
|
||||||
return llvm::size(g_register_infos_arm);
|
return llvm::array_lengthof(g_register_infos_arm);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RegisterInfo *
|
const RegisterInfo *
|
||||||
|
@ -93,7 +93,7 @@ RegisterContextWindows_arm::GetRegisterInfoAtIndex(size_t reg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t RegisterContextWindows_arm::GetRegisterSetCount() {
|
size_t RegisterContextWindows_arm::GetRegisterSetCount() {
|
||||||
return llvm::size(g_register_sets);
|
return llvm::array_lengthof(g_register_sets);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RegisterSet *RegisterContextWindows_arm::GetRegisterSet(size_t reg_set) {
|
const RegisterSet *RegisterContextWindows_arm::GetRegisterSet(size_t reg_set) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ using namespace lldb_private;
|
||||||
#undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
|
#undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
|
||||||
|
|
||||||
static size_t k_num_register_infos =
|
static size_t k_num_register_infos =
|
||||||
llvm::size(g_register_infos_arm64_le);
|
llvm::array_lengthof(g_register_infos_arm64_le);
|
||||||
|
|
||||||
// Array of lldb register numbers used to define the set of all General Purpose
|
// Array of lldb register numbers used to define the set of all General Purpose
|
||||||
// Registers
|
// Registers
|
||||||
|
@ -83,8 +83,8 @@ uint32_t g_fpu_reg_indices[] = {
|
||||||
|
|
||||||
RegisterSet g_register_sets[] = {
|
RegisterSet g_register_sets[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_reg_indices), g_gpr_reg_indices},
|
llvm::array_lengthof(g_gpr_reg_indices), g_gpr_reg_indices},
|
||||||
{"Floating Point Registers", "fpu", llvm::size(g_fpu_reg_indices),
|
{"Floating Point Registers", "fpu", llvm::array_lengthof(g_fpu_reg_indices),
|
||||||
g_fpu_reg_indices},
|
g_fpu_reg_indices},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ RegisterContextWindows_arm64::RegisterContextWindows_arm64(
|
||||||
RegisterContextWindows_arm64::~RegisterContextWindows_arm64() {}
|
RegisterContextWindows_arm64::~RegisterContextWindows_arm64() {}
|
||||||
|
|
||||||
size_t RegisterContextWindows_arm64::GetRegisterCount() {
|
size_t RegisterContextWindows_arm64::GetRegisterCount() {
|
||||||
return llvm::size(g_register_infos_arm64_le);
|
return llvm::array_lengthof(g_register_infos_arm64_le);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RegisterInfo *
|
const RegisterInfo *
|
||||||
|
@ -107,7 +107,7 @@ RegisterContextWindows_arm64::GetRegisterInfoAtIndex(size_t reg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t RegisterContextWindows_arm64::GetRegisterSetCount() {
|
size_t RegisterContextWindows_arm64::GetRegisterSetCount() {
|
||||||
return llvm::size(g_register_sets);
|
return llvm::array_lengthof(g_register_sets);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RegisterSet *
|
const RegisterSet *
|
||||||
|
|
|
@ -212,7 +212,7 @@ RegisterInfo g_register_infos[] = {
|
||||||
{DEFINE_FPU_XMM(xmm15)}
|
{DEFINE_FPU_XMM(xmm15)}
|
||||||
};
|
};
|
||||||
|
|
||||||
static size_t k_num_register_infos = llvm::size(g_register_infos);
|
static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
// Array of lldb register numbers used to define the set of all General Purpose
|
// Array of lldb register numbers used to define the set of all General Purpose
|
||||||
// Registers
|
// Registers
|
||||||
|
@ -235,9 +235,9 @@ uint32_t g_fpu_reg_indices[] = {
|
||||||
|
|
||||||
RegisterSet g_register_sets[] = {
|
RegisterSet g_register_sets[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_reg_indices), g_gpr_reg_indices},
|
llvm::array_lengthof(g_gpr_reg_indices), g_gpr_reg_indices},
|
||||||
{"Floating Point Registers", "fpu",
|
{"Floating Point Registers", "fpu",
|
||||||
llvm::size(g_fpu_reg_indices), g_fpu_reg_indices}};
|
llvm::array_lengthof(g_fpu_reg_indices), g_fpu_reg_indices}};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructors and Destructors
|
// Constructors and Destructors
|
||||||
|
@ -248,7 +248,7 @@ RegisterContextWindows_x64::RegisterContextWindows_x64(
|
||||||
RegisterContextWindows_x64::~RegisterContextWindows_x64() {}
|
RegisterContextWindows_x64::~RegisterContextWindows_x64() {}
|
||||||
|
|
||||||
size_t RegisterContextWindows_x64::GetRegisterCount() {
|
size_t RegisterContextWindows_x64::GetRegisterCount() {
|
||||||
return llvm::size(g_register_infos);
|
return llvm::array_lengthof(g_register_infos);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RegisterInfo *
|
const RegisterInfo *
|
||||||
|
@ -259,7 +259,7 @@ RegisterContextWindows_x64::GetRegisterInfoAtIndex(size_t reg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t RegisterContextWindows_x64::GetRegisterSetCount() {
|
size_t RegisterContextWindows_x64::GetRegisterSetCount() {
|
||||||
return llvm::size(g_register_sets);
|
return llvm::array_lengthof(g_register_sets);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RegisterSet *RegisterContextWindows_x64::GetRegisterSet(size_t reg_set) {
|
const RegisterSet *RegisterContextWindows_x64::GetRegisterSet(size_t reg_set) {
|
||||||
|
|
|
@ -118,7 +118,7 @@ RegisterInfo g_register_infos[] = {
|
||||||
nullptr,
|
nullptr,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
static size_t k_num_register_infos = llvm::size(g_register_infos);
|
static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
|
||||||
|
|
||||||
// Array of lldb register numbers used to define the set of all General Purpose
|
// Array of lldb register numbers used to define the set of all General Purpose
|
||||||
// Registers
|
// Registers
|
||||||
|
@ -130,7 +130,7 @@ uint32_t g_gpr_reg_indices[] = {eRegisterIndexEax, eRegisterIndexEbx,
|
||||||
|
|
||||||
RegisterSet g_register_sets[] = {
|
RegisterSet g_register_sets[] = {
|
||||||
{"General Purpose Registers", "gpr",
|
{"General Purpose Registers", "gpr",
|
||||||
llvm::size(g_gpr_reg_indices), g_gpr_reg_indices},
|
llvm::array_lengthof(g_gpr_reg_indices), g_gpr_reg_indices},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ RegisterContextWindows_x86::RegisterContextWindows_x86(
|
||||||
RegisterContextWindows_x86::~RegisterContextWindows_x86() {}
|
RegisterContextWindows_x86::~RegisterContextWindows_x86() {}
|
||||||
|
|
||||||
size_t RegisterContextWindows_x86::GetRegisterCount() {
|
size_t RegisterContextWindows_x86::GetRegisterCount() {
|
||||||
return llvm::size(g_register_infos);
|
return llvm::array_lengthof(g_register_infos);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RegisterInfo *
|
const RegisterInfo *
|
||||||
|
@ -153,7 +153,7 @@ RegisterContextWindows_x86::GetRegisterInfoAtIndex(size_t reg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t RegisterContextWindows_x86::GetRegisterSetCount() {
|
size_t RegisterContextWindows_x86::GetRegisterSetCount() {
|
||||||
return llvm::size(g_register_sets);
|
return llvm::array_lengthof(g_register_sets);
|
||||||
}
|
}
|
||||||
|
|
||||||
const RegisterSet *RegisterContextWindows_x86::GetRegisterSet(size_t reg_set) {
|
const RegisterSet *RegisterContextWindows_x86::GetRegisterSet(size_t reg_set) {
|
||||||
|
|
|
@ -336,7 +336,7 @@ static RegisterInfo g_reg_infos[] = {
|
||||||
DEF_Q(14),
|
DEF_Q(14),
|
||||||
DEF_Q(15)};
|
DEF_Q(15)};
|
||||||
|
|
||||||
constexpr size_t k_num_reg_infos = llvm::size(g_reg_infos);
|
constexpr size_t k_num_reg_infos = llvm::array_lengthof(g_reg_infos);
|
||||||
|
|
||||||
// ARM general purpose registers.
|
// ARM general purpose registers.
|
||||||
const uint32_t g_gpr_regnums[] = {
|
const uint32_t g_gpr_regnums[] = {
|
||||||
|
@ -445,26 +445,26 @@ const uint32_t g_fpu_regnums[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Skip the last LLDB_INVALID_REGNUM in each count below by subtracting 1
|
// Skip the last LLDB_INVALID_REGNUM in each count below by subtracting 1
|
||||||
constexpr size_t k_num_gpr_regs = llvm::size(g_gpr_regnums) - 1;
|
constexpr size_t k_num_gpr_regs = llvm::array_lengthof(g_gpr_regnums) - 1;
|
||||||
constexpr size_t k_num_fpu_regs = llvm::size(g_fpu_regnums) - 1;
|
constexpr size_t k_num_fpu_regs = llvm::array_lengthof(g_fpu_regnums) - 1;
|
||||||
|
|
||||||
static RegisterSet g_reg_sets[] = {
|
static RegisterSet g_reg_sets[] = {
|
||||||
{"General Purpose Registers", "gpr", k_num_gpr_regs, g_gpr_regnums},
|
{"General Purpose Registers", "gpr", k_num_gpr_regs, g_gpr_regnums},
|
||||||
{"Floating Point Registers", "fpu", k_num_fpu_regs, g_fpu_regnums},
|
{"Floating Point Registers", "fpu", k_num_fpu_regs, g_fpu_regnums},
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr size_t k_num_reg_sets = llvm::size(g_reg_sets);
|
constexpr size_t k_num_reg_sets = llvm::array_lengthof(g_reg_sets);
|
||||||
|
|
||||||
RegisterContextMinidump_ARM::RegisterContextMinidump_ARM(
|
RegisterContextMinidump_ARM::RegisterContextMinidump_ARM(
|
||||||
lldb_private::Thread &thread, const DataExtractor &data, bool apple)
|
lldb_private::Thread &thread, const DataExtractor &data, bool apple)
|
||||||
: RegisterContext(thread, 0), m_apple(apple) {
|
: RegisterContext(thread, 0), m_apple(apple) {
|
||||||
lldb::offset_t offset = 0;
|
lldb::offset_t offset = 0;
|
||||||
m_regs.context_flags = data.GetU32(&offset);
|
m_regs.context_flags = data.GetU32(&offset);
|
||||||
for (unsigned i = 0; i < llvm::size(m_regs.r); ++i)
|
for (unsigned i = 0; i < llvm::array_lengthof(m_regs.r); ++i)
|
||||||
m_regs.r[i] = data.GetU32(&offset);
|
m_regs.r[i] = data.GetU32(&offset);
|
||||||
m_regs.cpsr = data.GetU32(&offset);
|
m_regs.cpsr = data.GetU32(&offset);
|
||||||
m_regs.fpscr = data.GetU64(&offset);
|
m_regs.fpscr = data.GetU64(&offset);
|
||||||
for (unsigned i = 0; i < llvm::size(m_regs.d); ++i)
|
for (unsigned i = 0; i < llvm::array_lengthof(m_regs.d); ++i)
|
||||||
m_regs.d[i] = data.GetU64(&offset);
|
m_regs.d[i] = data.GetU64(&offset);
|
||||||
lldbassert(k_num_regs == k_num_reg_infos);
|
lldbassert(k_num_regs == k_num_reg_infos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -544,7 +544,7 @@ static RegisterInfo g_reg_infos[] = {
|
||||||
DEF_H(31),
|
DEF_H(31),
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr size_t k_num_reg_infos = llvm::size(g_reg_infos);
|
constexpr size_t k_num_reg_infos = llvm::array_lengthof(g_reg_infos);
|
||||||
|
|
||||||
// ARM64 general purpose registers.
|
// ARM64 general purpose registers.
|
||||||
const uint32_t g_gpr_regnums[] = {
|
const uint32_t g_gpr_regnums[] = {
|
||||||
|
@ -751,15 +751,15 @@ const uint32_t g_fpu_regnums[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Skip the last LLDB_INVALID_REGNUM in each count below by subtracting 1
|
// Skip the last LLDB_INVALID_REGNUM in each count below by subtracting 1
|
||||||
constexpr size_t k_num_gpr_regs = llvm::size(g_gpr_regnums) - 1;
|
constexpr size_t k_num_gpr_regs = llvm::array_lengthof(g_gpr_regnums) - 1;
|
||||||
constexpr size_t k_num_fpu_regs = llvm::size(g_fpu_regnums) - 1;
|
constexpr size_t k_num_fpu_regs = llvm::array_lengthof(g_fpu_regnums) - 1;
|
||||||
|
|
||||||
static RegisterSet g_reg_sets[] = {
|
static RegisterSet g_reg_sets[] = {
|
||||||
{"General Purpose Registers", "gpr", k_num_gpr_regs, g_gpr_regnums},
|
{"General Purpose Registers", "gpr", k_num_gpr_regs, g_gpr_regnums},
|
||||||
{"Floating Point Registers", "fpu", k_num_fpu_regs, g_fpu_regnums},
|
{"Floating Point Registers", "fpu", k_num_fpu_regs, g_fpu_regnums},
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr size_t k_num_reg_sets = llvm::size(g_reg_sets);
|
constexpr size_t k_num_reg_sets = llvm::array_lengthof(g_reg_sets);
|
||||||
|
|
||||||
RegisterContextMinidump_ARM64::RegisterContextMinidump_ARM64(
|
RegisterContextMinidump_ARM64::RegisterContextMinidump_ARM64(
|
||||||
lldb_private::Thread &thread, const DataExtractor &data)
|
lldb_private::Thread &thread, const DataExtractor &data)
|
||||||
|
|
|
@ -254,12 +254,12 @@ struct ArchDefinition {
|
||||||
};
|
};
|
||||||
|
|
||||||
void ArchSpec::ListSupportedArchNames(StringList &list) {
|
void ArchSpec::ListSupportedArchNames(StringList &list) {
|
||||||
for (uint32_t i = 0; i < llvm::size(g_core_definitions); ++i)
|
for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i)
|
||||||
list.AppendString(g_core_definitions[i].name);
|
list.AppendString(g_core_definitions[i].name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArchSpec::AutoComplete(CompletionRequest &request) {
|
void ArchSpec::AutoComplete(CompletionRequest &request) {
|
||||||
for (uint32_t i = 0; i < llvm::size(g_core_definitions); ++i)
|
for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i)
|
||||||
request.TryCompleteCurrentArg(g_core_definitions[i].name);
|
request.TryCompleteCurrentArg(g_core_definitions[i].name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ static const ArchDefinitionEntry g_macho_arch_entries[] = {
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
static const ArchDefinition g_macho_arch_def = {
|
static const ArchDefinition g_macho_arch_def = {
|
||||||
eArchTypeMachO, llvm::size(g_macho_arch_entries),
|
eArchTypeMachO, llvm::array_lengthof(g_macho_arch_entries),
|
||||||
g_macho_arch_entries, "mach-o"};
|
g_macho_arch_entries, "mach-o"};
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -409,7 +409,7 @@ static const ArchDefinitionEntry g_elf_arch_entries[] = {
|
||||||
|
|
||||||
static const ArchDefinition g_elf_arch_def = {
|
static const ArchDefinition g_elf_arch_def = {
|
||||||
eArchTypeELF,
|
eArchTypeELF,
|
||||||
llvm::size(g_elf_arch_entries),
|
llvm::array_lengthof(g_elf_arch_entries),
|
||||||
g_elf_arch_entries,
|
g_elf_arch_entries,
|
||||||
"elf",
|
"elf",
|
||||||
};
|
};
|
||||||
|
@ -435,7 +435,7 @@ static const ArchDefinitionEntry g_coff_arch_entries[] = {
|
||||||
|
|
||||||
static const ArchDefinition g_coff_arch_def = {
|
static const ArchDefinition g_coff_arch_def = {
|
||||||
eArchTypeCOFF,
|
eArchTypeCOFF,
|
||||||
llvm::size(g_coff_arch_entries),
|
llvm::array_lengthof(g_coff_arch_entries),
|
||||||
g_coff_arch_entries,
|
g_coff_arch_entries,
|
||||||
"pe-coff",
|
"pe-coff",
|
||||||
};
|
};
|
||||||
|
@ -446,7 +446,7 @@ static const ArchDefinition *g_arch_definitions[] = {
|
||||||
&g_macho_arch_def, &g_elf_arch_def, &g_coff_arch_def};
|
&g_macho_arch_def, &g_elf_arch_def, &g_coff_arch_def};
|
||||||
|
|
||||||
static const size_t k_num_arch_definitions =
|
static const size_t k_num_arch_definitions =
|
||||||
llvm::size(g_arch_definitions);
|
llvm::array_lengthof(g_arch_definitions);
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Static helper functions.
|
// Static helper functions.
|
||||||
|
@ -463,7 +463,7 @@ static const ArchDefinition *FindArchDefinition(ArchitectureType arch_type) {
|
||||||
|
|
||||||
// Get an architecture definition by name.
|
// Get an architecture definition by name.
|
||||||
static const CoreDefinition *FindCoreDefinition(llvm::StringRef name) {
|
static const CoreDefinition *FindCoreDefinition(llvm::StringRef name) {
|
||||||
for (unsigned int i = 0; i < llvm::size(g_core_definitions); ++i) {
|
for (unsigned int i = 0; i < llvm::array_lengthof(g_core_definitions); ++i) {
|
||||||
if (name.equals_insensitive(g_core_definitions[i].name))
|
if (name.equals_insensitive(g_core_definitions[i].name))
|
||||||
return &g_core_definitions[i];
|
return &g_core_definitions[i];
|
||||||
}
|
}
|
||||||
|
@ -471,7 +471,7 @@ static const CoreDefinition *FindCoreDefinition(llvm::StringRef name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline const CoreDefinition *FindCoreDefinition(ArchSpec::Core core) {
|
static inline const CoreDefinition *FindCoreDefinition(ArchSpec::Core core) {
|
||||||
if (core < llvm::size(g_core_definitions))
|
if (core < llvm::array_lengthof(g_core_definitions))
|
||||||
return &g_core_definitions[core];
|
return &g_core_definitions[core];
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ TEST(StatusTest, ErrorWin32) {
|
||||||
EXPECT_TRUE(success.Success());
|
EXPECT_TRUE(success.Success());
|
||||||
|
|
||||||
WCHAR name[128]{};
|
WCHAR name[128]{};
|
||||||
ULONG nameLen = llvm::size(name);
|
ULONG nameLen = llvm::array_lengthof(name);
|
||||||
ULONG langs = 0;
|
ULONG langs = 0;
|
||||||
GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &langs,
|
GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &langs,
|
||||||
reinterpret_cast<PZZWSTR>(&name), &nameLen);
|
reinterpret_cast<PZZWSTR>(&name), &nameLen);
|
||||||
|
|
|
@ -1430,6 +1430,12 @@ void shuffle(Iterator first, Iterator last, RNG &&g) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Find the length of an array.
|
||||||
|
template <class T, std::size_t N>
|
||||||
|
constexpr inline size_t array_lengthof(T (&)[N]) {
|
||||||
|
return N;
|
||||||
|
}
|
||||||
|
|
||||||
/// Adapt std::less<T> for array_pod_sort.
|
/// Adapt std::less<T> for array_pod_sort.
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline int array_pod_sort_comparator(const void *P1, const void *P2) {
|
inline int array_pod_sort_comparator(const void *P1, const void *P2) {
|
||||||
|
|
|
@ -63,16 +63,6 @@ struct in_place_index_t // NOLINT(readability-identifier-naming)
|
||||||
explicit in_place_index_t() = default;
|
explicit in_place_index_t() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class C>
|
|
||||||
constexpr auto size(const C& c) -> decltype(c.size()) { // NOLINT(readability-identifier-naming)
|
|
||||||
return c.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T, std::size_t N>
|
|
||||||
constexpr std::size_t size(const T (&array)[N]) noexcept { // NOLINT(readability-identifier-naming)
|
|
||||||
return N;
|
|
||||||
}
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Features from C++20
|
// Features from C++20
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
|
@ -924,7 +924,7 @@ public:
|
||||||
/// promotions or expansions.
|
/// promotions or expansions.
|
||||||
bool isTypeLegal(EVT VT) const {
|
bool isTypeLegal(EVT VT) const {
|
||||||
assert(!VT.isSimple() ||
|
assert(!VT.isSimple() ||
|
||||||
(unsigned)VT.getSimpleVT().SimpleTy < size(RegClassForVT));
|
(unsigned)VT.getSimpleVT().SimpleTy < array_lengthof(RegClassForVT));
|
||||||
return VT.isSimple() && RegClassForVT[VT.getSimpleVT().SimpleTy] != nullptr;
|
return VT.isSimple() && RegClassForVT[VT.getSimpleVT().SimpleTy] != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1078,7 +1078,7 @@ public:
|
||||||
if (VT.isExtended()) return Expand;
|
if (VT.isExtended()) return Expand;
|
||||||
// If a target-specific SDNode requires legalization, require the target
|
// If a target-specific SDNode requires legalization, require the target
|
||||||
// to provide custom legalization for it.
|
// to provide custom legalization for it.
|
||||||
if (Op >= size(OpActions[0])) return Custom;
|
if (Op >= array_lengthof(OpActions[0])) return Custom;
|
||||||
return OpActions[(unsigned)VT.getSimpleVT().SimpleTy][Op];
|
return OpActions[(unsigned)VT.getSimpleVT().SimpleTy][Op];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1379,8 +1379,8 @@ public:
|
||||||
/// expander for it.
|
/// expander for it.
|
||||||
LegalizeAction
|
LegalizeAction
|
||||||
getCondCodeAction(ISD::CondCode CC, MVT VT) const {
|
getCondCodeAction(ISD::CondCode CC, MVT VT) const {
|
||||||
assert((unsigned)CC < size(CondCodeActions) &&
|
assert((unsigned)CC < array_lengthof(CondCodeActions) &&
|
||||||
((unsigned)VT.SimpleTy >> 3) < size(CondCodeActions[0]) &&
|
((unsigned)VT.SimpleTy >> 3) < array_lengthof(CondCodeActions[0]) &&
|
||||||
"Table isn't big enough!");
|
"Table isn't big enough!");
|
||||||
// See setCondCodeAction for how this is encoded.
|
// See setCondCodeAction for how this is encoded.
|
||||||
uint32_t Shift = 4 * (VT.SimpleTy & 0x7);
|
uint32_t Shift = 4 * (VT.SimpleTy & 0x7);
|
||||||
|
@ -1488,7 +1488,7 @@ public:
|
||||||
|
|
||||||
/// Return the type of registers that this ValueType will eventually require.
|
/// Return the type of registers that this ValueType will eventually require.
|
||||||
MVT getRegisterType(MVT VT) const {
|
MVT getRegisterType(MVT VT) const {
|
||||||
assert((unsigned)VT.SimpleTy < size(RegisterTypeForVT));
|
assert((unsigned)VT.SimpleTy < array_lengthof(RegisterTypeForVT));
|
||||||
return RegisterTypeForVT[VT.SimpleTy];
|
return RegisterTypeForVT[VT.SimpleTy];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1496,7 +1496,7 @@ public:
|
||||||
MVT getRegisterType(LLVMContext &Context, EVT VT) const {
|
MVT getRegisterType(LLVMContext &Context, EVT VT) const {
|
||||||
if (VT.isSimple()) {
|
if (VT.isSimple()) {
|
||||||
assert((unsigned)VT.getSimpleVT().SimpleTy <
|
assert((unsigned)VT.getSimpleVT().SimpleTy <
|
||||||
size(RegisterTypeForVT));
|
array_lengthof(RegisterTypeForVT));
|
||||||
return RegisterTypeForVT[VT.getSimpleVT().SimpleTy];
|
return RegisterTypeForVT[VT.getSimpleVT().SimpleTy];
|
||||||
}
|
}
|
||||||
if (VT.isVector()) {
|
if (VT.isVector()) {
|
||||||
|
@ -1529,7 +1529,7 @@ public:
|
||||||
Optional<MVT> RegisterVT = None) const {
|
Optional<MVT> RegisterVT = None) const {
|
||||||
if (VT.isSimple()) {
|
if (VT.isSimple()) {
|
||||||
assert((unsigned)VT.getSimpleVT().SimpleTy <
|
assert((unsigned)VT.getSimpleVT().SimpleTy <
|
||||||
size(NumRegistersForVT));
|
array_lengthof(NumRegistersForVT));
|
||||||
return NumRegistersForVT[VT.getSimpleVT().SimpleTy];
|
return NumRegistersForVT[VT.getSimpleVT().SimpleTy];
|
||||||
}
|
}
|
||||||
if (VT.isVector()) {
|
if (VT.isVector()) {
|
||||||
|
@ -1597,7 +1597,7 @@ public:
|
||||||
/// If true, the target has custom DAG combine transformations that it can
|
/// If true, the target has custom DAG combine transformations that it can
|
||||||
/// perform for the specified node.
|
/// perform for the specified node.
|
||||||
bool hasTargetDAGCombine(ISD::NodeType NT) const {
|
bool hasTargetDAGCombine(ISD::NodeType NT) const {
|
||||||
assert(unsigned(NT >> 3) < size(TargetDAGCombineArray));
|
assert(unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray));
|
||||||
return TargetDAGCombineArray[NT >> 3] & (1 << (NT&7));
|
return TargetDAGCombineArray[NT >> 3] & (1 << (NT&7));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2212,7 +2212,7 @@ protected:
|
||||||
/// specified value type. This indicates the selector can handle values of
|
/// specified value type. This indicates the selector can handle values of
|
||||||
/// that class natively.
|
/// that class natively.
|
||||||
void addRegisterClass(MVT VT, const TargetRegisterClass *RC) {
|
void addRegisterClass(MVT VT, const TargetRegisterClass *RC) {
|
||||||
assert((unsigned)VT.SimpleTy < size(RegClassForVT));
|
assert((unsigned)VT.SimpleTy < array_lengthof(RegClassForVT));
|
||||||
RegClassForVT[VT.SimpleTy] = RC;
|
RegClassForVT[VT.SimpleTy] = RC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2229,7 +2229,7 @@ protected:
|
||||||
/// type and indicate what to do about it. Note that VT may refer to either
|
/// type and indicate what to do about it. Note that VT may refer to either
|
||||||
/// the type of a result or that of an operand of Op.
|
/// the type of a result or that of an operand of Op.
|
||||||
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action) {
|
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action) {
|
||||||
assert(Op < size(OpActions[0]) && "Table isn't big enough!");
|
assert(Op < array_lengthof(OpActions[0]) && "Table isn't big enough!");
|
||||||
OpActions[(unsigned)VT.SimpleTy][Op] = Action;
|
OpActions[(unsigned)VT.SimpleTy][Op] = Action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2294,7 +2294,7 @@ protected:
|
||||||
/// target and indicate what to do about it.
|
/// target and indicate what to do about it.
|
||||||
void setCondCodeAction(ISD::CondCode CC, MVT VT,
|
void setCondCodeAction(ISD::CondCode CC, MVT VT,
|
||||||
LegalizeAction Action) {
|
LegalizeAction Action) {
|
||||||
assert(VT.isValid() && (unsigned)CC < size(CondCodeActions) &&
|
assert(VT.isValid() && (unsigned)CC < array_lengthof(CondCodeActions) &&
|
||||||
"Table isn't big enough!");
|
"Table isn't big enough!");
|
||||||
assert((unsigned)Action < 0x10 && "too many bits for bitfield array");
|
assert((unsigned)Action < 0x10 && "too many bits for bitfield array");
|
||||||
/// The lower 3 bits of the SimpleTy index into Nth 4bit set from the 32-bit
|
/// The lower 3 bits of the SimpleTy index into Nth 4bit set from the 32-bit
|
||||||
|
@ -2324,7 +2324,7 @@ protected:
|
||||||
/// they want to provide a custom DAG combiner for by implementing the
|
/// they want to provide a custom DAG combiner for by implementing the
|
||||||
/// PerformDAGCombine virtual method.
|
/// PerformDAGCombine virtual method.
|
||||||
void setTargetDAGCombine(ISD::NodeType NT) {
|
void setTargetDAGCombine(ISD::NodeType NT) {
|
||||||
assert(unsigned(NT >> 3) < size(TargetDAGCombineArray));
|
assert(unsigned(NT >> 3) < array_lengthof(TargetDAGCombineArray));
|
||||||
TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7);
|
TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr FeatureBitset &operator^=(const FeatureBitset &RHS) {
|
constexpr FeatureBitset &operator^=(const FeatureBitset &RHS) {
|
||||||
for (unsigned I = 0, E = llvm::size(Bits); I != E; ++I) {
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I) {
|
||||||
Bits[I] ^= RHS.Bits[I];
|
Bits[I] ^= RHS.Bits[I];
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -116,7 +116,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr FeatureBitset &operator&=(const FeatureBitset &RHS) {
|
constexpr FeatureBitset &operator&=(const FeatureBitset &RHS) {
|
||||||
for (unsigned I = 0, E = llvm::size(Bits); I != E; ++I) {
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I) {
|
||||||
Bits[I] &= RHS.Bits[I];
|
Bits[I] &= RHS.Bits[I];
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -128,7 +128,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr FeatureBitset &operator|=(const FeatureBitset &RHS) {
|
constexpr FeatureBitset &operator|=(const FeatureBitset &RHS) {
|
||||||
for (unsigned I = 0, E = llvm::size(Bits); I != E; ++I) {
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I) {
|
||||||
Bits[I] |= RHS.Bits[I];
|
Bits[I] |= RHS.Bits[I];
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -4329,7 +4329,7 @@ LegalizerHelper::LegalizeResult LegalizerHelper::fewerElementsVectorShuffle(
|
||||||
// The input vector this mask element indexes into.
|
// The input vector this mask element indexes into.
|
||||||
unsigned Input = (unsigned)Idx / NewElts;
|
unsigned Input = (unsigned)Idx / NewElts;
|
||||||
|
|
||||||
if (Input >= size(Inputs)) {
|
if (Input >= array_lengthof(Inputs)) {
|
||||||
// The mask element does not index into any input vector.
|
// The mask element does not index into any input vector.
|
||||||
Ops.push_back(-1);
|
Ops.push_back(-1);
|
||||||
continue;
|
continue;
|
||||||
|
@ -4340,7 +4340,7 @@ LegalizerHelper::LegalizeResult LegalizerHelper::fewerElementsVectorShuffle(
|
||||||
|
|
||||||
// Find or create a shuffle vector operand to hold this input.
|
// Find or create a shuffle vector operand to hold this input.
|
||||||
unsigned OpNo;
|
unsigned OpNo;
|
||||||
for (OpNo = 0; OpNo < size(InputUsed); ++OpNo) {
|
for (OpNo = 0; OpNo < array_lengthof(InputUsed); ++OpNo) {
|
||||||
if (InputUsed[OpNo] == Input) {
|
if (InputUsed[OpNo] == Input) {
|
||||||
// This input vector is already an operand.
|
// This input vector is already an operand.
|
||||||
break;
|
break;
|
||||||
|
@ -4351,7 +4351,7 @@ LegalizerHelper::LegalizeResult LegalizerHelper::fewerElementsVectorShuffle(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OpNo >= size(InputUsed)) {
|
if (OpNo >= array_lengthof(InputUsed)) {
|
||||||
// More than two input vectors used! Give up on trying to create a
|
// More than two input vectors used! Give up on trying to create a
|
||||||
// shuffle vector. Insert all elements into a BUILD_VECTOR instead.
|
// shuffle vector. Insert all elements into a BUILD_VECTOR instead.
|
||||||
UseBuildVector = true;
|
UseBuildVector = true;
|
||||||
|
@ -4374,7 +4374,7 @@ LegalizerHelper::LegalizeResult LegalizerHelper::fewerElementsVectorShuffle(
|
||||||
// The input vector this mask element indexes into.
|
// The input vector this mask element indexes into.
|
||||||
unsigned Input = (unsigned)Idx / NewElts;
|
unsigned Input = (unsigned)Idx / NewElts;
|
||||||
|
|
||||||
if (Input >= size(Inputs)) {
|
if (Input >= array_lengthof(Inputs)) {
|
||||||
// The mask element is "undef" or indexes off the end of the input.
|
// The mask element is "undef" or indexes off the end of the input.
|
||||||
SVOps.push_back(MIRBuilder.buildUndef(EltTy).getReg(0));
|
SVOps.push_back(MIRBuilder.buildUndef(EltTy).getReg(0));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -2153,7 +2153,7 @@ void DAGTypeLegalizer::SplitVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode *N,
|
||||||
// The input vector this mask element indexes into.
|
// The input vector this mask element indexes into.
|
||||||
unsigned Input = (unsigned)Idx / NewElts;
|
unsigned Input = (unsigned)Idx / NewElts;
|
||||||
|
|
||||||
if (Input >= size(Inputs)) {
|
if (Input >= array_lengthof(Inputs)) {
|
||||||
// The mask element does not index into any input vector.
|
// The mask element does not index into any input vector.
|
||||||
Ops.push_back(-1);
|
Ops.push_back(-1);
|
||||||
continue;
|
continue;
|
||||||
|
@ -2164,7 +2164,7 @@ void DAGTypeLegalizer::SplitVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode *N,
|
||||||
|
|
||||||
// Find or create a shuffle vector operand to hold this input.
|
// Find or create a shuffle vector operand to hold this input.
|
||||||
unsigned OpNo;
|
unsigned OpNo;
|
||||||
for (OpNo = 0; OpNo < size(InputUsed); ++OpNo) {
|
for (OpNo = 0; OpNo < array_lengthof(InputUsed); ++OpNo) {
|
||||||
if (InputUsed[OpNo] == Input) {
|
if (InputUsed[OpNo] == Input) {
|
||||||
// This input vector is already an operand.
|
// This input vector is already an operand.
|
||||||
break;
|
break;
|
||||||
|
@ -2175,7 +2175,7 @@ void DAGTypeLegalizer::SplitVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode *N,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OpNo >= size(InputUsed)) {
|
if (OpNo >= array_lengthof(InputUsed)) {
|
||||||
// More than two input vectors used! Give up on trying to create a
|
// More than two input vectors used! Give up on trying to create a
|
||||||
// shuffle vector. Insert all elements into a BUILD_VECTOR instead.
|
// shuffle vector. Insert all elements into a BUILD_VECTOR instead.
|
||||||
useBuildVector = true;
|
useBuildVector = true;
|
||||||
|
@ -2198,7 +2198,7 @@ void DAGTypeLegalizer::SplitVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode *N,
|
||||||
// The input vector this mask element indexes into.
|
// The input vector this mask element indexes into.
|
||||||
unsigned Input = (unsigned)Idx / NewElts;
|
unsigned Input = (unsigned)Idx / NewElts;
|
||||||
|
|
||||||
if (Input >= size(Inputs)) {
|
if (Input >= array_lengthof(Inputs)) {
|
||||||
// The mask element is "undef" or indexes off the end of the input.
|
// The mask element is "undef" or indexes off the end of the input.
|
||||||
SVOps.push_back(DAG.getUNDEF(EltVT));
|
SVOps.push_back(DAG.getUNDEF(EltVT));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -966,7 +966,7 @@ TargetLoweringBase::getTypeConversion(LLVMContext &Context, EVT VT) const {
|
||||||
// If this is a simple type, use the ComputeRegisterProp mechanism.
|
// If this is a simple type, use the ComputeRegisterProp mechanism.
|
||||||
if (VT.isSimple()) {
|
if (VT.isSimple()) {
|
||||||
MVT SVT = VT.getSimpleVT();
|
MVT SVT = VT.getSimpleVT();
|
||||||
assert((unsigned)SVT.SimpleTy < size(TransformToType));
|
assert((unsigned)SVT.SimpleTy < array_lengthof(TransformToType));
|
||||||
MVT NVT = TransformToType[SVT.SimpleTy];
|
MVT NVT = TransformToType[SVT.SimpleTy];
|
||||||
LegalizeTypeAction LA = ValueTypeActions.getTypeAction(SVT);
|
LegalizeTypeAction LA = ValueTypeActions.getTypeAction(SVT);
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,7 @@ void writeIndexTable(
|
||||||
const MapVector<uint64_t, UnitIndexEntry> &IndexEntries,
|
const MapVector<uint64_t, UnitIndexEntry> &IndexEntries,
|
||||||
uint32_t DWARFUnitIndex::Entry::SectionContribution::*Field) {
|
uint32_t DWARFUnitIndex::Entry::SectionContribution::*Field) {
|
||||||
for (const auto &E : IndexEntries)
|
for (const auto &E : IndexEntries)
|
||||||
for (size_t I = 0; I != size(E.second.Contributions); ++I)
|
for (size_t I = 0; I != array_lengthof(E.second.Contributions); ++I)
|
||||||
if (ContributionOffsets[I])
|
if (ContributionOffsets[I])
|
||||||
Out.emitIntValue(E.second.Contributions[I].*Field, 4);
|
Out.emitIntValue(E.second.Contributions[I].*Field, 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -326,14 +326,14 @@ void GenericDINode::recalculateHash() {
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
#define DEFINE_GETIMPL_STORE(CLASS, ARGS, OPS) \
|
#define DEFINE_GETIMPL_STORE(CLASS, ARGS, OPS) \
|
||||||
return storeImpl(new (size(OPS)) \
|
return storeImpl(new (array_lengthof(OPS)) \
|
||||||
CLASS(Context, Storage, UNWRAP_ARGS(ARGS), OPS), \
|
CLASS(Context, Storage, UNWRAP_ARGS(ARGS), OPS), \
|
||||||
Storage, Context.pImpl->CLASS##s)
|
Storage, Context.pImpl->CLASS##s)
|
||||||
#define DEFINE_GETIMPL_STORE_NO_OPS(CLASS, ARGS) \
|
#define DEFINE_GETIMPL_STORE_NO_OPS(CLASS, ARGS) \
|
||||||
return storeImpl(new (0u) CLASS(Context, Storage, UNWRAP_ARGS(ARGS)), \
|
return storeImpl(new (0u) CLASS(Context, Storage, UNWRAP_ARGS(ARGS)), \
|
||||||
Storage, Context.pImpl->CLASS##s)
|
Storage, Context.pImpl->CLASS##s)
|
||||||
#define DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS(CLASS, OPS) \
|
#define DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS(CLASS, OPS) \
|
||||||
return storeImpl(new (size(OPS)) CLASS(Context, Storage, OPS), \
|
return storeImpl(new (array_lengthof(OPS)) CLASS(Context, Storage, OPS), \
|
||||||
Storage, Context.pImpl->CLASS##s)
|
Storage, Context.pImpl->CLASS##s)
|
||||||
#define DEFINE_GETIMPL_STORE_N(CLASS, ARGS, OPS, NUM_OPS) \
|
#define DEFINE_GETIMPL_STORE_N(CLASS, ARGS, OPS, NUM_OPS) \
|
||||||
return storeImpl(new (NUM_OPS) \
|
return storeImpl(new (NUM_OPS) \
|
||||||
|
@ -772,7 +772,7 @@ DICompileUnit *DICompileUnit::getImpl(
|
||||||
Macros,
|
Macros,
|
||||||
SysRoot,
|
SysRoot,
|
||||||
SDK};
|
SDK};
|
||||||
return storeImpl(new (size(Ops)) DICompileUnit(
|
return storeImpl(new (array_lengthof(Ops)) DICompileUnit(
|
||||||
Context, Storage, SourceLanguage, IsOptimized,
|
Context, Storage, SourceLanguage, IsOptimized,
|
||||||
RuntimeVersion, EmissionKind, DWOId, SplitDebugInlining,
|
RuntimeVersion, EmissionKind, DWOId, SplitDebugInlining,
|
||||||
DebugInfoForProfiling, NameTableKind, RangesBaseAddress,
|
DebugInfoForProfiling, NameTableKind, RangesBaseAddress,
|
||||||
|
|
|
@ -97,7 +97,7 @@ const MCFixupKindInfo &MCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
|
||||||
{"FK_SecRel_8", 0, 64, 0},
|
{"FK_SecRel_8", 0, 64, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
assert((size_t)Kind <= size(Builtins) && "Unknown fixup kind");
|
assert((size_t)Kind <= array_lengthof(Builtins) && "Unknown fixup kind");
|
||||||
return Builtins[Kind];
|
return Builtins[Kind];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
|
||||||
0, // length of DW_LNS_set_epilogue_begin
|
0, // length of DW_LNS_set_epilogue_begin
|
||||||
1 // DW_LNS_set_isa
|
1 // DW_LNS_set_isa
|
||||||
};
|
};
|
||||||
assert(size(StandardOpcodeLengths) >=
|
assert(array_lengthof(StandardOpcodeLengths) >=
|
||||||
(Params.DWARF2LineOpcodeBase - 1U));
|
(Params.DWARF2LineOpcodeBase - 1U));
|
||||||
return Emit(
|
return Emit(
|
||||||
MCOS, Params,
|
MCOS, Params,
|
||||||
|
|
|
@ -2288,7 +2288,7 @@ void MachOObjectFile::getRelocationTypeName(
|
||||||
"ARM64_RELOC_ADDEND"
|
"ARM64_RELOC_ADDEND"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (RType >= size(Table))
|
if (RType >= array_lengthof(Table))
|
||||||
res = "Unknown";
|
res = "Unknown";
|
||||||
else
|
else
|
||||||
res = Table[RType];
|
res = Table[RType];
|
||||||
|
|
|
@ -211,7 +211,7 @@ Error ARMAttributeParser::ABI_align_needed(AttrType tag) {
|
||||||
uint64_t value = de.getULEB128(cursor);
|
uint64_t value = de.getULEB128(cursor);
|
||||||
|
|
||||||
std::string description;
|
std::string description;
|
||||||
if (value < size(strings))
|
if (value < array_lengthof(strings))
|
||||||
description = strings[value];
|
description = strings[value];
|
||||||
else if (value <= 12)
|
else if (value <= 12)
|
||||||
description = "8-byte alignment, " + utostr(1ULL << value) +
|
description = "8-byte alignment, " + utostr(1ULL << value) +
|
||||||
|
@ -230,7 +230,7 @@ Error ARMAttributeParser::ABI_align_preserved(AttrType tag) {
|
||||||
uint64_t value = de.getULEB128(cursor);
|
uint64_t value = de.getULEB128(cursor);
|
||||||
|
|
||||||
std::string description;
|
std::string description;
|
||||||
if (value < size(strings))
|
if (value < array_lengthof(strings))
|
||||||
description = std::string(strings[value]);
|
description = std::string(strings[value]);
|
||||||
else if (value <= 12)
|
else if (value <= 12)
|
||||||
description = std::string("8-byte stack alignment, ") +
|
description = std::string("8-byte stack alignment, ") +
|
||||||
|
@ -382,7 +382,7 @@ Error ARMAttributeParser::nodefaults(AttrType tag) {
|
||||||
|
|
||||||
Error ARMAttributeParser::handler(uint64_t tag, bool &handled) {
|
Error ARMAttributeParser::handler(uint64_t tag, bool &handled) {
|
||||||
handled = false;
|
handled = false;
|
||||||
for (unsigned AHI = 0, AHE = size(displayRoutines); AHI != AHE;
|
for (unsigned AHI = 0, AHE = array_lengthof(displayRoutines); AHI != AHE;
|
||||||
++AHI) {
|
++AHI) {
|
||||||
if (uint64_t(displayRoutines[AHI].attribute) == tag) {
|
if (uint64_t(displayRoutines[AHI].attribute) == tag) {
|
||||||
if (Error e =
|
if (Error e =
|
||||||
|
|
|
@ -348,7 +348,7 @@ static void uninstallExceptionOrSignalHandlers() {
|
||||||
|
|
||||||
static const int Signals[] =
|
static const int Signals[] =
|
||||||
{ SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP };
|
{ SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGTRAP };
|
||||||
static const unsigned NumSignals = size(Signals);
|
static const unsigned NumSignals = array_lengthof(Signals);
|
||||||
static struct sigaction PrevActions[NumSignals];
|
static struct sigaction PrevActions[NumSignals];
|
||||||
|
|
||||||
static void CrashRecoverySignalHandler(int Signal) {
|
static void CrashRecoverySignalHandler(int Signal) {
|
||||||
|
|
|
@ -145,7 +145,7 @@ void llvm::write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
|
||||||
std::max(static_cast<unsigned>(W), std::max(1u, Nibbles) + PrefixChars);
|
std::max(static_cast<unsigned>(W), std::max(1u, Nibbles) + PrefixChars);
|
||||||
|
|
||||||
char NumberBuffer[kMaxWidth];
|
char NumberBuffer[kMaxWidth];
|
||||||
::memset(NumberBuffer, '0', llvm::size(NumberBuffer));
|
::memset(NumberBuffer, '0', llvm::array_lengthof(NumberBuffer));
|
||||||
if (Prefix)
|
if (Prefix)
|
||||||
NumberBuffer[1] = 'x';
|
NumberBuffer[1] = 'x';
|
||||||
char *EndPtr = NumberBuffer + NumChars;
|
char *EndPtr = NumberBuffer + NumChars;
|
||||||
|
|
|
@ -53,7 +53,7 @@ Error RISCVAttributeParser::stackAlign(unsigned tag) {
|
||||||
|
|
||||||
Error RISCVAttributeParser::handler(uint64_t tag, bool &handled) {
|
Error RISCVAttributeParser::handler(uint64_t tag, bool &handled) {
|
||||||
handled = false;
|
handled = false;
|
||||||
for (unsigned AHI = 0, AHE = size(displayRoutines); AHI != AHE;
|
for (unsigned AHI = 0, AHE = array_lengthof(displayRoutines); AHI != AHE;
|
||||||
++AHI) {
|
++AHI) {
|
||||||
if (uint64_t(displayRoutines[AHI].attribute) == tag) {
|
if (uint64_t(displayRoutines[AHI].attribute) == tag) {
|
||||||
if (Error e = (this->*displayRoutines[AHI].routine)(tag))
|
if (Error e = (this->*displayRoutines[AHI].routine)(tag))
|
||||||
|
|
|
@ -898,13 +898,13 @@ std::string Triple::normalize(StringRef Str) {
|
||||||
// If they are not there already, permute the components into their canonical
|
// If they are not there already, permute the components into their canonical
|
||||||
// positions by seeing if they parse as a valid architecture, and if so moving
|
// positions by seeing if they parse as a valid architecture, and if so moving
|
||||||
// the component to the architecture position etc.
|
// the component to the architecture position etc.
|
||||||
for (unsigned Pos = 0; Pos != size(Found); ++Pos) {
|
for (unsigned Pos = 0; Pos != array_lengthof(Found); ++Pos) {
|
||||||
if (Found[Pos])
|
if (Found[Pos])
|
||||||
continue; // Already in the canonical position.
|
continue; // Already in the canonical position.
|
||||||
|
|
||||||
for (unsigned Idx = 0; Idx != Components.size(); ++Idx) {
|
for (unsigned Idx = 0; Idx != Components.size(); ++Idx) {
|
||||||
// Do not reparse any components that already matched.
|
// Do not reparse any components that already matched.
|
||||||
if (Idx < size(Found) && Found[Idx])
|
if (Idx < array_lengthof(Found) && Found[Idx])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Does this component parse as valid for the target position?
|
// Does this component parse as valid for the target position?
|
||||||
|
@ -952,7 +952,7 @@ std::string Triple::normalize(StringRef Str) {
|
||||||
// components to the right.
|
// components to the right.
|
||||||
for (unsigned i = Pos; !CurrentComponent.empty(); ++i) {
|
for (unsigned i = Pos; !CurrentComponent.empty(); ++i) {
|
||||||
// Skip over any fixed components.
|
// Skip over any fixed components.
|
||||||
while (i < size(Found) && Found[i])
|
while (i < array_lengthof(Found) && Found[i])
|
||||||
++i;
|
++i;
|
||||||
// Place the component at the new position, getting the component
|
// Place the component at the new position, getting the component
|
||||||
// that was at this position - it will be moved right.
|
// that was at this position - it will be moved right.
|
||||||
|
@ -973,7 +973,7 @@ std::string Triple::normalize(StringRef Str) {
|
||||||
if (CurrentComponent.empty())
|
if (CurrentComponent.empty())
|
||||||
break;
|
break;
|
||||||
// Advance to the next component, skipping any fixed components.
|
// Advance to the next component, skipping any fixed components.
|
||||||
while (++i < size(Found) && Found[i])
|
while (++i < array_lengthof(Found) && Found[i])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
// The last component was pushed off the end - append it.
|
// The last component was pushed off the end - append it.
|
||||||
|
@ -981,7 +981,7 @@ std::string Triple::normalize(StringRef Str) {
|
||||||
Components.push_back(CurrentComponent);
|
Components.push_back(CurrentComponent);
|
||||||
|
|
||||||
// Advance Idx to the component's new position.
|
// Advance Idx to the component's new position.
|
||||||
while (++Idx < size(Found) && Found[Idx])
|
while (++Idx < array_lengthof(Found) && Found[Idx])
|
||||||
;
|
;
|
||||||
} while (Idx < Pos); // Add more until the final position is reached.
|
} while (Idx < Pos); // Add more until the final position is reached.
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,8 +239,8 @@ static const int InfoSigs[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const size_t NumSigs =
|
static const size_t NumSigs =
|
||||||
size(IntSigs) + size(KillSigs) +
|
array_lengthof(IntSigs) + array_lengthof(KillSigs) +
|
||||||
size(InfoSigs) + 1 /* SIGPIPE */;
|
array_lengthof(InfoSigs) + 1 /* SIGPIPE */;
|
||||||
|
|
||||||
|
|
||||||
static std::atomic<unsigned> NumRegisteredSignals = ATOMIC_VAR_INIT(0);
|
static std::atomic<unsigned> NumRegisteredSignals = ATOMIC_VAR_INIT(0);
|
||||||
|
@ -298,7 +298,7 @@ static void RegisterHandlers() { // Not signal-safe.
|
||||||
enum class SignalKind { IsKill, IsInfo };
|
enum class SignalKind { IsKill, IsInfo };
|
||||||
auto registerHandler = [&](int Signal, SignalKind Kind) {
|
auto registerHandler = [&](int Signal, SignalKind Kind) {
|
||||||
unsigned Index = NumRegisteredSignals.load();
|
unsigned Index = NumRegisteredSignals.load();
|
||||||
assert(Index < size(RegisteredSignalInfo) &&
|
assert(Index < array_lengthof(RegisteredSignalInfo) &&
|
||||||
"Out of space for signal handlers!");
|
"Out of space for signal handlers!");
|
||||||
|
|
||||||
struct sigaction NewHandler;
|
struct sigaction NewHandler;
|
||||||
|
@ -562,13 +562,13 @@ void llvm::sys::PrintStackTrace(raw_ostream &OS, int Depth) {
|
||||||
#if defined(HAVE_BACKTRACE)
|
#if defined(HAVE_BACKTRACE)
|
||||||
// Use backtrace() to output a backtrace on Linux systems with glibc.
|
// Use backtrace() to output a backtrace on Linux systems with glibc.
|
||||||
if (!depth)
|
if (!depth)
|
||||||
depth = backtrace(StackTrace, static_cast<int>(size(StackTrace)));
|
depth = backtrace(StackTrace, static_cast<int>(array_lengthof(StackTrace)));
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE__UNWIND_BACKTRACE)
|
#if defined(HAVE__UNWIND_BACKTRACE)
|
||||||
// Try _Unwind_Backtrace() if backtrace() failed.
|
// Try _Unwind_Backtrace() if backtrace() failed.
|
||||||
if (!depth)
|
if (!depth)
|
||||||
depth = unwindBacktrace(StackTrace,
|
depth = unwindBacktrace(StackTrace,
|
||||||
static_cast<int>(size(StackTrace)));
|
static_cast<int>(array_lengthof(StackTrace)));
|
||||||
#endif
|
#endif
|
||||||
if (!depth)
|
if (!depth)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -687,7 +687,7 @@ static bool isReservedName(StringRef path) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Then compare against the list of ancient reserved names.
|
// Then compare against the list of ancient reserved names.
|
||||||
for (size_t i = 0; i < size(sReservedNames); ++i) {
|
for (size_t i = 0; i < array_lengthof(sReservedNames); ++i) {
|
||||||
if (path.equals_insensitive(sReservedNames[i]))
|
if (path.equals_insensitive(sReservedNames[i]))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,7 +242,7 @@ static bool printStackTraceWithLLVMSymbolizer(llvm::raw_ostream &OS,
|
||||||
if (StackFrame.AddrFrame.Offset == 0)
|
if (StackFrame.AddrFrame.Offset == 0)
|
||||||
break;
|
break;
|
||||||
StackTrace[Depth++] = (void *)(uintptr_t)StackFrame.AddrPC.Offset;
|
StackTrace[Depth++] = (void *)(uintptr_t)StackFrame.AddrPC.Offset;
|
||||||
if (Depth >= size(StackTrace))
|
if (Depth >= array_lengthof(StackTrace))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr FeatureBitset &operator&=(const FeatureBitset &RHS) {
|
constexpr FeatureBitset &operator&=(const FeatureBitset &RHS) {
|
||||||
for (unsigned I = 0, E = size(Bits); I != E; ++I) {
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I) {
|
||||||
// GCC <6.2 crashes if this is written in a single statement.
|
// GCC <6.2 crashes if this is written in a single statement.
|
||||||
uint32_t NewBits = Bits[I] & RHS.Bits[I];
|
uint32_t NewBits = Bits[I] & RHS.Bits[I];
|
||||||
Bits[I] = NewBits;
|
Bits[I] = NewBits;
|
||||||
|
@ -63,7 +63,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr FeatureBitset &operator|=(const FeatureBitset &RHS) {
|
constexpr FeatureBitset &operator|=(const FeatureBitset &RHS) {
|
||||||
for (unsigned I = 0, E = size(Bits); I != E; ++I) {
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I) {
|
||||||
// GCC <6.2 crashes if this is written in a single statement.
|
// GCC <6.2 crashes if this is written in a single statement.
|
||||||
uint32_t NewBits = Bits[I] | RHS.Bits[I];
|
uint32_t NewBits = Bits[I] | RHS.Bits[I];
|
||||||
Bits[I] = NewBits;
|
Bits[I] = NewBits;
|
||||||
|
@ -74,7 +74,7 @@ public:
|
||||||
// gcc 5.3 miscompiles this if we try to write this using operator&=.
|
// gcc 5.3 miscompiles this if we try to write this using operator&=.
|
||||||
constexpr FeatureBitset operator&(const FeatureBitset &RHS) const {
|
constexpr FeatureBitset operator&(const FeatureBitset &RHS) const {
|
||||||
FeatureBitset Result;
|
FeatureBitset Result;
|
||||||
for (unsigned I = 0, E = size(Bits); I != E; ++I)
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I)
|
||||||
Result.Bits[I] = Bits[I] & RHS.Bits[I];
|
Result.Bits[I] = Bits[I] & RHS.Bits[I];
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
@ -82,20 +82,20 @@ public:
|
||||||
// gcc 5.3 miscompiles this if we try to write this using operator&=.
|
// gcc 5.3 miscompiles this if we try to write this using operator&=.
|
||||||
constexpr FeatureBitset operator|(const FeatureBitset &RHS) const {
|
constexpr FeatureBitset operator|(const FeatureBitset &RHS) const {
|
||||||
FeatureBitset Result;
|
FeatureBitset Result;
|
||||||
for (unsigned I = 0, E = size(Bits); I != E; ++I)
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I)
|
||||||
Result.Bits[I] = Bits[I] | RHS.Bits[I];
|
Result.Bits[I] = Bits[I] | RHS.Bits[I];
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr FeatureBitset operator~() const {
|
constexpr FeatureBitset operator~() const {
|
||||||
FeatureBitset Result;
|
FeatureBitset Result;
|
||||||
for (unsigned I = 0, E = size(Bits); I != E; ++I)
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I)
|
||||||
Result.Bits[I] = ~Bits[I];
|
Result.Bits[I] = ~Bits[I];
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool operator!=(const FeatureBitset &RHS) const {
|
constexpr bool operator!=(const FeatureBitset &RHS) const {
|
||||||
for (unsigned I = 0, E = size(Bits); I != E; ++I)
|
for (unsigned I = 0, E = array_lengthof(Bits); I != E; ++I)
|
||||||
if (Bits[I] != RHS.Bits[I])
|
if (Bits[I] != RHS.Bits[I])
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
|
@ -690,7 +690,7 @@ unsigned llvm::X86::getFeaturePriority(ProcessorFeatures Feat) {
|
||||||
#include "llvm/Support/X86TargetParser.def"
|
#include "llvm/Support/X86TargetParser.def"
|
||||||
std::numeric_limits<unsigned>::max() // Need to consume last comma.
|
std::numeric_limits<unsigned>::max() // Need to consume last comma.
|
||||||
};
|
};
|
||||||
std::array<unsigned, size(Priorities) - 1> HelperList;
|
std::array<unsigned, array_lengthof(Priorities) - 1> HelperList;
|
||||||
std::iota(HelperList.begin(), HelperList.end(), 0);
|
std::iota(HelperList.begin(), HelperList.end(), 0);
|
||||||
assert(std::is_permutation(HelperList.begin(), HelperList.end(),
|
assert(std::is_permutation(HelperList.begin(), HelperList.end(),
|
||||||
std::begin(Priorities),
|
std::begin(Priorities),
|
||||||
|
|
|
@ -480,12 +480,12 @@ static raw_ostream &write_padding(raw_ostream &OS, unsigned NumChars) {
|
||||||
C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C};
|
C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C};
|
||||||
|
|
||||||
// Usually the indentation is small, handle it with a fastpath.
|
// Usually the indentation is small, handle it with a fastpath.
|
||||||
if (NumChars < size(Chars))
|
if (NumChars < array_lengthof(Chars))
|
||||||
return OS.write(Chars, NumChars);
|
return OS.write(Chars, NumChars);
|
||||||
|
|
||||||
while (NumChars) {
|
while (NumChars) {
|
||||||
unsigned NumToWrite = std::min(NumChars,
|
unsigned NumToWrite = std::min(NumChars,
|
||||||
(unsigned)size(Chars)-1);
|
(unsigned)array_lengthof(Chars)-1);
|
||||||
OS.write(Chars, NumToWrite);
|
OS.write(Chars, NumToWrite);
|
||||||
NumChars -= NumToWrite;
|
NumChars -= NumToWrite;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5640,7 +5640,7 @@ void AArch64TargetLowering::saveVarArgRegisters(CCState &CCInfo,
|
||||||
static const MCPhysReg GPRArgRegs[] = { AArch64::X0, AArch64::X1, AArch64::X2,
|
static const MCPhysReg GPRArgRegs[] = { AArch64::X0, AArch64::X1, AArch64::X2,
|
||||||
AArch64::X3, AArch64::X4, AArch64::X5,
|
AArch64::X3, AArch64::X4, AArch64::X5,
|
||||||
AArch64::X6, AArch64::X7 };
|
AArch64::X6, AArch64::X7 };
|
||||||
static const unsigned NumGPRArgRegs = size(GPRArgRegs);
|
static const unsigned NumGPRArgRegs = array_lengthof(GPRArgRegs);
|
||||||
unsigned FirstVariadicGPR = CCInfo.getFirstUnallocated(GPRArgRegs);
|
unsigned FirstVariadicGPR = CCInfo.getFirstUnallocated(GPRArgRegs);
|
||||||
|
|
||||||
unsigned GPRSaveSize = 8 * (NumGPRArgRegs - FirstVariadicGPR);
|
unsigned GPRSaveSize = 8 * (NumGPRArgRegs - FirstVariadicGPR);
|
||||||
|
@ -5676,7 +5676,7 @@ void AArch64TargetLowering::saveVarArgRegisters(CCState &CCInfo,
|
||||||
static const MCPhysReg FPRArgRegs[] = {
|
static const MCPhysReg FPRArgRegs[] = {
|
||||||
AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3,
|
AArch64::Q0, AArch64::Q1, AArch64::Q2, AArch64::Q3,
|
||||||
AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7};
|
AArch64::Q4, AArch64::Q5, AArch64::Q6, AArch64::Q7};
|
||||||
static const unsigned NumFPRArgRegs = size(FPRArgRegs);
|
static const unsigned NumFPRArgRegs = array_lengthof(FPRArgRegs);
|
||||||
unsigned FirstVariadicFPR = CCInfo.getFirstUnallocated(FPRArgRegs);
|
unsigned FirstVariadicFPR = CCInfo.getFirstUnallocated(FPRArgRegs);
|
||||||
|
|
||||||
unsigned FPRSaveSize = 16 * (NumFPRArgRegs - FirstVariadicFPR);
|
unsigned FPRSaveSize = 16 * (NumFPRArgRegs - FirstVariadicFPR);
|
||||||
|
|
|
@ -706,7 +706,7 @@ static const LdStNInstrDesc LdStNInstInfo[] = {
|
||||||
|
|
||||||
static const LdStNInstrDesc *getLdStNInstrDesc(unsigned Opcode) {
|
static const LdStNInstrDesc *getLdStNInstrDesc(unsigned Opcode) {
|
||||||
unsigned Idx;
|
unsigned Idx;
|
||||||
for (Idx = 0; Idx != size(LdStNInstInfo); ++Idx)
|
for (Idx = 0; Idx != array_lengthof(LdStNInstInfo); ++Idx)
|
||||||
if (LdStNInstInfo[Idx].Opcode == Opcode)
|
if (LdStNInstInfo[Idx].Opcode == Opcode)
|
||||||
return &LdStNInstInfo[Idx];
|
return &LdStNInstInfo[Idx];
|
||||||
|
|
||||||
|
|
|
@ -347,7 +347,7 @@ const UnmangledFuncInfo UnmangledFuncInfo::Table[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const unsigned UnmangledFuncInfo::TableSize =
|
const unsigned UnmangledFuncInfo::TableSize =
|
||||||
size(UnmangledFuncInfo::Table);
|
array_lengthof(UnmangledFuncInfo::Table);
|
||||||
|
|
||||||
static AMDGPULibFunc::Param getRetType(AMDGPULibFunc::EFuncId id,
|
static AMDGPULibFunc::Param getRetType(AMDGPULibFunc::EFuncId id,
|
||||||
const AMDGPULibFunc::Param (&Leads)[2]) {
|
const AMDGPULibFunc::Param (&Leads)[2]) {
|
||||||
|
@ -555,7 +555,7 @@ static AMDGPULibFunc::ENamePrefix parseNamePrefix(StringRef& mangledName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
StringMap<int> ManglingRule::buildManglingRulesMap() {
|
StringMap<int> ManglingRule::buildManglingRulesMap() {
|
||||||
StringMap<int> Map(size(manglingRules));
|
StringMap<int> Map(array_lengthof(manglingRules));
|
||||||
int Id = 0;
|
int Id = 0;
|
||||||
for (auto Rule : manglingRules)
|
for (auto Rule : manglingRules)
|
||||||
Map.insert({Rule.Name, Id++});
|
Map.insert({Rule.Name, Id++});
|
||||||
|
|
|
@ -29,7 +29,7 @@ unsigned R600RegisterInfo::getSubRegFromChannel(unsigned Channel) {
|
||||||
R600::sub12, R600::sub13, R600::sub14, R600::sub15
|
R600::sub12, R600::sub13, R600::sub14, R600::sub15
|
||||||
};
|
};
|
||||||
|
|
||||||
assert(Channel < size(SubRegFromChannelTable));
|
assert(Channel < array_lengthof(SubRegFromChannelTable));
|
||||||
return SubRegFromChannelTable[Channel];
|
return SubRegFromChannelTable[Channel];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -560,18 +560,18 @@ SDValue ARCTargetLowering::LowerCallArguments(
|
||||||
ARC::R4, ARC::R5, ARC::R6, ARC::R7};
|
ARC::R4, ARC::R5, ARC::R6, ARC::R7};
|
||||||
auto *AFI = MF.getInfo<ARCFunctionInfo>();
|
auto *AFI = MF.getInfo<ARCFunctionInfo>();
|
||||||
unsigned FirstVAReg = CCInfo.getFirstUnallocated(ArgRegs);
|
unsigned FirstVAReg = CCInfo.getFirstUnallocated(ArgRegs);
|
||||||
if (FirstVAReg < size(ArgRegs)) {
|
if (FirstVAReg < array_lengthof(ArgRegs)) {
|
||||||
int Offset = 0;
|
int Offset = 0;
|
||||||
// Save remaining registers, storing higher register numbers at a higher
|
// Save remaining registers, storing higher register numbers at a higher
|
||||||
// address
|
// address
|
||||||
// There are (size(ArgRegs) - FirstVAReg) registers which
|
// There are (array_lengthof(ArgRegs) - FirstVAReg) registers which
|
||||||
// need to be saved.
|
// need to be saved.
|
||||||
int VarFI =
|
int VarFI =
|
||||||
MFI.CreateFixedObject((size(ArgRegs) - FirstVAReg) * 4,
|
MFI.CreateFixedObject((array_lengthof(ArgRegs) - FirstVAReg) * 4,
|
||||||
CCInfo.getNextStackOffset(), true);
|
CCInfo.getNextStackOffset(), true);
|
||||||
AFI->setVarArgsFrameIndex(VarFI);
|
AFI->setVarArgsFrameIndex(VarFI);
|
||||||
SDValue FIN = DAG.getFrameIndex(VarFI, MVT::i32);
|
SDValue FIN = DAG.getFrameIndex(VarFI, MVT::i32);
|
||||||
for (unsigned i = FirstVAReg; i < size(ArgRegs); i++) {
|
for (unsigned i = FirstVAReg; i < array_lengthof(ArgRegs); i++) {
|
||||||
// Move argument from phys reg -> virt reg
|
// Move argument from phys reg -> virt reg
|
||||||
unsigned VReg = RegInfo.createVirtualRegister(&ARC::GPR32RegClass);
|
unsigned VReg = RegInfo.createVirtualRegister(&ARC::GPR32RegClass);
|
||||||
RegInfo.addLiveIn(ArgRegs[i], VReg);
|
RegInfo.addLiveIn(ArgRegs[i], VReg);
|
||||||
|
|
|
@ -113,7 +113,7 @@ static const ARM_MLxEntry ARM_MLxTable[] = {
|
||||||
ARMBaseInstrInfo::ARMBaseInstrInfo(const ARMSubtarget& STI)
|
ARMBaseInstrInfo::ARMBaseInstrInfo(const ARMSubtarget& STI)
|
||||||
: ARMGenInstrInfo(ARM::ADJCALLSTACKDOWN, ARM::ADJCALLSTACKUP),
|
: ARMGenInstrInfo(ARM::ADJCALLSTACKDOWN, ARM::ADJCALLSTACKUP),
|
||||||
Subtarget(STI) {
|
Subtarget(STI) {
|
||||||
for (unsigned i = 0, e = size(ARM_MLxTable); i != e; ++i) {
|
for (unsigned i = 0, e = array_lengthof(ARM_MLxTable); i != e; ++i) {
|
||||||
if (!MLxEntryMap.insert(std::make_pair(ARM_MLxTable[i].MLxOpc, i)).second)
|
if (!MLxEntryMap.insert(std::make_pair(ARM_MLxTable[i].MLxOpc, i)).second)
|
||||||
llvm_unreachable("Duplicated entries?");
|
llvm_unreachable("Duplicated entries?");
|
||||||
MLxHazardOpcodes.insert(ARM_MLxTable[i].AddSubOpc);
|
MLxHazardOpcodes.insert(ARM_MLxTable[i].AddSubOpc);
|
||||||
|
@ -2466,7 +2466,7 @@ static const AddSubFlagsOpcodePair AddSubFlagsOpcodeMap[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned llvm::convertAddSubFlagsOpcode(unsigned OldOpc) {
|
unsigned llvm::convertAddSubFlagsOpcode(unsigned OldOpc) {
|
||||||
for (unsigned i = 0, e = size(AddSubFlagsOpcodeMap); i != e; ++i)
|
for (unsigned i = 0, e = array_lengthof(AddSubFlagsOpcodeMap); i != e; ++i)
|
||||||
if (OldOpc == AddSubFlagsOpcodeMap[i].PseudoOpc)
|
if (OldOpc == AddSubFlagsOpcodeMap[i].PseudoOpc)
|
||||||
return AddSubFlagsOpcodeMap[i].MachineOpc;
|
return AddSubFlagsOpcodeMap[i].MachineOpc;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -2367,7 +2367,7 @@ bool ARMFrameLowering::assignCalleeSavedSpillSlots(
|
||||||
const TargetFrameLowering::SpillSlot *
|
const TargetFrameLowering::SpillSlot *
|
||||||
ARMFrameLowering::getCalleeSavedSpillSlots(unsigned &NumEntries) const {
|
ARMFrameLowering::getCalleeSavedSpillSlots(unsigned &NumEntries) const {
|
||||||
static const SpillSlot FixedSpillOffsets[] = {{ARM::FPCXTNS, -4}};
|
static const SpillSlot FixedSpillOffsets[] = {{ARM::FPCXTNS, -4}};
|
||||||
NumEntries = size(FixedSpillOffsets);
|
NumEntries = array_lengthof(FixedSpillOffsets);
|
||||||
return FixedSpillOffsets;
|
return FixedSpillOffsets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4465,7 +4465,7 @@ SDValue ARMTargetLowering::LowerFormalArguments(
|
||||||
int lastInsIndex = -1;
|
int lastInsIndex = -1;
|
||||||
if (isVarArg && MFI.hasVAStart()) {
|
if (isVarArg && MFI.hasVAStart()) {
|
||||||
unsigned RegIdx = CCInfo.getFirstUnallocated(GPRArgRegs);
|
unsigned RegIdx = CCInfo.getFirstUnallocated(GPRArgRegs);
|
||||||
if (RegIdx != size(GPRArgRegs))
|
if (RegIdx != array_lengthof(GPRArgRegs))
|
||||||
ArgRegBegin = std::min(ArgRegBegin, (unsigned)GPRArgRegs[RegIdx]);
|
ArgRegBegin = std::min(ArgRegBegin, (unsigned)GPRArgRegs[RegIdx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ INITIALIZE_PASS(Thumb2SizeReduce, DEBUG_TYPE, THUMB2_SIZE_REDUCE_NAME, false,
|
||||||
Thumb2SizeReduce::Thumb2SizeReduce(std::function<bool(const Function &)> Ftor)
|
Thumb2SizeReduce::Thumb2SizeReduce(std::function<bool(const Function &)> Ftor)
|
||||||
: MachineFunctionPass(ID), PredicateFtor(std::move(Ftor)) {
|
: MachineFunctionPass(ID), PredicateFtor(std::move(Ftor)) {
|
||||||
OptimizeSize = MinimizeSize = false;
|
OptimizeSize = MinimizeSize = false;
|
||||||
for (unsigned i = 0, e = size(ReduceTable); i != e; ++i) {
|
for (unsigned i = 0, e = array_lengthof(ReduceTable); i != e; ++i) {
|
||||||
unsigned FromOpc = ReduceTable[i].WideOpc;
|
unsigned FromOpc = ReduceTable[i].WideOpc;
|
||||||
if (!ReduceOpcodeMap.insert(std::make_pair(FromOpc, i)).second)
|
if (!ReduceOpcodeMap.insert(std::make_pair(FromOpc, i)).second)
|
||||||
llvm_unreachable("Duplicated entries?");
|
llvm_unreachable("Duplicated entries?");
|
||||||
|
|
|
@ -1033,7 +1033,7 @@ static const MCPhysReg RegList16[] = {
|
||||||
AVR::R16R15, AVR::R15R14, AVR::R14R13, AVR::R13R12, AVR::R12R11,
|
AVR::R16R15, AVR::R15R14, AVR::R14R13, AVR::R13R12, AVR::R12R11,
|
||||||
AVR::R11R10, AVR::R10R9, AVR::R9R8};
|
AVR::R11R10, AVR::R10R9, AVR::R9R8};
|
||||||
|
|
||||||
static_assert(size(RegList8) == size(RegList16),
|
static_assert(array_lengthof(RegList8) == array_lengthof(RegList16),
|
||||||
"8-bit and 16-bit register arrays must be of equal length");
|
"8-bit and 16-bit register arrays must be of equal length");
|
||||||
|
|
||||||
/// Analyze incoming and outgoing function arguments. We need custom C++ code
|
/// Analyze incoming and outgoing function arguments. We need custom C++ code
|
||||||
|
@ -1074,7 +1074,7 @@ analyzeArguments(TargetLowering::CallLoweringInfo *CLI, const Function *F,
|
||||||
unsigned RegIdx = RegLastIdx + TotalBytes;
|
unsigned RegIdx = RegLastIdx + TotalBytes;
|
||||||
RegLastIdx = RegIdx;
|
RegLastIdx = RegIdx;
|
||||||
// If there are not enough registers, use the stack
|
// If there are not enough registers, use the stack
|
||||||
if (RegIdx >= size(RegList8)) {
|
if (RegIdx >= array_lengthof(RegList8)) {
|
||||||
UseStack = true;
|
UseStack = true;
|
||||||
}
|
}
|
||||||
for (; i != j; ++i) {
|
for (; i != j; ++i) {
|
||||||
|
|
|
@ -675,7 +675,7 @@ static DecodeStatus DecodeCtrRegsRegisterClass(MCInst &Inst, unsigned RegNo,
|
||||||
/* 28 */ 0, 0, UTIMERLO, UTIMERHI
|
/* 28 */ 0, 0, UTIMERLO, UTIMERHI
|
||||||
};
|
};
|
||||||
|
|
||||||
if (RegNo >= size(CtrlRegDecoderTable))
|
if (RegNo >= array_lengthof(CtrlRegDecoderTable))
|
||||||
return MCDisassembler::Fail;
|
return MCDisassembler::Fail;
|
||||||
|
|
||||||
static_assert(NoRegister == 0, "Expecting NoRegister to be 0");
|
static_assert(NoRegister == 0, "Expecting NoRegister to be 0");
|
||||||
|
@ -703,7 +703,7 @@ static DecodeStatus DecodeCtrRegs64RegisterClass(MCInst &Inst, unsigned RegNo,
|
||||||
/* 28 */ 0, 0, UTIMER, 0
|
/* 28 */ 0, 0, UTIMER, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (RegNo >= size(CtrlReg64DecoderTable))
|
if (RegNo >= array_lengthof(CtrlReg64DecoderTable))
|
||||||
return MCDisassembler::Fail;
|
return MCDisassembler::Fail;
|
||||||
|
|
||||||
static_assert(NoRegister == 0, "Expecting NoRegister to be 0");
|
static_assert(NoRegister == 0, "Expecting NoRegister to be 0");
|
||||||
|
@ -855,7 +855,7 @@ static DecodeStatus DecodeGuestRegsRegisterClass(MCInst &Inst, unsigned RegNo,
|
||||||
/* 28 */ GPMUCNT2, GPMUCNT3, G30, G31
|
/* 28 */ GPMUCNT2, GPMUCNT3, G30, G31
|
||||||
};
|
};
|
||||||
|
|
||||||
if (RegNo >= size(GuestRegDecoderTable))
|
if (RegNo >= array_lengthof(GuestRegDecoderTable))
|
||||||
return MCDisassembler::Fail;
|
return MCDisassembler::Fail;
|
||||||
if (GuestRegDecoderTable[RegNo] == Hexagon::NoRegister)
|
if (GuestRegDecoderTable[RegNo] == Hexagon::NoRegister)
|
||||||
return MCDisassembler::Fail;
|
return MCDisassembler::Fail;
|
||||||
|
@ -881,7 +881,7 @@ static DecodeStatus DecodeGuestRegs64RegisterClass(MCInst &Inst, unsigned RegNo,
|
||||||
/* 28 */ G29_28, 0, G31_30, 0
|
/* 28 */ G29_28, 0, G31_30, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (RegNo >= size(GuestReg64DecoderTable))
|
if (RegNo >= array_lengthof(GuestReg64DecoderTable))
|
||||||
return MCDisassembler::Fail;
|
return MCDisassembler::Fail;
|
||||||
if (GuestReg64DecoderTable[RegNo] == Hexagon::NoRegister)
|
if (GuestReg64DecoderTable[RegNo] == Hexagon::NoRegister)
|
||||||
return MCDisassembler::Fail;
|
return MCDisassembler::Fail;
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
{ Hexagon::R25, -36 }, { Hexagon::R24, -40 }, { Hexagon::D12, -40 },
|
{ Hexagon::R25, -36 }, { Hexagon::R24, -40 }, { Hexagon::D12, -40 },
|
||||||
{ Hexagon::R27, -44 }, { Hexagon::R26, -48 }, { Hexagon::D13, -48 }
|
{ Hexagon::R27, -44 }, { Hexagon::R26, -48 }, { Hexagon::D13, -48 }
|
||||||
};
|
};
|
||||||
NumEntries = size(Offsets);
|
NumEntries = array_lengthof(Offsets);
|
||||||
return Offsets;
|
return Offsets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue