Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #662

Re: A small LLVM tutorial: debugging information

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end
From Vincent Belliard <vincent@famillebelliard.fr>
Newsgroups comp.compilers
Subject Re: A small LLVM tutorial: debugging information
Date Thu, 31 May 2012 00:10:16 -0700 (PDT)
Organization Compilers Central
Lines 40
Sender news@iecc.com
Approved comp.compilers@iecc.com
Message-ID <12-06-001@comp.compilers> (permalink)
References <12-05-029@comp.compilers>
NNTP-Posting-Host news.iecc.com
X-Trace leila.iecc.com 1338528389 97027 64.57.183.58 (1 Jun 2012 05:26:29 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Fri, 1 Jun 2012 05:26:29 +0000 (UTC)
Keywords LLVM
Posted-Date 01 Jun 2012 01:26:29 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:662

Show key headers only | View raw


Yes, of course, using the LLVM builder is much easier (or, at least,
quicker to start). In my case, I needed to do all with my language
Entity so I couldn't use the builders. I did my own which are simpler
than the LLVM ones as they cover only what I needed.

This small tutorial is still useful if you use the builders. May some
topics won't be necessary but it's always good to understand deeply
what you are using.

Nevertheless, in the next version, I will add your comment.

vincent


PS: I made a very small language close to C but close to LLVM. It's very
useful to write small libraries functions with a deep control over the
generated code without writting directly in LLVM.
Here is an example of a string compare with my zero padded strings:

i1 @equals_string_contents(%_self: %string_content*, %_cmp: %string_content*)
{
var size_ref: i64 = %_self->size ;
var size_cmp: i64 = %_cmp->size ;
if (size_ref ne size_cmp) return 0 ;
var count: i64 = size_ref >> 3 ;
var ref: i64* = <i64*>%_self->data ;
var cmp: i64* = <i64*>%_cmp->data ;
loop
	{
	phi phi_count: i64 = count | next_count ;
	phi phi_ref: i64* = ref | next_ref ;
	phi phi_cmp: i64* = cmp | next_cmp ;
	if (phi_count eq 0) return 1 ;
	if (*phi_ref ne *phi_cmp) return 0 ;
	var next_count: i64 = phi_count - 1 ;
	var next_ref: i64* = phi_ref + 1 ;
	var next_cmp: i64* = phi_cmp + 1 ;
	}
}

Back to comp.compilers | Previous | NextPrevious in thread | Find similar


Thread

A small LLVM tutorial: debugging information vincent_belliard <vincent@famillebelliard.fr> - 2012-05-25 10:06 -0700
  Re: A small LLVM tutorial: debugging information Eric Christopher <echristo@gmail.com> - 2012-05-29 17:59 -0700
    Re: A small LLVM tutorial: debugging information Vincent Belliard <vincent@famillebelliard.fr> - 2012-05-31 00:10 -0700

csiph-web