Skip to content

Commit 7b9cf1c

Browse files
author
George Karpenkov
committedSep 6, 2017
[NFC] [CSA] Move AnyFunctionCall::getRuntimeDefinition implementation to cpp.
Differential Revision: https://reviews.llvm.org/D37499 llvm-svn: 312670
1 parent a0186dd commit 7b9cf1c

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed
 

‎clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h

+1-14
Original file line numberDiff line numberDiff line change
@@ -436,20 +436,7 @@ class AnyFunctionCall : public CallEvent {
436436
return cast<FunctionDecl>(CallEvent::getDecl());
437437
}
438438

439-
RuntimeDefinition getRuntimeDefinition() const override {
440-
const FunctionDecl *FD = getDecl();
441-
// Note that the AnalysisDeclContext will have the FunctionDecl with
442-
// the definition (if one exists).
443-
if (FD) {
444-
AnalysisDeclContext *AD =
445-
getLocationContext()->getAnalysisDeclContext()->
446-
getManager()->getContext(FD);
447-
if (AD->getBody())
448-
return RuntimeDefinition(AD->getDecl());
449-
}
450-
451-
return RuntimeDefinition();
452-
}
439+
RuntimeDefinition getRuntimeDefinition() const override;
453440

454441
bool argumentsMayEscape() const override;
455442

‎clang/lib/StaticAnalyzer/Core/CallEvent.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,22 @@ ArrayRef<ParmVarDecl*> AnyFunctionCall::parameters() const {
343343
return D->parameters();
344344
}
345345

346+
347+
RuntimeDefinition AnyFunctionCall::getRuntimeDefinition() const {
348+
const FunctionDecl *FD = getDecl();
349+
// Note that the AnalysisDeclContext will have the FunctionDecl with
350+
// the definition (if one exists).
351+
if (FD) {
352+
AnalysisDeclContext *AD =
353+
getLocationContext()->getAnalysisDeclContext()->
354+
getManager()->getContext(FD);
355+
if (AD->getBody())
356+
return RuntimeDefinition(AD->getDecl());
357+
}
358+
359+
return RuntimeDefinition();
360+
}
361+
346362
void AnyFunctionCall::getInitialStackFrameContents(
347363
const StackFrameContext *CalleeCtx,
348364
BindingsTy &Bindings) const {

0 commit comments

Comments
 (0)
Please sign in to comment.