本文整理汇总了C++中HeaderSearch::getModuleMap方法的典型用法代码示例。如果您正苦于以下问题:C++ HeaderSearch::getModuleMap方法的具体用法?C++ HeaderSearch::getModuleMap怎么用?C++ HeaderSearch::getModuleMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeaderSearch
的用法示例。
在下文中一共展示了HeaderSearch::getModuleMap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyHeaderSearchOptions
void clang::ApplyHeaderSearchOptions(HeaderSearch &HS,
const HeaderSearchOptions &HSOpts,
const LangOptions &Lang,
const llvm::Triple &Triple) {
InitHeaderSearch Init(HS, HSOpts.Verbose, HSOpts.Sysroot);
// Add the user defined entries.
for (unsigned i = 0, e = HSOpts.UserEntries.size(); i != e; ++i) {
const HeaderSearchOptions::Entry &E = HSOpts.UserEntries[i];
if (E.IgnoreSysRoot) {
Init.AddUnmappedPath(E.Path, E.Group, E.IsFramework);
} else {
Init.AddPath(E.Path, E.Group, E.IsFramework);
}
}
Init.AddDefaultIncludePaths(Lang, Triple, HSOpts);
for (unsigned i = 0, e = HSOpts.SystemHeaderPrefixes.size(); i != e; ++i)
Init.AddSystemHeaderPrefix(HSOpts.SystemHeaderPrefixes[i].Prefix,
HSOpts.SystemHeaderPrefixes[i].IsSystemHeader);
if (HSOpts.UseBuiltinIncludes) {
// Set up the builtin include directory in the module map.
SmallString<128> P = StringRef(HSOpts.ResourceDir);
llvm::sys::path::append(P, "include");
if (const DirectoryEntry *Dir = HS.getFileMgr().getDirectory(P.str()))
HS.getModuleMap().setBuiltinIncludeDir(Dir);
}
Init.Realize(Lang);
}
示例2: ApplyHeaderSearchOptions
void clang::ApplyHeaderSearchOptions(HeaderSearch &HS,
const HeaderSearchOptions &HSOpts,
const LangOptions &Lang,
const llvm::Triple &Triple) {
InitHeaderSearch Init(HS, HSOpts.Verbose, HSOpts.Sysroot);
// Add the user defined entries.
for (unsigned i = 0, e = HSOpts.UserEntries.size(); i != e; ++i) {
const HeaderSearchOptions::Entry &E = HSOpts.UserEntries[i];
Init.AddPath(E.Path, E.Group, !E.ImplicitExternC, E.IsUserSupplied,
E.IsFramework, E.IgnoreSysRoot);
}
Init.AddDefaultIncludePaths(Lang, Triple, HSOpts);
for (unsigned i = 0, e = HSOpts.SystemHeaderPrefixes.size(); i != e; ++i)
Init.AddSystemHeaderPrefix(HSOpts.SystemHeaderPrefixes[i].Prefix,
HSOpts.SystemHeaderPrefixes[i].IsSystemHeader);
if (HSOpts.UseBuiltinIncludes) {
// Set up the builtin include directory in the module map.
llvm::sys::Path P(HSOpts.ResourceDir);
P.appendComponent("include");
if (const DirectoryEntry *Dir = HS.getFileMgr().getDirectory(P.str()))
HS.getModuleMap().setBuiltinIncludeDir(Dir);
}
Init.Realize(Lang);
}