[llvm] 5cfce50 - Timer - fix shadow variable warnings for Name/Description members. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 11 09:23:47 PST 2019
Author: Simon Pilgrim
Date: 2019-11-11T17:19:14Z
New Revision: 5cfce5079bc8218e68b6404b70116aeccc346dd1
URL: https://github.com/llvm/llvm-project/commit/5cfce5079bc8218e68b6404b70116aeccc346dd1
DIFF: https://github.com/llvm/llvm-project/commit/5cfce5079bc8218e68b6404b70116aeccc346dd1.diff
LOG: Timer - fix shadow variable warnings for Name/Description members. NFC.
Added:
Modified:
llvm/include/llvm/Support/Timer.h
llvm/lib/Support/Timer.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h
index 9ff1bd9eee21..06a2f9e6dc9d 100644
--- a/llvm/include/llvm/Support/Timer.h
+++ b/llvm/include/llvm/Support/Timer.h
@@ -85,11 +85,11 @@ class Timer {
Timer **Prev = nullptr; ///< Pointer to \p Next of previous timer in group.
Timer *Next = nullptr; ///< Next timer in the group.
public:
- explicit Timer(StringRef Name, StringRef Description) {
- init(Name, Description);
+ explicit Timer(StringRef TimerName, StringRef TimerDescription) {
+ init(TimerName, TimerDescription);
}
- Timer(StringRef Name, StringRef Description, TimerGroup &tg) {
- init(Name, Description, tg);
+ Timer(StringRef TimerName, StringRef TimerDescription, TimerGroup &tg) {
+ init(TimerName, TimerDescription, tg);
}
Timer(const Timer &RHS) {
assert(!RHS.TG && "Can only copy uninitialized timers");
@@ -102,8 +102,8 @@ class Timer {
/// Create an uninitialized timer, client must use 'init'.
explicit Timer() {}
- void init(StringRef Name, StringRef Description);
- void init(StringRef Name, StringRef Description, TimerGroup &tg);
+ void init(StringRef TimerName, StringRef TimerDescription);
+ void init(StringRef TimerName, StringRef TimerDescription, TimerGroup &tg);
const std::string &getName() const { return Name; }
const std::string &getDescription() const { return Description; }
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index 10c9b8e0b329..613d2eaae6d3 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/lib/Support/Timer.cpp
@@ -91,14 +91,15 @@ static TimerGroup *getDefaultTimerGroup() { return &*DefaultTimerGroup; }
// Timer Implementation
//===----------------------------------------------------------------------===//
-void Timer::init(StringRef Name, StringRef Description) {
- init(Name, Description, *getDefaultTimerGroup());
+void Timer::init(StringRef TimerName, StringRef TimerDescription) {
+ init(TimerName, TimerDescription, *getDefaultTimerGroup());
}
-void Timer::init(StringRef Name, StringRef Description, TimerGroup &tg) {
+void Timer::init(StringRef TimerName, StringRef TimerDescription,
+ TimerGroup &tg) {
assert(!TG && "Timer already initialized");
- this->Name.assign(Name.begin(), Name.end());
- this->Description.assign(Description.begin(), Description.end());
+ Name.assign(TimerName.begin(), TimerName.end());
+ Description.assign(TimerDescription.begin(), TimerDescription.end());
Running = Triggered = false;
TG = &tg;
TG->addTimer(*this);
More information about the llvm-commits
mailing list