[PATCH] D45147: [clang] Implement Intercal compatibility feature

Leandro A. F. Pereira via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 1 07:40:35 PDT 2018


lpereira created this revision.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D45147

Files:
  include/clang-c/Index.h
  include/clang/AST/RecursiveASTVisitor.h
  include/clang/AST/Stmt.h
  include/clang/Basic/StmtNodes.td
  include/clang/Basic/TokenKinds.def
  include/clang/Parse/Parser.h
  include/clang/Sema/Sema.h
  lib/AST/StmtPrinter.cpp
  lib/CodeGen/CGStmt.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/Parse/ParseStmt.cpp
  lib/Sema/SemaStmt.cpp
  lib/Sema/TreeTransform.h
  lib/StaticAnalyzer/Core/ExprEngine.cpp
  tools/libclang/CXCursor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45147.140580.patch
Type: text/x-patch
Size: 11385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180401/889f82a5/attachment.bin>


More information about the cfe-commits mailing list