aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Lex/DirectoryLookup.h13
-rw-r--r--include/clang/Lex/HeaderMap.h8
-rw-r--r--include/clang/Lex/HeaderSearch.h9
-rw-r--r--include/clang/Lex/PPCallbacks.h18
-rw-r--r--include/clang/Lex/PreprocessingRecord.h3
-rw-r--r--include/clang/Lex/Preprocessor.h3
6 files changed, 39 insertions, 15 deletions
diff --git a/include/clang/Lex/DirectoryLookup.h b/include/clang/Lex/DirectoryLookup.h
index 64687a18e2..1ee19266f3 100644
--- a/include/clang/Lex/DirectoryLookup.h
+++ b/include/clang/Lex/DirectoryLookup.h
@@ -18,6 +18,7 @@
namespace llvm {
class StringRef;
+ template <typename T> class SmallVectorImpl;
}
namespace clang {
class HeaderMap;
@@ -121,11 +122,17 @@ public:
/// LookupFile - Lookup the specified file in this search path, returning it
/// if it exists or returning null if not.
- const FileEntry *LookupFile(llvm::StringRef Filename, HeaderSearch &HS) const;
+ /// If RawPath is not NULL and the file is found, RawPath will be set to the
+ /// raw path at which the file was found in the file system. For example,
+ /// for a search path ".." and a filename "../file.h" this would be
+ /// "../../file.h".
+ const FileEntry *LookupFile(llvm::StringRef Filename, HeaderSearch &HS,
+ llvm::SmallVectorImpl<char> *RawPath) const;
private:
- const FileEntry *DoFrameworkLookup(llvm::StringRef Filename,
- HeaderSearch &HS) const;
+ const FileEntry *DoFrameworkLookup(
+ llvm::StringRef Filename, HeaderSearch &HS,
+ llvm::SmallVectorImpl<char> *RawPath) const;
};
diff --git a/include/clang/Lex/HeaderMap.h b/include/clang/Lex/HeaderMap.h
index 8a5c83ecf4..54c7eb47c8 100644
--- a/include/clang/Lex/HeaderMap.h
+++ b/include/clang/Lex/HeaderMap.h
@@ -17,6 +17,7 @@
namespace llvm {
class MemoryBuffer;
class StringRef;
+ template <typename T> class SmallVectorImpl;
}
namespace clang {
class FileEntry;
@@ -47,7 +48,12 @@ public:
/// LookupFile - Check to see if the specified relative filename is located in
/// this HeaderMap. If so, open it and return its FileEntry.
- const FileEntry *LookupFile(llvm::StringRef Filename, FileManager &FM) const;
+ /// If RawPath is not NULL and the file is found, RawPath will be set to the
+ /// raw path at which the file was found in the file system. For example,
+ /// for a search path ".." and a filename "../file.h" this would be
+ /// "../../file.h".
+ const FileEntry *LookupFile(llvm::StringRef Filename, FileManager &FM,
+ llvm::SmallVectorImpl<char> *RawPath) const;
/// getFileName - Return the filename of the headermap.
const char *getFileName() const;
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index ed84ebc144..a63386bd6b 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -192,15 +192,18 @@ public:
const FileEntry *LookupFile(llvm::StringRef Filename, bool isAngled,
const DirectoryLookup *FromDir,
const DirectoryLookup *&CurDir,
- const FileEntry *CurFileEnt);
+ const FileEntry *CurFileEnt,
+ llvm::SmallVectorImpl<char> *RawPath);
/// LookupSubframeworkHeader - Look up a subframework for the specified
/// #include file. For example, if #include'ing <HIToolbox/HIToolbox.h> from
/// within ".../Carbon.framework/Headers/Carbon.h", check to see if HIToolbox
/// is a subframework within Carbon.framework. If so, return the FileEntry
/// for the designated file, otherwise return null.
- const FileEntry *LookupSubframeworkHeader(llvm::StringRef Filename,
- const FileEntry *RelativeFileEnt);
+ const FileEntry *LookupSubframeworkHeader(
+ llvm::StringRef Filename,
+ const FileEntry *RelativeFileEnt,
+ llvm::SmallVectorImpl<char> *RawPath);
/// LookupFrameworkCache - Look up the specified framework name in our
/// framework cache, returning the DirectoryEntry it is in if we know,
diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h
index b2a80a6298..242986dae5 100644
--- a/include/clang/Lex/PPCallbacks.h
+++ b/include/clang/Lex/PPCallbacks.h
@@ -75,12 +75,17 @@ public:
///
/// \param EndLoc The location of the last token within the inclusion
/// directive.
+ ///
+ /// \param RawPath Contains the raw path at which the file was found in the
+ /// file system. For example, for a search path ".." and a filename
+ /// "../file.h" this would be "../../file.h".
virtual void InclusionDirective(SourceLocation HashLoc,
const Token &IncludeTok,
llvm::StringRef FileName,
bool IsAngled,
const FileEntry *File,
- SourceLocation EndLoc) {
+ SourceLocation EndLoc,
+ const llvm::SmallVectorImpl<char> &RawPath) {
}
/// EndOfMainFile - This callback is invoked when the end of the main file is
@@ -188,11 +193,12 @@ public:
llvm::StringRef FileName,
bool IsAngled,
const FileEntry *File,
- SourceLocation EndLoc) {
- First->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, File,
- EndLoc);
- Second->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, File,
- EndLoc);
+ SourceLocation EndLoc,
+ const llvm::SmallVectorImpl<char> &RawPath) {
+ First->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, File,
+ EndLoc, RawPath);
+ Second->InclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, File,
+ EndLoc, RawPath);
}
virtual void EndOfMainFile() {
diff --git a/include/clang/Lex/PreprocessingRecord.h b/include/clang/Lex/PreprocessingRecord.h
index afd7ae1187..f5066d4bfd 100644
--- a/include/clang/Lex/PreprocessingRecord.h
+++ b/include/clang/Lex/PreprocessingRecord.h
@@ -341,7 +341,8 @@ namespace clang {
llvm::StringRef FileName,
bool IsAngled,
const FileEntry *File,
- SourceLocation EndLoc);
+ SourceLocation EndLoc,
+ const llvm::SmallVectorImpl<char> &RawPath);
};
} // end namespace clang
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 42af489d90..5dc13eb4ea 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -832,7 +832,8 @@ public:
/// for system #include's or not (i.e. using <> instead of "").
const FileEntry *LookupFile(llvm::StringRef Filename,
bool isAngled, const DirectoryLookup *FromDir,
- const DirectoryLookup *&CurDir);
+ const DirectoryLookup *&CurDir,
+ llvm::SmallVectorImpl<char> *RawPath);
/// GetCurLookup - The DirectoryLookup structure used to find the current
/// FileEntry, if CurLexer is non-null and if applicable. This allows us to