From: Julian Seward Date: Thu, 14 Oct 2004 10:42:15 +0000 (+0000) Subject: A bit more inlining of small fns. X-Git-Tag: svn/VALGRIND_3_0_1^2~994 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dd10d89d4706eeea9479e35b4140c4e9900ec83d;p=thirdparty%2Fvalgrind.git A bit more inlining of small fns. git-svn-id: svn://svn.valgrind.org/vex/trunk@340 --- diff --git a/VEX/priv/host-generic/h_generic_regs.c b/VEX/priv/host-generic/h_generic_regs.c index ee103504de..abbdfa4a5d 100644 --- a/VEX/priv/host-generic/h_generic_regs.c +++ b/VEX/priv/host-generic/h_generic_regs.c @@ -13,16 +13,6 @@ #include "host-generic/h_generic_regs.h" -HReg mkHReg ( UInt regno, HRegClass rc, Bool virtual ) -{ - UInt r24 = regno & 0x00FFFFFF; - /* This is critical. The register number field may only - occupy 24 bits. */ - if (r24 != regno) - vpanic("mkHReg: regno exceeds 2^24"); - return regno | (((UInt)rc) << 28) | (virtual ? (1<<24) : 0); -} - void ppHRegClass ( HRegClass hrc ) { switch (hrc) { @@ -75,12 +65,6 @@ void ppHRegUsage ( HRegUsage* tab ) } -void initHRegUsage ( HRegUsage* tab ) -{ - tab->n_used = 0; -} - - /* Add a register to a usage table. Combine incoming read uses with existing write uses into a modify use, and vice versa. Do not create duplicate entries -- each reg should only be mentioned once. diff --git a/VEX/priv/host-generic/h_generic_regs.h b/VEX/priv/host-generic/h_generic_regs.h index a3e446f0f3..b6d7151a81 100644 --- a/VEX/priv/host-generic/h_generic_regs.h +++ b/VEX/priv/host-generic/h_generic_regs.h @@ -63,7 +63,14 @@ extern void ppHRegClass ( HRegClass ); extern void ppHReg ( HReg ); /* Construct/destruct. */ -extern HReg mkHReg ( UInt regno, HRegClass rc, Bool virtual ); +static inline HReg mkHReg ( UInt regno, HRegClass rc, Bool virtual ) { + UInt r24 = regno & 0x00FFFFFF; + /* This is critical. The register number field may only + occupy 24 bits. */ + if (r24 != regno) + vpanic("mkHReg: regno exceeds 2^24"); + return regno | (((UInt)rc) << 28) | (virtual ? (1<<24) : 0); +} static inline HRegClass hregClass ( HReg r ) { UInt rc = r; @@ -111,7 +118,9 @@ typedef extern void ppHRegUsage ( HRegUsage* ); -extern void initHRegUsage ( HRegUsage* ); +static inline void initHRegUsage ( HRegUsage* tab ) { + tab->n_used = 0; +} /* Add a register to a usage table. Combine incoming read uses with existing write uses into a modify use, and vice versa. Do not