r175826 - Simplify code to use castAs rather than getAs + assert.
David Blaikie
dblaikie at gmail.com
Thu Feb 21 15:35:06 PST 2013
Author: dblaikie
Date: Thu Feb 21 17:35:06 2013
New Revision: 175826
URL: http://llvm.org/viewvc/llvm-project?rev=175826&view=rev
Log:
Simplify code to use castAs rather than getAs + assert.
Post commit review feedback on r175812 from Jordan Rose.
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp?rev=175826&r1=175825&r2=175826&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/PathDiagnostic.cpp Thu Feb 21 17:35:06 2013
@@ -993,11 +993,10 @@ StackHintGenerator::~StackHintGenerator(
std::string StackHintGeneratorForSymbol::getMessage(const ExplodedNode *N){
ProgramPoint P = N->getLocation();
- Optional<CallExitEnd> CExit = P.getAs<CallExitEnd>();
- assert(CExit && "Stack Hints should be constructed at CallExitEnd points.");
+ CallExitEnd CExit = P.castAs<CallExitEnd>();
// FIXME: Use CallEvent to abstract this over all calls.
- const Stmt *CallSite = CExit->getCalleeContext()->getCallSite();
+ const Stmt *CallSite = CExit.getCalleeContext()->getCallSite();
const CallExpr *CE = dyn_cast_or_null<CallExpr>(CallSite);
if (!CE)
return "";
More information about the cfe-commits
mailing list