]> granicus.if.org Git - clang/commitdiff
Add possibility to specify an include location for createFileIDForMemBuffer().
authorAxel Naumann <Axel.Naumann@cern.ch>
Mon, 31 Oct 2011 11:02:24 +0000 (11:02 +0000)
committerAxel Naumann <Axel.Naumann@cern.ch>
Mon, 31 Oct 2011 11:02:24 +0000 (11:02 +0000)
Useful to set up a virtual include hierarchy, e.g. to order diagnostics for ambiguous overloads from MemoryBuffers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143347 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/SourceManager.h

index 2298672093574814c8f48ca3b928c09637cb7462..62b6615f1f1bdc5ed43a81d8e6b7f1350fab75d5 100644 (file)
@@ -641,8 +641,9 @@ public:
   /// specified memory buffer.  This does no caching of the buffer and takes
   /// ownership of the MemoryBuffer, so only pass a MemoryBuffer to this once.
   FileID createFileIDForMemBuffer(const llvm::MemoryBuffer *Buffer,
-                                  int LoadedID = 0, unsigned LoadedOffset = 0) {
-    return createFileID(createMemBufferContentCache(Buffer), SourceLocation(),
+                                  int LoadedID = 0, unsigned LoadedOffset = 0,
+                                 SourceLocation IncludeLoc = SourceLocation()) {
+    return createFileID(createMemBufferContentCache(Buffer), IncludeLoc,
                         SrcMgr::C_User, LoadedID, LoadedOffset);
   }