[Lldb-commits] [lldb] 8d7796c - Fix a few clang-tidy warnings about auto * and const auto.
Eric Christopher via lldb-commits
lldb-commits at lists.llvm.org
Mon May 11 15:33:49 PDT 2020
Author: Eric Christopher
Date: 2020-05-11T15:33:17-07:00
New Revision: 8d7796cf9427a0c361a5831e4371ff030b98dfac
URL: https://github.com/llvm/llvm-project/commit/8d7796cf9427a0c361a5831e4371ff030b98dfac
DIFF: https://github.com/llvm/llvm-project/commit/8d7796cf9427a0c361a5831e4371ff030b98dfac.diff
LOG: Fix a few clang-tidy warnings about auto * and const auto.
Added:
Modified:
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 1665d68db6ff..970d4161899e 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -3416,9 +3416,9 @@ bool TypeSystemClang::IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
case clang::Type::ObjCObjectPointer:
if (check_objc) {
- if (auto objc_pointee_type =
+ if (const auto *objc_pointee_type =
qual_type->getPointeeType().getTypePtrOrNull()) {
- if (auto objc_object_type =
+ if (const auto *objc_object_type =
llvm::dyn_cast_or_null<clang::ObjCObjectType>(
objc_pointee_type)) {
if (objc_object_type->isObjCClass())
@@ -7092,7 +7092,7 @@ clang::FieldDecl *TypeSystemClang::AddFieldToRecordType(
field_clang_type.GetCompleteType();
- auto ivar = clang::ObjCIvarDecl::CreateDeserialized(clang_ast, 0);
+ auto *ivar = clang::ObjCIvarDecl::CreateDeserialized(clang_ast, 0);
ivar->setDeclContext(class_interface_decl);
ivar->setDeclName(ident);
ivar->setType(ClangUtil::GetQualType(field_clang_type));
@@ -8570,7 +8570,7 @@ static bool DumpEnumValue(const clang::QualType &qual_type, Stream *s,
// every enumerator is either a one bit value or a superset of the previous
// enumerators. Also 0 doesn't make sense when the enumerators are used as
// flags.
- for (auto enumerator : enum_decl->enumerators()) {
+ for (auto *enumerator : enum_decl->enumerators()) {
uint64_t val = enumerator->getInitVal().getSExtValue();
val = llvm::SignExtend64(val, 8*byte_size);
if (llvm::countPopulation(val) != 1 && (val & ~covered_bits) != 0)
@@ -8602,7 +8602,7 @@ static bool DumpEnumValue(const clang::QualType &qual_type, Stream *s,
uint64_t remaining_value = enum_uvalue;
std::vector<std::pair<uint64_t, llvm::StringRef>> values;
values.reserve(num_enumerators);
- for (auto enumerator : enum_decl->enumerators())
+ for (auto *enumerator : enum_decl->enumerators())
if (auto val = enumerator->getInitVal().getZExtValue())
values.emplace_back(val, enumerator->getName());
More information about the lldb-commits
mailing list