GCC and LLVM - Comparison of implementation of front-ends
Porovnání implementací předních částí překladačů GCC a LLVM
Authors
Supervisors
Reviewers
Editors
Other contributors
Journal Title
Journal ISSN
Volume Title
Publisher
České vysoké učení technické v Praze
Czech Technical University in Prague
Czech Technical University in Prague
Date of defense
2015-06-24
Abstract
Práce se zabývá implementací předních částí překladačů GCC a LLVM. Přední části zpracují a analyzují zdrojový kód jazyka Mila, který transformují ve vnitřní formu daného překladače. Jazyk Mila je zde rozebrán a je pro něj implementován lexikální analyzátor, parser a abstraktní syntaktický strom, což je v práci dokumentováno.
V práci je kladen důraz na detailní popis a porovnání využitých rozhraní GCC a LLVM. Na základě tohoto popisu může kdokoliv další vytvořit novou přední část pro zmíněné překladače. Porovnáním bylo zjištěno, že implementace přední části pro LLVM je oproti GCC náročnější, protože se od přední části vyžaduje větší předzpracování zdrojového kódu.
Obě přední části byly úspěšně implementovány a jsou otestovány sadou vzorových programů, které pokrývají všechny implementované funkcionality. Zdrojové kódy předních částí a vzorových programů jsou spolu s kompletní LL(k) gramatikou jazyka Mila k nalezení v příloze.
Implementations of compiler frontends for GCC and LLVM compiler toolkits are presented in the thesis. Frontends parse and analyse Mila source code, transforming it into an intermediate representation used by a respective compiler. Mila language is formally described and an implementation of a lexical analyser, a syntactic analyser and an abstract syntax tree is documented. In this thesis there is placed emphasis on the detailed description and comparison of used interface of GCC and LLVM. Based on this description, anyone can create a new frontend for these compilers. It was found that the implementation of the LLVM front-end is more difficult, because there is needed to do more transformations of source code in the front-end. Front-ends have been successfully implemented and tested to be correct by a set of sample programs covering all functionality. Source codes of front-ends, sample programs and complete LL(k) grammar of Mila language can be found in the appendix.
Implementations of compiler frontends for GCC and LLVM compiler toolkits are presented in the thesis. Frontends parse and analyse Mila source code, transforming it into an intermediate representation used by a respective compiler. Mila language is formally described and an implementation of a lexical analyser, a syntactic analyser and an abstract syntax tree is documented. In this thesis there is placed emphasis on the detailed description and comparison of used interface of GCC and LLVM. Based on this description, anyone can create a new frontend for these compilers. It was found that the implementation of the LLVM front-end is more difficult, because there is needed to do more transformations of source code in the front-end. Front-ends have been successfully implemented and tested to be correct by a set of sample programs covering all functionality. Source codes of front-ends, sample programs and complete LL(k) grammar of Mila language can be found in the appendix.
Description
Citation
Underlying research data set URL
Permanent link
Rights/License
A university thesis is a work protected by the Copyright Act of the Czech Republic. Extracts, copies and transcripts of the thesis are allowed for personal use only and at one`s own expense. The use of thesis should be in compliance with the Copyright Act.
Vysokoškolská závěrečná práce je dílo chráněné autorským zákonem. Je možné pořizovat z něj na své náklady a pro svoji osobní potřebu výpisy, opisy a rozmnoženiny. Jeho využití musí být v souladu s autorským zákonem v platném znění.
Vysokoškolská závěrečná práce je dílo chráněné autorským zákonem. Je možné pořizovat z něj na své náklady a pro svoji osobní potřebu výpisy, opisy a rozmnoženiny. Jeho využití musí být v souladu s autorským zákonem v platném znění.