diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-10-17 23:52:43 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-10-17 23:52:43 +0000 |
commit | eaea925e70e3ee85809e572aa8474b8dfc491af7 (patch) | |
tree | 50799fad70b7707b3224676753c8c6632ae25c80 | |
parent | 8b944468737f9bf91cd99454b54f0134fb7e52ee (diff) |
StringRefize some parts of Diagnostic API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84377 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/Diagnostic.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h index 380192e9da..b593cd5f82 100644 --- a/include/clang/Basic/Diagnostic.h +++ b/include/clang/Basic/Diagnostic.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_DIAGNOSTIC_H #include "clang/Basic/SourceLocation.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/type_traits.h" #include <string> #include <vector> @@ -107,7 +108,7 @@ public: /// \brief Create a code modification hint that inserts the given /// code string at a specific location. static CodeModificationHint CreateInsertion(SourceLocation InsertionLoc, - const std::string &Code) { + llvm::StringRef Code) { CodeModificationHint Hint; Hint.InsertionLoc = InsertionLoc; Hint.CodeToInsert = Code; @@ -125,7 +126,7 @@ public: /// \brief Create a code modification hint that replaces the given /// source range with the given code string. static CodeModificationHint CreateReplacement(SourceRange RemoveRange, - const std::string &Code) { + llvm::StringRef Code) { CodeModificationHint Hint; Hint.RemoveRange = RemoveRange; Hint.InsertionLoc = RemoveRange.getBegin(); @@ -546,7 +547,7 @@ public: /// return Diag(...); operator bool() const { return true; } - void AddString(const std::string &S) const { + void AddString(llvm::StringRef S) const { assert(NumArgs < Diagnostic::MaxArguments && "Too many arguments to diagnostic!"); if (DiagObj) { @@ -581,7 +582,7 @@ public: }; inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, - const std::string &S) { + llvm::StringRef S) { DB.AddString(S); return DB; } |