[clang] [clang][driver] add pointer qualifier to auto type (PR #91874)
Mohammed Keyvanzadeh via cfe-commits
cfe-commits at lists.llvm.org
Sat May 11 16:57:07 PDT 2024
https://github.com/VoltrexKeyva created https://github.com/llvm/llvm-project/pull/91874
Fix an LLVM coding standards inconformity by adding pointer qualifiers to `auto`-typed variables that deduce to pointer types.
See what the coding standards state [here](https://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto).
>From 8a09433a80243fb6dd7eb36623bb3df93e862264 Mon Sep 17 00:00:00 2001
From: Mohammed Keyvanzadeh <mohammadkeyvanzade94 at gmail.com>
Date: Sun, 12 May 2024 03:13:35 +0330
Subject: [PATCH] [clang][driver] add pointer qualifier to auto type
Fix an LLVM coding standards inconformity by adding pointer qualifiers
to `auto`-typed variables that deduce to pointer types.
---
clang/lib/Driver/Action.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/clang/lib/Driver/Action.cpp b/clang/lib/Driver/Action.cpp
index 849bf6035ebd2..e642cde9dca37 100644
--- a/clang/lib/Driver/Action.cpp
+++ b/clang/lib/Driver/Action.cpp
@@ -246,8 +246,8 @@ void OffloadAction::doOnHostDependence(const OffloadActionWorkTy &Work) const {
void OffloadAction::doOnEachDeviceDependence(
const OffloadActionWorkTy &Work) const {
- auto I = getInputs().begin();
- auto E = getInputs().end();
+ auto *I = getInputs().begin();
+ auto *E = getInputs().end();
if (I == E)
return;
@@ -261,7 +261,7 @@ void OffloadAction::doOnEachDeviceDependence(
if (HostTC)
++I;
- auto TI = DevToolChains.begin();
+ auto *TI = DevToolChains.begin();
for (; I != E; ++I, ++TI)
Work(*I, *TI, (*I)->getOffloadingArch());
}
More information about the cfe-commits
mailing list