]> granicus.if.org Git - clang/commitdiff
Kill some unnecessary calls to c_str().
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 29 Nov 2009 18:03:28 +0000 (18:03 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 29 Nov 2009 18:03:28 +0000 (18:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90084 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicObjCFoundationChecks.cpp
lib/Analysis/NSErrorChecker.cpp
lib/Analysis/UndefResultChecker.cpp

index e19e7abda74c74e7a5588cb9625679cce650df97..c913779864961e9a97e0727143e3ccb4e8b9acf8 100644 (file)
@@ -87,7 +87,7 @@ private:
     // by the BugReporter object 'BR' once we call BR.EmitWarning.
     if (!BT) BT = new APIMisuse("nil argument");
 
-    RangedBugReport *R = new RangedBugReport(*BT, os.str().c_str(), N);
+    RangedBugReport *R = new RangedBugReport(*BT, os.str(), N);
     R->addRange(ME->getArg(Arg)->getSourceRange());
     BR.EmitReport(R);
   }
@@ -435,7 +435,7 @@ void AuditCFNumberCreate::AddError(const TypedRegion* R, const Expr* Ex,
   // Lazily create the BugType object.  This will be owned
   // by the BugReporter object 'BR' once we call BR.EmitWarning.
   if (!BT) BT = new APIMisuse("Bad use of CFNumberCreate");
-  RangedBugReport *report = new RangedBugReport(*BT, os.str().c_str(), N);
+  RangedBugReport *report = new RangedBugReport(*BT, os.str(), N);
   report->addRange(Ex->getSourceRange());
   BR.EmitReport(report);
 }
index f6dd2d2471186b344c851ea74db9f6ef060238e7..c5c405e517694e5fca9757633ef435b32c11781a 100644 (file)
@@ -231,7 +231,7 @@ void NSErrorChecker::CheckParamDeref(const VarDecl *Param,
 
     os << Param->getNameAsString() << "' may be null.";
 
-    BugReport *report = new BugReport(*this, os.str().c_str(), *I);
+    BugReport *report = new BugReport(*this, os.str(), *I);
     // FIXME: Notable symbols are now part of the report.  We should
     //  add support for notable symbols in BugReport.
     //    BR.addNotableSymbol(SV->getSymbol());
index ec12a988e545167e600193e084c6536215ebe114..acc86dda5a97c126d9e4eb34ad34604873d94e45 100644 (file)
@@ -74,8 +74,7 @@ void UndefResultChecker::PostVisitBinaryOperator(CheckerContext &C,
          << BinaryOperator::getOpcodeStr(B->getOpcode())
          << "' expression is undefined";
     }
-    EnhancedBugReport *report = new EnhancedBugReport(*BT, 
-                                                    OS.str().str().c_str(), N);
+    EnhancedBugReport *report = new EnhancedBugReport(*BT, OS.str(), N);
     if (Ex) {
       report->addRange(Ex->getSourceRange());
       report->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue, Ex);