diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-09 15:58:16 +0000 | 
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-09 15:58:16 +0000 | 
| commit | 952391d8eb8a99f5fd731853bd3144daf81d85eb (patch) | |
| tree | 9278d86e47522425ac19269cd7b5b1d9daf4fd23 | |
| parent | 4e62554bfae2703b797ddff64e583aed0c4a7e35 (diff) | |
| download | bcm5719-llvm-952391d8eb8a99f5fd731853bd3144daf81d85eb.tar.gz bcm5719-llvm-952391d8eb8a99f5fd731853bd3144daf81d85eb.zip  | |
[llvm-cxxfilt] Fix -Wshadow warning. NFCI.
Local variable Decorated was shadowing the global variable Decorated
llvm-svn: 360352
| -rw-r--r-- | llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp | 19 | 
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp index a082dc7cfe8..eb84c3e8306 100644 --- a/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp +++ b/llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp @@ -55,22 +55,23 @@ Decorated(cl::Positional, cl::desc("<mangled>"), cl::ZeroOrMore);  static std::string demangle(llvm::raw_ostream &OS, const std::string &Mangled) {    int Status; -  const char *Decorated = Mangled.c_str(); +  const char *DecoratedStr = Mangled.c_str();    if (StripUnderscore) -    if (Decorated[0] == '_') -      ++Decorated; -  size_t DecoratedLength = strlen(Decorated); +    if (DecoratedStr[0] == '_') +      ++DecoratedStr; +  size_t DecoratedLength = strlen(DecoratedStr);    char *Undecorated = nullptr; -  if (Types || ((DecoratedLength >= 2 && strncmp(Decorated, "_Z", 2) == 0) || -                (DecoratedLength >= 4 && strncmp(Decorated, "___Z", 4) == 0))) -    Undecorated = itaniumDemangle(Decorated, nullptr, nullptr, &Status); +  if (Types || +      ((DecoratedLength >= 2 && strncmp(DecoratedStr, "_Z", 2) == 0) || +       (DecoratedLength >= 4 && strncmp(DecoratedStr, "___Z", 4) == 0))) +    Undecorated = itaniumDemangle(DecoratedStr, nullptr, nullptr, &Status);    if (!Undecorated && -      (DecoratedLength > 6 && strncmp(Decorated, "__imp_", 6) == 0)) { +      (DecoratedLength > 6 && strncmp(DecoratedStr, "__imp_", 6) == 0)) {      OS << "import thunk for "; -    Undecorated = itaniumDemangle(Decorated + 6, nullptr, nullptr, &Status); +    Undecorated = itaniumDemangle(DecoratedStr + 6, nullptr, nullptr, &Status);    }    std::string Result(Undecorated ? Undecorated : Mangled);  | 

