r237095 - Driver: Fix a -Wshadow issue from r237091
Justin Bogner
mail at justinbogner.com
Mon May 11 23:30:49 PDT 2015
Author: bogner
Date: Tue May 12 01:30:48 2015
New Revision: 237095
URL: http://llvm.org/viewvc/llvm-project?rev=237095&view=rev
Log:
Driver: Fix a -Wshadow issue from r237091
The MachO toolchain has an isTargetIOSBased method, but it isn't
virtual so it isn't very meaningful to call it. After thinking about
this, I guess that putting this logic in the MachO class is a bit of a
layering violation anyway. Do this more like how we handle
AddLinkRuntimeLibArgs instead.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/ToolChains.h
cfe/trunk/test/Driver/instrprof-ld.c
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=237095&r1=237094&r2=237095&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue May 12 01:30:48 2015
@@ -326,7 +326,7 @@ void MachO::AddLinkRuntimeLib(const ArgL
}
}
-void MachO::addProfileRTLibs(const ArgList &Args,
+void Darwin::addProfileRTLibs(const ArgList &Args,
ArgStringList &CmdArgs) const {
if (!(Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,
false) ||
Modified: cfe/trunk/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=237095&r1=237094&r2=237095&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.h (original)
+++ cfe/trunk/lib/Driver/ToolChains.h Tue May 12 01:30:48 2015
@@ -241,8 +241,10 @@ public:
/// Add any profiling runtime libraries that are needed. This is essentially a
/// MachO specific version of addProfileRT in Tools.cpp.
- void addProfileRTLibs(const llvm::opt::ArgList &Args,
- llvm::opt::ArgStringList &CmdArgs) const;
+ virtual void addProfileRTLibs(const llvm::opt::ArgList &Args,
+ llvm::opt::ArgStringList &CmdArgs) const {
+ // There aren't any profiling libs for embedded targets currently.
+ }
/// }
/// @name ToolChain Implementation
@@ -370,6 +372,9 @@ public:
return !isTargetIPhoneOS() || isIPhoneOSVersionLT(6, 0);
}
+ void addProfileRTLibs(const llvm::opt::ArgList &Args,
+ llvm::opt::ArgStringList &CmdArgs) const override;
+
protected:
/// }
/// @name Darwin specific Toolchain functions
Modified: cfe/trunk/test/Driver/instrprof-ld.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/instrprof-ld.c?rev=237095&r1=237094&r2=237095&view=diff
==============================================================================
--- cfe/trunk/test/Driver/instrprof-ld.c (original)
+++ cfe/trunk/test/Driver/instrprof-ld.c Tue May 12 01:30:48 2015
@@ -81,3 +81,11 @@
//
// CHECK-DARWIN-NOSTDLIB-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
// CHECK-DARWIN-NOSTDLIB-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_osx.a"
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: -target arm64-apple-ios -fprofile-instr-generate \
+// RUN: -resource-dir=%S/Inputs/resource_dir \
+// RUN: | FileCheck --check-prefix=CHECK-DARWIN-ARM64 %s
+//
+// CHECK-DARWIN-ARM64: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
+// CHECK-DARWIN-ARM64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}darwin{{/|\\\\}}libclang_rt.profile_ios.a"
More information about the cfe-commits
mailing list