view revisions.pl.in @ 920:545f54041d91

Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :) Fixed align N; in asm blocks. Fixed inreg parameter passing on x86 for ref/out params. Removed support for lazy initialization of function local static variables, I have no idea why I ever implemented this, it's not in the D spec, and DMD doesn't support it :P Some of the global variable related changes might cause minor regressions, but they should be easily fixable.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 03 Feb 2009 08:54:57 +0100
parents a331ce9bc749
children d66ab756c75b
line wrap: on
line source

#!/usr/bin/perl

use strict;
use warnings;
use File::stat;
use Time::localtime;

my $llvm_src = `perl @LLVM_CONFIG@ --src-root`;

my $llvm_rev = `svnversion $llvm_src`;

if ($llvm_rev =~ s/(\d+)\s+$/$1/) {
	$llvm_rev = qq!#define LLVM_REV "LLVM rev.$llvm_rev"!
} else {
	my $llvm_lib = `perl @LLVM_CONFIG@ --libdir`;
	$llvm_lib =~ s/\s+$//;
	$llvm_rev = ctime(stat($llvm_lib)->mtime) if (-d $llvm_lib);
	$llvm_rev = qq!#include "llvm/Config/config.h"\n#define LLVM_REV PACKAGE_STRING" ($llvm_rev)"!;
}

my $ldc_rev = `hg -R@PROJECT_SOURCE_DIR@ tip --template {rev}`;

my $out = qq!#ifndef LDC_VERSIONS_H
#define LDC_VERSIONS_H

$llvm_rev
#define LDC_REV "rev.$ldc_rev"

#endif // LDC_VERSIONS_H\n!;

my $revh;
my $old = "";
open $revh, "revisions.h" and $old = join "", <$revh>;

if ($old ne $out) {
	open $revh, ">revisions.h" or die "cannot create revisions.h: $!";
	print $revh $out;
	close $revh;
}