Skip to content

Commit 64bca11

Browse files
committed
clang format
1 parent 374b76e commit 64bca11

6 files changed

Lines changed: 11 additions & 7 deletions

File tree

.docker/Dockerfile.devenv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ USER vscode
1616

1717
ENV CC "/usr/bin/clang-14"
1818
ENV CXX "/usr/bin/clang++-14"
19+
ENV PATH "/usr/local/llvm-14/bin:/home/vscode/.local/bin:$PATH"
1920
ENV CMAKE_GENERATOR "Ninja"

include/phasar/Controller/AnalysisController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ enum class AnalysisControllerEmitterOptions : uint32_t {
4949
EmitPTAAsText = (1 << 11),
5050
EmitPTAAsDot = (1 << 12),
5151
EmitPTAAsJson = (1 << 13),
52-
EmitStatisticAsJson = (1 << 14),
52+
EmitStatisticsAsJson = (1 << 14),
5353
};
5454

5555
class AnalysisController {

include/phasar/PhasarLLVM/Passes/GeneralStatisticsAnalysis.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class GeneralStatistics {
4848
std::set<const llvm::Type *> AllocatedTypes;
4949
std::set<const llvm::Instruction *> AllocaInstructions;
5050
std::set<const llvm::Instruction *> RetResInstructions;
51+
std::string ModuleName = "";
5152

5253
public:
5354
/**

lib/Controller/AnalysisController.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ void AnalysisController::emitRequestedHelperAnalysisResults() {
273273
}
274274
}
275275

276-
if (EmitterOptions & AnalysisControllerEmitterOptions::EmitStatisticAsJson) {
276+
if (EmitterOptions & AnalysisControllerEmitterOptions::EmitStatisticsAsJson) {
277277
if (!ResultDirectory.empty()) {
278-
if (auto OFS = openFileStream("/psr-IrStatistic.json")) {
278+
if (auto OFS = openFileStream("/psr-IrStatistics.json")) {
279279
IRDB.printAsJson(*OFS);
280280
}
281281
} else {

lib/PhasarLLVM/Passes/GeneralStatisticsAnalysis.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ GeneralStatisticsAnalysis::run(llvm::Module &M,
4343
static const std::set<std::string> MemAllocatingFunctions = {
4444
"operator new(unsigned long)", "operator new[](unsigned long)", "malloc",
4545
"calloc", "realloc"};
46+
Stats.ModuleName = M.getName();
4647
for (auto &F : M) {
4748
++Stats.Functions;
4849
for (auto &BB : F) {
@@ -218,11 +219,12 @@ GeneralStatistics::getRetResInstructions() const {
218219

219220
nlohmann::json GeneralStatistics::getAsJson() const {
220221
nlohmann::json J;
222+
J["ModuleName"] = GeneralStatistics::ModuleName;
221223
J["Instructions"] = getInstructions();
222224
J["Functions"] = Functions;
223-
J["Alloca Instructions"] = AllocaInstructions.size();
224-
J["Call Sites"] = CallSites;
225-
J["Global Variables"] = Globals;
225+
J["AllocaInstructions"] = AllocaInstructions.size();
226+
J["CallSites"] = CallSites;
227+
J["GlobalVariables"] = Globals;
226228
return J;
227229
}
228230

tools/phasar-llvm/phasar-llvm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ int main(int Argc, const char **Argv) {
408408
EmitterOptions |= AnalysisControllerEmitterOptions::EmitPTAAsJson;
409409
}
410410
if (PhasarConfig::VariablesMap().count("emit-statistic-as-json")) {
411-
EmitterOptions |= AnalysisControllerEmitterOptions::EmitStatisticAsJson;
411+
EmitterOptions |= AnalysisControllerEmitterOptions::EmitStatisticsAsJson;
412412
}
413413
if (PhasarConfig::VariablesMap().count("follow-return-past-seeds")) {
414414
SolverConfig.setFollowReturnsPastSeeds(

0 commit comments

Comments
 (0)