summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-08-15 18:42:00 +0000
committerAnna Zaks <ganna@apple.com>2011-08-15 18:42:00 +0000
commit29f9b7adc35a9938835b3e74e0f6464934bf77d9 (patch)
treef52205221d8131c1f789c77389fa7b0a9b5dddf8 /clang/lib/StaticAnalyzer
parentd7d80aadd1b824ca5470ca7fde9eab455cf48df5 (diff)
downloadbcm5719-llvm-29f9b7adc35a9938835b3e74e0f6464934bf77d9.tar.gz
bcm5719-llvm-29f9b7adc35a9938835b3e74e0f6464934bf77d9.zip
MacOSKeychainAPIChecker: Use llvm::SmallString instead of std::string (as per code review for r137523).
llvm-svn: 137633
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
index 1663252cdd3..497202b9a5d 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
@@ -234,8 +234,8 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
if (!N)
return;
initBugType();
- std::string sbuf;
- llvm::raw_string_ostream os(sbuf);
+ llvm::SmallString<128> sbuf;
+ llvm::raw_svector_ostream os(sbuf);
unsigned int DIdx = FunctionsToTrack[AS->AllocatorIdx].DeallocatorIdx;
os << "Allocated data should be released before another call to "
<< "the allocator: missing a call to '"
@@ -272,7 +272,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
if (!ArgSM && !RegionArgIsBad)
return;
- // If trying to free data which has not been allocated yet, report as bug.
+ // If trying to free data which has not been allocated yet, report as a bug.
const AllocationState *AS = State->get<AllocatedData>(ArgSM);
if (!AS || RegionArgIsBad) {
// It is possible that this is a false positive - the argument might
@@ -299,8 +299,8 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
return;
initBugType();
- std::string sbuf;
- llvm::raw_string_ostream os(sbuf);
+ llvm::SmallString<80> sbuf;
+ llvm::raw_svector_ostream os(sbuf);
os << "Allocator doesn't match the deallocator: '"
<< FunctionsToTrack[PDeallocIdx].Name << "' should be used.";
RangedBugReport *Report = new RangedBugReport(*BT, os.str(), N);
@@ -402,8 +402,8 @@ RangedBugReport *MacOSKeychainAPIChecker::
ExplodedNode *N) const {
const ADFunctionInfo &FI = FunctionsToTrack[AS.AllocatorIdx];
initBugType();
- std::string sbuf;
- llvm::raw_string_ostream os(sbuf);
+ llvm::SmallString<70> sbuf;
+ llvm::raw_svector_ostream os(sbuf);
os << "Allocated data is not released: missing a call to '"
<< FunctionsToTrack[FI.DeallocatorIdx].Name << "'.";
RangedBugReport *Report = new RangedBugReport(*BT, os.str(), N);
OpenPOWER on IntegriCloud