Skip to content

Commit

Permalink
C++ semantics [symbol] tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
chathhorn committed Oct 23, 2019
1 parent 8217762 commit cc2264c
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 174 deletions.
12 changes: 9 additions & 3 deletions clang-tools/ClangKast/GetKastVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class GetKastVisitor
TALI->NumTemplateArgs));
} else {
Kast::add(Kast::KApply("TemplateSpecialization", Sort::DECL, {Sort::ATYPE, Sort::DECL}));
Kast::add(Kast::KApply("TemplateSpecializationType", Sort::ATYPE, {Sort::CID}));
Kast::add(Kast::KApply("TemplateSpecializationType2", Sort::ATYPE, {Sort::CID}));
TRY_TO(TraverseDeclarationName(FTSI->getTemplate()->getDeclName()));
}
} else if (FTSI->getTemplateSpecializationKind() != TSK_Undeclared &&
Expand All @@ -378,7 +378,7 @@ class GetKastVisitor
} else {
Kast::add(Kast::KApply("TemplateInstantiationDeclaration", Sort::DECL, {Sort::ATYPE, Sort::DECL}));
}
Kast::add(Kast::KApply("TemplateSpecializationType", Sort::ATYPE, {Sort::CID}));
Kast::add(Kast::KApply("TemplateSpecializationType2", Sort::ATYPE, {Sort::CID}));
TRY_TO(TraverseDeclarationName(FTSI->getTemplate()->getDeclName()));
}
}
Expand Down Expand Up @@ -1070,7 +1070,13 @@ class GetKastVisitor
if (T->getSizeModifier() != clang::ArrayType::Normal) {
throw std::logic_error("unimplemented: static/* array");
}
Kast::add(Kast::KApply("ArrayType", Sort::ATYPE, {Sort::ATYPE, sort}));
std::string arr;
if (sort == Sort::AEXPR) {
arr = "ArrayTypeAExpr";
} else {
arr = "ArrayType";
}
Kast::add(Kast::KApply(arr, Sort::ATYPE, {Sort::ATYPE, sort}));
TRY_TO(TraverseType(T->getElementType()));
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion semantics/common/compat.k
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module COMPAT-SYNTAX
syntax KItem ::= set(Set)

syntax K ::= listToK(List) [function]
syntax List ::= kSeqToList(K) [function]
syntax List ::= kSeqToList(K) [function, symbol]

syntax KTuple ::= kpair(K, K)
| ktriple(K, K, K)
Expand Down
Loading

0 comments on commit cc2264c

Please sign in to comment.