1 / 5

Simple Compiler - SCL

Simple Compiler - SCL. Notes on implementation details. High-level architecture. Frontend. High-level optimizations. Backend. Translation phases. NFA & DFA. AST. High-Level IR. Backend IR. Machine Description. Representations. Symbol Table. Memory-Managed Containers. Graph.

Download Presentation

Simple Compiler - SCL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simple Compiler - SCL Notes on implementation details

  2. High-level architecture Frontend High-level optimizations Backend Translation phases NFA & DFA AST High-Level IR Backend IR Machine Description Representations Symbol Table Memory-Managed Containers Graph Data structures Dynamic Memory Allocation Memory manager Memory Pools (Specialized/Default) Smart Pointers Intrusive lists Command line parser Logs Utils Asserts C++ STL Other external SW (e.g. Boost) Low-level Utils Operating system abstraction layer

  3. Low Level Utils • Assert macros • ASSERT(cond) just checks the condition while ASSERT_X(cond, where, what)prints out additional info on failure • ASSERT/ASSERTD, ASSERT_X/ASSERT_XDfor release/debug build • Most of the time ASSERT_XD should be used • Usage of STL is allowed • Below and including UTILS level • For non-critical functionality above UTILS • BOOST usage possibilty has not been studied yet

  4. Utils • Intrusive lists • Double-linked lists that built peer pointers into the object via inheritance • An object can be involved in multiple lists • Command line options parser • Supports boolean, integer, floating-point and string options • Supports long and short forms of options • Logging support • Logging to file • Logs can form tree-like hierarchy

  5. Intrusive Lists Doubly-liked lists. One object can participate in multiple list. The peer pointers are stored within the client object. Intrusive lists are created by subclassing instance of SListIface ( or MListIface for multiple lists) template corresponding to user class. MyClass MyClass NULL SListItem SListItem next next prev prev User Data User Data Typical syntax example: classMyClass: publicSListIface<MyClass> { … };

More Related