Sorry for my inattension.
I actually have 2 patches for clang Lex and for clang-tools-extra which build
needs to be fixed after applying the first patch.
01.06.2015, 17:12, "Rafael Espíndola" <[email protected]>:
> For the first few patches you just ask someone to commit it.
>
> In this case, two things I noticed when I applied the patch:
>
> * It is for clang, so you should send it to cfe-commits.
> * It is incomplete. Looks like you only included the header changes:
>
> llvm/tools/clang/lib/Lex/PTHLexer.cpp:434:25: error: out-of-line
> definition of 'Create' does not match any declaration in
> 'clang::PTHManager'
> PTHManager *PTHManager::Create(const std::string &file,
>
> On 1 June 2015 at 02:27, Косов Евгений <[email protected]> wrote:
>> Cool. Thanks for reviewing. How now can I commit this patch into trunk?
>>
>> Eugene
>>
>> 01.06.2015, 03:12, "Rafael Espíndola" <[email protected]>:
>>> LGTM
>>>
>>> On 31 May 2015 at 15:56, Косов Евгений <[email protected]> wrote:
>>>> Hi.
>>>>
>>>> This is a small and boring patch. I'm checking a patch submitting
>>>> process. Does it make sense to change more const string references in
>>>> other part of LLVM?
>>>>
>>>> Eugene
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> [email protected]
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Eugene
Index: include/clang/Lex/Lexer.h
===================================================================
--- include/clang/Lex/Lexer.h (revision 238723)
+++ include/clang/Lex/Lexer.h (working copy)
@@ -228,7 +228,7 @@
/// Stringify - Convert the specified string into a C string by escaping '\'
/// and " characters. This does not add surrounding ""'s to the string.
/// If Charify is true, this escapes the ' character instead of ".
- static std::string Stringify(const std::string &Str, bool Charify = false);
+ static std::string Stringify(StringRef Str, bool Charify = false);
/// Stringify - Convert the specified string into a C string by escaping '\'
/// and " characters. This does not add surrounding ""'s to the string.
Index: include/clang/Lex/PPCallbacks.h
===================================================================
--- include/clang/Lex/PPCallbacks.h (revision 238723)
+++ include/clang/Lex/PPCallbacks.h (working copy)
@@ -155,7 +155,7 @@
/// \param Loc The location of the directive.
/// \param str The text of the directive.
///
- virtual void Ident(SourceLocation Loc, const std::string &str) {
+ virtual void Ident(SourceLocation Loc, StringRef str) {
}
/// \brief Callback invoked when start reading any pragma directive.
@@ -165,14 +165,13 @@
/// \brief Callback invoked when a \#pragma comment directive is read.
virtual void PragmaComment(SourceLocation Loc, const IdentifierInfo *Kind,
- const std::string &Str) {
+ StringRef Str) {
}
/// \brief Callback invoked when a \#pragma detect_mismatch directive is
/// read.
- virtual void PragmaDetectMismatch(SourceLocation Loc,
- const std::string &Name,
- const std::string &Value) {
+ virtual void PragmaDetectMismatch(SourceLocation Loc, StringRef Name,
+ StringRef Value) {
}
/// \brief Callback invoked when a \#pragma clang __debug directive is read.
@@ -375,19 +374,19 @@
Second->EndOfMainFile();
}
- void Ident(SourceLocation Loc, const std::string &str) override {
+ void Ident(SourceLocation Loc, StringRef str) override {
First->Ident(Loc, str);
Second->Ident(Loc, str);
}
void PragmaComment(SourceLocation Loc, const IdentifierInfo *Kind,
- const std::string &Str) override {
+ StringRef Str) override {
First->PragmaComment(Loc, Kind, Str);
Second->PragmaComment(Loc, Kind, Str);
}
- void PragmaDetectMismatch(SourceLocation Loc, const std::string &Name,
- const std::string &Value) override {
+ void PragmaDetectMismatch(SourceLocation Loc, StringRef Name,
+ StringRef Value) override {
First->PragmaDetectMismatch(Loc, Name, Value);
Second->PragmaDetectMismatch(Loc, Name, Value);
}
Index: include/clang/Lex/PTHManager.h
===================================================================
--- include/clang/Lex/PTHManager.h (revision 238723)
+++ include/clang/Lex/PTHManager.h (working copy)
@@ -129,7 +129,7 @@
/// Create - This method creates PTHManager objects. The 'file' argument
/// is the name of the PTH file. This method returns NULL upon failure.
- static PTHManager *Create(const std::string& file, DiagnosticsEngine &Diags);
+ static PTHManager *Create(StringRef file, DiagnosticsEngine &Diags);
void setPreprocessor(Preprocessor *pp) { PP = pp; }
Index: include/clang/Lex/Preprocessor.h
===================================================================
--- include/clang/Lex/Preprocessor.h (revision 238723)
+++ include/clang/Lex/Preprocessor.h (working copy)
@@ -890,7 +890,7 @@
///
/// These predefines are automatically injected when parsing the main file.
void setPredefines(const char *P) { Predefines = P; }
- void setPredefines(const std::string &P) { Predefines = P; }
+ void setPredefines(StringRef P) { Predefines = P; }
/// Return information about the specified preprocessor
/// identifier token.
Index: lib/Frontend/PrintPreprocessedOutput.cpp
===================================================================
--- lib/Frontend/PrintPreprocessedOutput.cpp (revision 238723)
+++ lib/Frontend/PrintPreprocessedOutput.cpp (working copy)
@@ -128,7 +128,7 @@
CharSourceRange FilenameRange, const FileEntry *File,
StringRef SearchPath, StringRef RelativePath,
const Module *Imported) override;
- void Ident(SourceLocation Loc, const std::string &str) override;
+ void Ident(SourceLocation Loc, StringRef str) override;
void PragmaMessage(SourceLocation Loc, StringRef Namespace,
PragmaMessageKind Kind, StringRef Str) override;
void PragmaDebug(SourceLocation Loc, StringRef DebugType) override;
@@ -337,11 +337,11 @@
/// Ident - Handle #ident directives when read by the preprocessor.
///
-void PrintPPOutputPPCallbacks::Ident(SourceLocation Loc, const std::string &S) {
+void PrintPPOutputPPCallbacks::Ident(SourceLocation Loc, StringRef S) {
MoveToLine(Loc);
OS.write("#ident ", strlen("#ident "));
- OS.write(&S[0], S.size());
+ OS.write(S.begin(), S.size());
EmittedTokensOnThisLine = true;
}
Index: lib/Lex/Lexer.cpp
===================================================================
--- lib/Lex/Lexer.cpp (revision 238723)
+++ lib/Lex/Lexer.cpp (working copy)
@@ -199,7 +199,7 @@
/// Stringify - Convert the specified string into a C string, with surrounding
/// ""'s, and with escaped \ and " characters.
-std::string Lexer::Stringify(const std::string &Str, bool Charify) {
+std::string Lexer::Stringify(StringRef Str, bool Charify) {
std::string Result = Str;
char Quote = Charify ? '\'' : '"';
for (unsigned i = 0, e = Result.size(); i != e; ++i) {
Index: lib/Lex/PTHLexer.cpp
===================================================================
--- lib/Lex/PTHLexer.cpp (revision 238723)
+++ lib/Lex/PTHLexer.cpp (working copy)
@@ -431,8 +431,7 @@
Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0")) << Msg;
}
-PTHManager *PTHManager::Create(const std::string &file,
- DiagnosticsEngine &Diags) {
+PTHManager *PTHManager::Create(StringRef file, DiagnosticsEngine &Diags) {
// Memory map the PTH file.
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileOrErr =
llvm::MemoryBuffer::getFile(file);
Index: pp-trace/PPCallbacksTracker.cpp
===================================================================
--- pp-trace/PPCallbacksTracker.cpp (revision 238673)
+++ pp-trace/PPCallbacksTracker.cpp (working copy)
@@ -166,8 +166,7 @@
void PPCallbacksTracker::EndOfMainFile() { beginCallback("EndOfMainFile"); }
// Callback invoked when a #ident or #sccs directive is read.
-void PPCallbacksTracker::Ident(clang::SourceLocation Loc,
- const std::string &Str) {
+void PPCallbacksTracker::Ident(clang::SourceLocation Loc, llvm::StringRef Str) {
beginCallback("Ident");
appendArgument("Loc", Loc);
appendArgument("Str", Str);
@@ -185,7 +184,7 @@
// Callback invoked when a #pragma comment directive is read.
void PPCallbacksTracker::PragmaComment(clang::SourceLocation Loc,
const clang::IdentifierInfo *Kind,
- const std::string &Str) {
+ llvm::StringRef Str) {
beginCallback("PragmaComment");
appendArgument("Loc", Loc);
appendArgument("Kind", Kind);
@@ -195,8 +194,8 @@
// Callback invoked when a #pragma detect_mismatch directive is
// read.
void PPCallbacksTracker::PragmaDetectMismatch(clang::SourceLocation Loc,
- const std::string &Name,
- const std::string &Value) {
+ llvm::StringRef Name,
+ llvm::StringRef Value) {
beginCallback("PragmaDetectMismatch");
appendArgument("Loc", Loc);
appendArgument("Name", Name);
Index: pp-trace/PPCallbacksTracker.h
===================================================================
--- pp-trace/PPCallbacksTracker.h (revision 238673)
+++ pp-trace/PPCallbacksTracker.h (working copy)
@@ -100,14 +100,14 @@
void moduleImport(clang::SourceLocation ImportLoc, clang::ModuleIdPath Path,
const clang::Module *Imported) override;
void EndOfMainFile() override;
- void Ident(clang::SourceLocation Loc, const std::string &str) override;
+ void Ident(clang::SourceLocation Loc, llvm::StringRef str) override;
void PragmaDirective(clang::SourceLocation Loc,
clang::PragmaIntroducerKind Introducer) override;
void PragmaComment(clang::SourceLocation Loc,
const clang::IdentifierInfo *Kind,
- const std::string &Str) override;
- void PragmaDetectMismatch(clang::SourceLocation Loc, const std::string &Name,
- const std::string &Value) override;
+ llvm::StringRef Str) override;
+ void PragmaDetectMismatch(clang::SourceLocation Loc, llvm::StringRef Name,
+ llvm::StringRef Value) override;
void PragmaDebug(clang::SourceLocation Loc,
llvm::StringRef DebugType) override;
void PragmaMessage(clang::SourceLocation Loc, llvm::StringRef Namespace,
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits