[ClavaAst] Add CXXRecordDecl.getBases()
@@ -24,6 +24,7 @@ import org.suikasoft.jOptions.Interfaces.DataStore;
import pt.up.fe.specs.clava.ClavaNode;
import pt.up.fe.specs.clava.ast.decl.data.CXXBaseSpecifier;
+import pt.up.fe.specs.clava.ast.type.TagType;
/**
* Represents a C++ class.
@@ -157,4 +158,10 @@ public class CXXRecordDecl extends RecordDecl {
}
+ public List<Decl> getBases() {
+ return get(RECORD_BASES).stream()
+ .map(baseSpec -> baseSpec.get(CXXBaseSpecifier.TYPE).get(TagType.DECL))
+ .collect(Collectors.toList());
+ }
+
}
