Skip to content

Commit

Permalink
Fix even more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pefoley2 committed Aug 21, 2016
1 parent f88935f commit 1da19c1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions dataflowAPI/src/stackanalysis.C
Expand Up @@ -1016,7 +1016,7 @@ void StackAnalysis::handleXor(Instruction::Ptr insn, Block *block,
// xor mem1, imm2
// Xor with immediate. Set topBottom on target loc
Expression::Ptr immExpr = operands[1].getValue();
assert(typeid(*immExpr) == typeid(Immediate));
assert(dynamic_cast<Immediate*>(immExpr.get()));
xferFuncs.push_back(TransferFunc::copyFunc(writtenLoc, writtenLoc,
true));
}
Expand Down Expand Up @@ -1085,7 +1085,7 @@ void StackAnalysis::handleXor(Instruction::Ptr insn, Block *block,
} else {
// xor reg1, imm1
InstructionAPI::Expression::Ptr readExpr = operands[1].getValue();
assert(typeid(*readExpr) == typeid(InstructionAPI::Immediate));
assert(dynamic_cast<Immediate*>(readExpr.get()));
xferFuncs.push_back(TransferFunc::copyFunc(writtenLoc, writtenLoc, true));
copyBaseSubReg(written, xferFuncs);
}
Expand Down Expand Up @@ -1212,13 +1212,13 @@ void StackAnalysis::handlePushPop(Instruction::Ptr insn, Block *block,
Absloc writtenLoc(writtenSlotHeight, 0, NULL);

Expression::Ptr readExpr = insn->getOperand(0).getValue();
if (typeid(*readExpr) == typeid(RegisterAST)) {
if (dynamic_cast<RegisterAST*>(readExpr.get())) {
// Get copied register
MachRegister readReg = boost::dynamic_pointer_cast<RegisterAST>(
readExpr)->getID();
Absloc readLoc(readReg);
xferFuncs.push_back(TransferFunc::copyFunc(readLoc, writtenLoc));
} else if (typeid(*readExpr) == typeid(Immediate)) {
} else if (dynamic_cast<Immediate*>(readExpr.get())) {
// Get pushed immediate
long immVal = readExpr->eval().convert<long>();
xferFuncs.push_back(TransferFunc::absFunc(writtenLoc, immVal));
Expand All @@ -1232,7 +1232,7 @@ void StackAnalysis::handlePushPop(Instruction::Ptr insn, Block *block,

// Get target register
Expression::Ptr targExpr = insn->getOperand(0).getValue();
assert(typeid(*targExpr) == typeid(RegisterAST));
assert(dynamic_cast<RegisterAST*>(targExpr.get()));
MachRegister targReg = boost::dynamic_pointer_cast<RegisterAST>(
targExpr)->getID();
Absloc targLoc(targReg);
Expand Down
2 changes: 2 additions & 0 deletions parseAPI/src/BoundFactData.C
Expand Up @@ -797,6 +797,7 @@ void BoundFact::GenFact(const AST::Ptr ast, BoundValue* bv, bool isConditionalJu
}
}

/*
static bool IsSubTree(AST::Ptr tree, AST::Ptr sub) {
if (*tree == *sub) return true;
bool ret = false;
Expand All @@ -806,6 +807,7 @@ static bool IsSubTree(AST::Ptr tree, AST::Ptr sub) {
}
return ret;
}
*/

void BoundFact::KillFact(const AST::Ptr ast, bool isConditionalJump) {
for (auto fit = fact.begin(); fit != fact.end();)
Expand Down
2 changes: 1 addition & 1 deletion parseAPI/src/IA_aarch64Details.C
Expand Up @@ -166,7 +166,7 @@ bool IA_aarch64Details::parseJumpTable(Block* /*currBlk*/,

bool IA_aarch64Details::parseJumpTable(Dyninst::ParseAPI::Function* currFunc,
Dyninst::ParseAPI::Block* currBlk,
std::vector<std::pair< Address, Dyninst::ParseAPI::EdgeTypeEnum > >& outEdges)
std::vector<std::pair< Address, Dyninst::ParseAPI::EdgeTypeEnum > >& outEdges)
{
IndirectControlFlowAnalyzer icfa(currFunc, currBlk);
bool ret = icfa.NewJumpTableAnalysis(outEdges);
Expand Down
4 changes: 1 addition & 3 deletions parseAPI/src/JumpTablePred.h
Expand Up @@ -11,7 +11,6 @@ using namespace Dyninst;

class JumpTablePred : public Slicer::Predicates {

bool firstMemoryRead;
ParseAPI::Function *func;
ParseAPI::Block *block;
ReachFact &rf;
Expand Down Expand Up @@ -40,8 +39,7 @@ GraphPtr BuildAnalysisGraph(std::set<ParseAPI::Edge*> &visitedEdges);
ReachFact &r,
ThunkData &t,
std::vector<std::pair< Address, Dyninst::ParseAPI::EdgeTypeEnum > >& out):
firstMemoryRead(true), func(f),
block(b), rf(r), thunks(t), outEdges(out),jumpTableFormat(true) {}
func(f), block(b), rf(r), thunks(t), outEdges(out), jumpTableFormat(true) {}
};


Expand Down
1 change: 0 additions & 1 deletion symtabAPI/src/Object-elf.C
Expand Up @@ -2428,7 +2428,6 @@ char ** declFileNoToName = NULL;

bool Object::fix_global_symbol_modules_static_dwarf()
{
int status;
/* Initialize libdwarf. */
Dwarf_Debug *dbg_ptr = dwarf->type_dbg();
if (!dbg_ptr)
Expand Down
25 changes: 13 additions & 12 deletions symtabAPI/src/dwarfWalker.h
Expand Up @@ -47,9 +47,9 @@ namespace Dyninst {
Dwarf_Debug dbg_;
public:
DwarfParseActions(Symtab* s, Dwarf_Debug d) :
symtab_(s),
mod_(NULL),
dbg_(d),
mod_(NULL)
symtab_(s)
{}
typedef std::vector<std::pair<Address, Address> > range_set_t;
typedef boost::shared_ptr<std::vector<std::pair<Address, Address> > > range_set_ptr;
Expand Down Expand Up @@ -373,7 +373,7 @@ namespace Dyninst {

class ModuleFixer: public DwarfWalker {
private:
virtual bool findType(Type *&type, bool defaultToVoid) {
virtual bool findType(Type *& /*type*/, bool /*defaultToVoid*/) {
return false;
}
public:
Expand All @@ -391,9 +391,9 @@ namespace Dyninst {
return m_obj;
}

virtual void createLocalVariable(const std::vector<VariableLocation> &locs, Type *type,
Dwarf_Unsigned variableLineNo,
const std::string &fileName) {
virtual void createLocalVariable(const std::vector<VariableLocation> & /*locs*/, Type * /*type*/,
Dwarf_Unsigned /*variableLineNo*/,
const std::string & /*fileName*/) {
}


Expand All @@ -405,32 +405,33 @@ namespace Dyninst {
}


virtual void createParameter(const std::vector<VariableLocation> &locs, Type *paramType, Dwarf_Unsigned lineNo,
const std::string &fileName) {
virtual void createParameter(const std::vector<VariableLocation> & /*locs*/, Type * /*paramType*/, Dwarf_Unsigned /*lineNo*/,
const std::string & /*fileName*/) {
}


virtual void setFuncRanges() {
}


virtual void createGlobalVariable(const std::vector<VariableLocation> &locs, Type *type) {
virtual void createGlobalVariable(const std::vector<VariableLocation> & /*locs*/, Type * /*type*/) {
}


virtual bool addStaticClassVariable(const std::vector<VariableLocation> &locs, Type *type) {
virtual bool addStaticClassVariable(const std::vector<VariableLocation> & /*locs*/, Type * /*type*/) {
return false;
}


virtual typeCommon *getCommonBlockType(std::string &commonBlockName) {
virtual typeCommon *getCommonBlockType(std::string & /*commonBlockName*/) {
return NULL;
}
virtual void setModuleFromName(std::string moduleName) {
modname = moduleName;
}


virtual Symbol *findSymbolForCommonBlock(const std::string &commonBlockName) {
virtual Symbol *findSymbolForCommonBlock(const std::string & /*commonBlockName*/) {
return NULL;
}
virtual bool parseVariable() {
Expand Down

0 comments on commit 1da19c1

Please sign in to comment.