-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taking on every NYI we hit while parsing a large code base #71
Conversation
…ended the AST to typesymbol mapper with the mapping id of the declared alias template
This needs some testing. @linuswagner could you give it as spin? and perhaps supply a small code example that exercises this new feature? |
… bridge between Rascal and CDT
…non type-value arguments as template parameters
src/lang/cpp/AST.rsc
Outdated
@@ -554,3 +554,59 @@ java rel[loc,loc] parseForMacros(loc file, str charset=DEFAULT_CHARSET, bool inf | |||
@synopsis{All functions in this module that have a charset parameter use this as default.} | |||
public str DEFAULT_CHARSET = "UTF-8"; | |||
|
|||
public map[str, str] linusMacros = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, it's back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange.. I must have git commit -am
ed again.. it's in my muscle memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the status now? are we ready to merge?
src/lang/cpp/TypeSymbol.rsc
Outdated
|
||
| \functionSetType(loc decl, list[TypeSymbol] templateArguments) | ||
| \functionSetTypePointer(loc decl, list[TypeSymbol] templateArguments) | ||
|
||
| \unaryTypeTransformation(str operator, TypeSymbol operand) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of encoding the operator as a string parameter. Can we specialize this per operator? Looking at the code, there's (currently) only one value in the operator enum anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that either. I'll have a look. If it's a small finite set we can have one transformation constructor per operator. Otherwise, we introduce an TypeTransformationOperator sort.
@@ -376,7 +376,7 @@ private ISourceLocation resolveIEnumeration(IEnumeration binding, ISourceLocatio | |||
throw new RuntimeException("NYI" + binding.getClass().getSimpleName() + ": " + binding + " @ " + origin); | |||
} | |||
|
|||
private ISourceLocation resolveICPPBinding(ICPPBinding binding, ISourceLocation origin) throws URISyntaxException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is dead code.
@@ -840,6 +840,16 @@ public ISourceLocation resolveBinding(IASTNameOwner node, ISourceLocation origin | |||
return failedBinding("unknown"); | |||
} | |||
|
|||
public ISourceLocation resolveBinding(ICPPBinding binding, ISourceLocation origin) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason that the preexisting interface method did not suffice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, due to multiple inheritance of interfaces, the code for reaching ICPPBinding was not always reachable, in particular when the object did not accidentally also implement IASTNameOwner.
@@ -1459,29 +1457,6 @@ private int visit(ICPPASTDesignatedInitializer initializer) { | |||
return PROCESS_ABORT; | |||
} | |||
|
|||
// InitializerClauses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this unreachable code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. the compiler warned about that
@@ -1557,12 +1532,6 @@ private int visit(IASTArrayDeclarator declarator) { | |||
return PROCESS_ABORT; | |||
} | |||
|
|||
private int visit(IASTFieldDeclarator declarator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this unreachable code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments here and there. Looks good in general, but this PR has become much larger than just the alias templates, which makes it harder to review.
So true. We are under a lot of time pressure here so we decided to take a sprint and solve every remaining issue as it hits us. The code base we are trying to parse and map is incredibly large and decades old, so it seems we are bound for hitting every |
Just added GNU's computed goto's. Will try and simplify the TypeTransformationOperator design now. |
This is to fix this stracktrace: