libera/#clasp - IRC Chatlog
Search
20:16:17
Bike
yeah ,just having the same base class info between the scraper and analyzer would be enough i think
20:19:08
drmeister
Ok - let's see if I can attach it to the class as a typedef and then pull it out with a submatcher.
20:24:21
drmeister
That occurred to me yesterday and I forgot to mention it until now. You know about this - right?
20:40:05
drmeister
Here's a really powerful thing I discovered recently to do with ASTMatchers and STST
20:41:15
drmeister
You can write ASTMatchers and see what they recognize interactively. It's what I wanted in clasp but didn't put the work in to to achieve it.
20:41:58
drmeister
Each LISP_xxx_CLASS macro defines a typedef "Base". - that's the base class as seen in the LISP_xxx_CLASS macro.
20:46:38
drmeister
cxxRecordDecl(matchesName(".*_O"),forEach(typedefNameDecl(hasName("Base")).bind("ClaspBase")))
3:31:28
drmeister
{ TAGS:CLASS-KIND (TAGS:STAMP-NAME . "STAMPWTAG_core__MDArrayT_O") (TAGS:STAMP-KEY . "core::MDArrayT_O") (TAGS:PARENT-CLASS . "core::template_Array<core::MDArrayT_O,core::SimpleMDArrayT_O,core::SimpleVector_O,core::MDArray_O>") (TAGS:LISP-CLASS-BASE . "core::MDArray_O") (TAGS:ROOT-CLASS . "core::T_O") (TAGS:STAMP-WTAG . 3) (TAGS:DEFINITION-DATA . "IS_POLYMORPHIC") }
4:03:30
drmeister
It's on every class - but the ones that don't have that macro have NoLispClassBase or something like that.
4:06:25
drmeister
For some bizarre reason ClosureWithSlots_O comes back as a cast:elaborated-type - and when I get the name of the type it comes back as "class core::Closure_O" - that's right - it starts with "class ".
4:07:23
drmeister
Then I'm like - do I spend an indeterminate amount of time trying to figure out how to get just "core::Closure_O" or do I just search for the space and take the substring. Gah.
4:08:33
drmeister
I couldn't figure out why it's different. The only other one that has a cast:elaborated-type (In c++ clang::ElaboratedType) is core::T_O and that one I can understand.
4:09:02
drmeister
class ClosureWithSlots_O final : public core::BuiltinClosure_O::BuiltinClosure_O::Closure_O {
4:25:08
drmeister
I'm running the static analyze for cando and I'll push it with the changes to the static analyzer once it's done.