Skip to content

Commit 952391d

Browse files
committed
[llvm-cxxfilt] Fix -Wshadow warning. NFCI.
Local variable Decorated was shadowing the global variable Decorated llvm-svn: 360352
1 parent 4e62554 commit 952391d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,23 @@ Decorated(cl::Positional, cl::desc("<mangled>"), cl::ZeroOrMore);
5555
static std::string demangle(llvm::raw_ostream &OS, const std::string &Mangled) {
5656
int Status;
5757

58-
const char *Decorated = Mangled.c_str();
58+
const char *DecoratedStr = Mangled.c_str();
5959
if (StripUnderscore)
60-
if (Decorated[0] == '_')
61-
++Decorated;
62-
size_t DecoratedLength = strlen(Decorated);
60+
if (DecoratedStr[0] == '_')
61+
++DecoratedStr;
62+
size_t DecoratedLength = strlen(DecoratedStr);
6363

6464
char *Undecorated = nullptr;
6565

66-
if (Types || ((DecoratedLength >= 2 && strncmp(Decorated, "_Z", 2) == 0) ||
67-
(DecoratedLength >= 4 && strncmp(Decorated, "___Z", 4) == 0)))
68-
Undecorated = itaniumDemangle(Decorated, nullptr, nullptr, &Status);
66+
if (Types ||
67+
((DecoratedLength >= 2 && strncmp(DecoratedStr, "_Z", 2) == 0) ||
68+
(DecoratedLength >= 4 && strncmp(DecoratedStr, "___Z", 4) == 0)))
69+
Undecorated = itaniumDemangle(DecoratedStr, nullptr, nullptr, &Status);
6970

7071
if (!Undecorated &&
71-
(DecoratedLength > 6 && strncmp(Decorated, "__imp_", 6) == 0)) {
72+
(DecoratedLength > 6 && strncmp(DecoratedStr, "__imp_", 6) == 0)) {
7273
OS << "import thunk for ";
73-
Undecorated = itaniumDemangle(Decorated + 6, nullptr, nullptr, &Status);
74+
Undecorated = itaniumDemangle(DecoratedStr + 6, nullptr, nullptr, &Status);
7475
}
7576

7677
std::string Result(Undecorated ? Undecorated : Mangled);

0 commit comments

Comments
 (0)