[analyzer] Do not use references in std::pair.

llvm-svn: 138497
This commit is contained in:
Anna Zaks 2011-08-24 21:58:55 +00:00
parent a3e59b49e7
commit f880cff209
1 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ public:
void checkEndPath(EndOfFunctionNodeBuilder &B, ExprEngine &Eng) const; void checkEndPath(EndOfFunctionNodeBuilder &B, ExprEngine &Eng) const;
private: private:
typedef std::pair<SymbolRef, const AllocationState&> AllocationPair; typedef std::pair<SymbolRef, const AllocationState*> AllocationPair;
typedef llvm::SmallVector<AllocationPair, 2> AllocationPairVec; typedef llvm::SmallVector<AllocationPair, 2> AllocationPairVec;
enum APIKind { enum APIKind {
@ -504,7 +504,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const ReturnStmt *S,
BugReport *MacOSKeychainAPIChecker:: BugReport *MacOSKeychainAPIChecker::
generateAllocatedDataNotReleasedReport(const AllocationPair &AP, generateAllocatedDataNotReleasedReport(const AllocationPair &AP,
ExplodedNode *N) const { ExplodedNode *N) const {
const ADFunctionInfo &FI = FunctionsToTrack[AP.second.AllocatorIdx]; const ADFunctionInfo &FI = FunctionsToTrack[AP.second->AllocatorIdx];
initBugType(); initBugType();
llvm::SmallString<70> sbuf; llvm::SmallString<70> sbuf;
llvm::raw_svector_ostream os(sbuf); llvm::raw_svector_ostream os(sbuf);
@ -537,7 +537,7 @@ void MacOSKeychainAPIChecker::checkDeadSymbols(SymbolReaper &SR,
if (State->getSymVal(I->first) || if (State->getSymVal(I->first) ||
definitelyReturnedError(I->second.RetValue, State, C.getSValBuilder())) definitelyReturnedError(I->second.RetValue, State, C.getSValBuilder()))
continue; continue;
Errors.push_back(std::make_pair(I->first, I->second)); Errors.push_back(std::make_pair(I->first, &I->second));
} }
if (!Changed) if (!Changed)
return; return;
@ -576,7 +576,7 @@ void MacOSKeychainAPIChecker::checkEndPath(EndOfFunctionNodeBuilder &B,
Eng.getSValBuilder())) { Eng.getSValBuilder())) {
continue; continue;
} }
Errors.push_back(std::make_pair(I->first, I->second)); Errors.push_back(std::make_pair(I->first, &I->second));
} }
// If no change, do not generate a new state. // If no change, do not generate a new state.