Getting Started with LLVM Core Libraries

Total Page:16

File Type:pdf, Size:1020Kb

Getting Started with LLVM Core Libraries Getting Started with LLVM Core Libraries Get to grips with LLVM essentials and use the core libraries to build advanced tools Bruno Cardoso Lopes Rafael Auler BIRMINGHAM - MUMBAI Getting Started with LLVM Core Libraries Copyright © 2014 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: August 2014 Production reference: 1200814 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78216-692-4 www.packtpub.com Cover image by Aniket Sawant ([email protected]) Credits Authors Project Coordinator Bruno Cardoso Lopes Priyanka Goel Rafael Auler Proofreaders Reviewers Simran Bhogal Eli Bendersky Mario Cecere Logan Chien Jonathan Todd Jia Liu John Szakmeister Indexers Hemangini Bari Commissioning Editor Mariammal Chettiyar Mary Jasmine Nadar Tejal Soni Acquisition Editor Graphics Kevin Colaco Ronak Dhruv Abhinash Sahu Content Development Editor Arun Nadar Production Coordinators Saiprasad Kadam Technical Editors Conidon Miranda Pramod Kumavat Pratik More Cover Work Manu Joseph Copy Editors Saiprasad Kadam Dipti Kapadia Insiya Morbiwala Aditya Nair Alfida Paiva Stuti Srivastava About the Authors Bruno Cardoso Lopes received a PhD in Computer Science from University of Campinas, Brazil. He's been an LLVM contributor since 2007 and implemented the MIPS backend from scratch, which he has been maintaining for several years. Among his other contributions, he has written the x86 AVX support and improved the ARM assembler. His research interests include code compression techniques and reduced bit width ISAs. In the past, he has also developed drivers for Linux and FreeBSD operating systems. Rafael Auler is a PhD candidate at University of Campinas, Brazil. He holds a Master's degree in Computer Science and a Bachelor's degree in Computer Engineering from the same university. For his Master's work, he wrote a proof-of-concept tool that automatically generates LLVM backends based on architecture description files. Currently, his PhD research topics include dynamic binary translation, Just-in-Time compilers, and computer architecture. Rafael was also a recipient of the Microsoft Research 2013 Graduate Research Fellowship Award. About the Reviewers Eli Bendersky has been a professional programmer for 15 years, with extensive experience in systems programming, including compilers, linkers, and debuggers. He's been a core contributor to the LLVM project since early 2012. Logan Chien received his Master's degree in Computer Science from National Taiwan University. His research interests include compiler design, compiler optimization, and virtual machines. He is a software developer and has been working on several open source projects, including LLVM, Android, and so on. He has written several patches to fix the ARM zero-cost exception handling mechanism and enhanced the LLVM ARM integrated assembler. He was also a Software Engineer Intern at Google in 2012. At Google, he integrated the LLVM toolchain with the Android NDK. Jia Liu started GNU/Linux-related development in his college days and has been engaged in open-source-related development jobs after graduation. He is now responsible for all software-related work at China-DSP. He is interested in compiler technology and has been working on it for years. In his spare time, he also works on a few open source projects such as LLVM, QEMU, and GCC/Binutils. He is employed by a Chinese processor vendor, Glarun Technology—you can just call it China-DSP. China-DSP is a high-performance DSP vendor; the core business of the company is processor design, system software, and an embedded parallel processing platform that provides independent knowledge of electricity, telecommunications, automotive, manufacturing equipment, instrumentation, and consumer electronics. I want to thank my father and my mother; they raised me. Thanks to my girlfriend; in fact, I think she is my life's mentor. Thanks to my colleagues; we happily work with one another. John Szakmeister holds a Master of Science in Electrical Engineering from Johns Hopkins University and is a co-founder of Intelesys Corporation (www.intelesyscorp.com). John has been writing software professionally for more than 15 years and enjoys working on compilers, operating systems, sophisticated algorithms, and anything embedded. He's an avid supporter of Open Source and contributes to many projects in his free time. When he is not hacking, John works toward his black belt in Ninjutsu and enjoys reading technical books. I would like to thank my wife, Ann, and our two boys, Matthew and Andrew, for being so patient and understanding while I was reviewing this book. www.PacktPub.com Support files, eBooks, discount offers, and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. TM http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read, and search across Packt's entire library of books. Why subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via web browser Free access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. Table of Contents Preface 1 Chapter 1: Build and Install LLVM 9 Understanding LLVM versions 10 Obtaining prebuilt packages 10 Obtaining the official prebuilt binaries 11 Using package managers 12 Staying updated with snapshot packages 12 Building from sources 13 System requirements 13 Obtaining sources 14 SVN 14 Git 15 Building and installing LLVM 15 Using the autotools-generated configure script 15 Using CMake and Ninja 18 Using other Unix approaches 21 Windows and Microsoft Visual Studio 21 Mac OS X and Xcode 25 Summary 30 Chapter 2: External Projects 31 Introducing Clang extras 32 Building and installing Clang extra tools 33 Understanding Compiler-RT 34 Seeing Compiler-RT in action 34 Using the DragonEgg plugin 36 Building DragonEgg 37 Understanding the compilation pipeline with DragonEgg and LLVM tools 38 Understanding the LLVM test suite 39 Table of Contents Using LLDB 40 Exercising a debug session with LLDB 41 Introducing the libc++ standard library 43 Summary 46 Chapter 3: Tools and Design 47 Introducing LLVM's basic design principles and its history 47 Understanding LLVM today 50 Interacting with the compiler driver 52 Using standalone tools 54 Delving into the LLVM internal design 56 Getting to know LLVM's basic libraries 57 Introducing LLVM's C++ practices 58 Seeing polymorphism in practice 59 Introducing C++ templates in LLVM 59 Enforcing C++ best practices in LLVM 60 Making string references lightweight in LLVM 61 Demonstrating the pluggable pass interface 62 Writing your first LLVM project 64 Writing the Makefile 64 Writing the code 66 Navigating the LLVM source – general advice 68 Understanding the code as a documentation 68 Asking the community for help 69 Coping with updates – using the SVN log as a documentation 69 Concluding remarks 71 Summary 72 Chapter 4: The Frontend 73 Introducing Clang 73 Frontend actions 74 Libraries 76 Using libclang 76 Understanding Clang diagnostics 78 Reading diagnostics 80 Learning the frontend phases with Clang 83 Lexical analysis 83 Exercising lexical errors 85 Writing libclang code that uses the lexer 85 Preprocessing 88 Syntactic analysis 90 Understanding Clang AST nodes 90 Understanding the parser actions with a debugger 92 Exercising a parser error 94 Writing code that traverses the Clang AST 94 [ ii ] Table of Contents Serializing the AST with precompiled headers 97 Semantic analysis 98 Exercising a semantic error 99 Generating the LLVM IR code 99 Putting it together 100 Summary 104 Chapter 5: The LLVM Intermediate Representation 105 Overview 105 Understanding the LLVM IR target dependency 107 Exercising basic tools to manipulate the IR formats 108 Introducing the LLVM IR language syntax 109 Introducing the LLVM IR in-memory model 113 Writing a custom LLVM IR generator 114 Building
Recommended publications
  • Free Software an Introduction
    Free Software an Introduction By Steve Riddett using Scribus 1.3.3.12 and Ubuntu 8.10 Contents Famous Free Software...................................................... 2 The Difference.................................................................. 3 Stallman and Torvalds.......................................................4 The Meaning of Distro......................................................5 Linux and the Holy Grail.................................................. 6 Frequently Asked Questions............................................. 7 Where to find out more.....................................................8 2 Free Software - an Introduction Famous Free Software Firefox is a web browser similar to Microsoft's Internet Explorer but made the Free software way. The project started in 2003 from the source code of the Netscape browser which had been released when Netscape went bust. In April 2009, Firefox recorded 29% use worldwide (34% in Europe). Firefox is standards compliant and has a system of add-ons which allow innovative new features to be added by the community. OpenOffice.org is an office suite similar to Microsoft Office. It started life as Star Office. Sun Microsystems realised it was cheaper to buy out Star Office than to pay Microsoft for licence fees for MS Office. Sun then released the source code for Star Office under the name OpenOffice.org. OpenOffice.org is mostly compatible with MS Office file formats, which allows users to open .docs and .xls files in Open Office. Microsoft is working on a plug-in for MS Office that allows it to open .odf files. ODF (Open Document Format) is Open Office's default file format. Once this plug-in is complete there will 100% compatiblity between the two office suites. VLC is the VideoLAN Client. It was originally designed to allow you to watch video over the network.
    [Show full text]
  • Red Hat Enterprise Linux 6 Developer Guide
    Red Hat Enterprise Linux 6 Developer Guide An introduction to application development tools in Red Hat Enterprise Linux 6 Dave Brolley William Cohen Roland Grunberg Aldy Hernandez Karsten Hopp Jakub Jelinek Developer Guide Jeff Johnston Benjamin Kosnik Aleksander Kurtakov Chris Moller Phil Muldoon Andrew Overholt Charley Wang Kent Sebastian Red Hat Enterprise Linux 6 Developer Guide An introduction to application development tools in Red Hat Enterprise Linux 6 Edition 0 Author Dave Brolley [email protected] Author William Cohen [email protected] Author Roland Grunberg [email protected] Author Aldy Hernandez [email protected] Author Karsten Hopp [email protected] Author Jakub Jelinek [email protected] Author Jeff Johnston [email protected] Author Benjamin Kosnik [email protected] Author Aleksander Kurtakov [email protected] Author Chris Moller [email protected] Author Phil Muldoon [email protected] Author Andrew Overholt [email protected] Author Charley Wang [email protected] Author Kent Sebastian [email protected] Editor Don Domingo [email protected] Editor Jacquelynn East [email protected] Copyright © 2010 Red Hat, Inc. and others. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
    [Show full text]
  • Atmospheric Modelling and HPC
    Atmospheric Modelling and HPC Graziano Giuliani ICTP – ESP Trieste, 1 October 2015 NWP and Climate Codes ● Legacy code from the '60 : FORTRAN language ● Path and Dynamic Libraries ● Communication Libraries ● I/O format Libraries ● Data analysis tools and the data deluge http://clima-dods.ictp.it/Workshops/smr2761 Materials ● This presentation: – atmospheric_models_and_hpc.pdf ● Codes: – codes.tar.gz ● Download both, uncompress codes: – cp codes.tar.gz /scratch – cd /scratch – tar zxvf codes.tar.gz Legacy code ● Numerical Weather Prediction uses mathematical models of the atmosphere and oceans to predict the weather based on current weather conditions. ● MOST of the NWP and climate codes can push their roots back in the 1960-1970 ● The NWP problem was one of the target problem which led to the Computer Era: the ENIAC was used to create the first weather forecasts via computer in 1950. ● Code grows by ACCRETION FORTRAN and FortranXX ● Fortran Programming Language is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing. ● Originally developed by IBM in the 1950s for scientific and engineering applications ● Its standard is controlled by an ISO comitee: the most recent standard, ISO/IEC 1539-1:2010, informally known as Fortran 2008, was approved in September 2010. ● Needs a compiler to translate code into executable Fortran Compilers ● http://fortranwiki.org ● Most of the High Performance Compilers are Commercial, and “SuperComputer” vendors usually provide their HIGH OPTIMIZED version of Fortran Compiler. ● Some part of the Standard are left “COMPILER SPECIFIC”, opening for incompatibility among the binary formats produced by different compilers. The Fortran .mod files ● Fortran 90 introduced into the language the modules: module my_mod contains subroutine mysub(a,b) real , intent(in) :: a real , intent(out) :: b end subroutine mysub end module my_mod ● The compiler creates the object file and a .mod file compiling the above code.
    [Show full text]
  • Clangjit: Enhancing C++ with Just-In-Time Compilation
    ClangJIT: Enhancing C++ with Just-in-Time Compilation Hal Finkel David Poliakoff David F. Richards Lead, Compiler Technology and Lawrence Livermore National Lawrence Livermore National Programming Languages Laboratory Laboratory Leadership Computing Facility Livermore, CA, USA Livermore, CA, USA Argonne National Laboratory [email protected] [email protected] Lemont, IL, USA [email protected] ABSTRACT body of C++ code, but critically, defer the generation and optimiza- The C++ programming language is not only a keystone of the tion of template specializations until runtime using a relatively- high-performance-computing ecosystem but has proven to be a natural extension to the core C++ programming language. successful base for portable parallel-programming frameworks. As A significant design requirement for ClangJIT is that the runtime- is well known, C++ programmers use templates to specialize al- compilation process not explicitly access the file system - only gorithms, thus allowing the compiler to generate highly-efficient loading data from the running binary is permitted - which allows code for specific parameters, data structures, and so on. This capa- for deployment within environments where file-system access is bility has been limited to those specializations that can be identi- either unavailable or prohibitively expensive. In addition, this re- fied when the application is compiled, and in many critical cases, quirement maintains the redistributibility of the binaries using the compiling all potentially-relevant specializations is not practical. JIT-compilation features (i.e., they can run on systems where the ClangJIT provides a well-integrated C++ language extension allow- source code is unavailable). For example, on large HPC deploy- ing template-based specialization to occur during program execu- ments, especially on supercomputers with distributed file systems, tion.
    [Show full text]
  • CCPP Technical Documentation Release V3.0.0
    CCPP Technical Documentation Release v3.0.0 J. Schramm, L. Bernardet, L. Carson, G. Firl, D. Heinzeller, L. Pan, and M. Zhang Jun 17, 2019 For referencing this document please use: Schramm, J., L. Bernardet, L. Carson, G. Firl, D. Heinzeller, L. Pan, and M. Zhang, 2019. CCPP Technical Documentation Release v3.0.0. 91pp. Available at https://dtcenter.org/GMTB/v3.0/ccpp_tech_guide.pdf. CONTENTS 1 CCPP Overview 1 1.1 How to Use this Document........................................4 2 CCPP-Compliant Physics Parameterizations7 2.1 General Rules..............................................8 2.2 Input/output Variable (argument) Rules.................................9 2.3 Coding Rules............................................... 10 2.4 Parallel Programming Rules....................................... 11 2.5 Scientific Documentation Rules..................................... 12 2.5.1 Doxygen Comments and Commands.............................. 12 2.5.2 Doxygen Documentation Style................................. 13 2.5.3 Doxygen Configuration..................................... 18 2.5.4 Using Doxygen......................................... 20 3 CCPP Configuration and Build Options 23 4 Constructing Suites 27 4.1 Suite Definition File........................................... 27 4.1.1 Groups............................................. 27 4.1.2 Subcycling........................................... 27 4.1.3 Order of Schemes........................................ 28 4.2 Interstitial Schemes........................................... 28 4.3 SDF Examples.............................................
    [Show full text]
  • Challenges in Debugging Dynamically Compiled Languages As Exemplified by C# Debugger for Tizen
    Samsung R&D Institute Russia Center of System Software Challenges in debugging dynamically compiled languages as exemplified by C# debugger for Tizen Dmitri Botcharnikov 1 Agenda Dynamically compiled languages Tizen .NET Debugging Challenges Tizen .NET Debugger internals Future plans 2 Dynamically compiled languages Dynamically (Just-In-Time) compiled languages VM manages low-level details: memory allocation, exception handling But for debuggers… 3 Tizen .NET Visual Studio Tools for Tizen preview were released C# was added to Tizen Over 1,400,000 C# developers worldwide Tizen running on 50 millions Samsung devices (TV, wearables, mobile, IoT) http://developer.tizen.org 4 Technologies Tizen OS (emulator, platform-specific APIs) Xamarin.Forms .NET Core (CoreCLR, CoreFX, Roslyn) Visual Studio 2015 (Windows) 5 C# Compilation & Execution C# source MSIL Output CLR Roslyn JIT Language-specific compiler: C# => MSIL CLR JIT compiler: MSIL => native code 6 Debugging Challenges Source code to native code mapping ◦ C# compiler generates debugging information for source code to MSIL mapping Stepping in and over ◦ Stepping into not yet compiled code ◦ Managed exception handlers ◦ Lambdas, closures & iterators Local variables & arguments inspection ◦ C# compiler generates debugging information for MSIL variables 7 LLDB Subproject of LLVM (http://lldb.llvm.org) Native debugger builds on LLVM and Clang libraries Supports X86 and ARM architectures 8 SOS debugger plug-in Plug-in for LLDB (libsosplugin.so, libsos.so) Port of SOS.dll
    [Show full text]
  • Overview of LLVM Architecture of LLVM
    Overview of LLVM Architecture of LLVM Front-end: high-level programming language => LLVM IR Optimizer: optimize/analyze/secure the program in the IR form Back-end: LLVM IR => machine code Optimizer The optimizer’s job: analyze/optimize/secure programs. Optimizations are implemented as passes that traverse some portion of a program to either collect information or transform the program. A pass is an operation on a unit of IR code. Pass is an important concept in LLVM. LLVM IR - A low-level strongly-typed language-independent, SSA-based representation. - Tailored for static analyses and optimization purposes. Part 1 Part 1 has two kinds of passes: - Analysis pass (section 1): only analyze code statically - Transformation pass (section 2 & 3): insert code into the program Analysis pass (Section 1) Void foo (uint32_t int, uint32_t * p) { LLVM IR ... Clang opt } test.c test.bc stderr mypass.so Transformation pass (Section 2 & 3) mypass.so Void foo (uint32_t int, uint32_t * p) { ... LLVM IR opt LLVM IR } test.cpp Int main () { test.bc test-ins.bc ... Clang++ foo () ... LLVM IR } Clang++ main.cpp main.bc LLVM IR lib.cpp Executable lib.bc Section 1 Challenges: - How to traverse instructions in a function http://releases.llvm.org/3.9.1/docs/ProgrammersManual.html#iterating-over-the-instruction-in-a-function - How to print to stderr Section 2 & 3 Challenges: 1. How to traverse basic blocks in a function and instructions in a basic block 2. How to insert function calls to the runtime library a. Add the function signature to the symbol table of the module Section 2 & 3 Challenges: 1.
    [Show full text]
  • LLDB Tutorial: Adding Debugger Support for Your Target LLVM 2016 Tutorial
    LLDB Tutorial: Adding debugger support for your target LLVM 2016 tutorial Deepak Panickal Andrzej Warzyński Codeplay Soware @codeplayso March 18, 2016 Outline • LLDB architecture crash course I Overview of LLDB I User scenarios such as breakpoints, stack-walking etc. I Debugging ps • Both generic and specialized architectures are covered I MSP430 lldb debugging, which we have implemented for this tutorial I github.com/codeplaysoftware/lldb-msp430 I ARM architecture is also referred to for the generic cases • Focusing on debugging ELF executables on Linux EuroLLVM 2016 Outline 2 / 54 Overview Part 1: The Basics Part 2: ELF And Architecture Support Part 3: Registers Part 4: Memory and Breakpoints Part 5: Other Key Features Part 6: Debugging Tips Part 7: MSP430 Quick Recap EuroLLVM 2016 Outline 3 / 54 Part 1 The Basics EuroLLVM 2016 Part 1: The Basics 4 / 54 LLDB - Architecture lldb user driver TCP Socket GDB RSP . lldb-server debug API Architecture of LLDB LLDB offers mulple opons: I user drivers: command line, lldb-mi, Python I debug API: ptrace/simulator/runme/actual drivers EuroLLVM 2016 Part 1: The Basics 5 / 54 lldb/lldb-server lldb • Runs on host • Interacts with the user • Understands symbols, DWARF informaon, data formats, etc. • Plugin architecture I ProcessGDBRemote, DynamicLoaderPOSIXDYLD, ABISysV_msp430 are some... lldb-server • Runs on both remote and host, communicates to lldb via RSP over whichever medium is available • Interacts with the hardware/simulator • Deals with binary data and memory addresses • Plugin architecture I ObjectFileELF, ProcessLinux, are some... EuroLLVM 2016 Part 1: The Basics 6 / 54 GDB Remote Serial Protocol • Simple, ASCII message based protocol • Designed for debugging remote targets • Originally developed for gdb<->gdbserver communicaon • Extended for LLDB, see lldb-gdb-remote.txt Packet structure: checksum $.
    [Show full text]
  • Frogpond 37.1 • Winter 2014 (Pdf)
    F ROGPOND T HE JOURNAL OF THE HAIKU SOCIETY OF AMERICA V OLUME 37:1 W INTER 2014 About HSA & Frogpond Subscription / HSA Membership: For adults in the USA, $35; in Canada/Mexico, $37; for seniors and students in North America, $30; for everyone elsewhere, $47. Pay by check on a USA bank or by International Postal Money Order. All subscriptions/memberships are annual, expiring on December 31, and include three issues of Frogpond as well as three newsletters, the members’ anthology, and voting rights. All correspondence regarding new and renewed memberships, changes of address, and requests for information should be directed to the HSA secretary (see the list of RI¿FHUVS). Make checks and money orders payable to Haiku Society of America, Inc. Single Copies of Back Issues: For USA & Canada, $14; for elsewhere, $15 by surface and $20 by airmail. Older issues might cost more, depending on how many are OHIW3OHDVHLQTXLUH¿UVW0DNHFKHFNVSD\DEOHWR+DLNX6RFLHW\RI America, Inc. Send single copy and back issue orders to the Frogpond editor (see p. 3). Contributor Copyright and Acknowledgments: All prior copyrights are retained by contributors. Full rights revert to contributors upon publication in Frogpond. Neither the Haiku 6RFLHW\RI$PHULFDLWVRI¿FHUVQRUWKHHGLWRUDVVXPHUHVSRQVLELOLW\ IRUYLHZVRIFRQWULEXWRUV LQFOXGLQJLWVRZQRI¿FHUV ZKRVHZRUNLV printed in Frogpond, research errors, infringement of copyrights, or failure to make proper acknowledgments. Frogpond Listing and Copyright Information: ISSN 8755-156X Listed in the MLA International Bibliography, Humanities Interna- tional Complete, Poets and Writers. © 2014 by the Haiku Society of America, Inc. Francine Banwarth, Editor Michele Root-Bernstein, Associate Editor Cover Design and Photos: Christopher Patchel.
    [Show full text]
  • Software Process Versus Design Quality: Tug of War? > Architecture Haiku > Designing Resource-Aware Cloud Applications
    > Software Process versus Design Quality: Tug of War? > Architecture Haiku > Designing Resource-Aware Cloud Applications AUGUST 2015 www.computer.org IEEE COMPUTER SOCIETY http://computer.org • +1 714 821 8380 STAFF Editor Manager, Editorial Services Content Development Lee Garber Richard Park Senior Manager, Editorial Services Contributing Editors Robin Baldwin Christine Anthony, Brian Brannon, Carrie Clark Walsh, Brian Kirk, Chris Nelson, Meghan O’Dell, Dennis Taylor, Bonnie Wylie Director, Products and Services Evan Butterfield Production & Design Carmen Flores-Garvey, Monette Velasco, Jennie Zhu-Mai, Senior Advertising Coordinator Mark Bartosik Debbie Sims Circulation: ComputingEdge is published monthly by the IEEE Computer Society. IEEE Headquarters, Three Park Avenue, 17th Floor, New York, NY 10016-5997; IEEE Computer Society Publications Office, 10662 Los Vaqueros Circle, Los Alamitos, CA 90720; voice +1 714 821 8380; fax +1 714 821 4010; IEEE Computer Society Headquarters, 2001 L Street NW, Suite 700, Washington, DC 20036. Postmaster: Send undelivered copies and address changes to IEEE Membership Processing Dept., 445 Hoes Lane, Piscataway, NJ 08855. Application to Mail at Periodicals Postage Prices is pending at New York, New York, and at additional mailing offices. Canadian GST #125634188. Canada Post Corporation (Canadian distribution) publications mail agreement number 40013885. Return undeliverable Canadian addresses to PO Box 122, Niagara Falls, ON L2E 6S8 Canada. Printed in USA. Editorial: Unless otherwise stated, bylined articles, as well as product and service descriptions, reflect the author’s or firm’s opinion. Inclusion in ComputingEdge does not necessarily constitute endorsement by the IEEE or the Computer Society. All submissions are subject to editing for style, clarity, and space.
    [Show full text]
  • Nateguyver Breakpoints LLDB Debug Toolchain More
    ��������������������������� ��������������������������� �������� ����������������������������������������������������������������������������������� ���������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������� ������������������������������� ��������������������������������������������������������������������������������������� ����������������������������������������������������������������������� �������������������������������������������������������������������������������������� �������������������������������������������� ◼ Breakpoints & watchpoints ◼ Xcode's graphical debugger ◼ LLDB �������������� “ ������������������������������������������������������������������������������������ ��������������������������� ”������������������ ���������������������������� ◼ Assertions, Logging, and Debug configuration ◼ Static analysis & runtime memory tools ◼ Unit testing in xcode ���������������� ◼ Emphasis on LLDB as our debugging foundation ◼ Tips and tricks to stramline your the debuggin experience ◼ Use LLDB as an extensible investigative tool “�������������”������������ “��’���������������������������������������������������’���������������������’�������������� ��������’����������������������������������� ”������������������ ��������������������������������������������������� ���������������������������������������������������������������������������������� ����������������������������������������������������������������������������
    [Show full text]
  • Compiling a Higher-Order Smart Contract Language to LLVM
    Compiling a Higher-Order Smart Contract Language to LLVM Vaivaswatha Nagaraj Jacob Johannsen Anton Trunov Zilliqa Research Zilliqa Research Zilliqa Research [email protected] [email protected] [email protected] George Pîrlea Amrit Kumar Ilya Sergey Zilliqa Research Zilliqa Research Yale-NUS College [email protected] [email protected] National University of Singapore [email protected] Abstract +----------------------+ Scilla is a higher-order polymorphic typed intermediate | Blockchain Smart | | Contract Module | level language for implementing smart contracts. In this talk, | in C++ (BC) | +----------------------+ we describe a Scilla compiler targeting LLVM, with a focus + state variable | + ^ on mapping Scilla types, values, and its functional language foo.scilla | | | & message | fetch| | constructs to LLVM-IR. | | |update v v | The compiled LLVM-IR, when executed with LLVM’s JIT +--------------------------------------+---------------------------------+ framework, achieves a speedup of about 10x over the refer- | | | +-------------+ +----------------+ | ence interpreter on a typical Scilla contract. This reduced | +-----------------> |JIT Driver | +--> | Scilla Run-time| | | | |in C++ (JITD)| | Library in C++ | | latency is crucial in the setting of blockchains, where smart | | +-+-------+---+ | (SRTL) | | | | | ^ +----------------+ | contracts are executed as parts of transactions, to achieve | | | | | | | foo.scilla| | | peak transactions processed per second. Experiments on the | | | foo.ll| | | | | | | Ackermann
    [Show full text]