r302879 - [analyzer] Avoid an allocation in Std C function modelling

Gabor Horvath via cfe-commits cfe-commits at lists.llvm.org
Thu May 11 23:53:55 PDT 2017


Author: xazax
Date: Fri May 12 01:53:55 2017
New Revision: 302879

URL: http://llvm.org/viewvc/llvm-project?rev=302879&view=rev
Log:
[analyzer] Avoid an allocation in Std C function modelling

Differential Revision: https://reviews.llvm.org/D33095

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp?rev=302879&r1=302878&r2=302879&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp Fri May 12 01:53:55 2017
@@ -440,7 +440,10 @@ StdLibraryFunctionsChecker::findFunction
   BasicValueFactory &BVF = SVB.getBasicValueFactory();
   initFunctionSummaries(BVF);
 
-  std::string Name = FD->getQualifiedNameAsString();
+  IdentifierInfo *II = FD->getIdentifier();
+  if (!II)
+    return None;
+  StringRef Name = II->getName();
   if (Name.empty() || !C.isCLibraryFunction(FD, Name))
     return None;
 




More information about the cfe-commits mailing list