From 51327bd8839d0ac01002d5bec231fc2558a4afca Mon Sep 17 00:00:00 2001 From: Kenneth Lamar Date: Wed, 23 Oct 2024 18:18:09 -0400 Subject: [PATCH] Fix specHasBody() --- src/lcom.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lcom.cpp b/src/lcom.cpp index 06638fc..5f44ccb 100755 --- a/src/lcom.cpp +++ b/src/lcom.cpp @@ -3,6 +3,7 @@ #include #include +#include "sageInterface.h" #include #include @@ -16,6 +17,8 @@ #include "lcom.hpp" #include "traverse.hpp" +namespace si = SageInterface; + // using Class = SgAdaPackageSpec*; using Method = Traverse::MType; using Attribute = Traverse::AType; @@ -136,7 +139,7 @@ std::string sourceLocation(const SgLocatedNode* n, const std::string& alt) */ bool specHasBody(const SgNode*) { return true; } -bool specHasBody(const SgAdaPackageSpec* spec) { return spec->get_body() != nullptr; } +bool specHasBody(const SgAdaPackageSpec* spec) { return si::Ada::getBodyDefinition(spec) != nullptr; } template std::string ProcessLCOM(SgProject* project) {