Home | History | Annotate | Download | only in Serialization

Lines Matching defs:File

1 //===-- ASTReader.cpp - AST File Reader ----------------------------------===//
5 // This file is distributed under the University of Illinois Open Source
10 // This file defines the ASTReader class, which reads AST files.
433 // If the original import came from a file explicitly generated by the user,
436 // module import of an implicitly-loaded module file.
522 // AST file. If so, we should reject the AST file. Unfortunately, this
581 StringRef File = ExistingPPOpts.Includes[I];
582 if (File == ExistingPPOpts.ImplicitPCHInclude)
585 if (std::find(PPOpts.Includes.begin(), PPOpts.Includes.end(), File)
590 SuggestedPredefines += File;
595 StringRef File = ExistingPPOpts.MacroIncludes[I];
597 File)
602 SuggestedPredefines += File;
1076 // Parse the file names
1079 // Extract the file name
1089 assert(FID >= 0 && "Serialized line entries for non-local file.");
1095 assert(NumEntries && "no line entries for file ID");
1128 Error("malformed block record in AST file");
1134 Error("malformed source manager block record in AST file");
1145 Error("malformed block record in AST file");
1170 /// \brief If a header file is not found at the path that we expect it to be
1171 /// and the PCH file was moved from its original location, try to resolve the
1172 /// file by assuming that header+PCH were moved together and the header is in
1179 "No point trying to resolve the file if the PCH dir didn't change");
1208 Error("source location entry ID out-of-range for AST file");
1226 Error("could not decompress embedded file contents");
1246 Error("incorrectly-formatted source location entry in AST file");
1254 Error("incorrectly-formatted source location entry in AST file");
1258 // We will detect whether a file changed and return 'Failure' for it, but
1262 const FileEntry *File = IF.getFile();
1265 // Note that we only check if a File was returned. If it was out-of-date
1268 if (!File)
1273 // This is the module's main file.
1278 FileID FID = SourceMgr.createFileID(File, IncludeLoc, FileCharacter,
1295 = SourceMgr.getOrCreateContentCache(File,
1300 auto Buffer = ReadBuffer(SLocEntryCursor, File->getName());
1303 SourceMgr.overrideFileContents(File, std::move(Buffer));
1348 Error("source location entry ID out-of-range for AST file");
1352 // Find which module file this entry lands in.
1370 // Main file is the importer.
1371 assert(SourceMgr.getMainFileID().isValid() && "missing main file");
1432 Error("malformed block record in AST file");
1507 // If we see a TOKEN before a PP_MACRO_*, then the file is
1657 // If there was no preprocessor block, skip this file.
1671 Error("malformed block record in AST file");
1702 /// \brief Visitor class used to look up identifirs in an AST file.
1724 // If we've already searched this module file, skip it now.
1814 Error("malformed block record in AST file");
1834 Error("malformed block record in AST file");
1903 // Go find this input file.
1914 "invalid record type for input file");
1929 // If this ID is bogus, just return an empty input file.
1933 // If we've already loaded this input file, return it.
1940 // Go find this input file.
1952 const FileEntry *File = FileMgr.getFile(Filename, /*OpenFile=*/false);
1954 // If we didn't find the file, resolve it relative to the
1955 // original directory from which this AST file was created.
1956 if (File == nullptr && !F.OriginalDir.empty() && !CurrentDir.empty() &&
1962 File = FileMgr.getFile(Resolved);
1965 // For an overridden file, create a virtual file with the stored
1967 if ((Overridden || Transient) && File == nullptr)
1968 File = FileMgr.getVirtualFile(Filename, StoredSize, StoredTime);
1970 if (File == nullptr) {
1972 std::string ErrorStr = "could not find file '";
1974 ErrorStr += "' referenced by AST file '";
1979 // Record that we didn't find the file.
1984 // Check if there was a request to override the contents of the file
1985 // that was part of the precompiled header. Overridding such a file
1990 if ((!Overridden && !Transient) && SM.isFileOverridden(File)) {
1994 // that the original file will be used.
2000 SM.disableFileContentsOverride(File);
2001 // The FileEntry is a virtual file entry with the size of the contents
2004 FileMgr.modifyFileEntry(const_cast<FileEntry*>(File),
2010 // For an overridden file, there is nothing to validate.
2012 (StoredSize != File->getSize() ||
2013 (StoredTime && StoredTime != File->getModificationTime() &&
2041 // FIXME: If the file is overridden and we've already opened it,
2044 InputFile IF = InputFile(File, Overridden || Transient, IsOutOfDate);
2046 // Note that we've loaded this input file.
2051 /// \brief If we are loading a relocatable PCH or module file, and the filename
2053 /// the file name.
2173 Error("malformed block record in AST file");
2186 Error("malformed block record in AST file");
2241 Error("malformed block record in AST file");
2251 // Should we allow the configuration of the module file to differ from
2263 Error("malformed block record in AST file");
2277 Error("malformed block record in AST file");
2284 Error("malformed block record in AST file");
2344 // Read information about the AST file.
2362 // Load the AST file.
2410 // If we've already loaded a module map file covering this module, we may
2455 Error("malformed block record in AST file");
2459 // Read all of the records and blocks for the AST file.
2466 Error("error at end of module block in AST file");
2492 Error("malformed block record in AST file");
2504 Error("malformed block record in AST file");
2515 Error("malformed preprocessor detail record in AST file");
2541 Error("malformed comments block in AST file");
2550 Error("malformed block record in AST file");
2571 Error("duplicate TYPE_OFFSET record in AST file");
2595 Error("duplicate DECL_OFFSET record in AST file");
2661 Error("duplicate IDENTIFIER_OFFSET record in AST file");
2932 Error("Multiple SOURCE_LOCATION_PRELOADS records in AST file");
3025 Error("invalid DECL_UPDATE_OFFSETS block in AST file");
3042 Error("duplicate OBJC_CATEGORIES_MAP record in AST file");
3156 Error("duplicate MACRO_OFFSET record in AST file");
3226 // module map file exists or matches.
3231 // verify that it is found in the same module map file as we saved. If the
3232 // top-level AST file is a main file, skip this check because there is no
3238 // An implicitly-loaded module file should have its module listed in some
3239 // module map file that we've already loaded.
3261 // Check the primary module map file.
3264 assert(ModMap && "found module is missing module map file");
3281 Error("could not find file '" + Filename +"' referenced by AST file");
3435 // Overwrite the timestamp file contents so that file's mtime changes.
3441 OS << "Timestamp file\n";
3444 /// \brief Given a cursor at the start of an AST file, scan ahead and drop the
3481 // Defer any pending actions until we get to the end of reading the AST file.
3565 // Mark this identifier as being from an AST file so that we can track
3615 SubmoduleID GlobalID = getGlobalSubmoduleID(*Unresolved.File,Unresolved.ID);
3660 // If this AST file is a precompiled preamble, then set the
3661 // preamble file ID of the source manager to the file source file
3698 /// \brief Whether \p Stream starts with the AST/PCH file magic number 'CPCH'.
3715 return 2; // main source file
3742 // Load module file below.
3746 // The module file was missing; if the client can handle that, return
3758 // We couldn't load the module file because it is out-of-date. If the
3770 assert(M && "Missing module file");
3801 Error("invalid record at top-level of AST file");
3813 // Check that we didn't try to load a non-module AST file as a module.
3816 // a PCH file sort of works, but it's a bit wonky.
3849 Error("malformed block record in AST file");
3859 /// Parse a record and blob containing module file extension metadata.
3912 // Find a module file extension with this block name.
3946 if (unsigned File = SpecialTypes[SPECIAL_TYPE_FILE]) {
3947 QualType FileType = GetType(File);
3949 Error("FILE type is NULL");
3959 Error("Invalid FILE type in AST file");
3980 Error("Invalid jmp_buf type in AST file");
4000 assert(Tag && "Invalid sigjmp_buf type in AST file");
4036 assert(Tag && "Invalid ucontext_t type in AST file");
4052 // Re-export any modules that were imported by a non-module AST file.
4096 /// \brief Retrieve the name of the original source file name
4097 /// directly from the AST file, without actually loading the AST
4098 /// file.
4102 // Open the AST file.
4199 // Open the AST file.
4307 // Go find this input file.
4342 // Read information about the AST file.
4357 // Look for module file extension blocks, if requested.
4418 Error("malformed submodule block record in AST file");
4432 Error("malformed block record in AST file");
4502 if (CurFile != F.File) {
4507 << F.File->getName();
4513 CurrentModule->setASTFile(F.File);
4529 // Clear out data that will be replaced by what is in the module file.
4539 // imported module file.
4556 // point to a different copy of the file
4559 // after input file validation only real problems would remain and we
4624 Unresolved.File = &F;
4637 Unresolved.File = &F;
4667 Unresolved.File = &F;
4683 /// This routine parses the language options from the AST file and then gives
4686 /// \returns true if the listener deems the file unacceptable, false otherwise.
4943 const FileEntry *File = nullptr;
4945 File = PP.getFileManager().getFile(FullFileName);
4954 File,
5077 /// entity with index \arg Index came from file \arg FID.
5099 /// \brief Visitor used to search for information about a header file.
5115 // Look in the on-disk hash table for an entry for this file name.
5335 Error("incorrect encoding of vector type in AST file");
5348 Error("incorrect encoding of extended vector type in AST file");
5430 Error("incorrect encoding of typeof(type) in AST file");
6296 Error("malformed AST file: missing C++ ctor initializers");
6314 Error("malformed AST file: missing C++ base specifiers");
6364 Error("declaration ID out-of-range for AST file");
6448 assert(0 && "declaration ID out-of-range for AST file");
6449 Error("declaration ID out-of-range for AST file");
6463 assert(0 && "declaration ID out-of-range for AST file");
6464 Error("declaration ID out-of-range for AST file");
6498 Error("Corrupted AST file");
6596 void ASTReader::FindFileRegionDecls(FileID File,
6601 llvm::DenseMap<FileID, FileDeclsInfo>::iterator I = FileDeclIDs.find(File);
6610 BeginLoc = SM.getLocForStartOfFile(File).getLocWithOffset(Offset);
6752 std::fprintf(stderr, "*** AST File Statistics:\n");
7013 /// of the current AST file.
7017 /// the current AST file.
7053 // We have any identifiers remaining in the current AST file; return
7123 // If we've already searched this module file, skip it now.
7464 Error("no identifier table in AST file");
7476 // All of the strings in the AST file are preceded by a 16-bit length.
7515 Error("no macro table in AST file");
7567 Error("submodule ID out of range in AST file");
7586 assert(IndexFromEnd && "got reference to unknown module file");
7595 // For a file representing a module, use the submodule ID of the top-level
7596 // module as the file ID. For any other kind of file, the number of such
7598 // FIXME: Is this true even if we have an explicit module file and a PCH?
7604 assert(I != PCHModules.end() && "emitting reference to unknown file");
7634 Error("selector ID out of range in AST file");
8259 Error("malformed block record in AST file");