r222224 - [ASTReader] Add a convenience function to retrieve all the input files of a module file.

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Nov 17 21:24:18 PST 2014


Author: akirtzidis
Date: Mon Nov 17 23:24:18 2014
New Revision: 222224

URL: http://llvm.org/viewvc/llvm-project?rev=222224&view=rev
Log:
[ASTReader] Add a convenience function to retrieve all the input files of a module file.

Modified:
    cfe/trunk/include/clang/Serialization/ASTReader.h
    cfe/trunk/lib/Serialization/ASTReader.cpp

Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=222224&r1=222223&r2=222224&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Mon Nov 17 23:24:18 2014
@@ -2147,6 +2147,10 @@ public:
 
   //RIDErief Loads comments ranges.
   void ReadComments() override;
+
+  /// Return all input files for the given module file.
+  void getInputFiles(ModuleFile &F,
+                     SmallVectorImpl<serialization::InputFile> &Files);
 };
 
 /// \brief Helper class that saves the current stream position and

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=222224&r1=222223&r2=222224&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Mon Nov 17 23:24:18 2014
@@ -8142,6 +8142,14 @@ void ASTReader::ReadComments() {
   }
 }
 
+void ASTReader::getInputFiles(ModuleFile &F,
+                             SmallVectorImpl<serialization::InputFile> &Files) {
+  for (unsigned I = 0, E = F.InputFilesLoaded.size(); I != E; ++I) {
+    unsigned ID = I+1;
+    Files.push_back(getInputFile(F, ID));
+  }
+}
+
 std::string ASTReader::getOwningModuleNameForDiagnostic(const Decl *D) {
   // If we know the owning module, use it.
   if (Module *M = D->getOwningModule())





More information about the cfe-commits mailing list