================
@@ -2866,8 +2873,19 @@ GlobalVariable
*ModuleAddressSanitizer::getOrCreateModuleName() {
if (!ModuleName) {
// We shouldn't merge same module names, as this string serves as unique
// module ID in runtime.
+ std::string ModuleNameStr = M.getModuleIdentifier();
+
+ // Apply prefix map remapping.
+ SmallString<256> RemappedName(ModuleNameStr);
+ for (const auto &[Old, New] : PrefixMap) {
----------------
vitalybuka wrote:
```suggestion
for (const auto &[Old, New] : llvm::reverse(PrefixMap)) {
```
Iterate in reverse so the last matching prefix wins, consistent with
-fdebug-prefix-map, -fcoverage-prefix-map, and -ffile-prefix-map.
https://github.com/llvm/llvm-project/pull/186908
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits