本文整理汇总了C++中AnalysisResultPtr::loadBuiltins方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisResultPtr::loadBuiltins方法的具体用法?C++ AnalysisResultPtr::loadBuiltins怎么用?C++ AnalysisResultPtr::loadBuiltins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisResultPtr
的用法示例。
在下文中一共展示了AnalysisResultPtr::loadBuiltins方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
int process(const ProgramOptions &po) {
if (po.coredump) {
#if defined(__APPLE__)
struct rlimit rl;
getrlimit(RLIMIT_CORE, &rl);
rl.rlim_cur = 80000000LL;
if (rl.rlim_max < rl.rlim_cur) {
rl.rlim_max = rl.rlim_cur;
}
setrlimit(RLIMIT_CORE, &rl);
#else
struct rlimit64 rl;
getrlimit64(RLIMIT_CORE, &rl);
rl.rlim_cur = 8000000000LL;
if (rl.rlim_max < rl.rlim_cur) {
rl.rlim_max = rl.rlim_cur;
}
setrlimit64(RLIMIT_CORE, &rl);
#endif
}
// lint doesn't need analysis
if (po.target == "lint") {
return lintTarget(po);
}
Timer timer(Timer::WallTime);
AnalysisResultPtr ar;
// prepare a package
Package package(po.inputDir.c_str());
ar = package.getAnalysisResult();
std::string errs;
if (!AliasManager::parseOptimizations(po.optimizations, errs)) {
cerr << errs << "\n";
return false;
}
if (po.target != "php" || po.format != "pickled") {
if (!BuiltinSymbols::Load(ar, po.target == "cpp" && po.format == "sys")) {
return false;
}
ar->loadBuiltins();
}
{
Timer timer(Timer::WallTime, "parsing inputs");
if (!po.inputs.empty() && po.target == "php" && po.format == "pickled") {
for (unsigned int i = 0; i < po.inputs.size(); i++) {
package.addSourceFile(po.inputs[i].c_str());
}
if (!package.parse()) {
return 1;
}
} else {
ar->setPackage(&package);
ar->setParseOnDemand(po.parseOnDemand);
if (!po.parseOnDemand) {
ar->setParseOnDemandDirs(Option::ParseOnDemandDirs);
}
if (po.modules.empty() && po.fmodules.empty() &&
po.ffiles.empty() && po.inputs.empty() && po.inputList.empty()) {
package.addAllFiles(false);
} else {
for (unsigned int i = 0; i < po.modules.size(); i++) {
package.addDirectory(po.modules[i], false);
}
for (unsigned int i = 0; i < po.fmodules.size(); i++) {
package.addDirectory(po.fmodules[i], true);
}
for (unsigned int i = 0; i < po.ffiles.size(); i++) {
package.addSourceFile(po.ffiles[i].c_str());
}
for (unsigned int i = 0; i < po.cmodules.size(); i++) {
package.addStaticDirectory(po.cmodules[i].c_str());
}
for (unsigned int i = 0; i < po.cfiles.size(); i++) {
package.addStaticFile(po.cfiles[i].c_str());
}
for (unsigned int i = 0; i < po.inputs.size(); i++) {
package.addSourceFile(po.inputs[i].c_str());
}
if (!po.inputList.empty()) {
package.addInputList(po.inputList.c_str());
}
}
}
if (po.target != "filecache") {
if (!package.parse()) {
return 1;
}
ar->analyzeProgram();
}
}
// saving file cache
AsyncFileCacheSaver fileCacheThread(&package, po.filecache.c_str());
if (!po.filecache.empty()) {
fileCacheThread.start();
//.........这里部分代码省略.........