diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-21 23:35:06 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-21 23:35:06 +0000 |
commit | df1f94ebfac4578e27ad008522c7b333e977e51b (patch) | |
tree | d216df4cebdcb0a824d1f3939c80b98957b46782 | |
parent | 3c16431cb973079d178338833dafd6b483bf8c8d (diff) |
Simplify code to use castAs rather than getAs + assert.
Post commit review feedback on r175812 from Jordan Rose.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175826 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/StaticAnalyzer/Core/PathDiagnostic.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index b27a80f93c..8c6eaec1b5 100644 --- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -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 ""; |