return-empty-string-non-mangled.patch 659 B

1234567891011121314151617181920
  1. Author: Michael Wu <mwu@mozilla.com>
  2. Date: Thu Sep 24 11:36:08 2015 -0400
  3. Return an empty string when a symbol isn't mangled
  4. diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
  5. --- a/clang/tools/libclang/CIndex.cpp
  6. +++ b/clang/tools/libclang/CIndex.cpp
  7. @@ -3990,6 +3990,10 @@
  8. ASTContext &Ctx = ND->getASTContext();
  9. std::unique_ptr<MangleContext> MC(Ctx.createMangleContext());
  10. + // Don't mangle if we don't need to.
  11. + if (!MC->shouldMangleCXXName(ND))
  12. + return cxstring::createEmpty();
  13. +
  14. std::string FrontendBuf;
  15. llvm::raw_string_ostream FrontendBufOS(FrontendBuf);
  16. if (MC->shouldMangleDeclName(ND)) {