summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-07-03 09:30:33 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-07-03 09:30:33 +0000
commit40178c352e5b8841df4862490d112c2a1db0b058 (patch)
tree283af96289a77e749e430c0cd9015b7df65b618f
parent93834805245d840c4c0f6ca30b486cb491d2b7c2 (diff)
downloadbcm5719-llvm-40178c352e5b8841df4862490d112c2a1db0b058.tar.gz
bcm5719-llvm-40178c352e5b8841df4862490d112c2a1db0b058.zip
Revert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but now fails the bots.
llvm-svn: 241335
-rw-r--r--clang-tools-extra/clang-modernize/LoopConvert/StmtAncestor.h6
-rw-r--r--clang-tools-extra/clang-rename/RenamingAction.cpp13
-rw-r--r--clang-tools-extra/clang-rename/RenamingAction.h4
-rw-r--r--clang-tools-extra/modularize/Modularize.cpp4
-rw-r--r--clang-tools-extra/pp-trace/PPCallbacksTracker.cpp2
-rw-r--r--clang-tools-extra/pp-trace/PPCallbacksTracker.h2
-rw-r--r--clang/include/clang/ASTMatchers/ASTMatchers.h2
-rw-r--r--clang/include/clang/ASTMatchers/ASTMatchersInternal.h3
-rw-r--r--clang/include/clang/ASTMatchers/Dynamic/VariantValue.h6
-rw-r--r--clang/include/clang/Frontend/CompilerInstance.h15
-rw-r--r--clang/lib/ASTMatchers/Dynamic/Parser.cpp2
-rw-r--r--clang/lib/ASTMatchers/Dynamic/VariantValue.cpp4
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp6
13 files changed, 37 insertions, 32 deletions
diff --git a/clang-tools-extra/clang-modernize/LoopConvert/StmtAncestor.h b/clang-tools-extra/clang-modernize/LoopConvert/StmtAncestor.h
index fae4d131347..e2ee2b9fd4e 100644
--- a/clang-tools-extra/clang-modernize/LoopConvert/StmtAncestor.h
+++ b/clang-tools-extra/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-tools-extra/clang-rename/RenamingAction.cpp b/clang-tools-extra/clang-rename/RenamingAction.cpp
index 98cdc14b75d..0c2307b9653 100644
--- a/clang-tools-extra/clang-rename/RenamingAction.cpp
+++ b/clang-tools-extra/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-tools-extra/clang-rename/RenamingAction.h b/clang-tools-extra/clang-rename/RenamingAction.h
index 68fe331daf0..d52f21d7c23 100644
--- a/clang-tools-extra/clang-rename/RenamingAction.h
+++ b/clang-tools-extra/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/clang-tools-extra/modularize/Modularize.cpp b/clang-tools-extra/modularize/Modularize.cpp
index 4acfe72b42e..a309ecd3286 100644
--- a/clang-tools-extra/modularize/Modularize.cpp
+++ b/clang-tools-extra/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/clang-tools-extra/pp-trace/PPCallbacksTracker.cpp b/clang-tools-extra/pp-trace/PPCallbacksTracker.cpp
index e4211b3b94b..8a3705495ad 100644
--- a/clang-tools-extra/pp-trace/PPCallbacksTracker.cpp
+++ b/clang-tools-extra/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/clang-tools-extra/pp-trace/PPCallbacksTracker.h b/clang-tools-extra/pp-trace/PPCallbacksTracker.h
index 475e3bd4330..8c2e6bb55d2 100644
--- a/clang-tools-extra/pp-trace/PPCallbacksTracker.h
+++ b/clang-tools-extra/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);
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 281d6370e5c..e7a97a7ff74 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -112,7 +112,7 @@ private:
///
/// FIXME: Do we want to support this now that we have bind()?
template <typename T>
-internal::Matcher<T> id(StringRef ID,
+internal::Matcher<T> id(const std::string &ID,
const internal::BindableMatcher<T> &InnerMatcher) {
return InnerMatcher.bind(ID);
}
diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
index b494647d79b..cbaa4ba27ce 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
@@ -140,7 +140,8 @@ public:
};
/// \brief Add a binding from an id to a node.
- void setBinding(StringRef Id, const ast_type_traits::DynTypedNode &DynNode) {
+ void setBinding(const std::string &Id,
+ const ast_type_traits::DynTypedNode &DynNode) {
if (Bindings.empty())
Bindings.emplace_back();
for (BoundNodesMap &Binding : Bindings)
diff --git a/clang/include/clang/ASTMatchers/Dynamic/VariantValue.h b/clang/include/clang/ASTMatchers/Dynamic/VariantValue.h
index c391b24a333..78aa9dc82a9 100644
--- a/clang/include/clang/ASTMatchers/Dynamic/VariantValue.h
+++ b/clang/include/clang/ASTMatchers/Dynamic/VariantValue.h
@@ -242,7 +242,7 @@ struct VariantMatcher::TypedMatcherOps final : VariantMatcher::MatcherOps {
///
/// Supported types:
/// - \c unsigned
-/// - \c llvm::StringRef
+/// - \c std::string
/// - \c VariantMatcher (\c DynTypedMatcher / \c Matcher<T>)
class VariantValue {
public:
@@ -254,7 +254,7 @@ public:
/// \brief Specific constructors for each supported type.
VariantValue(unsigned Unsigned);
- VariantValue(StringRef String);
+ VariantValue(const std::string &String);
VariantValue(const VariantMatcher &Matchers);
/// \brief Returns true iff this is not an empty value.
@@ -269,7 +269,7 @@ public:
/// \brief String value functions.
bool isString() const;
const std::string &getString() const;
- void setString(StringRef String);
+ void setString(const std::string &String);
/// \brief Matcher value functions.
bool isMatcher() const;
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h
index 084d876a2ae..9cd806c99b8 100644
--- a/clang/include/clang/Frontend/CompilerInstance.h
+++ b/clang/include/clang/Frontend/CompilerInstance.h
@@ -157,10 +157,9 @@ class CompilerInstance : public ModuleLoader {
std::string TempFilename;
std::unique_ptr<raw_ostream> OS;
- OutputFile(std::string filename, std::string tempFilename,
+ OutputFile(const std::string &filename, const std::string &tempFilename,
std::unique_ptr<raw_ostream> OS)
- : Filename(std::move(filename)), TempFilename(std::move(tempFilename)),
- OS(std::move(OS)) {}
+ : Filename(filename), TempFilename(tempFilename), OS(std::move(OS)) {}
OutputFile(OutputFile &&O)
: Filename(std::move(O.Filename)),
TempFilename(std::move(O.TempFilename)), OS(std::move(O.OS)) {}
@@ -615,7 +614,7 @@ public:
///
/// \return - The new object on success, or null on failure.
static IntrusiveRefCntPtr<ASTReader> createPCHExternalASTSource(
- StringRef Path, StringRef Sysroot, bool DisablePCHValidation,
+ StringRef Path, const std::string &Sysroot, bool DisablePCHValidation,
bool AllowPCHWithCompilerErrors, Preprocessor &PP, ASTContext &Context,
const PCHContainerOperations &PCHContainerOps,
void *DeserializationListener, bool OwnDeserializationListener,
@@ -628,9 +627,11 @@ public:
/// Create a code completion consumer to print code completion results, at
/// \p Filename, \p Line, and \p Column, to the given output stream \p OS.
- static CodeCompleteConsumer *createCodeCompletionConsumer(
- Preprocessor &PP, StringRef Filename, unsigned Line, unsigned Column,
- const CodeCompleteOptions &Opts, raw_ostream &OS);
+ static CodeCompleteConsumer *
+ createCodeCompletionConsumer(Preprocessor &PP, const std::string &Filename,
+ unsigned Line, unsigned Column,
+ const CodeCompleteOptions &Opts,
+ raw_ostream &OS);
/// \brief Create the Sema object to be used for parsing.
void createSema(TranslationUnitKind TUKind,
diff --git a/clang/lib/ASTMatchers/Dynamic/Parser.cpp b/clang/lib/ASTMatchers/Dynamic/Parser.cpp
index 96a78cd9f8f..9930c530c08 100644
--- a/clang/lib/ASTMatchers/Dynamic/Parser.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/Parser.cpp
@@ -216,7 +216,7 @@ private:
if (Code[Length] == Marker) {
Result->Kind = TokenInfo::TK_Literal;
Result->Text = Code.substr(0, Length + 1);
- Result->Value = Code.substr(1, Length - 1);
+ Result->Value = Code.substr(1, Length - 1).str();
Code = Code.drop_front(Length + 1);
return;
}
diff --git a/clang/lib/ASTMatchers/Dynamic/VariantValue.cpp b/clang/lib/ASTMatchers/Dynamic/VariantValue.cpp
index 9d8be470058..a88b7070123 100644
--- a/clang/lib/ASTMatchers/Dynamic/VariantValue.cpp
+++ b/clang/lib/ASTMatchers/Dynamic/VariantValue.cpp
@@ -249,7 +249,7 @@ VariantValue::VariantValue(unsigned Unsigned) : Type(VT_Nothing) {
setUnsigned(Unsigned);
}
-VariantValue::VariantValue(StringRef String) : Type(VT_Nothing) {
+VariantValue::VariantValue(const std::string &String) : Type(VT_Nothing) {
setString(String);
}
@@ -319,7 +319,7 @@ const std::string &VariantValue::getString() const {
return *Value.String;
}
-void VariantValue::setString(StringRef NewValue) {
+void VariantValue::setString(const std::string &NewValue) {
reset();
Type = VT_String;
Value.String = new std::string(NewValue);
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index f42198df4f8..6b0fed67618 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -405,7 +405,7 @@ void CompilerInstance::createPCHExternalASTSource(
}
IntrusiveRefCntPtr<ASTReader> CompilerInstance::createPCHExternalASTSource(
- StringRef Path, StringRef Sysroot, bool DisablePCHValidation,
+ StringRef Path, const std::string &Sysroot, bool DisablePCHValidation,
bool AllowPCHWithCompilerErrors, Preprocessor &PP, ASTContext &Context,
const PCHContainerOperations &PCHContainerOps,
void *DeserializationListener, bool OwnDeserializationListener,
@@ -413,7 +413,7 @@ IntrusiveRefCntPtr<ASTReader> CompilerInstance::createPCHExternalASTSource(
HeaderSearchOptions &HSOpts = PP.getHeaderSearchInfo().getHeaderSearchOpts();
IntrusiveRefCntPtr<ASTReader> Reader(new ASTReader(
- PP, Context, PCHContainerOps, Sysroot.empty() ? "" : Sysroot.data(),
+ PP, Context, PCHContainerOps, Sysroot.empty() ? "" : Sysroot.c_str(),
DisablePCHValidation, AllowPCHWithCompilerErrors,
/*AllowConfigurationMismatch*/ false, HSOpts.ModulesValidateSystemHeaders,
UseGlobalModuleIndex));
@@ -502,7 +502,7 @@ void CompilerInstance::createFrontendTimer() {
CodeCompleteConsumer *
CompilerInstance::createCodeCompletionConsumer(Preprocessor &PP,
- StringRef Filename,
+ const std::string &Filename,
unsigned Line,
unsigned Column,
const CodeCompleteOptions &Opts,
OpenPOWER on IntegriCloud