summaryrefslogtreecommitdiffstats
path: root/clang/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang')
-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
4 files changed, 14 insertions, 12 deletions
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,
OpenPOWER on IntegriCloud