From evan.cheng at apple.com Mon Sep 1 02:00:14 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 01 Sep 2008 07:00:14 -0000 Subject: [llvm-commits] [llvm] r55596 - in /llvm/trunk/lib/Target/ARM: ARMInstrFormats.td ARMInstrInfo.td Message-ID: <200809010700.m8170EF1008599@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 1 02:00:14 2008 New Revision: 55596 URL: http://llvm.org/viewvc/llvm-project?rev=55596&view=rev Log: addrmode3 instruction encodings. Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=55596&r1=55595&r2=55596&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Sep 1 02:00:14 2008 @@ -155,7 +155,7 @@ class AI2ldw opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : AI2 { - let Inst{20} = 1; // load bit + let Inst{20} = 1; // L bit let Inst{21} = 0; // W bit let Inst{22} = 0; // B bit let Inst{24} = 1; // P bit @@ -163,7 +163,7 @@ class AI2ldb opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : AI2 { - let Inst{20} = 1; // load bit + let Inst{20} = 1; // L bit let Inst{21} = 0; // W bit let Inst{22} = 1; // B bit let Inst{24} = 1; // P bit @@ -173,7 +173,7 @@ class AI2stw opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : AI2 { - let Inst{20} = 0; // load bit + let Inst{20} = 0; // L bit let Inst{21} = 0; // W bit let Inst{22} = 0; // B bit let Inst{24} = 1; // P bit @@ -181,19 +181,18 @@ class AI2stb opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : AI2 { - let Inst{20} = 0; // load bit + let Inst{20} = 0; // L bit let Inst{21} = 0; // W bit let Inst{22} = 1; // B bit let Inst{24} = 1; // P bit } -// Pre-indexed ops -// loads +// Pre-indexed loads class AI2ldwpr opcod, dag oops, dag iops, Format f, string opc, string asm, string cstr, list pattern> : I { - let Inst{20} = 1; // load bit + let Inst{20} = 1; // L bit let Inst{21} = 1; // W bit let Inst{22} = 0; // B bit let Inst{24} = 1; // P bit @@ -202,18 +201,18 @@ string asm, string cstr, list pattern> : I { - let Inst{20} = 1; // load bit + let Inst{20} = 1; // L bit let Inst{21} = 1; // W bit let Inst{22} = 1; // B bit let Inst{24} = 1; // P bit } -// stores +// Pre-indexed stores class AI2stwpr opcod, dag oops, dag iops, Format f, string opc, string asm, string cstr, list pattern> : I { - let Inst{20} = 0; // load bit + let Inst{20} = 0; // L bit let Inst{21} = 1; // W bit let Inst{22} = 0; // B bit let Inst{24} = 1; // P bit @@ -222,19 +221,18 @@ string asm, string cstr, list pattern> : I { - let Inst{20} = 0; // load bit + let Inst{20} = 0; // L bit let Inst{21} = 1; // W bit let Inst{22} = 1; // B bit let Inst{24} = 1; // P bit } -// Post-indexed ops -// loads +// Post-indexed loads class AI2ldwpo opcod, dag oops, dag iops, Format f, string opc, string asm, string cstr, list pattern> : I { - let Inst{20} = 1; // load bit + let Inst{20} = 1; // L bit let Inst{21} = 0; // W bit let Inst{22} = 0; // B bit let Inst{24} = 0; // P bit @@ -243,18 +241,18 @@ string asm, string cstr, list pattern> : I { - let Inst{20} = 1; // load bit + let Inst{20} = 1; // L bit let Inst{21} = 0; // W bit let Inst{22} = 1; // B bit let Inst{24} = 0; // P bit } -// stores +// Post-indexed stores class AI2stwpo opcod, dag oops, dag iops, Format f, string opc, string asm, string cstr, list pattern> : I { - let Inst{20} = 0; // load bit + let Inst{20} = 0; // L bit let Inst{21} = 0; // W bit let Inst{22} = 0; // B bit let Inst{24} = 0; // P bit @@ -263,7 +261,7 @@ string asm, string cstr, list pattern> : I { - let Inst{20} = 0; // load bit + let Inst{20} = 0; // L bit let Inst{21} = 0; // W bit let Inst{22} = 1; // B bit let Inst{24} = 0; // P bit @@ -275,25 +273,193 @@ : I; -// addrmode4 instructions -class AI4 opcod, dag oops, dag iops, Format f, string opc, +// loads +class AI3ldh opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> - : I; + : I { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} +class AI3ldsh opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} +class AI3ldsb opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 0; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} +class AI3ldd opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 0; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} +// stores +class AI3sth opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} +class AI3std opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} + +// Pre-indexed loads +class AI3ldhpr opcod, dag oops, dag iops, Format f, string opc, + string asm, string cstr, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 1; // W bit + let Inst{24} = 1; // P bit +} +class AI3ldshpr opcod, dag oops, dag iops, Format f, string opc, + string asm, string cstr, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 1; // W bit + let Inst{24} = 1; // P bit +} +class AI3ldsbpr opcod, dag oops, dag iops, Format f, string opc, + string asm, string cstr, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 0; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 1; // W bit + let Inst{24} = 1; // P bit +} -// Pre-indexed ops -class AI3pr opcod, dag oops, dag iops, Format f, string opc, +// Pre-indexed stores +class AI3sthpr opcod, dag oops, dag iops, Format f, string opc, string asm, string cstr, list pattern> : I; + asm, cstr, pattern> { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 0; // L bit + let Inst{21} = 1; // W bit + let Inst{24} = 1; // P bit +} +// Post-indexed loads +class AI3ldhpo opcod, dag oops, dag iops, Format f, string opc, + string asm, string cstr, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 1; // W bit + let Inst{24} = 0; // P bit +} +class AI3ldshpo opcod, dag oops, dag iops, Format f, string opc, + string asm, string cstr, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 1; // W bit + let Inst{24} = 0; // P bit +} +class AI3ldsbpo opcod, dag oops, dag iops, Format f, string opc, + string asm, string cstr, list pattern> + : I { + let Inst{4} = 1; + let Inst{5} = 0; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 1; // W bit + let Inst{24} = 0; // P bit +} -// Post-indexed ops -class AI3po opcod, dag oops, dag iops, Format f, string opc, +// Post-indexed stores +class AI3sthpo opcod, dag oops, dag iops, Format f, string opc, string asm, string cstr, list pattern> : I; + asm, cstr,pattern> { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 0; // L bit + let Inst{21} = 1; // W bit + let Inst{24} = 0; // P bit +} + + +// addrmode4 instructions +class AI4 opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I; + // Special cases. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=55596&r1=55595&r2=55596&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Sep 1 02:00:14 2008 @@ -597,7 +597,7 @@ "ldr", " $dst, $addr", []>; // Loads with zero extension -def LDRH : AI3<0xB, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, +def LDRH : AI3ldh<0xB, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, "ldr", "h $dst, $addr", [(set GPR:$dst, (zextloadi16 addrmode3:$addr))]>; @@ -606,17 +606,17 @@ [(set GPR:$dst, (zextloadi8 addrmode2:$addr))]>; // Loads with sign extension -def LDRSH : AI3<0xE, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, +def LDRSH : AI3ldsh<0xE, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, "ldr", "sh $dst, $addr", [(set GPR:$dst, (sextloadi16 addrmode3:$addr))]>; -def LDRSB : AI3<0xD, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, +def LDRSB : AI3ldsb<0xD, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, "ldr", "sb $dst, $addr", [(set GPR:$dst, (sextloadi8 addrmode3:$addr))]>; let mayLoad = 1 in { // Load doubleword -def LDRD : AI3<0xD, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, +def LDRD : AI3ldd<0xD, (outs GPR:$dst), (ins addrmode3:$addr), LdFrm, "ldr", "d $dst, $addr", []>, Requires<[IsARM, HasV5T]>; @@ -629,11 +629,11 @@ (ins GPR:$base, am2offset:$offset), LdFrm, "ldr", " $dst, [$base], $offset", "$base = $base_wb", []>; -def LDRH_PRE : AI3pr<0xB, (outs GPR:$dst, GPR:$base_wb), +def LDRH_PRE : AI3ldhpr<0xB, (outs GPR:$dst, GPR:$base_wb), (ins addrmode3:$addr), LdFrm, "ldr", "h $dst, $addr!", "$addr.base = $base_wb", []>; -def LDRH_POST : AI3po<0xB, (outs GPR:$dst, GPR:$base_wb), +def LDRH_POST : AI3ldhpo<0xB, (outs GPR:$dst, GPR:$base_wb), (ins GPR:$base,am3offset:$offset), LdFrm, "ldr", "h $dst, [$base], $offset", "$base = $base_wb", []>; @@ -645,19 +645,19 @@ (ins GPR:$base,am2offset:$offset), LdFrm, "ldr", "b $dst, [$base], $offset", "$base = $base_wb", []>; -def LDRSH_PRE : AI3pr<0xE, (outs GPR:$dst, GPR:$base_wb), +def LDRSH_PRE : AI3ldshpr<0xE, (outs GPR:$dst, GPR:$base_wb), (ins addrmode3:$addr), LdFrm, "ldr", "sh $dst, $addr!", "$addr.base = $base_wb", []>; -def LDRSH_POST: AI3po<0xE, (outs GPR:$dst, GPR:$base_wb), +def LDRSH_POST: AI3ldshpo<0xE, (outs GPR:$dst, GPR:$base_wb), (ins GPR:$base,am3offset:$offset), LdFrm, "ldr", "sh $dst, [$base], $offset", "$base = $base_wb", []>; -def LDRSB_PRE : AI3pr<0xD, (outs GPR:$dst, GPR:$base_wb), +def LDRSB_PRE : AI3ldsbpr<0xD, (outs GPR:$dst, GPR:$base_wb), (ins addrmode3:$addr), LdFrm, "ldr", "sb $dst, $addr!", "$addr.base = $base_wb", []>; -def LDRSB_POST: AI3po<0xD, (outs GPR:$dst, GPR:$base_wb), +def LDRSB_POST: AI3ldsbpo<0xD, (outs GPR:$dst, GPR:$base_wb), (ins GPR:$base,am3offset:$offset), LdFrm, "ldr", "sb $dst, [$base], $offset", "$base = $base_wb", []>; } @@ -668,7 +668,7 @@ [(store GPR:$src, addrmode2:$addr)]>; // Stores with truncate -def STRH : AI3<0xB, (outs), (ins GPR:$src, addrmode3:$addr), StFrm, +def STRH : AI3sth<0xB, (outs), (ins GPR:$src, addrmode3:$addr), StFrm, "str", "h $src, $addr", [(truncstorei16 GPR:$src, addrmode3:$addr)]>; @@ -678,7 +678,7 @@ // Store doubleword let mayStore = 1 in -def STRD : AI3<0xF, (outs), (ins GPR:$src, addrmode3:$addr), StFrm, +def STRD : AI3std<0xF, (outs), (ins GPR:$src, addrmode3:$addr), StFrm, "str", "d $src, $addr", []>, Requires<[IsARM, HasV5T]>; @@ -695,13 +695,13 @@ [(set GPR:$base_wb, (post_store GPR:$src, GPR:$base, am2offset:$offset))]>; -def STRH_PRE : AI3pr<0xB, (outs GPR:$base_wb), +def STRH_PRE : AI3sthpr<0xB, (outs GPR:$base_wb), (ins GPR:$src, GPR:$base,am3offset:$offset), StFrm, "str", "h $src, [$base, $offset]!", "$base = $base_wb", [(set GPR:$base_wb, (pre_truncsti16 GPR:$src, GPR:$base,am3offset:$offset))]>; -def STRH_POST: AI3po<0xB, (outs GPR:$base_wb), +def STRH_POST: AI3sthpo<0xB, (outs GPR:$base_wb), (ins GPR:$src, GPR:$base,am3offset:$offset), StFrm, "str", "h $src, [$base], $offset", "$base = $base_wb", [(set GPR:$base_wb, (post_truncsti16 GPR:$src, From evan.cheng at apple.com Mon Sep 1 02:19:00 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 01 Sep 2008 07:19:00 -0000 Subject: [llvm-commits] [llvm] r55597 - /llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Message-ID: <200809010719.m817J07J009256@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 1 02:19:00 2008 New Revision: 55597 URL: http://llvm.org/viewvc/llvm-project?rev=55597&view=rev Log: Reorganize instruction formats again; AXI1 encoding. Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=55597&r1=55596&r2=55597&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Sep 1 02:19:00 2008 @@ -112,6 +112,17 @@ list Predicates = [IsARM]; } +// Special cases +class XI opcod, dag oops, dag iops, AddrMode am, SizeFlagVal sz, + IndexMode im, Format f, string asm, string cstr, list pattern> + : InstARM { + let OutOperandList = oops; + let InOperandList = iops; + let AsmString = asm; + let Pattern = pattern; + list Predicates = [IsARM]; +} + class AI opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I pattern> : sI; +class AXI opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI; +class AXIx2 opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI; // addrmode1 instructions class AI1 opcod, dag oops, dag iops, Format f, string opc, @@ -137,6 +156,14 @@ let Inst{21-24} = opcod; let Inst{26-27} = 0; } +class AXI1 opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 1; + let Inst{21-24} = opcod; + let Inst{26-27} = 0; +} class AI1x2 opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I { let Inst{26-27} = 1; } +class AXI2 opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI; // loads class AI2ldw opcod, dag oops, dag iops, Format f, string opc, @@ -272,6 +303,10 @@ string asm, list pattern> : I; +class AXI3 opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI; // loads class AI3ldh opcod, dag oops, dag iops, Format f, string opc, @@ -459,45 +494,11 @@ string asm, list pattern> : I; - - - -// Special cases. -class XI opcod, dag oops, dag iops, AddrMode am, SizeFlagVal sz, - IndexMode im, Format f, string asm, string cstr, list pattern> - : InstARM { - let OutOperandList = oops; - let InOperandList = iops; - let AsmString = asm; - let Pattern = pattern; - list Predicates = [IsARM]; -} - -class AXI opcod, dag oops, dag iops, Format f, string asm, - list pattern> - : XI; -class AXI1 opcod, dag oops, dag iops, Format f, string asm, - list pattern> - : XI; -class AXI2 opcod, dag oops, dag iops, Format f, string asm, - list pattern> - : XI; -class AXI3 opcod, dag oops, dag iops, Format f, string asm, - list pattern> - : XI; class AXI4 opcod, dag oops, dag iops, Format f, string asm, list pattern> : XI; -class AXIx2 opcod, dag oops, dag iops, Format f, string asm, - list pattern> - : XI; // BR_JT instructions class JTI opcod, dag oops, dag iops, string asm, list pattern> From evan.cheng at apple.com Mon Sep 1 02:34:13 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 01 Sep 2008 07:34:13 -0000 Subject: [llvm-commits] [llvm] r55598 - in /llvm/trunk/lib/Target/ARM: ARMInstrFormats.td ARMInstrInfo.td Message-ID: <200809010734.m817YDso010058@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 1 02:34:13 2008 New Revision: 55598 URL: http://llvm.org/viewvc/llvm-project?rev=55598&view=rev Log: AXI2 and AXI3 instruction encodings. Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=55598&r1=55597&r2=55598&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Sep 1 02:34:13 2008 @@ -191,6 +191,15 @@ let Inst{22} = 0; // B bit let Inst{24} = 1; // P bit } +class AXI2ldw opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{22} = 0; // B bit + let Inst{24} = 1; // P bit +} class AI2ldb opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : AI2 { @@ -199,6 +208,15 @@ let Inst{22} = 1; // B bit let Inst{24} = 1; // P bit } +class AXI2ldb opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{22} = 1; // B bit + let Inst{24} = 1; // P bit +} // stores class AI2stw opcod, dag oops, dag iops, Format f, string opc, @@ -209,6 +227,15 @@ let Inst{22} = 0; // B bit let Inst{24} = 1; // P bit } +class AXI2stw opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{22} = 0; // B bit + let Inst{24} = 1; // P bit +} class AI2stb opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : AI2 { @@ -217,6 +244,15 @@ let Inst{22} = 1; // B bit let Inst{24} = 1; // P bit } +class AXI2stb opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{22} = 1; // B bit + let Inst{24} = 1; // P bit +} // Pre-indexed loads class AI2ldwpr opcod, dag oops, dag iops, Format f, string opc, @@ -321,6 +357,18 @@ let Inst{21} = 0; // W bit let Inst{24} = 1; // P bit } +class AXI3ldh opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} class AI3ldsh opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} class AI3ldsb opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4} = 1; + let Inst{5} = 0; // H bit + let Inst{6} = 1; // S bit + let Inst{7} = 1; + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} class AI3ldd opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4} = 1; + let Inst{5} = 1; // H bit + let Inst{6} = 0; // S bit + let Inst{7} = 1; + let Inst{20} = 0; // L bit + let Inst{21} = 0; // W bit + let Inst{24} = 1; // P bit +} class AI3std opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I; -def PICLDZH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDZH : AXI3ldh<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}h $dst, $addr", [(set GPR:$dst, (zextloadi16 addrmodepc:$addr))]>; -def PICLDZB : AXI2<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDZB : AXI2ldb<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}b $dst, $addr", [(set GPR:$dst, (zextloadi8 addrmodepc:$addr))]>; -def PICLDH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDH : AXI3ldh<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}h $dst, $addr", [(set GPR:$dst, (extloadi16 addrmodepc:$addr))]>; -def PICLDB : AXI2<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDB : AXI2ldb<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}b $dst, $addr", [(set GPR:$dst, (extloadi8 addrmodepc:$addr))]>; -def PICLDSH : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDSH : AXI3ldsh<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}sh $dst, $addr", [(set GPR:$dst, (sextloadi16 addrmodepc:$addr))]>; -def PICLDSB : AXI3<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), +def PICLDSB : AXI3ldsb<0x0, (outs GPR:$dst), (ins addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tldr${p}sb $dst, $addr", [(set GPR:$dst, (sextloadi8 addrmodepc:$addr))]>; } let AddedComplexity = 10 in { -def PICSTR : AXI2<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), +def PICSTR : AXI2stw<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tstr$p $src, $addr", [(store GPR:$src, addrmodepc:$addr)]>; -def PICSTRH : AXI3<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), +def PICSTRH : AXI3sth<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tstr${p}h $src, $addr", [(truncstorei16 GPR:$src, addrmodepc:$addr)]>; -def PICSTRB : AXI2<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), +def PICSTRB : AXI2stb<0x0, (outs), (ins GPR:$src, addrmodepc:$addr, pred:$p), Pseudo, "${addr:label}:\n\tstr${p}b $src, $addr", [(truncstorei8 GPR:$src, addrmodepc:$addr)]>; } From evan.cheng at apple.com Mon Sep 1 02:48:18 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 01 Sep 2008 07:48:18 -0000 Subject: [llvm-commits] [llvm] r55599 - in /llvm/trunk/lib/Target/ARM: ARMInstrFormats.td ARMInstrInfo.td Message-ID: <200809010748.m817mIXn015224@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 1 02:48:18 2008 New Revision: 55599 URL: http://llvm.org/viewvc/llvm-project?rev=55599&view=rev Log: ldm / stm instruction encodings. Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=55599&r1=55598&r2=55599&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Sep 1 02:48:18 2008 @@ -577,11 +577,33 @@ class AI4 opcod, dag oops, dag iops, Format f, string opc, string asm, list pattern> : I; -class AXI4 opcod, dag oops, dag iops, Format f, string asm, + asm, "", pattern> { + let Inst{25-27} = 0x4; +} +class AXI4ld opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 1; // L bit + let Inst{22} = 0; // S bit + let Inst{25-27} = 0x4; +} +class AXI4ldpc opcod, dag oops, dag iops, Format f, string asm, list pattern> : XI; + "", pattern> { + let Inst{20} = 1; // L bit + let Inst{22} = 1; // S bit + let Inst{25-27} = 0x4; +} +class AXI4st opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{20} = 0; // L bit + let Inst{22} = 0; // S bit + let Inst{25-27} = 0x4; +} // BR_JT instructions Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=55599&r1=55598&r2=55599&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Sep 1 02:48:18 2008 @@ -523,7 +523,7 @@ // FIXME: $dst1 should be a def. But the extra ops must be in the end of the // operand list. let isReturn = 1, isTerminator = 1 in - def LDM_RET : AXI4<0x0, (outs), + def LDM_RET : AXI4ldpc<0x0, (outs), (ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops), LdFrm, "ldm${p}${addr:submode} $addr, $dst1", []>; @@ -725,13 +725,13 @@ // FIXME: $dst1 should be a def. let mayLoad = 1 in -def LDM : AXI4<0x0, (outs), +def LDM : AXI4ld<0x0, (outs), (ins addrmode4:$addr, pred:$p, reglist:$dst1, variable_ops), LdFrm, "ldm${p}${addr:submode} $addr, $dst1", []>; let mayStore = 1 in -def STM : AXI4<0x0, (outs), +def STM : AXI4st<0x0, (outs), (ins addrmode4:$addr, pred:$p, reglist:$src1, variable_ops), StFrm, "stm${p}${addr:submode} $addr, $src1", []>; From evan.cheng at apple.com Mon Sep 1 03:25:57 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 01 Sep 2008 08:25:57 -0000 Subject: [llvm-commits] [llvm] r55601 - in /llvm/trunk/lib/Target/ARM: ARMInstrFormats.td ARMInstrInfo.td Message-ID: <200809010825.m818PvQw025582@zion.cs.uiuc.edu> Author: evancheng Date: Mon Sep 1 03:25:56 2008 New Revision: 55601 URL: http://llvm.org/viewvc/llvm-project?rev=55601&view=rev Log: Control flow instruction encodings. Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=55601&r1=55600&r2=55601&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Sep 1 03:25:56 2008 @@ -135,10 +135,76 @@ list pattern> : XI; + +// Ctrl flow instructions +class ABLpredI opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I { + let Inst{24} = 1; // L bit + let Inst{25-27} = 5; +} +class ABLI opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{24} = 1; // L bit + let Inst{25-27} = 5; +} +class ABLXI opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{4-7} = 3; + let Inst{20-27} = 0x12; +} +// FIXME: BX class AXIx2 opcod, dag oops, dag iops, Format f, string asm, list pattern> : XI; +class ABI opcod, dag oops, dag iops, Format f, string asm, + list pattern> + : XI { + let Inst{24} = 0; // L bit + let Inst{25-27} = 5; +} +class ABccI opcod, dag oops, dag iops, Format f, string opc, + string asm, list pattern> + : I { + let Inst{24} = 0; // L bit + let Inst{25-27} = 5; +} + +// BR_JT instructions +// == mov pc +class JTI opcod, dag oops, dag iops, string asm, list pattern> + : XI { + let Inst{20} = 0; // S Bit + let Inst{21-24} = 0xd; + let Inst{26-27} = 0; +} +// == ldr pc +class JTI1 opcod, dag oops, dag iops, string asm, list pattern> + : XI { + let Inst{20} = 1; // L bit + let Inst{21} = 0; // W bit + let Inst{22} = 0; // B bit + let Inst{24} = 1; // P bit +} +// == add pc +class JTI2 opcod, dag oops, dag iops, string asm, list pattern> + : XI { + let Inst{20} = 0; // S bit + let Inst{21-24} = 4; + let Inst{26-27} = 0; +} + // addrmode1 instructions class AI1 opcod, dag oops, dag iops, Format f, string opc, @@ -606,18 +672,6 @@ } -// BR_JT instructions -class JTI opcod, dag oops, dag iops, string asm, list pattern> - : XI; -class JTI1 opcod, dag oops, dag iops, string asm, list pattern> - : XI; -class JTI2 opcod, dag oops, dag iops, string asm, list pattern> - : XI; - - //===----------------------------------------------------------------------===// // ARMPat - Same as Pat<>, but requires that the compiler be in ARM mode. Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=55601&r1=55600&r2=55601&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Sep 1 03:25:56 2008 @@ -531,16 +531,16 @@ let isCall = 1, Defs = [R0, R1, R2, R3, R12, LR, D0, D1, D2, D3, D4, D5, D6, D7, CPSR] in { - def BL : AXI<0xB, (outs), (ins i32imm:$func, variable_ops), Branch, + def BL : ABLI<0xB, (outs), (ins i32imm:$func, variable_ops), Branch, "bl ${func:call}", [(ARMcall tglobaladdr:$func)]>; - def BL_pred : AI<0xB, (outs), (ins i32imm:$func, variable_ops), - Branch, "bl", " ${func:call}", + def BL_pred : ABLpredI<0xB, (outs), (ins i32imm:$func, variable_ops), Branch, + "bl", " ${func:call}", [(ARMcall_pred tglobaladdr:$func)]>; // ARMv5T and above - def BLX : AXI<0x2, (outs), (ins GPR:$func, variable_ops), BranchMisc, + def BLX : ABLXI<0x2, (outs), (ins GPR:$func, variable_ops), BranchMisc, "blx $func", [(ARMcall GPR:$func)]>, Requires<[IsARM, HasV5T]>; let Uses = [LR] in { @@ -576,7 +576,7 @@ // FIXME: should be able to write a pattern for ARMBrcond, but can't use // a two-value operand where a dag node expects two operands. :( - def Bcc : AI<0xA, (outs), (ins brtarget:$target), Branch, + def Bcc : ABccI<0xA, (outs), (ins brtarget:$target), Branch, "b", " $target", [/*(ARMbrcond bb:$target, imm:$cc, CCR:$ccr)*/]>; } From rafael.espindola at gmail.com Mon Sep 1 04:42:53 2008 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 01 Sep 2008 09:42:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55602 - /llvm-gcc-4.2/trunk/gcc/tree-ssa-ccp.c Message-ID: <200809010942.m819grvl028651@zion.cs.uiuc.edu> Author: rafael Date: Mon Sep 1 04:42:52 2008 New Revision: 55602 URL: http://llvm.org/viewvc/llvm-project?rev=55602&view=rev Log: add "LLVM local" markers. Modified: llvm-gcc-4.2/trunk/gcc/tree-ssa-ccp.c Modified: llvm-gcc-4.2/trunk/gcc/tree-ssa-ccp.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-ssa-ccp.c?rev=55602&r1=55601&r2=55602&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-ssa-ccp.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree-ssa-ccp.c Mon Sep 1 04:42:52 2008 @@ -2544,11 +2544,13 @@ continue; } fcode = DECL_FUNCTION_CODE (callee); + /* LLVM LOCAL begin */ if (fcode != BUILT_IN_CONSTANT_P) { bsi_next (&i); continue; } + /* LLVM LOCAL end */ result = ccp_fold_builtin (*stmtp, call); if (!result) @@ -2626,10 +2628,14 @@ NULL, /* next */ 0, /* static_pass_number */ 0, /* tv_id */ + /* LLVM LOCAL begin */ PROP_cfg, /* properties_required */ + /* LLVM LOCAL end */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ + /* LLVM LOCAL begin */ TODO_dump_func, /* todo_flags_finish */ + /* LLVM LOCAL end */ 0 /* letter */ }; From baldrick at free.fr Mon Sep 1 06:40:11 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 01 Sep 2008 11:40:11 -0000 Subject: [llvm-commits] [llvm] r55604 - in /llvm/trunk: include/llvm/LinkAllPasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/MarkModRef.cpp Message-ID: <200809011140.m81BeB3G032485@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 1 06:40:11 2008 New Revision: 55604 URL: http://llvm.org/viewvc/llvm-project?rev=55604&view=rev Log: Add a small pass that sets the readnone/readonly attributes on functions, based on the result of alias analysis. It's not hardwired to use GlobalsModRef even though this is the only (AFAIK) alias analysis that results in this pass actually doing something. Enable as follows: opt ... -globalsmodref-aa -markmodref ... Advantages of this pass: (1) records the result of globalsmodref in the bitcode, meaning it is available for use by later passes (currently the pass manager isn't smart enough to magically make an advanced alias analysis available to all later passes), which may expose more optimization opportunities; (2) hopefully speeds up compilation when code is optimized twice, for example when a file is compiled to bitcode, then later LTO is done on it: marking functions readonly/readnone when producing the initial bitcode should speed up alias analysis during LTO; (3) good for discovering that globalsmodref doesn't work very well :) Not currently turned on by default. Added: llvm/trunk/lib/Transforms/Scalar/MarkModRef.cpp Modified: llvm/trunk/include/llvm/LinkAllPasses.h llvm/trunk/include/llvm/Transforms/Scalar.h Modified: llvm/trunk/include/llvm/LinkAllPasses.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=55604&r1=55603&r2=55604&view=diff ============================================================================== --- llvm/trunk/include/llvm/LinkAllPasses.h (original) +++ llvm/trunk/include/llvm/LinkAllPasses.h Mon Sep 1 06:40:11 2008 @@ -85,6 +85,7 @@ (void) llvm::createLowerInvokePass(); (void) llvm::createLowerSetJmpPass(); (void) llvm::createLowerSwitchPass(); + (void) llvm::createMarkModRefPass(); (void) llvm::createNoAAPass(); (void) llvm::createNoProfileInfoPass(); (void) llvm::createProfileLoaderPass(); Modified: llvm/trunk/include/llvm/Transforms/Scalar.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Scalar.h?rev=55604&r1=55603&r2=55604&view=diff ============================================================================== --- llvm/trunk/include/llvm/Transforms/Scalar.h (original) +++ llvm/trunk/include/llvm/Transforms/Scalar.h Mon Sep 1 06:40:11 2008 @@ -137,6 +137,11 @@ // LoopPass *createLoopIndexSplitPass(); +//===----------------------------------------------------------------------===// +// +// MarkModRef - This pass marks functions readnone/readonly. +// +FunctionPass *createMarkModRefPass(); //===----------------------------------------------------------------------===// // Added: llvm/trunk/lib/Transforms/Scalar/MarkModRef.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MarkModRef.cpp?rev=55604&view=auto ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/MarkModRef.cpp (added) +++ llvm/trunk/lib/Transforms/Scalar/MarkModRef.cpp Mon Sep 1 06:40:11 2008 @@ -0,0 +1,69 @@ +//===--------- MarkModRef.cpp - Mark functions readnone/readonly ----------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This pass marks functions readnone/readonly based on the results of alias +// analysis. This requires a sufficiently powerful alias analysis, such as +// GlobalsModRef (invoke as "opt ... -globalsmodref-aa -markmodref ..."). +// +//===----------------------------------------------------------------------===// + +#define DEBUG_TYPE "markmodref" +#include "llvm/ADT/Statistic.h" +#include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Support/Compiler.h" +#include "llvm/Transforms/Scalar.h" +#include "llvm/Function.h" +#include "llvm/Pass.h" +using namespace llvm; + +STATISTIC(NumReadNone, "Number of functions marked readnone"); +STATISTIC(NumReadOnly, "Number of functions marked readonly"); + +namespace { + struct VISIBILITY_HIDDEN MarkModRef : public FunctionPass { + static char ID; // Pass identification, replacement for typeid + MarkModRef() : FunctionPass((intptr_t)&ID) {} + + bool runOnFunction(Function &F); + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesCFG(); + AU.addRequired(); + AU.addPreserved(); + } + }; +} + +char MarkModRef::ID = 0; +static RegisterPass +X("markmodref", "Mark functions readnone/readonly"); + +bool MarkModRef::runOnFunction(Function &F) { + // FIXME: Wrong for functions with weak linkage. + if (F.doesNotAccessMemory()) + // Cannot do better. + return false; + + AliasAnalysis &AA = getAnalysis(); + AliasAnalysis::ModRefBehavior ModRef = AA.getModRefBehavior(&F); + if (ModRef == AliasAnalysis::DoesNotAccessMemory) { + F.setDoesNotAccessMemory(); + NumReadNone++; + return true; + } else if (ModRef == AliasAnalysis::OnlyReadsMemory && !F.onlyReadsMemory()) { + F.setOnlyReadsMemory(); + NumReadOnly++; + return true; + } + return false; +} + +FunctionPass *llvm::createMarkModRefPass() { + return new MarkModRef(); +} From baldrick at free.fr Mon Sep 1 07:00:56 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 01 Sep 2008 12:00:56 -0000 Subject: [llvm-commits] [llvm] r55605 - in /llvm/trunk/test/CodeGen/Generic: 2007-11-21-UndeadIllegalNode.ll APIntLoadStore.ll APIntParam.ll APIntSextParam.ll APIntZextParam.ll Message-ID: <200809011200.m81C0uPO000619@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 1 07:00:55 2008 New Revision: 55605 URL: http://llvm.org/viewvc/llvm-project?rev=55605&view=rev Log: Turn this legalize types test on. Modified: llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll llvm/trunk/test/CodeGen/Generic/APIntParam.ll llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll Modified: llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll?rev=55605&r1=55604&r2=55605&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll (original) +++ llvm/trunk/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll Mon Sep 1 07:00:55 2008 @@ -1,6 +1,4 @@ -; RUN: llvm-as < %s | llc -o - -; XFAIL: * -; Un-XFAIL this once LegalizeDAGTypes is turned on. +; RUN: llvm-as < %s | llc -enable-legalize-types -o - target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i686-pc-linux-gnu" Modified: llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll?rev=55605&r1=55604&r2=55605&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll (original) +++ llvm/trunk/test/CodeGen/Generic/APIntLoadStore.ll Mon Sep 1 07:00:55 2008 @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | llc -; XFAIL: * +; RUN: llvm-as < %s | llc -enable-legalize-types @i1_l = external global i1 ; [#uses=1] @i1_s = external global i1 ; [#uses=1] @i2_l = external global i2 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/Generic/APIntParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntParam.ll?rev=55605&r1=55604&r2=55605&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntParam.ll (original) +++ llvm/trunk/test/CodeGen/Generic/APIntParam.ll Mon Sep 1 07:00:55 2008 @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | llc -; XFAIL: * +; RUN: llvm-as < %s | llc -enable-legalize-types @i1_s = external global i1 ; [#uses=1] @i2_s = external global i2 ; [#uses=1] @i3_s = external global i3 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll?rev=55605&r1=55604&r2=55605&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll (original) +++ llvm/trunk/test/CodeGen/Generic/APIntSextParam.ll Mon Sep 1 07:00:55 2008 @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | llc -; XFAIL: * +; RUN: llvm-as < %s | llc -enable-legalize-types @i1_s = external global i1 ; [#uses=1] @i2_s = external global i2 ; [#uses=1] @i3_s = external global i3 ; [#uses=1] Modified: llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll?rev=55605&r1=55604&r2=55605&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll (original) +++ llvm/trunk/test/CodeGen/Generic/APIntZextParam.ll Mon Sep 1 07:00:55 2008 @@ -1,5 +1,4 @@ -; RUN: llvm-as < %s | llc -; XFAIL: * +; RUN: llvm-as < %s | llc -enable-legalize-types @i1_s = external global i1 ; [#uses=1] @i2_s = external global i2 ; [#uses=1] @i3_s = external global i3 ; [#uses=1] From baldrick at free.fr Mon Sep 1 08:11:15 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 01 Sep 2008 13:11:15 -0000 Subject: [llvm-commits] [llvm] r55606 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Message-ID: <200809011311.m81DBFB3002897@zion.cs.uiuc.edu> Author: baldrick Date: Mon Sep 1 08:11:13 2008 New Revision: 55606 URL: http://llvm.org/viewvc/llvm-project?rev=55606&view=rev Log: Even though no caller actually uses the new value (what matters is that it is added to the worklist), it seems more logical to return it. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=55606&r1=55605&r2=55606&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Mon Sep 1 08:11:13 2008 @@ -155,10 +155,11 @@ /// ReanalyzeNode - Recompute the NodeID and correct processed operands /// for the specified node, adding it to the worklist if ready. - void ReanalyzeNode(SDNode *N) { + SDNode *ReanalyzeNode(SDNode *N) { N->setNodeId(NewNode); SDValue V(N, 0); AnalyzeNewNode(V); // FIXME: ignore the change? + return V.getNode(); } void NoteDeletion(SDNode *Old, SDNode *New) { From ggreif at gmail.com Mon Sep 1 10:10:22 2008 From: ggreif at gmail.com (Gabor Greif) Date: Mon, 01 Sep 2008 15:10:22 -0000 Subject: [llvm-commits] [llvm] r55608 - in /llvm/trunk/lib/CodeGen/SelectionDAG: LegalizeTypes.cpp LegalizeTypes.h Message-ID: <200809011510.m81FAMna006824@zion.cs.uiuc.edu> Author: ggreif Date: Mon Sep 1 10:10:19 2008 New Revision: 55608 URL: http://llvm.org/viewvc/llvm-project?rev=55608&view=rev Log: Provide two overloads of AnalyzeNewNode. The first can update the SDNode in an SDValue while the second is called with SDNode* and returns a possibly updated SDNode*. This patch has no intended functional impact, but helps eliminating ugly temporary SDValues. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=55608&r1=55607&r2=55608&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Mon Sep 1 10:10:19 2008 @@ -221,11 +221,11 @@ /// AnalyzeNewNode - The specified node is the root of a subtree of potentially /// new nodes. Correct any processed operands (this may change the node) and /// calculate the NodeId. -void DAGTypeLegalizer::AnalyzeNewNode(SDValue &Val) { - SDNode * const N(Val.getNode()); +/// Returns the potentially changed node. +SDNode *DAGTypeLegalizer::AnalyzeNewNode(SDNode *N) { // If this was an existing node that is already done, we're done. if (N->getNodeId() != NewNode) - return; + return N; // Remove any stale map entries. ExpungeNode(N); @@ -268,16 +268,26 @@ // Some operands changed - update the node. if (!NewOps.empty()) - Val.setNode(DAG.UpdateNodeOperands(SDValue(N, 0), - &NewOps[0], - NewOps.size()).getNode()); - - SDNode * const Nu(Val.getNode()); - Nu->setNodeId(Nu->getNumOperands()-NumProcessed); - if (Nu->getNodeId() == ReadyToProcess) - Worklist.push_back(Nu); + N = DAG.UpdateNodeOperands(SDValue(N, 0), + &NewOps[0], + NewOps.size()).getNode(); + + N->setNodeId(N->getNumOperands()-NumProcessed); + if (N->getNodeId() == ReadyToProcess) + Worklist.push_back(N); + return N; +} + +/// AnalyzeNewNode - call AnalyzeNewNode(SDNode *N) +/// and update the node in SDValue if necessary. +void DAGTypeLegalizer::AnalyzeNewNode(SDValue &Val) { + SDNode *N(Val.getNode()); + SDNode *M(AnalyzeNewNode(N)); + if (N != M) + Val.setNode(M); } + namespace { /// NodeUpdateListener - This class is a DAGUpdateListener that listens for /// updates to nodes and recomputes their ready state. @@ -338,9 +348,7 @@ // If expansion produced new nodes, make sure they are properly marked. ExpungeNode(From); - SDValue ToNode(To, 0); - AnalyzeNewNode(ToNode); // Expunges To. - To = ToNode.getNode(); + To = AnalyzeNewNode(To); // Expunges To. assert(From->getNumValues() == To->getNumValues() && "Node results don't match"); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h?rev=55608&r1=55607&r2=55608&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.h Mon Sep 1 10:10:19 2008 @@ -157,9 +157,7 @@ /// for the specified node, adding it to the worklist if ready. SDNode *ReanalyzeNode(SDNode *N) { N->setNodeId(NewNode); - SDValue V(N, 0); - AnalyzeNewNode(V); // FIXME: ignore the change? - return V.getNode(); + return AnalyzeNewNode(N); } void NoteDeletion(SDNode *Old, SDNode *New) { @@ -171,6 +169,7 @@ private: void AnalyzeNewNode(SDValue &Val); + SDNode *AnalyzeNewNode(SDNode *N); void ReplaceValueWith(SDValue From, SDValue To); void ReplaceNodeWith(SDNode *From, SDNode *To); From kremenek at apple.com Mon Sep 1 14:58:31 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 01 Sep 2008 19:58:31 -0000 Subject: [llvm-commits] [llvm] r55611 - /llvm/tags/checker/checker-86/ Message-ID: <200809011958.m81JwV3E016400@zion.cs.uiuc.edu> Author: kremenek Date: Mon Sep 1 14:58:31 2008 New Revision: 55611 URL: http://llvm.org/viewvc/llvm-project?rev=55611&view=rev Log: Tagging checker-86. Added: llvm/tags/checker/checker-86/ - copied from r55610, llvm/trunk/ From nicholas at mxc.ca Mon Sep 1 17:06:06 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 01 Sep 2008 15:06:06 -0700 Subject: [llvm-commits] [llvm] r53158 - in /llvm/trunk: include/llvm/GlobalValue.h lib/Linker/LinkModules.cpp In-Reply-To: <200807052348.m65NmVKM009577@zion.cs.uiuc.edu> References: <200807052348.m65NmVKM009577@zion.cs.uiuc.edu> Message-ID: <48BC674E.2@mxc.ca> Anton Korobeynikov wrote: > Author: asl > Date: Sat Jul 5 18:48:30 2008 > New Revision: 53158 > > URL: http://llvm.org/viewvc/llvm-project?rev=53158&view=rev > Log: > Add convenient helper for checking whether global is weak in linker sense > having weak or linkonce or common or extweak LLVM linkage. Hi Anton, I ran across this function and have no idea what it is doing. I understand that it's an OR of those linkage types -- but why? What do those linkages all have in common? And why do you call it "weak for linker"? What's the linker got to do with it, above and beyond the 'linkages' that these already are? Could you elaborate in the documentation for this function? I'd appreciate it. Specifically, I happened to be looking for a function to determine whether or not this global was known to be 'absolutely final' at run time or not, regardless of what else we get linked against, or any LD_PRELOAD trickery to override weak symbols, etc. For all I know, this function might be it -- I couldn't tell. Nick > > Modified: > llvm/trunk/include/llvm/GlobalValue.h > llvm/trunk/lib/Linker/LinkModules.cpp > > Modified: llvm/trunk/include/llvm/GlobalValue.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/GlobalValue.h?rev=53158&r1=53157&r2=53158&view=diff > > ============================================================================== > --- llvm/trunk/include/llvm/GlobalValue.h (original) > +++ llvm/trunk/include/llvm/GlobalValue.h Sat Jul 5 18:48:30 2008 > @@ -110,6 +110,15 @@ > void setLinkage(LinkageTypes LT) { Linkage = LT; } > LinkageTypes getLinkage() const { return Linkage; } > > + /// isWeakForLinker - Determines if symbol is weak for linker having weak or > + /// linkonce or common or extweak LLVM linkage. > + bool isWeakForLinker() const { > + return (Linkage == WeakLinkage || > + Linkage == LinkOnceLinkage || > + Linkage == CommonLinkage || > + Linkage == ExternalWeakLinkage); > + } > + > /// copyAttributesFrom - copy all additional attributes (those not needed to > /// create a GlobalValue) from the GlobalValue Src to this one. > virtual void copyAttributesFrom(const GlobalValue *Src); > > Modified: llvm/trunk/lib/Linker/LinkModules.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=53158&r1=53157&r2=53158&view=diff > > ============================================================================== > --- llvm/trunk/lib/Linker/LinkModules.cpp (original) > +++ llvm/trunk/lib/Linker/LinkModules.cpp Sat Jul 5 18:48:30 2008 > @@ -483,11 +483,10 @@ > "': can only link appending global with another appending global!"); > LinkFromSrc = true; // Special cased. > LT = Src->getLinkage(); > - } else if (Src->hasWeakLinkage() || Src->hasLinkOnceLinkage() || > - Src->hasCommonLinkage()) { > + } else if (Src->isWeakForLinker()) { > // At this point we know that Dest has LinkOnce, External*, Weak, Common, > // or DLL* linkage. > - if ((Dest->hasLinkOnceLinkage() && > + if ((Dest->hasLinkOnceLinkage() && > (Src->hasWeakLinkage() || Src->hasCommonLinkage())) || > Dest->hasExternalWeakLinkage()) { > LinkFromSrc = true; > @@ -496,8 +495,7 @@ > LinkFromSrc = false; > LT = Dest->getLinkage(); > } > - } else if (Dest->hasWeakLinkage() || Dest->hasLinkOnceLinkage() || > - Dest->hasCommonLinkage()) { > + } else if (Dest->isWeakForLinker()) { > // At this point we know that Src has External* or DLL* linkage. > if (Src->hasExternalWeakLinkage()) { > LinkFromSrc = false; > @@ -762,10 +760,7 @@ > } else if (GlobalVariable *DGVar = dyn_cast_or_null(DGV)) { > // The only allowed way is to link alias with external declaration or weak > // symbol.. > - if (DGVar->isDeclaration() || > - DGVar->hasWeakLinkage() || > - DGVar->hasLinkOnceLinkage() || > - DGVar->hasCommonLinkage()) { > + if (DGVar->isDeclaration() || DGVar->isWeakForLinker()) { > // But only if aliasee is global too... > if (!isa(DAliasee)) > return Error(Err, "Global-Alias Collision on '" + SGA->getName() + > @@ -794,10 +789,7 @@ > } else if (Function *DF = dyn_cast_or_null(DGV)) { > // The only allowed way is to link alias with external declaration or weak > // symbol... > - if (DF->isDeclaration() || > - DF->hasWeakLinkage() || > - DF->hasLinkOnceLinkage() || > - DF->hasCommonLinkage()) { > + if (DF->isDeclaration() || DF->isWeakForLinker()) { > // But only if aliasee is function too... > if (!isa(DAliasee)) > return Error(Err, "Function-Alias Collision on '" + SGA->getName() + > @@ -874,12 +866,10 @@ > if (DGV->getInitializer() != SInit) > return Error(Err, "Global Variable Collision on '" + SGV->getName() + > "': global variables have different initializers"); > - } else if (DGV->hasLinkOnceLinkage() || DGV->hasWeakLinkage() || > - DGV->hasCommonLinkage()) { > + } else if (DGV->isWeakForLinker()) { > // Nothing is required, mapped values will take the new global > // automatically. > - } else if (SGV->hasLinkOnceLinkage() || SGV->hasWeakLinkage() || > - SGV->hasCommonLinkage()) { > + } else if (SGV->isWeakForLinker()) { > // Nothing is required, mapped values will take the new global > // automatically. > } else if (DGV->hasAppendingLinkage()) { > @@ -952,10 +942,7 @@ > // The only valid mappings are: > // - SF is external declaration, which is effectively a no-op. > // - SF is weak, when we just need to throw SF out. > - if (!SF->isDeclaration() && > - !SF->hasWeakLinkage() && > - !SF->hasLinkOnceLinkage() && > - !SF->hasCommonLinkage()) > + if (!SF->isDeclaration() && !SF->isWeakForLinker()) > return Error(Err, "Function-Alias Collision on '" + SF->getName() + > "': symbol multiple defined"); > > @@ -1042,21 +1029,19 @@ > } > > // At this point we know that DF has LinkOnce, Weak, or External* linkage. > - if (SF->hasWeakLinkage() || SF->hasLinkOnceLinkage() || > - SF->hasCommonLinkage()) { > + if (SF->isWeakForLinker()) { > ValueMap[SF] = MappedDF; > > // Linkonce+Weak = Weak > // *+External Weak = * > - if ((DF->hasLinkOnceLinkage() && > + if ((DF->hasLinkOnceLinkage() && > (SF->hasWeakLinkage() || SF->hasCommonLinkage())) || > DF->hasExternalWeakLinkage()) > DF->setLinkage(SF->getLinkage()); > continue; > } > > - if (DF->hasWeakLinkage() || DF->hasLinkOnceLinkage() || > - DF->hasCommonLinkage()) { > + if (DF->isWeakForLinker()) { > // At this point we know that SF has LinkOnce or External* linkage. > ValueMap[SF] = MappedDF; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From kremenek at apple.com Mon Sep 1 17:29:33 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 01 Sep 2008 22:29:33 -0000 Subject: [llvm-commits] [llvm] r55616 - /llvm/tags/checker/checker-87/ Message-ID: <200809012229.m81MTXBW021762@zion.cs.uiuc.edu> Author: kremenek Date: Mon Sep 1 17:29:32 2008 New Revision: 55616 URL: http://llvm.org/viewvc/llvm-project?rev=55616&view=rev Log: Tagging checker-87. Added: llvm/tags/checker/checker-87/ - copied from r55615, llvm/trunk/ From evan.cheng at apple.com Tue Sep 2 01:51:37 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 02 Sep 2008 06:51:37 -0000 Subject: [llvm-commits] [llvm] r55623 - in /llvm/trunk: lib/Target/Alpha/AlphaCodeEmitter.cpp lib/Target/PowerPC/PPCCodeEmitter.cpp utils/TableGen/CodeEmitterGen.cpp Message-ID: <200809020651.m826pbi2005428@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 2 01:51:36 2008 New Revision: 55623 URL: http://llvm.org/viewvc/llvm-project?rev=55623&view=rev Log: Change getBinaryCodeForInstr prototype. First operand MachineInstr& should be const. Make corresponding changes. Modified: llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp llvm/trunk/utils/TableGen/CodeEmitterGen.cpp Modified: llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp?rev=55623&r1=55622&r2=55623&view=diff ============================================================================== --- llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/Alpha/AlphaCodeEmitter.cpp Tue Sep 2 01:51:36 2008 @@ -33,7 +33,8 @@ /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr /// - int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); + unsigned getMachineOpValue(const MachineInstr &MI, + const MachineOperand &MO); public: static char ID; @@ -55,7 +56,7 @@ /// CodeEmitterGenerator using TableGen, produces the binary encoding for /// machine instructions. /// - unsigned getBinaryCodeForInstr(MachineInstr &MI); + unsigned getBinaryCodeForInstr(const MachineInstr &MI); private: void emitBasicBlock(MachineBasicBlock &MBB); @@ -87,7 +88,7 @@ MCE.StartMachineBasicBlock(&MBB); for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I) { - MachineInstr &MI = *I; + const MachineInstr &MI = *I; switch(MI.getOpcode()) { default: MCE.emitWordLE(getBinaryCodeForInstr(*I)); @@ -141,10 +142,11 @@ } } -int AlphaCodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { +unsigned AlphaCodeEmitter::getMachineOpValue(const MachineInstr &MI, + const MachineOperand &MO) { - int rv = 0; // Return value; defaults to 0 for unhandled cases - // or things that get fixed up later by the JIT. + unsigned rv = 0; // Return value; defaults to 0 for unhandled cases + // or things that get fixed up later by the JIT. if (MO.isRegister()) { rv = getAlphaRegNumber(MO.getReg()); Modified: llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp?rev=55623&r1=55622&r2=55623&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCCodeEmitter.cpp Tue Sep 2 01:51:36 2008 @@ -38,7 +38,7 @@ /// getMachineOpValue - evaluates the MachineOperand of a given MachineInstr /// - int getMachineOpValue(MachineInstr &MI, MachineOperand &MO); + unsigned getMachineOpValue(const MachineInstr &MI, const MachineOperand &MO); void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); @@ -68,7 +68,7 @@ /// CodeEmitterGenerator using TableGen, produces the binary encoding for /// machine instructions. /// - unsigned getBinaryCodeForInstr(MachineInstr &MI); + unsigned getBinaryCodeForInstr(const MachineInstr &MI); }; char PPCCodeEmitter::ID = 0; } @@ -100,10 +100,10 @@ MCE.StartMachineBasicBlock(&MBB); for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E; ++I){ - MachineInstr &MI = *I; + const MachineInstr &MI = *I; switch (MI.getOpcode()) { default: - MCE.emitWordBE(getBinaryCodeForInstr(*I)); + MCE.emitWordBE(getBinaryCodeForInstr(MI)); break; case TargetInstrInfo::DBG_LABEL: case TargetInstrInfo::EH_LABEL: @@ -121,9 +121,10 @@ } } -int PPCCodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { +unsigned PPCCodeEmitter::getMachineOpValue(const MachineInstr &MI, + const MachineOperand &MO) { - intptr_t rv = 0; // Return value; defaults to 0 for unhandled cases + unsigned rv = 0; // Return value; defaults to 0 for unhandled cases // or things that get fixed up later by the JIT. if (MO.isRegister()) { rv = PPCRegisterInfo::getRegisterNumbering(MO.getReg()); Modified: llvm/trunk/utils/TableGen/CodeEmitterGen.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeEmitterGen.cpp?rev=55623&r1=55622&r2=55623&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeEmitterGen.cpp (original) +++ llvm/trunk/utils/TableGen/CodeEmitterGen.cpp Tue Sep 2 01:51:36 2008 @@ -89,7 +89,7 @@ // Emit function declaration o << "unsigned " << Target.getName() << "CodeEmitter::" - << "getBinaryCodeForInstr(MachineInstr &MI) {\n"; + << "getBinaryCodeForInstr(const MachineInstr &MI) {\n"; // Emit instruction base values o << " static const unsigned InstBits[] = {\n"; @@ -221,6 +221,7 @@ o << " const unsigned opcode = MI.getOpcode();\n" << " unsigned Value = InstBits[opcode];\n" << " unsigned op;\n" + << " op = op; // suppress warning\n" << " switch (opcode) {\n"; // Emit each case statement From evan.cheng at apple.com Tue Sep 2 01:52:38 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 02 Sep 2008 06:52:38 -0000 Subject: [llvm-commits] [llvm] r55624 - /llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Message-ID: <200809020652.m826qcTJ005469@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 2 01:52:38 2008 New Revision: 55624 URL: http://llvm.org/viewvc/llvm-project?rev=55624&view=rev Log: Revamp ARM JIT. Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=55624&r1=55623&r2=55624&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue Sep 2 01:52:38 2008 @@ -13,18 +13,17 @@ //===----------------------------------------------------------------------===// #define DEBUG_TYPE "arm-emitter" +#include "ARM.h" +#include "ARMAddressingModes.h" #include "ARMInstrInfo.h" +#include "ARMRelocations.h" #include "ARMSubtarget.h" #include "ARMTargetMachine.h" -#include "ARMRelocations.h" -#include "ARMAddressingModes.h" -#include "ARM.h" #include "llvm/PassManager.h" #include "llvm/CodeGen/MachineCodeEmitter.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/Passes.h" -#include "llvm/Function.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Compiler.h" using namespace llvm; @@ -32,19 +31,19 @@ STATISTIC(NumEmitted, "Number of machine instructions emitted"); namespace { - class VISIBILITY_HIDDEN Emitter : public MachineFunctionPass { + class VISIBILITY_HIDDEN ARMCodeEmitter : public MachineFunctionPass { const ARMInstrInfo *II; const TargetData *TD; TargetMachine &TM; MachineCodeEmitter &MCE; public: static char ID; - explicit Emitter(TargetMachine &tm, MachineCodeEmitter &mce) - : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), + explicit ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce) + : MachineFunctionPass((intptr_t)&ID), II(0), TD(0), TM(tm), MCE(mce) {} - Emitter(TargetMachine &tm, MachineCodeEmitter &mce, + ARMCodeEmitter(TargetMachine &tm, MachineCodeEmitter &mce, const ARMInstrInfo &ii, const TargetData &td) - : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm), + : MachineFunctionPass((intptr_t)&ID), II(&ii), TD(&td), TM(tm), MCE(mce) {} bool runOnMachineFunction(MachineFunction &MF); @@ -54,10 +53,54 @@ } void emitInstruction(const MachineInstr &MI); - int getMachineOpValue(const MachineInstr &MI, unsigned OpIndex); - unsigned getBaseOpcodeFor(const TargetInstrDesc &TID); + + private: + unsigned getAddrModeNoneInstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary) ; + unsigned getAddrMode1InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary); + unsigned getAddrMode2InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary); + unsigned getAddrMode3InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary); + unsigned getAddrMode4InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary); + + /// getInstrBinary - Return binary encoding for the specified + /// machine instruction. + unsigned getInstrBinary(const MachineInstr &MI); + + /// getBinaryCodeForInstr - This function, generated by the + /// CodeEmitterGenerator using TableGen, produces the binary encoding for + /// machine instructions. + /// unsigned getBinaryCodeForInstr(const MachineInstr &MI); + /// getMachineOpValue - Return binary encoding of operand. If the machine + /// operand requires relocation, record the relocation and return zero. + unsigned getMachineOpValue(const MachineInstr &MI, unsigned OpIdx) { + return getMachineOpValue(MI, MI.getOperand(OpIdx)); + } + unsigned getMachineOpValue(const MachineInstr &MI, + const MachineOperand &MO); + + /// getBaseOpcodeFor - Return the opcode value. + /// + unsigned getBaseOpcodeFor(const TargetInstrDesc &TID) const { + return (TID.TSFlags & ARMII::OpcodeMask) >> ARMII::OpcodeShift; + } + + /// getShiftOp - Return the shift opcode (bit[6:5]) of the machine operand. + /// + unsigned getShiftOp(const MachineOperand &MO) const ; + + /// Routines that handle operands which add machine relocations which are + /// fixed up by the JIT fixup stage. void emitGlobalAddressForCall(GlobalValue *GV, bool DoesntNeedStub); void emitExternalSymbolAddress(const char *ES, unsigned Reloc); void emitConstPoolAddress(unsigned CPI, unsigned Reloc, @@ -66,22 +109,18 @@ unsigned PCAdj = 0); void emitGlobalConstant(const Constant *CV); void emitMachineBasicBlock(MachineBasicBlock *BB); - - private: - int getShiftOp(const MachineOperand &MO); - }; - char Emitter::ID = 0; + char ARMCodeEmitter::ID = 0; } /// createARMCodeEmitterPass - Return a pass that emits the collected ARM code /// to the specified MCE object. FunctionPass *llvm::createARMCodeEmitterPass(ARMTargetMachine &TM, MachineCodeEmitter &MCE) { - return new Emitter(TM, MCE); + return new ARMCodeEmitter(TM, MCE); } -bool Emitter::runOnMachineFunction(MachineFunction &MF) { +bool ARMCodeEmitter::runOnMachineFunction(MachineFunction &MF) { assert((MF.getTarget().getRelocationModel() != Reloc::Default || MF.getTarget().getRelocationModel() != Reloc::Static) && "JIT relocation model must be set to static or default!"); @@ -102,70 +141,57 @@ return false; } -/// getBaseOpcodeFor - Return the opcode value -unsigned Emitter::getBaseOpcodeFor(const TargetInstrDesc &TID) { - return (TID.TSFlags & ARMII::OpcodeMask) >> ARMII::OpcodeShift; -} - -/// getShiftOp - Verify which is the shift opcode (bit[6:5]) of the -/// machine operand. -int Emitter::getShiftOp(const MachineOperand &MO) { - unsigned ShiftOp = 0x0; - switch(ARM_AM::getAM2ShiftOpc(MO.getImm())) { +/// getShiftOp - Return the shift opcode (bit[6:5]) of the machine operand. +/// +unsigned ARMCodeEmitter::getShiftOp(const MachineOperand &MO) const { + switch (ARM_AM::getAM2ShiftOpc(MO.getImm())) { default: assert(0 && "Unknown shift opc!"); - case ARM_AM::asr: - ShiftOp = 0X2; - break; - case ARM_AM::lsl: - ShiftOp = 0X0; - break; - case ARM_AM::lsr: - ShiftOp = 0X1; - break; + case ARM_AM::asr: return 2; + case ARM_AM::lsl: return 0; + case ARM_AM::lsr: return 1; case ARM_AM::ror: - case ARM_AM::rrx: - ShiftOp = 0X3; - break; + case ARM_AM::rrx: return 3; } - return ShiftOp; + return 0; } -int Emitter::getMachineOpValue(const MachineInstr &MI, unsigned OpIndex) { - intptr_t rv = 0; - const MachineOperand &MO = MI.getOperand(OpIndex); - if (MO.isRegister()) { - assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg())); - rv = ARMRegisterInfo::getRegisterNumbering(MO.getReg()); - } else if (MO.isImmediate()) { - rv = MO.getImm(); - } else if (MO.isGlobalAddress()) { +/// getMachineOpValue - Return binary encoding of operand. If the machine +/// operand requires relocation, record the relocation and return zero. +unsigned ARMCodeEmitter::getMachineOpValue(const MachineInstr &MI, + const MachineOperand &MO) { + if (MO.isRegister()) + return ARMRegisterInfo::getRegisterNumbering(MO.getReg()); + else if (MO.isImmediate()) + return static_cast(MO.getImm()); + else if (MO.isGlobalAddress()) emitGlobalAddressForCall(MO.getGlobal(), false); - } else if (MO.isExternalSymbol()) { + else if (MO.isExternalSymbol()) emitExternalSymbolAddress(MO.getSymbolName(), ARM::reloc_arm_relative); - } else if (MO.isConstantPoolIndex()) { + else if (MO.isConstantPoolIndex()) emitConstPoolAddress(MO.getIndex(), ARM::reloc_arm_relative); - } else if (MO.isJumpTableIndex()) { + else if (MO.isJumpTableIndex()) emitJumpTableAddress(MO.getIndex(), ARM::reloc_arm_relative); - } else if (MO.isMachineBasicBlock()) { + else if (MO.isMachineBasicBlock()) emitMachineBasicBlock(MO.getMBB()); - } - return rv; + abort(); + return 0; } /// emitGlobalAddressForCall - Emit the specified address to the code stream /// assuming this is part of a function call, which is PC relative. /// -void Emitter::emitGlobalAddressForCall(GlobalValue *GV, bool DoesntNeedStub) { +void ARMCodeEmitter::emitGlobalAddressForCall(GlobalValue *GV, + bool DoesntNeedStub) { MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), - ARM::reloc_arm_branch, GV, 0, - DoesntNeedStub)); + ARM::reloc_arm_branch, GV, 0, + DoesntNeedStub)); } /// emitExternalSymbolAddress - Arrange for the address of an external symbol to /// be emitted to the current location in the function, and allow it to be PC /// relative. -void Emitter::emitExternalSymbolAddress(const char *ES, unsigned Reloc) { +void ARMCodeEmitter::emitExternalSymbolAddress(const char *ES, unsigned Reloc) { MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(), Reloc, ES)); } @@ -173,9 +199,9 @@ /// emitConstPoolAddress - Arrange for the address of an constant pool /// to be emitted to the current location in the function, and allow it to be PC /// relative. -void Emitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc, - int Disp /* = 0 */, - unsigned PCAdj /* = 0 */) { +void ARMCodeEmitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc, + int Disp /* = 0 */, + unsigned PCAdj /* = 0 */) { MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(), Reloc, CPI, PCAdj)); } @@ -183,472 +209,331 @@ /// emitJumpTableAddress - Arrange for the address of a jump table to /// be emitted to the current location in the function, and allow it to be PC /// relative. -void Emitter::emitJumpTableAddress(unsigned JTI, unsigned Reloc, - unsigned PCAdj /* = 0 */) { +void ARMCodeEmitter::emitJumpTableAddress(unsigned JTI, unsigned Reloc, + unsigned PCAdj /* = 0 */) { MCE.addRelocation(MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(), Reloc, JTI, PCAdj)); } /// emitMachineBasicBlock - Emit the specified address basic block. -void Emitter::emitMachineBasicBlock(MachineBasicBlock *BB) { +void ARMCodeEmitter::emitMachineBasicBlock(MachineBasicBlock *BB) { MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(), - ARM::reloc_arm_branch, BB)); + ARM::reloc_arm_branch, BB)); } -void Emitter::emitInstruction(const MachineInstr &MI) { +void ARMCodeEmitter::emitInstruction(const MachineInstr &MI) { NumEmitted++; // Keep track of the # of mi's emitted - MCE.emitWordLE(getBinaryCodeForInstr(MI)); + MCE.emitWordLE(getInstrBinary(MI)); } -unsigned Emitter::getBinaryCodeForInstr(const MachineInstr &MI) { - const TargetInstrDesc &Desc = MI.getDesc(); - unsigned opcode = Desc.Opcode; - // initial instruction mask - unsigned Value = 0xE0000000; - unsigned op; - - switch (Desc.TSFlags & ARMII::AddrModeMask) { - case ARMII::AddrModeNone: { - switch(Desc.TSFlags & ARMII::FormMask) { - default: { - assert(0 && "Unknown instruction subtype!"); - // treat special instruction CLZ - if(opcode == ARM::CLZ) { - // set first operand - op = getMachineOpValue(MI,0); - Value |= op << ARMII::RegRdShift; - - // set second operand - op = getMachineOpValue(MI,1); - Value |= op; - } - break; +unsigned ARMCodeEmitter::getAddrModeNoneInstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary) { + switch (Desc.TSFlags & ARMII::FormMask) { + default: + assert(0 && "Unknown instruction subtype!"); + break; + case ARMII::Branch: { + // Set signed_immed_24 field + Binary |= getMachineOpValue(MI, 0); + + // if it is a conditional branch, set cond field + if (Desc.Opcode == ARM::Bcc) { + Binary &= 0x0FFFFFFF; // clear conditional field + Binary |= getMachineOpValue(MI, 1) << 28; // set conditional field } - case ARMII::MulSMLAW: - case ARMII::MulSMULW: - // set bit W(21) - Value |= 1 << 21; - case ARMII::MulSMLA: - case ARMII::MulSMUL: { - // set bit W(21) - Value |= 1 << 24; - - // set opcode (bit[7:4]). For more information, see ARM-ARM page A3-31 - // SMLA - 1yx0 - // SMLAW - 1y00 - // SMULW - 1y10 - // SMUL - 1yx0 - unsigned char BaseOpcode = getBaseOpcodeFor(Desc); - Value |= BaseOpcode << 4; - - unsigned Format = (Desc.TSFlags & ARMII::FormMask); - if (Format == ARMII::MulSMUL) - Value |= 1 << 22; - - // set first operand - op = getMachineOpValue(MI,0); - Value |= op << ARMII::RegRnShift; - - // set second operand - op = getMachineOpValue(MI,1); - Value |= op; - - // set third operand - op = getMachineOpValue(MI,2); - Value |= op << ARMII::RegRsShift; - - // instructions SMLA and SMLAW have a fourth operand - if (Format != ARMII::MulSMULW && Format != ARMII::MulSMUL) { - op = getMachineOpValue(MI,3); - Value |= op << ARMII::RegRdShift; - } + break; + } + case ARMII::BranchMisc: { + // Set bit[19:8] to 0xFFF + Binary |= 0xfff << 8; + if (Desc.Opcode == ARM::BX_RET) + Binary |= 0xe; // the return register is LR + else + // otherwise, set the return register + Binary |= getMachineOpValue(MI, 0); + break; + } + } - break; - } - case ARMII::MulFrm: { - // bit[7:4] is always 9 - Value |= 9 << 4; - // set opcode (bit[23:20]) - unsigned char BaseOpcode = getBaseOpcodeFor(Desc); - Value |= BaseOpcode << 20; - - bool isMUL = opcode == ARM::MUL; - bool isMLA = opcode == ARM::MLA; - - // set first operand - op = getMachineOpValue(MI,0); - Value |= op << (isMUL || isMLA ? ARMII::RegRnShift : ARMII::RegRdShift); - - // set second operand - op = getMachineOpValue(MI,1); - Value |= op << (isMUL || isMLA ? 0 : ARMII::RegRnShift); - - // set third operand - op = getMachineOpValue(MI,2); - Value |= op << (isMUL || isMLA ? ARMII::RegRsShift : 0); - - // multiply instructions (except MUL), have a fourth operand - if (!isMUL) { - op = getMachineOpValue(MI,3); - Value |= op << (isMLA ? ARMII::RegRdShift : ARMII::RegRsShift); - } + return Binary; +} +unsigned ARMCodeEmitter::getAddrMode1InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary) { + // FIXME: Clean up. + // Treat 3 special instructions: MOVsra_flag, MOVsrl_flag and MOVrx. + unsigned Format = Desc.TSFlags & ARMII::FormMask; + if (Format == ARMII::DPRdMisc) { + Binary |= getMachineOpValue(MI, 0) << ARMII::RegRdShift; + Binary |= getMachineOpValue(MI, 1); + switch (Desc.Opcode) { + case ARM::MOVsra_flag: + Binary |= 0x1 << 6; + Binary |= 0x1 << 7; + break; + case ARM::MOVsrl_flag: + Binary |= 0x1 << 5; + Binary |= 0x1 << 7; break; - } - case ARMII::Branch: { - // set opcode (bit[27:24]) - unsigned BaseOpcode = getBaseOpcodeFor(Desc); - Value |= BaseOpcode << 24; - - // set signed_immed_24 field - op = getMachineOpValue(MI,0); - Value |= op; - - // if it is a conditional branch, set cond field - if (opcode == ARM::Bcc) { - op = getMachineOpValue(MI,1); - Value &= 0x0FFFFFFF; // clear conditional field - Value |= op << 28; // set conditional field - } - + case ARM::MOVrx: + Binary |= 0x3 << 5; break; } - case ARMII::BranchMisc: { - // set opcode (bit[7:4]) - unsigned char BaseOpcode = getBaseOpcodeFor(Desc); - Value |= BaseOpcode << 4; - // set bit[27:24] to 1, set bit[23:20] to 2 and set bit[19:8] to 0xFFF - Value |= 0x12fff << 8; - - if (opcode == ARM::BX_RET) - op = 0xe; // the return register is LR - else - // otherwise, set the return register - op = getMachineOpValue(MI,0); - Value |= op; + return Binary; + } - break; - } - case ARMII::Pseudo: - break; - } + // FIXME: Clean up this part. + // Data processing operand instructions has 3 possible encodings (for more + // information, see ARM-ARM page A3-10): + // 1. , + // 2. , + // 3. ,, + bool IsDataProcessing1 = Format == ARMII::DPRdIm || + Format == ARMII::DPRdReg || + Format == ARMII::DPRdSoReg; + bool IsDataProcessing2 = Format == ARMII::DPRnIm || + Format == ARMII::DPRnReg || + Format == ARMII::DPRnSoReg; + bool IsDataProcessing3 = false; + + if (Format == ARMII::DPRImS || Format == ARMII::DPRRegS || + Format == ARMII::DPRSoRegS || IsDataProcessing2) + IsDataProcessing3 = !IsDataProcessing2; + + IsDataProcessing3 = Format == ARMII::DPRIm || + Format == ARMII::DPRReg || + Format == ARMII::DPRSoReg || + IsDataProcessing3; + + // Set first operand + if (IsDataProcessing1 || IsDataProcessing3) { + Binary |= getMachineOpValue(MI, 0) << ARMII::RegRdShift; + } else if (IsDataProcessing2) { + Binary |= getMachineOpValue(MI, 0) << ARMII::RegRnShift; + } + // Set second operand of data processing #3 instructions + if (IsDataProcessing3) + Binary |= getMachineOpValue(MI, 1) << ARMII::RegRnShift; + + unsigned OpIdx = IsDataProcessing3 ? 2 : 1; + switch (Format) { + default: + assert(false && "Unknown operand type!"); + break; + case ARMII::DPRdIm: case ARMII::DPRnIm: + case ARMII::DPRIm: case ARMII::DPRImS: { + // Set bit I(25) to identify this is the immediate form of + Binary |= 1 << ARMII::I_BitShift; + // Set immed_8 field + const MachineOperand &MO = MI.getOperand(OpIdx); + Binary |= ARM_AM::getSOImmVal(MO.getImm()); + break; + } + case ARMII::DPRdReg: case ARMII::DPRnReg: + case ARMII::DPRReg: case ARMII::DPRRegS: { + // Set last operand (register Rm) + Binary |= getMachineOpValue(MI, OpIdx); break; } - case ARMII::AddrMode1: { - // set opcode (bit[24:21]) of data-processing instructions - unsigned char BaseOpcode = getBaseOpcodeFor(Desc); - Value |= BaseOpcode << 21; - - // treat 3 special instructions: MOVsra_flag, MOVsrl_flag and - // MOVrx. - unsigned Format = Desc.TSFlags & ARMII::FormMask; - if (Format == ARMII::DPRdMisc) { - Value |= getMachineOpValue(MI,0) << ARMII::RegRdShift; - Value |= getMachineOpValue(MI,1); - switch(opcode) { - case ARM::MOVsra_flag: { - Value |= 0x1 << 6; - Value |= 0x1 << 7; - break; - } - case ARM::MOVsrl_flag: { - Value |= 0x1 << 5; - Value |= 0x1 << 7; - break; - } - case ARM::MOVrx: { - Value |= 0x3 << 5; - break; - } - } + case ARMII::DPRdSoReg: case ARMII::DPRnSoReg: + case ARMII::DPRSoReg: case ARMII::DPRSoRegS: { + // Set last operand (register Rm) + Binary |= getMachineOpValue(MI, OpIdx); + + const MachineOperand &MO1 = MI.getOperand(OpIdx + 1); + const MachineOperand &MO2 = MI.getOperand(OpIdx + 2); + + // Identify it the instr is in immed or register shifts encoding + bool IsShiftByRegister = MO1.getReg() > 0; + // Set shift operand (bit[6:4]). + // ASR - 101 if it is in register shifts encoding; 100, otherwise. + // LSL - 001 if it is in register shifts encoding; 000, otherwise. + // LSR - 011 if it is in register shifts encoding; 010, otherwise. + // ROR - 111 if it is in register shifts encoding; 110, otherwise. + // RRX - 110 and bit[11:7] clear. + switch (ARM_AM::getSORegShOp(MO2.getImm())) { + default: assert(0 && "Unknown shift opc!"); + case ARM_AM::asr: + if (IsShiftByRegister) + Binary |= 0x5 << 4; + else + Binary |= 0x1 << 6; + break; + case ARM_AM::lsl: + if (IsShiftByRegister) + Binary |= 0x1 << 4; + break; + case ARM_AM::lsr: + if (IsShiftByRegister) + Binary |= 0x3 << 4; + else + Binary |= 0x1 << 5; + break; + case ARM_AM::ror: + if (IsShiftByRegister) + Binary |= 0x7 << 4; + else + Binary |= 0x3 << 5; + break; + case ARM_AM::rrx: + Binary |= 0x3 << 5; break; } - // Data processing operand instructions has 3 possible encodings (for more - // information, see ARM-ARM page A3-10): - // 1. , - // 2. , - // 3. ,, - bool IsDataProcessing1 = Format == ARMII::DPRdIm || - Format == ARMII::DPRdReg || - Format == ARMII::DPRdSoReg; - bool IsDataProcessing2 = Format == ARMII::DPRnIm || - Format == ARMII::DPRnReg || - Format == ARMII::DPRnSoReg; - bool IsDataProcessing3 = false; - - // set bit S(20) - if (Format == ARMII::DPRImS || Format == ARMII::DPRRegS || - Format == ARMII::DPRSoRegS || IsDataProcessing2) { - Value |= 1 << ARMII::S_BitShift; - IsDataProcessing3 = !IsDataProcessing2; + // Set the field related to shift operations (except rrx). + if (ARM_AM::getSORegShOp(MO2.getImm()) != ARM_AM::rrx) { + if (IsShiftByRegister) { + // Set the value of bit[11:8] (register Rs). + assert(ARM_AM::getSORegOffset(MO2.getImm()) == 0); + Binary |= (ARMRegisterInfo::getRegisterNumbering(MO1.getReg()) << + ARMII::RegRsShift); + } else + // Set the value of bit [11:7] (shift_immed field). + Binary |= ARM_AM::getSORegOffset(MO2.getImm()) << 7; } + break; + } + } - IsDataProcessing3 = Format == ARMII::DPRIm || - Format == ARMII::DPRReg || - Format == ARMII::DPRSoReg || - IsDataProcessing3; - - // set first operand - op = getMachineOpValue(MI,0); - if (IsDataProcessing1 || IsDataProcessing3) { - Value |= op << ARMII::RegRdShift; - } else if (IsDataProcessing2) { - Value |= op << ARMII::RegRnShift; - } + return Binary; +} - // set second operand of data processing #3 instructions - if (IsDataProcessing3) { - op = getMachineOpValue(MI,1); - Value |= op << ARMII::RegRnShift; - } +unsigned ARMCodeEmitter::getAddrMode2InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary) { + // Set first operand + Binary |= getMachineOpValue(MI, 0) << ARMII::RegRdShift; + + // Set second operand + Binary |= getMachineOpValue(MI, 1) << ARMII::RegRnShift; + + const MachineOperand &MO2 = MI.getOperand(2); + const MachineOperand &MO3 = MI.getOperand(3); + + // Set bit U(23) according to signal of immed value (positive or negative). + Binary |= ((ARM_AM::getAM2Op(MO3.getImm()) == ARM_AM::add ? 1 : 0) << + ARMII::U_BitShift); + if (!MO2.getReg()) { // is immediate + if (ARM_AM::getAM2Offset(MO3.getImm())) + // Set the value of offset_12 field + Binary |= ARM_AM::getAM2Offset(MO3.getImm()); + return Binary; + } - unsigned OperandIndex = IsDataProcessing3 ? 2 : 1; - switch (Format) { - case ARMII::DPRdIm: case ARMII::DPRnIm: - case ARMII::DPRIm: case ARMII::DPRImS: { - // set bit I(25) to identify this is the immediate form of - Value |= 1 << ARMII::I_BitShift; - // set immed_8 field - const MachineOperand &MO = MI.getOperand(OperandIndex); - op = ARM_AM::getSOImmVal(MO.getImm()); - Value |= op; + // Set bit I(25), because this is not in immediate enconding. + Binary |= 1 << ARMII::I_BitShift; + assert(TargetRegisterInfo::isPhysicalRegister(MO2.getReg())); + // Set bit[3:0] to the corresponding Rm register + Binary |= ARMRegisterInfo::getRegisterNumbering(MO2.getReg()); + + // if this instr is in scaled register offset/index instruction, set + // shift_immed(bit[11:7]) and shift(bit[6:5]) fields. + if (unsigned ShImm = ARM_AM::getAM2Offset(MO3.getImm())) { + Binary |= getShiftOp(MO3) << 5; // shift + Binary |= ShImm << 7; // shift_immed + } - break; - } - case ARMII::DPRdReg: case ARMII::DPRnReg: - case ARMII::DPRReg: case ARMII::DPRRegS: { - // set last operand (register Rm) - op = getMachineOpValue(MI,OperandIndex); - Value |= op; + return Binary; +} - break; - } - case ARMII::DPRdSoReg: case ARMII::DPRnSoReg: - case ARMII::DPRSoReg: case ARMII::DPRSoRegS: { - // set last operand (register Rm) - op = getMachineOpValue(MI,OperandIndex); - Value |= op; - - const MachineOperand &MO1 = MI.getOperand(OperandIndex + 1); - const MachineOperand &MO2 = MI.getOperand(OperandIndex + 2); - // identify it the instr is in immed or register shifts encoding - bool IsShiftByRegister = MO1.getReg() > 0; - // set shift operand (bit[6:4]). - // ASR - 101 if it is in register shifts encoding; 100, otherwise. - // LSL - 001 if it is in register shifts encoding; 000, otherwise. - // LSR - 011 if it is in register shifts encoding; 010, otherwise. - // ROR - 111 if it is in register shifts encoding; 110, otherwise. - // RRX - 110 and bit[11:7] clear. - switch(ARM_AM::getSORegShOp(MO2.getImm())) { - default: assert(0 && "Unknown shift opc!"); - case ARM_AM::asr: { - if(IsShiftByRegister) - Value |= 0x5 << 4; - else - Value |= 0x1 << 6; - break; - } - case ARM_AM::lsl: { - if(IsShiftByRegister) - Value |= 0x1 << 4; - break; - } - case ARM_AM::lsr: { - if(IsShiftByRegister) - Value |= 0x3 << 4; - else - Value |= 0x1 << 5; - break; - } - case ARM_AM::ror: { - if(IsShiftByRegister) - Value |= 0x7 << 4; - else - Value |= 0x3 << 5; - break; - } - case ARM_AM::rrx: { - Value |= 0x3 << 5; - break; - } - } - // set the field related to shift operations (except rrx). - if (ARM_AM::getSORegShOp(MO2.getImm()) != ARM_AM::rrx) { - if (IsShiftByRegister) { - // set the value of bit[11:8] (register Rs). - assert(TargetRegisterInfo::isPhysicalRegister(MO1.getReg())); - op = ARMRegisterInfo::getRegisterNumbering(MO1.getReg()); - assert(ARM_AM::getSORegOffset(MO2.getImm()) == 0); - Value |= op << ARMII::RegRsShift; - } else { - // set the value of bit [11:7] (shift_immed field). - op = ARM_AM::getSORegOffset(MO2.getImm()); - Value |= op << 7; - } - } - break; - } - default: assert(false && "Unknown operand type!"); - break; - } +unsigned ARMCodeEmitter::getAddrMode3InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary) { + // Set first operand + Binary |= getMachineOpValue(MI, 0) << ARMII::RegRdShift; + + // Set second operand + Binary |= getMachineOpValue(MI, 1) << ARMII::RegRnShift; + + const MachineOperand &MO2 = MI.getOperand(2); + const MachineOperand &MO3 = MI.getOperand(3); + + // Set bit U(23) according to signal of immed value (positive or negative) + Binary |= ((ARM_AM::getAM2Op(MO3.getImm()) == ARM_AM::add ? 1 : 0) << + ARMII::U_BitShift); + + // If this instr is in register offset/index encoding, set bit[3:0] + // to the corresponding Rm register. + if (MO2.getReg()) { + Binary |= ARMRegisterInfo::getRegisterNumbering(MO2.getReg()); + return Binary; + } - break; + // if this instr is in immediate offset/index encoding, set bit 22 to 1 + if (unsigned ImmOffs = ARM_AM::getAM3Offset(MO3.getImm())) { + Binary |= 1 << 22; + // Set operands + Binary |= (ImmOffs >> 4) << 8; // immedH + Binary |= (ImmOffs & ~0xF); // immedL } - case ARMII::AddrMode2: { - // bit 26 is always 1 - Value |= 1 << 26; - - unsigned Index = Desc.TSFlags & ARMII::IndexModeMask; - // if the instruction uses offset addressing or pre-indexed addressing, - // set bit P(24) to 1 - if (Index == ARMII::IndexModePre || Index == 0) - Value |= 1 << ARMII::IndexShift; - // if the instruction uses post-indexed addressing, set bit W(21) to 1 - if (Index == ARMII::IndexModePre) - Value |= 1 << 21; - - unsigned Format = Desc.TSFlags & ARMII::FormMask; - // If it is a load instruction (except LDRD), set bit L(20) to 1 - if (Format == ARMII::LdFrm) - Value |= 1 << ARMII::L_BitShift; - - // set bit B(22) - unsigned BitByte = getBaseOpcodeFor(Desc); - Value |= BitByte << 22; - - // set first operand - op = getMachineOpValue(MI,0); - Value |= op << ARMII::RegRdShift; - - // set second operand - op = getMachineOpValue(MI,1); - Value |= op << ARMII::RegRnShift; - - const MachineOperand &MO2 = MI.getOperand(2); - const MachineOperand &MO3 = MI.getOperand(3); - - // set bit U(23) according to signal of immed value (positive or negative) - Value |= (ARM_AM::getAM2Op(MO3.getImm()) == ARM_AM::add ? 1 : 0) << - ARMII::U_BitShift; - if (!MO2.getReg()) { // is immediate - if (ARM_AM::getAM2Offset(MO3.getImm())) - // set the value of offset_12 field - Value |= ARM_AM::getAM2Offset(MO3.getImm()); - break; - } - // set bit I(25), because this is not in immediate enconding. - Value |= 1 << ARMII::I_BitShift; - assert(TargetRegisterInfo::isPhysicalRegister(MO2.getReg())); - // set bit[3:0] to the corresponding Rm register - Value |= ARMRegisterInfo::getRegisterNumbering(MO2.getReg()); - - // if this instr is in scaled register offset/index instruction, set - // shift_immed(bit[11:7]) and shift(bit[6:5]) fields. - if (unsigned ShImm = ARM_AM::getAM2Offset(MO3.getImm())) { - unsigned ShiftOp = getShiftOp(MO3); - Value |= ShiftOp << 5; // shift - Value |= ShImm << 7; // shift_immed - } + return Binary; +} - break; +unsigned ARMCodeEmitter::getAddrMode4InstrBinary(const MachineInstr &MI, + const TargetInstrDesc &Desc, + unsigned Binary) { + // Set first operand + Binary |= getMachineOpValue(MI, 0) << ARMII::RegRnShift; + + // Set addressing mode by modifying bits U(23) and P(24) + // IA - Increment after - bit U = 1 and bit P = 0 + // IB - Increment before - bit U = 1 and bit P = 1 + // DA - Decrement after - bit U = 0 and bit P = 0 + // DB - Decrement before - bit U = 0 and bit P = 1 + const MachineOperand &MO = MI.getOperand(1); + ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MO.getImm()); + switch (Mode) { + default: assert(0 && "Unknown addressing sub-mode!"); + case ARM_AM::da: break; + case ARM_AM::db: Binary |= 0x1 << 24; break; + case ARM_AM::ia: Binary |= 0x1 << 23; break; + case ARM_AM::ib: Binary |= 0x3 << 23; break; } - case ARMII::AddrMode3: { - unsigned Index = Desc.TSFlags & ARMII::IndexModeMask; - // if the instruction uses offset addressing or pre-indexed addressing, - // set bit P(24) to 1 - if (Index == ARMII::IndexModePre || Index == 0) - Value |= 1 << ARMII::IndexShift; - - unsigned Format = Desc.TSFlags & ARMII::FormMask; - // If it is a load instruction (except LDRD), set bit L(20) to 1 - if (Format == ARMII::LdFrm && opcode != ARM::LDRD) - Value |= 1 << ARMII::L_BitShift; - - // bit[7:4] is the opcode of this instruction class (bits S and H). - unsigned char BaseOpcode = getBaseOpcodeFor(Desc); - Value |= BaseOpcode << 4; - - // set first operand - op = getMachineOpValue(MI,0); - Value |= op << ARMII::RegRdShift; - - // set second operand - op = getMachineOpValue(MI,1); - Value |= op << ARMII::RegRnShift; - - const MachineOperand &MO2 = MI.getOperand(2); - const MachineOperand &MO3 = MI.getOperand(3); - - // set bit U(23) according to signal of immed value (positive or negative) - Value |= (ARM_AM::getAM2Op(MO3.getImm()) == ARM_AM::add ? 1 : 0) << - ARMII::U_BitShift; - - // if this instr is in register offset/index encoding, set bit[3:0] - // to the corresponding Rm register. - if (MO2.getReg()) { - Value |= ARMRegisterInfo::getRegisterNumbering(MO2.getReg()); - break; - } - - // if this instr is in immediate offset/index encoding, set bit 22 to 1 - if (unsigned ImmOffs = ARM_AM::getAM3Offset(MO3.getImm())) { - Value |= 1 << 22; - // set operands - Value |= (ImmOffs >> 4) << 8; // immedH - Value |= (ImmOffs & ~0xF); // immedL - } - break; + // Set bit W(21) + if (ARM_AM::getAM4WBFlag(MO.getImm())) + Binary |= 0x1 << 21; + + // Set registers + for (unsigned i = 4, e = MI.getNumOperands(); i != e; ++i) { + const MachineOperand &MO = MI.getOperand(i); + if (MO.isRegister() && MO.isImplicit()) + continue; + unsigned RegNum = ARMRegisterInfo::getRegisterNumbering(MO.getReg()); + assert(TargetRegisterInfo::isPhysicalRegister(MO.getReg()) && + RegNum < 16); + Binary |= 0x1 << RegNum; } - case ARMII::AddrMode4: { - // bit 27 is always 1 - Value |= 1 << 27; - - unsigned Format = Desc.TSFlags & ARMII::FormMask; - // if it is a load instr, set bit L(20) to 1 - if (Format == ARMII::LdFrm) - Value |= 1 << ARMII::L_BitShift; - - unsigned OpIndex = 0; - - // set first operand - op = getMachineOpValue(MI,OpIndex); - Value |= op << ARMII::RegRnShift; - - // set addressing mode by modifying bits U(23) and P(24) - // IA - Increment after - bit U = 1 and bit P = 0 - // IB - Increment before - bit U = 1 and bit P = 1 - // DA - Decrement after - bit U = 0 and bit P = 0 - // DB - Decrement before - bit U = 0 and bit P = 1 - const MachineOperand &MO = MI.getOperand(OpIndex + 1); - ARM_AM::AMSubMode Mode = ARM_AM::getAM4SubMode(MO.getImm()); - switch(Mode) { - default: assert(0 && "Unknown addressing sub-mode!"); - case ARM_AM::ia: Value |= 0x1 << 23; break; - case ARM_AM::ib: Value |= 0x3 << 23; break; - case ARM_AM::da: break; - case ARM_AM::db: Value |= 0x1 << 24; break; - } - // set bit W(21) - if (ARM_AM::getAM4WBFlag(MO.getImm())) - Value |= 0x1 << 21; - - // set registers - for (unsigned i = OpIndex + 4, e = MI.getNumOperands(); i != e; ++i) { - const MachineOperand &MOR = MI.getOperand(i); - unsigned RegNumber = ARMRegisterInfo::getRegisterNumbering(MOR.getReg()); - assert(TargetRegisterInfo::isPhysicalRegister(MOR.getReg()) && - RegNumber < 16); - Value |= 0x1 << RegNumber; - } + return Binary; +} - break; - } +/// getInstrBinary - Return binary encoding for the specified +/// machine instruction. +unsigned ARMCodeEmitter::getInstrBinary(const MachineInstr &MI) { + // Part of binary is determined by TableGn. + unsigned Binary = getBinaryCodeForInstr(MI); + + const TargetInstrDesc &Desc = MI.getDesc(); + switch (Desc.TSFlags & ARMII::AddrModeMask) { + case ARMII::AddrModeNone: + return getAddrModeNoneInstrBinary(MI, Desc, Binary); + case ARMII::AddrMode1: + return getAddrMode1InstrBinary(MI, Desc, Binary); + case ARMII::AddrMode2: + return getAddrMode2InstrBinary(MI, Desc, Binary); + case ARMII::AddrMode3: + return getAddrMode3InstrBinary(MI, Desc, Binary); + case ARMII::AddrMode4: + return getAddrMode4InstrBinary(MI, Desc, Binary); } - return Value; + abort(); + return 0; } + +#include "ARMGenCodeEmitter.inc" From evan.cheng at apple.com Tue Sep 2 02:49:04 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 02 Sep 2008 07:49:04 -0000 Subject: [llvm-commits] [llvm] r55625 - /llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Message-ID: <200809020749.m827n42P012813@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 2 02:49:03 2008 New Revision: 55625 URL: http://llvm.org/viewvc/llvm-project?rev=55625&view=rev Log: Add Mac OS X compatible JIT callback routine. Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?rev=55625&r1=55624&r2=55625&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Tue Sep 2 02:49:03 2008 @@ -29,6 +29,14 @@ /// compile a function lazily. static TargetJITInfo::JITCompilerFn JITCompilerFunction; +// Get the ASMPREFIX for the current host. This is often '_'. +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ +#endif +#define GETASMPREFIX2(X) #X +#define GETASMPREFIX(X) GETASMPREFIX2(X) +#define ASMPREFIX GETASMPREFIX(__USER_LABEL_PREFIX__) + // CompilationCallback stub - We can't use a C function with inline assembly in // it, because we the prolog/epilog inserted by GCC won't work for us. Instead, // write our own wrapper, which does things our way, so we have complete control @@ -39,21 +47,37 @@ asm( ".text\n" ".align 2\n" - ".globl ARMCompilationCallback\n" - "ARMCompilationCallback:\n" + ".globl " ASMPREFIX "ARMCompilationCallback\n" + ASMPREFIX "ARMCompilationCallback:\n" // save main registers +#if defined(__APPLE__) + "stmfd sp!, {r4, r5, r6, r7, lr}\n" + "mov r0, r7\n" // stub's frame + "stmfd sp!, {r8, r10, r11}\n" +#else "mov ip, sp\n" "stmfd sp!, {fp, ip, lr, pc}\n" "sub fp, ip, #4\n" +#endif // __APPLE__ // arguments to Compilation Callback // r0 - our lr (address of the call instruction in stub plus 4) // r1 - stub's lr (address of instruction that called the stub plus 4) +#if defined(__APPLE__) + "mov r0, r7\n" // stub's frame +#else "mov r0, fp\n" // stub's frame +#endif // __APPLE__ "mov r1, lr\n" // stub's lr - "bl ARMCompilationCallbackC\n" + "bl " ASMPREFIX "ARMCompilationCallbackC\n" // restore main registers - "ldmfd sp, {fp, sp, pc}\n"); -#else // Not an ARM host +#if defined(__APPLE__) + "ldmfd sp!, {r8, r10, r11}\n" + "ldmfd sp!, {r4, r5, r6, r7, pc}\n" +#else + "ldmfd sp, {fp, sp, pc}\n" +#endif // __APPLE__ + ); +#else // Not an ARM host void ARMCompilationCallback() { assert(0 && "Cannot call ARMCompilationCallback() on a non-ARM arch!\n"); abort(); From evan.cheng at apple.com Tue Sep 2 03:14:01 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 02 Sep 2008 08:14:01 -0000 Subject: [llvm-commits] [llvm] r55626 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <200809020814.m828E1UG022472@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 2 03:14:01 2008 New Revision: 55626 URL: http://llvm.org/viewvc/llvm-project?rev=55626&view=rev Log: MMI may be null. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=55626&r1=55625&r2=55626&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Tue Sep 2 03:14:01 2008 @@ -965,7 +965,9 @@ TheJIT->RegisterTable(FrameRegister); } - MMI->EndFunction(); + + if (MMI) + MMI->EndFunction(); return false; } From m.kooijman at student.utwente.nl Tue Sep 2 04:44:41 2008 From: m.kooijman at student.utwente.nl (Matthijs Kooijman) Date: Tue, 2 Sep 2008 11:44:41 +0200 Subject: [llvm-commits] [llvm] r55557 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 configure In-Reply-To: <200808300116.m7U1GKHE014061@zion.cs.uiuc.edu> References: <200808300116.m7U1GKHE014061@zion.cs.uiuc.edu> Message-ID: <20080902094441.GA32157@katherina.student.utwente.nl> Hi Daniel, > Enable -fvisibility-inlines-hidden by default for compilers which > support it. This change is causing massive linking failures at least on 32bit linux. I'm not sure what is causing this exactly, but disabling -fvisibility-inlines-hidden again fixes the build. A quick check seems to suggest it does work properly on 64bit linux. I'm reverting this patch for now. If you need me to test other patches, feel free to send them over (though I'm only in office for one or two days per week...) The errors I'm seeing are like the following (but then over a hundred pages of them). These errors are generated when linking tablegen, I'm not sure if the problems are limited to that, or will also occure when linking the tools. g++ -I/home/kooijman/src/llvm-trunk/include -I/home/kooijman/src/llvm-trunk/utils/TableGen -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -g -fvisibility-inlines-hidden -Woverloaded-virtual -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -g -o /home/kooijman/src/llvm-trunk/Debug/bin/tblgen /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/AsmWriterEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/CallingConvEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/CodeEmitterGen.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/CodeGenDAGPatterns.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/CodeGenInstruction.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/CodeGenTarget.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/DAGISelEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/FastISelEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/InstrEnumEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/InstrInfoEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/IntrinsicEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/LLVMCConfigurationEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/Record.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/RegisterInfoEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/SubtargetEmitter.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/TGLexer.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/TGParser.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/TableGen.o /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/TableGenBackend.o -Wl,--export-dynamic -L/home/kooijman/src/llvm-trunk/Debug/lib -lLLVMSupport -lLLVMSystem -lpthread -ldl -lm -Wl,--rpath -Wl,/home/kooijman/src/llvm-trunk/Debug/bin /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/AsmWriterEmitter.o: In function `llvm::utostr_32(unsigned int, bool)': /home/kooijman/src/llvm-trunk/include/llvm/ADT/StringExtras.h:58: undefined reference to `std::allocator::allocator()' /home/kooijman/src/llvm-trunk/include/llvm/ADT/StringExtras.h:58: undefined reference to `std::allocator::~allocator()' /home/kooijman/src/llvm-trunk/include/llvm/ADT/StringExtras.h:58: undefined reference to `std::allocator::~allocator()' /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/AsmWriterEmitter.o: In function `llvm::utostr(unsigned long long, bool)': /home/kooijman/src/llvm-trunk/include/llvm/ADT/StringExtras.h:77: undefined reference to `std::allocator::allocator()' /home/kooijman/src/llvm-trunk/include/llvm/ADT/StringExtras.h:77: undefined reference to `std::allocator::~allocator()' /home/kooijman/src/llvm-trunk/include/llvm/ADT/StringExtras.h:77: undefined reference to `std::allocator::~allocator()' /home/kooijman/src/llvm-trunk/utils/TableGen/Debug/AsmWriterEmitter.o: In function `AsmWriterInst': /home/kooijman/src/llvm-trunk/utils/TableGen/AsmWriterEmitter.cpp:125: undefined reference to `std::basic_string, std::allocator >::find_first_of(char const*, unsigned int) const' /home/kooijman/src/llvm-trunk/utils/TableGen/AsmWriterEmitter.cpp:126: undefined reference to `std::basic_string, std::allocator >::size() const' Gr. Matthijs From matthijs at stdin.nl Tue Sep 2 04:51:00 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 02 Sep 2008 09:51:00 -0000 Subject: [llvm-commits] [llvm] r55628 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 Message-ID: <200809020951.m829p06Q026424@zion.cs.uiuc.edu> Author: matthijs Date: Tue Sep 2 04:51:00 2008 New Revision: 55628 URL: http://llvm.org/viewvc/llvm-project?rev=55628&view=rev Log: Revert r55557, it is causing linking failures on 32bit linux. Removed: llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 Modified: llvm/trunk/Makefile.config.in llvm/trunk/Makefile.rules llvm/trunk/autoconf/configure.ac Modified: llvm/trunk/Makefile.config.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=55628&r1=55627&r2=55628&view=diff ============================================================================== --- llvm/trunk/Makefile.config.in (original) +++ llvm/trunk/Makefile.config.in Tue Sep 2 04:51:00 2008 @@ -234,9 +234,6 @@ # Do we want to build with position independent code? ENABLE_PIC := @ENABLE_PIC@ -# Use -fvisibility-inlines-hidden? -ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@ - # This option tells the Makefiles to produce verbose output. # It essentially prints the commands that make is executing #VERBOSE = 1 Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=55628&r1=55627&r2=55628&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Sep 2 04:51:00 2008 @@ -241,10 +241,6 @@ endif endif -ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1) - CXX.Flags += -fvisibility-inlines-hidden -endif - # IF REQUIRES_EH=1 is specified then don't disable exceptions ifndef REQUIRES_EH CXX.Flags += -fno-exceptions Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=55628&r1=55627&r2=55628&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Tue Sep 2 04:51:00 2008 @@ -975,8 +975,6 @@ AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.]) fi -dnl Determine if the compiler supports -fvisibility-inlines-hidden. -AC_CXX_USE_VISIBILITY_INLINES_HIDDEN dnl===-----------------------------------------------------------------------=== dnl=== Removed: llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4?rev=55627&view=auto ============================================================================== --- llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 (original) +++ llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 (removed) @@ -1,22 +0,0 @@ -# -# Determine if the compiler accepts -fvisibility-inlines-hidden -# -# This macro is specific to LLVM. -# -AC_DEFUN([AC_CXX_USE_VISIBILITY_INLINES_HIDDEN], -[AC_CACHE_CHECK([for compiler -fvisibility-inlines-hidden option], - [llvm_cv_cxx_visibility_inlines_hidden], -[ AC_LANG_PUSH([C++]) - oldcxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], - [llvm_cv_cxx_visibility_inlines_hidden=yes],[llvm_cv_cxx_visibility_inlines_hidden=no]) - CXXFLAGS="$oldcxxflags" - AC_LANG_POP([C++]) -]) -if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then - AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[1]) -else - AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[0]) -fi -]) From m.kooijman at student.utwente.nl Tue Sep 2 07:55:09 2008 From: m.kooijman at student.utwente.nl (Matthijs Kooijman) Date: Tue, 2 Sep 2008 14:55:09 +0200 Subject: [llvm-commits] [llvm] r55557 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 configure In-Reply-To: <20080902094441.GA32157@katherina.student.utwente.nl> References: <200808300116.m7U1GKHE014061@zion.cs.uiuc.edu> <20080902094441.GA32157@katherina.student.utwente.nl> Message-ID: <20080902125509.GD32157@katherina.student.utwente.nl> Hi Daniel, some extra data. I managed to reproduce this on another system as well, turns out that the problem lies with gcc 4.1. I tried all of 4.1, 4.2 and 4.3 on the same system, 4.2 and 4.3 did not show these errors. This was again on 32 bit linux (that is, a 32bit chroot running on a 64bit kernel). I haven't tried 4.1 on 64bit yet, so not sure if this is specific to 32bit. Gr. Matthijs From baldrick at free.fr Tue Sep 2 09:23:42 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 02 Sep 2008 14:23:42 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55633 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Message-ID: <200809021423.m82ENggV003122@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 2 09:23:41 2008 New Revision: 55633 URL: http://llvm.org/viewvc/llvm-project?rev=55633&view=rev Log: Sanity check that gcc's notion of endianness coincides with ours. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=55633&r1=55632&r2=55633&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Sep 2 09:23:41 2008 @@ -209,6 +209,8 @@ FeatureStr = Features.getString(); #endif TheTarget = TME->CtorFn(*TheModule, FeatureStr); + assert(TheTarget->getTargetData()->isBigEndian() == BYTES_BIG_ENDIAN); + TheFolder = new TargetFolder(*TheTarget->getTargetData()); // Install information about target datalayout stuff into the module for From baldrick at free.fr Tue Sep 2 09:30:10 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 02 Sep 2008 14:30:10 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55634 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200809021430.m82EUAI3003369@zion.cs.uiuc.edu> Author: baldrick Date: Tue Sep 2 09:30:10 2008 New Revision: 55634 URL: http://llvm.org/viewvc/llvm-project?rev=55634&view=rev Log: Fix PR2724. Experiments with gcc show that BITS_BIG_ENDIAN is unrelated to how bitfields are represents in memory: it's BYTES_BIG_ENDIAN (the endianness of the machine) that matters. So use BYTES_BIG_ENDIAN everywhere. This showed up on MIPS which has BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=55634&r1=55633&r2=55634&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Sep 2 09:30:10 2008 @@ -2270,9 +2270,7 @@ unsigned BitsInVal = ThisLastBitPlusOne - ThisFirstBit; unsigned FirstBitInVal = ThisFirstBit % ValSizeInBits; - // If this target has bitfields laid out in big-endian order, invert the - // bit in the word if needed. - if (BITS_BIG_ENDIAN) + if (BYTES_BIG_ENDIAN) FirstBitInVal = ValSizeInBits-FirstBitInVal-BitsInVal; // Mask the bits out by shifting left first, then shifting right. The @@ -2948,9 +2946,7 @@ unsigned BitsInVal = ThisLastBitPlusOne - ThisFirstBit; unsigned FirstBitInVal = ThisFirstBit % ValSizeInBits; - // If this target has bitfields laid out in big-endian order, invert the bit - // in the word if needed. - if (BITS_BIG_ENDIAN) + if (BYTES_BIG_ENDIAN) FirstBitInVal = ValSizeInBits-FirstBitInVal-BitsInVal; // If not storing into the zero'th bit, shift the Src value to the left. @@ -6414,7 +6410,7 @@ // Compute the value to insert, and the mask to use. uint64_t FieldMask; - if (BITS_BIG_ENDIAN) { + if (BYTES_BIG_ENDIAN) { FieldMask = ~0ULL >> (64-NumBitsToInsert); FieldMask <<= FieldBitSize-(OffsetToBitFieldStart+NumBitsToInsert); ValToInsert <<= FieldBitSize-(OffsetToBitFieldStart+NumBitsToInsert); @@ -6463,7 +6459,7 @@ NumBitsToInsert); uint64_t EltValToInsert; - if (BITS_BIG_ENDIAN) { + if (BYTES_BIG_ENDIAN) { // If this is a big-endian bit-field, take the top NumBitsToInsert // bits from the bitfield value. EltValToInsert = ValToInsert >> (NumBitsToInsert-NumEltBitsToInsert); @@ -6562,7 +6558,7 @@ // Compute the NumBitsToInsert-wide value that we are going to insert // into this field as an ulong integer constant value. uint64_t ValToInsert; - if (BITS_BIG_ENDIAN) { + if (BYTES_BIG_ENDIAN) { // If this is a big-endian bit-field, take the top NumBitsToInsert // bits from the bitfield value. ValToInsert = BitfieldVal >> (BitfieldSize-NumBitsToInsert); @@ -6607,13 +6603,13 @@ uint64_t Val = CI->getZExtValue(); for (unsigned i = 0, e = ATy->getNumElements(); i != e; ++i) { unsigned char EltVal; - - if (TD.isLittleEndian()) { - EltVal = (Val >> 8*i) & 0xFF; - } else { + + if (BYTES_BIG_ENDIAN) { EltVal = (Val >> 8*(e-i-1)) & 0xFF; + } else { + EltVal = (Val >> 8*i) & 0xFF; } - + ArrayElts.push_back(ConstantInt::get(Type::Int8Ty, EltVal)); } From nunoplopes at sapo.pt Tue Sep 2 06:30:12 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 02 Sep 2008 11:30:12 -0000 Subject: [llvm-commits] [llvm] r55631 - /llvm/trunk/lib/VMCore/Verifier.cpp Message-ID: <200809021130.m82BUDZD029620@zion.cs.uiuc.edu> Author: nlopes Date: Tue Sep 2 06:30:10 2008 New Revision: 55631 URL: http://llvm.org/viewvc/llvm-project?rev=55631&view=rev Log: plug a little memleak in verifyFunction() # first commit to llvm, so whatch out :) Modified: llvm/trunk/lib/VMCore/Verifier.cpp Modified: llvm/trunk/lib/VMCore/Verifier.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=55631&r1=55630&r2=55631&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Verifier.cpp (original) +++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Sep 2 06:30:10 2008 @@ -1512,10 +1512,12 @@ Function &F = const_cast(f); assert(!F.isDeclaration() && "Cannot verify external functions"); - FunctionPassManager FPM(new ExistingModuleProvider(F.getParent())); + ExistingModuleProvider MP(F.getParent()); + FunctionPassManager FPM(&MP); Verifier *V = new Verifier(action); FPM.add(V); FPM.run(F); + MP.releaseModule(); return V->Broken; } From nunoplopes at sapo.pt Tue Sep 2 07:06:09 2008 From: nunoplopes at sapo.pt (Nuno Lopes) Date: Tue, 02 Sep 2008 12:06:09 -0000 Subject: [llvm-commits] [llvm] r55632 - /llvm/trunk/include/llvm/Support/raw_ostream.h Message-ID: <200809021206.m82C69Yx030989@zion.cs.uiuc.edu> Author: nlopes Date: Tue Sep 2 07:06:08 2008 New Revision: 55632 URL: http://llvm.org/viewvc/llvm-project?rev=55632&view=rev Log: plug memleak: destroy internal buffer Modified: llvm/trunk/include/llvm/Support/raw_ostream.h Modified: llvm/trunk/include/llvm/Support/raw_ostream.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=55632&r1=55631&r2=55632&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/raw_ostream.h (original) +++ llvm/trunk/include/llvm/Support/raw_ostream.h Tue Sep 2 07:06:08 2008 @@ -37,7 +37,10 @@ // Start out ready to flush. OutBufStart = OutBufEnd = OutBufCur = 0; } - virtual ~raw_ostream() {} + + virtual ~raw_ostream() { + delete [] OutBufStart; + } //===--------------------------------------------------------------------===// // Configuration Interface From dalej at apple.com Tue Sep 2 11:54:14 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 2 Sep 2008 09:54:14 -0700 Subject: [llvm-commits] [llvm] r55581 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp In-Reply-To: <200808310253.m7V2rKs1015732@zion.cs.uiuc.edu> References: <200808310253.m7V2rKs1015732@zion.cs.uiuc.edu> Message-ID: <1C190F51-C098-4531-94BD-BD07C85F4800@apple.com> On Aug 30, 2008, at 7:53 PMPDT, Bill Wendling wrote: > Author: void > Date: Sat Aug 30 21:53:19 2008 > New Revision: 55581 > > URL: http://llvm.org/viewvc/llvm-project?rev=55581&view=rev > Log: > Expand for ROTR with MVT::i64. > > Dale, Could you please review this? PPC has rotate instructions; these should be Legal. I'll look into it. > Modified: > llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp > > Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=55581&r1=55580&r2=55581&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Sat Aug 30 > 21:53:19 2008 > @@ -125,6 +125,7 @@ > > // PowerPC does not have ROTR > setOperationAction(ISD::ROTR, MVT::i32 , Expand); > + setOperationAction(ISD::ROTR, MVT::i64 , Expand); > > // PowerPC does not have Select > setOperationAction(ISD::SELECT, MVT::i32, Expand); > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From criswell at cs.uiuc.edu Tue Sep 2 12:03:10 2008 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue, 2 Sep 2008 12:03:10 -0500 Subject: [llvm-commits] CVS: CVSROOT/loginfo Message-ID: <200809021703.m82H3ACY004196@maute.cs.uiuc.edu> Changes in directory CVSROOT: loginfo updated: 1.37 -> 1.38 --- Log message: Added Haohui to the list of people to email on SAFECode commits. --- Diffs of the changes: (+1 -1) Index: CVSROOT/loginfo diff -u CVSROOT/loginfo:1.37 CVSROOT/loginfo:1.38 --- CVSROOT/loginfo:1.37 Fri Nov 3 12:36:45 2006 +++ CVSROOT/loginfo Tue Sep 2 12:03:00 2008 @@ -30,7 +30,7 @@ #^llvm/www ( /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/update-www.sh &); /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu #^llvm /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu #^reopt /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu -^safecode /home/vadve/shared/InternalCVS/CVSROOT/commit-diffs.pl %{sVv} criswell at uiuc.edu +^safecode /home/vadve/shared/InternalCVS/CVSROOT/commit-diffs.pl %{sVv} criswell at uiuc.edu haohui.mai at gmail.com ^poolalloc /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu ^gcc-3.4 /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu ^CVSROOT /home/vadve/vadve/Research/DynOpt/CVSRepository/CVSROOT/commit-diffs.pl %{sVv} llvm-commits at cs.uiuc.edu From daniel at zuster.org Tue Sep 2 12:12:37 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 2 Sep 2008 10:12:37 -0700 Subject: [llvm-commits] [llvm] r55557 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 configure In-Reply-To: <20080902125509.GD32157@katherina.student.utwente.nl> References: <200808300116.m7U1GKHE014061@zion.cs.uiuc.edu> <20080902094441.GA32157@katherina.student.utwente.nl> <20080902125509.GD32157@katherina.student.utwente.nl> Message-ID: <6a8523d60809021012u3ec52bfdu174f9948003417b0@mail.gmail.com> Hi Matthijs, This is unfortunate. I tested it on a 32-bit linux system with gcc 4.1.2 (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) and it seemed to work fine. Can we narrow the issue down further? If this works out to be a compiler bug, I'm not sure of the correct fix. Should we try and detect that -fvisibility-inlines-hidden is accepted but broken, or just add it to the list of gcc versions LLVM doesn't compile with? - Daniel On Tue, Sep 2, 2008 at 5:55 AM, Matthijs Kooijman < m.kooijman at student.utwente.nl> wrote: > Hi Daniel, > > some extra data. I managed to reproduce this on another system as well, > turns > out that the problem lies with gcc 4.1. I tried all of 4.1, 4.2 and 4.3 on > the > same system, 4.2 and 4.3 did not show these errors. This was again on 32 > bit > linux (that is, a 32bit chroot running on a 64bit kernel). > > I haven't tried 4.1 on 64bit yet, so not sure if this is specific to 32bit. > > Gr. > > Matthijs > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080902/c1d2290f/attachment.html From daniel at zuster.org Tue Sep 2 12:35:20 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 02 Sep 2008 17:35:20 -0000 Subject: [llvm-commits] [llvm] r55636 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 Message-ID: <200809021735.m82HZKR2011594@zion.cs.uiuc.edu> Author: ddunbar Date: Tue Sep 2 12:35:16 2008 New Revision: 55636 URL: http://llvm.org/viewvc/llvm-project?rev=55636&view=rev Log: Reapply majority of r55557 but with the changes to compilation flags disabled until issues with gcc 4.1 on linux 32-bit are resolved. Added: llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 - copied unchanged from r55627, llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 Modified: llvm/trunk/Makefile.config.in llvm/trunk/Makefile.rules llvm/trunk/autoconf/configure.ac Modified: llvm/trunk/Makefile.config.in URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=55636&r1=55635&r2=55636&view=diff ============================================================================== --- llvm/trunk/Makefile.config.in (original) +++ llvm/trunk/Makefile.config.in Tue Sep 2 12:35:16 2008 @@ -234,6 +234,9 @@ # Do we want to build with position independent code? ENABLE_PIC := @ENABLE_PIC@ +# Use -fvisibility-inlines-hidden? +ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@ + # This option tells the Makefiles to produce verbose output. # It essentially prints the commands that make is executing #VERBOSE = 1 Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=55636&r1=55635&r2=55636&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Tue Sep 2 12:35:16 2008 @@ -241,6 +241,10 @@ endif endif +#ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1) +# CXX.Flags += -fvisibility-inlines-hidden +#endif + # IF REQUIRES_EH=1 is specified then don't disable exceptions ifndef REQUIRES_EH CXX.Flags += -fno-exceptions Modified: llvm/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=55636&r1=55635&r2=55636&view=diff ============================================================================== --- llvm/trunk/autoconf/configure.ac (original) +++ llvm/trunk/autoconf/configure.ac Tue Sep 2 12:35:16 2008 @@ -975,6 +975,8 @@ AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.]) fi +dnl Determine if the compiler supports -fvisibility-inlines-hidden. +AC_CXX_USE_VISIBILITY_INLINES_HIDDEN dnl===-----------------------------------------------------------------------=== dnl=== From isanbard at gmail.com Tue Sep 2 12:36:05 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 2 Sep 2008 10:36:05 -0700 Subject: [llvm-commits] [llvm] r55628 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 In-Reply-To: <200809020951.m829p06Q026424@zion.cs.uiuc.edu> References: <200809020951.m829p06Q026424@zion.cs.uiuc.edu> Message-ID: <16e5fdf90809021036o40b59ed0s80a9b578b5ac1c83@mail.gmail.com> Make sure that you regenerate the configure file. -bw On Tue, Sep 2, 2008 at 2:51 AM, Matthijs Kooijman wrote: > Author: matthijs > Date: Tue Sep 2 04:51:00 2008 > New Revision: 55628 > > URL: http://llvm.org/viewvc/llvm-project?rev=55628&view=rev > Log: > Revert r55557, it is causing linking failures on 32bit linux. > > > Removed: > llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 > Modified: > llvm/trunk/Makefile.config.in > llvm/trunk/Makefile.rules > llvm/trunk/autoconf/configure.ac > > Modified: llvm/trunk/Makefile.config.in > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=55628&r1=55627&r2=55628&view=diff > > ============================================================================== > --- llvm/trunk/Makefile.config.in (original) > +++ llvm/trunk/Makefile.config.in Tue Sep 2 04:51:00 2008 > @@ -234,9 +234,6 @@ > # Do we want to build with position independent code? > ENABLE_PIC := @ENABLE_PIC@ > > -# Use -fvisibility-inlines-hidden? > -ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@ > - > # This option tells the Makefiles to produce verbose output. > # It essentially prints the commands that make is executing > #VERBOSE = 1 > > Modified: llvm/trunk/Makefile.rules > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=55628&r1=55627&r2=55628&view=diff > > ============================================================================== > --- llvm/trunk/Makefile.rules (original) > +++ llvm/trunk/Makefile.rules Tue Sep 2 04:51:00 2008 > @@ -241,10 +241,6 @@ > endif > endif > > -ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1) > - CXX.Flags += -fvisibility-inlines-hidden > -endif > - > # IF REQUIRES_EH=1 is specified then don't disable exceptions > ifndef REQUIRES_EH > CXX.Flags += -fno-exceptions > > Modified: llvm/trunk/autoconf/configure.ac > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=55628&r1=55627&r2=55628&view=diff > > ============================================================================== > --- llvm/trunk/autoconf/configure.ac (original) > +++ llvm/trunk/autoconf/configure.ac Tue Sep 2 04:51:00 2008 > @@ -975,8 +975,6 @@ > AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.]) > fi > > -dnl Determine if the compiler supports -fvisibility-inlines-hidden. > -AC_CXX_USE_VISIBILITY_INLINES_HIDDEN > > dnl===-----------------------------------------------------------------------=== > dnl=== > > Removed: llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4?rev=55627&view=auto > > ============================================================================== > --- llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 (original) > +++ llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 (removed) > @@ -1,22 +0,0 @@ > -# > -# Determine if the compiler accepts -fvisibility-inlines-hidden > -# > -# This macro is specific to LLVM. > -# > -AC_DEFUN([AC_CXX_USE_VISIBILITY_INLINES_HIDDEN], > -[AC_CACHE_CHECK([for compiler -fvisibility-inlines-hidden option], > - [llvm_cv_cxx_visibility_inlines_hidden], > -[ AC_LANG_PUSH([C++]) > - oldcxxflags="$CXXFLAGS" > - CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" > - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], > - [llvm_cv_cxx_visibility_inlines_hidden=yes],[llvm_cv_cxx_visibility_inlines_hidden=no]) > - CXXFLAGS="$oldcxxflags" > - AC_LANG_POP([C++]) > -]) > -if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then > - AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[1]) > -else > - AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[0]) > -fi > -]) > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From isanbard at gmail.com Tue Sep 2 12:45:43 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 2 Sep 2008 10:45:43 -0700 Subject: [llvm-commits] [llvm] r55581 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp In-Reply-To: <1C190F51-C098-4531-94BD-BD07C85F4800@apple.com> References: <200808310253.m7V2rKs1015732@zion.cs.uiuc.edu> <1C190F51-C098-4531-94BD-BD07C85F4800@apple.com> Message-ID: <16e5fdf90809021045s4ab1845aja1433b1123d40407@mail.gmail.com> On Tue, Sep 2, 2008 at 9:54 AM, Dale Johannesen wrote: > > On Aug 30, 2008, at 7:53 PMPDT, Bill Wendling wrote: > >> Author: void >> Date: Sat Aug 30 21:53:19 2008 >> New Revision: 55581 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=55581&view=rev >> Log: >> Expand for ROTR with MVT::i64. >> >> Dale, Could you please review this? > > PPC has rotate instructions; these should be Legal. I'll look into it. > I'd read that the ROTR was done by the ROTL instruction? -bw From dalej at apple.com Tue Sep 2 12:49:44 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 2 Sep 2008 10:49:44 -0700 Subject: [llvm-commits] [llvm] r55581 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp In-Reply-To: <16e5fdf90809021045s4ab1845aja1433b1123d40407@mail.gmail.com> References: <200808310253.m7V2rKs1015732@zion.cs.uiuc.edu> <1C190F51-C098-4531-94BD-BD07C85F4800@apple.com> <16e5fdf90809021045s4ab1845aja1433b1123d40407@mail.gmail.com> Message-ID: <422C1E4F-541D-4ED8-B613-E2DBD2CE3E1D@apple.com> On Sep 2, 2008, at 10:45 AMPDT, Bill Wendling wrote: > On Tue, Sep 2, 2008 at 9:54 AM, Dale Johannesen > wrote: >> >> On Aug 30, 2008, at 7:53 PMPDT, Bill Wendling wrote: >> >>> Author: void >>> Date: Sat Aug 30 21:53:19 2008 >>> New Revision: 55581 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=55581&view=rev >>> Log: >>> Expand for ROTR with MVT::i64. >>> >>> Dale, Could you please review this? >> >> PPC has rotate instructions; these should be Legal. I'll look into >> it. >> > I'd read that the ROTR was done by the ROTL instruction? They use the same instruction, yes, which is neither ROTR nor ROTL. From daniel at zuster.org Tue Sep 2 12:58:38 2008 From: daniel at zuster.org (Daniel Dunbar) Date: Tue, 2 Sep 2008 10:58:38 -0700 Subject: [llvm-commits] [llvm] r55628 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 In-Reply-To: <16e5fdf90809021036o40b59ed0s80a9b578b5ac1c83@mail.gmail.com> References: <200809020951.m829p06Q026424@zion.cs.uiuc.edu> <16e5fdf90809021036o40b59ed0s80a9b578b5ac1c83@mail.gmail.com> Message-ID: <6a8523d60809021058s607f1fd2lb8a7c34df79772fd@mail.gmail.com> Actually, don't, because I just reapplied. On Tue, Sep 2, 2008 at 10:36 AM, Bill Wendling wrote: > Make sure that you regenerate the configure file. > > -bw > > On Tue, Sep 2, 2008 at 2:51 AM, Matthijs Kooijman > wrote: > > Author: matthijs > > Date: Tue Sep 2 04:51:00 2008 > > New Revision: 55628 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=55628&view=rev > > Log: > > Revert r55557, it is causing linking failures on 32bit linux. > > > > > > Removed: > > llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 > > Modified: > > llvm/trunk/Makefile.config.in > > llvm/trunk/Makefile.rules > > llvm/trunk/autoconf/configure.ac > > > > Modified: llvm/trunk/Makefile.config.in > > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=55628&r1=55627&r2=55628&view=diff > > > > > ============================================================================== > > --- llvm/trunk/Makefile.config.in (original) > > +++ llvm/trunk/Makefile.config.in Tue Sep 2 04:51:00 2008 > > @@ -234,9 +234,6 @@ > > # Do we want to build with position independent code? > > ENABLE_PIC := @ENABLE_PIC@ > > > > -# Use -fvisibility-inlines-hidden? > > -ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@ > > - > > # This option tells the Makefiles to produce verbose output. > > # It essentially prints the commands that make is executing > > #VERBOSE = 1 > > > > Modified: llvm/trunk/Makefile.rules > > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=55628&r1=55627&r2=55628&view=diff > > > > > ============================================================================== > > --- llvm/trunk/Makefile.rules (original) > > +++ llvm/trunk/Makefile.rules Tue Sep 2 04:51:00 2008 > > @@ -241,10 +241,6 @@ > > endif > > endif > > > > -ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1) > > - CXX.Flags += -fvisibility-inlines-hidden > > -endif > > - > > # IF REQUIRES_EH=1 is specified then don't disable exceptions > > ifndef REQUIRES_EH > > CXX.Flags += -fno-exceptions > > > > Modified: llvm/trunk/autoconf/configure.ac > > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=55628&r1=55627&r2=55628&view=diff > > > > > ============================================================================== > > --- llvm/trunk/autoconf/configure.ac (original) > > +++ llvm/trunk/autoconf/configure.ac Tue Sep 2 04:51:00 2008 > > @@ -975,8 +975,6 @@ > > AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use > configure --disable-bindings.]) > > fi > > > > -dnl Determine if the compiler supports -fvisibility-inlines-hidden. > > -AC_CXX_USE_VISIBILITY_INLINES_HIDDEN > > > > > dnl===-----------------------------------------------------------------------=== > > dnl=== > > > > Removed: llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 > > URL: > http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4?rev=55627&view=auto > > > > > ============================================================================== > > --- llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 (original) > > +++ llvm/trunk/autoconf/m4/visibility_inlines_hidden.m4 (removed) > > @@ -1,22 +0,0 @@ > > -# > > -# Determine if the compiler accepts -fvisibility-inlines-hidden > > -# > > -# This macro is specific to LLVM. > > -# > > -AC_DEFUN([AC_CXX_USE_VISIBILITY_INLINES_HIDDEN], > > -[AC_CACHE_CHECK([for compiler -fvisibility-inlines-hidden option], > > - [llvm_cv_cxx_visibility_inlines_hidden], > > -[ AC_LANG_PUSH([C++]) > > - oldcxxflags="$CXXFLAGS" > > - CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" > > - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], > > - > [llvm_cv_cxx_visibility_inlines_hidden=yes],[llvm_cv_cxx_visibility_inlines_hidden=no]) > > - CXXFLAGS="$oldcxxflags" > > - AC_LANG_POP([C++]) > > -]) > > -if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then > > - AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[1]) > > -else > > - AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[0]) > > -fi > > -]) > > > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080902/19169be8/attachment.html From dalej at apple.com Tue Sep 2 13:16:35 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 2 Sep 2008 11:16:35 -0700 Subject: [llvm-commits] [llvm] r55581 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp In-Reply-To: <200808310253.m7V2rKs1015732@zion.cs.uiuc.edu> References: <200808310253.m7V2rKs1015732@zion.cs.uiuc.edu> Message-ID: <5493274E-82A2-4C5E-8FB9-9FC1331E3B02@apple.com> On Aug 30, 2008, at 7:53 PMPDT, Bill Wendling wrote: > Author: void > Date: Sat Aug 30 21:53:19 2008 > New Revision: 55581 > > URL: http://llvm.org/viewvc/llvm-project?rev=55581&view=rev > Log: > Expand for ROTR with MVT::i64. > > Dale, Could you please review this? We talked about this more, and this is OK. (This is somewhat confusing; there is actually no code to expand ROTR, the effect of marking it Expand is to prevent it from being generated, which is what we want.) > Modified: > llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp > > Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=55581&r1=55580&r2=55581&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Sat Aug 30 > 21:53:19 2008 > @@ -125,6 +125,7 @@ > > // PowerPC does not have ROTR > setOperationAction(ISD::ROTR, MVT::i32 , Expand); > + setOperationAction(ISD::ROTR, MVT::i64 , Expand); > > // PowerPC does not have Select > setOperationAction(ISD::SELECT, MVT::i32, Expand); > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From matthijs at stdin.nl Tue Sep 2 13:26:40 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 2 Sep 2008 20:26:40 +0200 Subject: [llvm-commits] [llvm] r55557 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 configure In-Reply-To: <6a8523d60809021012u3ec52bfdu174f9948003417b0@mail.gmail.com> References: <200808300116.m7U1GKHE014061@zion.cs.uiuc.edu> <20080902094441.GA32157@katherina.student.utwente.nl> <20080902125509.GD32157@katherina.student.utwente.nl> <6a8523d60809021012u3ec52bfdu174f9948003417b0@mail.gmail.com> Message-ID: <20080902182640.GG32157@katherina.student.utwente.nl> Hi Daniel, I'm seeing the failure also on Debian/unstable, running gcc-4.1 (GCC) 4.1.3 20080623 (prerelease) (Debian 4.1.2-23) I've just tested this on the same machine, but on the host system, so running on 64bit with the same gcc version as above. This failed as well. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080902/4f8afecd/attachment.bin From dpatel at apple.com Tue Sep 2 13:33:55 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 18:33:55 -0000 Subject: [llvm-commits] [llvm] r55638 - /llvm/trunk/include/llvm/Function.h Message-ID: <200809021833.m82IXtBb013569@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 13:33:55 2008 New Revision: 55638 URL: http://llvm.org/viewvc/llvm-project?rev=55638&view=rev Log: Getter and setter for function notes. Modified: llvm/trunk/include/llvm/Function.h Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=55638&r1=55637&r2=55638&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Tue Sep 2 13:33:55 2008 @@ -51,6 +51,12 @@ static int getListOffset(); }; +typedef unsigned FunctionNotes; +const FunctionNotes FP_None = 0; +const FunctionNotes FP_NoInline = 1<<0; +const FunctionNotes FP_AlwaysInline = 1<<1; +const FunctionNotes FP_OptimizeForSize = 1<<2; + class Function : public GlobalValue, public Annotable, public ilist_node { public: @@ -70,7 +76,8 @@ mutable ArgumentListType ArgumentList; ///< The formal arguments ValueSymbolTable *SymTab; ///< Symbol table of args/instructions PAListPtr ParamAttrs; ///< Parameter attributes - + FunctionNotes Notes; ///< Function properties + // The Calling Convention is stored in Value::SubclassData. /*unsigned CallingConvention;*/ @@ -148,6 +155,14 @@ /// void setParamAttrs(const PAListPtr &attrs) { ParamAttrs = attrs; } + /// getNotes - Return this function properties + /// + const FunctionNotes &getNotes() const { return Notes; } + + /// setNotes - Set properties for this function + /// + void setNotes(const FunctionNotes P) { Notes = P;} + /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm /// to use during code generation. bool hasGC() const; From gohman at apple.com Tue Sep 2 15:17:56 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 02 Sep 2008 20:17:56 -0000 Subject: [llvm-commits] [llvm] r55641 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200809022017.m82KHuLp017164@zion.cs.uiuc.edu> Author: djg Date: Tue Sep 2 15:17:56 2008 New Revision: 55641 URL: http://llvm.org/viewvc/llvm-project?rev=55641&view=rev Log: Ensure that HandlePHINodesInSuccessorBlocks is run for all blocks, even in FastISel mode in the case where FastISel successfully selects all the instructions. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=55641&r1=55640&r2=55641&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Sep 2 15:17:56 2008 @@ -5536,7 +5536,7 @@ } // Handle PHI nodes in successor blocks. - if (Begin != End && End == LLVMBB->end()) + if (End == LLVMBB->end()) HandlePHINodesInSuccessorBlocks(LLVMBB); // Make sure the root of the DAG is up-to-date. @@ -5798,8 +5798,14 @@ } } - if (Begin != End) - SelectBasicBlock(LLVMBB, Begin, End); + // Run SelectionDAG instruction selection on the remainder of the block + // not handled by FastISel. If FastISel is not run, this is the entire + // block. If FastISel is run and happens to handle all of the + // LLVM Instructions in the block, [Begin,End) will be an empty range, + // but we still need to run this so that + // HandlePHINodesInSuccessorBlocks is called and any resulting code + // is emitted. + SelectBasicBlock(LLVMBB, Begin, End); FinishBasicBlock(); } From matthijs at stdin.nl Tue Sep 2 15:21:55 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 2 Sep 2008 22:21:55 +0200 Subject: [llvm-commits] [llvm] r55557 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 configure In-Reply-To: <20080902182640.GG32157@katherina.student.utwente.nl> References: <200808300116.m7U1GKHE014061@zion.cs.uiuc.edu> <20080902094441.GA32157@katherina.student.utwente.nl> <20080902125509.GD32157@katherina.student.utwente.nl> <6a8523d60809021012u3ec52bfdu174f9948003417b0@mail.gmail.com> <20080902182640.GG32157@katherina.student.utwente.nl> Message-ID: <20080902202155.GI32157@katherina.student.utwente.nl> Hi Daniel, on the same 64 bit version, the etch version works fine. gcc-4.1 (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080902/7a8f746a/attachment.bin From matthijs at stdin.nl Tue Sep 2 15:22:45 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 2 Sep 2008 22:22:45 +0200 Subject: [llvm-commits] [llvm] r55628 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 In-Reply-To: <16e5fdf90809021036o40b59ed0s80a9b578b5ac1c83@mail.gmail.com> References: <200809020951.m829p06Q026424@zion.cs.uiuc.edu> <16e5fdf90809021036o40b59ed0s80a9b578b5ac1c83@mail.gmail.com> Message-ID: <20080902202245.GJ32157@katherina.student.utwente.nl> > Make sure that you regenerate the configure file. I just reverted the commit, so if I forgot to regenerate a configure file, then Daniel did as well :-) Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080902/54bbdc24/attachment.bin From dalej at apple.com Tue Sep 2 15:30:24 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 02 Sep 2008 20:30:24 -0000 Subject: [llvm-commits] [llvm] r55643 - /llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Message-ID: <200809022030.m82KUOn7017618@zion.cs.uiuc.edu> Author: johannes Date: Tue Sep 2 15:30:23 2008 New Revision: 55643 URL: http://llvm.org/viewvc/llvm-project?rev=55643&view=rev Log: Fix some bugs in the code sequences for atomics. Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=55643&r1=55642&r2=55643&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Sep 2 15:30:23 2008 @@ -3881,8 +3881,8 @@ MachineRegisterInfo &RegInfo = F->getRegInfo(); unsigned TmpReg = (!BinOpcode) ? incr : RegInfo.createVirtualRegister( - is64bit ? (const TargetRegisterClass *) &PPC::GPRCRegClass : - (const TargetRegisterClass *) &PPC::G8RCRegClass); + is64bit ? (const TargetRegisterClass *) &PPC::G8RCRegClass : + (const TargetRegisterClass *) &PPC::GPRCRegClass); // thisMBB: // ... @@ -3944,8 +3944,8 @@ MachineRegisterInfo &RegInfo = F->getRegInfo(); const TargetRegisterClass *RC = - is64bit ? (const TargetRegisterClass *) &PPC::GPRCRegClass : - (const TargetRegisterClass *) &PPC::G8RCRegClass; + is64bit ? (const TargetRegisterClass *) &PPC::G8RCRegClass : + (const TargetRegisterClass *) &PPC::GPRCRegClass; unsigned PtrReg = RegInfo.createVirtualRegister(RC); unsigned Shift1Reg = RegInfo.createVirtualRegister(RC); unsigned ShiftReg = RegInfo.createVirtualRegister(RC); @@ -3969,7 +3969,7 @@ // anywhere in the word. Hence all this nasty bookkeeping code. // add ptr1, ptrA, ptrB [copy if ptrA==0] // rlwinm shift1, ptr1, 3, 27, 28 [3, 27, 27] - // xor shift, shift1, 24 [16] + // xori shift, shift1, 24 [16] // rlwinm ptr, ptr1, 0, 0, 29 // slw incr2, incr, shift // li mask2, 255 [li mask3, 0; ori mask2, mask3, 65535] @@ -3994,7 +3994,7 @@ } BuildMI(BB, TII->get(PPC::RLWINM), Shift1Reg).addReg(Ptr1Reg) .addImm(3).addImm(27).addImm(is8bit ? 28 : 27); - BuildMI(BB, TII->get(is64bit ? PPC::XOR8 : PPC::XOR), ShiftReg) + BuildMI(BB, TII->get(is64bit ? PPC::XORI8 : PPC::XORI), ShiftReg) .addReg(Shift1Reg).addImm(is8bit ? 24 : 16); if (is64bit) BuildMI(BB, TII->get(PPC::RLDICR), PtrReg) @@ -4251,8 +4251,8 @@ MachineRegisterInfo &RegInfo = F->getRegInfo(); const TargetRegisterClass *RC = - is64bit ? (const TargetRegisterClass *) &PPC::GPRCRegClass : - (const TargetRegisterClass *) &PPC::G8RCRegClass; + is64bit ? (const TargetRegisterClass *) &PPC::G8RCRegClass : + (const TargetRegisterClass *) &PPC::GPRCRegClass; unsigned PtrReg = RegInfo.createVirtualRegister(RC); unsigned Shift1Reg = RegInfo.createVirtualRegister(RC); unsigned ShiftReg = RegInfo.createVirtualRegister(RC); @@ -4277,7 +4277,7 @@ // anywhere in the word. Hence all this nasty bookkeeping code. // add ptr1, ptrA, ptrB [copy if ptrA==0] // rlwinm shift1, ptr1, 3, 27, 28 [3, 27, 27] - // xor shift, shift1, 24 [16] + // xori shift, shift1, 24 [16] // rlwinm ptr, ptr1, 0, 0, 29 // slw newval2, newval, shift // slw oldval2, oldval,shift @@ -4309,7 +4309,7 @@ } BuildMI(BB, TII->get(PPC::RLWINM), Shift1Reg).addReg(Ptr1Reg) .addImm(3).addImm(27).addImm(is8bit ? 28 : 27); - BuildMI(BB, TII->get(is64bit ? PPC::XOR8 : PPC::XOR), ShiftReg) + BuildMI(BB, TII->get(is64bit ? PPC::XORI8 : PPC::XORI), ShiftReg) .addReg(Shift1Reg).addImm(is8bit ? 24 : 16); if (is64bit) BuildMI(BB, TII->get(PPC::RLDICR), PtrReg) From dpatel at apple.com Tue Sep 2 15:51:15 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 20:51:15 -0000 Subject: [llvm-commits] [llvm] r55645 - /llvm/trunk/lib/VMCore/Function.cpp Message-ID: <200809022051.m82KpFCP018422@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 15:51:15 2008 New Revision: 55645 URL: http://llvm.org/viewvc/llvm-project?rev=55645&view=rev Log: Initialize function notes. Modified: llvm/trunk/lib/VMCore/Function.cpp Modified: llvm/trunk/lib/VMCore/Function.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=55645&r1=55644&r2=55645&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Function.cpp (original) +++ llvm/trunk/lib/VMCore/Function.cpp Tue Sep 2 15:51:15 2008 @@ -173,6 +173,8 @@ // Ensure intrinsics have the right parameter attributes. if (unsigned IID = getIntrinsicID(true)) setParamAttrs(Intrinsic::getParamAttrs(Intrinsic::ID(IID))); + + Notes = 0; } Function::~Function() { From dpatel at apple.com Tue Sep 2 15:52:40 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 20:52:40 -0000 Subject: [llvm-commits] [llvm] r55646 - in /llvm/trunk/lib/AsmParser: LLLexer.cpp llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200809022052.m82Kqfa8018482@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 15:52:40 2008 New Revision: 55646 URL: http://llvm.org/viewvc/llvm-project?rev=55646&view=rev Log: Parse function notes. Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=55646&r1=55645&r2=55646&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/LLLexer.cpp (original) +++ llvm/trunk/lib/AsmParser/LLLexer.cpp Tue Sep 2 15:52:40 2008 @@ -497,6 +497,12 @@ KEYWORD("readnone", READNONE); KEYWORD("readonly", READONLY); + KEYWORD("notes", FNNOTE); + KEYWORD("inline", INLINE); + KEYWORD("always", ALWAYS); + KEYWORD("never", NEVER); + KEYWORD("optimizeforsize", OPTIMIZEFORSIZE); + KEYWORD("type", TYPE); KEYWORD("opaque", OPAQUE); Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=55646&r1=55645&r2=55646&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Sep 2 15:52:40 2008 @@ -225,9 +225,14 @@ READNONE = 406, READONLY = 407, GC = 408, - DEFAULT = 409, - HIDDEN = 410, - PROTECTED = 411 + FNNOTE = 409, + INLINE = 410, + ALWAYS = 411, + NEVER = 412, + OPTIMIZEFORSIZE = 413, + DEFAULT = 414, + HIDDEN = 415, + PROTECTED = 416 }; #endif /* Tokens. */ @@ -382,15 +387,20 @@ #define READNONE 406 #define READONLY 407 #define GC 408 -#define DEFAULT 409 -#define HIDDEN 410 -#define PROTECTED 411 +#define FNNOTE 409 +#define INLINE 410 +#define ALWAYS 411 +#define NEVER 412 +#define OPTIMIZEFORSIZE 413 +#define DEFAULT 414 +#define HIDDEN 415 +#define PROTECTED 416 /* Copy the first part of user declarations. */ -#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1367,7 +1377,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 970 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 970 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1396,6 +1406,7 @@ llvm::GlobalValue::LinkageTypes Linkage; llvm::GlobalValue::VisibilityTypes Visibility; llvm::ParameterAttributes ParamAttrs; + llvm::FunctionNotes FunctionNotes; llvm::APInt *APIntVal; int64_t SInt64Val; uint64_t UInt64Val; @@ -1416,7 +1427,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 193 of yacc.c. */ -#line 1420 "llvmAsmParser.tab.c" +#line 1431 "llvmAsmParser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -1429,7 +1440,7 @@ /* Line 216 of yacc.c. */ -#line 1433 "llvmAsmParser.tab.c" +#line 1444 "llvmAsmParser.tab.c" #ifdef short # undef short @@ -1644,20 +1655,20 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 44 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 2386 +#define YYLAST 2421 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 171 +#define YYNTOKENS 176 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 87 +#define YYNNTS 90 /* YYNRULES -- Number of rules. */ -#define YYNRULES 346 +#define YYNRULES 353 /* YYNRULES -- Number of states. */ -#define YYNSTATES 707 +#define YYNSTATES 720 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 411 +#define YYMAXUTOK 416 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -1669,15 +1680,15 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 157, 158, 161, 2, 160, 2, 2, 2, 2, 2, + 162, 163, 166, 2, 165, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 166, 159, 167, 2, 2, 2, 2, 2, 2, 2, + 171, 164, 172, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 163, 162, 165, 2, 2, 2, 2, 2, 170, + 2, 168, 167, 170, 2, 2, 2, 2, 2, 175, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 164, 2, 2, 168, 2, 169, 2, 2, 2, 2, + 169, 2, 2, 173, 2, 174, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1706,7 +1717,7 @@ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156 + 155, 156, 157, 158, 159, 160, 161 }; #if YYDEBUG @@ -1726,35 +1737,36 @@ 179, 181, 183, 184, 186, 188, 190, 192, 193, 195, 197, 198, 200, 202, 204, 206, 208, 210, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 234, 235, - 238, 240, 242, 244, 246, 248, 250, 251, 254, 255, - 258, 259, 262, 263, 267, 270, 271, 273, 274, 278, - 280, 283, 285, 287, 289, 291, 293, 295, 297, 299, - 301, 305, 307, 310, 316, 322, 328, 334, 338, 341, - 347, 352, 355, 357, 359, 361, 365, 367, 371, 373, - 374, 376, 380, 385, 389, 393, 398, 403, 407, 414, - 420, 423, 426, 429, 432, 435, 438, 441, 444, 447, - 450, 453, 456, 463, 469, 478, 485, 492, 500, 508, - 516, 524, 531, 540, 549, 555, 563, 567, 569, 571, - 573, 575, 576, 579, 586, 588, 589, 591, 594, 595, - 599, 600, 604, 608, 612, 616, 617, 626, 627, 637, - 638, 648, 654, 657, 661, 663, 667, 671, 675, 679, - 681, 682, 688, 692, 694, 698, 700, 701, 712, 714, - 716, 721, 723, 725, 728, 732, 733, 735, 737, 739, - 741, 743, 745, 747, 749, 751, 753, 755, 759, 763, - 766, 769, 773, 776, 782, 787, 789, 795, 797, 799, - 801, 803, 805, 807, 810, 812, 816, 819, 822, 826, - 830, 833, 834, 836, 839, 842, 846, 856, 866, 875, - 890, 892, 894, 901, 907, 910, 913, 920, 928, 933, - 938, 945, 952, 953, 954, 958, 961, 965, 968, 970, - 976, 982, 989, 996, 1003, 1010, 1015, 1022, 1027, 1032, - 1039, 1046, 1049, 1058, 1060, 1062, 1063, 1067, 1074, 1078, - 1085, 1088, 1094, 1102, 1108, 1113, 1118 + 238, 240, 242, 244, 246, 248, 250, 251, 254, 256, + 260, 264, 268, 270, 271, 276, 277, 280, 281, 284, + 285, 289, 292, 293, 295, 296, 300, 302, 305, 307, + 309, 311, 313, 315, 317, 319, 321, 323, 327, 329, + 332, 338, 344, 350, 356, 360, 363, 369, 374, 377, + 379, 381, 383, 387, 389, 393, 395, 396, 398, 402, + 407, 411, 415, 420, 425, 429, 436, 442, 445, 448, + 451, 454, 457, 460, 463, 466, 469, 472, 475, 478, + 485, 491, 500, 507, 514, 522, 530, 538, 546, 553, + 562, 571, 577, 585, 589, 591, 593, 595, 597, 598, + 601, 608, 610, 611, 613, 616, 617, 621, 622, 626, + 630, 634, 638, 639, 648, 649, 659, 660, 670, 676, + 679, 683, 685, 689, 693, 697, 701, 703, 704, 710, + 714, 716, 720, 722, 723, 735, 737, 739, 744, 746, + 748, 751, 755, 756, 758, 760, 762, 764, 766, 768, + 770, 772, 774, 776, 778, 782, 786, 789, 792, 796, + 799, 805, 810, 812, 818, 820, 822, 824, 826, 828, + 830, 833, 835, 839, 842, 845, 849, 853, 856, 857, + 859, 862, 865, 869, 879, 889, 898, 913, 915, 917, + 924, 930, 933, 936, 943, 951, 956, 961, 968, 975, + 976, 977, 981, 984, 988, 991, 993, 999, 1005, 1012, + 1019, 1026, 1033, 1038, 1045, 1050, 1055, 1062, 1069, 1072, + 1081, 1083, 1085, 1086, 1090, 1097, 1101, 1108, 1111, 1117, + 1125, 1131, 1136, 1141 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 218, 0, -1, 76, -1, 77, -1, 78, -1, 79, + 226, 0, -1, 76, -1, 77, -1, 78, -1, 79, -1, 80, -1, 81, -1, 82, -1, 83, -1, 84, -1, 88, -1, 89, -1, 90, -1, 85, -1, 86, -1, 87, -1, 121, -1, 122, -1, 123, -1, 124, @@ -1766,147 +1778,150 @@ -1, 112, -1, 113, -1, 114, -1, 101, -1, 102, -1, 103, -1, 104, -1, 26, -1, 27, -1, 11, -1, 12, -1, 13, -1, 16, -1, 15, -1, 14, - -1, 19, -1, 22, -1, 24, -1, 179, -1, -1, - 55, 157, 4, 158, -1, -1, 179, 159, -1, -1, - 7, 159, -1, 20, -1, 23, -1, 186, -1, -1, - 184, 159, -1, 42, -1, 44, -1, 43, -1, 45, + -1, 19, -1, 22, -1, 24, -1, 184, -1, -1, + 55, 162, 4, 163, -1, -1, 184, 164, -1, -1, + 7, 164, -1, 20, -1, 23, -1, 191, -1, -1, + 189, 164, -1, 42, -1, 44, -1, 43, -1, 45, -1, 47, -1, 49, -1, 46, -1, 48, -1, 51, - -1, -1, 154, -1, 155, -1, 156, -1, -1, 46, + -1, -1, 159, -1, 160, -1, 161, -1, -1, 46, -1, 48, -1, -1, 42, -1, 43, -1, 44, -1, 47, -1, -1, 44, -1, 42, -1, -1, 63, -1, 64, -1, 65, -1, 66, -1, 67, -1, 68, -1, 62, 4, -1, 143, -1, 122, -1, 142, -1, 123, -1, 145, -1, 146, -1, 148, -1, 149, -1, 150, - -1, 54, 4, -1, -1, 195, 194, -1, 144, -1, + -1, 54, 4, -1, -1, 200, 199, -1, 144, -1, 147, -1, 143, -1, 142, -1, 151, -1, 152, -1, - -1, 197, 196, -1, -1, 153, 22, -1, -1, 54, - 4, -1, -1, 160, 54, 4, -1, 34, 22, -1, - -1, 201, -1, -1, 160, 204, 203, -1, 201, -1, - 54, 4, -1, 11, -1, 12, -1, 13, -1, 16, - -1, 15, -1, 14, -1, 17, -1, 50, -1, 205, - -1, 206, 181, 161, -1, 240, -1, 162, 4, -1, - 206, 157, 210, 158, 197, -1, 10, 157, 210, 158, - 197, -1, 163, 4, 164, 206, 165, -1, 166, 4, - 164, 206, 167, -1, 168, 211, 169, -1, 168, 169, - -1, 166, 168, 211, 169, 167, -1, 166, 168, 169, - 167, -1, 206, 195, -1, 206, -1, 10, -1, 207, - -1, 209, 160, 207, -1, 209, -1, 209, 160, 39, - -1, 39, -1, -1, 206, -1, 211, 160, 206, -1, - 206, 163, 214, 165, -1, 206, 163, 165, -1, 206, - 170, 22, -1, 206, 166, 214, 167, -1, 206, 168, - 214, 169, -1, 206, 168, 169, -1, 206, 166, 168, - 214, 169, 167, -1, 206, 166, 168, 169, 167, -1, - 206, 40, -1, 206, 41, -1, 206, 240, -1, 206, - 213, -1, 206, 25, -1, 177, 3, -1, 177, 5, - -1, 177, 4, -1, 177, 6, -1, 11, 26, -1, - 11, 27, -1, 178, 9, -1, 174, 157, 212, 38, - 206, 158, -1, 120, 157, 212, 252, 158, -1, 134, - 157, 212, 160, 212, 160, 212, 158, -1, 172, 157, - 212, 160, 212, 158, -1, 173, 157, 212, 160, 212, - 158, -1, 91, 175, 157, 212, 160, 212, 158, -1, - 92, 176, 157, 212, 160, 212, 158, -1, 93, 175, - 157, 212, 160, 212, 158, -1, 94, 176, 157, 212, - 160, 212, 158, -1, 136, 157, 212, 160, 212, 158, - -1, 137, 157, 212, 160, 212, 160, 212, 158, -1, - 138, 157, 212, 160, 212, 160, 212, 158, -1, 140, - 157, 212, 253, 158, -1, 141, 157, 212, 160, 212, - 253, 158, -1, 214, 160, 212, -1, 212, -1, 32, - -1, 33, -1, 37, -1, -1, 208, 240, -1, 126, - 157, 217, 38, 206, 158, -1, 219, -1, -1, 220, - -1, 219, 220, -1, -1, 31, 221, 236, -1, -1, - 30, 222, 237, -1, 60, 59, 226, -1, 182, 18, - 206, -1, 182, 18, 10, -1, -1, 185, 189, 216, - 215, 212, 181, 223, 203, -1, -1, 185, 187, 189, - 216, 215, 212, 181, 224, 203, -1, -1, 185, 188, - 189, 216, 215, 206, 181, 225, 203, -1, 185, 189, - 35, 192, 217, -1, 52, 227, -1, 56, 159, 228, - -1, 22, -1, 53, 159, 22, -1, 69, 159, 22, - -1, 163, 229, 165, -1, 229, 160, 22, -1, 22, - -1, -1, 230, 160, 206, 195, 180, -1, 206, 195, - 180, -1, 230, -1, 230, 160, 39, -1, 39, -1, - -1, 193, 208, 184, 157, 231, 158, 197, 202, 199, - 198, -1, 28, -1, 168, -1, 191, 189, 232, 233, - -1, 29, -1, 169, -1, 244, 235, -1, 190, 189, - 232, -1, -1, 61, -1, 3, -1, 4, -1, 5, - -1, 6, -1, 9, -1, 26, -1, 27, -1, 40, - -1, 41, -1, 25, -1, 166, 214, 167, -1, 163, - 214, 165, -1, 163, 165, -1, 170, 22, -1, 168, - 214, 169, -1, 168, 169, -1, 166, 168, 214, 169, - 167, -1, 166, 168, 169, 167, -1, 213, -1, 59, - 238, 22, 160, 22, -1, 7, -1, 8, -1, 179, - -1, 184, -1, 240, -1, 239, -1, 206, 241, -1, - 242, -1, 243, 160, 242, -1, 244, 245, -1, 234, - 245, -1, 246, 182, 247, -1, 246, 183, 247, -1, - 246, 249, -1, -1, 21, -1, 70, 243, -1, 70, - 10, -1, 71, 17, 241, -1, 71, 11, 241, 160, - 17, 241, 160, 17, 241, -1, 72, 177, 241, 160, - 17, 241, 163, 248, 165, -1, 72, 177, 241, 160, - 17, 241, 163, 165, -1, 73, 193, 208, 241, 157, - 251, 158, 197, 38, 17, 241, 74, 17, 241, -1, - 74, -1, 75, -1, 248, 177, 239, 160, 17, 241, - -1, 177, 239, 160, 17, 241, -1, 182, 255, -1, - 183, 255, -1, 206, 163, 241, 160, 241, 165, -1, - 250, 160, 163, 241, 160, 241, 165, -1, 206, 195, - 241, 195, -1, 17, 195, 241, 195, -1, 251, 160, - 206, 195, 241, 195, -1, 251, 160, 17, 195, 241, - 195, -1, -1, -1, 252, 160, 242, -1, 160, 4, - -1, 253, 160, 4, -1, 58, 57, -1, 57, -1, - 172, 206, 241, 160, 241, -1, 173, 206, 241, 160, - 241, -1, 91, 175, 206, 241, 160, 241, -1, 92, - 176, 206, 241, 160, 241, -1, 93, 175, 206, 241, - 160, 241, -1, 94, 176, 206, 241, 160, 241, -1, - 174, 242, 38, 206, -1, 134, 242, 160, 242, 160, - 242, -1, 135, 242, 160, 206, -1, 136, 242, 160, - 242, -1, 137, 242, 160, 242, 160, 242, -1, 138, - 242, 160, 242, 160, 242, -1, 133, 250, -1, 254, - 193, 208, 241, 157, 251, 158, 197, -1, 257, -1, - 36, -1, -1, 115, 206, 200, -1, 115, 206, 160, - 11, 241, 200, -1, 116, 206, 200, -1, 116, 206, - 160, 11, 241, 200, -1, 117, 242, -1, 256, 118, - 206, 241, 200, -1, 256, 119, 242, 160, 206, 241, - 200, -1, 139, 206, 241, 160, 4, -1, 120, 206, - 241, 252, -1, 140, 206, 241, 253, -1, 141, 206, - 241, 160, 206, 241, 253, -1 + -1, 202, 201, -1, 204, -1, 203, 165, 204, -1, + 155, 164, 157, -1, 155, 164, 156, -1, 158, -1, + -1, 154, 162, 203, 163, -1, -1, 153, 22, -1, + -1, 54, 4, -1, -1, 165, 54, 4, -1, 34, + 22, -1, -1, 209, -1, -1, 165, 212, 211, -1, + 209, -1, 54, 4, -1, 11, -1, 12, -1, 13, + -1, 16, -1, 15, -1, 14, -1, 17, -1, 50, + -1, 213, -1, 214, 186, 166, -1, 248, -1, 167, + 4, -1, 214, 162, 218, 163, 202, -1, 10, 162, + 218, 163, 202, -1, 168, 4, 169, 214, 170, -1, + 171, 4, 169, 214, 172, -1, 173, 219, 174, -1, + 173, 174, -1, 171, 173, 219, 174, 172, -1, 171, + 173, 174, 172, -1, 214, 200, -1, 214, -1, 10, + -1, 215, -1, 217, 165, 215, -1, 217, -1, 217, + 165, 39, -1, 39, -1, -1, 214, -1, 219, 165, + 214, -1, 214, 168, 222, 170, -1, 214, 168, 170, + -1, 214, 175, 22, -1, 214, 171, 222, 172, -1, + 214, 173, 222, 174, -1, 214, 173, 174, -1, 214, + 171, 173, 222, 174, 172, -1, 214, 171, 173, 174, + 172, -1, 214, 40, -1, 214, 41, -1, 214, 248, + -1, 214, 221, -1, 214, 25, -1, 182, 3, -1, + 182, 5, -1, 182, 4, -1, 182, 6, -1, 11, + 26, -1, 11, 27, -1, 183, 9, -1, 179, 162, + 220, 38, 214, 163, -1, 120, 162, 220, 260, 163, + -1, 134, 162, 220, 165, 220, 165, 220, 163, -1, + 177, 162, 220, 165, 220, 163, -1, 178, 162, 220, + 165, 220, 163, -1, 91, 180, 162, 220, 165, 220, + 163, -1, 92, 181, 162, 220, 165, 220, 163, -1, + 93, 180, 162, 220, 165, 220, 163, -1, 94, 181, + 162, 220, 165, 220, 163, -1, 136, 162, 220, 165, + 220, 163, -1, 137, 162, 220, 165, 220, 165, 220, + 163, -1, 138, 162, 220, 165, 220, 165, 220, 163, + -1, 140, 162, 220, 261, 163, -1, 141, 162, 220, + 165, 220, 261, 163, -1, 222, 165, 220, -1, 220, + -1, 32, -1, 33, -1, 37, -1, -1, 216, 248, + -1, 126, 162, 225, 38, 214, 163, -1, 227, -1, + -1, 228, -1, 227, 228, -1, -1, 31, 229, 244, + -1, -1, 30, 230, 245, -1, 60, 59, 234, -1, + 187, 18, 214, -1, 187, 18, 10, -1, -1, 190, + 194, 224, 223, 220, 186, 231, 211, -1, -1, 190, + 192, 194, 224, 223, 220, 186, 232, 211, -1, -1, + 190, 193, 194, 224, 223, 214, 186, 233, 211, -1, + 190, 194, 35, 197, 225, -1, 52, 235, -1, 56, + 164, 236, -1, 22, -1, 53, 164, 22, -1, 69, + 164, 22, -1, 168, 237, 170, -1, 237, 165, 22, + -1, 22, -1, -1, 238, 165, 214, 200, 185, -1, + 214, 200, 185, -1, 238, -1, 238, 165, 39, -1, + 39, -1, -1, 198, 216, 189, 162, 239, 163, 202, + 210, 207, 206, 205, -1, 28, -1, 173, -1, 196, + 194, 240, 241, -1, 29, -1, 174, -1, 252, 243, + -1, 195, 194, 240, -1, -1, 61, -1, 3, -1, + 4, -1, 5, -1, 6, -1, 9, -1, 26, -1, + 27, -1, 40, -1, 41, -1, 25, -1, 171, 222, + 172, -1, 168, 222, 170, -1, 168, 170, -1, 175, + 22, -1, 173, 222, 174, -1, 173, 174, -1, 171, + 173, 222, 174, 172, -1, 171, 173, 174, 172, -1, + 221, -1, 59, 246, 22, 165, 22, -1, 7, -1, + 8, -1, 184, -1, 189, -1, 248, -1, 247, -1, + 214, 249, -1, 250, -1, 251, 165, 250, -1, 252, + 253, -1, 242, 253, -1, 254, 187, 255, -1, 254, + 188, 255, -1, 254, 257, -1, -1, 21, -1, 70, + 251, -1, 70, 10, -1, 71, 17, 249, -1, 71, + 11, 249, 165, 17, 249, 165, 17, 249, -1, 72, + 182, 249, 165, 17, 249, 168, 256, 170, -1, 72, + 182, 249, 165, 17, 249, 168, 170, -1, 73, 198, + 216, 249, 162, 259, 163, 202, 38, 17, 249, 74, + 17, 249, -1, 74, -1, 75, -1, 256, 182, 247, + 165, 17, 249, -1, 182, 247, 165, 17, 249, -1, + 187, 263, -1, 188, 263, -1, 214, 168, 249, 165, + 249, 170, -1, 258, 165, 168, 249, 165, 249, 170, + -1, 214, 200, 249, 200, -1, 17, 200, 249, 200, + -1, 259, 165, 214, 200, 249, 200, -1, 259, 165, + 17, 200, 249, 200, -1, -1, -1, 260, 165, 250, + -1, 165, 4, -1, 261, 165, 4, -1, 58, 57, + -1, 57, -1, 177, 214, 249, 165, 249, -1, 178, + 214, 249, 165, 249, -1, 91, 180, 214, 249, 165, + 249, -1, 92, 181, 214, 249, 165, 249, -1, 93, + 180, 214, 249, 165, 249, -1, 94, 181, 214, 249, + 165, 249, -1, 179, 250, 38, 214, -1, 134, 250, + 165, 250, 165, 250, -1, 135, 250, 165, 214, -1, + 136, 250, 165, 250, -1, 137, 250, 165, 250, 165, + 250, -1, 138, 250, 165, 250, 165, 250, -1, 133, + 258, -1, 262, 198, 216, 249, 162, 259, 163, 202, + -1, 265, -1, 36, -1, -1, 115, 214, 208, -1, + 115, 214, 165, 11, 249, 208, -1, 116, 214, 208, + -1, 116, 214, 165, 11, 249, 208, -1, 117, 250, + -1, 264, 118, 214, 249, 208, -1, 264, 119, 250, + 165, 214, 249, 208, -1, 139, 214, 249, 165, 4, + -1, 120, 214, 249, 260, -1, 140, 214, 249, 261, + -1, 141, 214, 249, 165, 214, 249, 261, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, - 1136, 1137, 1137, 1137, 1137, 1137, 1137, 1138, 1138, 1138, - 1138, 1138, 1138, 1139, 1139, 1139, 1139, 1139, 1139, 1142, - 1142, 1143, 1143, 1144, 1144, 1145, 1145, 1146, 1146, 1150, - 1150, 1151, 1151, 1152, 1152, 1153, 1153, 1154, 1154, 1155, - 1155, 1156, 1156, 1157, 1158, 1163, 1164, 1164, 1164, 1164, - 1164, 1166, 1166, 1166, 1167, 1167, 1169, 1170, 1174, 1178, - 1183, 1189, 1189, 1191, 1192, 1197, 1203, 1204, 1205, 1206, - 1207, 1208, 1212, 1213, 1214, 1218, 1219, 1220, 1221, 1225, - 1226, 1227, 1231, 1232, 1233, 1234, 1235, 1239, 1240, 1241, - 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1258, 1259, - 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1271, 1272, - 1277, 1278, 1279, 1280, 1281, 1282, 1285, 1286, 1291, 1292, - 1299, 1300, 1306, 1307, 1316, 1324, 1325, 1330, 1331, 1332, - 1337, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1353, 1357, - 1361, 1368, 1373, 1381, 1410, 1435, 1440, 1450, 1460, 1464, - 1474, 1481, 1490, 1497, 1502, 1507, 1514, 1515, 1522, 1529, - 1537, 1543, 1555, 1583, 1599, 1626, 1654, 1680, 1700, 1726, - 1746, 1758, 1765, 1831, 1841, 1851, 1857, 1867, 1873, 1883, - 1889, 1895, 1908, 1920, 1941, 1949, 1955, 1966, 1971, 1976, - 1981, 1986, 1992, 1998, 2004, 2012, 2023, 2027, 2035, 2035, - 2038, 2038, 2041, 2053, 2074, 2079, 2087, 2088, 2092, 2092, - 2096, 2096, 2099, 2102, 2126, 2138, 2137, 2149, 2148, 2158, - 2157, 2168, 2208, 2211, 2217, 2227, 2231, 2236, 2238, 2243, - 2248, 2257, 2267, 2278, 2282, 2291, 2300, 2305, 2434, 2434, - 2436, 2445, 2445, 2447, 2452, 2464, 2468, 2473, 2477, 2481, - 2486, 2491, 2495, 2499, 2503, 2507, 2511, 2515, 2537, 2559, - 2565, 2578, 2590, 2595, 2607, 2613, 2617, 2627, 2631, 2635, - 2640, 2647, 2647, 2653, 2662, 2667, 2672, 2676, 2685, 2694, - 2707, 2716, 2720, 2728, 2748, 2752, 2757, 2768, 2787, 2796, - 2882, 2886, 2893, 2904, 2917, 2926, 2939, 2950, 2960, 2971, - 2979, 2989, 2996, 2999, 3000, 3008, 3014, 3023, 3027, 3032, - 3048, 3065, 3079, 3093, 3107, 3121, 3133, 3141, 3148, 3154, - 3160, 3166, 3181, 3271, 3276, 3280, 3287, 3294, 3304, 3311, - 3321, 3329, 3343, 3360, 3374, 3389, 3404 + 0, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, + 1142, 1143, 1143, 1143, 1143, 1143, 1143, 1144, 1144, 1144, + 1144, 1144, 1144, 1145, 1145, 1145, 1145, 1145, 1145, 1148, + 1148, 1149, 1149, 1150, 1150, 1151, 1151, 1152, 1152, 1156, + 1156, 1157, 1157, 1158, 1158, 1159, 1159, 1160, 1160, 1161, + 1161, 1162, 1162, 1163, 1164, 1169, 1170, 1170, 1170, 1170, + 1170, 1172, 1172, 1172, 1173, 1173, 1175, 1176, 1180, 1184, + 1189, 1195, 1195, 1197, 1198, 1203, 1209, 1210, 1211, 1212, + 1213, 1214, 1218, 1219, 1220, 1224, 1225, 1226, 1227, 1231, + 1232, 1233, 1237, 1238, 1239, 1240, 1241, 1245, 1246, 1247, + 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1264, 1265, + 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1277, 1278, + 1283, 1284, 1285, 1286, 1287, 1288, 1291, 1292, 1297, 1298, + 1309, 1310, 1311, 1314, 1315, 1320, 1321, 1328, 1329, 1335, + 1336, 1345, 1353, 1354, 1359, 1360, 1361, 1366, 1379, 1379, + 1379, 1379, 1379, 1379, 1379, 1382, 1386, 1390, 1397, 1402, + 1410, 1439, 1464, 1469, 1479, 1489, 1493, 1503, 1510, 1519, + 1526, 1531, 1536, 1543, 1544, 1551, 1558, 1566, 1572, 1584, + 1612, 1628, 1655, 1683, 1709, 1729, 1755, 1775, 1787, 1794, + 1860, 1870, 1880, 1886, 1896, 1902, 1912, 1918, 1924, 1937, + 1949, 1970, 1978, 1984, 1995, 2000, 2005, 2010, 2015, 2021, + 2027, 2033, 2041, 2052, 2056, 2064, 2064, 2067, 2067, 2070, + 2082, 2103, 2108, 2116, 2117, 2121, 2121, 2125, 2125, 2128, + 2131, 2155, 2167, 2166, 2178, 2177, 2187, 2186, 2197, 2237, + 2240, 2246, 2256, 2260, 2265, 2267, 2272, 2277, 2286, 2296, + 2307, 2311, 2320, 2329, 2334, 2466, 2466, 2468, 2477, 2477, + 2479, 2484, 2496, 2500, 2505, 2509, 2513, 2518, 2523, 2527, + 2531, 2535, 2539, 2543, 2547, 2569, 2591, 2597, 2610, 2622, + 2627, 2639, 2645, 2649, 2659, 2663, 2667, 2672, 2679, 2679, + 2685, 2694, 2699, 2704, 2708, 2717, 2726, 2739, 2748, 2752, + 2760, 2780, 2784, 2789, 2800, 2819, 2828, 2914, 2918, 2925, + 2936, 2949, 2958, 2971, 2982, 2992, 3003, 3011, 3021, 3028, + 3031, 3032, 3040, 3046, 3055, 3059, 3064, 3080, 3097, 3111, + 3125, 3139, 3153, 3165, 3173, 3180, 3186, 3192, 3198, 3213, + 3303, 3308, 3312, 3319, 3326, 3336, 3343, 3353, 3361, 3375, + 3392, 3406, 3421, 3436 }; #endif @@ -1938,16 +1953,17 @@ "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", - "NEST", "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED", - "'('", "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", - "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", - "CastOps", "IPredicates", "FPredicates", "IntType", "FPType", - "LocalName", "OptLocalName", "OptAddrSpace", "OptLocalAssign", - "LocalNumber", "GlobalName", "OptGlobalAssign", "GlobalAssign", - "GVInternalLinkage", "GVExternalLinkage", "GVVisibilityStyle", - "FunctionDeclareLinkage", "FunctionDefineLinkage", "AliasLinkage", - "OptCallingConv", "ParamAttr", "OptParamAttrs", "FuncAttr", - "OptFuncAttrs", "OptGC", "OptAlign", "OptCAlign", "SectionString", + "NEST", "READNONE", "READONLY", "GC", "FNNOTE", "INLINE", "ALWAYS", + "NEVER", "OPTIMIZEFORSIZE", "DEFAULT", "HIDDEN", "PROTECTED", "'('", + "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", + "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps", + "IPredicates", "FPredicates", "IntType", "FPType", "LocalName", + "OptLocalName", "OptAddrSpace", "OptLocalAssign", "LocalNumber", + "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage", + "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage", + "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr", + "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "FuncNoteList", "FuncNote", + "OptFuncNotes", "OptGC", "OptAlign", "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType", @@ -1983,50 +1999,51 @@ 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 40, 41, 61, - 44, 42, 92, 91, 120, 93, 60, 62, 123, 125, - 99 + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 40, 41, 61, 44, 42, 92, 91, 120, + 93, 60, 62, 123, 125, 99 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 171, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 173, 173, 173, 173, 173, 173, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 177, 178, 178, 178, 178, - 178, 179, 179, 179, 180, 180, 181, 181, 182, 182, - 183, 184, 184, 185, 185, 186, 187, 187, 187, 187, - 187, 187, 188, 188, 188, 189, 189, 189, 189, 190, - 190, 190, 191, 191, 191, 191, 191, 192, 192, 192, - 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 194, 195, 195, - 196, 196, 196, 196, 196, 196, 197, 197, 198, 198, - 199, 199, 200, 200, 201, 202, 202, 203, 203, 204, - 204, 205, 205, 205, 205, 205, 205, 205, 206, 206, - 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, - 206, 207, 208, 208, 209, 209, 210, 210, 210, 210, - 211, 211, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 214, 214, 215, 215, - 216, 216, 217, 217, 218, 218, 219, 219, 221, 220, - 222, 220, 220, 220, 220, 223, 220, 224, 220, 225, - 220, 220, 220, 220, 226, 227, 227, 228, 229, 229, - 229, 230, 230, 231, 231, 231, 231, 232, 233, 233, - 234, 235, 235, 236, 237, 238, 238, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 240, 240, 240, - 240, 241, 241, 242, 243, 243, 244, 244, 245, 245, - 246, 246, 246, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 248, 248, 249, 249, 250, 250, 251, 251, - 251, 251, 251, 252, 252, 253, 253, 254, 254, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 256, 256, 257, 257, 257, 257, - 257, 257, 257, 257, 257, 257, 257 + 0, 176, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 178, 178, 178, 178, 178, 178, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + 181, 181, 181, 181, 181, 182, 183, 183, 183, 183, + 183, 184, 184, 184, 185, 185, 186, 186, 187, 187, + 188, 189, 189, 190, 190, 191, 192, 192, 192, 192, + 192, 192, 193, 193, 193, 194, 194, 194, 194, 195, + 195, 195, 196, 196, 196, 196, 196, 197, 197, 197, + 198, 198, 198, 198, 198, 198, 198, 198, 199, 199, + 199, 199, 199, 199, 199, 199, 199, 199, 200, 200, + 201, 201, 201, 201, 201, 201, 202, 202, 203, 203, + 204, 204, 204, 205, 205, 206, 206, 207, 207, 208, + 208, 209, 210, 210, 211, 211, 212, 212, 213, 213, + 213, 213, 213, 213, 213, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, 215, 216, + 216, 217, 217, 218, 218, 218, 218, 219, 219, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 221, + 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 222, 222, 223, 223, 224, 224, 225, + 225, 226, 226, 227, 227, 229, 228, 230, 228, 228, + 228, 228, 231, 228, 232, 228, 233, 228, 228, 228, + 228, 234, 235, 235, 236, 237, 237, 237, 238, 238, + 239, 239, 239, 239, 240, 241, 241, 242, 243, 243, + 244, 245, 246, 246, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, + 247, 247, 247, 247, 248, 248, 248, 248, 249, 249, + 250, 251, 251, 252, 252, 253, 253, 254, 254, 254, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 256, + 256, 257, 257, 258, 258, 259, 259, 259, 259, 259, + 260, 260, 261, 261, 262, 262, 263, 263, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 263, 263, + 263, 264, 264, 265, 265, 265, 265, 265, 265, 265, + 265, 265, 265, 265 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -2044,29 +2061,30 @@ 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 2, - 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, - 0, 2, 0, 3, 2, 0, 1, 0, 3, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 1, 2, 5, 5, 5, 5, 3, 2, 5, - 4, 2, 1, 1, 1, 3, 1, 3, 1, 0, - 1, 3, 4, 3, 3, 4, 4, 3, 6, 5, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 6, 5, 8, 6, 6, 7, 7, 7, - 7, 6, 8, 8, 5, 7, 3, 1, 1, 1, - 1, 0, 2, 6, 1, 0, 1, 2, 0, 3, - 0, 3, 3, 3, 3, 0, 8, 0, 9, 0, - 9, 5, 2, 3, 1, 3, 3, 3, 3, 1, - 0, 5, 3, 1, 3, 1, 0, 10, 1, 1, - 4, 1, 1, 2, 3, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 2, - 2, 3, 2, 5, 4, 1, 5, 1, 1, 1, - 1, 1, 1, 2, 1, 3, 2, 2, 3, 3, - 2, 0, 1, 2, 2, 3, 9, 9, 8, 14, - 1, 1, 6, 5, 2, 2, 6, 7, 4, 4, - 6, 6, 0, 0, 3, 2, 3, 2, 1, 5, - 5, 6, 6, 6, 6, 4, 6, 4, 4, 6, - 6, 2, 8, 1, 1, 0, 3, 6, 3, 6, - 2, 5, 7, 5, 4, 4, 7 + 1, 1, 1, 1, 1, 1, 0, 2, 1, 3, + 3, 3, 1, 0, 4, 0, 2, 0, 2, 0, + 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, + 5, 5, 5, 5, 3, 2, 5, 4, 2, 1, + 1, 1, 3, 1, 3, 1, 0, 1, 3, 4, + 3, 3, 4, 4, 3, 6, 5, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, + 5, 8, 6, 6, 7, 7, 7, 7, 6, 8, + 8, 5, 7, 3, 1, 1, 1, 1, 0, 2, + 6, 1, 0, 1, 2, 0, 3, 0, 3, 3, + 3, 3, 0, 8, 0, 9, 0, 9, 5, 2, + 3, 1, 3, 3, 3, 3, 1, 0, 5, 3, + 1, 3, 1, 0, 11, 1, 1, 4, 1, 1, + 2, 3, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 3, 2, 2, 3, 2, + 5, 4, 1, 5, 1, 1, 1, 1, 1, 1, + 2, 1, 3, 2, 2, 3, 3, 2, 0, 1, + 2, 2, 3, 9, 9, 8, 14, 1, 1, 6, + 5, 2, 2, 6, 7, 4, 4, 6, 6, 0, + 0, 3, 2, 3, 2, 1, 5, 5, 6, 6, + 6, 6, 4, 6, 4, 4, 6, 6, 2, 8, + 1, 1, 0, 3, 6, 3, 6, 2, 5, 7, + 5, 4, 4, 7 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -2074,77 +2092,78 @@ means the default is an error. */ static const yytype_uint16 yydefact[] = { - 74, 61, 71, 62, 72, 63, 220, 218, 0, 0, - 0, 0, 0, 0, 85, 73, 0, 74, 216, 89, - 92, 0, 0, 232, 0, 0, 68, 0, 75, 76, + 74, 61, 71, 62, 72, 63, 227, 225, 0, 0, + 0, 0, 0, 0, 85, 73, 0, 74, 223, 89, + 92, 0, 0, 239, 0, 0, 68, 0, 75, 76, 78, 77, 79, 82, 80, 83, 81, 84, 86, 87, - 88, 85, 85, 211, 1, 217, 90, 91, 85, 221, - 93, 94, 95, 96, 85, 291, 219, 291, 0, 0, - 240, 233, 234, 222, 277, 278, 224, 141, 142, 143, - 146, 145, 144, 147, 148, 0, 0, 0, 0, 279, - 280, 149, 223, 151, 211, 211, 97, 210, 0, 100, - 100, 292, 287, 69, 251, 252, 253, 286, 235, 236, - 239, 0, 169, 152, 0, 0, 0, 0, 158, 170, - 0, 0, 169, 0, 0, 0, 99, 98, 0, 208, - 209, 0, 0, 101, 102, 103, 104, 105, 106, 0, - 254, 0, 0, 335, 335, 290, 0, 237, 168, 118, - 164, 166, 0, 0, 0, 0, 0, 0, 157, 0, - 0, 150, 0, 0, 163, 0, 162, 0, 231, 141, - 142, 143, 146, 145, 144, 0, 0, 67, 67, 107, - 0, 248, 249, 250, 70, 334, 318, 0, 0, 0, - 0, 100, 300, 301, 2, 3, 4, 5, 6, 7, + 88, 85, 85, 218, 1, 224, 90, 91, 85, 228, + 93, 94, 95, 96, 85, 298, 226, 298, 0, 0, + 247, 240, 241, 229, 284, 285, 231, 148, 149, 150, + 153, 152, 151, 154, 155, 0, 0, 0, 0, 286, + 287, 156, 230, 158, 218, 218, 97, 217, 0, 100, + 100, 299, 294, 69, 258, 259, 260, 293, 242, 243, + 246, 0, 176, 159, 0, 0, 0, 0, 165, 177, + 0, 0, 176, 0, 0, 0, 99, 98, 0, 215, + 216, 0, 0, 101, 102, 103, 104, 105, 106, 0, + 261, 0, 0, 342, 342, 297, 0, 244, 175, 118, + 171, 173, 0, 0, 0, 0, 0, 0, 164, 0, + 0, 157, 0, 0, 170, 0, 169, 0, 238, 148, + 149, 150, 153, 152, 151, 0, 0, 67, 67, 107, + 0, 255, 256, 257, 70, 341, 325, 0, 0, 0, + 0, 100, 307, 308, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 288, 100, 304, 0, 333, 289, 305, 238, 161, - 0, 126, 67, 67, 160, 0, 171, 0, 126, 67, - 67, 0, 212, 189, 190, 185, 187, 186, 188, 191, - 184, 180, 181, 0, 0, 0, 0, 0, 0, 0, + 0, 295, 100, 311, 0, 340, 296, 312, 245, 168, + 0, 126, 67, 67, 167, 0, 178, 0, 126, 67, + 67, 0, 219, 196, 197, 192, 194, 193, 195, 198, + 191, 187, 188, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 183, 182, 225, 0, 317, 294, 67, 284, 293, + 0, 190, 189, 232, 0, 324, 301, 67, 291, 300, 0, 0, 55, 0, 0, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 0, 53, 54, 49, 50, 51, 52, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 0, 0, 0, 132, 132, 340, 67, 67, - 331, 0, 0, 0, 0, 0, 67, 67, 67, 67, + 47, 48, 0, 0, 0, 139, 139, 347, 67, 67, + 338, 0, 0, 0, 0, 0, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 109, 111, 110, 108, - 112, 113, 114, 115, 116, 119, 167, 165, 154, 155, - 156, 159, 66, 153, 227, 229, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 173, 207, - 0, 0, 0, 177, 0, 174, 0, 0, 0, 137, - 246, 257, 258, 259, 260, 261, 266, 262, 263, 264, - 265, 255, 0, 0, 0, 0, 275, 282, 281, 283, - 0, 0, 295, 0, 0, 67, 67, 67, 67, 0, - 336, 0, 338, 313, 0, 0, 0, 0, 0, 0, + 112, 113, 114, 115, 116, 119, 174, 172, 161, 162, + 163, 166, 66, 160, 234, 236, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 180, 214, + 0, 0, 0, 184, 0, 181, 0, 0, 0, 144, + 253, 264, 265, 266, 267, 268, 273, 269, 270, 271, + 272, 262, 0, 0, 0, 0, 282, 289, 288, 290, + 0, 0, 302, 0, 0, 67, 67, 67, 67, 0, + 343, 0, 345, 320, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 0, - 117, 123, 122, 120, 121, 124, 125, 127, 137, 137, - 0, 0, 0, 0, 0, 313, 0, 0, 0, 0, - 0, 0, 0, 172, 158, 170, 0, 175, 176, 0, - 0, 0, 0, 226, 245, 118, 243, 0, 256, 0, - 269, 0, 0, 0, 272, 0, 270, 285, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 344, 0, - 0, 0, 327, 328, 0, 0, 0, 0, 345, 0, - 0, 0, 325, 0, 132, 0, 228, 230, 67, 0, + 117, 123, 122, 120, 121, 124, 125, 127, 144, 144, + 0, 0, 0, 0, 0, 320, 0, 0, 0, 0, + 0, 0, 0, 179, 165, 177, 0, 182, 183, 0, + 0, 0, 0, 233, 252, 118, 250, 0, 263, 0, + 276, 0, 0, 0, 279, 0, 277, 292, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 351, 0, + 0, 0, 334, 335, 0, 0, 0, 0, 352, 0, + 0, 0, 332, 0, 139, 0, 235, 237, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 206, 179, 0, 0, 0, 0, 0, 0, 139, 137, - 65, 0, 126, 0, 268, 158, 0, 267, 271, 0, - 0, 312, 0, 0, 0, 0, 132, 133, 132, 0, - 0, 0, 0, 0, 0, 343, 315, 0, 67, 319, - 320, 312, 0, 341, 67, 213, 0, 0, 0, 0, - 193, 0, 0, 0, 0, 204, 0, 178, 0, 0, - 67, 134, 140, 138, 64, 242, 244, 118, 135, 0, - 274, 0, 0, 0, 118, 118, 0, 321, 322, 323, - 324, 337, 339, 314, 0, 0, 326, 329, 330, 316, - 0, 0, 132, 0, 0, 0, 0, 0, 201, 0, - 0, 0, 195, 196, 192, 65, 136, 130, 276, 273, - 0, 0, 0, 0, 126, 0, 306, 0, 346, 126, - 342, 197, 198, 199, 200, 0, 0, 0, 205, 241, - 0, 128, 0, 298, 0, 0, 109, 111, 118, 118, - 0, 118, 118, 307, 332, 194, 202, 203, 131, 0, - 247, 296, 0, 297, 0, 309, 308, 0, 0, 0, - 129, 0, 0, 0, 118, 118, 0, 0, 0, 311, - 310, 303, 0, 0, 302, 0, 299 + 213, 186, 0, 0, 0, 0, 0, 0, 146, 144, + 65, 0, 126, 0, 275, 165, 0, 274, 278, 0, + 0, 319, 0, 0, 0, 0, 139, 140, 139, 0, + 0, 0, 0, 0, 0, 350, 322, 0, 67, 326, + 327, 319, 0, 348, 67, 220, 0, 0, 0, 0, + 200, 0, 0, 0, 0, 211, 0, 185, 0, 0, + 67, 141, 147, 145, 64, 249, 251, 118, 142, 0, + 281, 0, 0, 0, 118, 118, 0, 328, 329, 330, + 331, 344, 346, 321, 0, 0, 333, 336, 337, 323, + 0, 0, 139, 0, 0, 0, 0, 0, 208, 0, + 0, 0, 202, 203, 199, 65, 143, 137, 283, 280, + 0, 0, 0, 0, 126, 0, 313, 0, 353, 126, + 349, 204, 205, 206, 207, 0, 0, 0, 212, 248, + 0, 135, 0, 305, 0, 0, 109, 111, 118, 118, + 0, 118, 118, 314, 339, 201, 209, 210, 138, 0, + 133, 303, 0, 304, 0, 316, 315, 0, 0, 0, + 136, 0, 254, 0, 0, 0, 118, 118, 0, 0, + 0, 0, 318, 317, 0, 132, 0, 128, 310, 0, + 0, 0, 134, 0, 309, 0, 131, 130, 129, 306 }; /* YYDEFGOTO[NTERM-NUM]. */ @@ -2152,596 +2171,605 @@ { -1, 278, 279, 280, 305, 322, 165, 166, 79, 595, 113, 12, 134, 80, 14, 15, 41, 42, 43, 48, - 54, 118, 129, 355, 239, 447, 358, 680, 661, 420, - 538, 637, 473, 539, 81, 167, 140, 157, 141, 142, - 110, 379, 406, 380, 121, 88, 158, 16, 17, 18, - 20, 19, 389, 448, 449, 63, 23, 61, 101, 476, - 477, 130, 173, 55, 96, 56, 49, 479, 407, 83, - 409, 288, 289, 57, 92, 93, 231, 665, 135, 330, - 606, 498, 508, 232, 233, 234, 235 + 54, 118, 129, 355, 239, 447, 358, 706, 707, 692, + 680, 661, 420, 538, 637, 473, 539, 81, 167, 140, + 157, 141, 142, 110, 379, 406, 380, 121, 88, 158, + 16, 17, 18, 20, 19, 389, 448, 449, 63, 23, + 61, 101, 476, 477, 130, 173, 55, 96, 56, 49, + 479, 407, 83, 409, 288, 289, 57, 92, 93, 231, + 665, 135, 330, 606, 498, 508, 232, 233, 234, 235 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -615 +#define YYPACT_NINF -630 static const yytype_int16 yypact[] = { - 498, -615, -615, -615, -615, -615, -615, -615, 2, -101, - 46, -19, 101, -9, 227, -615, 168, 547, -615, 49, - 266, 22, 25, -615, 24, 170, -615, 1932, -615, -615, - -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, - -615, -81, -81, 181, -615, -615, -615, -615, -81, -615, - -615, -615, -615, -615, -81, 205, -615, -10, 197, 212, - 219, -615, -615, -615, -615, -615, 97, -615, -615, -615, - -615, -615, -615, -615, -615, 259, 263, 3, 629, -615, - -615, -615, -12, -615, 240, 240, 211, -615, 142, 387, - 387, -615, -615, 77, -615, -615, -615, -615, -615, -615, - -615, -53, 1650, -615, 120, 143, 811, 97, -615, -12, - -112, 173, 1650, 166, 142, 142, -615, -615, 1691, -615, - -615, 1950, 335, -615, -615, -615, -615, -615, -615, 1979, - -615, -8, 184, 2213, 2213, -615, 325, -615, -615, -12, - -615, 193, 196, 1997, 1997, 189, -104, 1997, -615, 355, - 202, -615, 1950, 1997, 97, 204, -12, 242, -615, 41, - 353, 354, 361, 362, 366, 277, 368, 1514, 323, -615, - 141, -615, -615, -615, -615, -615, -615, 322, 2038, 72, - 369, 387, -615, -615, -615, -615, -615, -615, -615, -615, - -615, -615, -615, -615, -615, -615, -615, -615, -615, 559, - 285, 559, 285, 1997, 1997, 1997, 1997, -615, -615, -615, - -615, -615, -615, -615, -615, -615, -615, -615, -615, 1997, - 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, - 1997, -615, 387, -615, 104, -615, -615, -615, -615, 183, - 1709, -615, -34, -41, -615, 238, -12, 249, -615, 323, - -29, 1691, -615, -615, -615, -615, -615, -615, -615, -615, - -615, -615, -615, 559, 285, 559, 285, 251, 252, 255, - 256, 257, 261, 262, 1750, 2056, 1131, 394, 264, 265, - 268, -615, -615, -615, 269, -615, 97, 913, -615, 272, - 1081, 1081, -615, 1081, 1979, -615, -615, -615, -615, -615, - -615, -615, -615, -615, -615, 1997, -615, -615, -615, -615, - -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, - -615, -615, 1997, 1997, 1997, -28, 67, -615, 913, -33, - 273, 274, 275, 276, 282, 284, 913, 913, 913, 913, - 913, 385, 1979, 1997, 1997, 423, -615, -615, -615, -615, - -615, -615, -615, -615, -615, -615, -615, -615, 198, -615, - -615, -615, -615, 198, -615, 166, 390, 280, 288, 289, - 300, 1950, 1950, 1950, 1950, 1950, 1950, 1950, -615, -615, - -52, 1175, -107, -615, -79, -615, 1950, 1950, 1950, 298, - 1769, -615, -615, -615, -615, -615, -615, -615, -615, -615, - -615, 398, 1813, 2112, 1408, 407, -615, -615, -615, -615, - 1997, 301, -615, 302, 1081, 913, 913, 913, 913, 18, - -615, 28, -615, -615, 1081, 297, 1997, 1997, 1997, 1997, - 1997, 306, 308, 311, 316, 317, 1997, 1081, 913, 318, - -615, -615, -615, -615, -615, -615, -615, -615, 298, 298, - 1997, 1950, 1950, 1950, 1950, -615, 319, 321, 324, 326, - 308, 336, 1950, -615, 315, 1362, -58, -615, -615, 337, - 339, 447, 15, -615, -615, -12, 340, 343, -615, 473, - -615, -40, 1454, -106, -615, -2, -615, -615, 486, 487, - 348, 346, 347, 359, 363, 1081, 504, 1081, 364, 367, - 1081, 370, -12, -615, 371, 372, 522, 530, 379, 1997, - 1081, 1081, -12, 389, 382, 1997, -615, -615, -14, 388, - 391, 392, 393, 134, 1950, 1950, 1950, 1950, 135, 1950, - -615, -615, 397, 1950, 1950, 1997, 527, 551, -615, 298, - 40, 1871, -615, 396, -615, 401, 52, -615, -615, 1081, - 1081, 2159, 1081, 1081, 1081, 1081, 382, -615, 382, 1997, - 1081, 399, 1997, 1997, 1997, -615, -615, 553, 913, -615, - -615, 2159, 506, -615, 913, -615, 1950, 1950, 1950, 1950, - -615, 412, 403, 413, 414, -615, 308, -615, 417, 418, - 8, -615, -615, -615, -615, -615, -615, -12, 4, 557, - -615, 416, 420, 421, -4, -12, 161, -615, -615, -615, - -615, -615, -615, -615, 422, 1081, -615, -615, -615, -615, - 308, 162, 382, 427, 428, 435, 436, 1950, -615, 1950, - 1950, 188, -615, -615, -615, 40, -615, 541, -615, -615, - 564, 5, 761, 761, -615, 2218, -615, 431, 379, -615, - -615, -615, -615, -615, -615, 439, 442, 443, -615, -615, - 598, 451, 1081, -615, 1227, 7, 448, 449, -615, -615, - 100, -4, -12, -615, 198, -615, -615, -615, -615, 588, - -615, -615, 454, -615, 1227, 183, 183, 600, 761, 761, - -615, 601, 455, 1081, -615, -615, 1081, 603, 549, 183, - 183, -615, 1081, 604, -615, 1081, -615 + 247, -630, -630, -630, -630, -630, -630, -630, 30, -108, + 28, -66, 102, -40, -1, -630, 128, 668, -630, 29, + 248, 21, 44, -630, -28, 143, -630, 1914, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, 191, 191, 170, -630, -630, -630, -630, 191, -630, + -630, -630, -630, -630, 191, 167, -630, -7, 190, 210, + 221, -630, -630, -630, -630, -630, 114, -630, -630, -630, + -630, -630, -630, -630, -630, 289, 315, 3, 50, -630, + -630, -630, -32, -630, 252, 252, 171, -630, 280, 189, + 189, -630, -630, 324, -630, -630, -630, -630, -630, -630, + -630, 57, 1662, -630, 153, 165, 313, 114, -630, -32, + -84, 204, 1662, 214, 280, 280, -630, -630, 1614, -630, + -630, 1955, 366, -630, -630, -630, -630, -630, -630, 1996, + -630, -18, 219, 2230, 2230, -630, 354, -630, -630, -32, + -630, 234, 260, 2040, 2040, 256, -80, 2040, -630, 411, + 275, -630, 1955, 2040, 114, 278, -32, 222, -630, 282, + 438, 439, 440, 441, 442, 158, 443, 1568, 398, -630, + 86, -630, -630, -630, -630, -630, -630, 400, 2081, 105, + 447, 189, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, 480, + 284, 480, 284, 2040, 2040, 2040, 2040, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, 2040, + 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, 2040, + 2040, -630, 189, -630, 55, -630, -630, -630, -630, 424, + 1703, -630, -19, -36, -630, 287, -32, 297, -630, 398, + 13, 1614, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, 480, 284, 480, 284, 299, 300, 306, + 307, 310, 317, 320, 1744, 2122, 541, 453, 323, 326, + 328, -630, -630, -630, 330, -630, 114, 984, -630, 312, + 1157, 1157, -630, 1157, 1996, -630, -630, -630, -630, -630, + -630, -630, -630, -630, -630, 2040, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, -630, 2040, 2040, 2040, -17, 24, -630, 984, -39, + 336, 337, 341, 342, 343, 345, 984, 984, 984, 984, + 984, 457, 1996, 2040, 2040, 509, -630, -630, -630, -630, + -630, -630, -630, -630, -630, -630, -630, -630, 283, -630, + -630, -630, -630, 283, -630, 214, 486, 364, 365, 367, + 368, 1955, 1955, 1955, 1955, 1955, 1955, 1955, -630, -630, + 63, 650, 54, -630, -70, -630, 1955, 1955, 1955, 363, + 1788, -630, -630, -630, -630, -630, -630, -630, -630, -630, + -630, 470, 1829, 2166, 755, 510, -630, -630, -630, -630, + 2040, 369, -630, 374, 1157, 984, 984, 984, 984, 42, + -630, 43, -630, -630, 1157, 373, 2040, 2040, 2040, 2040, + 2040, 377, 378, 379, 385, 397, 2040, 1157, 984, 403, + -630, -630, -630, -630, -630, -630, -630, -630, 363, 363, + 2040, 1955, 1955, 1955, 1955, -630, 406, 420, 423, 425, + 378, 427, 1955, -630, 417, 1432, -60, -630, -630, 428, + 429, 557, 17, -630, -630, -32, 431, 445, -630, 580, + -630, 177, 1034, 129, -630, -24, -630, -630, 588, 592, + 448, 446, 449, 450, 451, 1157, 608, 1157, 452, 460, + 1157, 463, -32, -630, 469, 471, 609, 614, 472, 2040, + 1157, 1157, -32, 476, 475, 2040, -630, -630, -6, 477, + 479, 482, 483, 141, 1955, 1955, 1955, 1955, 202, 1955, + -630, -630, 473, 1955, 1955, 2040, 600, 637, -630, 363, + 481, 1870, -630, 484, -630, 474, -21, -630, -630, 1157, + 1157, 2207, 1157, 1157, 1157, 1157, 475, -630, 475, 2040, + 1157, 485, 2040, 2040, 2040, -630, -630, 647, 984, -630, + -630, 2207, 598, -630, 984, -630, 1955, 1955, 1955, 1955, + -630, 489, 492, 491, 506, -630, 378, -630, 512, 513, + 47, -630, -630, -630, -630, -630, -630, -32, -5, 655, + -630, 507, 516, 514, 4, -32, 212, -630, -630, -630, + -630, -630, -630, -630, 515, 1157, -630, -630, -630, -630, + 378, 242, 475, 521, 526, 532, 533, 1955, -630, 1955, + 1955, 243, -630, -630, -630, 481, -630, 643, -630, -630, + 684, 1, 827, 827, -630, 2248, -630, 534, 472, -630, + -630, -630, -630, -630, -630, 539, 540, 542, -630, -630, + 702, 554, 1157, -630, 1296, 2, 548, 549, -630, -630, + 40, 4, -32, -630, 283, -630, -630, -630, -630, 691, + 562, -630, 552, -630, 1296, 424, 424, 701, 827, 827, + -630, 559, -630, 705, 558, 1157, -630, -630, 147, 1157, + 708, 645, 424, 424, 563, -630, 266, -630, -630, 1157, + 709, 188, -630, 147, -630, 1157, -630, -630, -630, -630 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -615, 96, 112, 190, -165, -160, -178, -615, 0, -11, - -140, 533, -615, 6, -615, -615, -615, -615, 37, -615, - -615, -615, -144, -615, -463, -615, -238, -615, -615, -323, - 29, -615, -424, -615, -615, -26, 410, -125, -615, 516, - 523, -86, -162, -267, 200, 267, 380, -615, -615, 613, - -615, -615, -615, -615, -615, -615, -615, -615, -615, -615, - -615, 542, -615, -615, -615, -615, -615, -615, -614, -80, - 174, -190, -615, -615, 576, -615, 500, -615, -615, -615, - 76, 209, -447, -615, 531, -615, -615 + -630, 220, 223, 285, -181, -175, -174, -630, 0, 94, + -142, 638, -630, 11, -630, -630, -630, -630, 71, -630, + -630, -630, -144, -630, -226, -630, -227, -630, 26, -630, + -630, -630, -308, 132, -630, -424, -630, -630, -26, 494, + -126, -630, 628, 635, -113, -165, -271, 318, 352, 493, + -630, -630, 725, -630, -630, -630, -630, -630, -630, -630, + -630, -630, -630, -630, 656, -630, -630, -630, -630, -630, + -630, -629, -56, 183, -190, -630, -630, 688, -630, 613, + -630, -630, -630, 178, 293, -451, -630, 616, -630, -630 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -216 +#define YYTABLE_NINF -223 static const yytype_int16 yytable[] = { - 11, 82, 293, 422, 170, 281, 13, 105, 382, 384, - 363, 91, 540, 528, 111, 327, 292, 11, 292, 94, - 171, 111, 111, 13, 516, 517, 111, 111, 283, 495, - 331, 332, 333, 334, 335, 168, 323, 294, 536, 497, - 341, 111, 324, 111, -55, -55, -55, -55, 147, 536, - 682, -147, 109, 462, 462, 21, 147, 148, 24, 1, - 467, 547, 3, 111, 5, 245, 249, 253, 254, 537, - 692, 22, 496, 38, 39, 40, 139, 252, 84, 85, - 109, 462, 496, 290, 132, 89, 139, 282, 342, 291, - 468, 90, 156, 11, 345, 46, 1, 47, 367, 3, - 369, 5, 462, 156, 368, 25, 370, 136, 462, 364, - 365, 532, 137, 463, 466, 593, 112, 242, 243, 27, - 462, 246, 111, 112, 112, 544, 360, 250, 112, 112, - 424, 359, 419, -67, 635, 481, 483, 485, 687, 631, - 26, 642, 643, 112, 575, 112, 441, 442, 443, -67, - 28, 444, 287, -147, 439, 445, 446, -147, 462, 95, - 172, 2, 346, 347, 4, 112, 634, 548, 44, 414, - 663, 106, 683, 648, 119, 120, 284, 325, 326, 287, - 328, 58, 348, 349, 59, 350, 351, 60, 352, 353, - 354, 573, 62, 329, 287, 287, 287, 287, 287, 336, - 337, 338, 339, 340, 287, 685, 686, 408, 688, 689, - 408, 408, 462, 408, 139, 546, 86, 437, 87, 98, - 487, 601, 343, 344, 112, 156, 91, 421, -67, 228, - 228, 699, 700, 611, 99, 612, 501, 345, 503, 504, - 505, 100, 441, 442, 443, 229, 229, 444, 408, 64, - 65, 445, 446, 116, 102, 117, 408, 408, 408, 408, - 408, 1, 2, 103, 3, 4, 5, 104, 156, 29, - 30, 31, 32, 33, 34, 35, 36, 87, 37, 415, - 255, 256, 257, 258, 143, 455, 456, 457, 458, 459, - 460, 461, 580, 585, 559, 567, 416, 417, 418, 650, - 469, 470, 471, 281, 598, 346, 347, 144, 50, 51, - 52, 306, 307, 53, 152, 153, 156, 438, 287, 644, - 649, 645, 645, 230, 230, 348, 349, 151, 350, 351, - 149, 352, 353, 354, 408, 408, 408, 408, 408, 169, - 441, 442, 443, 174, 408, 444, 658, 238, 567, 445, - 446, 114, 115, 240, 241, 465, 244, 408, 408, 247, - 248, 251, -56, -57, 475, 519, 520, 521, 522, 613, - -60, -59, 616, 617, 618, -58, 530, 259, 111, 285, - 292, 38, 39, 40, 287, 282, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 287, 502, 287, 287, 287, 361, 670, 362, 371, 372, - 512, 674, 373, 374, 375, 408, 385, 408, 376, 377, - 408, 386, 387, 436, 518, 388, 390, 440, 450, 486, - 408, 408, 410, 425, 426, 427, 428, 451, 581, 582, - 583, 584, 429, 586, 430, 452, 453, 588, 589, 122, - 123, 124, 125, 126, 127, 128, 465, 454, 472, 478, - 500, 488, 489, 664, 411, 412, 506, 413, 507, 408, - 408, 509, 408, 408, 408, 408, 510, 511, 515, 524, - 408, 525, 531, 568, 526, 535, 527, 684, 408, 574, - 623, 624, 625, 626, 408, 543, 529, 533, -215, 534, - 541, 542, 423, 549, 550, 551, 552, 553, 557, 590, - 431, 432, 433, 434, 435, 597, -69, 1, 2, 554, - 3, 4, 5, 555, 559, 605, 565, 560, 6, 7, - 562, 563, 564, 287, 566, 408, 287, 287, 287, 567, - 594, 655, 572, 656, 657, 605, 571, -214, 576, 591, - 8, 577, 578, 579, 9, 592, 599, 619, 10, 615, - 496, 628, 408, 408, 587, -69, 1, 2, 600, 3, - 4, 5, 627, 629, 630, 632, 633, 6, 7, 638, - 640, 662, 408, 639, 641, 651, 652, 646, 490, 491, - 492, 493, 494, 653, 654, 660, 673, 675, 499, 8, - 676, 677, 678, 9, 679, -18, -19, 10, 408, 408, - 690, 513, 514, 408, 691, 697, 408, 693, 696, 672, - 702, 705, 408, 703, 659, 408, 133, 636, 150, 146, - 45, 366, 131, 97, 236, 594, 64, 65, 0, 107, - 67, 68, 69, 70, 71, 72, 73, 621, 1, 2, - 357, 3, 4, 5, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 523, 237, 0, 0, 0, 556, - 0, 558, 0, 0, 561, 0, 0, 0, 0, 74, - 0, 0, 0, 0, 569, 570, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 602, 603, 0, 607, 608, 609, 610, - 0, 0, 0, 0, 614, 0, 0, 0, 0, 0, - 0, 0, 620, 0, 0, 0, 0, 0, 622, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 391, 392, 393, 394, 64, 65, - 395, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 3, 4, 5, 396, 397, 398, 647, - 0, 75, 76, 0, 0, 77, 0, 78, 108, 0, - 0, 399, 400, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 345, 668, 669, 64, 65, - 401, 107, 67, 68, 69, 70, 71, 72, 73, 0, - 1, 2, 0, 3, 4, 5, 681, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 263, 264, 265, 266, 0, 0, 0, 0, - 0, 74, 694, 695, 0, 0, 0, 698, 0, 0, - 701, 0, 0, 0, 0, 0, 704, 0, 0, 706, - 0, 267, 207, 666, 667, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 0, 268, 0, 269, 270, 271, - 0, 272, 273, 348, 349, 0, 350, 351, 0, 352, - 353, 354, 0, 0, 0, 0, 391, 392, 393, 394, - 64, 65, 395, 0, 402, 0, 0, 403, 0, 404, - 0, 405, 1, 2, 0, 3, 4, 5, 396, 397, - 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 399, 400, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, - 0, 0, 401, 75, 76, 0, 0, 77, 0, 78, - 145, 0, 0, 0, 0, 0, 0, 0, 0, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 263, 264, 265, 266, 0, 0, + 11, 82, 281, 170, 382, 384, 293, 105, 168, 528, + 171, 13, 292, 292, 91, 327, 111, 11, 422, 111, + 323, 363, 94, 111, 516, 517, 283, 324, 13, 536, + 331, 332, 333, 334, 335, 682, 111, 294, 111, 249, + 341, 29, 30, 31, 32, 33, 34, 35, 36, 111, + 37, 536, 109, 495, 497, 694, 24, 64, 65, -154, + 107, 67, 68, 69, 70, 71, 72, 73, 111, 1, + 2, 537, 3, 4, 5, 46, 139, 47, 687, 111, + 109, 147, 367, 21, 369, 147, 139, 25, 342, 368, + 148, 370, 156, 11, 245, 462, 496, 496, 26, 22, + 74, 252, 111, 156, 468, 462, 2, 364, 365, 4, + 466, 282, 84, 85, 532, 593, 290, 242, 243, 89, + 27, 246, 291, 112, 28, 90, 112, 250, 44, 424, + 112, 481, 483, 485, -67, 631, 360, 441, 442, 443, + 60, 462, 444, 112, 462, 112, 445, 446, 419, -67, + 548, 359, 287, 601, 439, 172, 112, 575, 38, 39, + 40, 255, 256, 257, 258, 62, -154, 95, 414, 648, + -154, 663, 683, 343, 344, 112, 106, 325, 326, 287, + 328, 284, 441, 442, 443, 58, 112, 444, 91, 421, + -67, 445, 446, 329, 287, 287, 287, 287, 287, 336, + 337, 338, 339, 340, 287, 86, 573, 87, 59, 112, + 634, 546, 98, 116, 139, 117, 437, 75, 76, 462, + 487, 77, 136, 78, 108, 156, 467, 137, 462, 64, + 65, 408, 99, 463, 408, 408, 501, 408, 503, 504, + 505, 1, 2, 100, 3, 4, 5, -222, 611, 540, + 612, 122, 123, 124, 125, 126, 127, 128, 455, 456, + 457, 458, 459, 460, 461, -69, 1, 2, 156, 3, + 4, 5, 408, 469, 470, 471, 102, 6, 7, 415, + 408, 408, 408, 408, 408, -55, -55, -55, -55, 87, + 50, 51, 52, 103, 462, 53, 416, 417, 418, 8, + 281, 547, 704, 9, 580, 705, 559, 10, 253, 254, + 306, 307, 119, 120, 650, 598, 156, 438, 287, 104, + 64, 65, 143, 107, 67, 68, 69, 70, 71, 72, + 73, 132, 1, 2, 144, 3, 4, 5, 519, 520, + 521, 522, 462, 1, 716, 717, 3, 544, 5, 530, + 38, 39, 40, 228, 228, 465, 229, 229, 408, 408, + 408, 408, 408, 74, 475, 585, 149, 567, 408, 613, + 169, 635, 616, 617, 618, 644, 238, 645, 642, 643, + 151, 408, 408, 174, 287, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 240, + 287, 502, 287, 287, 287, 649, 658, 645, 567, 282, + 512, 581, 582, 583, 584, 247, 586, 670, 230, 230, + 588, 589, 674, 241, 518, 441, 442, 443, 244, 712, + 444, 713, 152, 153, 445, 446, 114, 115, 248, 408, + 251, 408, 685, 686, 408, 688, 689, -56, -57, -60, + -59, -58, 259, 111, 408, 408, 465, 285, 292, 361, + 362, 371, 372, 623, 624, 625, 626, 664, 373, 374, + 702, 703, 375, 411, 412, 385, 413, 410, 345, 376, + 75, 76, 377, 568, 77, 386, 78, 145, 387, 574, + 388, 684, 390, 408, 408, 436, 408, 408, 408, 408, + 1, 425, 426, 3, 408, 5, 427, 428, 429, 590, + 430, 423, 408, 440, 655, 597, 656, 657, 408, 431, + 432, 433, 434, 435, 450, 605, 451, 452, 472, 453, + 454, 478, 486, 287, 488, 345, 287, 287, 287, 489, + 594, 500, 506, 507, 509, 605, 346, 347, 64, 65, + 510, 107, 159, 160, 161, 162, 163, 164, 73, 408, + 1, 2, 511, 3, 4, 5, 348, 349, 515, 350, + 351, 524, 352, 353, 354, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 525, 408, 408, 526, 531, + 527, 74, 529, 533, 534, 535, 541, 490, 491, 492, + 493, 494, 543, 346, 347, 549, 408, 499, 542, 550, + 551, 552, 557, 565, 553, 554, 555, 559, 566, 672, + 513, 514, 591, 348, 349, 560, 350, 351, 562, 352, + 353, 354, 408, 408, 563, 594, 564, 567, 571, 408, + 572, 592, 576, 408, 577, 587, 600, 578, 579, 599, + 615, 619, 496, 408, 627, 628, 629, 64, 65, 408, + 107, 159, 160, 161, 162, 163, 164, 73, -221, 1, + 2, 630, 3, 4, 5, 632, 633, 638, 556, 639, + 558, 640, 641, 561, 651, 646, -69, 1, 2, 652, + 3, 4, 5, 569, 570, 653, 654, 660, 6, 7, + 74, 662, 675, 676, 673, 677, 678, 679, 75, 76, + -18, -19, 77, 690, 78, 383, 691, 693, 695, 710, + 8, 698, 699, 700, 9, 709, 715, 711, 10, 659, + 636, 133, 602, 603, 357, 607, 608, 609, 610, 718, + 150, 146, 45, 614, 366, 97, 131, 236, 523, 621, + 237, 620, 0, 0, 0, 0, 0, 622, 0, 0, + 0, 0, 64, 65, 0, 107, 159, 160, 161, 162, + 163, 164, 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 647, 0, + 0, 0, 0, 0, 0, 74, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 75, 76, 0, + 0, 77, 0, 78, 464, 668, 669, 0, 0, 0, + 391, 392, 393, 394, 64, 65, 395, 0, 0, 0, + 0, 0, 0, 0, 0, 681, 1, 2, 0, 3, + 4, 5, 396, 397, 398, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 399, 400, 0, + 0, 696, 697, 0, 0, 0, 0, 0, 701, 0, + 0, 345, 708, 0, 0, 0, 401, 0, 0, 0, + 0, 0, 714, 0, 0, 0, 0, 0, 719, 0, + 0, 0, 0, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 263, 264, + 265, 266, 75, 76, 0, 0, 77, 0, 78, 484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 267, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 0, 268, 0, 269, - 270, 271, 0, 272, 273, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 267, 207, 666, + 667, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 0, 268, 0, 269, 270, 271, 0, 272, 273, 348, + 349, 0, 350, 351, 0, 352, 353, 354, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 391, 392, 393, + 394, 64, 65, 395, 0, 402, 0, 0, 403, 0, + 404, 0, 405, 1, 2, 0, 3, 4, 5, 396, + 397, 398, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 399, 400, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, + 0, 64, 65, 401, 107, 159, 160, 161, 162, 163, + 164, 73, 0, 1, 2, 0, 3, 4, 5, 0, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 263, 264, 265, 266, 0, + 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 112, 0, 0, 0, 0, 0, 402, 0, 0, 403, - 0, 404, 0, 405, 391, 392, 393, 394, 64, 65, - 395, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 3, 4, 5, 396, 397, 398, 0, + 0, 0, 0, 0, 267, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 0, 268, 0, + 269, 270, 271, 0, 272, 273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 399, 400, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, - 401, 107, 159, 160, 161, 162, 163, 164, 73, 0, - 1, 2, 0, 3, 4, 5, 0, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 263, 264, 265, 266, 0, 0, 0, 0, - 0, 74, 64, 65, 0, 107, 159, 160, 161, 162, - 163, 164, 73, 0, 1, 2, 0, 3, 4, 5, - 0, 267, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 0, 268, 0, 269, 270, 271, - 0, 272, 273, 0, 0, 74, 0, 0, 0, 0, - 391, 392, 393, 394, 0, 0, 395, 0, 0, 0, - 0, 0, 0, 0, 402, 0, 0, 403, 0, 404, - 0, 405, 396, 397, 398, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 112, 0, 0, 0, + 0, 0, 402, 0, 0, 403, 0, 404, 0, 405, + 391, 392, 393, 394, 64, 65, 395, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 2, 0, 3, + 4, 5, 396, 397, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 399, 400, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 75, 76, 0, 0, 77, 0, 78, 545, 0, 0, 0, 0, 0, 0, 0, 401, 0, 0, 0, - 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, - 383, 0, 0, 184, 185, 186, 187, 188, 189, 190, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 263, 264, 265, 266, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 75, 76, 0, - 0, 77, 0, 78, 464, 0, 0, 267, 207, 208, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 267, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 0, 268, 0, 269, 270, 271, 0, 272, 273, 64, + 0, 268, 0, 269, 270, 271, 0, 272, 273, 391, + 392, 393, 394, 0, 0, 395, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 396, 397, 398, 0, 402, 0, 0, 403, 0, + 404, 0, 405, 0, 0, 0, 399, 400, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 401, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 263, 264, 265, + 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 267, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 0, + 268, 0, 269, 270, 271, 0, 272, 273, 0, 64, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 3, 4, 5, 260, 0, 0, - 402, 0, 0, 403, 0, 404, 0, 405, 0, 0, - 0, 0, 261, 262, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 64, 65, 111, 107, 159, - 160, 161, 162, 163, 164, 73, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 184, 185, + 0, 0, 0, 0, 402, 0, 0, 403, 0, 404, + 0, 405, 261, 262, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 263, 264, 265, 266, 0, 74, 0, - 0, 64, 65, 0, 107, 159, 160, 161, 162, 163, - 164, 73, 0, 1, 2, 0, 3, 4, 5, 0, + 196, 197, 198, 263, 264, 265, 266, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 267, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 0, 268, 0, 269, 270, - 271, 0, 272, 273, 74, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, - 0, 64, 65, -67, 0, 274, 0, 0, 275, 0, - 276, 0, 277, 1, 2, 0, 3, 4, 5, 260, + 271, 0, 272, 273, 0, 64, 65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, + 3, 4, 5, 260, 112, 0, 0, 0, -67, 0, + 274, 0, 0, 275, 0, 276, 0, 277, 261, 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 261, 262, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, - 75, 76, 0, 0, 77, 0, 78, 484, 0, 0, + 0, 64, 65, 111, 154, 67, 68, 69, 70, 71, + 72, 73, 0, 1, 2, 0, 3, 4, 5, 0, + 0, 0, 0, 0, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 263, + 264, 265, 266, 0, 74, 0, 0, 0, 0, 64, + 65, 0, 107, 67, 68, 69, 70, 71, 72, 73, + 0, 1, 2, 0, 3, 4, 5, 0, 267, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 138, 268, 0, 269, 270, 271, 0, 272, 273, + 64, 65, 74, 107, 67, 68, 69, 70, 71, 72, + 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, + 112, 0, 0, 0, 0, 0, 274, 0, 0, 275, + 155, 276, 356, 277, 0, 0, 0, 0, 0, 0, + 0, 64, 65, 74, 107, 159, 160, 161, 162, 163, + 164, 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 263, 264, 265, 266, 0, - 0, 0, 0, 0, 0, 0, 75, 76, 0, 0, - 77, 0, 78, 545, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 267, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 0, 268, 0, - 269, 270, 271, 0, 272, 273, 0, 64, 65, 0, - 107, 67, 68, 69, 70, 71, 72, 73, 0, 1, - 2, 112, 3, 4, 5, 0, 0, 274, 0, 0, - 275, 0, 276, 0, 277, 0, 0, 0, 0, 138, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, - 74, 154, 67, 68, 69, 70, 71, 72, 73, 0, - 1, 2, 0, 3, 4, 5, 64, 65, 0, 107, - 67, 68, 69, 70, 71, 72, 73, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 74, 0, 0, 0, 0, 0, 0, 356, 0, - 0, 0, 0, 0, 0, 0, 0, 64, 65, 74, - 107, 159, 160, 161, 162, 163, 164, 73, 0, 1, - 2, 0, 3, 4, 5, 0, 64, 65, 0, 107, - 67, 68, 69, 70, 71, 72, 73, 0, 1, 2, + 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, + 0, 0, 0, 0, 74, 64, 65, 0, 107, 67, + 68, 69, 70, 71, 72, 73, 0, 1, 2, 0, + 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 474, 0, 75, + 76, 0, 0, 77, 0, 78, 64, 65, 74, 107, + 159, 160, 161, 162, 163, 164, 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 74, 0, 0, 0, 0, 0, 0, 0, 474, 0, - 0, 0, 75, 76, 0, 0, 77, 155, 78, 74, - 64, 65, 0, 107, 159, 160, 161, 162, 163, 164, - 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, - 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, + 75, 76, 0, 0, 77, 0, 78, 64, 65, 74, + 107, 67, 68, 69, 70, 71, 72, 73, 0, 1, + 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 596, + 0, 75, 76, 0, 378, 77, 0, 78, 0, 0, + 74, 64, 65, 0, 66, 67, 68, 69, 70, 71, + 72, 73, 0, 1, 2, 0, 3, 4, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 75, 76, 0, 0, 77, + 0, 78, 64, 65, 74, 107, 159, 160, 161, 162, + 163, 164, 73, 0, 1, 2, 0, 3, 4, 5, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 75, 76, 0, 480, + 77, 0, 78, 64, 65, 74, 154, 67, 68, 69, + 70, 71, 72, 73, 0, 1, 2, 0, 3, 4, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 75, 76, 0, + 0, 77, 0, 78, 0, 0, 74, 64, 65, 0, + 107, 67, 68, 69, 70, 71, 72, 73, 0, 1, + 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, 64, 65, - 0, 107, 67, 68, 69, 70, 71, 72, 73, 0, + 74, 286, 67, 68, 69, 70, 71, 72, 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 596, 0, 75, 76, 0, 378, 77, 0, 78, 0, - 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 75, 76, 0, 0, 77, 0, 78, 0, 64, - 65, 0, 66, 67, 68, 69, 70, 71, 72, 73, - 0, 1, 2, 0, 3, 4, 5, 64, 65, 0, - 107, 159, 160, 161, 162, 163, 164, 73, 0, 1, - 2, 0, 3, 4, 5, 75, 76, 0, 480, 77, - 0, 78, 74, 0, 0, 0, 64, 65, 0, 154, - 67, 68, 69, 70, 71, 72, 73, 0, 1, 2, - 74, 3, 4, 5, 64, 65, 0, 107, 67, 68, - 69, 70, 71, 72, 73, 0, 1, 2, 0, 3, - 4, 5, 0, 0, 0, 0, 0, 0, 0, 74, - 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, - 0, 0, 0, 0, 0, 64, 65, 74, 286, 67, - 68, 69, 70, 71, 72, 73, 0, 1, 2, 0, - 3, 4, 5, 64, 65, 0, 107, 159, 160, 161, - 162, 163, 164, 73, 0, 1, 2, 0, 3, 4, - 5, 0, 0, 0, 0, 0, 0, 0, 74, 0, - 0, 0, 0, 0, 75, 76, 0, 0, 77, 0, - 78, 0, 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, 64, - 65, 0, 107, 159, 160, 161, 162, 163, 164, 73, + 65, 74, 107, 159, 160, 161, 162, 163, 164, 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, - 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, - 76, 0, 74, 77, 0, 78, 64, 65, 0, 107, - 67, 68, 69, 70, 71, 72, 604, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 75, 76, 0, 0, 77, 0, 78, 0, 0, 74, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, + 0, 0, 74, 64, 65, 0, 107, 159, 160, 161, + 162, 163, 164, 73, 0, 1, 2, 0, 3, 4, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 75, 76, 0, + 0, 77, 0, 78, 64, 65, 74, 107, 67, 68, + 69, 70, 71, 72, 604, 0, 1, 2, 0, 3, + 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 76, - 0, 0, 77, 0, 381, 64, 65, 0, 107, 67, - 68, 69, 70, 71, 72, 671, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 175, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 74, 0, - 176, 177, 0, 0, 75, 76, 0, 0, 77, 0, - 482, 0, 0, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 0, 0, + 0, 0, 77, 0, 78, 64, 65, 74, 107, 67, + 68, 69, 70, 71, 72, 671, 175, 1, 2, 0, + 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 176, 177, 75, + 76, 0, 0, 77, 0, 381, 0, 0, 74, 0, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 0, 0, 0, 0, 0, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 482, + 0, 0, 0, 0, 0, 203, 204, 205, 0, 0, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 0, 0, 75, 76, 0, 0, 77, 0, + 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 75, 76, 0, 0, 77, 0, 78, 203, 204, - 205, 0, 0, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 75, 76, 0, 0, 77, 0, 78 + 0, 0, 0, 0, 0, 75, 76, 0, 0, 77, + 0, 78 }; static const yytype_int16 yycheck[] = { - 0, 27, 180, 326, 129, 167, 0, 4, 275, 276, - 248, 21, 475, 460, 55, 205, 11, 17, 11, 29, - 28, 55, 55, 17, 448, 449, 55, 55, 168, 11, - 220, 221, 222, 223, 224, 121, 201, 181, 34, 11, - 230, 55, 202, 55, 3, 4, 5, 6, 160, 34, - 664, 55, 78, 160, 160, 53, 160, 169, 159, 19, - 167, 167, 22, 55, 24, 169, 152, 26, 27, 54, - 684, 69, 54, 154, 155, 156, 102, 157, 41, 42, - 106, 160, 54, 11, 7, 48, 112, 167, 232, 17, - 169, 54, 118, 93, 54, 46, 19, 48, 263, 22, - 265, 24, 160, 129, 264, 59, 266, 160, 160, 249, - 250, 169, 165, 165, 381, 539, 157, 143, 144, 18, - 160, 147, 55, 157, 157, 165, 167, 153, 157, 157, - 163, 165, 160, 161, 597, 402, 403, 404, 38, 586, - 159, 604, 605, 157, 158, 157, 142, 143, 144, 161, - 159, 147, 178, 157, 344, 151, 152, 161, 160, 169, - 168, 20, 122, 123, 23, 157, 158, 169, 0, 294, - 165, 168, 165, 620, 32, 33, 170, 203, 204, 205, - 206, 159, 142, 143, 159, 145, 146, 163, 148, 149, - 150, 514, 22, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 668, 669, 287, 671, 672, - 290, 291, 160, 293, 240, 482, 35, 342, 37, 22, - 410, 169, 118, 119, 157, 251, 21, 160, 161, 133, - 134, 694, 695, 556, 22, 558, 426, 54, 428, 429, - 430, 22, 142, 143, 144, 133, 134, 147, 328, 7, - 8, 151, 152, 42, 157, 44, 336, 337, 338, 339, - 340, 19, 20, 4, 22, 23, 24, 4, 294, 42, - 43, 44, 45, 46, 47, 48, 49, 37, 51, 305, - 3, 4, 5, 6, 164, 371, 372, 373, 374, 375, - 376, 377, 158, 158, 160, 160, 322, 323, 324, 622, - 386, 387, 388, 465, 542, 122, 123, 164, 42, 43, - 44, 26, 27, 47, 114, 115, 342, 343, 344, 158, - 158, 160, 160, 133, 134, 142, 143, 161, 145, 146, - 157, 148, 149, 150, 414, 415, 416, 417, 418, 4, - 142, 143, 144, 159, 424, 147, 158, 22, 160, 151, - 152, 84, 85, 160, 158, 381, 167, 437, 438, 4, - 158, 157, 9, 9, 390, 451, 452, 453, 454, 559, - 9, 9, 562, 563, 564, 9, 462, 9, 55, 57, - 11, 154, 155, 156, 410, 465, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 426, 427, 428, 429, 430, 167, 644, 158, 157, 157, - 436, 649, 157, 157, 157, 495, 22, 497, 157, 157, - 500, 157, 157, 38, 450, 157, 157, 4, 38, 22, - 510, 511, 160, 160, 160, 160, 160, 157, 524, 525, - 526, 527, 160, 529, 160, 157, 157, 533, 534, 62, - 63, 64, 65, 66, 67, 68, 482, 157, 160, 61, - 163, 160, 160, 641, 290, 291, 160, 293, 160, 549, - 550, 160, 552, 553, 554, 555, 160, 160, 160, 160, - 560, 160, 167, 509, 160, 38, 160, 665, 568, 515, - 576, 577, 578, 579, 574, 22, 160, 160, 0, 160, - 160, 158, 328, 17, 17, 157, 160, 160, 4, 535, - 336, 337, 338, 339, 340, 541, 18, 19, 20, 160, - 22, 23, 24, 160, 160, 551, 4, 160, 30, 31, - 160, 160, 160, 559, 4, 615, 562, 563, 564, 160, - 540, 627, 160, 629, 630, 571, 157, 0, 160, 22, - 52, 160, 160, 160, 56, 4, 160, 4, 60, 160, - 54, 158, 642, 643, 167, 18, 19, 20, 167, 22, - 23, 24, 160, 160, 160, 158, 158, 30, 31, 22, - 160, 17, 662, 167, 163, 158, 158, 165, 414, 415, - 416, 417, 418, 158, 158, 54, 165, 158, 424, 52, - 158, 158, 4, 56, 153, 157, 157, 60, 688, 689, - 22, 437, 438, 693, 160, 160, 696, 17, 17, 645, - 17, 17, 702, 74, 635, 705, 93, 598, 112, 106, - 17, 251, 90, 57, 134, 635, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, 571, 19, 20, - 240, 22, 23, 24, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 455, 134, -1, -1, -1, 495, - -1, 497, -1, -1, 500, -1, -1, -1, -1, 50, - -1, -1, -1, -1, 510, 511, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 549, 550, -1, 552, 553, 554, 555, - -1, -1, -1, -1, 560, -1, -1, -1, -1, -1, - -1, -1, 568, -1, -1, -1, -1, -1, 574, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 3, 4, 5, 6, 7, 8, - 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 19, 20, -1, 22, 23, 24, 25, 26, 27, 615, - -1, 162, 163, -1, -1, 166, -1, 168, 169, -1, - -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 54, 642, 643, 7, 8, - 59, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, -1, 22, 23, 24, 662, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, -1, -1, -1, -1, - -1, 50, 688, 689, -1, -1, -1, 693, -1, -1, - 696, -1, -1, -1, -1, -1, 702, -1, -1, 705, - -1, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, -1, 134, -1, 136, 137, 138, - -1, 140, 141, 142, 143, -1, 145, 146, -1, 148, - 149, 150, -1, -1, -1, -1, 3, 4, 5, 6, - 7, 8, 9, -1, 163, -1, -1, 166, -1, 168, - -1, 170, 19, 20, -1, 22, 23, 24, 25, 26, - 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 40, 41, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 55, -1, - -1, -1, 59, 162, 163, -1, -1, 166, -1, 168, - 169, -1, -1, -1, -1, -1, -1, -1, -1, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, -1, -1, + 0, 27, 167, 129, 275, 276, 180, 4, 121, 460, + 28, 0, 11, 11, 21, 205, 55, 17, 326, 55, + 201, 248, 29, 55, 448, 449, 168, 202, 17, 34, + 220, 221, 222, 223, 224, 664, 55, 181, 55, 152, + 230, 42, 43, 44, 45, 46, 47, 48, 49, 55, + 51, 34, 78, 11, 11, 684, 164, 7, 8, 55, + 10, 11, 12, 13, 14, 15, 16, 17, 55, 19, + 20, 54, 22, 23, 24, 46, 102, 48, 38, 55, + 106, 165, 263, 53, 265, 165, 112, 59, 232, 264, + 174, 266, 118, 93, 174, 165, 54, 54, 164, 69, + 50, 157, 55, 129, 174, 165, 20, 249, 250, 23, + 381, 167, 41, 42, 174, 539, 11, 143, 144, 48, + 18, 147, 17, 162, 164, 54, 162, 153, 0, 168, + 162, 402, 403, 404, 166, 586, 172, 142, 143, 144, + 168, 165, 147, 162, 165, 162, 151, 152, 165, 166, + 174, 170, 178, 174, 344, 173, 162, 163, 159, 160, + 161, 3, 4, 5, 6, 22, 162, 174, 294, 620, + 166, 170, 170, 118, 119, 162, 173, 203, 204, 205, + 206, 170, 142, 143, 144, 164, 162, 147, 21, 165, + 166, 151, 152, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 35, 514, 37, 164, 162, + 163, 482, 22, 42, 240, 44, 342, 167, 168, 165, + 410, 171, 165, 173, 174, 251, 172, 170, 165, 7, + 8, 287, 22, 170, 290, 291, 426, 293, 428, 429, + 430, 19, 20, 22, 22, 23, 24, 0, 556, 475, + 558, 62, 63, 64, 65, 66, 67, 68, 371, 372, + 373, 374, 375, 376, 377, 18, 19, 20, 294, 22, + 23, 24, 328, 386, 387, 388, 162, 30, 31, 305, + 336, 337, 338, 339, 340, 3, 4, 5, 6, 37, + 42, 43, 44, 4, 165, 47, 322, 323, 324, 52, + 465, 172, 155, 56, 163, 158, 165, 60, 26, 27, + 26, 27, 32, 33, 622, 542, 342, 343, 344, 4, + 7, 8, 169, 10, 11, 12, 13, 14, 15, 16, + 17, 7, 19, 20, 169, 22, 23, 24, 451, 452, + 453, 454, 165, 19, 156, 157, 22, 170, 24, 462, + 159, 160, 161, 133, 134, 381, 133, 134, 414, 415, + 416, 417, 418, 50, 390, 163, 162, 165, 424, 559, + 4, 597, 562, 563, 564, 163, 22, 165, 604, 605, + 166, 437, 438, 164, 410, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 165, + 426, 427, 428, 429, 430, 163, 163, 165, 165, 465, + 436, 524, 525, 526, 527, 4, 529, 644, 133, 134, + 533, 534, 649, 163, 450, 142, 143, 144, 172, 163, + 147, 165, 114, 115, 151, 152, 84, 85, 163, 495, + 162, 497, 668, 669, 500, 671, 672, 9, 9, 9, + 9, 9, 9, 55, 510, 511, 482, 57, 11, 172, + 163, 162, 162, 576, 577, 578, 579, 641, 162, 162, + 696, 697, 162, 290, 291, 22, 293, 165, 54, 162, + 167, 168, 162, 509, 171, 162, 173, 174, 162, 515, + 162, 665, 162, 549, 550, 38, 552, 553, 554, 555, + 19, 165, 165, 22, 560, 24, 165, 165, 165, 535, + 165, 328, 568, 4, 627, 541, 629, 630, 574, 336, + 337, 338, 339, 340, 38, 551, 162, 162, 165, 162, + 162, 61, 22, 559, 165, 54, 562, 563, 564, 165, + 540, 168, 165, 165, 165, 571, 122, 123, 7, 8, + 165, 10, 11, 12, 13, 14, 15, 16, 17, 615, + 19, 20, 165, 22, 23, 24, 142, 143, 165, 145, + 146, 165, 148, 149, 150, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 165, 642, 643, 165, 172, + 165, 50, 165, 165, 165, 38, 165, 414, 415, 416, + 417, 418, 22, 122, 123, 17, 662, 424, 163, 17, + 162, 165, 4, 4, 165, 165, 165, 165, 4, 645, + 437, 438, 22, 142, 143, 165, 145, 146, 165, 148, + 149, 150, 688, 689, 165, 635, 165, 165, 162, 695, + 165, 4, 165, 699, 165, 172, 172, 165, 165, 165, + 165, 4, 54, 709, 165, 163, 165, 7, 8, 715, + 10, 11, 12, 13, 14, 15, 16, 17, 0, 19, + 20, 165, 22, 23, 24, 163, 163, 22, 495, 172, + 497, 165, 168, 500, 163, 170, 18, 19, 20, 163, + 22, 23, 24, 510, 511, 163, 163, 54, 30, 31, + 50, 17, 163, 163, 170, 163, 4, 153, 167, 168, + 162, 162, 171, 22, 173, 174, 154, 165, 17, 74, + 52, 162, 17, 165, 56, 17, 17, 164, 60, 635, + 598, 93, 549, 550, 240, 552, 553, 554, 555, 713, + 112, 106, 17, 560, 251, 57, 90, 134, 455, 571, + 134, 568, -1, -1, -1, -1, -1, 574, -1, -1, + -1, -1, 7, 8, -1, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 615, -1, + -1, -1, -1, -1, -1, 50, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 167, 168, -1, + -1, 171, -1, 173, 174, 642, 643, -1, -1, -1, + 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, + -1, -1, -1, -1, -1, 662, 19, 20, -1, 22, + 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, + -1, 688, 689, -1, -1, -1, -1, -1, 695, -1, + -1, 54, 699, -1, -1, -1, 59, -1, -1, -1, + -1, -1, 709, -1, -1, -1, -1, -1, 715, -1, + -1, -1, -1, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 167, 168, -1, -1, 171, -1, 173, 174, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, -1, 134, -1, 136, - 137, 138, -1, 140, 141, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + -1, 134, -1, 136, 137, 138, -1, 140, 141, 142, + 143, -1, 145, 146, -1, 148, 149, 150, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, + 6, 7, 8, 9, -1, 168, -1, -1, 171, -1, + 173, -1, 175, 19, 20, -1, 22, 23, 24, 25, + 26, 27, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, + -1, 7, 8, 59, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, -1, + -1, -1, -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 157, -1, -1, -1, -1, -1, 163, -1, -1, 166, - -1, 168, -1, 170, 3, 4, 5, 6, 7, 8, - 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 19, 20, -1, 22, 23, 24, 25, 26, 27, -1, + -1, -1, -1, -1, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, -1, 134, -1, + 136, 137, 138, -1, 140, 141, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 7, 8, - 59, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, -1, 22, 23, 24, -1, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, -1, -1, -1, -1, - -1, 50, 7, 8, -1, 10, 11, 12, 13, 14, - 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, - -1, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, -1, 134, -1, 136, 137, 138, - -1, 140, 141, -1, -1, 50, -1, -1, -1, -1, - 3, 4, 5, 6, -1, -1, 9, -1, -1, -1, - -1, -1, -1, -1, 163, -1, -1, 166, -1, 168, - -1, 170, 25, 26, 27, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 162, -1, -1, -1, + -1, -1, 168, -1, -1, 171, -1, 173, -1, 175, + 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 19, 20, -1, 22, + 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 167, 168, -1, -1, 171, -1, 173, 174, -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, - -1, -1, -1, 162, 163, -1, -1, 166, -1, 168, - 169, -1, -1, 76, 77, 78, 79, 80, 81, 82, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 162, 163, -1, - -1, 166, -1, 168, 169, -1, -1, 120, 121, 122, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - -1, 134, -1, 136, 137, 138, -1, 140, 141, 7, + -1, 134, -1, 136, 137, 138, -1, 140, 141, 3, + 4, 5, 6, -1, -1, 9, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 25, 26, 27, -1, 168, -1, -1, 171, -1, + 173, -1, 175, -1, -1, -1, 40, 41, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, -1, + 134, -1, 136, 137, 138, -1, 140, 141, -1, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 19, 20, -1, 22, 23, 24, 25, -1, -1, - 163, -1, -1, 166, -1, 168, -1, 170, -1, -1, - -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 7, 8, 55, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, 76, 77, + -1, -1, -1, -1, 168, -1, -1, 171, -1, 173, + -1, 175, 40, 41, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 55, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, -1, 50, -1, - -1, 7, 8, -1, 10, 11, 12, 13, 14, 15, - 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, + 88, 89, 90, 91, 92, 93, 94, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, -1, 134, -1, 136, 137, - 138, -1, 140, 141, 50, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 157, - -1, 7, 8, 161, -1, 163, -1, -1, 166, -1, - 168, -1, 170, 19, 20, -1, 22, 23, 24, 25, + 138, -1, 140, 141, -1, 7, 8, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 19, 20, -1, + 22, 23, 24, 25, 162, -1, -1, -1, 166, -1, + 168, -1, -1, 171, -1, 173, -1, 175, 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, - 162, 163, -1, -1, 166, -1, 168, 169, -1, -1, + -1, 7, 8, 55, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, + -1, -1, -1, -1, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, -1, 50, -1, -1, -1, -1, 7, + 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 39, 134, -1, 136, 137, 138, -1, 140, 141, + 7, 8, 50, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, + 162, -1, -1, -1, -1, -1, 168, -1, -1, 171, + 126, 173, 39, 175, -1, -1, -1, -1, -1, -1, + -1, 7, 8, 50, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, -1, - -1, -1, -1, -1, -1, -1, 162, 163, -1, -1, - 166, -1, 168, 169, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, -1, 134, -1, - 136, 137, 138, -1, 140, 141, -1, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, 157, 22, 23, 24, -1, -1, 163, -1, -1, - 166, -1, 168, -1, 170, -1, -1, -1, -1, 39, - -1, -1, -1, -1, -1, -1, -1, -1, 7, 8, - 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, -1, 22, 23, 24, 7, 8, -1, 10, + -1, 167, 168, -1, -1, 171, -1, 173, -1, -1, + -1, -1, -1, -1, 50, 7, 8, -1, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 39, -1, 167, + 168, -1, -1, 171, -1, 173, 7, 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, 50, -1, -1, -1, -1, -1, -1, 39, -1, - -1, -1, -1, -1, -1, -1, -1, 7, 8, 50, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 167, 168, -1, -1, 171, -1, 173, 7, 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, -1, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - 50, -1, -1, -1, -1, -1, -1, -1, 39, -1, - -1, -1, 162, 163, -1, -1, 166, 126, 168, 50, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, + 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, + -1, 167, 168, -1, 170, 171, -1, 173, -1, -1, + 50, 7, 8, -1, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 162, 163, -1, -1, 166, -1, 168, - -1, -1, -1, 50, -1, -1, -1, -1, -1, -1, - -1, 162, 163, -1, -1, 166, -1, 168, 7, 8, - -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 167, 168, -1, -1, 171, + -1, 173, 7, 8, 50, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 39, -1, 162, 163, -1, 165, 166, -1, 168, -1, - -1, 50, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 162, 163, -1, -1, 166, -1, 168, -1, 7, - 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, 162, 163, -1, 165, 166, - -1, 168, 50, -1, -1, -1, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - 50, 22, 23, 24, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, -1, -1, -1, -1, -1, -1, -1, 50, - -1, -1, -1, 162, 163, -1, -1, 166, -1, 168, - -1, -1, -1, -1, -1, 7, 8, 50, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, 7, 8, -1, 10, 11, 12, 13, + -1, -1, -1, -1, -1, -1, 167, 168, -1, 170, + 171, -1, 173, 7, 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, -1, -1, -1, -1, -1, -1, -1, 50, -1, - -1, -1, -1, -1, 162, 163, -1, -1, 166, -1, - 168, -1, -1, -1, -1, -1, 50, -1, -1, -1, - -1, -1, 162, 163, -1, -1, 166, -1, 168, 7, - 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, - -1, 162, 163, -1, -1, 166, -1, 168, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 162, - 163, -1, 50, 166, -1, 168, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, + 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 167, 168, -1, + -1, 171, -1, 173, -1, -1, 50, 7, 8, -1, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 162, 163, -1, -1, 166, -1, 168, -1, -1, 50, - -1, -1, -1, -1, -1, -1, -1, -1, 162, 163, - -1, -1, 166, -1, 168, 7, 8, -1, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, -1, 36, + -1, 167, 168, -1, -1, 171, -1, 173, 7, 8, + 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 50, -1, - 57, 58, -1, -1, 162, 163, -1, -1, 166, -1, - 168, -1, -1, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, -1, -1, + -1, -1, 167, 168, -1, -1, 171, -1, 173, 7, + 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 162, 163, -1, -1, 166, -1, 168, 115, 116, - 117, -1, -1, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, -1, -1, -1, -1, -1, + -1, -1, -1, 167, 168, -1, -1, 171, -1, 173, + -1, -1, 50, 7, 8, -1, 10, 11, 12, 13, + 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, + 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 167, 168, -1, + -1, 171, -1, 173, 7, 8, 50, 10, 11, 12, + 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, + 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 167, 168, + -1, -1, 171, -1, 173, 7, 8, 50, 10, 11, + 12, 13, 14, 15, 16, 17, 36, 19, 20, -1, + 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 57, 58, 167, + 168, -1, -1, 171, -1, 173, -1, -1, 50, -1, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, -1, -1, -1, -1, -1, + -1, -1, -1, 167, 168, -1, -1, 171, -1, 173, + -1, -1, -1, -1, -1, 115, 116, 117, -1, -1, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, -1, -1, 167, 168, -1, -1, 171, -1, + 173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 162, 163, -1, -1, 166, -1, 168 + -1, -1, -1, -1, -1, 167, 168, -1, -1, 171, + -1, 173 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -2749,76 +2777,77 @@ static const yytype_uint16 yystos[] = { 0, 19, 20, 22, 23, 24, 30, 31, 52, 56, - 60, 179, 182, 184, 185, 186, 218, 219, 220, 222, - 221, 53, 69, 227, 159, 59, 159, 18, 159, 42, - 43, 44, 45, 46, 47, 48, 49, 51, 154, 155, - 156, 187, 188, 189, 0, 220, 46, 48, 190, 237, - 42, 43, 44, 47, 191, 234, 236, 244, 159, 159, - 163, 228, 22, 226, 7, 8, 10, 11, 12, 13, - 14, 15, 16, 17, 50, 162, 163, 166, 168, 179, - 184, 205, 206, 240, 189, 189, 35, 37, 216, 189, - 189, 21, 245, 246, 29, 169, 235, 245, 22, 22, - 22, 229, 157, 4, 4, 4, 168, 10, 169, 206, - 211, 55, 157, 181, 216, 216, 42, 44, 192, 32, - 33, 215, 62, 63, 64, 65, 66, 67, 68, 193, - 232, 232, 7, 182, 183, 249, 160, 165, 39, 206, - 207, 209, 210, 164, 164, 169, 211, 160, 169, 157, - 210, 161, 215, 215, 10, 126, 206, 208, 217, 11, - 12, 13, 14, 15, 16, 177, 178, 206, 212, 4, - 208, 28, 168, 233, 159, 36, 57, 58, 70, 71, + 60, 184, 187, 189, 190, 191, 226, 227, 228, 230, + 229, 53, 69, 235, 164, 59, 164, 18, 164, 42, + 43, 44, 45, 46, 47, 48, 49, 51, 159, 160, + 161, 192, 193, 194, 0, 228, 46, 48, 195, 245, + 42, 43, 44, 47, 196, 242, 244, 252, 164, 164, + 168, 236, 22, 234, 7, 8, 10, 11, 12, 13, + 14, 15, 16, 17, 50, 167, 168, 171, 173, 184, + 189, 213, 214, 248, 194, 194, 35, 37, 224, 194, + 194, 21, 253, 254, 29, 174, 243, 253, 22, 22, + 22, 237, 162, 4, 4, 4, 173, 10, 174, 214, + 219, 55, 162, 186, 224, 224, 42, 44, 197, 32, + 33, 223, 62, 63, 64, 65, 66, 67, 68, 198, + 240, 240, 7, 187, 188, 257, 165, 170, 39, 214, + 215, 217, 218, 169, 169, 174, 219, 165, 174, 162, + 218, 166, 223, 223, 10, 126, 214, 216, 225, 11, + 12, 13, 14, 15, 16, 182, 183, 214, 220, 4, + 216, 28, 173, 241, 164, 36, 57, 58, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 172, 173, - 174, 247, 254, 255, 256, 257, 247, 255, 22, 195, - 160, 158, 206, 206, 167, 169, 206, 4, 158, 212, - 206, 157, 240, 26, 27, 3, 4, 5, 6, 9, + 134, 135, 136, 137, 138, 139, 140, 141, 177, 178, + 179, 255, 262, 263, 264, 265, 255, 263, 22, 200, + 165, 163, 214, 214, 172, 174, 214, 4, 163, 220, + 214, 162, 248, 26, 27, 3, 4, 5, 6, 9, 25, 40, 41, 91, 92, 93, 94, 120, 134, 136, - 137, 138, 140, 141, 163, 166, 168, 170, 172, 173, - 174, 213, 240, 181, 184, 57, 10, 206, 242, 243, - 11, 17, 11, 177, 193, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 175, 26, 27, 101, 102, + 137, 138, 140, 141, 168, 171, 173, 175, 177, 178, + 179, 221, 248, 186, 189, 57, 10, 214, 250, 251, + 11, 17, 11, 182, 198, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 180, 26, 27, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 176, 175, 176, 206, 206, 242, 206, 206, - 250, 242, 242, 242, 242, 242, 206, 206, 206, 206, - 206, 242, 193, 118, 119, 54, 122, 123, 142, 143, - 145, 146, 148, 149, 150, 194, 39, 207, 197, 165, - 167, 167, 158, 197, 181, 181, 217, 175, 176, 175, - 176, 157, 157, 157, 157, 157, 157, 157, 165, 212, - 214, 168, 214, 169, 214, 22, 157, 157, 157, 223, - 157, 3, 4, 5, 6, 9, 25, 26, 27, 40, - 41, 59, 163, 166, 168, 170, 213, 239, 240, 241, - 160, 241, 241, 241, 208, 206, 206, 206, 206, 160, - 200, 160, 200, 241, 163, 160, 160, 160, 160, 160, - 160, 241, 241, 241, 241, 241, 38, 208, 206, 242, - 4, 142, 143, 144, 147, 151, 152, 196, 224, 225, - 38, 157, 157, 157, 157, 212, 212, 212, 212, 212, - 212, 212, 160, 165, 169, 206, 214, 167, 169, 212, - 212, 212, 160, 203, 39, 206, 230, 231, 61, 238, - 165, 214, 168, 214, 169, 214, 22, 242, 160, 160, - 241, 241, 241, 241, 241, 11, 54, 11, 252, 241, - 163, 242, 206, 242, 242, 242, 160, 160, 253, 160, - 160, 160, 206, 241, 241, 160, 203, 203, 206, 212, - 212, 212, 212, 252, 160, 160, 160, 160, 253, 160, - 212, 167, 169, 160, 160, 38, 34, 54, 201, 204, - 195, 160, 158, 22, 165, 169, 214, 167, 169, 17, - 17, 157, 160, 160, 160, 160, 241, 4, 241, 160, - 160, 241, 160, 160, 160, 4, 4, 160, 206, 241, - 241, 157, 160, 200, 206, 158, 160, 160, 160, 160, - 158, 212, 212, 212, 212, 158, 212, 167, 212, 212, - 206, 22, 4, 203, 179, 180, 39, 206, 197, 160, - 167, 169, 241, 241, 17, 206, 251, 241, 241, 241, - 241, 200, 200, 242, 241, 160, 242, 242, 242, 4, - 241, 251, 241, 212, 212, 212, 212, 160, 158, 160, - 160, 253, 158, 158, 158, 195, 201, 202, 22, 167, - 160, 163, 195, 195, 158, 160, 165, 241, 253, 158, - 200, 158, 158, 158, 158, 212, 212, 212, 158, 180, - 54, 199, 17, 165, 177, 248, 122, 123, 241, 241, - 197, 17, 206, 165, 197, 158, 158, 158, 4, 153, - 198, 241, 239, 165, 177, 195, 195, 38, 195, 195, - 22, 160, 239, 17, 241, 241, 17, 160, 241, 195, - 195, 241, 17, 74, 241, 17, 241 + 113, 114, 181, 180, 181, 214, 214, 250, 214, 214, + 258, 250, 250, 250, 250, 250, 214, 214, 214, 214, + 214, 250, 198, 118, 119, 54, 122, 123, 142, 143, + 145, 146, 148, 149, 150, 199, 39, 215, 202, 170, + 172, 172, 163, 202, 186, 186, 225, 180, 181, 180, + 181, 162, 162, 162, 162, 162, 162, 162, 170, 220, + 222, 173, 222, 174, 222, 22, 162, 162, 162, 231, + 162, 3, 4, 5, 6, 9, 25, 26, 27, 40, + 41, 59, 168, 171, 173, 175, 221, 247, 248, 249, + 165, 249, 249, 249, 216, 214, 214, 214, 214, 165, + 208, 165, 208, 249, 168, 165, 165, 165, 165, 165, + 165, 249, 249, 249, 249, 249, 38, 216, 214, 250, + 4, 142, 143, 144, 147, 151, 152, 201, 232, 233, + 38, 162, 162, 162, 162, 220, 220, 220, 220, 220, + 220, 220, 165, 170, 174, 214, 222, 172, 174, 220, + 220, 220, 165, 211, 39, 214, 238, 239, 61, 246, + 170, 222, 173, 222, 174, 222, 22, 250, 165, 165, + 249, 249, 249, 249, 249, 11, 54, 11, 260, 249, + 168, 250, 214, 250, 250, 250, 165, 165, 261, 165, + 165, 165, 214, 249, 249, 165, 211, 211, 214, 220, + 220, 220, 220, 260, 165, 165, 165, 165, 261, 165, + 220, 172, 174, 165, 165, 38, 34, 54, 209, 212, + 200, 165, 163, 22, 170, 174, 222, 172, 174, 17, + 17, 162, 165, 165, 165, 165, 249, 4, 249, 165, + 165, 249, 165, 165, 165, 4, 4, 165, 214, 249, + 249, 162, 165, 208, 214, 163, 165, 165, 165, 165, + 163, 220, 220, 220, 220, 163, 220, 172, 220, 220, + 214, 22, 4, 211, 184, 185, 39, 214, 202, 165, + 172, 174, 249, 249, 17, 214, 259, 249, 249, 249, + 249, 208, 208, 250, 249, 165, 250, 250, 250, 4, + 249, 259, 249, 220, 220, 220, 220, 165, 163, 165, + 165, 261, 163, 163, 163, 200, 209, 210, 22, 172, + 165, 168, 200, 200, 163, 165, 170, 249, 261, 163, + 208, 163, 163, 163, 163, 220, 220, 220, 163, 185, + 54, 207, 17, 170, 182, 256, 122, 123, 249, 249, + 202, 17, 214, 170, 202, 163, 163, 163, 4, 153, + 206, 249, 247, 170, 182, 200, 200, 38, 200, 200, + 22, 154, 205, 165, 247, 17, 249, 249, 162, 17, + 165, 249, 200, 200, 155, 158, 203, 204, 249, 17, + 74, 164, 163, 165, 249, 17, 156, 157, 204, 249 }; #define yyerrok (yyerrstatus = 0) @@ -3633,152 +3662,152 @@ switch (yyn) { case 29: -#line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1148 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1143 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1143 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1144 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1144 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1150 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1157 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1158 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1159 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1161 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1162 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1163 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 65: -#line 1167 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1173 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 66: -#line 1169 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1175 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 67: -#line 1170 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1176 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 68: -#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1180 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3786,7 +3815,7 @@ break; case 69: -#line 1178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1184 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3794,7 +3823,7 @@ break; case 70: -#line 1183 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1189 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal); CHECK_FOR_ERROR @@ -3802,7 +3831,7 @@ break; case 74: -#line 1192 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1198 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3810,7 +3839,7 @@ break; case 75: -#line 1197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1203 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3818,162 +3847,162 @@ break; case 76: -#line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 77: -#line 1204 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1210 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 78: -#line 1205 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1211 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 79: -#line 1206 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1212 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 80: -#line 1207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1213 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 81: -#line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1214 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 82: -#line 1212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1218 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 83: -#line 1213 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 84: -#line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1220 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 85: -#line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 86: -#line 1219 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 87: -#line 1220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 88: -#line 1221 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1227 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 89: -#line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1231 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 90: -#line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1232 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 91: -#line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1233 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 92: -#line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1237 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 93: -#line 1232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 94: -#line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1239 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 95: -#line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1240 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 96: -#line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1241 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 97: -#line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1245 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 98: -#line 1240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1246 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 99: -#line 1241 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1247 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 100: -#line 1244 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1250 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 101: -#line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1251 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 102: -#line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 103: -#line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1253 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 104: -#line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1254 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 105: -#line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1255 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 106: -#line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_SSECall; ;} break; case 107: -#line 1251 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1257 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -3983,129 +4012,174 @@ break; case 108: -#line 1258 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1264 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 109: -#line 1259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1265 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 110: -#line 1260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1266 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 111: -#line 1261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1267 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 112: -#line 1262 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1268 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 113: -#line 1263 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1269 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 114: -#line 1264 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1270 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} break; case 115: -#line 1265 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1271 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} break; case 116: -#line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1272 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::Nest; ;} break; case 117: -#line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1273 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 118: -#line 1271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1277 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 119: -#line 1272 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1278 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 120: -#line 1277 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1283 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 121: -#line 1278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1284 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 122: -#line 1279 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1285 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 123: -#line 1280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1286 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 124: -#line 1281 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1287 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} break; case 125: -#line 1282 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1288 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} break; case 126: -#line 1285 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1291 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 127: -#line 1286 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1292 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 128: -#line 1291 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} +#line 1297 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FunctionNotes) = (yyvsp[(1) - (1)].FunctionNotes); ;} break; case 129: -#line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1298 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" + { + FunctionNotes tmp = (yyvsp[(1) - (3)].FunctionNotes) | (yyvsp[(3) - (3)].FunctionNotes); + if ((yyvsp[(3) - (3)].FunctionNotes) == FP_NoInline && ((yyvsp[(1) - (3)].FunctionNotes) & FP_AlwaysInline)) + GEN_ERROR("Function Notes may include only one inline notes!") + if ((yyvsp[(3) - (3)].FunctionNotes) == FP_AlwaysInline && ((yyvsp[(1) - (3)].FunctionNotes) & FP_NoInline)) + GEN_ERROR("Function Notes may include only one inline notes!") + (yyval.FunctionNotes) = tmp; + CHECK_FOR_ERROR + ;} + break; + + case 130: +#line 1309 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FunctionNotes) = FP_NoInline; ;} + break; + + case 131: +#line 1310 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FunctionNotes) = FP_AlwaysInline; ;} + break; + + case 132: +#line 1311 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FunctionNotes) = FP_OptimizeForSize; ;} + break; + + case 133: +#line 1314 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FunctionNotes) = FP_None; ;} + break; + + case 134: +#line 1315 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionNotes) = (yyvsp[(3) - (4)].FunctionNotes); + ;} + break; + + case 135: +#line 1320 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 136: +#line 1321 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; - case 130: -#line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 137: +#line 1328 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; - case 131: -#line 1300 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 138: +#line 1329 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4114,13 +4188,13 @@ ;} break; - case 132: -#line 1306 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 139: +#line 1335 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; - case 133: -#line 1307 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 140: +#line 1336 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4129,8 +4203,8 @@ ;} break; - case 134: -#line 1316 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 141: +#line 1345 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -4140,28 +4214,28 @@ ;} break; - case 135: -#line 1324 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 142: +#line 1353 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; - case 136: -#line 1325 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 143: +#line 1354 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; - case 137: -#line 1330 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 144: +#line 1359 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; - case 138: -#line 1331 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 145: +#line 1360 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; - case 139: -#line 1332 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 146: +#line 1361 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4169,8 +4243,8 @@ ;} break; - case 140: -#line 1337 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 147: +#line 1366 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4179,24 +4253,24 @@ ;} break; - case 148: -#line 1353 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 155: +#line 1382 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR ;} break; - case 149: -#line 1357 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 156: +#line 1386 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR ;} break; - case 150: -#line 1361 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 157: +#line 1390 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4206,8 +4280,8 @@ ;} break; - case 151: -#line 1368 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 158: +#line 1397 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4215,8 +4289,8 @@ ;} break; - case 152: -#line 1373 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 159: +#line 1402 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4227,8 +4301,8 @@ ;} break; - case 153: -#line 1381 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 160: +#line 1410 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4260,8 +4334,8 @@ ;} break; - case 154: -#line 1410 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 161: +#line 1439 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4288,8 +4362,8 @@ ;} break; - case 155: -#line 1435 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 162: +#line 1464 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); @@ -4297,8 +4371,8 @@ ;} break; - case 156: -#line 1440 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 163: +#line 1469 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4311,8 +4385,8 @@ ;} break; - case 157: -#line 1450 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 164: +#line 1479 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4325,16 +4399,16 @@ ;} break; - case 158: -#line 1460 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 165: +#line 1489 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR ;} break; - case 159: -#line 1464 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 166: +#line 1493 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4347,16 +4421,16 @@ ;} break; - case 160: -#line 1474 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 167: +#line 1503 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR ;} break; - case 161: -#line 1481 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 168: +#line 1510 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4365,8 +4439,8 @@ ;} break; - case 162: -#line 1490 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 169: +#line 1519 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4376,15 +4450,15 @@ ;} break; - case 163: -#line 1497 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 170: +#line 1526 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; - case 164: -#line 1502 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 171: +#line 1531 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4392,16 +4466,16 @@ ;} break; - case 165: -#line 1507 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 172: +#line 1536 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR ;} break; - case 167: -#line 1515 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 174: +#line 1544 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4411,8 +4485,8 @@ ;} break; - case 168: -#line 1522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 175: +#line 1551 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4422,16 +4496,16 @@ ;} break; - case 169: -#line 1529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 176: +#line 1558 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR ;} break; - case 170: -#line 1537 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 177: +#line 1566 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4440,8 +4514,8 @@ ;} break; - case 171: -#line 1543 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 178: +#line 1572 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4449,8 +4523,8 @@ ;} break; - case 172: -#line 1555 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 179: +#line 1584 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4481,8 +4555,8 @@ ;} break; - case 173: -#line 1583 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 180: +#line 1612 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4501,8 +4575,8 @@ ;} break; - case 174: -#line 1599 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 181: +#line 1628 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4532,8 +4606,8 @@ ;} break; - case 175: -#line 1626 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 182: +#line 1655 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4564,8 +4638,8 @@ ;} break; - case 176: -#line 1654 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 183: +#line 1683 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4594,8 +4668,8 @@ ;} break; - case 177: -#line 1680 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 184: +#line 1709 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4618,8 +4692,8 @@ ;} break; - case 178: -#line 1700 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 185: +#line 1729 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4648,8 +4722,8 @@ ;} break; - case 179: -#line 1726 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 186: +#line 1755 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4672,8 +4746,8 @@ ;} break; - case 180: -#line 1746 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 187: +#line 1775 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4688,8 +4762,8 @@ ;} break; - case 181: -#line 1758 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 188: +#line 1787 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4699,8 +4773,8 @@ ;} break; - case 182: -#line 1765 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 189: +#line 1794 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4769,8 +4843,8 @@ ;} break; - case 183: -#line 1831 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 190: +#line 1860 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4783,8 +4857,8 @@ ;} break; - case 184: -#line 1841 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 191: +#line 1870 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4797,8 +4871,8 @@ ;} break; - case 185: -#line 1851 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 192: +#line 1880 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4807,8 +4881,8 @@ ;} break; - case 186: -#line 1857 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 193: +#line 1886 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4821,8 +4895,8 @@ ;} break; - case 187: -#line 1867 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 194: +#line 1896 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4831,8 +4905,8 @@ ;} break; - case 188: -#line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 195: +#line 1902 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4845,8 +4919,8 @@ ;} break; - case 189: -#line 1883 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 196: +#line 1912 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant true must have type i1"); @@ -4855,8 +4929,8 @@ ;} break; - case 190: -#line 1889 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 197: +#line 1918 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) GEN_ERROR("Constant false must have type i1"); @@ -4865,8 +4939,8 @@ ;} break; - case 191: -#line 1895 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 198: +#line 1924 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4880,8 +4954,8 @@ ;} break; - case 192: -#line 1908 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 199: +#line 1937 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4896,8 +4970,8 @@ ;} break; - case 193: -#line 1920 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 200: +#line 1949 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -4921,8 +4995,8 @@ ;} break; - case 194: -#line 1941 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 201: +#line 1970 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -4933,8 +5007,8 @@ ;} break; - case 195: -#line 1949 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 202: +#line 1978 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -4943,8 +5017,8 @@ ;} break; - case 196: -#line 1955 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 203: +#line 1984 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -4958,8 +5032,8 @@ ;} break; - case 197: -#line 1966 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 204: +#line 1995 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -4967,8 +5041,8 @@ ;} break; - case 198: -#line 1971 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 205: +#line 2000 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -4976,8 +5050,8 @@ ;} break; - case 199: -#line 1976 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 206: +#line 2005 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -4985,8 +5059,8 @@ ;} break; - case 200: -#line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 207: +#line 2010 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -4994,8 +5068,8 @@ ;} break; - case 201: -#line 1986 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 208: +#line 2015 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -5004,8 +5078,8 @@ ;} break; - case 202: -#line 1992 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 209: +#line 2021 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -5014,8 +5088,8 @@ ;} break; - case 203: -#line 1998 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 210: +#line 2027 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -5024,8 +5098,8 @@ ;} break; - case 204: -#line 2004 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 211: +#line 2033 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); @@ -5036,8 +5110,8 @@ ;} break; - case 205: -#line 2012 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 212: +#line 2041 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa((yyvsp[(3) - (7)].ConstVal)->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); @@ -5048,16 +5122,16 @@ ;} break; - case 206: -#line 2023 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 213: +#line 2052 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR ;} break; - case 207: -#line 2027 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 214: +#line 2056 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -5065,28 +5139,28 @@ ;} break; - case 208: -#line 2035 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 215: +#line 2064 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; - case 209: -#line 2035 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 216: +#line 2064 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; - case 210: -#line 2038 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 217: +#line 2067 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; - case 211: -#line 2038 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 218: +#line 2067 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; - case 212: -#line 2041 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 219: +#line 2070 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -5101,8 +5175,8 @@ ;} break; - case 213: -#line 2053 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 220: +#line 2082 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -5117,8 +5191,8 @@ ;} break; - case 214: -#line 2074 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 221: +#line 2103 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5126,8 +5200,8 @@ ;} break; - case 215: -#line 2079 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 222: +#line 2108 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5135,40 +5209,40 @@ ;} break; - case 218: -#line 2092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 225: +#line 2121 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; - case 219: -#line 2092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 226: +#line 2121 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR ;} break; - case 220: -#line 2096 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 227: +#line 2125 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; - case 221: -#line 2096 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 228: +#line 2125 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 222: -#line 2099 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 229: +#line 2128 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 223: -#line 2102 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 230: +#line 2131 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5195,8 +5269,8 @@ ;} break; - case 224: -#line 2126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 231: +#line 2155 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5210,8 +5284,8 @@ ;} break; - case 225: -#line 2138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 232: +#line 2167 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5222,15 +5296,15 @@ ;} break; - case 226: -#line 2145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 233: +#line 2174 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 227: -#line 2149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 234: +#line 2178 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5239,15 +5313,15 @@ ;} break; - case 228: -#line 2154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 235: +#line 2183 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; - case 229: -#line 2158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 236: +#line 2187 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5257,16 +5331,16 @@ ;} break; - case 230: -#line 2164 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 237: +#line 2193 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR ;} break; - case 231: -#line 2168 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 238: +#line 2197 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5309,22 +5383,22 @@ ;} break; - case 232: -#line 2208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 239: +#line 2237 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 233: -#line 2211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 240: +#line 2240 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 234: -#line 2217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 241: +#line 2246 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5336,24 +5410,24 @@ ;} break; - case 235: -#line 2227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 242: +#line 2256 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); ;} break; - case 236: -#line 2231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 243: +#line 2260 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); ;} break; - case 238: -#line 2238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 245: +#line 2267 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5361,8 +5435,8 @@ ;} break; - case 239: -#line 2243 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 246: +#line 2272 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5370,15 +5444,15 @@ ;} break; - case 240: -#line 2248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 247: +#line 2277 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; - case 241: -#line 2257 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 248: +#line 2286 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -5391,8 +5465,8 @@ ;} break; - case 242: -#line 2267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 249: +#line 2296 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -5405,16 +5479,16 @@ ;} break; - case 243: -#line 2278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 250: +#line 2307 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR ;} break; - case 244: -#line 2282 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 251: +#line 2311 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5426,8 +5500,8 @@ ;} break; - case 245: -#line 2291 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 252: +#line 2320 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5439,35 +5513,35 @@ ;} break; - case 246: -#line 2300 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 253: +#line 2329 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR ;} break; - case 247: -#line 2306 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 254: +#line 2335 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { - std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); - delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! + std::string FunctionName(*(yyvsp[(3) - (11)].StrVal)); + delete (yyvsp[(3) - (11)].StrVal); // Free strdup'd memory! // Check the function result for abstractness if this is a define. We should // have no abstract types at this point - if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (11)].TypeVal))) + GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (11)].TypeVal)->get()->getDescription()); - if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (10)].TypeVal))) + if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (11)].TypeVal))) GEN_ERROR("Invalid result type for LLVM function"); std::vector ParamTypeList; SmallVector Attrs; - if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) - Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs))); - if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments... + if ((yyvsp[(7) - (11)].ParamAttrs) != ParamAttr::None) + Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (11)].ParamAttrs))); + if ((yyvsp[(5) - (11)].ArgList)) { // If there are arguments... unsigned index = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) { + for (ArgListType::iterator I = (yyvsp[(5) - (11)].ArgList)->begin(); I != (yyvsp[(5) - (11)].ArgList)->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -5484,9 +5558,9 @@ if (!Attrs.empty()) PAL = PAListPtr::get(Attrs.begin(), Attrs.end()); - FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg); + FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (11)].TypeVal), ParamTypeList, isVarArg); const PointerType *PFT = PointerType::getUnqual(FT); - delete (yyvsp[(2) - (10)].TypeVal); + delete (yyvsp[(2) - (11)].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -5540,31 +5614,34 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal)); + Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal)); Fn->setParamAttrs(PAL); - Fn->setAlignment((yyvsp[(9) - (10)].UIntVal)); - if ((yyvsp[(8) - (10)].StrVal)) { - Fn->setSection(*(yyvsp[(8) - (10)].StrVal)); - delete (yyvsp[(8) - (10)].StrVal); - } - if ((yyvsp[(10) - (10)].StrVal)) { - Fn->setGC((yyvsp[(10) - (10)].StrVal)->c_str()); - delete (yyvsp[(10) - (10)].StrVal); + Fn->setAlignment((yyvsp[(9) - (11)].UIntVal)); + if ((yyvsp[(8) - (11)].StrVal)) { + Fn->setSection(*(yyvsp[(8) - (11)].StrVal)); + delete (yyvsp[(8) - (11)].StrVal); + } + if ((yyvsp[(10) - (11)].StrVal)) { + Fn->setGC((yyvsp[(10) - (11)].StrVal)->c_str()); + delete (yyvsp[(10) - (11)].StrVal); + } + if ((yyvsp[(11) - (11)].FunctionNotes)) { + Fn->setNotes((yyvsp[(11) - (11)].FunctionNotes)); } // Add all of the arguments we parsed to the function... - if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty... + if ((yyvsp[(5) - (11)].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 && + assert((yyvsp[(5) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (11)].ArgList)->back().Name == 0 && "Not a varargs marker!"); - delete (yyvsp[(5) - (10)].ArgList)->back().Ty; - (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry + delete (yyvsp[(5) - (11)].ArgList)->back().Ty; + (yyvsp[(5) - (11)].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); unsigned Idx = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); - I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = (yyvsp[(5) - (11)].ArgList)->begin(); + I != (yyvsp[(5) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -5572,14 +5649,14 @@ Idx++; } - delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list + delete (yyvsp[(5) - (11)].ArgList); // We're now done with the argument list } CHECK_FOR_ERROR ;} break; - case 250: -#line 2436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 257: +#line 2468 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5590,16 +5667,16 @@ ;} break; - case 253: -#line 2447 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 260: +#line 2479 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 254: -#line 2452 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 261: +#line 2484 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5609,40 +5686,40 @@ ;} break; - case 255: -#line 2464 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 262: +#line 2496 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 256: -#line 2468 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 263: +#line 2500 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 257: -#line 2473 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 264: +#line 2505 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR ;} break; - case 258: -#line 2477 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 265: +#line 2509 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR ;} break; - case 259: -#line 2481 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 266: +#line 2513 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true); delete (yyvsp[(1) - (1)].APIntVal); @@ -5650,8 +5727,8 @@ ;} break; - case 260: -#line 2486 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 267: +#line 2518 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false); delete (yyvsp[(1) - (1)].APIntVal); @@ -5659,56 +5736,56 @@ ;} break; - case 261: -#line 2491 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 268: +#line 2523 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR ;} break; - case 262: -#line 2495 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 269: +#line 2527 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR ;} break; - case 263: -#line 2499 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 270: +#line 2531 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR ;} break; - case 264: -#line 2503 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 271: +#line 2535 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR ;} break; - case 265: -#line 2507 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 272: +#line 2539 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR ;} break; - case 266: -#line 2511 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 273: +#line 2543 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR ;} break; - case 267: -#line 2515 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 274: +#line 2547 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5733,8 +5810,8 @@ ;} break; - case 268: -#line 2537 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 275: +#line 2569 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); @@ -5759,8 +5836,8 @@ ;} break; - case 269: -#line 2559 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 276: +#line 2591 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Use undef instead of an array because it's inconvenient to determine // the element type at this point, there being no elements to examine. @@ -5769,8 +5846,8 @@ ;} break; - case 270: -#line 2565 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 277: +#line 2597 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length(); const Type *ETy = Type::Int8Ty; @@ -5786,8 +5863,8 @@ ;} break; - case 271: -#line 2578 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 278: +#line 2610 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(2) - (3)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i) @@ -5802,8 +5879,8 @@ ;} break; - case 272: -#line 2590 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 279: +#line 2622 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector()); (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector())); @@ -5811,8 +5888,8 @@ ;} break; - case 273: -#line 2595 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 280: +#line 2627 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements((yyvsp[(3) - (5)].ConstVector)->size()); for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i) @@ -5827,8 +5904,8 @@ ;} break; - case 274: -#line 2607 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 281: +#line 2639 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = StructType::get(std::vector(), /*isPacked=*/true); @@ -5837,16 +5914,16 @@ ;} break; - case 275: -#line 2613 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 282: +#line 2645 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR ;} break; - case 276: -#line 2617 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 283: +#line 2649 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5855,24 +5932,24 @@ ;} break; - case 277: -#line 2627 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 284: +#line 2659 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR ;} break; - case 278: -#line 2631 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 285: +#line 2663 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR ;} break; - case 279: -#line 2635 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 286: +#line 2667 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5880,8 +5957,8 @@ ;} break; - case 280: -#line 2640 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 287: +#line 2672 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5889,8 +5966,8 @@ ;} break; - case 283: -#line 2653 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 290: +#line 2685 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -5900,8 +5977,8 @@ ;} break; - case 284: -#line 2662 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 291: +#line 2694 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -5909,32 +5986,32 @@ ;} break; - case 285: -#line 2667 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 292: +#line 2699 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR ;} break; - case 286: -#line 2672 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 293: +#line 2704 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 287: -#line 2676 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 294: +#line 2708 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR ;} break; - case 288: -#line 2685 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 295: +#line 2717 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -5945,8 +6022,8 @@ ;} break; - case 289: -#line 2694 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 296: +#line 2726 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal)); @@ -5960,8 +6037,8 @@ ;} break; - case 290: -#line 2707 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 297: +#line 2739 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -5973,16 +6050,16 @@ ;} break; - case 291: -#line 2716 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 298: +#line 2748 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR ;} break; - case 292: -#line 2720 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 299: +#line 2752 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -5991,8 +6068,8 @@ ;} break; - case 293: -#line 2728 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 300: +#line 2760 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -6015,16 +6092,16 @@ ;} break; - case 294: -#line 2748 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 301: +#line 2780 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR ;} break; - case 295: -#line 2752 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 302: +#line 2784 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -6032,8 +6109,8 @@ ;} break; - case 296: -#line 2757 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 303: +#line 2789 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1) GEN_ERROR("Branch condition must have type i1"); @@ -6047,8 +6124,8 @@ ;} break; - case 297: -#line 2768 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 304: +#line 2800 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -6070,8 +6147,8 @@ ;} break; - case 298: -#line 2787 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 305: +#line 2819 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -6083,8 +6160,8 @@ ;} break; - case 299: -#line 2797 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 306: +#line 2829 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6172,24 +6249,24 @@ ;} break; - case 300: -#line 2882 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 307: +#line 2914 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR ;} break; - case 301: -#line 2886 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 308: +#line 2918 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR ;} break; - case 302: -#line 2893 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 309: +#line 2925 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -6203,8 +6280,8 @@ ;} break; - case 303: -#line 2904 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 310: +#line 2936 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -6219,8 +6296,8 @@ ;} break; - case 304: -#line 2917 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 311: +#line 2949 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -6231,8 +6308,8 @@ ;} break; - case 305: -#line 2926 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 312: +#line 2958 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal)); @@ -6246,8 +6323,8 @@ ;} break; - case 306: -#line 2939 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 313: +#line 2971 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -6261,8 +6338,8 @@ ;} break; - case 307: -#line 2950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 314: +#line 2982 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -6273,8 +6350,8 @@ ;} break; - case 308: -#line 2960 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 315: +#line 2992 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6288,8 +6365,8 @@ ;} break; - case 309: -#line 2971 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 316: +#line 3003 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -6300,8 +6377,8 @@ ;} break; - case 310: -#line 2979 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 317: +#line 3011 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6314,8 +6391,8 @@ ;} break; - case 311: -#line 2989 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 318: +#line 3021 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -6325,18 +6402,18 @@ ;} break; - case 312: -#line 2996 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 319: +#line 3028 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; - case 313: -#line 2999 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 320: +#line 3031 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; - case 314: -#line 3000 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 321: +#line 3032 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -6344,8 +6421,8 @@ ;} break; - case 315: -#line 3008 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 322: +#line 3040 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = new std::vector(); if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) @@ -6354,8 +6431,8 @@ ;} break; - case 316: -#line 3014 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 323: +#line 3046 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList); if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val)) @@ -6365,24 +6442,24 @@ ;} break; - case 317: -#line 3023 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 324: +#line 3055 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 318: -#line 3027 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 325: +#line 3059 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 319: -#line 3032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 326: +#line 3064 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6401,8 +6478,8 @@ ;} break; - case 320: -#line 3048 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 327: +#line 3080 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6422,8 +6499,8 @@ ;} break; - case 321: -#line 3065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 328: +#line 3097 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6440,8 +6517,8 @@ ;} break; - case 322: -#line 3079 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 329: +#line 3111 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6458,8 +6535,8 @@ ;} break; - case 323: -#line 3093 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 330: +#line 3125 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6476,8 +6553,8 @@ ;} break; - case 324: -#line 3107 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 331: +#line 3139 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6494,8 +6571,8 @@ ;} break; - case 325: -#line 3121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 332: +#line 3153 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6510,8 +6587,8 @@ ;} break; - case 326: -#line 3133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 333: +#line 3165 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); @@ -6522,8 +6599,8 @@ ;} break; - case 327: -#line 3141 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 334: +#line 3173 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6533,8 +6610,8 @@ ;} break; - case 328: -#line 3148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 335: +#line 3180 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6543,8 +6620,8 @@ ;} break; - case 329: -#line 3154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 336: +#line 3186 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6553,8 +6630,8 @@ ;} break; - case 330: -#line 3160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 337: +#line 3192 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6563,8 +6640,8 @@ ;} break; - case 331: -#line 3166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 338: +#line 3198 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6582,8 +6659,8 @@ ;} break; - case 332: -#line 3182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 339: +#line 3214 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6675,32 +6752,32 @@ ;} break; - case 333: -#line 3271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 340: +#line 3303 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR ;} break; - case 334: -#line 3276 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 341: +#line 3308 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 335: -#line 3280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 342: +#line 3312 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 336: -#line 3287 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 343: +#line 3319 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6710,8 +6787,8 @@ ;} break; - case 337: -#line 3294 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 344: +#line 3326 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6724,8 +6801,8 @@ ;} break; - case 338: -#line 3304 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 345: +#line 3336 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6735,8 +6812,8 @@ ;} break; - case 339: -#line 3311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 346: +#line 3343 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); @@ -6749,8 +6826,8 @@ ;} break; - case 340: -#line 3321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 347: +#line 3353 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6760,8 +6837,8 @@ ;} break; - case 341: -#line 3329 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 348: +#line 3361 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6778,8 +6855,8 @@ ;} break; - case 342: -#line 3343 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 349: +#line 3375 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6799,8 +6876,8 @@ ;} break; - case 343: -#line 3360 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 350: +#line 3392 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6817,8 +6894,8 @@ ;} break; - case 344: -#line 3374 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 351: +#line 3406 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6836,8 +6913,8 @@ ;} break; - case 345: -#line 3389 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 352: +#line 3421 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6855,8 +6932,8 @@ ;} break; - case 346: -#line 3404 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + case 353: +#line 3436 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription()); @@ -6878,7 +6955,7 @@ /* Line 1267 of yacc.c. */ -#line 6882 "llvmAsmParser.tab.c" +#line 6959 "llvmAsmParser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -7092,7 +7169,7 @@ } -#line 3423 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3455 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=55646&r1=55645&r2=55646&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Tue Sep 2 15:52:40 2008 @@ -190,9 +190,14 @@ READNONE = 406, READONLY = 407, GC = 408, - DEFAULT = 409, - HIDDEN = 410, - PROTECTED = 411 + FNNOTE = 409, + INLINE = 410, + ALWAYS = 411, + NEVER = 412, + OPTIMIZEFORSIZE = 413, + DEFAULT = 414, + HIDDEN = 415, + PROTECTED = 416 }; #endif /* Tokens. */ @@ -347,16 +352,21 @@ #define READNONE 406 #define READONLY 407 #define GC 408 -#define DEFAULT 409 -#define HIDDEN 410 -#define PROTECTED 411 +#define FNNOTE 409 +#define INLINE 410 +#define ALWAYS 411 +#define NEVER 412 +#define OPTIMIZEFORSIZE 413 +#define DEFAULT 414 +#define HIDDEN 415 +#define PROTECTED 416 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 970 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 970 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -385,6 +395,7 @@ llvm::GlobalValue::LinkageTypes Linkage; llvm::GlobalValue::VisibilityTypes Visibility; llvm::ParameterAttributes ParamAttrs; + llvm::FunctionNotes FunctionNotes; llvm::APInt *APIntVal; int64_t SInt64Val; uint64_t UInt64Val; @@ -405,7 +416,7 @@ llvm::FCmpInst::Predicate FPredicate; } /* Line 1529 of yacc.c. */ -#line 409 "llvmAsmParser.tab.h" +#line 420 "llvmAsmParser.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=55646&r1=55645&r2=55646&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Tue Sep 2 15:52:40 2008 @@ -995,6 +995,7 @@ llvm::GlobalValue::LinkageTypes Linkage; llvm::GlobalValue::VisibilityTypes Visibility; llvm::ParameterAttributes ParamAttrs; + llvm::FunctionNotes FunctionNotes; llvm::APInt *APIntVal; int64_t SInt64Val; uint64_t UInt64Val; @@ -1090,6 +1091,8 @@ %type OptCallingConv LocalNumber %type OptParamAttrs ParamAttr %type OptFuncAttrs FuncAttr +%type OptFuncNotes FuncNote +%type FuncNoteList // Basic Block Terminating Operators %token RET BR SWITCH INVOKE UNWIND UNREACHABLE @@ -1123,6 +1126,9 @@ %token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST %token READNONE READONLY GC +// Function Notes +%token FNNOTE INLINE ALWAYS NEVER OPTIMIZEFORSIZE + // Visibility Styles %token DEFAULT HIDDEN PROTECTED @@ -1288,6 +1294,29 @@ } ; +FuncNoteList : FuncNote { $$ = $1; } + | FuncNoteList ',' FuncNote { + FunctionNotes tmp = $1 | $3; + if ($3 == FP_NoInline && ($1 & FP_AlwaysInline)) + GEN_ERROR("Function Notes may include only one inline notes!") + if ($3 == FP_AlwaysInline && ($1 & FP_NoInline)) + GEN_ERROR("Function Notes may include only one inline notes!") + $$ = tmp; + CHECK_FOR_ERROR + } + ; + +FuncNote : INLINE '=' NEVER { $$ = FP_NoInline; } + | INLINE '=' ALWAYS { $$ = FP_AlwaysInline; } + | OPTIMIZEFORSIZE { $$ = FP_OptimizeForSize; } + ; + +OptFuncNotes : /* empty */ { $$ = FP_None; } + | FNNOTE '(' FuncNoteList ')' { + $$ = $3; + } + ; + OptGC : /* empty */ { $$ = 0; } | GC STRINGCONSTANT { $$ = $2; @@ -2303,7 +2332,7 @@ }; FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')' - OptFuncAttrs OptSection OptAlign OptGC { + OptFuncAttrs OptSection OptAlign OptGC OptFuncNotes { std::string FunctionName(*$3); delete $3; // Free strdup'd memory! @@ -2405,6 +2434,9 @@ Fn->setGC($10->c_str()); delete $10; } + if ($11) { + Fn->setNotes($11); + } // Add all of the arguments we parsed to the function... if ($5) { // Is null if empty... Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=55646&r1=55645&r2=55646&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Tue Sep 2 15:52:40 2008 @@ -995,6 +995,7 @@ llvm::GlobalValue::LinkageTypes Linkage; llvm::GlobalValue::VisibilityTypes Visibility; llvm::ParameterAttributes ParamAttrs; + llvm::FunctionNotes FunctionNotes; llvm::APInt *APIntVal; int64_t SInt64Val; uint64_t UInt64Val; @@ -1090,6 +1091,8 @@ %type OptCallingConv LocalNumber %type OptParamAttrs ParamAttr %type OptFuncAttrs FuncAttr +%type OptFuncNotes FuncNote +%type FuncNoteList // Basic Block Terminating Operators %token RET BR SWITCH INVOKE UNWIND UNREACHABLE @@ -1123,6 +1126,9 @@ %token SIGNEXT ZEROEXT NORETURN INREG SRET NOUNWIND NOALIAS BYVAL NEST %token READNONE READONLY GC +// Function Notes +%token FNNOTE INLINE ALWAYS NEVER OPTIMIZEFORSIZE + // Visibility Styles %token DEFAULT HIDDEN PROTECTED @@ -1288,6 +1294,29 @@ } ; +FuncNoteList : FuncNote { $$ = $1; } + | FuncNoteList ',' FuncNote { + FunctionNotes tmp = $1 | $3; + if ($3 == FP_NoInline && ($1 & FP_AlwaysInline)) + GEN_ERROR("Function Notes may include only one inline notes!") + if ($3 == FP_AlwaysInline && ($1 & FP_NoInline)) + GEN_ERROR("Function Notes may include only one inline notes!") + $$ = tmp; + CHECK_FOR_ERROR + } + ; + +FuncNote : INLINE '=' NEVER { $$ = FP_NoInline; } + | INLINE '=' ALWAYS { $$ = FP_AlwaysInline; } + | OPTIMIZEFORSIZE { $$ = FP_OptimizeForSize; } + ; + +OptFuncNotes : /* empty */ { $$ = FP_None; } + | FNNOTE '(' FuncNoteList ')' { + $$ = $3; + } + ; + OptGC : /* empty */ { $$ = 0; } | GC STRINGCONSTANT { $$ = $2; @@ -2303,7 +2332,7 @@ }; FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')' - OptFuncAttrs OptSection OptAlign OptGC { + OptFuncAttrs OptSection OptAlign OptGC OptFuncNotes { std::string FunctionName(*$3); delete $3; // Free strdup'd memory! @@ -2405,6 +2434,9 @@ Fn->setGC($10->c_str()); delete $10; } + if ($11) { + Fn->setNotes($11); + } // Add all of the arguments we parsed to the function... if ($5) { // Is null if empty... From dpatel at apple.com Tue Sep 2 15:56:33 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 20:56:33 -0000 Subject: [llvm-commits] [llvm] r55647 - /llvm/trunk/lib/VMCore/AsmWriter.cpp Message-ID: <200809022056.m82KuXKo018616@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 15:56:33 2008 New Revision: 55647 URL: http://llvm.org/viewvc/llvm-project?rev=55647&view=rev Log: Print function notes. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=55647&r1=55646&r2=55647&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Tue Sep 2 15:56:33 2008 @@ -1395,7 +1395,15 @@ Out << " align " << F->getAlignment(); if (F->hasGC()) Out << " gc \"" << F->getGC() << '"'; - + FunctionNotes FNotes = F->getNotes(); + if (FNotes != FP_None) { + Out << " notes("; + if (FNotes && FP_AlwaysInline) + Out << "inline=always"; + else if (FNotes && FP_NoInline) + Out << "inline=never"; + Out << ")"; + } if (F->isDeclaration()) { Out << "\n"; } else { From dpatel at apple.com Tue Sep 2 15:58:16 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 20:58:16 -0000 Subject: [llvm-commits] [llvm] r55648 - in /llvm/trunk/test/Assembler: 2008-09-02-FunctionNotes.ll 2008-09-02-FunctionNotes2.ll Message-ID: <200809022058.m82KwGUD018678@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 15:58:16 2008 New Revision: 55648 URL: http://llvm.org/viewvc/llvm-project?rev=55648&view=rev Log: Function notes tests. Added: llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll Added: llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll?rev=55648&view=auto ============================================================================== --- llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll (added) +++ llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll Tue Sep 2 15:58:16 2008 @@ -0,0 +1,11 @@ +; Test function notes +; RUN: llvm-as < %s -f -o /dev/null + +define void @fn1() notes(inline=always) { + ret void +} + +define void @fn2() notes(inline=never) { + ret void +} + Added: llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll?rev=55648&view=auto ============================================================================== --- llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll (added) +++ llvm/trunk/test/Assembler/2008-09-02-FunctionNotes2.ll Tue Sep 2 15:58:16 2008 @@ -0,0 +1,7 @@ +; Test function notes +; RUN: not llvm-as %s |& grep "only one inline note" + +define void @fn1() notes(inline=always,inline=never) { + ret void +} + From dalej at apple.com Tue Sep 2 16:18:19 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 02 Sep 2008 21:18:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55650 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200809022118.m82LIJeg019335@zion.cs.uiuc.edu> Author: johannes Date: Tue Sep 2 16:18:19 2008 New Revision: 55650 URL: http://llvm.org/viewvc/llvm-project?rev=55650&view=rev Log: Don't convert atomics that aren't supported by the target. This gets us undefined functions at linktime instead of crashes in llvm, which is what gcc does. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=55650&r1=55649&r2=55650&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Sep 2 16:18:19 2008 @@ -4590,82 +4590,113 @@ return true; } case BUILT_IN_BOOL_COMPARE_AND_SWAP_8: { +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif Result = BuildCmpAndSwapAtomicBuiltin(exp, long_long_unsigned_type_node, true); return true; } - case BUILT_IN_BOOL_COMPARE_AND_SWAP_16: - abort(); // not handled; should use SSE on x86 + + case BUILT_IN_VAL_COMPARE_AND_SWAP_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_VAL_COMPARE_AND_SWAP_1: case BUILT_IN_VAL_COMPARE_AND_SWAP_2: - case BUILT_IN_VAL_COMPARE_AND_SWAP_4: - case BUILT_IN_VAL_COMPARE_AND_SWAP_8: - case BUILT_IN_VAL_COMPARE_AND_SWAP_16: { + case BUILT_IN_VAL_COMPARE_AND_SWAP_4: { tree type = TREE_TYPE(exp); Result = BuildCmpAndSwapAtomicBuiltin(exp, type, false); return true; } + case BUILT_IN_FETCH_AND_ADD_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_FETCH_AND_ADD_1: case BUILT_IN_FETCH_AND_ADD_2: - case BUILT_IN_FETCH_AND_ADD_4: - case BUILT_IN_FETCH_AND_ADD_8: - case BUILT_IN_FETCH_AND_ADD_16: { + case BUILT_IN_FETCH_AND_ADD_4: { Result = BuildBinaryAtomicBuiltin(exp, Intrinsic::atomic_load_add); return true; } + case BUILT_IN_FETCH_AND_SUB_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_FETCH_AND_SUB_1: case BUILT_IN_FETCH_AND_SUB_2: - case BUILT_IN_FETCH_AND_SUB_4: - case BUILT_IN_FETCH_AND_SUB_8: - case BUILT_IN_FETCH_AND_SUB_16: { + case BUILT_IN_FETCH_AND_SUB_4: { Result = BuildBinaryAtomicBuiltin(exp, Intrinsic::atomic_load_sub); return true; } + case BUILT_IN_FETCH_AND_OR_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_FETCH_AND_OR_1: case BUILT_IN_FETCH_AND_OR_2: - case BUILT_IN_FETCH_AND_OR_4: - case BUILT_IN_FETCH_AND_OR_8: - case BUILT_IN_FETCH_AND_OR_16: { + case BUILT_IN_FETCH_AND_OR_4: { Result = BuildBinaryAtomicBuiltin(exp, Intrinsic::atomic_load_or); return true; } + case BUILT_IN_FETCH_AND_AND_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_FETCH_AND_AND_1: case BUILT_IN_FETCH_AND_AND_2: - case BUILT_IN_FETCH_AND_AND_4: - case BUILT_IN_FETCH_AND_AND_8: - case BUILT_IN_FETCH_AND_AND_16: { + case BUILT_IN_FETCH_AND_AND_4: { Result = BuildBinaryAtomicBuiltin(exp, Intrinsic::atomic_load_and); return true; } + case BUILT_IN_FETCH_AND_XOR_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_FETCH_AND_XOR_1: case BUILT_IN_FETCH_AND_XOR_2: - case BUILT_IN_FETCH_AND_XOR_4: - case BUILT_IN_FETCH_AND_XOR_8: - case BUILT_IN_FETCH_AND_XOR_16: { + case BUILT_IN_FETCH_AND_XOR_4: { Result = BuildBinaryAtomicBuiltin(exp, Intrinsic::atomic_load_xor); return true; } + case BUILT_IN_FETCH_AND_NAND_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_FETCH_AND_NAND_1: case BUILT_IN_FETCH_AND_NAND_2: - case BUILT_IN_FETCH_AND_NAND_4: - case BUILT_IN_FETCH_AND_NAND_8: - case BUILT_IN_FETCH_AND_NAND_16: { + case BUILT_IN_FETCH_AND_NAND_4: { Result = BuildBinaryAtomicBuiltin(exp, Intrinsic::atomic_load_nand); return true; } + case BUILT_IN_LOCK_TEST_AND_SET_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_LOCK_TEST_AND_SET_1: case BUILT_IN_LOCK_TEST_AND_SET_2: - case BUILT_IN_LOCK_TEST_AND_SET_4: - case BUILT_IN_LOCK_TEST_AND_SET_8: - case BUILT_IN_LOCK_TEST_AND_SET_16: { + case BUILT_IN_LOCK_TEST_AND_SET_4: { Result = BuildBinaryAtomicBuiltin(exp, Intrinsic::atomic_swap); return true; } + + case BUILT_IN_ADD_AND_FETCH_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_ADD_AND_FETCH_1: case BUILT_IN_ADD_AND_FETCH_2: - case BUILT_IN_ADD_AND_FETCH_4: - case BUILT_IN_ADD_AND_FETCH_8: - case BUILT_IN_ADD_AND_FETCH_16: { + case BUILT_IN_ADD_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); tree arglist = TREE_OPERAND(exp, 1); Value* C[2] = { @@ -4686,11 +4717,14 @@ Result = Builder.CreateIntToPtr(Result, ResultTy); return true; } + case BUILT_IN_SUB_AND_FETCH_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_SUB_AND_FETCH_1: case BUILT_IN_SUB_AND_FETCH_2: - case BUILT_IN_SUB_AND_FETCH_4: - case BUILT_IN_SUB_AND_FETCH_8: - case BUILT_IN_SUB_AND_FETCH_16: { + case BUILT_IN_SUB_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); tree arglist = TREE_OPERAND(exp, 1); Value* C[2] = { @@ -4711,11 +4745,14 @@ Result = Builder.CreateIntToPtr(Result, ResultTy); return true; } + case BUILT_IN_OR_AND_FETCH_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_OR_AND_FETCH_1: case BUILT_IN_OR_AND_FETCH_2: - case BUILT_IN_OR_AND_FETCH_4: - case BUILT_IN_OR_AND_FETCH_8: - case BUILT_IN_OR_AND_FETCH_16: { + case BUILT_IN_OR_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); tree arglist = TREE_OPERAND(exp, 1); Value* C[2] = { @@ -4736,11 +4773,14 @@ Result = Builder.CreateIntToPtr(Result, ResultTy); return true; } + case BUILT_IN_AND_AND_FETCH_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_AND_AND_FETCH_1: case BUILT_IN_AND_AND_FETCH_2: - case BUILT_IN_AND_AND_FETCH_4: - case BUILT_IN_AND_AND_FETCH_8: - case BUILT_IN_AND_AND_FETCH_16: { + case BUILT_IN_AND_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); tree arglist = TREE_OPERAND(exp, 1); Value* C[2] = { @@ -4761,11 +4801,14 @@ Result = Builder.CreateIntToPtr(Result, ResultTy); return true; } + case BUILT_IN_XOR_AND_FETCH_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_XOR_AND_FETCH_1: case BUILT_IN_XOR_AND_FETCH_2: - case BUILT_IN_XOR_AND_FETCH_4: - case BUILT_IN_XOR_AND_FETCH_8: - case BUILT_IN_XOR_AND_FETCH_16: { + case BUILT_IN_XOR_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); tree arglist = TREE_OPERAND(exp, 1); Value* C[2] = { @@ -4786,11 +4829,14 @@ Result = Builder.CreateIntToPtr(Result, ResultTy); return true; } + case BUILT_IN_NAND_AND_FETCH_8: +#if defined(TARGET_POWERPC) + if (!TARGET_64BIT) + return false; +#endif case BUILT_IN_NAND_AND_FETCH_1: case BUILT_IN_NAND_AND_FETCH_2: - case BUILT_IN_NAND_AND_FETCH_4: - case BUILT_IN_NAND_AND_FETCH_8: - case BUILT_IN_NAND_AND_FETCH_16: { + case BUILT_IN_NAND_AND_FETCH_4: { const Type *ResultTy = ConvertType(TREE_TYPE(exp)); tree arglist = TREE_OPERAND(exp, 1); Value* C[2] = { From dalej at apple.com Tue Sep 2 16:19:30 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 02 Sep 2008 21:19:30 -0000 Subject: [llvm-commits] [llvm] r55651 - in /llvm/trunk/test/FrontendC: Atomics-no64bit.c Atomics.c Message-ID: <200809022119.m82LJVNO019433@zion.cs.uiuc.edu> Author: johannes Date: Tue Sep 2 16:19:30 2008 New Revision: 55651 URL: http://llvm.org/viewvc/llvm-project?rev=55651&view=rev Log: New testcase for targets without 64-bit atomics; xfail old test for ppc. Added: llvm/trunk/test/FrontendC/Atomics-no64bit.c Modified: llvm/trunk/test/FrontendC/Atomics.c Added: llvm/trunk/test/FrontendC/Atomics-no64bit.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/Atomics-no64bit.c?rev=55651&view=auto ============================================================================== --- llvm/trunk/test/FrontendC/Atomics-no64bit.c (added) +++ llvm/trunk/test/FrontendC/Atomics-no64bit.c Tue Sep 2 16:19:30 2008 @@ -0,0 +1,236 @@ +// Test frontend handling of __sync builtins. +// Modified from a gcc testcase. +// RUN: %llvmgcc -S %s -o - | grep atomic | count 192 +// RUN: %llvmgcc -S %s -o - | grep p0i8 | count 50 +// RUN: %llvmgcc -S %s -o - | grep p0i16 | count 50 +// RUN: %llvmgcc -S %s -o - | grep p0i32 | count 92 +// RUN: %llvmgcc -S %s -o - | grep volatile | count 8 + +// Currently this is implemented only for Alpha, X86, PowerPC. +// Add your target here if it doesn't work. +// This version of the test does not include long long. +// XFAIL: sparc|arm|ia64 + +signed char sc; +unsigned char uc; +signed short ss; +unsigned short us; +signed int si; +unsigned int ui; +signed long sl; +unsigned long ul; + +void test_op_ignore (void) +{ + (void) __sync_fetch_and_add (&sc, 1); + (void) __sync_fetch_and_add (&uc, 1); + (void) __sync_fetch_and_add (&ss, 1); + (void) __sync_fetch_and_add (&us, 1); + (void) __sync_fetch_and_add (&si, 1); + (void) __sync_fetch_and_add (&ui, 1); + (void) __sync_fetch_and_add (&sl, 1); + (void) __sync_fetch_and_add (&ul, 1); + + (void) __sync_fetch_and_sub (&sc, 1); + (void) __sync_fetch_and_sub (&uc, 1); + (void) __sync_fetch_and_sub (&ss, 1); + (void) __sync_fetch_and_sub (&us, 1); + (void) __sync_fetch_and_sub (&si, 1); + (void) __sync_fetch_and_sub (&ui, 1); + (void) __sync_fetch_and_sub (&sl, 1); + (void) __sync_fetch_and_sub (&ul, 1); + + (void) __sync_fetch_and_or (&sc, 1); + (void) __sync_fetch_and_or (&uc, 1); + (void) __sync_fetch_and_or (&ss, 1); + (void) __sync_fetch_and_or (&us, 1); + (void) __sync_fetch_and_or (&si, 1); + (void) __sync_fetch_and_or (&ui, 1); + (void) __sync_fetch_and_or (&sl, 1); + (void) __sync_fetch_and_or (&ul, 1); + + (void) __sync_fetch_and_xor (&sc, 1); + (void) __sync_fetch_and_xor (&uc, 1); + (void) __sync_fetch_and_xor (&ss, 1); + (void) __sync_fetch_and_xor (&us, 1); + (void) __sync_fetch_and_xor (&si, 1); + (void) __sync_fetch_and_xor (&ui, 1); + (void) __sync_fetch_and_xor (&sl, 1); + (void) __sync_fetch_and_xor (&ul, 1); + + (void) __sync_fetch_and_and (&sc, 1); + (void) __sync_fetch_and_and (&uc, 1); + (void) __sync_fetch_and_and (&ss, 1); + (void) __sync_fetch_and_and (&us, 1); + (void) __sync_fetch_and_and (&si, 1); + (void) __sync_fetch_and_and (&ui, 1); + (void) __sync_fetch_and_and (&sl, 1); + (void) __sync_fetch_and_and (&ul, 1); + + (void) __sync_fetch_and_nand (&sc, 1); + (void) __sync_fetch_and_nand (&uc, 1); + (void) __sync_fetch_and_nand (&ss, 1); + (void) __sync_fetch_and_nand (&us, 1); + (void) __sync_fetch_and_nand (&si, 1); + (void) __sync_fetch_and_nand (&ui, 1); + (void) __sync_fetch_and_nand (&sl, 1); + (void) __sync_fetch_and_nand (&ul, 1); +} + +void test_fetch_and_op (void) +{ + sc = __sync_fetch_and_add (&sc, 11); + uc = __sync_fetch_and_add (&uc, 11); + ss = __sync_fetch_and_add (&ss, 11); + us = __sync_fetch_and_add (&us, 11); + si = __sync_fetch_and_add (&si, 11); + ui = __sync_fetch_and_add (&ui, 11); + sl = __sync_fetch_and_add (&sl, 11); + ul = __sync_fetch_and_add (&ul, 11); + + sc = __sync_fetch_and_sub (&sc, 11); + uc = __sync_fetch_and_sub (&uc, 11); + ss = __sync_fetch_and_sub (&ss, 11); + us = __sync_fetch_and_sub (&us, 11); + si = __sync_fetch_and_sub (&si, 11); + ui = __sync_fetch_and_sub (&ui, 11); + sl = __sync_fetch_and_sub (&sl, 11); + ul = __sync_fetch_and_sub (&ul, 11); + + sc = __sync_fetch_and_or (&sc, 11); + uc = __sync_fetch_and_or (&uc, 11); + ss = __sync_fetch_and_or (&ss, 11); + us = __sync_fetch_and_or (&us, 11); + si = __sync_fetch_and_or (&si, 11); + ui = __sync_fetch_and_or (&ui, 11); + sl = __sync_fetch_and_or (&sl, 11); + ul = __sync_fetch_and_or (&ul, 11); + + sc = __sync_fetch_and_xor (&sc, 11); + uc = __sync_fetch_and_xor (&uc, 11); + ss = __sync_fetch_and_xor (&ss, 11); + us = __sync_fetch_and_xor (&us, 11); + si = __sync_fetch_and_xor (&si, 11); + ui = __sync_fetch_and_xor (&ui, 11); + sl = __sync_fetch_and_xor (&sl, 11); + ul = __sync_fetch_and_xor (&ul, 11); + + sc = __sync_fetch_and_and (&sc, 11); + uc = __sync_fetch_and_and (&uc, 11); + ss = __sync_fetch_and_and (&ss, 11); + us = __sync_fetch_and_and (&us, 11); + si = __sync_fetch_and_and (&si, 11); + ui = __sync_fetch_and_and (&ui, 11); + sl = __sync_fetch_and_and (&sl, 11); + ul = __sync_fetch_and_and (&ul, 11); + + sc = __sync_fetch_and_nand (&sc, 11); + uc = __sync_fetch_and_nand (&uc, 11); + ss = __sync_fetch_and_nand (&ss, 11); + us = __sync_fetch_and_nand (&us, 11); + si = __sync_fetch_and_nand (&si, 11); + ui = __sync_fetch_and_nand (&ui, 11); + sl = __sync_fetch_and_nand (&sl, 11); + ul = __sync_fetch_and_nand (&ul, 11); +} + +void test_op_and_fetch (void) +{ + sc = __sync_add_and_fetch (&sc, uc); + uc = __sync_add_and_fetch (&uc, uc); + ss = __sync_add_and_fetch (&ss, uc); + us = __sync_add_and_fetch (&us, uc); + si = __sync_add_and_fetch (&si, uc); + ui = __sync_add_and_fetch (&ui, uc); + sl = __sync_add_and_fetch (&sl, uc); + ul = __sync_add_and_fetch (&ul, uc); + + sc = __sync_sub_and_fetch (&sc, uc); + uc = __sync_sub_and_fetch (&uc, uc); + ss = __sync_sub_and_fetch (&ss, uc); + us = __sync_sub_and_fetch (&us, uc); + si = __sync_sub_and_fetch (&si, uc); + ui = __sync_sub_and_fetch (&ui, uc); + sl = __sync_sub_and_fetch (&sl, uc); + ul = __sync_sub_and_fetch (&ul, uc); + + sc = __sync_or_and_fetch (&sc, uc); + uc = __sync_or_and_fetch (&uc, uc); + ss = __sync_or_and_fetch (&ss, uc); + us = __sync_or_and_fetch (&us, uc); + si = __sync_or_and_fetch (&si, uc); + ui = __sync_or_and_fetch (&ui, uc); + sl = __sync_or_and_fetch (&sl, uc); + ul = __sync_or_and_fetch (&ul, uc); + + sc = __sync_xor_and_fetch (&sc, uc); + uc = __sync_xor_and_fetch (&uc, uc); + ss = __sync_xor_and_fetch (&ss, uc); + us = __sync_xor_and_fetch (&us, uc); + si = __sync_xor_and_fetch (&si, uc); + ui = __sync_xor_and_fetch (&ui, uc); + sl = __sync_xor_and_fetch (&sl, uc); + ul = __sync_xor_and_fetch (&ul, uc); + + sc = __sync_and_and_fetch (&sc, uc); + uc = __sync_and_and_fetch (&uc, uc); + ss = __sync_and_and_fetch (&ss, uc); + us = __sync_and_and_fetch (&us, uc); + si = __sync_and_and_fetch (&si, uc); + ui = __sync_and_and_fetch (&ui, uc); + sl = __sync_and_and_fetch (&sl, uc); + ul = __sync_and_and_fetch (&ul, uc); + + sc = __sync_nand_and_fetch (&sc, uc); + uc = __sync_nand_and_fetch (&uc, uc); + ss = __sync_nand_and_fetch (&ss, uc); + us = __sync_nand_and_fetch (&us, uc); + si = __sync_nand_and_fetch (&si, uc); + ui = __sync_nand_and_fetch (&ui, uc); + sl = __sync_nand_and_fetch (&sl, uc); + ul = __sync_nand_and_fetch (&ul, uc); +} + +void test_compare_and_swap (void) +{ + sc = __sync_val_compare_and_swap (&sc, uc, sc); + uc = __sync_val_compare_and_swap (&uc, uc, sc); + ss = __sync_val_compare_and_swap (&ss, uc, sc); + us = __sync_val_compare_and_swap (&us, uc, sc); + si = __sync_val_compare_and_swap (&si, uc, sc); + ui = __sync_val_compare_and_swap (&ui, uc, sc); + sl = __sync_val_compare_and_swap (&sl, uc, sc); + ul = __sync_val_compare_and_swap (&ul, uc, sc); + + ui = __sync_bool_compare_and_swap (&sc, uc, sc); + ui = __sync_bool_compare_and_swap (&uc, uc, sc); + ui = __sync_bool_compare_and_swap (&ss, uc, sc); + ui = __sync_bool_compare_and_swap (&us, uc, sc); + ui = __sync_bool_compare_and_swap (&si, uc, sc); + ui = __sync_bool_compare_and_swap (&ui, uc, sc); + ui = __sync_bool_compare_and_swap (&sl, uc, sc); + ui = __sync_bool_compare_and_swap (&ul, uc, sc); +} + +void test_lock (void) +{ + sc = __sync_lock_test_and_set (&sc, 1); + uc = __sync_lock_test_and_set (&uc, 1); + ss = __sync_lock_test_and_set (&ss, 1); + us = __sync_lock_test_and_set (&us, 1); + si = __sync_lock_test_and_set (&si, 1); + ui = __sync_lock_test_and_set (&ui, 1); + sl = __sync_lock_test_and_set (&sl, 1); + ul = __sync_lock_test_and_set (&ul, 1); + + __sync_synchronize (); + + __sync_lock_release (&sc); + __sync_lock_release (&uc); + __sync_lock_release (&ss); + __sync_lock_release (&us); + __sync_lock_release (&si); + __sync_lock_release (&ui); + __sync_lock_release (&sl); + __sync_lock_release (&ul); +} Modified: llvm/trunk/test/FrontendC/Atomics.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/Atomics.c?rev=55651&r1=55650&r2=55651&view=diff ============================================================================== --- llvm/trunk/test/FrontendC/Atomics.c (original) +++ llvm/trunk/test/FrontendC/Atomics.c Tue Sep 2 16:19:30 2008 @@ -8,7 +8,8 @@ // Currently this is implemented only for Alpha, X86, PowerPC. // Add your target here if it doesn't work. -// XFAIL: sparc|arm|ia64 +// PPC32 does not translate the long long variants, so fails this test. +// XFAIL: sparc|arm|ia64|powerpc signed char sc; unsigned char uc; From isanbard at gmail.com Tue Sep 2 16:34:10 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:34:10 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55653 - in /llvm-gcc-4.2/trunk: gcc/common.opt gcc/cp/Make-lang.in gcc/cp/class.c gcc/cp/cp-gimplify.c gcc/cp/cp-lang.c gcc/cp/cp-objcp-common.c gcc/cp/cp-tree.h gcc/gimplify.c gcc/objcp/objcp-lang.c gcc/toplev.c gcc/tree.c libcpp/charset.c Message-ID: <200809022134.m82LYB2t020015@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:34:10 2008 New Revision: 55653 URL: http://llvm.org/viewvc/llvm-project?rev=55653&view=rev Log: Comment and whitespace fixes Modified: llvm-gcc-4.2/trunk/gcc/common.opt llvm-gcc-4.2/trunk/gcc/cp/Make-lang.in llvm-gcc-4.2/trunk/gcc/cp/class.c llvm-gcc-4.2/trunk/gcc/cp/cp-gimplify.c llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.c llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h llvm-gcc-4.2/trunk/gcc/gimplify.c llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c llvm-gcc-4.2/trunk/gcc/toplev.c llvm-gcc-4.2/trunk/gcc/tree.c llvm-gcc-4.2/trunk/libcpp/charset.c Modified: llvm-gcc-4.2/trunk/gcc/common.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/common.opt?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/common.opt (original) +++ llvm-gcc-4.2/trunk/gcc/common.opt Tue Sep 2 16:34:10 2008 @@ -1011,9 +1011,12 @@ Common RejectNegative Joined -fstack-limit-symbol= Trap if the stack goes past symbol +; APPLE LOCAL begin stack-protector default 5095227 +; LLVM LOCAL FIXME Don't add Init just yet fstack-protector Common Report Var(flag_stack_protect, 1) Use propolice as a stack protection method +; APPLE LOCAL end stack-protector default 5095227 fstack-protector-all Common Report RejectNegative Var(flag_stack_protect, 2) VarExists Modified: llvm-gcc-4.2/trunk/gcc/cp/Make-lang.in URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/Make-lang.in?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/Make-lang.in (original) +++ llvm-gcc-4.2/trunk/gcc/cp/Make-lang.in Tue Sep 2 16:34:10 2008 @@ -107,7 +107,7 @@ $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) \ $(CC1PLUS_ORDER_FLAGS) -# APLE LOCAL end LLVM +# LLVM LOCAL end cc1plus-checksum.c : cc1plus-dummy$(exeext) build/genchecksum$(build_exeext) build/genchecksum$(build_exeext) cc1plus-dummy$(exeext) > $@ Modified: llvm-gcc-4.2/trunk/gcc/cp/class.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/class.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/class.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/class.c Tue Sep 2 16:34:10 2008 @@ -1481,9 +1481,9 @@ = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t); /* APPLE LOCAL begin omit calls to empty destructors 5559195 */ - CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (variants) = + CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (variants) = CLASSTYPE_HAS_NONTRIVIAL_DESTRUCTOR_BODY (t); - CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (variants) = + CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (variants) = CLASSTYPE_DESTRUCTOR_NONTRIVIAL_BECAUSE_OF_BASE (t); /* APPLE LOCAL end omit calls to empty destructors 5559195 */ @@ -8011,7 +8011,7 @@ /* APPLE LOCAL end KEXT double destructor */ /* APPLE LOCAL begin 4167759 */ -/* Set DECL_IGNORED_P flag for ctors and dtors associated +/* Set DECL_IGNORED_P flag for ctors and dtors associated with TYPE using VALUE. */ void cp_set_decl_ignore_flag (tree type, int value) Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-gimplify.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-gimplify.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-gimplify.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-gimplify.c Tue Sep 2 16:34:10 2008 @@ -292,7 +292,7 @@ append_to_statement_list (t, &exit); /* elem = nil */ t = build2 (MODIFY_EXPR, void_type_node, inner_foreach, - fold_convert (TREE_TYPE (inner_foreach), + fold_convert (TREE_TYPE (inner_foreach), integer_zero_node)); gimplify_stmt (&t); append_to_statement_list (t, &exit); @@ -314,7 +314,7 @@ /* APPLE LOCAL begin radar 4547045 */ /* Pop foreach's inner loop break label so outer loop's - break label becomes target of inner loop body's break statements. + break label becomes target of inner loop body's break statements. */ t = NULL_TREE; /* APPLE LOCAL radar 4667060 */ Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-lang.c Tue Sep 2 16:34:10 2008 @@ -150,4 +150,5 @@ { cp_finish_file (); } + #include "gtype-cp.h" Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-objcp-common.c Tue Sep 2 16:34:10 2008 @@ -291,7 +291,7 @@ code = TREE_CODE (typename); class = TREE_CODE_CLASS (code); - if (code != IDENTIFIER_NODE + if (code != IDENTIFIER_NODE || class != tcc_exceptional) return retval; Modified: llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cp-tree.h Tue Sep 2 16:34:10 2008 @@ -3134,8 +3134,8 @@ /* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \ #define DO_ATTRIBUTES(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 2) /* APPLE LOCAL begin C* language */ -/* Used as a flag to indicate synthesized inner do-while loop of a - foreach statement. Used for generation of break/continue statement +/* Used as a flag to indicate synthesized inner do-while loop of a + foreach statement. Used for generation of break/continue statement of the loop. */ #define DO_FOREACH(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 3) /* APPLE LOCAL end C* language */ Modified: llvm-gcc-4.2/trunk/gcc/gimplify.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gimplify.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gimplify.c (original) +++ llvm-gcc-4.2/trunk/gcc/gimplify.c Tue Sep 2 16:34:10 2008 @@ -1148,7 +1148,7 @@ tree result_decl, result; if (!ret_expr || TREE_CODE (ret_expr) == RESULT_DECL - /* APPLE LOCAL begin radar 6040305 - blocks */ + /* APPLE LOCAL radar 6040305 - blocks */ || ret_expr == error_mark_node || cur_block) return GS_ALL_DONE; Modified: llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c (original) +++ llvm-gcc-4.2/trunk/gcc/objcp/objcp-lang.c Tue Sep 2 16:34:10 2008 @@ -213,4 +213,5 @@ { objc_finish_file (); } + #include "gtype-objcp.h" Modified: llvm-gcc-4.2/trunk/gcc/toplev.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/toplev.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/toplev.c (original) +++ llvm-gcc-4.2/trunk/gcc/toplev.c Tue Sep 2 16:34:10 2008 @@ -259,10 +259,8 @@ int flag_short_enums; /* LLVM LOCAL begin */ - /* Options to pass directly into the LLVM backend. */ const char *llvm_optns = 0; - /* LLVM LOCAL end */ /* APPLE LOCAL begin -fast or -fastf or -fastcp */ Modified: llvm-gcc-4.2/trunk/gcc/tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree.c Tue Sep 2 16:34:10 2008 @@ -2883,7 +2883,7 @@ } else if (CONSTANT_CLASS_P (node)) ; -/* APPLE LOCAL begin LLVM */ +/* LLVM LOCAL begin */ #ifdef ENABLE_LLVM /* Support the "array ref with pointer base" extension. If we have &p[i], treat this like we do a binop. @@ -2898,7 +2898,7 @@ TREE_SIDE_EFFECTS(TREE_OPERAND(node, 1)); } #endif -/* APPLE LOCAL end LLVM */ +/* LLVM LOCAL end */ else { ti = tc = false; Modified: llvm-gcc-4.2/trunk/libcpp/charset.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/charset.c?rev=55653&r1=55652&r2=55653&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/charset.c (original) +++ llvm-gcc-4.2/trunk/libcpp/charset.c Tue Sep 2 16:34:10 2008 @@ -1692,7 +1692,7 @@ terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ - /* APPLE LOCAL don't read to.text[-1] radar 6121572 */ + /* APPLE LOCAL don't access to.text[-1] radar 6121572 */ if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else From matthijs at stdin.nl Tue Sep 2 16:40:01 2008 From: matthijs at stdin.nl (Matthijs Kooijman) Date: Tue, 2 Sep 2008 23:40:01 +0200 Subject: [llvm-commits] [llvm] r55557 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac autoconf/m4/visibility_inlines_hidden.m4 configure In-Reply-To: <20080902202155.GI32157@katherina.student.utwente.nl> References: <200808300116.m7U1GKHE014061@zion.cs.uiuc.edu> <20080902094441.GA32157@katherina.student.utwente.nl> <20080902125509.GD32157@katherina.student.utwente.nl> <6a8523d60809021012u3ec52bfdu174f9948003417b0@mail.gmail.com> <20080902182640.GG32157@katherina.student.utwente.nl> <20080902202155.GI32157@katherina.student.utwente.nl> Message-ID: <20080902214001.GK32157@katherina.student.utwente.nl> Hi Daniel, I think this is really a compiler bug. I'm not completely sure what -fvisibility-inlines-hidden is supposed to do, but it also breaks with the following trivial twoliner: matthijs at xanthe:~$ cat test.cpp #include std::string foo; matthijs at xanthe:~$ g++-4.1 test.cpp -fvisibility-inlines-hidden /usr/lib/gcc/x86_64-linux-gnu/4.1.3/../../../../lib/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' /tmp/ccvMMK6h.o: In function `__tcf_0': test.cpp:(.text+0x12): undefined reference to `std::basic_string, std::allocator >::~basic_string()' /tmp/ccvMMK6h.o: In function `__static_initialization_and_destruction_0(int, int)': test.cpp:(.text+0x3b): undefined reference to `std::basic_string, std::allocator >::basic_string()' /usr/bin/ld: a.out: hidden symbol `std::basic_string, std::allocator >::~basic_string()' isn't defined /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: ld returned 1 exit status (disregarding the undefined main error). I'm wondering if this is Debian/Ubuntu specific, or also happens using upstream gcc versions. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080902/f999fd5b/attachment.bin From isanbard at gmail.com Tue Sep 2 16:43:04 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:43:04 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55654 - in /llvm-gcc-4.2/trunk/gcc: cfg.c cp/cvt.c cp/pt.c crtstuff.c doc/invoke.texi gcc.c gcov.c ipa-inline.c opts.c Message-ID: <200809022143.m82Lh5cx020305@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:43:04 2008 New Revision: 55654 URL: http://llvm.org/viewvc/llvm-project?rev=55654&view=rev Log: Default to Wformat-security Modified: llvm-gcc-4.2/trunk/gcc/cfg.c llvm-gcc-4.2/trunk/gcc/cp/cvt.c llvm-gcc-4.2/trunk/gcc/cp/pt.c llvm-gcc-4.2/trunk/gcc/crtstuff.c llvm-gcc-4.2/trunk/gcc/doc/invoke.texi llvm-gcc-4.2/trunk/gcc/gcc.c llvm-gcc-4.2/trunk/gcc/gcov.c llvm-gcc-4.2/trunk/gcc/ipa-inline.c llvm-gcc-4.2/trunk/gcc/opts.c Modified: llvm-gcc-4.2/trunk/gcc/cfg.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cfg.c?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cfg.c (original) +++ llvm-gcc-4.2/trunk/gcc/cfg.c Tue Sep 2 16:43:04 2008 @@ -830,7 +830,8 @@ else fprintf (file, ", "); first = false; - fprintf (file, bb_bitnames[i]); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fprintf (file, "%s", bb_bitnames[i]); } if (!first) fprintf (file, ")"); Modified: llvm-gcc-4.2/trunk/gcc/cp/cvt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/cvt.c?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/cvt.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/cvt.c Tue Sep 2 16:43:04 2008 @@ -640,7 +640,8 @@ if ((invalid_conv_diag = targetm.invalid_conversion (TREE_TYPE (expr), type))) { - error (invalid_conv_diag); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (invalid_conv_diag, ""); return error_mark_node; } Modified: llvm-gcc-4.2/trunk/gcc/cp/pt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/pt.c?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/pt.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/pt.c Tue Sep 2 16:43:04 2008 @@ -6702,7 +6702,7 @@ SET_DECL_ASSEMBLER_NAME (r, NULL_TREE); /* LLVM LOCAL begin */ #ifndef ENABLE_LLVM - SET_DECL_RTL (r, NULL_RTX); + SET_DECL_RTL (r, NULL_RTX); #else SET_DECL_LLVM (r, 0); #endif @@ -8971,7 +8971,8 @@ /*template_arg_p=*/false, &error_msg); if (error_msg) - error (error_msg); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error ("%s", error_msg); if (!function_p && TREE_CODE (decl) == IDENTIFIER_NODE) decl = unqualified_name_lookup_error (decl); return decl; Modified: llvm-gcc-4.2/trunk/gcc/crtstuff.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/crtstuff.c?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/crtstuff.c (original) +++ llvm-gcc-4.2/trunk/gcc/crtstuff.c Tue Sep 2 16:43:04 2008 @@ -192,7 +192,7 @@ #ifdef __llvm__ __attribute__ ((__used__, section(".ctors"), aligned(sizeof(func_ptr)))) #else - __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr)))) + __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr)))) #endif /* LLVM LOCAL end */ = { (func_ptr) (-1) }; @@ -529,7 +529,7 @@ /* FIXME: Remove when external weak linkage will be alive. */ __attribute__((__used__, section(".dtors"), aligned(sizeof(func_ptr)))) #else - __attribute__((unused, section(".dtors"), aligned(sizeof(func_ptr)))) + __attribute__((unused, section(".dtors"), aligned(sizeof(func_ptr)))) #endif /* LLVM LOCAL end */ = { (func_ptr) 0 }; Modified: llvm-gcc-4.2/trunk/gcc/doc/invoke.texi URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/doc/invoke.texi?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/doc/invoke.texi (original) +++ llvm-gcc-4.2/trunk/gcc/doc/invoke.texi Tue Sep 2 16:43:04 2008 @@ -282,9 +282,11 @@ -Wconversion -Wno-deprecated-declarations @gol -Wdisabled-optimization -Wno-div-by-zero -Wno-endif-labels @gol -Werror -Werror=* -Werror-implicit-function-declaration @gol --Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol + at c APPLE LOCAL default to Wformat-security 5764921 +-Wfatal-errors -Wfloat-equal -Wno-format -Wformat=2 @gol -Wno-format-extra-args -Wformat-nonliteral @gol --Wformat-security -Wformat-y2k @gol + at c APPLE LOCAL default to Wformat-security 5764921 +-Wno-format-security -Wformat-y2k @gol -Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol -Wimport -Wno-import -Winit-self -Winline @gol -Wno-int-to-pointer-cast @gol @@ -2437,33 +2439,43 @@ @item -fobjc-gc @opindex fobjc-gc Enable garbage collection (GC) in Objective-C and Objective-C++ programs. - at c APPLE LOCAL begin ObjC GC -The resulting binary requires additional runtime support which is not -present in any released version of Mac OS X. - -When the @option{-fobjc-gc} switch is specified, the compiler will replace -assignments to instance variables (ivars) and to certain kinds of pointers to -Objective-C object instances with calls to interceptor functions provided -by the runtime garbage collector. Two type qualifiers, @code{__strong} and - at code{__weak}, also become available. The @code{__strong} qualifier may be -used to indicate that assignments to variables of this type should generate -a GC interceptor call, e.g.: + at c APPLE LOCAL begin radar 5780114 - ObjC GC +The resulting binary requires additional runtime support which is present on +Mac OS X Version 10.5 (Leopard) and later. All Objective-C objects are presumed +to be garbage collected. To aid in this effort, compiler implements assignments +of Objective-C object pointers via runtime support functions. These functions work +correctly in non-GC environments as well, in case this code is used as part of a +library. Assignments of objects into instance variables of other objects are +intercepted, so are assignments to global object variables. In general, assignments +through pointers to objects are intercepted. Additionally, assignments of objects +as fields within structures are intercepted. + +In addition, other pointer variables may be marked with the __strong storage class +modifier to indicate to the compiler that these assignments need to use the assignment +runtime functions as well, allowing the memory referenced by these pointers to be +allocated from the collector. A __weak storage class modifier for pointers is also +introduced to indicate a zero-ing weak reference. This is permitted only for instance +variables of an object or globals. The compiler arranges for all reads as well as +writes to these variables to occur via runtime support functions. Under garbage +collection these variables are not consulted when determining what is not garbage +and they are set to nil (zero) if the memory they reference is deemed garbage and is +collected. @smallexample - __strong void *p; // assignments to 'p' will have interceptor calls + __strong void *p; // assignments to 'p' will have runtime support calls int *q; // assignments to 'q' ordinarly will not @dots{} - (__strong int *)q = 0; // this assignment will call an interceptor + (__strong int *)q = 0; // this assignment will call a runtime support function @end smallexample -Conversely, the @code{__weak} type qualifier may be used to suppress -interceptor call generation: +Conversely, the @code{__weak} type qualifier may be used to call weak runtime +functions. @smallexample - __weak id q; // assignments to 'q' will not have interceptor calls - id p; // assignments to 'p' will have interceptor calls + __weak id q; // assignments to 'q' will have the '__weak' semantics + id p; // assignments to 'p' will have the "__strong' semantics @dots{} - (__weak id)p = 0; // suppress interceptor call for this assignment + (__weak id)p = 0; // Fall back to '__weak' semantics in this assignment. @end smallexample @item -fobjc-gc-only @@ -2473,7 +2485,7 @@ This flag implies @option{-fobjc-gc} as well. With this flag, framework is marked as not honoring retain/release. - at c APPLE LOCAL end ObjC GC + at c APPLE LOCAL end radar 5780114 - ObjC GC @item -freplace-objc-classes @opindex freplace-objc-classes Emit a special marker instructing @command{ld(1)} not to statically link in @@ -2746,8 +2758,10 @@ occurred rather than trying to keep going and printing further error messages. - at item -Wformat - at opindex Wformat + at c APPLE LOCAL begin default to Wformat-security 5764921 + at item -Wno-format + at opindex Wno-format + at c APPLE LOCAL end default to Wformat-security 5764921 @opindex ffreestanding @opindex fno-builtin Check calls to @code{printf} and @code{scanf}, etc., to make sure that @@ -2812,8 +2826,10 @@ string literal and so cannot be checked, unless the format function takes its format arguments as a @code{va_list}. - at item -Wformat-security - at opindex Wformat-security + at c APPLE LOCAL begin default to Wformat-security 5764921 + at item -Wno-format-security + at opindex Wno-format-security + at c APPLE LOCAL end default to Wformat-security 5764921 If @option{-Wformat} is specified, also warn about uses of format functions that represent possible security problems. At present, this warns about calls to @code{printf} and @code{scanf} functions where the @@ -3618,8 +3634,6 @@ @item -Wshorten-64-to-32 @opindex Wshorten-64-to-32 Warn if a value is implicitly converted from a 64 bit type to a 32 bit type. -This option is deprecated in favor of the -Wconversion option in future -releases. @c APPLE LOCAL end mainline @c APPLE LOCAL begin mainline Modified: llvm-gcc-4.2/trunk/gcc/gcc.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gcc.c?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gcc.c (original) +++ llvm-gcc-4.2/trunk/gcc/gcc.c Tue Sep 2 16:43:04 2008 @@ -3054,7 +3054,8 @@ if (errmsg != NULL) { if (err == 0) - fatal (errmsg); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fatal ("%s", errmsg); else { errno = err; @@ -6842,7 +6843,8 @@ if (! verbose_flag) { - printf (_("\nFor bug reporting instructions, please see:\n")); + /* APPLE LOCAL default to Wformat-security 5764921 */ + printf ("%s", _("\nFor bug reporting instructions, please see:\n")); printf ("%s.\n", bug_report_url); return (0); Modified: llvm-gcc-4.2/trunk/gcc/gcov.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gcov.c?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gcov.c (original) +++ llvm-gcc-4.2/trunk/gcc/gcov.c Tue Sep 2 16:43:04 2008 @@ -417,7 +417,8 @@ fnotice (stdout, "gcov (GCC) %s\n", version_string); fprintf (stdout, "Copyright %s 2006 Free Software Foundation, Inc.\n", _("(C)")); - fnotice (stdout, + /* APPLE LOCAL default to Wformat-security 5764921 */ + fnotice (stdout, "%s", _("This is free software; see the source for copying conditions.\n" "There is NO warranty; not even for MERCHANTABILITY or \n" "FITNESS FOR A PARTICULAR PURPOSE.\n\n")); Modified: llvm-gcc-4.2/trunk/gcc/ipa-inline.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ipa-inline.c?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ipa-inline.c (original) +++ llvm-gcc-4.2/trunk/gcc/ipa-inline.c Tue Sep 2 16:43:04 2008 @@ -310,7 +310,8 @@ if (!DECL_STRUCT_FUNCTION (decl)->cfg) { if (reason) - *reason = N_("function body not available"); + /* APPLE LOCAL wording 4598393 */ + *reason = N_("the function body must appear before caller"); return false; } @@ -1088,7 +1089,8 @@ if (altivec_infection (node->callers)) { if (dump_file) - fprintf (dump_file, node->callers->inline_failed); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fprintf (dump_file, "%s", node->callers->inline_failed); continue; } /* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */ Modified: llvm-gcc-4.2/trunk/gcc/opts.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/opts.c?rev=55654&r1=55653&r2=55654&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/opts.c (original) +++ llvm-gcc-4.2/trunk/gcc/opts.c Tue Sep 2 16:43:04 2008 @@ -1379,7 +1379,8 @@ for (i = 0; i < cl_options_count; i++) if ((cl_options[i].flags & (CL_TARGET | CL_UNDOCUMENTED)) == CL_TARGET) { - printf (_("\nTarget specific options:\n")); + /* APPLE LOCAL default to Wformat-security 5764921 */ + printf ("%s", _("\nTarget specific options:\n")); print_filtered_help (CL_TARGET); break; } From isanbard at gmail.com Tue Sep 2 16:45:02 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:45:02 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55655 - in /llvm-gcc-4.2/trunk/gcc: c-convert.c c-incpath.c collect2.c langhooks.c tlink.c unwind-dw2.c Message-ID: <200809022145.m82Lj2Xc020372@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:45:01 2008 New Revision: 55655 URL: http://llvm.org/viewvc/llvm-project?rev=55655&view=rev Log: Default to Wformat-security and comment fixes Modified: llvm-gcc-4.2/trunk/gcc/c-convert.c llvm-gcc-4.2/trunk/gcc/c-incpath.c llvm-gcc-4.2/trunk/gcc/collect2.c llvm-gcc-4.2/trunk/gcc/langhooks.c llvm-gcc-4.2/trunk/gcc/tlink.c llvm-gcc-4.2/trunk/gcc/unwind-dw2.c Modified: llvm-gcc-4.2/trunk/gcc/c-convert.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-convert.c?rev=55655&r1=55654&r2=55655&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-convert.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-convert.c Tue Sep 2 16:45:01 2008 @@ -80,7 +80,8 @@ if ((invalid_conv_diag = targetm.invalid_conversion (TREE_TYPE (expr), type))) { - error (invalid_conv_diag); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (invalid_conv_diag, ""); return error_mark_node; } Modified: llvm-gcc-4.2/trunk/gcc/c-incpath.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-incpath.c?rev=55655&r1=55654&r2=55655&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-incpath.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-incpath.c Tue Sep 2 16:45:01 2008 @@ -74,7 +74,8 @@ case REASON_DUP_SYS: fprintf (stderr, _("ignoring duplicate directory \"%s\"\n"), path->name); if (reason == REASON_DUP_SYS) - fprintf (stderr, + /* APPLE LOCAL default to Wformat-security 5764921 */ + fprintf (stderr, "%s", _(" as it is a non-system directory that duplicates a system directory\n")); break; @@ -483,11 +484,13 @@ { struct cpp_dir *p; - fprintf (stderr, _("#include \"...\" search starts here:\n")); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fprintf (stderr, "%s", _("#include \"...\" search starts here:\n")); for (p = heads[QUOTE];; p = p->next) { if (p == heads[BRACKET]) - fprintf (stderr, _("#include <...> search starts here:\n")); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fprintf (stderr, "%s", _("#include <...> search starts here:\n")); if (!p) break; /* APPLE LOCAL begin 5033355 */ @@ -499,7 +502,8 @@ fprintf (stderr, " %s (framework directory)\n", p->name); /* APPLE LOCAL end 5033355 */ } - fprintf (stderr, _("End of search list.\n")); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fprintf (stderr, "%s", _("End of search list.\n")); } } Modified: llvm-gcc-4.2/trunk/gcc/collect2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/collect2.c?rev=55655&r1=55654&r2=55655&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/collect2.c (original) +++ llvm-gcc-4.2/trunk/gcc/collect2.c Tue Sep 2 16:45:01 2008 @@ -1572,10 +1572,12 @@ if (err != 0) { errno = err; - fatal_perror (errmsg); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fatal_perror ("%s", errmsg); } else - fatal (errmsg); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fatal ("%s", errmsg); } return pex; @@ -2060,10 +2062,12 @@ if (err != 0) { errno = err; - fatal_perror (errmsg); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fatal_perror ("%s", errmsg); } else - fatal (errmsg); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fatal ("%s", errmsg); } int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); Modified: llvm-gcc-4.2/trunk/gcc/langhooks.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/langhooks.c?rev=55655&r1=55654&r2=55655&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/langhooks.c (original) +++ llvm-gcc-4.2/trunk/gcc/langhooks.c Tue Sep 2 16:45:01 2008 @@ -522,7 +522,8 @@ pp_set_prefix (context->printer, new_prefix); if (current_function_decl == NULL) - pp_printf (context->printer, _("At top level:")); + /* APPLE LOCAL default to Wformat-security 5764921 */ + pp_printf (context->printer, "%s", _("At top level:")); else { if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE) Modified: llvm-gcc-4.2/trunk/gcc/tlink.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tlink.c?rev=55655&r1=55654&r2=55655&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tlink.c (original) +++ llvm-gcc-4.2/trunk/gcc/tlink.c Tue Sep 2 16:45:01 2008 @@ -785,7 +785,8 @@ if (! recompile_files ()) break; if (tlink_verbose) - fprintf (stderr, _("collect: relinking\n")); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fprintf (stderr, "%s", _("collect: relinking\n")); exit = tlink_execute ("ld", ld_argv, ldout, lderrout); } } Modified: llvm-gcc-4.2/trunk/gcc/unwind-dw2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/unwind-dw2.c?rev=55655&r1=55654&r2=55655&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/unwind-dw2.c (original) +++ llvm-gcc-4.2/trunk/gcc/unwind-dw2.c Tue Sep 2 16:45:01 2008 @@ -1514,6 +1514,7 @@ /* LLVM LOCAL begin This change is needed to match Apple's installed libgcc. */ #ifdef LLVM_STACKSENSITIVE_UNWIND_RESUME + /* APPLE LOCAL libgcc 6148462 */ return _Unwind_GetCFA (context); #else return _Unwind_GetIP (context); From dpatel at apple.com Tue Sep 2 16:46:44 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 21:46:44 -0000 Subject: [llvm-commits] [llvm] r55656 - /llvm/trunk/lib/VMCore/AsmWriter.cpp Message-ID: <200809022146.m82Lkivi020436@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 16:46:44 2008 New Revision: 55656 URL: http://llvm.org/viewvc/llvm-project?rev=55656&view=rev Log: Use bitwise AND. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=55656&r1=55655&r2=55656&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Tue Sep 2 16:46:44 2008 @@ -1398,9 +1398,9 @@ FunctionNotes FNotes = F->getNotes(); if (FNotes != FP_None) { Out << " notes("; - if (FNotes && FP_AlwaysInline) + if (FNotes & FP_AlwaysInline) Out << "inline=always"; - else if (FNotes && FP_NoInline) + else if (FNotes & FP_NoInline) Out << "inline=never"; Out << ")"; } From dpatel at apple.com Tue Sep 2 16:47:14 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 21:47:14 -0000 Subject: [llvm-commits] [llvm] r55657 - in /llvm/trunk: lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Writer/BitcodeWriter.cpp test/Assembler/2008-09-02-FunctionNotes.ll Message-ID: <200809022147.m82LlEZ4020463@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 16:47:13 2008 New Revision: 55657 URL: http://llvm.org/viewvc/llvm-project?rev=55657&view=rev Log: Read and write function notes. Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=55657&r1=55656&r2=55657&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Sep 2 16:47:13 2008 @@ -1197,6 +1197,9 @@ return Error("Invalid GC ID"); Func->setGC(GCTable[Record[8]-1].c_str()); } + if (!isProto && Record.size() > 9 && Record[9]) { + Func->setNotes(Record[9]); + } ValueList.push_back(Func); Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=55657&r1=55656&r2=55657&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original) +++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Tue Sep 2 16:47:13 2008 @@ -412,6 +412,7 @@ Vals.push_back(F->hasSection() ? SectionMap[F->getSection()] : 0); Vals.push_back(getEncodedVisibility(F)); Vals.push_back(F->hasGC() ? GCMap[F->getGC()] : 0); + Vals.push_back(F->getNotes()); unsigned AbbrevToUse = 0; Stream.EmitRecord(bitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse); Modified: llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll?rev=55657&r1=55656&r2=55657&view=diff ============================================================================== --- llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll (original) +++ llvm/trunk/test/Assembler/2008-09-02-FunctionNotes.ll Tue Sep 2 16:47:13 2008 @@ -1,5 +1,5 @@ ; Test function notes -; RUN: llvm-as < %s -f -o /dev/null +; RUN: llvm-as < %s | llvm-dis | grep inline | count 2 define void @fn1() notes(inline=always) { ret void @@ -9,3 +9,6 @@ ret void } +define void @fn3() { + ret void +} From isanbard at gmail.com Tue Sep 2 16:47:50 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:47:50 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55658 - /llvm-gcc-4.2/trunk/fixincludes/mkfixinc.sh Message-ID: <200809022147.m82LloBn020491@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:47:50 2008 New Revision: 55658 URL: http://llvm.org/viewvc/llvm-project?rev=55658&view=rev Log: Add mingw32 Modified: llvm-gcc-4.2/trunk/fixincludes/mkfixinc.sh Modified: llvm-gcc-4.2/trunk/fixincludes/mkfixinc.sh URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/fixincludes/mkfixinc.sh?rev=55658&r1=55657&r2=55658&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/fixincludes/mkfixinc.sh (original) +++ llvm-gcc-4.2/trunk/fixincludes/mkfixinc.sh Tue Sep 2 16:47:50 2008 @@ -20,6 +20,7 @@ i?86-*-moss* | \ i?86-*-pe | \ i?86-*-cygwin* | \ + i?86-*-mingw32* | \ i?86-*-uwin* | \ i?86-*-interix* | \ powerpc-*-eabiaix* | \ From isanbard at gmail.com Tue Sep 2 16:48:25 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:48:25 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55659 - /llvm-gcc-4.2/trunk/gcc/config/arm/arm.md Message-ID: <200809022148.m82LmPuG020520@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:48:25 2008 New Revision: 55659 URL: http://llvm.org/viewvc/llvm-project?rev=55659&view=rev Log: Add missing length attribute Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.md Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.md URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.md?rev=55659&r1=55658&r2=55659&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.md (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.md Tue Sep 2 16:48:25 2008 @@ -1440,6 +1440,8 @@ (mult:SI (match_dup 3) (subreg:SI (match_dup 2) 4)) (subreg:SI (match_dup 0) 4)))] "" + ;; APPLE LOCAL 6110622 constant pool reference out of range + [(set_attr "length" "20")] ) ;; APPLE LOCAL end DImode multiply enhancement From isanbard at gmail.com Tue Sep 2 16:49:38 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:49:38 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55660 - in /llvm-gcc-4.2/trunk/gcc/config/arm: arm.c arm.h Message-ID: <200809022149.m82LndI5020570@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:49:38 2008 New Revision: 55660 URL: http://llvm.org/viewvc/llvm-project?rev=55660&view=rev Log: Mark pushes as RTW_FRAME_RELATED_P Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=55660&r1=55659&r2=55660&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Tue Sep 2 16:49:38 2008 @@ -84,6 +84,7 @@ static const char *fp_const_from_val (REAL_VALUE_TYPE *); static arm_cc get_arm_condition_code (rtx); static HOST_WIDE_INT int_log2 (HOST_WIDE_INT); +static rtx is_jump_table (rtx); static const char *output_multi_immediate (rtx *, const char *, const char *, int, HOST_WIDE_INT); static const char *shift_op (rtx, HOST_WIDE_INT *); @@ -12165,7 +12166,9 @@ & regs_above_fp; /* Save everything up to the FP, and the LR */ - emit_multi_reg_push (initial_push_regs); + insn = emit_multi_reg_push (initial_push_regs); + /* rdar://6148015 */ + RTX_FRAME_RELATED_P (insn) = 1; /* Configure FP to point to the saved FP. */ insn = emit_insn ( @@ -12179,7 +12182,11 @@ /* Push remaining regs. */ if (second_push_regs) - emit_multi_reg_push (second_push_regs); + { + insn = emit_multi_reg_push (second_push_regs); + /* rdar://6148015 */ + RTX_FRAME_RELATED_P (insn) = 1; + } } else { @@ -12640,7 +12647,8 @@ "wC12", "wC13", "wC14", "wC15" }; - fprintf (stream, wc_reg_names [INTVAL (x)]); + /* APPLE LOCAL default to Wformat-security 5764921 */ + fprintf (stream, "%s", wc_reg_names [INTVAL (x)]); } return; Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=55660&r1=55659&r2=55660&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Tue Sep 2 16:49:38 2008 @@ -2682,6 +2682,14 @@ (TARGET_THUMB ? (MAX (BASIC_ALIGN, 4 * BITS_PER_UNIT)) : BASIC_ALIGN) #endif /* APPLE LOCAL end ARM 4-byte align stack objects */ + +/* APPLE LOCAL begin ARM 6148015 */ +/* Tells us how to find the CFA == dwarf frame_base == address of stack + on entry to the function given the (virtual) arg-pointer. */ +#define ARG_POINTER_CFA_OFFSET(FNDECL) \ + ((FIRST_PARM_OFFSET (FNDECL)) \ + + (DECL_STRUCT_FUNCTION (FNDECL))->pretend_args_size) +/* APPLE LOCAL end ARM 6148015 */ enum arm_builtins { From isanbard at gmail.com Tue Sep 2 16:51:04 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:51:04 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55661 - in /llvm-gcc-4.2/trunk: ChangeLog.apple gcc/ChangeLog.apple gcc/cp/ChangeLog.apple gcc/objc/ChangeLog.apple gcc/testsuite/ChangeLog.apple Message-ID: <200809022151.m82Lp4BH020636@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:51:04 2008 New Revision: 55661 URL: http://llvm.org/viewvc/llvm-project?rev=55661&view=rev Log: Update change logs Modified: llvm-gcc-4.2/trunk/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple Modified: llvm-gcc-4.2/trunk/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/ChangeLog.apple?rev=55661&r1=55660&r2=55661&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/ChangeLog.apple Tue Sep 2 16:51:04 2008 @@ -1,3 +1,17 @@ +2008-08-25 Josh Conner + + Radar 6162685 + * build_libgcc: Strip libgcc. + + Radar 6175043 + * build_libgcc: Disable bootstrap if BOOTSTRAP is empty. + +2008-08-06 Eugene Marinelli + + Radar 6123671 + * driverdriver.c (main): Instead of aborting, print a fatal error when + there is no argument after -o. + 2008-06-04 Josh Conner Radar 5961147 Modified: llvm-gcc-4.2/trunk/gcc/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ChangeLog.apple?rev=55661&r1=55660&r2=55661&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/ChangeLog.apple Tue Sep 2 16:51:04 2008 @@ -1,3 +1,255 @@ +2008-08-28 Stuart Hastings + + Radar 5023884 + * gcc/config/darwin.h (LINK_SPEC): Remove "-multiply_defined + suppress". + +2008-08-28 Fariborz Jahanian + + Radar 6160536 + * c-commmon.c (build_block_helper_name): New + * c-common.h (build_block_helper_name): New decl. + * c-parser.c (c_parser_block_literal_expr): Call + build_block_helper_name to build pretty helper function + name. + +2008-08-28 Fariborz Jahanian + + Radar 6180456 + * c-decl.c (synth_block_byref_id_object_copy_func): Different + API for copying __block declared objects in c. + (synth_block_byref_id_object_dispose_func): Different API + for releasing __block declared objects in c. + * c-common.c (block_byref_assign_copy_decl): New + (build_indirect_object_id_exp): Cast to 'id *' in objective-c + mode only. + * c-common.h (build_block_byref_assign_copy_decl): New decl. + * c-parser.c (synth_copy_helper_block_func): Refactored code + to call build_block_byref_assign_copy_decl(). + +2008-08-27 Fariborz Jahanian + + Radar 6177162 + * c-typeck.c (build_external_ref): Allow local static as a byref + variable by default. + +2008-08-27 Fariborz Jahanian + + Radar 5780114 + * gcc/doc/extend.texi: Modify documentation for -fobjc-gc. + +2008-08-26 Stuart Hastings + + Radar 6131435 + * gcc/config/i386/i386.h (SLOW_BYTE_ACCESS): Remove check for + TARGET. + +2008-08-22 Fariborz Jahanian + + Radar 6164211 + * c-typeck.c (build_array_ref): Preserve element's + protocol list when building array type. + +2008-08-22 Fariborz Jahanian + + Radar 6172148 + * tree.h (BLOCK_SYNTHESIZED_FUNC): Define + * dwarf2out.c (dwarf2out_decl): Check for + block helpers and do not treat them as nested + functions. + * c-decl.c (build_helper_func_decl): Set BLOCK_SYNTHESIZED_FUNC + for all block helper functions. + +2008-08-25 Josh Conner + + Radar 6148015 + * config/arm/arm.h (ARG_POINTER_CFA_OFFSET): Define. + * config/arm/arm.c (arm_expand_prologue): Mark pushes as + RTX_FRAME_RELATED_P. + +2008-08-24 Caroline Tice + + Radars 6144664, 6145471, 6144634 + c-decl.c (build_block_byref_decl): Assign the source + location for each byref decl to the source location of + the helper function decl. + (build_block_ref_decl): Ditto for ref decls. + +2008-08-23 Josh Conner + + Radar 6162387 + * config/darwin-sections.def (objc_v2_selector_refs_section): + Change section type to literal_pointers. + +2008-08-22 Fariborz Jahanian + + Radar 5595325 + * config/darwin-protos.h (darwin_handle_nsobject_attribute): New decl. + * config/darwin.c (darwin_handle_nsobject_attribute): New handler + for NSObject attribute. + * config/darwin.h: New entry for NSObject attribute table. + +2008-08-19 Fariborz Jahanian + + Radar 5435299 + * c.opt (fnew-property-ivar-synthesis): New option. + +2008-08-20 Stuart Hastings + + Radar 6131435 + * gcc/config/i386.h (SLOW_BYTE_ACCESS): Fix APPLE LOCAL. + +2008-08-19 Stuart Hastings + + Radar 6131435 + * gcc/config/i386.h (SLOW_BYTE_ACCESS): Set false under + -mkernel, -fapple-kext, or -m64. + +2008-08-18 Josh Conner + + Revert: + 2008-08-14 Eugene Marinelli + Radar 6149764 + * Makefile.in: Add treecode-num-insns.def to tree-inline.o dependency + list. + + 2008-08-06 Eugene Marinelli + Radar 6013597 + * params.def: Change default PARAM_INLINE_CALL_COST from 16 to 2. + Multiply instruction-count related parameters by 0.55 to account + for new instruction count estimation. + * tree-inline.c (estimate_num_insns_1): Replace most cases with + addition of constants defined in treecode-num-insns.def. Other cases + modified to return 1000 times the estimated number of instructions. + (estimate_num_insns): Divide result of estimate_num_insns_1 by 1000. + * treecode-num-insns.def: Add + +2008-08-14 Eugene Marinelli + + Radar 6149764 + * Makefile.in: Add treecode-num-insns.def to tree-inline.o dependency + list. + +2008-08-14 Fariborz Jahanian + + Radar 5822844 + * c-typeck.c (digest_init): Handler block as initializer. + (c_finish_return): check for completed block before + analyzing block's return expression. + * varasm.c (output_constant): Allow outputting block data. + * c-common.h (BLOCK_IS_GLOBAL): New flag. + (block_is_complete): New field in block data structure. + * c-parser.c (build_block_struct_initlist): New initializer and + flag for global block data. + (build_block_literal_tmp): Temporary data for global block is + declared as global static. + (c_parser_block_literal_expr): Removed diagnostics for global blocks. + Moved fixing helper function type earlier before its tree is built. + +2008-08-11 Jim Grosbach + + Radar 6141565 + * gcc/c-common.c (iasm_constraint_for): fix compiler warning + +2008-08-08 Stuart Hastings + + Radar 6131435 + * gcc/config/i386.h (SLOW_BYTE_ACCESS): Set false for all + targets. + +2008-08-08 Stuart Hastings + + Radar 5971844 + * gcc/config/i386/darwin.opt + (-mdarwin-rtl-pre-ignore-critical-edges): New flag. + * gcc/postreload-gcse.c (eliminate_partially_redundant_load): + Disable critical edge check under + -mdarwin-rtl-pre-ignore-critical-edges. + +2008-08-07 Stuart Hastings + + Radar 6128170 + * gcc/except.c (output_function_exception_table): Move .align + ahead of both labels. + +2008-08-06 Fariborz Jahanian + + Radar 6014138 + * c-decl.c (build_block_byref_decl): In the presence of nested "{" + move up the scope chain until reaching the main function body's scope. + +2008-08-06 Eugene Marinelli + + Radar 6013597 + * params.def: Change default PARAM_INLINE_CALL_COST from 16 to 2. + Multiply instruction-count related parameters by 0.55 to account + for new instruction count estimation. + * tree-inline.c (estimate_num_insns_1): Replace most cases with + addition of constants defined in treecode-num-insns.def. Other cases + modified to return 1000 times the estimated number of instructions. + (estimate_num_insns): Divide result of estimate_num_insns_1 by 1000. + * treecode-num-insns.def: Add + +2008-08-06 Fariborz Jahanian + + Radar 6112131 - again (restore __byref again). + * config/darwin-c.c (darwin_cpp_builtins): Define __block. + +2008-08-05 Eugene Marinelli + + Radar 6020402 + Re-add fixed version of original patch for radar 6020402. + +2008-08-05 Jim Grosbach + + Radar 6110622 + * config/arm/arm.md (soft_muldi3): Missing length attribute + +2008-08-05 Stuart Hastings + + Radar 6102803 + * flow.c (recompute_reg_usage): If targeting ppc with + -ftree-pre, clear existing reg-lifetime info to insure + thorough dead-code elimination. + * sbitmap.c (dump_sbitmap_vector): Avoid dumping uninitialized + memory. + +2008-08-04 Eugene Marinelli + + Radar 6020402 + Temporarily reverting previous fix because of compilation error. + +2008-08-04 Fariborz Jahanian + + Radar 6040305 - work in progress. + * c-decl.c (build_indirect_object_id_exp): Removed. + * c-common.c (build_indirect_object_id_exp): Added + * c-common.h (build_indirect_object_id_exp): New decl. + * config/darwin-c.c (darwin_cpp_builtins): Define __byref + in c++ mode as well. + +2008-08-04 Eugene Marinelli + + Radar 6020402 + * calls.c (store_unaligned_arguments_into_pseudos): Add additional + argument to store_bit_field call. + * expmed.c (store_bit_field): Add argument for type of struct + containing the bit field. + (widest_mode_including_no_volatile_fields): Add. + (store_fixed_bit_field): Use widest_mode_including_no_volatile_fields + to set the maximum mode size to the size around the current field + that does not include any volatile fields. + * expr.c (emit_group_store, copy_blkmode_from_reg, write_complex_part): + Add arguments to store_bit_field calls. + * expr.h (store_bit_field): Add argument for struct type. + * ifcvt.c (noce_emit_move_insn): Add arguments to + store_bit_field calls. + +2008-08-4 Jim Grosbach + Radar 6090616 + * global.c (set_preference): Add checks to prevent integer underflow + of register numbers. + 2008-08-01 Geoff Keating Radar 5095227 Modified: llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple?rev=55661&r1=55660&r2=55661&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/cp/ChangeLog.apple Tue Sep 2 16:51:04 2008 @@ -1,3 +1,80 @@ +2008-08-28 Fariborz Jahanian + + Radar 6160536 + * parser.c (cp_parser_block_literal_expr): Call build_block_helper_name + to get pretty name for block helper function. + +2008-08-28 Fariborz Jahanian + + Radar 6180456 + * decl.c (synth_block_byref_id_object_copy_func): Use different + API when copying __block object in c language. + (synth_block_byref_id_object_dispose_func): Use different + API when releasing a __block object in c. + * parser.c (synth_copy_helper_block_func): Refactored to + call build_block_byref_assign_copy_decl(). + +2008-08-27 Fariborz Jahanian + + Radar 6087117 + * typeck.c (convert_arguments): Takes an extra argument + for distiguinsing block call to function calls. + (build_function_call): Tell convert_arguments if we + are calling a block. + +2008-08-22 Fariborz Jahanian + + Radar 6172148 + * parser.c (build_helper_func_decl): Set BLOCK_SYNTHESIZED_FUNC + for all block helper functions; used by die generation. + +2008-08-24 Caroline Tice + + Radar 6040305 - work in proggress. + * parser.c (clean_and_exit): Clean up if inside + a function. + (cp_parser_block_literal_expr): Set DECL_NO_STATIC_CHAIN + if inside a function. + +2008-08-05 Fariborz Jahanian + + Radar 6040305 - work in progress. + * decl.c (cp_finish_decl): local static is treated just + like global static wrt __byref. + * semantics.c (finish_id_expression): Ditto. + +2008-08-05 Fariborz Jahanian + + Radar 6040305 - work in progress. + * decl.c (init_byref_decl): Generate c-style helper + functions for compose/dispose helpers. + +2008-08-04 Fariborz Jahanian + + Radar 6040305 - work in progress. + * decl.c (synth_block_byref_id_object_copy_func, + synth_block_byref_id_object_dispose_func, + block_start_struct, block_finish_struct, + new_block_byref_decl, init_byref_decl): New routines. + (cp_finish_decl): Build the APIed version of + a __byref local vriable. + * semantics.c (finish_id_expression): Add a __byref + variable to the list of such variables for current + block. + * parser.c (build_component_ref): Fix to make it work. + (cp_parser_block_literal_expr): Push/pop language-c, + set context of the helper function. + (declare_block_prologue_local_vars): Mend tree for + the built-in local variables in the helper prologue. + 2008-07-31 Fariborz Jahanian Radar 6040305 - work in progress Modified: llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple?rev=55661&r1=55660&r2=55661&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/objc/ChangeLog.apple Tue Sep 2 16:51:04 2008 @@ -1,3 +1,80 @@ +2008-08-26 Fariborz Jahanian + + Radar 5595325 (minor addition) + * objc-act.c (objc_finish_message_expr): Do not warn + on invalid receiver type if receiver is an + NSObject. + +008-08-22 Fariborz Jahanian + + Radar 5595325 + * objc-act.c (objc_nsobject_attribute_type): New + (objc_compare_types): Allow NSObject pointers to match 'id' + (objc_is_object_ptr): An SObject pointer is a valid objective-c + object. + +2008-08-20 Fariborz Jahanian + + Radar 6157135 + * objc-act.c (objc_delta_format_args): Don't change + number of first variarg if it is 0. + +2008-08-19 Fariborz Jahanian + + Radar 5435299 + * objc-act.c (objc_synthesize_new_getter): Do not call + objc_lookup_property_ivar with -fnew-property-ivar-synthesis + (objc_synthesize_new_setter): Ditto. + (objc_add_internal_ivar): Synthesize an ivar according to + new rules. + (lookup_property_impl_in_list): New + (lookup_ivar_in_property_list): New + (objc_declare_property_impl): Diagnose a corner case + of a missing 'ivar'. Synthesize 'ivar' at point + of @synthesize declaration. Issue more diagnostics. + +2008-08-19 Fariborz Jahanian + + Radar 5847641 + * objc-act.c (objc_declare_property_impl): Warn if + undeclared ivar is specified on @synthesize. + +2008-08-18 Fariborz Jahanian + + Radar 5424416 + * objc-act.c (objc_start_method_definition): Issue + diagnostics on methods returning array or function. + +2008-08-18 Fariborz Jahanian + + Radar 5453108 + * objc-act.c (property_method_in_class): New + (check_methods): Check on method being a property + method in current class by calling property_method_in_class. + +2008-08-14 Dale Johannesen + + * objc-act.c (build_objc_string_decl): Rename to + build_objc_string_ident throughout. Make it return an + identifier instead of building a var_decl which gets + thrown away. + (add_objc_string): Modify for interface change. + +2008-08-12 Fariborz Jahanian + + Radar 6133042 + * objc-act.c (block_pointer_strong_value): New + (objc_build_aggregate_ivar_layout): Find GCability of + block pointer by calling above routine. + (objc_is_gcable_type): Ditto. + +2008-08-05 Fariborz Jahanian + + Radar 6040305 - work in proggress. + + * objc-act.c (build_ivar_reference): treat 'self' as + a copied in variable or ObjC++ as well. + 2008-07-28 Fariborz Jahanian Radar 6049617 Modified: llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple?rev=55661&r1=55660&r2=55661&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/ChangeLog.apple Tue Sep 2 16:51:04 2008 @@ -1,3 +1,126 @@ +2008-08-07 Stuart Hastings + + Radar 6128170 + * gcc/testsuite/objc.dg/6128170.m: New. + +2008-08-06 Fariborz Jahanian + + Radar 6014138 + * gcc.apple/block-nested.c: Modified + +2008-08-07 Stuart Hastings + + * gcc.apple/5773922.c: Added -std=c99. + +2008-08-06 Eugene Marinelli + + Radar 6013597 + * g++.dg/inline-limit-1.C: Update number of calls needed to cause + inlining and non-inlining. + +2008-08-06 Eugene Marinelli + + Radar 6020402 + * gcc.apple/6020402-1.c: Check for orq exclusively (not xorq). + * gcc.apple/6020402-2.c: Check for orl exclusively (not xorl). + +2008-08-06 Jon Ziegler + + Radar 5095227 + Testing default, so don't run these tests + when -fstack-proctor[-all] is specified. + * g++.apple/kext-stackprotect-1.C + * g++.apple/kext-stackprotect-2.C + +2008-08-06 Fariborz Jahanian + + Radar 6112131 - again (restore __byref again). + * gcc.apple/block-block-storageclass.c: Add + * g++.apple/block-block-storageclass.C: Add + +2008-08-06 Fariborz Jahanian + + Radar 6040305 - work in proggress. + * g++.apple/block-global-block.C: Add + +2008-08-06 Stuart Hastings + + Radar 5774132.C + * g++.apple/5774132.C: New. + +2008-08-06 Stuart Hastings + + Radar 5773922 + * gcc.apple/5773922.c: New. + +2008-08-05 Jon Ziegler + + Radar 6125032 + * g++.apple/5596043.C: make compile only + +2008-08-05 Fariborz Jahanian + + Radar 6040305 - work in proggress. + * g++.apple/block-ivar.C: Add + +2008-08-05 Fariborz Jahanian + + Radar 6040305 - work in progress. + * g++.apple/block-error-global-byref.C: Add + * g++.apple/block-global-byref.C: Add + * g++.apple/block-global-implicit-byref.C: Modified + * g++.apple/block-blocks-test-1.C: Modified + * g++.apple/block-blocks-test-1.C: Modified + * g++.apple/block-readonly-diag.C: Modified + * g++.apple/block-assigngcglobal.C: Modified + * g++.apple/block-assigngcivar.C: Modified + +2008-08-05 Fariborz Jahanian + + Radar 6040305 - work in progress. + * g++.apple/block-byref.C + * g++.apple/block-byref-attribute.C + * g++.apple/block-implicit-byref.C + +2008-08-05 Fariborz Jahanian + + Radar 6040305 - work in progress. + * g++.apple/block-blocks-test-8.C: Add + +2008-08-05 Stuart Hastings + + Radar 5951276 + * gcc.target/i386/20020616-1.c: Skip for Darwin. + +2008-08-05 Fariborz Jahanian + + Radar 6040305 - work in progress. + * g++.apple/block-blocks-test-7.C: Add. + +2008-08-05 Fariborz Jahanian + + Radar 6040305 (More tests passed with previous patch). + * g++.apple/block-blocks-test-1.C: Add + * g++.apple/block-blocks-test-5.C: Add + * g++.apple/block-blocks-test-6.C: Add + +2008-08-04 Fariborz Jahanian + + Radar 6040305 - work in progress. + * g++.apple/block-blocks-test-4.C: Add + +2008-08-04 Eugene Marinelli + + Radar 6020402 + * gcc.apple/6020402-1.c: Add + * gcc.apple/6020402-2.c: Add + +2008-08-04 Jon Ziegler + + Radar 6112293 + * gcc.c-torture/execute/builtins/lib/sprintf.c + * gcc.dg/cpp/trad/include.c + 2008-07-31 Fariborz Jahanian Radar 6040305 - work in progress From isanbard at gmail.com Tue Sep 2 16:52:04 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:52:04 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55662 - in /llvm-gcc-4.2/trunk/gcc: flow.c sbitmap.c Message-ID: <200809022152.m82Lq5lL020706@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:52:04 2008 New Revision: 55662 URL: http://llvm.org/viewvc/llvm-project?rev=55662&view=rev Log: If targeting ppc with -ftree-pre, clear existing reg-lifetime info to insure thorough DCE Modified: llvm-gcc-4.2/trunk/gcc/flow.c llvm-gcc-4.2/trunk/gcc/sbitmap.c Modified: llvm-gcc-4.2/trunk/gcc/flow.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/flow.c?rev=55662&r1=55661&r2=55662&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/flow.c (original) +++ llvm-gcc-4.2/trunk/gcc/flow.c Tue Sep 2 16:52:04 2008 @@ -3994,10 +3994,12 @@ } /* APPLE LOCAL begin 5695218 */ static void -maybe_uses_pic_offset_table_rtx (struct propagate_block_info *pbi ATTRIBUTE_UNUSED, - rtx reg ATTRIBUTE_UNUSED, +/* LLVM LOCAL begin */ +maybe_uses_pic_offset_table_rtx (struct propagate_block_info *pbi ATTRIBUTE_UNUSED, + rtx reg ATTRIBUTE_UNUSED, rtx cond ATTRIBUTE_UNUSED, - rtx insn ATTRIBUTE_UNUSED) + rtx insn ATTRIBUTE_UNUSED) +/* LLVM LOCAL begin */ { /* LLVM LOCAL */ #ifndef ENABLE_LLVM @@ -4566,7 +4568,25 @@ REG_UNUSED notes to REG_DEAD notes. This causes CHECK_DEAD_NOTES in sched1 to die. To solve this update the DEATH_NOTES here. */ - update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_REG_INFO | PROP_DEATH_NOTES); + /* APPLE LOCAL begin 6102803 */ +#ifdef TARGET_POWERPC + if (flag_tree_pre) + { + basic_block bb; + /* Zap the life information from the last round. If we don't + do this, we can wind up with registers that no longer appear + in the code being marked live at entry. */ + FOR_EACH_BB (bb) + { + CLEAR_REG_SET (bb->il.rtl->global_live_at_start); + CLEAR_REG_SET (bb->il.rtl->global_live_at_end); + } + update_life_info (NULL, UPDATE_LIFE_GLOBAL, PROP_FINAL); + } + else +#endif + update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_REG_INFO | PROP_DEATH_NOTES); + /* APPLE LOCAL end 6102803 */ if (dump_file) dump_flow_info (dump_file, dump_flags); Modified: llvm-gcc-4.2/trunk/gcc/sbitmap.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/sbitmap.c?rev=55662&r1=55661&r2=55662&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/sbitmap.c (original) +++ llvm-gcc-4.2/trunk/gcc/sbitmap.c Tue Sep 2 16:52:04 2008 @@ -787,7 +787,8 @@ int bb; fprintf (file, "%s\n", title); - for (bb = 0; bb < n_maps; bb++) + /* APPLE LOCAL 6102803 */ + for (bb = NUM_FIXED_BLOCKS; bb < n_maps; bb++) { fprintf (file, "%s %d\n", subtitle, bb); dump_sbitmap (file, bmaps[bb]); From isanbard at gmail.com Tue Sep 2 16:53:06 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:53:06 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55663 - in /llvm-gcc-4.2/trunk/gcc: cgraph.c tree-inline.c Message-ID: <200809022153.m82Lr7KF020748@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:53:06 2008 New Revision: 55663 URL: http://llvm.org/viewvc/llvm-project?rev=55663&view=rev Log: Fix wording. Modified: llvm-gcc-4.2/trunk/gcc/cgraph.c llvm-gcc-4.2/trunk/gcc/tree-inline.c Modified: llvm-gcc-4.2/trunk/gcc/cgraph.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cgraph.c?rev=55663&r1=55662&r2=55663&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cgraph.c (original) +++ llvm-gcc-4.2/trunk/gcc/cgraph.c Tue Sep 2 16:53:06 2008 @@ -396,7 +396,8 @@ gcc_assert (get_call_expr_in (call_stmt)); if (!DECL_SAVED_TREE (callee->decl)) - edge->inline_failed = N_("function body not available"); + /* APPLE LOCAL wording 4598393 */ + edge->inline_failed = N_("the function body must appear before caller"); else if (callee->local.redefined_extern_inline) edge->inline_failed = N_("redefined extern inline functions are not " "considered for inlining"); Modified: llvm-gcc-4.2/trunk/gcc/tree-inline.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-inline.c?rev=55663&r1=55662&r2=55663&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree-inline.c (original) +++ llvm-gcc-4.2/trunk/gcc/tree-inline.c Tue Sep 2 16:53:06 2008 @@ -2040,8 +2040,10 @@ /* Avoid warnings during early inline pass. */ && (!flag_unit_at_a_time || cgraph_global_info_ready)) { - sorry ("inlining failed in call to %q+F: %s", fn, reason); - sorry ("called from here"); + /* APPLE LOCAL begin wording 4598393 */ + error ("% function could not be inlined in call to %q+F: %s", fn, reason); + error ("called from here"); + /* APPLE LOCAL end wording 4598393 */ } else if (warn_inline && DECL_DECLARED_INLINE_P (fn) && !DECL_IN_SYSTEM_HEADER (fn) @@ -2652,7 +2654,7 @@ #ifdef ENABLE_LLVM SET_DECL_LLVM (copy, 0); #else - SET_DECL_RTL (copy, NULL_RTX); + SET_DECL_RTL (copy, NULL_RTX); #endif /* LLVM_LOCAL end */ From isanbard at gmail.com Tue Sep 2 16:54:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:54:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55664 - in /llvm-gcc-4.2/trunk/gcc: config/darwin.opt postreload-gcse.c Message-ID: <200809022154.m82LsJJg020789@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:54:18 2008 New Revision: 55664 URL: http://llvm.org/viewvc/llvm-project?rev=55664&view=rev Log: Disable critical edge check under mdarwin-rtl-pre-ignore-critical-edges. Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.opt llvm-gcc-4.2/trunk/gcc/postreload-gcse.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.opt?rev=55664&r1=55663&r2=55664&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.opt (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.opt Tue Sep 2 16:54:18 2008 @@ -70,3 +70,8 @@ mkernel Target Report Var(flag_mkernel) Generate code for the kernel or loadable kernel extentions + +; APPLE LOCAL begin 5971844 +mdarwin-rtl-pre-ignore-critical-edges +Target Report Var(flag_darwin_rtl_pre_ignore_critical_edges) +; APPLE LOCAL end 5971844 Modified: llvm-gcc-4.2/trunk/gcc/postreload-gcse.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/postreload-gcse.c?rev=55664&r1=55663&r2=55664&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/postreload-gcse.c (original) +++ llvm-gcc-4.2/trunk/gcc/postreload-gcse.c Tue Sep 2 16:54:18 2008 @@ -1118,6 +1118,13 @@ } } + /* APPLE LOCAL begin 5971844 */ +#ifdef TARGET_MACHO + if (flag_darwin_rtl_pre_ignore_critical_edges) + critical_edge_split = false; +#endif + /* APPLE LOCAL end 5971844 */ + if (/* No load can be replaced by copy. */ npred_ok == 0 /* Prevent exploding the code. */ From isanbard at gmail.com Tue Sep 2 16:55:22 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:55:22 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55665 - /llvm-gcc-4.2/trunk/gcc/builtins.c Message-ID: <200809022155.m82LtMRh020830@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:55:22 2008 New Revision: 55665 URL: http://llvm.org/viewvc/llvm-project?rev=55665&view=rev Log: Comment out BUILT_IN_ADJUST_TRAMPOLINE for LLVM instead of omitting it. Modified: llvm-gcc-4.2/trunk/gcc/builtins.c Modified: llvm-gcc-4.2/trunk/gcc/builtins.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/builtins.c?rev=55665&r1=55664&r2=55665&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/builtins.c (original) +++ llvm-gcc-4.2/trunk/gcc/builtins.c Tue Sep 2 16:55:22 2008 @@ -6332,7 +6332,12 @@ case BUILT_IN_INIT_TRAMPOLINE: return expand_builtin_init_trampoline (arglist); - /* LLVM LOCAL deleted 2 lines */ + /* LLVM LOCAL begin deleted 2 lines */ +#ifndef ENABLE_LLVM + case BUILT_IN_ADJUST_TRAMPOLINE: + return expand_builtin_adjust_trampoline (arglist); +#endif + /* LLVM LOCAL end deleted 2 lines */ case BUILT_IN_FORK: case BUILT_IN_EXECL: From isanbard at gmail.com Tue Sep 2 16:56:15 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:56:15 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55666 - /llvm-gcc-4.2/trunk/driverdriver.c Message-ID: <200809022156.m82LuFPd020865@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:56:15 2008 New Revision: 55666 URL: http://llvm.org/viewvc/llvm-project?rev=55666&view=rev Log: Allocate enough space in the driver-driver. Modified: llvm-gcc-4.2/trunk/driverdriver.c Modified: llvm-gcc-4.2/trunk/driverdriver.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/driverdriver.c?rev=55666&r1=55665&r2=55666&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/driverdriver.c (original) +++ llvm-gcc-4.2/trunk/driverdriver.c Tue Sep 2 16:56:15 2008 @@ -624,8 +624,8 @@ /* Total number of arguments in separate compiler invocation is : total number of original arguments - total no input files + one input - file + "-o" + output file . */ - new_new_argv = (const char **) malloc ((new_argc - num_infiles + 4) * sizeof (const char *)); + file + "-o" + output file + arch specific options + NULL . */ + new_new_argv = (const char **) malloc ((new_argc - num_infiles + 5) * sizeof (const char *)); if (!new_new_argv) abort (); @@ -711,7 +711,9 @@ } /* Replace -arch options with appropriate "-mcpu=" OR - "-march=". INDEX is the index in arches[] table. */ + "-march=". INDEX is the index in arches[] table. We cannot + return more than 1 as do_compile_separately only allocated one + extra slot for us. */ static int add_arch_options (int index, const char **current_argv, int arch_index) @@ -1382,7 +1384,7 @@ else if (!strcmp (argv[i], "-o")) { if (i + 1 >= argc) - abort (); + fatal ("argument to '-o' is missing"); output_filename = argv[i+1]; i++; From isanbard at gmail.com Tue Sep 2 16:58:19 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 21:58:19 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55667 - /llvm-gcc-4.2/trunk/gcc/treecode-num-insns.def Message-ID: <200809022158.m82LwJQt020959@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 16:58:18 2008 New Revision: 55667 URL: http://llvm.org/viewvc/llvm-project?rev=55667&view=rev Log: List of overhead costs in instructions. Added: llvm-gcc-4.2/trunk/gcc/treecode-num-insns.def Added: llvm-gcc-4.2/trunk/gcc/treecode-num-insns.def URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/treecode-num-insns.def?rev=55667&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/treecode-num-insns.def (added) +++ llvm-gcc-4.2/trunk/gcc/treecode-num-insns.def Tue Sep 2 16:58:18 2008 @@ -0,0 +1,158 @@ +/* APPLE LOCAL file 6013597 */ +/* These values represent the "overhead" cost in instructions (x1000) of each + expression type, i.e. the cost of the tree without the costs of its + subexpressions. The first set of costs was generated by adding annotations + indicating the beginning and end of each GIMPLE tree to the assembler + output of the cpu2000 and cpu2006 benchmark suites. The remaining + expression types were not present in these benchmarks, so the costs + that were previously used in tree-inline.c are used here. + + Each cost is 1000 times the true estimated cost in instructions. This is + done to avoid the use of floating point arithmetic. + tree-inline.c:estimate_num_insns compensates for this by dividing the + number of instructions returned by tree-inline.c:estimate_num_insns_1 by + 1000. + */ + +/* Instruction counts generated by analyzing cpu2000 and cpu2006 benchmark + builds. */ +NUM_INSNS_CASE(COMPLEX_CST,125) +NUM_INSNS_CASE(STRING_CST,400) +NUM_INSNS_CASE(VAR_DECL,17) +NUM_INSNS_CASE(COMPONENT_REF,24) +NUM_INSNS_CASE(INDIRECT_REF,425) +NUM_INSNS_CASE(ARRAY_REF,182) +NUM_INSNS_CASE(PLUS_EXPR,898) +NUM_INSNS_CASE(MINUS_EXPR,1641) +NUM_INSNS_CASE(MULT_EXPR,885) +NUM_INSNS_CASE(TRUNC_DIV_EXPR,3814) +NUM_INSNS_CASE(TRUNC_MOD_EXPR,5253) +NUM_INSNS_CASE(RDIV_EXPR,1909) +NUM_INSNS_CASE(EXACT_DIV_EXPR,823) +NUM_INSNS_CASE(FIX_TRUNC_EXPR,1506) +NUM_INSNS_CASE(FLOAT_EXPR,1746) +NUM_INSNS_CASE(NEGATE_EXPR,1702) +NUM_INSNS_CASE(MIN_EXPR,3220) +NUM_INSNS_CASE(MAX_EXPR,2706) +NUM_INSNS_CASE(ABS_EXPR,4032) +NUM_INSNS_CASE(LSHIFT_EXPR,1711) +NUM_INSNS_CASE(RSHIFT_EXPR,2617) +NUM_INSNS_CASE(RROTATE_EXPR,1272) +NUM_INSNS_CASE(BIT_IOR_EXPR,3469) +NUM_INSNS_CASE(BIT_XOR_EXPR,3597) +NUM_INSNS_CASE(BIT_AND_EXPR,2428) +NUM_INSNS_CASE(BIT_NOT_EXPR,2488) +NUM_INSNS_CASE(TRUTH_AND_EXPR,90) +NUM_INSNS_CASE(TRUTH_OR_EXPR,505) +NUM_INSNS_CASE(TRUTH_NOT_EXPR,864) +NUM_INSNS_CASE(LT_EXPR,1280) +NUM_INSNS_CASE(LE_EXPR,1441) +NUM_INSNS_CASE(GT_EXPR,2382) +NUM_INSNS_CASE(GE_EXPR,1250) +NUM_INSNS_CASE(EQ_EXPR,1776) +NUM_INSNS_CASE(NE_EXPR,1596) +NUM_INSNS_CASE(CONVERT_EXPR,172) +NUM_INSNS_CASE(NOP_EXPR,269) +NUM_INSNS_CASE(SAVE_EXPR,769) +NUM_INSNS_CASE(ADDR_EXPR,400) +NUM_INSNS_CASE(COMPLEX_EXPR,3411) +NUM_INSNS_CASE(TARGET_MEM_REF,50) +NUM_INSNS_CASE(SWITCH_EXPR,3839) + +/* Instruction counts left over from the older version of tree-inline.c. */ +/* Containers have no cost. */ +NUM_INSNS_CASE(TREE_LIST,0) +NUM_INSNS_CASE(TREE_VEC,0) +NUM_INSNS_CASE(BLOCK,0) +NUM_INSNS_CASE(BIT_FIELD_REF,0) +NUM_INSNS_CASE(ALIGN_INDIRECT_REF,0) +NUM_INSNS_CASE(MISALIGNED_INDIRECT_REF,0) +NUM_INSNS_CASE(ARRAY_RANGE_REF,0) +NUM_INSNS_CASE(OBJ_TYPE_REF,0) +NUM_INSNS_CASE(EXC_PTR_EXPR,0) +NUM_INSNS_CASE(FILTER_EXPR,0) +NUM_INSNS_CASE(COMPOUND_EXPR,0) +NUM_INSNS_CASE(BIND_EXPR,0) +NUM_INSNS_CASE(WITH_CLEANUP_EXPR,0) +NUM_INSNS_CASE(VIEW_CONVERT_EXPR,0) +NUM_INSNS_CASE(RANGE_EXPR,0) +NUM_INSNS_CASE(CASE_LABEL_EXPR,0) +NUM_INSNS_CASE(SSA_NAME,0) +NUM_INSNS_CASE(CATCH_EXPR,0) +NUM_INSNS_CASE(EH_FILTER_EXPR,0) +NUM_INSNS_CASE(STATEMENT_LIST,0) +NUM_INSNS_CASE(ERROR_MARK,0) +NUM_INSNS_CASE(NON_LVALUE_EXPR,0) +NUM_INSNS_CASE(FDESC_EXPR,0) +NUM_INSNS_CASE(VA_ARG_EXPR,0) +NUM_INSNS_CASE(TRY_CATCH_EXPR,0) +NUM_INSNS_CASE(TRY_FINALLY_EXPR,0) +NUM_INSNS_CASE(LABEL_EXPR,0) +NUM_INSNS_CASE(GOTO_EXPR,0) +NUM_INSNS_CASE(RETURN_EXPR,0) +NUM_INSNS_CASE(EXIT_EXPR,0) +NUM_INSNS_CASE(LOOP_EXPR,0) +NUM_INSNS_CASE(PHI_NODE,0) +NUM_INSNS_CASE(WITH_SIZE_EXPR,0) +NUM_INSNS_CASE(OMP_CLAUSE,0) +NUM_INSNS_CASE(OMP_RETURN,0) +NUM_INSNS_CASE(OMP_CONTINUE,0) + +/* Assign a cost of 0 to certain rare tree codes of type tcc_reference. */ +NUM_INSNS_CASE(REALPART_EXPR,0) +NUM_INSNS_CASE(IMAGPART_EXPR,0) + +/* Assign cost of 1 to usual operations. */ +NUM_INSNS_CASE(COND_EXPR,1000) +NUM_INSNS_CASE(VEC_COND_EXPR,1000) +NUM_INSNS_CASE(FIX_CEIL_EXPR,1000) +NUM_INSNS_CASE(FIX_FLOOR_EXPR,1000) +NUM_INSNS_CASE(FIX_ROUND_EXPR,1000) +NUM_INSNS_CASE(LROTATE_EXPR,1000) +NUM_INSNS_CASE(VEC_LSHIFT_EXPR,1000) +NUM_INSNS_CASE(VEC_RSHIFT_EXPR,1000) +NUM_INSNS_CASE(TRUTH_ANDIF_EXPR,1000) +NUM_INSNS_CASE(TRUTH_ORIF_EXPR,1000) +NUM_INSNS_CASE(TRUTH_XOR_EXPR,1000) +NUM_INSNS_CASE(ORDERED_EXPR,1000) +NUM_INSNS_CASE(UNORDERED_EXPR,1000) +NUM_INSNS_CASE(UNLT_EXPR,1000) +NUM_INSNS_CASE(UNLE_EXPR,1000) +NUM_INSNS_CASE(UNGT_EXPR,1000) +NUM_INSNS_CASE(UNGE_EXPR,1000) +NUM_INSNS_CASE(UNEQ_EXPR,1000) +NUM_INSNS_CASE(LTGT_EXPR,1000) +NUM_INSNS_CASE(CONJ_EXPR,1000) +NUM_INSNS_CASE(PREDECREMENT_EXPR,1000) +NUM_INSNS_CASE(PREINCREMENT_EXPR,1000) +NUM_INSNS_CASE(POSTDECREMENT_EXPR,1000) +NUM_INSNS_CASE(POSTINCREMENT_EXPR,1000) +NUM_INSNS_CASE(ASM_EXPR,1000) +NUM_INSNS_CASE(REALIGN_LOAD_EXPR,1000) +NUM_INSNS_CASE(REDUC_MAX_EXPR,1000) +NUM_INSNS_CASE(REDUC_MIN_EXPR,1000) +NUM_INSNS_CASE(REDUC_PLUS_EXPR,1000) +NUM_INSNS_CASE(WIDEN_SUM_EXPR,1000) +NUM_INSNS_CASE(DOT_PROD_EXPR,1000) +NUM_INSNS_CASE(WIDEN_MULT_EXPR,1000) +NUM_INSNS_CASE(RESX_EXPR,1000) + +/* Few special cases of expensive operations. This is useful to avoid + inlining on functions having too many of these. */ +NUM_INSNS_CASE(CEIL_DIV_EXPR,10000) +NUM_INSNS_CASE(FLOOR_DIV_EXPR,10000) +NUM_INSNS_CASE(ROUND_DIV_EXPR,10000) +NUM_INSNS_CASE(CEIL_MOD_EXPR,10000) +NUM_INSNS_CASE(FLOOR_MOD_EXPR,10000) +NUM_INSNS_CASE(ROUND_MOD_EXPR,10000) + +/* OpenMP directives are generally very expensive. */ +NUM_INSNS_CASE(OMP_PARALLEL,40000) +NUM_INSNS_CASE(OMP_FOR,40000) +NUM_INSNS_CASE(OMP_SECTIONS,40000) +NUM_INSNS_CASE(OMP_SINGLE,40000) +NUM_INSNS_CASE(OMP_SECTION,40000) +NUM_INSNS_CASE(OMP_MASTER,40000) +NUM_INSNS_CASE(OMP_ORDERED,40000) +NUM_INSNS_CASE(OMP_CRITICAL,40000) +NUM_INSNS_CASE(OMP_ATOMIC,40000) From evan.cheng at apple.com Tue Sep 2 16:59:13 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 02 Sep 2008 21:59:13 -0000 Subject: [llvm-commits] [llvm] r55668 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Message-ID: <200809022159.m82LxEJJ020998@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 2 16:59:13 2008 New Revision: 55668 URL: http://llvm.org/viewvc/llvm-project?rev=55668&view=rev Log: 80 col violations. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55668&r1=55667&r2=55668&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Sep 2 16:59:13 2008 @@ -21,7 +21,8 @@ #include "llvm/Target/TargetMachine.h" using namespace llvm; -unsigned FastISel::getRegForValue(Value *V, DenseMap &ValueMap) { +unsigned FastISel::getRegForValue(Value *V, + DenseMap &ValueMap) { unsigned &Reg = ValueMap[V]; if (Reg != 0) return Reg; @@ -433,7 +434,8 @@ FastISel::~FastISel() {} -unsigned FastISel::FastEmit_(MVT::SimpleValueType, MVT::SimpleValueType, ISD::NodeType) { +unsigned FastISel::FastEmit_(MVT::SimpleValueType, MVT::SimpleValueType, + ISD::NodeType) { return 0; } From isanbard at gmail.com Tue Sep 2 17:00:01 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 22:00:01 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55669 - /llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def Message-ID: <200809022200.m82M01hU021066@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 17:00:01 2008 New Revision: 55669 URL: http://llvm.org/viewvc/llvm-project?rev=55669&view=rev Log: Use correct objective-C section name. Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def?rev=55669&r1=55668&r2=55669&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin-sections.def Tue Sep 2 17:00:01 2008 @@ -103,7 +103,7 @@ DEF_SECTION (objc_v2_categorylist_section, 0, ".section __DATA, __objc_catlist, regular, no_dead_strip", 1) DEF_SECTION (objc_v2_selector_refs_section, 0, - ".section __DATA, __objc_selrefs, regular, no_dead_strip", 1) + ".section __DATA, __objc_selrefs, literal_pointers, no_dead_strip", 1) DEF_SECTION (objc_v2_nonlazy_class_section, 0, ".section __DATA, __objc_nlclslist, regular, no_dead_strip", 1) DEF_SECTION (objc_v2_nonlazy_category_section, 0, From isanbard at gmail.com Tue Sep 2 17:08:00 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 22:08:00 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55670 - in /llvm-gcc-4.2/trunk/gcc/config: darwin-protos.h darwin.c darwin.h Message-ID: <200809022208.m82M80Rc021320@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 17:08:00 2008 New Revision: 55670 URL: http://llvm.org/viewvc/llvm-project?rev=55670&view=rev Log: Handle NSObject attribute. Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-protos.h llvm-gcc-4.2/trunk/gcc/config/darwin.c llvm-gcc-4.2/trunk/gcc/config/darwin.h Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-protos.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-protos.h?rev=55670&r1=55669&r2=55670&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin-protos.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin-protos.h Tue Sep 2 17:08:00 2008 @@ -95,6 +95,8 @@ /* APPLE LOCAL ObjC GC */ extern tree darwin_handle_objc_gc_attribute (tree *, tree, tree, int, bool *); +/* APPLE LOCAL file radar 5595352 */ +extern tree darwin_handle_nsobject_attribute (tree *, tree, tree, int, bool *); extern void darwin_file_start (void); extern void darwin_file_end (void); Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=55670&r1=55669&r2=55670&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Tue Sep 2 17:08:00 2008 @@ -1772,6 +1772,40 @@ } /* APPLE LOCAL end ObjC GC */ +/* APPLE LOCAL begin radar 5595352 */ +tree +darwin_handle_nsobject_attribute (tree *node, + tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) +{ + tree orig = *node, type; + if (!POINTER_TYPE_P (orig) || TREE_CODE (TREE_TYPE (orig)) != RECORD_TYPE) + { + error ("__attribute ((NSObject)) is for pointer types only"); + return NULL_TREE; + } + type = build_type_attribute_variant (orig, + tree_cons (name, NULL_TREE, + TYPE_ATTRIBUTES (orig))); + /* The main variant must be preserved no matter what. What ever + main variant comes out of the call to build_type_attribute_variant + is bogus here. */ + if (TYPE_MAIN_VARIANT (orig) != TYPE_MAIN_VARIANT (type)) + { + TYPE_MAIN_VARIANT (type) = TYPE_MAIN_VARIANT (orig); + TYPE_NEXT_VARIANT (type) = TYPE_NEXT_VARIANT (orig); + TYPE_NEXT_VARIANT (orig) = type; + } + + *node = type; + /* No need to hang on to the attribute any longer. */ + *no_add_attrs = true; + return NULL_TREE; +} +/* APPLE LOCAL end radar 5595352 */ + /* APPLE LOCAL begin darwin_set_section_for_var_p 20020226 --turly */ /* This is specifically for any initialised static class constants Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=55670&r1=55669&r2=55670&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Tue Sep 2 17:08:00 2008 @@ -453,9 +453,8 @@ %{nomultidefs} \ %{Zmulti_module:-multi_module} %{Zsingle_module:-single_module} \ %{Zmultiply_defined*:-multiply_defined %*} \ - %{!Zmultiply_defined*:%{shared-libgcc: \ - %:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \ - %:version-compare(< 10.5 mmacosx-version-min= suppress)}} \ + "/* APPLE LOCAL begin deletion 5023884 */" \ + "/* APPLE LOCAL end deletion 5023884 */" \ %{Zmultiplydefinedunused*:-multiply_defined_unused %*} \ "/* APPLE LOCAL mainline 2007-06-01 5238485 */" \ %{fpie:-pie} \ @@ -1073,15 +1072,15 @@ } while (0) #else /* LLVM LOCAL end */ -#define ASM_DECLARE_CLASS_REFERENCE(FILE,NAME) \ - do { \ - if (FILE) { \ - fprintf (FILE, "\t"); \ - assemble_name (FILE, NAME); \ - fprintf (FILE, "=0\n"); \ - (*targetm.asm_out.globalize_label) (FILE, NAME); \ - } \ - } while (0) +#define ASM_DECLARE_CLASS_REFERENCE(FILE,NAME) \ + do { \ + if (FILE) { \ + fprintf (FILE, "\t"); \ + assemble_name (FILE, NAME); \ + fprintf (FILE, "=0\n"); \ + (*targetm.asm_out.globalize_label) (FILE, NAME); \ + } \ + } while (0) /* LLVM LOCAL */ #endif /*ENABLE_LLVM*/ @@ -1109,6 +1108,8 @@ darwin_handle_kext_attribute }, \ /* APPLE LOCAL ObjC GC */ \ { "objc_gc", 1, 1, false, true, false, darwin_handle_objc_gc_attribute }, \ + /* APPLE LOCAL radar 5595352 */ \ + { "NSObject", 0, 0, false, true, false, darwin_handle_nsobject_attribute },\ { "weak_import", 0, 0, true, false, false, \ darwin_handle_weak_import_attribute } From isanbard at gmail.com Tue Sep 2 17:10:47 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 22:10:47 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55671 - /llvm-gcc-4.2/trunk/gcc/config/darwin-c.c Message-ID: <200809022210.m82MAlXS021421@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 17:10:46 2008 New Revision: 55671 URL: http://llvm.org/viewvc/llvm-project?rev=55671&view=rev Log: Fix #pragma unused () parsing. Add __block= Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-c.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin-c.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin-c.c?rev=55671&r1=55670&r2=55671&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin-c.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin-c.c Tue Sep 2 17:10:46 2008 @@ -338,10 +338,12 @@ tree decl, x; int tok; - if (pragma_lex (&x) != CPP_OPEN_PAREN) + /* APPLE LOCAL 5979888 */ + if ((tok=pragma_lex (&x)) != CPP_OPEN_PAREN) BAD ("missing '(' after '#pragma unused', ignoring"); - while (1) + /* APPLE LOCAL 5979888 */ + while (tok != CPP_EOF && tok != CPP_CLOSE_PAREN) { tok = pragma_lex (&decl); if (tok == CPP_NAME && decl) @@ -1083,12 +1085,14 @@ } /* APPLE LOCAL end ObjC GC */ /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ - if (flag_blocks && !c_dialect_cxx ()) { + if (flag_blocks) { /* APPLE LOCAL radar 6096219 */ builtin_define ("__byref=__attribute__((__blocks__(byref)))"); + builtin_define ("__block=__attribute__((__blocks__(byref)))"); } else { builtin_define ("__byref="); + builtin_define ("__block="); } /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ From isanbard at gmail.com Tue Sep 2 17:12:10 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 22:12:10 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55672 - /llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Message-ID: <200809022212.m82MCAQV021469@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 17:12:10 2008 New Revision: 55672 URL: http://llvm.org/viewvc/llvm-project?rev=55672&view=rev Log: Set SLOW_BYTE_ACCESS false under -mkernel, -fapple-kext, or -m64. Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.h?rev=55672&r1=55671&r2=55672&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.h Tue Sep 2 17:12:10 2008 @@ -1982,11 +1982,8 @@ subsequent accesses occur to other fields in the same word of the structure, but to different bytes. */ -/* APPLE LOCAL begin radar 4287182 */ -/* Temporarily set it to two targets. Please sync it with main line - when its patch is approved. */ -#define SLOW_BYTE_ACCESS (TARGET_GENERIC | TARGET_NOCONA | TARGET_CORE2) -/* APPLE LOCAL end radar 4287182 */ +/* APPLE LOCAL 6131435 */ +#define SLOW_BYTE_ACCESS (!flag_apple_kext && !flag_mkernel && !TARGET_64BIT) /* Nonzero if access to memory by shorts is slow and undesirable. */ #define SLOW_SHORT_ACCESS 0 From dpatel at apple.com Tue Sep 2 17:16:13 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 22:16:13 -0000 Subject: [llvm-commits] [llvm] r55673 - in /llvm/trunk: lib/Transforms/IPO/Inliner.cpp test/Transforms/Inline/2008-09-02-AlwaysInline.ll test/Transforms/Inline/2008-09-02-NoInline.ll Message-ID: <200809022216.m82MGDNg021600@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 17:16:13 2008 New Revision: 55673 URL: http://llvm.org/viewvc/llvm-project?rev=55673&view=rev Log: respect inline=never and inline=always notes. Added: llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll llvm/trunk/test/Transforms/Inline/2008-09-02-NoInline.ll Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=55673&r1=55672&r2=55673&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Tue Sep 2 17:16:13 2008 @@ -140,7 +140,14 @@ int InlineCost = getInlineCost(CS); float FudgeFactor = getInlineFudgeFactor(CS); - if (InlineCost >= (int)(InlineThreshold * FudgeFactor)) { + Function *Fn = CS.getCalledFunction(); + bool AlwaysInline = false; + if (Fn && (Fn->getNotes() & FP_AlwaysInline)) + AlwaysInline = true; + if (Fn && (Fn->getNotes() & FP_NoInline)) + DOUT << "NOT Inlining: inline=never is set" << *CS.getInstruction(); + else if (!AlwaysInline + && InlineCost >= (int)(InlineThreshold * FudgeFactor)) { DOUT << " NOT Inlining: cost=" << InlineCost << ", Call: " << *CS.getInstruction(); } else { Added: llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll?rev=55673&view=auto ============================================================================== --- llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll (added) +++ llvm/trunk/test/Transforms/Inline/2008-09-02-AlwaysInline.ll Tue Sep 2 17:16:13 2008 @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | opt -inline-threshold=0 -inline | llvm-dis | not grep call + +define i32 @fn2() notes(inline=always) { + ret i32 1 +} + +define i32 @fn3() { + %r = call i32 @fn2() + ret i32 %r +} Added: llvm/trunk/test/Transforms/Inline/2008-09-02-NoInline.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/2008-09-02-NoInline.ll?rev=55673&view=auto ============================================================================== --- llvm/trunk/test/Transforms/Inline/2008-09-02-NoInline.ll (added) +++ llvm/trunk/test/Transforms/Inline/2008-09-02-NoInline.ll Tue Sep 2 17:16:13 2008 @@ -0,0 +1,10 @@ +; RUN: llvm-as < %s | opt -inline | llvm-dis | grep call | count 1 + +define i32 @fn2() notes(inline=never) { + ret i32 1 +} + +define i32 @fn3() { + %r = call i32 @fn2() + ret i32 %r +} From dpatel at apple.com Tue Sep 2 17:18:08 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 22:18:08 -0000 Subject: [llvm-commits] [llvm] r55674 - in /llvm/trunk: lib/Transforms/Scalar/LoopStrengthReduce.cpp test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Message-ID: <200809022218.m82MI83R021674@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 17:18:08 2008 New Revision: 55674 URL: http://llvm.org/viewvc/llvm-project?rev=55674&view=rev Log: If all IV uses are extending integer IV then change the type of IV itself, if possible. Added: llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=55674&r1=55673&r2=55674&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Sep 2 17:18:08 2008 @@ -46,6 +46,7 @@ STATISTIC(NumVariable, "Number of PHIs with variable strides"); STATISTIC(NumEliminated, "Number of strides eliminated"); STATISTIC(NumShadow, "Number of Shadow IVs optimized"); +STATISTIC(NumIVType, "Number of IV types optimized"); namespace { @@ -184,6 +185,10 @@ /// inside the loop then try to eliminate the cast opeation. void OptimizeShadowIV(Loop *L); + /// OptimizeIVType - If IV is always sext'ed or zext'ed then + /// change the type of IV, if possible. + void OptimizeIVType(Loop *L); + bool FindIVUserForCond(ICmpInst *Cond, IVStrideUse *&CondUse, const SCEVHandle *&CondStride); bool RequiresTypeConversion(const Type *Ty, const Type *NewTy); @@ -1808,6 +1813,200 @@ } } +/// suitableExtInstruction - Helper function used by OptimizeIVType. +/// If I is a suitable SEXT or ZEXT instruction then return type +/// to which I is extended to. Otherwise return NULL. +const Type *suitableExtInstruction(Instruction *I, bool isSigned, + const Type *ExtType) { + + const Type *DestType = NULL; + if (ZExtInst *ZI = dyn_cast(I)) + DestType = ZI->getDestTy(); + else if (SExtInst *SI = dyn_cast(I)) { + // If the inital value is signed then this is not suitable for + // OptimizeIVType transformation. + if (isSigned) + return NULL; + DestType = SI->getDestTy(); + } + + if (!DestType) return NULL; + + if (!ExtType) + return DestType; + + // If another use of IV extended to some other type then the IV is not + // suitable for OptimizeIVType transformation. + if (ExtType != DestType) + return NULL; + + return DestType; +} + +/// suitableIVIncr - Helper function used by OptimizeIVType. If I is +/// a suitable binary operator whose all uses are either SEXT or ZEXT +/// then return the type to which all uses are extended to. Otherwise +/// return NULL. +const Type *suitableIVIncr(Instruction *I, + Instruction *PHI, bool isSigned, + const Type *ExtType) { + + BinaryOperator *Incr = dyn_cast(I); + if (!Incr) return NULL; + + if (Incr->getOpcode() != Instruction::Add) + return NULL; + + ConstantInt *C = NULL; + if (Incr->getOperand(0) == PHI) + C = dyn_cast(Incr->getOperand(1)); + else if (Incr->getOperand(1) == PHI) + C = dyn_cast(Incr->getOperand(0)); + + if (!C) return NULL; + + const Type *RExtType = NULL; + for (Value::use_iterator IncUI = Incr->use_begin(), + IncUE = Incr->use_end(); IncUI != IncUE; ++IncUI) { + + Instruction *U2 = dyn_cast(*IncUI); + if (U2 == PHI) + continue; + const Type *DestType = suitableExtInstruction(U2, isSigned, ExtType); + if (!DestType) + return NULL; + + if (!RExtType) + RExtType = DestType; + + if (DestType != RExtType) + return NULL; + } + + return RExtType; + +} + +/// getNewPHIIncrement - Create a new increment instruction for newPHI +/// using type Ty based on increment instruction Incr. +/// Helper function used by OptimizeIVType. +BinaryOperator *getNewPHIIncrement(BinaryOperator *Incr, PHINode *PHI, + PHINode *NewPHI, const Type *Ty) { + ConstantInt *C = NULL; + if (Incr->getOperand(0) == PHI) + C = dyn_cast(Incr->getOperand(1)); + else if (Incr->getOperand(1) == PHI) + C = dyn_cast(Incr->getOperand(0)); + + assert (C && "Unexpected Incr operand!"); + return BinaryOperator::Create(Incr->getOpcode(), NewPHI, + ConstantInt::get(Ty, C->getZExtValue()), + "IV.next", Incr); +} + +/// OptimizeIVType - If IV is always sext'ed or zext'ed then +/// change the type of IV, if possible. +void LoopStrengthReduce::OptimizeIVType(Loop *L) { + + BasicBlock *LPH = L->getLoopPreheader(); + SmallVector PHIs; + for (BasicBlock::iterator BI = L->getHeader()->begin(), + BE = L->getHeader()->end(); BI != BE; ++BI) { + if (PHINode *PHI = dyn_cast(BI)) + PHIs.push_back(PHI); + else + break; + } + + while(!PHIs.empty()) { + PHINode *PHI = PHIs.back(); PHIs.pop_back(); + if (PHI->getNumIncomingValues() != 2) continue; + + unsigned Entry = 0, Latch = 1; + if (PHI->getIncomingBlock(0) != LPH) { + Entry = 1; + Latch = 0; + } + + ConstantInt *CInit = dyn_cast(PHI->getIncomingValue(Entry)); + if (!CInit) return; + + bool signedInit = CInit->getValue().isNegative(); + + bool TransformPhi = true; + const Type *ExtType = NULL; + BinaryOperator *Incr = NULL; + SmallVector PHIUses; + + // Collect all IV uses. + for (Value::use_iterator UI = PHI->use_begin(), + UE = PHI->use_end(); UI != UE; ++UI) { + Instruction *Use = dyn_cast(*UI); + if (!Use) { + TransformPhi = false; + break; + } + + ExtType = suitableIVIncr(Use, PHI, signedInit, ExtType); + if (ExtType) { + Incr = cast(Use); + continue; + } + ExtType = suitableExtInstruction(Use, signedInit, ExtType); + if (ExtType) { + PHIUses.push_back(Use); + continue; + } + + TransformPhi = false; + break; + } + + if (!TransformPhi || Incr == false || PHIUses.empty()) + continue; + + // Apply transformation. Extend IV type and eliminate SEXT or ZEXT + // instructions. + NumIVType++; + + PHINode *NewPH = PHINode::Create(ExtType, "IV", PHI); + ConstantInt *NewCInit = ConstantInt::get(ExtType, CInit->getZExtValue()); + BinaryOperator *NewIncr = getNewPHIIncrement(Incr, PHI, NewPH, ExtType); + + NewPH->addIncoming(NewCInit, PHI->getIncomingBlock(Entry)); + NewPH->addIncoming(NewIncr, PHI->getIncomingBlock(Latch)); + + // Replace all SEXT or ZEXT uses with new IV directly. + while (!PHIUses.empty()) { + Instruction *Use = PHIUses.back(); PHIUses.pop_back(); + SE->deleteValueFromRecords(Use); + Use->replaceAllUsesWith(NewPH); + Use->eraseFromParent(); + } + + // Replace all uses of IV increment with new increment. + SmallVector IncrUses; + for (Value::use_iterator UI2 = Incr->use_begin(), + UE2 = Incr->use_end(); UI2 != UE2; ++UI2) + IncrUses.push_back(cast(*UI2)); + + while (!IncrUses.empty()) { + Instruction *Use = IncrUses.back(); IncrUses.pop_back(); + if (Use == PHI) continue; + SE->deleteValueFromRecords(Use); + Use->replaceAllUsesWith(NewIncr); + Use->eraseFromParent(); + } + + // Remove old PHI and increment instruction. + SE->deleteValueFromRecords(PHI); + PHI->removeIncomingValue(Entry); + PHI->removeIncomingValue(Latch); + SE->deleteValueFromRecords(Incr); + Incr->eraseFromParent(); + } +} + // OptimizeIndvars - Now that IVUsesByStride is set up with all of the indvar // uses in the loop, look to see if we can eliminate some, in favor of using // common indvars for the different uses. @@ -1877,6 +2076,8 @@ UIntPtrTy = TD->getIntPtrType(); Changed = false; + OptimizeIVType(L); + // Find all uses of induction variables in this loop, and catagorize // them by stride. Start by finding all of the PHI nodes in the header for // this loop. If they are induction variables, inspect their uses. Added: llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll?rev=55674&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll (added) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Tue Sep 2 17:18:08 2008 @@ -0,0 +1,57 @@ +; RUN: llvm-as < %s | opt -loop-reduce | llvm-dis | grep sext | count 1 +; ModuleID = '' + %struct.App1Marker = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }> + %struct.ComponentInstanceRecord = type <{ [1 x i32] }> + %struct.DCPredictors = type { [5 x i16] } + %struct.DecodeTable = type { i16, i16, i16, i16, i8**, i8** } + %struct.ICMDataProcRecord = type <{ i16 (i8**, i32, i32)*, i32 }> + %struct.JPEGBitStream = type { i8*, i32, i32, i32, i32, i32, %struct.App1Marker*, i8*, i32, i16, i16, i32 } + %struct.JPEGGlobals = type { [2048 x i8], %struct.JPEGBitStream, i8*, i32, i32, %struct.ComponentInstanceRecord*, %struct.ComponentInstanceRecord*, i32, %struct.OpaqueQTMLMutex*, %struct.Rect, i32, i32, %struct.SharedGlobals, %struct.DCPredictors, i8, i8, void (i8*, i16**, i32, %struct.YUVGeneralParams*)*, %struct.YUVGeneralParams, i16, i16, i32, [5 x i16*], [5 x %struct.DecodeTable*], [5 x %struct.DecodeTable*], [5 x i8], [5 x i8], [4 x [65 x i16]], [4 x %struct.DecodeTable], [4 x %struct.DecodeTable], [4 x i8*], [4 x i8*], i16, i16, i32, i8**, i8**, i8**, i8**, i8**, i8**, i8**, i8**, i8**, i8**, [18 x i8], [18 x i8], [18 x i8], [18 x i8], i32, i32, i8**, i8**, i8, i8, i8, i8, i16, i16, %struct.App1Marker*, i8, i8, i8, i8, i32**, i8*, i16*, i8*, i16*, i8, [3 x i8], i32, [3 x i32], [3 x i32], [3 x i32], [3 x i32], [3 x i32], [3 x i16*], [3 x i16*], [3 x i8**], [3 x %struct.DecodeTable*], [3 x %struct.DecodeTable*], [3 x i32], i32, [3 x i16*], i32, i32, i32, [3 x i32], i8,! i8, i8, i8, %struct.ICMDataProcRecord*, i32, i32, i8**, i8**, i8**, i8**, i32, i32, i8*, i32, i32, i16*, i16*, i8*, i32, i32, i32, i32, i32, i32, i32, [16 x <2 x i64>], [1280 x i8], i8 } + %struct.OpaqueQTMLMutex = type opaque + %struct.Rect = type { i16, i16, i16, i16 } + %struct.SharedDGlobals = type { %struct.DecodeTable, %struct.DecodeTable, %struct.DecodeTable, %struct.DecodeTable } + %struct.SharedEGlobals = type { i8**, i8**, i8**, i8** } + %struct.SharedGlobals = type { %struct.SharedEGlobals*, %struct.SharedDGlobals* } + %struct.YUVGeneralParams = type { i16*, i8*, i8*, i8*, i8*, i8*, void (i8*, i16**, i32, %struct.YUVGeneralParams*)*, i16, i16, i16, [6 x i8], void (i8*, i16**, i32, %struct.YUVGeneralParams*)*, i16, i16 } + at llvm.used = appending global [1 x i8*] [ i8* bitcast (i16 (%struct.JPEGGlobals*)* @ExtractBufferedBlocksIgnored to i8*) ], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0] + +define i16 @ExtractBufferedBlocksIgnored(%struct.JPEGGlobals* %globp) signext nounwind { +entry: + %tmp4311 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 70 ; [#uses=1] + %tmp4412 = load i32* %tmp4311, align 16 ; [#uses=2] + %tmp4613 = icmp sgt i32 %tmp4412, 0 ; [#uses=1] + br i1 %tmp4613, label %bb, label %bb49 + +bb: ; preds = %bb28, %entry + %component.09 = phi i16 [ 0, %entry ], [ %tmp37, %bb28 ] ; [#uses=2] + %tmp12 = sext i16 %component.09 to i32 ; [#uses=2] + %tmp6 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 77, i32 %tmp12 ; [#uses=2] + %tmp7 = load i16** %tmp6, align 4 ; [#uses=2] + %tmp235 = getelementptr %struct.JPEGGlobals* %globp, i32 0, i32 71, i32 %tmp12 ; [#uses=1] + %tmp246 = load i32* %tmp235, align 4 ; [#uses=2] + %tmp267 = icmp sgt i32 %tmp246, 0 ; [#uses=1] + br i1 %tmp267, label %bb8, label %bb28 + +bb8: ; preds = %bb8, %bb + %indvar = phi i32 [ 0, %bb ], [ %indvar.next2, %bb8 ] ; [#uses=3] + %theDCTBufferIter.01.rec = shl i32 %indvar, 6 ; [#uses=1] + %tmp10.rec = add i32 %theDCTBufferIter.01.rec, 64 ; [#uses=1] + %tmp10 = getelementptr i16* %tmp7, i32 %tmp10.rec ; [#uses=1] + %i.02 = trunc i32 %indvar to i16 ; [#uses=1] + %tmp13 = add i16 %i.02, 1 ; [#uses=1] + %phitmp = sext i16 %tmp13 to i32 ; [#uses=1] + %tmp26 = icmp slt i32 %phitmp, %tmp246 ; [#uses=1] + %indvar.next2 = add i32 %indvar, 1 ; [#uses=1] + br i1 %tmp26, label %bb8, label %bb28 + +bb28: ; preds = %bb8, %bb + %theDCTBufferIter.0.lcssa = phi i16* [ %tmp7, %bb ], [ %tmp10, %bb8 ] ; [#uses=1] + store i16* %theDCTBufferIter.0.lcssa, i16** %tmp6, align 4 + %tmp37 = add i16 %component.09, 1 ; [#uses=2] + %phitmp15 = sext i16 %tmp37 to i32 ; [#uses=1] + %tmp46 = icmp slt i32 %phitmp15, %tmp4412 ; [#uses=1] + br i1 %tmp46, label %bb, label %bb49 + +bb49: ; preds = %bb28, %entry + ret i16 0 +} From isanbard at gmail.com Tue Sep 2 17:20:13 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 02 Sep 2008 22:20:13 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55675 - in /llvm-gcc-4.2/trunk/gcc: ./ config/i386/ cp/ objc/ testsuite/g++.apple/ testsuite/g++.dg/ testsuite/gcc.c-torture/execute/builtins/lib/ testsuite/gcc.dg/cpp/trad/ testsuite/gcc.target/i386/ testsuite/objc.dg/ Message-ID: <200809022220.m82MKFMd021793@zion.cs.uiuc.edu> Author: void Date: Tue Sep 2 17:20:12 2008 New Revision: 55675 URL: http://llvm.org/viewvc/llvm-project?rev=55675&view=rev Log: This syncs LLVM-GCC up with Apple's GCC tree, r150332. This sync is important because it brings in important bug fixes for blocks. At this point, the "blocks" syntax should be pretty stable. Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m Modified: llvm-gcc-4.2/trunk/gcc/c-common.c llvm-gcc-4.2/trunk/gcc/c-common.h llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c llvm-gcc-4.2/trunk/gcc/c-decl.c llvm-gcc-4.2/trunk/gcc/c-parser.c llvm-gcc-4.2/trunk/gcc/c-typeck.c llvm-gcc-4.2/trunk/gcc/c.opt llvm-gcc-4.2/trunk/gcc/calls.c llvm-gcc-4.2/trunk/gcc/config/i386/i386.c llvm-gcc-4.2/trunk/gcc/cp/call.c llvm-gcc-4.2/trunk/gcc/cp/decl.c llvm-gcc-4.2/trunk/gcc/cp/decl2.c llvm-gcc-4.2/trunk/gcc/cp/parser.c llvm-gcc-4.2/trunk/gcc/cp/semantics.c llvm-gcc-4.2/trunk/gcc/cp/typeck.c llvm-gcc-4.2/trunk/gcc/dbxout.c llvm-gcc-4.2/trunk/gcc/dwarf2out.c llvm-gcc-4.2/trunk/gcc/dwarf2out.h llvm-gcc-4.2/trunk/gcc/except.c llvm-gcc-4.2/trunk/gcc/expmed.c llvm-gcc-4.2/trunk/gcc/expr.c llvm-gcc-4.2/trunk/gcc/expr.h llvm-gcc-4.2/trunk/gcc/final.c llvm-gcc-4.2/trunk/gcc/fold-const.c llvm-gcc-4.2/trunk/gcc/function.c llvm-gcc-4.2/trunk/gcc/gcov-io.c llvm-gcc-4.2/trunk/gcc/global.c llvm-gcc-4.2/trunk/gcc/ifcvt.c llvm-gcc-4.2/trunk/gcc/objc/objc-act.c llvm-gcc-4.2/trunk/gcc/rtl.h llvm-gcc-4.2/trunk/gcc/stmt.c llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/5596043.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-3.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-1.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-2.C llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inline-limit-1.C llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/trad/include.c llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/20020616-1.c llvm-gcc-4.2/trunk/gcc/tree.h llvm-gcc-4.2/trunk/gcc/varasm.c llvm-gcc-4.2/trunk/gcc/version.c Modified: llvm-gcc-4.2/trunk/gcc/c-common.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.c Tue Sep 2 17:20:12 2008 @@ -302,7 +302,8 @@ /* Warn about format/argument anomalies in calls to formatted I/O functions (*printf, *scanf, strftime, strfmon, etc.). */ -int warn_format; +/* APPLE LOCAL default to Wformat-security 5764921 */ +int warn_format = 1; /* Warn about using __null (as NULL in C++) as sentinel. For code compiled with GCC this doesn't matter as __null is guaranteed to have the right @@ -1228,7 +1229,20 @@ if (warn_shorten_64_to_32 && TYPE_PRECISION (TREE_TYPE (expr)) == 64 && TYPE_PRECISION (type) == 32) - warning (0, "implicit conversion shortens 64-bit value into a 32-bit value"); + /* APPLE LOCAL begin 64bit shorten warning 5429810 */ + { + /* As a special case, don't warn when we are working with small + constants as the enum forming code shortens them into smaller + types. */ + if (TREE_CODE (expr) == INTEGER_CST) + { + bool unsignedp = tree_int_cst_sgn (expr) >= 0; + if (min_precision (expr, unsignedp) <= TYPE_PRECISION (type)) + return; + } + warning (0, "implicit conversion shortens 64-bit value into a 32-bit value"); + } + /* APPLE LOCAL end 64bit shorten warning 5429810 */ } /* Convert EXPR to TYPE, warning about conversion problems with constants. @@ -6128,6 +6142,35 @@ /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ /* APPLE LOCAL begin blocks 6040305 */ + +/* This routine builds: + *(id *)(EXP+20) expression which references the object id pointer. +*/ +tree +build_indirect_object_id_exp (tree exp) +{ + tree dst_obj; + int int_size = int_cst_value (TYPE_SIZE_UNIT (unsigned_type_node)); + int offset; + /* dst->object = [src->object retail]; In thid case 'object' is the field + of the object passed offset by: void* + int + int + void* + void * + This must match definition of Block_byref structs. */ + offset = GET_MODE_SIZE (Pmode) + int_size + int_size + GET_MODE_SIZE (Pmode) + + GET_MODE_SIZE (Pmode); + dst_obj = build2 (PLUS_EXPR, ptr_type_node, exp, + build_int_cst (NULL_TREE, offset)); + /* APPLE LOCAL begin radar 6180456 */ + if (c_dialect_objc ()) + { + /* Type case to: 'id *' */ + dst_obj = cast_to_pointer_to_id (dst_obj); + dst_obj = build_indirect_ref (dst_obj, "unary *"); + } + /* APPLE LOCAL end radar 6180456 */ + return dst_obj; +} + +/* APPLE LOCAL begin radar 6180456 */ static tree block_byref_release_decl; /* Build a: void _Block_byref_release (void *) if not done @@ -6151,6 +6194,29 @@ } return block_byref_release_decl; } +/* APPLE LOCAL end radar 6180456 */ + +static tree block_byref_assign_copy_decl; +tree +build_block_byref_assign_copy_decl (void) +{ + /* Build a: void _Block_byref_assign_copy (void *, void *) if not done already. */ + if (!block_byref_assign_copy_decl + && !(block_byref_assign_copy_decl + = lookup_name (get_identifier ("_Block_byref_assign_copy")))) + { + tree func_type + = build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node))); + + block_byref_assign_copy_decl + = builtin_function ("_Block_byref_assign_copy", func_type, + 0, NOT_BUILT_IN, 0, NULL_TREE); + TREE_NOTHROW (block_byref_assign_copy_decl) = 0; + } + return block_byref_assign_copy_decl; +} /* This routine builds call to: _Block_byref_release(VAR_DECL.forwarding); @@ -6209,6 +6275,29 @@ } /* APPLE LOCAL end radar 5803600 */ +/* APPLE LOCAL begin radar 6160536 */ +tree +build_block_helper_name (int unique_count) +{ + char *buf; + if (!current_function_decl) + { + buf = (char *)alloca (32); + sprintf (buf, "__block_global_%d", unique_count); + } + else + { + tree outer_decl = current_function_decl; + while (outer_decl && DECL_CONTEXT (outer_decl)) + outer_decl = DECL_CONTEXT (outer_decl); + buf = (char *)alloca (IDENTIFIER_LENGTH (DECL_NAME (outer_decl)) + 32); + sprintf (buf, "__%s_block_invoke_%d", + IDENTIFIER_POINTER (DECL_NAME (outer_decl)), unique_count); + } + return get_identifier (buf); +} +/* APPLE LOCAL end radar 6160536 */ + /* Handle a "sentinel" attribute. */ static tree @@ -6538,11 +6627,13 @@ message = NULL; } else - error (gmsgid); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (gmsgid, ""); if (message) { - error (message); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (message, ""); free (message); } #undef catenate_messages @@ -7266,9 +7357,10 @@ once = 1; /* LLVM LOCAL begin */ #ifdef ENABLE_LLVM - for (i=0; i < sizeof (db) / sizeof(db[0]) - 2; ++i) + for (i=0; i + 2 < sizeof (db) / sizeof(db[0]); ++i) #else - for (i=0; i < sizeof (db) / sizeof(db[0]) - 1; ++i) + /* APPLE LOCAL 6141565 fix comparison always false warning */ + for (i=0; i + 1 < sizeof (db) / sizeof(db[0]); ++i) #endif /* LLVM LOCAL end */ gcc_assert (iasm_op_comp (&db[i+1], &db[i]) >= 0); @@ -8499,11 +8591,11 @@ #ifdef ENABLE_LLVM tree stmt, label; #else - tree sexpr; - tree inputs = NULL_TREE, outputs = NULL_TREE, clobbers = NULL_TREE; - tree stmt; - tree label, l; - tree str, one; + tree sexpr; + tree inputs = NULL_TREE, outputs = NULL_TREE, clobbers = NULL_TREE; + tree stmt; + tree label, l; + tree str, one; #endif /* LLVM LOCAL end */ STRIP_NOPS (labid); Modified: llvm-gcc-4.2/trunk/gcc/c-common.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-common.h?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-common.h (original) +++ llvm-gcc-4.2/trunk/gcc/c-common.h Tue Sep 2 17:20:12 2008 @@ -1124,7 +1124,9 @@ BLOCK_NEEDS_FREE = (1 << 24), BLOCK_HAS_COPY_DISPOSE = (1 << 25), BLOCK_NO_COPY = (1 << 26), /* interim byref: no copies allowed */ - BLOCK_IS_GC = (1 << 27) + BLOCK_IS_GC = (1 << 27), + /* APPLE LOCAL radar 5822844 */ + BLOCK_IS_GLOBAL = (1 << 28) }; struct block_sema_info { @@ -1145,6 +1147,8 @@ bool isVariadic; bool BlockHasCopyDispose; bool BlockHasByrefVar; + /* APPLE LOCAL radar 5822844 */ + bool block_is_complete; /* When true, we are done analyzing block. */ /* the_scope - This is the scope for the block itself, which contains arguments etc. Use only for C. */ @@ -1198,6 +1202,7 @@ extern void gen_block_byref_release_exp (tree); extern tree build_block_byref_release_exp (tree); extern tree build_block_byref_release_decl (void); +extern tree build_block_byref_assign_copy_decl (void); extern void release_all_local_byrefs_at_return (void); void diagnose_byref_var_in_current_scope (void); extern void release_local_byrefs_at_break (void); @@ -1205,6 +1210,12 @@ extern void outof_bc_stmt_block (void); /* APPLE LOCAL end radar 6083129 - byref escapes */ +/* APPLE LOCAL radar 6040305 - blocks */ +extern tree build_indirect_object_id_exp (tree); + +/* APPLE LOCAL radar 6160536 */ +extern tree build_block_helper_name (int); + /* In c-omp.c */ extern tree c_finish_omp_master (tree); extern tree c_finish_omp_critical (tree, tree); Modified: llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-cppbuiltin.c Tue Sep 2 17:20:12 2008 @@ -584,7 +584,7 @@ options. */ /* APPLE LOCAL begin blocks */ /* APPLE LOCAL radar 5868913 */ - if (flag_blocks && !c_dialect_cxx ()) + if (flag_blocks) cpp_define (pfile, "__BLOCKS__=1"); /* APPLE LOCAL end blocks */ if (optimize_size) Modified: llvm-gcc-4.2/trunk/gcc/c-decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-decl.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-decl.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-decl.c Tue Sep 2 17:20:12 2008 @@ -326,13 +326,13 @@ tree blocks; tree blocks_last; - /* APPLE LOCAL begin radar 6083129 - byref escapes */ - /* None-zero if outermost block of a statement which can have a + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ + /* Non-zero if outermost block of a statement which can have a break/continue stmt; such as while, switch, etc. This cannot be a boolen field because the same scope can be used for a nested while/for statement; as in, while(...) while (...). */ unsigned int bc_stmt_body; - /* APPLE LOCAL end radar 6083129 - byref escapes */ + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ /* The depth of this scope. Used to keep the ->shadowed chain of bindings sorted innermost to outermost. */ @@ -360,11 +360,11 @@ /* True means make a BLOCK for this scope no matter what. */ BOOL_BITFIELD keep : 1; - /* APPLE LOCAL begin radar 6083129 - byref escapes */ + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ /* When true, current scope has at least one local __byref variable - in its scope. This flag is used for compile-time performance. */ + in its scope. This flag is used for compile-time performance. */ BOOL_BITFIELD byref_in_current_scope : 1; - /* APPLE LOCAL end radar 6083129 - byref escapes */ + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ }; /* The scope currently in effect. */ @@ -688,10 +688,10 @@ scope->keep = keep_next_level_flag; scope->outer = current_scope; scope->depth = current_scope ? (current_scope->depth + 1) : 0; - /* APPLE LOCAL begin radar 6083129 - byref escapes */ + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ scope->byref_in_current_scope = current_scope ? current_scope->byref_in_current_scope : false; - /* APPLE LOCAL end radar 6083129 - byref escapes */ + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ /* Check for scope depth overflow. Unlikely (2^28 == 268,435,456) but possible. */ @@ -716,11 +716,12 @@ TYPE_CONTEXT (type) = context; } -/* APPLE LOCAL begin radar 6083129 - byref escapes */ +/* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ /* This routine is called at the begining of parsing of a while/for, etc. - statement and sets bc_stmt_body in current scope to say that outer scope + statement and sets bc_stmt_body in current scope to say that outer scope is for such a statement. */ -void in_bc_stmt_block (void) +void +in_bc_stmt_block (void) { gcc_assert (current_scope); ++current_scope->bc_stmt_body; @@ -728,7 +729,8 @@ /* This routine resets the bc_stmt_body flag before exiting the top-most block of while/for, etc. statement. */ -void outof_bc_stmt_block (void) +void +outof_bc_stmt_block (void) { gcc_assert (current_scope && current_scope->bc_stmt_body > 0); --current_scope->bc_stmt_body; @@ -737,15 +739,16 @@ /* This routine generates calls of _Block_byref_release(VAR_DECL.forwarding); for all byref variables seen in the scope of the return statement. */ -void release_all_local_byrefs_at_return (void) +void +release_all_local_byrefs_at_return (void) { struct c_scope *scope; struct c_binding *b; - + gcc_assert (current_scope); if (flag_objc_gc_only || !current_scope->byref_in_current_scope) return; - + scope = current_scope; while (scope && scope != file_scope) { @@ -753,28 +756,27 @@ { tree p = b->decl; if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) - gen_block_byref_release_exp (p); + gen_block_byref_release_exp (p); } - /* APPLE LOCAL begin radar 6083129 */ /* Release up to scope of the block. */ if (cur_block && cur_block->the_scope == scope) break; - /* APPLE LOCAL end radar 6083129 */ scope = scope->outer; } } /* This routine issues a diagnostic if a __byref variable is seen in - current scope. This is for now called from a goto statement. */ -void diagnose_byref_var_in_current_scope (void) + current scope. This is for now called from a goto statement. */ +void +diagnose_byref_var_in_current_scope (void) { struct c_scope *scope; struct c_binding *b; - + gcc_assert (current_scope); if (flag_objc_gc_only || !current_scope->byref_in_current_scope) return; - + scope = current_scope; while (scope && scope != file_scope) { @@ -790,18 +792,20 @@ scope = scope->outer; } } -/* This routine generates call to _Block_byref_release(VAR_DECL.forwarding); - for all __byref variables which go out of scope when 'break' is executed. -*/ -void release_local_byrefs_at_break (void) + +/* This routine generates call to + _Block_byref_release(VAR_DECL.forwarding); for all __byref + variables which go out of scope when 'break' is executed. */ +void +release_local_byrefs_at_break (void) { struct c_scope *scope; struct c_binding *b; - + gcc_assert (current_scope); if (flag_objc_gc_only || !current_scope->byref_in_current_scope) return; - + scope = current_scope; while (scope && !scope->bc_stmt_body) { @@ -809,13 +813,13 @@ { tree p = b->decl; if (p && TREE_CODE (p) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (p)) - gen_block_byref_release_exp (p); + gen_block_byref_release_exp (p); } scope = scope->outer; } } -/* APPLE LOCAL end radar 6083129 - byref escapes */ +/* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ /* Exit a scope. Restore the state of the identifier-decl mappings that were in effect when this scope was entered. Return a BLOCK @@ -947,10 +951,10 @@ goto common_symbol; case VAR_DECL: - /* APPLE LOCAL begin radar 6083129 - byref escapes */ + /* APPLE LOCAL begin radar 6083129 - byref escapes (C++ cp) */ if (!flag_objc_gc_only && COPYABLE_BYREF_LOCAL_VAR (p)) - gen_block_byref_release_exp (p); - /* APPLE LOCAL end radar 6083129 - byref escapes */ + gen_block_byref_release_exp (p); + /* APPLE LOCAL end radar 6083129 - byref escapes (C++ cp) */ /* Warnings for unused variables. */ if (!TREE_USED (p) @@ -1416,14 +1420,14 @@ { /* APPLE LOCAL begin disable typechecking for SPEC --dbj */ /* Accept incompatible function declarations, and incompatible - global variables provided they are in different files. + global variables provided they are in different files. (Would be nice to check this for functions also, but context is not set for them.) */ bool warn = false; - if (disable_typechecking_for_spec_flag + if (disable_typechecking_for_spec_flag && TREE_PUBLIC (olddecl) && TREE_PUBLIC (newdecl) - && ((TREE_CODE (olddecl) == VAR_DECL + && ((TREE_CODE (olddecl) == VAR_DECL && TREE_CODE (newdecl) == VAR_DECL && !same_translation_unit_p (olddecl, newdecl)) || (TREE_CODE (olddecl) == FUNCTION_DECL @@ -3637,7 +3641,7 @@ /* APPLE LOCAL begin radar 4281748 */ - if (c_dialect_objc () + if (c_dialect_objc () && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == FUNCTION_DECL)) objc_check_global_decl (decl); @@ -3697,46 +3701,24 @@ using_eh_for_cleanups (); } -/* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ +/* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ cr) */ static tree block_byref_id_object_copy; static tree block_byref_id_object_dispose; -/* This routine builds: - *(id *)(EXP+20) expression which references the object id pointer. -*/ -static tree -build_indirect_object_id_exp (tree exp) -{ - tree dst_obj; - int int_size = int_cst_value (TYPE_SIZE_UNIT (unsigned_type_node)); - int offset; - /* dst->object = [src->object retail]; In thid case 'object' is the field - of the object passed offset by: void* + int + int + void* + void * - This must match definition of Block_byref structs. */ - offset = GET_MODE_SIZE (Pmode) + int_size + int_size + GET_MODE_SIZE (Pmode) + - GET_MODE_SIZE (Pmode); - dst_obj = build2 (PLUS_EXPR, ptr_type_node, exp, - build_int_cst (NULL_TREE, offset)); - /* Type case to: 'id *' */ - dst_obj = cast_to_pointer_to_id (dst_obj); - dst_obj = build_indirect_ref (dst_obj, "unary *"); - return dst_obj; -} - - /** This routine builds: void __Block_byref_id_object_copy(struct Block_byref_id_object *dst, - struct Block_byref_id_object *src) { - dst->object = [src->object retain]; - } -*/ -static void synth_block_byref_id_object_copy_func (void) + struct Block_byref_id_object *src) { + dst->object = [src->object retain]; // objective-c only + _Block_byref_assign_copy(&_dest->object, _src->object) // or: c language + } */ +static void +synth_block_byref_id_object_copy_func (void) { tree stmt, fnbody; tree dst_arg, src_arg; - tree dst_obj, src_obj, retain_exp, store; + tree dst_obj, src_obj; struct c_arg_info * arg_info; gcc_assert (block_byref_id_object_copy); @@ -3770,12 +3752,25 @@ /* src_obj is: _src->object. */ src_obj = build_indirect_object_id_exp (src_arg); - retain_exp = retain_block_component (src_obj); - - /* dst->object = [src->object retain]; */ - store = build_modify_expr (dst_obj, NOP_EXPR, retain_exp); + /* APPLE LOCAL begin radar 6180456 */ + if (c_dialect_objc ()) + { + tree retain_exp = retain_block_component (src_obj); - add_stmt (store); + /* dst->object = [src->object retain]; */ + tree store = build_modify_expr (dst_obj, NOP_EXPR, retain_exp); + add_stmt (store); + } + else + { + /* _Block_byref_assign_copy(&_dest->object, _src->object) */ + tree func_params = tree_cons (NULL_TREE, build_fold_addr_expr (dst_obj), + tree_cons (NULL_TREE, src_obj, + NULL_TREE)); + tree call_exp = build_function_call (build_block_byref_assign_copy_decl (), func_params); + add_stmt (call_exp); + } + /* APPLE LOCAL end radar 6180456 */ fnbody = c_end_compound_stmt (stmt, true); add_stmt (fnbody); @@ -3787,11 +3782,12 @@ /** This routine builds: - void __Block_byref_id_object_dispose(struct Block_byref_id_object *_src) { - [_src->object release]; - } -*/ -static void synth_block_byref_id_object_dispose_func (void) + void __Block_byref_id_object_dispose(struct Block_byref_id_object *_src) { + [_src->object release]; // objective-c or: + _Block_byref_release(_src->object) // c language + } */ +static void +synth_block_byref_id_object_dispose_func (void) { tree stmt, fnbody; tree src_arg, src_obj, rel_exp; @@ -3814,10 +3810,19 @@ /* Body of the function. */ stmt = c_begin_compound_stmt (true); - /* [_src->object release]; */ src_obj = build_indirect_object_id_exp (src_arg); - rel_exp = release_block_component (src_obj); + /* APPLE LOCAL begin radar 6180456 */ + if (c_dialect_objc ()) + /* [_src->object release]; */ + rel_exp = release_block_component (src_obj); + else + { + /* _Block_byref_release(_src->object) */ + tree func_params = tree_cons (NULL_TREE, src_obj, NULL_TREE); + rel_exp = build_function_call (build_block_byref_release_decl (), func_params); + } + /* APPLE LOCAL end radar 6180456 */ add_stmt (rel_exp); fnbody = c_end_compound_stmt (stmt, true); @@ -3829,14 +3834,14 @@ /* new_block_byref_decl - This routine changes a 'typex x' declared variable into: - struct __Block_byref_x { - struct Block_byref_x *forwarding; - int32_t flags; - int32_t size; - void *ByrefKeepFuncPtr; // Only if variable is __byref ObjC object - void *ByrefDestroyFuncPtr; // Only if variable is __byref ObjC object - typex x; - } x; + struct __Block_byref_x { + struct Block_byref_x *forwarding; + int32_t flags; + int32_t size; + void *ByrefKeepFuncPtr; // Only if variable is __byref ObjC object + void *ByrefDestroyFuncPtr; // Only if variable is __byref ObjC object + typex x; + } x; */ static tree @@ -3910,7 +3915,6 @@ { &x, 0, sizeof(struct __Block_byref_x), &byref_keep, &byref_destroy, &initializer-expr}; - */ static tree init_byref_decl (tree decl, tree init) @@ -3987,7 +3991,7 @@ init = build_constructor_from_list (block_byref_type, nreverse (initlist)); return init; } -/* APPLE LOCAL end radar 5932809 - copyable byref blocks */ +/* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ cr) */ /* Finish processing of a declaration; install its initial value. @@ -4015,7 +4019,7 @@ /* Don't crash if parm is initialized. */ if (TREE_CODE (decl) == PARM_DECL) init = 0; - /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ + /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ cq) */ /* We build a new type for each local variable declared as __byref and initialize it to a list of initializers. */ else if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) @@ -4035,7 +4039,7 @@ current_scope->byref_in_current_scope = true; } } - /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ + /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ cq) */ if (init) store_init_value (decl, init); @@ -7950,6 +7954,7 @@ tree build_block_byref_decl (tree name, tree decl, tree exp) { + struct c_scope *scope = current_scope; /* If it is already a byref declaration, do not add the pointer type because such declarations already have the pointer type added. This happens when we have two nested byref declarations in @@ -7957,6 +7962,10 @@ tree ptr_type = (TREE_CODE (decl) == VAR_DECL && BLOCK_DECL_BYREF (decl)) ? TREE_TYPE (decl) : build_pointer_type (TREE_TYPE (decl)); tree byref_decl = build_decl (VAR_DECL, name, ptr_type); + /* APPLE LOCAL begin radars 6144664 & 6145471 */ + DECL_SOURCE_LOCATION (byref_decl) = DECL_SOURCE_LOCATION + (cur_block->helper_func_decl); + /* APPLE LOCAL end radars 6144664 & 6145471 */ BLOCK_DECL_BYREF (byref_decl) = 1; /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ch) */ @@ -7967,10 +7976,15 @@ } /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ch) */ + /* In the presence of nested "{" + move up the scope chain until reaching the main function body's scope. + */ + while (scope && !scope->function_body) + scope = scope->outer; /* Current scope must be that of the main function body. */ - gcc_assert (current_scope->function_body); + gcc_assert (scope && scope->function_body); bind (name, byref_decl, - current_scope, /*invisible=*/false, /*nested=*/false); + scope, /*invisible=*/false, /*nested=*/false); cur_block->block_byref_decl_list = tree_cons (NULL_TREE, byref_decl, cur_block->block_byref_decl_list); cur_block->block_original_byref_decl_list = @@ -7995,28 +8009,28 @@ if (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl)) decl = build_byref_local_var_access (decl, DECL_NAME (decl)); else { - /* APPLE LOCAL begin radar 5988451 */ + /* APPLE LOCAL begin radar 5988451 (C++ ch) */ if (cur_block->prev_block_info) { - /* Traverse enclosing blocks. Insert a copied-in variable in each - enclosing block which has no declaration of this variable. This is - to ensure that the current (inner) block has the 'frozen' value of the - copied-in variable; which means the value of the copied in variable - is at the point of the block declaration and *not* when the inner block - is envoked. - */ + /* Traverse enclosing blocks. Insert a copied-in variable in + each enclosing block which has no declaration of this + variable. This is to ensure that the current (inner) block + has the 'frozen' value of the copied-in variable; which means + the value of the copied in variable is at the point of the + block declaration and *not* when the inner block is + invoked. */ struct block_sema_info *cb = cur_block->prev_block_info; while (cb) { struct c_binding *b = I_SYMBOL_BINDING (name); /* Find the first declaration not in current block. */ - while (b && b->decl - && (TREE_CODE (b->decl) == VAR_DECL + while (b && b->decl + && (TREE_CODE (b->decl) == VAR_DECL || TREE_CODE (b->decl) == PARM_DECL) && b->depth >= cur_block->the_scope->depth) b = b->shadowed; - + /* Is the next declaration not in enclosing block? */ - if (b && b->decl - && (TREE_CODE (b->decl) == VAR_DECL + if (b && b->decl + && (TREE_CODE (b->decl) == VAR_DECL || TREE_CODE (b->decl) == PARM_DECL) && b->depth < cb->the_scope->depth) { /* No declaration of variable seen in the block. Must insert one, @@ -8029,16 +8043,20 @@ cur_block = save_current_block; current_scope = save_scope; } - cb = cb->prev_block_info; + cb = cb->prev_block_info; } } - /* APPLE LOCAL end radar 5988451 */ + /* APPLE LOCAL end radar 5988451 (C++ ch) */ } /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ch) */ ref_decl = build_decl (VAR_DECL, name, build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_CONST)); + /* APPLE LOCAL begin radars 6144664 & 6145471 */ + DECL_SOURCE_LOCATION (ref_decl) = DECL_SOURCE_LOCATION + (cur_block->helper_func_decl); + /* APPLE LOCAL end radars 6144664 & 6145471 */ DECL_INITIAL (ref_decl) = error_mark_node; /* APPLE LOCAL radar 5805175 - blocks (C++ ch) */ c_apply_type_quals_to_decl (TYPE_QUAL_CONST, ref_decl); @@ -8152,7 +8170,9 @@ begin_block (void) { struct block_sema_info *csi; +#if 0 push_scope (); +#endif csi = (struct block_sema_info*)xcalloc (1, sizeof (struct block_sema_info)); csi->prev_block_info = cur_block; cur_block = csi; @@ -8164,7 +8184,9 @@ { struct block_sema_info *csi = cur_block; cur_block = cur_block->prev_block_info; +#if 0 pop_scope (); +#endif return csi; } @@ -8175,13 +8197,13 @@ return (cur_block && cur_block->the_scope == current_scope); } -/* This routine returns 'true' if 'name' has a declaration inside - block, 'false' otherwise. If 'name' has no declaration in current - block, it returns in DECL the user declaration for 'name' found in - the enclosing scope. Note that if it is declared in current - declaration, it can be either a user declaration or a - byref/copied-in declaration added in current block's scope by - the compiler. */ +/* This routine returns 'true' if 'name' has a declaration inside the + current block, 'false' otherwise. If 'name' has no declaration in + the current block, it returns in DECL the user declaration for + 'name' found in the enclosing scope. Note that if it is declared + in current declaration, it can be either a user declaration or a + byref/copied-in declaration added in current block's scope by the + compiler. */ bool lookup_name_in_block (tree name, tree *decl) { @@ -8204,7 +8226,7 @@ enclosing block is found, it must be returned as this is where the variable in current (nested block) will have to get its value. */ - while (b && b->decl + while (b && b->decl && (TREE_CODE (b->decl) == VAR_DECL) && BLOCK_DECL_BYREF (b->decl)) b = b->shadowed; @@ -8245,6 +8267,8 @@ TREE_PUBLIC (func_decl) = 0; TREE_USED (func_decl) = 1; TREE_NOTHROW (func_decl) = 0; + /* APPLE LOCAL radar 6172148 */ + BLOCK_SYNTHESIZED_FUNC (func_decl) = 1; return func_decl; } @@ -9274,7 +9298,7 @@ code = TREE_CODE (typename); class = TREE_CODE_CLASS (code); - if (code != IDENTIFIER_NODE + if (code != IDENTIFIER_NODE || class != tcc_exceptional) return retval; Modified: llvm-gcc-4.2/trunk/gcc/c-parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-parser.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-parser.c Tue Sep 2 17:20:12 2008 @@ -2401,6 +2401,7 @@ ret.spec = TREE_TYPE (expr.value); /* APPLE LOCAL begin radar 4204796 (in 4.2 n) */ if (c_dialect_objc() + && ret.spec != error_mark_node && lookup_attribute ("objc_volatilized", TYPE_ATTRIBUTES (ret.spec))) ret.spec = build_qualified_type (ret.spec, (TYPE_QUALS (ret.spec) & ~TYPE_QUAL_VOLATILE)); @@ -9383,11 +9384,7 @@ /* APPLE LOCAL begin radar 5732232 - blocks (C++ ce) */ static tree block_copy_assign_decl; static tree block_destroy_decl; -/* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ce) */ -static tree block_byref_assign_copy_decl; -/* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ce) */ -/* APPLE LOCAL begin radar 6083129 - byref escapes (C++ ce) */ void gen_block_byref_release_exp (tree var_decl) { @@ -9395,7 +9392,6 @@ if (cleanup) add_stmt (cleanup); } -/* APPLE LOCAL end radar 6083129 - byref escapes (C++ ce) */ bool building_block_byref_decl = false; static bool @@ -9417,10 +9413,8 @@ building_block_byref_decl = false; if (byref_decl_expr.value != error_mark_node && !(TREE_CODE (byref_decl_expr.value) == VAR_DECL && - /* APPLE LOCAL begin radar 5803600 (C++ ce) */ (BLOCK_DECL_BYREF (byref_decl_expr.value) || in_block_global_byref_list (byref_decl_expr.value)))) - /* APPLE LOCAL end radar 5803600 (C++ ce) */ error ( "only a visible variable may be used in a block byref declaration"); } while (c_parser_next_token_is (parser, CPP_COMMA)); @@ -9464,7 +9458,6 @@ break; } - /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ce) */ /* Further check to see that we have __byref variables which require Copy/Dispose helpers. */ for (chain = block_impl->block_byref_decl_list; chain; @@ -9475,7 +9468,6 @@ block_impl->BlockHasByrefVar = TRUE; break; } - /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ce) */ sprintf(buffer, "__block_%d", ++unique_count); push_to_top_level (); @@ -9484,7 +9476,6 @@ field_decl = build_decl (FIELD_DECL, get_identifier ("impl"), TREE_TYPE (invoke_impl_ptr_type)); field_decl_chain = field_decl; - /* APPLE LOCAL radar 5932809 - copyable byref blocks (C++ ce) */ if (block_impl->BlockHasCopyDispose) { /* void *CopyFuncPtr; */ @@ -9495,12 +9486,10 @@ field_decl = build_decl (FIELD_DECL, get_identifier ("DestroyFuncPtr"), ptr_type_node); chainon (field_decl_chain, field_decl); - /* APPLE LOCAL begin radar 5988451 (C++ ce) */ /* If inner block of a nested block has BlockHasCopyDispose, so does its outer block. */ if (block_impl->prev_block_info) block_impl->prev_block_info->BlockHasCopyDispose = TRUE; - /* APPLE LOCAL end radar 5988451 (C++ ce) */ } /* int x; // ref variable list ... */ @@ -9531,8 +9520,8 @@ /** build_block_struct_initlist - builds the initializer list: - { &_NSConcreteStackBlock // isa, - BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE // flags, + { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa, + BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags, sizeof(struct block_1), helper_1 }, copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE @@ -9549,10 +9538,9 @@ int size; tree helper_addr, chain, fields; unsigned flags = 0; - /* APPLE LOCAL radar 5811599 (C++ ce) */ static tree NSConcreteStackBlock_decl = NULL_TREE; + static tree NSConcreteGlobalBlock_decl = NULL_TREE; - /* APPLE LOCAL radar 5932809 - copyable byref blocks (C++ ce) */ if (block_impl->BlockHasCopyDispose) /* Note! setting of this flag merely indicates to the runtime that we have destroy_helper_block/copy_helper_block helper @@ -9565,25 +9553,48 @@ fields = TYPE_FIELDS (TREE_TYPE (invoke_impl_ptr_type)); - /* APPLE LOCAL begin radar 5811599 (C++ ce) */ - /* Find an existing declaration for _NSConcreteStackBlock or declare - extern void *_NSConcreteStackBlock; */ - if (NSConcreteStackBlock_decl == NULL_TREE) - { - tree name_id = get_identifier("_NSConcreteStackBlock"); - NSConcreteStackBlock_decl = lookup_name (name_id); - if (!NSConcreteStackBlock_decl) - { - NSConcreteStackBlock_decl = build_decl (VAR_DECL, name_id, ptr_type_node); - DECL_EXTERNAL (NSConcreteStackBlock_decl) = 1; - TREE_PUBLIC (NSConcreteStackBlock_decl) = 1; - pushdecl_top_level (NSConcreteStackBlock_decl); - rest_of_decl_compilation (NSConcreteStackBlock_decl, 0, 0); - } - } - initlist = build_tree_list (fields, - build_fold_addr_expr (NSConcreteStackBlock_decl)); - /* APPLE LOCAL end radar 5811599 (C++ ce) */ + if (!current_function_decl) + { + /* This is a global block. */ + /* Find an existing declaration for _NSConcreteGlobalBlock or declare + extern void *_NSConcreteGlobalBlock; */ + if (NSConcreteGlobalBlock_decl == NULL_TREE) + { + tree name_id = get_identifier("_NSConcreteGlobalBlock"); + NSConcreteGlobalBlock_decl = lookup_name (name_id); + if (!NSConcreteGlobalBlock_decl) + { + NSConcreteGlobalBlock_decl = build_decl (VAR_DECL, name_id, ptr_type_node); + DECL_EXTERNAL (NSConcreteGlobalBlock_decl) = 1; + TREE_PUBLIC (NSConcreteGlobalBlock_decl) = 1; + pushdecl_top_level (NSConcreteGlobalBlock_decl); + rest_of_decl_compilation (NSConcreteGlobalBlock_decl, 0, 0); + } + } + initlist = build_tree_list (fields, + build_fold_addr_expr (NSConcreteGlobalBlock_decl)); + flags |= BLOCK_IS_GLOBAL; + } + else + { + /* Find an existing declaration for _NSConcreteStackBlock or declare + extern void *_NSConcreteStackBlock; */ + if (NSConcreteStackBlock_decl == NULL_TREE) + { + tree name_id = get_identifier("_NSConcreteStackBlock"); + NSConcreteStackBlock_decl = lookup_name (name_id); + if (!NSConcreteStackBlock_decl) + { + NSConcreteStackBlock_decl = build_decl (VAR_DECL, name_id, ptr_type_node); + DECL_EXTERNAL (NSConcreteStackBlock_decl) = 1; + TREE_PUBLIC (NSConcreteStackBlock_decl) = 1; + pushdecl_top_level (NSConcreteStackBlock_decl); + rest_of_decl_compilation (NSConcreteStackBlock_decl, 0, 0); + } + } + initlist = build_tree_list (fields, + build_fold_addr_expr (NSConcreteStackBlock_decl)); + } fields = TREE_CHAIN (fields); initlist = tree_cons (fields, @@ -9603,7 +9614,6 @@ nreverse (initlist)); fields = TYPE_FIELDS (block_struct_type); initlist = build_tree_list (fields, initlist); - /* APPLE LOCAL radar 5932809 - copyable byref blocks (C++ ce) */ if (block_impl->BlockHasCopyDispose) { fields = TREE_CHAIN (fields); @@ -9618,18 +9628,15 @@ for (chain = block_impl->block_original_ref_decl_list; chain; chain = TREE_CHAIN (chain)) { - /* APPLE LOCAL begin radar 5834569 (C++ ce) */ tree y = TREE_VALUE (chain); TREE_USED (y) = 1; fields = TREE_CHAIN (fields); initlist = tree_cons (fields, copy_in_object (y), initlist); - /* APPLE LOCAL end radar 5834569 (C++ ce) */ } for (chain = block_impl->block_original_byref_decl_list; chain; chain = TREE_CHAIN (chain)) { tree y = TREE_VALUE (chain); - /* APPLE LOCAL radar 5834569 (C++ ce) */ TREE_USED (y) = 1; fields = TREE_CHAIN (fields); y = build_fold_addr_expr (y); @@ -9655,8 +9662,8 @@ 3) build the temporary initialization: struct block_1 I = { - { &_NSConcreteStackBlock // isa, - BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE // flags, + { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa, + BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags, sizeof(struct block_1), helper_1 }, copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE @@ -9698,6 +9705,12 @@ bind = build3 (BIND_EXPR, void_type_node, block_holder_tmp_decl, exp, NULL); TREE_SIDE_EFFECTS (bind) = 1; add_stmt (bind); + /* Temporary representing a global block is made global static. */ + if (global_bindings_p ()) { + TREE_PUBLIC (block_holder_tmp_decl) = 0; + TREE_STATIC (block_holder_tmp_decl) = 1; + finish_decl (block_holder_tmp_decl, constructor, NULL_TREE); + } return block_holder_tmp_decl; } @@ -9790,7 +9803,6 @@ } } - /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ce) */ /* For each __byref declared variable used in |...| Must generate call to: _Block_byref_assign_copy(&_dest->myImportedBlock, _src->myImportedBlock) */ @@ -9807,30 +9819,13 @@ DECL_NAME (p)); /* _Block_byref_assign_copy(&_dest->myImportedClosure, _src->myImportedClosure) */ - /* Build a: void _Block_byref_assign_copy (void *, void *) if - not done already. */ - if (!block_byref_assign_copy_decl - && !(block_byref_assign_copy_decl - = lookup_name (get_identifier ("_Block_byref_assign_copy")))) - { - tree func_type - = build_function_type (void_type_node, - tree_cons (NULL_TREE, ptr_type_node, - tree_cons (NULL_TREE, ptr_type_node, void_list_node))); - - block_byref_assign_copy_decl - = builtin_function ("_Block_byref_assign_copy", func_type, - 0, NOT_BUILT_IN, 0, NULL_TREE); - TREE_NOTHROW (block_byref_assign_copy_decl) = 0; - } dst_block_component = build_fold_addr_expr (dst_block_component); func_params = tree_cons (NULL_TREE, dst_block_component, tree_cons (NULL_TREE, src_block_component, NULL_TREE)); - call_exp = build_function_call (block_byref_assign_copy_decl, func_params); + call_exp = build_function_call (build_block_byref_assign_copy_decl (), func_params); add_stmt (call_exp); } - /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ce) */ fnbody = c_end_compound_stmt (stmt, true); add_stmt (fnbody); @@ -9877,10 +9872,8 @@ /* _Block_destroy(_src->myImportedClosure); */ /* _Block_destroy (void *); */ /* Build a: void _Block_destroy (void *) if not done already. */ - /* APPLE LOCAL begin radar 5992047 (C++ ce) */ if (!block_destroy_decl && !(block_destroy_decl = lookup_name (get_identifier ("_Block_destroy")))) - /* APPLE LOCAL end radar 5992047 (C++ ce) */ { tree func_type = build_function_type (void_type_node, @@ -9903,7 +9896,6 @@ } } - /* APPLE LOCAL begin radar 5932809 - copyable byref blocks (C++ ce) */ /* For each __byref declared variable used in |...| Must generate call to: _Block_byref_release(_src->myImportedClosure) */ @@ -9924,7 +9916,6 @@ call_exp = build_function_call (build_block_byref_release_decl (), func_params); add_stmt (call_exp); } - /* APPLE LOCAL end radar 5932809 - copyable byref blocks (C++ ce) */ fnbody = c_end_compound_stmt (stmt, true); add_stmt (fnbody); @@ -9955,8 +9946,6 @@ tree restype, resdecl; tree fnbody, typelist; tree helper_function_type; - /* APPLE LOCAL radar 5824092 (C++ ce) */ - bool at_file_scope = global_bindings_p (); tree block; c_parser_consume_token (parser); /* eat '^' */ @@ -10019,7 +10008,6 @@ function, even though we do not know its type yet. */ self_arg = build_decl (PARM_DECL, get_identifier ("_self"), ptr_type_node); - /* APPLE LOCAL radar 5925784 (C++ ce) */ TREE_USED (self_arg) = 1; /* Prevent unused parameter '_self' warning. */ TREE_CHAIN (self_arg) = cur_block->arg_info->parms; cur_block->arg_info->types = tree_cons (NULL_TREE, ptr_type_node, arg_type); @@ -10028,10 +10016,10 @@ /* Build the declaration of the helper function (we do not know its result type yet, so assume it is 'void'). Treat this as a nested function and use nested function infrastructure for its generation. */ - sprintf (name, "__helper_%d", unique_count); ftype = build_function_type (void_type_node, cur_block->arg_info->types); - block_helper_function_decl = build_helper_func_decl (get_identifier (name), + /* APPLE LOCAL radar 6160536 */ + block_helper_function_decl = build_helper_func_decl (build_block_helper_name (unique_count), ftype); DECL_CONTEXT (block_helper_function_decl) = current_function_decl; BLOCK_HELPER_FUNC (block_helper_function_decl) = 1; @@ -10039,12 +10027,10 @@ push_function_context (); start_block_helper_function (cur_block->helper_func_decl, false); - /* APPLE LOCAL begin radar 5988451 (C++ ce) */ /* Set block's scope to the scope of the helper function's main body. This is primarily used when nested blocks are declared. */ /* FIXME: Name of objc_get_current_scope needs to get changed. */ cur_block->the_scope = (struct c_scope*)objc_get_current_scope (); - /* APPLE LOCAL end radar 5988451 (C++ ce) */ /* Enter parameter list to the scope of the helper function. */ store_parm_decls_from (cur_block->arg_info); @@ -10066,7 +10052,6 @@ else { struct c_expr expr; stmt = c_begin_compound_stmt (true); - /* APPLE LOCAL radar 6034839 */ error ("blocks require { }"); expr = c_parser_cast_expression (parser, NULL); body = expr.value; @@ -10092,13 +10077,6 @@ restype = !cur_block->return_type ? void_type_node : cur_block->return_type; - /* APPLE LOCAL begin radar 5824092 (C++ ce) */ - if (at_file_scope) - { - error ("block literal cannot be declared at global scope"); - return clean_and_exit (block); - } - /* APPLE LOCAL end radar 5824092 (C++ ce) */ if (restype == error_mark_node) return clean_and_exit (block); @@ -10117,13 +10095,33 @@ fnbody = c_end_compound_stmt (stmt, true); add_stmt (fnbody); + + /* We are done parsing of the block body. Return type of block is now known. + We also know all we need to know about the helper function. So, fix its + type here. */ + /* We moved this here because for global blocks, helper function body is + not nested and is gimplified in call to finish_function() and return type + of the function must be correct. */ + ftype = build_function_type (restype, arg_type); + /* Declare helper function; as in: + double helper_1(struct block_1 *ii, int z); */ + typelist = TYPE_ARG_TYPES (ftype); + /* (struct block_1 *ii, int z, ...) */ + typelist = tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, + typelist); + helper_function_type = build_function_type (TREE_TYPE (ftype), typelist); + TREE_TYPE (cur_block->helper_func_decl) = helper_function_type; + /* Let tree builder know that we are done analyzing block's return type so it + does not do it twice (and produce bad return expression tree). This case is + for global blocks as finish_function () for them builds AST for the entire + body of the function. */ + cur_block->block_is_complete = true; finish_function (); pop_function_context (); /* Build the declaration for copy_helper_block and destroy_helper_block helper functions for later use. */ - /* APPLE LOCAL radar 5932809 - copyable byref blocks (C++ ce) */ if (cur_block->BlockHasCopyDispose) { /* void copy_helper_block (struct block*, struct block *); */ @@ -10147,20 +10145,6 @@ synth_destroy_helper_block_func (cur_block); } - - /* We are out of helper function scope and back in its enclosing scope. - We also know all we need to know about the helper function. So, fix its - type here. */ - ftype = build_function_type (restype, arg_type); - /* Declare helper function; as in: - double helper_1(struct block_1 *ii, int z); */ - typelist = TYPE_ARG_TYPES (ftype); - /* (struct block_1 *ii, int z, ...) */ - typelist = tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, - typelist); - helper_function_type = build_function_type (TREE_TYPE (ftype), typelist); - TREE_TYPE (cur_block->helper_func_decl) = helper_function_type; - block_impl = finish_block (block); /* Build unqiue name of the temporary used in code gen. */ Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-typeck.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c-typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/c-typeck.c Tue Sep 2 17:20:12 2008 @@ -75,13 +75,13 @@ static int require_constant_value; static int require_constant_elements; -/* APPLE LOCAL begin radar 5732232 - blocks */ +/* APPLE LOCAL begin radar 5732232 - blocks (C++ cm) */ /* APPLE LOCAL begin radar 5811943 - Fix type of pointers to Blocks */ /* Move declaration of invoke_impl_ptr_type to c-common.c */ /* APPLE LOCAL end radar 5811943 - Fix type of pointers to Blocks */ static bool types_are_block_compatible (tree lhptee, tree rhptee); static tree build_block_call (tree, tree, tree); -/* APPLE LOCAL end radar 5732232 - blocks */ +/* APPLE LOCAL end radar 5732232 - blocks (C++ cm) */ static bool null_pointer_constant_p (tree); static tree qualify_type (tree, tree); static int tagged_types_tu_compatible_p (tree, tree); @@ -550,8 +550,12 @@ if (t2 == error_mark_node) return t1; - gcc_assert (TREE_CODE (t1) == POINTER_TYPE - && TREE_CODE (t2) == POINTER_TYPE); + /* APPLE LOCAL begin blocks 6065211 */ + gcc_assert ((TREE_CODE (t1) == POINTER_TYPE + && TREE_CODE (t2) == POINTER_TYPE) + || (TREE_CODE (t1) == BLOCK_POINTER_TYPE + && TREE_CODE (t2) == BLOCK_POINTER_TYPE)); + /* APPLE LOCAL end blocks 6065211 */ /* Merge the attributes. */ attributes = targetm.merge_type_attributes (t1, t2); @@ -566,10 +570,15 @@ if (TREE_CODE (mv2) != ARRAY_TYPE) mv2 = TYPE_MAIN_VARIANT (pointed_to_2); target = composite_type (mv1, mv2); - t1 = build_pointer_type (c_build_qualified_type - (target, - TYPE_QUALS (pointed_to_1) | - TYPE_QUALS (pointed_to_2))); + /* APPLE LOCAL begin blocks 6065211 */ + t1 = c_build_qualified_type (target, + TYPE_QUALS (pointed_to_1) | + TYPE_QUALS (pointed_to_2)); + if (TREE_CODE (t2) == BLOCK_POINTER_TYPE) + t1 = build_block_pointer_type (t1); + else + t1 = build_pointer_type (t1); + /* APPLE LOCAL end blocks 6065211 */ return build_type_attribute_variant (t1, attributes); } @@ -952,6 +961,15 @@ int val; tree mvl, mvr; + /* APPLE LOCAL begin blocks 6065211 */ + if (TREE_CODE (ttl) == BLOCK_POINTER_TYPE + && TREE_CODE (ttr) == BLOCK_POINTER_TYPE) + return types_are_block_compatible (TREE_TYPE (ttl), + TREE_TYPE (ttr)); + if (TREE_CODE (ttl) != TREE_CODE (ttr)) + return 0; + /* APPLE LOCAL end blocks 6065211 */ + /* Do not lose qualifiers on element types of array types that are pointer targets by taking their TYPE_MAIN_VARIANT. */ mvl = TREE_TYPE (ttl); @@ -2057,7 +2075,12 @@ } type = TREE_TYPE (TREE_TYPE (array)); - if (TREE_CODE (type) != ARRAY_TYPE) + /* APPLE LOCAL begin radar 6164211 */ + /* The ObjC front-end uses TYPE_MAIN_VARIANT to tie together types differing + only in qualifications. But when constructing an array type, + the protocols do matter and must be kept around. */ + if (TREE_CODE (type) != ARRAY_TYPE && !objc_is_object_ptr (type)) + /* APPLE LOCAL end radar 6164211 */ type = TYPE_MAIN_VARIANT (type); rval = build4 (ARRAY_REF, type, array, index, NULL_TREE, NULL_TREE); /* Array ref is const/volatile if the array elements are @@ -2166,14 +2189,14 @@ (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL)); gdecl = (TREE_CODE (decl) == VAR_DECL && - (DECL_EXTERNAL (decl) - || (TREE_STATIC (decl) && !DECL_CONTEXT (decl)))); + /* APPLE LOCAL radar 6177162 */ + (DECL_EXTERNAL (decl) || TREE_STATIC (decl))); /* Treat all 'global' variables as 'byref' by default. */ - /* APPLE LOCAL begin radar 6014138 */ + /* APPLE LOCAL begin radar 6014138 (C++ ci) */ if (building_block_byref_decl || gdecl || (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl))) - /* APPLE LOCAL end radar 6014138 */ + /* APPLE LOCAL end radar 6014138 (C++ ci) */ { /* APPLE LOCAL begin radar 5803600 (C++ ci) */ /* byref globals are directly accessed. */ @@ -2751,7 +2774,8 @@ else if ((invalid_func_diag = targetm.calls.invalid_arg_for_unprototyped_fn (typelist, fundecl, val))) { - error (invalid_func_diag); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (invalid_func_diag, ""); return error_mark_node; } else @@ -3070,7 +3094,8 @@ if ((invalid_op_diag = targetm.invalid_unary_op (code, TREE_TYPE (xarg)))) { - error (invalid_op_diag); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (invalid_op_diag, ""); return error_mark_node; } @@ -3626,7 +3651,12 @@ pedwarn ("ISO C forbids conditional expr with only one void side"); result_type = void_type_node; } - else if (code1 == POINTER_TYPE && code2 == POINTER_TYPE) + /* APPLE LOCAL begin blocks 6065211 */ + else if ((code1 == POINTER_TYPE + || code1 == BLOCK_POINTER_TYPE) + && (code2 == POINTER_TYPE + || code2 == BLOCK_POINTER_TYPE)) + /* APPLE LOCAL end blocks 6065211 */ { if (comp_target_types (type1, type2)) result_type = common_pointer_type (type1, type2); @@ -3634,6 +3664,14 @@ result_type = qualify_type (type2, type1); else if (null_pointer_constant_p (orig_op2)) result_type = qualify_type (type1, type2); + /* APPLE LOCAL begin blocks 6065211 */ + else if (code2 == BLOCK_POINTER_TYPE + && VOID_TYPE_P (TREE_TYPE (type1))) + result_type = type2; + else if (code1 == BLOCK_POINTER_TYPE + && VOID_TYPE_P (TREE_TYPE (type2))) + result_type = type1; + /* APPLE LOCAL end blocks 6065211 */ else if (VOID_TYPE_P (TREE_TYPE (type1))) { if (pedantic && TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE) @@ -3684,27 +3722,27 @@ } /* APPLE LOCAL begin radar 5732232 - blocks (C++ co) */ /* APPLE LOCAL radar 5957801 */ - else if (code1 == BLOCK_POINTER_TYPE && (code2 == INTEGER_TYPE || code2 == POINTER_TYPE)) - { - if (!null_pointer_constant_p (orig_op2)) - error ("block pointer/integer type mismatch in conditional expression"); - else + else if (code1 == BLOCK_POINTER_TYPE && code2 == INTEGER_TYPE) { - op2 = convert (type1, null_pointer_node); + if (!null_pointer_constant_p (orig_op2)) + error ("block pointer/integer type mismatch in conditional expression"); + else + { + op2 = convert (type1, null_pointer_node); + } + result_type = type1; } - result_type = type1; - } /* APPLE LOCAL radar 5957801 */ - else if (code2 == BLOCK_POINTER_TYPE && (code1 == INTEGER_TYPE || code1 == POINTER_TYPE)) - { - if (!null_pointer_constant_p (orig_op1)) - error ("block pointer/integer type mismatch in conditional expression"); - else + else if (code2 == BLOCK_POINTER_TYPE && code1 == INTEGER_TYPE) { - op1 = convert (type2, null_pointer_node); + if (!null_pointer_constant_p (orig_op1)) + error ("block pointer/integer type mismatch in conditional expression"); + else + { + op1 = convert (type2, null_pointer_node); + } + result_type = type2; } - result_type = type2; - } /* APPLE LOCAL end radar 5732232 - blocks (C++ co) */ if (!result_type) @@ -4039,15 +4077,15 @@ return true; if (TREE_CODE (lhptee) == FUNCTION_TYPE && TREE_CODE (rhptee) == FUNCTION_TYPE) return functiontypes_are_block_compatible (lhptee, rhptee); - /* APPLE LOCAL begin radar 5882266 */ + /* APPLE LOCAL begin radar 5882266 (C++ cm) */ if (TREE_CODE (lhptee) == POINTER_TYPE && TREE_CODE (rhptee) == POINTER_TYPE) return types_are_block_compatible (TREE_TYPE (lhptee), TREE_TYPE (rhptee)); - /* APPLE LOCAL end radar 5882266 */ - /* APPLE LOCAL begin radar 5988995 */ + /* APPLE LOCAL end radar 5882266 (C++ cm) */ + /* APPLE LOCAL begin radar 5988995 (C++ cm) */ if (TREE_CODE (lhptee) == BLOCK_POINTER_TYPE && TREE_CODE (rhptee) == BLOCK_POINTER_TYPE) return types_are_block_compatible (TREE_TYPE (lhptee), TREE_TYPE (rhptee)); - /* APPLE LOCAL end radar 5988995 */ + /* APPLE LOCAL end radar 5988995 (C++ cm) */ return false; } @@ -5324,7 +5362,10 @@ } /* Added to enable additional -Wmissing-format-attribute warnings. */ - if (TREE_CODE (TREE_TYPE (inside_init)) == POINTER_TYPE) + /* APPLE LOCAL begin radar 5822844 */ + if (TREE_CODE (TREE_TYPE (inside_init)) == POINTER_TYPE || + TREE_CODE (TREE_TYPE (inside_init)) == BLOCK_POINTER_TYPE) + /* APPLE LOCAL end radar 5822844 */ inside_init = convert_for_assignment (type, inside_init, ic_init, NULL_TREE, NULL_TREE, 0); return inside_init; @@ -7722,7 +7763,8 @@ tree valtype, ret_stmt; bool no_warning = false; - if (cur_block) { + /* APPLE LOCAL radar 5822844 */ + if (cur_block && !cur_block->block_is_complete) { /* APPLE LOCAL radar 6083129 - byref escapes (C++ cp) */ release_all_local_byrefs_at_return (); retval = c_finish_block_return_stmt (retval); @@ -8651,7 +8693,8 @@ if ((invalid_op_diag = targetm.invalid_binary_op (code, type0, type1))) { - error (invalid_op_diag); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (invalid_op_diag, ""); return error_mark_node; } @@ -8842,7 +8885,10 @@ && (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE)) short_compare = 1; - else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) + /* APPLE LOCAL begin blocks 6065211 */ + else if ((code0 == POINTER_TYPE || code0 == BLOCK_POINTER_TYPE) + && (code1 == POINTER_TYPE || code1 == BLOCK_POINTER_TYPE)) + /* APPLE LOCAL end blocks 6065211 */ { tree tt0 = TREE_TYPE (type0); tree tt1 = TREE_TYPE (type1); @@ -8851,6 +8897,12 @@ and both must be object or both incomplete. */ if (comp_target_types (type0, type1)) result_type = common_pointer_type (type0, type1); + /* APPLE LOCAL begin blocks 6065211 */ + else if (code1 == BLOCK_POINTER_TYPE && VOID_TYPE_P (tt0)) + ; + else if (code0 == BLOCK_POINTER_TYPE && VOID_TYPE_P (tt1)) + ; + /* APPLE LOCAL end blocks 6065211 */ else if (VOID_TYPE_P (tt0)) { /* op0 != orig_op0 detects the case of something @@ -8870,7 +8922,14 @@ else /* Avoid warning about the volatile ObjC EH puts on decls. */ if (!objc_ok) - pedwarn ("comparison of distinct pointer types lacks a cast"); + /* APPLE LOCAL begin blocks 6065211 */ + { + if (code0 == BLOCK_POINTER_TYPE || code1 == BLOCK_POINTER_TYPE) + pedwarn ("comparison of distinct block types lacks a cast"); + else + pedwarn ("comparison of distinct pointer types lacks a cast"); + } + /* APPLE LOCAL end blocks 6065211 */ if (result_type == NULL_TREE) result_type = ptr_type_node; @@ -8908,30 +8967,10 @@ pedwarn ("comparison between pointer and integer"); } /* APPLE LOCAL begin radar 5732232 - blocks (C++ cl) */ - if (code0 == BLOCK_POINTER_TYPE && null_pointer_constant_p (orig_op1)) + else if (code0 == BLOCK_POINTER_TYPE && null_pointer_constant_p (orig_op1)) result_type = type0; - else if (code1 == BLOCK_POINTER_TYPE - && null_pointer_constant_p (orig_op0)) + else if (code1 == BLOCK_POINTER_TYPE && null_pointer_constant_p (orig_op0)) result_type = type1; - else if (code0 == BLOCK_POINTER_TYPE && code1 == BLOCK_POINTER_TYPE) - { - if (!types_are_block_compatible (TREE_TYPE(type0), TREE_TYPE(type1))) - error ("comparison of distinct block types (%qT and %qT)", - type0, type1); - result_type = type0; - } - else if (code0 == BLOCK_POINTER_TYPE && code1 == INTEGER_TYPE) - { - result_type = type0; - error ("comparison between pointer and integer (%qT and %qT)", - type0, type1); - } - else if (code0 == INTEGER_TYPE && code1 == BLOCK_POINTER_TYPE) - { - result_type = type1; - error ("comparison between integer and pointer (%qT and %qT)", - type0, type1); - } /* APPLE LOCAL end radar 5732232 - blocks (C++ cl) */ break; Modified: llvm-gcc-4.2/trunk/gcc/c.opt URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c.opt?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/c.opt (original) +++ llvm-gcc-4.2/trunk/gcc/c.opt Tue Sep 2 17:20:12 2008 @@ -236,9 +236,11 @@ C ObjC C++ ObjC++ Var(warn_format_nonliteral) Warn about format strings that are not literals +; APPLE LOCAL begin default to Wformat-security 5764921 Wformat-security -C ObjC C++ ObjC++ Var(warn_format_security) +C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warn about possible security problems with format functions +; APPLE LOCAL end default to Wformat-security 5764921 Wformat-y2k C ObjC C++ ObjC++ Var(warn_format_y2k) @@ -360,9 +362,11 @@ C++ ObjC++ Var(warn_nonvdtor) Warn about non-virtual destructors +; APPLE LOCAL begin turn on for C++/Objective-C++ Wnonnull -C ObjC Var(warn_nonnull) +C ObjC C++ ObjC++ Var(warn_nonnull) Warn about NULL being passed to argument slots marked as requiring non-NULL +; APPLE LOCAL end turn on for C++/Objective-C++ Wnormalized= C ObjC C++ ObjC++ Joined @@ -769,6 +773,12 @@ Enable Objective-C new property syntax and semantics ; APPLE LOCAL end objc new property - not for merge to the FSF +; APPLE LOCAL begin radar 5435299 +fnew-property-ivar-synthesis +ObjC ObjC++ Var(flag_new_property_ivar_synthesis) Init(0) +Enable new style of fragile-ivar synthesis for properties +; APPLE LOCAL end radar 5435299 + ; APPLE LOCAL begin radar 4810609 fobjc-gc-only ObjC ObjC++ Var(flag_objc_gc_only) Init(0) Modified: llvm-gcc-4.2/trunk/gcc/calls.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/calls.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/calls.c (original) +++ llvm-gcc-4.2/trunk/gcc/calls.c Tue Sep 2 17:20:12 2008 @@ -910,7 +910,9 @@ bytes -= bitsize / BITS_PER_UNIT; store_bit_field (reg, bitsize, endian_correction, word_mode, - word); + /* APPLE LOCAL begin 6020402 */ + word, NULL_TREE); + /* APPLE LOCAL end 6020402 */ } } } Modified: llvm-gcc-4.2/trunk/gcc/config/i386/i386.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/i386.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/i386/i386.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/i386/i386.c Tue Sep 2 17:20:12 2008 @@ -5837,13 +5837,20 @@ gcc_assert (style); r11 = gen_rtx_REG (DImode, FIRST_REX_INT_REG + 3 /* R11 */); insn = emit_insn (gen_rtx_SET (DImode, r11, offset)); - if (style < 0) + /* APPLE LOCAL async unwind info 5949469 */ + if (style < 0 || flag_asynchronous_unwind_tables) RTX_FRAME_RELATED_P (insn) = 1; insn = emit_insn (gen_pro_epilogue_adjust_stack_rex64_2 (dest, src, r11, offset)); } if (style < 0) RTX_FRAME_RELATED_P (insn) = 1; + /* APPLE LOCAL begin async unwind info 5949350 5949469 */ + else if (flag_asynchronous_unwind_tables + && (src == hard_frame_pointer_rtx + || src == stack_pointer_rtx)) + RTX_FRAME_RELATED_P (insn) = 1; + /* APPLE LOCAL end async unwind info 5949350 5949469 */ } /* Handle the TARGET_INTERNAL_ARG_POINTER hook. */ @@ -6278,7 +6285,13 @@ /* If not an i386, mov & pop is faster than "leave". */ else if (TARGET_USE_LEAVE || optimize_size || !cfun->machine->use_fast_prologue_epilogue) - emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ()); + /* APPLE LOCAL begin async unwind info 5949350 */ + { + rtx insn = emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ()); + if (flag_asynchronous_unwind_tables) + RTX_FRAME_RELATED_P (insn) = 1; + } + /* APPLE LOCAL end async unwind info 5949350 */ else { pro_epilogue_adjust_stack (stack_pointer_rtx, @@ -6318,7 +6331,13 @@ /* Leave results in shorter dependency chains on CPUs that are able to grok it fast. */ if (TARGET_USE_LEAVE) - emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ()); + /* APPLE LOCAL begin async unwind info 5949350 */ + { + rtx insn = emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ()); + if (flag_asynchronous_unwind_tables) + RTX_FRAME_RELATED_P (insn) = 1; + } + /* APPLE LOCAL end async unwind info 5949350 */ else if (TARGET_64BIT) emit_insn (gen_popdi1 (hard_frame_pointer_rtx)); else Modified: llvm-gcc-4.2/trunk/gcc/cp/call.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/call.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/call.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/call.c Tue Sep 2 17:20:12 2008 @@ -708,7 +708,7 @@ if (c_dialect_objc ()) nfrom = objc_non_volatilized_type (nfrom); from = build_pointer_type - (cp_build_qualified_type (void_type_node, + (cp_build_qualified_type (void_type_node, cp_type_quals (nfrom))); /* APPLE LOCAL end radar 4451818 */ conv = build_conv (ck_ptr, from, conv); @@ -758,8 +758,8 @@ && COMPLETE_TYPE_P (TREE_TYPE (from))) { /* APPLE LOCAL begin radar 4668465 */ - tree fr = c_dialect_objc () ? - objc_non_volatilized_type (TREE_TYPE (from)) + tree fr = c_dialect_objc () ? + objc_non_volatilized_type (TREE_TYPE (from)) : TREE_TYPE (from); from = cp_build_qualified_type (TREE_TYPE (to), @@ -3576,11 +3576,10 @@ /* APPLE LOCAL begin blocks 6040305 (co) */ && (TYPE_PTR_P (arg2_type) || TYPE_PTR_TO_MEMBER_P (arg2_type) || TREE_CODE (arg2_type) == BLOCK_POINTER_TYPE)) - /* APPLE LOCAL end blocks 6040305 (co) */ - || (TYPE_PTR_P (arg2_type) && TYPE_PTR_P (arg3_type)) - /* APPLE LOCAL begin blocks 6040305 (co) */ - || (TREE_CODE (arg2_type) == BLOCK_POINTER_TYPE - && TREE_CODE (arg3_type) == BLOCK_POINTER_TYPE) + || ((TYPE_PTR_P (arg2_type) + || TREE_CODE (arg2_type) == BLOCK_POINTER_TYPE) + && (TYPE_PTR_P (arg3_type) + || TREE_CODE (arg3_type) == BLOCK_POINTER_TYPE)) /* APPLE LOCAL end blocks 6040305 (co) */ || (TYPE_PTRMEM_P (arg2_type) && TYPE_PTRMEM_P (arg3_type)) || (TYPE_PTRMEMFUNC_P (arg2_type) && TYPE_PTRMEMFUNC_P (arg3_type))) Modified: llvm-gcc-4.2/trunk/gcc/cp/decl.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl.c Tue Sep 2 17:20:12 2008 @@ -2475,11 +2475,11 @@ /* FIXME finish this off. */ struct c_scope *scope; struct c_binding *b; - + gcc_assert (current_scope); if (flag_objc_gc_only || !current_scope->byref_in_current_scope) return; - + scope = current_scope; while (scope && scope != file_scope) { @@ -2496,7 +2496,7 @@ } #endif } -/* APPLE LOCAL begin blocks 6040305 (cp) */ +/* APPLE LOCAL end blocks 6040305 (cp) */ /* Check that a new jump to a label DECL is OK. Called by finish_goto_stmt. */ @@ -4848,6 +4848,14 @@ which reshape_init exists). */ if (!first_initializer_p) { + /* APPLE LOCAL begin 6052773 */ + if (init == error_mark_node) + { + ++d->cur; + return init; + } + /* APPLE LOCAL end 6052773 */ + if (TREE_CODE (init) == CONSTRUCTOR) { if (TREE_TYPE (init) && TYPE_PTRMEMFUNC_P (TREE_TYPE (init))) @@ -5313,6 +5321,339 @@ return false; } +/* APPLE LOCAL begin blocks 6040305 (cr) */ +static tree block_byref_id_object_copy; +static tree block_byref_id_object_dispose; + +/** + This routine builds: + + void __Block_byref_id_object_copy(struct Block_byref_id_object *dst, + struct Block_byref_id_object *src) { + dst->object = [src->object retain]; + } */ +static void +synth_block_byref_id_object_copy_func (void) +{ + tree stmt; + tree dst_arg, src_arg; + tree dst_obj, src_obj; + + gcc_assert (block_byref_id_object_copy); + /* Set up: (void* _dest, void*_src) parameters. */ + dst_arg = build_decl (PARM_DECL, get_identifier ("_dst"), + ptr_type_node); + TREE_USED (dst_arg) = 1; + DECL_ARG_TYPE (dst_arg) = ptr_type_node; + src_arg = build_decl (PARM_DECL, get_identifier ("_src"), + ptr_type_node); + TREE_USED (src_arg) = 1; + DECL_ARG_TYPE (src_arg) = ptr_type_node; + /* arg_info = xcalloc (1, sizeof (struct c_arg_info)); */ + TREE_CHAIN (dst_arg) = src_arg; + /* arg_info->parms = dst_arg; */ + /* arg_info->types = tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, + ptr_type_node, + NULL_TREE)); */ + DECL_ARGUMENTS (block_byref_id_object_copy) = dst_arg; + /* function header synthesis. */ + push_function_context (); + /* start_block_helper_function (block_byref_id_object_copy, true); */ + /* store_parm_decls_from (arg_info); */ + start_preparsed_function (block_byref_id_object_copy, + /*attrs*/NULL_TREE, + SF_PRE_PARSED); + + /* Body of the function. */ + stmt = begin_compound_stmt (BCS_FN_BODY); + /* Build dst->object */ + dst_obj = build_indirect_object_id_exp (dst_arg); + + + /* src_obj is: _src->object. */ + src_obj = build_indirect_object_id_exp (src_arg); + /* APPLE LOCAL begin radar 6180456 */ + if (c_dialect_objc ()) + { + tree retain_exp = retain_block_component (src_obj); + + /* dst->object = [src->object retain]; */ + tree store = build_modify_expr (dst_obj, NOP_EXPR, retain_exp); + add_stmt (store); + } + else + { + /* _Block_byref_assign_copy(&_dest->object, _src->object) */ + tree func_params = tree_cons (NULL_TREE, build_fold_addr_expr (dst_obj), + tree_cons (NULL_TREE, src_obj, + NULL_TREE)); + tree call_exp = build_function_call (build_block_byref_assign_copy_decl (), func_params); + add_stmt (call_exp); + } + /* APPLE LOCAL end radar 6180456 */ + + finish_compound_stmt (stmt); + finish_function (0); + pop_function_context (); +} + +/** + This routine builds: + + void __Block_byref_id_object_dispose(struct Block_byref_id_object *_src) { + [_src->object release]; // objective-c++ or: + _Block_byref_release(_src->object) // c++ language + } */ +static void synth_block_byref_id_object_dispose_func (void) +{ + tree stmt; + tree src_arg, src_obj, rel_exp; + + gcc_assert (block_byref_id_object_dispose); + /* Set up: (void *_src) parameter. */ + src_arg = build_decl (PARM_DECL, get_identifier ("_src"), + ptr_type_node); + TREE_USED (src_arg) = 1; + DECL_ARG_TYPE (src_arg) = ptr_type_node; + /* arg_info = xcalloc (1, sizeof (struct c_arg_info)); + arg_info->parms = src_arg; + arg_info->types = tree_cons (NULL_TREE, ptr_type_node, + NULL_TREE); */ + DECL_ARGUMENTS (block_byref_id_object_dispose) = src_arg; + /* function header synthesis. */ + push_function_context (); + /* start_block_helper_function (block_byref_id_object_dispose, true); */ + /* store_parm_decls_from (arg_info); */ + start_preparsed_function (block_byref_id_object_dispose, + /*attrs*/NULL_TREE, + SF_PRE_PARSED); + + /* Body of the function. */ + stmt = begin_compound_stmt (BCS_FN_BODY); + src_obj = build_indirect_object_id_exp (src_arg); + + /* APPLE LOCAL begin radar 6180456 */ + if (c_dialect_objc ()) + /* [_src->object release]; */ + rel_exp = release_block_component (src_obj); + else + { + /* _Block_byref_release(_src->object) */ + tree func_params = tree_cons (NULL_TREE, src_obj, NULL_TREE); + rel_exp = build_function_call (build_block_byref_release_decl (), func_params); + } + /* APPLE LOCAL end radar 6180456 */ + add_stmt (rel_exp); + + finish_compound_stmt (stmt); + finish_function (0); + pop_function_context (); +} + +static tree +block_start_struct (tree name) +{ + tree s; + /* The idea here is to mimic the actions that the C++ parser takes when + constructing 'extern "C" struct NAME {'. */ + push_lang_context (lang_name_c); + + s = xref_tag (record_type, name, ts_global, 0); + CLASSTYPE_DECLARED_CLASS (s) = 0; /* this is a 'struct', not a 'class'. */ + xref_basetypes (s, NULL_TREE); /* no base classes here! */ + + return begin_class_definition (s, NULL_TREE); +} + +static tree +block_finish_struct (tree t, tree fieldlist) +{ + tree field, next_field; + + for (field = fieldlist; field; field = next_field) + { + next_field = TREE_CHAIN (field); /* insert one field at a time; */ + TREE_CHAIN (field) = NULL_TREE; /* otherwise, grokfield croaks. */ + finish_member_declaration (field); + } + t = finish_struct (t, NULL); + pop_lang_context (); + + return t; +} + +/* new_block_byref_decl - This routine changes a 'typex x' declared variable into: + + struct __Block_byref_x { + struct Block_byref_x *forwarding; + int32_t flags; + int32_t size; + void *ByrefKeepFuncPtr; // Only if variable is __byref ObjC object + void *ByrefDestroyFuncPtr; // Only if variable is __byref ObjC object + typex x; + } x; +*/ + +static tree +new_block_byref_decl (tree decl) +{ + static int unique_count; + tree Block_byref_type; + tree fields = NULL_TREE, field; + const char *prefix = "__Block_byref_"; + char *string = (char*)alloca (strlen (IDENTIFIER_POINTER (DECL_NAME (decl))) + + strlen (prefix) + 8 /* to hold the count */); + + sprintf (string, "%s%d_%s", prefix, ++unique_count, + IDENTIFIER_POINTER (DECL_NAME (decl))); + + push_to_top_level (); + /* Block_byref_type = start_struct (RECORD_TYPE, get_identifier (string)); */ + Block_byref_type = block_start_struct (get_identifier (string)); + + /* struct Block_byref_x *forwarding; */ + field = build_decl (FIELD_DECL, get_identifier ("forwarding"), + build_pointer_type (Block_byref_type)); + fields = field; + + /* int32_t flags; */ + field = build_decl (FIELD_DECL, get_identifier ("flags"), + unsigned_type_node); + chainon (fields, field); + + /* int32_t size; */ + field = build_decl (FIELD_DECL, get_identifier ("size"), + unsigned_type_node); + chainon (fields, field); + + if (COPYABLE_BYREF_LOCAL_NONPOD (decl)) + { + /* void *ByrefKeepFuncPtr; */ + field = build_decl (FIELD_DECL, get_identifier ("ByrefKeepFuncPtr"), + ptr_type_node); + chainon (fields, field); + + /* void *ByrefDestroyFuncPtr; */ + field = build_decl (FIELD_DECL, get_identifier ("ByrefDestroyFuncPtr"), + ptr_type_node); + chainon (fields, field); + } + + /* typex x; */ + field = build_decl (FIELD_DECL, DECL_NAME (decl), TREE_TYPE (decl)); + chainon (fields, field); + + /* finish_struct (Block_byref_type, field_decl_chain, NULL_TREE); */ + block_finish_struct (Block_byref_type, fields); + pop_from_top_level (); + + TREE_TYPE (decl) = Block_byref_type; + /* Force layout_decl to recompute these fields. */ + DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0; + layout_decl (decl, 0); + return decl; +} + +/* init_byref_decl - This routine builds the initializer for the __Block_byref_x + type in the form of: + { &x, 0, sizeof(struct __Block_byref_x), initializer-expr}; + + or: + { &x, 0, sizeof(struct __Block_byref_x)}; + when INIT is NULL_TREE + + For __byref ObjC objects, it also adds "byref_keep" and "byref_destroy" + Funtion pointers. So the most general initializers would be: + + { &x, 0, sizeof(struct __Block_byref_x), &byref_keep, &byref_destroy, + &initializer-expr}; + */ +static tree +init_byref_decl (tree decl, tree init) +{ + tree initlist; + tree block_byref_type = TREE_TYPE (decl); + int size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (block_byref_type)); + unsigned flags = 0; + tree fields; + + if (COPYABLE_BYREF_LOCAL_NONPOD (decl)) + flags = BLOCK_HAS_COPY_DISPOSE; + + fields = TYPE_FIELDS (block_byref_type); + initlist = tree_cons (fields, + build_unary_op (ADDR_EXPR, decl, 0), 0); + fields = TREE_CHAIN (fields); + + initlist = tree_cons (fields, build_int_cst (TREE_TYPE (fields), flags), + initlist); + fields = TREE_CHAIN (fields); + initlist = tree_cons (fields, build_int_cst (TREE_TYPE (fields), size), + initlist); + fields = TREE_CHAIN (fields); + + if (COPYABLE_BYREF_LOCAL_NONPOD (decl)) + { + char name [64]; + /* Add &__Block_byref_id_object_copy, &__Block_byref_id_object_dispose + initializers. */ + if (!block_byref_id_object_copy) + { + tree func_type; + push_lang_context (lang_name_c); + /* Build a void __Block_byref_id_object_copy(void*, void*) type. */ + func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, + tree_cons (NULL_TREE, ptr_type_node, + void_list_node))); + strcpy (name, "__Block_byref_id_object_copy"); + block_byref_id_object_copy = build_helper_func_decl (get_identifier (name), + func_type); + DECL_CONTEXT (block_byref_id_object_copy) = current_function_decl; + /* Synthesize function definition. */ + synth_block_byref_id_object_copy_func (); + pop_lang_context (); + } + initlist = tree_cons (fields, + build_fold_addr_expr (block_byref_id_object_copy), + initlist); + fields = TREE_CHAIN (fields); + + if (!block_byref_id_object_dispose) + { + tree func_type; + push_lang_context (lang_name_c); + /* Synthesize void __Block_byref_id_object_dispose (void*) and + build &__Block_byref_id_object_dispose. */ + func_type = + build_function_type (void_type_node, + tree_cons (NULL_TREE, ptr_type_node, void_list_node)); + strcpy (name, "__Block_byref_id_object_dispose"); + block_byref_id_object_dispose = build_helper_func_decl (get_identifier (name), + func_type); + DECL_CONTEXT (block_byref_id_object_dispose) = current_function_decl; + /* Synthesize function definition. */ + synth_block_byref_id_object_dispose_func (); + pop_lang_context (); + } + initlist = tree_cons (fields, + build_fold_addr_expr (block_byref_id_object_dispose), + initlist); + fields = TREE_CHAIN (fields); + } + + if (init) + { + init = digest_init (TREE_TYPE (fields), init); + initlist = tree_cons (fields, init, initlist); + } + init = build_constructor_from_list (block_byref_type, nreverse (initlist)); + return init; +} +/* APPLE LOCAL end blocks 6040305 (cr) */ + /* Finish processing of a declaration; install its line number and initial value. If the length of an array type is not known before, @@ -5448,6 +5789,25 @@ if (DECL_THREAD_LOCAL_P (decl) && !pod_type_p (TREE_TYPE (decl))) error ("%qD cannot be thread-local because it has non-POD type %qT", decl, TREE_TYPE (decl)); + /* APPLE LOCAL begin blocks 6040305 (cq) */ + if (COPYABLE_BYREF_LOCAL_VAR (decl)) { + if (DECL_EXTERNAL (decl) || TREE_STATIC (decl)) + { + warning (0, + "__byref attribute is only allowed on local variables - ignored"); + COPYABLE_BYREF_LOCAL_VAR (decl) = 0; + COPYABLE_BYREF_LOCAL_NONPOD (decl) = 0; + } + else + { + decl = new_block_byref_decl (decl); + if (! flag_objc_gc_only) + push_cleanup (decl, build_block_byref_release_exp (decl), false); + init = init_byref_decl (decl, init); + } + } + /* APPLE LOCAL end blocks 6040305 (cq) */ + /* If this is a local variable that will need a mangled name, register it now. We must do this before processing the initializer for the variable, since the initialization might @@ -5916,7 +6276,7 @@ /* APPLE LOCAL begin radar 5733674 */ if (c_dialect_objc () && flag_objc_gc && init && TREE_CODE (init) == INIT_EXPR) { - tree result = objc_generate_write_barrier (TREE_OPERAND (init, 0), + tree result = objc_generate_write_barrier (TREE_OPERAND (init, 0), INIT_EXPR, TREE_OPERAND (init, 1)); if (result) init = result; Modified: llvm-gcc-4.2/trunk/gcc/cp/decl2.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/decl2.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/decl2.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/decl2.c Tue Sep 2 17:20:12 2008 @@ -1895,7 +1895,9 @@ if (subvis == VISIBILITY_ANON) /* LLVM LOCAL begin - Fix for GCC PR c++/29365 */ { +#ifdef ENABLE_LLVM if (!in_main_input_context ()) +#endif warning (0, "\ %qT has a field %qD whose type uses the anonymous namespace", type, t); @@ -1917,7 +1919,9 @@ if (subvis == VISIBILITY_ANON) /* LLVM LOCAL begin - Fix for GCC PR c++/29365 */ { +#ifdef ENABLE_LLVM if (!in_main_input_context()) +#endif warning (0, "\ %qT has a base %qT whose type uses the anonymous namespace", type, TREE_TYPE (t)); Modified: llvm-gcc-4.2/trunk/gcc/cp/parser.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/parser.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/parser.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/parser.c Tue Sep 2 17:20:12 2008 @@ -20496,15 +20496,14 @@ tree build_component_ref (tree e, tree member) { - /* See declare_block_prologue_local_vars for code to find - FIELD_DECLs, if the below doesn't work. */ + if (!DECL_P (member)) + member = lookup_member (TREE_TYPE (e), member, 0, 0); return build_class_member_access_expr (e, member, NULL_TREE, false); } static tree block_copy_assign_decl; static tree block_destroy_decl; -static tree block_byref_assign_copy_decl; /** build_block_struct_type - struct block_1 { @@ -20614,8 +20613,8 @@ /** build_block_struct_initlist - builds the initializer list: - { &_NSConcreteStackBlock // isa, - BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE // flags, + { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa, + BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags, sizeof(struct block_1), helper_1 }, copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE @@ -20633,6 +20632,7 @@ tree helper_addr, chain, fields; unsigned flags = 0; static tree NSConcreteStackBlock_decl = NULL_TREE; + static tree NSConcreteGlobalBlock_decl = NULL_TREE; if (block_impl->BlockHasCopyDispose) /* Note! setting of this flag merely indicates to the runtime that @@ -20646,23 +20646,48 @@ fields = TYPE_FIELDS (TREE_TYPE (invoke_impl_ptr_type)); - /* Find an existing declaration for _NSConcreteStackBlock or declare - extern void *_NSConcreteStackBlock; */ - if (NSConcreteStackBlock_decl == NULL_TREE) - { - tree name_id = get_identifier("_NSConcreteStackBlock"); - NSConcreteStackBlock_decl = lookup_name (name_id); - if (!NSConcreteStackBlock_decl) + if (!current_function_decl) + { + /* This is a global block. */ + /* Find an existing declaration for _NSConcreteGlobalBlock or declare + extern void *_NSConcreteGlobalBlock; */ + if (NSConcreteGlobalBlock_decl == NULL_TREE) { - NSConcreteStackBlock_decl = build_decl (VAR_DECL, name_id, ptr_type_node); - DECL_EXTERNAL (NSConcreteStackBlock_decl) = 1; - TREE_PUBLIC (NSConcreteStackBlock_decl) = 1; - pushdecl_top_level (NSConcreteStackBlock_decl); - rest_of_decl_compilation (NSConcreteStackBlock_decl, 0, 0); + tree name_id = get_identifier("_NSConcreteGlobalBlock"); + NSConcreteGlobalBlock_decl = lookup_name (name_id); + if (!NSConcreteGlobalBlock_decl) + { + NSConcreteGlobalBlock_decl = build_decl (VAR_DECL, name_id, ptr_type_node); + DECL_EXTERNAL (NSConcreteGlobalBlock_decl) = 1; + TREE_PUBLIC (NSConcreteGlobalBlock_decl) = 1; + pushdecl_top_level (NSConcreteGlobalBlock_decl); + rest_of_decl_compilation (NSConcreteGlobalBlock_decl, 0, 0); + } } + initlist = build_tree_list (fields, + build_fold_addr_expr (NSConcreteGlobalBlock_decl)); + flags |= BLOCK_IS_GLOBAL; + } + else + { + /* Find an existing declaration for _NSConcreteStackBlock or declare + extern void *_NSConcreteStackBlock; */ + if (NSConcreteStackBlock_decl == NULL_TREE) + { + tree name_id = get_identifier("_NSConcreteStackBlock"); + NSConcreteStackBlock_decl = lookup_name (name_id); + if (!NSConcreteStackBlock_decl) + { + NSConcreteStackBlock_decl = build_decl (VAR_DECL, name_id, ptr_type_node); + DECL_EXTERNAL (NSConcreteStackBlock_decl) = 1; + TREE_PUBLIC (NSConcreteStackBlock_decl) = 1; + pushdecl_top_level (NSConcreteStackBlock_decl); + rest_of_decl_compilation (NSConcreteStackBlock_decl, 0, 0); + } + } + initlist = build_tree_list (fields, + build_fold_addr_expr (NSConcreteStackBlock_decl)); } - initlist = build_tree_list (fields, - build_fold_addr_expr (NSConcreteStackBlock_decl)); fields = TREE_CHAIN (fields); initlist = tree_cons (fields, @@ -20675,6 +20700,7 @@ initlist); fields = TREE_CHAIN (fields); helper_addr = build_fold_addr_expr (block_impl->helper_func_decl); + /* mark_used (block_impl->helper_func_decl); */ helper_addr = convert (ptr_type_node, helper_addr); initlist = tree_cons (fields, helper_addr, initlist); gcc_assert (invoke_impl_ptr_type); @@ -20731,8 +20757,8 @@ 3) build the temporary initialization: struct block_1 I = { - { &_NSConcreteStackBlock // isa, - BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE // flags, + { &_NSConcreteStackBlock or &_NSConcreteGlobalBlock // isa, + BLOCK_NO_COPY | BLOCK_HAS_COPY_DISPOSE | BLOCK_IS_GLOBAL // flags, sizeof(struct block_1), helper_1 }, copy_helper_block_1, // only if block BLOCK_HAS_COPY_DISPOSE @@ -20774,6 +20800,12 @@ bind = build3 (BIND_EXPR, void_type_node, block_holder_tmp_decl, exp, NULL); TREE_SIDE_EFFECTS (bind) = 1; add_stmt (bind); + /* Temporary representing a global block is made global static. */ + if (global_bindings_p ()) { + TREE_PUBLIC (block_holder_tmp_decl) = 0; + TREE_STATIC (block_holder_tmp_decl) = 1; + finish_decl (block_holder_tmp_decl, constructor, NULL_TREE); + } return block_holder_tmp_decl; } @@ -20782,7 +20814,8 @@ { pop_function_context (); pop_lang_context (); - free (finish_block (block)); + if (current_function_decl) + free (finish_block (block)); return error_mark_node; } @@ -20889,32 +20922,19 @@ DECL_NAME (p)); /* _Block_byref_assign_copy(&_dest->myImportedClosure, _src->myImportedClosure) */ - /* Build a: void _Block_byref_assign_copy (void *, void *) if - not done already. */ - if (!block_byref_assign_copy_decl - && !(block_byref_assign_copy_decl - = lookup_name (get_identifier ("_Block_byref_assign_copy")))) - { - tree func_type - = build_function_type (void_type_node, - tree_cons (NULL_TREE, ptr_type_node, - tree_cons (NULL_TREE, ptr_type_node, void_list_node))); - - block_byref_assign_copy_decl - = builtin_function ("_Block_byref_assign_copy", func_type, - 0, NOT_BUILT_IN, 0, NULL_TREE); - TREE_NOTHROW (block_byref_assign_copy_decl) = 0; - } dst_block_component = build_fold_addr_expr (dst_block_component); func_params = tree_cons (NULL_TREE, dst_block_component, tree_cons (NULL_TREE, src_block_component, NULL_TREE)); - call_exp = build_function_call (block_byref_assign_copy_decl, func_params); + call_exp = build_function_call (build_block_byref_assign_copy_decl (), func_params); add_stmt (call_exp); } finish_compound_stmt (stmt); finish_function (0); + /* Hum, would be nice if someone else did this for us. */ + if (global_bindings_p ()) + cgraph_finalize_function (block_impl->copy_helper_func_decl, false); pop_function_context (); /* free (arg_info); */ } @@ -21011,6 +21031,9 @@ finish_compound_stmt (stmt); finish_function (0); + /* Hum, would be nice if someone else did this for us. */ + if (global_bindings_p ()) + cgraph_finalize_function (block_impl->destroy_helper_func_decl, false); pop_function_context (); } @@ -21036,7 +21059,6 @@ tree restype, resdecl; tree typelist; tree helper_function_type; - bool at_file_scope = global_bindings_p (); tree block; cp_lexer_consume_token (parser->lexer); /* eat '^' */ @@ -21105,13 +21127,14 @@ /* Build the declaration of the helper function (we do not know its result type yet, so assume it is 'void'). Treat this as a nested function and use nested function infrastructure for its generation. */ - sprintf (name, "__helper_%d", unique_count); push_lang_context (lang_name_c); ftype = build_function_type (void_type_node, arg_type); - block_helper_function_decl = build_helper_func_decl (get_identifier (name), + /* APPLE LOCAL radar 6160536 */ + block_helper_function_decl = build_helper_func_decl (build_block_helper_name (unique_count), ftype); - DECL_NO_STATIC_CHAIN (current_function_decl) = 0; + if (current_function_decl) + DECL_NO_STATIC_CHAIN (current_function_decl) = 0; DECL_CONTEXT (block_helper_function_decl) = current_function_decl; BLOCK_HELPER_FUNC (block_helper_function_decl) = 1; cur_block->helper_func_decl = block_helper_function_decl; @@ -21126,10 +21149,6 @@ /*attrs*/NULL_TREE, SF_PRE_PARSED); - /* Set block's scope to the scope of the helper function's main body. - This is primarily used when nested blocks are declared. */ - cur_block->cp_the_scope = current_binding_level; - /* Start parsing body or expression part of the block literal. */ { unsigned save = parser->in_statement; @@ -21137,6 +21156,9 @@ emit the proper error message in c_finish_bc_stmt. */ parser->in_statement = 0; stmt = begin_compound_stmt (BCS_FN_BODY); + /* Set block's scope to the scope of the helper function's main body. + This is primarily used when nested blocks are declared. */ + cur_block->cp_the_scope = current_binding_level; cp_parser_compound_statement (parser, NULL, false, false); parser->in_statement = save; } @@ -21146,11 +21168,6 @@ restype = !cur_block->return_type ? void_type_node : cur_block->return_type; - if (at_file_scope) - { - error ("block literal cannot be declared at global scope"); - return clean_and_exit (block); - } if (restype == error_mark_node) return clean_and_exit (block); @@ -21169,8 +21186,32 @@ finish_compound_stmt (stmt); /* add_stmt (fnbody); */ + + /* We are done parsing of the block body. Return type of block is now known. + We also know all we need to know about the helper function. So, fix its + type here. */ + /* We moved this here because for global blocks, helper function body is + not nested and is gimplified in call to finish_function() and return type + of the function must be correct. */ + ftype = build_function_type (restype, TREE_CHAIN (arg_type)); + /* Declare helper function; as in: + double helper_1(struct block_1 *ii, int z); */ + typelist = TYPE_ARG_TYPES (ftype); + /* (struct block_1 *ii, int z, ...) */ + typelist = tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, + typelist); + helper_function_type = build_function_type (TREE_TYPE (ftype), typelist); + TREE_TYPE (cur_block->helper_func_decl) = helper_function_type; + /* Let tree builder know that we are done analyzing block's return type so it + does not do it twice (and produce bad return expression tree). This case is + for global blocks as finish_function () for them builds AST for the entire + body of the function. */ + cur_block->block_is_complete = true; finish_function (0); pop_function_context (); + /* Hum, would be nice if someone else did this for us. */ + if (global_bindings_p ()) + cgraph_finalize_function (cur_block->helper_func_decl, false); pop_lang_context (); /* Build the declaration for copy_helper_block and destroy_helper_block @@ -21178,15 +21219,19 @@ if (cur_block->BlockHasCopyDispose) { + tree s_ftype; + + push_lang_context (lang_name_c); /* void copy_helper_block (struct block*, struct block *); */ - tree s_ftype = build_function_type (void_type_node, - tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, - tree_cons (NULL_TREE, - cur_block->block_arg_ptr_type, - void_list_node))); + s_ftype = build_function_type (void_type_node, + tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, + tree_cons (NULL_TREE, + cur_block->block_arg_ptr_type, + void_list_node))); sprintf (name, "__copy_helper_block_%d", unique_count); cur_block->copy_helper_func_decl = build_helper_func_decl (get_identifier (name), s_ftype); + DECL_CONTEXT (cur_block->copy_helper_func_decl) = current_function_decl; synth_copy_helper_block_func (cur_block); /* void destroy_helper_block (struct block*); */ @@ -21196,23 +21241,11 @@ sprintf (name, "__destroy_helper_block_%d", unique_count); cur_block->destroy_helper_func_decl = build_helper_func_decl (get_identifier (name), s_ftype); + DECL_CONTEXT (cur_block->destroy_helper_func_decl) = current_function_decl; synth_destroy_helper_block_func (cur_block); + pop_lang_context (); } - - /* We are out of helper function scope and back in its enclosing scope. - We also know all we need to know about the helper function. So, fix its - type here. */ - ftype = build_function_type (restype, TREE_CHAIN (arg_type)); - /* Declare helper function; as in: - double helper_1(struct block_1 *ii, int z); */ - typelist = TYPE_ARG_TYPES (ftype); - /* (struct block_1 *ii, int z, ...) */ - typelist = tree_cons (NULL_TREE, cur_block->block_arg_ptr_type, - typelist); - helper_function_type = build_function_type (TREE_TYPE (ftype), typelist); - TREE_TYPE (cur_block->helper_func_decl) = helper_function_type; - block_impl = finish_block (block); /* Build unqiue name of the temporary used in code gen. */ @@ -21265,6 +21298,7 @@ /* Current scope must be that of the main function body. */ /* FIXME gcc_assert (current_scope->function_body);*/ pushdecl (byref_decl); + mark_used (byref_decl); /* APPLE LOCAL begin radar 6083129 - byref escapes (cp) */ /* FIXME: finish this off, ensure the decl is scoped appropriately for when we want the cleanup to run. */ @@ -21275,6 +21309,10 @@ tree_cons (NULL_TREE, byref_decl, cur_block->block_byref_decl_list); cur_block->block_original_byref_decl_list = tree_cons (NULL_TREE, exp, cur_block->block_original_byref_decl_list); + /* APPLE LOCAL begin radar 6144664 */ + DECL_SOURCE_LOCATION (byref_decl) + = DECL_SOURCE_LOCATION (cur_block->helper_func_decl); + /* APPLE LOCAL end radar 6144664 */ return byref_decl; } @@ -21289,6 +21327,8 @@ tree build_block_ref_decl (tree name, tree decl) { + /* FIXME - Broken, should be found via objc runtime testcases. */ + /* FIXME - Don't use DECL_CONTEXT on any helpers */ tree ref_decl; /* 'decl' was previously declared as __block. Simply, copy the value embedded in the above variable. */ @@ -21296,13 +21336,13 @@ decl = build_byref_local_var_access (decl, DECL_NAME (decl)); else { if (cur_block->prev_block_info) { - /* Traverse enclosing blocks. Insert a copied-in variable in each - enclosing block which has no declaration of this variable. This is - to ensure that the current (inner) block has the 'frozen' value of the - copied-in variable; which means the value of the copied in variable - is at the point of the block declaration and *not* when the inner block - is invoked. - */ + /* Traverse enclosing blocks. Insert a copied-in variable in + each enclosing block which has no declaration of this + variable. This is to ensure that the current (inner) block + has the 'frozen' value of the copied-in variable; which means + the value of the copied in variable is at the point of the + block declaration and *not* when the inner block is + invoked. */ struct block_sema_info *cb = cur_block->prev_block_info; while (cb) { struct cxx_binding *b = I_SYMBOL_BINDING (name); @@ -21355,6 +21395,10 @@ ref_decl = build_decl (VAR_DECL, name, build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_CONST)); + /* APPLE LOCAL begin radar 6144664 */ + DECL_SOURCE_LOCATION (ref_decl) = DECL_SOURCE_LOCATION + (cur_block->helper_func_decl); + /* APPLE LOCAL end radar 6144664 */ DECL_CONTEXT (ref_decl) = current_function_decl; DECL_INITIAL (ref_decl) = error_mark_node; c_apply_type_quals_to_decl (TYPE_QUAL_CONST, ref_decl); @@ -21468,6 +21512,8 @@ bool lookup_name_in_block (tree name, tree *decl) { + /* FIXME - Broken, should be found via objc runtime testcases. */ + /* FIXME - Don't use DECL_CONTEXT on any helpers */ cxx_binding *b = I_SYMBOL_BINDING (name); if (b && b->declared_in_block && DECL_CONTEXT (BINDING_VALUE (b)) == current_function_decl) @@ -21500,6 +21546,8 @@ TREE_PUBLIC (func_decl) = 0; TREE_USED (func_decl) = 1; TREE_NOTHROW (func_decl) = 0; + /* APPLE LOCAL radar 6172148 */ + BLOCK_SYNTHESIZED_FUNC (func_decl) = 1; retrofit_lang_decl (func_decl); return func_decl; } @@ -21517,10 +21565,8 @@ tree decl_stmt; decl = component; - component = lookup_member (TREE_TYPE (TREE_TYPE (self_parm)), - DECL_NAME (component), 0, 0); block_component = build_component_ref (build_indirect_ref (self_parm, "->"), - component); + DECL_NAME (component)); gcc_assert (block_component); DECL_EXTERNAL (decl) = 0; TREE_STATIC (decl) = 0; @@ -21532,6 +21578,9 @@ i = tsi_start (stmt); decl_stmt = build_stmt (DECL_EXPR, decl); SET_EXPR_LOCATION (decl_stmt, DECL_SOURCE_LOCATION (decl)); + decl_stmt = build3 (BIND_EXPR, void_type_node, decl, decl_stmt, NULL); + TREE_SIDE_EFFECTS (decl_stmt) = 1; + tsi_link_before (&i, decl_stmt, TSI_SAME_STMT); } Modified: llvm-gcc-4.2/trunk/gcc/cp/semantics.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/semantics.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/semantics.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/semantics.c Tue Sep 2 17:20:12 2008 @@ -774,11 +774,11 @@ expr = check_return_expr (expr, &no_warning); - /* APPLE LOCAL begin radar 6040305 - blocks */ + /* APPLE LOCAL begin blocks 6040305 */ if (current_function_decl && BLOCK_HELPER_FUNC (current_function_decl) && !cur_block) return expr; - /* APPLE LOCAL end radar 6040305 - blocks */ + /* APPLE LOCAL end blocks 6040305 */ if (flag_openmp && !check_omp_return ()) return error_mark_node; @@ -2942,12 +2942,10 @@ (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL)); gdecl = (TREE_CODE (decl) == VAR_DECL && - (DECL_EXTERNAL (decl) - || (TREE_STATIC (decl) - && (!DECL_CONTEXT (decl) - || DECL_NAMESPACE_SCOPE_P (decl))))); + (DECL_EXTERNAL (decl) || TREE_STATIC (decl))); /* Treat all 'global' variables as 'byref' by default. */ - if (gdecl) + if (gdecl + || (TREE_CODE (decl) == VAR_DECL && COPYABLE_BYREF_LOCAL_VAR (decl))) { /* byref globals are directly accessed. */ if (!gdecl) @@ -4073,7 +4071,12 @@ struct block_sema_info *csi; tree block; /* push_scope (); */ + current_stmt_tree ()->stmts_are_full_exprs_p = 1; +#if 0 block = do_pushlevel (sk_block); +#else + block = NULL_TREE; +#endif csi = (struct block_sema_info*)xcalloc (1, sizeof (struct block_sema_info)); csi->prev_block_info = cur_block; cur_block = csi; @@ -4086,7 +4089,12 @@ struct block_sema_info *csi = cur_block; cur_block = cur_block->prev_block_info; /* pop_scope (); */ - do_poplevel (block); +#if 0 + if (block) + do_poplevel (block); +#else + block = 0; +#endif return csi; } /* APPLE LOCAL end blocks 6040305 (ch) */ Modified: llvm-gcc-4.2/trunk/gcc/cp/typeck.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/cp/typeck.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/cp/typeck.c (original) +++ llvm-gcc-4.2/trunk/gcc/cp/typeck.c Tue Sep 2 17:20:12 2008 @@ -57,7 +57,8 @@ static bool casts_away_constness (tree, tree); static void maybe_warn_about_returning_address_of_local (tree); static tree lookup_destructor (tree, tree, tree); -static tree convert_arguments (tree, tree, tree, int); +/* APPLE LOCAL radar 6087117 */ +static tree convert_arguments (tree, tree, tree, int, int); /* Do `exp = require_complete_type (exp);' to make sure exp does not have an incomplete type. (That includes void types.) @@ -454,8 +455,13 @@ result_type = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1), result_type); } + /* APPLE LOCAL begin blocks 6065211 */ + else if (TREE_CODE (t1) == BLOCK_POINTER_TYPE + && result_type != void_type_node) + result_type = build_block_pointer_type (result_type); else result_type = build_pointer_type (result_type); + /* APPLE LOCAL end blocks 6065211 */ /* Merge the attributes. */ attributes = (*targetm.merge_type_attributes) (t1, t2); @@ -575,6 +581,14 @@ return error_mark_node; } } + /* APPLE LOCAL begin blocks 6065211 */ + else if (TREE_CODE (t1) != TREE_CODE (t2)) + { + error ("%s between distinct pointer types %qT and %qT " + "lacks a cast", location, t1, t2); + return error_mark_node; + } + /* APPLE LOCAL end blocks 6065211 */ return composite_pointer_type_r (t1, t2, location); } @@ -1041,15 +1055,15 @@ if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) return false; break; - + /* APPLE LOCAL begin blocks 6040305 */ case BLOCK_POINTER_TYPE: if (TREE_CODE (t2) == BLOCK_POINTER_TYPE) { tree pt1 = TREE_TYPE (t1); tree pt2 = TREE_TYPE (t2); - if (!same_type_ignoring_top_level_qualifiers_p ( - TREE_TYPE (pt1), TREE_TYPE (pt2))) + if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (pt1), + TREE_TYPE (pt2))) return false; if (!compparms (TYPE_ARG_TYPES (pt1), TYPE_ARG_TYPES (pt2))) return false; @@ -1064,7 +1078,7 @@ || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) return false; break; - + case METHOD_TYPE: case FUNCTION_TYPE: if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) @@ -2747,7 +2761,7 @@ return function; } -/* APPLE LOCAL begin blocks 6040305 */ +/* APPLE LOCAL begin blocks 6040305 (cm) */ /** build_block_call - Routine to build a block call; as in: ((double(*)(struct invok_impl *, int))(BLOCK_PTR_VAR->FuncPtr))(I, 42); @@ -2781,7 +2795,7 @@ return build3 (CALL_EXPR, TREE_TYPE (fntype), function_ptr_exp, params, NULL_TREE); } -/* APPLE LOCAL end blocks 6040305 */ +/* APPLE LOCAL end blocks 6040305 (cm) */ tree build_function_call (tree function, tree params) @@ -2861,8 +2875,11 @@ /* Convert the parameters to the types declared in the function prototype, or apply default promotions. */ + /* APPLE LOCAL begin radar 6087117 */ coerced_params = convert_arguments (TYPE_ARG_TYPES (fntype), - params, fndecl, LOOKUP_NORMAL); + params, fndecl, LOOKUP_NORMAL, + (TREE_CODE (TREE_TYPE (function)) == BLOCK_POINTER_TYPE)); + /* APPLE LOCAL end radar 6087117 */ if (coerced_params == error_mark_node) return error_mark_node; @@ -2897,7 +2914,8 @@ default arguments, if such were specified. Do so here. */ static tree -convert_arguments (tree typelist, tree values, tree fndecl, int flags) +/* APPLE LOCAL radar 6087117 */ +convert_arguments (tree typelist, tree values, tree fndecl, int flags, int block_call) { tree typetail, valtail; tree result = NULL_TREE; @@ -2939,7 +2957,8 @@ error ("at this point in file"); } else - error ("too many arguments to function"); + /* APPLE LOCAL radar 6087117 */ + error ("too many arguments to %s", (block_call ? "block call" : "function")); /* In case anybody wants to know if this argument list is valid. */ if (result) @@ -3041,7 +3060,8 @@ error ("at this point in file"); } else - error ("too few arguments to function"); + /* APPLE LOCAL radar 6087117 */ + error ("too few arguments to %s", (block_call ? "block call" : "function")); return error_mark_node; } } @@ -3234,7 +3254,8 @@ if ((invalid_op_diag = targetm.invalid_binary_op (code, type0, type1))) { - error (invalid_op_diag); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (invalid_op_diag, ""); return error_mark_node; } @@ -3442,15 +3463,13 @@ && (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE)) short_compare = 1; - else if ((code0 == POINTER_TYPE && code1 == POINTER_TYPE) - || (TYPE_PTRMEM_P (type0) && TYPE_PTRMEM_P (type1))) - result_type = composite_pointer_type (type0, type1, op0, op1, - "comparison"); /* APPLE LOCAL begin blocks 6040305 */ - else if (code0 == BLOCK_POINTER_TYPE && code1 == BLOCK_POINTER_TYPE) + else if (((code0 == POINTER_TYPE || code0 == BLOCK_POINTER_TYPE) + && (code1 == POINTER_TYPE || code1 == BLOCK_POINTER_TYPE)) + || (TYPE_PTRMEM_P (type0) && TYPE_PTRMEM_P (type1))) + /* APPLE LOCAL end blocks 6040305 */ result_type = composite_pointer_type (type0, type1, op0, op1, "comparison"); - /* APPLE LOCAL end blocks 6040305 */ /* APPLE LOCAL blocks 6040305 (cl) */ else if ((code0 == POINTER_TYPE || code0 == BLOCK_POINTER_TYPE || TYPE_PTRMEM_P (type0)) && null_ptr_cst_p (op1)) @@ -3919,12 +3938,24 @@ if (! converted) { - /* APPLE LOCAL begin mainline */ - if (TREE_TYPE (op0) != result_type) - op0 = cp_convert_and_check (result_type, op0); - if (TREE_TYPE (op1) != result_type) - op1 = cp_convert_and_check (result_type, op1); - /* APPLE LOCAL end mainline */ + /* APPLE LOCAL begin 64bit shorten warning 6183168 */ + if (final_type == 0) + { + /* APPLE LOCAL begin mainline */ + if (TREE_TYPE (op0) != result_type) + op0 = cp_convert_and_check (result_type, op0); + if (TREE_TYPE (op1) != result_type) + op1 = cp_convert_and_check (result_type, op1); + /* APPLE LOCAL end mainline */ + } + else + { + if (TREE_TYPE (op0) != result_type) + op0 = cp_convert (result_type, op0); + if (TREE_TYPE (op1) != result_type) + op1 = cp_convert (result_type, op1); + } + /* APPLE LOCAL end 64bit shorten warning 6183168 */ if (op0 == error_mark_node || op1 == error_mark_node) return error_mark_node; @@ -4176,7 +4207,8 @@ : code), TREE_TYPE (xarg)))) { - error (invalid_op_diag); + /* APPLE LOCAL default to Wformat-security 5764921 */ + error (invalid_op_diag, ""); return error_mark_node; } @@ -7537,7 +7569,7 @@ return win; } -/* APPLE LOCAL begin radar 6040305 - blocks */ +/* APPLE LOCAL begin blocks 6040305 */ tree c_finish_return (tree exp) { /* Unlike c front-end, genericize gets called in the middle of @@ -7549,4 +7581,4 @@ && BLOCK_HELPER_FUNC (current_function_decl)); return finish_return_stmt (exp); } -/* APPLE LOCAL end radar 6040305 - blocks */ +/* APPLE LOCAL end blocks 6040305 */ Modified: llvm-gcc-4.2/trunk/gcc/dbxout.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dbxout.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dbxout.c (original) +++ llvm-gcc-4.2/trunk/gcc/dbxout.c Tue Sep 2 17:20:12 2008 @@ -2112,6 +2112,8 @@ { case VOID_TYPE: case LANG_TYPE: + /* APPLE LOCAL blocks 6034272 */ + case BLOCK_POINTER_TYPE: dbxout_void_type (type); break; @@ -2314,6 +2316,8 @@ { case VOID_TYPE: case LANG_TYPE: + /* APPLE LOCAL blocks 6034272 */ + case BLOCK_POINTER_TYPE: dbxout_void_type (type); break; Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2out.c (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2out.c Tue Sep 2 17:20:12 2008 @@ -214,6 +214,8 @@ typedef struct cfa_loc GTY(()) { HOST_WIDE_INT offset; + /* APPLE LOCAL async unwind info 5949350 */ + HOST_WIDE_INT fp_offset; HOST_WIDE_INT base_offset; unsigned int reg; int indirect; /* 1 if CFA is accessed via a dereference. */ @@ -731,6 +733,21 @@ /* The last args_size we actually output. */ static HOST_WIDE_INT old_args_size; +/* APPLE LOCAL begin async unwind info 5949350 */ +/* This routine should be called anytime the cfa.reg can be switched + away from the fp. We record the offset used with the fp, so that + if we go from using the fp to the sp and then update the sp from + the fp, we know what offset to use instead of the current offset in + use for the sp. */ + +static inline void +notice_cfa_fp_offset (void) +{ + if (cfa.reg == (unsigned) HARD_FRAME_POINTER_REGNUM) + cfa.fp_offset = cfa.offset; +} +/* APPLE LOCAL end async unwind info 5949350 */ + /* Entry point to update the canonical frame address (CFA). LABEL is passed to add_fde_cfi. The value of CFA is now to be calculated from REG+OFFSET. */ @@ -741,6 +758,8 @@ dw_cfa_location loc; loc.indirect = 0; loc.base_offset = 0; + /* APPLE LOCAL async unwind info 5949350 */ + notice_cfa_fp_offset (); loc.reg = reg; loc.offset = offset; def_cfa_1 (label, &loc); @@ -773,6 +792,8 @@ if (cfa_store.reg == loc.reg && loc.indirect == 0) cfa_store.offset = loc.offset; + /* APPLE LOCAL async unwind info 5949350 */ + notice_cfa_fp_offset (); loc.reg = DWARF_FRAME_REGNUM (loc.reg); lookup_cfa (&old_cfa); @@ -1108,7 +1129,20 @@ insns to be marked, and to be able to handle saving state around epilogues textually in the middle of the function. */ if (prologue_epilogue_contains (insn) || sibcall_epilogue_contains (insn)) - return; + /* APPLE LOCAL begin async unwind info 5949350 */ + { + if (!flag_asynchronous_unwind_tables) + return; + + /* We now handle epilogues for flag_asynchronous_unwind_tables. + We do this by saving the cfa information around the epilogue + instructions and restoring that information after the + epilogue instructions. See dwarf2out_frame_debug_noncall for + the information that is saved and restored. */ + if (!epilogue_contains (insn)) + return; + } + /* APPLE LOCAL end async unwind info 5949350 */ /* If only calls can throw, and we have a frame pointer, save up adjustments until we see the CALL_INSN. */ @@ -1563,6 +1597,8 @@ case REG: if (cfa.reg == (unsigned) REGNO (src)) { + /* APPLE LOCAL async unwind info 5949350 */ + notice_cfa_fp_offset (); /* Rule 1 */ /* Update the CFA rule wrt SP or FP. Make sure src is relative to the current CFA register. @@ -1609,8 +1645,24 @@ if (XEXP (src, 0) == hard_frame_pointer_rtx) { + /* APPLE LOCAL begin async unwind info 5949350 */ + /* In the epilogue, sometimes we switch from fp to + sp and then play with sp, then do another switch + from fp to sp. In order for this to work, we + have to save a copy of the offset against fp, and + restore that here, back into cfa.offset when we + notice that we were using sp and not fp. */ + if (cfa.reg == (unsigned) STACK_POINTER_REGNUM) + { + cfa.reg = HARD_FRAME_POINTER_REGNUM; + cfa.offset = cfa.fp_offset; + } + /* APPLE LOCAL end async unwind info 5949350 */ + /* Restoring SP from FP in the epilogue. */ gcc_assert (cfa.reg == (unsigned) HARD_FRAME_POINTER_REGNUM); + /* APPLE LOCAL async unwind info 5949350 */ + notice_cfa_fp_offset (); cfa.reg = STACK_POINTER_REGNUM; } else if (GET_CODE (src) == LO_SUM) @@ -1651,6 +1703,8 @@ && REGNO (XEXP (src, 0)) == cfa.reg && GET_CODE (XEXP (src, 1)) == CONST_INT) { + /* APPLE LOCAL async unwind info 5949350 */ + notice_cfa_fp_offset (); /* Setting a temporary CFA register that will be copied into the FP later on. */ offset = - INTVAL (XEXP (src, 1)); @@ -1843,6 +1897,8 @@ x = XEXP (x, 0); gcc_assert (REG_P (x)); + /* APPLE LOCAL async unwind info 5949350 */ + notice_cfa_fp_offset (); cfa.reg = REGNO (x); cfa.base_offset = offset; cfa.indirect = 1; @@ -1860,6 +1916,53 @@ } } +/* APPLE LOCAL begin async unwind info 5949350 */ +/* Mirror routine to dwarf2out_frame_debug_noncall, except this + routine is only called for all non-CALL_P instructions and only + before the instruction. We use this to save and restore the cfa + state around epilogue instructions so that we can track frame + related instructions from the epilogue when + flag_asynchronous_unwind_tables is on. */ +void +dwarf2out_frame_debug_noncall (bool inside_epilogue) +{ + static dw_cfa_location saved_cfa; + static dw_cfa_location saved_cfa_store; + static dw_cfa_location saved_cfa_temp; + static HOST_WIDE_INT saved_args_size; + + const char *label; + + if (inside_epilogue) + { + if (saved_cfa.reg == 0) + { + /* When we enter an epilogue, we save the current cfa so + that we can restore it when we leave the epilogue. */ + saved_cfa = cfa; + saved_cfa_store = cfa_store; + saved_cfa_temp = cfa_temp; + saved_args_size = args_size; + } + } + else if (saved_cfa.reg != 0) + { + /* We have now left the epilogue, so restore the saved cfa. */ + cfa = saved_cfa; + cfa_store = saved_cfa_store; + cfa_temp = saved_cfa_temp; + args_size = saved_args_size; + + label = dwarf2out_cfi_label (); + def_cfa_1 (label, &cfa); + + /* Once restored, we might need to save it again. */ + saved_cfa.reg = 0; + return; + } +} +/* APPLE LOCAL end async unwind info 5949350 */ + /* Record call frame debugging information for INSN, which either sets SP or FP (adjusting how we calculate the frame address) or saves a register to the stack. If INSN is NULL_RTX, initialize our state. @@ -14303,8 +14406,8 @@ a plain function, this will be fixed up in decls_for_scope. If we're a method, it will be ignored, since we already have a DIE. */ if (decl_function_context (decl) - /* APPLE LOCAL blocks 5811952 */ - && (! BLOCK_HELPER_FUNC (decl)) + /* APPLE LOCAL blocks 5811952 - radar 6172148 */ + && (! BLOCK_SYNTHESIZED_FUNC (decl)) /* But if we're in terse mode, we don't care about scope. */ && debug_info_level > DINFO_LEVEL_TERSE) context_die = NULL; Modified: llvm-gcc-4.2/trunk/gcc/dwarf2out.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/dwarf2out.h?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/dwarf2out.h (original) +++ llvm-gcc-4.2/trunk/gcc/dwarf2out.h Tue Sep 2 17:20:12 2008 @@ -21,6 +21,8 @@ extern void dwarf2out_decl (tree); extern void dwarf2out_frame_debug (rtx, bool); +/* APPLE LOCAL async unwind info 5949350 */ +extern void dwarf2out_frame_debug_noncall (bool); extern void debug_dwarf (void); struct die_struct; Modified: llvm-gcc-4.2/trunk/gcc/except.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/except.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/except.c (original) +++ llvm-gcc-4.2/trunk/gcc/except.c Tue Sep 2 17:20:12 2008 @@ -3763,8 +3763,9 @@ switch_to_exception_section (); #endif - /* If the target wants a label to begin the table, emit it here. */ - targetm.asm_out.except_table_label (asm_out_file); + /* APPLE LOCAL begin 6128170 */ + /* deletion; code moved down 26 lines */ + /* APPLE LOCAL end 6128170 */ have_tt_data = (VEC_length (tree, cfun->eh->ttype_data) > 0 || VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) > 0); @@ -3784,6 +3785,11 @@ assemble_align (tt_format_size * BITS_PER_UNIT); } + /* APPLE LOCAL begin 6128170 */ + /* If the target wants a label to begin the table, emit it here. */ + targetm.asm_out.except_table_label (asm_out_file); + /* APPLE LOCAL end 6128170 */ + targetm.asm_out.internal_label (asm_out_file, "LLSDA", current_function_funcdef_no); Modified: llvm-gcc-4.2/trunk/gcc/expmed.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/expmed.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/expmed.c (original) +++ llvm-gcc-4.2/trunk/gcc/expmed.c Tue Sep 2 17:20:12 2008 @@ -40,7 +40,9 @@ static void store_fixed_bit_field (rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, - unsigned HOST_WIDE_INT, rtx); + /* APPLE LOCAL begin 6020402 */ + unsigned HOST_WIDE_INT, rtx, tree); + /* APPLE LOCAL end 6020402 */ static void store_split_bit_field (rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, rtx); static rtx extract_fixed_bit_field (enum machine_mode, rtx, @@ -54,6 +56,12 @@ static void do_cmp_and_jump (rtx, rtx, enum rtx_code, enum machine_mode, rtx); static rtx expand_smod_pow2 (enum machine_mode, rtx, HOST_WIDE_INT); static rtx expand_sdiv_pow2 (enum machine_mode, rtx, HOST_WIDE_INT); +/* APPLE LOCAL begin 6020402 */ +static enum machine_mode +widest_mode_including_no_volatile_fields (tree, unsigned HOST_WIDE_INT, + unsigned HOST_WIDE_INT, + unsigned HOST_WIDE_INT); +/* APPLE LOCAL end 6020402 */ /* Test whether a value is zero of a power of two. */ #define EXACT_POWER_OF_2_OR_ZERO_P(x) (((x) & ((x) - 1)) == 0) @@ -332,7 +340,11 @@ containing BITSIZE bits starting at bit BITNUM. FIELDMODE is the machine-mode of the FIELD_DECL node for this field. ALIGN is the alignment that STR_RTX is known to have. - TOTAL_SIZE is the size of the structure in bytes, or -1 if varying. */ +APPLE LOCAL begin 6020402 + TOTAL_SIZE is the size of the structure in bytes, or -1 if varying. + STRUCT_TYPE is the type of the struct containing the bitfield, or NULL_TREE + if the struct type is not available. +APPLE LOCAL end 6020402 */ /* ??? Note that there are two different ideas here for how to determine the size to count bits within, for a register. @@ -345,7 +357,9 @@ rtx store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, unsigned HOST_WIDE_INT bitnum, enum machine_mode fieldmode, - rtx value) + /* APPLE LOCAL begin 6020402 */ + rtx value, tree struct_type) + /* APPLE LOCAL end 6020402 */ { unsigned int unit = (MEM_P (str_rtx)) ? BITS_PER_UNIT : BITS_PER_WORD; @@ -582,7 +596,10 @@ store_bit_field (op0, MIN (BITS_PER_WORD, bitsize - i * BITS_PER_WORD), bitnum + bit_offset, word_mode, - operand_subword_force (value, wordnum, fieldmode)); + /* APPLE LOCAL begin 6020402 */ + operand_subword_force (value, wordnum, fieldmode), + struct_type); + /* APPLE LOCAL end 6020402 */ } return value; } @@ -695,7 +712,9 @@ (GET_MODE_CLASS (fieldmode) != MODE_INT && GET_MODE_CLASS (fieldmode) != MODE_PARTIAL_INT) ? GET_MODE (orig_value) : fieldmode, - orig_value); + /* APPLE LOCAL begin 6020402 */ + orig_value, struct_type); + /* APPLE LOCAL end 6020402 */ /* APPLE LOCAL end do not use float fieldmode */ emit_move_insn (op0, tempreg); return value; @@ -775,16 +794,133 @@ else { delete_insns_since (last); - store_fixed_bit_field (op0, offset, bitsize, bitpos, value); + /* APPLE LOCAL begin 6020402 */ + store_fixed_bit_field (op0, offset, bitsize, bitpos, value, + struct_type); + /* APPLE LOCAL end 6020402 */ } } else insv_loses: /* Insv is not available; store using shifts and boolean ops. */ - store_fixed_bit_field (op0, offset, bitsize, bitpos, value); + /* APPLE LOCAL begin 6020402 */ + store_fixed_bit_field (op0, offset, bitsize, bitpos, value, struct_type); + /* APPLE LOCAL end 6020402 */ return value; } +/* APPLE LOCAL begin 6020402 */ +/* Given a struct type and a bit field corresponding to OFFSET_BYTES, BITSIZE, + and BITPOS, returns the widest mode that can be used to store to the bit + field without also writing to a volatile region of the struct. If no mode + is small enough to fit the bit field, then VOIDmode is returned. It is + assumed that OFFSET_BYTES, BITSIZE, and BITPOS correspond to a field + defined explicitly in STRUCT_TYPE. + + STRUCT_TYPE is the type of the struct containing the bit field. + OFFSET_BYTES is the offset of the target field in the struct in bytes. + BITPOS is the offset of the target field in the struct in bits, not + including the byte offset. + BITSIZE is the size of the bit field in bits. +*/ + +static enum machine_mode +widest_mode_including_no_volatile_fields (tree struct_type, + unsigned HOST_WIDE_INT offset_bytes, + unsigned HOST_WIDE_INT bitpos, + unsigned HOST_WIDE_INT bitsize) +{ + enum machine_mode minmode = VOIDmode, maxmode = VOIDmode, tmode; + unsigned target_low, target_high; + + /* Find the narrowest integer mode that contains the bit field. */ + for (minmode = GET_CLASS_NARROWEST_MODE (MODE_INT); minmode != VOIDmode; + minmode = GET_MODE_WIDER_MODE (minmode)) + { + unsigned unit = GET_MODE_BITSIZE (minmode); + if ((bitpos % unit) + bitsize <= unit) + break; + } + + if (minmode == VOIDmode) + return VOIDmode; /* No mode will fit a bitfield of this size. */ + + target_low = offset_bytes * 8 + bitpos; + target_high = target_low + bitsize; + + maxmode = VOIDmode; + + for (tmode = minmode; + tmode != VOIDmode + && GET_MODE_BITSIZE (tmode) <= GET_MODE_BITSIZE (word_mode); + tmode = GET_MODE_WIDER_MODE (tmode)) + { + tree field; + unsigned mode_bitsize = GET_MODE_BITSIZE (tmode); + unsigned mode_low = (target_low / mode_bitsize) * mode_bitsize; + unsigned mode_high = mode_low + mode_bitsize; + + for (field = TYPE_FIELDS (struct_type); field; + field = TREE_CHAIN (field)) + { + unsigned field_low, field_high; + bool field_is_target_field, field_intersects_with_mode_range; + + /* Make sure all values that we need are present for this field. */ + if (TREE_CODE (field) != FIELD_DECL + || DECL_FIELD_OFFSET (field) == NULL_TREE + || DECL_FIELD_BIT_OFFSET (field) == NULL_TREE + || TREE_TYPE (field) == NULL_TREE + || TYPE_SIZE (TREE_TYPE (field)) == NULL_TREE) + continue; + + if (TREE_CODE (DECL_FIELD_OFFSET (field)) != INTEGER_CST) + return VOIDmode; + + field_low = 8 * TREE_INT_CST_LOW (DECL_FIELD_OFFSET (field)) + + TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (field)); + + if (DECL_SIZE (field) != NULL_TREE) + field_high = field_low + TREE_INT_CST_LOW (DECL_SIZE (field)); + else + { + if (TREE_CODE (TYPE_SIZE (TYPE_SIZE (TREE_TYPE (field)))) + != INTEGER_CST) + return VOIDmode; + + field_high = field_low + + TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (field))); + } + + /* We assume that this will be true if the current field is the + target field. This may not be the case if the field is + split up, for instance. */ + field_is_target_field = + field_low == target_low && field_high == target_high; + + /* The current field and the current mode intersect if either the + field low or the field high is in the mode range, or if the + field completely contains the mode range. */ + field_intersects_with_mode_range = + (field_high > mode_low && field_high <= mode_high) + || (field_low >= mode_low && field_low < mode_high) + || (field_high >= mode_high && field_low <= mode_low); + + if (!field_is_target_field + && TYPE_VOLATILE (TREE_TYPE (field)) + && field_intersects_with_mode_range) + /* The current field is volatile and within the mode of the + target field. Return the max mode allowed up to this point. */ + return maxmode; + } + + maxmode = tmode; + } + + return maxmode; +} +/* APPLE LOCAL end 6020402 */ + /* Use shifts and boolean operations to store VALUE into a bit field of width BITSIZE in a memory location specified by OP0 except offset by OFFSET bytes. @@ -797,7 +933,10 @@ static void store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset, unsigned HOST_WIDE_INT bitsize, - unsigned HOST_WIDE_INT bitpos, rtx value) + /* APPLE LOCAL begin 6020402 */ + unsigned HOST_WIDE_INT bitpos, rtx value, + tree struct_type) + /* APPLE LOCAL end 6020402 */ { enum machine_mode mode; unsigned int total_bits = BITS_PER_WORD; @@ -829,12 +968,24 @@ a word, we won't be doing the extraction the normal way. We don't want a mode bigger than the destination. */ - mode = GET_MODE (op0); - if (GET_MODE_BITSIZE (mode) == 0 - || GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (word_mode)) - mode = word_mode; + /* APPLE LOCAL begin 6020402 */ + enum machine_mode maxmode = GET_MODE (op0); + + /* Find the largest mode that doesn't interfere with volatile fields in + * the struct. */ + if (struct_type != NULL_TREE && TREE_CODE (struct_type) == RECORD_TYPE) + maxmode = widest_mode_including_no_volatile_fields (struct_type, + offset, + bitpos, bitsize); + + if (GET_MODE_BITSIZE (maxmode) == 0 + || GET_MODE_BITSIZE (maxmode) > GET_MODE_BITSIZE (word_mode)) + maxmode = word_mode; + /* APPLE LOCAL end 6020402 */ mode = get_best_mode (bitsize, bitpos + offset * BITS_PER_UNIT, - MEM_ALIGN (op0), mode, MEM_VOLATILE_P (op0)); + /* APPLE LOCAL begin 6020402 */ + MEM_ALIGN (op0), maxmode, MEM_VOLATILE_P (op0)); + /* APPLE LOCAL end 6020402 */ if (mode == VOIDmode) { @@ -1069,7 +1220,9 @@ /* OFFSET is in UNITs, and UNIT is in bits. store_fixed_bit_field wants offset in bytes. */ store_fixed_bit_field (word, offset * unit / BITS_PER_UNIT, thissize, - thispos, part); + /* APPLE LOCAL begin 6020402 */ + thispos, part, NULL_TREE); + /* APPLE LOCAL end 6020402 */ bitsdone += thissize; } } Modified: llvm-gcc-4.2/trunk/gcc/expr.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/expr.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/expr.c (original) +++ llvm-gcc-4.2/trunk/gcc/expr.c Tue Sep 2 17:20:12 2008 @@ -2055,7 +2055,9 @@ emit_move_insn (adjust_address (dest, mode, bytepos), tmps[i]); else store_bit_field (dest, bytelen * BITS_PER_UNIT, bytepos * BITS_PER_UNIT, - mode, tmps[i]); + /* APPLE LOCAL begin 6020402 */ + mode, tmps[i], NULL_TREE); + /* APPLE LOCAL end 6020402 */ } /* Copy from the pseudo into the (probable) hard reg. */ @@ -2139,7 +2141,10 @@ store_bit_field (dst, bitsize, bitpos % BITS_PER_WORD, word_mode, extract_bit_field (src, bitsize, xbitpos % BITS_PER_WORD, 1, - NULL_RTX, word_mode, word_mode)); + /* APPLE LOCAL begin 6020402 */ + NULL_RTX, word_mode, word_mode), + NULL_TREE); + /* APPLE LOCAL end 6020402 */ } return tgtblk; @@ -2783,7 +2788,10 @@ gcc_assert (MEM_P (cplx) && ibitsize < BITS_PER_WORD); } - store_bit_field (cplx, ibitsize, imag_p ? ibitsize : 0, imode, val); + /* APPLE LOCAL begin 6020402 */ + store_bit_field (cplx, ibitsize, imag_p ? ibitsize : 0, imode, val, + NULL_TREE); + /* APPLE LOCAL end 6020402 */ } /* Extract one of the components of the complex value CPLX. Extract the @@ -5633,7 +5641,9 @@ } /* Store the value in the bitfield. */ - store_bit_field (target, bitsize, bitpos, mode, temp); + /* APPLE LOCAL begin 6020402 */ + store_bit_field (target, bitsize, bitpos, mode, temp, type); + /* APPLE LOCAL end 6020402 */ return const0_rtx; } Modified: llvm-gcc-4.2/trunk/gcc/expr.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/expr.h?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/expr.h (original) +++ llvm-gcc-4.2/trunk/gcc/expr.h Tue Sep 2 17:20:12 2008 @@ -733,7 +733,10 @@ mode_for_extraction (enum extraction_pattern, int); extern rtx store_bit_field (rtx, unsigned HOST_WIDE_INT, - unsigned HOST_WIDE_INT, enum machine_mode, rtx); + /* APPLE LOCAL begin 6020402 */ + unsigned HOST_WIDE_INT, enum machine_mode, rtx, + tree); + /* APPLE LOCAL end 6020402 */ extern rtx extract_bit_field (rtx, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, int, rtx, enum machine_mode, enum machine_mode); Modified: llvm-gcc-4.2/trunk/gcc/final.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/final.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/final.c (original) +++ llvm-gcc-4.2/trunk/gcc/final.c Tue Sep 2 17:20:12 2008 @@ -1944,7 +1944,12 @@ case BARRIER: #if defined (DWARF2_UNWIND_INFO) if (dwarf2out_do_frame ()) - dwarf2out_frame_debug (insn, false); + /* APPLE LOCAL begin async unwind info 5949350 */ + { + dwarf2out_frame_debug_noncall (epilogue_contains (insn)); + dwarf2out_frame_debug (insn, false); + } + /* APPLE LOCAL end async unwind info 5949350 */ #endif break; @@ -2529,6 +2534,10 @@ #if defined (DWARF2_UNWIND_INFO) if (CALL_P (insn) && dwarf2out_do_frame ()) dwarf2out_frame_debug (insn, false); + /* APPLE LOCAL begin async unwind info 5949350 */ + else if (dwarf2out_do_frame ()) + dwarf2out_frame_debug_noncall (epilogue_contains (insn)); + /* APPLE LOCAL end async unwind info 5949350 */ #endif /* Find the proper template for this insn. */ Modified: llvm-gcc-4.2/trunk/gcc/fold-const.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/fold-const.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/fold-const.c (original) +++ llvm-gcc-4.2/trunk/gcc/fold-const.c Tue Sep 2 17:20:12 2008 @@ -992,7 +992,8 @@ } } else if (issue_strict_overflow_warning (wc)) - warning (OPT_Wstrict_overflow, gmsgid); + /* APPLE LOCAL default to Wformat-security 5764921 */ + warning (OPT_Wstrict_overflow, "%s", gmsgid); } /* Return true if the built-in mathematical function specified by CODE @@ -10609,7 +10610,13 @@ && ! DECL_WEAK (TREE_OPERAND (arg1, 0)) && ! lookup_attribute ("alias", DECL_ATTRIBUTES (TREE_OPERAND (arg1, 0))) - && ! DECL_EXTERNAL (TREE_OPERAND (arg1, 0))) + /* APPLE LOCAL begin folding of anon union 6120295 */ + && ! DECL_EXTERNAL (TREE_OPERAND (arg1, 0)) + && ! (TREE_CODE (TREE_OPERAND (arg0, 0)) == VAR_DECL + && DECL_HAS_VALUE_EXPR_P (TREE_OPERAND (arg0, 0)) + && TREE_CODE (TREE_OPERAND (arg0, 0)) == VAR_DECL + && DECL_HAS_VALUE_EXPR_P (TREE_OPERAND (arg0, 0)))) + /* APPLE LOCAL end folding of anon union 6120295 */ { /* We know that we're looking at the address of two non-weak, unaliased, static _DECL nodes. Modified: llvm-gcc-4.2/trunk/gcc/function.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/function.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/function.c (original) +++ llvm-gcc-4.2/trunk/gcc/function.c Tue Sep 2 17:20:12 2008 @@ -4731,6 +4731,16 @@ return 0; } +/* APPLE LOCAL begin async unwind info 5949350 */ +int +epilogue_contains (rtx insn) +{ + if (contains (insn, &epilogue)) + return 1; + return 0; +} +/* APPLE LOCAL end async unwind info 5949350 */ + int prologue_epilogue_contains (rtx insn) { Modified: llvm-gcc-4.2/trunk/gcc/gcov-io.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/gcov-io.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/gcov-io.c (original) +++ llvm-gcc-4.2/trunk/gcc/gcov-io.c Tue Sep 2 17:20:12 2008 @@ -132,9 +132,11 @@ } if (!gcov_var.file) return 0; -#endif + /* APPLE LOCAL begin fread is way slow 6178552 */ setbuf (gcov_var.file, (char *)0); +#endif + /* APPLE LOCAL end fread is way slow 6178552 */ return 1; } Modified: llvm-gcc-4.2/trunk/gcc/global.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/global.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/global.c (original) +++ llvm-gcc-4.2/trunk/gcc/global.c Tue Sep 2 17:20:12 2008 @@ -2312,6 +2312,8 @@ then give the other a preference. */ if (dest_regno < FIRST_PSEUDO_REGISTER && src_regno >= FIRST_PSEUDO_REGISTER + /* APPLE LOCAL 6090616 avoid regno underflow */ + && (offset <= 0 || dest_regno >= (unsigned)offset) && reg_allocno[src_regno] >= 0) { dest_regno -= offset; @@ -2331,6 +2333,8 @@ } if (src_regno < FIRST_PSEUDO_REGISTER && dest_regno >= FIRST_PSEUDO_REGISTER + /* APPLE LOCAL 6090616 avoid regno underflow */ + && (offset >= 0 || src_regno >= (unsigned)-offset) && reg_allocno[dest_regno] >= 0) { src_regno += offset; Modified: llvm-gcc-4.2/trunk/gcc/ifcvt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ifcvt.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/ifcvt.c (original) +++ llvm-gcc-4.2/trunk/gcc/ifcvt.c Tue Sep 2 17:20:12 2008 @@ -826,7 +826,9 @@ } gcc_assert (start < (MEM_P (op) ? BITS_PER_UNIT : BITS_PER_WORD)); - store_bit_field (op, size, start, GET_MODE (x), y); + /* APPLE LOCAL begin 6020402 */ + store_bit_field (op, size, start, GET_MODE (x), y, NULL_TREE); + /* APPLE LOCAL end 6020402 */ return; } @@ -880,7 +882,10 @@ inner = XEXP (outer, 0); outmode = GET_MODE (outer); bitpos = SUBREG_BYTE (outer) * BITS_PER_UNIT; - store_bit_field (inner, GET_MODE_BITSIZE (outmode), bitpos, outmode, y); + /* APPLE LOCAL begin 6020402 */ + store_bit_field (inner, GET_MODE_BITSIZE (outmode), bitpos, outmode, y, + NULL_TREE); + /* APPLE LOCAL end 6020402 */ } /* Return sequence of instructions generated by if conversion. This Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original) +++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Tue Sep 2 17:20:12 2008 @@ -82,7 +82,7 @@ #endif /* LLVM LOCAL end */ -#define OBJC_VOID_AT_END void_list_node +#define OBJC_VOID_AT_END void_list_node /* APPLE LOCAL radar 4506893 */ static bool in_objc_property_setter_name_context = false; @@ -104,15 +104,15 @@ if method names contain underscores. -- rms. */ #ifndef OBJC_GEN_METHOD_LABEL #define OBJC_GEN_METHOD_LABEL(BUF, IS_INST, CLASS_NAME, CAT_NAME, SEL_NAME, NUM) \ - do { \ - char *temp; \ - sprintf ((BUF), "_%s_%s_%s_%s", \ - ((IS_INST) ? "i" : "c"), \ - (CLASS_NAME), \ - ((CAT_NAME)? (CAT_NAME) : ""), \ - (SEL_NAME)); \ - for (temp = (BUF); *temp; temp++) \ - if (*temp == ':') *temp = '_'; \ + do { \ + char *temp; \ + sprintf ((BUF), "_%s_%s_%s_%s", \ + ((IS_INST) ? "i" : "c"), \ + (CLASS_NAME), \ + ((CAT_NAME)? (CAT_NAME) : ""), \ + (SEL_NAME)); \ + for (temp = (BUF); *temp; temp++) \ + if (*temp == ':') *temp = '_'; \ } while (0) #endif /* APPLE LOCAL begin radar 4862848 */ @@ -175,8 +175,8 @@ #define NEW_PROTOCOL_VERSION 3 /* (Decide if these can ever be validly changed.) */ -#define OBJC_ENCODE_INLINE_DEFS 0 -#define OBJC_ENCODE_DONT_INLINE_DEFS 1 +#define OBJC_ENCODE_INLINE_DEFS 0 +#define OBJC_ENCODE_DONT_INLINE_DEFS 1 /*** Private Interface (procedures) ***/ @@ -1174,7 +1174,7 @@ static bool managed_objc_object_pointer (tree type) { - return type && type != error_mark_node && POINTER_TYPE_P (type) + return type && type != error_mark_node && POINTER_TYPE_P (type) && (objc_is_object_id (TREE_TYPE (type)) || TYPED_OBJECT (TREE_TYPE (type))); } /* APPLE LOCAL end radar 5168496 */ @@ -2260,6 +2260,20 @@ } /* APPLE LOCAL end radar 5082000 */ +/* APPLE LOCAL begin radar 6133042 */ +/* This routine checks block pointers and either returns + 1 for GCable, or -1 if they are tagged as __weak. */ +static int +block_pointer_strong_value (tree type) +{ + gcc_assert (type && TREE_CODE (type) == BLOCK_POINTER_TYPE); + type = TREE_TYPE (TREE_TYPE (type)); + while (POINTER_TYPE_P (type)) + type = TREE_TYPE (type); + return (objc_is_strong_p (type) >= 0 ? 1 : -1); +} +/* APPLE LOCAL end radar 6133042 */ + static void objc_build_aggregate_ivar_layout (tree aggr_type, tree field_decl, unsigned int base_byte_pos, @@ -2399,7 +2413,13 @@ break; } /* APPLE LOCAL end objc gc 5547128 */ - + /* APPLE LOCAL begin radar 6133042 */ + if (TREE_CODE (type) == BLOCK_POINTER_TYPE) + { + strong = block_pointer_strong_value (type); + break; + } + /* APPLE LOCAL end radar 6133042 */ type = TREE_TYPE (type); } while (!strong && type); @@ -3090,6 +3110,25 @@ if (attributes) warning (0, "method attribute may be specified on method declarations only"); /* APPLE LOCAL end radar 4529765 */ + /* APPLE LOCAL begin radar 5424416 */ + if (TREE_TYPE (decl) && TREE_CODE (TREE_TYPE (decl)) == TREE_LIST) + { + tree type = TREE_VALUE (TREE_TYPE (decl)); + if (type) + { + if (TREE_CODE (type) == FUNCTION_TYPE) + { + error ("%qs declared as method returning a function", + IDENTIFIER_POINTER (DECL_NAME (decl))); + } + else if (TREE_CODE (type) == ARRAY_TYPE) + { + error ("%qs declared as method returning an array", + IDENTIFIER_POINTER (DECL_NAME (decl))); + } + } + } + /* APPLE LOCAL end radar 5424416 */ /* APPLE LOCAL radar 3803157 - objc attribute */ objc_decl_method_attributes (&decl, attributes, 0); objc_add_method (objc_implementation_context, @@ -3450,7 +3489,8 @@ strcat (errbuf, " the \'"); strcat (errbuf, IDENTIFIER_POINTER (PROTOCOL_NAME (proto))); strcat (errbuf, "\' protocol"); - warning (0, errbuf); + /* APPLE LOCAL default to Wformat-security 5764921 */ + warning (0, "%s", errbuf); } return false; @@ -3532,6 +3572,16 @@ } /* APPLE LOCAL end 4154928 */ +/* APPLE LOCAL begin radar 5595325 */ +/* This routine checks that TYPE has __attribute__((NSObject)) */ +static bool +objc_nsobject_attribute_type (tree type) +{ + return POINTER_TYPE_P (type) && + lookup_attribute ("NSObject", TYPE_ATTRIBUTES (type)); +} +/* APPLE LOCAL end radar 5595325 */ + /* Determine if it is permissible to assign (if ARGNO is greater than -3) an instance of RTYP to an instance of LTYP or to compare the two (if ARGNO is equal to -3), per ObjC type system rules. Before @@ -3565,10 +3615,18 @@ tree lcls, rcls, lproto, rproto; bool pointers_compatible; + /* APPLE LOCAL begin radar 5595325 */ + tree orig_ltyp, orig_rtyp; + /* APPLE LOCAL end radar 5595325 */ + /* We must be dealing with pointer types */ if (!POINTER_TYPE_P (ltyp) || !POINTER_TYPE_P (rtyp)) return false; + /* APPLE LOCAL begin radar 5595325 */ + orig_ltyp = ltyp; + orig_rtyp = rtyp; + /* APPLE LOCAL end radar 5595325 */ do { ltyp = TREE_TYPE (ltyp); /* Remove indirections. */ @@ -3607,12 +3665,22 @@ return false; if (!objc_is_object_id (ltyp) && !objc_is_class_id (ltyp) - && !TYPE_HAS_OBJC_INFO (ltyp)) - return false; + /* APPLE LOCAL begin radar 5595325 */ + && !TYPE_HAS_OBJC_INFO (ltyp)) { + /* Allow NSObject pointers to match 'id' */ + return (objc_nsobject_attribute_type (orig_ltyp) && objc_is_object_id (rtyp)) + ? true : false; + } + /* APPLE LOCAL end radar 5595325 */ if (!objc_is_object_id (rtyp) && !objc_is_class_id (rtyp) - && !TYPE_HAS_OBJC_INFO (rtyp)) - return false; + /* APPLE LOCAL begin radar 5595325 */ + && !TYPE_HAS_OBJC_INFO (rtyp)) { + /* Allow NSObject pointers to match 'id' */ + return (objc_nsobject_attribute_type (orig_rtyp) && objc_is_object_id (ltyp)) + ? true : false; + } + /* APPLE LOCAL end radar 5595325 */ /* APPLE LOCAL begin 4175534 */ /* Past this point, we are committed to returning 'true' to the caller @@ -6543,6 +6611,10 @@ objc_is_object_ptr (tree type) { tree ret; + /* APPLE LOCAL begin radar 5595325 */ + if (objc_nsobject_attribute_type (type)) + return TREE_TYPE (type); + /* APPLE LOCAL end radar 5595325 */ type = TYPE_MAIN_VARIANT (type); if (!POINTER_TYPE_P (type)) @@ -6619,10 +6691,7 @@ '__weak' */ if (TREE_CODE (type) == BLOCK_POINTER_TYPE) { - type = TREE_TYPE (TREE_TYPE (type)); - while (POINTER_TYPE_P (type)) - type = TREE_TYPE (type); - strong = (objc_is_strong_p (type) >= 0 ? 1 : -1); + strong = block_pointer_strong_value (type); break; } /* APPLE LOCAL end radar 5882266, 5832193 */ @@ -7944,7 +8013,14 @@ if (flag_objc_sjlj_exceptions) { /* LLVM LOCAL begin */ +#ifdef ENABLE_LLVM OBJC_FLAG_SJLJ_EXCEPTIONS; +#else + if (darwin_macosx_version_min + && strverscmp (darwin_macosx_version_min, "10.3") < 0) + warning (0, "Mac OS X version 10.3 or later is needed instead of %s for objc/obj-c++ exceptions", + darwin_macosx_version_min); +#endif /* LLVM LOCAL end */ } /* APPLE LOCAL end radar 4590191 */ @@ -12855,7 +12931,7 @@ for these two arguments. This is to make rest of the "format" attribute processing done in the middle-end to work seemlessly. */ -static tree +static void objc_delta_format_args (tree format) { tree format_num_expr, first_arg_num_expr; @@ -12872,9 +12948,11 @@ if (first_arg_num_expr && TREE_CODE (first_arg_num_expr) == INTEGER_CST) { val = TREE_INT_CST_LOW (first_arg_num_expr); - TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args))) = build_int_cst (NULL_TREE, val+2); + /* APPLE LOCAL begin radar 6157135 */ + if (val != 0) + TREE_VALUE (TREE_CHAIN (TREE_CHAIN (args))) = build_int_cst (NULL_TREE, val+2); + /* APPLE LOCAL end radar 6157135 */ } - return format; } /* This routine recognizes objc legal attributes. In case of "format" @@ -12885,14 +12963,12 @@ { tree chain; bool res = false; - if (!attributes) - return res; for (chain = attributes; chain; chain = TREE_CHAIN (chain)) { if (is_attribute_p ("format", TREE_PURPOSE (chain))) { - chain = objc_delta_format_args (chain); - return true; + objc_delta_format_args (chain); + res = true; } else if (is_attribute_p ("sentinel", TREE_PURPOSE (chain))) res = true; @@ -13421,10 +13497,14 @@ /* APPLE LOCAL end radar 3533972 */ #endif /* APPLE LOCAL end decay function/array receivers */ - warning (0, "invalid receiver type %qs", - gen_type_name (orig_rtype)); - /* After issuing the "invalid receiver" warning, perform method - lookup as if we were messaging 'id'. */ + /* APPLE LOCAL begin radar 5595325 */ + /* Do not issue this warning on random NSObject objects. */ + if (!objc_nsobject_attribute_type (orig_rtype)) + warning (0, "invalid receiver type %qs", + gen_type_name (orig_rtype)); + /* After issuing the "invalid receiver" warning, perform method + lookup as if we were messaging 'id'. */ + /* APPLE LOCAL end radar 5595325 */ rtype = rprotos = NULL_TREE; } } @@ -15077,6 +15157,24 @@ } /* APPLE LOCAL end radar 4449535 */ +/* APPLE LOCAL begin radar 5453108 */ +/* This routine checks to see if there is a setter/getter method declared in current + class. If so, it returns 'true' so caller does not issue a warning. This is + the case of a method declared in class's protocol which matches class's getter/settter. +*/ +static bool +property_method_in_class (tree meth, bool inst_method, tree interface) +{ + tree list, property_method; + if (!interface || !inst_method) + return false; + list = CLASS_NST_METHODS (interface); + + property_method = lookup_method (list, meth); + return (property_method && + METHOD_PROPERTY_CONTEXT (property_method) != NULL); +} +/* APPLE LOCAL end radar 5453108 */ /* Make sure all entries in CHAIN are also in LIST. */ static int @@ -15093,13 +15191,15 @@ /* APPLE LOCAL end radar 4359757 */ { /* APPLE LOCAL begin C* property metadata (Radar 4498373) */ - if (chain != NULL && METHOD_PROPERTY_CONTEXT (chain) != NULL_TREE) + /* APPLE LOCAL begin radar 5453108 */ + if (chain != NULL && (METHOD_PROPERTY_CONTEXT (chain) != NULL_TREE || + property_method_in_class (chain, mtype == (int)'-', interface))) + /* APPLE LOCAL end radar 5453108 */ { /* Case of instance method in interface not found in its implementation. This is OK in case of instance method setter/getter declaration synthesized via property declaration in the interface. Happens for dynamic properties. */ gcc_assert (mtype == (int)'-'); - gcc_assert (TREE_CODE (METHOD_PROPERTY_CONTEXT (chain)) == PROPERTY_DECL); chain = TREE_CHAIN (chain); continue; } @@ -16041,7 +16141,10 @@ input_location = DECL_SOURCE_LOCATION (property); /* APPLE LOCAL end radar 5839812 - location for synthesized methods */ - objc_lookup_property_ivar (class, property); + /* APPLE LOCAL begin radar 5435299 */ + if (!flag_new_property_ivar_synthesis) + objc_lookup_property_ivar (class, property); + /* APPLE LOCAL end radar 5435299 */ /* Find declaration of the property in the interface. There must be one. */ /* APPLE LOCAL radar 5040740 - radar 5207415 */ @@ -16172,7 +16275,10 @@ objc_implementation_context),setter_ident)) return; - objc_lookup_property_ivar (class, property); + /* APPLE LOCAL begin radar 5435299 */ + if (!flag_new_property_ivar_synthesis) + objc_lookup_property_ivar (class, property); + /* APPLE LOCAL end radar 5435299 */ /* Find declaration of the property in the interface. There must be one. */ /* APPLE LOCAL radar 5040740 */ @@ -16428,7 +16534,7 @@ { tree record = CLASS_STATIC_TEMPLATE (class); tree type = TREE_TYPE (property); - tree field_decl, field; + tree field_decl, field, nf; /* APPLE LOCAL begin radar 6029624 */ #ifdef OBJCPLUS if (TREE_CODE (type) == REFERENCE_TYPE) @@ -16439,14 +16545,27 @@ ivar_name ? ivar_name : objc_build_property_ivar_name (property)); DECL_CONTEXT (field_decl) = record; + /* APPLE LOCAL begin radar 5435299 */ + /* With -fnew-property-ivar_synthesis, synthesized 'ivar' is always private. */ (void) add_instance_variable (class, - 1, field_decl); + !flag_new_property_ivar_synthesis ? 1 : 2, field_decl); + /* APPLE LOCAL end radar 5435299 */ if (objc_is_strong_p (type) == -1) { tree attribute = tree_cons (NULL_TREE, get_identifier ("weak"), NULL_TREE); attribute = tree_cons (get_identifier ("objc_gc"), attribute, NULL_TREE); decl_attributes (&field_decl, attribute, 0); } + /* APPLE LOCAL begin radar 5435299 */ + nf = copy_node (field_decl); + if (flag_new_property_ivar_synthesis) + { + /* New field added to struct must not have ivar specific access info. + This confuses c++'s side of its own access field checking. */ + TREE_PUBLIC (nf) = IVAR_PUBLIC_OR_PROTECTED (nf) = 1; + TREE_PRIVATE (nf) = TREE_PROTECTED (nf) = 0; + } + /* APPLE LOCAL end radar 5435299 */ /* Unfortunately, CLASS_IVARS is completed when interface is completed. Must add the new ivar by hand to its list here. */ @@ -16459,14 +16578,12 @@ if (field && TREE_CHAIN (field) && TREE_CODE (TREE_CHAIN (field)) != FIELD_DECL) { - tree nf = copy_node (field_decl); TREE_CHAIN (nf) = TREE_CHAIN (field); TREE_CHAIN (field) = nf; } else #endif /* OBJCPLUS */ - CLASS_IVARS (class) = chainon (CLASS_IVARS (class), - copy_node (field_decl)); + CLASS_IVARS (class) = chainon (CLASS_IVARS (class), nf); gcc_assert (record); /* Must also add this ivar to the end of list of fields for this class. */ field = TYPE_FIELDS (record); @@ -16478,6 +16595,10 @@ /* Ugh, must recalculate struct layout since an ivar was added. */ TYPE_SIZE (record) = 0; layout_type (record); + /* APPLE LOCAL begin radar 5435299 */ + if (flag_new_property_ivar_synthesis) + objc_ivar_chain = CLASS_RAW_IVARS (class); + /* APPLE LOCAL end radar 5435299 */ } /* This routine looks up PROPERTY's 'ivar' in the CLASS. If one not found, it inserts one @@ -18867,7 +18988,7 @@ if (flag_objc_abi != 2) #endif /* LLVM LOCAL end - radar 5702446 */ - ASM_DECLARE_CLASS_REFERENCE (asm_out_file, string); + ASM_DECLARE_CLASS_REFERENCE (asm_out_file, string); return; } else @@ -19300,6 +19421,10 @@ if (!POINTER_TYPE_P (typ)) return false; + /* APPLE LOCAL begin radar 5595325 */ + if (objc_nsobject_attribute_type (typ)) + return true; + /* APPLE LOCAL end radar 5595325 */ do typ = TREE_TYPE (typ); /* Remove indirections. */ while (POINTER_TYPE_P (typ)); @@ -19649,6 +19774,36 @@ /* APPLE LOCAL end radar 5040740 */ +/* APPLE LOCAL begin radar 5435299 */ +/* lookup_property_impl_in_list - Look for an existing property + @synthesize/@dynamic in current implementation. +*/ +static tree +lookup_property_impl_in_list (tree chain, tree property) +{ + tree x; + for (x = IMPL_PROPERTY_DECL (chain); x; x = TREE_CHAIN (x)) + if (PROPERTY_NAME (x) == property) + return x; + return NULL_TREE; +} + +/* lookup_ivar_in_property_list - Searches current property list looking for + one which uses the given ivar_name. If found, it returns this property. +*/ + +static tree +lookup_ivar_in_property_list (tree chain, tree ivar_name) +{ + tree x; + for (x = IMPL_PROPERTY_DECL (chain); x; x = TREE_CHAIN (x)) + if (PROPERTY_IVAR_NAME (x) == ivar_name) + return x; + return NULL_TREE; +} + +/* APPLE LOCAL end radar 5435299 */ + /* This routine declares a new property implementation. Triggered by a @synthesize or @dynamic declaration. */ void objc_declare_property_impl (int impl_code, tree tree_list) @@ -19723,10 +19878,16 @@ property name must be used. */ if (!ivar_name) ivar_name = property_name; + /* APPLE LOCAL radar 5435299 */ + PROPERTY_IVAR_NAME (property_decl) = ivar_name; ivar_decl = nested_ivar_lookup (class, ivar_name); + /* APPLE LOCAL begin radar 5847641 */ + if (flag_objc_abi <= 1 && TREE_PURPOSE (chain) && !ivar_decl) + warning (0, "ivar name %qs specified on the synthesized property %qs not found", + IDENTIFIER_POINTER (ivar_name), IDENTIFIER_POINTER (property_name)) ; + /* APPLE LOCAL end radar 5847641 */ if (ivar_decl) { - /* APPLE LOCAL begin radar 5389292 */ /* Check for semnatic correctness of the existing ivar. */ tree ivar_type = DECL_BIT_FIELD_TYPE (ivar_decl) ? DECL_BIT_FIELD_TYPE (ivar_decl) @@ -19734,6 +19895,21 @@ /* APPLE LOCAL begin radar 6029624 */ tree property_type = TREE_TYPE (property_decl); bool comparison_result; + /* APPLE LOCAL begin radar 5435299 */ + if (flag_new_property_ivar_synthesis && flag_objc_abi == 2 && + !TREE_PURPOSE (chain)) { + /* In ObjC2 abi, it is illegal when a @synthesize with no named ivar + does not have a matching ivar in its class but some superclass ivar + already has the desired name */ + tree record = CLASS_STATIC_TEMPLATE (class); + if (record && record != DECL_CONTEXT (ivar_decl)) + error ("property %qs attempting to use ivar %qs in super class %qs", + IDENTIFIER_POINTER (property_name), + IDENTIFIER_POINTER (ivar_name), + IDENTIFIER_POINTER (OBJC_TYPE_NAME (record))); + } + /* APPLE LOCAL end radar 5435299 */ + /* APPLE LOCAL begin radar 5389292 */ #ifdef OBJCPLUS if (TREE_CODE (property_type) == REFERENCE_TYPE) { @@ -19774,9 +19950,24 @@ } } } - - PROPERTY_IVAR_NAME (property_decl) = ivar_name; + /* APPLE LOCAL begin radar 5435299 */ + else if (flag_new_property_ivar_synthesis) + objc_lookup_property_ivar (class, property_decl); + if (flag_new_property_ivar_synthesis && + (x = lookup_ivar_in_property_list (objc_implementation_context, + ivar_name))) + error ("synthesized properties %qs and %qs both claim ivar %qs", + IDENTIFIER_POINTER (property_name), + IDENTIFIER_POINTER (DECL_NAME (x)), + IDENTIFIER_POINTER (ivar_name)); + /* APPLE LOCAL end radar 5435299 */ } + /* APPLE LOCAL begin radar 5435299 */ + if (flag_new_property_ivar_synthesis && + lookup_property_impl_in_list (objc_implementation_context, property_name)) + error ("property %qs is already implemented", + IDENTIFIER_POINTER (property_name)); + /* APPLE LOCAL end radar 5435299 */ /* Add the property to the list of properties for current implementation. */ TREE_CHAIN (property_decl) = IMPL_PROPERTY_DECL (objc_implementation_context); IMPL_PROPERTY_DECL (objc_implementation_context) = property_decl; Modified: llvm-gcc-4.2/trunk/gcc/rtl.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/rtl.h?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/rtl.h (original) +++ llvm-gcc-4.2/trunk/gcc/rtl.h Tue Sep 2 17:20:12 2008 @@ -2143,6 +2143,8 @@ /* In function.c */ extern void reposition_prologue_and_epilogue_notes (rtx); extern void thread_prologue_and_epilogue_insns (rtx); + /* APPLE LOCAL async unwind info 5949350 */ +extern int epilogue_contains (rtx); extern int prologue_epilogue_contains (rtx); extern int sibcall_epilogue_contains (rtx); extern void mark_temp_addr_taken (rtx); Modified: llvm-gcc-4.2/trunk/gcc/stmt.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/stmt.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/stmt.c (original) +++ llvm-gcc-4.2/trunk/gcc/stmt.c Tue Sep 2 17:20:12 2008 @@ -1727,7 +1727,10 @@ store_bit_field (dst, bitsize, xbitpos % BITS_PER_WORD, word_mode, extract_bit_field (src, bitsize, bitpos % BITS_PER_WORD, 1, - NULL_RTX, word_mode, word_mode)); + /* APPLE LOCAL begin 6020402 */ + NULL_RTX, word_mode, word_mode), + NULL_TREE); + /* APPLE LOCAL end 6020402 */ } tmpmode = GET_MODE (result_rtl); Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/5596043.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/5596043.C?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/5596043.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/5596043.C Tue Sep 2 17:20:12 2008 @@ -1,6 +1,6 @@ /* APPLE LOCAL file radar 5591491 */ /* { dg-options "-O2" } */ -/* { dg-do run { target powerpc**-*-darwin* } } */ +/* { dg-do compile { target powerpc**-*-darwin* } } */ struct T { volatile unsigned int word; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-2.C?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-2.C Tue Sep 2 17:20:12 2008 @@ -1,6 +1,7 @@ /* APPLE LOCAL file 5932809 */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ +void _Block_byref_release(void*src){} #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-3.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/block-blocks-test-3.C?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-3.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/block-blocks-test-3.C Tue Sep 2 17:20:12 2008 @@ -1,6 +1,7 @@ /* APPLE LOCAL file 5932809 */ /* { dg-options "-fblocks" } */ /* { dg-do run } */ +void _Block_byref_release(void*src){} #include Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/kext-stackprotect-1.C?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-1.C Tue Sep 2 17:20:12 2008 @@ -1,6 +1,8 @@ /* APPLE LOCAL file stack-protector default 5095227 */ /* { dg-do compile { target powerpc*-*-darwin* } } */ /* { dg-options "-fapple-kext -mmacosx-version-min=10.6" } */ +/* { dg-skip-if "" { *-*-darwin* } { "-fstack-protector" } { "" } } */ +/* { dg-skip-if "" { *-*-darwin* } { "-fstack-protector-all" } { "" } } */ extern void f2(char *); void f1(void) { Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-2.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/kext-stackprotect-2.C?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-2.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/kext-stackprotect-2.C Tue Sep 2 17:20:12 2008 @@ -1,11 +1,13 @@ /* APPLE LOCAL file stack-protector default 5095227 */ /* { dg-do compile { target i?86*-*-darwin* } } */ -/* { dg-options "-fapple-kext" } */ +/* { dg-options "-fapple-kext -mmacosx-version-min=10.6" } */ +/* { dg-skip-if "" { *-*-darwin* } { "-fstack-protector" } { "" } } */ +/* { dg-skip-if "" { *-*-darwin* } { "-fstack-protector-all" } { "" } } */ extern void f2(char *); void f1(void) { char array[256]; f2(array); } -/* { dg-final { scan-assembler-not "__stack_chk_guard" } } */ -/* { dg-final { scan-assembler-not "__stack_chk_fail" } } */ +/* { dg-final { scan-assembler "__stack_chk_guard" } } */ +/* { dg-final { scan-assembler "__stack_chk_fail" } } */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inline-limit-1.C URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/inline-limit-1.C?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inline-limit-1.C (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/inline-limit-1.C Tue Sep 2 17:20:12 2008 @@ -11,22 +11,25 @@ but this testcase is expected to require revision every time the GCC inlining heuristics change. */ -extern void bulk (int); /* CALLs are assumed to generate 10 'estimated insns'. */ +/* CALLs with three int arguments and no return type are assumed to generate 5 + 'estimated insns'. */ +extern void bulk (int, int, int); /* Inlining limits for inline and non-inline functions are currently - identical for C++. Empirically, a body with one will be inlined, - and a body with two calls will not. */ + identical for C++. Empirically, a body with few instructions will be + inlined, and a body with several calls will not. */ void calleex1 (void) { - bulk (1); bulk (2); + bulk (1,1,1); bulk (2,1,1); bulk (3,1,1); bulk (4,1,1); + bulk (5,1,1); bulk (6,1,1); } -void inline +void inlinex1 (void) { - bulk (1); + bulk (1,4,2); } int Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.c-torture/execute/builtins/lib/sprintf.c Tue Sep 2 17:20:12 2008 @@ -4,7 +4,8 @@ extern int inside_main; int -sprintf (char *buf, const char *fmt, ...) +/* APPLE LOCAL radar 6112293 */ +(sprintf) (char *buf, const char *fmt, ...) { va_list ap; int r; Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/trad/include.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/trad/include.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/trad/include.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/cpp/trad/include.c Tue Sep 2 17:20:12 2008 @@ -5,5 +5,7 @@ /* { dg-do preprocess } */ #define __STDC__ 1 /* Stop complaints about non-ISO compilers. */ -#define stdio 1 -#include /* { dg-bogus "o such file or directory" } */ +/* APPLE LOCAL begin Radar 6112293 */ +#define errno 1 +#include /* { dg-bogus "o such file or directory" } */ +/* APPLE LOCAL end Radar 6112293 */ Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/20020616-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/20020616-1.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/20020616-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.target/i386/20020616-1.c Tue Sep 2 17:20:12 2008 @@ -1,5 +1,7 @@ /* PR opt/6722 */ /* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* APPLE LOCAL 5951276 */ +/* { dg-skip-if "" { i?86-apple-darwin* } } */ /* { dg-options "-O2" } */ register int k asm("%ebx"); Added: llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m?rev=55675&view=auto ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m (added) +++ llvm-gcc-4.2/trunk/gcc/testsuite/objc.dg/6128170.m Tue Sep 2 17:20:12 2008 @@ -0,0 +1,15 @@ +/* APPLE LOCAL file 6128170 */ +/* { dg-do compile { target i?86*-*-darwin* x86_64-*-darwin* } } */ +/* { dg-options { "-m64" } } */ +/* { dg-final { scan-assembler "GCC_except_table.*:\nLLSDA" } } */ +/* { dg-final { scan-assembler-not "GCC_except_table.*:\n\t.align" } } */ +#include +void test() +{ + @try { + [NSObject alloc]; + } + @catch (NSException* ex) { + [NSObject alloc]; + } +} Modified: llvm-gcc-4.2/trunk/gcc/tree.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/tree.h (original) +++ llvm-gcc-4.2/trunk/gcc/tree.h Tue Sep 2 17:20:12 2008 @@ -3070,7 +3070,9 @@ /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ unsigned copyable_byref_local_var : 1; unsigned copyable_byref_local_nonpod : 1; - /* 6 unused bits. */ + /* APPLE LOCAL radar 6172148 */ + unsigned block_synthesized_function : 1; + /* 5 unused bits. */ /* APPLE LOCAL end radar 5932809 - copyable byref blocks */ /* APPLE LOCAL end radar 5732232 - blocks */ }; @@ -3123,6 +3125,8 @@ #define BLOCK_DECL_BYREF(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_decl_byref) #define BLOCK_DECL_COPIED(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.block_decl_copied) /* APPLE LOCAL end radar 5732232 - blocks */ +/* APPLE LOCAL radar 6172148 */ +#define BLOCK_SYNTHESIZED_FUNC(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.block_synthesized_function) /* APPLE LOCAL begin radar 5932809 - copyable byref blocks */ #define COPYABLE_BYREF_LOCAL_VAR(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.copyable_byref_local_var) #define COPYABLE_BYREF_LOCAL_NONPOD(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.copyable_byref_local_nonpod) @@ -4850,6 +4854,6 @@ /* APPLE LOCAL end CW asm blocks */ /* APPLE LOCAL radar 6113240 */ -extern tree invoke_impl_ptr_type; +extern GTY(()) tree invoke_impl_ptr_type; #endif /* GCC_TREE_H */ Modified: llvm-gcc-4.2/trunk/gcc/varasm.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/varasm.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/varasm.c (original) +++ llvm-gcc-4.2/trunk/gcc/varasm.c Tue Sep 2 17:20:12 2008 @@ -4243,6 +4243,8 @@ case ENUMERAL_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: + /* APPLE LOCAL radar 5822844 */ + case BLOCK_POINTER_TYPE: case OFFSET_TYPE: if (! assemble_integer (expand_expr (exp, NULL_RTX, VOIDmode, EXPAND_INITIALIZER), Modified: llvm-gcc-4.2/trunk/gcc/version.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/version.c?rev=55675&r1=55674&r2=55675&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/version.c (original) +++ llvm-gcc-4.2/trunk/gcc/version.c Tue Sep 2 17:20:12 2008 @@ -11,12 +11,12 @@ /* APPLE LOCAL begin Apple version */ #ifdef ENABLE_LLVM #ifdef LLVM_VERSION_INFO -#define VERSUFFIX " (Based on Apple Inc. build 5617) (LLVM build " LLVM_VERSION_INFO ")" +#define VERSUFFIX " (Based on Apple Inc. build 5620) (LLVM build " LLVM_VERSION_INFO ")" #else -#define VERSUFFIX " (Based on Apple Inc. build 5617) (LLVM build)" +#define VERSUFFIX " (Based on Apple Inc. build 5620) (LLVM build)" #endif #else -#define VERSUFFIX " (Based on Apple Inc. build 5617)" +#define VERSUFFIX " (Based on Apple Inc. build 5620)" #endif /* APPLE LOCAL end Apple version */ From dpatel at apple.com Tue Sep 2 17:43:57 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 02 Sep 2008 22:43:57 -0000 Subject: [llvm-commits] [llvm] r55676 - in /llvm/trunk: include/llvm/Function.h lib/AsmParser/llvmAsmParser.cpp.cvs lib/AsmParser/llvmAsmParser.y lib/AsmParser/llvmAsmParser.y.cvs lib/Transforms/IPO/Inliner.cpp lib/VMCore/AsmWriter.cpp Message-ID: <200809022243.m82MhvRj022454@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 17:43:57 2008 New Revision: 55676 URL: http://llvm.org/viewvc/llvm-project?rev=55676&view=rev Log: s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g Modified: llvm/trunk/include/llvm/Function.h llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs llvm/trunk/lib/Transforms/IPO/Inliner.cpp llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/include/llvm/Function.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=55676&r1=55675&r2=55676&view=diff ============================================================================== --- llvm/trunk/include/llvm/Function.h (original) +++ llvm/trunk/include/llvm/Function.h Tue Sep 2 17:43:57 2008 @@ -52,10 +52,10 @@ }; typedef unsigned FunctionNotes; -const FunctionNotes FP_None = 0; -const FunctionNotes FP_NoInline = 1<<0; -const FunctionNotes FP_AlwaysInline = 1<<1; -const FunctionNotes FP_OptimizeForSize = 1<<2; +const FunctionNotes FN_NOTE_None = 0; +const FunctionNotes FN_NOTE_NoInline = 1<<0; +const FunctionNotes FN_NOTE_AlwaysInline = 1<<1; +const FunctionNotes FN_NOTE_OptimizeForSize = 1<<2; class Function : public GlobalValue, public Annotable, public ilist_node { @@ -155,13 +155,13 @@ /// void setParamAttrs(const PAListPtr &attrs) { ParamAttrs = attrs; } - /// getNotes - Return this function properties + /// getNotes - Return function notes /// const FunctionNotes &getNotes() const { return Notes; } - /// setNotes - Set properties for this function + /// setNotes - Set notes for this function /// - void setNotes(const FunctionNotes P) { Notes = P;} + void setNotes(const FunctionNotes P) { Notes = Notes | P;} /// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm /// to use during code generation. Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=55676&r1=55675&r2=55676&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Sep 2 17:43:57 2008 @@ -4125,9 +4125,9 @@ #line 1298 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" { FunctionNotes tmp = (yyvsp[(1) - (3)].FunctionNotes) | (yyvsp[(3) - (3)].FunctionNotes); - if ((yyvsp[(3) - (3)].FunctionNotes) == FP_NoInline && ((yyvsp[(1) - (3)].FunctionNotes) & FP_AlwaysInline)) + if ((yyvsp[(3) - (3)].FunctionNotes) == FN_NOTE_NoInline && ((yyvsp[(1) - (3)].FunctionNotes) & FN_NOTE_AlwaysInline)) GEN_ERROR("Function Notes may include only one inline notes!") - if ((yyvsp[(3) - (3)].FunctionNotes) == FP_AlwaysInline && ((yyvsp[(1) - (3)].FunctionNotes) & FP_NoInline)) + if ((yyvsp[(3) - (3)].FunctionNotes) == FN_NOTE_AlwaysInline && ((yyvsp[(1) - (3)].FunctionNotes) & FN_NOTE_NoInline)) GEN_ERROR("Function Notes may include only one inline notes!") (yyval.FunctionNotes) = tmp; CHECK_FOR_ERROR @@ -4136,22 +4136,22 @@ case 130: #line 1309 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FunctionNotes) = FP_NoInline; ;} + { (yyval.FunctionNotes) = FN_NOTE_NoInline; ;} break; case 131: #line 1310 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FunctionNotes) = FP_AlwaysInline; ;} + { (yyval.FunctionNotes) = FN_NOTE_AlwaysInline; ;} break; case 132: #line 1311 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FunctionNotes) = FP_OptimizeForSize; ;} + { (yyval.FunctionNotes) = FN_NOTE_OptimizeForSize; ;} break; case 133: #line 1314 "/Volumes/Nanpura/fn_prop/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FunctionNotes) = FP_None; ;} + { (yyval.FunctionNotes) = FN_NOTE_None; ;} break; case 134: Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=55676&r1=55675&r2=55676&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Tue Sep 2 17:43:57 2008 @@ -1297,21 +1297,21 @@ FuncNoteList : FuncNote { $$ = $1; } | FuncNoteList ',' FuncNote { FunctionNotes tmp = $1 | $3; - if ($3 == FP_NoInline && ($1 & FP_AlwaysInline)) + if ($3 == FN_NOTE_NoInline && ($1 & FN_NOTE_AlwaysInline)) GEN_ERROR("Function Notes may include only one inline notes!") - if ($3 == FP_AlwaysInline && ($1 & FP_NoInline)) + if ($3 == FN_NOTE_AlwaysInline && ($1 & FN_NOTE_NoInline)) GEN_ERROR("Function Notes may include only one inline notes!") $$ = tmp; CHECK_FOR_ERROR } ; -FuncNote : INLINE '=' NEVER { $$ = FP_NoInline; } - | INLINE '=' ALWAYS { $$ = FP_AlwaysInline; } - | OPTIMIZEFORSIZE { $$ = FP_OptimizeForSize; } +FuncNote : INLINE '=' NEVER { $$ = FN_NOTE_NoInline; } + | INLINE '=' ALWAYS { $$ = FN_NOTE_AlwaysInline; } + | OPTIMIZEFORSIZE { $$ = FN_NOTE_OptimizeForSize; } ; -OptFuncNotes : /* empty */ { $$ = FP_None; } +OptFuncNotes : /* empty */ { $$ = FN_NOTE_None; } | FNNOTE '(' FuncNoteList ')' { $$ = $3; } Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=55676&r1=55675&r2=55676&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Tue Sep 2 17:43:57 2008 @@ -1297,21 +1297,21 @@ FuncNoteList : FuncNote { $$ = $1; } | FuncNoteList ',' FuncNote { FunctionNotes tmp = $1 | $3; - if ($3 == FP_NoInline && ($1 & FP_AlwaysInline)) + if ($3 == FN_NOTE_NoInline && ($1 & FN_NOTE_AlwaysInline)) GEN_ERROR("Function Notes may include only one inline notes!") - if ($3 == FP_AlwaysInline && ($1 & FP_NoInline)) + if ($3 == FN_NOTE_AlwaysInline && ($1 & FN_NOTE_NoInline)) GEN_ERROR("Function Notes may include only one inline notes!") $$ = tmp; CHECK_FOR_ERROR } ; -FuncNote : INLINE '=' NEVER { $$ = FP_NoInline; } - | INLINE '=' ALWAYS { $$ = FP_AlwaysInline; } - | OPTIMIZEFORSIZE { $$ = FP_OptimizeForSize; } +FuncNote : INLINE '=' NEVER { $$ = FN_NOTE_NoInline; } + | INLINE '=' ALWAYS { $$ = FN_NOTE_AlwaysInline; } + | OPTIMIZEFORSIZE { $$ = FN_NOTE_OptimizeForSize; } ; -OptFuncNotes : /* empty */ { $$ = FP_None; } +OptFuncNotes : /* empty */ { $$ = FN_NOTE_None; } | FNNOTE '(' FuncNoteList ')' { $$ = $3; } Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=55676&r1=55675&r2=55676&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Tue Sep 2 17:43:57 2008 @@ -142,9 +142,9 @@ Function *Fn = CS.getCalledFunction(); bool AlwaysInline = false; - if (Fn && (Fn->getNotes() & FP_AlwaysInline)) + if (Fn && (Fn->getNotes() & FN_NOTE_AlwaysInline)) AlwaysInline = true; - if (Fn && (Fn->getNotes() & FP_NoInline)) + if (Fn && (Fn->getNotes() & FN_NOTE_NoInline)) DOUT << "NOT Inlining: inline=never is set" << *CS.getInstruction(); else if (!AlwaysInline && InlineCost >= (int)(InlineThreshold * FudgeFactor)) { Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=55676&r1=55675&r2=55676&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Tue Sep 2 17:43:57 2008 @@ -1396,11 +1396,11 @@ if (F->hasGC()) Out << " gc \"" << F->getGC() << '"'; FunctionNotes FNotes = F->getNotes(); - if (FNotes != FP_None) { + if (FNotes != FN_NOTE_None) { Out << " notes("; - if (FNotes & FP_AlwaysInline) + if (FNotes & FN_NOTE_AlwaysInline) Out << "inline=always"; - else if (FNotes & FP_NoInline) + else if (FNotes & FN_NOTE_NoInline) Out << "inline=never"; Out << ")"; } From gohman at apple.com Tue Sep 2 18:07:56 2008 From: gohman at apple.com (Dan Gohman) Date: Tue, 2 Sep 2008 16:07:56 -0700 Subject: [llvm-commits] [llvm] r55674 - in /llvm/trunk: lib/Transforms/Scalar/LoopStrengthReduce.cpp test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll In-Reply-To: <200809022218.m82MI83R021674@zion.cs.uiuc.edu> References: <200809022218.m82MI83R021674@zion.cs.uiuc.edu> Message-ID: On Sep 2, 2008, at 3:18 PM, Devang Patel wrote: > Author: dpatel > Date: Tue Sep 2 17:18:08 2008 > New Revision: 55674 > > URL: http://llvm.org/viewvc/llvm-project?rev=55674&view=rev > Log: > If all IV uses are extending integer IV then change the type of IV > itself, if possible. Hi Devang, Wouldn't it be better to do this transformation in IndVarSimplify, rather than in LoopStrengthReduce? It seems that this transformation simplifies loops, and makes it possible to compute trip counts in more cases, which would be beneficial to many passes. This code doesn't appear to handle integer wraparound correctly. At least, I didn't see anything that checked the trip count, or even the induction variable comparison. Am I missing something? > + for (Value::use_iterator UI = PHI->use_begin(), > + UE = PHI->use_end(); UI != UE; ++UI) { > + Instruction *Use = dyn_cast(*UI); > + if (!Use) { > + TransformPhi = false; > + break; > + } The users of an instruction are always instructions, so you can use cast instead of dyn_cast here, and skip the if. > + for (Value::use_iterator IncUI = Incr->use_begin(), > + IncUE = Incr->use_end(); IncUI != IncUE; ++IncUI) { > + > + Instruction *U2 = dyn_cast(*IncUI); Ditto. > + ConstantInt *C = NULL; > + if (Incr->getOperand(0) == PHI) > + C = dyn_cast(Incr->getOperand(1)); > + else if (Incr->getOperand(1) == PHI) > + C = dyn_cast(Incr->getOperand(0)); This code is essentially doing add-hoc scalar-evolution analysis, and at a brief readthrough, I didn't find code to verify that it's doing so correctly. In the code above, it doesn't verify that the add's user is in fact the same PHI that it's using. LSR and IndVars are both already ScalarEvolution clients. Could you replace this ad-hoc analysis by using the real ScalarEvolution analysis here? > > + if (!TransformPhi || Incr == false || PHIUses.empty()) > + continue; Incr is a BinaryOperator*, so it shouldn't be compared with false. Dan From dpatel at apple.com Tue Sep 2 18:43:25 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 2 Sep 2008 16:43:25 -0700 Subject: [llvm-commits] [llvm] r55674 - in /llvm/trunk: lib/Transforms/Scalar/LoopStrengthReduce.cpp test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll In-Reply-To: References: <200809022218.m82MI83R021674@zion.cs.uiuc.edu> Message-ID: <2FADDA23-9CB2-4A33-A0F0-34678CF21515@apple.com> On Sep 2, 2008, at 4:07 PM, Dan Gohman wrote: > > On Sep 2, 2008, at 3:18 PM, Devang Patel wrote: > >> Author: dpatel >> Date: Tue Sep 2 17:18:08 2008 >> New Revision: 55674 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=55674&view=rev >> Log: >> If all IV uses are extending integer IV then change the type of IV >> itself, if possible. > > Hi Devang, > > Wouldn't it be better to do this transformation in IndVarSimplify, > rather than in LoopStrengthReduce? It seems that this transformation > simplifies loops, and makes it possible to compute trip counts in > more cases, which would be beneficial to many passes. Good idea. I was toying with the idea to make a separate little pass, but IndVarSimplify is a good fit. > This code doesn't appear to handle integer wraparound correctly. At > least, I didn't see anything that checked the trip count, or even > the induction variable comparison. Am I missing something? Nope. During restructuring, I accidently lost the check. >> + for (Value::use_iterator UI = PHI->use_begin(), >> + UE = PHI->use_end(); UI != UE; ++UI) { >> + Instruction *Use = dyn_cast(*UI); >> + if (!Use) { >> + TransformPhi = false; >> + break; >> + } > > The users of an instruction are always instructions, so you can > use cast instead of dyn_cast here, and skip the if. > >> + for (Value::use_iterator IncUI = Incr->use_begin(), >> + IncUE = Incr->use_end(); IncUI != IncUE; ++IncUI) { >> + >> + Instruction *U2 = dyn_cast(*IncUI); > > Ditto. ok > > >> + ConstantInt *C = NULL; >> + if (Incr->getOperand(0) == PHI) >> + C = dyn_cast(Incr->getOperand(1)); >> + else if (Incr->getOperand(1) == PHI) >> + C = dyn_cast(Incr->getOperand(0)); > > This code is essentially doing add-hoc scalar-evolution analysis, and > at a brief readthrough, I didn't find code to verify that it's doing > so correctly. In the code above, it doesn't verify that the add's user > is in fact the same PHI that it's using. LSR and IndVars are both > already ScalarEvolution clients. Could you replace this ad-hoc > analysis by using the real ScalarEvolution analysis here? ok :) >> + if (!TransformPhi || Incr == false || PHIUses.empty()) >> + continue; > > Incr is a BinaryOperator*, so it shouldn't be compared with false. Yup. I'll fix these issues. Thanks, - Devang From dalej at apple.com Tue Sep 2 18:44:14 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 02 Sep 2008 23:44:14 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55677 - /llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Message-ID: <200809022344.m82NiE8u024196@zion.cs.uiuc.edu> Author: johannes Date: Tue Sep 2 18:44:13 2008 New Revision: 55677 URL: http://llvm.org/viewvc/llvm-project?rev=55677&view=rev Log: Fix visibility in ObjC at -O0. When redoing type and/or initialization late, after the symbol has changed, we need to consider visibility also. Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=55677&r1=55676&r2=55677&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Tue Sep 2 18:44:13 2008 @@ -895,6 +895,9 @@ // Get or create the global variable now. GlobalVariable *GV = cast(DECL_LLVM(decl)); + // Visibility may also have changed. + handleVisibility(decl, GV); + // Convert the initializer over. Constant *Init = TreeConstantToLLVM::Convert(DECL_INITIAL(decl)); @@ -915,6 +918,9 @@ // Get or create the global variable now. GlobalVariable *GV = cast(DECL_LLVM(decl)); + // Visibility may also have changed. + handleVisibility(decl, GV); + // Temporary to avoid infinite recursion (see comments emit_global_to_llvm) GV->setInitializer(UndefValue::get(GV->getType()->getElementType())); From dpatel at apple.com Tue Sep 2 19:02:43 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 03 Sep 2008 00:02:43 -0000 Subject: [llvm-commits] [llvm] r55678 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200809030002.m8302hGX024835@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 19:02:42 2008 New Revision: 55678 URL: http://llvm.org/viewvc/llvm-project?rev=55678&view=rev Log: While removing PHI, use basicblock to identify incoming value. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=55678&r1=55677&r2=55678&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Sep 2 19:02:42 2008 @@ -1909,6 +1909,7 @@ void LoopStrengthReduce::OptimizeIVType(Loop *L) { BasicBlock *LPH = L->getLoopPreheader(); + BasicBlock *LatchBB = L->getLoopLatch(); SmallVector PHIs; for (BasicBlock::iterator BI = L->getHeader()->begin(), BE = L->getHeader()->end(); BI != BE; ++BI) { @@ -2000,8 +2001,8 @@ // Remove old PHI and increment instruction. SE->deleteValueFromRecords(PHI); - PHI->removeIncomingValue(Entry); - PHI->removeIncomingValue(Latch); + PHI->removeIncomingValue(LatchBB); + PHI->removeIncomingValue(LPH); SE->deleteValueFromRecords(Incr); Incr->eraseFromParent(); } From evan.cheng at apple.com Tue Sep 2 19:03:49 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 03 Sep 2008 00:03:49 -0000 Subject: [llvm-commits] [llvm] r55679 - in /llvm/trunk: lib/Target/X86/X86FastISel.cpp lib/Target/X86/X86FastISel.h lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h utils/TableGen/FastISelEmitter.cpp Message-ID: <200809030003.m8303nvj024887@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 2 19:03:49 2008 New Revision: 55679 URL: http://llvm.org/viewvc/llvm-project?rev=55679&view=rev Log: Let tblgen only generate fastisel routines, not the class definition. This makes it easier for targets to define its own fastisel class. Removed: llvm/trunk/lib/Target/X86/X86FastISel.h Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/utils/TableGen/FastISelEmitter.cpp Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=55679&r1=55678&r2=55679&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Tue Sep 2 19:03:49 2008 @@ -16,17 +16,31 @@ #include "X86.h" #include "X86RegisterInfo.h" #include "X86ISelLowering.h" -#include "X86FastISel.h" #include "X86TargetMachine.h" +#include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/MachineRegisterInfo.h" -#include "X86GenFastISel.inc" -namespace llvm { +using namespace llvm; -namespace X86 { +class X86FastISel : public FastISel { + /// Subtarget - Keep a pointer to the X86Subtarget around so that we can + /// make the right decision when generating code for different targets. + const X86Subtarget *Subtarget; + + public: + explicit X86FastISel(MachineFunction &mf) : FastISel(mf) {} + + virtual bool + TargetSelectInstruction(Instruction *I, + DenseMap &ValueMap, + DenseMap &MBBMap, + MachineBasicBlock *MBB); + +#include "X86GenFastISel.inc" +}; bool -FastISel::TargetSelectInstruction(Instruction *I, +X86FastISel::TargetSelectInstruction(Instruction *I, DenseMap &ValueMap, DenseMap &MBBMap, MachineBasicBlock *MBB) { @@ -37,6 +51,8 @@ return false; } -} - +namespace llvm { + llvm::FastISel *X86::createFastISel(MachineFunction &mf) { + return new X86FastISel(mf); + } } Removed: llvm/trunk/lib/Target/X86/X86FastISel.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.h?rev=55678&view=auto ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.h (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.h (removed) @@ -1,31 +0,0 @@ -//===-- X86FastISel.h - X86 FastISel header -------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the interface to the X86-specific support for the FastISel -// class. -// -//===----------------------------------------------------------------------===// - -#ifndef X86FASTISEL_H -#define X86FASTISEL_H - -namespace llvm { - -class FastISel; -class MachineFunction; - -namespace X86 { - -FastISel *createFastISel(MachineFunction &mf); - -} // namespace X86 - -} // namespace llvm - -#endif Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=55679&r1=55678&r2=55679&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Sep 2 19:03:49 2008 @@ -17,7 +17,6 @@ #include "X86ISelLowering.h" #include "X86MachineFunctionInfo.h" #include "X86TargetMachine.h" -#include "X86FastISel.h" #include "llvm/CallingConv.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=55679&r1=55678&r2=55679&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Tue Sep 2 19:03:49 2008 @@ -19,6 +19,7 @@ #include "X86RegisterInfo.h" #include "X86MachineFunctionInfo.h" #include "llvm/Target/TargetLowering.h" +#include "llvm/CodeGen/FastIsel.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/CallingConvLower.h" @@ -595,6 +596,10 @@ MachineBasicBlock *BB, unsigned cmovOpc); }; + + namespace X86 { + FastISel *createFastISel(MachineFunction &mf); + } } #endif // X86ISELLOWERING_H Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=55679&r1=55678&r2=55679&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Tue Sep 2 19:03:49 2008 @@ -352,89 +352,6 @@ } } -void FastISelMap::PrintClass(std::ostream &OS) { - // Declare the target FastISel class. - OS << "class FastISel : public llvm::FastISel {\n"; - for (OperandsOpcodeTypeRetPredMap::const_iterator OI = SimplePatterns.begin(), - OE = SimplePatterns.end(); OI != OE; ++OI) { - const OperandsSignature &Operands = OI->first; - const OpcodeTypeRetPredMap &OTM = OI->second; - - for (OpcodeTypeRetPredMap::const_iterator I = OTM.begin(), E = OTM.end(); - I != E; ++I) { - const std::string &Opcode = I->first; - const TypeRetPredMap &TM = I->second; - - for (TypeRetPredMap::const_iterator TI = TM.begin(), TE = TM.end(); - TI != TE; ++TI) { - MVT::SimpleValueType VT = TI->first; - const RetPredMap &RM = TI->second; - - if (RM.size() != 1) - for (RetPredMap::const_iterator RI = RM.begin(), RE = RM.end(); - RI != RE; ++RI) { - MVT::SimpleValueType RetVT = RI->first; - OS << " unsigned FastEmit_" << getLegalCName(Opcode) - << "_" << getLegalCName(getName(VT)) << "_" - << getLegalCName(getName(RetVT)) << "_"; - Operands.PrintManglingSuffix(OS); - OS << "("; - Operands.PrintParameters(OS); - OS << ");\n"; - } - - OS << " unsigned FastEmit_" << getLegalCName(Opcode) - << "_" << getLegalCName(getName(VT)) << "_"; - Operands.PrintManglingSuffix(OS); - OS << "(MVT::SimpleValueType RetVT"; - if (!Operands.empty()) - OS << ", "; - Operands.PrintParameters(OS); - OS << ");\n"; - } - - OS << " unsigned FastEmit_" << getLegalCName(Opcode) << "_"; - Operands.PrintManglingSuffix(OS); - OS << "(MVT::SimpleValueType VT, MVT::SimpleValueType RetVT"; - if (!Operands.empty()) - OS << ", "; - Operands.PrintParameters(OS); - OS << ");\n"; - } - - OS << " unsigned FastEmit_"; - Operands.PrintManglingSuffix(OS); - OS << "(MVT::SimpleValueType VT, MVT::SimpleValueType RetVT, ISD::NodeType Opcode"; - if (!Operands.empty()) - OS << ", "; - Operands.PrintParameters(OS); - OS << ");\n"; - } - OS << "\n"; - - OS << "bool TargetSelectInstruction(Instruction *I,\n"; - OS << " " - "DenseMap &ValueMap,\n"; - OS << " " - "DenseMap &MBBMap,\n"; - OS << " " - "MachineBasicBlock *MBB);\n"; - - // Declare the Subtarget member, which is used for predicate checks. - OS << " const " << InstNS.substr(0, InstNS.size() - 2) - << "Subtarget *Subtarget;\n"; - OS << "\n"; - - // Declare the constructor. - OS << "public:\n"; - OS << " explicit FastISel(MachineFunction &mf)\n"; - OS << " : llvm::FastISel(mf),\n"; - OS << " Subtarget(&TM.getSubtarget<" << InstNS.substr(0, InstNS.size() - 2) - << "Subtarget>()) {}\n"; - OS << "};\n"; - OS << "\n"; -} - void FastISelMap::PrintFunctionDefinitions(std::ostream &OS) { // Now emit code for all the patterns that we collected. for (OperandsOpcodeTypeRetPredMap::const_iterator OI = SimplePatterns.begin(), @@ -462,7 +379,7 @@ const PredMap &PM = RI->second; bool HasPred = false; - OS << "unsigned FastISel::FastEmit_" + OS << "unsigned FastEmit_" << getLegalCName(Opcode) << "_" << getLegalCName(getName(VT)) << "_" << getLegalCName(getName(RetVT)) << "_"; @@ -524,7 +441,7 @@ } // Emit one function for the type that demultiplexes on return type. - OS << "unsigned FastISel::FastEmit_" + OS << "unsigned FastEmit_" << getLegalCName(Opcode) << "_" << getLegalCName(getName(VT)) << "_"; Operands.PrintManglingSuffix(OS); @@ -548,7 +465,7 @@ } else { // Non-variadic return type. - OS << "unsigned FastISel::FastEmit_" + OS << "unsigned FastEmit_" << getLegalCName(Opcode) << "_" << getLegalCName(getName(VT)) << "_"; Operands.PrintManglingSuffix(OS); @@ -618,7 +535,7 @@ } // Emit one function for the opcode that demultiplexes based on the type. - OS << "unsigned FastISel::FastEmit_" + OS << "unsigned FastEmit_" << getLegalCName(Opcode) << "_"; Operands.PrintManglingSuffix(OS); OS << "(MVT::SimpleValueType VT, MVT::SimpleValueType RetVT"; @@ -651,7 +568,7 @@ // Emit one function for the operand signature that demultiplexes based // on opcode and type. - OS << "unsigned FastISel::FastEmit_"; + OS << "unsigned FastEmit_"; Operands.PrintManglingSuffix(OS); OS << "(MVT::SimpleValueType VT, MVT::SimpleValueType RetVT, ISD::NodeType Opcode"; if (!Operands.empty()) @@ -689,27 +606,9 @@ EmitSourceFileHeader("\"Fast\" Instruction Selector for the " + Target.getName() + " target", OS); - OS << "#include \"llvm/CodeGen/FastISel.h\"\n"; - OS << "\n"; - OS << "namespace llvm {\n"; - OS << "\n"; - OS << "namespace " << InstNS.substr(0, InstNS.size() - 2) << " {\n"; - OS << "\n"; - FastISelMap F(InstNS); F.CollectPatterns(CGP); - F.PrintClass(OS); F.PrintFunctionDefinitions(OS); - - // Define the target FastISel creation function. - OS << "llvm::FastISel *createFastISel(MachineFunction &mf) {\n"; - OS << " return new FastISel(mf);\n"; - OS << "}\n"; - OS << "\n"; - - OS << "} // namespace X86\n"; - OS << "\n"; - OS << "} // namespace llvm\n"; } FastISelEmitter::FastISelEmitter(RecordKeeper &R) From dpatel at apple.com Tue Sep 2 19:10:56 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 03 Sep 2008 00:10:56 -0000 Subject: [llvm-commits] [llvm] r55680 - in /llvm/trunk: lib/Transforms/Scalar/LoopStrengthReduce.cpp test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Message-ID: <200809030010.m830Au7a025109@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 19:10:56 2008 New Revision: 55680 URL: http://llvm.org/viewvc/llvm-project?rev=55680&view=rev Log: Check iteration count. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=55680&r1=55679&r2=55680&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Sep 2 19:10:56 2008 @@ -1908,6 +1908,10 @@ /// change the type of IV, if possible. void LoopStrengthReduce::OptimizeIVType(Loop *L) { + SCEVHandle IterationCount = SE->getIterationCount(L); + if (isa(IterationCount)) + return; + BasicBlock *LPH = L->getLoopPreheader(); BasicBlock *LatchBB = L->getLoopLatch(); SmallVector PHIs; Modified: llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll?rev=55680&r1=55679&r2=55680&view=diff ============================================================================== --- llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll (original) +++ llvm/trunk/test/Transforms/LoopStrengthReduce/2008-09-02-IVType.ll Tue Sep 2 19:10:56 2008 @@ -49,7 +49,7 @@ store i16* %theDCTBufferIter.0.lcssa, i16** %tmp6, align 4 %tmp37 = add i16 %component.09, 1 ; [#uses=2] %phitmp15 = sext i16 %tmp37 to i32 ; [#uses=1] - %tmp46 = icmp slt i32 %phitmp15, %tmp4412 ; [#uses=1] + %tmp46 = icmp slt i32 %phitmp15, 42 ; [#uses=1] br i1 %tmp46, label %bb, label %bb49 bb49: ; preds = %bb28, %entry From dpatel at apple.com Tue Sep 2 19:29:13 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 03 Sep 2008 00:29:13 -0000 Subject: [llvm-commits] [llvm] r55682 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Message-ID: <200809030029.m830TDnn025663@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 19:29:13 2008 New Revision: 55682 URL: http://llvm.org/viewvc/llvm-project?rev=55682&view=rev Log: Add additional check to ensure that iv is canonicalized. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=55682&r1=55681&r2=55682&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Sep 2 19:29:13 2008 @@ -1935,6 +1935,7 @@ ConstantInt *CInit = dyn_cast(PHI->getIncomingValue(Entry)); if (!CInit) return; + if (!CInit->isZero()) return; bool signedInit = CInit->getValue().isNegative(); From dpatel at apple.com Tue Sep 2 19:30:09 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 03 Sep 2008 00:30:09 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55683 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200809030030.m830UAow025707@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 19:30:09 2008 New Revision: 55683 URL: http://llvm.org/viewvc/llvm-project?rev=55683&view=rev Log: Use function notes to encode attribute noinline. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=55683&r1=55682&r2=55683&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Sep 2 19:30:09 2008 @@ -651,12 +651,15 @@ AttributeUsedGlobals.insert(Fn); // Handle noinline Functions - if (lookup_attribute ("noinline", DECL_ATTRIBUTES (FnDecl))) { + if (lookup_attribute ("noinline", DECL_ATTRIBUTES (FnDecl))) + Fn->setNotes(FN_NOTE_NoInline); + /* FIXME: Remove llvm.noinline related code. + { const Type *SBP= PointerType::getUnqual(Type::Int8Ty); AttributeNoinlineFunctions.push_back( Builder.getFolder().CreateBitCast(Fn, SBP) ); - } + }*/ // Handle annotate attributes if (DECL_ATTRIBUTES(FnDecl)) From dpatel at apple.com Tue Sep 2 19:33:57 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 03 Sep 2008 00:33:57 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r55684 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200809030033.m830XveR025811@zion.cs.uiuc.edu> Author: dpatel Date: Tue Sep 2 19:33:57 2008 New Revision: 55684 URL: http://llvm.org/viewvc/llvm-project?rev=55684&view=rev Log: encode always_inline as a function note. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=55684&r1=55683&r2=55684&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Sep 2 19:33:57 2008 @@ -660,7 +660,11 @@ Builder.getFolder().CreateBitCast(Fn, SBP) ); }*/ - + + // Handle always_inline attribute + if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (FnDecl))) + Fn->setNotes(FN_NOTE_AlwaysInline); + // Handle annotate attributes if (DECL_ATTRIBUTES(FnDecl)) AddAnnotateAttrsToGlobal(Fn, FnDecl); From evan.cheng at apple.com Tue Sep 2 20:04:47 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 03 Sep 2008 01:04:47 -0000 Subject: [llvm-commits] [llvm] r55685 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp Message-ID: <200809030104.m8314lOs026712@zion.cs.uiuc.edu> Author: evancheng Date: Tue Sep 2 20:04:47 2008 New Revision: 55685 URL: http://llvm.org/viewvc/llvm-project?rev=55685&view=rev Log: Unbreak fast isel. Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=55685&r1=55684&r2=55685&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Tue Sep 2 20:04:47 2008 @@ -14,8 +14,9 @@ //===----------------------------------------------------------------------===// #include "X86.h" -#include "X86RegisterInfo.h" #include "X86ISelLowering.h" +#include "X86RegisterInfo.h" +#include "X86Subtarget.h" #include "X86TargetMachine.h" #include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -28,7 +29,9 @@ const X86Subtarget *Subtarget; public: - explicit X86FastISel(MachineFunction &mf) : FastISel(mf) {} + explicit X86FastISel(MachineFunction &mf) : FastISel(mf) { + Subtarget = &TM.getSubtarget(); + } virtual bool TargetSelectInstruction(Instruction *I, From kremenek at apple.com Tue Sep 2 21:54:11 2008 From: kremenek at apple.com (Ted Kremenek) Date: Wed, 03 Sep 2008 02:54:11 -0000 Subject: [llvm-commits] [llvm] r55687 - /llvm/trunk/lib/Target/X86/X86ISelLowering.h Message-ID: <200809030254.m832sB22029963@zion.cs.uiuc.edu> Author: kremenek Date: Tue Sep 2 21:54:11 2008 New Revision: 55687 URL: http://llvm.org/viewvc/llvm-project?rev=55687&view=rev Log: Fix capitalization in #include of FastISel.h. This unbreaks the build on case-sensitive filesystems. Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=55687&r1=55686&r2=55687&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Tue Sep 2 21:54:11 2008 @@ -19,7 +19,7 @@ #include "X86RegisterInfo.h" #include "X86MachineFunctionInfo.h" #include "llvm/Target/TargetLowering.h" -#include "llvm/CodeGen/FastIsel.h" +#include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/CallingConvLower.h" From nicholas at mxc.ca Wed Sep 3 00:54:33 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 03 Sep 2008 05:54:33 -0000 Subject: [llvm-commits] [llvm] r55689 - in /llvm/trunk: lib/VMCore/ConstantFold.cpp test/Transforms/InstCombine/2008-09-02-VectorCrash.ll Message-ID: <200809030554.m835sYlA002881@zion.cs.uiuc.edu> Author: nicholas Date: Wed Sep 3 00:54:33 2008 New Revision: 55689 URL: http://llvm.org/viewvc/llvm-project?rev=55689&view=rev Log: Don't crash when trying to constant fold a vector with some elements that can't be folded. Instead, fail to fold the entire vector. We could also return a vector with some elements folded and some not. If anyone thinks that's a better approach, please speak up! Added: llvm/trunk/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp Modified: llvm/trunk/lib/VMCore/ConstantFold.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ConstantFold.cpp?rev=55689&r1=55688&r2=55689&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/ConstantFold.cpp (original) +++ llvm/trunk/lib/VMCore/ConstantFold.cpp Wed Sep 3 00:54:33 2008 @@ -238,9 +238,12 @@ std::vector res; const VectorType *DestVecTy = cast(DestTy); const Type *DstEltTy = DestVecTy->getElementType(); - for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i) - res.push_back(ConstantFoldCastInstruction(opc, V->getOperand(i), - DstEltTy)); + for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i) { + Constant *C = ConstantFoldCastInstruction(opc, CV->getOperand(i), + DstEltTy); + if (!C) return 0; // Can't fold operand. + res.push_back(C); + } return ConstantVector::get(DestVecTy, res); } return 0; // Can't fold. @@ -268,9 +271,12 @@ std::vector res; const VectorType *DestVecTy = cast(DestTy); const Type *DstEltTy = DestVecTy->getElementType(); - for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i) - res.push_back(ConstantFoldCastInstruction(opc, V->getOperand(i), - DstEltTy)); + for (unsigned i = 0, e = CV->getType()->getNumElements(); i != e; ++i) { + Constant *C = ConstantFoldCastInstruction(opc, CV->getOperand(i), + DstEltTy); + if (!C) return 0; // Can't fold operand. + res.push_back(C); + } return ConstantVector::get(DestVecTy, res); } return 0; Added: llvm/trunk/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll?rev=55689&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/2008-09-02-VectorCrash.ll Wed Sep 3 00:54:33 2008 @@ -0,0 +1,27 @@ +; RUN: llvm-as < %s | opt -instcombine + +define void @entry(i32 %m_task_id, i32 %start_x, i32 %end_x, i32 %start_y, i32 %end_y) { + br label %1 + +;