[PATCH] D148757: [clang] Apply -fcoverage-prefix-map reverse order

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 25 15:19:41 PDT 2023


MaskRay added a comment.

LGTM



================
Comment at: clang/include/clang/Basic/CodeGenOptions.h:211
+
+  /// Prefix replacement map for coverage.
+  llvm::SmallVector<std::pair<std::string, std::string>, 0> CoveragePrefixMap;
----------------
While adding a comment, clarify what coverage it is? There are multiple coverage instrumentation features in Clang.


================
Comment at: clang/lib/CodeGen/CoverageMappingGen.cpp:1638
     : CGM(CGM), SourceInfo(SourceInfo) {
-  CoveragePrefixMap = CGM.getCodeGenOpts().CoveragePrefixMap;
+  for (const auto &[From, To] : CGM.getCodeGenOpts().CoveragePrefixMap)
+    CoveragePrefixMap.emplace_back(From, To);
----------------
`CoveragePrefixMap` can be removed. I just removed `DebugPrefixMap` as well:)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148757/new/

https://reviews.llvm.org/D148757



More information about the cfe-commits mailing list