[clang] 15cd16a - [Driver] Drop unnecessary const from return types (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 4 08:05:42 PDT 2021
Author: Kazu Hirata
Date: 2021-09-04T08:05:27-07:00
New Revision: 15cd16aaf0b7a01e9f4f9f7ddfcf866c4db47199
URL: https://github.com/llvm/llvm-project/commit/15cd16aaf0b7a01e9f4f9f7ddfcf866c4db47199
DIFF: https://github.com/llvm/llvm-project/commit/15cd16aaf0b7a01e9f4f9f7ddfcf866c4db47199.diff
LOG: [Driver] Drop unnecessary const from return types (NFC)
Identified with readability-const-return-type.
Added:
Modified:
clang/lib/Driver/ToolChains/AMDGPU.h
clang/lib/Driver/ToolChains/Arch/ARM.cpp
clang/lib/Driver/ToolChains/Arch/ARM.h
clang/lib/Driver/ToolChains/Darwin.cpp
clang/lib/Driver/ToolChains/Hexagon.cpp
clang/lib/Driver/ToolChains/Hexagon.h
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/AMDGPU.h b/clang/lib/Driver/ToolChains/AMDGPU.h
index b93d554683ff..63364d19a521 100644
--- a/clang/lib/Driver/ToolChains/AMDGPU.h
+++ b/clang/lib/Driver/ToolChains/AMDGPU.h
@@ -51,7 +51,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUToolChain : public Generic_ELF {
const std::map<options::ID, const StringRef> OptionsDefault;
Tool *buildLinker() const override;
- const StringRef getOptionDefault(options::ID OptID) const {
+ StringRef getOptionDefault(options::ID OptID) const {
auto opt = OptionsDefault.find(OptID);
assert(opt != OptionsDefault.end() && "No Default for Option");
return opt->second;
diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.cpp b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
index a6cf378f81f3..2f184731d829 100644
--- a/clang/lib/Driver/ToolChains/Arch/ARM.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/ARM.cpp
@@ -849,7 +849,7 @@ void arm::getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple,
}
-const std::string arm::getARMArch(StringRef Arch, const llvm::Triple &Triple) {
+std::string arm::getARMArch(StringRef Arch, const llvm::Triple &Triple) {
std::string MArch;
if (!Arch.empty())
MArch = std::string(Arch);
diff --git a/clang/lib/Driver/ToolChains/Arch/ARM.h b/clang/lib/Driver/ToolChains/Arch/ARM.h
index 8e7c10ecd5d6..0ab0d6c281f8 100644
--- a/clang/lib/Driver/ToolChains/Arch/ARM.h
+++ b/clang/lib/Driver/ToolChains/Arch/ARM.h
@@ -24,7 +24,7 @@ namespace arm {
std::string getARMTargetCPU(StringRef CPU, llvm::StringRef Arch,
const llvm::Triple &Triple);
-const std::string getARMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
+std::string getARMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
StringRef getARMCPUForMArch(llvm::StringRef Arch, const llvm::Triple &Triple);
llvm::ARM::ArchKind getLLVMArchKindForARM(StringRef CPU, StringRef Arch,
const llvm::Triple &Triple);
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index f610bc2a781a..15c885fa6507 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -34,7 +34,7 @@ using namespace clang::driver::toolchains;
using namespace clang;
using namespace llvm::opt;
-static const VersionTuple minimumMacCatalystDeploymentTarget() {
+static VersionTuple minimumMacCatalystDeploymentTarget() {
return VersionTuple(13, 1);
}
diff --git a/clang/lib/Driver/ToolChains/Hexagon.cpp b/clang/lib/Driver/ToolChains/Hexagon.cpp
index 5f5964ec982b..01568e0b2edd 100644
--- a/clang/lib/Driver/ToolChains/Hexagon.cpp
+++ b/clang/lib/Driver/ToolChains/Hexagon.cpp
@@ -704,11 +704,11 @@ bool HexagonToolChain::isAutoHVXEnabled(const llvm::opt::ArgList &Args) {
// Returns the default CPU for Hexagon. This is the default compilation target
// if no Hexagon processor is selected at the command-line.
//
-const StringRef HexagonToolChain::GetDefaultCPU() {
+StringRef HexagonToolChain::GetDefaultCPU() {
return "hexagonv60";
}
-const StringRef HexagonToolChain::GetTargetCPUVersion(const ArgList &Args) {
+StringRef HexagonToolChain::GetTargetCPUVersion(const ArgList &Args) {
Arg *CpuArg = nullptr;
if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ))
CpuArg = A;
diff --git a/clang/lib/Driver/ToolChains/Hexagon.h b/clang/lib/Driver/ToolChains/Hexagon.h
index 9dc9b3ceddde..899630555352 100644
--- a/clang/lib/Driver/ToolChains/Hexagon.h
+++ b/clang/lib/Driver/ToolChains/Hexagon.h
@@ -107,8 +107,8 @@ class LLVM_LIBRARY_VISIBILITY HexagonToolChain : public Linux {
std::string getCompilerRTPath() const override;
static bool isAutoHVXEnabled(const llvm::opt::ArgList &Args);
- static const StringRef GetDefaultCPU();
- static const StringRef GetTargetCPUVersion(const llvm::opt::ArgList &Args);
+ static StringRef GetDefaultCPU();
+ static StringRef GetTargetCPUVersion(const llvm::opt::ArgList &Args);
static Optional<unsigned> getSmallDataThreshold(
const llvm::opt::ArgList &Args);
More information about the cfe-commits
mailing list