[llvm-branch-commits] [MC][profgen][NFC] Expand auto for MCDecodedPseudoProbe (PR #102788)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Aug 10 21:34:07 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mc
@llvm/pr-subscribers-pgo
Author: Amir Ayupov (aaupov)
<details>
<summary>Changes</summary>
Expand autos in select places to trigger type casts.
---
Full diff: https://github.com/llvm/llvm-project/pull/102788.diff
2 Files Affected:
- (modified) llvm/lib/MC/MCPseudoProbe.cpp (+2-2)
- (modified) llvm/tools/llvm-profgen/ProfileGenerator.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/MC/MCPseudoProbe.cpp b/llvm/lib/MC/MCPseudoProbe.cpp
index bb9538d55b7aa..e9e391c8eadd7 100644
--- a/llvm/lib/MC/MCPseudoProbe.cpp
+++ b/llvm/lib/MC/MCPseudoProbe.cpp
@@ -630,7 +630,7 @@ void MCPseudoProbeDecoder::printProbeForAddress(raw_ostream &OS,
uint64_t Address) {
auto It = Address2ProbesMap.find(Address);
if (It != Address2ProbesMap.end()) {
- for (auto &Probe : It->second) {
+ for (const MCDecodedPseudoProbe &Probe : It->second) {
OS << " [Probe]:\t";
Probe.print(OS, GUID2FuncDescMap, true);
}
@@ -657,7 +657,7 @@ MCPseudoProbeDecoder::getCallProbeForAddr(uint64_t Address) const {
const auto &Probes = It->second;
const MCDecodedPseudoProbe *CallProbe = nullptr;
- for (const auto &Probe : Probes) {
+ for (const MCDecodedPseudoProbe &Probe : Probes) {
if (Probe.isCall()) {
// Disabling the assert and returning first call probe seen so far.
// Subsequent call probes, if any, are ignored. Due to the the way
diff --git a/llvm/tools/llvm-profgen/ProfileGenerator.cpp b/llvm/tools/llvm-profgen/ProfileGenerator.cpp
index 175556c2220e6..c840e7789edfe 100644
--- a/llvm/tools/llvm-profgen/ProfileGenerator.cpp
+++ b/llvm/tools/llvm-profgen/ProfileGenerator.cpp
@@ -1194,7 +1194,7 @@ void ProfileGeneratorBase::extractProbesFromRange(
Binary->getAddress2ProbesMap();
auto It = Address2ProbesMap.find(IP.Address);
if (It != Address2ProbesMap.end()) {
- for (const auto &Probe : It->second) {
+ for (const MCDecodedPseudoProbe &Probe : It->second) {
ProbeCounter[&Probe] += Count;
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/102788
More information about the llvm-branch-commits
mailing list