This is an archive of the discontinued LLVM Phabricator instance.

[clang] Implement Intercal compatibility feature
AbandonedPublic

Authored by lpereira on Apr 1 2018, 7:40 AM.

Details

Reviewers
None
Summary

This commit is part of a grand series of changes that aims to reduce
the amount of evil in the world. The "goto" statement is one of such
evils that must be fought; however, due to both compatibility reasons,
and lack of support in mainstream compilers, it can't be removed just
now.

This patch implements Intercal's "comefrom" statement in both C and C++
modes.

When comparing to the original implementation, the astute reader will
note that behavior such as producing an error when more than one line
comes from another label or not properly handling when a line comes
from a label and goes to a label. This is to keep the tone of both C
and C++ languages, with regards to undefined behavior.

Diff Detail

Event Timeline

lpereira created this revision.Apr 1 2018, 7:40 AM

Macro testcase:
Please add docs, release notes entry, and most importantly, tests!

lpereira abandoned this revision.Apr 3 2018, 6:36 AM