23#include "llvm/ADT/Statistic.h"
24#include "llvm/Option/ArgList.h"
25#include "llvm/Support/ErrorHandling.h"
26#include "llvm/Support/ManagedStatic.h"
27#include "llvm/Support/Path.h"
28#include "llvm/Support/YAMLParser.h"
29#include "llvm/Support/raw_ostream.h"
30#include "llvm/TargetParser/Triple.h"
42#define DEBUG_TYPE "CrossTranslationUnit"
43STATISTIC(NumGetCTUCalled,
"The # of getCTUDefinition function called");
46 "The # of getCTUDefinition called but the function is not in any other TU");
48 "The # of getCTUDefinition successfully returned the "
49 "requested function's body");
50STATISTIC(NumUnsupportedNodeFound,
"The # of imports when the ASTImporter "
51 "encountered an unsupported AST Node");
52STATISTIC(NumNameConflicts,
"The # of imports when the ASTImporter "
53 "encountered an ODR error");
54STATISTIC(NumTripleMismatch,
"The # of triple mismatches");
55STATISTIC(NumLangMismatch,
"The # of language mismatches");
56STATISTIC(NumLangDialectMismatch,
"The # of language dialect mismatches");
58 "The # of ASTs not loaded because of threshold");
62bool hasEqualKnownFields(
const llvm::Triple &Lhs,
const llvm::Triple &Rhs) {
64 if (Lhs.getArch() != Triple::UnknownArch &&
65 Rhs.getArch() != Triple::UnknownArch && Lhs.getArch() != Rhs.getArch())
67 if (Lhs.getSubArch() != Triple::NoSubArch &&
68 Rhs.getSubArch() != Triple::NoSubArch &&
69 Lhs.getSubArch() != Rhs.getSubArch())
71 if (Lhs.getVendor() != Triple::UnknownVendor &&
72 Rhs.getVendor() != Triple::UnknownVendor &&
73 Lhs.getVendor() != Rhs.getVendor())
75 if (!Lhs.isOSUnknown() && !Rhs.isOSUnknown() &&
76 Lhs.getOS() != Rhs.getOS())
78 if (Lhs.getEnvironment() != Triple::UnknownEnvironment &&
79 Rhs.getEnvironment() != Triple::UnknownEnvironment &&
80 Lhs.getEnvironment() != Rhs.getEnvironment())
82 if (Lhs.getObjectFormat() != Triple::UnknownObjectFormat &&
83 Rhs.getObjectFormat() != Triple::UnknownObjectFormat &&
84 Lhs.getObjectFormat() != Rhs.getObjectFormat())
90class IndexErrorCategory :
public std::error_category {
92 const char *
name() const noexcept
override {
return "clang.index"; }
94 std::string message(
int Condition)
const override {
101 return "An unknown error has occurred.";
103 return "The index file is missing.";
105 return "Invalid index file format.";
107 return "Multiple definitions in the index file.";
109 return "Missing definition from the index file.";
111 return "Failed to import the definition.";
113 return "Failed to load external AST source.";
115 return "Failed to generate USR.";
117 return "Triple mismatch";
119 return "Language mismatch";
121 return "Language dialect mismatch";
123 return "Load threshold reached";
125 return "Invocation list file contains multiple references to the same "
128 return "Invocation list file is not found.";
130 return "Invocation list file is empty.";
132 return "Invocation list file is in wrong format.";
134 return "Invocation list file does not contain the requested source file.";
136 llvm_unreachable(
"Unrecognized index_error_code.");
140static llvm::ManagedStatic<IndexErrorCategory>
Category;
146 OS <<
Category->message(
static_cast<int>(Code)) <<
'\n';
150 return std::error_code(
static_cast<int>(Code), *
Category);
160 StringRef &FilePath) {
163 size_t USRLength = 0;
164 if (LineRef.consumeInteger(10, USRLength))
166 assert(USRLength &&
"USRLength should be greater than zero.");
168 if (!LineRef.consume_front(
":"))
174 if (USRLength >= LineRef.size() ||
' ' != LineRef[USRLength])
177 LookupName = LineRef.substr(0, USRLength);
178 FilePath = LineRef.substr(USRLength + 1);
184 std::ifstream ExternalMapFile{std::string(IndexPath)};
185 if (!ExternalMapFile)
189 llvm::StringMap<std::string>
Result;
192 while (std::getline(ExternalMapFile,
Line)) {
194 StringRef LookupName, FilePathInIndex;
196 return llvm::make_error<IndexError>(
201 llvm::sys::path::native(FilePath, llvm::sys::path::Style::posix);
203 bool InsertionOccured;
204 std::tie(std::ignore, InsertionOccured) =
205 Result.try_emplace(LookupName, FilePath.begin(), FilePath.end());
206 if (!InsertionOccured)
207 return llvm::make_error<IndexError>(
217 std::ostringstream
Result;
218 for (
const auto &
E : Index)
219 Result <<
E.getKey().size() <<
':' <<
E.getKey().str() <<
' '
220 <<
E.getValue() <<
'\n';
230 return D->hasBody(DefD);
233 return D->getAnyInitializer(DefD);
241 : Context(CI.getASTContext()), ASTStorage(CI) {
245 if (!S || S->getType() != llvm::sys::fs::file_type::directory_file)
254std::optional<std::string>
260 return std::string(DeclUSR);
267CrossTranslationUnitContext::findDefInDeclContext(
const DeclContext *DC,
268 StringRef LookupName) {
269 assert(DC &&
"Declaration Context must not be null");
271 const auto *SubDC = dyn_cast<DeclContext>(
D);
273 if (
const auto *ND = findDefInDeclContext<T>(SubDC, LookupName))
276 const auto *ND = dyn_cast<T>(
D);
280 std::optional<std::string> ResultLookupName =
getLookupName(ResultDecl);
281 if (!ResultLookupName || *ResultLookupName != LookupName)
290 const T *
D, StringRef CrossTUDir, StringRef IndexName,
291 bool DisplayCTUProgress) {
292 assert(
D &&
"D is missing, bad call to this function!");
294 "D has a body or init in current translation unit!");
298 return llvm::make_error<IndexError>(
301 loadExternalAST(*LookupName, CrossTUDir, IndexName, DisplayCTUProgress);
303 return ASTUnitOrError.takeError();
304 ASTUnit *Unit = *ASTUnitOrError;
305 assert(&Unit->getFileManager() ==
306 &Unit->getASTContext().getSourceManager().getFileManager());
309 const llvm::Triple &TripleFrom =
310 Unit->getASTContext().getTargetInfo().getTriple();
315 if (!hasEqualKnownFields(TripleTo, TripleFrom)) {
320 std::string(Unit->getMainFileName()),
321 TripleTo.str(), TripleFrom.str());
325 const auto &LangFrom = Unit->getASTContext().getLangOpts();
329 if (LangTo.CPlusPlus != LangFrom.CPlusPlus) {
347 if (LangTo.CPlusPlus11 != LangFrom.CPlusPlus11 ||
348 LangTo.CPlusPlus14 != LangFrom.CPlusPlus14 ||
349 LangTo.CPlusPlus17 != LangFrom.CPlusPlus17 ||
350 LangTo.CPlusPlus20 != LangFrom.CPlusPlus20) {
351 ++NumLangDialectMismatch;
352 return llvm::make_error<IndexError>(
356 TranslationUnitDecl *TU = Unit->getASTContext().getTranslationUnitDecl();
357 if (
const T *ResultDecl = findDefInDeclContext<T>(TU, *LookupName))
364 StringRef CrossTUDir,
366 bool DisplayCTUProgress) {
367 return getCrossTUDefinitionImpl(FD, CrossTUDir, IndexName,
373 StringRef CrossTUDir,
375 bool DisplayCTUProgress) {
376 return getCrossTUDefinitionImpl(VD, CrossTUDir, IndexName,
403CrossTranslationUnitContext::ASTUnitStorage::ASTUnitStorage(
405 : Loader(CI, CI.getAnalyzerOpts().CTUDir,
406 CI.getAnalyzerOpts().CTUInvocationList),
407 LoadGuard(CI.getASTContext().getLangOpts().
CPlusPlus
408 ? CI.getAnalyzerOpts().CTUImportCppThreshold
409 : CI.getAnalyzerOpts().CTUImportThreshold) {}
412CrossTranslationUnitContext::ASTUnitStorage::getASTUnitForFile(
413 StringRef
FileName,
bool DisplayCTUProgress) {
415 auto ASTCacheEntry = FileASTUnitMap.find(
FileName);
416 if (ASTCacheEntry == FileASTUnitMap.end()) {
420 ++NumASTLoadThresholdReached;
421 return llvm::make_error<IndexError>(
425 auto LoadAttempt = Loader.load(
FileName);
428 return LoadAttempt.takeError();
430 std::unique_ptr<ASTUnit> LoadedUnit = std::move(LoadAttempt.get());
433 ASTUnit *Unit = LoadedUnit.get();
436 FileASTUnitMap[
FileName] = std::move(LoadedUnit);
438 LoadGuard.indicateLoadSuccess();
440 if (DisplayCTUProgress)
441 llvm::errs() <<
"CTU loaded AST file: " <<
FileName <<
"\n";
447 return ASTCacheEntry->second.get();
452CrossTranslationUnitContext::ASTUnitStorage::getASTUnitForFunction(
453 StringRef FunctionName, StringRef CrossTUDir, StringRef IndexName,
454 bool DisplayCTUProgress) {
456 auto ASTCacheEntry = NameASTUnitMap.find(FunctionName);
457 if (ASTCacheEntry == NameASTUnitMap.end()) {
461 if (llvm::Error IndexLoadError =
462 ensureCTUIndexLoaded(CrossTUDir, IndexName))
463 return std::move(IndexLoadError);
466 auto It = NameFileMap.find(FunctionName);
467 if (It == NameFileMap.end()) {
475 getASTUnitForFile(It->second, DisplayCTUProgress)) {
478 NameASTUnitMap[FunctionName] = *FoundForFile;
479 return *FoundForFile;
482 return FoundForFile.takeError();
486 return ASTCacheEntry->second;
491CrossTranslationUnitContext::ASTUnitStorage::getFileForFunction(
492 StringRef FunctionName, StringRef CrossTUDir, StringRef IndexName) {
493 if (llvm::Error IndexLoadError = ensureCTUIndexLoaded(CrossTUDir, IndexName))
494 return std::move(IndexLoadError);
495 return NameFileMap[FunctionName];
498llvm::Error CrossTranslationUnitContext::ASTUnitStorage::ensureCTUIndexLoaded(
499 StringRef CrossTUDir, StringRef IndexName) {
501 if (!NameFileMap.empty())
502 return llvm::Error::success();
505 SmallString<256> IndexFile = CrossTUDir;
506 if (llvm::sys::path::is_absolute(IndexName))
507 IndexFile = IndexName;
509 llvm::sys::path::append(IndexFile, IndexName);
513 NameFileMap = *IndexMapping;
514 return llvm::Error::success();
517 return IndexMapping.takeError();
522 StringRef LookupName, StringRef CrossTUDir, StringRef IndexName,
523 bool DisplayCTUProgress) {
531 LookupName, CrossTUDir, IndexName, DisplayCTUProgress);
534 return Unit.takeError();
538 return llvm::make_error<IndexError>(
544CrossTranslationUnitContext::ASTLoader::ASTLoader(
546 : CI(CI), CTUDir(CTUDir), InvocationListFilePath(InvocationListFilePath) {}
548CrossTranslationUnitContext::LoadResultTy
549CrossTranslationUnitContext::ASTLoader::load(StringRef
Identifier) {
551 if (llvm::sys::path::is_absolute(
Identifier, PathStyle)) {
560 llvm::sys::path::native(
Path, PathStyle);
563 llvm::sys::path::remove_dots(
Path,
true, PathStyle);
565 if (
Path.ends_with(
".ast"))
566 return loadFromDump(
Path);
568 return loadFromSource(
Path);
571CrossTranslationUnitContext::LoadResultTy
572CrossTranslationUnitContext::ASTLoader::loadFromDump(StringRef ASTDumpPath) {
573 auto DiagOpts = std::make_shared<DiagnosticOptions>();
574 TextDiagnosticPrinter *DiagClient =
575 new TextDiagnosticPrinter(llvm::errs(), *DiagOpts);
576 auto Diags = llvm::makeIntrusiveRefCnt<DiagnosticsEngine>(
579 ASTDumpPath, CI.getPCHContainerOperations()->getRawReader(),
581 CI.getHeaderSearchOpts());
595CrossTranslationUnitContext::LoadResultTy
596CrossTranslationUnitContext::ASTLoader::loadFromSource(
597 StringRef SourceFilePath) {
599 if (llvm::Error InitError = lazyInitInvocationList())
600 return std::move(InitError);
601 assert(InvocationList);
603 auto Invocation = InvocationList->find(SourceFilePath);
604 if (Invocation == InvocationList->end())
605 return llvm::make_error<IndexError>(
608 const InvocationListTy::mapped_type &InvocationCommand = Invocation->second;
610 SmallVector<const char *, 32> CommandLineArgs(InvocationCommand.size());
611 std::transform(InvocationCommand.begin(), InvocationCommand.end(),
612 CommandLineArgs.begin(),
613 [](
auto &&CmdPart) { return CmdPart.c_str(); });
615 auto DiagOpts = std::make_shared<DiagnosticOptions>(CI.getDiagnosticOpts());
616 auto *DiagClient =
new ForwardingDiagnosticConsumer{CI.getDiagnosticClient()};
617 IntrusiveRefCntPtr<DiagnosticIDs> DiagID{
618 CI.getDiagnostics().getDiagnosticIDs()};
619 auto Diags = llvm::makeIntrusiveRefCnt<DiagnosticsEngine>(DiagID, *DiagOpts,
623 CommandLineArgs.begin(), (CommandLineArgs.end()),
624 CI.getPCHContainerOperations(), DiagOpts, Diags,
625 CI.getHeaderSearchOpts().ResourceDir);
634 llvm::yaml::Stream InvocationFile(FileContent,
SM);
637 llvm::yaml::document_iterator FirstInvocationFile = InvocationFile.begin();
640 if (FirstInvocationFile == InvocationFile.end())
641 return llvm::make_error<IndexError>(
644 llvm::yaml::Node *DocumentRoot = FirstInvocationFile->getRoot();
646 return llvm::make_error<IndexError>(
652 auto *Mappings = dyn_cast<llvm::yaml::MappingNode>(DocumentRoot);
654 return llvm::make_error<IndexError>(
657 for (
auto &NextMapping : *Mappings) {
659 auto *Key = dyn_cast<llvm::yaml::ScalarNode>(NextMapping.getKey());
661 return llvm::make_error<IndexError>(
665 StringRef SourcePath = Key->getValue(ValueStorage);
669 llvm::sys::path::native(NativeSourcePath, PathStyle);
671 StringRef InvocationKey = NativeSourcePath;
673 if (InvocationList.contains(InvocationKey))
674 return llvm::make_error<IndexError>(
679 auto *Args = dyn_cast<llvm::yaml::SequenceNode>(NextMapping.getValue());
681 return llvm::make_error<IndexError>(
684 for (
auto &Arg : *Args) {
685 auto *CmdString = dyn_cast<llvm::yaml::ScalarNode>(&Arg);
687 return llvm::make_error<IndexError>(
691 ValueStorage.clear();
692 InvocationList[InvocationKey].emplace_back(
693 CmdString->getValue(ValueStorage));
696 if (InvocationList[InvocationKey].empty())
697 return llvm::make_error<IndexError>(
701 return InvocationList;
704llvm::Error CrossTranslationUnitContext::ASTLoader::lazyInitInvocationList() {
707 return llvm::Error::success();
709 return llvm::make_error<IndexError>(PreviousParsingResult);
711 llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> FileContent =
712 llvm::MemoryBuffer::getFile(InvocationListFilePath);
715 return llvm::make_error<IndexError>(PreviousParsingResult);
717 std::unique_ptr<llvm::MemoryBuffer> ContentBuffer = std::move(*FileContent);
718 assert(ContentBuffer &&
"If no error was produced after loading, the pointer "
719 "should not be nullptr.");
725 if (!ExpectedInvocationList) {
726 llvm::handleAllErrors(
727 ExpectedInvocationList.takeError(),
728 [&](
const IndexError &
E) { PreviousParsingResult = E.getCode(); });
729 return llvm::make_error<IndexError>(PreviousParsingResult);
732 InvocationList = *ExpectedInvocationList;
734 return llvm::Error::success();
739CrossTranslationUnitContext::importDefinitionImpl(
const T *
D, ASTUnit *Unit) {
740 assert(
hasBodyOrInit(
D) &&
"Decls to be imported should have body or init.");
742 assert(&
D->getASTContext() == &Unit->getASTContext() &&
743 "ASTContext of Decl and the unit should match.");
744 ASTImporter &Importer = getOrCreateASTImporter(Unit);
746 auto ToDeclOrError = Importer.Import(
D);
747 if (!ToDeclOrError) {
748 handleAllErrors(ToDeclOrError.takeError(), [&](
const ASTImportError &IE) {
750 case ASTImportError::NameConflict:
753 case ASTImportError::UnsupportedConstruct:
754 ++NumUnsupportedNodeFound;
756 case ASTImportError::Unknown:
757 llvm_unreachable(
"Unknown import error happened.");
763 auto *ToDecl = cast<T>(*ToDeclOrError);
764 assert(
hasBodyOrInit(ToDecl) &&
"Imported Decl should have body or init.");
768 ToDecl->getASTContext().getParentMapContext().clear();
776 return importDefinitionImpl(FD, Unit);
780CrossTranslationUnitContext::importDefinition(
const VarDecl *VD,
782 return importDefinitionImpl(VD, Unit);
785void CrossTranslationUnitContext::lazyInitImporterSharedSt(
787 if (!ImporterSharedSt)
788 ImporterSharedSt = std::make_shared<ASTImporterSharedState>(*ToTU);
792CrossTranslationUnitContext::getOrCreateASTImporter(
ASTUnit *Unit) {
796 if (I != ASTUnitImporterMap.end())
806std::optional<clang::MacroExpansionContext>
807CrossTranslationUnitContext::getMacroExpansionContextForSourceLocation(
813bool CrossTranslationUnitContext::isImportedAsNew(
const Decl *ToDecl)
const {
814 if (!ImporterSharedSt)
816 return ImporterSharedSt->isNewDecl(
const_cast<Decl *
>(ToDecl));
819bool CrossTranslationUnitContext::hasError(
const Decl *ToDecl)
const {
820 if (!ImporterSharedSt)
822 return static_cast<bool>(
823 ImporterSharedSt->getImportDeclErrorIfAny(
const_cast<Decl *
>(ToDecl)));
STATISTIC(NumObjCCallEdges, "Number of Objective-C method call edges")
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
TranslationUnitDecl * getTranslationUnitDecl() const
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
const LangOptions & getLangOpts() const
DiagnosticsEngine & getDiagnostics() const
const TargetInfo & getTargetInfo() const
Imports selected nodes from one AST context into another context, merging AST nodes where appropriate...
Utility class for loading a ASTContext from an AST file.
static std::unique_ptr< ASTUnit > LoadFromASTFile(StringRef Filename, const PCHContainerReader &PCHContainerRdr, WhatToLoad ToLoad, std::shared_ptr< DiagnosticOptions > DiagOpts, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, const FileSystemOptions &FileSystemOpts, const HeaderSearchOptions &HSOpts, const LangOptions *LangOpts=nullptr, bool OnlyLocalDecls=false, CaptureDiagsKind CaptureDiagnostics=CaptureDiagsKind::None, bool AllowASTWithCompilerErrors=false, bool UserFilesAreVolatile=false, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS=llvm::vfs::getRealFileSystem())
Create a ASTUnit from an AST file.
@ LoadEverything
Load everything, including Sema.
static std::unique_ptr< ASTUnit > LoadFromCommandLine(const char **ArgBegin, const char **ArgEnd, std::shared_ptr< PCHContainerOperations > PCHContainerOps, std::shared_ptr< DiagnosticOptions > DiagOpts, IntrusiveRefCntPtr< DiagnosticsEngine > Diags, StringRef ResourceFilesPath, bool StorePreamblesInMemory=false, StringRef PreambleStoragePath=StringRef(), bool OnlyLocalDecls=false, CaptureDiagsKind CaptureDiagnostics=CaptureDiagsKind::None, ArrayRef< RemappedFile > RemappedFiles={}, bool RemappedFilesKeepOriginalName=true, unsigned PrecompilePreambleAfterNParses=0, TranslationUnitKind TUKind=TU_Complete, bool CacheCodeCompletionResults=false, bool IncludeBriefCommentsInCodeCompletion=false, bool AllowPCHWithCompilerErrors=false, SkipFunctionBodiesScope SkipFunctionBodies=SkipFunctionBodiesScope::None, bool SingleFileParse=false, bool UserFilesAreVolatile=false, bool ForSerialization=false, bool RetainExcludedConditionalBlocks=false, std::optional< StringRef > ModuleFormat=std::nullopt, std::unique_ptr< ASTUnit > *ErrAST=nullptr, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS=nullptr)
LoadFromCommandLine - Create an ASTUnit from a vector of command line arguments, which must specify e...
const ASTContext & getASTContext() const
unsigned ShouldEmitErrorsOnInvalidConfigValue
bool isConstQualified() const
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
AnalyzerOptions & getAnalyzerOpts()
DiagnosticsEngine & getDiagnostics() const
Get the current diagnostics engine.
llvm::vfs::FileSystem & getVirtualFileSystem() const
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Decl - This represents one declaration (or definition), e.g.
static llvm::IntrusiveRefCntPtr< DiagnosticIDs > create()
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Represents a function declaration or definition.
This represents a decl that may have a name.
bool isTrivialType(const ASTContext &Context) const
Return true if this is a trivial type per (C++0x [basic.types]p9)
Encodes a location in the source.
FileManager & getFileManager() const
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
The top declaration context.
Represents a variable declaration or definition.
void emitCrossTUDiagnostics(const IndexError &IE)
Emit diagnostics for the user for potential configuration errors.
llvm::Expected< const FunctionDecl * > getCrossTUDefinition(const FunctionDecl *FD, StringRef CrossTUDir, StringRef IndexName, bool DisplayCTUProgress=false)
This function loads a function or variable definition from an external AST file and merges it into th...
llvm::Expected< const FunctionDecl * > importDefinition(const FunctionDecl *FD, ASTUnit *Unit)
This function merges a definition from a separate AST Unit into the current one which was created by ...
CrossTranslationUnitContext(CompilerInstance &CI)
static std::optional< std::string > getLookupName(const NamedDecl *ND)
Get a name to identify a named decl.
~CrossTranslationUnitContext()
llvm::Expected< ASTUnit * > loadExternalAST(StringRef LookupName, StringRef CrossTUDir, StringRef IndexName, bool DisplayCTUProgress=false)
This function loads a definition from an external AST file.
index_error_code getCode() const
std::string getTripleToName() const
std::error_code convertToErrorCode() const override
void log(raw_ostream &OS) const override
std::string getTripleFromName() const
std::string getFileName() const
Defines the clang::TargetInfo interface.
bool shouldImport(const VarDecl *VD, const ASTContext &ACtx)
Returns true if it makes sense to import a foreign variable definition.
llvm::StringMap< llvm::SmallVector< std::string, 32 > > InvocationListTy
llvm::Expected< llvm::StringMap< std::string > > parseCrossTUIndex(StringRef IndexPath)
This function parses an index file that determines which translation unit contains which definition.
std::string createCrossTUIndexString(const llvm::StringMap< std::string > &Index)
llvm::Expected< InvocationListTy > parseInvocationList(StringRef FileContent, llvm::sys::path::Style PathStyle=llvm::sys::path::Style::posix)
Parse the YAML formatted invocation list file content FileContent.
static bool hasBodyOrInit(const FunctionDecl *D, const FunctionDecl *&DefD)
@ invocation_list_wrong_format
@ invocation_list_file_not_found
@ invocation_list_lookup_unsuccessful
@ failed_to_get_external_ast
@ invocation_list_ambiguous
static bool parseCrossTUIndexItem(StringRef LineRef, StringRef &LookupName, StringRef &FilePath)
Parse one line of the input CTU index file.
bool generateUSRForDecl(const Decl *D, SmallVectorImpl< char > &Buf)
Generate a USR for a Decl, including the USR prefix.
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
const FunctionProtoType * T