diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-24 06:57:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-24 06:57:14 +0000 |
commit | d8e3083840fef752d11ca183f42786470ed061e3 (patch) | |
tree | 9ef03e5fc1e183197e3fa18c35ca7de5cb472a09 /include | |
parent | 1cf12bfa80825cce46be35a0a2b54f281b0b51db (diff) |
Use a smallstring instead of an std::string in FileChanged to avoid some malloc traffic.
This speeds up -E on xalancbmk by 2.4%
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 2 | ||||
-rw-r--r-- | include/clang/Lex/Lexer.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index dd8a86cc7e..825e7dee65 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -240,7 +240,7 @@ public: /// getSourceName - This method returns the name of the file or buffer that /// the SourceLocation specifies. This can be modified with #line directives, /// etc. - std::string getSourceName(SourceLocation Loc); + const char *getSourceName(SourceLocation Loc); /// Given a SourceLocation object, return the logical location referenced by /// the ID. This logical location is subject to #line directives, etc. diff --git a/include/clang/Lex/Lexer.h b/include/clang/Lex/Lexer.h index 6cff000207..18c2fca31a 100644 --- a/include/clang/Lex/Lexer.h +++ b/include/clang/Lex/Lexer.h @@ -17,6 +17,7 @@ #include "clang/Lex/Token.h" #include "clang/Lex/MultipleIncludeOpt.h" #include "clang/Basic/LangOptions.h" +#include "llvm/ADT/SmallVector.h" #include <string> #include <vector> #include <cassert> @@ -173,6 +174,10 @@ public: /// If Charify is true, this escapes the ' character instead of ". static std::string Stringify(const std::string &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. + static void Stringify(llvm::SmallVectorImpl<char> &Str); + //===--------------------------------------------------------------------===// // Internal implementation interfaces. private: |