diff --git a/include/swift/AST/DiagnosticsFrontend.def b/include/swift/AST/DiagnosticsFrontend.def index 42bc9c823bc83..7aa018966646b 100644 --- a/include/swift/AST/DiagnosticsFrontend.def +++ b/include/swift/AST/DiagnosticsFrontend.def @@ -299,9 +299,6 @@ ERROR(error_optimization_remark_pattern, none, "%0 in '%1'", ERROR(error_invalid_debug_prefix_map, none, "invalid argument '%0' to -debug-prefix-map; it must be of the form " "'original=remapped'", (StringRef)) -ERROR(error_invalid_coverage_prefix_map, none, - "invalid argument '%0' to -coverage-prefix-map; it must be of the form " - "'original=remapped'", (StringRef)) ERROR(error_unable_to_write_swift_ranges_file, none, diff --git a/include/swift/AST/IRGenOptions.h b/include/swift/AST/IRGenOptions.h index 9b55d54d28d6a..279fdcefb3c4e 100644 --- a/include/swift/AST/IRGenOptions.h +++ b/include/swift/AST/IRGenOptions.h @@ -169,9 +169,6 @@ class IRGenOptions { /// Path prefixes that should be rewritten in debug info. PathRemapper DebugPrefixMap; - /// Path prefixes that should be rewritten in coverage info. - PathRemapper CoveragePrefixMap; - /// What level of debug info to generate. IRGenDebugInfoLevel DebugInfoLevel : 2; diff --git a/include/swift/Option/Options.td b/include/swift/Option/Options.td index 8fe0347dec253..edaf19bdc3559 100644 --- a/include/swift/Option/Options.td +++ b/include/swift/Option/Options.td @@ -724,9 +724,6 @@ def gdwarf_types : Flag<["-"], "gdwarf-types">, def debug_prefix_map : Separate<["-"], "debug-prefix-map">, Flags<[FrontendOption]>, HelpText<"Remap source paths in debug info">; -def coverage_prefix_map : Separate<["-"], "coverage-prefix-map">, - Flags<[FrontendOption]>, - HelpText<"Remap source paths in coverage info">; def debug_info_format : Joined<["-"], "debug-info-format=">, Flags<[FrontendOption]>, diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index d0bee08f8318d..d0be6bc80fd3a 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -179,12 +179,6 @@ static void validateDebugInfoArgs(DiagnosticEngine &diags, for (auto A : args.getAllArgValues(options::OPT_debug_prefix_map)) if (A.find('=') == StringRef::npos) diags.diagnose(SourceLoc(), diag::error_invalid_debug_prefix_map, A); - - // Check for any -coverage-prefix-map options that aren't of the form - // 'original=remapped' (either side can be empty, however). - for (auto A : args.getAllArgValues(options::OPT_coverage_prefix_map)) - if (A.find('=') == StringRef::npos) - diags.diagnose(SourceLoc(), diag::error_invalid_coverage_prefix_map, A); } static void validateVerifyIncrementalDependencyArgs(DiagnosticEngine &diags, diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 5e2d1fe29309d..b1d6f97b0e887 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -262,7 +262,6 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI, // Pass on file paths that should be remapped in debug info. inputArgs.AddAllArgs(arguments, options::OPT_debug_prefix_map); - inputArgs.AddAllArgs(arguments, options::OPT_coverage_prefix_map); // Pass through the values passed to -Xfrontend. inputArgs.AddAllArgValues(arguments, options::OPT_Xfrontend); diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index dee447cd18470..ee668f1eb9905 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1306,11 +1306,6 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args, Opts.DebugPrefixMap.addMapping(SplitMap.first, SplitMap.second); } - for (auto A : Args.getAllArgValues(options::OPT_coverage_prefix_map)) { - auto SplitMap = StringRef(A).split('='); - Opts.CoveragePrefixMap.addMapping(SplitMap.first, SplitMap.second); - } - for (const Arg *A : Args.filtered(OPT_Xcc)) { StringRef Opt = A->getValue(); if (Opt.startswith("-D") || Opt.startswith("-U")) diff --git a/lib/IRGen/GenCoverage.cpp b/lib/IRGen/GenCoverage.cpp index a5d2e6d512f6e..699d1584e4eb1 100644 --- a/lib/IRGen/GenCoverage.cpp +++ b/lib/IRGen/GenCoverage.cpp @@ -18,7 +18,6 @@ #include "IRGenModule.h" #include "SwiftTargetInfo.h" -#include "swift/AST/IRGenOptions.h" #include "swift/SIL/SILModule.h" #include "llvm/IR/Constants.h" #include "llvm/IR/Module.h" @@ -61,7 +60,6 @@ void IRGenModule::emitCoverageMapping() { if (std::find(Files.begin(), Files.end(), M->getFile()) == Files.end()) Files.push_back(M->getFile()); - auto remapper = getOptions().CoveragePrefixMap; // Awkwardly munge absolute filenames into a vector of StringRefs. // TODO: This is heinous - the same thing is happening in clang, but the API // really needs to be cleaned up for both. @@ -70,7 +68,7 @@ void IRGenModule::emitCoverageMapping() { for (StringRef Name : Files) { llvm::SmallString<256> Path(Name); llvm::sys::fs::make_absolute(Path); - FilenameStrs.push_back(remapper.remapPath(Path)); + FilenameStrs.push_back(std::string(Path.begin(), Path.end())); FilenameRefs.push_back(FilenameStrs.back()); } diff --git a/test/Driver/coverage-prefix-map.swift b/test/Driver/coverage-prefix-map.swift deleted file mode 100644 index fd2ff8a5cbc2c..0000000000000 --- a/test/Driver/coverage-prefix-map.swift +++ /dev/null @@ -1,9 +0,0 @@ -// RUN: not %target-swiftc_driver -coverage-prefix-map old %s 2>&1 | %FileCheck %s -check-prefix CHECK-INVALID -// RUN: %target-swiftc_driver -### -coverage-prefix-map old=new %s 2>&1 | %FileCheck %s -check-prefix CHECK-SIMPLE -// RUN: %target-swiftc_driver -### -coverage-prefix-map old=n=ew %s 2>&1 | %FileCheck %s -check-prefix CHECK-COMPLEX -// RUN: %target-swiftc_driver -### -coverage-prefix-map old= %s 2>&1 | %FileCheck %s -check-prefix CHECK-EMPTY - -// CHECK-INVALID: error: invalid argument 'old' to -coverage-prefix-map -// CHECK-SIMPLE: coverage-prefix-map old=new -// CHECK-COMPLEX: coverage-prefix-map old=n=ew -// CHECK-EMPTY: coverage-prefix-map old= diff --git a/test/Profiler/coverage_relative_path.swift b/test/Profiler/coverage_relative_path.swift deleted file mode 100644 index b6b1db136dd9a..0000000000000 --- a/test/Profiler/coverage_relative_path.swift +++ /dev/null @@ -1,16 +0,0 @@ -// %s expands to an absolute path, so to test relative paths we need to create a -// clean directory, put the source there, and cd into it. -// RUN: rm -rf %t -// RUN: mkdir -p %t/foo/bar/baz -// RUN: cp %s %t/foo/bar/baz/coverage_relative_path.swift -// RUN: cd %t/foo/bar - -// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -Xllvm -enable-name-compression=false -emit-ir baz/coverage_relative_path.swift | %FileCheck -check-prefix=ABSOLUTE %s -// -// ABSOLUTE: @__llvm_coverage_mapping = {{.*"\\01.*foo.*bar.*baz.*coverage_relative_path\.swift}} - -// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -Xllvm -enable-name-compression=false -coverage-prefix-map $PWD=. -emit-ir baz/coverage_relative_path.swift | %FileCheck -check-prefix=RELATIVE %s -// -// RELATIVE: @__llvm_coverage_mapping = {{.*"\\01[^/]*}}.{{/|\\}}baz{{.*coverage_relative_path\.swift}} - -func coverage() {}