diff options
author | Yaron Keren <yaron.keren@gmail.com> | 2015-07-03 09:30:33 +0000 |
---|---|---|
committer | Yaron Keren <yaron.keren@gmail.com> | 2015-07-03 09:30:33 +0000 |
commit | 15eba5ef9530ece731666d735881f996aaa58060 (patch) | |
tree | 8c151ec3c12595a6ba41d87e87f1539f5ec06f9f | |
parent | 002088f62686c3dd1474fee044fc35a214a89d74 (diff) |
Revert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but now fails the bots.
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@241335 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | clang-modernize/LoopConvert/StmtAncestor.h | 6 | ||||
-rw-r--r-- | clang-rename/RenamingAction.cpp | 13 | ||||
-rw-r--r-- | clang-rename/RenamingAction.h | 4 | ||||
-rw-r--r-- | modularize/Modularize.cpp | 4 | ||||
-rw-r--r-- | pp-trace/PPCallbacksTracker.cpp | 2 | ||||
-rw-r--r-- | pp-trace/PPCallbacksTracker.h | 2 |
6 files changed, 17 insertions, 14 deletions
diff --git a/clang-modernize/LoopConvert/StmtAncestor.h b/clang-modernize/LoopConvert/StmtAncestor.h index fae4d131..e2ee2b9f 100644 --- a/clang-modernize/LoopConvert/StmtAncestor.h +++ b/clang-modernize/LoopConvert/StmtAncestor.h @@ -170,9 +170,9 @@ private: class DeclFinderASTVisitor : public clang::RecursiveASTVisitor<DeclFinderASTVisitor> { public: - DeclFinderASTVisitor(std::string Name, - const StmtGeneratedVarNameMap *GeneratedDecls) - : Name(std::move(Name)), GeneratedDecls(GeneratedDecls), Found(false) {} + DeclFinderASTVisitor(const std::string &Name, + const StmtGeneratedVarNameMap *GeneratedDecls) : + Name(Name), GeneratedDecls(GeneratedDecls), Found(false) { } /// Attempts to find any usages of variables name Name in Body, returning /// true when it is used in Body. This includes the generated loop variables diff --git a/clang-rename/RenamingAction.cpp b/clang-rename/RenamingAction.cpp index 98cdc14b..0c2307b9 100644 --- a/clang-rename/RenamingAction.cpp +++ b/clang-rename/RenamingAction.cpp @@ -37,11 +37,14 @@ namespace rename { class RenamingASTConsumer : public ASTConsumer { public: - RenamingASTConsumer(StringRef NewName, StringRef PrevName, + RenamingASTConsumer(const std::string &NewName, + const std::string &PrevName, const std::vector<std::string> &USRs, - tooling::Replacements &Replaces, bool PrintLocations) + tooling::Replacements &Replaces, + bool PrintLocations) : NewName(NewName), PrevName(PrevName), USRs(USRs), Replaces(Replaces), - PrintLocations(PrintLocations) {} + PrintLocations(PrintLocations) { + } void HandleTranslationUnit(ASTContext &Context) override { const auto &SourceMgr = Context.getSourceManager(); @@ -55,7 +58,7 @@ public: NewCandidates.clear(); } - auto PrevNameLen = PrevName.size(); + auto PrevNameLen = PrevName.length(); if (PrintLocations) for (const auto &Loc : RenamingCandidates) { FullSourceLoc FullLoc(Loc, SourceMgr); @@ -72,7 +75,7 @@ public: } private: - StringRef NewName, PrevName; + const std::string &NewName, &PrevName; const std::vector<std::string> &USRs; tooling::Replacements &Replaces; bool PrintLocations; diff --git a/clang-rename/RenamingAction.h b/clang-rename/RenamingAction.h index 68fe331d..d52f21d7 100644 --- a/clang-rename/RenamingAction.h +++ b/clang-rename/RenamingAction.h @@ -25,7 +25,7 @@ namespace rename { class RenamingAction { public: - RenamingAction(llvm::StringRef NewName, llvm::StringRef PrevName, + RenamingAction(const std::string &NewName, const std::string &PrevName, const std::vector<std::string> &USRs, tooling::Replacements &Replaces, bool PrintLocations = false) : NewName(NewName), PrevName(PrevName), USRs(USRs), Replaces(Replaces), @@ -35,7 +35,7 @@ public: std::unique_ptr<ASTConsumer> newASTConsumer(); private: - llvm::StringRef NewName, PrevName; + const std::string &NewName, &PrevName; const std::vector<std::string> &USRs; tooling::Replacements &Replaces; bool PrintLocations; diff --git a/modularize/Modularize.cpp b/modularize/Modularize.cpp index 4acfe72b..a309ecd3 100644 --- a/modularize/Modularize.cpp +++ b/modularize/Modularize.cpp @@ -466,9 +466,9 @@ class EntityMap : public StringMap<SmallVector<Entry, 2> > { public: DenseMap<const FileEntry *, HeaderContents> HeaderContentMismatches; - void add(StringRef Name, enum Entry::EntryKind Kind, Location Loc) { + void add(const std::string &Name, enum Entry::EntryKind Kind, Location Loc) { // Record this entity in its header. - HeaderEntry HE = {Name.str(), Loc}; + HeaderEntry HE = { Name, Loc }; CurHeaderContents[Loc.File].push_back(HE); // Check whether we've seen this entry before. diff --git a/pp-trace/PPCallbacksTracker.cpp b/pp-trace/PPCallbacksTracker.cpp index e4211b3b..8a370549 100644 --- a/pp-trace/PPCallbacksTracker.cpp +++ b/pp-trace/PPCallbacksTracker.cpp @@ -627,7 +627,7 @@ void PPCallbacksTracker::appendArgument(const char *Name, // Append a double-quoted argument to the top trace item. void PPCallbacksTracker::appendQuotedArgument(const char *Name, - llvm::StringRef Value) { + const std::string &Value) { std::string Str; llvm::raw_string_ostream SS(Str); SS << "\"" << Value << "\""; diff --git a/pp-trace/PPCallbacksTracker.h b/pp-trace/PPCallbacksTracker.h index 475e3bd4..8c2e6bb5 100644 --- a/pp-trace/PPCallbacksTracker.h +++ b/pp-trace/PPCallbacksTracker.h @@ -215,7 +215,7 @@ public: void appendArgument(const char *Name, const clang::Module *Value); /// \brief Append a double-quoted argument to the top trace item. - void appendQuotedArgument(const char *Name, llvm::StringRef Value); + void appendQuotedArgument(const char *Name, const std::string &Value); /// \brief Append a double-quoted file path argument to the top trace item. void appendFilePathArgument(const char *Name, llvm::StringRef Value); |