本文整理汇总了C++中llvm::Triple::getObjectFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ Triple::getObjectFormat方法的具体用法?C++ Triple::getObjectFormat怎么用?C++ Triple::getObjectFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llvm::Triple
的用法示例。
在下文中一共展示了Triple::getObjectFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddDefaultIncludePaths
void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang,
const llvm::Triple &triple,
const HeaderSearchOptions &HSOpts) {
// NB: This code path is going away. All of the logic is moving into the
// driver which has the information necessary to do target-specific
// selections of default include paths. Each target which moves there will be
// exempted from this logic here until we can delete the entire pile of code.
switch (triple.getOS()) {
default:
break; // Everything else continues to use this routine's logic.
case llvm::Triple::Linux:
return;
case llvm::Triple::Win32:
if (triple.getEnvironment() == llvm::Triple::MSVC ||
triple.getEnvironment() == llvm::Triple::Itanium ||
triple.getObjectFormat() == llvm::Triple::MachO)
return;
break;
}
if (Lang.CPlusPlus && HSOpts.UseStandardCXXIncludes &&
HSOpts.UseStandardSystemIncludes) {
if (HSOpts.UseLibcxx) {
if (triple.isOSDarwin()) {
// On Darwin, libc++ may be installed alongside the compiler in
// include/c++/v1.
if (!HSOpts.ResourceDir.empty()) {
// Remove version from foo/lib/clang/version
StringRef NoVer = llvm::sys::path::parent_path(HSOpts.ResourceDir);
// Remove clang from foo/lib/clang
StringRef Lib = llvm::sys::path::parent_path(NoVer);
// Remove lib from foo/lib
SmallString<128> P = llvm::sys::path::parent_path(Lib);
// Get foo/include/c++/v1
llvm::sys::path::append(P, "include", "c++", "v1");
AddUnmappedPath(P.str(), CXXSystem, false);
}
}
// On Solaris, include the support directory for things like xlocale and
// fudged system headers.
if (triple.getOS() == llvm::Triple::Solaris)
AddPath("/usr/include/c++/v1/support/solaris", CXXSystem, false);
AddPath("/usr/include/c++/v1", CXXSystem, false);
} else {
AddDefaultCPlusPlusIncludePaths(triple, HSOpts);
}
}
AddDefaultCIncludePaths(triple, HSOpts);
// Add the default framework include paths on Darwin.
if (HSOpts.UseStandardSystemIncludes) {
if (triple.isOSDarwin()) {
AddPath("/System/Library/Frameworks", System, true);
AddPath("/Library/Frameworks", System, true);
}
}
}