Skip to content

Commit 61e6575

Browse files
committed
improve error/warning message
1 parent 36a2eeb commit 61e6575

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

lib/Controller/AnalysisController.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <set>
1515
#include <utility>
1616

17+
#include "llvm/ADT/STLExtras.h"
1718
#include "llvm/Support/ErrorHandling.h"
1819

1920
#include "phasar/Controller/AnalysisController.h"

lib/PhasarLLVM/ControlFlow/LLVMBasedICFG.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,16 +854,20 @@ LLVMBasedICFG::buildCRuntimeGlobalCtorsDtorsModel(llvm::Module &M) {
854854
break;
855855
case 2:
856856
if (UEntry->getName() != "main") {
857-
std::cerr << "ERROR: The only entrypoint, where parameters are "
858-
"supported, is main\n";
857+
std::cerr
858+
<< "WARNING: The only entrypoint, where parameters are "
859+
"supported, is 'main'.\nAutomated global support for library "
860+
"analysis (entry-points=__ALL__) is not yet supported.\n";
859861
break;
860862
}
861863

862864
IRB.CreateCall(UEntry, {GlobModel->getArg(0), GlobModel->getArg(1)});
863865
break;
864866
default:
865-
std::cerr << "ERROR: Entrypoints with parameters are not supported, "
866-
"except for argc and argv in main\n";
867+
std::cerr
868+
<< "WARNING: Entrypoints with parameters are not supported, "
869+
"except for argc and argv in main.\nAutomated global support for "
870+
"library analysis (entry-points=__ALL__) is not yet supported.\n";
867871
break;
868872
}
869873

lib/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDELinearConstantAnalysis.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,20 @@ IDELinearConstantAnalysis::initialSeeds() {
257257
// The analysis' entry points
258258
std::set<const llvm::Function *> EntryPointFuns;
259259

260-
// Otherwise, consider the user-defined entry point(s)
261-
for (const auto &EntryPoint : EntryPoints) {
262-
EntryPointFuns.insert(IRDB->getFunctionDefinition(EntryPoint));
260+
// Consider the user-defined entry point(s)
261+
if (EntryPoints.size() == 1U &&
262+
EntryPoints.find("__ALL__") != EntryPoints.end()) {
263+
// Consider all available function definitions as entry points
264+
for (const auto *Fun : IRDB->getAllFunctions()) {
265+
if (!Fun->isDeclaration()) {
266+
EntryPointFuns.insert(Fun);
267+
}
268+
}
269+
} else {
270+
// Consider the user specified entry points
271+
for (const auto &EntryPoint : EntryPoints) {
272+
EntryPointFuns.insert(IRDB->getFunctionDefinition(EntryPoint));
273+
}
263274
}
264275

265276
// std::set initial seeds at the required entry points and generate global

0 commit comments

Comments
 (0)