Skip to content

Commit

Permalink
bugfix to global variable types and removed some unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
argyrosan committed Nov 27, 2023
1 parent f9b04d2 commit 0f5fb5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/fact-generator/src/DebugInfoProcessorImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class cclyzer::DebugInfoProcessor::Impl
if (auto *DDI = llvm::dyn_cast<llvm::DbgDeclareInst>(&I)){
debugInfoFinder.processInstruction(module,I);
record_local_var_assoc(*DDI);
}else if (auto *DVI = llvm::dyn_cast<llvm::DbgValueInst>(&I)){
}else{
debugInfoFinder.processInstruction(module,I);
}
}
Expand Down
12 changes: 10 additions & 2 deletions tools/fact-generator/src/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ FactGenerator::writeGlobalVar(const llvm::GlobalVariable& gv,
// Serialize global variable properties
refmode_t visibility = refmode(gv.getVisibility());
refmode_t linkage = refmode(gv.getLinkage());
refmode_t varType = recordType(gv.getType()->getElementType());
auto value_type = gv.getValueType();
recordType(value_type);
//string representation of value_type
std::string value_type_string;
llvm::raw_string_ostream rso(value_type_string);
value_type->print(rso);

//var type is pointer to value type
refmode_t varType = value_type_string.append("*");
refmode_t thrLocMode = refmode(gv.getThreadLocalMode());

// Record unmangled variable name
Expand Down Expand Up @@ -124,4 +132,4 @@ FactGenerator::writeGlobalVar(const llvm::GlobalVariable& gv,
// Record alignment
if (gv.getAlignment())
writeFact(pred::global_var::align, id, gv.getAlignment());
}
}

0 comments on commit 0f5fb5f

Please sign in to comment.