diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-04-17 09:33:03 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-04-17 09:33:03 +0000 |
commit | b11416d061f6710b0548bb6fbd730a32b8e66226 (patch) | |
tree | 6a69d5fda952634036fd64b7b0b1b89eb788cb3a /clang/lib/Checker/CheckSecuritySyntaxOnly.cpp | |
parent | ca0a53ac52992973d9aad654f4d8e2961d174de4 (diff) | |
download | bcm5719-llvm-b11416d061f6710b0548bb6fbd730a32b8e66226.tar.gz bcm5719-llvm-b11416d061f6710b0548bb6fbd730a32b8e66226.zip |
Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.
The next step is to print the name directly into the stream, avoiding a temporary std::string copy.
llvm-svn: 101632
Diffstat (limited to 'clang/lib/Checker/CheckSecuritySyntaxOnly.cpp')
-rw-r--r-- | clang/lib/Checker/CheckSecuritySyntaxOnly.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/Checker/CheckSecuritySyntaxOnly.cpp b/clang/lib/Checker/CheckSecuritySyntaxOnly.cpp index efbce612614..74e12b18a81 100644 --- a/clang/lib/Checker/CheckSecuritySyntaxOnly.cpp +++ b/clang/lib/Checker/CheckSecuritySyntaxOnly.cpp @@ -387,11 +387,11 @@ void WalkAST::CheckCall_rand(const CallExpr *CE, const FunctionDecl *FD) { // Issue a warning. llvm::SmallString<256> buf1; llvm::raw_svector_ostream os1(buf1); - os1 << "'" << FD->getNameAsString() << "' is a poor random number generator"; + os1 << '\'' << FD << "' is a poor random number generator"; llvm::SmallString<256> buf2; llvm::raw_svector_ostream os2(buf2); - os2 << "Function '" << FD->getNameAsString() + os2 << "Function '" << FD << "' is obsolete because it implements a poor random number generator." << " Use 'arc4random' instead"; @@ -472,14 +472,12 @@ void WalkAST::CheckUncheckedReturnValue(CallExpr *CE) { // Issue a warning. llvm::SmallString<256> buf1; llvm::raw_svector_ostream os1(buf1); - os1 << "Return value is not checked in call to '" << FD->getNameAsString() - << "'"; + os1 << "Return value is not checked in call to '" << FD << '\''; llvm::SmallString<256> buf2; llvm::raw_svector_ostream os2(buf2); - os2 << "The return value from the call to '" << FD->getNameAsString() - << "' is not checked. If an error occurs in '" - << FD->getNameAsString() + os2 << "The return value from the call to '" << FD + << "' is not checked. If an error occurs in '" << FD << "', the following code may execute with unexpected privileges"; SourceRange R = CE->getCallee()->getSourceRange(); |