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.
389 // If the original import came from a file explicitly generated by the user,
478 // AST file. If so, we should reject the AST file. Unfortunately, this
537 StringRef File = ExistingPPOpts.Includes[I];
538 if (File == ExistingPPOpts.ImplicitPCHInclude)
541 if (std::find(PPOpts.Includes.begin(), PPOpts.Includes.end(), File)
547 HeaderSearch::NormalizeDashIncludePath(File, FileMgr);
552 StringRef File = ExistingPPOpts.MacroIncludes[I];
554 File)
560 HeaderSearch::NormalizeDashIncludePath(File, FileMgr);
1020 // Parse the file names
1023 // Extract the file name
1035 assert(FID >= 0 && "Serialized line entries for non-local file.");
1074 Error("malformed block record in AST file");
1080 Error("malformed source manager block record in AST file");
1091 Error("malformed block record in AST file");
1116 /// \brief If a header file is not found at the path that we expect it to be
1117 /// and the PCH file was moved from its original location, try to resolve the
1118 /// file by assuming that header+PCH were moved together and the header is in
1125 "No point trying to resolve the file if the PCH dir didn't change");
1154 Error("source location entry ID out-of-range for AST file");
1166 Error("incorrectly-formatted source location entry in AST file");
1174 Error("incorrectly-formatted source location entry in AST file");
1178 // We will detect whether a file changed and return 'Failure' for it, but
1182 const FileEntry *File = IF.getFile();
1185 // Note that we only check if a File was returned. If it was out-of-date
1188 if (!File)
1193 // This is the module's main file.
1198 FileID FID = SourceMgr.createFileID(File, IncludeLoc, FileCharacter,
1215 = SourceMgr.getOrCreateContentCache(File,
1229 = llvm::MemoryBuffer::getMemBuffer(Blob.drop_back(1), File->getName());
1230 SourceMgr.overrideFileContents(File, Buffer);
1282 Error("source location entry ID out-of-range for AST file");
1286 // Find which module file this entry lands in.
1304 // Main file is the importer.
1305 assert(!SourceMgr.getMainFileID().isInvalid() && "missing main file");
1316 Error("malformed block record in AST file");
1368 Error("malformed block record in AST file");
1443 // If we see a TOKEN before a PP_MACRO_*, then the file is
1587 // If there was no preprocessor block, skip this file.
1601 Error("malformed block record in AST file");
1629 /// \brief Visitor class used to look up identifirs in an AST file.
1652 // If we've already searched this module file, skip it now.
1808 Error("malformed block record in AST file");
1816 Error("malformed block record in AST file");
1951 // Use the location at which the containing module file was first imported
2020 // Go find this input file.
2031 "invalid record type for input file");
2055 // If this ID is bogus, just return an empty input file.
2059 // If we've already loaded this input file, return it.
2066 // Go find this input file.
2077 const FileEntry *File
2081 // If we didn't find the file, resolve it relative to the
2082 // original directory from which this AST file was created.
2083 if (File == nullptr && !F.OriginalDir.empty() && !CurrentDir.empty() &&
2089 File = FileMgr.getFile(Resolved);
2092 // For an overridden file, create a virtual file with the stored
2094 if (Overridden && File == nullptr) {
2095 File = FileMgr.getVirtualFile(Filename, StoredSize, StoredTime);
2098 if (File == nullptr) {
2100 std::string ErrorStr = "could not find file '";
2102 ErrorStr += "' referenced by AST file";
2105 // Record that we didn't find the file.
2110 // Check if there was a request to override the contents of the file
2111 // that was part of the precompiled header. Overridding such a file
2115 if (!Overridden && SM.isFileOverridden(File)) {
2119 // that the original file will be used.
2120 SM.disableFileContentsOverride(File);
2121 // The FileEntry is a virtual file entry with the size of the contents
2124 FileMgr.modifyFileEntry(const_cast<FileEntry*>(File),
2130 // For an overridden file, there is nothing to validate.
2131 if (!Overridden && (StoredSize != File->getSize()
2133 // In our regression testing, the Windows file system seems to
2136 || StoredTime != File->getModificationTime()
2165 InputFile IF = InputFile(File, Overridden, IsOutOfDate);
2167 // Note that we've loaded this input file.
2176 const FileEntry *File = FileMgr.getFile(Filename);
2177 if (File == nullptr && !M.OriginalDir.empty() && !CurrentDir.empty() &&
2183 File = FileMgr.getFile(resolved);
2186 return File;
2189 /// \brief If we are loading a relocatable PCH file, and the filename is
2190 /// not an absolute path, add the system root to the beginning of the file
2194 // If this is not a relocatable PCH file, there's nothing to do.
2222 Error("malformed block record in AST file");
2233 Error("malformed block record in AST file");
2290 Error("malformed block record in AST file");
2297 Error("malformed block record in AST file");
2342 // Read information about the AST file.
2356 // Load the AST file.
2453 // verify that it is found in the same module map file as we saved. If the
2454 // top-level AST file is a main file, skip this check because there is no
2471 assert(M->ModuleMap && "found module is missing module map file");
2499 Error("malformed block record in AST file");
2503 // Read all of the records and blocks for the AST file.
2510 Error("error at end of module block in AST file");
2536 Error("malformed block record in AST file");
2548 Error("malformed block record in AST file");
2559 Error("malformed preprocessor detail record in AST file");
2585 Error("malformed comments block in AST file");
2594 Error("malformed block record in AST file");
2615 Error("duplicate TYPE_OFFSET record in AST file");
2639 Error("duplicate DECL_OFFSET record in AST file");
2713 Error("duplicate IDENTIFIER_OFFSET record in AST file");
2985 Error("Multiple SOURCE_LOCATION_PRELOADS records in AST file");
3083 Error("invalid DECL_UPDATE_OFFSETS block in AST file");
3100 Error("invalid DECL_REPLACEMENTS block in AST file");
3111 Error("duplicate OBJC_CATEGORIES_MAP record in AST file");
3126 Error("duplicate CXX_BASE_SPECIFIER_OFFSETS record in AST file");
3230 Error("duplicate LOCAL_REDECLARATIONS_MAP record in AST file");
3251 Error("duplicate MACRO_OFFSET record in AST file");
3431 // Overwrite the timestamp file contents so that file's mtime changes.
3438 OS << "Timestamp file\n";
3448 // Defer any pending actions until we get to the end of reading the AST file.
3544 SubmoduleID GlobalID = getGlobalSubmoduleID(*Unresolved.File,Unresolved.ID);
3589 // If this AST file is a precompiled preamble, then set the
3590 // preamble file ID of the source manager to the file source file
3645 // Load module file below.
3649 // The module file
3663 // We couldn't load the module file because it is out-of-date. If the
3677 assert(M && "Missing module file");
3710 Error("invalid record at top-level of AST file");
3721 Error("malformed BlockInfoBlock in AST file");
3752 Error("malformed block record in AST file");
3778 if (unsigned File = SpecialTypes[SPECIAL_TYPE_FILE]) {
3779 QualType FileType = GetType(File);
3781 Error("FILE type is NULL");
3791 Error("Invalid FILE type in AST file");
3812 Error("Invalid jmp_buf type in AST file");
3832 assert(Tag && "Invalid sigjmp_buf type in AST file");
3868 assert(Tag && "Invalid ucontext_t type in AST file");
3884 // Re-export any modules that were imported by a non-module AST file.
3905 /// \brief Given a cursor at the start of an AST file, scan ahead and drop the
3935 /// \brief Retrieve the name of the original source file name
3936 /// directly from the AST file, without actually loading the AST
3937 /// file.
3941 // Open the AST file.
4030 // Open the AST file.
4149 // Go find this input file.
4196 Error("malformed submodule block record in AST file");
4210 Error("malformed block record in AST file");
4274 if (CurFile != F.File) {
4279 << F.File->getName();
4285 CurrentModule->setASTFile(F.File);
4300 // Clear out data that will be replaced by what is the module file.
4446 Unresolved.File = &F;
4467 Unresolved.File = &F;
4529 Unresolved.File = &F;
4545 /// This routine parses the language options from the AST file and then gives
4548 /// \returns true if the listener deems the file unacceptable, false otherwise.
4792 const FileEntry *File = nullptr;
4794 File = PP.getFileManager().getFile(FullFileName);
4803 File,
4927 /// entity with index \arg Index came from file \arg FID.
4949 /// \brief Visitor used to search for information about a header file.
4968 // Look in the on-disk hash table for an entry for this file name.
5188 Error("incorrect encoding of vector type in AST file");
5201 Error("incorrect encoding of extended vector type in AST file");
5270 Error("incorrect encoding of typeof(type) in AST file");
6005 Error("malformed AST file: missing C++ base specifier");
6023 Error("malformed AST file: missing C++ base specifiers");
6070 Error("declaration ID out-of-range for AST file");
6120 assert(0 && "declaration ID out-of-range for AST file");
6121 Error("declaration ID out-of-range for AST file");
6135 assert(0 && "declaration ID out-of-range for AST file");
6136 Error("declaration ID out-of-range for AST file");
6170 Error("Corrupted AST file");
6294 void ASTReader::FindFileRegionDecls(FileID File,
6299 llvm::DenseMap<FileID, FileDeclsInfo>::iterator I = FileDeclIDs.find(File);
6308 BeginLoc = SM.getLocForStartOfFile(File).getLocWithOffset(Offset);
6406 /// \brief Retrieve the "definitive" module file for the definition of the
6409 /// The "definitive" module file is the only place where we need to look to
6460 // If we can definitively determine which module file to look into,
6623 std::fprintf(stderr, "*** AST File Statistics:\n");
6864 /// of the current AST file.
6868 /// the current AST file.
6900 // We have any identifiers remaining in the current AST file; return
6937 // If we've already searched this module file, skip it now.
7253 Error("no identifier table in AST file");
7265 // All of the strings in the AST file are preceded by a 16-bit length.
7303 Error("no macro table in AST file");
7355 Error("submodule ID out of range in AST file");
7375 Error("selector ID out of range in AST file");
7974 Error("malformed block record in AST file");