From 8dc7b982b4556c243e0502e6e230bdd53ddd65ff Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 1 Jan 2020 17:23:21 +0100 Subject: [NFC] Fixes -Wrange-loop-analysis warnings This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index ee9d388131f1..4b825c7af078 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -273,7 +273,7 @@ void TargetLoweringObjectFileELF::emitModuleMetadata(MCStreamer &Streamer, Streamer.SwitchSection(S); - for (const auto &Operand : LinkerOptions->operands()) { + for (const auto *Operand : LinkerOptions->operands()) { if (cast(Operand)->getNumOperands() != 2) report_fatal_error("invalid llvm.linker.options"); for (const auto &Option : cast(Operand)->operands()) { @@ -289,7 +289,7 @@ void TargetLoweringObjectFileELF::emitModuleMetadata(MCStreamer &Streamer, Streamer.SwitchSection(S); - for (const auto &Operand : DependentLibraries->operands()) { + for (const auto *Operand : DependentLibraries->operands()) { Streamer.EmitBytes( cast(cast(Operand)->getOperand(0))->getString()); Streamer.EmitIntValue(0, 1); @@ -885,7 +885,7 @@ void TargetLoweringObjectFileMachO::emitModuleMetadata(MCStreamer &Streamer, Module &M) const { // Emit the linker options if present. if (auto *LinkerOptions = M.getNamedMetadata("llvm.linker.options")) { - for (const auto &Option : LinkerOptions->operands()) { + for (const auto *Option : LinkerOptions->operands()) { SmallVector StrOptions; for (const auto &Piece : cast(Option)->operands()) StrOptions.push_back(cast(Piece)->getString()); @@ -1449,7 +1449,7 @@ void TargetLoweringObjectFileCOFF::emitModuleMetadata(MCStreamer &Streamer, // linker. MCSection *Sec = getDrectveSection(); Streamer.SwitchSection(Sec); - for (const auto &Option : LinkerOptions->operands()) { + for (const auto *Option : LinkerOptions->operands()) { for (const auto &Piece : cast(Option)->operands()) { // Lead with a space for consistency with our dllexport implementation. std::string Directive(" "); -- cgit v1.2.3