Skip to content
Snippets Groups Projects
SMPFunction.h 84.9 KiB
Newer Older
clc5q's avatar
clc5q committed
	void ChainAliasHelper(std::size_t BlockNum); // helper for AliasAnalysis2()
	void FindCounterVariables(void); // Mark NUMERIC (and propagate) any DEF that starts at small immed. value and gets only small inc/dec operations.
	bool CounterVarHelper(const STARSOpndTypePtr &DefOp, int DefSSANum, int BlockNum, bool LocalName, std::list<std::pair<int, STARS_ea_t> > &CounterSSANums); // recursive helper for FindCounterVariables()
	bool ConditionalTypePropagation(void); // Apply SCC algorithm to unresolved Phi DEFs
	bool PropagateSignedness(void); // Propagate signedness FG info from DEFs to USEs whenever there is no USE sign info.
	void MarkSpecialNumericErrorCases(void); // Detect and mark special cases before emitting numeric error annotations.
	void EmitReturnTargetAnnotations(void); // Emit Indirect Branch Target destinations for return instructions in this func.
	void EmitFuncPtrShadowingAnnotations(FILE *InfoAnnotFile); // Emit annotations for func ptr shadowing defense
	bool IsAlreadyShadowed(const ShadowPoint &CriticalOp); // Is CriticalOp already represented in AlreadyShadowed set?
	void EmitShadowingHelper(FILE *InfoAnnotFile, SMPInstr *CurrInst, bool FuncPtr, STARS_ea_t CallAddr); // common code for different cases in shadowing func ptr, critical args
	void EmitFuncPtrShadowingAnnotations2(FILE *InfoAnnotFile); // Emit annotations for func ptr shadowing defense
	void EmitArgShadowingAnnotations(FILE *InfoAnnotFile); // Emit annotations for critical argument shadowing defense
	void EmitStackMemWriteAnnotations(STARSExpression *MemWriteLowerBound, STARSExpression *MemWriteUpperBound, bool PositiveIncrement, const std::set<STARS_ea_t> &StackPtrCopiesSet);
	bool MDFindReturnTypes(void); // Fill ReturnRegTypes[]
	void MDFindIncomingTypes(void); // Fill IncomingRegTypes[]
	bool IsCallerReturnAddressReadOrWritten(void); // Can the return address of any caller be read or written directly from this function?

	friend class STARS_IDA_Function_t;
	friend class STARS_IRDB_Function_t;
}; // end class SMPFunction

#endif